my-portfolio/dist/editor/js/CKEditor/ckeditor.js.map

1 line
6.4 MiB
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"version":3,"file":"ckeditor.js","mappings":";;;;;AAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAuB,cAAID,IAE3BD,EAAoB,cAAIC,GACzB,CATD,CASGK,MAAM,IACT,M,sBCRA,MAAMC,EAAc,EAAQ,MAMtBC,EAAkB,CAAC,EACzB,IAAK,MAAMC,KAAOC,OAAOC,KAAKJ,GAC7BC,EAAgBD,EAAYE,IAAQA,EAGrC,MAAMG,EAAU,CACfC,IAAK,CAACC,SAAU,EAAGC,OAAQ,OAC3BC,IAAK,CAACF,SAAU,EAAGC,OAAQ,OAC3BE,IAAK,CAACH,SAAU,EAAGC,OAAQ,OAC3BG,IAAK,CAACJ,SAAU,EAAGC,OAAQ,OAC3BI,KAAM,CAACL,SAAU,EAAGC,OAAQ,QAC5BK,IAAK,CAACN,SAAU,EAAGC,OAAQ,OAC3BM,IAAK,CAACP,SAAU,EAAGC,OAAQ,OAC3BO,IAAK,CAACR,SAAU,EAAGC,OAAQ,OAC3BQ,IAAK,CAACT,SAAU,EAAGC,OAAQ,CAAC,QAC5BS,QAAS,CAACV,SAAU,EAAGC,OAAQ,CAAC,YAChCU,OAAQ,CAACX,SAAU,EAAGC,OAAQ,CAAC,WAC/BW,QAAS,CAACZ,SAAU,EAAGC,OAAQ,CAAC,YAChCY,IAAK,CAACb,SAAU,EAAGC,OAAQ,CAAC,IAAK,IAAK,MACtCa,MAAO,CAACd,SAAU,EAAGC,OAAQ,CAAC,MAAO,MAAO,QAC5Cc,KAAM,CAACf,SAAU,EAAGC,OAAQ,CAAC,UAG9BZ,EAAOD,Q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KmqC,OAAO/xC,MAAMoL,SAAS2hD,WACpD5rC,QAAQ,MAAO,IAAIjhB,MAClC,CAIA+nO,YAGI,OAFYpG,GAAwBj6N,KAAKmqC,OAAO/xC,MAAMoL,SAAS2hD,WACrCtoD,MAAMmD,KAAKugO,oBAAsB,IACtCjoO,MACzB,CAOAkoO,gBACI,MAAMJ,EAAQpgO,KAAKogO,MAAQpgO,KAAKqgO,YAC1BH,EAAalgO,KAAKkgO,WAAalgO,KAAKmgO,iBAC1CngO,KAAKqK,KAAK,SAAU,CAChB+1N,QACAF,cAER,IlDnDJ,GAAOxxL,cAAgB,CACtBykF,QAAS,CACRr/F,MAAO,CACN,UACA,IACA,aACA,WACA,YACA,sBACA,OACA,gBACA,YACA,SACA,OACA,YACA,cACA,YACA,eACA,IACA,YACA,UACA,SACA,YACA,IACA,cACA,cACA,aACA,cACA,aACA,OACA,OACA,IACA,QACA,iBACA,oBACA,OACA,YACA,gBACA,YACA,aAED+sM,wBAAwB,GAEzB7uM,SAAU,QACVuyC,MAAO,CACN4uD,QAAS,CACR,uBACA,qBACA,oBACA,mBACA,kBACA,cAGFysC,MAAO,CACNkhE,eAAgB,CACf,cACA,WACA,kBACA,sBACA,qBAKH,W,kB/iC3MA","sources":["webpack://ClassicEditor/webpack/universalModuleDefinition","webpack://ClassicEditor/./node_modules/color-convert/conversions.js","webpack://ClassicEditor/./node_modules/color-convert/index.js","webpack://ClassicEditor/./node_modules/color-convert/route.js","webpack://ClassicEditor/./node_modules/color-name/index.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/theme/code.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-code-block/theme/codeblock.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/theme/renderer.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-find-and-replace/theme/findandreplace.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-find-and-replace/theme/findandreplaceform.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/theme/fontsize.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-highlight/theme/highlight.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-horizontal-line/theme/horizontalline.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-embed/theme/htmlembed.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-support/theme/datafilter.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/theme/image.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/theme/imageinsert.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/theme/imageinsertformrowview.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/theme/link.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/theme/collapsible.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/theme/list.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/theme/listproperties.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/theme/liststyles.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/theme/todolist.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-media-embed/theme/mediaembed.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-media-embed/theme/mediaembedediting.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-media-embed/theme/mediaform.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-page-break/theme/pagebreak.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-source-editing/theme/sourceediting.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-special-characters/theme/charactergrid.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-special-characters/theme/characterinfo.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-special-characters/theme/specialcharacters.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-style/theme/style.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-style/theme/stylegrid.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-style/theme/stylegroup.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-style/theme/stylepanel.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/colorinput.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/form.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/formrow.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/table.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/tablecaption.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/tablecellproperties.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/tablecolumnresize.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/tableform.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/tableproperties.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorpicker/colorpicker.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/input/input.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css","webpack://ClassicEditor/./node_modules/css-loader/dist/runtime/api.js","webpack://ClassicEditor/./node_modules/css-loader/dist/runtime/cssWithMappingToString.js","webpack://ClassicEditor/./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","webpack://ClassicEditor/webpack/bootstrap","webpack://ClassicEditor/webpack/runtime/compat get default export","webpack://ClassicEditor/webpack/runtime/define property getters","webpack://ClassicEditor/webpack/runtime/global","webpack://ClassicEditor/webpack/runtime/hasOwnProperty shorthand","webpack://ClassicEditor/webpack/runtime/nonce","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/bindings/csstransitiondisablermixin.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/bindings/submithandler.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/bindings/addkeyboardhandlingforgrid.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/env.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/fastdiff.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/diff.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/spy.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/uid.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/priorities.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/inserttopriorityarray.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/version.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.js","webpack://ClassicEditor/./node_modules/lodash-es/isObject.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/elementreplacer.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/count.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/isiterable.js","webpack://ClassicEditor/./node_modules/lodash-es/_freeGlobal.js","webpack://ClassicEditor/./node_modules/lodash-es/_root.js","webpack://ClassicEditor/./node_modules/lodash-es/_Symbol.js","webpack://ClassicEditor/./node_modules/lodash-es/_getRawTag.js","webpack://ClassicEditor/./node_modules/lodash-es/_objectToString.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseGetTag.js","webpack://ClassicEditor/./node_modules/lodash-es/isArray.js","webpack://ClassicEditor/./node_modules/lodash-es/isObjectLike.js","webpack://ClassicEditor/./node_modules/lodash-es/isString.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/createelement.js","webpack://ClassicEditor/./node_modules/lodash-es/_overArg.js","webpack://ClassicEditor/./node_modules/lodash-es/_getPrototype.js","webpack://ClassicEditor/./node_modules/lodash-es/isPlainObject.js","webpack://ClassicEditor/./node_modules/lodash-es/_listCacheClear.js","webpack://ClassicEditor/./node_modules/lodash-es/eq.js","webpack://ClassicEditor/./node_modules/lodash-es/_assocIndexOf.js","webpack://ClassicEditor/./node_modules/lodash-es/_listCacheDelete.js","webpack://ClassicEditor/./node_modules/lodash-es/_listCacheGet.js","webpack://ClassicEditor/./node_modules/lodash-es/_listCacheHas.js","webpack://ClassicEditor/./node_modules/lodash-es/_listCacheSet.js","webpack://ClassicEditor/./node_modules/lodash-es/_ListCache.js","webpack://ClassicEditor/./node_modules/lodash-es/_stackClear.js","webpack://ClassicEditor/./node_modules/lodash-es/_stackDelete.js","webpack://ClassicEditor/./node_modules/lodash-es/_stackGet.js","webpack://ClassicEditor/./node_modules/lodash-es/_stackHas.js","webpack://ClassicEditor/./node_modules/lodash-es/isFunction.js","webpack://ClassicEditor/./node_modules/lodash-es/_coreJsData.js","webpack://ClassicEditor/./node_modules/lodash-es/_isMasked.js","webpack://ClassicEditor/./node_modules/lodash-es/_toSource.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseIsNative.js","webpack://ClassicEditor/./node_modules/lodash-es/_getValue.js","webpack://ClassicEditor/./node_modules/lodash-es/_getNative.js","webpack://ClassicEditor/./node_modules/lodash-es/_Map.js","webpack://ClassicEditor/./node_modules/lodash-es/_nativeCreate.js","webpack://ClassicEditor/./node_modules/lodash-es/_hashClear.js","webpack://ClassicEditor/./node_modules/lodash-es/_hashDelete.js","webpack://ClassicEditor/./node_modules/lodash-es/_hashGet.js","webpack://ClassicEditor/./node_modules/lodash-es/_hashHas.js","webpack://ClassicEditor/./node_modules/lodash-es/_hashSet.js","webpack://ClassicEditor/./node_modules/lodash-es/_Hash.js","webpack://ClassicEditor/./node_modules/lodash-es/_mapCacheClear.js","webpack://ClassicEditor/./node_modules/lodash-es/_isKeyable.js","webpack://ClassicEditor/./node_modules/lodash-es/_getMapData.js","webpack://ClassicEditor/./node_modules/lodash-es/_mapCacheDelete.js","webpack://ClassicEditor/./node_modules/lodash-es/_mapCacheGet.js","webpack://ClassicEditor/./node_modules/lodash-es/_mapCacheHas.js","webpack://ClassicEditor/./node_modules/lodash-es/_mapCacheSet.js","webpack://ClassicEditor/./node_modules/lodash-es/_MapCache.js","webpack://ClassicEditor/./node_modules/lodash-es/_stackSet.js","webpack://ClassicEditor/./node_modules/lodash-es/_Stack.js","webpack://ClassicEditor/./node_modules/lodash-es/_arrayEach.js","webpack://ClassicEditor/./node_modules/lodash-es/_defineProperty.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseAssignValue.js","webpack://ClassicEditor/./node_modules/lodash-es/_assignValue.js","webpack://ClassicEditor/./node_modules/lodash-es/_copyObject.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseTimes.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseIsArguments.js","webpack://ClassicEditor/./node_modules/lodash-es/isArguments.js","webpack://ClassicEditor/./node_modules/lodash-es/stubFalse.js","webpack://ClassicEditor/./node_modules/lodash-es/isBuffer.js","webpack://ClassicEditor/./node_modules/lodash-es/_isIndex.js","webpack://ClassicEditor/./node_modules/lodash-es/isLength.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseIsTypedArray.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseUnary.js","webpack://ClassicEditor/./node_modules/lodash-es/_nodeUtil.js","webpack://ClassicEditor/./node_modules/lodash-es/isTypedArray.js","webpack://ClassicEditor/./node_modules/lodash-es/_arrayLikeKeys.js","webpack://ClassicEditor/./node_modules/lodash-es/_isPrototype.js","webpack://ClassicEditor/./node_modules/lodash-es/_nativeKeys.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseKeys.js","webpack://ClassicEditor/./node_modules/lodash-es/isArrayLike.js","webpack://ClassicEditor/./node_modules/lodash-es/keys.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseAssign.js","webpack://ClassicEditor/./node_modules/lodash-es/_nativeKeysIn.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseKeysIn.js","webpack://ClassicEditor/./node_modules/lodash-es/keysIn.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseAssignIn.js","webpack://ClassicEditor/./node_modules/lodash-es/_cloneBuffer.js","webpack://ClassicEditor/./node_modules/lodash-es/_copyArray.js","webpack://ClassicEditor/./node_modules/lodash-es/_arrayFilter.js","webpack://ClassicEditor/./node_modules/lodash-es/stubArray.js","webpack://ClassicEditor/./node_modules/lodash-es/_getSymbols.js","webpack://ClassicEditor/./node_modules/lodash-es/_copySymbols.js","webpack://ClassicEditor/./node_modules/lodash-es/_arrayPush.js","webpack://ClassicEditor/./node_modules/lodash-es/_getSymbolsIn.js","webpack://ClassicEditor/./node_modules/lodash-es/_copySymbolsIn.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseGetAllKeys.js","webpack://ClassicEditor/./node_modules/lodash-es/_getAllKeys.js","webpack://ClassicEditor/./node_modules/lodash-es/_getAllKeysIn.js","webpack://ClassicEditor/./node_modules/lodash-es/_DataView.js","webpack://ClassicEditor/./node_modules/lodash-es/_Promise.js","webpack://ClassicEditor/./node_modules/lodash-es/_Set.js","webpack://ClassicEditor/./node_modules/lodash-es/_WeakMap.js","webpack://ClassicEditor/./node_modules/lodash-es/_getTag.js","webpack://ClassicEditor/./node_modules/lodash-es/_initCloneArray.js","webpack://ClassicEditor/./node_modules/lodash-es/_Uint8Array.js","webpack://ClassicEditor/./node_modules/lodash-es/_cloneArrayBuffer.js","webpack://ClassicEditor/./node_modules/lodash-es/_cloneDataView.js","webpack://ClassicEditor/./node_modules/lodash-es/_cloneRegExp.js","webpack://ClassicEditor/./node_modules/lodash-es/_cloneSymbol.js","webpack://ClassicEditor/./node_modules/lodash-es/_cloneTypedArray.js","webpack://ClassicEditor/./node_modules/lodash-es/_initCloneByTag.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseCreate.js","webpack://ClassicEditor/./node_modules/lodash-es/_initCloneObject.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseIsMap.js","webpack://ClassicEditor/./node_modules/lodash-es/isMap.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseIsSet.js","webpack://ClassicEditor/./node_modules/lodash-es/isSet.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseClone.js","webpack://ClassicEditor/./node_modules/lodash-es/cloneDeepWith.js","webpack://ClassicEditor/./node_modules/lodash-es/isElement.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/config.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/isnode.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/iswindow.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/global.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/getancestors.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/isrange.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/getborderwidths.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/setdatainelement.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/indexof.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/insertat.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/iscomment.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/isvalidattributename.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/isvisible.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/position.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/getpositionedancestor.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/remove.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/scroll.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/keyboard.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/language.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/toarray.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/translation-service.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/locale.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/collection.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/first.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/focustracker.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/tomap.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/objecttomap.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/delay.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/unicode.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/globals/globals.css?9ffd","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/view.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/template.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/editorui/bodycollection.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css?d134","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css?e9d2","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css?aaf0","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/button/switchbuttonview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colortileview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/icons/color-tile-check.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css?2704","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colorgridview.js","webpack://ClassicEditor/./node_modules/color-parse/index.mjs","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/colorpicker/utils.js","webpack://ClassicEditor/./node_modules/lodash-es/now.js","webpack://ClassicEditor/./node_modules/lodash-es/_trimmedEndIndex.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseTrim.js","webpack://ClassicEditor/./node_modules/lodash-es/isSymbol.js","webpack://ClassicEditor/./node_modules/lodash-es/toNumber.js","webpack://ClassicEditor/./node_modules/lodash-es/debounce.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css?8d4e","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css?2832","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/input/input.css?edfa","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/input/inputview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/inputtext/inputtextview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/inputnumber/inputnumberview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownpanelview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css?1880","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/icons/dropdown-arrow.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbuttonview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarseparatorview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarlinebreakview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/src/plugin.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/src/command.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/src/multicommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/src/plugincollection.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/src/context.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css?b8f9","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/placeholder.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/typecheckable.js","webpack://ClassicEditor/./node_modules/lodash-es/clone.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/node.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/text.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.js","webpack://ClassicEditor/./node_modules/lodash-es/_isKey.js","webpack://ClassicEditor/./node_modules/lodash-es/memoize.js","webpack://ClassicEditor/./node_modules/lodash-es/_memoizeCapped.js","webpack://ClassicEditor/./node_modules/lodash-es/_stringToPath.js","webpack://ClassicEditor/./node_modules/lodash-es/_arrayMap.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseToString.js","webpack://ClassicEditor/./node_modules/lodash-es/toString.js","webpack://ClassicEditor/./node_modules/lodash-es/_castPath.js","webpack://ClassicEditor/./node_modules/lodash-es/last.js","webpack://ClassicEditor/./node_modules/lodash-es/_toKey.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseGet.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseSlice.js","webpack://ClassicEditor/./node_modules/lodash-es/_parent.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseUnset.js","webpack://ClassicEditor/./node_modules/lodash-es/unset.js","webpack://ClassicEditor/./node_modules/lodash-es/get.js","webpack://ClassicEditor/./node_modules/lodash-es/_assignMergeValue.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseFor.js","webpack://ClassicEditor/./node_modules/lodash-es/_createBaseFor.js","webpack://ClassicEditor/./node_modules/lodash-es/isArrayLikeObject.js","webpack://ClassicEditor/./node_modules/lodash-es/_safeGet.js","webpack://ClassicEditor/./node_modules/lodash-es/toPlainObject.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseMergeDeep.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseMerge.js","webpack://ClassicEditor/./node_modules/lodash-es/identity.js","webpack://ClassicEditor/./node_modules/lodash-es/_apply.js","webpack://ClassicEditor/./node_modules/lodash-es/_overRest.js","webpack://ClassicEditor/./node_modules/lodash-es/constant.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseSetToString.js","webpack://ClassicEditor/./node_modules/lodash-es/_shortOut.js","webpack://ClassicEditor/./node_modules/lodash-es/_setToString.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseRest.js","webpack://ClassicEditor/./node_modules/lodash-es/_isIterateeCall.js","webpack://ClassicEditor/./node_modules/lodash-es/_createAssigner.js","webpack://ClassicEditor/./node_modules/lodash-es/merge.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseSet.js","webpack://ClassicEditor/./node_modules/lodash-es/set.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/stylesmap.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/element.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/rooteditableelement.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/position.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/range.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/selection.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/documentselection.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/document.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/attributeelement.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/emptyelement.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/uielement.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/rawelement.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/downcastwriter.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/filler.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/theme/renderer.css?d589","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/renderer.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.js","webpack://ClassicEditor/./node_modules/lodash-es/assignIn.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/keyobserver.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/fakeselectionobserver.js","webpack://ClassicEditor/./node_modules/lodash-es/_setCacheAdd.js","webpack://ClassicEditor/./node_modules/lodash-es/_setCacheHas.js","webpack://ClassicEditor/./node_modules/lodash-es/_SetCache.js","webpack://ClassicEditor/./node_modules/lodash-es/_arraySome.js","webpack://ClassicEditor/./node_modules/lodash-es/_cacheHas.js","webpack://ClassicEditor/./node_modules/lodash-es/_equalArrays.js","webpack://ClassicEditor/./node_modules/lodash-es/_mapToArray.js","webpack://ClassicEditor/./node_modules/lodash-es/_setToArray.js","webpack://ClassicEditor/./node_modules/lodash-es/_equalByTag.js","webpack://ClassicEditor/./node_modules/lodash-es/_equalObjects.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseIsEqualDeep.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseIsEqual.js","webpack://ClassicEditor/./node_modules/lodash-es/isEqualWith.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mutationobserver.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/focusobserver.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/selectionobserver.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/compositionobserver.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/datatransfer.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/inputobserver.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/arrowkeysobserver.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/tabobserver.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/view.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/typecheckable.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/node.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/splicearray.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/text.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/element.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/position.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/range.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/conversion/mapper.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/conversion/modelconsumable.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcastdispatcher.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/selection.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversionhelpers.js","webpack://ClassicEditor/./node_modules/lodash-es/cloneDeep.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/selection-post-fixer.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/controller/editingcontroller.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/conversion/viewconsumable.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/schema.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcastdispatcher.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/basichtmlwriter.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/controller/datacontroller.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversion.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.js","webpack://ClassicEditor/./node_modules/lodash-es/isEqual.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/nooperation.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootoperation.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operationfactory.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/transform.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/liveposition.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/batch.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/differ.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/history.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/rootelement.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/document.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/markercollection.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/operation/detachoperation.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/documentfragment.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/writer.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/deletecontent.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/getselectedcontent.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/insertcontent.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/findoptimalinsertionrange.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/insertobject.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/utils/modifyselection.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/model/model.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/clickobserver.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/upcastwriter.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/background.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/border.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/margin.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-engine/src/view/styles/padding.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/src/commandcollection.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/src/editingkeystrokehandler.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/src/editor/editor.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/dataapimixin.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/elementapimixin.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/src/pendingactions.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/cancel.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/src/index.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/bold.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/caption.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/check.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/cog.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/eraser.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/image.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/low-vision.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/importexport.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/paragraph.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/plus.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/text.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-bottom.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-middle.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-top.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-left.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-center.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-right.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/align-justify.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-inline-left.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-center.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-inline-right.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-full-width.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-inline.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-left.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-right.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-full.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-large.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-small.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/object-size-medium.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/pencil.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/pilcrow.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/quote.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/theme/icons/three-vertical-dots.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css?0211","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/bindings/preventdefault.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css?cbd7","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/list/listview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/list/listitemview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/list/listseparatorview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css?0497","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css?347c","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/listdropdown.css?1a4d","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/utils.js","webpack://ClassicEditor/./node_modules/vanilla-colorful/lib/utils/math.js","webpack://ClassicEditor/./node_modules/vanilla-colorful/lib/utils/convert.js","webpack://ClassicEditor/./node_modules/vanilla-colorful/lib/utils/compare.js","webpack://ClassicEditor/./node_modules/vanilla-colorful/lib/utils/dom.js","webpack://ClassicEditor/./node_modules/vanilla-colorful/lib/components/slider.js","webpack://ClassicEditor/./node_modules/vanilla-colorful/lib/components/hue.js","webpack://ClassicEditor/./node_modules/vanilla-colorful/lib/components/saturation.js","webpack://ClassicEditor/./node_modules/vanilla-colorful/lib/styles/color-picker.js","webpack://ClassicEditor/./node_modules/vanilla-colorful/lib/components/color-picker.js","webpack://ClassicEditor/./node_modules/vanilla-colorful/lib/styles/hue.js","webpack://ClassicEditor/./node_modules/vanilla-colorful/lib/styles/saturation.js","webpack://ClassicEditor/./node_modules/vanilla-colorful/lib/entrypoints/hex.js","webpack://ClassicEditor/./node_modules/vanilla-colorful/hex-color-picker.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorpicker/colorpicker.css?53be","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/colorpicker/colorpickerview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/componentfactory.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css?7831","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css?a08c","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/tooltipmanager.js","webpack://ClassicEditor/./node_modules/lodash-es/throttle.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/editorui/poweredby.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/verifylicense.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/icons/project-logo.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/findclosestscrollableancestor.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/editorui/editorui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/editorui/editorui.css?2a16","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/editorui/editoruiview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/editorui/boxed/boxededitoruiview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/editableui/editableuiview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css?0cda","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/formheader/formheaderview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/notification/notification.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/model.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/icons/previous-arrow.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css?1baf","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css?17b0","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/icons/next-arrow.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css?009d","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/panel/sticky/stickypanelview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/balloon/balloontoolbar.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css?45fd","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blockbuttonview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blocktoolbar.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/icons/color-palette.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/src/index.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditorui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css?97f1","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditoruiview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-watchdog/src/watchdog.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-watchdog/src/utils/getsubnodes.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-watchdog/src/utils/areconnectedthroughproperties.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-watchdog/src/editorwatchdog.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-watchdog/src/contextwatchdog.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-utils/src/dom/getdatafromelement.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-core/src/editor/utils/attachtoform.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-alignment/src/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-alignment/src/alignmentui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/viewtoplaintext.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/normalizeclipboarddata.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/plaintexttohtml.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-typing/src/utils/changebuffer.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-typing/src/inserttextcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-typing/src/inserttextobserver.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-typing/src/input.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-typing/src/deletecommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-typing/src/deleteobserver.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-typing/src/delete.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-typing/src/typing.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-typing/src/utils/getlasttextline.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-typing/src/textwatcher.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-typing/src/twostepcaretmovement.js","webpack://ClassicEditor/./node_modules/lodash-es/escapeRegExp.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-typing/src/texttransformation.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-typing/src/utils/findattributerange.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-typing/src/utils/inlinehighlight.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-enter/src/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-enter/src/entercommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-enter/src/enterobserver.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-enter/src/enter.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-enter/src/shiftentercommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-enter/src/shiftenter.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-widget/src/highlightstack.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-widget/theme/icons/drag-handle.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-widget/src/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css?abb1","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/widgettypearound.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-widget/theme/icons/return-arrow.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-widget/src/verticalnavigation.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css?47b7","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-widget/src/widget.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-widget/src/widgettoolbarrepository.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizerstate.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/sizeview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizer.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css?24e6","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-widget/src/widgetresize.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css?0a95","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-clipboard/src/dragdrop.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboard.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-clipboard/src/lineview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-undo/src/basecommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-undo/src/undocommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-undo/src/redocommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-undo/src/undoediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-undo/theme/icons/undo.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-undo/theme/icons/redo.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-undo/src/undoui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-undo/src/undo.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/image/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imageutils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/autoimage.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-autoformat/src/blockautoformatediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-autoformat/src/inlineautoformatediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-autoformat/src/autoformat.js","webpack://ClassicEditor/./node_modules/lodash-es/_castSlice.js","webpack://ClassicEditor/./node_modules/lodash-es/_hasUnicode.js","webpack://ClassicEditor/./node_modules/lodash-es/_asciiToArray.js","webpack://ClassicEditor/./node_modules/lodash-es/_unicodeToArray.js","webpack://ClassicEditor/./node_modules/lodash-es/_stringToArray.js","webpack://ClassicEditor/./node_modules/lodash-es/upperFirst.js","webpack://ClassicEditor/./node_modules/lodash-es/_createCaseFirst.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/src/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/src/autolink.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquotecommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css?66ed","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/src/code/codeediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/theme/code.css?83c4","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/src/code/codeui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/code.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-code-block/src/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-code-block/src/codeblockcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-code-block/src/indentcodeblockcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-code-block/src/outdentcodeblockcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-code-block/src/converters.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-code-block/src/codeblockediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-code-block/theme/codeblock.css?ff4a","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-code-block/src/codeblockui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-code-block/theme/icons/codeblock.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-support/src/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-support/src/converters.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-support/src/schemadefinitions.js","webpack://ClassicEditor/./node_modules/lodash-es/mergeWith.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-support/src/dataschema.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseFindIndex.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseIsNaN.js","webpack://ClassicEditor/./node_modules/lodash-es/_strictIndexOf.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseIndexOf.js","webpack://ClassicEditor/./node_modules/lodash-es/_baseIndexOfWith.js","webpack://ClassicEditor/./node_modules/lodash-es/_basePullAll.js","webpack://ClassicEditor/./node_modules/lodash-es/pull.js","webpack://ClassicEditor/./node_modules/lodash-es/pullAll.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-support/theme/datafilter.css?7ba1","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-support/src/datafilter.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-select-all/src/selectallcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-select-all/src/selectallediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-select-all/src/selectallui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-select-all/theme/icons/select-all.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-select-all/src/selectall.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css?7101","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-find-and-replace/theme/findandreplaceform.css?50d4","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-find-and-replace/src/ui/findandreplaceformview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-find-and-replace/src/findandreplaceui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-find-and-replace/theme/icons/find-replace.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-find-and-replace/src/findcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-find-and-replace/src/replacecommandbase.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-find-and-replace/src/replacecommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-find-and-replace/src/replaceallcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-find-and-replace/src/findnextcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-find-and-replace/src/findpreviouscommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-find-and-replace/src/findandreplacestate.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-find-and-replace/src/findandreplaceutils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-find-and-replace/theme/findandreplace.css?9ce3","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-find-and-replace/src/findandreplaceediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/src/fontcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/src/documentcolorcollection.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css?361f","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/src/ui/colortableview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/src/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/src/ui/colorui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-background.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-color.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/src/fontfamily/fontfamilycommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/src/fontfamily/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/src/fontfamily/fontfamilyediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/src/fontfamily/fontfamilyui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-family.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/src/fontsize/fontsizecommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/src/fontsize/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/src/fontsize/fontsizeediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/theme/fontsize.css?31d2","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/src/fontsize/fontsizeui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/theme/icons/font-size.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-support/src/integrations/codeblock.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-support/src/integrations/dualcontent.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-support/src/integrations/heading.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-support/src/integrations/integrationutils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-support/src/integrations/image.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-support/src/integrations/mediaembed.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-support/src/integrations/script.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-support/src/integrations/table.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-support/src/integrations/style.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-support/src/integrations/documentlist.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-support/src/integrations/customelement.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-support/src/generalhtmlsupport.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-paragraph/src/insertparagraphcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-heading/src/headingcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-heading/src/headingediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css?2b0a","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-heading/src/headingui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-heading/src/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-highlight/src/highlightcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-highlight/src/highlightediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-highlight/theme/highlight.css?5ebc","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-highlight/src/highlightui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-highlight/theme/icons/marker.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-highlight/theme/icons/pen.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-horizontal-line/src/horizontallinecommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-horizontal-line/theme/horizontalline.css?3559","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-horizontal-line/src/horizontallineediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-horizontal-line/src/horizontallineui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-horizontal-line/theme/icons/horizontalline.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-embed/theme/htmlembed.css?bc83","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembedui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-embed/theme/icons/html.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativecommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css?66f4","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/ui/textalternativeformview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/image/ui/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/image/converters.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/image/imageloadobserver.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/image/insertimagecommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/image/replaceimagesourcecommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/image/imageediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/image/imagetypecommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/image/imageblockediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/theme/image.css?5c96","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imageblock.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/image/imageinlineediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imageinline.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/toggleimagecaptioncommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionutils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css?5152","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-upload/src/filereader.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-upload/src/filerepository.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-upload/src/ui/filedialogbuttonview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-upload/src/adapters/simpleuploadadapter.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imageupload/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css?72d0","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css?b791","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css?3f3f","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadprogress.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imageupload/uploadimagecommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imageupload.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/theme/imageinsertformrowview.css?bfb2","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imageinsert/ui/imageinsertformrowview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/theme/imageinsert.css?2fb5","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imageinsert/ui/imageinsertpanelview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imageinsert/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imageinsert/imageinsertui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imageinsertviaurl.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imageresize/resizeimagecommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizeediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizebuttons.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizehandles.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css?a8fb","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestylecommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/converters.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css?a152","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-indent/src/indentediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-indent/theme/icons/indent.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-indent/theme/icons/outdent.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-indent/src/indentui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-indent/src/indentblockcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-indent/src/indentcommandbehavior/indentusingoffset.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-indent/src/indentcommandbehavior/indentusingclasses.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-indent/src/indentblock.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/italic.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/src/utils/automaticdecorators.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/src/linkcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/src/unlinkcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/src/utils/manualdecorator.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/theme/link.css?4da5","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/src/linkediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css?837e","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/src/ui/linkformview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css?b997","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/src/ui/linkactionsview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/theme/icons/unlink.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/theme/icons/link.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/src/linkui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/src/linkimageediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/src/linkimageui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css?843b","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/src/list/listcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/src/list/indentcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/src/list/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/src/list/listutils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/src/list/converters.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/theme/list.css?ef70","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/src/list/listediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/theme/icons/numberedlist.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/theme/icons/bulletedlist.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/src/list/listui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/src/listproperties/liststylecommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/src/listproperties/listreversedcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/src/listproperties/liststartcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/src/listproperties/listpropertiesediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/theme/collapsible.css?ab49","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/src/listproperties/ui/collapsibleview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/theme/listproperties.css?c6ab","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/src/listproperties/ui/listpropertiesview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/theme/liststyles.css?4c65","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/src/listproperties/listpropertiesui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/theme/icons/liststyledisc.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/theme/icons/liststylecircle.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/theme/icons/liststylesquare.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/theme/icons/liststyledecimal.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/theme/icons/liststyledecimalleadingzero.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/theme/icons/liststylelowerroman.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/theme/icons/liststyleupperroman.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/theme/icons/liststylelowerlatin.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/theme/icons/liststyleupperlatin.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-media-embed/src/converters.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-media-embed/src/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-media-embed/src/mediaembedcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-media-embed/src/mediaregistry.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-media-embed/theme/icons/media-placeholder.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-media-embed/theme/mediaembedediting.css?816e","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-media-embed/src/mediaembedediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-media-embed/src/automediaembed.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-media-embed/theme/mediaform.css?e368","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-media-embed/src/ui/mediaformview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-media-embed/src/mediaembedui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-media-embed/theme/icons/media.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-media-embed/theme/mediaembed.css?b12c","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-page-break/src/pagebreakcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-page-break/theme/pagebreak.css?7ae9","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-page-break/src/pagebreakediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-page-break/src/pagebreakui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-page-break/theme/icons/pagebreak.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/list.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/image.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/mswordnormalizer.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/br.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/googledocsnormalizer.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removeboldwrapper.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/googlesheetsnormalizer.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removegooglesheetstag.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removexmlns.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removeinvalidtablewidth.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/space.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/parse.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-remove-format/theme/icons/remove-format.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformatediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-source-editing/src/utils/formathtml.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-source-editing/theme/sourceediting.css?8d2b","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-source-editing/src/sourceediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-special-characters/src/ui/specialcharactersnavigationview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-special-characters/theme/charactergrid.css?0a9b","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-special-characters/src/ui/charactergridview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-special-characters/theme/characterinfo.css?a125","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-special-characters/src/ui/characterinfoview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-special-characters/src/ui/specialcharactersview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-special-characters/theme/specialcharacters.css?1939","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-special-characters/src/specialcharacters.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-special-characters/src/specialcharactersarrows.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-special-characters/src/specialcharacterscurrency.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-special-characters/src/specialcharactersmathematical.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-special-characters/src/specialcharacterslatin.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-special-characters/src/specialcharacterstext.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/strikethrough.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-style/src/ui/stylegridbuttonview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-style/theme/stylegrid.css?0373","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-style/src/ui/stylegridview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-style/theme/stylegroup.css?ba5e","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-style/src/ui/stylegroupview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-style/theme/stylepanel.css?c06e","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-style/src/ui/stylepanelview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-style/src/styleutils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-style/theme/style.css?8015","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-style/src/styleui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-style/src/stylecommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-style/src/integrations/documentlist.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-style/src/integrations/table.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-style/src/integrations/link.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-style/src/styleediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/subscript.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/superscript.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/converters/tableproperties.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/utils/common.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/converters/upcasttable.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablewalker.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/converters/downcast.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/commands/inserttablecommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/commands/insertrowcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/commands/insertcolumncommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/commands/splitcellcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/utils/structure.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/commands/removerowcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/commands/removecolumncommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/commands/setheaderrowcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/commands/setheadercolumncommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tableutils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellscommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/commands/selectrowcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/commands/selectcolumncommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/converters/table-layout-post-fixer.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-paragraph-post-fixer.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-refresh-handler.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/tableediting.css?183a","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tableediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/converters/table-headings-refresh-handler.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css?8f02","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/ui/inserttableview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tableui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/icons/table.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-column.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-row.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-merge-cell.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/tableselection.css?52d0","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tableselection.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tableclipboard.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablekeyboard.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablemouse/mouseeventsobserver.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablemouse.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/table.css?7a76","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/converters/table-caption-post-fixer.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecaption/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecaption/toggletablecaptioncommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecaption/tablecaptionediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecaption/tablecaptionui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/tablecaption.css?b30e","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/colorinput.css?a66f","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/ui/colorinputview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/utils/ui/table-properties.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/formrow.css?e9c9","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/ui/formrowview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/form.css?9b02","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/tableform.css?4fab","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/tablecellproperties.css?861e","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/ui/tablecellpropertiesview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/utils/ui/widget.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/utils/ui/contextualballoon.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/utils/table-properties.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/tablecellpropertiesui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-cell-properties.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellpropertycommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecellwidth/commands/tablecellwidthcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecellwidth/tablecellwidthediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellpaddingcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellheightcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellbackgroundcolorcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellverticalalignmentcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellhorizontalalignmentcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellborderstylecommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellbordercolorcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellborderwidthcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/tablecellpropertiesediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecolumnresize/constants.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecolumnresize/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecolumnresize/tablewidthscommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecolumnresize/tablecolumnresizeediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecolumnresize/converters.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/tablecolumnresize.css?9b35","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tablepropertycommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tablebackgroundcolorcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tablebordercolorcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tableborderstylecommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tableborderwidthcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tablewidthcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tableheightcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tablealignmentcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tableproperties/tablepropertiesediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/tableproperties.css?db5b","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tableproperties/ui/tablepropertiesview.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/theme/icons/table-properties.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tableproperties/tablepropertiesui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-language/src/utils.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-language/src/textpartlanguagecommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-language/src/textpartlanguageediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-language/src/textpartlanguageui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/src/todolist/checktodolistcommand.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/src/todolist/todolistconverters.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/src/todolist/todolistediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/src/todolist/todolistui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/theme/icons/todolist.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/theme/todolist.css?1468","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineediting.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/underline.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineui.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-word-count/src/utils.js","webpack://ClassicEditor/./src/ckeditor.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-alignment/src/alignment.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquote.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/src/code.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-code-block/src/codeblock.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-essentials/src/essentials.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-find-and-replace/src/findandreplace.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/src/fontcolor.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/src/fontfamily.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-font/src/fontsize.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-heading/src/heading.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-highlight/src/highlight.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-horizontal-line/src/horizontalline.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-support/src/htmlcomment.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-html-embed/src/htmlembed.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/image.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imagecaption.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imageinsert.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imageresize.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imagestyle.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-image/src/imagetoolbar.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-indent/src/indent.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/src/link.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-link/src/linkimage.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/src/list.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/src/listproperties.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-media-embed/src/mediaembed.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-media-embed/src/mediaembedtoolbar.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-page-break/src/pagebreak.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-remove-format/src/removeformat.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-source-editing/theme/icons/source-editing.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-special-characters/theme/icons/specialcharacters.svg","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-special-characters/src/specialcharactersessentials.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-style/src/style.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/table.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecaption.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tablecolumnresize.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tableproperties.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-table/src/tabletoolbar.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-language/src/textpartlanguage.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-list/src/todolist.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline.js","webpack://ClassicEditor/./node_modules/@ckeditor/ckeditor5-word-count/src/wordcount.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ClassicEditor\"] = factory();\n\telse\n\t\troot[\"ClassicEditor\"] = factory();\n})(self, () => {\nreturn ","/* MIT license */\n/* eslint-disable no-mixed-operators */\nconst cssKeywords = require('color-name');\n\n// NOTE: conversions should only return primitive values (i.e. arrays, or\n// values that give correct `typeof` results).\n// do not use box values types (i.e. Number(), String(), etc.)\n\nconst reverseKeywords = {};\nfor (const key of Object.keys(cssKeywords)) {\n\treverseKeywords[cssKeywords[key]] = key;\n}\n\nconst convert = {\n\trgb: {channels: 3, labels: 'rgb'},\n\thsl: {channels: 3, labels: 'hsl'},\n\thsv: {channels: 3, labels: 'hsv'},\n\thwb: {channels: 3, labels: 'hwb'},\n\tcmyk: {channels: 4, labels: 'cmyk'},\n\txyz: {channels: 3, labels: 'xyz'},\n\tlab: {channels: 3, labels: 'lab'},\n\tlch: {channels: 3, labels: 'lch'},\n\thex: {channels: 1, labels: ['hex']},\n\tkeyword: {channels: 1, labels: ['keyword']},\n\tansi16: {channels: 1, labels: ['ansi16']},\n\tansi256: {channels: 1, labels: ['ansi256']},\n\thcg: {channels: 3, labels: ['h', 'c', 'g']},\n\tapple: {channels: 3, labels: ['r16', 'g16', 'b16']},\n\tgray: {channels: 1, labels: ['gray']}\n};\n\nmodule.exports = convert;\n\n// Hide .channels and .labels properties\nfor (const model of Object.keys(convert)) {\n\tif (!('channels' in convert[model])) {\n\t\tthrow new Error('missing channels property: ' + model);\n\t}\n\n\tif (!('labels' in convert[model])) {\n\t\tthrow new Error('missing channel labels property: ' + model);\n\t}\n\n\tif (convert[model].labels.length !== convert[model].channels) {\n\t\tthrow new Error('channel and label counts mismatch: ' + model);\n\t}\n\n\tconst {channels, labels} = convert[model];\n\tdelete convert[model].channels;\n\tdelete convert[model].labels;\n\tObject.defineProperty(convert[model], 'channels', {value: channels});\n\tObject.defineProperty(convert[model], 'labels', {value: labels});\n}\n\nconvert.rgb.hsl = function (rgb) {\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\tconst min = Math.min(r, g, b);\n\tconst max = Math.max(r, g, b);\n\tconst delta = max - min;\n\tlet h;\n\tlet s;\n\n\tif (max === min) {\n\t\th = 0;\n\t} else if (r === max) {\n\t\th = (g - b) / delta;\n\t} else if (g === max) {\n\t\th = 2 + (b - r) / delta;\n\t} else if (b === max) {\n\t\th = 4 + (r - g) / delta;\n\t}\n\n\th = Math.min(h * 60, 360);\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tconst l = (min + max) / 2;\n\n\tif (max === min) {\n\t\ts = 0;\n\t} else if (l <= 0.5) {\n\t\ts = delta / (max + min);\n\t} else {\n\t\ts = delta / (2 - max - min);\n\t}\n\n\treturn [h, s * 100, l * 100];\n};\n\nconvert.rgb.hsv = function (rgb) {\n\tlet rdif;\n\tlet gdif;\n\tlet bdif;\n\tlet h;\n\tlet s;\n\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\tconst v = Math.max(r, g, b);\n\tconst diff = v - Math.min(r, g, b);\n\tconst diffc = function (c) {\n\t\treturn (v - c) / 6 / diff + 1 / 2;\n\t};\n\n\tif (diff === 0) {\n\t\th = 0;\n\t\ts = 0;\n\t} else {\n\t\ts = diff / v;\n\t\trdif = diffc(r);\n\t\tgdif = diffc(g);\n\t\tbdif = diffc(b);\n\n\t\tif (r === v) {\n\t\t\th = bdif - gdif;\n\t\t} else if (g === v) {\n\t\t\th = (1 / 3) + rdif - bdif;\n\t\t} else if (b === v) {\n\t\t\th = (2 / 3) + gdif - rdif;\n\t\t}\n\n\t\tif (h < 0) {\n\t\t\th += 1;\n\t\t} else if (h > 1) {\n\t\t\th -= 1;\n\t\t}\n\t}\n\n\treturn [\n\t\th * 360,\n\t\ts * 100,\n\t\tv * 100\n\t];\n};\n\nconvert.rgb.hwb = function (rgb) {\n\tconst r = rgb[0];\n\tconst g = rgb[1];\n\tlet b = rgb[2];\n\tconst h = convert.rgb.hsl(rgb)[0];\n\tconst w = 1 / 255 * Math.min(r, Math.min(g, b));\n\n\tb = 1 - 1 / 255 * Math.max(r, Math.max(g, b));\n\n\treturn [h, w * 100, b * 100];\n};\n\nconvert.rgb.cmyk = function (rgb) {\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\n\tconst k = Math.min(1 - r, 1 - g, 1 - b);\n\tconst c = (1 - r - k) / (1 - k) || 0;\n\tconst m = (1 - g - k) / (1 - k) || 0;\n\tconst y = (1 - b - k) / (1 - k) || 0;\n\n\treturn [c * 100, m * 100, y * 100, k * 100];\n};\n\nfunction comparativeDistance(x, y) {\n\t/*\n\t\tSee https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance\n\t*/\n\treturn (\n\t\t((x[0] - y[0]) ** 2) +\n\t\t((x[1] - y[1]) ** 2) +\n\t\t((x[2] - y[2]) ** 2)\n\t);\n}\n\nconvert.rgb.keyword = function (rgb) {\n\tconst reversed = reverseKeywords[rgb];\n\tif (reversed) {\n\t\treturn reversed;\n\t}\n\n\tlet currentClosestDistance = Infinity;\n\tlet currentClosestKeyword;\n\n\tfor (const keyword of Object.keys(cssKeywords)) {\n\t\tconst value = cssKeywords[keyword];\n\n\t\t// Compute comparative distance\n\t\tconst distance = comparativeDistance(rgb, value);\n\n\t\t// Check if its less, if so set as closest\n\t\tif (distance < currentClosestDistance) {\n\t\t\tcurrentClosestDistance = distance;\n\t\t\tcurrentClosestKeyword = keyword;\n\t\t}\n\t}\n\n\treturn currentClosestKeyword;\n};\n\nconvert.keyword.rgb = function (keyword) {\n\treturn cssKeywords[keyword];\n};\n\nconvert.rgb.xyz = function (rgb) {\n\tlet r = rgb[0] / 255;\n\tlet g = rgb[1] / 255;\n\tlet b = rgb[2] / 255;\n\n\t// Assume sRGB\n\tr = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92);\n\tg = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92);\n\tb = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92);\n\n\tconst x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);\n\tconst y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);\n\tconst z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);\n\n\treturn [x * 100, y * 100, z * 100];\n};\n\nconvert.rgb.lab = function (rgb) {\n\tconst xyz = convert.rgb.xyz(rgb);\n\tlet x = xyz[0];\n\tlet y = xyz[1];\n\tlet z = xyz[2];\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);\n\n\tconst l = (116 * y) - 16;\n\tconst a = 500 * (x - y);\n\tconst b = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.hsl.rgb = function (hsl) {\n\tconst h = hsl[0] / 360;\n\tconst s = hsl[1] / 100;\n\tconst l = hsl[2] / 100;\n\tlet t2;\n\tlet t3;\n\tlet val;\n\n\tif (s === 0) {\n\t\tval = l * 255;\n\t\treturn [val, val, val];\n\t}\n\n\tif (l < 0.5) {\n\t\tt2 = l * (1 + s);\n\t} else {\n\t\tt2 = l + s - l * s;\n\t}\n\n\tconst t1 = 2 * l - t2;\n\n\tconst rgb = [0, 0, 0];\n\tfor (let i = 0; i < 3; i++) {\n\t\tt3 = h + 1 / 3 * -(i - 1);\n\t\tif (t3 < 0) {\n\t\t\tt3++;\n\t\t}\n\n\t\tif (t3 > 1) {\n\t\t\tt3--;\n\t\t}\n\n\t\tif (6 * t3 < 1) {\n\t\t\tval = t1 + (t2 - t1) * 6 * t3;\n\t\t} else if (2 * t3 < 1) {\n\t\t\tval = t2;\n\t\t} else if (3 * t3 < 2) {\n\t\t\tval = t1 + (t2 - t1) * (2 / 3 - t3) * 6;\n\t\t} else {\n\t\t\tval = t1;\n\t\t}\n\n\t\trgb[i] = val * 255;\n\t}\n\n\treturn rgb;\n};\n\nconvert.hsl.hsv = function (hsl) {\n\tconst h = hsl[0];\n\tlet s = hsl[1] / 100;\n\tlet l = hsl[2] / 100;\n\tlet smin = s;\n\tconst lmin = Math.max(l, 0.01);\n\n\tl *= 2;\n\ts *= (l <= 1) ? l : 2 - l;\n\tsmin *= lmin <= 1 ? lmin : 2 - lmin;\n\tconst v = (l + s) / 2;\n\tconst sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);\n\n\treturn [h, sv * 100, v * 100];\n};\n\nconvert.hsv.rgb = function (hsv) {\n\tconst h = hsv[0] / 60;\n\tconst s = hsv[1] / 100;\n\tlet v = hsv[2] / 100;\n\tconst hi = Math.floor(h) % 6;\n\n\tconst f = h - Math.floor(h);\n\tconst p = 255 * v * (1 - s);\n\tconst q = 255 * v * (1 - (s * f));\n\tconst t = 255 * v * (1 - (s * (1 - f)));\n\tv *= 255;\n\n\tswitch (hi) {\n\t\tcase 0:\n\t\t\treturn [v, t, p];\n\t\tcase 1:\n\t\t\treturn [q, v, p];\n\t\tcase 2:\n\t\t\treturn [p, v, t];\n\t\tcase 3:\n\t\t\treturn [p, q, v];\n\t\tcase 4:\n\t\t\treturn [t, p, v];\n\t\tcase 5:\n\t\t\treturn [v, p, q];\n\t}\n};\n\nconvert.hsv.hsl = function (hsv) {\n\tconst h = hsv[0];\n\tconst s = hsv[1] / 100;\n\tconst v = hsv[2] / 100;\n\tconst vmin = Math.max(v, 0.01);\n\tlet sl;\n\tlet l;\n\n\tl = (2 - s) * v;\n\tconst lmin = (2 - s) * vmin;\n\tsl = s * vmin;\n\tsl /= (lmin <= 1) ? lmin : 2 - lmin;\n\tsl = sl || 0;\n\tl /= 2;\n\n\treturn [h, sl * 100, l * 100];\n};\n\n// http://dev.w3.org/csswg/css-color/#hwb-to-rgb\nconvert.hwb.rgb = function (hwb) {\n\tconst h = hwb[0] / 360;\n\tlet wh = hwb[1] / 100;\n\tlet bl = hwb[2] / 100;\n\tconst ratio = wh + bl;\n\tlet f;\n\n\t// Wh + bl cant be > 1\n\tif (ratio > 1) {\n\t\twh /= ratio;\n\t\tbl /= ratio;\n\t}\n\n\tconst i = Math.floor(6 * h);\n\tconst v = 1 - bl;\n\tf = 6 * h - i;\n\n\tif ((i & 0x01) !== 0) {\n\t\tf = 1 - f;\n\t}\n\n\tconst n = wh + f * (v - wh); // Linear interpolation\n\n\tlet r;\n\tlet g;\n\tlet b;\n\t/* eslint-disable max-statements-per-line,no-multi-spaces */\n\tswitch (i) {\n\t\tdefault:\n\t\tcase 6:\n\t\tcase 0: r = v; g = n; b = wh; break;\n\t\tcase 1: r = n; g = v; b = wh; break;\n\t\tcase 2: r = wh; g = v; b = n; break;\n\t\tcase 3: r = wh; g = n; b = v; break;\n\t\tcase 4: r = n; g = wh; b = v; break;\n\t\tcase 5: r = v; g = wh; b = n; break;\n\t}\n\t/* eslint-enable max-statements-per-line,no-multi-spaces */\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.cmyk.rgb = function (cmyk) {\n\tconst c = cmyk[0] / 100;\n\tconst m = cmyk[1] / 100;\n\tconst y = cmyk[2] / 100;\n\tconst k = cmyk[3] / 100;\n\n\tconst r = 1 - Math.min(1, c * (1 - k) + k);\n\tconst g = 1 - Math.min(1, m * (1 - k) + k);\n\tconst b = 1 - Math.min(1, y * (1 - k) + k);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.rgb = function (xyz) {\n\tconst x = xyz[0] / 100;\n\tconst y = xyz[1] / 100;\n\tconst z = xyz[2] / 100;\n\tlet r;\n\tlet g;\n\tlet b;\n\n\tr = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);\n\tg = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);\n\tb = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);\n\n\t// Assume sRGB\n\tr = r > 0.0031308\n\t\t? ((1.055 * (r ** (1.0 / 2.4))) - 0.055)\n\t\t: r * 12.92;\n\n\tg = g > 0.0031308\n\t\t? ((1.055 * (g ** (1.0 / 2.4))) - 0.055)\n\t\t: g * 12.92;\n\n\tb = b > 0.0031308\n\t\t? ((1.055 * (b ** (1.0 / 2.4))) - 0.055)\n\t\t: b * 12.92;\n\n\tr = Math.min(Math.max(0, r), 1);\n\tg = Math.min(Math.max(0, g), 1);\n\tb = Math.min(Math.max(0, b), 1);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.lab = function (xyz) {\n\tlet x = xyz[0];\n\tlet y = xyz[1];\n\tlet z = xyz[2];\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);\n\n\tconst l = (116 * y) - 16;\n\tconst a = 500 * (x - y);\n\tconst b = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.lab.xyz = function (lab) {\n\tconst l = lab[0];\n\tconst a = lab[1];\n\tconst b = lab[2];\n\tlet x;\n\tlet y;\n\tlet z;\n\n\ty = (l + 16) / 116;\n\tx = a / 500 + y;\n\tz = y - b / 200;\n\n\tconst y2 = y ** 3;\n\tconst x2 = x ** 3;\n\tconst z2 = z ** 3;\n\ty = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;\n\tx = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;\n\tz = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;\n\n\tx *= 95.047;\n\ty *= 100;\n\tz *= 108.883;\n\n\treturn [x, y, z];\n};\n\nconvert.lab.lch = function (lab) {\n\tconst l = lab[0];\n\tconst a = lab[1];\n\tconst b = lab[2];\n\tlet h;\n\n\tconst hr = Math.atan2(b, a);\n\th = hr * 360 / 2 / Math.PI;\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tconst c = Math.sqrt(a * a + b * b);\n\n\treturn [l, c, h];\n};\n\nconvert.lch.lab = function (lch) {\n\tconst l = lch[0];\n\tconst c = lch[1];\n\tconst h = lch[2];\n\n\tconst hr = h / 360 * 2 * Math.PI;\n\tconst a = c * Math.cos(hr);\n\tconst b = c * Math.sin(hr);\n\n\treturn [l, a, b];\n};\n\nconvert.rgb.ansi16 = function (args, saturation = null) {\n\tconst [r, g, b] = args;\n\tlet value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization\n\n\tvalue = Math.round(value / 50);\n\n\tif (value === 0) {\n\t\treturn 30;\n\t}\n\n\tlet ansi = 30\n\t\t+ ((Math.round(b / 255) << 2)\n\t\t| (Math.round(g / 255) << 1)\n\t\t| Math.round(r / 255));\n\n\tif (value === 2) {\n\t\tansi += 60;\n\t}\n\n\treturn ansi;\n};\n\nconvert.hsv.ansi16 = function (args) {\n\t// Optimization here; we already know the value and don't need to get\n\t// it converted for us.\n\treturn convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);\n};\n\nconvert.rgb.ansi256 = function (args) {\n\tconst r = args[0];\n\tconst g = args[1];\n\tconst b = args[2];\n\n\t// We use the extended greyscale palette here, with the exception of\n\t// black and white. normal palette only has 4 greyscale shades.\n\tif (r === g && g === b) {\n\t\tif (r < 8) {\n\t\t\treturn 16;\n\t\t}\n\n\t\tif (r > 248) {\n\t\t\treturn 231;\n\t\t}\n\n\t\treturn Math.round(((r - 8) / 247) * 24) + 232;\n\t}\n\n\tconst ansi = 16\n\t\t+ (36 * Math.round(r / 255 * 5))\n\t\t+ (6 * Math.round(g / 255 * 5))\n\t\t+ Math.round(b / 255 * 5);\n\n\treturn ansi;\n};\n\nconvert.ansi16.rgb = function (args) {\n\tlet color = args % 10;\n\n\t// Handle greyscale\n\tif (color === 0 || color === 7) {\n\t\tif (args > 50) {\n\t\t\tcolor += 3.5;\n\t\t}\n\n\t\tcolor = color / 10.5 * 255;\n\n\t\treturn [color, color, color];\n\t}\n\n\tconst mult = (~~(args > 50) + 1) * 0.5;\n\tconst r = ((color & 1) * mult) * 255;\n\tconst g = (((color >> 1) & 1) * mult) * 255;\n\tconst b = (((color >> 2) & 1) * mult) * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.ansi256.rgb = function (args) {\n\t// Handle greyscale\n\tif (args >= 232) {\n\t\tconst c = (args - 232) * 10 + 8;\n\t\treturn [c, c, c];\n\t}\n\n\targs -= 16;\n\n\tlet rem;\n\tconst r = Math.floor(args / 36) / 5 * 255;\n\tconst g = Math.floor((rem = args % 36) / 6) / 5 * 255;\n\tconst b = (rem % 6) / 5 * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hex = function (args) {\n\tconst integer = ((Math.round(args[0]) & 0xFF) << 16)\n\t\t+ ((Math.round(args[1]) & 0xFF) << 8)\n\t\t+ (Math.round(args[2]) & 0xFF);\n\n\tconst string = integer.toString(16).toUpperCase();\n\treturn '000000'.substring(string.length) + string;\n};\n\nconvert.hex.rgb = function (args) {\n\tconst match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);\n\tif (!match) {\n\t\treturn [0, 0, 0];\n\t}\n\n\tlet colorString = match[0];\n\n\tif (match[0].length === 3) {\n\t\tcolorString = colorString.split('').map(char => {\n\t\t\treturn char + char;\n\t\t}).join('');\n\t}\n\n\tconst integer = parseInt(colorString, 16);\n\tconst r = (integer >> 16) & 0xFF;\n\tconst g = (integer >> 8) & 0xFF;\n\tconst b = integer & 0xFF;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hcg = function (rgb) {\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\tconst max = Math.max(Math.max(r, g), b);\n\tconst min = Math.min(Math.min(r, g), b);\n\tconst chroma = (max - min);\n\tlet grayscale;\n\tlet hue;\n\n\tif (chroma < 1) {\n\t\tgrayscale = min / (1 - chroma);\n\t} else {\n\t\tgrayscale = 0;\n\t}\n\n\tif (chroma <= 0) {\n\t\thue = 0;\n\t} else\n\tif (max === r) {\n\t\thue = ((g - b) / chroma) % 6;\n\t} else\n\tif (max === g) {\n\t\thue = 2 + (b - r) / chroma;\n\t} else {\n\t\thue = 4 + (r - g) / chroma;\n\t}\n\n\thue /= 6;\n\thue %= 1;\n\n\treturn [hue * 360, chroma * 100, grayscale * 100];\n};\n\nconvert.hsl.hcg = function (hsl) {\n\tconst s = hsl[1] / 100;\n\tconst l = hsl[2] / 100;\n\n\tconst c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l));\n\n\tlet f = 0;\n\tif (c < 1.0) {\n\t\tf = (l - 0.5 * c) / (1.0 - c);\n\t}\n\n\treturn [hsl[0], c * 100, f * 100];\n};\n\nconvert.hsv.hcg = function (hsv) {\n\tconst s = hsv[1] / 100;\n\tconst v = hsv[2] / 100;\n\n\tconst c = s * v;\n\tlet f = 0;\n\n\tif (c < 1.0) {\n\t\tf = (v - c) / (1 - c);\n\t}\n\n\treturn [hsv[0], c * 100, f * 100];\n};\n\nconvert.hcg.rgb = function (hcg) {\n\tconst h = hcg[0] / 360;\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\n\tif (c === 0.0) {\n\t\treturn [g * 255, g * 255, g * 255];\n\t}\n\n\tconst pure = [0, 0, 0];\n\tconst hi = (h % 1) * 6;\n\tconst v = hi % 1;\n\tconst w = 1 - v;\n\tlet mg = 0;\n\n\t/* eslint-disable max-statements-per-line */\n\tswitch (Math.floor(hi)) {\n\t\tcase 0:\n\t\t\tpure[0] = 1; pure[1] = v; pure[2] = 0; break;\n\t\tcase 1:\n\t\t\tpure[0] = w; pure[1] = 1; pure[2] = 0; break;\n\t\tcase 2:\n\t\t\tpure[0] = 0; pure[1] = 1; pure[2] = v; break;\n\t\tcase 3:\n\t\t\tpure[0] = 0; pure[1] = w; pure[2] = 1; break;\n\t\tcase 4:\n\t\t\tpure[0] = v; pure[1] = 0; pure[2] = 1; break;\n\t\tdefault:\n\t\t\tpure[0] = 1; pure[1] = 0; pure[2] = w;\n\t}\n\t/* eslint-enable max-statements-per-line */\n\n\tmg = (1.0 - c) * g;\n\n\treturn [\n\t\t(c * pure[0] + mg) * 255,\n\t\t(c * pure[1] + mg) * 255,\n\t\t(c * pure[2] + mg) * 255\n\t];\n};\n\nconvert.hcg.hsv = function (hcg) {\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\n\tconst v = c + g * (1.0 - c);\n\tlet f = 0;\n\n\tif (v > 0.0) {\n\t\tf = c / v;\n\t}\n\n\treturn [hcg[0], f * 100, v * 100];\n};\n\nconvert.hcg.hsl = function (hcg) {\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\n\tconst l = g * (1.0 - c) + 0.5 * c;\n\tlet s = 0;\n\n\tif (l > 0.0 && l < 0.5) {\n\t\ts = c / (2 * l);\n\t} else\n\tif (l >= 0.5 && l < 1.0) {\n\t\ts = c / (2 * (1 - l));\n\t}\n\n\treturn [hcg[0], s * 100, l * 100];\n};\n\nconvert.hcg.hwb = function (hcg) {\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\tconst v = c + g * (1.0 - c);\n\treturn [hcg[0], (v - c) * 100, (1 - v) * 100];\n};\n\nconvert.hwb.hcg = function (hwb) {\n\tconst w = hwb[1] / 100;\n\tconst b = hwb[2] / 100;\n\tconst v = 1 - b;\n\tconst c = v - w;\n\tlet g = 0;\n\n\tif (c < 1) {\n\t\tg = (v - c) / (1 - c);\n\t}\n\n\treturn [hwb[0], c * 100, g * 100];\n};\n\nconvert.apple.rgb = function (apple) {\n\treturn [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];\n};\n\nconvert.rgb.apple = function (rgb) {\n\treturn [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];\n};\n\nconvert.gray.rgb = function (args) {\n\treturn [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];\n};\n\nconvert.gray.hsl = function (args) {\n\treturn [0, 0, args[0]];\n};\n\nconvert.gray.hsv = convert.gray.hsl;\n\nconvert.gray.hwb = function (gray) {\n\treturn [0, 100, gray[0]];\n};\n\nconvert.gray.cmyk = function (gray) {\n\treturn [0, 0, 0, gray[0]];\n};\n\nconvert.gray.lab = function (gray) {\n\treturn [gray[0], 0, 0];\n};\n\nconvert.gray.hex = function (gray) {\n\tconst val = Math.round(gray[0] / 100 * 255) & 0xFF;\n\tconst integer = (val << 16) + (val << 8) + val;\n\n\tconst string = integer.toString(16).toUpperCase();\n\treturn '000000'.substring(string.length) + string;\n};\n\nconvert.rgb.gray = function (rgb) {\n\tconst val = (rgb[0] + rgb[1] + rgb[2]) / 3;\n\treturn [val / 255 * 100];\n};\n","const conversions = require('./conversions');\nconst route = require('./route');\n\nconst convert = {};\n\nconst models = Object.keys(conversions);\n\nfunction wrapRaw(fn) {\n\tconst wrappedFn = function (...args) {\n\t\tconst arg0 = args[0];\n\t\tif (arg0 === undefined || arg0 === null) {\n\t\t\treturn arg0;\n\t\t}\n\n\t\tif (arg0.length > 1) {\n\t\t\targs = arg0;\n\t\t}\n\n\t\treturn fn(args);\n\t};\n\n\t// Preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nfunction wrapRounded(fn) {\n\tconst wrappedFn = function (...args) {\n\t\tconst arg0 = args[0];\n\n\t\tif (arg0 === undefined || arg0 === null) {\n\t\t\treturn arg0;\n\t\t}\n\n\t\tif (arg0.length > 1) {\n\t\t\targs = arg0;\n\t\t}\n\n\t\tconst result = fn(args);\n\n\t\t// We're assuming the result is an array here.\n\t\t// see notice in conversions.js; don't use box types\n\t\t// in conversion functions.\n\t\tif (typeof result === 'object') {\n\t\t\tfor (let len = result.length, i = 0; i < len; i++) {\n\t\t\t\tresult[i] = Math.round(result[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t};\n\n\t// Preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nmodels.forEach(fromModel => {\n\tconvert[fromModel] = {};\n\n\tObject.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});\n\tObject.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});\n\n\tconst routes = route(fromModel);\n\tconst routeModels = Object.keys(routes);\n\n\trouteModels.forEach(toModel => {\n\t\tconst fn = routes[toModel];\n\n\t\tconvert[fromModel][toModel] = wrapRounded(fn);\n\t\tconvert[fromModel][toModel].raw = wrapRaw(fn);\n\t});\n});\n\nmodule.exports = convert;\n","const conversions = require('./conversions');\n\n/*\n\tThis function routes a model to all other models.\n\n\tall functions that are routed have a property `.conversion` attached\n\tto the returned synthetic function. This property is an array\n\tof strings, each with the steps in between the 'from' and 'to'\n\tcolor models (inclusive).\n\n\tconversions that are not possible simply are not included.\n*/\n\nfunction buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}\n\n// https://en.wikipedia.org/wiki/Breadth-first_search\nfunction deriveBFS(fromModel) {\n\tconst graph = buildGraph();\n\tconst queue = [fromModel]; // Unshift -> queue -> pop\n\n\tgraph[fromModel].distance = 0;\n\n\twhile (queue.length) {\n\t\tconst current = queue.pop();\n\t\tconst adjacents = Object.keys(conversions[current]);\n\n\t\tfor (let len = adjacents.length, i = 0; i < len; i++) {\n\t\t\tconst adjacent = adjacents[i];\n\t\t\tconst node = graph[adjacent];\n\n\t\t\tif (node.distance === -1) {\n\t\t\t\tnode.distance = graph[current].distance + 1;\n\t\t\t\tnode.parent = current;\n\t\t\t\tqueue.unshift(adjacent);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn graph;\n}\n\nfunction link(from, to) {\n\treturn function (args) {\n\t\treturn to(from(args));\n\t};\n}\n\nfunction wrapConversion(toModel, graph) {\n\tconst path = [graph[toModel].parent, toModel];\n\tlet fn = conversions[graph[toModel].parent][toModel];\n\n\tlet cur = graph[toModel].parent;\n\twhile (graph[cur].parent) {\n\t\tpath.unshift(graph[cur].parent);\n\t\tfn = link(conversions[graph[cur].parent][cur], fn);\n\t\tcur = graph[cur].parent;\n\t}\n\n\tfn.conversion = path;\n\treturn fn;\n}\n\nmodule.exports = function (fromModel) {\n\tconst graph = deriveBFS(fromModel);\n\tconst conversion = {};\n\n\tconst models = Object.keys(graph);\n\tfor (let len = models.length, i = 0; i < len; i++) {\n\t\tconst toModel = models[i];\n\t\tconst node = graph[toModel];\n\n\t\tif (node.parent === null) {\n\t\t\t// No possible conversion, or this node is the source model.\n\t\t\tcontinue;\n\t\t}\n\n\t\tconversion[toModel] = wrapConversion(toModel, graph);\n\t}\n\n\treturn conversion;\n};\n\n","'use strict'\r\n\r\nmodule.exports = {\r\n\t\"aliceblue\": [240, 248, 255],\r\n\t\"antiquewhite\": [250, 235, 215],\r\n\t\"aqua\": [0, 255, 255],\r\n\t\"aquamarine\": [127, 255, 212],\r\n\t\"azure\": [240, 255, 255],\r\n\t\"beige\": [245, 245, 220],\r\n\t\"bisque\": [255, 228, 196],\r\n\t\"black\": [0, 0, 0],\r\n\t\"blanchedalmond\": [255, 235, 205],\r\n\t\"blue\": [0, 0, 255],\r\n\t\"blueviolet\": [138, 43, 226],\r\n\t\"brown\": [165, 42, 42],\r\n\t\"burlywood\": [222, 184, 135],\r\n\t\"cadetblue\": [95, 158, 160],\r\n\t\"chartreuse\": [127, 255, 0],\r\n\t\"chocolate\": [210, 105, 30],\r\n\t\"coral\": [255, 127, 80],\r\n\t\"cornflowerblue\": [100, 149, 237],\r\n\t\"cornsilk\": [255, 248, 220],\r\n\t\"crimson\": [220, 20, 60],\r\n\t\"cyan\": [0, 255, 255],\r\n\t\"darkblue\": [0, 0, 139],\r\n\t\"darkcyan\": [0, 139, 139],\r\n\t\"darkgoldenrod\": [184, 134, 11],\r\n\t\"darkgray\": [169, 169, 169],\r\n\t\"darkgreen\": [0, 100, 0],\r\n\t\"darkgrey\": [169, 169, 169],\r\n\t\"darkkhaki\": [189, 183, 107],\r\n\t\"darkmagenta\": [139, 0, 139],\r\n\t\"darkolivegreen\": [85, 107, 47],\r\n\t\"darkorange\": [255, 140, 0],\r\n\t\"darkorchid\": [153, 50, 204],\r\n\t\"darkred\": [139, 0, 0],\r\n\t\"darksalmon\": [233, 150, 122],\r\n\t\"darkseagreen\": [143, 188, 143],\r\n\t\"darkslateblue\": [72, 61, 139],\r\n\t\"darkslategray\": [47, 79, 79],\r\n\t\"darkslategrey\": [47, 79, 79],\r\n\t\"darkturquoise\": [0, 206, 209],\r\n\t\"darkviolet\": [148, 0, 211],\r\n\t\"deeppink\": [255, 20, 147],\r\n\t\"deepskyblue\": [0, 191, 255],\r\n\t\"dimgray\": [105, 105, 105],\r\n\t\"dimgrey\": [105, 105, 105],\r\n\t\"dodgerblue\": [30, 144, 255],\r\n\t\"firebrick\": [178, 34, 34],\r\n\t\"floralwhite\": [255, 250, 240],\r\n\t\"forestgreen\": [34, 139, 34],\r\n\t\"fuchsia\": [255, 0, 255],\r\n\t\"gainsboro\": [220, 220, 220],\r\n\t\"ghostwhite\": [248, 248, 255],\r\n\t\"gold\": [255, 215, 0],\r\n\t\"goldenrod\": [218, 165, 32],\r\n\t\"gray\": [128, 128, 128],\r\n\t\"green\": [0, 128, 0],\r\n\t\"greenyellow\": [173, 255, 47],\r\n\t\"grey\": [128, 128, 128],\r\n\t\"honeydew\": [240, 255, 240],\r\n\t\"hotpink\": [255, 105, 180],\r\n\t\"indianred\": [205, 92, 92],\r\n\t\"indigo\": [75, 0, 130],\r\n\t\"ivory\": [255, 255, 240],\r\n\t\"khaki\": [240, 230, 140],\r\n\t\"lavender\": [230, 230, 250],\r\n\t\"lavenderblush\": [255, 240, 245],\r\n\t\"lawngreen\": [124, 252, 0],\r\n\t\"lemonchiffon\": [255, 250, 205],\r\n\t\"lightblue\": [173, 216, 230],\r\n\t\"lightcoral\": [240, 128, 128],\r\n\t\"lightcyan\": [224, 255, 255],\r\n\t\"lightgoldenrodyellow\": [250, 250, 210],\r\n\t\"lightgray\": [211, 211, 211],\r\n\t\"lightgreen\": [144, 238, 144],\r\n\t\"lightgrey\": [211, 211, 211],\r\n\t\"lightpink\": [255, 182, 193],\r\n\t\"lightsalmon\": [255, 160, 122],\r\n\t\"lightseagreen\": [32, 178, 170],\r\n\t\"lightskyblue\": [135, 206, 250],\r\n\t\"lightslategray\": [119, 136, 153],\r\n\t\"lightslategrey\": [119, 136, 153],\r\n\t\"lightsteelblue\": [176, 196, 222],\r\n\t\"lightyellow\": [255, 255, 224],\r\n\t\"lime\": [0, 255, 0],\r\n\t\"limegreen\": [50, 205, 50],\r\n\t\"linen\": [250, 240, 230],\r\n\t\"magenta\": [255, 0, 255],\r\n\t\"maroon\": [128, 0, 0],\r\n\t\"mediumaquamarine\": [102, 205, 170],\r\n\t\"mediumblue\": [0, 0, 205],\r\n\t\"mediumorchid\": [186, 85, 211],\r\n\t\"mediumpurple\": [147, 112, 219],\r\n\t\"mediumseagreen\": [60, 179, 113],\r\n\t\"mediumslateblue\": [123, 104, 238],\r\n\t\"mediumspringgreen\": [0, 250, 154],\r\n\t\"mediumturquoise\": [72, 209, 204],\r\n\t\"mediumvioletred\": [199, 21, 133],\r\n\t\"midnightblue\": [25, 25, 112],\r\n\t\"mintcream\": [245, 255, 250],\r\n\t\"mistyrose\": [255, 228, 225],\r\n\t\"moccasin\": [255, 228, 181],\r\n\t\"navajowhite\": [255, 222, 173],\r\n\t\"navy\": [0, 0, 128],\r\n\t\"oldlace\": [253, 245, 230],\r\n\t\"olive\": [128, 128, 0],\r\n\t\"olivedrab\": [107, 142, 35],\r\n\t\"orange\": [255, 165, 0],\r\n\t\"orangered\": [255, 69, 0],\r\n\t\"orchid\": [218, 112, 214],\r\n\t\"palegoldenrod\": [238, 232, 170],\r\n\t\"palegreen\": [152, 251, 152],\r\n\t\"paleturquoise\": [175, 238, 238],\r\n\t\"palevioletred\": [219, 112, 147],\r\n\t\"papayawhip\": [255, 239, 213],\r\n\t\"peachpuff\": [255, 218, 185],\r\n\t\"peru\": [205, 133, 63],\r\n\t\"pink\": [255, 192, 203],\r\n\t\"plum\": [221, 160, 221],\r\n\t\"powderblue\": [176, 224, 230],\r\n\t\"purple\": [128, 0, 128],\r\n\t\"rebeccapurple\": [102, 51, 153],\r\n\t\"red\": [255, 0, 0],\r\n\t\"rosybrown\": [188, 143, 143],\r\n\t\"royalblue\": [65, 105, 225],\r\n\t\"saddlebrown\": [139, 69, 19],\r\n\t\"salmon\": [250, 128, 114],\r\n\t\"sandybrown\": [244, 164, 96],\r\n\t\"seagreen\": [46, 139, 87],\r\n\t\"seashell\": [255, 245, 238],\r\n\t\"sienna\": [160, 82, 45],\r\n\t\"silver\": [192, 192, 192],\r\n\t\"skyblue\": [135, 206, 235],\r\n\t\"slateblue\": [106, 90, 205],\r\n\t\"slategray\": [112, 128, 144],\r\n\t\"slategrey\": [112, 128, 144],\r\n\t\"snow\": [255, 250, 250],\r\n\t\"springgreen\": [0, 255, 127],\r\n\t\"steelblue\": [70, 130, 180],\r\n\t\"tan\": [210, 180, 140],\r\n\t\"teal\": [0, 128, 128],\r\n\t\"thistle\": [216, 191, 216],\r\n\t\"tomato\": [255, 99, 71],\r\n\t\"turquoise\": [64, 224, 208],\r\n\t\"violet\": [238, 130, 238],\r\n\t\"wheat\": [245, 222, 179],\r\n\t\"white\": [255, 255, 255],\r\n\t\"whitesmoke\": [245, 245, 245],\r\n\t\"yellow\": [255, 255, 0],\r\n\t\"yellowgreen\": [154, 205, 50]\r\n};\r\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-content code{background-color:hsla(0,0%,78%,.3);border-radius:2px;padding:.15em}.ck.ck-editor__editable .ck-code_selected{background-color:hsla(0,0%,78%,.5)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-basic-styles/theme/code.css\"],\"names\":[],\"mappings\":\"AAKA,iBACC,kCAAuC,CAEvC,iBAAkB,CADlB,aAED,CAEA,0CACC,kCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-content code {\\n\\tbackground-color: hsla(0, 0%, 78%, 0.3);\\n\\tpadding: .15em;\\n\\tborder-radius: 2px;\\n}\\n\\n.ck.ck-editor__editable .ck-code_selected {\\n\\tbackground-color: hsla(0, 0%, 78%, 0.5);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-content blockquote{border-left:5px solid #ccc;font-style:italic;margin-left:0;margin-right:0;overflow:hidden;padding-left:1.5em;padding-right:1.5em}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css\"],\"names\":[],\"mappings\":\"AAKA,uBAWC,0BAAsC,CADtC,iBAAkB,CAFlB,aAAc,CACd,cAAe,CAPf,eAAgB,CAIhB,kBAAmB,CADnB,mBAOD,CAEA,gCACC,aAAc,CACd,2BACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-content blockquote {\\n\\t/* See #12 */\\n\\toverflow: hidden;\\n\\n\\t/* https://github.com/ckeditor/ckeditor5-block-quote/issues/15 */\\n\\tpadding-right: 1.5em;\\n\\tpadding-left: 1.5em;\\n\\n\\tmargin-left: 0;\\n\\tmargin-right: 0;\\n\\tfont-style: italic;\\n\\tborder-left: solid 5px hsl(0, 0%, 80%);\\n}\\n\\n.ck-content[dir=\\\"rtl\\\"] blockquote {\\n\\tborder-left: 0;\\n\\tborder-right: solid 5px hsl(0, 0%, 80%);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-editor__editable .ck.ck-clipboard-drop-target-position{display:inline;pointer-events:none;position:relative}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{position:absolute;width:0}.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__selection-handle,.ck.ck-editor__editable .ck-widget:-webkit-drag>.ck-widget__type-around{display:none}.ck.ck-clipboard-drop-target-line{pointer-events:none;position:absolute}:root{--ck-clipboard-drop-target-dot-width:12px;--ck-clipboard-drop-target-dot-height:8px;--ck-clipboard-drop-target-color:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span{background:var(--ck-clipboard-drop-target-color);border:1px solid var(--ck-clipboard-drop-target-color);bottom:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);margin-left:-1px;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5)}.ck.ck-editor__editable .ck.ck-clipboard-drop-target-position span:after{border-color:var(--ck-clipboard-drop-target-color) transparent transparent transparent;border-style:solid;border-width:calc(var(--ck-clipboard-drop-target-dot-height)) calc(var(--ck-clipboard-drop-target-dot-width)*.5) 0 calc(var(--ck-clipboard-drop-target-dot-width)*.5);content:\\\"\\\";display:block;height:0;left:50%;position:absolute;top:calc(var(--ck-clipboard-drop-target-dot-height)*-.5);transform:translateX(-50%);width:0}.ck.ck-editor__editable .ck-widget.ck-clipboard-drop-target-range{outline:var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color)!important}.ck.ck-editor__editable .ck-widget:-webkit-drag{zoom:.6;outline:none!important}.ck.ck-clipboard-drop-target-line{background:var(--ck-clipboard-drop-target-color);border:1px solid var(--ck-clipboard-drop-target-color);height:0;margin-top:-1px}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-clipboard/clipboard.css\"],\"names\":[],\"mappings\":\"AASC,8DACC,cAAe,CAEf,mBAAoB,CADpB,iBAOD,CAJC,mEACC,iBAAkB,CAClB,OACD,CAWA,qJACC,YACD,CAIF,kCAEC,mBAAoB,CADpB,iBAED,CChCA,MACC,yCAA0C,CAC1C,yCAA0C,CAC1C,6DACD,CAOE,mEAIC,gDAAiD,CADjD,sDAAuD,CAFvD,2DAA8D,CAI9D,gBAAiB,CAHjB,wDAqBD,CAfC,yEAWC,sFAAuF,CAEvF,kBAAmB,CADnB,qKAA0K,CAX1K,UAAW,CAIX,aAAc,CAFd,QAAS,CAIT,QAAS,CADT,iBAAkB,CAElB,wDAA2D,CAE3D,0BAA2B,CAR3B,OAYD,CAOF,kEACC,gGACD,CAKA,gDACC,OAAS,CACT,sBACD,CAGD,kCAGC,gDAAiD,CADjD,sDAAuD,CADvD,QAAS,CAGT,eACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-editor__editable {\\n\\t/*\\n\\t * Vertical drop target (in text).\\n\\t */\\n\\t& .ck.ck-clipboard-drop-target-position {\\n\\t\\tdisplay: inline;\\n\\t\\tposition: relative;\\n\\t\\tpointer-events: none;\\n\\n\\t\\t& span {\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\twidth: 0;\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Styles of the widget being dragged (its preview).\\n\\t */\\n\\t& .ck-widget:-webkit-drag {\\n\\t\\t& > .ck-widget__selection-handle {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\n\\t\\t& > .ck-widget__type-around {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck.ck-clipboard-drop-target-line {\\n\\tposition: absolute;\\n\\tpointer-events: none;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-clipboard-drop-target-dot-width: 12px;\\n\\t--ck-clipboard-drop-target-dot-height: 8px;\\n\\t--ck-clipboard-drop-target-color: var(--ck-color-focus-border)\\n}\\n\\n.ck.ck-editor__editable {\\n\\t/*\\n\\t * Vertical drop target (in text).\\n\\t */\\n\\t& .ck.ck-clipboard-drop-target-position {\\n\\t\\t& span {\\n\\t\\t\\tbottom: calc(-.5 * var(--ck-clipboard-drop-target-dot-height));\\n\\t\\t\\ttop: calc(-.5 * var(--ck-clipboard-drop-target-dot-height));\\n\\t\\t\\tborder: 1px solid var(--ck-clipboard-drop-target-color);\\n\\t\\t\\tbackground: var(--ck-clipboard-drop-target-color);\\n\\t\\t\\tmargin-left: -1px;\\n\\n\\t\\t\\t/* The triangle above the marker */\\n\\t\\t\\t&::after {\\n\\t\\t\\t\\tcontent: \\\"\\\";\\n\\t\\t\\t\\twidth: 0;\\n\\t\\t\\t\\theight: 0;\\n\\n\\t\\t\\t\\tdisplay: block;\\n\\t\\t\\t\\tposition: absolute;\\n\\t\\t\\t\\tleft: 50%;\\n\\t\\t\\t\\ttop: calc(var(--ck-clipboard-drop-target-dot-height) * -.5);\\n\\n\\t\\t\\t\\ttransform: translateX(-50%);\\n\\t\\t\\t\\tborder-color: var(--ck-clipboard-drop-target-color) transparent transparent transparent;\\n\\t\\t\\t\\tborder-width: calc(var(--ck-clipboard-drop-target-dot-height)) calc(.5 * var(--ck-clipboard-drop-target-dot-width)) 0 calc(.5 * var(--ck-clipboard-drop-target-dot-width));\\n\\t\\t\\t\\tborder-style: solid;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Styles of the widget that it a drop target.\\n\\t */\\n\\t& .ck-widget.ck-clipboard-drop-target-range {\\n\\t\\toutline: var(--ck-widget-outline-thickness) solid var(--ck-clipboard-drop-target-color) !important;\\n\\t}\\n\\n\\t/*\\n\\t * Styles of the widget being dragged (its preview).\\n\\t */\\n\\t& .ck-widget:-webkit-drag {\\n\\t\\tzoom: 0.6;\\n\\t\\toutline: none !important;\\n\\t}\\n}\\n\\n.ck.ck-clipboard-drop-target-line {\\n\\theight: 0;\\n\\tborder: 1px solid var(--ck-clipboard-drop-target-color);\\n\\tbackground: var(--ck-clipboard-drop-target-color);\\n\\tmargin-top: -1px;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-content pre{background:hsla(0,0%,78%,.3);border:1px solid #c4c4c4;border-radius:2px;color:#353535;direction:ltr;font-style:normal;min-width:200px;padding:1em;tab-size:4;text-align:left;white-space:pre-wrap}.ck-content pre code{background:unset;border-radius:0;padding:0}.ck.ck-editor__editable pre{position:relative}.ck.ck-editor__editable pre[data-language]:after{content:attr(data-language);position:absolute}:root{--ck-color-code-block-label-background:#757575}.ck.ck-editor__editable pre[data-language]:after{background:var(--ck-color-code-block-label-background);color:#fff;font-family:var(--ck-font-face);font-size:10px;line-height:16px;padding:var(--ck-spacing-tiny) var(--ck-spacing-medium);right:10px;top:-1px;white-space:nowrap}.ck.ck-code-block-dropdown .ck-dropdown__panel{max-height:250px;overflow-x:hidden;overflow-y:auto}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-code-block/theme/codeblock.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-code-block/codeblock.css\"],\"names\":[],\"mappings\":\"AAKA,gBAGC,4BAAiC,CACjC,wBAAiC,CACjC,iBAAkB,CAHlB,aAAwB,CAOxB,aAAc,CAMd,iBAAkB,CAGlB,eAAgB,CAjBhB,WAAY,CAUZ,UAAW,CAHX,eAAgB,CAIhB,oBAaD,CALC,qBACC,gBAAiB,CAEjB,eAAgB,CADhB,SAED,CAGD,4BACC,iBAMD,CAJC,iDACC,2BAA4B,CAC5B,iBACD,CCjCD,MACC,8CACD,CAEA,iDAGC,sDAAuD,CAMvD,UAAuB,CAHvB,+BAAgC,CADhC,cAAe,CAEf,gBAAiB,CACjB,uDAAwD,CANxD,UAAW,CADX,QAAS,CAST,kBACD,CAEA,+CAEC,gBAAiB,CAEjB,iBAAkB,CADlB,eAED\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-content pre {\\n\\tpadding: 1em;\\n\\tcolor: hsl(0, 0%, 20.8%);\\n\\tbackground: hsla(0, 0%, 78%, 0.3);\\n\\tborder: 1px solid hsl(0, 0%, 77%);\\n\\tborder-radius: 2px;\\n\\n\\t/* Code block are language directionagnostic. */\\n\\ttext-align: left;\\n\\tdirection: ltr;\\n\\n\\ttab-size: 4;\\n\\twhite-space: pre-wrap;\\n\\n\\t/* Don't inherit the style, e.g. when in a block quote. */\\n\\tfont-style: normal;\\n\\n\\t/* Don't let the code be squashed e.g. when in a table cell. */\\n\\tmin-width: 200px;\\n\\n\\t& code {\\n\\t\\tbackground: unset;\\n\\t\\tpadding: 0;\\n\\t\\tborder-radius: 0;\\n\\t}\\n}\\n\\n.ck.ck-editor__editable pre {\\n\\tposition: relative;\\n\\n\\t&[data-language]::after {\\n\\t\\tcontent: attr(data-language);\\n\\t\\tposition: absolute;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-code-block-label-background: hsl(0, 0%, 46%);\\n}\\n\\n.ck.ck-editor__editable pre[data-language]::after {\\n\\ttop: -1px;\\n\\tright: 10px;\\n\\tbackground: var(--ck-color-code-block-label-background);\\n\\n\\tfont-size: 10px;\\n\\tfont-family: var(--ck-font-face);\\n\\tline-height: 16px;\\n\\tpadding: var(--ck-spacing-tiny) var(--ck-spacing-medium);\\n\\tcolor: hsl(0, 0%, 100%);\\n\\twhite-space: nowrap;\\n}\\n\\n.ck.ck-code-block-dropdown .ck-dropdown__panel {\\n\\t/* There could be dozens of languages available. Use scroll to prevent a 10e6px dropdown. */\\n\\tmax-height: 250px;\\n\\toverflow-y: auto;\\n\\toverflow-x: hidden;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-modal)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-editor-classic/classiceditor.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAKA,cAIC,iBAMD,CAJC,2DAEC,yBACD,CCLC,gDCED,eDKC,CAPA,uICMA,qCAAsC,CDJpC,2BAA4B,CAC5B,4BAIF,CAPA,gDAMC,qBACD,CAEA,iFACC,uBAAwB,CCR1B,eDaC,CANA,yMCHA,qCAAsC,CDOpC,eAEF,CAKF,yCAEC,0CAA2C,CCpB3C,eD8BD,CAZA,yHCdE,qCAAsC,CDmBtC,wBAAyB,CACzB,yBAMF,CAHC,0DACC,wCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-editor {\\n\\t/* All the elements within `.ck-editor` are positioned relatively to it.\\n\\t If any element needs to be positioned with respect to the <body>, etc.,\\n\\t it must land outside of the `.ck-editor` in DOM. */\\n\\tposition: relative;\\n\\n\\t& .ck-editor__top .ck-sticky-panel .ck-toolbar {\\n\\t\\t/* https://github.com/ckeditor/ckeditor5-editor-classic/issues/62 */\\n\\t\\tz-index: var(--ck-z-modal);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../mixins/_rounded.css\\\";\\n\\n.ck.ck-editor__top {\\n\\t& .ck-sticky-panel {\\n\\t\\t& .ck-toolbar {\\n\\t\\t\\t@mixin ck-rounded-corners {\\n\\t\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t\\t\\tborder-bottom-right-radius: 0;\\n\\t\\t\\t}\\n\\n\\t\\t\\tborder-bottom-width: 0;\\n\\t\\t}\\n\\n\\t\\t& .ck-sticky-panel__content_sticky .ck-toolbar {\\n\\t\\t\\tborder-bottom-width: 1px;\\n\\n\\t\\t\\t@mixin ck-rounded-corners {\\n\\t\\t\\t\\tborder-radius: 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n/* Note: Use ck-editor__main to make sure these styles don't apply to other editor types */\\n.ck.ck-editor__main > .ck-editor__editable {\\n\\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/113 */\\n\\tbackground: var(--ck-color-base-background);\\n\\n\\t@mixin ck-rounded-corners {\\n\\t\\tborder-top-left-radius: 0;\\n\\t\\tborder-top-right-radius: 0;\\n\\t}\\n\\n\\t&:not(.ck-focused) {\\n\\t\\tborder-color: var(--ck-color-base-border);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck .ck-placeholder,.ck.ck-placeholder{position:relative}.ck .ck-placeholder:before,.ck.ck-placeholder:before{content:attr(data-placeholder);left:0;pointer-events:none;position:absolute;right:0}.ck.ck-read-only .ck-placeholder:before{display:none}.ck.ck-reset_all .ck-placeholder{position:relative}.ck .ck-placeholder:before,.ck.ck-placeholder:before{color:var(--ck-color-engine-placeholder-text);cursor:text}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-engine/theme/placeholder.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-engine/placeholder.css\"],\"names\":[],\"mappings\":\"AAMA,uCAEC,iBAWD,CATC,qDAIC,8BAA+B,CAF/B,MAAO,CAKP,mBAAoB,CANpB,iBAAkB,CAElB,OAKD,CAKA,wCACC,YACD,CAQD,iCACC,iBACD,CC5BC,qDAEC,6CAA8C,CAD9C,WAED\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/* See ckeditor/ckeditor5#936. */\\n.ck.ck-placeholder,\\n.ck .ck-placeholder {\\n\\tposition: relative;\\n\\n\\t&::before {\\n\\t\\tposition: absolute;\\n\\t\\tleft: 0;\\n\\t\\tright: 0;\\n\\t\\tcontent: attr(data-placeholder);\\n\\n\\t\\t/* See ckeditor/ckeditor5#469. */\\n\\t\\tpointer-events: none;\\n\\t}\\n}\\n\\n/* See ckeditor/ckeditor5#1987. */\\n.ck.ck-read-only .ck-placeholder {\\n\\t&::before {\\n\\t\\tdisplay: none;\\n\\t}\\n}\\n\\n/*\\n * Rules for the `ck-placeholder` are loaded before the rules for `ck-reset_all` in the base CKEditor 5 DLL build.\\n * This fix overwrites the incorrectly set `position: static` from `ck-reset_all`.\\n * See https://github.com/ckeditor/ckeditor5/issues/11418.\\n */\\n.ck.ck-reset_all .ck-placeholder {\\n\\tposition: relative;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/* See ckeditor/ckeditor5#936. */\\n.ck.ck-placeholder, .ck .ck-placeholder {\\n\\t&::before {\\n\\t\\tcursor: text;\\n\\t\\tcolor: var(--ck-color-engine-placeholder-text);\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-editor__editable span[data-ck-unsafe-element]{display:none}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-engine/theme/renderer.css\"],\"names\":[],\"mappings\":\"AAMA,qDACC,YACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/* Elements marked by the Renderer as hidden should be invisible in the editor. */\\n.ck.ck-editor__editable span[data-ck-unsafe-element] {\\n\\tdisplay: none;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-find-result{background:var(--ck-color-highlight-background);color:var(--ck-color-text)}.ck-find-result_selected{background:#ff9633}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-find-and-replace/theme/findandreplace.css\"],\"names\":[],\"mappings\":\"AAKA,gBACC,+CAAgD,CAChD,0BACD,CAEA,yBACC,kBACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-find-result {\\n\\tbackground: var(--ck-color-highlight-background);\\n\\tcolor: var(--ck-color-text);\\n}\\n\\n.ck-find-result_selected {\\n\\tbackground: hsl(29, 100%, 60%);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-find-and-replace-form{max-width:100%}.ck.ck-find-and-replace-form fieldset{display:flex}.ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__find .ck-results-counter{position:absolute}.ck.ck-find-and-replace-form{width:400px}.ck.ck-find-and-replace-form:focus{outline:none}.ck.ck-find-and-replace-form fieldset{align-content:stretch;align-items:center;border:0;flex-direction:row;flex-wrap:nowrap;margin:0;padding:var(--ck-spacing-large)}.ck.ck-find-and-replace-form fieldset>.ck-button{flex:0 0 auto}[dir=ltr] .ck.ck-find-and-replace-form fieldset>*+*{margin-left:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-find-and-replace-form fieldset>*+*{margin-right:var(--ck-spacing-standard)}.ck.ck-find-and-replace-form fieldset .ck-labeled-field-view{flex:1 1 auto}.ck.ck-find-and-replace-form fieldset .ck-labeled-field-view .ck-input{min-width:50px;width:100%}.ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__find{align-items:flex-start}.ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__find>.ck-button-find{font-weight:700}.ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__find>.ck-button-find .ck-button__label{padding-left:var(--ck-spacing-large);padding-right:var(--ck-spacing-large)}.ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__find>.ck-button-prev>.ck-icon{transform:rotate(90deg)}.ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__find>.ck-button-next>.ck-icon{transform:rotate(-90deg)}.ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__find .ck-results-counter{top:50%;transform:translateY(-50%)}[dir=ltr] .ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__find .ck-results-counter{right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__find .ck-results-counter{left:var(--ck-spacing-standard)}.ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__find .ck-results-counter{color:var(--ck-color-base-border)}.ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__replace{flex-wrap:wrap;justify-content:flex-end;margin-top:calc(var(--ck-spacing-large)*-1)}.ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__replace>.ck-labeled-field-view{margin-bottom:var(--ck-spacing-large)}.ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__replace>.ck-options-dropdown{margin-left:0;margin-right:auto}.ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__replace>.ck-labeled-field-view,.ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__replace>.ck-labeled-field-view .ck-input{width:100%}@media screen and (max-width:600px){.ck.ck-find-and-replace-form{width:300px}.ck.ck-find-and-replace-form fieldset{flex-wrap:wrap}.ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__find .ck-labeled-field-view{flex:1 0 auto;margin-bottom:var(--ck-spacing-standard);width:100%}.ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__find>.ck-button{text-align:center}.ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__find>.ck-button:first-of-type{flex:1 1 auto}[dir=ltr] .ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__find>.ck-button:first-of-type{margin-left:0}[dir=rtl] .ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__find>.ck-button:first-of-type{margin-right:0}.ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__find>.ck-button:first-of-type .ck-button__label{text-align:center;width:100%}.ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__replace>:not(.ck-labeled-field-view){flex:1 1 auto}.ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__replace>.ck-dropdown:not(.ck-labeled-field-view){flex-grow:0}.ck.ck-find-and-replace-form fieldset.ck-find-and-replace-form__replace>.ck-button:not(.ck-labeled-field-view)>.ck-button__label{text-align:center;width:100%}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-find-and-replace/theme/findandreplaceform.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-find-and-replace/findandreplaceform.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\"],\"names\":[],\"mappings\":\"AAKA,6BACC,cAUD,CARC,sCACC,YAMD,CAHC,yFACC,iBACD,CCNF,6BACC,WAyGD,CAnGC,mCACC,YACD,CAEA,sCAIC,qBAAsB,CADtB,kBAAmB,CAInB,QAAS,CANT,kBAAmB,CACnB,gBAAiB,CAMjB,QAAS,CAFT,+BAwFD,CApFC,iDACC,aACD,CAGC,oDACC,sCACD,CAIA,oDACC,uCACD,CAGD,6DACC,aAMD,CAJC,uEAEC,cAAe,CADf,UAED,CAID,qEAEC,sBAkCD,CAhCC,qFACC,eAOD,CAJC,uGACC,oCAAqC,CACrC,qCACD,CAGD,8FACC,uBACD,CAEA,8FACC,wBACD,CAEA,yFACC,OAAQ,CACR,0BAWD,CAbA,mGAKE,gCAQF,CAbA,mGASE,+BAIF,CAbA,yFAYC,iCACD,CAID,wEACC,cAAe,CACf,wBAAyB,CACzB,2CAeD,CAbC,+FACC,qCACD,CAEA,6FAEC,aAAc,CADd,iBAED,CAEA,wMAEC,UACD,CCzGF,oCD+GA,6BACC,WAiDD,CA/CC,sCACC,cA6CD,CAzCE,4FACC,aAAc,CAEd,wCAAyC,CADzC,UAED,CAEA,gFACC,iBAkBD,CAhBC,8FACC,aAcD,CAfA,wGAIE,aAWF,CAfA,wGAQE,cAOF,CAJC,gHAEC,iBAAkB,CADlB,UAED,CAMH,qGACC,aAUD,CARC,iHACC,WACD,CAEA,iIAEC,iBAAkB,CADlB,UAED,CC5JH\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-find-and-replace-form {\\n\\tmax-width: 100%;\\n\\n\\t& fieldset {\\n\\t\\tdisplay: flex;\\n\\n\\t\\t/* The find fieldset */\\n\\t\\t&.ck-find-and-replace-form__find .ck-results-counter {\\n\\t\\t\\tposition: absolute;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck.ck-find-and-replace-form {\\n\\twidth: 400px;\\n\\n\\t/*\\n\\t * The <form> needs tabindex=\\\"-1\\\" for proper Esc handling after being clicked\\n\\t * but the side effect is that this creates a nasty focus outline in some browsers.\\n\\t */\\n\\t&:focus {\\n\\t\\toutline: none;\\n\\t}\\n\\n\\t& fieldset {\\n\\t\\tflex-direction: row;\\n\\t\\tflex-wrap: nowrap;\\n\\t\\talign-items: center;\\n\\t\\talign-content: stretch;\\n\\n\\t\\tpadding: var(--ck-spacing-large);\\n\\t\\tborder: 0;\\n\\t\\tmargin: 0;\\n\\n\\t\\t& > .ck-button {\\n\\t\\t\\tflex: 0 0 auto;\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t& > * + * {\\n\\t\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t& > * + * {\\n\\t\\t\\t\\tmargin-right: var(--ck-spacing-standard);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t& .ck-labeled-field-view {\\n\\t\\t\\tflex: 1 1 auto;\\n\\n\\t\\t\\t& .ck-input {\\n\\t\\t\\t\\twidth: 100%;\\n\\t\\t\\t\\tmin-width: 50px;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t/* The find fieldset */\\n\\t\\t&.ck-find-and-replace-form__find {\\n\\t\\t\\t/* To display all controls in line when there's an error under the input */\\n\\t\\t\\talign-items: flex-start;\\n\\n\\t\\t\\t& > .ck-button-find {\\n\\t\\t\\t\\tfont-weight: bold;\\n\\n\\t\\t\\t\\t/* Beef the find button up a little. It's the main action button in the form */\\n\\t\\t\\t\\t& .ck-button__label {\\n\\t\\t\\t\\t\\tpadding-left: var(--ck-spacing-large);\\n\\t\\t\\t\\t\\tpadding-right: var(--ck-spacing-large);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\t& > .ck-button-prev > .ck-icon {\\n\\t\\t\\t\\ttransform: rotate(90deg);\\n\\t\\t\\t}\\n\\n\\t\\t\\t& > .ck-button-next > .ck-icon {\\n\\t\\t\\t\\ttransform: rotate(-90deg);\\n\\t\\t\\t}\\n\\n\\t\\t\\t& .ck-results-counter {\\n\\t\\t\\t\\ttop: 50%;\\n\\t\\t\\t\\ttransform: translateY(-50%);\\n\\n\\t\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\t\\tright: var(--ck-spacing-standard);\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\t\\tleft: var(--ck-spacing-standard);\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\tcolor: var(--ck-color-base-border);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t/* The replace fieldset */\\n\\t\\t&.ck-find-and-replace-form__replace {\\n\\t\\t\\tflex-wrap: wrap;\\n\\t\\t\\tjustify-content: flex-end;\\n\\t\\t\\tmargin-top: calc( -1 * var(--ck-spacing-large) );\\n\\n\\t\\t\\t& > .ck-labeled-field-view {\\n\\t\\t\\t\\tmargin-bottom: var(--ck-spacing-large);\\n\\t\\t\\t}\\n\\n\\t\\t\\t& > .ck-options-dropdown {\\n\\t\\t\\t\\tmargin-right: auto;\\n\\t\\t\\t\\tmargin-left: 0;\\n\\t\\t\\t}\\n\\n\\t\\t\\t& > .ck-labeled-field-view,\\n\\t\\t\\t& > .ck-labeled-field-view .ck-input {\\n\\t\\t\\t\\twidth: 100%;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n@mixin ck-media-phone {\\n\\t.ck.ck-find-and-replace-form {\\n\\t\\twidth: 300px;\\n\\n\\t\\t& fieldset {\\n\\t\\t\\tflex-wrap: wrap;\\n\\n\\t\\t\\t/* The find fieldset */\\n\\t\\t\\t&.ck-find-and-replace-form__find {\\n\\t\\t\\t\\t& .ck-labeled-field-view {\\n\\t\\t\\t\\t\\tflex: 1 0 auto;\\n\\t\\t\\t\\t\\twidth: 100%;\\n\\t\\t\\t\\t\\tmargin-bottom: var(--ck-spacing-standard);\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t& > .ck-button {\\n\\t\\t\\t\\t\\ttext-align: center;\\n\\n\\t\\t\\t\\t\\t&:first-of-type {\\n\\t\\t\\t\\t\\t\\tflex: 1 1 auto;\\n\\n\\t\\t\\t\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\t\\t\\t\\tmargin-left: 0;\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\t\\t\\t\\tmargin-right: 0;\\n\\t\\t\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t\\t\\t& .ck-button__label {\\n\\t\\t\\t\\t\\t\\t\\twidth: 100%;\\n\\t\\t\\t\\t\\t\\t\\ttext-align: center;\\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\\t/* The replace fieldset */\\n\\t\\t\\t&.ck-find-and-replace-form__replace > :not(.ck-labeled-field-view) {\\n\\t\\t\\t\\tflex: 1 1 auto;\\n\\n\\t\\t\\t\\t&.ck-dropdown {\\n\\t\\t\\t\\t\\tflex-grow: 0;\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t&.ck-button > .ck-button__label {\\n\\t\\t\\t\\t\\twidth: 100%;\\n\\t\\t\\t\\t\\ttext-align: center;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-phone {\\n\\t@media screen and (max-width: 600px) {\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck .ck-button.ck-color-table__color-picker,.ck .ck-button.ck-color-table__remove-color{align-items:center;display:flex;width:100%}[dir=rtl] .ck .ck-button.ck-color-table__color-picker,[dir=rtl] .ck .ck-button.ck-color-table__remove-color{justify-content:flex-start}.ck .ck-button.ck-color-table__color-picker{border-bottom-left-radius:0;border-bottom-right-radius:0;padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard)}.ck .ck-button.ck-color-table__color-picker:not(:focus){border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck .ck-button.ck-color-table__color-picker .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck .ck-button.ck-color-table__color-picker .ck.ck-icon{margin-left:var(--ck-spacing-standard)}label.ck.ck-color-grid__label{font-weight:unset}.ck.ck-color-picker{padding:8px}.ck.ck-color-picker .hex-color-picker{height:100px;margin:0 0 var(--ck-spacing-large) 0}.ck.ck-color-picker .hex-color-picker::part(saturation){border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0}.ck.ck-color-picker .hex-color-picker::part(hue){border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius)}.ck.ck-color-picker .hex-color-picker::part(hue-pointer),.ck.ck-color-picker .hex-color-picker::part(saturation-pointer){height:15px;width:15px}.ck.ck-color-table_action-bar{display:flex;flex-direction:row;justify-content:space-around;padding:0 8px 8px}.ck.ck-color-table_action-bar .ck-button-cancel,.ck.ck-color-table_action-bar .ck-button-save{flex:1}.ck .ck-button.ck-color-table__remove-color{border-bottom-left-radius:0;border-bottom-right-radius:0;padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard)}.ck .ck-button.ck-color-table__remove-color:not(:focus){border-bottom:1px solid var(--ck-color-base-border)}[dir=ltr] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck .ck-button.ck-color-table__remove-color .ck.ck-icon{margin-left:var(--ck-spacing-standard)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-font/theme/fontcolor.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-font/fontcolor.css\"],\"names\":[],\"mappings\":\"AAOA,wFAGC,kBAAmB,CADnB,YAAa,CAEb,UAKD,CATA,4GAOE,0BAEF,CAEA,4CAEC,2BAA4B,CAC5B,4BAA6B,CAF7B,qEAiBD,CAbC,wDACC,gDACD,CAEA,kEAEE,uCAMF,CARA,kEAME,sCAEF,CAGD,8BACC,iBACD,CAEA,oBACC,WAmBD,CAjBC,sCACC,YAAa,CACb,oCAcD,CAZC,wDACC,iEACD,CACA,iDACC,iEACD,CAEA,yHAGC,WAAY,CADZ,UAED,CAIF,8BACC,YAAa,CACb,kBAAmB,CACnB,4BAA6B,CAC7B,iBAMD,CAJC,8FAEC,MACD,CClED,4CAEC,2BAA4B,CAC5B,4BAA6B,CAF7B,qEAiBD,CAbC,wDACC,mDACD,CAEA,kEAEE,uCAMF,CARA,kEAME,sCAEF\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck .ck-button.ck-color-table__remove-color,\\n.ck .ck-button.ck-color-table__color-picker {\\n\\tdisplay: flex;\\n\\talign-items: center;\\n\\twidth: 100%;\\n\\n\\t@mixin ck-dir rtl {\\n\\t\\tjustify-content: flex-start;\\n\\t}\\n}\\n\\n.ck .ck-button.ck-color-table__color-picker {\\n\\tpadding: calc(var(--ck-spacing-standard) / 2 ) var(--ck-spacing-standard);\\n\\tborder-bottom-left-radius: 0;\\n\\tborder-bottom-right-radius: 0;\\n\\n\\t&:not(:focus) {\\n\\t\\tborder-top: 1px solid var(--ck-color-base-border);\\n\\t}\\n\\n\\t& .ck.ck-icon {\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\tmargin-right: var(--ck-spacing-standard);\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t}\\n\\t}\\n}\\n\\nlabel.ck.ck-color-grid__label {\\n\\tfont-weight: unset;\\n}\\n\\n.ck.ck-color-picker {\\n\\tpadding: 8px;\\n\\n\\t& .hex-color-picker {\\n\\t\\theight: 100px;\\n\\t\\tmargin: 0 0 var(--ck-spacing-large) 0;\\n\\n\\t\\t&::part(saturation) {\\n\\t\\t\\tborder-radius: var(--ck-border-radius) var(--ck-border-radius) 0 0;\\n\\t\\t}\\n\\t\\t&::part(hue) {\\n\\t\\t\\tborder-radius: 0 0 var(--ck-border-radius) var(--ck-border-radius);\\n\\t\\t}\\n\\n\\t\\t&::part(saturation-pointer),\\n\\t\\t&::part(hue-pointer) {\\n\\t\\t\\twidth: 15px;\\n\\t\\t\\theight: 15px;\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck.ck-color-table_action-bar {\\n\\tdisplay: flex;\\n\\tflex-direction: row;\\n\\tjustify-content: space-around;\\n\\tpadding: 0 8px 8px;\\n\\n\\t& .ck-button-save,\\n\\t& .ck-button-cancel {\\n\\t\\tflex: 1\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck .ck-button.ck-color-table__remove-color {\\n\\tpadding: calc(var(--ck-spacing-standard) / 2 ) var(--ck-spacing-standard);\\n\\tborder-bottom-left-radius: 0;\\n\\tborder-bottom-right-radius: 0;\\n\\n\\t&:not(:focus) {\\n\\t\\tborder-bottom: 1px solid var(--ck-color-base-border);\\n\\t}\\n\\n\\t& .ck.ck-icon {\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\tmargin-right: var(--ck-spacing-standard);\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t}\\n\\t}\\n}\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-content .text-tiny{font-size:.7em}.ck-content .text-small{font-size:.85em}.ck-content .text-big{font-size:1.4em}.ck-content .text-huge{font-size:1.8em}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-font/theme/fontsize.css\"],\"names\":[],\"mappings\":\"AAUC,uBACC,cACD,CAEA,wBACC,eACD,CAEA,sBACC,eACD,CAEA,uBACC,eACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/* The values should be synchronized with the \\\"FONT_SIZE_PRESET_UNITS\\\" object in the \\\"/src/fontsize/utils.js\\\" file. */\\n\\n/* Styles should be prefixed with the `.ck-content` class.\\nSee https://github.com/ckeditor/ckeditor5/issues/6636 */\\n.ck-content {\\n\\t& .text-tiny {\\n\\t\\tfont-size: .7em;\\n\\t}\\n\\n\\t& .text-small {\\n\\t\\tfont-size: .85em;\\n\\t}\\n\\n\\t& .text-big {\\n\\t\\tfont-size: 1.4em;\\n\\t}\\n\\n\\t& .text-huge {\\n\\t\\tfont-size: 1.8em;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-heading/theme/heading.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-heading/heading.css\"],\"names\":[],\"mappings\":\"AAKA,wBACC,cACD,CAEA,wBACC,cACD,CAEA,wBACC,cACD,CAEA,+BACC,eACD,CCZC,2EACC,SACD,CAEA,uEACC,cACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-heading_heading1 {\\n\\tfont-size: 20px;\\n}\\n\\n.ck.ck-heading_heading2 {\\n\\tfont-size: 17px;\\n}\\n\\n.ck.ck-heading_heading3 {\\n\\tfont-size: 14px;\\n}\\n\\n.ck[class*=\\\"ck-heading_heading\\\"] {\\n\\tfont-weight: bold;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/* Resize dropdown's button label. */\\n.ck.ck-dropdown.ck-heading-dropdown {\\n\\t& .ck-dropdown__button .ck-button__label {\\n\\t\\twidth: 8em;\\n\\t}\\n\\n\\t& .ck-dropdown__panel .ck-list__item {\\n\\t\\tmin-width: 18em;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-highlight-marker-yellow:#fdfd77;--ck-highlight-marker-green:#62f962;--ck-highlight-marker-pink:#fc7899;--ck-highlight-marker-blue:#72ccfd;--ck-highlight-pen-red:#e71313;--ck-highlight-pen-green:#128a00}.ck-content .marker-yellow{background-color:var(--ck-highlight-marker-yellow)}.ck-content .marker-green{background-color:var(--ck-highlight-marker-green)}.ck-content .marker-pink{background-color:var(--ck-highlight-marker-pink)}.ck-content .marker-blue{background-color:var(--ck-highlight-marker-blue)}.ck-content .pen-red{background-color:transparent;color:var(--ck-highlight-pen-red)}.ck-content .pen-green{background-color:transparent;color:var(--ck-highlight-pen-green)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-highlight/theme/highlight.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,oCAA+C,CAC/C,mCAA+C,CAC/C,kCAA8C,CAC9C,kCAA8C,CAC9C,8BAAwC,CACxC,gCACD,CAGC,2BACC,kDACD,CAFA,0BACC,iDACD,CAFA,yBACC,gDACD,CAFA,yBACC,gDACD,CAIA,qBAIC,4BAA6B,CAH7B,iCAID,CALA,uBAIC,4BAA6B,CAH7B,mCAID\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-highlight-marker-yellow: hsl(60, 97%, 73%);\\n\\t--ck-highlight-marker-green: hsl(120, 93%, 68%);\\n\\t--ck-highlight-marker-pink: hsl(345, 96%, 73%);\\n\\t--ck-highlight-marker-blue: hsl(201, 97%, 72%);\\n\\t--ck-highlight-pen-red: hsl(0, 85%, 49%);\\n\\t--ck-highlight-pen-green: hsl(112, 100%, 27%);\\n}\\n\\n@define-mixin highlight-marker-color $color {\\n\\t.ck-content .marker-$color {\\n\\t\\tbackground-color: var(--ck-highlight-marker-$color);\\n\\t}\\n}\\n\\n@define-mixin highlight-pen-color $color {\\n\\t.ck-content .pen-$color {\\n\\t\\tcolor: var(--ck-highlight-pen-$color);\\n\\n\\t\\t/* Override default yellow background of `<mark>` from user agent stylesheet */\\n\\t\\tbackground-color: transparent;\\n\\t}\\n}\\n\\n@mixin highlight-marker-color yellow;\\n@mixin highlight-marker-color green;\\n@mixin highlight-marker-color pink;\\n@mixin highlight-marker-color blue;\\n\\n@mixin highlight-pen-color red;\\n@mixin highlight-pen-color green;\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-editor__editable .ck-horizontal-line{display:flow-root}.ck-content hr{background:#dedede;border:0;height:4px;margin:15px 0}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-horizontal-line/theme/horizontalline.css\"],\"names\":[],\"mappings\":\"AAMA,yCAEC,iBACD,CAEA,eAGC,kBAA2B,CAC3B,QAAS,CAFT,UAAW,CADX,aAID\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n\\n.ck-editor__editable .ck-horizontal-line {\\n\\t/* Necessary to render properly next to floated objects, e.g. side image case. */\\n\\tdisplay: flow-root;\\n}\\n\\n.ck-content hr {\\n\\tmargin: 15px 0;\\n\\theight: 4px;\\n\\tbackground: hsl(0, 0%, 87%);\\n\\tborder: 0;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-widget.raw-html-embed{display:flow-root;font-style:normal;margin:.9em auto;min-width:15em;position:relative}.ck-widget.raw-html-embed:before{position:absolute;z-index:1}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{display:flex;flex-direction:column;position:absolute}.ck-widget.raw-html-embed .raw-html-embed__preview{display:flex;overflow:hidden;position:relative}.ck-widget.raw-html-embed .raw-html-embed__preview-content{border-collapse:separate;border-spacing:7px;display:table;margin:auto;position:relative;width:100%}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}:root{--ck-html-embed-content-width:calc(100% - var(--ck-icon-size)*1.5);--ck-html-embed-source-height:10em;--ck-html-embed-unfocused-outline-width:1px;--ck-html-embed-content-min-height:calc(var(--ck-icon-size) + var(--ck-spacing-standard));--ck-html-embed-source-disabled-background:var(--ck-color-base-foreground);--ck-html-embed-source-disabled-color:#737373}.ck-widget.raw-html-embed{background-color:var(--ck-color-base-foreground);font-size:var(--ck-font-size-base)}.ck-widget.raw-html-embed:not(.ck-widget_selected):not(:hover){outline:var(--ck-html-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border)}.ck-widget.raw-html-embed[dir=ltr]{text-align:left}.ck-widget.raw-html-embed[dir=rtl]{text-align:right}.ck-widget.raw-html-embed:before{background:#999;border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius);color:var(--ck-color-base-background);content:attr(data-html-embed-label);font-family:var(--ck-font-face);font-size:var(--ck-font-size-tiny);left:var(--ck-spacing-standard);padding:calc(var(--ck-spacing-tiny) + var(--ck-html-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);top:calc(var(--ck-html-embed-unfocused-outline-width)*-1);transition:background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck-widget.raw-html-embed[dir=rtl]:before{left:auto;right:var(--ck-spacing-standard)}.ck-widget.raw-html-embed[dir=ltr] .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before{margin-left:50px}.ck.ck-editor__editable.ck-blurred .ck-widget.raw-html-embed.ck-widget_selected:before{padding:var(--ck-spacing-tiny) var(--ck-spacing-small);top:0}.ck.ck-editor__editable:not(.ck-blurred) .ck-widget.raw-html-embed.ck-widget_selected:before{background:var(--ck-color-focus-border);padding:var(--ck-spacing-tiny) var(--ck-spacing-small);top:0}.ck.ck-editor__editable .ck-widget.raw-html-embed:not(.ck-widget_selected):hover:before{padding:var(--ck-spacing-tiny) var(--ck-spacing-small);top:0}.ck-widget.raw-html-embed .raw-html-embed__content-wrapper{padding:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{right:var(--ck-spacing-standard);top:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__save-button{color:var(--ck-color-button-save)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__cancel-button{color:var(--ck-color-button-cancel)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button:not(:first-child){margin-top:var(--ck-spacing-small)}.ck-widget.raw-html-embed[dir=rtl] .raw-html-embed__buttons-wrapper{left:var(--ck-spacing-standard);right:auto}.ck-widget.raw-html-embed .raw-html-embed__source{box-sizing:border-box;direction:ltr;font-family:monospace;font-size:var(--ck-font-size-base);height:var(--ck-html-embed-source-height);min-width:0;padding:var(--ck-spacing-standard);resize:none;tab-size:4;text-align:left;white-space:pre-wrap;width:var(--ck-html-embed-content-width)}.ck-widget.raw-html-embed .raw-html-embed__source[disabled]{-webkit-text-fill-color:var(--ck-html-embed-source-disabled-color);background:var(--ck-html-embed-source-disabled-background);color:var(--ck-html-embed-source-disabled-color);opacity:1}.ck-widget.raw-html-embed .raw-html-embed__preview{min-height:var(--ck-html-embed-content-min-height);width:var(--ck-html-embed-content-width)}.ck-editor__editable:not(.ck-read-only) .ck-widget.raw-html-embed .raw-html-embed__preview{pointer-events:none}.ck-widget.raw-html-embed .raw-html-embed__preview-content{background-color:var(--ck-color-base-foreground);box-sizing:border-box}.ck-widget.raw-html-embed .raw-html-embed__preview-content>*{margin-left:auto;margin-right:auto}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{color:var(--ck-html-embed-source-disabled-color)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-html-embed/theme/htmlembed.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-html-embed/htmlembed.css\"],\"names\":[],\"mappings\":\"AAMA,0BAMC,iBAAkB,CAOlB,iBAAkB,CATlB,gBAAkB,CAMlB,cAAe,CALf,iBAwDD,CA5CC,iCACC,iBAAkB,CAGlB,SACD,CAKA,2DAEC,YAAa,CACb,qBAAsB,CAFtB,iBAGD,CAEA,mDAGC,YAAa,CADb,eAAgB,CADhB,iBAGD,CAEA,2DAOC,wBAAyB,CACzB,kBAAmB,CAFnB,aAAc,CAHd,WAAY,CADZ,iBAAkB,CADlB,UAQD,CAEA,+DAQC,kBAAmB,CAHnB,QAAS,CAET,YAAa,CAEb,sBAAuB,CAPvB,MAAO,CADP,iBAAkB,CAGlB,OAAQ,CADR,KAOD,CC7DD,MACC,kEAAqE,CACrE,kCAAmC,CACnC,2CAA4C,CAC5C,yFAA0F,CAE1F,0EAA2E,CAC3E,6CACD,CAGA,0BAEC,gDAAiD,CADjD,kCA0ID,CAvIC,+DACC,iGACD,CAGA,mCACC,eACD,CAEA,mCACC,gBACD,CAIA,iCAIC,eAA4B,CAG5B,iEAAkE,CAClE,qCAAsC,CAPtC,mCAAoC,CASpC,+BAAgC,CADhC,kCAAmC,CANnC,+BAAgC,CAGhC,kIAAmI,CAJnI,yDAA4D,CAG5D,0GAMD,CAEA,0CACC,SAAU,CACV,gCACD,CAGA,iIACC,gBACD,CAxCD,uFA4CE,sDAAuD,CADvD,KAgGF,CA3IA,6FAkDE,uCAAwC,CADxC,sDAAuD,CADvD,KA2FF,CA3IA,wFAuDE,sDAAuD,CADvD,KAqFF,CA/EC,2DACC,kCACD,CAGA,2DAEC,gCAAiC,CADjC,8BAcD,CAXC,kGACC,iCACD,CAEA,oGACC,mCACD,CAEA,wFACC,kCACD,CAGD,oEACC,+BAAgC,CAChC,UACD,CAGA,kDACC,qBAAsB,CActB,aAAc,CAPd,qBAAsB,CAGtB,kCAAmC,CATnC,yCAA0C,CAG1C,WAAY,CACZ,kCAAmC,CAFnC,WAAY,CAKZ,UAAW,CAKX,eAAgB,CAJhB,oBAAqB,CAPrB,wCAsBD,CARC,4DAKC,kEAAmE,CAJnE,0DAA2D,CAC3D,gDAAiD,CAIjD,SACD,CAID,mDACC,kDAAmD,CACnD,wCAMD,CARA,2FAME,mBAEF,CAEA,2DAEC,gDAAiD,CADjD,qBAOD,CAJC,6DACC,gBAAiB,CACjB,iBACD,CAGD,+DACC,gDACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/* The feature container. */\\n.ck-widget.raw-html-embed {\\n\\t/* Give the embed some air. */\\n\\t/* The first value should be equal to --ck-spacing-large variable if used in the editor context\\n\\tto avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */\\n\\tmargin: 0.9em auto;\\n\\tposition: relative;\\n\\tdisplay: flow-root;\\n\\n\\t/* Give the html embed some minimal width in the content to prevent them\\n\\tfrom being \\\"squashed\\\" in tight spaces, e.g. in table cells (https://github.com/ckeditor/ckeditor5/issues/8331) */\\n\\tmin-width: 15em;\\n\\n\\t/* Don't inherit the style, e.g. when in a block quote. */\\n\\tfont-style: normal;\\n\\n\\t/* ----- Emebed label in the upper left corner ----------------------------------------------- */\\n\\n\\t&::before {\\n\\t\\tposition: absolute;\\n\\n\\t\\t/* Make sure the content does not cover the label. */\\n\\t\\tz-index: 1;\\n\\t}\\n\\n\\t/* ----- Emebed internals --------------------------------------------------------------------- */\\n\\n\\t/* The switch mode button wrapper. */\\n\\t& .raw-html-embed__buttons-wrapper {\\n\\t\\tposition: absolute;\\n\\t\\tdisplay: flex;\\n\\t\\tflex-direction: column;\\n\\t}\\n\\n\\t& .raw-html-embed__preview {\\n\\t\\tposition: relative;\\n\\t\\toverflow: hidden;\\n\\t\\tdisplay: flex;\\n\\t}\\n\\n\\t& .raw-html-embed__preview-content {\\n\\t\\twidth: 100%;\\n\\t\\tposition: relative;\\n\\t\\tmargin: auto;\\n\\n\\t\\t/* Gives spacing to the small renderable elements, so they always cover the placeholder. */\\n\\t\\tdisplay: table;\\n\\t\\tborder-collapse: separate;\\n\\t\\tborder-spacing: 7px;\\n\\t}\\n\\n\\t& .raw-html-embed__preview-placeholder {\\n\\t\\tposition: absolute;\\n\\t\\tleft: 0;\\n\\t\\ttop: 0;\\n\\t\\tright: 0;\\n\\t\\tbottom: 0;\\n\\n\\t\\tdisplay: flex;\\n\\t\\talign-items: center;\\n\\t\\tjustify-content: center;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-html-embed-content-width: calc(100% - 1.5 * var(--ck-icon-size));\\n\\t--ck-html-embed-source-height: 10em;\\n\\t--ck-html-embed-unfocused-outline-width: 1px;\\n\\t--ck-html-embed-content-min-height: calc(var(--ck-icon-size) + var(--ck-spacing-standard));\\n\\n\\t--ck-html-embed-source-disabled-background: var(--ck-color-base-foreground);\\n\\t--ck-html-embed-source-disabled-color: hsl(0deg 0% 45%);\\n}\\n\\n/* The feature container. */\\n.ck-widget.raw-html-embed {\\n\\tfont-size: var(--ck-font-size-base);\\n\\tbackground-color: var(--ck-color-base-foreground);\\n\\n\\t&:not(.ck-widget_selected):not(:hover) {\\n\\t\\toutline: var(--ck-html-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border);\\n\\t}\\n\\n\\t/* HTML embed widget itself should respect UI language direction */\\n\\t&[dir=\\\"ltr\\\"] {\\n\\t\\ttext-align: left;\\n\\t}\\n\\n\\t&[dir=\\\"rtl\\\"] {\\n\\t\\ttext-align: right;\\n\\t}\\n\\n\\t/* ----- Embed label in the upper left corner ----------------------------------------------- */\\n\\n\\t&::before {\\n\\t\\tcontent: attr(data-html-embed-label);\\n\\t\\ttop: calc(-1 * var(--ck-html-embed-unfocused-outline-width));\\n\\t\\tleft: var(--ck-spacing-standard);\\n\\t\\tbackground: hsl(0deg 0% 60%);\\n\\t\\ttransition: background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);\\n\\t\\tpadding: calc(var(--ck-spacing-tiny) + var(--ck-html-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);\\n\\t\\tborder-radius: 0 0 var(--ck-border-radius) var(--ck-border-radius);\\n\\t\\tcolor: var(--ck-color-base-background);\\n\\t\\tfont-size: var(--ck-font-size-tiny);\\n\\t\\tfont-family: var(--ck-font-face);\\n\\t}\\n\\n\\t&[dir=\\\"rtl\\\"]::before {\\n\\t\\tleft: auto;\\n\\t\\tright: var(--ck-spacing-standard);\\n\\t}\\n\\n\\t/* Make space for label but it only collides in LTR languages */\\n\\t&[dir=\\\"ltr\\\"] .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before {\\n\\t\\tmargin-left: 50px;\\n\\t}\\n\\n\\t@nest .ck.ck-editor__editable.ck-blurred &.ck-widget_selected::before {\\n\\t\\ttop: 0px;\\n\\t\\tpadding: var(--ck-spacing-tiny) var(--ck-spacing-small);\\n\\t}\\n\\n\\t@nest .ck.ck-editor__editable:not(.ck-blurred) &.ck-widget_selected::before {\\n\\t\\ttop: 0;\\n\\t\\tpadding: var(--ck-spacing-tiny) var(--ck-spacing-small);\\n\\t\\tbackground: var(--ck-color-focus-border);\\n\\t}\\n\\n\\t@nest .ck.ck-editor__editable &:not(.ck-widget_selected):hover::before {\\n\\t\\ttop: 0px;\\n\\t\\tpadding: var(--ck-spacing-tiny) var(--ck-spacing-small);\\n\\t}\\n\\n\\t/* ----- Emebed internals --------------------------------------------------------------------- */\\n\\n\\t& .raw-html-embed__content-wrapper {\\n\\t\\tpadding: var(--ck-spacing-standard);\\n\\t}\\n\\n\\t/* The switch mode button wrapper. */\\n\\t& .raw-html-embed__buttons-wrapper {\\n\\t\\ttop: var(--ck-spacing-standard);\\n\\t\\tright: var(--ck-spacing-standard);\\n\\n\\t\\t& .ck-button.raw-html-embed__save-button {\\n\\t\\t\\tcolor: var(--ck-color-button-save);\\n\\t\\t}\\n\\n\\t\\t& .ck-button.raw-html-embed__cancel-button {\\n\\t\\t\\tcolor: var(--ck-color-button-cancel);\\n\\t\\t}\\n\\n\\t\\t& .ck-button:not(:first-child) {\\n\\t\\t\\tmargin-top: var(--ck-spacing-small);\\n\\t\\t}\\n\\t}\\n\\n\\t&[dir=\\\"rtl\\\"] .raw-html-embed__buttons-wrapper {\\n\\t\\tleft: var(--ck-spacing-standard);\\n\\t\\tright: auto;\\n\\t}\\n\\n\\t/* The edit source element. */\\n\\t& .raw-html-embed__source {\\n\\t\\tbox-sizing: border-box;\\n\\t\\theight: var(--ck-html-embed-source-height);\\n\\t\\twidth: var(--ck-html-embed-content-width);\\n\\t\\tresize: none;\\n\\t\\tmin-width: 0;\\n\\t\\tpadding: var(--ck-spacing-standard);\\n\\n\\t\\tfont-family: monospace;\\n\\t\\ttab-size: 4;\\n\\t\\twhite-space: pre-wrap;\\n\\t\\tfont-size: var(--ck-font-size-base); /* Safari needs this. */\\n\\n\\t\\t/* HTML code is directionagnostic. */\\n\\t\\ttext-align: left;\\n\\t\\tdirection: ltr;\\n\\n\\t\\t&[disabled] {\\n\\t\\t\\tbackground: var(--ck-html-embed-source-disabled-background);\\n\\t\\t\\tcolor: var(--ck-html-embed-source-disabled-color);\\n\\n\\t\\t\\t/* Safari needs this for the proper text color in disabled input (https://github.com/ckeditor/ckeditor5/issues/8320). */\\n\\t\\t\\t-webkit-text-fill-color: var(--ck-html-embed-source-disabled-color);\\n\\t\\t\\topacity: 1;\\n\\t\\t}\\n\\t}\\n\\n\\t/* The preview data container. */\\n\\t& .raw-html-embed__preview {\\n\\t\\tmin-height: var(--ck-html-embed-content-min-height);\\n\\t\\twidth: var(--ck-html-embed-content-width);\\n\\n\\t\\t/* Disable all mouse interaction as long as the editor is not readonly. */\\n\\t\\t@nest .ck-editor__editable:not(.ck-read-only) & {\\n\\t\\t\\tpointer-events: none;\\n\\t\\t}\\n\\t}\\n\\n\\t& .raw-html-embed__preview-content {\\n\\t\\tbox-sizing: border-box;\\n\\t\\tbackground-color: var(--ck-color-base-foreground);\\n\\n\\t\\t& > * {\\n\\t\\t\\tmargin-left: auto;\\n\\t\\t\\tmargin-right: auto;\\n\\t\\t}\\n\\t}\\n\\n\\t& .raw-html-embed__preview-placeholder {\\n\\t\\tcolor: var(--ck-html-embed-source-disabled-color)\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-html-object-embed-unfocused-outline-width:1px}.ck-widget.html-object-embed{background-color:var(--ck-color-base-foreground);font-size:var(--ck-font-size-base);min-width:calc(76px + var(--ck-spacing-standard));padding:var(--ck-spacing-small);padding-top:calc(var(--ck-font-size-tiny) + var(--ck-spacing-large))}.ck-widget.html-object-embed:not(.ck-widget_selected):not(:hover){outline:var(--ck-html-object-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border)}.ck-widget.html-object-embed:before{background:#999;border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius);color:var(--ck-color-base-background);content:attr(data-html-object-embed-label);font-family:var(--ck-font-face);font-size:var(--ck-font-size-tiny);font-style:normal;font-weight:400;left:var(--ck-spacing-standard);padding:calc(var(--ck-spacing-tiny) + var(--ck-html-object-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);position:absolute;top:0;transition:background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck-widget.html-object-embed .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before{margin-left:50px}.ck-widget.html-object-embed .html-object-embed__content{pointer-events:none}div.ck-widget.html-object-embed{margin:1em auto}span.ck-widget.html-object-embed{display:inline-block}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-html-support/theme/datafilter.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,kDACD,CAEA,6BAEC,gDAAiD,CADjD,kCAAmC,CAKnC,iDAAkD,CAHlD,+BAAgC,CAEhC,oEAgCD,CA7BC,kEACC,wGACD,CAEA,oCAOC,eAA4B,CAG5B,iEAAkE,CAClE,qCAAsC,CAPtC,0CAA2C,CAS3C,+BAAgC,CADhC,kCAAmC,CAVnC,iBAAkB,CADlB,eAAmB,CAKnB,+BAAgC,CAGhC,yIAA0I,CAN1I,iBAAkB,CAElB,KAAM,CAGN,0GAMD,CAGA,2HACC,gBACD,CAEA,yDAEC,mBACD,CAGD,gCACC,eACD,CAEA,iCACC,oBACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-html-object-embed-unfocused-outline-width: 1px;\\n}\\n\\n.ck-widget.html-object-embed {\\n\\tfont-size: var(--ck-font-size-base);\\n\\tbackground-color: var(--ck-color-base-foreground);\\n\\tpadding: var(--ck-spacing-small);\\n\\t/* Leave space for label */\\n\\tpadding-top: calc(var(--ck-font-size-tiny) + var(--ck-spacing-large));\\n\\tmin-width: calc(76px + var(--ck-spacing-standard));\\n\\n\\t&:not(.ck-widget_selected):not(:hover) {\\n\\t\\toutline: var(--ck-html-object-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border);\\n\\t}\\n\\n\\t&::before {\\n\\t\\tfont-weight: normal;\\n\\t\\tfont-style: normal;\\n\\t\\tposition: absolute;\\n\\t\\tcontent: attr(data-html-object-embed-label);\\n\\t\\ttop: 0;\\n\\t\\tleft: var(--ck-spacing-standard);\\n\\t\\tbackground: hsl(0deg 0% 60%);\\n\\t\\ttransition: background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);\\n\\t\\tpadding: calc(var(--ck-spacing-tiny) + var(--ck-html-object-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);\\n\\t\\tborder-radius: 0 0 var(--ck-border-radius) var(--ck-border-radius);\\n\\t\\tcolor: var(--ck-color-base-background);\\n\\t\\tfont-size: var(--ck-font-size-tiny);\\n\\t\\tfont-family: var(--ck-font-face);\\n\\t}\\n\\n\\t/* Make space for label. */\\n\\t& .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before {\\n\\t\\tmargin-left: 50px;\\n\\t}\\n\\n\\t& .html-object-embed__content {\\n\\t\\t/* Disable user interaction with embed content */\\n\\t\\tpointer-events: none;\\n\\t}\\n}\\n\\ndiv.ck-widget.html-object-embed {\\n\\tmargin: 1em auto;\\n}\\n\\nspan.ck-widget.html-object-embed {\\n\\tdisplay: inline-block;\\n}\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-content .image{clear:both;display:table;margin:.9em auto;min-width:50px;text-align:center}.ck-content .image img{display:block;margin:0 auto;max-width:100%;min-width:100%}.ck-content .image-inline{align-items:flex-start;display:inline-flex;max-width:100%}.ck-content .image-inline picture{display:flex}.ck-content .image-inline img,.ck-content .image-inline picture{flex-grow:1;flex-shrink:1;max-width:100%}.ck.ck-editor__editable .image>figcaption.ck-placeholder:before{overflow:hidden;padding-left:inherit;padding-right:inherit;text-overflow:ellipsis;white-space:nowrap}.ck.ck-editor__editable .image-inline.ck-widget_selected,.ck.ck-editor__editable .image.ck-widget_selected{z-index:1}.ck.ck-editor__editable .image-inline.ck-widget_selected ::selection{display:none}.ck.ck-editor__editable td .image-inline img,.ck.ck-editor__editable th .image-inline img{max-width:none}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/image.css\"],\"names\":[],\"mappings\":\"AAMC,mBAEC,UAAW,CADX,aAAc,CAOd,gBAAkB,CAGlB,cAAe,CARf,iBAuBD,CAbC,uBAEC,aAAc,CAGd,aAAc,CAGd,cAAe,CAGf,cACD,CAGD,0BAYC,sBAAuB,CANvB,mBAAoB,CAGpB,cAoBD,CAdC,kCACC,YACD,CAGA,gEAGC,WAAY,CACZ,aAAc,CAGd,cACD,CAUD,gEASC,eAAgB,CARhB,oBAAqB,CACrB,qBAAsB,CAQtB,sBAAuB,CAFvB,kBAGD,CAWA,2GACC,SAUD,CAHC,qEACC,YACD,CAOA,0FACC,cACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-content {\\n\\t& .image {\\n\\t\\tdisplay: table;\\n\\t\\tclear: both;\\n\\t\\ttext-align: center;\\n\\n\\t\\t/* Make sure there is some space between the content and the image. Center image by default. */\\n\\t\\t/* The first value should be equal to --ck-spacing-large variable if used in the editor context\\n\\t \\tto avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */\\n\\t\\tmargin: 0.9em auto;\\n\\n\\t\\t/* Make sure the caption will be displayed properly (See: https://github.com/ckeditor/ckeditor5/issues/1870). */\\n\\t\\tmin-width: 50px;\\n\\n\\t\\t& img {\\n\\t\\t\\t/* Prevent unnecessary margins caused by line-height (see #44). */\\n\\t\\t\\tdisplay: block;\\n\\n\\t\\t\\t/* Center the image if its width is smaller than the content's width. */\\n\\t\\t\\tmargin: 0 auto;\\n\\n\\t\\t\\t/* Make sure the image never exceeds the size of the parent container (ckeditor/ckeditor5-ui#67). */\\n\\t\\t\\tmax-width: 100%;\\n\\n\\t\\t\\t/* Make sure the image is never smaller than the parent container (See: https://github.com/ckeditor/ckeditor5/issues/9300). */\\n\\t\\t\\tmin-width: 100%\\n\\t\\t}\\n\\t}\\n\\n\\t& .image-inline {\\n\\t\\t/*\\n\\t\\t * Normally, the .image-inline would have \\\"display: inline-block\\\" and \\\"img { width: 100% }\\\" (to follow the wrapper while resizing).\\n\\t\\t * Unfortunately, together with \\\"srcset\\\", it gets automatically stretched up to the width of the editing root.\\n\\t\\t * This strange behavior does not happen with inline-flex.\\n\\t\\t */\\n\\t\\tdisplay: inline-flex;\\n\\n\\t\\t/* While being resized, don't allow the image to exceed the width of the editing root. */\\n\\t\\tmax-width: 100%;\\n\\n\\t\\t/* This is required by Safari to resize images in a sensible way. Without this, the browser breaks the ratio. */\\n\\t\\talign-items: flex-start;\\n\\n\\t\\t/* When the picture is present it must act as a flex container to let the img resize properly */\\n\\t\\t& picture {\\n\\t\\t\\tdisplay: flex;\\n\\t\\t}\\n\\n\\t\\t/* When the picture is present, it must act like a resizable img. */\\n\\t\\t& picture,\\n\\t\\t& img {\\n\\t\\t\\t/* This is necessary for the img to span the entire .image-inline wrapper and to resize properly. */\\n\\t\\t\\tflex-grow: 1;\\n\\t\\t\\tflex-shrink: 1;\\n\\n\\t\\t\\t/* Prevents overflowing the editing root boundaries when an inline image is very wide. */\\n\\t\\t\\tmax-width: 100%;\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck.ck-editor__editable {\\n\\t/*\\n\\t * Inhertit the content styles padding of the <figcaption> in case the integration overrides `text-align: center`\\n\\t * of `.image` (e.g. to the left/right). This ensures the placeholder stays at the padding just like the native\\n\\t * caret does, and not at the edge of <figcaption>.\\n\\t */\\n\\t& .image > figcaption.ck-placeholder::before {\\n\\t\\tpadding-left: inherit;\\n\\t\\tpadding-right: inherit;\\n\\n\\t\\t/*\\n\\t\\t * Make sure the image caption placeholder doesn't overflow the placeholder area.\\n\\t\\t * See https://github.com/ckeditor/ckeditor5/issues/9162.\\n\\t\\t */\\n\\t\\twhite-space: nowrap;\\n\\t\\toverflow: hidden;\\n\\t\\ttext-overflow: ellipsis;\\n\\t}\\n\\n\\n\\t/*\\n\\t * Make sure the selected inline image always stays on top of its siblings.\\n\\t * See https://github.com/ckeditor/ckeditor5/issues/9108.\\n\\t */\\n\\t& .image.ck-widget_selected {\\n\\t\\tz-index: 1;\\n\\t}\\n\\n\\t& .image-inline.ck-widget_selected {\\n\\t\\tz-index: 1;\\n\\n\\t\\t/*\\n\\t\\t * Make sure the native browser selection style is not displayed.\\n\\t\\t * Inline image widgets have their own styles for the selected state and\\n\\t\\t * leaving this up to the browser is asking for a visual collision.\\n\\t\\t */\\n\\t\\t& ::selection {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n\\n\\t/* The inline image nested in the table should have its original size if not resized.\\n\\tSee https://github.com/ckeditor/ckeditor5/issues/9117. */\\n\\t& td,\\n\\t& th {\\n\\t\\t& .image-inline img {\\n\\t\\t\\tmax-width: none;\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-color-image-caption-background:#f7f7f7;--ck-color-image-caption-text:#333;--ck-color-image-caption-highligted-background:#fd0}.ck-content .image>figcaption{background-color:var(--ck-color-image-caption-background);caption-side:bottom;color:var(--ck-color-image-caption-text);display:table-caption;font-size:.75em;outline-offset:-1px;padding:.6em;word-break:break-word}.ck.ck-editor__editable .image>figcaption.image__caption_highlighted{animation:ck-image-caption-highlight .6s ease-out}@keyframes ck-image-caption-highlight{0%{background-color:var(--ck-color-image-caption-highligted-background)}to{background-color:var(--ck-color-image-caption-background)}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imagecaption.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,2CAAoD,CACpD,kCAA8C,CAC9C,mDACD,CAGA,8BAKC,yDAA0D,CAH1D,mBAAoB,CAEpB,wCAAyC,CAHzC,qBAAsB,CAMtB,eAAgB,CAChB,mBAAoB,CAFpB,YAAa,CAHb,qBAMD,CAGA,qEACC,iDACD,CAEA,sCACC,GACC,oEACD,CAEA,GACC,yDACD,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-image-caption-background: hsl(0, 0%, 97%);\\n\\t--ck-color-image-caption-text: hsl(0, 0%, 20%);\\n\\t--ck-color-image-caption-highligted-background: hsl(52deg 100% 50%);\\n}\\n\\n/* Content styles */\\n.ck-content .image > figcaption {\\n\\tdisplay: table-caption;\\n\\tcaption-side: bottom;\\n\\tword-break: break-word;\\n\\tcolor: var(--ck-color-image-caption-text);\\n\\tbackground-color: var(--ck-color-image-caption-background);\\n\\tpadding: .6em;\\n\\tfont-size: .75em;\\n\\toutline-offset: -1px;\\n}\\n\\n/* Editing styles */\\n.ck.ck-editor__editable .image > figcaption.image__caption_highlighted {\\n\\tanimation: ck-image-caption-highlight .6s ease-out;\\n}\\n\\n@keyframes ck-image-caption-highlight {\\n\\t0% {\\n\\t\\tbackground-color: var(--ck-color-image-caption-highligted-background);\\n\\t}\\n\\n\\t100% {\\n\\t\\tbackground-color: var(--ck-color-image-caption-background);\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-image-insert__panel{padding:var(--ck-spacing-large)}.ck.ck-image-insert__ck-finder-button{border:1px solid #ccc;border-radius:var(--ck-border-radius);display:block;margin:var(--ck-spacing-standard) auto;width:100%}.ck.ck-splitbutton>.ck-file-dialog-button.ck-button{border:none;margin:0;padding:0}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageinsert.css\"],\"names\":[],\"mappings\":\"AAKA,2BACC,+BACD,CAEA,sCAIC,qBAAiC,CACjC,qCAAsC,CAJtC,aAAc,CAEd,sCAAuC,CADvC,UAID,CAGA,oDAGC,WAAY,CADZ,QAAS,CADT,SAGD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-image-insert__panel {\\n\\tpadding: var(--ck-spacing-large);\\n}\\n\\n.ck.ck-image-insert__ck-finder-button {\\n\\tdisplay: block;\\n\\twidth: 100%;\\n\\tmargin: var(--ck-spacing-standard) auto;\\n\\tborder: 1px solid hsl(0, 0%, 80%);\\n\\tborder-radius: var(--ck-border-radius);\\n}\\n\\n/* https://github.com/ckeditor/ckeditor5/issues/7986 */\\n.ck.ck-splitbutton > .ck-file-dialog-button.ck-button {\\n\\tpadding: 0;\\n\\tmargin: 0;\\n\\tborder: none;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-image-insert-form:focus{outline:none}.ck.ck-form__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.ck.ck-form__row>:not(.ck-label){flex-grow:1}.ck.ck-form__row.ck-image-insert-form__action-row{margin-top:var(--ck-spacing-standard)}.ck.ck-form__row.ck-image-insert-form__action-row .ck-button-cancel,.ck.ck-form__row.ck-image-insert-form__action-row .ck-button-save{justify-content:center}.ck.ck-form__row.ck-image-insert-form__action-row .ck-button .ck-button__label{color:var(--ck-color-text)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageinsertformrowview.css\"],\"names\":[],\"mappings\":\"AAMC,+BAEC,YACD,CAGD,iBACC,YAAa,CACb,kBAAmB,CACnB,gBAAiB,CACjB,6BAmBD,CAhBC,iCACC,WACD,CAEA,kDACC,qCAUD,CARC,sIAEC,sBACD,CAEA,+EACC,0BACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-image-insert-form {\\n\\t&:focus {\\n\\t\\t/* See: https://github.com/ckeditor/ckeditor5/issues/4773 */\\n\\t\\toutline: none;\\n\\t}\\n}\\n\\n.ck.ck-form__row {\\n\\tdisplay: flex;\\n\\tflex-direction: row;\\n\\tflex-wrap: nowrap;\\n\\tjustify-content: space-between;\\n\\n\\t/* Ignore labels that work as fieldset legends */\\n\\t& > *:not(.ck-label) {\\n\\t\\tflex-grow: 1;\\n\\t}\\n\\n\\t&.ck-image-insert-form__action-row {\\n\\t\\tmargin-top: var(--ck-spacing-standard);\\n\\n\\t\\t& .ck-button-save,\\n\\t\\t& .ck-button-cancel {\\n\\t\\t\\tjustify-content: center;\\n\\t\\t}\\n\\n\\t\\t& .ck-button .ck-button__label {\\n\\t\\t\\tcolor: var(--ck-color-text);\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-content .image.image_resized{box-sizing:border-box;display:block;max-width:100%}.ck-content .image.image_resized img{width:100%}.ck-content .image.image_resized>figcaption{display:block}.ck.ck-editor__editable td .image-inline.image_resized img,.ck.ck-editor__editable th .image-inline.image_resized img{max-width:100%}[dir=ltr] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon{margin-left:var(--ck-spacing-standard)}.ck.ck-dropdown .ck-button.ck-resize-image-button .ck-button__label{width:4em}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageresize.css\"],\"names\":[],\"mappings\":\"AAKA,iCAQC,qBAAsB,CADtB,aAAc,CANd,cAkBD,CATC,qCAEC,UACD,CAEA,4CAEC,aACD,CAQC,sHACC,cACD,CAIF,oFACC,uCACD,CAEA,oFACC,sCACD,CAEA,oEACC,SACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-content .image.image_resized {\\n\\tmax-width: 100%;\\n\\t/*\\n\\tThe `<figure>` element for resized images must not use `display:table` as browsers do not support `max-width` for it well.\\n\\tSee https://stackoverflow.com/questions/4019604/chrome-safari-ignoring-max-width-in-table/14420691#14420691 for more.\\n\\tFortunately, since we control the width, there is no risk that the image will look bad.\\n\\t*/\\n\\tdisplay: block;\\n\\tbox-sizing: border-box;\\n\\n\\t& img {\\n\\t\\t/* For resized images it is the `<figure>` element that determines the image width. */\\n\\t\\twidth: 100%;\\n\\t}\\n\\n\\t& > figcaption {\\n\\t\\t/* The `<figure>` element uses `display:block`, so `<figcaption>` also has to. */\\n\\t\\tdisplay: block;\\n\\t}\\n}\\n\\n.ck.ck-editor__editable {\\n\\t/* The resized inline image nested in the table should respect its parent size.\\n\\tSee https://github.com/ckeditor/ckeditor5/issues/9117. */\\n\\t& td,\\n\\t& th {\\n\\t\\t& .image-inline.image_resized img {\\n\\t\\t\\tmax-width: 100%;\\n\\t\\t}\\n\\t}\\n}\\n\\n[dir=\\\"ltr\\\"] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon {\\n\\tmargin-right: var(--ck-spacing-standard);\\n}\\n\\n[dir=\\\"rtl\\\"] .ck.ck-button.ck-button_with-text.ck-resize-image-button .ck-button__icon {\\n\\tmargin-left: var(--ck-spacing-standard);\\n}\\n\\n.ck.ck-dropdown .ck-button.ck-resize-image-button .ck-button__label {\\n\\twidth: 4em;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-image-style-spacing:1.5em;--ck-inline-image-style-spacing:calc(var(--ck-image-style-spacing)/2)}.ck-content .image-style-block-align-left,.ck-content .image-style-block-align-right{max-width:calc(100% - var(--ck-image-style-spacing))}.ck-content .image-style-align-left,.ck-content .image-style-align-right{clear:none}.ck-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing);max-width:50%}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}.ck-content .image-style-block-align-right{margin-left:auto;margin-right:0}.ck-content .image-style-block-align-left{margin-left:0;margin-right:auto}.ck-content p+.image-style-align-left,.ck-content p+.image-style-align-right,.ck-content p+.image-style-side{margin-top:0}.ck-content .image-inline.image-style-align-left,.ck-content .image-inline.image-style-align-right{margin-bottom:var(--ck-inline-image-style-spacing);margin-top:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-left{margin-right:var(--ck-inline-image-style-spacing)}.ck-content .image-inline.image-style-align-right{margin-left:var(--ck-inline-image-style-spacing)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-background)}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__action:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton.ck-splitbutton_flatten:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover):after{display:none}.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__action:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled),.ck.ck-splitbutton.ck-splitbutton_flatten.ck-splitbutton_open:hover>.ck-splitbutton__arrow:not(.ck-disabled):not(:hover){background-color:var(--ck-color-button-on-hover-background)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imagestyle.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,8BAA+B,CAC/B,qEACD,CAMC,qFAEC,oDACD,CAIA,yEAEC,UACD,CAEA,8BACC,WAAY,CACZ,yCAA0C,CAC1C,aACD,CAEA,oCACC,UAAW,CACX,0CACD,CAEA,sCACC,gBAAiB,CACjB,iBACD,CAEA,qCACC,WAAY,CACZ,yCACD,CAEA,2CAEC,gBAAiB,CADjB,cAED,CAEA,0CACC,aAAc,CACd,iBACD,CAGA,6GAGC,YACD,CAGC,mGAGC,kDAAmD,CADnD,+CAED,CAEA,iDACC,iDACD,CAEA,kDACC,gDACD,CAUC,0lBAGC,qDAKD,CAHC,8nBACC,YACD,CAKD,oVAGC,2DACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-image-style-spacing: 1.5em;\\n\\t--ck-inline-image-style-spacing: calc(var(--ck-image-style-spacing) / 2);\\n}\\n\\n.ck-content {\\n\\t/* Provides a minimal side margin for the left and right aligned images, so that the user has a visual feedback\\n\\tconfirming successful application of the style if image width exceeds the editor's size.\\n\\tSee https://github.com/ckeditor/ckeditor5/issues/9342 */\\n\\t& .image-style-block-align-left,\\n\\t& .image-style-block-align-right {\\n\\t\\tmax-width: calc(100% - var(--ck-image-style-spacing));\\n\\t}\\n\\n\\t/* Allows displaying multiple floating images in the same line.\\n\\tSee https://github.com/ckeditor/ckeditor5/issues/9183#issuecomment-804988132 */\\n\\t& .image-style-align-left,\\n\\t& .image-style-align-right {\\n\\t\\tclear: none;\\n\\t}\\n\\n\\t& .image-style-side {\\n\\t\\tfloat: right;\\n\\t\\tmargin-left: var(--ck-image-style-spacing);\\n\\t\\tmax-width: 50%;\\n\\t}\\n\\n\\t& .image-style-align-left {\\n\\t\\tfloat: left;\\n\\t\\tmargin-right: var(--ck-image-style-spacing);\\n\\t}\\n\\n\\t& .image-style-align-center {\\n\\t\\tmargin-left: auto;\\n\\t\\tmargin-right: auto;\\n\\t}\\n\\n\\t& .image-style-align-right {\\n\\t\\tfloat: right;\\n\\t\\tmargin-left: var(--ck-image-style-spacing);\\n\\t}\\n\\n\\t& .image-style-block-align-right {\\n\\t\\tmargin-right: 0;\\n\\t\\tmargin-left: auto;\\n\\t}\\n\\n\\t& .image-style-block-align-left {\\n\\t\\tmargin-left: 0;\\n\\t\\tmargin-right: auto;\\n\\t}\\n\\n\\t/* Simulates margin collapsing with the preceding paragraph, which does not work for the floating elements. */\\n\\t& p + .image-style-align-left,\\n\\t& p + .image-style-align-right,\\n\\t& p + .image-style-side {\\n\\t\\tmargin-top: 0;\\n\\t}\\n\\n\\t& .image-inline {\\n\\t\\t&.image-style-align-left,\\n\\t\\t&.image-style-align-right {\\n\\t\\t\\tmargin-top: var(--ck-inline-image-style-spacing);\\n\\t\\t\\tmargin-bottom: var(--ck-inline-image-style-spacing);\\n\\t\\t}\\n\\n\\t\\t&.image-style-align-left {\\n\\t\\t\\tmargin-right: var(--ck-inline-image-style-spacing);\\n\\t\\t}\\n\\n\\t\\t&.image-style-align-right {\\n\\t\\t\\tmargin-left: var(--ck-inline-image-style-spacing);\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck.ck-splitbutton {\\n\\t/* The button should display as a regular drop-down if the action button\\n\\tis forced to fire the same action as the arrow button. */\\n\\t&.ck-splitbutton_flatten {\\n\\t\\t&:hover,\\n\\t\\t&.ck-splitbutton_open {\\n\\t\\t\\t& > .ck-splitbutton__action:not(.ck-disabled),\\n\\t\\t\\t& > .ck-splitbutton__arrow:not(.ck-disabled),\\n\\t\\t\\t& > .ck-splitbutton__arrow:not(.ck-disabled):not(:hover) {\\n\\t\\t\\t\\tbackground-color: var(--ck-color-button-on-background);\\n\\n\\t\\t\\t\\t&::after {\\n\\t\\t\\t\\t\\tdisplay: none;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&.ck-splitbutton_open:hover {\\n\\t\\t\\t& > .ck-splitbutton__action:not(.ck-disabled),\\n\\t\\t\\t& > .ck-splitbutton__arrow:not(.ck-disabled),\\n\\t\\t\\t& > .ck-splitbutton__arrow:not(.ck-disabled):not(:hover) {\\n\\t\\t\\t\\tbackground-color: var(--ck-color-button-on-hover-background);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-image-upload-complete-icon{border-radius:50%;display:block;position:absolute;right:min(var(--ck-spacing-medium),6%);top:min(var(--ck-spacing-medium),6%);z-index:1}.ck-image-upload-complete-icon:after{content:\\\"\\\";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20;--ck-image-upload-icon-width:2px;--ck-image-upload-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck-image-upload-complete-icon{animation-delay:0ms,3s;animation-duration:.5s,.5s;animation-fill-mode:forwards,forwards;animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;background:var(--ck-color-image-upload-icon-background);font-size:calc(1px*var(--ck-image-upload-icon-size));height:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size));opacity:0;overflow:hidden;width:calc(var(--ck-image-upload-icon-is-visible)*var(--ck-image-upload-icon-size))}.ck-image-upload-complete-icon:after{animation-delay:.5s;animation-duration:.5s;animation-fill-mode:forwards;animation-name:ck-upload-complete-icon-check;border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);box-sizing:border-box;height:0;left:25%;opacity:0;top:50%;transform:scaleX(-1) rotate(135deg);transform-origin:left top;width:0}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{height:0;opacity:1;width:0}33%{height:0;width:.3em}to{height:.45em;opacity:1;width:.3em}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadicon.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadicon.css\"],\"names\":[],\"mappings\":\"AAKA,+BAUC,iBAAkB,CATlB,aAAc,CACd,iBAAkB,CAOlB,sCAAwC,CADxC,oCAAsC,CAGtC,SAMD,CAJC,qCACC,UAAW,CACX,iBACD,CChBD,MACC,iCAA8C,CAC9C,+CAA4D,CAG5D,8BAA+B,CAC/B,gCAAiC,CACjC,4DACD,CAEA,+BAWC,sBAA4B,CAN5B,0BAAgC,CADhC,qCAAuC,CADvC,wEAA0E,CAD1E,uDAAwD,CAMxD,oDAAuD,CAWvD,oFAAuF,CAlBvF,SAAU,CAgBV,eAAgB,CAChB,mFA0BD,CAtBC,qCAgBC,mBAAsB,CADtB,sBAAyB,CAEzB,4BAA6B,CAH7B,4CAA6C,CAF7C,sFAAuF,CADvF,oFAAqF,CASrF,qBAAsB,CAdtB,QAAS,CAJT,QAAS,CAGT,SAAU,CADV,OAAQ,CAKR,mCAAoC,CACpC,yBAA0B,CAH1B,OAcD,CAGD,wCACC,GACC,SACD,CAEA,GACC,SACD,CACD,CAEA,wCACC,GACC,SACD,CAEA,GACC,SACD,CACD,CAEA,yCACC,GAGC,QAAS,CAFT,SAAU,CACV,OAED,CACA,IAEC,QAAS,CADT,UAED,CACA,GAGC,YAAc,CAFd,SAAU,CACV,UAED,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-image-upload-complete-icon {\\n\\tdisplay: block;\\n\\tposition: absolute;\\n\\n\\t/*\\n\\t * Smaller images should have the icon closer to the border.\\n\\t * Match the icon position with the linked image indicator brought by the link image feature.\\n\\t */\\n\\ttop: min(var(--ck-spacing-medium), 6%);\\n\\tright: min(var(--ck-spacing-medium), 6%);\\n\\tborder-radius: 50%;\\n\\tz-index: 1;\\n\\n\\t&::after {\\n\\t\\tcontent: \\\"\\\";\\n\\t\\tposition: absolute;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-image-upload-icon: hsl(0, 0%, 100%);\\n\\t--ck-color-image-upload-icon-background: hsl(120, 100%, 27%);\\n\\n\\t/* Match the icon size with the linked image indicator brought by the link image feature. */\\n\\t--ck-image-upload-icon-size: 20;\\n\\t--ck-image-upload-icon-width: 2px;\\n\\t--ck-image-upload-icon-is-visible: clamp(0px, 100% - 50px, 1px);\\n}\\n\\n.ck-image-upload-complete-icon {\\n\\topacity: 0;\\n\\tbackground: var(--ck-color-image-upload-icon-background);\\n\\tanimation-name: ck-upload-complete-icon-show, ck-upload-complete-icon-hide;\\n\\tanimation-fill-mode: forwards, forwards;\\n\\tanimation-duration: 500ms, 500ms;\\n\\n\\t/* To make animation scalable. */\\n\\tfont-size: calc(1px * var(--ck-image-upload-icon-size));\\n\\n\\t/* Hide completed upload icon after 3 seconds. */\\n\\tanimation-delay: 0ms, 3000ms;\\n\\n\\t/*\\n\\t * Use CSS math to simulate container queries.\\n\\t * https://css-tricks.com/the-raven-technique-one-step-closer-to-container-queries/#what-about-showing-and-hiding-things\\n\\t */\\n\\toverflow: hidden;\\n\\twidth: calc(var(--ck-image-upload-icon-is-visible) * var(--ck-image-upload-icon-size));\\n\\theight: calc(var(--ck-image-upload-icon-is-visible) * var(--ck-image-upload-icon-size));\\n\\n\\t/* This is check icon element made from border-width mixed with animations. */\\n\\t&::after {\\n\\t\\t/* Because of border transformation we need to \\\"hard code\\\" left position. */\\n\\t\\tleft: 25%;\\n\\n\\t\\ttop: 50%;\\n\\t\\topacity: 0;\\n\\t\\theight: 0;\\n\\t\\twidth: 0;\\n\\n\\t\\ttransform: scaleX(-1) rotate(135deg);\\n\\t\\ttransform-origin: left top;\\n\\t\\tborder-top: var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);\\n\\t\\tborder-right: var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);\\n\\n\\t\\tanimation-name: ck-upload-complete-icon-check;\\n\\t\\tanimation-duration: 500ms;\\n\\t\\tanimation-delay: 500ms;\\n\\t\\tanimation-fill-mode: forwards;\\n\\n\\t\\t/* #1095. While reset is not providing proper box-sizing for pseudoelements, we need to handle it. */\\n\\t\\tbox-sizing: border-box;\\n\\t}\\n}\\n\\n@keyframes ck-upload-complete-icon-show {\\n\\tfrom {\\n\\t\\topacity: 0;\\n\\t}\\n\\n\\tto {\\n\\t\\topacity: 1;\\n\\t}\\n}\\n\\n@keyframes ck-upload-complete-icon-hide {\\n\\tfrom {\\n\\t\\topacity: 1;\\n\\t}\\n\\n\\tto {\\n\\t\\topacity: 0;\\n\\t}\\n}\\n\\n@keyframes ck-upload-complete-icon-check {\\n\\t0% {\\n\\t\\topacity: 1;\\n\\t\\twidth: 0;\\n\\t\\theight: 0;\\n\\t}\\n\\t33% {\\n\\t\\twidth: 0.3em;\\n\\t\\theight: 0;\\n\\t}\\n\\t100% {\\n\\t\\topacity: 1;\\n\\t\\twidth: 0.3em;\\n\\t\\theight: 0.45em;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck .ck-upload-placeholder-loader{align-items:center;display:flex;justify-content:center;left:0;position:absolute;top:0}.ck .ck-upload-placeholder-loader:before{content:\\\"\\\";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px;--ck-upload-placeholder-image-aspect-ratio:2.8}.ck .ck-image-upload-placeholder{margin:0;width:100%}.ck .ck-image-upload-placeholder.image-inline{width:calc(var(--ck-upload-placeholder-loader-size)*2*var(--ck-upload-placeholder-image-aspect-ratio))}.ck .ck-image-upload-placeholder img{aspect-ratio:var(--ck-upload-placeholder-image-aspect-ratio)}.ck .ck-upload-placeholder-loader{height:100%;width:100%}.ck .ck-upload-placeholder-loader:before{animation:ck-upload-placeholder-loader 1s linear infinite;border-radius:50%;border-right:2px solid transparent;border-top:3px solid var(--ck-color-upload-placeholder-loader);height:var(--ck-upload-placeholder-loader-size);width:var(--ck-upload-placeholder-loader-size)}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadloader.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadloader.css\"],\"names\":[],\"mappings\":\"AAKA,kCAGC,kBAAmB,CADnB,YAAa,CAEb,sBAAuB,CAEvB,MAAO,CALP,iBAAkB,CAIlB,KAOD,CAJC,yCACC,UAAW,CACX,iBACD,CCXD,MACC,4CAAqD,CACrD,wCAAyC,CACzC,8CACD,CAEA,iCAGC,QAAS,CADT,UAgBD,CAbC,8CACC,sGACD,CAEA,qCAOC,4DACD,CAGD,kCAEC,WAAY,CADZ,UAWD,CARC,yCAMC,yDAA0D,CAH1D,iBAAkB,CAElB,kCAAmC,CADnC,8DAA+D,CAF/D,+CAAgD,CADhD,8CAMD,CAGD,wCACC,GACC,uBACD,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck .ck-upload-placeholder-loader {\\n\\tposition: absolute;\\n\\tdisplay: flex;\\n\\talign-items: center;\\n\\tjustify-content: center;\\n\\ttop: 0;\\n\\tleft: 0;\\n\\n\\t&::before {\\n\\t\\tcontent: '';\\n\\t\\tposition: relative;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-upload-placeholder-loader: hsl(0, 0%, 70%);\\n\\t--ck-upload-placeholder-loader-size: 32px;\\n\\t--ck-upload-placeholder-image-aspect-ratio: 2.8;\\n}\\n\\n.ck .ck-image-upload-placeholder {\\n\\t/* We need to control the full width of the SVG gray background. */\\n\\twidth: 100%;\\n\\tmargin: 0;\\n\\n\\t&.image-inline {\\n\\t\\twidth: calc( 2 * var(--ck-upload-placeholder-loader-size) * var(--ck-upload-placeholder-image-aspect-ratio) );\\n\\t}\\n\\n\\t& img {\\n\\t\\t/*\\n\\t\\t * This is an arbitrary aspect for a 1x1 px GIF to display to the user. Not too tall, not too short.\\n\\t\\t * There's nothing special about this number except that it should make the image placeholder look like\\n\\t\\t * a real image during this short period after the upload started and before the image was read from the\\n\\t\\t * file system (and a rich preview was loaded).\\n\\t\\t */\\n\\t\\taspect-ratio: var(--ck-upload-placeholder-image-aspect-ratio);\\n\\t}\\n}\\n\\n.ck .ck-upload-placeholder-loader {\\n\\twidth: 100%;\\n\\theight: 100%;\\n\\n\\t&::before {\\n\\t\\twidth: var(--ck-upload-placeholder-loader-size);\\n\\t\\theight: var(--ck-upload-placeholder-loader-size);\\n\\t\\tborder-radius: 50%;\\n\\t\\tborder-top: 3px solid var(--ck-color-upload-placeholder-loader);\\n\\t\\tborder-right: 2px solid transparent;\\n\\t\\tanimation: ck-upload-placeholder-loader 1s linear infinite;\\n\\t}\\n}\\n\\n@keyframes ck-upload-placeholder-loader {\\n\\tto {\\n\\t\\ttransform: rotate( 360deg );\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-editor__editable .image,.ck.ck-editor__editable .image-inline{position:relative}.ck.ck-editor__editable .image .ck-progress-bar,.ck.ck-editor__editable .image-inline .ck-progress-bar{left:0;position:absolute;top:0}.ck.ck-editor__editable .image-inline.ck-appear,.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}.ck.ck-editor__editable .image .ck-progress-bar,.ck.ck-editor__editable .image-inline .ck-progress-bar{background:var(--ck-color-upload-bar-background);height:2px;transition:width .1s;width:0}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/imageuploadprogress.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-image/imageuploadprogress.css\"],\"names\":[],\"mappings\":\"AAMC,qEAEC,iBACD,CAGA,uGAIC,MAAO,CAFP,iBAAkB,CAClB,KAED,CCRC,yFACC,oBACD,CAID,uGAIC,gDAAiD,CAFjD,UAAW,CAGX,oBAAuB,CAFvB,OAGD,CAGD,kBACC,GAAO,SAAY,CACnB,GAAO,SAAY,CACpB\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-editor__editable {\\n\\t& .image,\\n\\t& .image-inline {\\n\\t\\tposition: relative;\\n\\t}\\n\\n\\t/* Upload progress bar. */\\n\\t& .image .ck-progress-bar,\\n\\t& .image-inline .ck-progress-bar {\\n\\t\\tposition: absolute;\\n\\t\\ttop: 0;\\n\\t\\tleft: 0;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-editor__editable {\\n\\t& .image,\\n\\t& .image-inline {\\n\\t\\t/* Showing animation. */\\n\\t\\t&.ck-appear {\\n\\t\\t\\tanimation: fadeIn 700ms;\\n\\t\\t}\\n\\t}\\n\\n\\t/* Upload progress bar. */\\n\\t& .image .ck-progress-bar,\\n\\t& .image-inline .ck-progress-bar {\\n\\t\\theight: 2px;\\n\\t\\twidth: 0;\\n\\t\\tbackground: var(--ck-color-upload-bar-background);\\n\\t\\ttransition: width 100ms;\\n\\t}\\n}\\n\\n@keyframes fadeIn {\\n\\tfrom { opacity: 0; }\\n\\tto { opacity: 1; }\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-field-view{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-image/theme/textalternativeform.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\"],\"names\":[],\"mappings\":\"AAOA,6BACC,YAAa,CACb,kBAAmB,CACnB,gBAqBD,CAnBC,oDACC,oBACD,CAEA,uCACC,YACD,CCZA,oCDCD,6BAcE,cAUF,CARE,oDACC,eACD,CAEA,wCACC,cACD,CCrBD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n\\n.ck.ck-text-alternative-form {\\n\\tdisplay: flex;\\n\\tflex-direction: row;\\n\\tflex-wrap: nowrap;\\n\\n\\t& .ck-labeled-field-view {\\n\\t\\tdisplay: inline-block;\\n\\t}\\n\\n\\t& .ck-label {\\n\\t\\tdisplay: none;\\n\\t}\\n\\n\\t@mixin ck-media-phone {\\n\\t\\tflex-wrap: wrap;\\n\\n\\t\\t& .ck-labeled-field-view {\\n\\t\\t\\tflex-basis: 100%;\\n\\t\\t}\\n\\n\\t\\t& .ck-button {\\n\\t\\t\\tflex-basis: 50%;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-phone {\\n\\t@media screen and (max-width: 600px) {\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}.ck .ck-link_selected span.image-inline{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background)}.ck .ck-fake-link-selection{background:var(--ck-color-link-fake-selection)}.ck .ck-fake-link-selection_collapsed{border-right:1px solid var(--ck-color-base-text);height:100%;margin-right:-1px;outline:1px solid hsla(0,0%,100%,.5)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/link.css\"],\"names\":[],\"mappings\":\"AAMA,sBACC,mDAMD,CAHC,wCACC,yFACD,CAOD,4BACC,8CACD,CAGA,sCAEC,gDAAiD,CADjD,WAAY,CAEZ,iBAAkB,CAClB,oCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/* Class added to span element surrounding currently selected link. */\\n.ck .ck-link_selected {\\n\\tbackground: var(--ck-color-link-selected-background);\\n\\n\\t/* Give linked inline images some outline to let the user know they are also part of the link. */\\n\\t& span.image-inline {\\n\\t\\toutline: var(--ck-widget-outline-thickness) solid var(--ck-color-link-selected-background);\\n\\t}\\n}\\n\\n/*\\n * Classes used by the \\\"fake visual selection\\\" displayed in the content when an input\\n * in the link UI has focus (the browser does not render the native selection in this state).\\n */\\n.ck .ck-fake-link-selection {\\n\\tbackground: var(--ck-color-link-fake-selection);\\n}\\n\\n/* A collapsed fake visual selection. */\\n.ck .ck-fake-link-selection_collapsed {\\n\\theight: 100%;\\n\\tborder-right: 1px solid var(--ck-color-base-text);\\n\\tmargin-right: -1px;\\n\\toutline: solid 1px hsla(0, 0%, 100%, .5);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{color:var(--ck-color-link-default);cursor:pointer;max-width:var(--ck-input-width);min-width:3em;padding:0 var(--ck-spacing-medium);text-align:center;text-overflow:ellipsis}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{max-width:100%;min-width:0}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview),[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-link/theme/linkactions.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/linkactions.css\"],\"names\":[],\"mappings\":\"AAOA,oBACC,YAAa,CACb,kBAAmB,CACnB,gBAqBD,CAnBC,8CACC,oBAKD,CAHC,gEACC,eACD,CCXD,oCDCD,oBAcE,cAUF,CARE,8CACC,eACD,CAEA,8DACC,cACD,CCrBD,CCIA,wDACC,cAAe,CACf,eAmCD,CAjCC,0EAEC,kCAAmC,CAEnC,cAAe,CAIf,+BAAgC,CAChC,aAAc,CARd,kCAAmC,CASnC,iBAAkB,CAPlB,sBAYD,CAHC,gFACC,yBACD,CAGD,mPAIC,eACD,CAEA,+DACC,eACD,CAGC,gFACC,yBACD,CAWD,qHACC,sCACD,CDtDD,oCC0DC,wDACC,8DAMD,CAJC,0EAEC,cAAe,CADf,WAED,CAGD,gJAME,aAEF,CDzED\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n\\n.ck.ck-link-actions {\\n\\tdisplay: flex;\\n\\tflex-direction: row;\\n\\tflex-wrap: nowrap;\\n\\n\\t& .ck-link-actions__preview {\\n\\t\\tdisplay: inline-block;\\n\\n\\t\\t& .ck-button__label {\\n\\t\\t\\toverflow: hidden;\\n\\t\\t}\\n\\t}\\n\\n\\t@mixin ck-media-phone {\\n\\t\\tflex-wrap: wrap;\\n\\n\\t\\t& .ck-link-actions__preview {\\n\\t\\t\\tflex-basis: 100%;\\n\\t\\t}\\n\\n\\t\\t& .ck-button:not(.ck-link-actions__preview) {\\n\\t\\t\\tflex-basis: 50%;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-phone {\\n\\t@media screen and (max-width: 600px) {\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n@import \\\"../mixins/_focus.css\\\";\\n@import \\\"../mixins/_shadow.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n\\n.ck.ck-link-actions {\\n\\t& .ck-button.ck-link-actions__preview {\\n\\t\\tpadding-left: 0;\\n\\t\\tpadding-right: 0;\\n\\n\\t\\t& .ck-button__label {\\n\\t\\t\\tpadding: 0 var(--ck-spacing-medium);\\n\\t\\t\\tcolor: var(--ck-color-link-default);\\n\\t\\t\\ttext-overflow: ellipsis;\\n\\t\\t\\tcursor: pointer;\\n\\n\\t\\t\\t/* Match the box model of the link editor form's input so the balloon\\n\\t\\t\\tdoes not change width when moving between actions and the form. */\\n\\t\\t\\tmax-width: var(--ck-input-width);\\n\\t\\t\\tmin-width: 3em;\\n\\t\\t\\ttext-align: center;\\n\\n\\t\\t\\t&:hover {\\n\\t\\t\\t\\ttext-decoration: underline;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&,\\n\\t\\t&:hover,\\n\\t\\t&:focus,\\n\\t\\t&:active {\\n\\t\\t\\tbackground: none;\\n\\t\\t}\\n\\n\\t\\t&:active {\\n\\t\\t\\tbox-shadow: none;\\n\\t\\t}\\n\\n\\t\\t&:focus {\\n\\t\\t\\t& .ck-button__label {\\n\\t\\t\\t\\ttext-decoration: underline;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t@mixin ck-dir ltr {\\n\\t\\t& .ck-button:not(:first-child) {\\n\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t}\\n\\t}\\n\\n\\t@mixin ck-dir rtl {\\n\\t\\t& .ck-button:not(:last-child) {\\n\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t}\\n\\t}\\n\\n\\t@mixin ck-media-phone {\\n\\t\\t& .ck-button.ck-link-actions__preview {\\n\\t\\t\\tmargin: var(--ck-spacing-standard) var(--ck-spacing-standard) 0;\\n\\n\\t\\t\\t& .ck-button__label {\\n\\t\\t\\t\\tmin-width: 0;\\n\\t\\t\\t\\tmax-width: 100%;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t& .ck-button:not(.ck-link-actions__preview) {\\n\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\tmargin-left: 0;\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tmargin-left: 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-link-form{display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form_layout-vertical .ck-button.ck-button-cancel,.ck.ck-link-form_layout-vertical .ck-button.ck-button-save{margin-top:var(--ck-spacing-medium)}.ck.ck-link-form_layout-vertical{min-width:var(--ck-input-width);padding:0}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical>.ck-button{border-radius:0;margin:0;padding:var(--ck-spacing-standard);width:50%}.ck.ck-link-form_layout-vertical>.ck-button:not(:focus){border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-link-form_layout-vertical>.ck-button,[dir=rtl] .ck.ck-link-form_layout-vertical>.ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical>.ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin:var(--ck-spacing-standard) var(--ck-spacing-large)}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{padding:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-link/theme/linkform.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/linkform.css\"],\"names\":[],\"mappings\":\"AAOA,iBACC,YAiBD,CAfC,2BACC,YACD,CCNA,oCDCD,iBAQE,cAUF,CARE,wCACC,eACD,CAEA,4BACC,cACD,CCfD,CDuBD,iCACC,aAYD,CALE,wHAEC,mCACD,CE/BF,iCAEC,+BAAgC,CADhC,SAgDD,CA7CC,wDACC,8EAMD,CAJC,uEACC,WAAY,CACZ,UACD,CAGD,4CAIC,eAAgB,CAFhB,QAAS,CADT,kCAAmC,CAEnC,SAkBD,CAfC,wDACC,gDACD,CARD,4GAeE,aAMF,CAJE,mEACC,kDACD,CAKF,6CACC,yDAUD,CARC,wEACC,SAAU,CACV,UAKD,CAHC,8EACC,eACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n\\n.ck.ck-link-form {\\n\\tdisplay: flex;\\n\\n\\t& .ck-label {\\n\\t\\tdisplay: none;\\n\\t}\\n\\n\\t@mixin ck-media-phone {\\n\\t\\tflex-wrap: wrap;\\n\\n\\t\\t& .ck-labeled-field-view {\\n\\t\\t\\tflex-basis: 100%;\\n\\t\\t}\\n\\n\\t\\t& .ck-button {\\n\\t\\t\\tflex-basis: 50%;\\n\\t\\t}\\n\\t}\\n}\\n\\n/*\\n * Style link form differently when manual decorators are available.\\n * See: https://github.com/ckeditor/ckeditor5-link/issues/186.\\n */\\n.ck.ck-link-form_layout-vertical {\\n\\tdisplay: block;\\n\\n\\t/*\\n\\t * Whether the form is in the responsive mode or not, if there are decorator buttons\\n\\t * keep the top margin of action buttons medium.\\n\\t */\\n\\t& .ck-button {\\n\\t\\t&.ck-button-save,\\n\\t\\t&.ck-button-cancel {\\n\\t\\t\\tmargin-top: var(--ck-spacing-medium);\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-phone {\\n\\t@media screen and (max-width: 600px) {\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n/*\\n * Style link form differently when manual decorators are available.\\n * See: https://github.com/ckeditor/ckeditor5-link/issues/186.\\n */\\n.ck.ck-link-form_layout-vertical {\\n\\tpadding: 0;\\n\\tmin-width: var(--ck-input-width);\\n\\n\\t& .ck-labeled-field-view {\\n\\t\\tmargin: var(--ck-spacing-large) var(--ck-spacing-large) var(--ck-spacing-small);\\n\\n\\t\\t& .ck-input-text {\\n\\t\\t\\tmin-width: 0;\\n\\t\\t\\twidth: 100%;\\n\\t\\t}\\n\\t}\\n\\n\\t& > .ck-button {\\n\\t\\tpadding: var(--ck-spacing-standard);\\n\\t\\tmargin: 0;\\n\\t\\twidth: 50%;\\n\\t\\tborder-radius: 0;\\n\\n\\t\\t&:not(:focus) {\\n\\t\\t\\tborder-top: 1px solid var(--ck-color-base-border);\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\tmargin-left: 0;\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\tmargin-left: 0;\\n\\n\\t\\t\\t&:last-of-type {\\n\\t\\t\\t\\tborder-right: 1px solid var(--ck-color-base-border);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t/* Using additional `.ck` class for stronger CSS specificity than `.ck.ck-link-form > :not(:first-child)`. */\\n\\t& .ck.ck-list {\\n\\t\\tmargin: var(--ck-spacing-standard) var(--ck-spacing-large);\\n\\n\\t\\t& .ck-button.ck-switchbutton {\\n\\t\\t\\tpadding: 0;\\n\\t\\t\\twidth: 100%;\\n\\n\\t\\t\\t&:hover {\\n\\t\\t\\t\\tbackground: none;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-editor__editable a span.image-inline:after,.ck.ck-editor__editable figure.image>a:after{display:block;position:absolute}:root{--ck-link-image-indicator-icon-size:20;--ck-link-image-indicator-icon-is-visible:clamp(0px,100% - 50px,1px)}.ck.ck-editor__editable a span.image-inline:after,.ck.ck-editor__editable figure.image>a:after{background-color:rgba(0,0,0,.4);background-image:url(\\\"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2ZmZiIgZD0ibTExLjA3NyAxNSAuOTkxLTEuNDE2YS43NS43NSAwIDEgMSAxLjIyOS44NmwtMS4xNDggMS42NGEuNzQ4Ljc0OCAwIDAgMS0uMjE3LjIwNiA1LjI1MSA1LjI1MSAwIDAgMS04LjUwMy01Ljk1NS43NDEuNzQxIDAgMCAxIC4xMi0uMjc0bDEuMTQ3LTEuNjM5YS43NS43NSAwIDEgMSAxLjIyOC44Nkw0LjkzMyAxMC43bC4wMDYuMDAzYTMuNzUgMy43NSAwIDAgMCA2LjEzMiA0LjI5NGwuMDA2LjAwNHptNS40OTQtNS4zMzVhLjc0OC43NDggMCAwIDEtLjEyLjI3NGwtMS4xNDcgMS42MzlhLjc1Ljc1IDAgMSAxLTEuMjI4LS44NmwuODYtMS4yM2EzLjc1IDMuNzUgMCAwIDAtNi4xNDQtNC4zMDFsLS44NiAxLjIyOWEuNzUuNzUgMCAwIDEtMS4yMjktLjg2bDEuMTQ4LTEuNjRhLjc0OC43NDggMCAwIDEgLjIxNy0uMjA2IDUuMjUxIDUuMjUxIDAgMCAxIDguNTAzIDUuOTU1em0tNC41NjMtMi41MzJhLjc1Ljc1IDAgMCAxIC4xODQgMS4wNDVsLTMuMTU1IDQuNTA1YS43NS43NSAwIDEgMS0xLjIyOS0uODZsMy4xNTUtNC41MDZhLjc1Ljc1IDAgMCAxIDEuMDQ1LS4xODR6Ii8+PC9zdmc+\\\");background-position:50%;background-repeat:no-repeat;background-size:14px;border-radius:100%;content:\\\"\\\";height:calc(var(--ck-link-image-indicator-icon-is-visible)*var(--ck-link-image-indicator-icon-size));overflow:hidden;right:min(var(--ck-spacing-medium),6%);top:min(var(--ck-spacing-medium),6%);width:calc(var(--ck-link-image-indicator-icon-is-visible)*var(--ck-link-image-indicator-icon-size))}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-link/theme/linkimage.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-link/linkimage.css\"],\"names\":[],\"mappings\":\"AASE,+FACC,aAAc,CACd,iBACD,CCPF,MAEC,sCAAuC,CACvC,oEACD,CAME,+FAUC,+BAAqC,CACrC,83BAA+3B,CAG/3B,uBAA2B,CAD3B,2BAA4B,CAD5B,oBAAqB,CAGrB,kBAAmB,CAdnB,UAAW,CAsBX,oGAAuG,CAFvG,eAAgB,CAbhB,sCAAwC,CADxC,oCAAsC,CAetC,mGAED\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-editor__editable {\\n\\t/* Linked image indicator */\\n\\t& figure.image > a,\\n\\t& a span.image-inline {\\n\\t\\t&::after {\\n\\t\\t\\tdisplay: block;\\n\\t\\t\\tposition: absolute;\\n\\t\\t}\\n\\t}\\n}\\n\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t/* Match the icon size with the upload indicator brought by the image upload feature. */\\n\\t--ck-link-image-indicator-icon-size: 20;\\n\\t--ck-link-image-indicator-icon-is-visible: clamp(0px, 100% - 50px, 1px);\\n}\\n\\n.ck.ck-editor__editable {\\n\\t/* Linked image indicator */\\n\\t& figure.image > a,\\n\\t& a span.image-inline {\\n\\t\\t&::after {\\n\\t\\t\\tcontent: \\\"\\\";\\n\\n\\t\\t\\t/*\\n\\t\\t\\t * Smaller images should have the icon closer to the border.\\n\\t\\t\\t * Match the icon position with the upload indicator brought by the image upload feature.\\n\\t\\t\\t */\\n\\t\\t\\ttop: min(var(--ck-spacing-medium), 6%);\\n\\t\\t\\tright: min(var(--ck-spacing-medium), 6%);\\n\\n\\t\\t\\tbackground-color: hsla(0, 0%, 0%, .4);\\n\\t\\t\\tbackground-image: url(\\\"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2ZmZiIgZD0ibTExLjA3NyAxNSAuOTkxLTEuNDE2YS43NS43NSAwIDEgMSAxLjIyOS44NmwtMS4xNDggMS42NGEuNzQ4Ljc0OCAwIDAgMS0uMjE3LjIwNiA1LjI1MSA1LjI1MSAwIDAgMS04LjUwMy01Ljk1NS43NDEuNzQxIDAgMCAxIC4xMi0uMjc0bDEuMTQ3LTEuNjM5YS43NS43NSAwIDEgMSAxLjIyOC44Nkw0LjkzMyAxMC43bC4wMDYuMDAzYTMuNzUgMy43NSAwIDAgMCA2LjEzMiA0LjI5NGwuMDA2LjAwNHptNS40OTQtNS4zMzVhLjc0OC43NDggMCAwIDEtLjEyLjI3NGwtMS4xNDcgMS42MzlhLjc1Ljc1IDAgMSAxLTEuMjI4LS44NmwuODYtMS4yM2EzLjc1IDMuNzUgMCAwIDAtNi4xNDQtNC4zMDFsLS44NiAxLjIyOWEuNzUuNzUgMCAwIDEtMS4yMjktLjg2bDEuMTQ4LTEuNjRhLjc0OC43NDggMCAwIDEgLjIxNy0uMjA2IDUuMjUxIDUuMjUxIDAgMCAxIDguNTAzIDUuOTU1em0tNC41NjMtMi41MzJhLjc1Ljc1IDAgMCAxIC4xODQgMS4wNDVsLTMuMTU1IDQuNTA1YS43NS43NSAwIDEgMS0xLjIyOS0uODZsMy4xNTUtNC41MDZhLjc1Ljc1IDAgMCAxIDEuMDQ1LS4xODR6Ii8+PC9zdmc+\\\");\\n\\t\\t\\tbackground-size: 14px;\\n\\t\\t\\tbackground-repeat: no-repeat;\\n\\t\\t\\tbackground-position: center;\\n\\t\\t\\tborder-radius: 100%;\\n\\n\\t\\t\\t/*\\n\\t\\t\\t* Use CSS math to simulate container queries.\\n\\t\\t\\t* https://css-tricks.com/the-raven-technique-one-step-closer-to-container-queries/#what-about-showing-and-hiding-things\\n\\t\\t\\t*/\\n\\t\\t\\toverflow: hidden;\\n\\t\\t\\twidth: calc(var(--ck-link-image-indicator-icon-is-visible) * var(--ck-link-image-indicator-icon-size));\\n\\t\\t\\theight: calc(var(--ck-link-image-indicator-icon-is-visible) * var(--ck-link-image-indicator-icon-size));\\n\\t\\t}\\n\\t}\\n}\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-collapsible.ck-collapsible_collapsed>.ck-collapsible__children{display:none}:root{--ck-collapsible-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-collapsible>.ck.ck-button{border-radius:0;color:inherit;font-weight:700;padding:var(--ck-spacing-medium) var(--ck-spacing-large);width:100%}.ck.ck-collapsible>.ck.ck-button:focus{background:transparent}.ck.ck-collapsible>.ck.ck-button:active,.ck.ck-collapsible>.ck.ck-button:hover:not(:focus),.ck.ck-collapsible>.ck.ck-button:not(:focus){background:transparent;border-color:transparent;box-shadow:none}.ck.ck-collapsible>.ck.ck-button>.ck-icon{margin-right:var(--ck-spacing-medium);width:var(--ck-collapsible-arrow-size)}.ck.ck-collapsible>.ck-collapsible__children{padding:0 var(--ck-spacing-large) var(--ck-spacing-large)}.ck.ck-collapsible.ck-collapsible_collapsed>.ck.ck-button .ck-icon{transform:rotate(-90deg)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-list/theme/collapsible.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-list/collapsible.css\"],\"names\":[],\"mappings\":\"AAMC,sEACC,YACD,CCHD,MACC,yDACD,CAGC,iCAIC,eAAgB,CAChB,aAAc,CAHd,eAAiB,CACjB,wDAAyD,CAFzD,UAoBD,CAdC,uCACC,sBACD,CAEA,wIACC,sBAAuB,CACvB,wBAAyB,CACzB,eACD,CAEA,0CACC,qCAAsC,CACtC,sCACD,CAGD,6CACC,yDACD,CAGC,mEACC,wBACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-collapsible.ck-collapsible_collapsed {\\n\\t& > .ck-collapsible__children {\\n\\t\\tdisplay: none;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-collapsible-arrow-size: calc(0.5 * var(--ck-icon-size));\\n}\\n\\n.ck.ck-collapsible {\\n\\t& > .ck.ck-button {\\n\\t\\twidth: 100%;\\n\\t\\tfont-weight: bold;\\n\\t\\tpadding: var(--ck-spacing-medium) var(--ck-spacing-large);\\n\\t\\tborder-radius: 0;\\n\\t\\tcolor: inherit;\\n\\n\\t\\t&:focus {\\n\\t\\t\\tbackground: transparent;\\n\\t\\t}\\n\\n\\t\\t&:active, &:not(:focus), &:hover:not(:focus) {\\n\\t\\t\\tbackground: transparent;\\n\\t\\t\\tborder-color: transparent;\\n\\t\\t\\tbox-shadow: none;\\n\\t\\t}\\n\\n\\t\\t& > .ck-icon {\\n\\t\\t\\tmargin-right: var(--ck-spacing-medium);\\n\\t\\t\\twidth: var(--ck-collapsible-arrow-size);\\n\\t\\t}\\n\\t}\\n\\n\\t& > .ck-collapsible__children {\\n\\t\\tpadding: 0 var(--ck-spacing-large) var(--ck-spacing-large);\\n\\t}\\n\\n\\t&.ck-collapsible_collapsed {\\n\\t\\t& > .ck.ck-button .ck-icon {\\n\\t\\t\\ttransform: rotate(-90deg);\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-content ol{list-style-type:decimal}.ck-content ol ol{list-style-type:lower-latin}.ck-content ol ol ol{list-style-type:lower-roman}.ck-content ol ol ol ol{list-style-type:upper-latin}.ck-content ol ol ol ol ol{list-style-type:upper-roman}.ck-content ul{list-style-type:disc}.ck-content ul ul{list-style-type:circle}.ck-content ul ul ul,.ck-content ul ul ul ul{list-style-type:square}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-list/theme/list.css\"],\"names\":[],\"mappings\":\"AAKA,eACC,uBAiBD,CAfC,kBACC,2BAaD,CAXC,qBACC,2BASD,CAPC,wBACC,2BAKD,CAHC,2BACC,2BACD,CAMJ,eACC,oBAaD,CAXC,kBACC,sBASD,CAJE,6CACC,sBACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-content ol {\\n\\tlist-style-type: decimal;\\n\\n\\t& ol {\\n\\t\\tlist-style-type: lower-latin;\\n\\n\\t\\t& ol {\\n\\t\\t\\tlist-style-type: lower-roman;\\n\\n\\t\\t\\t& ol {\\n\\t\\t\\t\\tlist-style-type: upper-latin;\\n\\n\\t\\t\\t\\t& ol {\\n\\t\\t\\t\\t\\tlist-style-type: upper-roman;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck-content ul {\\n\\tlist-style-type: disc;\\n\\n\\t& ul {\\n\\t\\tlist-style-type: circle;\\n\\n\\t\\t& ul {\\n\\t\\t\\tlist-style-type: square;\\n\\n\\t\\t\\t& ul {\\n\\t\\t\\t\\tlist-style-type: square;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-list-properties.ck-list-properties_without-styles{padding:var(--ck-spacing-large)}.ck.ck-list-properties.ck-list-properties_without-styles>*{min-width:14em}.ck.ck-list-properties.ck-list-properties_without-styles>*+*{margin-top:var(--ck-spacing-standard)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-list-styles-list{grid-template-columns:repeat(4,auto)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible{border-top:1px solid var(--ck-color-base-border)}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible>.ck-collapsible__children>*{width:100%}.ck.ck-list-properties.ck-list-properties_with-numbered-properties>.ck-collapsible>.ck-collapsible__children>*+*{margin-top:var(--ck-spacing-standard)}.ck.ck-list-properties .ck.ck-numbered-list-properties__start-index .ck-input{min-width:auto;width:100%}.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order{background:transparent;margin-bottom:calc(var(--ck-spacing-tiny)*-1);padding-left:0;padding-right:0}.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order:active,.ck.ck-list-properties .ck.ck-numbered-list-properties__reversed-order:hover{background:none;border-color:transparent;box-shadow:none}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-list/listproperties.css\"],\"names\":[],\"mappings\":\"AAOC,yDACC,+BASD,CAPC,2DACC,cAKD,CAHC,6DACC,qCACD,CASD,wFACC,oCACD,CAGA,mFACC,gDAWD,CARE,+GACC,UAKD,CAHC,iHACC,qCACD,CAMJ,8EACC,cAAe,CACf,UACD,CAEA,uEACC,sBAAuB,CAGvB,6CAAgD,CAFhD,cAAe,CACf,eAQD,CALC,2JAGC,eAAgB,CADhB,wBAAyB,CADzB,eAGD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-list-properties {\\n\\t/* When there are no list styles and there is no collapsible. */\\n\\t&.ck-list-properties_without-styles {\\n\\t\\tpadding: var(--ck-spacing-large);\\n\\n\\t\\t& > * {\\n\\t\\t\\tmin-width: 14em;\\n\\n\\t\\t\\t& + * {\\n\\t\\t\\t\\tmargin-top: var(--ck-spacing-standard);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * When the numbered list property fields (start at, reversed) should be displayed,\\n\\t * more horizontal space is needed. Reconfigure the style grid to create that space.\\n\\t */\\n\\t&.ck-list-properties_with-numbered-properties {\\n\\t\\t& > .ck-list-styles-list {\\n\\t\\t\\tgrid-template-columns: repeat( 4, auto );\\n\\t\\t}\\n\\n\\t\\t/* When list styles are rendered and property fields are in a collapsible. */\\n\\t\\t& > .ck-collapsible {\\n\\t\\t\\tborder-top: 1px solid var(--ck-color-base-border);\\n\\n\\t\\t\\t& > .ck-collapsible__children {\\n\\t\\t\\t\\t& > * {\\n\\t\\t\\t\\t\\twidth: 100%;\\n\\n\\t\\t\\t\\t\\t& + * {\\n\\t\\t\\t\\t\\t\\tmargin-top: var(--ck-spacing-standard);\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck.ck-numbered-list-properties__start-index .ck-input {\\n\\t\\tmin-width: auto;\\n\\t\\twidth: 100%;\\n\\t}\\n\\n\\t& .ck.ck-numbered-list-properties__reversed-order {\\n\\t\\tbackground: transparent;\\n\\t\\tpadding-left: 0;\\n\\t\\tpadding-right: 0;\\n\\t\\tmargin-bottom: calc(-1 * var(--ck-spacing-tiny));\\n\\n\\t\\t&:active, &:hover {\\n\\t\\t\\tbox-shadow: none;\\n\\t\\t\\tborder-color: transparent;\\n\\t\\t\\tbackground: none;\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-list-styles-list{display:grid}:root{--ck-list-style-button-size:44px}.ck.ck-list-styles-list{column-gap:var(--ck-spacing-medium);grid-template-columns:repeat(3,auto);padding:var(--ck-spacing-large);row-gap:var(--ck-spacing-medium)}.ck.ck-list-styles-list .ck-button{box-sizing:content-box;margin:0;padding:0}.ck.ck-list-styles-list .ck-button,.ck.ck-list-styles-list .ck-button .ck-icon{height:var(--ck-list-style-button-size);width:var(--ck-list-style-button-size)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-list/theme/liststyles.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-list/liststyles.css\"],\"names\":[],\"mappings\":\"AAKA,wBACC,YACD,CCFA,MACC,gCACD,CAEA,wBAGC,mCAAoC,CAFpC,oCAAwC,CAGxC,+BAAgC,CAFhC,gCA4BD,CAxBC,mCAiBC,sBAAuB,CAPvB,QAAS,CANT,SAmBD,CAJC,+EAhBA,uCAAwC,CADxC,sCAoBA\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-list-styles-list {\\n\\tdisplay: grid;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-list-style-button-size: 44px;\\n}\\n\\n.ck.ck-list-styles-list {\\n\\tgrid-template-columns: repeat( 3, auto );\\n\\trow-gap: var(--ck-spacing-medium);\\n\\tcolumn-gap: var(--ck-spacing-medium);\\n\\tpadding: var(--ck-spacing-large);\\n\\n\\t& .ck-button {\\n\\t\\t/* Make the button look like a thumbnail (the icon \\\"takes it all\\\"). */\\n\\t\\twidth: var(--ck-list-style-button-size);\\n\\t\\theight: var(--ck-list-style-button-size);\\n\\t\\tpadding: 0;\\n\\n\\t\\t/*\\n\\t\\t * Buttons are aligned by the grid so disable default button margins to not collide with the\\n\\t\\t * gaps in the grid.\\n\\t\\t */\\n\\t\\tmargin: 0;\\n\\n\\t\\t/*\\n\\t\\t * Make sure the button border (which is displayed on focus, BTW) does not steal pixels\\n\\t\\t * from the button dimensions and, as a result, decrease the size of the icon\\n\\t\\t * (which becomes blurry as it scales down).\\n\\t\\t */\\n\\t\\tbox-sizing: content-box;\\n\\n\\t\\t& .ck-icon {\\n\\t\\t\\twidth: var(--ck-list-style-button-size);\\n\\t\\t\\theight: var(--ck-list-style-button-size);\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-todo-list-checkmark-size:16px}.ck-content .todo-list{list-style:none}.ck-content .todo-list li{margin-bottom:5px}.ck-content .todo-list li .todo-list{margin-top:5px}.ck-content .todo-list .todo-list__label>input{-webkit-appearance:none;border:0;display:inline-block;height:var(--ck-todo-list-checkmark-size);left:-25px;margin-left:0;margin-right:-15px;position:relative;right:0;vertical-align:middle;width:var(--ck-todo-list-checkmark-size)}.ck-content .todo-list .todo-list__label>input:before{border:1px solid #333;border-radius:2px;box-sizing:border-box;content:\\\"\\\";display:block;height:100%;position:absolute;transition:box-shadow .25s ease-in-out,background .25s ease-in-out,border .25s ease-in-out;width:100%}.ck-content .todo-list .todo-list__label>input:after{border-color:transparent;border-style:solid;border-width:0 calc(var(--ck-todo-list-checkmark-size)/8) calc(var(--ck-todo-list-checkmark-size)/8) 0;box-sizing:content-box;content:\\\"\\\";display:block;height:calc(var(--ck-todo-list-checkmark-size)/2.6);left:calc(var(--ck-todo-list-checkmark-size)/3);pointer-events:none;position:absolute;top:calc(var(--ck-todo-list-checkmark-size)/5.3);transform:rotate(45deg);width:calc(var(--ck-todo-list-checkmark-size)/5.3)}.ck-content .todo-list .todo-list__label>input[checked]:before{background:#26ab33;border-color:#26ab33}.ck-content .todo-list .todo-list__label>input[checked]:after{border-color:#fff}.ck-content .todo-list .todo-list__label .todo-list__label__description{vertical-align:middle}[dir=rtl] .todo-list .todo-list__label>input{left:0;margin-left:-15px;margin-right:0;right:-25px}.ck-editor__editable .todo-list .todo-list__label>input{cursor:pointer}.ck-editor__editable .todo-list .todo-list__label>input:hover:before{box-shadow:0 0 0 5px rgba(0,0,0,.1)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-list/theme/todolist.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,kCACD,CAEA,uBACC,eA0ED,CAxEC,0BACC,iBAKD,CAHC,qCACC,cACD,CAIA,+CACC,uBAAwB,CAQxB,QAAS,CAPT,oBAAqB,CAGrB,yCAA0C,CAO1C,UAAW,CAGX,aAAc,CAFd,kBAAmB,CAVnB,iBAAkB,CAWlB,OAAQ,CARR,qBAAsB,CAFtB,wCAqDD,CAxCC,sDAOC,qBAAiC,CACjC,iBAAkB,CALlB,qBAAsB,CACtB,UAAW,CAHX,aAAc,CAKd,WAAY,CAJZ,iBAAkB,CAOlB,0FAAgG,CAJhG,UAKD,CAEA,qDAaC,wBAAyB,CADzB,kBAAmB,CAEnB,sGAA+G,CAX/G,sBAAuB,CAEvB,UAAW,CAJX,aAAc,CAUd,mDAAwD,CAHxD,+CAAoD,CAJpD,mBAAoB,CAFpB,iBAAkB,CAOlB,gDAAqD,CAMrD,uBAAwB,CALxB,kDAMD,CAGC,+DACC,kBAA8B,CAC9B,oBACD,CAEA,8DACC,iBACD,CAIF,wEACC,qBACD,CAKF,6CACC,MAAO,CAGP,iBAAkB,CAFlB,cAAe,CACf,WAED,CAMA,wDACC,cAKD,CAHC,qEACC,mCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-todo-list-checkmark-size: 16px;\\n}\\n\\n.ck-content .todo-list {\\n\\tlist-style: none;\\n\\n\\t& li {\\n\\t\\tmargin-bottom: 5px;\\n\\n\\t\\t& .todo-list {\\n\\t\\t\\tmargin-top: 5px;\\n\\t\\t}\\n\\t}\\n\\n\\t& .todo-list__label {\\n\\t\\t& > input {\\n\\t\\t\\t-webkit-appearance: none;\\n\\t\\t\\tdisplay: inline-block;\\n\\t\\t\\tposition: relative;\\n\\t\\t\\twidth: var(--ck-todo-list-checkmark-size);\\n\\t\\t\\theight: var(--ck-todo-list-checkmark-size);\\n\\t\\t\\tvertical-align: middle;\\n\\n\\t\\t\\t/* Needed on iOS */\\n\\t\\t\\tborder: 0;\\n\\n\\t\\t\\t/* LTR styles */\\n\\t\\t\\tleft: -25px;\\n\\t\\t\\tmargin-right: -15px;\\n\\t\\t\\tright: 0;\\n\\t\\t\\tmargin-left: 0;\\n\\n\\t\\t\\t&::before {\\n\\t\\t\\t\\tdisplay: block;\\n\\t\\t\\t\\tposition: absolute;\\n\\t\\t\\t\\tbox-sizing: border-box;\\n\\t\\t\\t\\tcontent: '';\\n\\t\\t\\t\\twidth: 100%;\\n\\t\\t\\t\\theight: 100%;\\n\\t\\t\\t\\tborder: 1px solid hsl(0, 0%, 20%);\\n\\t\\t\\t\\tborder-radius: 2px;\\n\\t\\t\\t\\ttransition: 250ms ease-in-out box-shadow, 250ms ease-in-out background, 250ms ease-in-out border;\\n\\t\\t\\t}\\n\\n\\t\\t\\t&::after {\\n\\t\\t\\t\\tdisplay: block;\\n\\t\\t\\t\\tposition: absolute;\\n\\t\\t\\t\\tbox-sizing: content-box;\\n\\t\\t\\t\\tpointer-events: none;\\n\\t\\t\\t\\tcontent: '';\\n\\n\\t\\t\\t\\t/* Calculate tick position, size and border-width proportional to the checkmark size. */\\n\\t\\t\\t\\tleft: calc( var(--ck-todo-list-checkmark-size) / 3 );\\n\\t\\t\\t\\ttop: calc( var(--ck-todo-list-checkmark-size) / 5.3 );\\n\\t\\t\\t\\twidth: calc( var(--ck-todo-list-checkmark-size) / 5.3 );\\n\\t\\t\\t\\theight: calc( var(--ck-todo-list-checkmark-size) / 2.6 );\\n\\t\\t\\t\\tborder-style: solid;\\n\\t\\t\\t\\tborder-color: transparent;\\n\\t\\t\\t\\tborder-width: 0 calc( var(--ck-todo-list-checkmark-size) / 8 ) calc( var(--ck-todo-list-checkmark-size) / 8 ) 0;\\n\\t\\t\\t\\ttransform: rotate(45deg);\\n\\t\\t\\t}\\n\\n\\t\\t\\t&[checked] {\\n\\t\\t\\t\\t&::before {\\n\\t\\t\\t\\t\\tbackground: hsl(126, 64%, 41%);\\n\\t\\t\\t\\t\\tborder-color: hsl(126, 64%, 41%);\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t&::after {\\n\\t\\t\\t\\t\\tborder-color: hsl(0, 0%, 100%);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t& .todo-list__label__description {\\n\\t\\t\\tvertical-align: middle;\\n\\t\\t}\\n\\t}\\n}\\n\\n/* RTL styles */\\n[dir=\\\"rtl\\\"] .todo-list .todo-list__label > input {\\n\\tleft: 0;\\n\\tmargin-right: 0;\\n\\tright: -25px;\\n\\tmargin-left: -15px;\\n}\\n\\n/*\\n * To-do list should be interactive only during the editing\\n * (https://github.com/ckeditor/ckeditor5/issues/2090).\\n */\\n.ck-editor__editable .todo-list .todo-list__label > input {\\n\\tcursor: pointer;\\n\\n\\t&:hover::before {\\n\\t\\tbox-shadow: 0 0 0 5px hsla(0, 0%, 0%, 0.1);\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-content .media{clear:both;display:block;margin:.9em 0;min-width:15em}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-media-embed/theme/mediaembed.css\"],\"names\":[],\"mappings\":\"AAKA,mBAGC,UAAW,CASX,aAAc,CAJd,aAAe,CAQf,cACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-content .media {\\n\\t/* Don't allow floated content overlap the media.\\n\\thttps://github.com/ckeditor/ckeditor5-media-embed/issues/53 */\\n\\tclear: both;\\n\\n\\t/* Make sure there is some space between the content and the media. */\\n\\t/* The first value should be equal to --ck-spacing-large variable if used in the editor context\\n\\tto avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */\\n\\tmargin: 0.9em 0;\\n\\n\\t/* Make sure media is not overriden with Bootstrap default `flex` value.\\n\\tSee: https://github.com/ckeditor/ckeditor5/issues/1373. */\\n\\tdisplay: block;\\n\\n\\t/* Give the media some minimal width in the content to prevent them\\n\\tfrom being \\\"squashed\\\" in tight spaces, e.g. in table cells (#44) */\\n\\tmin-width: 15em;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-media__wrapper .ck-media__placeholder{align-items:center;display:flex;flex-direction:column}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url{max-width:100%;position:relative}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-media__placeholder__url__text{display:block;overflow:hidden}.ck-media__wrapper[data-oembed-url*=\\\"facebook.com\\\"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*=\\\"goo.gl/maps\\\"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*=\\\"google.com/maps\\\"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*=\\\"instagram.com\\\"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*=\\\"maps.app.goo.gl\\\"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*=\\\"maps.google.com\\\"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*=\\\"twitter.com\\\"] .ck-media__placeholder__icon *{display:none}.ck-editor__editable:not(.ck-read-only) .ck-media__wrapper>:not(.ck-media__placeholder),.ck-editor__editable:not(.ck-read-only) .ck-widget:not(.ck-widget_selected) .ck-media__placeholder{pointer-events:none}:root{--ck-media-embed-placeholder-icon-size:3em;--ck-color-media-embed-placeholder-url-text:#757575;--ck-color-media-embed-placeholder-url-text-hover:var(--ck-color-base-text)}.ck-media__wrapper{margin:0 auto}.ck-media__wrapper .ck-media__placeholder{background:var(--ck-color-base-foreground);padding:calc(var(--ck-spacing-standard)*3)}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon{background-position:50%;background-size:cover;height:var(--ck-media-embed-placeholder-icon-size);margin-bottom:var(--ck-spacing-large);min-width:var(--ck-media-embed-placeholder-icon-size)}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon .ck-icon{height:100%;width:100%}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text{color:var(--ck-color-media-embed-placeholder-url-text);font-style:italic;text-align:center;text-overflow:ellipsis;white-space:nowrap}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:var(--ck-color-media-embed-placeholder-url-text-hover);cursor:pointer;text-decoration:underline}.ck-media__wrapper[data-oembed-url*=\\\"open.spotify.com\\\"]{max-height:380px;max-width:300px}.ck-media__wrapper[data-oembed-url*=\\\"goo.gl/maps\\\"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*=\\\"google.com/maps\\\"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*=\\\"maps.app.goo.gl\\\"] .ck-media__placeholder__icon,.ck-media__wrapper[data-oembed-url*=\\\"maps.google.com\\\"] .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAuMzc4IiBoZWlnaHQ9IjI1NC4xNjciIHZpZXdCb3g9IjAgMCA2Ni4yNDYgNjcuMjQ4Ij48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcyLjUzMSAtMjE4LjQ1NSkgc2NhbGUoLjk4MDEyKSI+PHJlY3Qgcnk9IjUuMjM4IiByeD0iNS4yMzgiIHk9IjIzMS4zOTkiIHg9IjE3Ni4wMzEiIGhlaWdodD0iNjAuMDk5IiB3aWR0aD0iNjAuMDk5IiBmaWxsPSIjMzRhNjY4IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Im0yMDYuNDc3IDI2MC45LTI4Ljk4NyAyOC45ODdhNS4yMTggNS4yMTggMCAwIDAgMy43OCAxLjYxaDQ5LjYyMWMxLjY5NCAwIDMuMTktLjc5OCA0LjE0Ni0yLjAzN3oiIGZpbGw9IiM1Yzg4YzUiLz48cGF0aCBkPSJNMjI2Ljc0MiAyMjIuOTg4Yy05LjI2NiAwLTE2Ljc3NyA3LjE3LTE2Ljc3NyAxNi4wMTQuMDA3IDIuNzYyLjY2MyA1LjQ3NCAyL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1LjIyNyAwIDAgMCA1LjIzOCA1LjIzOGgxLjAxNWwzNS42NjYtMzUuNjY2YTEzNi4yNzUgMTM2LjI3NSAwIDAgMC0yLjc2NC0zLjkgMzcuNTc1IDM3LjU3NSAwIDAgMC0uOTg5LTEuNDQgMzUuMTI3IDM1LjEyNyAwIDAgMC0uOTUtMS41MDhjLS4wODMtLjE2Mi0uMTc2LS4zMjYtLjI2NC0uNDg5eiIgZmlsbD0iI2ZkZGM0ZiIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48cGF0aCBkPSJtMjExLjk5OCAyNjEuMDgzLTYuMTUyIDYuMTUxIDI0LjI2NCAyNC4yNjRoLjc4MWE1LjIyNyA1LjIyNyAwIDAgMCA1LjIzOS01LjIzOHYtMS4wNDV6IiBmaWxsPSIjZmZmIiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjwvZz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*=\\\"facebook.com\\\"] .ck-media__placeholder{background:#4268b3}.ck-media__wrapper[data-oembed-url*=\\\"facebook.com\\\"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAyNCIgaGVpZ2h0PSIxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik05NjcuNDg0IDBINTYuNTE3QzI1LjMwNCAwIDAgMjUuMzA0IDAgNTYuNTE3djkxMC45NjZDMCA5OTguNjk0IDI1LjI5NyAxMDI0IDU2LjUyMiAxMDI0SDU0N1Y2MjhINDE0VjQ3M2gxMzNWMzU5LjAyOWMwLTEzMi4yNjIgODAuNzczLTIwNC4yODIgMTk4Ljc1Ni0yMDQuMjgyIDU2LjUxMyAwIDEwNS4wODYgNC4yMDggMTE5LjI0NCA2LjA4OVYyOTlsLTgxLjYxNi4wMzdjLTYzLjk5MyAwLTc2LjM4NCAzMC40OTItNzYuMzg0IDc1LjIzNlY0NzNoMTUzLjQ4N2wtMTkuOTg2IDE1NUg3MDd2Mzk2aDI2MC40ODRjMzEuMjEzIDAgNTYuNTE2LTI1LjMwMyA1Ni41MTYtNTYuNTE2VjU2LjUxNUMxMDI0IDI1LjMwMyA5OTguNjk3IDAgOTY3LjQ4NCAwIiBmaWxsPSIjRkZGRkZFIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*=\\\"facebook.com\\\"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#cdf}.ck-media__wrapper[data-oembed-url*=\\\"facebook.com\\\"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*=\\\"instagram.com\\\"] .ck-media__placeholder{background:linear-gradient(-135deg,#1400c7,#b800b1,#f50000)}.ck-media__wrapper[data-oembed-url*=\\\"instagram.com\\\"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTA0IiBoZWlnaHQ9IjUwNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PHBhdGggaWQ9ImEiIGQ9Ik0wIC4xNTloNTAzLjg0MVY1MDMuOTRIMHoiLz48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48bWFzayBpZD0iYiIgZmlsbD0iI2ZmZiI+PHVzZSB4bGluazpocmVmPSIjYSIvPjwvbWFzaz48cGF0aCBkPSJNMjUxLjkyMS4xNTljLTY4LjQxOCAwLTc2Ljk5Ny4yOS0xMDMuODY3IDEuNTE2LTI2LjgxNCAxLjIyMy00NS4xMjcgNS40ODItNjEuMTUxIDExLjcxLTE2LjU2NiA2LjQzNy0zMC42MTUgMTUuMDUxLTQ0LjYyMSAyOS4wN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MTEuNzU5IDEwLjAyOS0yMC4xNTEgMTguODQ1LTI4Ljk2NiA4LjgxNS04LjgxNiAxNy4yMDctMTQuMjc1IDI4Ljk2Ni0xOC44NDUgOC44NzctMy40NSAyMi4yMTYtNy41NTQgNDYuNzc4LTguNjc0IDI2LjU2NC0xLjIxMiAzNC41MzItMS40NjkgMTAxLjc5OC0xLjQ2OVoiIGZpbGw9IiNGRkYiIG1hc2s9InVybCgjYikiLz48cGF0aCBkPSJNMjUxLjkyMSAzMzYuMDUzYy00Ni4zNzggMC04My45NzQtMzcuNTk2LTgzLjk3NC04My45NzMgMC00Ni4zNzggMzcuNTk2LTgzLjk3NCA4My45NzQtODMuOTc0IDQ2LjM3NyAwIDgzLjk3MyAzNy41OTYgODMuOTczIDgzLjk3NCAwIDQ2LjM3Ny0zNy41OTYgODMuOTczLTgzLjk3MyA4My45NzNabTAtMjEzLjMzOGMtNzEuNDQ3IDAtMTI5LjM2NSA1Ny45MTgtMTI5LjM2NSAxMjkuMzY1IDAgNzEuNDQ2IDU3LjkxOCAxMjkuMzY0IDEyOS4zNjUgMTI5LjM2NCA3MS40NDYgMCAxMjkuMzY0LTU3LjkxOCAxMjkuMzY0LTEyOS4zNjQgMC03MS40NDctNTcuOTE4LTEyOS4zNjUtMTI5LjM2NC0xMjkuMzY1Wk00MTYuNjI3IDExNy42MDRjMCAxNi42OTYtMTMuNTM1IDMwLjIzLTMwLjIzMSAzMC4yMy0xNi42OTUgMC0zMC4yMy0xMy41MzQtMzAuMjMtMzAuMjMgMC0xNi42OTYgMTMuNTM1LTMwLjIzMSAzMC4yMy0zMC4yMzEgMTYuNjk2IDAgMzAuMjMxIDEzLjUzNSAzMC4yMzEgMzAuMjMxIiBmaWxsPSIjRkZGIi8+PC9nPjwvc3ZnPg==)}.ck-media__wrapper[data-oembed-url*=\\\"instagram.com\\\"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#ffe0fe}.ck-media__wrapper[data-oembed-url*=\\\"instagram.com\\\"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*=\\\"twitter.com\\\"] .ck.ck-media__placeholder{background:linear-gradient(90deg,#71c6f4,#0d70a5)}.ck-media__wrapper[data-oembed-url*=\\\"twitter.com\\\"] .ck.ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgNDAwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA0MDAgNDAwIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBkPSJNNDAwIDIwMGMwIDExMC41LTg5LjUgMjAwLTIwMCAyMDBTMCAzMTAuNSAwIDIwMCA4OS41IDAgMjAwIDBzMjAwIDg5LjUgMjAwIDIwMHpNMTYzLjQgMzA1LjVjODguNyAwIDEzNy4yLTczLjUgMTM3LjItMTM3LjIgMC0yLjEgMC00LjItLjEtNi4yIDkuNC02LjggMTcuNi0xNS4zIDI0LjEtMjUtOC42IDMuOC0xNy45IDYuNC0yNy43IDcuNiAxMC02IDE3LjYtMTUuNCAyMS4yLTI2LjctOS4zIDUuNS0xOS42IDkuNS0zMC42IDExLjctOC44LTkuNC0yMS4zLTE1LjItMzUuMi0xNS4yLTI2LjYgMC00OC4yIDIxLjYtNDguMiA0OC4yIDAgMy44LjQgNy41IDEuMyAxMS00MC4xLTItNzUuNi0yMS4yLTk5LjQtNTAuNC00LjEgNy4xLTYuNSAxNS40LTYuNSAyNC4yIDAgMTYuNyA4LjUgMzEuNSAyMS41IDQwLjEtNy45LS4yLTE1LjMtMi40LTIxLjgtNnYuNmMwIDIzLjQgMTYuNiA0Mi44IDM4LjcgNDcuMy00IDEuMS04LjMgMS43LTEyLjcgMS43LTMuMSAwLTYuMS0uMy05LjEtLjkgNi4xIDE5LjIgMjMuOSAzMy4xIDQ1IDMzLjUtMTYuNSAxMi45LTM3LjMgMjAuNi01OS45IDIwLjYtMy45IDAtNy43LS4yLTExLjUtLjcgMjEuMSAxMy44IDQ2LjUgMjEuOCA3My43IDIxLjgiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*=\\\"twitter.com\\\"] .ck.ck-media__placeholder .ck-media__placeholder__url__text{color:#b8e6ff}.ck-media__wrapper[data-oembed-url*=\\\"twitter.com\\\"] .ck.ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-media-embed/theme/mediaembedediting.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-media-embed/mediaembedediting.css\"],\"names\":[],\"mappings\":\"AAMC,0CAGC,kBAAmB,CAFnB,YAAa,CACb,qBAcD,CAXC,sEAEC,cAAe,CAEf,iBAMD,CAJC,wGAEC,aAAc,CADd,eAED,CAWD,6kBACC,YACD,CAYF,2LACC,mBACD,CC1CA,MACC,0CAA2C,CAE3C,mDAA4D,CAC5D,2EACD,CAEA,mBACC,aA+FD,CA7FC,0CAEC,0CAA2C,CAD3C,0CA6BD,CA1BC,uEAIC,uBAA2B,CAC3B,qBAAsB,CAHtB,kDAAmD,CACnD,qCAAsC,CAFtC,qDAUD,CAJC,gFAEC,WAAY,CADZ,UAED,CAGD,4EACC,sDAAuD,CAGvD,iBAAkB,CADlB,iBAAkB,CAElB,sBAAuB,CAHvB,kBAUD,CALC,kFACC,4DAA6D,CAC7D,cAAe,CACf,yBACD,CAIF,wDAEC,gBAAiB,CADjB,eAED,CAEA,4UAIC,wvGACD,CAEA,2EACC,kBAaD,CAXC,wGACC,orBACD,CAEA,6GACC,UAKD,CAHC,mHACC,UACD,CAIF,4EACC,2DAcD,CAZC,yGACC,4jHACD,CAGA,8GACC,aAKD,CAHC,oHACC,UACD,CAIF,6EAEC,iDAaD,CAXC,0GACC,wiCACD,CAEA,+GACC,aAKD,CAHC,qHACC,UACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-media__wrapper {\\n\\t& .ck-media__placeholder {\\n\\t\\tdisplay: flex;\\n\\t\\tflex-direction: column;\\n\\t\\talign-items: center;\\n\\n\\t\\t& .ck-media__placeholder__url {\\n\\t\\t\\t/* Otherwise the URL will overflow when the content is very narrow. */\\n\\t\\t\\tmax-width: 100%;\\n\\n\\t\\t\\tposition: relative;\\n\\n\\t\\t\\t& .ck-media__placeholder__url__text {\\n\\t\\t\\t\\toverflow: hidden;\\n\\t\\t\\t\\tdisplay: block;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t&[data-oembed-url*=\\\"twitter.com\\\"],\\n\\t&[data-oembed-url*=\\\"google.com/maps\\\"],\\n\\t&[data-oembed-url*=\\\"goo.gl/maps\\\"],\\n\\t&[data-oembed-url*=\\\"maps.google.com\\\"],\\n\\t&[data-oembed-url*=\\\"maps.app.goo.gl\\\"],\\n\\t&[data-oembed-url*=\\\"facebook.com\\\"],\\n\\t&[data-oembed-url*=\\\"instagram.com\\\"] {\\n\\t\\t& .ck-media__placeholder__icon * {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n}\\n\\n/* Disable all mouse interaction as long as the editor is not readonly.\\n https://github.com/ckeditor/ckeditor5-media-embed/issues/58 */\\n.ck-editor__editable:not(.ck-read-only) .ck-media__wrapper > *:not(.ck-media__placeholder) {\\n\\tpointer-events: none;\\n}\\n\\n/* Disable all mouse interaction when the widget is not selected (e.g. to avoid opening links by accident).\\n https://github.com/ckeditor/ckeditor5-media-embed/issues/18 */\\n.ck-editor__editable:not(.ck-read-only) .ck-widget:not(.ck-widget_selected) .ck-media__placeholder {\\n\\tpointer-events: none;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-media-embed-placeholder-icon-size: 3em;\\n\\n\\t--ck-color-media-embed-placeholder-url-text: hsl(0, 0%, 46%);\\n\\t--ck-color-media-embed-placeholder-url-text-hover: var(--ck-color-base-text);\\n}\\n\\n.ck-media__wrapper {\\n\\tmargin: 0 auto;\\n\\n\\t& .ck-media__placeholder {\\n\\t\\tpadding: calc( 3 * var(--ck-spacing-standard) );\\n\\t\\tbackground: var(--ck-color-base-foreground);\\n\\n\\t\\t& .ck-media__placeholder__icon {\\n\\t\\t\\tmin-width: var(--ck-media-embed-placeholder-icon-size);\\n\\t\\t\\theight: var(--ck-media-embed-placeholder-icon-size);\\n\\t\\t\\tmargin-bottom: var(--ck-spacing-large);\\n\\t\\t\\tbackground-position: center;\\n\\t\\t\\tbackground-size: cover;\\n\\n\\t\\t\\t& .ck-icon {\\n\\t\\t\\t\\twidth: 100%;\\n\\t\\t\\t\\theight: 100%;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t& .ck-media__placeholder__url__text {\\n\\t\\t\\tcolor: var(--ck-color-media-embed-placeholder-url-text);\\n\\t\\t\\twhite-space: nowrap;\\n\\t\\t\\ttext-align: center;\\n\\t\\t\\tfont-style: italic;\\n\\t\\t\\ttext-overflow: ellipsis;\\n\\n\\t\\t\\t&:hover {\\n\\t\\t\\t\\tcolor: var(--ck-color-media-embed-placeholder-url-text-hover);\\n\\t\\t\\t\\tcursor: pointer;\\n\\t\\t\\t\\ttext-decoration: underline;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t&[data-oembed-url*=\\\"open.spotify.com\\\"] {\\n\\t\\tmax-width: 300px;\\n\\t\\tmax-height: 380px;\\n\\t}\\n\\n\\t&[data-oembed-url*=\\\"google.com/maps\\\"] .ck-media__placeholder__icon,\\n\\t&[data-oembed-url*=\\\"goo.gl/maps\\\"] .ck-media__placeholder__icon,\\n\\t&[data-oembed-url*=\\\"maps.google.com\\\"] .ck-media__placeholder__icon,\\n\\t&[data-oembed-url*=\\\"maps.app.goo.gl\\\"] .ck-media__placeholder__icon {\\n\\t\\tbackground-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAuMzc4IiBoZWlnaHQ9IjI1NC4xNjciIHZpZXdCb3g9IjAgMCA2Ni4yNDYgNjcuMjQ4Ij48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcyLjUzMSAtMjE4LjQ1NSkgc2NhbGUoLjk4MDEyKSI+PHJlY3Qgcnk9IjUuMjM4IiByeD0iNS4yMzgiIHk9IjIzMS4zOTkiIHg9IjE3Ni4wMzEiIGhlaWdodD0iNjAuMDk5IiB3aWR0aD0iNjAuMDk5IiBmaWxsPSIjMzRhNjY4IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Ik0yMDYuNDc3IDI2MC45bC0yOC45ODcgMjguOTg3YTUuMjE4IDUuMjE4IDAgMCAwIDMuNzggMS42MWg0OS42MjFjMS42OTQgMCAzLjE5LS43OTggNC4xNDYtMi4wMzd6IiBmaWxsPSIjNWM4OGM1Ii8+PHBhdGggZD0iTTIyNi43NDIgMjIyLjk4OGMtOS4yNjYgMC0xNi43NzcgNy4xNy0xNi43NzcgMTYuMDE0LjAwNyAyLjc2Mi42NjMgNS40NzQgMi4wOTMgNy44NzUuNDMuNzAzLjgzIDEuNDA4IDEuMTkgMi4xMDcuMzMzLjUwMi42NSAxLjAwNS45NSAxLjUwOC4zNDMuNDc3LjY3My45NTcuOTg4IDEuNDQgMS4zMSAxLjc2OSAyLjUgMy41MDIgMy42MzcgNS4xNjguNzkzIDEuMjc1IDEuNjgzIDIuNjQgMi40NjYgMy45OSAyLjM2MyA0LjA5NCA0LjAwNyA4LjA5MiA0LjYgMTMuOTE0di4wMT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w5OTguNjk0IDI1LjI5NywxMDI0IDU2LjUyMiwxMDI0IEw1NDcsMTAyNCBMNTQ3LDYyOCBMNDE0LDYyOCBMNDE0LDQ3MyBMNTQ3LDQ3MyBMNTQ3LDM1OS4wMjkgQzU0NywyMjYuNzY3IDYyNy43NzMsMTU0Ljc0NyA3NDUuNzU2LDE1NC43NDcgQzgwMi4yNjksMTU0Ljc0NyA4NTAuODQyLDE1OC45NTUgODY1LDE2MC44MzYgTDg2NSwyOTkgTDc4My4zODQsMjk5LjAzNyBDNzE5LjM5MSwyOTkuMDM3IDcwNywzMjkuNTI5IDcwNywzNzQuMjczIEw3MDcsNDczIEw4NjAuNDg3LDQ3MyBMODQwLjUwMSw2MjggTDcwNyw2MjggTDcwNywxMDI0IEw5NjcuNDg0LDEwMjQgQzk5OC42OTcsMTAyNCAxMDI0LDk5OC42OTcgMTAyNCw5NjcuNDg0IEwxMDI0LDU2LjUxNSBDMTAyNCwyNS4zMDMgOTk4LjY5NywwIDk2Ny40ODQsMCIgaWQ9IkZpbGwtMSI+PC9wYXRoPiAgICAgICAgPC9nPiAgICA8L2c+PC9zdmc+);\\n\\t\\t}\\n\\n\\t\\t& .ck-media__placeholder__url__text {\\n\\t\\t\\tcolor: hsl(220, 100%, 90%);\\n\\n\\t\\t\\t&:hover {\\n\\t\\t\\t\\tcolor: hsl(0, 0%, 100%);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t&[data-oembed-url*=\\\"instagram.com\\\"] .ck-media__placeholder {\\n\\t\\tbackground: linear-gradient(-135deg,hsl(246, 100%, 39%),hsl(302, 100%, 36%),hsl(0, 100%, 48%));\\n\\n\\t\\t& .ck-media__placeholder__icon {\\n\\t\\t\\tbackground-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSI1MDRweCIgaGVpZ2h0PSI1MDRweCIgdmlld0JveD0iMCAwIDUwNCA1MDQi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YsMzIzLjUyNiAxODAuNDc0LDM4MS40NDQgMjUxLjkyMSwzODEuNDQ0IEMzMjMuMzY3LDM4MS40NDQgMzgxLjI4NSwzMjMuNTI2IDM4MS4yODUsMjUyLjA4IEMzODEuMjg1LDE4MC42MzMgMzIzLjM2NywxMjIuNzE1IDI1MS45MjEsMTIyLjcxNSBaIiBpZD0iRmlsbC00IiBmaWxsPSIjRkZGRkZGIj48L3BhdGg+ICAgICAgICA8cGF0aCBkPSJNNDE2LjYyNywxMTcuNjA0IEM0MTYuNjI3LDEzNC4zIDQwMy4wOTIsMTQ3LjgzNCAzODYuMzk2LDE0Ny44MzQgQzM2OS43MDEsMTQ3LjgzNCAzNTYuMTY2LDEzNC4zIDM1Ni4xNjYsMTE3LjYwNCBDMzU2LjE2NiwxMDAuOTA4IDM2OS43MDEsODcuMzczIDM4Ni4zOTYsODcuMzczIEM0MDMuMDkyLDg3LjM3MyA0MTYuNjI3LDEwMC45MDggNDE2LjYyNywxMTcuNjA0IiBpZD0iRmlsbC01IiBmaWxsPSIjRkZGRkZGIj48L3BhdGg+ICAgIDwvZz48L3N2Zz4=);\\n\\t\\t}\\n\\n\\t\\t/* stylelint-disable-next-line no-descending-specificity */\\n\\t\\t& .ck-media__placeholder__url__text {\\n\\t\\t\\tcolor: hsl(302, 100%, 94%);\\n\\n\\t\\t\\t&:hover {\\n\\t\\t\\t\\tcolor: hsl(0, 0%, 100%);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t&[data-oembed-url*=\\\"twitter.com\\\"] .ck.ck-media__placeholder {\\n\\t\\t/* Use gradient to contrast with focused widget (ckeditor/ckeditor5-media-embed#22). */\\n\\t\\tbackground: linear-gradient( to right, hsl(201, 85%, 70%), hsl(201, 85%, 35%) );\\n\\n\\t\\t& .ck-media__placeholder__icon {\\n\\t\\t\\tbackground-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZl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y4xLDQ1LDMzLjVjLTE2LjUsMTIuOS0zNy4zLDIwLjYtNTkuOSwyMC42Yy0zLjksMC03LjctMC4yLTExLjUtMC43QzExMC44LDI5Ny41LDEzNi4yLDMwNS41LDE2My40LDMwNS41Ii8+PC9zdmc+);\\n\\t\\t}\\n\\n\\t\\t& .ck-media__placeholder__url__text {\\n\\t\\t\\tcolor: hsl(201, 100%, 86%);\\n\\n\\t\\t\\t&:hover {\\n\\t\\t\\t\\tcolor: hsl(0, 0%, 100%);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-media-form{align-items:flex-start;display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-media-form .ck-labeled-field-view{display:inline-block}.ck.ck-media-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-media-form{flex-wrap:wrap}.ck.ck-media-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-media-form .ck-button{flex-basis:50%}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-media-embed/theme/mediaform.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\"],\"names\":[],\"mappings\":\"AAOA,kBAEC,sBAAuB,CADvB,YAAa,CAEb,kBAAmB,CACnB,gBAqBD,CAnBC,yCACC,oBACD,CAEA,4BACC,YACD,CCbA,oCDCD,kBAeE,cAUF,CARE,yCACC,eACD,CAEA,6BACC,cACD,CCtBD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n\\n.ck.ck-media-form {\\n\\tdisplay: flex;\\n\\talign-items: flex-start;\\n\\tflex-direction: row;\\n\\tflex-wrap: nowrap;\\n\\n\\t& .ck-labeled-field-view {\\n\\t\\tdisplay: inline-block;\\n\\t}\\n\\n\\t& .ck-label {\\n\\t\\tdisplay: none;\\n\\t}\\n\\n\\t@mixin ck-media-phone {\\n\\t\\tflex-wrap: wrap;\\n\\n\\t\\t& .ck-labeled-field-view {\\n\\t\\t\\tflex-basis: 100%;\\n\\t\\t}\\n\\n\\t\\t& .ck-button {\\n\\t\\t\\tflex-basis: 50%;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-phone {\\n\\t@media screen and (max-width: 600px) {\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-content .page-break{align-items:center;clear:both;display:flex;justify-content:center;padding:5px 0;position:relative}.ck-content .page-break:after{border-bottom:2px dashed #c4c4c4;content:\\\"\\\";position:absolute;width:100%}.ck-content .page-break__label{background:#fff;border:1px solid #c4c4c4;border-radius:2px;box-shadow:2px 2px 1px rgba(0,0,0,.15);color:#333;display:block;font-family:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;font-size:.75em;font-weight:700;padding:.3em .6em;position:relative;text-transform:uppercase;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1}@media print{.ck-content .page-break{padding:0}.ck-content .page-break:after{display:none}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-page-break/theme/pagebreak.css\"],\"names\":[],\"mappings\":\"AAKA,wBAKC,kBAAmB,CAHnB,UAAW,CAEX,YAAa,CAEb,sBAAuB,CAHvB,aAAc,CAFd,iBAaD,CANC,8BAGC,gCAAyC,CAFzC,UAAW,CACX,iBAAkB,CAElB,UACD,CAGD,+BAYC,eAA4B,CAN5B,wBAAiC,CACjC,iBAAkB,CAMlB,sCAA6C,CAF7C,UAAsB,CAPtB,aAAc,CAId,qDAA0D,CAC1D,eAAiB,CACjB,eAAiB,CAPjB,iBAAkB,CAFlB,iBAAkB,CAIlB,wBAAyB,CAWzB,wBAAyB,CACzB,qBAAsB,CACtB,oBAAqB,CACrB,gBAAiB,CAjBjB,SAkBD,CAGA,aACC,wBACC,SAKD,CAHC,8BACC,YACD,CAEF\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-content .page-break {\\n\\tposition: relative;\\n\\tclear: both;\\n\\tpadding: 5px 0;\\n\\tdisplay: flex;\\n\\talign-items: center;\\n\\tjustify-content: center;\\n\\n\\t&::after {\\n\\t\\tcontent: '';\\n\\t\\tposition: absolute;\\n\\t\\tborder-bottom: 2px dashed hsl(0, 0%, 77%);\\n\\t\\twidth: 100%;\\n\\t}\\n}\\n\\n.ck-content .page-break__label {\\n\\tposition: relative;\\n\\tz-index: 1;\\n\\tpadding: .3em .6em;\\n\\tdisplay: block;\\n\\ttext-transform: uppercase;\\n\\tborder: 1px solid hsl(0, 0%, 77%);\\n\\tborder-radius: 2px;\\n\\tfont-family: Helvetica, Arial, Tahoma, Verdana, Sans-Serif;\\n\\tfont-size: 0.75em;\\n\\tfont-weight: bold;\\n\\tcolor: hsl(0, 0%, 20%);\\n\\tbackground: hsl(0, 0%, 100%);\\n\\tbox-shadow: 2px 2px 1px hsla(0, 0%, 0%, 0.15);\\n\\n\\t/* Disable the possibility to select the label text by the user. */\\n\\t-webkit-user-select: none;\\n\\t-moz-user-select: none;\\n\\t-ms-user-select: none;\\n\\tuser-select: none;\\n}\\n\\n/* Do not show the page break element inside the print preview window. */\\n@media print {\\n\\t.ck-content .page-break {\\n\\t\\tpadding: 0;\\n\\n\\t\\t&::after {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-source-editing-area{overflow:hidden;position:relative}.ck-source-editing-area textarea,.ck-source-editing-area:after{border:1px solid transparent;font-family:monospace;font-size:var(--ck-font-size-normal);line-height:var(--ck-line-height-base);margin:0;padding:var(--ck-spacing-large);white-space:pre-wrap}.ck-source-editing-area:after{content:attr(data-value) \\\" \\\";display:block;visibility:hidden}.ck-source-editing-area textarea{border-color:var(--ck-color-base-border);border-radius:0;box-sizing:border-box;height:100%;outline:none;overflow:hidden;position:absolute;resize:none;width:100%}.ck-rounded-corners .ck-source-editing-area textarea,.ck-source-editing-area textarea.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck-source-editing-area textarea:not([readonly]):focus{border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-source-editing/theme/sourceediting.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\"],\"names\":[],\"mappings\":\"AASA,wBAEC,eAAgB,CADhB,iBAED,CAEA,+DAIC,4BAA6B,CAG7B,qBAAsB,CADtB,oCAAqC,CADrC,sCAAuC,CAFvC,QAAS,CADT,+BAAgC,CAMhC,oBACD,CAEA,8BACC,4BAA6B,CAE7B,aAAc,CADd,iBAED,CAEA,iCASC,wCAAyC,CC7BzC,eAAgB,CD2BhB,qBAAsB,CAJtB,WAAY,CAEZ,YAAa,CACb,eAAgB,CALhB,iBAAkB,CAGlB,WAAY,CAFZ,UAkBD,CApBA,yGChBE,qCAAsC,CD4BtC,wBAAyB,CACzB,yBAOF,CAJC,uDEpCA,2BAA2B,CCF3B,qCAA8B,CDC9B,YFwCA\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\\\";\\n@import \\\"@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css\\\";\\n@import \\\"@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\\\";\\n\\n.ck-source-editing-area {\\n\\tposition: relative;\\n\\toverflow: hidden;\\n}\\n\\n.ck-source-editing-area::after,\\n.ck-source-editing-area textarea {\\n\\tpadding: var(--ck-spacing-large);\\n\\tmargin: 0;\\n\\tborder: 1px solid transparent;\\n\\tline-height: var(--ck-line-height-base);\\n\\tfont-size: var(--ck-font-size-normal);\\n\\tfont-family: monospace;\\n\\twhite-space: pre-wrap;\\n}\\n\\n.ck-source-editing-area::after {\\n\\tcontent: attr(data-value) \\\" \\\";\\n\\tvisibility: hidden;\\n\\tdisplay: block;\\n}\\n\\n.ck-source-editing-area textarea {\\n\\tposition: absolute;\\n\\twidth: 100%;\\n\\theight: 100%;\\n\\tresize: none;\\n\\toutline: none;\\n\\toverflow: hidden;\\n\\tbox-sizing: border-box;\\n\\n\\tborder-color: var(--ck-color-base-border);\\n\\n\\t@mixin ck-rounded-corners {\\n\\t\\tborder-top-left-radius: 0;\\n\\t\\tborder-top-right-radius: 0;\\n\\t}\\n\\n\\t&:not([readonly]):focus {\\n\\t\\t@mixin ck-focus-ring;\\n\\t\\t@mixin ck-box-shadow var(--ck-inner-shadow);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A visual style of focused element's border.\\n */\\n@define-mixin ck-focus-ring {\\n\\t/* Disable native outline. */\\n\\toutline: none;\\n\\tborder: var(--ck-focus-ring)\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-character-grid{max-width:100%}.ck.ck-character-grid .ck-character-grid__tiles{display:grid}:root{--ck-character-grid-tile-size:24px}.ck.ck-character-grid{max-height:200px;overflow-x:hidden;overflow-y:auto;width:350px}@media screen and (max-width:600px){.ck.ck-character-grid{width:190px}}.ck.ck-character-grid .ck-character-grid__tiles{grid-gap:var(--ck-spacing-standard);grid-template-columns:repeat(10,1fr);margin:var(--ck-spacing-standard) var(--ck-spacing-large)}@media screen and (max-width:600px){.ck.ck-character-grid .ck-character-grid__tiles{grid-template-columns:repeat(5,1fr)}}.ck.ck-character-grid .ck-character-grid__tile{border:0;font-size:1.2em;height:var(--ck-character-grid-tile-size);min-height:var(--ck-character-grid-tile-size);min-width:var(--ck-character-grid-tile-size);padding:0;transition:box-shadow .2s ease;width:var(--ck-character-grid-tile-size)}.ck.ck-character-grid .ck-character-grid__tile:focus:not(.ck-disabled),.ck.ck-character-grid .ck-character-grid__tile:hover:not(.ck-disabled){border:0;box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-character-grid .ck-character-grid__tile .ck-button__label{line-height:var(--ck-character-grid-tile-size);text-align:center;width:100%}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-special-characters/theme/charactergrid.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-special-characters/charactergrid.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\"],\"names\":[],\"mappings\":\"AAKA,sBACC,cAKD,CAHC,gDACC,YACD,CCFD,MACC,kCACD,CAEA,sBAIC,gBAAiB,CAFjB,iBAAkB,CADlB,eAAgB,CAEhB,WAyCD,CClDC,oCDMD,sBAOE,WAqCF,CChDC,CDcA,gDAGC,mCAAoC,CAFpC,oCAAsC,CACtC,yDAMD,CCxBA,oCDgBA,gDAME,mCAEF,CCtBA,CDwBA,+CAQC,QAAS,CAHT,eAAgB,CAHhB,yCAA0C,CAE1C,6CAA8C,CAD9C,4CAA6C,CAG7C,SAAU,CACV,8BAA+B,CAN/B,wCAsBD,CAbC,8IAGC,QAAS,CACT,iGACD,CAGA,iEACC,8CAA+C,CAE/C,iBAAkB,CADlB,UAED\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-character-grid {\\n\\tmax-width: 100%;\\n\\t\\n\\t& .ck-character-grid__tiles {\\n\\t\\tdisplay: grid;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n@import \\\"../mixins/_rounded.css\\\";\\n\\n:root {\\n\\t--ck-character-grid-tile-size: 24px;\\n}\\n\\n.ck.ck-character-grid {\\n\\toverflow-y: auto;\\n\\toverflow-x: hidden;\\n\\twidth: 350px;\\n\\tmax-height: 200px;\\n\\n\\t@mixin ck-media-phone {\\n\\t\\twidth: 190px;\\n\\t}\\n\\n\\t& .ck-character-grid__tiles {\\n\\t\\tgrid-template-columns: repeat(10, 1fr);\\n\\t\\tmargin: var(--ck-spacing-standard) var(--ck-spacing-large);\\n\\t\\tgrid-gap: var(--ck-spacing-standard);\\n\\n\\t\\t@mixin ck-media-phone {\\n\\t\\t\\tgrid-template-columns: repeat(5, 1fr);\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck-character-grid__tile {\\n\\t\\twidth: var(--ck-character-grid-tile-size);\\n\\t\\theight: var(--ck-character-grid-tile-size);\\n\\t\\tmin-width: var(--ck-character-grid-tile-size);\\n\\t\\tmin-height: var(--ck-character-grid-tile-size);\\n\\t\\tfont-size: 1.2em;\\n\\t\\tpadding: 0;\\n\\t\\ttransition: .2s ease box-shadow;\\n\\t\\tborder: 0;\\n\\n\\t\\t&:focus:not( .ck-disabled ),\\n\\t\\t&:hover:not( .ck-disabled ) {\\n\\t\\t\\t/* Disable the default .ck-button's border ring. */\\n\\t\\t\\tborder: 0;\\n\\t\\t\\tbox-shadow: inset 0 0 0 1px var(--ck-color-base-background), 0 0 0 2px var(--ck-color-focus-border);\\n\\t\\t}\\n\\n\\t\\t/* Make sure the glyph is rendered in the center of the button */\\n\\t\\t& .ck-button__label {\\n\\t\\t\\tline-height: var(--ck-character-grid-tile-size);\\n\\t\\t\\twidth: 100%;\\n\\t\\t\\ttext-align: center;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-phone {\\n\\t@media screen and (max-width: 600px) {\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-character-info{border-top:1px solid var(--ck-color-base-border);display:flex;justify-content:space-between;padding:var(--ck-spacing-small) var(--ck-spacing-large)}.ck.ck-character-info>*{font-size:var(--ck-font-size-small);text-transform:uppercase}.ck.ck-character-info .ck-character-info__name{max-width:280px;overflow:hidden;text-overflow:ellipsis}.ck.ck-character-info .ck-character-info__code{opacity:.6}@media screen and (max-width:600px){.ck.ck-character-info{max-width:190px}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-special-characters/theme/characterinfo.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-special-characters/characterinfo.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\"],\"names\":[],\"mappings\":\"AAKA,sBCIC,gDAAiD,CDHjD,YAAa,CACb,6BAA8B,CCC9B,uDDAD,CCGC,wBAEC,mCAAoC,CADpC,wBAED,CAEA,+CACC,eAAgB,CAEhB,eAAgB,CADhB,sBAED,CAEA,+CACC,UACD,CClBA,oCDCD,sBAoBE,eAEF,CCrBC\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-character-info {\\n\\tdisplay: flex;\\n\\tjustify-content: space-between;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n\\n.ck.ck-character-info {\\n\\tpadding: var(--ck-spacing-small) var(--ck-spacing-large);\\n\\tborder-top: 1px solid var(--ck-color-base-border);\\n\\n\\t& > * {\\n\\t\\ttext-transform: uppercase;\\n\\t\\tfont-size: var(--ck-font-size-small);\\n\\t}\\n\\n\\t& .ck-character-info__name {\\n\\t\\tmax-width: 280px;\\n\\t\\ttext-overflow: ellipsis;\\n\\t\\toverflow: hidden;\\n\\t}\\n\\n\\t& .ck-character-info__code {\\n\\t\\topacity: .6;\\n\\t}\\n\\n\\t@mixin ck-media-phone {\\n\\t\\tmax-width: 190px;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-phone {\\n\\t@media screen and (max-width: 600px) {\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-special-characters-navigation>.ck-label{max-width:160px;overflow:hidden;text-overflow:ellipsis}.ck.ck-special-characters-navigation>.ck-dropdown .ck-dropdown__panel{max-height:250px;overflow-x:hidden;overflow-y:auto}@media screen and (max-width:600px){.ck.ck-special-characters-navigation{max-width:190px}.ck.ck-special-characters-navigation>.ck-form__header__label{overflow:hidden;text-overflow:ellipsis}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-special-characters/specialcharacters.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\"],\"names\":[],\"mappings\":\"AAUC,+CACC,eAAgB,CAEhB,eAAgB,CADhB,sBAED,CAEA,sEAEC,gBAAiB,CAEjB,iBAAkB,CADlB,eAED,CCfA,oCDED,qCAgBE,eAOF,CALE,6DAEC,eAAgB,CADhB,sBAED,CCrBD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n\\n.ck.ck-special-characters-navigation {\\n\\n\\t& > .ck-label {\\n\\t\\tmax-width: 160px;\\n\\t\\ttext-overflow: ellipsis;\\n\\t\\toverflow: hidden;\\n\\t}\\n\\n\\t& > .ck-dropdown .ck-dropdown__panel {\\n\\t\\t/* There could be dozens of categories available. Use scroll to prevent a 10e6px dropdown. */\\n\\t\\tmax-height: 250px;\\n\\t\\toverflow-y: auto;\\n\\t\\toverflow-x: hidden;\\n\\t}\\n\\n\\t@mixin ck-media-phone {\\n\\t\\tmax-width: 190px;\\n\\n\\t\\t& > .ck-form__header__label {\\n\\t\\t\\ttext-overflow: ellipsis;\\n\\t\\t\\toverflow: hidden;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-phone {\\n\\t@media screen and (max-width: 600px) {\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-dropdown.ck-style-dropdown.ck-style-dropdown_multiple-active>.ck-button>.ck-button__label{font-style:italic}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-style/style.css\"],\"names\":[],\"mappings\":\"AAKA,iGACC,iBACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-dropdown.ck-style-dropdown.ck-style-dropdown_multiple-active > .ck-button > .ck-button__label {\\n\\tfont-style: italic;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-style-panel-columns:3}.ck.ck-style-panel .ck-style-grid{display:grid;grid-template-columns:repeat(var(--ck-style-panel-columns),auto);justify-content:start}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button{display:flex;flex-direction:column;justify-content:space-between}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button .ck-style-grid__button__preview{align-content:center;align-items:center;display:flex;flex-basis:100%;flex-grow:1;justify-content:flex-start}:root{--ck-style-panel-button-width:120px;--ck-style-panel-button-height:80px;--ck-style-panel-button-label-background:#f0f0f0;--ck-style-panel-button-hover-label-background:#ebebeb;--ck-style-panel-button-hover-border-color:#b3b3b3}.ck.ck-style-panel .ck-style-grid{column-gap:var(--ck-spacing-large);row-gap:var(--ck-spacing-large)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button{--ck-color-button-default-hover-background:var(--ck-color-base-background);--ck-color-button-default-active-background:var(--ck-color-base-background);height:var(--ck-style-panel-button-height);padding:0;width:var(--ck-style-panel-button-width)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button:not(:focus){border:1px solid var(--ck-color-base-border)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button .ck-button__label{flex-shrink:0;height:22px;line-height:22px;overflow:hidden;padding:0 var(--ck-spacing-medium);text-overflow:ellipsis;width:100%}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button .ck-style-grid__button__preview{background:var(--ck-color-base-background);border:2px solid var(--ck-color-base-background);opacity:.9;overflow:hidden;padding:var(--ck-spacing-medium);width:100%}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button.ck-disabled{--ck-color-button-default-disabled-background:var(--ck-color-base-foreground)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button.ck-disabled:not(:focus){border-color:var(--ck-style-panel-button-label-background)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button.ck-disabled .ck-style-grid__button__preview{border-color:var(--ck-color-base-foreground);filter:saturate(.3);opacity:.4}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button.ck-on{border-color:var(--ck-color-base-active)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button.ck-on .ck-button__label{box-shadow:0 -1px 0 var(--ck-color-base-active);z-index:1}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button.ck-on:hover{border-color:var(--ck-color-base-active-focus)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button:not(.ck-on) .ck-button__label{background:var(--ck-style-panel-button-label-background)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button:not(.ck-on):hover .ck-button__label{background:var(--ck-style-panel-button-hover-label-background)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button:hover:not(.ck-disabled):not(.ck-on){border-color:var(--ck-style-panel-button-hover-border-color)}.ck.ck-style-panel .ck-style-grid .ck-style-grid__button:hover:not(.ck-disabled):not(.ck-on) .ck-style-grid__button__preview{opacity:1}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-style/theme/stylegrid.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-style/stylegrid.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,0BACD,CAEA,kCACC,YAAa,CACb,gEAAiE,CACjE,qBAgBD,CAdC,yDACC,YAAa,CAEb,qBAAsB,CADtB,6BAWD,CARC,yFAEC,oBAAqB,CAErB,kBAAmB,CAHnB,YAAa,CAKb,eAAgB,CADhB,WAAY,CAFZ,0BAID,CCrBF,MACC,mCAAoC,CACpC,mCAAoC,CACpC,gDAA2D,CAC3D,sDAAiE,CACjE,kDACD,CAEA,kCAEC,kCAAmC,CADnC,+BAmFD,CAhFC,yDACC,0EAA2E,CAC3E,2EAA4E,CAI5E,0CAA2C,CAF3C,SAAU,CACV,wCA0ED,CAtEC,qEACC,4CACD,CAEA,2EAOC,aAAc,CANd,WAAY,CACZ,gBAAiB,CAGjB,eAAgB,CADhB,kCAAmC,CAEnC,sBAAuB,CAHvB,UAKD,CAEA,yFAMC,0CAA2C,CAC3C,gDAAiD,CAJjD,UAAW,CADX,eAAgB,CAGhB,gCAAiC,CAJjC,UAOD,CAEA,qEACC,6EAaD,CAVC,iFACC,0DACD,CAEA,qGAGC,4CAA6C,CAC7C,mBAAoB,CAHpB,UAID,CAGD,+DACC,wCAUD,CARC,iFACC,+CAAgD,CAChD,SACD,CAEA,qEACC,8CACD,CAIA,uFACC,wDACD,CAEA,6FACC,8DACD,CAGD,6FACC,4DAKD,CAHC,6HACC,SACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-style-panel-columns: 3;\\n}\\n\\n.ck.ck-style-panel .ck-style-grid {\\n\\tdisplay: grid;\\n\\tgrid-template-columns: repeat(var(--ck-style-panel-columns),auto);\\n\\tjustify-content: start;\\n\\n\\t& .ck-style-grid__button {\\n\\t\\tdisplay: flex;\\n\\t\\tjustify-content: space-between;\\n\\t\\tflex-direction: column;\\n\\n\\t\\t& .ck-style-grid__button__preview {\\n\\t\\t\\tdisplay: flex;\\n\\t\\t\\talign-content: center;\\n\\t\\t\\tjustify-content: flex-start;\\n\\t\\t\\talign-items: center;\\n\\t\\t\\tflex-grow: 1;\\n\\t\\t\\tflex-basis: 100%;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-style-panel-button-width: 120px;\\n\\t--ck-style-panel-button-height: 80px;\\n\\t--ck-style-panel-button-label-background: hsl(0, 0%, 94.1%);\\n\\t--ck-style-panel-button-hover-label-background: hsl(0, 0%, 92.1%);\\n\\t--ck-style-panel-button-hover-border-color: hsl(0, 0%, 70%);\\n}\\n\\n.ck.ck-style-panel .ck-style-grid {\\n\\trow-gap: var(--ck-spacing-large);\\n\\tcolumn-gap: var(--ck-spacing-large);\\n\\n\\t& .ck-style-grid__button {\\n\\t\\t--ck-color-button-default-hover-background: var(--ck-color-base-background);\\n\\t\\t--ck-color-button-default-active-background: var(--ck-color-base-background);\\n\\n\\t\\tpadding: 0;\\n\\t\\twidth: var(--ck-style-panel-button-width);\\n\\t\\theight: var(--ck-style-panel-button-height);\\n\\n\\t\\t/* Let default .ck-button :focus styles apply */\\n\\t\\t&:not(:focus) {\\n\\t\\t\\tborder: 1px solid var(--ck-color-base-border);\\n\\t\\t}\\n\\n\\t\\t& .ck-button__label {\\n\\t\\t\\theight: 22px;\\n\\t\\t\\tline-height: 22px;\\n\\t\\t\\twidth: 100%;\\n\\t\\t\\tpadding: 0 var(--ck-spacing-medium);\\n\\t\\t\\toverflow: hidden;\\n\\t\\t\\ttext-overflow: ellipsis;\\n\\t\\t\\tflex-shrink: 0;\\n\\t\\t}\\n\\n\\t\\t& .ck-style-grid__button__preview {\\n\\t\\t\\twidth: 100%;\\n\\t\\t\\toverflow: hidden;\\n\\t\\t\\topacity: .9;\\n\\n\\t\\t\\tpadding: var(--ck-spacing-medium);\\n\\t\\t\\tbackground: var(--ck-color-base-background);\\n\\t\\t\\tborder: 2px solid var(--ck-color-base-background);\\n\\t\\t}\\n\\n\\t\\t&.ck-disabled {\\n\\t\\t\\t--ck-color-button-default-disabled-background: var(--ck-color-base-foreground);\\n\\n\\t\\t\\t/* Let default .ck-button :focus styles apply */\\n\\t\\t\\t&:not(:focus) {\\n\\t\\t\\t\\tborder-color: var(--ck-style-panel-button-label-background);\\n\\t\\t\\t}\\n\\n\\t\\t\\t& .ck-style-grid__button__preview {\\n\\t\\t\\t\\topacity: .4;\\n\\n\\t\\t\\t\\tborder-color: var(--ck-color-base-foreground);\\n\\t\\t\\t\\tfilter: saturate(.3);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&.ck-on {\\n\\t\\t\\tborder-color: var(--ck-color-base-active);\\n\\n\\t\\t\\t& .ck-button__label {\\n\\t\\t\\t\\tbox-shadow: 0 -1px 0 var(--ck-color-base-active);\\n\\t\\t\\t\\tz-index: 1; /* Stay on top of the preview with the shadow. */\\n\\t\\t\\t}\\n\\n\\t\\t\\t&:hover {\\n\\t\\t\\t\\tborder-color: var(--ck-color-base-active-focus);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&:not(.ck-on) {\\n\\t\\t\\t& .ck-button__label {\\n\\t\\t\\t\\tbackground: var(--ck-style-panel-button-label-background);\\n\\t\\t\\t}\\n\\n\\t\\t\\t&:hover .ck-button__label {\\n\\t\\t\\t\\tbackground: var(--ck-style-panel-button-hover-label-background);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&:hover:not(.ck-disabled):not(.ck-on) {\\n\\t\\t\\tborder-color: var(--ck-style-panel-button-hover-border-color);\\n\\n\\t\\t\\t& .ck-style-grid__button__preview {\\n\\t\\t\\t\\topacity: 1;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-style-panel .ck-style-panel__style-group>.ck-label{margin:var(--ck-spacing-large) 0}.ck.ck-style-panel .ck-style-panel__style-group:first-child>.ck-label{margin-top:0}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-style/stylegroup.css\"],\"names\":[],\"mappings\":\"AAMC,0DACC,gCACD,CAGC,sEACC,YACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-style-panel .ck-style-panel__style-group {\\n\\t& > .ck-label {\\n\\t\\tmargin: var(--ck-spacing-large) 0;\\n\\t}\\n\\n\\t&:first-child {\\n\\t\\t& > .ck-label {\\n\\t\\t\\tmargin-top: 0;\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-style-panel-max-height:470px}.ck.ck-style-panel{max-height:var(--ck-style-panel-max-height);overflow-y:auto;padding:var(--ck-spacing-large)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-style/stylepanel.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,iCACD,CAEA,mBAGC,2CAA4C,CAD5C,eAAgB,CADhB,+BAGD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-style-panel-max-height: 470px;\\n}\\n\\n.ck.ck-style-panel {\\n\\tpadding: var(--ck-spacing-large);\\n\\toverflow-y: auto;\\n\\tmax-height: var(--ck-style-panel-max-height);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-input-color{display:flex;flex-direction:row-reverse;width:100%}.ck.ck-input-color>input.ck.ck-input-text{flex-grow:1;min-width:auto}.ck.ck-input-color>div.ck.ck-dropdown{min-width:auto}.ck.ck-input-color>div.ck.ck-dropdown>.ck-input-color__button .ck-dropdown__arrow{display:none}.ck.ck-input-color .ck.ck-input-color__button{display:flex}.ck.ck-input-color .ck.ck-input-color__button .ck.ck-input-color__button__preview{overflow:hidden;position:relative}.ck.ck-input-color .ck.ck-input-color__button .ck.ck-input-color__button__preview>.ck.ck-input-color__button__preview__no-color-indicator{display:block;position:absolute}[dir=ltr] .ck.ck-input-color>.ck.ck-input-text{border-bottom-right-radius:0;border-top-right-radius:0}[dir=rtl] .ck.ck-input-color>.ck.ck-input-text{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-input-color>.ck.ck-input-text:focus{z-index:0}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{padding:0}[dir=ltr] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{border-bottom-left-radius:0;border-top-left-radius:0}[dir=ltr] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button:not(:focus){border-left:1px solid transparent}[dir=rtl] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button{border-bottom-right-radius:0;border-top-right-radius:0}[dir=rtl] .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button:not(:focus){border-right:1px solid transparent}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button.ck-disabled{background:var(--ck-color-input-disabled-background)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview{border-radius:0}.ck-rounded-corners .ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview,.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview{border:1px solid var(--ck-color-input-border);height:20px;width:20px}.ck.ck-input-color>.ck.ck-dropdown>.ck.ck-button.ck-input-color__button>.ck.ck-input-color__button__preview>.ck.ck-input-color__button__preview__no-color-indicator{background:red;border-radius:2px;height:150%;left:50%;top:-30%;transform:rotate(45deg);transform-origin:50%;width:8%}.ck.ck-input-color .ck.ck-input-color__remove-color{border-bottom-left-radius:0;border-bottom-right-radius:0;padding:calc(var(--ck-spacing-standard)/2) var(--ck-spacing-standard);width:100%}.ck.ck-input-color .ck.ck-input-color__remove-color:not(:focus){border-bottom:1px solid var(--ck-color-input-border)}[dir=ltr] .ck.ck-input-color .ck.ck-input-color__remove-color{border-top-right-radius:0}[dir=rtl] .ck.ck-input-color .ck.ck-input-color__remove-color{border-top-left-radius:0}.ck.ck-input-color .ck.ck-input-color__remove-color .ck.ck-icon{margin-right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-input-color .ck.ck-input-color__remove-color .ck.ck-icon{margin-left:var(--ck-spacing-standard);margin-right:0}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/colorinput.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/colorinput.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAKA,mBAEC,YAAa,CACb,0BAA2B,CAF3B,UAgCD,CA5BC,0CAEC,WAAY,CADZ,cAED,CAEA,sCACC,cAMD,CAHC,kFACC,YACD,CAGD,8CAEC,YAWD,CATC,kFAEC,eAAgB,CADhB,iBAOD,CAJC,0IAEC,aAAc,CADd,iBAED,CC1BF,+CAGE,4BAA6B,CAD7B,yBAcF,CAhBA,+CAQE,2BAA4B,CAD5B,wBASF,CAHC,2CACC,SACD,CAIA,wEACC,SA0CD,CA3CA,kFAKE,2BAA4B,CAD5B,wBAuCF,CApCE,8FACC,iCACD,CATF,kFAcE,4BAA6B,CAD7B,yBA8BF,CA3BE,8FACC,kCACD,CAGD,oFACC,oDACD,CAEA,4GC1CF,eD2DE,CAjBA,+PCtCD,qCDuDC,CAjBA,4GAKC,6CAA8C,CAD9C,WAAY,CADZ,UAcD,CAVC,oKAKC,cAA6B,CAC7B,iBAAkB,CAHlB,WAAY,CADZ,QAAS,CADT,QAAS,CAMT,uBAAwB,CACxB,oBAAqB,CAJrB,QAKD,CAKH,oDAIC,2BAA4B,CAC5B,4BAA6B,CAH7B,qEAAwE,CADxE,UA0BD,CApBC,gEACC,oDACD,CATD,8DAYE,yBAeF,CA3BA,8DAgBE,wBAWF,CARC,gEACC,uCAMD,CAPA,0EAKE,sCAAuC,CADvC,cAGF\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-input-color {\\n\\twidth: 100%;\\n\\tdisplay: flex;\\n\\tflex-direction: row-reverse;\\n\\n\\t& > input.ck.ck-input-text {\\n\\t\\tmin-width: auto;\\n\\t\\tflex-grow: 1;\\n\\t}\\n\\n\\t& > div.ck.ck-dropdown {\\n\\t\\tmin-width: auto;\\n\\n\\t\\t/* This dropdown has no arrow but a color preview instead. */\\n\\t\\t& > .ck-input-color__button .ck-dropdown__arrow {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck.ck-input-color__button {\\n\\t\\t/* Resolving issue with misaligned buttons on Safari (see #10589) */\\n\\t\\tdisplay: flex;\\n\\n\\t\\t& .ck.ck-input-color__button__preview {\\n\\t\\t\\tposition: relative;\\n\\t\\t\\toverflow: hidden;\\n\\n\\t\\t\\t& > .ck.ck-input-color__button__preview__no-color-indicator {\\n\\t\\t\\t\\tposition: absolute;\\n\\t\\t\\t\\tdisplay: block;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n@import \\\"../mixins/_rounded.css\\\";\\n\\n.ck.ck-input-color {\\n\\t& > .ck.ck-input-text {\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\tborder-top-right-radius: 0;\\n\\t\\t\\tborder-bottom-right-radius: 0;\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\tborder-top-left-radius: 0;\\n\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t}\\n\\n\\t\\t/* Make sure the focused input is always on top of the dropdown button so its\\n\\t\\t outline and border are never cropped (also when the input is read-only). */\\n\\t\\t&:focus {\\n\\t\\t\\tz-index: 0;\\n\\t\\t}\\n\\t}\\n\\n\\t& > .ck.ck-dropdown {\\n\\t\\t& > .ck.ck-button.ck-input-color__button {\\n\\t\\t\\tpadding: 0;\\n\\n\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\tborder-top-left-radius: 0;\\n\\t\\t\\t\\tborder-bottom-left-radius: 0;\\n\\n\\t\\t\\t\\t&:not(:focus) {\\n\\t\\t\\t\\t\\tborder-left: 1px solid transparent;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tborder-top-right-radius: 0;\\n\\t\\t\\t\\tborder-bottom-right-radius: 0;\\n\\n\\t\\t\\t\\t&:not(:focus) {\\n\\t\\t\\t\\t\\tborder-right: 1px solid transparent;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\t&.ck-disabled {\\n\\t\\t\\t\\tbackground: var(--ck-color-input-disabled-background);\\n\\t\\t\\t}\\n\\n\\t\\t\\t& > .ck.ck-input-color__button__preview {\\n\\t\\t\\t\\t@mixin ck-rounded-corners;\\n\\n\\t\\t\\t\\twidth: 20px;\\n\\t\\t\\t\\theight: 20px;\\n\\t\\t\\t\\tborder: 1px solid var(--ck-color-input-border);\\n\\n\\t\\t\\t\\t& > .ck.ck-input-color__button__preview__no-color-indicator {\\n\\t\\t\\t\\t\\ttop: -30%;\\n\\t\\t\\t\\t\\tleft: 50%;\\n\\t\\t\\t\\t\\theight: 150%;\\n\\t\\t\\t\\t\\twidth: 8%;\\n\\t\\t\\t\\t\\tbackground: hsl(0, 100%, 50%);\\n\\t\\t\\t\\t\\tborder-radius: 2px;\\n\\t\\t\\t\\t\\ttransform: rotate(45deg);\\n\\t\\t\\t\\t\\ttransform-origin: 50%;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck.ck-input-color__remove-color {\\n\\t\\twidth: 100%;\\n\\t\\tpadding: calc(var(--ck-spacing-standard) / 2) var(--ck-spacing-standard);\\n\\n\\t\\tborder-bottom-left-radius: 0;\\n\\t\\tborder-bottom-right-radius: 0;\\n\\n\\t\\t&:not(:focus) {\\n\\t\\t\\tborder-bottom: 1px solid var(--ck-color-input-border);\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\tborder-top-right-radius: 0;\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\tborder-top-left-radius: 0;\\n\\t\\t}\\n\\n\\t\\t& .ck.ck-icon {\\n\\t\\t\\tmargin-right: var(--ck-spacing-standard);\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tmargin-right: 0;\\n\\t\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-form{padding:0 0 var(--ck-spacing-large)}.ck.ck-form:focus{outline:none}.ck.ck-form .ck.ck-input-text{min-width:100%;width:0}.ck.ck-form .ck.ck-dropdown{min-width:100%}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button:not(:focus){border:1px solid var(--ck-color-base-border)}.ck.ck-form .ck.ck-dropdown .ck-dropdown__button .ck-button__label{width:100%}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/form.css\"],\"names\":[],\"mappings\":\"AAKA,YACC,mCAyBD,CAvBC,kBAEC,YACD,CAEA,8BACC,cAAe,CACf,OACD,CAEA,4BACC,cAWD,CARE,6DACC,4CACD,CAEA,mEACC,UACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-form {\\n\\tpadding: 0 0 var(--ck-spacing-large);\\n\\n\\t&:focus {\\n\\t\\t/* See: https://github.com/ckeditor/ckeditor5/issues/4773 */\\n\\t\\toutline: none;\\n\\t}\\n\\n\\t& .ck.ck-input-text {\\n\\t\\tmin-width: 100%;\\n\\t\\twidth: 0;\\n\\t}\\n\\n\\t& .ck.ck-dropdown {\\n\\t\\tmin-width: 100%;\\n\\n\\t\\t& .ck-dropdown__button {\\n\\t\\t\\t&:not(:focus) {\\n\\t\\t\\t\\tborder: 1px solid var(--ck-color-base-border);\\n\\t\\t\\t}\\n\\n\\t\\t\\t& .ck-button__label {\\n\\t\\t\\t\\twidth: 100%;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-form__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.ck.ck-form__row>:not(.ck-label){flex-grow:1}.ck.ck-form__row.ck-table-form__action-row .ck-button-cancel,.ck.ck-form__row.ck-table-form__action-row .ck-button-save{justify-content:center}.ck.ck-form__row{padding:var(--ck-spacing-standard) var(--ck-spacing-large) 0}[dir=ltr] .ck.ck-form__row>:not(.ck-label)+*{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-form__row>:not(.ck-label)+*{margin-right:var(--ck-spacing-large)}.ck.ck-form__row>.ck-label{min-width:100%;width:100%}.ck.ck-form__row.ck-table-form__action-row{margin-top:var(--ck-spacing-large)}.ck.ck-form__row.ck-table-form__action-row .ck-button .ck-button__label{color:var(--ck-color-text)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/formrow.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/formrow.css\"],\"names\":[],\"mappings\":\"AAKA,iBACC,YAAa,CACb,kBAAmB,CACnB,gBAAiB,CACjB,6BAaD,CAVC,iCACC,WACD,CAGC,wHAEC,sBACD,CCbF,iBACC,4DA2BD,CAvBE,6CAEE,mCAMF,CARA,6CAME,oCAEF,CAGD,2BAEC,cAAe,CADf,UAED,CAEA,2CACC,kCAKD,CAHC,wEACC,0BACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-form__row {\\n\\tdisplay: flex;\\n\\tflex-direction: row;\\n\\tflex-wrap: nowrap;\\n\\tjustify-content: space-between;\\n\\n\\t/* Ignore labels that work as fieldset legends */\\n\\t& > *:not(.ck-label) {\\n\\t\\tflex-grow: 1;\\n\\t}\\n\\n\\t&.ck-table-form__action-row {\\n\\t\\t& .ck-button-save,\\n\\t\\t& .ck-button-cancel {\\n\\t\\t\\tjustify-content: center;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck.ck-form__row {\\n\\tpadding: var(--ck-spacing-standard) var(--ck-spacing-large) 0;\\n\\n\\t/* Ignore labels that work as fieldset legends */\\n\\t& > *:not(.ck-label) {\\n\\t\\t& + * {\\n\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\tmargin-left: var(--ck-spacing-large);\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tmargin-right: var(--ck-spacing-large);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t& > .ck-label {\\n\\t\\twidth: 100%;\\n\\t\\tmin-width: 100%;\\n\\t}\\n\\n\\t&.ck-table-form__action-row {\\n\\t\\tmargin-top: var(--ck-spacing-large);\\n\\n\\t\\t& .ck-button .ck-button__label {\\n\\t\\t\\tcolor: var(--ck-color-text);\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap}:root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px}.ck .ck-insert-table-dropdown__grid{padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0;width:calc(var(--ck-insert-table-dropdown-box-width)*10 + var(--ck-insert-table-dropdown-box-margin)*20 + var(--ck-insert-table-dropdown-padding)*2)}.ck .ck-insert-table-dropdown__label,.ck[dir=rtl] .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{border:1px solid var(--ck-color-base-border);border-radius:1px;margin:var(--ck-insert-table-dropdown-box-margin);min-height:var(--ck-insert-table-dropdown-box-height);min-width:var(--ck-insert-table-dropdown-box-width);outline:none;transition:none}.ck .ck-insert-table-dropdown-grid-box:focus{box-shadow:none}.ck .ck-insert-table-dropdown-grid-box.ck-on{background:var(--ck-color-focus-outer-shadow);border-color:var(--ck-color-focus-border)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/inserttable.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/inserttable.css\"],\"names\":[],\"mappings\":\"AAKA,oCACC,YAAa,CACb,kBAAmB,CACnB,cACD,CCJA,MACC,uCAAwC,CACxC,0CAA2C,CAC3C,yCAA0C,CAC1C,yCACD,CAEA,oCAGC,yFAA0F,CAD1F,oJAED,CAEA,mFAEC,iBACD,CAEA,uCAIC,4CAA6C,CAC7C,iBAAkB,CAFlB,iDAAkD,CADlD,qDAAsD,CADtD,mDAAoD,CAKpD,YAAa,CACb,eAUD,CARC,6CACC,eACD,CAEA,6CAEC,6CAA8C,CAD9C,yCAED\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck .ck-insert-table-dropdown__grid {\\n\\tdisplay: flex;\\n\\tflex-direction: row;\\n\\tflex-wrap: wrap;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-insert-table-dropdown-padding: 10px;\\n\\t--ck-insert-table-dropdown-box-height: 11px;\\n\\t--ck-insert-table-dropdown-box-width: 12px;\\n\\t--ck-insert-table-dropdown-box-margin: 1px;\\n}\\n\\n.ck .ck-insert-table-dropdown__grid {\\n\\t/* The width of a container should match 10 items in a row so there will be a 10x10 grid. */\\n\\twidth: calc(var(--ck-insert-table-dropdown-box-width) * 10 + var(--ck-insert-table-dropdown-box-margin) * 20 + var(--ck-insert-table-dropdown-padding) * 2);\\n\\tpadding: var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0;\\n}\\n\\n.ck .ck-insert-table-dropdown__label,\\n.ck[dir=rtl] .ck-insert-table-dropdown__label {\\n\\ttext-align: center;\\n}\\n\\n.ck .ck-insert-table-dropdown-grid-box {\\n\\tmin-width: var(--ck-insert-table-dropdown-box-width);\\n\\tmin-height: var(--ck-insert-table-dropdown-box-height);\\n\\tmargin: var(--ck-insert-table-dropdown-box-margin);\\n\\tborder: 1px solid var(--ck-color-base-border);\\n\\tborder-radius: 1px;\\n\\toutline: none;\\n\\ttransition: none;\\n\\n\\t&:focus {\\n\\t\\tbox-shadow: none;\\n\\t}\\n\\n\\t&.ck-on {\\n\\t\\tborder-color: var(--ck-color-focus-border);\\n\\t\\tbackground: var(--ck-color-focus-outer-shadow);\\n\\t}\\n}\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-content .table{display:table;margin:.9em auto}.ck-content .table table{border:1px double #b3b3b3;border-collapse:collapse;border-spacing:0;height:100%;width:100%}.ck-content .table table td,.ck-content .table table th{border:1px solid #bfbfbf;min-width:2em;padding:.4em}.ck-content .table table th{background:rgba(0,0,0,.05);font-weight:700}.ck-content[dir=rtl] .table th{text-align:right}.ck-content[dir=ltr] .table th{text-align:left}.ck-editor__editable .ck-table-bogus-paragraph{display:inline-block;width:100%}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/table.css\"],\"names\":[],\"mappings\":\"AAKA,mBAKC,aAAc,CADd,gBAiCD,CA9BC,yBAYC,yBAAkC,CAVlC,wBAAyB,CACzB,gBAAiB,CAKjB,WAAY,CADZ,UAsBD,CAfC,wDAQC,wBAAiC,CANjC,aAAc,CACd,YAMD,CAEA,4BAEC,0BAA+B,CAD/B,eAED,CAMF,+BACC,gBACD,CAEA,+BACC,eACD,CAEA,+CAKC,oBAAqB,CAMrB,UACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck-content .table {\\n\\t/* Give the table widget some air and center it horizontally */\\n\\t/* The first value should be equal to --ck-spacing-large variable if used in the editor context\\n\\tto avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */\\n\\tmargin: 0.9em auto;\\n\\tdisplay: table;\\n\\n\\t& table {\\n\\t\\t/* The table cells should have slight borders */\\n\\t\\tborder-collapse: collapse;\\n\\t\\tborder-spacing: 0;\\n\\n\\t\\t/* Table width and height are set on the parent <figure>. Make sure the table inside stretches\\n\\t\\tto the full dimensions of the container (https://github.com/ckeditor/ckeditor5/issues/6186). */\\n\\t\\twidth: 100%;\\n\\t\\theight: 100%;\\n\\n\\t\\t/* The outer border of the table should be slightly darker than the inner lines.\\n\\t\\tAlso see https://github.com/ckeditor/ckeditor5-table/issues/50. */\\n\\t\\tborder: 1px double hsl(0, 0%, 70%);\\n\\n\\t\\t& td,\\n\\t\\t& th {\\n\\t\\t\\tmin-width: 2em;\\n\\t\\t\\tpadding: .4em;\\n\\n\\t\\t\\t/* The border is inherited from .ck-editor__nested-editable styles, so theoretically it's not necessary here.\\n\\t\\t\\tHowever, the border is a content style, so it should use .ck-content (so it works outside the editor).\\n\\t\\t\\tHence, the duplication. See https://github.com/ckeditor/ckeditor5/issues/6314 */\\n\\t\\t\\tborder: 1px solid hsl(0, 0%, 75%);\\n\\t\\t}\\n\\n\\t\\t& th {\\n\\t\\t\\tfont-weight: bold;\\n\\t\\t\\tbackground: hsla(0, 0%, 0%, 5%);\\n\\t\\t}\\n\\t}\\n}\\n\\n/* Text alignment of the table header should match the editor settings and override the native browser styling,\\nwhen content is available outside the editor. See https://github.com/ckeditor/ckeditor5/issues/6638 */\\n.ck-content[dir=\\\"rtl\\\"] .table th {\\n\\ttext-align: right;\\n}\\n\\n.ck-content[dir=\\\"ltr\\\"] .table th {\\n\\ttext-align: left;\\n}\\n\\n.ck-editor__editable .ck-table-bogus-paragraph {\\n\\t/*\\n\\t * Use display:inline-block to force Chrome/Safari to limit text mutations to this element.\\n\\t * See https://github.com/ckeditor/ckeditor5/issues/6062.\\n\\t */\\n\\tdisplay: inline-block;\\n\\n\\t/*\\n\\t * Inline HTML elements nested in the span should always be dimensioned in relation to the whole cell width.\\n\\t * See https://github.com/ckeditor/ckeditor5/issues/9117.\\n\\t */\\n\\twidth: 100%;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-color-table-caption-background:#f7f7f7;--ck-color-table-caption-text:#333;--ck-color-table-caption-highlighted-background:#fd0}.ck-content .table>figcaption{background-color:var(--ck-color-table-caption-background);caption-side:top;color:var(--ck-color-table-caption-text);display:table-caption;font-size:.75em;outline-offset:-1px;padding:.6em;text-align:center;word-break:break-word}.ck.ck-editor__editable .table>figcaption.table__caption_highlighted{animation:ck-table-caption-highlight .6s ease-out}.ck.ck-editor__editable .table>figcaption.ck-placeholder:before{overflow:hidden;padding-left:inherit;padding-right:inherit;text-overflow:ellipsis;white-space:nowrap}@keyframes ck-table-caption-highlight{0%{background-color:var(--ck-color-table-caption-highlighted-background)}to{background-color:var(--ck-color-table-caption-background)}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/tablecaption.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,2CAAoD,CACpD,kCAA8C,CAC9C,oDACD,CAGA,8BAMC,yDAA0D,CAJ1D,gBAAiB,CAGjB,wCAAyC,CAJzC,qBAAsB,CAOtB,eAAgB,CAChB,mBAAoB,CAFpB,YAAa,CAHb,iBAAkB,CADlB,qBAOD,CAIC,qEACC,iDACD,CAEA,gEASC,eAAgB,CARhB,oBAAqB,CACrB,qBAAsB,CAQtB,sBAAuB,CAFvB,kBAGD,CAGD,sCACC,GACC,qEACD,CAEA,GACC,yDACD,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-table-caption-background: hsl(0, 0%, 97%);\\n\\t--ck-color-table-caption-text: hsl(0, 0%, 20%);\\n\\t--ck-color-table-caption-highlighted-background: hsl(52deg 100% 50%);\\n}\\n\\n/* Content styles */\\n.ck-content .table > figcaption {\\n\\tdisplay: table-caption;\\n\\tcaption-side: top;\\n\\tword-break: break-word;\\n\\ttext-align: center;\\n\\tcolor: var(--ck-color-table-caption-text);\\n\\tbackground-color: var(--ck-color-table-caption-background);\\n\\tpadding: .6em;\\n\\tfont-size: .75em;\\n\\toutline-offset: -1px;\\n}\\n\\n/* Editing styles */\\n.ck.ck-editor__editable .table > figcaption {\\n\\t&.table__caption_highlighted {\\n\\t\\tanimation: ck-table-caption-highlight .6s ease-out;\\n\\t}\\n\\n\\t&.ck-placeholder::before {\\n\\t\\tpadding-left: inherit;\\n\\t\\tpadding-right: inherit;\\n\\n\\t\\t/*\\n\\t\\t * Make sure the table caption placeholder doesn't overflow the placeholder area.\\n\\t\\t * See https://github.com/ckeditor/ckeditor5/issues/9162.\\n\\t\\t */\\n\\t\\twhite-space: nowrap;\\n\\t\\toverflow: hidden;\\n\\t\\ttext-overflow: ellipsis;\\n\\t}\\n}\\n\\n@keyframes ck-table-caption-highlight {\\n\\t0% {\\n\\t\\tbackground-color: var(--ck-color-table-caption-highlighted-background);\\n\\t}\\n\\n\\t100% {\\n\\t\\tbackground-color: var(--ck-color-table-caption-background);\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row{flex-wrap:wrap}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar:first-of-type{flex-grow:0.57}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar:last-of-type{flex-grow:0.43}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar .ck-button{flex-grow:1}.ck.ck-table-cell-properties-form{width:320px}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__padding-row{align-self:flex-end;padding:0;width:25%}.ck.ck-table-cell-properties-form .ck-form__row.ck-table-cell-properties-form__alignment-row .ck.ck-toolbar{background:none;margin-top:var(--ck-spacing-standard)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/tablecellproperties.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/tablecellproperties.css\"],\"names\":[],\"mappings\":\"AAOE,6FACC,cAiBD,CAdE,0HAEC,cACD,CAEA,yHAEC,cACD,CAEA,uHACC,WACD,CClBJ,kCACC,WAkBD,CAfE,2FACC,mBAAoB,CACpB,SAAU,CACV,SACD,CAGC,4GACC,eAAgB,CAGhB,qCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-table-cell-properties-form {\\n\\t& .ck-form__row {\\n\\t\\t&.ck-table-cell-properties-form__alignment-row {\\n\\t\\t\\tflex-wrap: wrap;\\n\\n\\t\\t\\t& .ck.ck-toolbar {\\n\\t\\t\\t\\t&:first-of-type {\\n\\t\\t\\t\\t\\t/* 4 buttons out of 7 (h-alignment + v-alignment) = 0.57 */\\n\\t\\t\\t\\t\\tflex-grow: 0.57;\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t&:last-of-type {\\n\\t\\t\\t\\t\\t/* 3 buttons out of 7 (h-alignment + v-alignment) = 0.43 */\\n\\t\\t\\t\\t\\tflex-grow: 0.43;\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t& .ck-button {\\n\\t\\t\\t\\t\\tflex-grow: 1;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-table-cell-properties-form {\\n\\twidth: 320px;\\n\\n\\t& .ck-form__row {\\n\\t\\t&.ck-table-cell-properties-form__padding-row {\\n\\t\\t\\talign-self: flex-end;\\n\\t\\t\\tpadding: 0;\\n\\t\\t\\twidth: 25%;\\n\\t\\t}\\n\\n\\t\\t&.ck-table-cell-properties-form__alignment-row {\\n\\t\\t\\t& .ck.ck-toolbar {\\n\\t\\t\\t\\tbackground: none;\\n\\n\\t\\t\\t\\t/* Compensate for missing input label that would push the margin (toolbar has no inputs). */\\n\\t\\t\\t\\tmargin-top: var(--ck-spacing-standard);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-color-table-column-resizer-hover:var(--ck-color-base-active);--ck-table-column-resizer-width:7px;--ck-table-column-resizer-position-offset:calc(var(--ck-table-column-resizer-width)*-0.5 - 0.5px)}.ck-content .table .ck-table-resized{table-layout:fixed}.ck-content .table table{overflow:hidden}.ck-content .table td,.ck-content .table th{position:relative}.ck.ck-editor__editable .table .ck-table-column-resizer{bottom:-999999px;cursor:col-resize;position:absolute;right:var(--ck-table-column-resizer-position-offset);top:-999999px;user-select:none;width:var(--ck-table-column-resizer-width);z-index:var(--ck-z-default)}.ck.ck-editor__editable .table[draggable] .ck-table-column-resizer,.ck.ck-editor__editable.ck-column-resize_disabled .table .ck-table-column-resizer{display:none}.ck.ck-editor__editable .table .ck-table-column-resizer:hover,.ck.ck-editor__editable .table .ck-table-column-resizer__active{background-color:var(--ck-color-table-column-resizer-hover);opacity:.25}.ck.ck-editor__editable[dir=rtl] .table .ck-table-column-resizer{left:var(--ck-table-column-resizer-position-offset);right:unset}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/tablecolumnresize.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,iEAAkE,CAClE,mCAAoC,CAIpC,iGACD,CAEA,qCACC,kBACD,CAEA,yBACC,eACD,CAEA,4CAEC,iBACD,CAEA,wDAOC,gBAAiB,CAGjB,iBAAkB,CATlB,iBAAkB,CAOlB,oDAAqD,CAFrD,aAAc,CAKd,gBAAiB,CAFjB,0CAA2C,CAG3C,2BACD,CAQA,qJACC,YACD,CAEA,8HAEC,2DAA4D,CAC5D,WACD,CAEA,iEACC,mDAAoD,CACpD,WACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-table-column-resizer-hover: var(--ck-color-base-active);\\n\\t--ck-table-column-resizer-width: 7px;\\n\\n\\t/* The offset used for absolute positioning of the resizer element, so that it is placed exactly above the cell border.\\n\\t The value is: minus half the width of the resizer decreased additionaly by the half the width of the border (0.5px). */\\n\\t--ck-table-column-resizer-position-offset: calc(var(--ck-table-column-resizer-width) * -0.5 - 0.5px);\\n}\\n\\n.ck-content .table .ck-table-resized {\\n\\ttable-layout: fixed;\\n}\\n\\n.ck-content .table table {\\n\\toverflow: hidden;\\n}\\n\\n.ck-content .table td,\\n.ck-content .table th {\\n\\tposition: relative;\\n}\\n\\n.ck.ck-editor__editable .table .ck-table-column-resizer {\\n\\tposition: absolute;\\n\\t/* The resizer element resides in each cell so to occupy the entire height of the table, which is unknown from a CSS point of view,\\n\\t it is extended to an extremely high height. Even for screens with a very high pixel density, the resizer will fulfill its role as\\n\\t it should, i.e. for a screen of 476 ppi the total height of the resizer will take over 350 sheets of A4 format, which is totally\\n\\t unrealistic height for a single table. */\\n\\ttop: -999999px;\\n\\tbottom: -999999px;\\n\\tright: var(--ck-table-column-resizer-position-offset);\\n\\twidth: var(--ck-table-column-resizer-width);\\n\\tcursor: col-resize;\\n\\tuser-select: none;\\n\\tz-index: var(--ck-z-default);\\n}\\n\\n.ck.ck-editor__editable.ck-column-resize_disabled .table .ck-table-column-resizer {\\n\\tdisplay: none;\\n}\\n\\n/* The resizer elements, which are extended to an extremely high height, break the drag & drop feature in Chrome. To make it work again,\\n all resizers must be hidden while the table is dragged. */\\n.ck.ck-editor__editable .table[draggable] .ck-table-column-resizer {\\n\\tdisplay: none;\\n}\\n\\n.ck.ck-editor__editable .table .ck-table-column-resizer:hover,\\n.ck.ck-editor__editable .table .ck-table-column-resizer__active {\\n\\tbackground-color: var(--ck-color-table-column-resizer-hover);\\n\\topacity: 0.25;\\n}\\n\\n.ck.ck-editor__editable[dir=rtl] .table .ck-table-column-resizer {\\n\\tleft: var(--ck-table-column-resizer-position-offset);\\n\\tright: unset;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-color-table-focused-cell-background:rgba(158,201,250,.3)}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table td.ck-editor__nested-editable:focus,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable:focus{background:var(--ck-color-table-focused-cell-background);border-style:none;outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/tableediting.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,6DACD,CAKE,8QAGC,wDAAyD,CAKzD,iBAAkB,CAClB,8CAA+C,CAC/C,mBACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-table-focused-cell-background: hsla(212, 90%, 80%, .3);\\n}\\n\\n.ck-widget.table {\\n\\t& td,\\n\\t& th {\\n\\t\\t&.ck-editor__nested-editable.ck-editor__nested-editable_focused,\\n\\t\\t&.ck-editor__nested-editable:focus {\\n\\t\\t\\t/* A very slight background to highlight the focused cell */\\n\\t\\t\\tbackground: var(--ck-color-table-focused-cell-background);\\n\\n\\t\\t\\t/* Fixes the problem where surrounding cells cover the focused cell's border.\\n\\t\\t\\tIt does not fix the problem in all places but the UX is improved.\\n\\t\\t\\tSee https://github.com/ckeditor/ckeditor5-table/issues/29. */\\n\\t\\t\\tborder-style: none;\\n\\t\\t\\toutline: 1px solid var(--ck-color-focus-border);\\n\\t\\t\\toutline-offset: -1px; /* progressive enhancement - no IE support */\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-table-form .ck-form__row.ck-table-form__background-row,.ck.ck-table-form .ck-form__row.ck-table-form__border-row{flex-wrap:wrap}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row{align-items:center;flex-wrap:wrap}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-field-view{align-items:center;display:flex;flex-direction:column-reverse}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-labeled-field-view .ck.ck-dropdown,.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimension-operator{flex-grow:0}.ck.ck-table-form .ck.ck-labeled-field-view{position:relative}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{bottom:calc(var(--ck-table-properties-error-arrow-size)*-1);left:50%;position:absolute;transform:translate(-50%,100%);z-index:1}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status:after{content:\\\"\\\";left:50%;position:absolute;top:calc(var(--ck-table-properties-error-arrow-size)*-1);transform:translateX(-50%)}:root{--ck-table-properties-error-arrow-size:6px;--ck-table-properties-min-error-width:150px}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-labeled-field-view>.ck-label{font-size:var(--ck-font-size-tiny);text-align:center}.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-style,.ck.ck-table-form .ck-form__row.ck-table-form__border-row .ck-table-form__border-width{max-width:80px;min-width:80px;width:80px}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row{padding:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimensions-row__height,.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimensions-row__width{margin:0}.ck.ck-table-form .ck-form__row.ck-table-form__dimensions-row .ck-table-form__dimension-operator{align-self:flex-end;display:inline-block;height:var(--ck-ui-component-min-height);line-height:var(--ck-ui-component-min-height);margin:0 var(--ck-spacing-small)}.ck.ck-table-form .ck.ck-labeled-field-view{padding-top:var(--ck-spacing-standard)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{border-radius:0}.ck-rounded-corners .ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status,.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{background:var(--ck-color-base-error);color:var(--ck-color-base-background);min-width:var(--ck-table-properties-min-error-width);padding:var(--ck-spacing-small) var(--ck-spacing-medium);text-align:center}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status:after{border-color:transparent transparent var(--ck-color-base-error) transparent;border-style:solid;border-width:0 var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size)}.ck.ck-table-form .ck.ck-labeled-field-view .ck.ck-labeled-field-view__status{animation:ck-table-form-labeled-view-status-appear .15s ease both}.ck.ck-table-form .ck.ck-labeled-field-view .ck-input.ck-error:not(:focus)+.ck.ck-labeled-field-view__status{display:none}@keyframes ck-table-form-labeled-view-status-appear{0%{opacity:0}to{opacity:1}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/tableform.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/tableform.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAWE,wHACC,cACD,CAEA,8DAEC,kBAAmB,CADnB,cAgBD,CAbC,qFAGC,kBAAmB,CAFnB,YAAa,CACb,6BAMD,CAEA,sMACC,WACD,CAIF,4CAEC,iBAoBD,CAlBC,8EAGC,2DAAgE,CADhE,QAAS,CADT,iBAAkB,CAGlB,8BAA+B,CAG/B,SAUD,CAPC,oFACC,UAAW,CAGX,QAAS,CAFT,iBAAkB,CAClB,wDAA6D,CAE7D,0BACD,CChDH,MACC,0CAA2C,CAC3C,2CACD,CAMI,2FACC,kCAAmC,CACnC,iBACD,CAGD,8KAIC,cAAe,CADf,cAAe,CADf,UAGD,CAGD,8DACC,SAcD,CAZC,yMAEC,QACD,CAEA,iGACC,mBAAoB,CACpB,oBAAqB,CACrB,wCAAyC,CACzC,6CAA8C,CAC9C,gCACD,CAIF,4CACC,sCAyBD,CAvBC,8ECxCD,eDyDC,CAjBA,mMCpCA,qCDqDA,CAjBA,8EAGC,qCAAsC,CACtC,qCAAsC,CAEtC,oDAAqD,CADrD,wDAAyD,CAEzD,iBAUD,CAPC,oFACC,2EAA4E,CAE5E,kBAAmB,CADnB,kJAED,CAdD,8EAgBC,iEACD,CAGA,6GACC,YACD,CAIF,oDACC,GACC,SACD,CAEA,GACC,SACD,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-table-form {\\n\\t& .ck-form__row {\\n\\t\\t&.ck-table-form__border-row {\\n\\t\\t\\tflex-wrap: wrap;\\n\\t\\t}\\n\\n\\t\\t&.ck-table-form__background-row {\\n\\t\\t\\tflex-wrap: wrap;\\n\\t\\t}\\n\\n\\t\\t&.ck-table-form__dimensions-row {\\n\\t\\t\\tflex-wrap: wrap;\\n\\t\\t\\talign-items: center;\\n\\n\\t\\t\\t& .ck-labeled-field-view {\\n\\t\\t\\t\\tdisplay: flex;\\n\\t\\t\\t\\tflex-direction: column-reverse;\\n\\t\\t\\t\\talign-items: center;\\n\\n\\t\\t\\t\\t& .ck.ck-dropdown {\\n\\t\\t\\t\\t\\tflex-grow: 0;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\t& .ck-table-form__dimension-operator {\\n\\t\\t\\t\\tflex-grow: 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck.ck-labeled-field-view {\\n\\t\\t/* Allow absolute positioning of the status (error) balloons. */\\n\\t\\tposition: relative;\\n\\n\\t\\t& .ck.ck-labeled-field-view__status {\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\tleft: 50%;\\n\\t\\t\\tbottom: calc( -1 * var(--ck-table-properties-error-arrow-size) );\\n\\t\\t\\ttransform: translate(-50%,100%);\\n\\n\\t\\t\\t/* Make sure the balloon status stays on top of other form elements. */\\n\\t\\t\\tz-index: 1;\\n\\n\\t\\t\\t/* The arrow pointing towards the field. */\\n\\t\\t\\t&::after {\\n\\t\\t\\t\\tcontent: \\\"\\\";\\n\\t\\t\\t\\tposition: absolute;\\n\\t\\t\\t\\ttop: calc( -1 * var(--ck-table-properties-error-arrow-size) );\\n\\t\\t\\t\\tleft: 50%;\\n\\t\\t\\t\\ttransform: translateX( -50% );\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../mixins/_rounded.css\\\";\\n\\n:root {\\n\\t--ck-table-properties-error-arrow-size: 6px;\\n\\t--ck-table-properties-min-error-width: 150px;\\n}\\n\\n.ck.ck-table-form {\\n\\t& .ck-form__row {\\n\\t\\t&.ck-table-form__border-row {\\n\\t\\t\\t& .ck-labeled-field-view {\\n\\t\\t\\t\\t& > .ck-label {\\n\\t\\t\\t\\t\\tfont-size: var(--ck-font-size-tiny);\\n\\t\\t\\t\\t\\ttext-align: center;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\n\\t\\t\\t& .ck-table-form__border-style,\\n\\t\\t\\t& .ck-table-form__border-width {\\n\\t\\t\\t\\twidth: 80px;\\n\\t\\t\\t\\tmin-width: 80px;\\n\\t\\t\\t\\tmax-width: 80px;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&.ck-table-form__dimensions-row {\\n\\t\\t\\tpadding: 0;\\n\\n\\t\\t\\t& .ck-table-form__dimensions-row__width,\\n\\t\\t\\t& .ck-table-form__dimensions-row__height {\\n\\t\\t\\t\\tmargin: 0\\n\\t\\t\\t}\\n\\n\\t\\t\\t& .ck-table-form__dimension-operator {\\n\\t\\t\\t\\talign-self: flex-end;\\n\\t\\t\\t\\tdisplay: inline-block;\\n\\t\\t\\t\\theight: var(--ck-ui-component-min-height);\\n\\t\\t\\t\\tline-height: var(--ck-ui-component-min-height);\\n\\t\\t\\t\\tmargin: 0 var(--ck-spacing-small);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck.ck-labeled-field-view {\\n\\t\\tpadding-top: var(--ck-spacing-standard);\\n\\n\\t\\t& .ck.ck-labeled-field-view__status {\\n\\t\\t\\t@mixin ck-rounded-corners;\\n\\n\\t\\t\\tbackground: var(--ck-color-base-error);\\n\\t\\t\\tcolor: var(--ck-color-base-background);\\n\\t\\t\\tpadding: var(--ck-spacing-small) var(--ck-spacing-medium);\\n\\t\\t\\tmin-width: var(--ck-table-properties-min-error-width);\\n\\t\\t\\ttext-align: center;\\n\\n\\t\\t\\t/* The arrow pointing towards the field. */\\n\\t\\t\\t&::after {\\n\\t\\t\\t\\tborder-color: transparent transparent var(--ck-color-base-error) transparent;\\n\\t\\t\\t\\tborder-width: 0 var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size);\\n\\t\\t\\t\\tborder-style: solid;\\n\\t\\t\\t}\\n\\n\\t\\t\\tanimation: ck-table-form-labeled-view-status-appear .15s ease both;\\n\\t\\t}\\n\\n\\t\\t/* Hide the error balloon when the field is blurred. Makes the experience much more clear. */\\n\\t\\t& .ck-input.ck-error:not(:focus) + .ck.ck-labeled-field-view__status {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n}\\n\\n@keyframes ck-table-form-labeled-view-status-appear {\\n\\t0% {\\n\\t\\topacity: 0;\\n\\t}\\n\\n\\t100% {\\n\\t\\topacity: 1;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row{align-content:baseline;flex-basis:0;flex-wrap:wrap}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar .ck-toolbar__items{flex-wrap:nowrap}.ck.ck-table-properties-form{width:320px}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row{align-self:flex-end;padding:0}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar{background:none;margin-top:var(--ck-spacing-standard)}.ck.ck-table-properties-form .ck-form__row.ck-table-properties-form__alignment-row .ck.ck-toolbar .ck-toolbar__items>*{width:40px}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-table/theme/tableproperties.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/tableproperties.css\"],\"names\":[],\"mappings\":\"AAOE,mFAGC,sBAAuB,CADvB,YAAa,CADb,cAOD,CAHC,qHACC,gBACD,CCTH,6BACC,WAmBD,CAhBE,mFACC,mBAAoB,CACpB,SAYD,CAVC,kGACC,eAAgB,CAGhB,qCAKD,CAHC,uHACC,UACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-table-properties-form {\\n\\t& .ck-form__row {\\n\\t\\t&.ck-table-properties-form__alignment-row {\\n\\t\\t\\tflex-wrap: wrap;\\n\\t\\t\\tflex-basis: 0;\\n\\t\\t\\talign-content: baseline;\\n\\n\\t\\t\\t& .ck.ck-toolbar .ck-toolbar__items {\\n\\t\\t\\t\\tflex-wrap: nowrap;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-table-properties-form {\\n\\twidth: 320px;\\n\\n\\t& .ck-form__row {\\n\\t\\t&.ck-table-properties-form__alignment-row {\\n\\t\\t\\talign-self: flex-end;\\n\\t\\t\\tpadding: 0;\\n\\n\\t\\t\\t& .ck.ck-toolbar {\\n\\t\\t\\t\\tbackground: none;\\n\\n\\t\\t\\t\\t/* Compensate for missing input label that would push the margin (toolbar has no inputs). */\\n\\t\\t\\t\\tmargin-top: var(--ck-spacing-standard);\\n\\n\\t\\t\\t\\t& .ck-toolbar__items > * {\\n\\t\\t\\t\\t\\twidth: 40px;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-table-selected-cell-background:rgba(158,207,250,.3)}.ck.ck-editor__editable .table table td.ck-editor__editable_selected,.ck.ck-editor__editable .table table th.ck-editor__editable_selected{box-shadow:unset;caret-color:transparent;outline:unset;position:relative}.ck.ck-editor__editable .table table td.ck-editor__editable_selected:after,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:after{background-color:var(--ck-table-selected-cell-background);bottom:0;content:\\\"\\\";left:0;pointer-events:none;position:absolute;right:0;top:0}.ck.ck-editor__editable .table table td.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table td.ck-editor__editable_selected:focus,.ck.ck-editor__editable .table table th.ck-editor__editable_selected ::selection,.ck.ck-editor__editable .table table th.ck-editor__editable_selected:focus{background-color:transparent}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget{outline:unset}.ck.ck-editor__editable .table table td.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle,.ck.ck-editor__editable .table table th.ck-editor__editable_selected .ck-widget>.ck-widget__selection-handle{display:none}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-table/tableselection.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,wDACD,CAGC,0IAKC,gBAAiB,CAFjB,uBAAwB,CACxB,aAAc,CAFd,iBAiCD,CA3BC,sJAGC,yDAA0D,CAK1D,QAAS,CAPT,UAAW,CAKX,MAAO,CAJP,mBAAoB,CAEpB,iBAAkB,CAGlB,OAAQ,CAFR,KAID,CAEA,wTAEC,4BACD,CAMA,gKACC,aAKD,CAHC,0NACC,YACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-table-selected-cell-background: hsla(208, 90%, 80%, .3);\\n}\\n\\n.ck.ck-editor__editable .table table {\\n\\t& td.ck-editor__editable_selected,\\n\\t& th.ck-editor__editable_selected {\\n\\t\\tposition: relative;\\n\\t\\tcaret-color: transparent;\\n\\t\\toutline: unset;\\n\\t\\tbox-shadow: unset;\\n\\n\\t\\t/* https://github.com/ckeditor/ckeditor5/issues/6446 */\\n\\t\\t&:after {\\n\\t\\t\\tcontent: '';\\n\\t\\t\\tpointer-events: none;\\n\\t\\t\\tbackground-color: var(--ck-table-selected-cell-background);\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\ttop: 0;\\n\\t\\t\\tleft: 0;\\n\\t\\t\\tright: 0;\\n\\t\\t\\tbottom: 0;\\n\\t\\t}\\n\\n\\t\\t& ::selection,\\n\\t\\t&:focus {\\n\\t\\t\\tbackground-color: transparent;\\n\\t\\t}\\n\\n\\t\\t/*\\n\\t\\t * To reduce the amount of noise, all widgets in the table selection have no outline and no selection handle.\\n\\t\\t * See https://github.com/ckeditor/ckeditor5/issues/9491.\\n\\t\\t */\\n\\t\\t& .ck-widget {\\n\\t\\t\\toutline: unset;\\n\\n\\t\\t\\t& > .ck-widget__selection-handle {\\n\\t\\t\\t\\tdisplay: none;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-button,a.ck.ck-button{align-items:center;display:inline-flex;justify-content:left;position:relative;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{display:none}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:not(.ck-button_with-text),a.ck.ck-button:not(.ck-button_with-text){justify-content:center}.ck.ck-button,a.ck.ck-button{background:var(--ck-color-button-default-background)}.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck.ck-button,a.ck.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button,a.ck.ck-button{-webkit-appearance:none;border:1px solid transparent;cursor:default;font-size:inherit;line-height:1;min-height:var(--ck-ui-component-min-height);min-width:var(--ck-ui-component-min-height);padding:var(--ck-spacing-tiny);text-align:center;transition:box-shadow .2s ease-in-out,border .2s ease-in-out;vertical-align:middle;white-space:nowrap}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{color:inherit;cursor:inherit;font-size:inherit;font-weight:inherit;vertical-align:middle}[dir=ltr] .ck.ck-button .ck-button__label,[dir=ltr] a.ck.ck-button .ck-button__label{text-align:left}[dir=rtl] .ck.ck-button .ck-button__label,[dir=rtl] a.ck.ck-button .ck-button__label{text-align:right}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{color:inherit}[dir=ltr] .ck.ck-button .ck-button__keystroke,[dir=ltr] a.ck.ck-button .ck-button__keystroke{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-button .ck-button__keystroke,[dir=rtl] a.ck.ck-button .ck-button__keystroke{margin-right:var(--ck-spacing-large)}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{font-weight:700;opacity:.7}.ck.ck-button.ck-disabled:active,.ck.ck-button.ck-disabled:focus,a.ck.ck-button.ck-disabled:active,a.ck.ck-button.ck-disabled:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-button.ck-disabled .ck-button__icon,.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__keystroke,a.ck.ck-button.ck-disabled .ck-button__keystroke{opacity:.3}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}[dir=ltr] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=ltr] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:calc(var(--ck-spacing-small)*-1);margin-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=rtl] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:var(--ck-spacing-small);margin-right:calc(var(--ck-spacing-small)*-1)}.ck.ck-button.ck-button_with-keystroke .ck-button__label,a.ck.ck-button.ck-button_with-keystroke .ck-button__label{flex-grow:1}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background)}.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-hover-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{color:var(--ck-color-button-on-color)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background)}.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-action,a.ck.ck-button-action{color:var(--ck-color-button-action-text)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/button.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/button/button.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/mixins/_button.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_disabled.css\"],\"names\":[],\"mappings\":\"AAOA,6BAMC,kBAAmB,CADnB,mBAAoB,CAEpB,oBAAqB,CAHrB,iBAAkB,CCFlB,qBAAsB,CACtB,wBAAyB,CACzB,oBAAqB,CACrB,gBDkBD,CAdC,iEACC,YACD,CAGC,yGACC,oBACD,CAID,iFACC,sBACD,CEjBD,6BCAC,oDD4ID,CCzIE,6EACC,0DACD,CAEA,+EACC,2DACD,CAID,qDACC,6DACD,CDfD,6BEDC,eF6ID,CA5IA,wIEGE,qCFyIF,CA5IA,6BA6BC,uBAAwB,CANxB,4BAA6B,CAjB7B,cAAe,CAcf,iBAAkB,CAHlB,aAAc,CAJd,4CAA6C,CAD7C,2CAA4C,CAJ5C,8BAA+B,CAC/B,iBAAkB,CAiBlB,4DAA8D,CAnB9D,qBAAsB,CAFtB,kBAuID,CA7GC,oFGhCA,2BAA2B,CCF3B,2CAA8B,CDC9B,YHqCA,CAIC,kJAEC,aACD,CAGD,iEAIC,aAAc,CACd,cAAe,CAHf,iBAAkB,CAClB,mBAAoB,CAMpB,qBASD,CAlBA,qFAYE,eAMF,CAlBA,qFAgBE,gBAEF,CAEA,yEACC,aAYD,CAbA,6FAIE,mCASF,CAbA,6FAQE,oCAKF,CAbA,yEAWC,eAAiB,CACjB,UACD,CAIC,oIIrFD,oDJyFC,CAOA,gLKhGD,kCLkGC,CAEA,iGACC,UACD,CAGD,qEACC,yDAcD,CAXC,2HAEE,4CAA+C,CAC/C,oCAOF,CAVA,2HAQE,mCAAoC,CADpC,6CAGF,CAKA,mHACC,WACD,CAID,yCC/HA,+CDmIA,CChIC,yFACC,qDACD,CAEA,2FACC,sDACD,CAID,iEACC,wDACD,CDgHA,yCAGC,qCACD,CAEA,2DACC,iCACD,CAEA,+DACC,mCACD,CAID,2CC/IC,mDDoJD,CCjJE,2FACC,yDACD,CAEA,6FACC,0DACD,CAID,mEACC,4DACD,CDgID,2CAIC,wCACD,CAEA,uCAEC,eACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../mixins/_unselectable.css\\\";\\n\\n.ck.ck-button,\\na.ck.ck-button {\\n\\t@mixin ck-unselectable;\\n\\n\\tposition: relative;\\n\\tdisplay: inline-flex;\\n\\talign-items: center;\\n\\tjustify-content: left;\\n\\n\\t& .ck-button__label {\\n\\t\\tdisplay: none;\\n\\t}\\n\\n\\t&.ck-button_with-text {\\n\\t\\t& .ck-button__label {\\n\\t\\t\\tdisplay: inline-block;\\n\\t\\t}\\n\\t}\\n\\n\\t/* Center the icon horizontally in a button without text. */\\n\\t&:not(.ck-button_with-text) {\\n\\t\\tjustify-content: center;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Makes element unselectable.\\n */\\n@define-mixin ck-unselectable {\\n\\t-moz-user-select: none;\\n\\t-webkit-user-select: none;\\n\\t-ms-user-select: none;\\n\\tuser-select: none\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_focus.css\\\";\\n@import \\\"../../../mixins/_shadow.css\\\";\\n@import \\\"../../../mixins/_disabled.css\\\";\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"../../mixins/_button.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck.ck-button,\\na.ck.ck-button {\\n\\t@mixin ck-button-colors --ck-color-button-default;\\n\\t@mixin ck-rounded-corners;\\n\\n\\twhite-space: nowrap;\\n\\tcursor: default;\\n\\tvertical-align: middle;\\n\\tpadding: var(--ck-spacing-tiny);\\n\\ttext-align: center;\\n\\n\\t/* A very important piece of styling. Go to variable declaration to learn more. */\\n\\tmin-width: var(--ck-ui-component-min-height);\\n\\tmin-height: var(--ck-ui-component-min-height);\\n\\n\\t/* Normalize the height of the line. Removing this will break consistent height\\n\\tamong text and text-less buttons (with icons). */\\n\\tline-height: 1;\\n\\n\\t/* Enable font size inheritance, which allows fluid UI scaling. */\\n\\tfont-size: inherit;\\n\\n\\t/* Avoid flickering when the foucs border shows up. */\\n\\tborder: 1px solid transparent;\\n\\n\\t/* Apply some smooth transition to the box-shadow and border. */\\n\\ttransition: box-shadow .2s ease-in-out, border .2s ease-in-out;\\n\\n\\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/189 */\\n\\t-webkit-appearance: none;\\n\\n\\t&:active,\\n\\t&:focus {\\n\\t\\t@mixin ck-focus-ring;\\n\\t\\t@mixin ck-box-shadow var(--ck-focus-outer-shadow);\\n\\t}\\n\\n\\t/* Allow icon coloring using the text \\\"color\\\" property. */\\n\\t& .ck-button__icon {\\n\\t\\t& use,\\n\\t\\t& use * {\\n\\t\\t\\tcolor: inherit;\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck-button__label {\\n\\t\\t/* Enable font size inheritance, which allows fluid UI scaling. */\\n\\t\\tfont-size: inherit;\\n\\t\\tfont-weight: inherit;\\n\\t\\tcolor: inherit;\\n\\t\\tcursor: inherit;\\n\\n\\t\\t/* Must be consistent with .ck-icon's vertical align. Otherwise, buttons with and\\n\\t\\twithout labels (but with icons) have different sizes in Chrome */\\n\\t\\tvertical-align: middle;\\n\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\ttext-align: left;\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\ttext-align: right;\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck-button__keystroke {\\n\\t\\tcolor: inherit;\\n\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\tmargin-left: var(--ck-spacing-large);\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\tmargin-right: var(--ck-spacing-large);\\n\\t\\t}\\n\\n\\t\\tfont-weight: bold;\\n\\t\\topacity: .7;\\n\\t}\\n\\n\\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/70 */\\n\\t&.ck-disabled {\\n\\t\\t&:active,\\n\\t\\t&:focus {\\n\\t\\t\\t/* The disabled button should have a slightly less visible shadow when focused. */\\n\\t\\t\\t@mixin ck-box-shadow var(--ck-focus-disabled-outer-shadow);\\n\\t\\t}\\n\\n\\t\\t& .ck-button__icon {\\n\\t\\t\\t@mixin ck-disabled;\\n\\t\\t}\\n\\n\\t\\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/98 */\\n\\t\\t& .ck-button__label {\\n\\t\\t\\t@mixin ck-disabled;\\n\\t\\t}\\n\\n\\t\\t& .ck-button__keystroke {\\n\\t\\t\\topacity: .3;\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-button_with-text {\\n\\t\\tpadding: var(--ck-spacing-tiny) var(--ck-spacing-standard);\\n\\n\\t\\t/* stylelint-disable-next-line no-descending-specificity */\\n\\t\\t& .ck-button__icon {\\n\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\tmargin-left: calc(-1 * var(--ck-spacing-small));\\n\\t\\t\\t\\tmargin-right: var(--ck-spacing-small);\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tmargin-right: calc(-1 * var(--ck-spacing-small));\\n\\t\\t\\t\\tmargin-left: var(--ck-spacing-small);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-button_with-keystroke {\\n\\t\\t/* stylelint-disable-next-line no-descending-specificity */\\n\\t\\t& .ck-button__label {\\n\\t\\t\\tflex-grow: 1;\\n\\t\\t}\\n\\t}\\n\\n\\t/* A style of the button which is currently on, e.g. its feature is active. */\\n\\t&.ck-on {\\n\\t\\t@mixin ck-button-colors --ck-color-button-on;\\n\\n\\t\\tcolor: var(--ck-color-button-on-color);\\n\\t}\\n\\n\\t&.ck-button-save {\\n\\t\\tcolor: var(--ck-color-button-save);\\n\\t}\\n\\n\\t&.ck-button-cancel {\\n\\t\\tcolor: var(--ck-color-button-cancel);\\n\\t}\\n}\\n\\n/* A style of the button which handles the primary action. */\\n.ck.ck-button-action,\\na.ck.ck-button-action {\\n\\t@mixin ck-button-colors --ck-color-button-action;\\n\\n\\tcolor: var(--ck-color-button-action-text);\\n}\\n\\n.ck.ck-button-bold,\\na.ck.ck-button-bold {\\n\\tfont-weight: bold;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements a button of given background color.\\n *\\n * @param {String} $background - Background color of the button.\\n * @param {String} $border - Border color of the button.\\n */\\n@define-mixin ck-button-colors $prefix {\\n\\tbackground: var($(prefix)-background);\\n\\n\\t&:not(.ck-disabled) {\\n\\t\\t&:hover {\\n\\t\\t\\tbackground: var($(prefix)-hover-background);\\n\\t\\t}\\n\\n\\t\\t&:active {\\n\\t\\t\\tbackground: var($(prefix)-active-background);\\n\\t\\t}\\n\\t}\\n\\n\\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/98 */\\n\\t&.ck-disabled {\\n\\t\\tbackground: var($(prefix)-disabled-background);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A visual style of focused element's border.\\n */\\n@define-mixin ck-focus-ring {\\n\\t/* Disable native outline. */\\n\\toutline: none;\\n\\tborder: var(--ck-focus-ring)\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A class which indicates that an element holding it is disabled.\\n */\\n@define-mixin ck-disabled {\\n\\topacity: var(--ck-disabled-opacity);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:calc(1.07692em + 1px);--ck-switch-button-translation:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - 2px);--ck-switch-button-inner-hover-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton,.ck.ck-button.ck-switchbutton.ck-on:active,.ck.ck-button.ck-switchbutton.ck-on:focus,.ck.ck-button.ck-switchbutton.ck-on:hover,.ck.ck-button.ck-switchbutton:active,.ck.ck-button.ck-switchbutton:focus,.ck.ck-button.ck-switchbutton:hover{background:transparent;color:inherit}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(var(--ck-spacing-large)*2)}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(var(--ck-spacing-large)*2)}.ck.ck-button.ck-switchbutton .ck-button__toggle{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle.ck-rounded-corners{border-radius:var(--ck-border-radius)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-left:auto}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-right:auto}.ck.ck-button.ck-switchbutton .ck-button__toggle{background:var(--ck-color-switch-button-off-background);border:1px solid transparent;transition:background .4s ease,box-shadow .2s ease-in-out,outline .2s ease-in-out;width:var(--ck-switch-button-toggle-width)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:calc(var(--ck-border-radius)*.5)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{background:var(--ck-color-switch-button-inner-background);height:var(--ck-switch-button-toggle-inner-size);transition:all .3s ease;width:var(--ck-switch-button-toggle-inner-size)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover{background:var(--ck-color-switch-button-off-hover-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover .ck-button__toggle__inner{box-shadow:var(--ck-switch-button-inner-hover-shadow)}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton:focus{border-color:transparent;box-shadow:none;outline:none}.ck.ck-button.ck-switchbutton:focus .ck-button__toggle{box-shadow:0 0 0 1px var(--ck-color-base-background),0 0 0 5px var(--ck-color-focus-outer-shadow);outline:var(--ck-focus-ring);outline-offset:1px}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle{background:var(--ck-color-switch-button-on-background)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle:hover{background:var(--ck-color-switch-button-on-hover-background)}[dir=ltr] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(var( --ck-switch-button-translation ))}[dir=rtl] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(calc(var( --ck-switch-button-translation )*-1))}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/button/switchbutton.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/button/switchbutton.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_disabled.css\"],\"names\":[],\"mappings\":\"AASE,4HACC,aACD,CCCF,MAEC,8CAA+C,CAE/C,0DAAgE,CAChE,2HAIC,CACD,0FACD,CAOC,0QAEC,sBAAuB,CADvB,aAED,CAEA,0DAGE,4CAOF,CAVA,0DAQE,2CAEF,CAEA,iDCpCA,eD4EA,CAxCA,yIChCC,qCDwED,CAxCA,2DAKE,gBAmCF,CAxCA,2DAUE,iBA8BF,CAxCA,iDAkBC,uDAAwD,CAFxD,4BAA6B,CAD7B,iFAAsF,CAEtF,0CAuBD,CApBC,2ECxDD,eDmEC,CAXA,6LCpDA,qCAAsC,CDsDpC,8CASF,CAXA,2EAOC,yDAA0D,CAD1D,gDAAiD,CAIjD,uBAA0B,CAL1B,+CAMD,CAEA,uDACC,6DAKD,CAHC,iFACC,qDACD,CAIF,6DEhFA,kCFkFA,CAGA,oCACC,wBAAyB,CAEzB,eAAgB,CADhB,YAQD,CALC,uDACC,iGAAmG,CAEnG,4BAA6B,CAD7B,kBAED,CAKA,uDACC,sDAkBD,CAhBC,6DACC,4DACD,CAEA,2FAKE,2DAMF,CAXA,2FASE,oEAEF\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-button.ck-switchbutton {\\n\\t& .ck-button__toggle {\\n\\t\\tdisplay: block;\\n\\n\\t\\t& .ck-button__toggle__inner {\\n\\t\\t\\tdisplay: block;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"../../../mixins/_disabled.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n/* Note: To avoid rendering issues (aliasing) but to preserve the responsive nature\\nof the component, floatingpoint numbers have been used which, for the default font size\\n(see: --ck-font-size-base), will generate simple integers. */\\n:root {\\n\\t/* 34px at 13px font-size */\\n\\t--ck-switch-button-toggle-width: 2.6153846154em;\\n\\t/* 14px at 13px font-size */\\n\\t--ck-switch-button-toggle-inner-size: calc(1.0769230769em + 1px);\\n\\t--ck-switch-button-translation: calc(\\n\\t\\tvar(--ck-switch-button-toggle-width) -\\n\\t\\tvar(--ck-switch-button-toggle-inner-size) -\\n\\t\\t2px /* Border */\\n\\t);\\n\\t--ck-switch-button-inner-hover-shadow: 0 0 0 5px var(--ck-color-switch-button-inner-shadow);\\n}\\n\\n.ck.ck-button.ck-switchbutton {\\n\\t/* Unlike a regular button, the switch button text color and background should never change.\\n\\t * Changing toggle switch (background, outline) is enough to carry the information about the\\n\\t * state of the entire component (https://github.com/ckeditor/ckeditor5/issues/12519)\\n\\t */\\n\\t&, &:hover, &:focus, &:active, &.ck-on:hover, &.ck-on:focus, &.ck-on:active {\\n\\t\\tcolor: inherit;\\n\\t\\tbackground: transparent;\\n\\t}\\n\\n\\t& .ck-button__label {\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t/* Separate the label from the switch */\\n\\t\\t\\tmargin-right: calc(2 * var(--ck-spacing-large));\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t/* Separate the label from the switch */\\n\\t\\t\\tmargin-left: calc(2 * var(--ck-spacing-large));\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck-button__toggle {\\n\\t\\t@mixin ck-rounded-corners;\\n\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t/* Make sure the toggle is always to the right as far as possible. */\\n\\t\\t\\tmargin-left: auto;\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t/* Make sure the toggle is always to the left as far as possible. */\\n\\t\\t\\tmargin-right: auto;\\n\\t\\t}\\n\\n\\t\\t/* Apply some smooth transition to the box-shadow and border. */\\n\\t\\t/* Gently animate the background color of the toggle switch */\\n\\t\\ttransition: background 400ms ease, box-shadow .2s ease-in-out, outline .2s ease-in-out;\\n\\t\\tborder: 1px solid transparent;\\n\\t\\twidth: var(--ck-switch-button-toggle-width);\\n\\t\\tbackground: var(--ck-color-switch-button-off-background);\\n\\n\\t\\t& .ck-button__toggle__inner {\\n\\t\\t\\t@mixin ck-rounded-corners {\\n\\t\\t\\t\\tborder-radius: calc(.5 * var(--ck-border-radius));\\n\\t\\t\\t}\\n\\n\\t\\t\\twidth: var(--ck-switch-button-toggle-inner-size);\\n\\t\\t\\theight: var(--ck-switch-button-toggle-inner-size);\\n\\t\\t\\tbackground: var(--ck-color-switch-button-inner-background);\\n\\n\\t\\t\\t/* Gently animate the inner part of the toggle switch */\\n\\t\\t\\ttransition: all 300ms ease;\\n\\t\\t}\\n\\n\\t\\t&:hover {\\n\\t\\t\\tbackground: var(--ck-color-switch-button-off-hover-background);\\n\\n\\t\\t\\t& .ck-button__toggle__inner {\\n\\t\\t\\t\\tbox-shadow: var(--ck-switch-button-inner-hover-shadow);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-disabled .ck-button__toggle {\\n\\t\\t@mixin ck-disabled;\\n\\t}\\n\\n\\t/* Overriding default .ck-button:focus styles + an outline around the toogle */\\n\\t&:focus {\\n\\t\\tborder-color: transparent;\\n\\t\\toutline: none;\\n\\t\\tbox-shadow: none;\\n\\n\\t\\t& .ck-button__toggle {\\n\\t\\t\\tbox-shadow: 0 0 0 1px var(--ck-color-base-background), 0 0 0 5px var(--ck-color-focus-outer-shadow);\\n\\t\\t\\toutline-offset: 1px;\\n\\t\\t\\toutline: var(--ck-focus-ring);\\n\\t\\t}\\n\\t}\\n\\n\\t/* stylelint-disable-next-line no-descending-specificity */\\n\\t&.ck-on {\\n\\t\\t& .ck-button__toggle {\\n\\t\\t\\tbackground: var(--ck-color-switch-button-on-background);\\n\\n\\t\\t\\t&:hover {\\n\\t\\t\\t\\tbackground: var(--ck-color-switch-button-on-hover-background);\\n\\t\\t\\t}\\n\\n\\t\\t\\t& .ck-button__toggle__inner {\\n\\t\\t\\t\\t/*\\n\\t\\t\\t\\t* Move the toggle switch to the right. It will be animated.\\n\\t\\t\\t\\t*/\\n\\t\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\t\\ttransform: translateX( var( --ck-switch-button-translation ) );\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\t\\ttransform: translateX( calc( -1 * var( --ck-switch-button-translation ) ) );\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A class which indicates that an element holding it is disabled.\\n */\\n@define-mixin ck-disabled {\\n\\topacity: var(--ck-disabled-opacity);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-color-grid{display:grid}:root{--ck-color-grid-tile-size:24px;--ck-color-color-grid-check-icon:#166fd4}.ck.ck-color-grid{grid-gap:5px;padding:8px}.ck.ck-color-grid__tile{border:0;height:var(--ck-color-grid-tile-size);min-height:var(--ck-color-grid-tile-size);min-width:var(--ck-color-grid-tile-size);padding:0;transition:box-shadow .2s ease;width:var(--ck-color-grid-tile-size)}.ck.ck-color-grid__tile.ck-disabled{cursor:unset;transition:unset}.ck.ck-color-grid__tile.ck-color-table__color-tile_bordered{box-shadow:0 0 0 1px var(--ck-color-base-border)}.ck.ck-color-grid__tile .ck.ck-icon{color:var(--ck-color-color-grid-check-icon);display:none}.ck.ck-color-grid__tile.ck-on{box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-base-text)}.ck.ck-color-grid__tile.ck-on .ck.ck-icon{display:block}.ck.ck-color-grid__tile.ck-on,.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){border:0}.ck.ck-color-grid__tile:focus:not(.ck-disabled),.ck.ck-color-grid__tile:hover:not(.ck-disabled){box-shadow:inset 0 0 0 1px var(--ck-color-base-background),0 0 0 2px var(--ck-color-focus-border)}.ck.ck-color-grid__label{padding:0 var(--ck-spacing-standard)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorgrid/colorgrid.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/colorgrid/colorgrid.css\"],\"names\":[],\"mappings\":\"AAKA,kBACC,YACD,CCAA,MACC,8BAA+B,CAK/B,wCACD,CAEA,kBACC,YAAa,CACb,WACD,CAEA,wBAOC,QAAS,CALT,qCAAsC,CAEtC,yCAA0C,CAD1C,wCAAyC,CAEzC,SAAU,CACV,8BAA+B,CAL/B,oCAyCD,CAjCC,oCACC,YAAa,CACb,gBACD,CAEA,4DACC,gDACD,CAEA,oCAEC,2CAA4C,CAD5C,YAED,CAEA,8BACC,8FAKD,CAHC,0CACC,aACD,CAGD,8HAIC,QACD,CAEA,gGAEC,iGACD,CAGD,yBACC,oCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-color-grid {\\n\\tdisplay: grid;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n\\n:root {\\n\\t--ck-color-grid-tile-size: 24px;\\n\\n\\t/* Not using global colors here because these may change but some colors in a pallette\\n\\t * require special treatment. For instance, this ensures no matter what the UI text color is,\\n\\t * the check icon will look good on the black color tile. */\\n\\t--ck-color-color-grid-check-icon: hsl(212, 81%, 46%);\\n}\\n\\n.ck.ck-color-grid {\\n\\tgrid-gap: 5px;\\n\\tpadding: 8px;\\n}\\n\\n.ck.ck-color-grid__tile {\\n\\twidth: var(--ck-color-grid-tile-size);\\n\\theight: var(--ck-color-grid-tile-size);\\n\\tmin-width: var(--ck-color-grid-tile-size);\\n\\tmin-height: var(--ck-color-grid-tile-size);\\n\\tpadding: 0;\\n\\ttransition: .2s ease box-shadow;\\n\\tborder: 0;\\n\\n\\t&.ck-disabled {\\n\\t\\tcursor: unset;\\n\\t\\ttransition: unset;\\n\\t}\\n\\n\\t&.ck-color-table__color-tile_bordered {\\n\\t\\tbox-shadow: 0 0 0 1px var(--ck-color-base-border);\\n\\t}\\n\\n\\t& .ck.ck-icon {\\n\\t\\tdisplay: none;\\n\\t\\tcolor: var(--ck-color-color-grid-check-icon);\\n\\t}\\n\\n\\t&.ck-on {\\n\\t\\tbox-shadow: inset 0 0 0 1px var(--ck-color-base-background), 0 0 0 2px var(--ck-color-base-text);\\n\\n\\t\\t& .ck.ck-icon {\\n\\t\\t\\tdisplay: block;\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-on,\\n\\t&:focus:not( .ck-disabled ),\\n\\t&:hover:not( .ck-disabled ) {\\n\\t\\t/* Disable the default .ck-button's border ring. */\\n\\t\\tborder: 0;\\n\\t}\\n\\n\\t&:focus:not( .ck-disabled ),\\n\\t&:hover:not( .ck-disabled ) {\\n\\t\\tbox-shadow: inset 0 0 0 1px var(--ck-color-base-background), 0 0 0 2px var(--ck-color-focus-border);\\n\\t}\\n}\\n\\n.ck.ck-color-grid__label {\\n\\tpadding: 0 var(--ck-spacing-standard);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-input{min-width:unset}.color-picker-hex-input{width:max-content}.ck.ck-color-picker__row{display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.ck.ck-color-picker__row .ck-color-picker__hash-view{padding-right:var(--ck-spacing-medium);padding-top:var(--ck-spacing-tiny)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/colorpicker/colorpicker.css\"],\"names\":[],\"mappings\":\"AAKA,aACC,eACD,CAEA,wBACC,iBACD,CAEA,yBACC,YAAa,CACb,kBAAmB,CACnB,gBAAiB,CACjB,6BAMD,CAJC,qDAEC,sCAAuC,CADvC,kCAED\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-input {\\n\\tmin-width: unset;\\n}\\n\\n.color-picker-hex-input {\\n\\twidth: max-content;\\n}\\n\\n.ck.ck-color-picker__row {\\n\\tdisplay: flex;\\n\\tflex-direction: row;\\n\\tflex-wrap: nowrap;\\n\\tjustify-content: space-between;\\n\\n\\t& .ck-color-picker__hash-view {\\n\\t\\tpadding-top: var(--ck-spacing-tiny);\\n\\t\\tpadding-right: var(--ck-spacing-medium);\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-dropdown-max-width:75vw}.ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-dropdown__panel{display:none;max-width:var(--ck-dropdown-max-width);position:absolute;z-index:var(--ck-z-modal)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{bottom:auto;top:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se{left:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_n,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_s{left:50%;transform:translateX(-50%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nmw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_smw{left:75%;transform:translateX(-75%)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nme,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sme{left:25%;transform:translateX(-25%)}.ck.ck-toolbar .ck-dropdown__panel{z-index:calc(var(--ck-z-modal) + 1)}:root{--ck-dropdown-arrow-size:calc(var(--ck-icon-size)*0.5)}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-dropdown .ck-dropdown__arrow{margin-left:var(--ck-spacing-standard);right:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-dropdown .ck-dropdown__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{overflow:hidden;text-overflow:ellipsis;width:7em}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-dropdown__button_label-width_auto .ck-button__label{width:auto}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active{box-shadow:none}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-off:active:focus,.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on:active:focus{box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-dropdown__panel{border-radius:0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dropdown__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;box-shadow:var(--ck-drop-shadow),0 0;min-width:100%}.ck.ck-dropdown__panel.ck-dropdown__panel_se{border-top-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_sw{border-top-right-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_ne{border-bottom-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_nw{border-bottom-right-radius:0}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/dropdown.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/dropdown.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_disabled.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,4BACD,CAEA,gBACC,oBAAqB,CACrB,iBA2ED,CAzEC,oCACC,mBAAoB,CACpB,2BACD,CAGA,+CACC,UACD,CAEA,oCACC,YAAa,CAEb,sCAAuC,CAEvC,iBAAkB,CAHlB,yBA4DD,CAvDC,+DACC,oBACD,CAEA,mSAKC,WACD,CAEA,mSAUC,WAAY,CADZ,QAED,CAEA,oHAEC,MACD,CAEA,oHAEC,OACD,CAEA,kHAGC,QAAS,CACT,0BACD,CAEA,sHAGC,QAAS,CACT,0BACD,CAEA,sHAGC,QAAS,CACT,0BACD,CAQF,mCACC,mCACD,CCpFA,MACC,sDACD,CAEA,gBAEC,iBA2ED,CAzEC,oCACC,mCACD,CAGC,8CAIC,sCAAuC,CAHvC,gCAID,CAIA,8CACC,+BAAgC,CAGhC,oCACD,CAGD,gDC/BA,kCDiCA,CAIE,mFAEC,oCACD,CAIA,mFAEC,qCACD,CAID,iEAEC,eAAgB,CAChB,sBAAuB,CAFvB,SAGD,CAGA,6EC1DD,kCD4DC,CAGA,qDACC,2BAA4B,CAC5B,4BACD,CAEA,sGACC,UACD,CAGA,yHAEC,eAKD,CAHC,qIE7EF,2CF+EE,CAKH,uBGlFC,eH8GD,CA5BA,qFG9EE,qCH0GF,CA5BA,uBAIC,oDAAqD,CACrD,sDAAuD,CACvD,QAAS,CE1FT,oCAA8B,CF6F9B,cAmBD,CAfC,6CACC,wBACD,CAEA,6CACC,yBACD,CAEA,6CACC,2BACD,CAEA,6CACC,4BACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-dropdown-max-width: 75vw;\\n}\\n\\n.ck.ck-dropdown {\\n\\tdisplay: inline-block;\\n\\tposition: relative;\\n\\n\\t& .ck-dropdown__arrow {\\n\\t\\tpointer-events: none;\\n\\t\\tz-index: var(--ck-z-default);\\n\\t}\\n\\n\\t/* Dropdown button should span horizontally, e.g. in vertical toolbars */\\n\\t& .ck-button.ck-dropdown__button {\\n\\t\\twidth: 100%;\\n\\t}\\n\\n\\t& .ck-dropdown__panel {\\n\\t\\tdisplay: none;\\n\\t\\tz-index: var(--ck-z-modal);\\n\\t\\tmax-width: var(--ck-dropdown-max-width);\\n\\n\\t\\tposition: absolute;\\n\\n\\t\\t&.ck-dropdown__panel-visible {\\n\\t\\t\\tdisplay: inline-block;\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__panel_ne,\\n\\t\\t&.ck-dropdown__panel_nw,\\n\\t\\t&.ck-dropdown__panel_n,\\n\\t\\t&.ck-dropdown__panel_nmw,\\n\\t\\t&.ck-dropdown__panel_nme {\\n\\t\\t\\tbottom: 100%;\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__panel_se,\\n\\t\\t&.ck-dropdown__panel_sw,\\n\\t\\t&.ck-dropdown__panel_smw,\\n\\t\\t&.ck-dropdown__panel_sme,\\n\\t\\t&.ck-dropdown__panel_s {\\n\\t\\t\\t/*\\n\\t\\t\\t * Using transform: translate3d( 0, 100%, 0 ) causes blurry dropdown on Chrome 67-78+ on non-retina displays.\\n\\t\\t\\t * See https://github.com/ckeditor/ckeditor5/issues/1053.\\n\\t\\t\\t */\\n\\t\\t\\ttop: 100%;\\n\\t\\t\\tbottom: auto;\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__panel_ne,\\n\\t\\t&.ck-dropdown__panel_se {\\n\\t\\t\\tleft: 0px;\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__panel_nw,\\n\\t\\t&.ck-dropdown__panel_sw {\\n\\t\\t\\tright: 0px;\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__panel_s,\\n\\t\\t&.ck-dropdown__panel_n {\\n\\t\\t\\t/* Positioning panels relative to the center of the button */\\n\\t\\t\\tleft: 50%;\\n\\t\\t\\ttransform: translateX(-50%);\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__panel_nmw,\\n\\t\\t&.ck-dropdown__panel_smw {\\n\\t\\t\\t/* Positioning panels relative to the middle-west of the button */\\n\\t\\t\\tleft: 75%;\\n\\t\\t\\ttransform: translateX(-75%);\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__panel_nme,\\n\\t\\t&.ck-dropdown__panel_sme {\\n\\t\\t\\t/* Positioning panels relative to the middle-east of the button */\\n\\t\\t\\tleft: 25%;\\n\\t\\t\\ttransform: translateX(-25%);\\n\\t\\t}\\n\\t}\\n}\\n\\n/*\\n * Toolbar dropdown panels should be always above the UI (eg. other dropdown panels) from the editor's content.\\n * See https://github.com/ckeditor/ckeditor5/issues/7874\\n */\\n.ck.ck-toolbar .ck-dropdown__panel {\\n\\tz-index: calc( var(--ck-z-modal) + 1 );\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"../../../mixins/_disabled.css\\\";\\n@import \\\"../../../mixins/_shadow.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n:root {\\n\\t--ck-dropdown-arrow-size: calc(0.5 * var(--ck-icon-size));\\n}\\n\\n.ck.ck-dropdown {\\n\\t/* Enable font size inheritance, which allows fluid UI scaling. */\\n\\tfont-size: inherit;\\n\\n\\t& .ck-dropdown__arrow {\\n\\t\\twidth: var(--ck-dropdown-arrow-size);\\n\\t}\\n\\n\\t@mixin ck-dir ltr {\\n\\t\\t& .ck-dropdown__arrow {\\n\\t\\t\\tright: var(--ck-spacing-standard);\\n\\n\\t\\t\\t/* A space to accommodate the triangle. */\\n\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t}\\n\\t}\\n\\n\\t@mixin ck-dir rtl {\\n\\t\\t& .ck-dropdown__arrow {\\n\\t\\t\\tleft: var(--ck-spacing-standard);\\n\\n\\t\\t\\t/* A space to accommodate the triangle. */\\n\\t\\t\\tmargin-right: var(--ck-spacing-small);\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-disabled .ck-dropdown__arrow {\\n\\t\\t@mixin ck-disabled;\\n\\t}\\n\\n\\t& .ck-button.ck-dropdown__button {\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t&:not(.ck-button_with-text) {\\n\\t\\t\\t\\t/* Make sure dropdowns with just an icon have the right inner spacing */\\n\\t\\t\\t\\tpadding-left: var(--ck-spacing-small);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t&:not(.ck-button_with-text) {\\n\\t\\t\\t\\t/* Make sure dropdowns with just an icon have the right inner spacing */\\n\\t\\t\\t\\tpadding-right: var(--ck-spacing-small);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t/* #23 */\\n\\t\\t& .ck-button__label {\\n\\t\\t\\twidth: 7em;\\n\\t\\t\\toverflow: hidden;\\n\\t\\t\\ttext-overflow: ellipsis;\\n\\t\\t}\\n\\n\\t\\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/70 */\\n\\t\\t&.ck-disabled .ck-button__label {\\n\\t\\t\\t@mixin ck-disabled;\\n\\t\\t}\\n\\n\\t\\t/* https://github.com/ckeditor/ckeditor5/issues/816 */\\n\\t\\t&.ck-on {\\n\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t\\tborder-bottom-right-radius: 0;\\n\\t\\t}\\n\\n\\t\\t&.ck-dropdown__button_label-width_auto .ck-button__label {\\n\\t\\t\\twidth: auto;\\n\\t\\t}\\n\\n\\t\\t/* https://github.com/ckeditor/ckeditor5/issues/8699 */\\n\\t\\t&.ck-off:active,\\n\\t\\t&.ck-on:active {\\n\\t\\t\\tbox-shadow: none;\\n\\t\\t\\t\\n\\t\\t\\t&:focus {\\n\\t\\t\\t\\t@mixin ck-box-shadow var(--ck-focus-outer-shadow);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck.ck-dropdown__panel {\\n\\t@mixin ck-rounded-corners;\\n\\t@mixin ck-drop-shadow;\\n\\n\\tbackground: var(--ck-color-dropdown-panel-background);\\n\\tborder: 1px solid var(--ck-color-dropdown-panel-border);\\n\\tbottom: 0;\\n\\n\\t/* Make sure the panel is at least as wide as the drop-down's button. */\\n\\tmin-width: 100%;\\n\\n\\t/* Disabled corner border radius to be consistent with the .dropdown__button\\n\\thttps://github.com/ckeditor/ckeditor5/issues/816 */\\n\\t&.ck-dropdown__panel_se {\\n\\t\\tborder-top-left-radius: 0;\\n\\t}\\n\\n\\t&.ck-dropdown__panel_sw {\\n\\t\\tborder-top-right-radius: 0;\\n\\t}\\n\\n\\t&.ck-dropdown__panel_ne {\\n\\t\\tborder-bottom-left-radius: 0;\\n\\t}\\n\\n\\t&.ck-dropdown__panel_nw {\\n\\t\\tborder-bottom-right-radius: 0;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A class which indicates that an element holding it is disabled.\\n */\\n@define-mixin ck-disabled {\\n\\topacity: var(--ck-disabled-opacity);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/listdropdown.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAOA,6CCIC,eDqBD,CAzBA,iICQE,qCAAsC,CDJtC,wBAqBF,CAfE,mFCND,eDYC,CANA,6MCFA,qCAAsC,CDKpC,2BAA4B,CAC5B,4BAA6B,CAF7B,wBAIF,CAEA,kFCdD,eDmBC,CALA,2MCVA,qCAAsC,CDYpC,wBAAyB,CACzB,yBAEF\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n\\n.ck.ck-dropdown .ck-dropdown__panel .ck-list {\\n\\t/* Disabled radius of top-left border to be consistent with .dropdown__button\\n\\thttps://github.com/ckeditor/ckeditor5/issues/816 */\\n\\t@mixin ck-rounded-corners {\\n\\t\\tborder-top-left-radius: 0;\\n\\t}\\n\\n\\t/* Make sure the button belonging to the first/last child of the list goes well with the\\n\\tborder radius of the entire panel. */\\n\\t& .ck-list__item {\\n\\t\\t&:first-child .ck-button {\\n\\t\\t\\t@mixin ck-rounded-corners {\\n\\t\\t\\t\\tborder-top-left-radius: 0;\\n\\t\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t\\t\\tborder-bottom-right-radius: 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&:last-child .ck-button {\\n\\t\\t\\t@mixin ck-rounded-corners {\\n\\t\\t\\t\\tborder-top-left-radius: 0;\\n\\t\\t\\t\\tborder-top-right-radius: 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-splitbutton{font-size:inherit}.ck.ck-splitbutton .ck-splitbutton__action:focus{z-index:calc(var(--ck-z-default) + 1)}:root{--ck-color-split-button-hover-background:#ebebeb;--ck-color-split-button-hover-border:#b3b3b3}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-bottom-right-radius:unset;border-top-right-radius:unset}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__action{border-bottom-left-radius:unset;border-top-left-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow{min-width:unset}[dir=ltr] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-bottom-left-radius:unset;border-top-left-radius:unset}[dir=rtl] .ck.ck-splitbutton>.ck-splitbutton__arrow{border-bottom-right-radius:unset;border-top-right-radius:unset}.ck.ck-splitbutton>.ck-splitbutton__arrow svg{width:var(--ck-dropdown-arrow-size)}.ck.ck-splitbutton>.ck-splitbutton__arrow:not(:focus){border-bottom-width:0;border-top-width:0}.ck.ck-splitbutton.ck-splitbutton_open>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover),.ck.ck-splitbutton:hover>.ck-button:not(.ck-on):not(.ck-disabled):not(:hover){background:var(--ck-color-split-button-hover-background)}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{background-color:var(--ck-color-split-button-hover-border);content:\\\"\\\";height:100%;position:absolute;width:1px}.ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:focus:after,.ck.ck-splitbutton:hover>.ck-splitbutton__arrow:focus:after{--ck-color-split-button-hover-border:var(--ck-color-focus-border)}[dir=ltr] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=ltr] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{left:-1px}[dir=rtl] .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow:not(.ck-disabled):after,[dir=rtl] .ck.ck-splitbutton:hover>.ck-splitbutton__arrow:not(.ck-disabled):after{right:-1px}.ck.ck-splitbutton.ck-splitbutton_open{border-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__action,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__action{border-bottom-left-radius:0}.ck-rounded-corners .ck.ck-splitbutton.ck-splitbutton_open>.ck-splitbutton__arrow,.ck.ck-splitbutton.ck-splitbutton_open.ck-rounded-corners>.ck-splitbutton__arrow{border-bottom-right-radius:0}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/splitbutton.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/splitbutton.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAKA,mBAEC,iBAKD,CAHC,iDACC,qCACD,CCJD,MACC,gDAAyD,CACzD,4CACD,CAMC,oIAKE,gCAAiC,CADjC,6BASF,CAbA,oIAWE,+BAAgC,CADhC,4BAGF,CAEA,0CAGC,eAiBD,CApBA,oDAQE,+BAAgC,CADhC,4BAaF,CApBA,oDAcE,gCAAiC,CADjC,6BAOF,CAHC,8CACC,mCACD,CAKD,sDAEC,qBAAwB,CADxB,kBAED,CAQC,0KACC,wDACD,CAIA,8JAKC,0DAA2D,CAJ3D,UAAW,CAGX,WAAY,CAFZ,iBAAkB,CAClB,SAGD,CAGA,sIACC,iEACD,CAGC,kLACC,SACD,CAIA,kLACC,UACD,CAMF,uCCzFA,eDmGA,CAVA,qHCrFC,qCD+FD,CARE,qKACC,2BACD,CAEA,mKACC,4BACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-splitbutton {\\n\\t/* Enable font size inheritance, which allows fluid UI scaling. */\\n\\tfont-size: inherit;\\n\\n\\t& .ck-splitbutton__action:focus {\\n\\t\\tz-index: calc(var(--ck-z-default) + 1);\\n\\t}\\n}\\n\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n\\n:root {\\n\\t--ck-color-split-button-hover-background: hsl(0, 0%, 92%);\\n\\t--ck-color-split-button-hover-border: hsl(0, 0%, 70%);\\n}\\n\\n.ck.ck-splitbutton {\\n\\t/*\\n\\t * Note: ck-rounded and ck-dir mixins don't go together (because they both use @nest).\\n\\t */\\n\\t&:hover > .ck-splitbutton__action,\\n\\t&.ck-splitbutton_open > .ck-splitbutton__action {\\n\\t\\t@nest [dir=\\\"ltr\\\"] & {\\n\\t\\t\\t/* Don't round the action button on the right side */\\n\\t\\t\\tborder-top-right-radius: unset;\\n\\t\\t\\tborder-bottom-right-radius: unset;\\n\\t\\t}\\n\\n\\t\\t@nest [dir=\\\"rtl\\\"] & {\\n\\t\\t\\t/* Don't round the action button on the left side */\\n\\t\\t\\tborder-top-left-radius: unset;\\n\\t\\t\\tborder-bottom-left-radius: unset;\\n\\t\\t}\\n\\t}\\n\\n\\t& > .ck-splitbutton__arrow {\\n\\t\\t/* It's a text-less button and since the icon is positioned absolutely in such situation,\\n\\t\\tit must get some arbitrary min-width. */\\n\\t\\tmin-width: unset;\\n\\n\\t\\t@nest [dir=\\\"ltr\\\"] & {\\n\\t\\t\\t/* Don't round the arrow button on the left side */\\n\\t\\t\\tborder-top-left-radius: unset;\\n\\t\\t\\tborder-bottom-left-radius: unset;\\n\\t\\t}\\n\\n\\t\\t@nest [dir=\\\"rtl\\\"] & {\\n\\t\\t\\t/* Don't round the arrow button on the right side */\\n\\t\\t\\tborder-top-right-radius: unset;\\n\\t\\t\\tborder-bottom-right-radius: unset;\\n\\t\\t}\\n\\n\\t\\t& svg {\\n\\t\\t\\twidth: var(--ck-dropdown-arrow-size);\\n\\t\\t}\\n\\t}\\n\\n\\t/* Make sure the divider stretches 100% height of the button\\n\\thttps://github.com/ckeditor/ckeditor5/issues/10936 */\\n\\t& > .ck-splitbutton__arrow:not(:focus) {\\n\\t\\tborder-top-width: 0px;\\n\\t\\tborder-bottom-width: 0px;\\n\\t}\\n\\n\\t/* When the split button is \\\"open\\\" (the arrow is on) or being hovered, it should get some styling\\n\\tas a whole. The background of both buttons should stand out and there should be a visual\\n\\tseparation between both buttons. */\\n\\t&.ck-splitbutton_open,\\n\\t&:hover {\\n\\t\\t/* When the split button hovered as a whole, not as individual buttons. */\\n\\t\\t& > .ck-button:not(.ck-on):not(.ck-disabled):not(:hover) {\\n\\t\\t\\tbackground: var(--ck-color-split-button-hover-background);\\n\\t\\t}\\n\\n\\t\\t/* Splitbutton separator needs to be set with the ::after pseudoselector\\n\\t\\tto display properly the borders on focus */\\n\\t\\t& > .ck-splitbutton__arrow:not(.ck-disabled)::after {\\n\\t\\t\\tcontent: '';\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\twidth: 1px;\\n\\t\\t\\theight: 100%;\\n\\t\\t\\tbackground-color: var(--ck-color-split-button-hover-border);\\n\\t\\t}\\n\\n\\t\\t/* Make sure the divider between the buttons looks fine when the button is focused */\\n\\t\\t& > .ck-splitbutton__arrow:focus::after {\\n\\t\\t\\t--ck-color-split-button-hover-border: var(--ck-color-focus-border);\\n\\t\\t}\\n\\n\\t\\t@nest [dir=\\\"ltr\\\"] & {\\n\\t\\t\\t& > .ck-splitbutton__arrow:not(.ck-disabled)::after {\\n\\t\\t\\t\\tleft: -1px;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t@nest [dir=\\\"rtl\\\"] & {\\n\\t\\t\\t& > .ck-splitbutton__arrow:not(.ck-disabled)::after {\\n\\t\\t\\t\\tright: -1px;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t/* Don't round the bottom left and right corners of the buttons when \\\"open\\\"\\n\\thttps://github.com/ckeditor/ckeditor5/issues/816 */\\n\\t&.ck-splitbutton_open {\\n\\t\\t@mixin ck-rounded-corners {\\n\\t\\t\\t& > .ck-splitbutton__action {\\n\\t\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t\\t}\\n\\n\\t\\t\\t& > .ck-splitbutton__arrow {\\n\\t\\t\\t\\tborder-bottom-right-radius: 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-toolbar-dropdown-max-width:60vw}.ck.ck-toolbar-dropdown>.ck-dropdown__panel{max-width:var(--ck-toolbar-dropdown-max-width);width:max-content}.ck.ck-toolbar-dropdown>.ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/dropdown/toolbardropdown.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/toolbardropdown.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,oCACD,CAEA,4CAGC,8CAA+C,CAD/C,iBAQD,CAJE,6DACC,qCACD,CCZF,oCACC,QACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-toolbar-dropdown-max-width: 60vw;\\n}\\n\\n.ck.ck-toolbar-dropdown > .ck-dropdown__panel {\\n\\t/* https://github.com/ckeditor/ckeditor5/issues/5586 */\\n\\twidth: max-content;\\n\\tmax-width: var(--ck-toolbar-dropdown-max-width);\\n\\n\\t& .ck-button {\\n\\t\\t&:focus {\\n\\t\\t\\tz-index: calc(var(--ck-z-default) + 1);\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-toolbar-dropdown .ck-toolbar {\\n\\tborder: 0;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-color-editable-blur-selection:#d9d9d9}.ck.ck-editor__editable:not(.ck-editor__nested-editable){border-radius:0}.ck-rounded-corners .ck.ck-editor__editable:not(.ck-editor__nested-editable),.ck.ck-editor__editable.ck-rounded-corners:not(.ck-editor__nested-editable){border-radius:var(--ck-border-radius)}.ck.ck-editor__editable.ck-focused:not(.ck-editor__nested-editable){border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}.ck.ck-editor__editable_inline{border:1px solid transparent;overflow:auto;padding:0 var(--ck-spacing-standard)}.ck.ck-editor__editable_inline[dir=ltr]{text-align:left}.ck.ck-editor__editable_inline[dir=rtl]{text-align:right}.ck.ck-editor__editable_inline>:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-editor__editable_inline.ck-blurred ::selection{background:var(--ck-color-editable-blur-selection)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-base-foreground)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-base-foreground)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/editorui/editorui.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\"],\"names\":[],\"mappings\":\"AAWA,MACC,0CACD,CAEA,yDCJC,eDWD,CAPA,yJCAE,qCDOF,CAJC,oEEPA,2BAA2B,CCF3B,qCAA8B,CDC9B,YFWA,CAGD,+BAGC,4BAA6B,CAF7B,aAAc,CACd,oCA6BD,CA1BC,wCACC,eACD,CAEA,wCACC,gBACD,CAGA,4CACC,kCACD,CAGA,2CAKC,qCACD,CAGA,sDACC,kDACD,CAKA,gEACC,mDACD,CAIA,gEACC,gDACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"../../../mixins/_disabled.css\\\";\\n@import \\\"../../../mixins/_shadow.css\\\";\\n@import \\\"../../../mixins/_focus.css\\\";\\n@import \\\"../../mixins/_button.css\\\";\\n\\n:root {\\n\\t--ck-color-editable-blur-selection: hsl(0, 0%, 85%);\\n}\\n\\n.ck.ck-editor__editable:not(.ck-editor__nested-editable) {\\n\\t@mixin ck-rounded-corners;\\n\\n\\t&.ck-focused {\\n\\t\\t@mixin ck-focus-ring;\\n\\t\\t@mixin ck-box-shadow var(--ck-inner-shadow);\\n\\t}\\n}\\n\\n.ck.ck-editor__editable_inline {\\n\\toverflow: auto;\\n\\tpadding: 0 var(--ck-spacing-standard);\\n\\tborder: 1px solid transparent;\\n\\n\\t&[dir=\\\"ltr\\\"] {\\n\\t\\ttext-align: left;\\n\\t}\\n\\n\\t&[dir=\\\"rtl\\\"] {\\n\\t\\ttext-align: right;\\n\\t}\\n\\n\\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/116 */\\n\\t& > *:first-child {\\n\\t\\tmargin-top: var(--ck-spacing-large);\\n\\t}\\n\\n\\t/* https://github.com/ckeditor/ckeditor5/issues/847 */\\n\\t& > *:last-child {\\n\\t\\t/*\\n\\t\\t * This value should match with the default margins of the block elements (like .media or .image)\\n\\t\\t * to avoid a content jumping when the fake selection container shows up (See https://github.com/ckeditor/ckeditor5/issues/9825).\\n\\t\\t */\\n\\t\\tmargin-bottom: var(--ck-spacing-large);\\n\\t}\\n\\n\\t/* https://github.com/ckeditor/ckeditor5/issues/6517 */\\n\\t&.ck-blurred ::selection {\\n\\t\\tbackground: var(--ck-color-editable-blur-selection);\\n\\t}\\n}\\n\\n/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/111 */\\n.ck.ck-balloon-panel.ck-toolbar-container[class*=\\\"arrow_n\\\"] {\\n\\t&::after {\\n\\t\\tborder-bottom-color: var(--ck-color-base-foreground);\\n\\t}\\n}\\n\\n.ck.ck-balloon-panel.ck-toolbar-container[class*=\\\"arrow_s\\\"] {\\n\\t&::after {\\n\\t\\tborder-top-color: var(--ck-color-base-foreground);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A visual style of focused element's border.\\n */\\n@define-mixin ck-focus-ring {\\n\\t/* Disable native outline. */\\n\\toutline: none;\\n\\tborder: var(--ck-focus-ring)\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-form__header{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}:root{--ck-form-header-height:38px}.ck.ck-form__header{border-bottom:1px solid var(--ck-color-base-border);height:var(--ck-form-header-height);line-height:var(--ck-form-header-height);padding:var(--ck-spacing-small) var(--ck-spacing-large)}.ck.ck-form__header .ck-form__header__label{font-weight:700}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/formheader/formheader.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/formheader/formheader.css\"],\"names\":[],\"mappings\":\"AAKA,oBAIC,kBAAmB,CAHnB,YAAa,CACb,kBAAmB,CACnB,gBAAiB,CAEjB,6BACD,CCNA,MACC,4BACD,CAEA,oBAIC,mDAAoD,CAFpD,mCAAoC,CACpC,wCAAyC,CAFzC,uDAQD,CAHC,4CACC,eACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-form__header {\\n\\tdisplay: flex;\\n\\tflex-direction: row;\\n\\tflex-wrap: nowrap;\\n\\talign-items: center;\\n\\tjustify-content: space-between;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-form-header-height: 38px;\\n}\\n\\n.ck.ck-form__header {\\n\\tpadding: var(--ck-spacing-small) var(--ck-spacing-large);\\n\\theight: var(--ck-form-header-height);\\n\\tline-height: var(--ck-form-header-height);\\n\\tborder-bottom: 1px solid var(--ck-color-base-border);\\n\\n\\t& .ck-form__header__label {\\n\\t\\tfont-weight: bold;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{font-size:.8333350694em;height:var(--ck-icon-size);width:var(--ck-icon-size);will-change:transform}.ck.ck-icon,.ck.ck-icon *{cursor:inherit}.ck.ck-icon.ck-icon_inherit-color,.ck.ck-icon.ck-icon_inherit-color *{color:inherit}.ck.ck-icon.ck-icon_inherit-color :not([fill]){fill:currentColor}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/icon/icon.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/icon/icon.css\"],\"names\":[],\"mappings\":\"AAKA,YACC,qBACD,CCFA,MACC,0EACD,CAEA,YAKC,uBAAwB,CAHxB,0BAA2B,CAD3B,yBAA0B,CAU1B,qBAoBD,CAlBC,0BALA,cAQA,CAMC,sEACC,aAMD,CAJC,+CAEC,iBACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-icon {\\n\\tvertical-align: middle;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-icon-size: calc(var(--ck-line-height-base) * var(--ck-font-size-normal));\\n}\\n\\n.ck.ck-icon {\\n\\twidth: var(--ck-icon-size);\\n\\theight: var(--ck-icon-size);\\n\\n\\t/* Multiplied by the height of the line in \\\"px\\\" should give SVG \\\"viewport\\\" dimensions */\\n\\tfont-size: .8333350694em;\\n\\n\\t/* Inherit cursor style (#5). */\\n\\tcursor: inherit;\\n\\n\\t/* This will prevent blurry icons on Firefox. See #340. */\\n\\twill-change: transform;\\n\\n\\t& * {\\n\\t\\t/* Inherit cursor style (#5). */\\n\\t\\tcursor: inherit;\\n\\t}\\n\\n\\t/* Allows dynamic coloring of an icon by inheriting its color from the parent. */\\n\\t&.ck-icon_inherit-color {\\n\\t\\tcolor: inherit;\\n\\n\\t\\t& * {\\n\\t\\t\\tcolor: inherit;\\n\\n\\t\\t\\t&:not([fill]) {\\n\\t\\t\\t\\t/* Needed by FF. */\\n\\t\\t\\t\\tfill: currentColor;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-input-width:18em;--ck-input-text-width:var(--ck-input-width)}.ck.ck-input{border-radius:0}.ck-rounded-corners .ck.ck-input,.ck.ck-input.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input{background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);min-height:var(--ck-ui-component-min-height);min-width:var(--ck-input-width);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);transition:box-shadow .1s ease-in-out,border .1s ease-in-out}.ck.ck-input:focus{border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;outline:none}.ck.ck-input[readonly]{background:var(--ck-color-input-disabled-background);border:1px solid var(--ck-color-input-disabled-border);color:var(--ck-color-input-disabled-text)}.ck.ck-input[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-input.ck-error{animation:ck-input-shake .3s ease both;border-color:var(--ck-color-input-error-border)}.ck.ck-input.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),0 0}@keyframes ck-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/input/input.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\"],\"names\":[],\"mappings\":\"AASA,MACC,qBAAsB,CAGtB,2CACD,CAEA,aCLC,eD2CD,CAtCA,iECDE,qCDuCF,CAtCA,aAGC,2CAA4C,CAC5C,6CAA8C,CAK9C,4CAA6C,CAH7C,+BAAgC,CADhC,6DAA8D,CAO9D,4DA0BD,CAxBC,mBEnBA,2BAA2B,CCF3B,2CAA8B,CDC9B,YFuBA,CAEA,uBAEC,oDAAqD,CADrD,sDAAuD,CAEvD,yCAMD,CAJC,6BG/BD,oDHkCC,CAGD,sBAEC,sCAAuC,CADvC,+CAMD,CAHC,4BGzCD,iDH2CC,CAIF,0BACC,IACC,0BACD,CAEA,IACC,yBACD,CAEA,IACC,0BACD,CAEA,IACC,yBACD,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"../../../mixins/_focus.css\\\";\\n@import \\\"../../../mixins/_shadow.css\\\";\\n\\n:root {\\n\\t--ck-input-width: 18em;\\n\\n\\t/* Backward compatibility. */\\n\\t--ck-input-text-width: var(--ck-input-width);\\n}\\n\\n.ck.ck-input {\\n\\t@mixin ck-rounded-corners;\\n\\n\\tbackground: var(--ck-color-input-background);\\n\\tborder: 1px solid var(--ck-color-input-border);\\n\\tpadding: var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);\\n\\tmin-width: var(--ck-input-width);\\n\\n\\t/* This is important to stay of the same height as surrounding buttons */\\n\\tmin-height: var(--ck-ui-component-min-height);\\n\\n\\t/* Apply some smooth transition to the box-shadow and border. */\\n\\ttransition: box-shadow .1s ease-in-out, border .1s ease-in-out;\\n\\n\\t&:focus {\\n\\t\\t@mixin ck-focus-ring;\\n\\t\\t@mixin ck-box-shadow var(--ck-focus-outer-shadow);\\n\\t}\\n\\n\\t&[readonly] {\\n\\t\\tborder: 1px solid var(--ck-color-input-disabled-border);\\n\\t\\tbackground: var(--ck-color-input-disabled-background);\\n\\t\\tcolor: var(--ck-color-input-disabled-text);\\n\\n\\t\\t&:focus {\\n\\t\\t\\t/* The read-only input should have a slightly less visible shadow when focused. */\\n\\t\\t\\t@mixin ck-box-shadow var(--ck-focus-disabled-outer-shadow);\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-error {\\n\\t\\tborder-color: var(--ck-color-input-error-border);\\n\\t\\tanimation: ck-input-shake .3s ease both;\\n\\n\\t\\t&:focus {\\n\\t\\t\\t@mixin ck-box-shadow var(--ck-focus-error-outer-shadow);\\n\\t\\t}\\n\\t}\\n}\\n\\n@keyframes ck-input-shake {\\n\\t20% {\\n\\t\\ttransform: translateX(-2px);\\n\\t}\\n\\n\\t40% {\\n\\t\\ttransform: translateX(2px);\\n\\t}\\n\\n\\t60% {\\n\\t\\ttransform: translateX(-1px);\\n\\t}\\n\\n\\t80% {\\n\\t\\ttransform: translateX(1px);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A visual style of focused element's border.\\n */\\n@define-mixin ck-focus-ring {\\n\\t/* Disable native outline. */\\n\\toutline: none;\\n\\tborder: var(--ck-focus-ring)\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/label/label.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/label/label.css\"],\"names\":[],\"mappings\":\"AAKA,aACC,aACD,CAEA,mBACC,YACD,CCNA,aACC,eACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-label {\\n\\tdisplay: block;\\n}\\n\\n.ck.ck-voice-label {\\n\\tdisplay: none;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-label {\\n\\tfont-weight: bold;\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{display:flex;position:relative}.ck.ck-labeled-field-view .ck.ck-label{display:block;position:absolute}:root{--ck-labeled-field-view-transition:.1s cubic-bezier(0,0,0.24,0.95);--ck-labeled-field-empty-unfocused-max-width:100% - 2 * var(--ck-spacing-medium);--ck-labeled-field-label-default-position-x:var(--ck-spacing-medium);--ck-labeled-field-label-default-position-y:calc(var(--ck-font-size-base)*0.6);--ck-color-labeled-field-label-background:var(--ck-color-base-background)}.ck.ck-labeled-field-view{border-radius:0}.ck-rounded-corners .ck.ck-labeled-field-view,.ck.ck-labeled-field-view.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper{width:100%}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{top:0}[dir=ltr] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{left:0}[dir=rtl] .ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{right:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{background:var(--ck-color-labeled-field-label-background);font-weight:400;line-height:normal;max-width:100%;overflow:hidden;padding:0 calc(var(--ck-font-size-tiny)*.5);pointer-events:none;text-overflow:ellipsis;transform:translate(var(--ck-spacing-medium),-6px) scale(.75);transform-origin:0 0;transition:transform var(--ck-labeled-field-view-transition),padding var(--ck-labeled-field-view-transition),background var(--ck-labeled-field-view-transition)}.ck.ck-labeled-field-view.ck-error .ck-input:not([readonly])+.ck.ck-label,.ck.ck-labeled-field-view.ck-error>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view .ck-labeled-field-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-field-view .ck-labeled-field-view__status.ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view.ck-disabled>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{color:var(--ck-color-input-disabled-text)}[dir=ltr] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=ltr] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(var(--ck-labeled-field-label-default-position-x),var(--ck-labeled-field-label-default-position-y)) scale(1)}[dir=rtl] .ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,[dir=rtl] .ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{transform:translate(calc(var(--ck-labeled-field-label-default-position-x)*-1),var(--ck-labeled-field-label-default-position-y)) scale(1)}.ck.ck-labeled-field-view.ck-disabled.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label,.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck.ck-label{background:transparent;max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width));padding:0}.ck.ck-labeled-field-view>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck.ck-button{background:transparent}.ck.ck-labeled-field-view.ck-labeled-field-view_empty>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown>.ck-button>.ck-button__label{opacity:0}.ck.ck-labeled-field-view.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder)>.ck.ck-labeled-field-view__input-wrapper>.ck-dropdown+.ck-label{max-width:calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard))}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/labeledfield/labeledfieldview.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/labeledfield/labeledfieldview.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAMC,mEACC,YAAa,CACb,iBACD,CAEA,uCACC,aAAc,CACd,iBACD,CCND,MACC,kEAAsE,CACtE,gFAAiF,CACjF,oEAAqE,CACrE,8EAAiF,CACjF,yEACD,CAEA,0BCLC,eD8GD,CAzGA,2FCDE,qCD0GF,CAtGC,mEACC,UAmCD,CAjCC,gFACC,KA+BD,CAhCA,0FAIE,MA4BF,CAhCA,0FAQE,OAwBF,CAhCA,gFAiBC,yDAA0D,CAG1D,eAAmB,CADnB,kBAAoB,CAOpB,cAAe,CAFf,eAAgB,CANhB,2CAA8C,CAP9C,mBAAoB,CAYpB,sBAAuB,CARvB,6DAA+D,CAH/D,oBAAqB,CAgBrB,+JAID,CAQA,mKACC,gCACD,CAGD,yDACC,mCAAoC,CACpC,kCAAmC,CAInC,kBAKD,CAHC,6FACC,gCACD,CAID,4OAEC,yCACD,CAIA,oUAGE,+HAYF,CAfA,oUAOE,wIAQF,CAfA,gTAaC,sBAAuB,CAFvB,iEAAkE,CAGlE,SACD,CAKA,8FACC,sBACD,CAGA,yIACC,SACD,CAGA,kMACC,8HACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-labeled-field-view {\\n\\t& > .ck.ck-labeled-field-view__input-wrapper {\\n\\t\\tdisplay: flex;\\n\\t\\tposition: relative;\\n\\t}\\n\\n\\t& .ck.ck-label {\\n\\t\\tdisplay: block;\\n\\t\\tposition: absolute;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n@import \\\"../../../mixins/_rounded.css\\\";\\n\\n:root {\\n\\t--ck-labeled-field-view-transition: .1s cubic-bezier(0, 0, 0.24, 0.95);\\n\\t--ck-labeled-field-empty-unfocused-max-width: 100% - 2 * var(--ck-spacing-medium);\\n\\t--ck-labeled-field-label-default-position-x: var(--ck-spacing-medium);\\n\\t--ck-labeled-field-label-default-position-y: calc(0.6 * var(--ck-font-size-base));\\n\\t--ck-color-labeled-field-label-background: var(--ck-color-base-background);\\n}\\n\\n.ck.ck-labeled-field-view {\\n\\t@mixin ck-rounded-corners;\\n\\n\\t& > .ck.ck-labeled-field-view__input-wrapper {\\n\\t\\twidth: 100%;\\n\\n\\t\\t& > .ck.ck-label {\\n\\t\\t\\ttop: 0px;\\n\\n\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\tleft: 0px;\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tright: 0px;\\n\\t\\t\\t}\\n\\n\\t\\t\\tpointer-events: none;\\n\\t\\t\\ttransform-origin: 0 0;\\n\\n\\t\\t\\t/* By default, display the label scaled down above the field. */\\n\\t\\t\\ttransform: translate(var(--ck-spacing-medium), -6px) scale(.75);\\n\\n\\t\\t\\tbackground: var(--ck-color-labeled-field-label-background);\\n\\t\\t\\tpadding: 0 calc(.5 * var(--ck-font-size-tiny));\\n\\t\\t\\tline-height: initial;\\n\\t\\t\\tfont-weight: normal;\\n\\n\\t\\t\\t/* Prevent overflow when the label is longer than the input */\\n\\t\\t\\ttext-overflow: ellipsis;\\n\\t\\t\\toverflow: hidden;\\n\\n\\t\\t\\tmax-width: 100%;\\n\\n\\t\\t\\ttransition:\\n\\t\\t\\t\\ttransform var(--ck-labeled-field-view-transition),\\n\\t\\t\\t\\tpadding var(--ck-labeled-field-view-transition),\\n\\t\\t\\t\\tbackground var(--ck-labeled-field-view-transition);\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-error {\\n\\t\\t& > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label {\\n\\t\\t\\tcolor: var(--ck-color-base-error);\\n\\t\\t}\\n\\n\\t\\t& .ck-input:not([readonly]) + .ck.ck-label {\\n\\t\\t\\tcolor: var(--ck-color-base-error);\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck-labeled-field-view__status {\\n\\t\\tfont-size: var(--ck-font-size-small);\\n\\t\\tmargin-top: var(--ck-spacing-small);\\n\\n\\t\\t/* Let the info wrap to the next line to avoid stretching the layout horizontally.\\n\\t\\tThe status could be very long. */\\n\\t\\twhite-space: normal;\\n\\n\\t\\t&.ck-labeled-field-view__status_error {\\n\\t\\t\\tcolor: var(--ck-color-base-error);\\n\\t\\t}\\n\\t}\\n\\n\\t/* Disabled fields and fields that have no focus should fade out. */\\n\\t&.ck-disabled > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label,\\n\\t&.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused) > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label {\\n\\t\\tcolor: var(--ck-color-input-disabled-text);\\n\\t}\\n\\n\\t/* Fields that are disabled or not focused and without a placeholder should have full-sized labels. */\\n\\t/* stylelint-disable-next-line no-descending-specificity */\\n\\t&.ck-disabled.ck-labeled-field-view_empty > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label,\\n\\t&.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder) > .ck.ck-labeled-field-view__input-wrapper > .ck.ck-label {\\n\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\ttransform: translate(var(--ck-labeled-field-label-default-position-x), var(--ck-labeled-field-label-default-position-y)) scale(1);\\n\\t\\t}\\n\\n\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\ttransform: translate(calc(-1 * var(--ck-labeled-field-label-default-position-x)), var(--ck-labeled-field-label-default-position-y)) scale(1);\\n\\t\\t}\\n\\n\\t\\t/* Compensate for the default translate position. */\\n\\t\\tmax-width: calc(var(--ck-labeled-field-empty-unfocused-max-width));\\n\\n\\t\\tbackground: transparent;\\n\\t\\tpadding: 0;\\n\\t}\\n\\n\\t/*------ DropdownView integration ----------------------------------------------------------------------------------- */\\n\\n\\t/* Make sure dropdown' background color in any of dropdown's state does not collide with labeled field. */\\n\\t& > .ck.ck-labeled-field-view__input-wrapper > .ck-dropdown > .ck.ck-button {\\n\\t\\tbackground: transparent;\\n\\t}\\n\\n\\t/* When the dropdown is \\\"empty\\\", the labeled field label replaces its label. */\\n\\t&.ck-labeled-field-view_empty > .ck.ck-labeled-field-view__input-wrapper > .ck-dropdown > .ck-button > .ck-button__label {\\n\\t\\topacity: 0;\\n\\t}\\n\\n\\t/* Make sure the label of the empty, unfocused input does not cover the dropdown arrow. */\\n\\t&.ck-labeled-field-view_empty:not(.ck-labeled-field-view_focused):not(.ck-labeled-field-view_placeholder) > .ck.ck-labeled-field-view__input-wrapper > .ck-dropdown + .ck-label {\\n\\t\\tmax-width: calc(var(--ck-labeled-field-empty-unfocused-max-width) - var(--ck-dropdown-arrow-size) - var(--ck-spacing-standard));\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-list{display:flex;flex-direction:column;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{background:var(--ck-color-list-background);list-style-type:none}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{border-radius:0;min-height:unset;padding:calc(var(--ck-line-height-base)*.2*var(--ck-font-size-base)) calc(var(--ck-line-height-base)*.4*var(--ck-font-size-base));text-align:left;width:100%}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(var(--ck-line-height-base)*1.2*var(--ck-font-size-base))}.ck.ck-list__item .ck-button:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on{background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item .ck-button.ck-on:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item .ck-button.ck-on:focus:not(.ck-switchbutton):not(.ck-disabled){border-color:var(--ck-color-base-background)}.ck.ck-list__item .ck-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item .ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item .ck-switchbutton.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck.ck-list__separator{background:var(--ck-color-base-border);height:1px;width:100%}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/list/list.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/list/list.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAOA,YAGC,YAAa,CACb,qBAAsB,CCFtB,qBAAsB,CACtB,wBAAyB,CACzB,oBAAqB,CACrB,gBDaD,CAZC,2DAEC,aACD,CAKA,kCACC,iBAAkB,CAClB,2BACD,CEfD,YCEC,eDGD,CALA,+DCME,qCDDF,CALA,YAIC,0CAA2C,CAD3C,oBAED,CAEA,kBACC,cAAe,CACf,cA2DD,CAzDC,6BAIC,eAAgB,CAHhB,gBAAiB,CAQjB,iIAEiE,CARjE,eAAgB,CADhB,UAwCD,CA7BC,+CAEC,yEACD,CAEA,oCACC,eACD,CAEA,mCACC,oDAAqD,CACrD,yCAaD,CAXC,0CACC,eACD,CAEA,2DACC,0DACD,CAEA,iFACC,4CACD,CAGD,qDACC,uDACD,CAMA,yCACC,0CAA2C,CAC3C,aAMD,CAJC,iEACC,uDAAwD,CACxD,aACD,CAKH,uBAGC,sCAAuC,CAFvC,UAAW,CACX,UAED\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../mixins/_unselectable.css\\\";\\n\\n.ck.ck-list {\\n\\t@mixin ck-unselectable;\\n\\n\\tdisplay: flex;\\n\\tflex-direction: column;\\n\\n\\t& .ck-list__item,\\n\\t& .ck-list__separator {\\n\\t\\tdisplay: block;\\n\\t}\\n\\n\\t/* Make sure that whatever child of the list item gets focus, it remains on the\\n\\ttop. Thanks to that, styles like box-shadow, outline, etc. are not masked by\\n\\tadjacent list items. */\\n\\t& .ck-list__item > *:focus {\\n\\t\\tposition: relative;\\n\\t\\tz-index: var(--ck-z-default);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Makes element unselectable.\\n */\\n@define-mixin ck-unselectable {\\n\\t-moz-user-select: none;\\n\\t-webkit-user-select: none;\\n\\t-ms-user-select: none;\\n\\tuser-select: none\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_disabled.css\\\";\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"../../../mixins/_shadow.css\\\";\\n\\n.ck.ck-list {\\n\\t@mixin ck-rounded-corners;\\n\\n\\tlist-style-type: none;\\n\\tbackground: var(--ck-color-list-background);\\n}\\n\\n.ck.ck-list__item {\\n\\tcursor: default;\\n\\tmin-width: 12em;\\n\\n\\t& .ck-button {\\n\\t\\tmin-height: unset;\\n\\t\\twidth: 100%;\\n\\t\\ttext-align: left;\\n\\t\\tborder-radius: 0;\\n\\n\\t\\t/* List items should have the same height. Use absolute units to make sure it is so\\n\\t\\t because e.g. different heading styles may have different height\\n\\t\\t https://github.com/ckeditor/ckeditor5-heading/issues/63 */\\n\\t\\tpadding:\\n\\t\\t\\tcalc(.2 * var(--ck-line-height-base) * var(--ck-font-size-base))\\n\\t\\t\\tcalc(.4 * var(--ck-line-height-base) * var(--ck-font-size-base));\\n\\n\\t\\t& .ck-button__label {\\n\\t\\t\\t/* https://github.com/ckeditor/ckeditor5-heading/issues/63 */\\n\\t\\t\\tline-height: calc(1.2 * var(--ck-line-height-base) * var(--ck-font-size-base));\\n\\t\\t}\\n\\n\\t\\t&:active {\\n\\t\\t\\tbox-shadow: none;\\n\\t\\t}\\n\\n\\t\\t&.ck-on {\\n\\t\\t\\tbackground: var(--ck-color-list-button-on-background);\\n\\t\\t\\tcolor: var(--ck-color-list-button-on-text);\\n\\n\\t\\t\\t&:active {\\n\\t\\t\\t\\tbox-shadow: none;\\n\\t\\t\\t}\\n\\n\\t\\t\\t&:hover:not(.ck-disabled) {\\n\\t\\t\\t\\tbackground: var(--ck-color-list-button-on-background-focus);\\n\\t\\t\\t}\\n\\n\\t\\t\\t&:focus:not(.ck-switchbutton):not(.ck-disabled) {\\n\\t\\t\\t\\tborder-color: var(--ck-color-base-background);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&:hover:not(.ck-disabled) {\\n\\t\\t\\tbackground: var(--ck-color-list-button-hover-background);\\n\\t\\t}\\n\\t}\\n\\n\\t/* It's unnecessary to change the background/text of a switch toggle; it has different ways\\n\\tof conveying its state (like the switcher) */\\n\\t& .ck-switchbutton {\\n\\t\\t&.ck-on {\\n\\t\\t\\tbackground: var(--ck-color-list-background);\\n\\t\\t\\tcolor: inherit;\\n\\n\\t\\t\\t&:hover:not(.ck-disabled) {\\n\\t\\t\\t\\tbackground: var(--ck-color-list-button-hover-background);\\n\\t\\t\\t\\tcolor: inherit;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck.ck-list__separator {\\n\\theight: 1px;\\n\\twidth: 100%;\\n\\tbackground: var(--ck-color-base-border);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-modal)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:\\\"\\\";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-border-width:1px;--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px;--ck-balloon-arrow-drop-shadow:0 2px 2px var(--ck-color-shadow-drop)}.ck.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{background:var(--ck-color-panel-background);border:var(--ck-balloon-border-width) solid var(--ck-color-panel-border);box-shadow:var(--ck-drop-shadow),0 0;min-height:15px}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{border-style:solid;height:0;width:0}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-width:0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width)}.ck.ck-balloon-panel[class*=arrow_n]:before{border-color:transparent transparent var(--ck-color-panel-border) transparent;margin-top:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_n]:after{border-color:transparent transparent var(--ck-color-panel-background) transparent;margin-top:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-width:var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-color:var(--ck-color-panel-border) transparent transparent;filter:drop-shadow(var(--ck-balloon-arrow-drop-shadow));margin-bottom:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_s]:after{border-color:var(--ck-color-panel-background) transparent transparent transparent;margin-bottom:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_e]:after,.ck.ck-balloon-panel[class*=arrow_e]:before{border-width:var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_e]:before{border-color:transparent transparent transparent var(--ck-color-panel-border);margin-right:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_e]:after{border-color:transparent transparent transparent var(--ck-color-panel-background);margin-right:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel[class*=arrow_w]:after,.ck.ck-balloon-panel[class*=arrow_w]:before{border-width:var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0}.ck.ck-balloon-panel[class*=arrow_w]:before{border-color:transparent var(--ck-color-panel-border) transparent transparent;margin-left:calc(var(--ck-balloon-border-width)*-1)}.ck.ck-balloon-panel[class*=arrow_w]:after{border-color:transparent var(--ck-color-panel-background) transparent transparent;margin-left:calc(var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:50%;margin-left:calc(var(--ck-balloon-arrow-half-width)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);right:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);margin-right:calc(var(--ck-balloon-arrow-half-width)*2);right:25%}.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:before{bottom:calc(var(--ck-balloon-arrow-height)*-1);left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:before{margin-right:calc(var(--ck-balloon-arrow-half-width)*2);right:25%;top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:before{left:25%;margin-left:calc(var(--ck-balloon-arrow-half-width)*2);top:calc(var(--ck-balloon-arrow-height)*-1)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_e:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_e:before{margin-top:calc(var(--ck-balloon-arrow-half-width)*-1);right:calc(var(--ck-balloon-arrow-height)*-1);top:50%}.ck.ck-balloon-panel.ck-balloon-panel_arrow_w:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_w:before{left:calc(var(--ck-balloon-arrow-height)*-1);margin-top:calc(var(--ck-balloon-arrow-half-width)*-1);top:50%}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonpanel.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/balloonpanel.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\"],\"names\":[],\"mappings\":\"AAKA,MAEC,8DACD,CAEA,qBACC,YAAa,CACb,iBAAkB,CAElB,yBAyCD,CAtCE,+GAEC,UAAW,CACX,iBACD,CAEA,wDACC,6CACD,CAEA,uDACC,uDACD,CAIA,4CACC,6CACD,CAEA,2CACC,uDACD,CAIA,4CACC,6CACD,CAEA,2CACC,uDACD,CAGD,8CACC,aACD,CC9CD,MACC,6BAA8B,CAC9B,6BAA8B,CAC9B,8BAA+B,CAC/B,iCAAkC,CAClC,oEACD,CAEA,qBCLC,eDmMD,CA9LA,iFCDE,qCD+LF,CA9LA,qBAMC,2CAA4C,CAC5C,wEAAyE,CEdzE,oCAA8B,CFW9B,eA0LD,CApLE,+GAIC,kBAAmB,CADnB,QAAS,CADT,OAGD,CAIA,uFAEC,mHACD,CAEA,4CACC,6EAA8E,CAC9E,kDACD,CAEA,2CACC,iFAAkF,CAClF,gFACD,CAIA,uFAEC,mHACD,CAEA,4CACC,iEAAkE,CAClE,uDAAwD,CACxD,qDACD,CAEA,2CACC,iFAAkF,CAClF,mFACD,CAIA,uFAEC,mHACD,CAEA,4CACC,6EAA8E,CAC9E,oDACD,CAEA,2CACC,iFAAkF,CAClF,kFACD,CAIA,uFAEC,mHACD,CAEA,4CACC,6EAA8E,CAC9E,mDACD,CAEA,2CACC,iFAAkF,CAClF,iFACD,CAIA,yGAEC,QAAS,CACT,uDAA0D,CAC1D,2CACD,CAIA,2GAEC,+CAAkD,CAClD,2CACD,CAIA,2GAEC,gDAAmD,CACnD,2CACD,CAIA,yGAIC,8CAAiD,CAFjD,QAAS,CACT,uDAED,CAIA,2GAGC,8CAAiD,CADjD,+CAED,CAIA,2GAGC,8CAAiD,CADjD,gDAED,CAIA,6GAIC,8CAAiD,CADjD,uDAA0D,CAD1D,SAGD,CAIA,6GAIC,8CAAiD,CAFjD,QAAS,CACT,sDAED,CAIA,6GAGC,uDAA0D,CAD1D,SAAU,CAEV,2CACD,CAIA,6GAEC,QAAS,CACT,sDAAyD,CACzD,2CACD,CAIA,yGAGC,sDAAyD,CADzD,6CAAgD,CAEhD,OACD,CAIA,yGAEC,4CAA+C,CAC/C,sDAAyD,CACzD,OACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t/* Make sure the balloon arrow does not float over its children. */\\n\\t--ck-balloon-panel-arrow-z-index: calc(var(--ck-z-default) - 3);\\n}\\n\\n.ck.ck-balloon-panel {\\n\\tdisplay: none;\\n\\tposition: absolute;\\n\\n\\tz-index: var(--ck-z-modal);\\n\\n\\t&.ck-balloon-panel_with-arrow {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tcontent: \\\"\\\";\\n\\t\\t\\tposition: absolute;\\n\\t\\t}\\n\\n\\t\\t&::before {\\n\\t\\t\\tz-index: var(--ck-balloon-panel-arrow-z-index);\\n\\t\\t}\\n\\n\\t\\t&::after {\\n\\t\\t\\tz-index: calc(var(--ck-balloon-panel-arrow-z-index) + 1);\\n\\t\\t}\\n\\t}\\n\\n\\t&[class*=\\\"arrow_n\\\"] {\\n\\t\\t&::before {\\n\\t\\t\\tz-index: var(--ck-balloon-panel-arrow-z-index);\\n\\t\\t}\\n\\n\\t\\t&::after {\\n\\t\\t\\tz-index: calc(var(--ck-balloon-panel-arrow-z-index) + 1);\\n\\t\\t}\\n\\t}\\n\\n\\t&[class*=\\\"arrow_s\\\"] {\\n\\t\\t&::before {\\n\\t\\t\\tz-index: var(--ck-balloon-panel-arrow-z-index);\\n\\t\\t}\\n\\n\\t\\t&::after {\\n\\t\\t\\tz-index: calc(var(--ck-balloon-panel-arrow-z-index) + 1);\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_visible {\\n\\t\\tdisplay: block;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"../../../mixins/_shadow.css\\\";\\n\\n:root {\\n\\t--ck-balloon-border-width: 1px;\\n\\t--ck-balloon-arrow-offset: 2px;\\n\\t--ck-balloon-arrow-height: 10px;\\n\\t--ck-balloon-arrow-half-width: 8px;\\n\\t--ck-balloon-arrow-drop-shadow: 0 2px 2px var(--ck-color-shadow-drop);\\n}\\n\\n.ck.ck-balloon-panel {\\n\\t@mixin ck-rounded-corners;\\n\\t@mixin ck-drop-shadow;\\n\\n\\tmin-height: 15px;\\n\\n\\tbackground: var(--ck-color-panel-background);\\n\\tborder: var(--ck-balloon-border-width) solid var(--ck-color-panel-border);\\n\\n\\t&.ck-balloon-panel_with-arrow {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\twidth: 0;\\n\\t\\t\\theight: 0;\\n\\t\\t\\tborder-style: solid;\\n\\t\\t}\\n\\t}\\n\\n\\t&[class*=\\\"arrow_n\\\"] {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tborder-width: 0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width);\\n\\t\\t}\\n\\n\\t\\t&::before {\\n\\t\\t\\tborder-color: transparent transparent var(--ck-color-panel-border) transparent;\\n\\t\\t\\tmargin-top: calc( -1 * var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\n\\t\\t&::after {\\n\\t\\t\\tborder-color: transparent transparent var(--ck-color-panel-background) transparent;\\n\\t\\t\\tmargin-top: calc( var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\t}\\n\\n\\t&[class*=\\\"arrow_s\\\"] {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tborder-width: var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width);\\n\\t\\t}\\n\\n\\t\\t&::before {\\n\\t\\t\\tborder-color: var(--ck-color-panel-border) transparent transparent;\\n\\t\\t\\tfilter: drop-shadow(var(--ck-balloon-arrow-drop-shadow));\\n\\t\\t\\tmargin-bottom: calc( -1 * var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\n\\t\\t&::after {\\n\\t\\t\\tborder-color: var(--ck-color-panel-background) transparent transparent transparent;\\n\\t\\t\\tmargin-bottom: calc( var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\t}\\n\\n\\t&[class*=\\\"arrow_e\\\"] {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tborder-width: var(--ck-balloon-arrow-half-width) 0 var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height);\\n\\t\\t}\\n\\n\\t\\t&::before {\\n\\t\\t\\tborder-color: transparent transparent transparent var(--ck-color-panel-border);\\n\\t\\t\\tmargin-right: calc( -1 * var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\n\\t\\t&::after {\\n\\t\\t\\tborder-color: transparent transparent transparent var(--ck-color-panel-background);\\n\\t\\t\\tmargin-right: calc( var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\t}\\n\\n\\t&[class*=\\\"arrow_w\\\"] {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tborder-width: var(--ck-balloon-arrow-half-width) var(--ck-balloon-arrow-height) var(--ck-balloon-arrow-half-width) 0;\\n\\t\\t}\\n\\n\\t\\t&::before {\\n\\t\\t\\tborder-color: transparent var(--ck-color-panel-border) transparent transparent;\\n\\t\\t\\tmargin-left: calc( -1 * var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\n\\t\\t&::after {\\n\\t\\t\\tborder-color: transparent var(--ck-color-panel-background) transparent transparent;\\n\\t\\t\\tmargin-left: calc( var(--ck-balloon-arrow-offset) - var(--ck-balloon-border-width) );\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_n {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tleft: 50%;\\n\\t\\t\\tmargin-left: calc(-1 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\ttop: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_nw {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tleft: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\ttop: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_ne {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tright: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\ttop: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_s {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tleft: 50%;\\n\\t\\t\\tmargin-left: calc(-1 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_sw {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tleft: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_se {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tright: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_sme {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tright: 25%;\\n\\t\\t\\tmargin-right: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_smw {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tleft: 25%;\\n\\t\\t\\tmargin-left: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\tbottom: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_nme {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tright: 25%;\\n\\t\\t\\tmargin-right: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\ttop: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_nmw {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tleft: 25%;\\n\\t\\t\\tmargin-left: calc(2 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\ttop: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_e {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tright: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t\\tmargin-top: calc(-1 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\ttop: 50%;\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-balloon-panel_arrow_w {\\n\\t\\t&::before,\\n\\t\\t&::after {\\n\\t\\t\\tleft: calc(-1 * var(--ck-balloon-arrow-height));\\n\\t\\t\\tmargin-top: calc(-1 * var(--ck-balloon-arrow-half-width));\\n\\t\\t\\ttop: 50%;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck .ck-balloon-rotator__navigation{align-items:center;display:flex;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}.ck .ck-balloon-rotator__navigation{background:var(--ck-color-toolbar-background);border-bottom:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation>*{margin-bottom:var(--ck-spacing-small);margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-left:var(--ck-spacing-small);margin-right:var(--ck-spacing-standard)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/balloonrotator.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/balloonrotator.css\"],\"names\":[],\"mappings\":\"AAKA,oCAEC,kBAAmB,CADnB,YAAa,CAEb,sBACD,CAKA,6CACC,sBACD,CCXA,oCACC,6CAA8C,CAC9C,sDAAuD,CACvD,iCAgBD,CAbC,sCAGC,qCAAsC,CAFtC,oCAAqC,CACrC,kCAED,CAGA,iEAIC,mCAAoC,CAHpC,uCAID,CAMA,2DACC,eACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck .ck-balloon-rotator__navigation {\\n\\tdisplay: flex;\\n\\talign-items: center;\\n\\tjustify-content: center;\\n}\\n\\n/* Buttons inside a toolbar should be centered when rotator bar is wider.\\n * See: https://github.com/ckeditor/ckeditor5-ui/issues/495\\n */\\n.ck .ck-balloon-rotator__content .ck-toolbar {\\n\\tjustify-content: center;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck .ck-balloon-rotator__navigation {\\n\\tbackground: var(--ck-color-toolbar-background);\\n\\tborder-bottom: 1px solid var(--ck-color-toolbar-border);\\n\\tpadding: 0 var(--ck-spacing-small);\\n\\n\\t/* Let's keep similar appearance to `ck-toolbar`. */\\n\\t& > * {\\n\\t\\tmargin-right: var(--ck-spacing-small);\\n\\t\\tmargin-top: var(--ck-spacing-small);\\n\\t\\tmargin-bottom: var(--ck-spacing-small);\\n\\t}\\n\\n\\t/* Gives counter more breath than buttons. */\\n\\t& .ck-balloon-rotator__counter {\\n\\t\\tmargin-right: var(--ck-spacing-standard);\\n\\n\\t\\t/* We need to use smaller margin because of previous button's right margin. */\\n\\t\\tmargin-left: var(--ck-spacing-small);\\n\\t}\\n}\\n\\n.ck .ck-balloon-rotator__content {\\n\\n\\t/* Disable default annotation shadow inside rotator with fake panels. */\\n\\t& .ck.ck-annotation-wrapper {\\n\\t\\tbox-shadow: none;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-modal) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}:root{--ck-balloon-fake-panel-offset-horizontal:6px;--ck-balloon-fake-panel-offset-vertical:6px}.ck .ck-fake-panel div{background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);box-shadow:var(--ck-drop-shadow),0 0;height:100%;min-height:15px;width:100%}.ck .ck-fake-panel div:first-child{margin-left:var(--ck-balloon-fake-panel-offset-horizontal);margin-top:var(--ck-balloon-fake-panel-offset-vertical)}.ck .ck-fake-panel div:nth-child(2){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*2);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*2)}.ck .ck-fake-panel div:nth-child(3){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*3);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*3)}.ck .ck-balloon-panel_arrow_s+.ck-fake-panel,.ck .ck-balloon-panel_arrow_se+.ck-fake-panel,.ck .ck-balloon-panel_arrow_sw+.ck-fake-panel{--ck-balloon-fake-panel-offset-vertical:-6px}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/fakepanel.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/fakepanel.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\"],\"names\":[],\"mappings\":\"AAKA,mBACC,iBAAkB,CAGlB,mCACD,CAEA,uBACC,iBACD,CAEA,mCACC,SACD,CAEA,oCACC,SACD,CCfA,MACC,6CAA8C,CAC9C,2CACD,CAGA,uBAKC,2CAA4C,CAC5C,6CAA8C,CAC9C,qCAAsC,CCXtC,oCAA8B,CDc9B,WAAY,CAPZ,eAAgB,CAMhB,UAED,CAEA,mCACC,0DAA2D,CAC3D,uDACD,CAEA,oCACC,kEAAqE,CACrE,+DACD,CACA,oCACC,kEAAqE,CACrE,+DACD,CAGA,yIAGC,4CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck .ck-fake-panel {\\n\\tposition: absolute;\\n\\n\\t/* Fake panels should be placed under main balloon content. */\\n\\tz-index: calc(var(--ck-z-modal) - 1);\\n}\\n\\n.ck .ck-fake-panel div {\\n\\tposition: absolute;\\n}\\n\\n.ck .ck-fake-panel div:nth-child( 1 ) {\\n\\tz-index: 2;\\n}\\n\\n.ck .ck-fake-panel div:nth-child( 2 ) {\\n\\tz-index: 1;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_shadow.css\\\";\\n\\n:root {\\n\\t--ck-balloon-fake-panel-offset-horizontal: 6px;\\n\\t--ck-balloon-fake-panel-offset-vertical: 6px;\\n}\\n\\n/* Let's use `.ck-balloon-panel` appearance. See: balloonpanel.css. */\\n.ck .ck-fake-panel div {\\n\\t@mixin ck-drop-shadow;\\n\\n\\tmin-height: 15px;\\n\\n\\tbackground: var(--ck-color-panel-background);\\n\\tborder: 1px solid var(--ck-color-panel-border);\\n\\tborder-radius: var(--ck-border-radius);\\n\\n\\twidth: 100%;\\n\\theight: 100%;\\n}\\n\\n.ck .ck-fake-panel div:nth-child( 1 ) {\\n\\tmargin-left: var(--ck-balloon-fake-panel-offset-horizontal);\\n\\tmargin-top: var(--ck-balloon-fake-panel-offset-vertical);\\n}\\n\\n.ck .ck-fake-panel div:nth-child( 2 ) {\\n\\tmargin-left: calc(var(--ck-balloon-fake-panel-offset-horizontal) * 2);\\n\\tmargin-top: calc(var(--ck-balloon-fake-panel-offset-vertical) * 2);\\n}\\n.ck .ck-fake-panel div:nth-child( 3 ) {\\n\\tmargin-left: calc(var(--ck-balloon-fake-panel-offset-horizontal) * 3);\\n\\tmargin-top: calc(var(--ck-balloon-fake-panel-offset-vertical) * 3);\\n}\\n\\n/* If balloon is positioned above element, we need to move fake panel to the top. */\\n.ck .ck-balloon-panel_arrow_s + .ck-fake-panel,\\n.ck .ck-balloon-panel_arrow_se + .ck-fake-panel,\\n.ck .ck-balloon-panel_arrow_sw + .ck-fake-panel {\\n\\t--ck-balloon-fake-panel-offset-vertical: -6px;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{position:fixed;top:0;z-index:var(--ck-z-modal)}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{position:absolute;top:auto}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{border-top-left-radius:0;border-top-right-radius:0;border-width:0 1px 1px;box-shadow:var(--ck-drop-shadow),0 0}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/panel/stickypanel.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/panel/stickypanel.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\"],\"names\":[],\"mappings\":\"AAMC,qDAEC,cAAe,CACf,KAAM,CAFN,yBAGD,CAEA,kEAEC,iBAAkB,CADlB,QAED,CCPA,qDAIC,wBAAyB,CACzB,yBAA0B,CAF1B,sBAAuB,CCFxB,oCDKA\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-sticky-panel {\\n\\t& .ck-sticky-panel__content_sticky {\\n\\t\\tz-index: var(--ck-z-modal); /* #315 */\\n\\t\\tposition: fixed;\\n\\t\\ttop: 0;\\n\\t}\\n\\n\\t& .ck-sticky-panel__content_sticky_bottom-limit {\\n\\t\\ttop: auto;\\n\\t\\tposition: absolute;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_shadow.css\\\";\\n\\n.ck.ck-sticky-panel {\\n\\t& .ck-sticky-panel__content_sticky {\\n\\t\\t@mixin ck-drop-shadow;\\n\\n\\t\\tborder-width: 0 1px 1px;\\n\\t\\tborder-top-left-radius: 0;\\n\\t\\tborder-top-right-radius: 0;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-vertical-form .ck-button:after{bottom:-1px;content:\\\"\\\";position:absolute;right:-1px;top:-1px;width:0;z-index:1}.ck-vertical-form .ck-button:focus:after{display:none}@media screen and (max-width:600px){.ck.ck-responsive-form .ck-button:after{bottom:-1px;content:\\\"\\\";position:absolute;right:-1px;top:-1px;width:0;z-index:1}.ck.ck-responsive-form .ck-button:focus:after{display:none}}.ck-vertical-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form{padding:var(--ck-spacing-large)}.ck.ck-responsive-form:focus{outline:none}[dir=ltr] .ck.ck-responsive-form>:not(:first-child),[dir=rtl] .ck.ck-responsive-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-responsive-form{padding:0;width:calc(var(--ck-input-width)*.8)}.ck.ck-responsive-form .ck-labeled-field-view{margin:var(--ck-spacing-large) var(--ck-spacing-large) 0}.ck.ck-responsive-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-responsive-form .ck-labeled-field-view .ck-labeled-field-view__error{white-space:normal}.ck.ck-responsive-form>.ck-button:nth-last-child(2):after{border-right:1px solid var(--ck-color-base-border)}.ck.ck-responsive-form>.ck-button:last-child,.ck.ck-responsive-form>.ck-button:nth-last-child(2){border-radius:0;margin-top:var(--ck-spacing-large);padding:var(--ck-spacing-standard)}.ck.ck-responsive-form>.ck-button:last-child:not(:focus),.ck.ck-responsive-form>.ck-button:nth-last-child(2):not(:focus){border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-responsive-form>.ck-button:last-child,[dir=ltr] .ck.ck-responsive-form>.ck-button:nth-last-child(2),[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2){margin-left:0}[dir=rtl] .ck.ck-responsive-form>.ck-button:last-child:last-of-type,[dir=rtl] .ck.ck-responsive-form>.ck-button:nth-last-child(2):last-of-type{border-right:1px solid var(--ck-color-base-border)}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/responsive-form/responsiveform.css\"],\"names\":[],\"mappings\":\"AAQC,mCAMC,WAAY,CALZ,UAAW,CAEX,iBAAkB,CAClB,UAAW,CACX,QAAS,CAHT,OAAQ,CAKR,SACD,CAEA,yCACC,YACD,CCdA,oCDoBE,wCAMC,WAAY,CALZ,UAAW,CAEX,iBAAkB,CAClB,UAAW,CACX,QAAS,CAHT,OAAQ,CAKR,SACD,CAEA,8CACC,YACD,CC9BF,CCAD,qDACC,kDACD,CAEA,uBACC,+BAmED,CAjEC,6BAEC,YACD,CASC,uGACC,sCACD,CDvBD,oCCMD,uBAqBE,SAAU,CACV,oCA8CF,CA5CE,8CACC,wDAWD,CATC,6DACC,WAAY,CACZ,UACD,CAGA,4EACC,kBACD,CAKA,0DACC,kDACD,CAGD,iGAIC,eAAgB,CADhB,kCAAmC,CADnC,kCAmBD,CAfC,yHACC,gDACD,CARD,0OAeE,aAMF,CAJE,+IACC,kDACD,CDpEH\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n\\n.ck-vertical-form .ck-button {\\n\\t&::after {\\n\\t\\tcontent: \\\"\\\";\\n\\t\\twidth: 0;\\n\\t\\tposition: absolute;\\n\\t\\tright: -1px;\\n\\t\\ttop: -1px;\\n\\t\\tbottom: -1px;\\n\\t\\tz-index: 1;\\n\\t}\\n\\n\\t&:focus::after {\\n\\t\\tdisplay: none;\\n\\t}\\n}\\n\\n.ck.ck-responsive-form {\\n\\t@mixin ck-media-phone {\\n\\t\\t& .ck-button {\\n\\t\\t\\t&::after {\\n\\t\\t\\t\\tcontent: \\\"\\\";\\n\\t\\t\\t\\twidth: 0;\\n\\t\\t\\t\\tposition: absolute;\\n\\t\\t\\t\\tright: -1px;\\n\\t\\t\\t\\ttop: -1px;\\n\\t\\t\\t\\tbottom: -1px;\\n\\t\\t\\t\\tz-index: 1;\\n\\t\\t\\t}\\n\\n\\t\\t\\t&:focus::after {\\n\\t\\t\\t\\tdisplay: none;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@define-mixin ck-media-phone {\\n\\t@media screen and (max-width: 600px) {\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_rwd.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck-vertical-form > .ck-button:nth-last-child(2)::after {\\n\\tborder-right: 1px solid var(--ck-color-base-border);\\n}\\n\\n.ck.ck-responsive-form {\\n\\tpadding: var(--ck-spacing-large);\\n\\n\\t&:focus {\\n\\t\\t/* See: https://github.com/ckeditor/ckeditor5/issues/4773 */\\n\\t\\toutline: none;\\n\\t}\\n\\n\\t@mixin ck-dir ltr {\\n\\t\\t& > :not(:first-child) {\\n\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t}\\n\\t}\\n\\n\\t@mixin ck-dir rtl {\\n\\t\\t& > :not(:last-child) {\\n\\t\\t\\tmargin-left: var(--ck-spacing-standard);\\n\\t\\t}\\n\\t}\\n\\n\\t@mixin ck-media-phone {\\n\\t\\tpadding: 0;\\n\\t\\twidth: calc(.8 * var(--ck-input-width));\\n\\n\\t\\t& .ck-labeled-field-view {\\n\\t\\t\\tmargin: var(--ck-spacing-large) var(--ck-spacing-large) 0;\\n\\n\\t\\t\\t& .ck-input-text {\\n\\t\\t\\t\\tmin-width: 0;\\n\\t\\t\\t\\twidth: 100%;\\n\\t\\t\\t}\\n\\n\\t\\t\\t/* Let the long error messages wrap in the narrow form. */\\n\\t\\t\\t& .ck-labeled-field-view__error {\\n\\t\\t\\t\\twhite-space: normal;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t/* Styles for two last buttons in the form (save&cancel, edit&unlink, etc.). */\\n\\t\\t& > .ck-button:nth-last-child(2) {\\n\\t\\t\\t&::after {\\n\\t\\t\\t\\tborder-right: 1px solid var(--ck-color-base-border);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t& > .ck-button:nth-last-child(1),\\n\\t\\t& > .ck-button:nth-last-child(2) {\\n\\t\\t\\tpadding: var(--ck-spacing-standard);\\n\\t\\t\\tmargin-top: var(--ck-spacing-large);\\n\\t\\t\\tborder-radius: 0;\\n\\n\\t\\t\\t&:not(:focus) {\\n\\t\\t\\t\\tborder-top: 1px solid var(--ck-color-base-border);\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir ltr {\\n\\t\\t\\t\\tmargin-left: 0;\\n\\t\\t\\t}\\n\\n\\t\\t\\t@mixin ck-dir rtl {\\n\\t\\t\\t\\tmargin-left: 0;\\n\\n\\t\\t\\t\\t&:last-of-type {\\n\\t\\t\\t\\t\\tborder-right: 1px solid var(--ck-color-base-border);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-block-toolbar-button{position:absolute;z-index:var(--ck-z-default)}:root{--ck-color-block-toolbar-button:var(--ck-color-text);--ck-block-toolbar-button-size:var(--ck-font-size-normal)}.ck.ck-block-toolbar-button{color:var(--ck-color-block-toolbar-button);font-size:var(--ck-block-toolbar-size)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/blocktoolbar.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/toolbar/blocktoolbar.css\"],\"names\":[],\"mappings\":\"AAKA,4BACC,iBAAkB,CAClB,2BACD,CCHA,MACC,oDAAqD,CACrD,yDACD,CAEA,4BACC,0CAA2C,CAC3C,sCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-block-toolbar-button {\\n\\tposition: absolute;\\n\\tz-index: var(--ck-z-default);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-block-toolbar-button: var(--ck-color-text);\\n\\t--ck-block-toolbar-button-size: var(--ck-font-size-normal);\\n}\\n\\n.ck.ck-block-toolbar-button {\\n\\tcolor: var(--ck-color-block-toolbar-button);\\n\\tfont-size: var(--ck-block-toolbar-size);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-toolbar{align-items:center;display:flex;flex-flow:row nowrap;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-toolbar>.ck-toolbar__items{align-items:center;display:flex;flex-flow:row wrap;flex-grow:1}.ck.ck-toolbar .ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar .ck.ck-toolbar__separator:first-child,.ck.ck-toolbar .ck.ck-toolbar__separator:last-child{display:none}.ck.ck-toolbar .ck-toolbar__line-break{flex-basis:100%}.ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck-dropdown__button .ck-dropdown__arrow{display:none}.ck.ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);border:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck.ck-toolbar .ck.ck-toolbar__separator{align-self:stretch;background:var(--ck-color-toolbar-border);margin-bottom:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);min-width:1px;width:1px}.ck.ck-toolbar .ck-toolbar__line-break{height:0}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break){margin-right:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items:empty+.ck.ck-toolbar__separator{display:none}.ck.ck-toolbar>.ck-toolbar__items>:not(.ck-toolbar__line-break),.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-bottom:var(--ck-spacing-small);margin-top:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{border-radius:0;margin:0;width:100%}.ck.ck-toolbar.ck-toolbar_compact{padding:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>*{margin:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>:not(:first-child):not(:last-child){border-radius:0}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck.ck-button.ck-dropdown__button{padding-left:var(--ck-spacing-tiny)}.ck.ck-toolbar .ck-toolbar__nested-toolbar-dropdown>.ck-dropdown__panel{min-width:auto}.ck.ck-toolbar .ck-toolbar__nested-toolbar-dropdown>.ck-button>.ck-button__label{max-width:7em;width:auto}.ck.ck-toolbar:focus{outline:none}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck{margin-right:0}.ck.ck-toolbar[dir=rtl]:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-left:0}.ck.ck-toolbar.ck-toolbar_compact[dir=rtl]>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-toolbar.ck-toolbar_compact[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-bottom-right-radius:0;border-top-right-radius:0}.ck.ck-toolbar.ck-toolbar_grouping[dir=rtl]>.ck-toolbar__items:not(:empty):not(:only-child),.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-right:0}.ck.ck-toolbar.ck-toolbar_compact[dir=ltr]>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-bottom-right-radius:0;border-top-right-radius:0}.ck.ck-toolbar.ck-toolbar_compact[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-bottom-left-radius:0;border-top-left-radius:0}.ck.ck-toolbar.ck-toolbar_grouping[dir=ltr]>.ck-toolbar__items:not(:empty):not(:only-child),.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/toolbar/toolbar.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/mixins/_unselectable.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/toolbar/toolbar.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_rounded.css\"],\"names\":[],\"mappings\":\"AAOA,eAKC,kBAAmB,CAFnB,YAAa,CACb,oBAAqB,CCFrB,qBAAsB,CACtB,wBAAyB,CACzB,oBAAqB,CACrB,gBD6CD,CA3CC,kCAGC,kBAAmB,CAFnB,YAAa,CACb,kBAAmB,CAEnB,WAED,CAEA,yCACC,oBAWD,CAJC,yGAEC,YACD,CAGD,uCACC,eACD,CAEA,sDACC,gBACD,CAEA,sDACC,qBACD,CAEA,sDACC,gBACD,CAGC,yFACC,YACD,CE/CF,eCGC,eDwGD,CA3GA,qECOE,qCDoGF,CA3GA,eAGC,6CAA8C,CAE9C,+CAAgD,CADhD,iCAuGD,CApGC,yCACC,kBAAmB,CAGnB,yCAA0C,CAO1C,qCAAsC,CADtC,kCAAmC,CAPnC,aAAc,CADd,SAUD,CAEA,uCACC,QACD,CAGC,gEAEC,oCACD,CAIA,kEACC,YACD,CAGD,gHAIC,qCAAsC,CADtC,kCAED,CAEA,mCAEC,SAaD,CAVC,0DAQC,eAAgB,CAHhB,QAAS,CAHT,UAOD,CAGD,kCAEC,SAWD,CATC,uDAEC,QAMD,CAHC,yFACC,eACD,CASD,kFACC,mCACD,CAMA,wEACC,cACD,CAEA,iFACC,aAAc,CACd,UACD,CAGD,qBACC,YACD,CAtGD,qCAyGE,QAEF,CAYC,+FACC,cACD,CAEA,iJAEC,mCACD,CAEA,qHACC,aACD,CAIC,6JAEC,2BAA4B,CAD5B,wBAED,CAGA,2JAEC,4BAA6B,CAD7B,yBAED,CASD,8RACC,mCACD,CAWA,qHACC,cACD,CAIC,6JAEC,4BAA6B,CAD7B,yBAED,CAGA,2JAEC,2BAA4B,CAD5B,wBAED,CASD,8RACC,oCACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../mixins/_unselectable.css\\\";\\n\\n.ck.ck-toolbar {\\n\\t@mixin ck-unselectable;\\n\\n\\tdisplay: flex;\\n\\tflex-flow: row nowrap;\\n\\talign-items: center;\\n\\n\\t& > .ck-toolbar__items {\\n\\t\\tdisplay: flex;\\n\\t\\tflex-flow: row wrap;\\n\\t\\talign-items: center;\\n\\t\\tflex-grow: 1;\\n\\n\\t}\\n\\n\\t& .ck.ck-toolbar__separator {\\n\\t\\tdisplay: inline-block;\\n\\n\\t\\t/*\\n\\t\\t * A leading or trailing separator makes no sense (separates from nothing on one side).\\n\\t\\t * For instance, it can happen when toolbar items (also separators) are getting grouped one by one and\\n\\t\\t * moved to another toolbar in the dropdown.\\n\\t\\t */\\n\\t\\t&:first-child,\\n\\t\\t&:last-child {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n\\n\\t& .ck-toolbar__line-break {\\n\\t\\tflex-basis: 100%;\\n\\t}\\n\\n\\t&.ck-toolbar_grouping > .ck-toolbar__items {\\n\\t\\tflex-wrap: nowrap;\\n\\t}\\n\\n\\t&.ck-toolbar_vertical > .ck-toolbar__items {\\n\\t\\tflex-direction: column;\\n\\t}\\n\\n\\t&.ck-toolbar_floating > .ck-toolbar__items {\\n\\t\\tflex-wrap: nowrap;\\n\\t}\\n\\n\\t& > .ck.ck-toolbar__grouped-dropdown {\\n\\t\\t& > .ck-dropdown__button .ck-dropdown__arrow {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Makes element unselectable.\\n */\\n@define-mixin ck-unselectable {\\n\\t-moz-user-select: none;\\n\\t-webkit-user-select: none;\\n\\t-ms-user-select: none;\\n\\tuser-select: none\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n@import \\\"@ckeditor/ckeditor5-ui/theme/mixins/_dir.css\\\";\\n\\n.ck.ck-toolbar {\\n\\t@mixin ck-rounded-corners;\\n\\n\\tbackground: var(--ck-color-toolbar-background);\\n\\tpadding: 0 var(--ck-spacing-small);\\n\\tborder: 1px solid var(--ck-color-toolbar-border);\\n\\n\\t& .ck.ck-toolbar__separator {\\n\\t\\talign-self: stretch;\\n\\t\\twidth: 1px;\\n\\t\\tmin-width: 1px;\\n\\t\\tbackground: var(--ck-color-toolbar-border);\\n\\n\\t\\t/*\\n\\t\\t * These margins make the separators look better in balloon toolbars (when aligned with the \\\"tip\\\").\\n\\t\\t * See https://github.com/ckeditor/ckeditor5/issues/7493.\\n\\t\\t */\\n\\t\\tmargin-top: var(--ck-spacing-small);\\n\\t\\tmargin-bottom: var(--ck-spacing-small);\\n\\t}\\n\\n\\t& .ck-toolbar__line-break {\\n\\t\\theight: 0;\\n\\t}\\n\\n\\t& > .ck-toolbar__items {\\n\\t\\t& > *:not(.ck-toolbar__line-break) {\\n\\t\\t\\t/* (#11) Separate toolbar items. */\\n\\t\\t\\tmargin-right: var(--ck-spacing-small);\\n\\t\\t}\\n\\n\\t\\t/* Don't display a separator after an empty items container, for instance,\\n\\t\\twhen all items were grouped */\\n\\t\\t&:empty + .ck.ck-toolbar__separator {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t}\\n\\n\\t& > .ck-toolbar__items > *:not(.ck-toolbar__line-break),\\n\\t& > .ck.ck-toolbar__grouped-dropdown {\\n\\t\\t/* Make sure items wrapped to the next line have v-spacing */\\n\\t\\tmargin-top: var(--ck-spacing-small);\\n\\t\\tmargin-bottom: var(--ck-spacing-small);\\n\\t}\\n\\n\\t&.ck-toolbar_vertical {\\n\\t\\t/* Items in a vertical toolbar span the entire width. */\\n\\t\\tpadding: 0;\\n\\n\\t\\t/* Specificity matters here. See https://github.com/ckeditor/ckeditor5-theme-lark/issues/168. */\\n\\t\\t& > .ck-toolbar__items > .ck {\\n\\t\\t\\t/* Items in a vertical toolbar should span the horizontal space. */\\n\\t\\t\\twidth: 100%;\\n\\n\\t\\t\\t/* Items in a vertical toolbar should have no margin. */\\n\\t\\t\\tmargin: 0;\\n\\n\\t\\t\\t/* Items in a vertical toolbar span the entire width so rounded corners are pointless. */\\n\\t\\t\\tborder-radius: 0;\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-toolbar_compact {\\n\\t\\t/* No spacing around items. */\\n\\t\\tpadding: 0;\\n\\n\\t\\t& > .ck-toolbar__items > * {\\n\\t\\t\\t/* Compact toolbar items have no spacing between them. */\\n\\t\\t\\tmargin: 0;\\n\\n\\t\\t\\t/* \\\"Middle\\\" children should have no rounded corners. */\\n\\t\\t\\t&:not(:first-child):not(:last-child) {\\n\\t\\t\\t\\tborder-radius: 0;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t& > .ck.ck-toolbar__grouped-dropdown {\\n\\t\\t/*\\n\\t\\t * Dropdown button has asymmetric padding to fit the arrow.\\n\\t\\t * This button has no arrow so let's revert that padding back to normal.\\n\\t\\t */\\n\\t\\t& > .ck.ck-button.ck-dropdown__button {\\n\\t\\t\\tpadding-left: var(--ck-spacing-tiny);\\n\\t\\t}\\n\\t}\\n\\n\\t/* A drop-down containing the nested toolbar with configured items. */\\n\\t& .ck-toolbar__nested-toolbar-dropdown {\\n\\t\\t/* Prevent empty space in the panel when the dropdown label is visible and long but the toolbar has few items. */\\n\\t\\t& > .ck-dropdown__panel {\\n\\t\\t\\tmin-width: auto;\\n\\t\\t}\\n\\n\\t\\t& > .ck-button > .ck-button__label {\\n\\t\\t\\tmax-width: 7em;\\n\\t\\t\\twidth: auto;\\n\\t\\t}\\n\\t}\\n\\n\\t&:focus {\\n\\t\\toutline: none;\\n\\t}\\n\\n\\t@nest .ck-toolbar-container & {\\n\\t\\tborder: 0;\\n\\t}\\n}\\n\\n/* stylelint-disable */\\n\\n/*\\n * Styles for RTL toolbars.\\n *\\n * Note: In some cases (e.g. a decoupled editor), the toolbar has its own \\\"dir\\\"\\n * because its parent is not controlled by the editor framework.\\n */\\n[dir=\\\"rtl\\\"] .ck.ck-toolbar,\\n.ck.ck-toolbar[dir=\\\"rtl\\\"] {\\n\\t& > .ck-toolbar__items > .ck {\\n\\t\\tmargin-right: 0;\\n\\t}\\n\\n\\t&:not(.ck-toolbar_compact) > .ck-toolbar__items > .ck {\\n\\t\\t/* (#11) Separate toolbar items. */\\n\\t\\tmargin-left: var(--ck-spacing-small);\\n\\t}\\n\\n\\t& > .ck-toolbar__items > .ck:last-child {\\n\\t\\tmargin-left: 0;\\n\\t}\\n\\n\\t&.ck-toolbar_compact > .ck-toolbar__items > .ck {\\n\\t\\t/* No rounded corners on the right side of the first child. */\\n\\t\\t&:first-child {\\n\\t\\t\\tborder-top-left-radius: 0;\\n\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t}\\n\\n\\t\\t/* No rounded corners on the left side of the last child. */\\n\\t\\t&:last-child {\\n\\t\\t\\tborder-top-right-radius: 0;\\n\\t\\t\\tborder-bottom-right-radius: 0;\\n\\t\\t}\\n\\t}\\n\\n\\t/* Separate the the separator form the grouping dropdown when some items are grouped. */\\n\\t& > .ck.ck-toolbar__separator {\\n\\t\\tmargin-left: var(--ck-spacing-small);\\n\\t}\\n\\n\\t/* Some spacing between the items and the separator before the grouped items dropdown. */\\n\\t&.ck-toolbar_grouping > .ck-toolbar__items:not(:empty):not(:only-child) {\\n\\t\\tmargin-left: var(--ck-spacing-small);\\n\\t}\\n}\\n\\n/*\\n * Styles for LTR toolbars.\\n *\\n * Note: In some cases (e.g. a decoupled editor), the toolbar has its own \\\"dir\\\"\\n * because its parent is not controlled by the editor framework.\\n */\\n[dir=\\\"ltr\\\"] .ck.ck-toolbar,\\n.ck.ck-toolbar[dir=\\\"ltr\\\"] {\\n\\t& > .ck-toolbar__items > .ck:last-child {\\n\\t\\tmargin-right: 0;\\n\\t}\\n\\n\\t&.ck-toolbar_compact > .ck-toolbar__items > .ck {\\n\\t\\t/* No rounded corners on the right side of the first child. */\\n\\t\\t&:first-child {\\n\\t\\t\\tborder-top-right-radius: 0;\\n\\t\\t\\tborder-bottom-right-radius: 0;\\n\\t\\t}\\n\\n\\t\\t/* No rounded corners on the left side of the last child. */\\n\\t\\t&:last-child {\\n\\t\\t\\tborder-top-left-radius: 0;\\n\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t}\\n\\t}\\n\\n\\t/* Separate the the separator form the grouping dropdown when some items are grouped. */\\n\\t& > .ck.ck-toolbar__separator {\\n\\t\\tmargin-right: var(--ck-spacing-small);\\n\\t}\\n\\n\\t/* Some spacing between the items and the separator before the grouped items dropdown. */\\n\\t&.ck-toolbar_grouping > .ck-toolbar__items:not(:empty):not(:only-child) {\\n\\t\\tmargin-right: var(--ck-spacing-small);\\n\\t}\\n}\\n\\n/* stylelint-enable */\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Implements rounded corner interface for .ck-rounded-corners class.\\n *\\n * @see $ck-border-radius\\n */\\n@define-mixin ck-rounded-corners {\\n\\tborder-radius: 0;\\n\\n\\t@nest .ck-rounded-corners &,\\n\\t&.ck-rounded-corners {\\n\\t\\tborder-radius: var(--ck-border-radius);\\n\\t\\t@mixin-content;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck.ck-balloon-panel.ck-tooltip{--ck-balloon-border-width:0px;--ck-balloon-arrow-offset:0px;--ck-balloon-arrow-half-width:4px;--ck-balloon-arrow-height:4px;--ck-color-panel-background:var(--ck-color-tooltip-background);padding:0 var(--ck-spacing-medium);pointer-events:none;z-index:calc(var(--ck-z-modal) + 100)}.ck.ck-balloon-panel.ck-tooltip .ck-tooltip__text{color:var(--ck-color-tooltip-text);font-size:.9em;line-height:1.5}.ck.ck-balloon-panel.ck-tooltip{box-shadow:none}.ck.ck-balloon-panel.ck-tooltip:before{display:none}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/components/tooltip/tooltip.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/components/tooltip/tooltip.css\"],\"names\":[],\"mappings\":\"AAKA,gCCGC,6BAA8B,CAC9B,6BAA8B,CAC9B,iCAAkC,CAClC,6BAA8B,CAC9B,8DAA+D,CAE/D,kCAAmC,CDPnC,mBAAoB,CAEpB,qCACD,CCMC,kDAGC,kCAAmC,CAFnC,cAAe,CACf,eAED,CAbD,gCAgBC,eAMD,CAHC,uCACC,YACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-balloon-panel.ck-tooltip {\\n\\t/* Keep tooltips transparent for any interactions. */\\n\\tpointer-events: none;\\n\\n\\tz-index: calc( var(--ck-z-modal) + 100 );\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../../../mixins/_rounded.css\\\";\\n\\n.ck.ck-balloon-panel.ck-tooltip {\\n\\t--ck-balloon-border-width: 0px;\\n\\t--ck-balloon-arrow-offset: 0px;\\n\\t--ck-balloon-arrow-half-width: 4px;\\n\\t--ck-balloon-arrow-height: 4px;\\n\\t--ck-color-panel-background: var(--ck-color-tooltip-background);\\n\\n\\tpadding: 0 var(--ck-spacing-medium);\\n\\n\\t& .ck-tooltip__text {\\n\\t\\tfont-size: .9em;\\n\\t\\tline-height: 1.5;\\n\\t\\tcolor: var(--ck-color-tooltip-text);\\n\\t}\\n\\n\\t/* Reset balloon panel styles */\\n\\tbox-shadow: none;\\n\\n\\t/* Hide the default shadow of the .ck-balloon-panel tip */\\n\\t&::before {\\n\\t\\tdisplay: none;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck-hidden{display:none!important}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset,.ck.ck-reset_all{box-sizing:border-box;height:auto;position:static;width:auto}:root{--ck-z-default:1;--ck-z-modal:calc(var(--ck-z-default) + 999)}.ck-transitions-disabled,.ck-transitions-disabled *{transition:none!important}:root{--ck-powered-by-line-height:10px;--ck-powered-by-padding-vertical:2px;--ck-powered-by-padding-horizontal:4px;--ck-powered-by-text-color:#4f4f4f;--ck-powered-by-border-radius:var(--ck-border-radius);--ck-powered-by-background:#fff;--ck-powered-by-border-color:var(--ck-color-focus-border)}.ck.ck-balloon-panel.ck-powered-by-balloon{--ck-border-radius:var(--ck-powered-by-border-radius);background:var(--ck-powered-by-background);border:0;box-shadow:none;min-height:unset}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by{line-height:var(--ck-powered-by-line-height)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by a{align-items:center;cursor:pointer;display:flex;filter:grayscale(80%);line-height:var(--ck-powered-by-line-height);opacity:.66;padding:var(--ck-powered-by-padding-vertical) var(--ck-powered-by-padding-horizontal)}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by .ck-powered-by__label{color:var(--ck-powered-by-text-color);cursor:pointer;font-size:7.5px;font-weight:700;letter-spacing:-.2px;line-height:normal;margin-right:4px;padding-left:2px;text-transform:uppercase}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by .ck-icon{cursor:pointer;display:block}.ck.ck-balloon-panel.ck-powered-by-balloon .ck.ck-powered-by:hover a{filter:grayscale(0);opacity:1}.ck.ck-balloon-panel.ck-powered-by-balloon[class*=position_border]{border:var(--ck-focus-ring);border-color:var(--ck-powered-by-border-color)}:root{--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#ccced1;--ck-color-base-action:#53a336;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#2977ff;--ck-color-base-active-focus:#0d65ff;--ck-color-base-error:#db3700;--ck-color-focus-border-coordinates:218,81.8%,56.9%;--ck-color-focus-border:hsl(var(--ck-color-focus-border-coordinates));--ck-color-focus-outer-shadow:#cae1fc;--ck-color-focus-disabled-shadow:rgba(119,186,248,.3);--ck-color-focus-error-shadow:rgba(255,64,31,.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,.15);--ck-color-shadow-drop-active:rgba(0,0,0,.2);--ck-color-shadow-inner:rgba(0,0,0,.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#f0f0f0;--ck-color-button-default-active-background:#f0f0f0;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#f0f7ff;--ck-color-button-on-hover-background:#dbecff;--ck-color-button-on-active-background:#dbecff;--ck-color-button-on-disabled-background:#f0f2f4;--ck-color-button-on-color:#2977ff;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#4d9d30;--ck-color-button-action-active-background:#4d9d30;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#939393;--ck-color-switch-button-off-hover-background:#7d7d7d;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-on-hover-background:#4d9d30;--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-switch-button-inner-shadow:rgba(0,0,0,.1);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:var(--ck-color-base-border);--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:var(--ck-color-base-border);--ck-color-input-disabled-text:#757575;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-button-on-color);--ck-color-list-button-on-background-focus:var(--ck-color-button-on-color);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-background);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,176,255,.1);--ck-color-link-fake-selection:rgba(31,176,255,.3);--ck-color-highlight-background:#ff0;--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset,.ck.ck-reset_all{word-wrap:break-word;background:transparent;border:0;margin:0;padding:0;text-decoration:none;transition:none;vertical-align:middle}.ck-reset_all :not(.ck-reset_all-excluded *),.ck.ck-reset_all{border-collapse:collapse;color:var(--ck-color-text);cursor:auto;float:none;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);text-align:left;white-space:nowrap}.ck-reset_all .ck-rtl :not(.ck-reset_all-excluded *){text-align:right}.ck-reset_all iframe:not(.ck-reset_all-excluded *){vertical-align:inherit}.ck-reset_all textarea:not(.ck-reset_all-excluded *){white-space:pre-wrap}.ck-reset_all input[type=password]:not(.ck-reset_all-excluded *),.ck-reset_all input[type=text]:not(.ck-reset_all-excluded *),.ck-reset_all textarea:not(.ck-reset_all-excluded *){cursor:text}.ck-reset_all input[type=password][disabled]:not(.ck-reset_all-excluded *),.ck-reset_all input[type=text][disabled]:not(.ck-reset_all-excluded *),.ck-reset_all textarea[disabled]:not(.ck-reset_all-excluded *){cursor:default}.ck-reset_all fieldset:not(.ck-reset_all-excluded *){border:2px groove #dfdee3;padding:10px}.ck-reset_all button:not(.ck-reset_all-excluded *)::-moz-focus-inner{border:0;padding:0}.ck[dir=rtl],.ck[dir=rtl] .ck{text-align:right}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_hidden.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_reset.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_zindex.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_transition.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-ui/theme/globals/_poweredby.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_colors.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_disabled.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_focus.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_fonts.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_reset.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_rounded.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_shadow.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-ui/globals/_spacing.css\"],\"names\":[],\"mappings\":\"AAQA,WAGC,sBACD,CCPA,2EAGC,qBAAsB,CAEtB,WAAY,CACZ,eAAgB,CAFhB,UAGD,CCPA,MACC,gBAAiB,CACjB,4CACD,CCAA,oDAEC,yBACD,CCNA,MACC,gCAAiC,CACjC,oCAAqC,CACrC,sCAAuC,CACvC,kCAA2C,CAC3C,qDAAsD,CACtD,+BAA4C,CAC5C,yDACD,CAEA,2CACC,qDAAsD,CAItD,0CAA2C,CAF3C,QAAS,CACT,eAAgB,CAEhB,gBA6CD,CA3CC,6DACC,4CAoCD,CAlCC,+DAGC,kBAAmB,CAFnB,cAAe,CACf,YAAa,CAGb,qBAAsB,CACtB,4CAA6C,CAF7C,WAAY,CAGZ,qFACD,CAEA,mFASC,qCAAsC,CAFtC,cAAe,CANf,eAAgB,CAIhB,eAAiB,CAHjB,oBAAqB,CAMrB,kBAAmB,CAFnB,gBAAiB,CAHjB,gBAAiB,CACjB,wBAOD,CAEA,sEAEC,cAAe,CADf,aAED,CAGC,qEACC,mBAAqB,CACrB,SACD,CAIF,mEACC,2BAA4B,CAC5B,8CACD,CC5DD,MACC,kCAAmD,CACnD,+BAAoD,CACpD,8BAAkD,CAClD,8BAAuD,CACvD,6BAAmD,CACnD,yBAA+C,CAC/C,8BAAsD,CACtD,oCAA4D,CAC5D,6BAAkD,CAIlD,mDAA4D,CAC5D,qEAA+E,CAC/E,qCAA4D,CAC5D,qDAA8D,CAC9D,gDAAyD,CACzD,yCAAqD,CACrD,sCAAsD,CACtD,4CAA0D,CAC1D,sCAAsD,CAItD,gDAAuD,CACvD,kDAAiE,CACjE,m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DAEC,yBAAoC,CADpC,YAED,CAEA,qEAGC,QAAQ,CADR,SAED,CAMD,8BAEC,gBACD,CCnFA,MACC,sBAAuB,CCAvB,gEAAiE,CAKjE,0DAA2D,CAK3D,wEAAyE,CCbzE,uBAA8B,CAC9B,mDAA2D,CAC3D,4CAAkD,CAClD,oDAA4D,CAC5D,mDAA2D,CAC3D,kDAA2D,CAC3D,yDFFD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A class which hides an element in DOM.\\n */\\n.ck-hidden {\\n\\t/* Override selector specificity. Otherwise, all elements with some display\\n\\tstyle defined will override this one, which is not a desired result. */\\n\\tdisplay: none !important;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck.ck-reset,\\n.ck.ck-reset_all,\\n.ck-reset_all *:not(.ck-reset_all-excluded *) {\\n\\tbox-sizing: border-box;\\n\\twidth: auto;\\n\\theight: auto;\\n\\tposition: static;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-z-default: 1;\\n\\t--ck-z-modal: calc( var(--ck-z-default) + 999 );\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A class that disables all transitions of the element and its children.\\n */\\n.ck-transitions-disabled,\\n.ck-transitions-disabled * {\\n\\ttransition: none !important;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-powered-by-line-height: 10px;\\n\\t--ck-powered-by-padding-vertical: 2px;\\n\\t--ck-powered-by-padding-horizontal: 4px;\\n\\t--ck-powered-by-text-color: hsl(0, 0%, 31%);\\n\\t--ck-powered-by-border-radius: var(--ck-border-radius);\\n\\t--ck-powered-by-background: hsl(0, 0%, 100%);\\n\\t--ck-powered-by-border-color: var(--ck-color-focus-border);\\n}\\n\\n.ck.ck-balloon-panel.ck-powered-by-balloon {\\n\\t--ck-border-radius: var(--ck-powered-by-border-radius);\\n\\n\\tborder: 0;\\n\\tbox-shadow: none;\\n\\tbackground: var(--ck-powered-by-background);\\n\\tmin-height: unset;\\n\\n\\t& .ck.ck-powered-by {\\n\\t\\tline-height: var(--ck-powered-by-line-height);\\n\\n\\t\\t& a {\\n\\t\\t\\tcursor: pointer;\\n\\t\\t\\tdisplay: flex;\\n\\t\\t\\talign-items: center;\\n\\t\\t\\topacity: .66;\\n\\t\\t\\tfilter: grayscale(80%);\\n\\t\\t\\tline-height: var(--ck-powered-by-line-height);\\n\\t\\t\\tpadding: var(--ck-powered-by-padding-vertical) var(--ck-powered-by-padding-horizontal);\\n\\t\\t}\\n\\n\\t\\t& .ck-powered-by__label {\\n\\t\\t\\tfont-size: 7.5px;\\n\\t\\t\\tletter-spacing: -.2px;\\n\\t\\t\\tpadding-left: 2px;\\n\\t\\t\\ttext-transform: uppercase;\\n\\t\\t\\tfont-weight: bold;\\n\\t\\t\\tmargin-right: 4px;\\n\\t\\t\\tcursor: pointer;\\n\\t\\t\\tline-height: normal;\\n\\t\\t\\tcolor: var(--ck-powered-by-text-color);\\n\\n\\t\\t}\\n\\n\\t\\t& .ck-icon {\\n\\t\\t\\tdisplay: block;\\n\\t\\t\\tcursor: pointer;\\n\\t\\t}\\n\\n\\t\\t&:hover {\\n\\t\\t\\t& a {\\n\\t\\t\\t\\tfilter: grayscale(0%);\\n\\t\\t\\t\\topacity: 1;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t&[class*=\\\"position_border\\\"] {\\n\\t\\tborder: var(--ck-focus-ring);\\n\\t\\tborder-color: var(--ck-powered-by-border-color);\\n\\t}\\n}\\n\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-base-foreground: \\t\\t\\t\\t\\t\\t\\t\\thsl(0, 0%, 98%);\\n\\t--ck-color-base-background: \\t\\t\\t\\t\\t\\t\\t\\thsl(0, 0%, 100%);\\n\\t--ck-color-base-border: \\t\\t\\t\\t\\t\\t\\t\\t\\thsl(220, 6%, 81%);\\n\\t--ck-color-base-action: \\t\\t\\t\\t\\t\\t\\t\\t\\thsl(104, 50.2%, 42.5%);\\n\\t--ck-color-base-focus: \\t\\t\\t\\t\\t\\t\\t\\t\\t\\thsl(209, 92%, 70%);\\n\\t--ck-color-base-text: \\t\\t\\t\\t\\t\\t\\t\\t\\t\\thsl(0, 0%, 20%);\\n\\t--ck-color-base-active: \\t\\t\\t\\t\\t\\t\\t\\t\\thsl(218.1, 100%, 58%);\\n\\t--ck-color-base-active-focus:\\t\\t\\t\\t\\t\\t\\t\\thsl(218.2, 100%, 52.5%);\\n\\t--ck-color-base-error:\\t\\t\\t\\t\\t\\t\\t\\t\\t\\thsl(15, 100%, 43%);\\n\\n\\t/* -- Generic colors ------------------------------------------------------------------------ */\\n\\n\\t--ck-color-focus-border-coordinates: \\t\\t\\t\\t\\t\\t218, 81.8%, 56.9%;\\n\\t--ck-color-focus-border: \\t\\t\\t\\t\\t\\t\\t\\t\\thsl(var(--ck-color-focus-border-coordinates));\\n\\t--ck-color-focus-outer-shadow:\\t\\t\\t\\t\\t\\t\\t\\thsl(212.4, 89.3%, 89%);\\n\\t--ck-color-focus-disabled-shadow:\\t\\t\\t\\t\\t\\t\\thsla(209, 90%, 72%,.3);\\n\\t--ck-color-focus-error-shadow:\\t\\t\\t\\t\\t\\t\\t\\thsla(9,100%,56%,.3);\\n\\t--ck-color-text: \\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-text);\\n\\t--ck-color-shadow-drop: \\t\\t\\t\\t\\t\\t\\t\\t\\thsla(0, 0%, 0%, 0.15);\\n\\t--ck-color-shadow-drop-active:\\t\\t\\t\\t\\t\\t\\t\\thsla(0, 0%, 0%, 0.2);\\n\\t--ck-color-shadow-inner: \\t\\t\\t\\t\\t\\t\\t\\t\\thsla(0, 0%, 0%, 0.1);\\n\\n\\t/* -- Buttons ------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-button-default-background: \\t\\t\\t\\t\\t\\ttransparent;\\n\\t--ck-color-button-default-hover-background: \\t\\t\\t\\thsl(0, 0%, 94.1%);\\n\\t--ck-color-button-default-active-background: \\t\\t\\t\\thsl(0, 0%, 94.1%);\\n\\t--ck-color-button-default-disabled-background: \\t\\t\\t\\ttransparent;\\n\\n\\t--ck-color-button-on-background: \\t\\t\\t\\t\\t\\t\\thsl(212, 100%, 97.1%);\\n\\t--ck-color-button-on-hover-background: \\t\\t\\t\\t\\t\\thsl(211.7, 100%, 92.9%);\\n\\t--ck-color-button-on-active-background: \\t\\t\\t\\t\\thsl(211.7, 100%, 92.9%);\\n\\t--ck-color-button-on-disabled-background: \\t\\t\\t\\t\\thsl(211, 15%, 95%);\\n\\t--ck-color-button-on-color:\\t\\t\\t\\t\\t\\t\\t\\t\\thsl(218.1, 100%, 58%);\\n\\n\\n\\t--ck-color-button-action-background: \\t\\t\\t\\t\\t\\tvar(--ck-color-base-action);\\n\\t--ck-color-button-action-hover-background: \\t\\t\\t\\t\\thsl(104, 53.2%, 40.2%);\\n\\t--ck-color-button-action-active-background: \\t\\t\\t\\thsl(104, 53.2%, 40.2%);\\n\\t--ck-color-button-action-disabled-background: \\t\\t\\t\\thsl(104, 44%, 58%);\\n\\t--ck-color-button-action-text: \\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\n\\t--ck-color-button-save: \\t\\t\\t\\t\\t\\t\\t\\t\\thsl(120, 100%, 27%);\\n\\t--ck-color-button-cancel: \\t\\t\\t\\t\\t\\t\\t\\t\\thsl(15, 100%, 43%);\\n\\n\\t--ck-color-switch-button-off-background:\\t\\t\\t\\t\\thsl(0, 0%, 57.6%);\\n\\t--ck-color-switch-button-off-hover-background:\\t\\t\\t\\thsl(0, 0%, 49%);\\n\\t--ck-color-switch-button-on-background:\\t\\t\\t\\t\\t\\tvar(--ck-color-button-action-background);\\n\\t--ck-color-switch-button-on-hover-background:\\t\\t\\t\\thsl(104, 53.2%, 40.2%);\\n\\t--ck-color-switch-button-inner-background:\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\t--ck-color-switch-button-inner-shadow:\\t\\t\\t\\t\\t\\thsla(0, 0%, 0%, 0.1);\\n\\n\\t/* -- Dropdown ------------------------------------------------------------------------------ */\\n\\n\\t--ck-color-dropdown-panel-background: \\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\t--ck-color-dropdown-panel-border: \\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-border);\\n\\n\\t/* -- Input --------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-input-background: \\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\t--ck-color-input-border: \\t\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-border);\\n\\t--ck-color-input-error-border:\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-error);\\n\\t--ck-color-input-text: \\t\\t\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-text);\\n\\t--ck-color-input-disabled-background: \\t\\t\\t\\t\\t\\thsl(0, 0%, 95%);\\n\\t--ck-color-input-disabled-border: \\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-border);\\n\\t--ck-color-input-disabled-text: \\t\\t\\t\\t\\t\\t\\thsl(0, 0%, 46%);\\n\\n\\t/* -- List ---------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-list-background: \\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\t--ck-color-list-button-hover-background: \\t\\t\\t\\t\\tvar(--ck-color-button-default-hover-background);\\n\\t--ck-color-list-button-on-background: \\t\\t\\t\\t\\t\\tvar(--ck-color-button-on-color);\\n\\t--ck-color-list-button-on-background-focus: \\t\\t\\t\\tvar(--ck-color-button-on-color);\\n\\t--ck-color-list-button-on-text:\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\n\\t/* -- Panel --------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-panel-background: \\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\t--ck-color-panel-border: \\t\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-border);\\n\\n\\t/* -- Toolbar ------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-toolbar-background: \\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\t--ck-color-toolbar-border: \\t\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-border);\\n\\n\\t/* -- Tooltip ------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-tooltip-background: \\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-text);\\n\\t--ck-color-tooltip-text: \\t\\t\\t\\t\\t\\t\\t\\t\\tvar(--ck-color-base-background);\\n\\n\\t/* -- Engine -------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-engine-placeholder-text: \\t\\t\\t\\t\\t\\thsl(0, 0%, 44%);\\n\\n\\t/* -- Upload -------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-upload-bar-background:\\t\\t \\t\\t\\t\\t\\thsl(209, 92%, 70%);\\n\\n\\t/* -- Link -------------------------------------------------------------------------------- */\\n\\n\\t--ck-color-link-default:\\t\\t\\t\\t\\t\\t\\t\\t\\thsl(240, 100%, 47%);\\n\\t--ck-color-link-selected-background:\\t\\t\\t\\t\\t\\thsla(201, 100%, 56%, 0.1);\\n\\t--ck-color-link-fake-selection:\\t\\t\\t\\t\\t\\t\\t\\thsla(201, 100%, 56%, 0.3);\\n\\n\\t/* -- Search result highlight ---------------------------------------------------------------- */\\n\\n\\t--ck-color-highlight-background:\\t\\t\\t\\t\\t\\t\\thsl(60, 100%, 50%)\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t/**\\n\\t * An opacity value of disabled UI item.\\n\\t */\\n\\t--ck-disabled-opacity: .5;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t/**\\n\\t * The geometry of the of focused element's outer shadow.\\n\\t */\\n\\t--ck-focus-outer-shadow-geometry: 0 0 0 3px;\\n\\n\\t/**\\n\\t * A visual style of focused element's outer shadow.\\n\\t */\\n\\t--ck-focus-outer-shadow: var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-outer-shadow);\\n\\n\\t/**\\n\\t * A visual style of focused element's outer shadow (when disabled).\\n\\t */\\n\\t--ck-focus-disabled-outer-shadow: var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);\\n\\n\\t/**\\n\\t * A visual style of focused element's outer shadow (when has errors).\\n\\t */\\n\\t--ck-focus-error-outer-shadow: var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);\\n\\n\\t/**\\n\\t * A visual style of focused element's border or outline.\\n\\t */\\n\\t--ck-focus-ring: 1px solid var(--ck-color-focus-border);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-font-size-base: 13px;\\n\\t--ck-line-height-base: 1.84615;\\n\\t--ck-font-face: Helvetica, Arial, Tahoma, Verdana, Sans-Serif;\\n\\n\\t--ck-font-size-tiny: 0.7em;\\n\\t--ck-font-size-small: 0.75em;\\n\\t--ck-font-size-normal: 1em;\\n\\t--ck-font-size-big: 1.4em;\\n\\t--ck-font-size-large: 1.8em;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t/* This is super-important. This is **manually** adjusted so a button without an icon\\n\\tis never smaller than a button with icon, additionally making sure that text-less buttons\\n\\tare perfect squares. The value is also shared by other components which should stay \\\"in-line\\\"\\n\\twith buttons. */\\n\\t--ck-ui-component-min-height: 2.3em;\\n}\\n\\n/**\\n * Resets an element, ignoring its children.\\n */\\n.ck.ck-reset,\\n.ck.ck-reset_all,\\n.ck-reset_all *:not(.ck-reset_all-excluded *) {\\n\\t/* Do not include inheritable rules here. */\\n\\tmargin: 0;\\n\\tpadding: 0;\\n\\tborder: 0;\\n\\tbackground: transparent;\\n\\ttext-decoration: none;\\n\\tvertical-align: middle;\\n\\ttransition: none;\\n\\n\\t/* https://github.com/ckeditor/ckeditor5-theme-lark/issues/105 */\\n\\tword-wrap: break-word;\\n}\\n\\n/**\\n * Resets an element AND its children.\\n */\\n.ck.ck-reset_all,\\n.ck-reset_all *:not(.ck-reset_all-excluded *) {\\n\\t/* These are rule inherited by all children elements. */\\n\\tborder-collapse: collapse;\\n\\tfont: normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);\\n\\tcolor: var(--ck-color-text);\\n\\ttext-align: left;\\n\\twhite-space: nowrap;\\n\\tcursor: auto;\\n\\tfloat: none;\\n}\\n\\n.ck-reset_all {\\n\\t& .ck-rtl *:not(.ck-reset_all-excluded *) {\\n\\t\\ttext-align: right;\\n\\t}\\n\\n\\t& iframe:not(.ck-reset_all-excluded *) {\\n\\t\\t/* For IE */\\n\\t\\tvertical-align: inherit;\\n\\t}\\n\\n\\t& textarea:not(.ck-reset_all-excluded *) {\\n\\t\\twhite-space: pre-wrap;\\n\\t}\\n\\n\\t& textarea:not(.ck-reset_all-excluded *),\\n\\t& input[type=\\\"text\\\"]:not(.ck-reset_all-excluded *),\\n\\t& input[type=\\\"password\\\"]:not(.ck-reset_all-excluded *) {\\n\\t\\tcursor: text;\\n\\t}\\n\\n\\t& textarea[disabled]:not(.ck-reset_all-excluded *),\\n\\t& input[type=\\\"text\\\"][disabled]:not(.ck-reset_all-excluded *),\\n\\t& input[type=\\\"password\\\"][disabled]:not(.ck-reset_all-excluded *) {\\n\\t\\tcursor: default;\\n\\t}\\n\\n\\t& fieldset:not(.ck-reset_all-excluded *) {\\n\\t\\tpadding: 10px;\\n\\t\\tborder: 2px groove hsl(255, 7%, 88%);\\n\\t}\\n\\n\\t& button:not(.ck-reset_all-excluded *)::-moz-focus-inner {\\n\\t\\t/* See http://stackoverflow.com/questions/5517744/remove-extra-button-spacing-padding-in-firefox */\\n\\t\\tpadding: 0;\\n\\t\\tborder: 0\\n\\t}\\n}\\n\\n/**\\n * Default UI rules for RTL languages.\\n */\\n.ck[dir=\\\"rtl\\\"],\\n.ck[dir=\\\"rtl\\\"] .ck {\\n\\ttext-align: right;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * Default border-radius value.\\n */\\n:root{\\n\\t--ck-border-radius: 2px;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t/**\\n\\t * A visual style of element's inner shadow (i.e. input).\\n\\t */\\n\\t--ck-inner-shadow: 2px 2px 3px var(--ck-color-shadow-inner) inset;\\n\\n\\t/**\\n\\t * A visual style of element's drop shadow (i.e. panel).\\n\\t */\\n\\t--ck-drop-shadow: 0 1px 2px 1px var(--ck-color-shadow-drop);\\n\\n\\t/**\\n\\t * A visual style of element's active shadow (i.e. comment or suggestion).\\n\\t */\\n\\t--ck-drop-shadow-active: 0 3px 6px 1px var(--ck-color-shadow-drop-active);\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-spacing-unit: \\t\\t\\t\\t\\t\\t0.6em;\\n\\t--ck-spacing-large: \\t\\t\\t\\t\\tcalc(var(--ck-spacing-unit) * 1.5);\\n\\t--ck-spacing-standard: \\t\\t\\t\\t\\tvar(--ck-spacing-unit);\\n\\t--ck-spacing-medium: \\t\\t\\t\\t\\tcalc(var(--ck-spacing-unit) * 0.8);\\n\\t--ck-spacing-small: \\t\\t\\t\\t\\tcalc(var(--ck-spacing-unit) * 0.5);\\n\\t--ck-spacing-tiny: \\t\\t\\t\\t\\t\\tcalc(var(--ck-spacing-unit) * 0.3);\\n\\t--ck-spacing-extra-tiny: \\t\\t\\t\\tcalc(var(--ck-spacing-unit) * 0.16);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2;--ck-resizer-border-radius:var(--ck-border-radius);--ck-resizer-tooltip-offset:10px;--ck-resizer-tooltip-height:calc(var(--ck-spacing-small)*2 + 10px)}.ck .ck-widget,.ck .ck-widget.ck-widget_with-selection-handle{position:relative}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{position:absolute}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{visibility:visible}.ck .ck-size-view{background:var(--ck-color-resizer-tooltip-background);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);color:var(--ck-color-resizer-tooltip-text);display:block;font-size:var(--ck-font-size-tiny);height:var(--ck-resizer-tooltip-height);line-height:var(--ck-resizer-tooltip-height);padding:0 var(--ck-spacing-small)}.ck .ck-size-view.ck-orientation-above-center,.ck .ck-size-view.ck-orientation-bottom-left,.ck .ck-size-view.ck-orientation-bottom-right,.ck .ck-size-view.ck-orientation-top-left,.ck .ck-size-view.ck-orientation-top-right{position:absolute}.ck .ck-size-view.ck-orientation-top-left{left:var(--ck-resizer-tooltip-offset);top:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{right:var(--ck-resizer-tooltip-offset);top:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-right{bottom:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-left{bottom:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-above-center{left:50%;top:calc(var(--ck-resizer-tooltip-height)*-1);transform:translate(-50%)}:root{--ck-widget-outline-thickness:3px;--ck-widget-handler-icon-size:16px;--ck-widget-handler-animation-duration:200ms;--ck-widget-handler-animation-curve:ease;--ck-color-widget-blurred-border:#dedede;--ck-color-widget-hover-border:#ffc83d;--ck-color-widget-editable-focus-background:var(--ck-color-base-background);--ck-color-widget-drag-handler-icon-color:var(--ck-color-base-background)}.ck .ck-widget{outline-color:transparent;outline-style:solid;outline-width:var(--ck-widget-outline-thickness);transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck .ck-widget:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{background-color:var(--ck-color-widget-editable-focus-background);border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;outline:none}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{background-color:transparent;border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;box-sizing:border-box;left:calc(0px - var(--ck-widget-outline-thickness));opacity:0;padding:4px;top:0;transform:translateY(-100%);transition:background-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),visibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{color:var(--ck-color-widget-drag-handler-icon-color);height:var(--ck-widget-handler-icon-size);width:var(--ck-widget-handler-icon-size)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle{background-color:var(--ck-color-widget-hover-border);opacity:1}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{background-color:var(--ck-color-focus-border);opacity:1}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:1}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{left:auto;right:calc(0px - var(--ck-widget-outline-thickness))}.ck.ck-editor__editable.ck-read-only .ck-widget{transition:none}.ck.ck-editor__editable.ck-read-only .ck-widget:not(.ck-widget_selected){--ck-widget-outline-thickness:0px}.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle:hover>.ck-widget__selection-handle:hover,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle>.ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-widget/theme/widget.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-widget/widget.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_focus.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/mixins/_shadow.css\"],\"names\":[],\"mappings\":\"AAKA,MACC,+CAAgD,CAChD,6CAAsD,CACtD,uCAAgD,CAEhD,kDAAmD,CACnD,gCAAiC,CACjC,kEACD,CAOA,8DAEC,iBAqBD,CAnBC,4EACC,iBAOD,CALC,qFAGC,aACD,CASD,iLACC,kBACD,CAGD,kBACC,qDAAsD,CAEtD,qDAAsD,CACtD,6CAA8C,CAF9C,0CAA2C,CAI3C,aAAc,CADd,kCAAmC,CAGnC,uCAAwC,CACxC,4CAA6C,CAF7C,iCAsCD,CAlCC,8NAKC,iBACD,CAEA,0CAEC,qCAAsC,CADtC,oCAED,CAEA,2CAEC,sCAAuC,CADvC,oCAED,CAEA,8CACC,uCAAwC,CACxC,sCACD,CAEA,6CACC,uCAAwC,CACxC,qCACD,CAGA,8CAEC,QAAS,CADT,6CAAgD,CAEhD,yBACD,CCjFD,MACC,iCAAkC,CAClC,kCAAmC,CACnC,4CAA6C,CAC7C,wCAAyC,CAEzC,wCAAiD,CACjD,sCAAkD,CAClD,2EAA4E,CAC5E,yEACD,CAEA,eAGC,yBAA0B,CAD1B,mBAAoB,CADpB,gDAAiD,CAGjD,6GAUD,CARC,0EAEC,6EACD,CAEA,qBACC,iDACD,CAGD,gCACC,4BAWD,CAPC,yGAKC,iEAAkE,CCnCnE,2BAA2B,CCF3B,qCAA8B,CDC9B,YDqCA,CAIA,4EAKC,4BAA6B,CAa7B,iEAAkE,CAhBlE,qBAAsB,CAoBtB,mDAAoD,CAhBpD,SAAU,CALV,WAAY,CAsBZ,KAAM,CAFN,2BAA4B,CAT5B,6SAgCD,CAnBC,qFAIC,oDAAqD,CADrD,yCAA0C,CAD1C,wCAWD,CANC,kHACC,SAAU,CAGV,+DACD,CAID,wHACC,SACD,CAID,kFAEC,oDAAqD,CADrD,SAED,CAKC,oMAEC,6CAA8C,CAD9C,SAOD,CAHC,gRACC,SACD,CAOH,qFACC,SAAU,CACV,oDACD,CAGA,gDAEC,eAkBD,CAhBC,yEAOC,iCACD,CAGC,gOAEC,gDACD,CAOD,wIAEC,mDAQD,CALE,ghBAEC,gDACD,CAKH,yKAOC,yDACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-color-resizer: var(--ck-color-focus-border);\\n\\t--ck-color-resizer-tooltip-background: hsl(0, 0%, 15%);\\n\\t--ck-color-resizer-tooltip-text: hsl(0, 0%, 95%);\\n\\n\\t--ck-resizer-border-radius: var(--ck-border-radius);\\n\\t--ck-resizer-tooltip-offset: 10px;\\n\\t--ck-resizer-tooltip-height: calc(var(--ck-spacing-small) * 2 + 10px);\\n}\\n\\n.ck .ck-widget {\\n\\t/* This is neccessary for type around UI to be positioned properly. */\\n\\tposition: relative;\\n}\\n\\n.ck .ck-widget.ck-widget_with-selection-handle {\\n\\t/* Make the widget wrapper a relative positioning container for the drag handle. */\\n\\tposition: relative;\\n\\n\\t& .ck-widget__selection-handle {\\n\\t\\tposition: absolute;\\n\\n\\t\\t& .ck-icon {\\n\\t\\t\\t/* Make sure the icon in not a subject to font-size or line-height to avoid\\n\\t\\t\\tunnecessary spacing around it. */\\n\\t\\t\\tdisplay: block;\\n\\t\\t}\\n\\t}\\n\\n\\t/* Show the selection handle on mouse hover over the widget, but not for nested widgets. */\\n\\t&:hover > .ck-widget__selection-handle {\\n\\t\\tvisibility: visible;\\n\\t}\\n\\n\\t/* Show the selection handle when the widget is selected, but not for nested widgets. */\\n\\t&.ck-widget_selected > .ck-widget__selection-handle {\\n\\t\\tvisibility: visible;\\n\\t}\\n}\\n\\n.ck .ck-size-view {\\n\\tbackground: var(--ck-color-resizer-tooltip-background);\\n\\tcolor: var(--ck-color-resizer-tooltip-text);\\n\\tborder: 1px solid var(--ck-color-resizer-tooltip-text);\\n\\tborder-radius: var(--ck-resizer-border-radius);\\n\\tfont-size: var(--ck-font-size-tiny);\\n\\tdisplay: block;\\n\\tpadding: 0 var(--ck-spacing-small);\\n\\theight: var(--ck-resizer-tooltip-height);\\n\\tline-height: var(--ck-resizer-tooltip-height);\\n\\n\\t&.ck-orientation-top-left,\\n\\t&.ck-orientation-top-right,\\n\\t&.ck-orientation-bottom-right,\\n\\t&.ck-orientation-bottom-left,\\n\\t&.ck-orientation-above-center {\\n\\t\\tposition: absolute;\\n\\t}\\n\\n\\t&.ck-orientation-top-left {\\n\\t\\ttop: var(--ck-resizer-tooltip-offset);\\n\\t\\tleft: var(--ck-resizer-tooltip-offset);\\n\\t}\\n\\n\\t&.ck-orientation-top-right {\\n\\t\\ttop: var(--ck-resizer-tooltip-offset);\\n\\t\\tright: var(--ck-resizer-tooltip-offset);\\n\\t}\\n\\n\\t&.ck-orientation-bottom-right {\\n\\t\\tbottom: var(--ck-resizer-tooltip-offset);\\n\\t\\tright: var(--ck-resizer-tooltip-offset);\\n\\t}\\n\\n\\t&.ck-orientation-bottom-left {\\n\\t\\tbottom: var(--ck-resizer-tooltip-offset);\\n\\t\\tleft: var(--ck-resizer-tooltip-offset);\\n\\t}\\n\\n\\t/* Class applied if the widget is too small to contain the size label */\\n\\t&.ck-orientation-above-center {\\n\\t\\ttop: calc(var(--ck-resizer-tooltip-height) * -1);\\n\\t\\tleft: 50%;\\n\\t\\ttransform: translate(-50%);\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n@import \\\"../mixins/_focus.css\\\";\\n@import \\\"../mixins/_shadow.css\\\";\\n\\n:root {\\n\\t--ck-widget-outline-thickness: 3px;\\n\\t--ck-widget-handler-icon-size: 16px;\\n\\t--ck-widget-handler-animation-duration: 200ms;\\n\\t--ck-widget-handler-animation-curve: ease;\\n\\n\\t--ck-color-widget-blurred-border: hsl(0, 0%, 87%);\\n\\t--ck-color-widget-hover-border: hsl(43, 100%, 62%);\\n\\t--ck-color-widget-editable-focus-background: var(--ck-color-base-background);\\n\\t--ck-color-widget-drag-handler-icon-color: var(--ck-color-base-background);\\n}\\n\\n.ck .ck-widget {\\n\\toutline-width: var(--ck-widget-outline-thickness);\\n\\toutline-style: solid;\\n\\toutline-color: transparent;\\n\\ttransition: outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);\\n\\n\\t&.ck-widget_selected,\\n\\t&.ck-widget_selected:hover {\\n\\t\\toutline: var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border);\\n\\t}\\n\\n\\t&:hover {\\n\\t\\toutline-color: var(--ck-color-widget-hover-border);\\n\\t}\\n}\\n\\n.ck .ck-editor__nested-editable {\\n\\tborder: 1px solid transparent;\\n\\n\\t/* The :focus style is applied before .ck-editor__nested-editable_focused class is rendered in the view.\\n\\tThese styles show a different border for a blink of an eye, so `:focus` need to have same styles applied. */\\n\\t&.ck-editor__nested-editable_focused,\\n\\t&:focus {\\n\\t\\t@mixin ck-focus-ring;\\n\\t\\t@mixin ck-box-shadow var(--ck-inner-shadow);\\n\\n\\t\\tbackground-color: var(--ck-color-widget-editable-focus-background);\\n\\t}\\n}\\n\\n.ck .ck-widget.ck-widget_with-selection-handle {\\n\\t& .ck-widget__selection-handle {\\n\\t\\tpadding: 4px;\\n\\t\\tbox-sizing: border-box;\\n\\n\\t\\t/* Background and opacity will be animated as the handler shows up or the widget gets selected. */\\n\\t\\tbackground-color: transparent;\\n\\t\\topacity: 0;\\n\\n\\t\\t/* Transition:\\n\\t\\t * background-color for the .ck-widget_selected state change,\\n\\t\\t * visibility for hiding the handler,\\n\\t\\t * opacity for the proper look of the icon when the handler disappears. */\\n\\t\\ttransition:\\n\\t\\t\\tbackground-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),\\n\\t\\t\\tvisibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),\\n\\t\\t\\topacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);\\n\\n\\t\\t/* Make only top corners round. */\\n\\t\\tborder-radius: var(--ck-border-radius) var(--ck-border-radius) 0 0;\\n\\n\\t\\t/* Place the drag handler outside the widget wrapper. */\\n\\t\\ttransform: translateY(-100%);\\n\\t\\tleft: calc(0px - var(--ck-widget-outline-thickness));\\n\\t\\ttop: 0;\\n\\n\\t\\t& .ck-icon {\\n\\t\\t\\t/* Make sure the dimensions of the icon are independent of the fon-size of the content. */\\n\\t\\t\\twidth: var(--ck-widget-handler-icon-size);\\n\\t\\t\\theight: var(--ck-widget-handler-icon-size);\\n\\t\\t\\tcolor: var(--ck-color-widget-drag-handler-icon-color);\\n\\n\\t\\t\\t/* The \\\"selected\\\" part of the icon is invisible by default */\\n\\t\\t\\t& .ck-icon__selected-indicator {\\n\\t\\t\\t\\topacity: 0;\\n\\n\\t\\t\\t\\t/* Note: The animation is longer on purpose. Simply feels better. */\\n\\t\\t\\t\\ttransition: opacity 300ms var(--ck-widget-handler-animation-curve);\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t/* Advertise using the look of the icon that once clicked the handler, the widget will be selected. */\\n\\t\\t&:hover .ck-icon .ck-icon__selected-indicator {\\n\\t\\t\\topacity: 1;\\n\\t\\t}\\n\\t}\\n\\n\\t/* Show the selection handler on mouse hover over the widget, but not for nested widgets. */\\n\\t&:hover > .ck-widget__selection-handle {\\n\\t\\topacity: 1;\\n\\t\\tbackground-color: var(--ck-color-widget-hover-border);\\n\\t}\\n\\n\\t/* Show the selection handler when the widget is selected, but not for nested widgets. */\\n\\t&.ck-widget_selected,\\n\\t&.ck-widget_selected:hover {\\n\\t\\t& > .ck-widget__selection-handle {\\n\\t\\t\\topacity: 1;\\n\\t\\t\\tbackground-color: var(--ck-color-focus-border);\\n\\n\\t\\t\\t/* When the widget is selected, notify the user using the proper look of the icon. */\\n\\t\\t\\t& .ck-icon .ck-icon__selected-indicator {\\n\\t\\t\\t\\topacity: 1;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n/* In a RTL environment, align the selection handler to the right side of the widget */\\n/* stylelint-disable-next-line no-descending-specificity */\\n.ck[dir=\\\"rtl\\\"] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle {\\n\\tleft: auto;\\n\\tright: calc(0px - var(--ck-widget-outline-thickness));\\n}\\n\\n/* https://github.com/ckeditor/ckeditor5/issues/6415 */\\n.ck.ck-editor__editable.ck-read-only .ck-widget {\\n\\t/* Prevent the :hover outline from showing up because of the used outline-color transition. */\\n\\ttransition: none;\\n\\n\\t&:not(.ck-widget_selected) {\\n\\t\\t/* Disable visual effects of hover/active widget when CKEditor is in readOnly mode.\\n\\t\\t * See: https://github.com/ckeditor/ckeditor5/issues/1261\\n\\t\\t *\\n\\t\\t * Leave the unit because this custom property is used in calc() by other features.\\n\\t\\t * See: https://github.com/ckeditor/ckeditor5/issues/6775\\n\\t\\t */\\n\\t\\t--ck-widget-outline-thickness: 0px;\\n\\t}\\n\\n\\t&.ck-widget_with-selection-handle {\\n\\t\\t& .ck-widget__selection-handle,\\n\\t\\t& .ck-widget__selection-handle:hover {\\n\\t\\t\\tbackground: var(--ck-color-widget-blurred-border);\\n\\t\\t}\\n\\t}\\n}\\n\\n/* Style the widget when it's selected but the editable it belongs to lost focus. */\\n/* stylelint-disable-next-line no-descending-specificity */\\n.ck.ck-editor__editable.ck-blurred .ck-widget {\\n\\t&.ck-widget_selected,\\n\\t&.ck-widget_selected:hover {\\n\\t\\toutline-color: var(--ck-color-widget-blurred-border);\\n\\n\\t\\t&.ck-widget_with-selection-handle {\\n\\t\\t\\t& > .ck-widget__selection-handle,\\n\\t\\t\\t& > .ck-widget__selection-handle:hover {\\n\\t\\t\\t\\tbackground: var(--ck-color-widget-blurred-border);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n.ck.ck-editor__editable > .ck-widget.ck-widget_with-selection-handle:first-child,\\n.ck.ck-editor__editable blockquote > .ck-widget.ck-widget_with-selection-handle:first-child {\\n\\t/* Do not crop selection handler if a widget is a first-child in the blockquote or in the root editable.\\n\\tIn fact, anything with overflow: hidden.\\n\\thttps://github.com/ckeditor/ckeditor5-block-quote/issues/28\\n\\thttps://github.com/ckeditor/ckeditor5-widget/issues/44\\n\\thttps://github.com/ckeditor/ckeditor5-widget/issues/66 */\\n\\tmargin-top: calc(1em + var(--ck-widget-handler-icon-size));\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A visual style of focused element's border.\\n */\\n@define-mixin ck-focus-ring {\\n\\t/* Disable native outline. */\\n\\toutline: none;\\n\\tborder: var(--ck-focus-ring)\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n/**\\n * A helper to combine multiple shadows.\\n */\\n@define-mixin ck-box-shadow $shadowA, $shadowB: 0 0 {\\n\\tbox-shadow: $shadowA, $shadowB;\\n}\\n\\n/**\\n * Gives an element a drop shadow so it looks like a floating panel.\\n */\\n@define-mixin ck-drop-shadow {\\n\\t@mixin ck-box-shadow var(--ck-drop-shadow);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck .ck-widget_with-resizer{position:relative}.ck .ck-widget__resizer{display:none;left:0;pointer-events:none;position:absolute;top:0}.ck-focused .ck-widget_with-resizer.ck-widget_selected>.ck-widget__resizer{display:block}.ck .ck-widget__resizer__handle{pointer-events:all;position:absolute}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{cursor:nwse-resize}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left,.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{cursor:nesw-resize}:root{--ck-resizer-size:10px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-border-width:1px}.ck .ck-widget__resizer{outline:1px solid var(--ck-color-resizer)}.ck .ck-widget__resizer__handle{background:var(--ck-color-focus-border);border:var(--ck-resizer-border-width) solid #fff;border-radius:var(--ck-resizer-border-radius);height:var(--ck-resizer-size);width:var(--ck-resizer-size)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-left{left:var(--ck-resizer-offset);top:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-top-right{right:var(--ck-resizer-offset);top:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-right{bottom:var(--ck-resizer-offset);right:var(--ck-resizer-offset)}.ck .ck-widget__resizer__handle.ck-widget__resizer__handle-bottom-left{bottom:var(--ck-resizer-offset);left:var(--ck-resizer-offset)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-widget/theme/widgetresize.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-widget/widgetresize.css\"],\"names\":[],\"mappings\":\"AAKA,4BAEC,iBACD,CAEA,wBACC,YAAa,CAMb,MAAO,CAFP,mBAAoB,CAHpB,iBAAkB,CAMlB,KACD,CAGC,2EACC,aACD,CAGD,gCAIC,kBAAmB,CAHnB,iBAcD,CATC,4IAEC,kBACD,CAEA,4IAEC,kBACD,CCpCD,MACC,sBAAuB,CAGvB,yDAAiE,CACjE,6BACD,CAEA,wBACC,yCACD,CAEA,gCAGC,uCAAwC,CACxC,gDAA6D,CAC7D,6CAA8C,CAH9C,6BAA8B,CAD9B,4BAyBD,CAnBC,oEAEC,6BAA8B,CAD9B,4BAED,CAEA,qEAEC,8BAA+B,CAD/B,4BAED,CAEA,wEACC,+BAAgC,CAChC,8BACD,CAEA,uEACC,+BAAgC,CAChC,6BACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck .ck-widget_with-resizer {\\n\\t/* Make the widget wrapper a relative positioning container for the drag handle. */\\n\\tposition: relative;\\n}\\n\\n.ck .ck-widget__resizer {\\n\\tdisplay: none;\\n\\tposition: absolute;\\n\\n\\t/* The wrapper itself should not interfere with the pointer device, only the handles should. */\\n\\tpointer-events: none;\\n\\n\\tleft: 0;\\n\\ttop: 0;\\n}\\n\\n.ck-focused .ck-widget_with-resizer.ck-widget_selected {\\n\\t& > .ck-widget__resizer {\\n\\t\\tdisplay: block;\\n\\t}\\n}\\n\\n.ck .ck-widget__resizer__handle {\\n\\tposition: absolute;\\n\\n\\t/* Resizers are the only UI elements that should interfere with a pointer device. */\\n\\tpointer-events: all;\\n\\n\\t&.ck-widget__resizer__handle-top-left,\\n\\t&.ck-widget__resizer__handle-bottom-right {\\n\\t\\tcursor: nwse-resize;\\n\\t}\\n\\n\\t&.ck-widget__resizer__handle-top-right,\\n\\t&.ck-widget__resizer__handle-bottom-left {\\n\\t\\tcursor: nesw-resize;\\n\\t}\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-resizer-size: 10px;\\n\\n\\t/* Set the resizer with a 50% offset. */\\n\\t--ck-resizer-offset: calc( ( var(--ck-resizer-size) / -2 ) - 2px);\\n\\t--ck-resizer-border-width: 1px;\\n}\\n\\n.ck .ck-widget__resizer {\\n\\toutline: 1px solid var(--ck-color-resizer);\\n}\\n\\n.ck .ck-widget__resizer__handle {\\n\\twidth: var(--ck-resizer-size);\\n\\theight: var(--ck-resizer-size);\\n\\tbackground: var(--ck-color-focus-border);\\n\\tborder: var(--ck-resizer-border-width) solid hsl(0, 0%, 100%);\\n\\tborder-radius: var(--ck-resizer-border-radius);\\n\\n\\t&.ck-widget__resizer__handle-top-left {\\n\\t\\ttop: var(--ck-resizer-offset);\\n\\t\\tleft: var(--ck-resizer-offset);\\n\\t}\\n\\n\\t&.ck-widget__resizer__handle-top-right {\\n\\t\\ttop: var(--ck-resizer-offset);\\n\\t\\tright: var(--ck-resizer-offset);\\n\\t}\\n\\n\\t&.ck-widget__resizer__handle-bottom-right {\\n\\t\\tbottom: var(--ck-resizer-offset);\\n\\t\\tright: var(--ck-resizer-offset);\\n\\t}\\n\\n\\t&.ck-widget__resizer__handle-bottom-left {\\n\\t\\tbottom: var(--ck-resizer-offset);\\n\\t\\tleft: var(--ck-resizer-offset);\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".ck .ck-widget .ck-widget__type-around__button{display:block;overflow:hidden;position:absolute;z-index:var(--ck-z-default)}.ck .ck-widget .ck-widget__type-around__button svg{left:50%;position:absolute;top:50%;z-index:calc(var(--ck-z-default) + 2)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_before{left:min(10%,30px);top:calc(var(--ck-widget-outline-thickness)*-.5);transform:translateY(-50%)}.ck .ck-widget .ck-widget__type-around__button.ck-widget__type-around__button_after{bottom:calc(var(--ck-widget-outline-thickness)*-.5);right:min(10%,30px);transform:translateY(50%)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{content:\\\"\\\";display:block;left:1px;position:absolute;top:1px;z-index:calc(var(--ck-z-default) + 1)}.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:none;left:0;position:absolute;right:0}.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__fake-caret{left:calc(var(--ck-widget-outline-thickness)*-1);right:calc(var(--ck-widget-outline-thickness)*-1)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__fake-caret{display:block;top:calc(var(--ck-widget-outline-thickness)*-1 - 1px)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__fake-caret{bottom:calc(var(--ck-widget-outline-thickness)*-1 - 1px);display:block}.ck.ck-editor__editable.ck-read-only .ck-widget__type-around,.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around,.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around{display:none}:root{--ck-widget-type-around-button-size:20px;--ck-color-widget-type-around-button-active:var(--ck-color-focus-border);--ck-color-widget-type-around-button-hover:var(--ck-color-widget-hover-border);--ck-color-widget-type-around-button-blurred-editable:var(--ck-color-widget-blurred-border);--ck-color-widget-type-around-button-radar-start-alpha:0;--ck-color-widget-type-around-button-radar-end-alpha:.3;--ck-color-widget-type-around-button-icon:var(--ck-color-base-background)}.ck .ck-widget .ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button);border-radius:100px;height:var(--ck-widget-type-around-button-size);opacity:0;pointer-events:none;transition:opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);width:var(--ck-widget-type-around-button-size)}.ck .ck-widget .ck-widget__type-around__button svg{height:8px;margin-top:1px;transform:translate(-50%,-50%);transition:transform .5s ease;width:10px}.ck .ck-widget .ck-widget__type-around__button svg *{stroke-dasharray:10;stroke-dashoffset:0;fill:none;stroke:var(--ck-color-widget-type-around-button-icon);stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round}.ck .ck-widget .ck-widget__type-around__button svg line{stroke-dasharray:7}.ck .ck-widget .ck-widget__type-around__button:hover{animation:ck-widget-type-around-button-sonar 1s ease infinite}.ck .ck-widget .ck-widget__type-around__button:hover svg polyline{animation:ck-widget-type-around-arrow-dash 2s linear}.ck .ck-widget .ck-widget__type-around__button:hover svg line{animation:ck-widget-type-around-arrow-tip-dash 2s linear}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:1;pointer-events:auto}.ck .ck-widget:not(.ck-widget_selected)>.ck-widget__type-around>.ck-widget__type-around__button{background:var(--ck-color-widget-type-around-button-hover)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover{background:var(--ck-color-widget-type-around-button-active)}.ck .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:after,.ck .ck-widget>.ck-widget__type-around>.ck-widget__type-around__button:hover:after{background:linear-gradient(135deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.3));border-radius:100px;height:calc(var(--ck-widget-type-around-button-size) - 2px);width:calc(var(--ck-widget-type-around-button-size) - 2px)}.ck .ck-widget.ck-widget_with-selection-handle>.ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:20px}.ck .ck-widget .ck-widget__type-around__fake-caret{animation:ck-widget-type-around-fake-caret-pulse 1s linear infinite normal forwards;background:var(--ck-color-base-text);height:1px;outline:1px solid hsla(0,0%,100%,.5);pointer-events:none}.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_after,.ck .ck-widget.ck-widget_selected.ck-widget_type-around_show-fake-caret_before{outline-color:transparent}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected:hover,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after>.ck-widget__type-around>.ck-widget__type-around__button,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_after.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_selected.ck-widget_with-resizer>.ck-widget__resizer,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected:hover>.ck-widget__selection-handle,.ck .ck-widget.ck-widget_type-around_show-fake-caret_before.ck-widget_with-selection-handle.ck-widget_selected>.ck-widget__selection-handle{opacity:0}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around>.ck-widget__type-around__button_before{margin-left:0;margin-right:20px}.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button,.ck-editor__nested-editable.ck-editor__editable_selected .ck-widget:hover>.ck-widget__type-around>.ck-widget__type-around__button{opacity:0;pointer-events:none}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover){background:var(--ck-color-widget-type-around-button-blurred-editable)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected>.ck-widget__type-around>.ck-widget__type-around__button:not(:hover) svg *{stroke:#999}@keyframes ck-widget-type-around-arrow-dash{0%{stroke-dashoffset:10}20%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-arrow-tip-dash{0%,20%{stroke-dashoffset:7}40%,to{stroke-dashoffset:0}}@keyframes ck-widget-type-around-button-sonar{0%{box-shadow:0 0 0 0 hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}50%{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-end-alpha))}to{box-shadow:0 0 0 5px hsla(var(--ck-color-focus-border-coordinates),var(--ck-color-widget-type-around-button-radar-start-alpha))}}@keyframes ck-widget-type-around-fake-caret-pulse{0%{opacity:1}49%{opacity:1}50%{opacity:0}99%{opacity:0}to{opacity:1}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@ckeditor/ckeditor5-widget/theme/widgettypearound.css\",\"webpack://./node_modules/@ckeditor/ckeditor5-theme-lark/theme/ckeditor5-widget/widgettypearound.css\"],\"names\":[],\"mappings\":\"AASC,+CACC,aAAc,CAEd,eAAgB,CADhB,iBAAkB,CAElB,2BAwBD,CAtBC,mDAGC,QAAS,CAFT,iBAAkB,CAClB,OAAQ,CAER,qCACD,CAEA,qFAGC,kBAAoB,CADpB,gDAAoD,CAGpD,0BACD,CAEA,oFAEC,mDAAuD,CACvD,mBAAqB,CAErB,yBACD,CAUA,mLACC,UAAW,CACX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ACD,CACA,GACC,+HACD,CACD,CAEA,kDACC,GACC,SACD,CACA,IACC,SACD,CACA,IACC,SACD,CACA,IACC,SACD,CACA,GACC,SACD,CACD\",\"sourcesContent\":[\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n.ck .ck-widget {\\n\\t/*\\n\\t * Styles of the type around buttons\\n\\t */\\n\\t& .ck-widget__type-around__button {\\n\\t\\tdisplay: block;\\n\\t\\tposition: absolute;\\n\\t\\toverflow: hidden;\\n\\t\\tz-index: var(--ck-z-default);\\n\\n\\t\\t& svg {\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\ttop: 50%;\\n\\t\\t\\tleft: 50%;\\n\\t\\t\\tz-index: calc(var(--ck-z-default) + 2);\\n\\t\\t}\\n\\n\\t\\t&.ck-widget__type-around__button_before {\\n\\t\\t\\t/* Place it in the middle of the outline */\\n\\t\\t\\ttop: calc(-0.5 * var(--ck-widget-outline-thickness));\\n\\t\\t\\tleft: min(10%, 30px);\\n\\n\\t\\t\\ttransform: translateY(-50%);\\n\\t\\t}\\n\\n\\t\\t&.ck-widget__type-around__button_after {\\n\\t\\t\\t/* Place it in the middle of the outline */\\n\\t\\t\\tbottom: calc(-0.5 * var(--ck-widget-outline-thickness));\\n\\t\\t\\tright: min(10%, 30px);\\n\\n\\t\\t\\ttransform: translateY(50%);\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the buttons when:\\n\\t * - the widget is selected,\\n\\t * - or the button is being hovered (regardless of the widget state).\\n\\t */\\n\\t&.ck-widget_selected > .ck-widget__type-around > .ck-widget__type-around__button,\\n\\t& > .ck-widget__type-around > .ck-widget__type-around__button:hover {\\n\\t\\t&::after {\\n\\t\\t\\tcontent: \\\"\\\";\\n\\t\\t\\tdisplay: block;\\n\\t\\t\\tposition: absolute;\\n\\t\\t\\ttop: 1px;\\n\\t\\t\\tleft: 1px;\\n\\t\\t\\tz-index: calc(var(--ck-z-default) + 1);\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the horizontal \\\"fake caret\\\" which is displayed when the user navigates using the keyboard.\\n\\t */\\n\\t& > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\\n\\t\\tdisplay: none;\\n\\t\\tposition: absolute;\\n\\t\\tleft: 0;\\n\\t\\tright: 0;\\n\\t}\\n\\n\\t/*\\n\\t * When the widget is hovered the \\\"fake caret\\\" would normally be narrower than the\\n\\t * extra outline displayed around the widget. Let's extend the \\\"fake caret\\\" to match\\n\\t * the full width of the widget.\\n\\t */\\n\\t&:hover > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\\n\\t\\tleft: calc( -1 * var(--ck-widget-outline-thickness) );\\n\\t\\tright: calc( -1 * var(--ck-widget-outline-thickness) );\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the horizontal \\\"fake caret\\\" when it should be displayed before the widget (backward keyboard navigation).\\n\\t */\\n\\t&.ck-widget_type-around_show-fake-caret_before > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\\n\\t\\ttop: calc( -1 * var(--ck-widget-outline-thickness) - 1px );\\n\\t\\tdisplay: block;\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the horizontal \\\"fake caret\\\" when it should be displayed after the widget (forward keyboard navigation).\\n\\t */\\n\\t&.ck-widget_type-around_show-fake-caret_after > .ck-widget__type-around > .ck-widget__type-around__fake-caret {\\n\\t\\tbottom: calc( -1 * var(--ck-widget-outline-thickness) - 1px );\\n\\t\\tdisplay: block;\\n\\t}\\n}\\n\\n/*\\n * Integration with the read-only mode of the editor.\\n */\\n.ck.ck-editor__editable.ck-read-only .ck-widget__type-around {\\n\\tdisplay: none;\\n}\\n\\n/*\\n * Integration with the restricted editing mode (feature) of the editor.\\n */\\n.ck.ck-editor__editable.ck-restricted-editing_mode_restricted .ck-widget__type-around {\\n\\tdisplay: none;\\n}\\n\\n/*\\n * Integration with the #isEnabled property of the WidgetTypeAround plugin.\\n */\\n.ck.ck-editor__editable.ck-widget__type-around_disabled .ck-widget__type-around {\\n\\tdisplay: none;\\n}\\n\",\"/*\\n * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\\n */\\n\\n:root {\\n\\t--ck-widget-type-around-button-size: 20px;\\n\\t--ck-color-widget-type-around-button-active: var(--ck-color-focus-border);\\n\\t--ck-color-widget-type-around-button-hover: var(--ck-color-widget-hover-border);\\n\\t--ck-color-widget-type-around-button-blurred-editable: var(--ck-color-widget-blurred-border);\\n\\t--ck-color-widget-type-around-button-radar-start-alpha: 0;\\n\\t--ck-color-widget-type-around-button-radar-end-alpha: .3;\\n\\t--ck-color-widget-type-around-button-icon: var(--ck-color-base-background);\\n}\\n\\n@define-mixin ck-widget-type-around-button-visible {\\n\\topacity: 1;\\n\\tpointer-events: auto;\\n}\\n\\n@define-mixin ck-widget-type-around-button-hidden {\\n\\topacity: 0;\\n\\tpointer-events: none;\\n}\\n\\n.ck .ck-widget {\\n\\t/*\\n\\t * Styles of the type around buttons\\n\\t */\\n\\t& .ck-widget__type-around__button {\\n\\t\\twidth: var(--ck-widget-type-around-button-size);\\n\\t\\theight: var(--ck-widget-type-around-button-size);\\n\\t\\tbackground: var(--ck-color-widget-type-around-button);\\n\\t\\tborder-radius: 100px;\\n\\t\\ttransition: opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve), background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);\\n\\n\\t\\t@mixin ck-widget-type-around-button-hidden;\\n\\n\\t\\t& svg {\\n\\t\\t\\twidth: 10px;\\n\\t\\t\\theight: 8px;\\n\\t\\t\\ttransform: translate(-50%,-50%);\\n\\t\\t\\ttransition: transform .5s ease;\\n\\t\\t\\tmargin-top: 1px;\\n\\n\\t\\t\\t& * {\\n\\t\\t\\t\\tstroke-dasharray: 10;\\n\\t\\t\\t\\tstroke-dashoffset: 0;\\n\\n\\t\\t\\t\\tfill: none;\\n\\t\\t\\t\\tstroke: var(--ck-color-widget-type-around-button-icon);\\n\\t\\t\\t\\tstroke-width: 1.5px;\\n\\t\\t\\t\\tstroke-linecap: round;\\n\\t\\t\\t\\tstroke-linejoin: round;\\n\\t\\t\\t}\\n\\n\\t\\t\\t& line {\\n\\t\\t\\t\\tstroke-dasharray: 7;\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t&:hover {\\n\\t\\t\\t/*\\n\\t\\t\\t * Display the \\\"sonar\\\" around the button when hovered.\\n\\t\\t\\t */\\n\\t\\t\\tanimation: ck-widget-type-around-button-sonar 1s ease infinite;\\n\\n\\t\\t\\t/*\\n\\t\\t\\t * Animate active button's icon.\\n\\t\\t\\t */\\n\\t\\t\\t& svg {\\n\\t\\t\\t\\t& polyline {\\n\\t\\t\\t\\t\\tanimation: ck-widget-type-around-arrow-dash 2s linear;\\n\\t\\t\\t\\t}\\n\\n\\t\\t\\t\\t& line {\\n\\t\\t\\t\\t\\tanimation: ck-widget-type-around-arrow-tip-dash 2s linear;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Show type around buttons when the widget gets selected or being hovered.\\n\\t */\\n\\t&.ck-widget_selected,\\n\\t&:hover {\\n\\t\\t& > .ck-widget__type-around > .ck-widget__type-around__button {\\n\\t\\t\\t@mixin ck-widget-type-around-button-visible;\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the buttons when the widget is NOT selected (but the buttons are visible\\n\\t * and still can be hovered).\\n\\t */\\n\\t&:not(.ck-widget_selected) > .ck-widget__type-around > .ck-widget__type-around__button {\\n\\t\\tbackground: var(--ck-color-widget-type-around-button-hover);\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the buttons when:\\n\\t * - the widget is selected,\\n\\t * - or the button is being hovered (regardless of the widget state).\\n\\t */\\n\\t&.ck-widget_selected > .ck-widget__type-around > .ck-widget__type-around__button,\\n\\t& > .ck-widget__type-around > .ck-widget__type-around__button:hover {\\n\\t\\tbackground: var(--ck-color-widget-type-around-button-active);\\n\\n\\t\\t&::after {\\n\\t\\t\\twidth: calc(var(--ck-widget-type-around-button-size) - 2px);\\n\\t\\t\\theight: calc(var(--ck-widget-type-around-button-size) - 2px);\\n\\t\\t\\tborder-radius: 100px;\\n\\t\\t\\tbackground: linear-gradient(135deg, hsla(0,0%,100%,0) 0%, hsla(0,0%,100%,.3) 100%);\\n\\t\\t}\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the \\\"before\\\" button when the widget has a selection handle. Because some space\\n\\t * is consumed by the handle, the button must be moved slightly to the right to let it breathe.\\n\\t */\\n\\t&.ck-widget_with-selection-handle > .ck-widget__type-around > .ck-widget__type-around__button_before {\\n\\t\\tmargin-left: 20px;\\n\\t}\\n\\n\\t/*\\n\\t * Styles for the horizontal \\\"fake caret\\\" which is displayed when the user navigates using the keyboard.\\n\\t */\\n\\t& .ck-widget__type-around__fake-caret {\\n\\t\\tpointer-events: none;\\n\\t\\theight: 1px;\\n\\t\\tanimation: ck-widget-type-around-fake-caret-pulse linear 1s infinite normal forwards;\\n\\n\\t\\t/*\\n\\t\\t * The semi-transparent-outline+background combo improves the contrast\\n\\t\\t * when the background underneath the fake caret is dark.\\n\\t\\t */\\n\\t\\toutline: solid 1px hsla(0, 0%, 100%, .5);\\n\\t\\tbackground: var(--ck-color-base-text);\\n\\t}\\n\\n\\t/*\\n\\t * Styles of the widget when the \\\"fake caret\\\" is blinking (e.g. upon keyboard navigation).\\n\\t * Despite the widget being physically selected in the model, its outline should disappear.\\n\\t */\\n\\t&.ck-widget_selected {\\n\\t\\t&.ck-widget_type-around_show-fake-caret_before,\\n\\t\\t&.ck-widget_type-around_show-fake-caret_after {\\n\\t\\t\\toutline-color: transparent;\\n\\t\\t}\\n\\t}\\n\\n\\t&.ck-widget_type-around_show-fake-caret_before,\\n\\t&.ck-widget_type-around_show-fake-caret_after {\\n\\t\\t/*\\n\\t\\t * When the \\\"fake caret\\\" is visible we simulate that the widget is not selected\\n\\t\\t * (despite being physically selected), so the outline color should be for the\\n\\t\\t * unselected widget.\\n\\t\\t */\\n\\t\\t&.ck-widget_selected:hover {\\n\\t\\t\\toutline-color: var(--ck-color-widget-hover-border);\\n\\t\\t}\\n\\n\\t\\t/*\\n\\t\\t * Styles of the type around buttons when the \\\"fake caret\\\" is blinking (e.g. upon keyboard navigation).\\n\\t\\t * In this state, the type around buttons would collide with the fake carets so they should disappear.\\n\\t\\t */\\n\\t\\t& > .ck-widget__type-around > .ck-widget__type-around__button {\\n\\t\\t\\t@mixin ck-widget-type-around-button-hidden;\\n\\t\\t}\\n\\n\\t\\t/*\\n\\t\\t * Fake horizontal caret integration with the selection handle. When the caret is visible, simply\\n\\t\\t * hide the handle because it intersects with the caret (and does not make much sense anyway).\\n\\t\\t */\\n\\t\\t&.ck-widget_with-selection-handle {\\n\\t\\t\\t&.ck-widget_selected,\\n\\t\\t\\t&.ck-widget_selected:hover {\\n\\t\\t\\t\\t& > .ck-widget__selection-handle {\\n\\t\\t\\t\\t\\topacity: 0\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\n\\t\\t/*\\n\\t\\t * Fake horizontal caret integration with the resize UI. When the caret is visible, simply\\n\\t\\t * hide the resize UI because it creates too much noise. It can be visible when the user\\n\\t\\t * hovers the widget, though.\\n\\t\\t */\\n\\t\\t&.ck-widget_selected.ck-widget_with-resizer > .ck-widget__resizer {\\n\\t\\t\\topacity: 0\\n\\t\\t}\\n\\t}\\n}\\n\\n/*\\n * Styles for the \\\"before\\\" button when the widget has a selection handle in an RTL environment.\\n * The selection handler is aligned to the right side of the widget so there is no need to create\\n * additional space for it next to the \\\"before\\\" button.\\n */\\n.ck[dir=\\\"rtl\\\"] .ck-widget.ck-widget_with-selection-handle .ck-widget__type-around > .ck-widget__type-around__button_before {\\n\\tmargin-left: 0;\\n\\tmargin-right: 20px;\\n}\\n\\n/*\\n * Hide type around buttons when the widget is selected as a child of a selected\\n * nested editable (e.g. mulit-cell table selection).\\n *\\n * See https://github.com/ckeditor/ckeditor5/issues/7263.\\n */\\n.ck-editor__nested-editable.ck-editor__editable_selected {\\n\\t& .ck-widget {\\n\\t\\t&.ck-widget_selected,\\n\\t\\t&:hover {\\n\\t\\t\\t& > .ck-widget__type-around > .ck-widget__type-around__button {\\n\\t\\t\\t\\t@mixin ck-widget-type-around-button-hidden;\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n/*\\n * Styles for the buttons when the widget is selected but the user clicked outside of the editor (blurred the editor).\\n */\\n.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected > .ck-widget__type-around > .ck-widget__type-around__button:not(:hover) {\\n\\tbackground: var(--ck-color-widget-type-around-button-blurred-editable);\\n\\n\\t& svg * {\\n\\t\\tstroke: hsl(0,0%,60%);\\n\\t}\\n}\\n\\n@keyframes ck-widget-type-around-arrow-dash {\\n\\t0% {\\n\\t\\tstroke-dashoffset: 10;\\n\\t}\\n\\t20%, 100% {\\n\\t\\tstroke-dashoffset: 0;\\n\\t}\\n}\\n\\n@keyframes ck-widget-type-around-arrow-tip-dash {\\n\\t0%, 20% {\\n\\t\\tstroke-dashoffset: 7;\\n\\t}\\n\\t40%, 100% {\\n\\t\\tstroke-dashoffset: 0;\\n\\t}\\n}\\n\\n@keyframes ck-widget-type-around-button-sonar {\\n\\t0% {\\n\\t\\tbox-shadow: 0 0 0 0 hsla(var(--ck-color-focus-border-coordinates), var(--ck-color-widget-type-around-button-radar-start-alpha));\\n\\t}\\n\\t50% {\\n\\t\\tbox-shadow: 0 0 0 5px hsla(var(--ck-color-focus-border-coordinates), var(--ck-color-widget-type-around-button-radar-end-alpha));\\n\\t}\\n\\t100% {\\n\\t\\tbox-shadow: 0 0 0 5px hsla(var(--ck-color-focus-border-coordinates), var(--ck-color-widget-type-around-button-radar-start-alpha));\\n\\t}\\n}\\n\\n@keyframes ck-widget-type-around-fake-caret-pulse {\\n\\t0% {\\n\\t\\topacity: 1;\\n\\t}\\n\\t49% {\\n\\t\\topacity: 1;\\n\\t}\\n\\t50% {\\n\\t\\topacity: 0;\\n\\t}\\n\\t99% {\\n\\t\\topacity: 0;\\n\\t}\\n\\t100% {\\n\\t\\topacity: 1;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (cssWithMappingToString) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join(\"\");\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === \"string\") {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, \"\"]];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};","\"use strict\";\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nmodule.exports = function cssWithMappingToString(item) {\n var _item = _slicedToArray(item, 4),\n content = _item[1],\n cssMapping = _item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (typeof btoa === \"function\") {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || \"\").concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join(\"\\n\");\n }\n\n return [content].join(\"\\n\");\n};","\"use strict\";\n\nvar isOldIE = function isOldIE() {\n var memo;\n return function memorize() {\n if (typeof memo === 'undefined') {\n // Test for IE <= 9 as proposed by Browserhacks\n // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n // Tests for existence of standard globals is to allow style-loader\n // to operate correctly into non-standard environments\n // @see https://github.com/webpack-contrib/style-loader/issues/177\n memo = Boolean(window && document && document.all && !window.atob);\n }\n\n return memo;\n };\n}();\n\nvar getTarget = function getTarget() {\n var memo = {};\n return function memorize(target) {\n if (typeof memo[target] === 'undefined') {\n var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself\n\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n\n memo[target] = styleTarget;\n }\n\n return memo[target];\n };\n}();\n\nvar stylesInDom = [];\n\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n\n for (var i = 0; i < stylesInDom.length; i++) {\n if (stylesInDom[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n\n return result;\n}\n\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var index = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3]\n };\n\n if (index !== -1) {\n stylesInDom[index].references++;\n stylesInDom[index].updater(obj);\n } else {\n stylesInDom.push({\n identifier: identifier,\n updater: addStyle(obj, options),\n references: 1\n });\n }\n\n identifiers.push(identifier);\n }\n\n return identifiers;\n}\n\nfunction insertStyleElement(options) {\n var style = document.createElement('style');\n var attributes = options.attributes || {};\n\n if (typeof attributes.nonce === 'undefined') {\n var nonce = typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : null;\n\n if (nonce) {\n attributes.nonce = nonce;\n }\n }\n\n Object.keys(attributes).forEach(function (key) {\n style.setAttribute(key, attributes[key]);\n });\n\n if (typeof options.insert === 'function') {\n options.insert(style);\n } else {\n var target = getTarget(options.insert || 'head');\n\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n\n target.appendChild(style);\n }\n\n return style;\n}\n\nfunction removeStyleElement(style) {\n // istanbul ignore if\n if (style.parentNode === null) {\n return false;\n }\n\n style.parentNode.removeChild(style);\n}\n/* istanbul ignore next */\n\n\nvar replaceText = function replaceText() {\n var textStore = [];\n return function replace(index, replacement) {\n textStore[index] = replacement;\n return textStore.filter(Boolean).join('\\n');\n };\n}();\n\nfunction applyToSingletonTag(style, index, remove, obj) {\n var css = remove ? '' : obj.media ? \"@media \".concat(obj.media, \" {\").concat(obj.css, \"}\") : obj.css; // For old IE\n\n /* istanbul ignore if */\n\n if (style.styleSheet) {\n style.styleSheet.cssText = replaceText(index, css);\n } else {\n var cssNode = document.createTextNode(css);\n var childNodes = style.childNodes;\n\n if (childNodes[index]) {\n style.removeChild(childNodes[index]);\n }\n\n if (childNodes.length) {\n style.insertBefore(cssNode, childNodes[index]);\n } else {\n style.appendChild(cssNode);\n }\n }\n}\n\nfunction applyToTag(style, options, obj) {\n var css = obj.css;\n var media = obj.media;\n var sourceMap = obj.sourceMap;\n\n if (media) {\n style.setAttribute('media', media);\n } else {\n style.removeAttribute('media');\n }\n\n if (sourceMap && typeof btoa !== 'undefined') {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n } // For old IE\n\n /* istanbul ignore if */\n\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n while (style.firstChild) {\n style.removeChild(style.firstChild);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar singleton = null;\nvar singletonCounter = 0;\n\nfunction addStyle(obj, options) {\n var style;\n var update;\n var remove;\n\n if (options.singleton) {\n var styleIndex = singletonCounter++;\n style = singleton || (singleton = insertStyleElement(options));\n update = applyToSingletonTag.bind(null, style, styleIndex, false);\n remove = applyToSingletonTag.bind(null, style, styleIndex, true);\n } else {\n style = insertStyleElement(options);\n update = applyToTag.bind(null, style, options);\n\n remove = function remove() {\n removeStyleElement(style);\n };\n }\n\n update(obj);\n return function updateStyle(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {\n return;\n }\n\n update(obj = newObj);\n } else {\n remove();\n }\n };\n}\n\nmodule.exports = function (list, options) {\n options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n // tags it will allow on a page\n\n if (!options.singleton && typeof options.singleton !== 'boolean') {\n options.singleton = isOldIE();\n }\n\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n\n if (Object.prototype.toString.call(newList) !== '[object Array]') {\n return;\n }\n\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDom[index].references--;\n }\n\n var newLastIdentifiers = modulesToDom(newList, options);\n\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n\n var _index = getIndexByIdentifier(_identifier);\n\n if (stylesInDom[_index].references === 0) {\n stylesInDom[_index].updater();\n\n stylesInDom.splice(_index, 1);\n }\n }\n\n lastIdentifiers = newLastIdentifiers;\n };\n};","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","__webpack_require__.nc = undefined;","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* global document */\n/**\n * Handles clicking **outside** of a specified set of elements, then fires an action.\n *\n * **Note**: Actually, the action is executed upon `mousedown`, not `click`. It prevents\n * certain issues when the user keeps holding the mouse button and the UI cannot react\n * properly.\n *\n * @param options Configuration options.\n * @param options.emitter The emitter to which this behavior should be added.\n * @param options.activator Function returning a `Boolean`, to determine whether the handler is active.\n * @param options.contextElements Array of HTML elements or a callback returning an array of HTML elements\n * that determine the scope of the handler. Clicking any of them or their descendants will **not** fire the callback.\n * @param options.callback An action executed by the handler.\n */\nexport default function clickOutsideHandler({ emitter, activator, callback, contextElements }) {\n emitter.listenTo(document, 'mousedown', (evt, domEvt) => {\n if (!activator()) {\n return;\n }\n // Check if `composedPath` is `undefined` in case the browser does not support native shadow DOM.\n // Can be removed when all supported browsers support native shadow DOM.\n const path = typeof domEvt.composedPath == 'function' ? domEvt.composedPath() : [];\n const contextElementsList = typeof contextElements == 'function' ? contextElements() : contextElements;\n for (const contextElement of contextElementsList) {\n if (contextElement.contains(domEvt.target) || path.includes(contextElement)) {\n return;\n }\n }\n callback();\n });\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * A mixin that brings the possibility to temporarily disable CSS transitions using\n * {@link module:ui/view~View} methods. It is helpful when, for instance, the transitions should not happen\n * when the view is first displayed but they should work normal in other cases.\n *\n * The methods to control the CSS transitions are:\n * * `disableCssTransitions()` Adds the `.ck-transitions-disabled` class to the\n * {@link module:ui/view~View#element view element}.\n * * `enableCssTransitions()` Removes the `.ck-transitions-disabled` class from the\n * {@link module:ui/view~View#element view element}.\n *\n * The usage comes down to:\n *\n * ```ts\n * const MyViewWithCssTransitionDisabler = CssTransitionDisablerMixin( MyView );\n * const view = new MyViewWithCssTransitionDisabler();\n *\n * // ...\n *\n * view.disableCssTransitions();\n * view.show();\n * view.enableCssTransitions();\n * ```\n *\n * @param view View instance that should get this functionality.\n */\nexport default function CssTransitionDisablerMixin(view) {\n class Mixin extends view {\n disableCssTransitions() {\n this._isCssTransitionsDisabled = true;\n }\n enableCssTransitions() {\n this._isCssTransitionsDisabled = false;\n }\n constructor(...args) {\n super(...args);\n this.set('_isCssTransitionsDisabled', false);\n this.initializeCssTransitionDisablerMixin();\n }\n initializeCssTransitionDisablerMixin() {\n this.extendTemplate({\n attributes: {\n class: [\n this.bindTemplate.if('_isCssTransitionsDisabled', 'ck-transitions-disabled')\n ]\n }\n });\n }\n }\n return Mixin;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * A handler useful for {@link module:ui/view~View views} working as HTML forms. It intercepts a native DOM\n * `submit` event, prevents the default web browser behavior (navigation and page reload) and\n * fires the `submit` event on a view instead. Such a custom event can be then used by any\n * {@link module:utils/dom/emittermixin~DomEmitter emitter}, e.g. to serialize the form data.\n *\n * ```ts\n * import submitHandler from '@ckeditor/ckeditor5-ui/src/bindings/submithandler';\n *\n * // ...\n *\n * class AnyFormView extends View {\n * \tconstructor() {\n * \t\tsuper();\n *\n * \t\t// ...\n *\n * \t\tsubmitHandler( {\n * \t\t\tview: this\n * \t\t} );\n * \t}\n * }\n *\n * // ...\n *\n * const view = new AnyFormView();\n *\n * // A sample listener attached by an emitter working with the view.\n * this.listenTo( view, 'submit', () => {\n * \tsaveTheFormData();\n * \thideTheForm();\n * } );\n * ```\n *\n * @param options Configuration options.\n * @param options.view The view which DOM `submit` events should be handled.\n */\nexport default function submitHandler({ view }) {\n view.listenTo(view.element, 'submit', (evt, domEvt) => {\n domEvt.preventDefault();\n view.fire('submit');\n }, { useCapture: true });\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * A helper that adds a keyboard navigation support (arrow up/down/left/right) for grids.\n *\n * @param options Configuration options.\n * @param options.keystrokeHandler Keystroke handler to register navigation with arrow keys.\n * @param options.focusTracker A focus tracker for grid elements.\n * @param options.gridItems A collection of grid items.\n * @param options.numberOfColumns Number of columns in the grid. Can be specified as a function that returns\n * the number (e.g. for responsive grids).\n * @param options.uiLanguageDirection String of ui language direction.\n */\nexport default function addKeyboardHandlingForGrid({ keystrokeHandler, focusTracker, gridItems, numberOfColumns, uiLanguageDirection }) {\n const getNumberOfColumns = typeof numberOfColumns === 'number' ? () => numberOfColumns : numberOfColumns;\n keystrokeHandler.set('arrowright', getGridItemFocuser((focusedElementIndex, gridItems) => {\n return uiLanguageDirection === 'rtl' ?\n getLeftElementIndex(focusedElementIndex, gridItems.length) :\n getRightElementIndex(focusedElementIndex, gridItems.length);\n }));\n keystrokeHandler.set('arrowleft', getGridItemFocuser((focusedElementIndex, gridItems) => {\n return uiLanguageDirection === 'rtl' ?\n getRightElementIndex(focusedElementIndex, gridItems.length) :\n getLeftElementIndex(focusedElementIndex, gridItems.length);\n }));\n keystrokeHandler.set('arrowup', getGridItemFocuser((focusedElementIndex, gridItems) => {\n let nextIndex = focusedElementIndex - getNumberOfColumns();\n if (nextIndex < 0) {\n nextIndex = focusedElementIndex + getNumberOfColumns() * Math.floor(gridItems.length / getNumberOfColumns());\n if (nextIndex > gridItems.length - 1) {\n nextIndex -= getNumberOfColumns();\n }\n }\n return nextIndex;\n }));\n keystrokeHandler.set('arrowdown', getGridItemFocuser((focusedElementIndex, gridItems) => {\n let nextIndex = focusedElementIndex + getNumberOfColumns();\n if (nextIndex > gridItems.length - 1) {\n nextIndex = focusedElementIndex % getNumberOfColumns();\n }\n return nextIndex;\n }));\n function getGridItemFocuser(getIndexToFocus) {\n return (evt) => {\n const focusedElement = gridItems.find(item => item.element === focusTracker.focusedElement);\n const focusedElementIndex = gridItems.getIndex(focusedElement);\n const nextIndexToFocus = getIndexToFocus(focusedElementIndex, gridItems);\n gridItems.get(nextIndexToFocus).focus();\n evt.stopPropagation();\n evt.preventDefault();\n };\n }\n /**\n * Function returning the next index.\n *\n * ```\n * before: [ ][x][ ]\tafter: [ ][ ][x]\n * index = 1 index = 2\n * ```\n *\n * If current index is last, function returns first index.\n *\n * ```\n * before: [ ][ ][x]\tafter: [x][ ][ ]\n * index = 2 index = 0\n * ```\n *\n * @param elementIndex Number of current index.\n * @param collectionLength A count of collection items.\n */\n function getRightElementIndex(elementIndex, collectionLength) {\n if (elementIndex === collectionLength - 1) {\n return 0;\n }\n else {\n return elementIndex + 1;\n }\n }\n /**\n * Function returning the previous index.\n *\n * ```\n * before: [ ][x][ ]\tafter: [x][ ][ ]\n * index = 1 index = 0\n * ```\n *\n * If current index is first, function returns last index.\n *\n * ```\n * before: [x][ ][ ]\tafter: [ ][ ][x]\n * index = 0 index = 2\n * ```\n *\n * @param elementIndex Number of current index.\n * @param collectionLength A count of collection items.\n */\n function getLeftElementIndex(elementIndex, collectionLength) {\n if (elementIndex === 0) {\n return collectionLength - 1;\n }\n else {\n return elementIndex - 1;\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* globals navigator:false */\n/**\n * @module utils/env\n */\n/**\n * Safely returns `userAgent` from browser's navigator API in a lower case.\n * If navigator API is not available it will return an empty string.\n */\nexport function getUserAgent() {\n // In some environments navigator API might not be available.\n try {\n return navigator.userAgent.toLowerCase();\n }\n catch (e) {\n return '';\n }\n}\nconst userAgent = getUserAgent();\n/**\n * A namespace containing environment and browser information.\n */\nconst env = {\n isMac: isMac(userAgent),\n isWindows: isWindows(userAgent),\n isGecko: isGecko(userAgent),\n isSafari: isSafari(userAgent),\n isiOS: isiOS(userAgent),\n isAndroid: isAndroid(userAgent),\n isBlink: isBlink(userAgent),\n features: {\n isRegExpUnicodePropertySupported: isRegExpUnicodePropertySupported()\n }\n};\nexport default env;\n/**\n * Checks if User Agent represented by the string is running on Macintosh.\n *\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is running on Macintosh or not.\n */\nexport function isMac(userAgent) {\n return userAgent.indexOf('macintosh') > -1;\n}\n/**\n * Checks if User Agent represented by the string is running on Windows.\n *\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is running on Windows or not.\n */\nexport function isWindows(userAgent) {\n return userAgent.indexOf('windows') > -1;\n}\n/**\n * Checks if User Agent represented by the string is Firefox (Gecko).\n *\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is Firefox or not.\n */\nexport function isGecko(userAgent) {\n return !!userAgent.match(/gecko\\/\\d+/);\n}\n/**\n * Checks if User Agent represented by the string is Safari.\n *\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is Safari or not.\n */\nexport function isSafari(userAgent) {\n return userAgent.indexOf(' applewebkit/') > -1 && userAgent.indexOf('chrome') === -1;\n}\n/**\n * Checks if User Agent represented by the string is running in iOS.\n *\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is running in iOS or not.\n */\nexport function isiOS(userAgent) {\n // \"Request mobile site\" || \"Request desktop site\".\n return !!userAgent.match(/iphone|ipad/i) || (isMac(userAgent) && navigator.maxTouchPoints > 0);\n}\n/**\n * Checks if User Agent represented by the string is Android mobile device.\n *\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is Safari or not.\n */\nexport function isAndroid(userAgent) {\n return userAgent.indexOf('android') > -1;\n}\n/**\n * Checks if User Agent represented by the string is Blink engine.\n *\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is Blink engine or not.\n */\nexport function isBlink(userAgent) {\n // The Edge browser before switching to the Blink engine used to report itself as Chrome (and \"Edge/\")\n // but after switching to the Blink it replaced \"Edge/\" with \"Edg/\".\n return userAgent.indexOf('chrome/') > -1 && userAgent.indexOf('edge/') < 0;\n}\n/**\n * Checks if the current environment supports ES2018 Unicode properties like `\\p{P}` or `\\p{L}`.\n * More information about unicode properties might be found\n * [in Unicode Standard Annex #44](https://www.unicode.org/reports/tr44/#GC_Values_Table).\n */\nexport function isRegExpUnicodePropertySupported() {\n let isSupported = false;\n // Feature detection for Unicode properties. Added in ES2018. Currently Firefox does not support it.\n // See https://github.com/ckeditor/ckeditor5-mention/issues/44#issuecomment-487002174.\n try {\n // Usage of regular expression literal cause error during build (ckeditor/ckeditor5-dev#534).\n isSupported = 'ć'.search(new RegExp('[\\\\p{L}]', 'u')) === 0;\n }\n catch (error) {\n // Firefox throws a SyntaxError when the group is unsupported.\n }\n return isSupported;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/fastdiff\n */\n/**\n * Finds positions of the first and last change in the given string/array and generates a set of changes:\n *\n * ```ts\n * fastDiff( '12a', '12xyza' );\n * // [ { index: 2, type: 'insert', values: [ 'x', 'y', 'z' ] } ]\n *\n * fastDiff( '12a', '12aa' );\n * // [ { index: 3, type: 'insert', values: [ 'a' ] } ]\n *\n * fastDiff( '12xyza', '12a' );\n * // [ { index: 2, type: 'delete', howMany: 3 } ]\n *\n * fastDiff( [ '1', '2', 'a', 'a' ], [ '1', '2', 'a' ] );\n * // [ { index: 3, type: 'delete', howMany: 1 } ]\n *\n * fastDiff( [ '1', '2', 'a', 'b', 'c', '3' ], [ '2', 'a', 'b' ] );\n * // [ { index: 0, type: 'insert', values: [ '2', 'a', 'b' ] }, { index: 3, type: 'delete', howMany: 6 } ]\n * ```\n *\n * Passed arrays can contain any type of data, however to compare them correctly custom comparator function\n * should be passed as a third parameter:\n *\n * ```ts\n * fastDiff( [ { value: 1 }, { value: 2 } ], [ { value: 1 }, { value: 3 } ], ( a, b ) => {\n * \treturn a.value === b.value;\n * } );\n * // [ { index: 1, type: 'insert', values: [ { value: 3 } ] }, { index: 2, type: 'delete', howMany: 1 } ]\n * ```\n *\n * The resulted set of changes can be applied to the input in order to transform it into the output, for example:\n *\n * ```ts\n * let input = '12abc3';\n * const output = '2ab';\n * const changes = fastDiff( input, output );\n *\n * changes.forEach( change => {\n * \tif ( change.type == 'insert' ) {\n * \t\tinput = input.substring( 0, change.index ) + change.values.join( '' ) + input.substring( change.index );\n * \t} else if ( change.type == 'delete' ) {\n * \t\tinput = input.substring( 0, change.index ) + input.substring( change.index + change.howMany );\n * \t}\n * } );\n *\n * // input equals output now\n * ```\n *\n * or in case of arrays:\n *\n * ```ts\n * let input = [ '1', '2', 'a', 'b', 'c', '3' ];\n * const output = [ '2', 'a', 'b' ];\n * const changes = fastDiff( input, output );\n *\n * changes.forEach( change => {\n * \tif ( change.type == 'insert' ) {\n * \t\tinput = input.slice( 0, change.index ).concat( change.values, input.slice( change.index ) );\n * \t} else if ( change.type == 'delete' ) {\n * \t\tinput = input.slice( 0, change.index ).concat( input.slice( change.index + change.howMany ) );\n * \t}\n * } );\n *\n * // input equals output now\n * ```\n *\n * By passing `true` as the fourth parameter (`atomicChanges`) the output of this function will become compatible with\n * the {@link module:utils/diff~diff `diff()`} function:\n *\n * ```ts\n * fastDiff( '12a', '12xyza', undefined, true );\n * // [ 'equal', 'equal', 'insert', 'insert', 'insert', 'equal' ]\n * ```\n *\n * The default output format of this function is compatible with the output format of\n * {@link module:utils/difftochanges~diffToChanges `diffToChanges()`}. The `diffToChanges()` input format is, in turn,\n * compatible with the output of {@link module:utils/diff~diff `diff()`}:\n *\n * ```ts\n * const a = '1234';\n * const b = '12xyz34';\n *\n * // Both calls will return the same results (grouped changes format).\n * fastDiff( a, b );\n * diffToChanges( diff( a, b ) );\n *\n * // Again, both calls will return the same results (atomic changes format).\n * fastDiff( a, b, undefined, true );\n * diff( a, b );\n * ```\n *\n * @typeParam T The type of array elements.\n * @typeParam AtomicChanges The type of `atomicChanges` parameter (selects the result type).\n * @param a Input array or string.\n * @param b Input array or string.\n * @param cmp Optional function used to compare array values, by default `===` (strict equal operator) is used.\n * @param atomicChanges Whether an array of `inset|delete|equal` operations should\n * be returned instead of changes set. This makes this function compatible with {@link module:utils/diff~diff `diff()`}.\n * Defaults to `false`.\n * @returns Array of changes. The elements are either {@link module:utils/diff~DiffResult} or {@link module:utils/difftochanges~Change},\n * depending on `atomicChanges` parameter.\n */\nexport default function fastDiff(a, b, cmp, atomicChanges) {\n // Set the comparator function.\n cmp = cmp || function (a, b) {\n return a === b;\n };\n // Convert the string (or any array-like object - eg. NodeList) to an array by using the slice() method because,\n // unlike Array.from(), it returns array of UTF-16 code units instead of the code points of a string.\n // One code point might be a surrogate pair of two code units. All text offsets are expected to be in code units.\n // See ckeditor/ckeditor5#3147.\n //\n // We need to make sure here that fastDiff() works identical to diff().\n const arrayA = Array.isArray(a) ? a : Array.prototype.slice.call(a);\n const arrayB = Array.isArray(b) ? b : Array.prototype.slice.call(b);\n // Find first and last change.\n const changeIndexes = findChangeBoundaryIndexes(arrayA, arrayB, cmp);\n // Transform into changes array.\n const result = atomicChanges ?\n changeIndexesToAtomicChanges(changeIndexes, arrayB.length) :\n changeIndexesToChanges(arrayB, changeIndexes);\n return result;\n}\n/**\n * Finds position of the first and last change in the given arrays. For example:\n *\n * ```ts\n * const indexes = findChangeBoundaryIndexes( [ '1', '2', '3', '4' ], [ '1', '3', '4', '2', '4' ] );\n * console.log( indexes ); // { firstIndex: 1, lastIndexOld: 3, lastIndexNew: 4 }\n * ```\n *\n * The above indexes means that in the first array the modified part is `1[23]4` and in the second array it is `1[342]4`.\n * Based on such indexes, array with `insert`/`delete` operations which allows transforming first value into the second one\n * can be generated.\n */\nfunction findChangeBoundaryIndexes(arr1, arr2, cmp) {\n // Find the first difference between passed values.\n const firstIndex = findFirstDifferenceIndex(arr1, arr2, cmp);\n // If arrays are equal return -1 indexes object.\n if (firstIndex === -1) {\n return { firstIndex: -1, lastIndexOld: -1, lastIndexNew: -1 };\n }\n // Remove the common part of each value and reverse them to make it simpler to find the last difference between them.\n const oldArrayReversed = cutAndReverse(arr1, firstIndex);\n const newArrayReversed = cutAndReverse(arr2, firstIndex);\n // Find the first difference between reversed values.\n // It should be treated as \"how many elements from the end the last difference occurred\".\n //\n // For example:\n //\n // \t\t\t\tinitial\t->\tafter cut\t-> reversed:\n // oldValue:\t'321ba'\t->\t'21ba'\t\t-> 'ab12'\n // newValue:\t'31xba'\t->\t'1xba'\t\t-> 'abx1'\n // lastIndex:\t\t\t\t\t\t\t-> 2\n //\n // So the last change occurred two characters from the end of the arrays.\n const lastIndex = findFirstDifferenceIndex(oldArrayReversed, newArrayReversed, cmp);\n // Use `lastIndex` to calculate proper offset, starting from the beginning (`lastIndex` kind of starts from the end).\n const lastIndexOld = arr1.length - lastIndex;\n const lastIndexNew = arr2.length - lastIndex;\n return { firstIndex, lastIndexOld, lastIndexNew };\n}\n/**\n * Returns a first index on which given arrays differ. If both arrays are the same, -1 is returned.\n */\nfunction findFirstDifferenceIndex(arr1, arr2, cmp) {\n for (let i = 0; i < Math.max(arr1.length, arr2.length); i++) {\n if (arr1[i] === undefined || arr2[i] === undefined || !cmp(arr1[i], arr2[i])) {\n return i;\n }\n }\n return -1; // Return -1 if arrays are equal.\n}\n/**\n * Returns a copy of the given array with `howMany` elements removed starting from the beginning and in reversed order.\n *\n * @param arr Array to be processed.\n * @param howMany How many elements from array beginning to remove.\n * @returns Shortened and reversed array.\n */\nfunction cutAndReverse(arr, howMany) {\n return arr.slice(howMany).reverse();\n}\n/**\n * Generates changes array based on change indexes from `findChangeBoundaryIndexes` function. This function will\n * generate array with 0 (no changes), 1 (deletion or insertion) or 2 records (insertion and deletion).\n *\n * @param newArray New array for which change indexes were calculated.\n * @param changeIndexes Change indexes object from `findChangeBoundaryIndexes` function.\n * @returns Array of changes compatible with {@link module:utils/difftochanges~diffToChanges} format.\n */\nfunction changeIndexesToChanges(newArray, changeIndexes) {\n const result = [];\n const { firstIndex, lastIndexOld, lastIndexNew } = changeIndexes;\n // Order operations as 'insert', 'delete' array to keep compatibility with {@link module:utils/difftochanges~diffToChanges}\n // in most cases. However, 'diffToChanges' does not stick to any order so in some cases\n // (for example replacing '12345' with 'abcd') it will generate 'delete', 'insert' order.\n if (lastIndexNew - firstIndex > 0) {\n result.push({\n index: firstIndex,\n type: 'insert',\n values: newArray.slice(firstIndex, lastIndexNew)\n });\n }\n if (lastIndexOld - firstIndex > 0) {\n result.push({\n index: firstIndex + (lastIndexNew - firstIndex),\n type: 'delete',\n howMany: lastIndexOld - firstIndex\n });\n }\n return result;\n}\n/**\n * Generates array with set `equal|insert|delete` operations based on change indexes from `findChangeBoundaryIndexes` function.\n *\n * @param changeIndexes Change indexes object from `findChangeBoundaryIndexes` function.\n * @param newLength Length of the new array on which `findChangeBoundaryIndexes` calculated change indexes.\n * @returns Array of changes compatible with {@link module:utils/diff~diff} format.\n */\nfunction changeIndexesToAtomicChanges(changeIndexes, newLength) {\n const { firstIndex, lastIndexOld, lastIndexNew } = changeIndexes;\n // No changes.\n if (firstIndex === -1) {\n return Array(newLength).fill('equal');\n }\n let result = [];\n if (firstIndex > 0) {\n result = result.concat(Array(firstIndex).fill('equal'));\n }\n if (lastIndexNew - firstIndex > 0) {\n result = result.concat(Array(lastIndexNew - firstIndex).fill('insert'));\n }\n if (lastIndexOld - firstIndex > 0) {\n result = result.concat(Array(lastIndexOld - firstIndex).fill('delete'));\n }\n if (lastIndexNew < newLength) {\n result = result.concat(Array(newLength - lastIndexNew).fill('equal'));\n }\n return result;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/diff\n */\nimport fastDiff from './fastdiff';\n// The following code is based on the \"O(NP) Sequence Comparison Algorithm\"\n// by Sun Wu, Udi Manber, Gene Myers, Webb Miller.\n/**\n * Calculates the difference between two arrays or strings producing an array containing a list of changes\n * necessary to transform input into output.\n *\n * ```ts\n * diff( 'aba', 'acca' ); // [ 'equal', 'insert', 'insert', 'delete', 'equal' ]\n * ```\n *\n * This function is based on the \"O(NP) Sequence Comparison Algorithm\" by Sun Wu, Udi Manber, Gene Myers, Webb Miller.\n * Unfortunately, while it gives the most precise results, its to complex for longer strings/arrow (above 200 items).\n * Therefore, `diff()` automatically switches to {@link module:utils/fastdiff~fastDiff `fastDiff()`} when detecting\n * such a scenario. The return formats of both functions are identical.\n *\n * @param a Input array or string.\n * @param b Output array or string.\n * @param cmp Optional function used to compare array values, by default === is used.\n * @returns Array of changes.\n */\nexport default function diff(a, b, cmp) {\n // Set the comparator function.\n cmp = cmp || function (a, b) {\n return a === b;\n };\n const aLength = a.length;\n const bLength = b.length;\n // Perform `fastDiff` for longer strings/arrays (see #269).\n if (aLength > 200 || bLength > 200 || aLength + bLength > 300) {\n return diff.fastDiff(a, b, cmp, true);\n }\n // Temporary action type statics.\n let _insert, _delete;\n // Swapped the arrays to use the shorter one as the first one.\n if (bLength < aLength) {\n const tmp = a;\n a = b;\n b = tmp;\n // We swap the action types as well.\n _insert = 'delete';\n _delete = 'insert';\n }\n else {\n _insert = 'insert';\n _delete = 'delete';\n }\n const m = a.length;\n const n = b.length;\n const delta = n - m;\n // Edit scripts, for each diagonal.\n const es = {};\n // Furthest points, the furthest y we can get on each diagonal.\n const fp = {};\n function snake(k) {\n // We use -1 as an alternative below to handle initial values ( instead of filling the fp with -1 first ).\n // Furthest points (y) on the diagonal below k.\n const y1 = (fp[k - 1] !== undefined ? fp[k - 1] : -1) + 1;\n // Furthest points (y) on the diagonal above k.\n const y2 = fp[k + 1] !== undefined ? fp[k + 1] : -1;\n // The way we should go to get further.\n const dir = y1 > y2 ? -1 : 1;\n // Clone previous changes array (if any).\n if (es[k + dir]) {\n es[k] = es[k + dir].slice(0);\n }\n // Create changes array.\n if (!es[k]) {\n es[k] = [];\n }\n // Push the action.\n es[k].push(y1 > y2 ? _insert : _delete);\n // Set the beginning coordinates.\n let y = Math.max(y1, y2);\n let x = y - k;\n // Traverse the diagonal as long as the values match.\n while (x < m && y < n && cmp(a[x], b[y])) {\n x++;\n y++;\n // Push no change action.\n es[k].push('equal');\n }\n return y;\n }\n let p = 0;\n let k;\n // Traverse the graph until we reach the end of the longer string.\n do {\n // Updates furthest points and edit scripts for diagonals below delta.\n for (k = -p; k < delta; k++) {\n fp[k] = snake(k);\n }\n // Updates furthest points and edit scripts for diagonals above delta.\n for (k = delta + p; k > delta; k--) {\n fp[k] = snake(k);\n }\n // Updates furthest point and edit script for the delta diagonal.\n // note that the delta diagonal is the one which goes through the sink (m, n).\n fp[delta] = snake(delta);\n p++;\n } while (fp[delta] !== n);\n // Return the final list of edit changes.\n // We remove the first item that represents the action for the injected nulls.\n return es[delta].slice(1);\n}\n// Store the API in static property to easily overwrite it in tests.\n// Too bad dependency injection does not work in Webpack + ES 6 (const) + Babel.\ndiff.fastDiff = fastDiff;\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/spy\n */\n/**\n * Creates a spy function (ala Sinon.js) that can be used to inspect call to it.\n *\n * The following are the present features:\n *\n * * spy.called: property set to `true` if the function has been called at least once.\n *\n * @returns The spy function.\n */\nfunction spy() {\n return function spy() {\n spy.called = true;\n };\n}\nexport default spy;\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/eventinfo\n */\nimport spy from './spy';\n/**\n * The event object passed to event callbacks. It is used to provide information about the event as well as a tool to\n * manipulate it.\n */\nexport default class EventInfo {\n /**\n * @param source The emitter.\n * @param name The event name.\n */\n constructor(source, name) {\n this.source = source;\n this.name = name;\n this.path = [];\n // The following methods are defined in the constructor because they must be re-created per instance.\n this.stop = spy();\n this.off = spy();\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/uid\n */\n/**\n * A hash table of hex numbers to avoid using toString() in uid() which is costly.\n * [ '00', '01', '02', ..., 'fe', 'ff' ]\n */\nconst HEX_NUMBERS = new Array(256).fill('')\n .map((_, index) => ('0' + (index).toString(16)).slice(-2));\n/**\n * Returns a unique id. The id starts with an \"e\" character and a randomly generated string of\n * 32 alphanumeric characters.\n *\n * **Note**: The characters the unique id is built from correspond to the hex number notation\n * (from \"0\" to \"9\", from \"a\" to \"f\"). In other words, each id corresponds to an \"e\" followed\n * by 16 8-bit numbers next to each other.\n *\n * @returns An unique id string.\n */\nexport default function uid() {\n // Let's create some positive random 32bit integers first.\n //\n // 1. Math.random() is a float between 0 and 1.\n // 2. 0x100000000 is 2^32 = 4294967296.\n // 3. >>> 0 enforces integer (in JS all numbers are floating point).\n //\n // For instance:\n //\t\tMath.random() * 0x100000000 = 3366450031.853859\n // but\n //\t\tMath.random() * 0x100000000 >>> 0 = 3366450031.\n const r1 = Math.random() * 0x100000000 >>> 0;\n const r2 = Math.random() * 0x100000000 >>> 0;\n const r3 = Math.random() * 0x100000000 >>> 0;\n const r4 = Math.random() * 0x100000000 >>> 0;\n // Make sure that id does not start with number.\n return 'e' +\n HEX_NUMBERS[r1 >> 0 & 0xFF] +\n HEX_NUMBERS[r1 >> 8 & 0xFF] +\n HEX_NUMBERS[r1 >> 16 & 0xFF] +\n HEX_NUMBERS[r1 >> 24 & 0xFF] +\n HEX_NUMBERS[r2 >> 0 & 0xFF] +\n HEX_NUMBERS[r2 >> 8 & 0xFF] +\n HEX_NUMBERS[r2 >> 16 & 0xFF] +\n HEX_NUMBERS[r2 >> 24 & 0xFF] +\n HEX_NUMBERS[r3 >> 0 & 0xFF] +\n HEX_NUMBERS[r3 >> 8 & 0xFF] +\n HEX_NUMBERS[r3 >> 16 & 0xFF] +\n HEX_NUMBERS[r3 >> 24 & 0xFF] +\n HEX_NUMBERS[r4 >> 0 & 0xFF] +\n HEX_NUMBERS[r4 >> 8 & 0xFF] +\n HEX_NUMBERS[r4 >> 16 & 0xFF] +\n HEX_NUMBERS[r4 >> 24 & 0xFF];\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Provides group of constants to use instead of hardcoding numeric priority values.\n */\nconst priorities = {\n get(priority = 'normal') {\n if (typeof priority != 'number') {\n return this[priority] || this.normal;\n }\n else {\n return priority;\n }\n },\n highest: 100000,\n high: 1000,\n normal: 0,\n low: -1000,\n lowest: -100000\n};\nexport default priorities;\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport priorities from './priorities';\n/**\n * Inserts any object with priority at correct index by priority so registered objects are always sorted from highest to lowest priority.\n *\n * @param objects Array of objects with priority to insert object to.\n * @param objectToInsert Object with `priority` property.\n */\nexport default function insertToPriorityArray(objects, objectToInsert) {\n const priority = priorities.get(objectToInsert.priority);\n for (let i = 0; i < objects.length; i++) {\n if (priorities.get(objects[i].priority) < priority) {\n objects.splice(i, 0, objectToInsert);\n return;\n }\n }\n objects.push(objectToInsert);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/ckeditorerror\n */\n/* globals console */\n/**\n * URL to the documentation with error codes.\n */\nexport const DOCUMENTATION_URL = 'https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html';\n/**\n * The CKEditor error class.\n *\n * You should throw `CKEditorError` when:\n *\n * * An unexpected situation occurred and the editor (most probably) will not work properly. Such exception will be handled\n * by the {@link module:watchdog/watchdog~Watchdog watchdog} (if it is integrated),\n * * If the editor is incorrectly integrated or the editor API is used in the wrong way. This way you will give\n * feedback to the developer as soon as possible. Keep in mind that for common integration issues which should not\n * stop editor initialization (like missing upload adapter, wrong name of a toolbar component) we use\n * {@link module:utils/ckeditorerror~logWarning `logWarning()`} and\n * {@link module:utils/ckeditorerror~logError `logError()`}\n * to improve developers experience and let them see the a working editor as soon as possible.\n *\n * ```ts\n * /**\n * * Error thrown when a plugin cannot be loaded due to JavaScript errors, lack of plugins with a given name, etc.\n * *\n * * @error plugin-load\n * * @param pluginName The name of the plugin that could not be loaded.\n * * @param moduleName The name of the module which tried to load this plugin.\n * *\\/\n * throw new CKEditorError( 'plugin-load', {\n * \tpluginName: 'foo',\n * \tmoduleName: 'bar'\n * } );\n * ```\n */\nexport default class CKEditorError extends Error {\n /**\n * Creates an instance of the CKEditorError class.\n *\n * @param errorName The error id in an `error-name` format. A link to this error documentation page will be added\n * to the thrown error's `message`.\n * @param context A context of the error by which the {@link module:watchdog/watchdog~Watchdog watchdog}\n * is able to determine which editor crashed. It should be an editor instance or a property connected to it. It can be also\n * a `null` value if the editor should not be restarted in case of the error (e.g. during the editor initialization).\n * The error context should be checked using the `areConnectedThroughProperties( editor, context )` utility\n * to check if the object works as the context.\n * @param data Additional data describing the error. A stringified version of this object\n * will be appended to the error message, so the data are quickly visible in the console. The original\n * data object will also be later available under the {@link #data} property.\n */\n constructor(errorName, context, data) {\n super(getErrorMessage(errorName, data));\n this.name = 'CKEditorError';\n this.context = context;\n this.data = data;\n }\n /**\n * Checks if the error is of the `CKEditorError` type.\n */\n is(type) {\n return type === 'CKEditorError';\n }\n /**\n * A utility that ensures that the thrown error is a {@link module:utils/ckeditorerror~CKEditorError} one.\n * It is useful when combined with the {@link module:watchdog/watchdog~Watchdog} feature, which can restart the editor in case\n * of a {@link module:utils/ckeditorerror~CKEditorError} error.\n *\n * @param err The error to rethrow.\n * @param context An object connected through properties with the editor instance. This context will be used\n * by the watchdog to verify which editor should be restarted.\n */\n static rethrowUnexpectedError(err, context) {\n if (err.is && err.is('CKEditorError')) {\n throw err;\n }\n /**\n * An unexpected error occurred inside the CKEditor 5 codebase. This error will look like the original one\n * to make the debugging easier.\n *\n * This error is only useful when the editor is initialized using the {@link module:watchdog/watchdog~Watchdog} feature.\n * In case of such error (or any {@link module:utils/ckeditorerror~CKEditorError} error) the watchdog should restart the editor.\n *\n * @error unexpected-error\n */\n const error = new CKEditorError(err.message, context);\n // Restore the original stack trace to make the error look like the original one.\n // See https://github.com/ckeditor/ckeditor5/issues/5595 for more details.\n error.stack = err.stack;\n throw error;\n }\n}\n/**\n * Logs a warning to the console with a properly formatted message and adds a link to the documentation.\n * Use whenever you want to log a warning to the console.\n *\n * ```ts\n * /**\n * * There was a problem processing the configuration of the toolbar. The item with the given\n * * name does not exist, so it was omitted when rendering the toolbar.\n * *\n * * @error toolbarview-item-unavailable\n * * @param {String} name The name of the component.\n * *\\/\n * logWarning( 'toolbarview-item-unavailable', { name } );\n * ```\n *\n * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to throw an error and when to log\n * a warning or an error to the console.\n *\n * @param errorName The error name to be logged.\n * @param data Additional data to be logged.\n */\nexport function logWarning(errorName, data) {\n console.warn(...formatConsoleArguments(errorName, data));\n}\n/**\n * Logs an error to the console with a properly formatted message and adds a link to the documentation.\n * Use whenever you want to log an error to the console.\n *\n * ```ts\n * /**\n * * There was a problem processing the configuration of the toolbar. The item with the given\n * * name does not exist, so it was omitted when rendering the toolbar.\n * *\n * * @error toolbarview-item-unavailable\n * * @param {String} name The name of the component.\n * *\\/\n * logError( 'toolbarview-item-unavailable', { name } );\n * ```\n *\n * **Note**: In most cases logging a warning using {@link module:utils/ckeditorerror~logWarning} is enough.\n *\n * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to use each method.\n *\n * @param errorName The error name to be logged.\n * @param data Additional data to be logged.\n */\nexport function logError(errorName, data) {\n console.error(...formatConsoleArguments(errorName, data));\n}\n/**\n * Returns formatted link to documentation message.\n */\nfunction getLinkToDocumentationMessage(errorName) {\n return `\\nRead more: ${DOCUMENTATION_URL}#error-${errorName}`;\n}\n/**\n * Returns formatted error message.\n */\nfunction getErrorMessage(errorName, data) {\n const processedObjects = new WeakSet();\n const circularReferencesReplacer = (key, value) => {\n if (typeof value === 'object' && value !== null) {\n if (processedObjects.has(value)) {\n return `[object ${value.constructor.name}]`;\n }\n processedObjects.add(value);\n }\n return value;\n };\n const stringifiedData = data ? ` ${JSON.stringify(data, circularReferencesReplacer)}` : '';\n const documentationLink = getLinkToDocumentationMessage(errorName);\n return errorName + stringifiedData + documentationLink;\n}\n/**\n * Returns formatted console error arguments.\n */\nfunction formatConsoleArguments(errorName, data) {\n const documentationMessage = getLinkToDocumentationMessage(errorName);\n return data ? [errorName, data, documentationMessage] : [errorName, documentationMessage];\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/version\n */\n/* globals window, global */\nimport CKEditorError from './ckeditorerror';\nconst version = '38.0.1';\nexport default version;\n// The second argument is not a month. It is `monthIndex` and starts from `0`.\nexport const releaseDate = new Date(2023, 4, 23);\n/* istanbul ignore next -- @preserve */\nconst windowOrGlobal = typeof window === 'object' ? window : global;\n/* istanbul ignore next -- @preserve */\nif (windowOrGlobal.CKEDITOR_VERSION) {\n /**\n * This error is thrown when due to a mistake in how CKEditor 5 was installed or initialized, some\n * of its modules were duplicated (evaluated and executed twice). Module duplication leads to inevitable runtime\n * errors.\n *\n * There are many situations in which some modules can be loaded twice. In the worst case scenario,\n * you may need to check your project for each of these issues and fix them all.\n *\n * # Trying to add a plugin to an existing build\n *\n * If you import an existing CKEditor 5 build and a plugin like this:\n *\n * ```ts\n * import ClassicEditor from '@ckeditor/ckeditor5-build-classic';\n * import Highlight from '@ckeditor/ckeditor5-highlight/src/highlight';\n * ```\n *\n * Then your project loads some CKEditor 5 packages twice. How does it happen?\n *\n * The build package contains a file which is already compiled with webpack. This means\n * that it contains all the necessary code from e.g. `@ckeditor/ckeditor5-engine` and `@ckeditor/ckeditor5-utils`.\n *\n * However, the `Highlight` plugin imports some of the modules from these packages, too. If you ask webpack to\n * build such a project, you will end up with the modules being included (and run) twice &mdash; first, because they are\n * included inside the build package, and second, because they are required by the `Highlight` plugin.\n *\n * Therefore, **you must never add plugins to an existing build** unless your plugin has no dependencies.\n *\n * Adding plugins to a build is done by taking the source version of this build (so, before it was built with webpack)\n * and adding plugins there. In this situation, webpack will know that it only needs to load each plugin once.\n *\n * Read more in the {@glink installation/plugins/installing-plugins Installing plugins} guide.\n *\n * # Confused an editor build with an editor implementation\n *\n * This scenario is very similar to the previous one, but has a different origin.\n *\n * Let's assume that you wanted to use CKEditor 5 from source, as explained in the\n * {@glink installation/advanced/alternative-setups/integrating-from-source-webpack \"Building from source\"} section\n * or in the {@glink framework/quick-start \"Quick start\"} guide of CKEditor 5 Framework.\n *\n * The correct way to do so is to import an editor and plugins and run them together like this:\n *\n * ```ts\n * import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';\n * import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';\n * import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';\n * import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';\n * import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';\n *\n * ClassicEditor\n * \t.create( document.querySelector( '#editor' ), {\n * \t\tplugins: [ Essentials, Paragraph, Bold, Italic ],\n * \t\ttoolbar: [ 'bold', 'italic' ]\n * \t} )\n * \t.then( editor => {\n * \t\tconsole.log( 'Editor was initialized', editor );\n * \t} )\n * \t.catch( error => {\n * \t\tconsole.error( error.stack );\n * \t} );\n * ```\n *\n * However, you might have mistakenly imported a build instead of the source `ClassicEditor`. In this case\n * your imports will look like this:\n *\n * ```ts\n * import ClassicEditor from '@ckeditor/ckeditor5-build-classic';\n * import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';\n * import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';\n * import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';\n * import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';\n * ```\n *\n * This creates the same situation as in the previous section because you use a build together with source plugins.\n *\n * Remember: `@ckeditor/ckeditor5-build-*` packages contain editor builds and `@ckeditor/ckeditor5-editor-*` contain source editors.\n *\n * # Loading two or more builds on one page\n *\n * If you use CKEditor 5 builds, you might have loaded two (or more) `ckeditor.js` files on one web page.\n * Check your web page for duplicated `<script>` elements or make sure your page builder/bundler includes CKEditor only once.\n *\n * If you want to use two different types of editors at once, see the\n * {@glink installation/advanced/using-two-editors \"Using two different editors\"}\n * section.\n *\n * # Using outdated packages\n *\n * Building CKEditor 5 from source requires using multiple npm packages. These packages have their dependencies\n * to other packages. If you use the latest version of, for example, `@ckeditor/ckeditor5-editor-classic` with\n * an outdated version of `@ckeditor/ckeditor5-image`, npm or yarn will need to install two different versions of\n * `@ckeditor/ckeditor5-core` because `@ckeditor/ckeditor5-editor-classic` and `@ckeditor/ckeditor5-image` may require\n * different versions of the core package.\n *\n * The solution to this issue is to update all packages to their latest version. We recommend\n * using tools like [`npm-check-updates`](https://www.npmjs.com/package/npm-check-updates) which simplify this process.\n *\n * # Conflicting version of dependencies\n *\n * This is a special case of the previous scenario. If you use CKEditor 5 with some third-party plugins,\n * it may happen that even if you use the latest versions of the official packages and the latest version of\n * these third-party packages, there will be a conflict between some of their dependencies.\n *\n * Such a problem can be resolved by either downgrading CKEditor 5 packages (which we do not recommend) or\n * asking the author of the third-party package to upgrade its depdendencies (or forking their project and doing this yourself).\n *\n * **Note:** All official CKEditor 5 packages (excluding integrations and `ckeditor5-dev-*` packages) are released in the\n * same major version. This is &mdash; in the `x.y.z`, the `x` is the same for all packages. This is the simplest way to check\n * whether you use packages coming from the same CKEditor 5 version. You can read more about versioning in the\n * {@glink updating/versioning-policy Versioning policy} guide.\n *\n * # Packages were duplicated in `node_modules`\n *\n * In some situations, especially when calling `npm install` multiple times, it may happen\n * that npm will not correctly \"deduplicate\" packages.\n *\n * Normally, npm deduplicates all packages so, for example, `@ckeditor/ckeditor5-core` is installed only once in `node_modules/`.\n * However, it is known to fail to do so from time to time.\n *\n * We recommend checking if any of the steps listed below help:\n *\n * * `rm -rf node_modules && npm install` to make sure you have a clean `node_modules/` directory. This step\n * is known to help in most cases.\n * * If you use `yarn.lock` or `package-lock.json`, remove it before `npm install`.\n * * Check whether all CKEditor 5 packages are up to date and reinstall them\n * if you changed anything (`rm -rf node_modules && npm install`).\n *\n * If all packages are correct and compatible with each other, the steps above are known to help. If not, you may\n * try to check with `npm ls` how many times packages like `@ckeditor/ckeditor5-core`, `@ckeditor/ckeditor5-engine` and\n *`@ckeditor/ckeditor5-utils` are installed. If more than once, verify which package causes that.\n *\n * @error ckeditor-duplicated-modules\n */\n throw new CKEditorError('ckeditor-duplicated-modules', null);\n}\nelse {\n windowOrGlobal.CKEDITOR_VERSION = version;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/emittermixin\n */\nimport EventInfo from './eventinfo';\nimport uid from './uid';\nimport priorities from './priorities';\nimport insertToPriorityArray from './inserttopriorityarray';\n// To check if component is loaded more than once.\nimport './version';\nimport CKEditorError from './ckeditorerror';\nconst _listeningTo = Symbol('listeningTo');\nconst _emitterId = Symbol('emitterId');\nconst _delegations = Symbol('delegations');\nconst defaultEmitterClass = EmitterMixin(Object);\nexport default function EmitterMixin(base) {\n if (!base) {\n return defaultEmitterClass;\n }\n class Mixin extends base {\n on(event, callback, options) {\n this.listenTo(this, event, callback, options);\n }\n once(event, callback, options) {\n let wasFired = false;\n const onceCallback = (event, ...args) => {\n // Ensure the callback is called only once even if the callback itself leads to re-firing the event\n // (which would call the callback again).\n if (!wasFired) {\n wasFired = true;\n // Go off() at the first call.\n event.off();\n // Go with the original callback.\n callback.call(this, event, ...args);\n }\n };\n // Make a similar on() call, simply replacing the callback.\n this.listenTo(this, event, onceCallback, options);\n }\n off(event, callback) {\n this.stopListening(this, event, callback);\n }\n listenTo(emitter, event, callback, options = {}) {\n let emitterInfo, eventCallbacks;\n // _listeningTo contains a list of emitters that this object is listening to.\n // This list has the following format:\n //\n // _listeningTo: {\n // emitterId: {\n // emitter: emitter,\n // callbacks: {\n // event1: [ callback1, callback2, ... ]\n // ....\n // }\n // },\n // ...\n // }\n if (!this[_listeningTo]) {\n this[_listeningTo] = {};\n }\n const emitters = this[_listeningTo];\n if (!_getEmitterId(emitter)) {\n _setEmitterId(emitter);\n }\n const emitterId = _getEmitterId(emitter);\n if (!(emitterInfo = emitters[emitterId])) {\n emitterInfo = emitters[emitterId] = {\n emitter,\n callbacks: {}\n };\n }\n if (!(eventCallbacks = emitterInfo.callbacks[event])) {\n eventCallbacks = emitterInfo.callbacks[event] = [];\n }\n eventCallbacks.push(callback);\n // Finally register the callback to the event.\n addEventListener(this, emitter, event, callback, options);\n }\n stopListening(emitter, event, callback) {\n const emitters = this[_listeningTo];\n let emitterId = emitter && _getEmitterId(emitter);\n const emitterInfo = (emitters && emitterId) ? emitters[emitterId] : undefined;\n const eventCallbacks = (emitterInfo && event) ? emitterInfo.callbacks[event] : undefined;\n // Stop if nothing has been listened.\n if (!emitters || (emitter && !emitterInfo) || (event && !eventCallbacks)) {\n return;\n }\n // All params provided. off() that single callback.\n if (callback) {\n removeEventListener(this, emitter, event, callback);\n // We must remove callbacks as well in order to prevent memory leaks.\n // See https://github.com/ckeditor/ckeditor5/pull/8480\n const index = eventCallbacks.indexOf(callback);\n if (index !== -1) {\n if (eventCallbacks.length === 1) {\n delete emitterInfo.callbacks[event];\n }\n else {\n removeEventListener(this, emitter, event, callback);\n }\n }\n }\n // Only `emitter` and `event` provided. off() all callbacks for that event.\n else if (eventCallbacks) {\n while ((callback = eventCallbacks.pop())) {\n removeEventListener(this, emitter, event, callback);\n }\n delete emitterInfo.callbacks[event];\n }\n // Only `emitter` provided. off() all events for that emitter.\n else if (emitterInfo) {\n for (event in emitterInfo.callbacks) {\n this.stopListening(emitter, event);\n }\n delete emitters[emitterId];\n }\n // No params provided. off() all emitters.\n else {\n for (emitterId in emitters) {\n this.stopListening(emitters[emitterId].emitter);\n }\n delete this[_listeningTo];\n }\n }\n fire(eventOrInfo, ...args) {\n try {\n const eventInfo = eventOrInfo instanceof EventInfo ? eventOrInfo : new EventInfo(this, eventOrInfo);\n const event = eventInfo.name;\n let callbacks = getCallbacksForEvent(this, event);\n // Record that the event passed this emitter on its path.\n eventInfo.path.push(this);\n // Handle event listener callbacks first.\n if (callbacks) {\n // Arguments passed to each callback.\n const callbackArgs = [eventInfo, ...args];\n // Copying callbacks array is the easiest and most secure way of preventing infinite loops, when event callbacks\n // are added while processing other callbacks. Previous solution involved adding counters (unique ids) but\n // failed if callbacks were added to the queue before currently processed callback.\n // If this proves to be too inefficient, another method is to change `.on()` so callbacks are stored if same\n // event is currently processed. Then, `.fire()` at the end, would have to add all stored events.\n callbacks = Array.from(callbacks);\n for (let i = 0; i < callbacks.length; i++) {\n callbacks[i].callback.apply(this, callbackArgs);\n // Remove the callback from future requests if off() has been called.\n if (eventInfo.off.called) {\n // Remove the called mark for the next calls.\n delete eventInfo.off.called;\n this._removeEventListener(event, callbacks[i].callback);\n }\n // Do not execute next callbacks if stop() was called.\n if (eventInfo.stop.called) {\n break;\n }\n }\n }\n // Delegate event to other emitters if needed.\n const delegations = this[_delegations];\n if (delegations) {\n const destinations = delegations.get(event);\n const passAllDestinations = delegations.get('*');\n if (destinations) {\n fireDelegatedEvents(destinations, eventInfo, args);\n }\n if (passAllDestinations) {\n fireDelegatedEvents(passAllDestinations, eventInfo, args);\n }\n }\n return eventInfo.return;\n }\n catch (err) {\n // @if CK_DEBUG // throw err;\n /* istanbul ignore next -- @preserve */\n CKEditorError.rethrowUnexpectedError(err, this);\n }\n }\n delegate(...events) {\n return {\n to: (emitter, nameOrFunction) => {\n if (!this[_delegations]) {\n this[_delegations] = new Map();\n }\n // Originally there was a for..of loop which unfortunately caused an error in Babel that didn't allow\n // build an application. See: https://github.com/ckeditor/ckeditor5-react/issues/40.\n events.forEach(eventName => {\n const destinations = this[_delegations].get(eventName);\n if (!destinations) {\n this[_delegations].set(eventName, new Map([[emitter, nameOrFunction]]));\n }\n else {\n destinations.set(emitter, nameOrFunction);\n }\n });\n }\n };\n }\n stopDelegating(event, emitter) {\n if (!this[_delegations]) {\n return;\n }\n if (!event) {\n this[_delegations].clear();\n }\n else if (!emitter) {\n this[_delegations].delete(event);\n }\n else {\n const destinations = this[_delegations].get(event);\n if (destinations) {\n destinations.delete(emitter);\n }\n }\n }\n _addEventListener(event, callback, options) {\n createEventNamespace(this, event);\n const lists = getCallbacksListsForNamespace(this, event);\n const priority = priorities.get(options.priority);\n const callbackDefinition = {\n callback,\n priority\n };\n // Add the callback to all callbacks list.\n for (const callbacks of lists) {\n // Add the callback to the list in the right priority position.\n insertToPriorityArray(callbacks, callbackDefinition);\n }\n }\n _removeEventListener(event, callback) {\n const lists = getCallbacksListsForNamespace(this, event);\n for (const callbacks of lists) {\n for (let i = 0; i < callbacks.length; i++) {\n if (callbacks[i].callback == callback) {\n // Remove the callback from the list (fixing the next index).\n callbacks.splice(i, 1);\n i--;\n }\n }\n }\n }\n }\n return Mixin;\n}\n// Backward compatibility with `mix`\n([\n 'on', 'once', 'off', 'listenTo',\n 'stopListening', 'fire', 'delegate', 'stopDelegating',\n '_addEventListener', '_removeEventListener'\n]).forEach(key => {\n EmitterMixin[key] = defaultEmitterClass.prototype[key];\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 * @internal\n * @param listeningEmitter An emitter that listens.\n * @param listenedToEmitterId Unique emitter id of emitter listened to.\n */\nexport function _getEmitterListenedTo(listeningEmitter, listenedToEmitterId) {\n const listeningTo = listeningEmitter[_listeningTo];\n if (listeningTo && listeningTo[listenedToEmitterId]) {\n return listeningTo[listenedToEmitterId].emitter;\n }\n return null;\n}\n/**\n * Sets emitter's unique id.\n *\n * **Note:** `_emitterId` can be set only once.\n *\n * @internal\n * @param emitter An emitter for which id will be set.\n * @param id Unique id to set. If not passed, random unique id will be set.\n */\nexport function _setEmitterId(emitter, id) {\n if (!emitter[_emitterId]) {\n emitter[_emitterId] = id || uid();\n }\n}\n/**\n * Returns emitter's unique id.\n *\n * @internal\n * @param emitter An emitter which id will be returned.\n */\nexport function _getEmitterId(emitter) {\n return 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.\n */\nfunction getEvents(source) {\n if (!source._events) {\n Object.defineProperty(source, '_events', {\n value: {}\n });\n }\n return source._events;\n}\n/**\n * Creates event node for generic-specific events relation architecture.\n */\nfunction makeEventNode() {\n return {\n callbacks: [],\n childEvents: []\n };\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.\n */\nfunction createEventNamespace(source, eventName) {\n const events = getEvents(source);\n // First, check if the event we want to add to the structure already exists.\n if (events[eventName]) {\n // If it exists, we don't have to do anything.\n return;\n }\n // In other case, we have to create the structure for the event.\n // Note, that we might need to create intermediate events too.\n // I.e. if foo:bar:abc is being registered and we only have foo in the structure,\n // we need to also register foo:bar.\n // Currently processed event name.\n let name = eventName;\n // Name of the event that is a child event for currently processed event.\n let childEventName = null;\n // Array containing all newly created specific events.\n const newEventNodes = [];\n // While loop can't check for ':' index because we have to handle generic events too.\n // In each loop, we truncate event name, going from the most specific name to the generic one.\n // I.e. foo:bar:abc -> foo:bar -> foo.\n while (name !== '') {\n if (events[name]) {\n // If the currently processed event name is already registered, we can be sure\n // that it already has all the structure created, so we can break the loop here\n // as no more events need to be registered.\n break;\n }\n // If this event is not yet registered, create a new object for it.\n events[name] = makeEventNode();\n // Add it to the array with newly created events.\n newEventNodes.push(events[name]);\n // Add previously processed event name as a child of this event.\n if (childEventName) {\n events[name].childEvents.push(childEventName);\n }\n childEventName = name;\n // If `.lastIndexOf()` returns -1, `.substr()` will return '' which will break the loop.\n name = name.substr(0, name.lastIndexOf(':'));\n }\n if (name !== '') {\n // If name is not empty, we found an already registered event that was a parent of the\n // event we wanted to register.\n // Copy that event's callbacks to newly registered events.\n for (const node of newEventNodes) {\n node.callbacks = events[name].callbacks.slice();\n }\n // Add last newly created event to the already registered event.\n events[name].childEvents.push(childEventName);\n }\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 */\nfunction getCallbacksListsForNamespace(source, eventName) {\n const eventNode = getEvents(source)[eventName];\n if (!eventNode) {\n return [];\n }\n let callbacksLists = [eventNode.callbacks];\n for (let i = 0; i < eventNode.childEvents.length; i++) {\n const childCallbacksLists = getCallbacksListsForNamespace(source, eventNode.childEvents[i]);\n callbacksLists = callbacksLists.concat(childCallbacksLists);\n }\n return 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.\n */\nfunction getCallbacksForEvent(source, eventName) {\n let event;\n if (!source._events || !(event = source._events[eventName]) || !event.callbacks.length) {\n // There are no callbacks registered for specified eventName.\n // But this could be a specific-type event that is in a namespace.\n if (eventName.indexOf(':') > -1) {\n // If the eventName is specific, try to find callback lists for more generic event.\n return getCallbacksForEvent(source, eventName.substr(0, eventName.lastIndexOf(':')));\n }\n else {\n // If this is a top-level generic event, return null;\n return null;\n }\n }\n return event.callbacks;\n}\n/**\n * Fires delegated events for given map of destinations.\n *\n * @param destinations A map containing `[ {@link module:utils/emittermixin~Emitter}, \"event name\" ]` pair destinations.\n * @param eventInfo The original event info object.\n * @param fireArgs Arguments the original event was fired with.\n */\nfunction fireDelegatedEvents(destinations, eventInfo, fireArgs) {\n for (let [emitter, name] of destinations) {\n if (!name) {\n name = eventInfo.name;\n }\n else if (typeof name == 'function') {\n name = name(eventInfo.name);\n }\n const delegatedInfo = new EventInfo(eventInfo.source, name);\n delegatedInfo.path = [...eventInfo.path];\n emitter.fire(delegatedInfo, ...fireArgs);\n }\n}\n/**\n * Helper for registering event callback on the emitter.\n */\nfunction addEventListener(listener, emitter, event, callback, options) {\n if (emitter._addEventListener) {\n emitter._addEventListener(event, callback, options);\n }\n else {\n // Allow listening on objects that do not implement Emitter interface.\n // This is needed in some tests that are using mocks instead of the real objects with EmitterMixin mixed.\n (listener._addEventListener).call(emitter, event, callback, options);\n }\n}\n/**\n * Helper for removing event callback from the emitter.\n */\nfunction removeEventListener(listener, emitter, event, callback) {\n if (emitter._removeEventListener) {\n emitter._removeEventListener(event, callback);\n }\n else {\n // Allow listening on objects that do not implement Emitter interface.\n // This is needed in some tests that are using mocks instead of the real objects with EmitterMixin mixed.\n listener._removeEventListener.call(emitter, event, callback);\n }\n}\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.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 != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* eslint-disable @typescript-eslint/unified-signatures */\n/**\n * @module utils/observablemixin\n */\nimport EmitterMixin from './emittermixin';\nimport CKEditorError from './ckeditorerror';\nimport { isObject } from 'lodash-es';\nconst observablePropertiesSymbol = Symbol('observableProperties');\nconst boundObservablesSymbol = Symbol('boundObservables');\nconst boundPropertiesSymbol = Symbol('boundProperties');\nconst decoratedMethods = Symbol('decoratedMethods');\nconst decoratedOriginal = Symbol('decoratedOriginal');\nconst defaultObservableClass = ObservableMixin(EmitterMixin());\nexport default function ObservableMixin(base) {\n if (!base) {\n return defaultObservableClass;\n }\n class Mixin extends base {\n set(name, value) {\n // If the first parameter is an Object, iterate over its properties.\n if (isObject(name)) {\n Object.keys(name).forEach(property => {\n this.set(property, name[property]);\n }, this);\n return;\n }\n initObservable(this);\n const properties = this[observablePropertiesSymbol];\n if ((name in this) && !properties.has(name)) {\n /**\n * Cannot override an existing property.\n *\n * This error is thrown when trying to {@link module:utils/observablemixin~Observable#set set} a property with\n * a name of an already existing property. For example:\n *\n * ```ts\n * let observable = new Model();\n * observable.property = 1;\n * observable.set( 'property', 2 );\t\t\t// throws\n *\n * observable.set( 'property', 1 );\n * observable.set( 'property', 2 );\t\t\t// ok, because this is an existing property.\n * ```\n *\n * @error observable-set-cannot-override\n */\n throw new CKEditorError('observable-set-cannot-override', this);\n }\n Object.defineProperty(this, name, {\n enumerable: true,\n configurable: true,\n get() {\n return properties.get(name);\n },\n set(value) {\n const oldValue = properties.get(name);\n // Fire `set` event before the new value will be set to make it possible\n // to override observable property without affecting `change` event.\n // See https://github.com/ckeditor/ckeditor5-utils/issues/171.\n let newValue = this.fire(`set:${name}`, name, value, oldValue);\n if (newValue === undefined) {\n newValue = value;\n }\n // Allow undefined as an initial value like A.define( 'x', undefined ) (#132).\n // Note: When properties map has no such own property, then its value is undefined.\n if (oldValue !== newValue || !properties.has(name)) {\n properties.set(name, newValue);\n this.fire(`change:${name}`, name, newValue, oldValue);\n }\n }\n });\n this[name] = value;\n }\n bind(...bindProperties) {\n if (!bindProperties.length || !isStringArray(bindProperties)) {\n /**\n * All properties must be strings.\n *\n * @error observable-bind-wrong-properties\n */\n throw new CKEditorError('observable-bind-wrong-properties', this);\n }\n if ((new Set(bindProperties)).size !== bindProperties.length) {\n /**\n * Properties must be unique.\n *\n * @error observable-bind-duplicate-properties\n */\n throw new CKEditorError('observable-bind-duplicate-properties', this);\n }\n initObservable(this);\n const boundProperties = this[boundPropertiesSymbol];\n bindProperties.forEach(propertyName => {\n if (boundProperties.has(propertyName)) {\n /**\n * Cannot bind the same property more than once.\n *\n * @error observable-bind-rebind\n */\n throw new CKEditorError('observable-bind-rebind', this);\n }\n });\n const bindings = new Map();\n bindProperties.forEach(a => {\n const binding = { property: a, to: [] };\n boundProperties.set(a, binding);\n bindings.set(a, binding);\n });\n return {\n to: bindTo,\n toMany: bindToMany,\n _observable: this,\n _bindProperties: bindProperties,\n _to: [],\n _bindings: bindings\n };\n }\n unbind(...unbindProperties) {\n // Nothing to do here if not inited yet.\n if (!(this[observablePropertiesSymbol])) {\n return;\n }\n const boundProperties = this[boundPropertiesSymbol];\n const boundObservables = this[boundObservablesSymbol];\n if (unbindProperties.length) {\n if (!isStringArray(unbindProperties)) {\n /**\n * Properties must be strings.\n *\n * @error observable-unbind-wrong-properties\n */\n throw new CKEditorError('observable-unbind-wrong-properties', this);\n }\n unbindProperties.forEach(propertyName => {\n const binding = boundProperties.get(propertyName);\n // Nothing to do if the binding is not defined\n if (!binding) {\n return;\n }\n binding.to.forEach(([toObservable, toProperty]) => {\n const toProperties = boundObservables.get(toObservable);\n const toPropertyBindings = toProperties[toProperty];\n toPropertyBindings.delete(binding);\n if (!toPropertyBindings.size) {\n delete toProperties[toProperty];\n }\n if (!Object.keys(toProperties).length) {\n boundObservables.delete(toObservable);\n this.stopListening(toObservable, 'change');\n }\n });\n boundProperties.delete(propertyName);\n });\n }\n else {\n boundObservables.forEach((bindings, boundObservable) => {\n this.stopListening(boundObservable, 'change');\n });\n boundObservables.clear();\n boundProperties.clear();\n }\n }\n decorate(methodName) {\n initObservable(this);\n const originalMethod = this[methodName];\n if (!originalMethod) {\n /**\n * Cannot decorate an undefined method.\n *\n * @error observablemixin-cannot-decorate-undefined\n * @param {Object} object The object which method should be decorated.\n * @param {String} methodName Name of the method which does not exist.\n */\n throw new CKEditorError('observablemixin-cannot-decorate-undefined', this, { object: this, methodName });\n }\n this.on(methodName, (evt, args) => {\n evt.return = originalMethod.apply(this, args);\n });\n this[methodName] = function (...args) {\n return this.fire(methodName, args);\n };\n this[methodName][decoratedOriginal] = originalMethod;\n if (!this[decoratedMethods]) {\n this[decoratedMethods] = [];\n }\n this[decoratedMethods].push(methodName);\n }\n // Override the EmitterMixin stopListening method to be able to clean (and restore) decorated methods.\n // This is needed in case of:\n // 1. Have x.foo() decorated.\n // 2. Call x.stopListening()\n // 3. Call x.foo(). Problem: nothing happens (the original foo() method is not executed)\n stopListening(emitter, event, callback) {\n // Removing all listeners so let's clean the decorated methods to the original state.\n if (!emitter && this[decoratedMethods]) {\n for (const methodName of this[decoratedMethods]) {\n this[methodName] = this[methodName][decoratedOriginal];\n }\n delete this[decoratedMethods];\n }\n super.stopListening(emitter, event, callback);\n }\n }\n return Mixin;\n}\n// Backward compatibility with `mix`\n([\n 'set', 'bind', 'unbind', 'decorate',\n 'on', 'once', 'off', 'listenTo',\n 'stopListening', 'fire', 'delegate', 'stopDelegating',\n '_addEventListener', '_removeEventListener'\n]).forEach(key => {\n ObservableMixin[key] = defaultObservableClass.prototype[key];\n});\n// Init symbol properties needed for the observable mechanism to work.\nfunction initObservable(observable) {\n // Do nothing if already inited.\n if (observable[observablePropertiesSymbol]) {\n return;\n }\n // The internal hash containing the observable's state.\n Object.defineProperty(observable, observablePropertiesSymbol, {\n value: new Map()\n });\n // Map containing bindings to external observables. It shares the binding objects\n // (`{ observable: A, property: 'a', to: ... }`) with {@link module:utils/observablemixin~Observable#_boundProperties} and\n // it is used to observe external observables to update own properties accordingly.\n // See {@link module:utils/observablemixin~Observable#bind}.\n //\n //\t\tA.bind( 'a', 'b', 'c' ).to( B, 'x', 'y', 'x' );\n //\t\tconsole.log( A._boundObservables );\n //\n //\t\t\tMap( {\n //\t\t\t\tB: {\n //\t\t\t\t\tx: Set( [\n //\t\t\t\t\t\t{ observable: A, property: 'a', to: [ [ B, 'x' ] ] },\n //\t\t\t\t\t\t{ observable: A, property: 'c', to: [ [ B, 'x' ] ] }\n //\t\t\t\t\t] ),\n //\t\t\t\t\ty: Set( [\n //\t\t\t\t\t\t{ observable: A, property: 'b', to: [ [ B, 'y' ] ] },\n //\t\t\t\t\t] )\n //\t\t\t\t}\n //\t\t\t} )\n //\n //\t\tA.bind( 'd' ).to( B, 'z' ).to( C, 'w' ).as( callback );\n //\t\tconsole.log( A._boundObservables );\n //\n //\t\t\tMap( {\n //\t\t\t\tB: {\n //\t\t\t\t\tx: Set( [\n //\t\t\t\t\t\t{ observable: A, property: 'a', to: [ [ B, 'x' ] ] },\n //\t\t\t\t\t\t{ observable: A, property: 'c', to: [ [ B, 'x' ] ] }\n //\t\t\t\t\t] ),\n //\t\t\t\t\ty: Set( [\n //\t\t\t\t\t\t{ observable: A, property: 'b', to: [ [ B, 'y' ] ] },\n //\t\t\t\t\t] ),\n //\t\t\t\t\tz: Set( [\n //\t\t\t\t\t\t{ observable: A, property: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }\n //\t\t\t\t\t] )\n //\t\t\t\t},\n //\t\t\t\tC: {\n //\t\t\t\t\tw: Set( [\n //\t\t\t\t\t\t{ observable: A, property: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }\n //\t\t\t\t\t] )\n //\t\t\t\t}\n //\t\t\t} )\n //\n Object.defineProperty(observable, boundObservablesSymbol, {\n value: new Map()\n });\n // Object that stores which properties of this observable are bound and how. It shares\n // the binding objects (`{ observable: A, property: 'a', to: ... }`) with\n // {@link module:utils/observablemixin~Observable#_boundObservables}. This data structure is\n // a reverse of {@link module:utils/observablemixin~Observable#_boundObservables} and it is helpful for\n // {@link module:utils/observablemixin~Observable#unbind}.\n //\n // See {@link module:utils/observablemixin~Observable#bind}.\n //\n //\t\tA.bind( 'a', 'b', 'c' ).to( B, 'x', 'y', 'x' );\n //\t\tconsole.log( A._boundProperties );\n //\n //\t\t\tMap( {\n //\t\t\t\ta: { observable: A, property: 'a', to: [ [ B, 'x' ] ] },\n //\t\t\t\tb: { observable: A, property: 'b', to: [ [ B, 'y' ] ] },\n //\t\t\t\tc: { observable: A, property: 'c', to: [ [ B, 'x' ] ] }\n //\t\t\t} )\n //\n //\t\tA.bind( 'd' ).to( B, 'z' ).to( C, 'w' ).as( callback );\n //\t\tconsole.log( A._boundProperties );\n //\n //\t\t\tMap( {\n //\t\t\t\ta: { observable: A, property: 'a', to: [ [ B, 'x' ] ] },\n //\t\t\t\tb: { observable: A, property: 'b', to: [ [ B, 'y' ] ] },\n //\t\t\t\tc: { observable: A, property: 'c', to: [ [ B, 'x' ] ] },\n //\t\t\t\td: { observable: A, property: 'd', to: [ [ B, 'z' ], [ C, 'w' ] ], callback: callback }\n //\t\t\t} )\n Object.defineProperty(observable, boundPropertiesSymbol, {\n value: new Map()\n });\n}\n/**\n * A chaining for {@link module:utils/observablemixin~Observable#bind} providing `.to()` interface.\n *\n * @param args Arguments of the `.to( args )` binding.\n */\nfunction bindTo(...args) {\n const parsedArgs = parseBindToArgs(...args);\n const bindingsKeys = Array.from(this._bindings.keys());\n const numberOfBindings = bindingsKeys.length;\n // Eliminate A.bind( 'x' ).to( B, C )\n if (!parsedArgs.callback && parsedArgs.to.length > 1) {\n /**\n * Binding multiple observables only possible with callback.\n *\n * @error observable-bind-to-no-callback\n */\n throw new CKEditorError('observable-bind-to-no-callback', this);\n }\n // Eliminate A.bind( 'x', 'y' ).to( B, callback )\n if (numberOfBindings > 1 && parsedArgs.callback) {\n /**\n * Cannot bind multiple properties and use a callback in one binding.\n *\n * @error observable-bind-to-extra-callback\n */\n throw new CKEditorError('observable-bind-to-extra-callback', this);\n }\n parsedArgs.to.forEach(to => {\n // Eliminate A.bind( 'x', 'y' ).to( B, 'a' )\n if (to.properties.length && to.properties.length !== numberOfBindings) {\n /**\n * The number of properties must match.\n *\n * @error observable-bind-to-properties-length\n */\n throw new CKEditorError('observable-bind-to-properties-length', this);\n }\n // When no to.properties specified, observing source properties instead i.e.\n // A.bind( 'x', 'y' ).to( B ) -> Observe B.x and B.y\n if (!to.properties.length) {\n to.properties = this._bindProperties;\n }\n });\n this._to = parsedArgs.to;\n // Fill {@link BindChain#_bindings} with callback. When the callback is set there's only one binding.\n if (parsedArgs.callback) {\n this._bindings.get(bindingsKeys[0]).callback = parsedArgs.callback;\n }\n attachBindToListeners(this._observable, this._to);\n // Update observable._boundProperties and observable._boundObservables.\n updateBindToBound(this);\n // Set initial values of bound properties.\n this._bindProperties.forEach(propertyName => {\n updateBoundObservableProperty(this._observable, propertyName);\n });\n}\n/**\n * Binds to an attribute in a set of iterable observables.\n */\nfunction bindToMany(observables, attribute, callback) {\n if (this._bindings.size > 1) {\n /**\n * Binding one attribute to many observables only possible with one attribute.\n *\n * @error observable-bind-to-many-not-one-binding\n */\n throw new CKEditorError('observable-bind-to-many-not-one-binding', this);\n }\n this.to(\n // Bind to #attribute of each observable...\n ...getBindingTargets(observables, attribute), \n // ...using given callback to parse attribute values.\n callback);\n}\n/**\n * Returns an array of binding components for\n * {@link Observable#bind} from a set of iterable observables.\n */\nfunction getBindingTargets(observables, attribute) {\n const observableAndAttributePairs = observables.map(observable => [observable, attribute]);\n // Merge pairs to one-dimension array of observables and attributes.\n return Array.prototype.concat.apply([], observableAndAttributePairs);\n}\n/**\n * Check if all entries of the array are of `String` type.\n */\nfunction isStringArray(arr) {\n return 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 * ```ts\n * A.bind( 'x' ).to( B, 'a', C, 'b', call );\n * ```\n *\n * becomes\n *\n * ```ts\n * {\n * \tto: [\n * \t\t{ observable: B, properties: [ 'a' ] },\n * \t\t{ observable: C, properties: [ 'b' ] },\n * \t],\n * \tcallback: call\n * }\n *\n * @param args Arguments of {@link Observable#bind}`.to( args )`.\n */\nfunction parseBindToArgs(...args) {\n // Eliminate A.bind( 'x' ).to()\n if (!args.length) {\n /**\n * Invalid argument syntax in `to()`.\n *\n * @error observable-bind-to-parse-error\n */\n throw new CKEditorError('observable-bind-to-parse-error', null);\n }\n const parsed = { to: [] };\n let lastObservable;\n if (typeof args[args.length - 1] == 'function') {\n parsed.callback = args.pop();\n }\n args.forEach(a => {\n if (typeof a == 'string') {\n lastObservable.properties.push(a);\n }\n else if (typeof a == 'object') {\n lastObservable = { observable: a, properties: [] };\n parsed.to.push(lastObservable);\n }\n else {\n throw new CKEditorError('observable-bind-to-parse-error', null);\n }\n });\n return parsed;\n}\n/**\n * Synchronizes {@link module:utils/observable#_boundObservables} with {@link Binding}.\n *\n * @param binding A binding to store in {@link Observable#_boundObservables}.\n * @param toObservable A observable, which is a new component of `binding`.\n * @param toPropertyName A name of `toObservable`'s property, a new component of the `binding`.\n */\nfunction updateBoundObservables(observable, binding, toObservable, toPropertyName) {\n const boundObservables = observable[boundObservablesSymbol];\n const bindingsToObservable = boundObservables.get(toObservable);\n const bindings = bindingsToObservable || {};\n if (!bindings[toPropertyName]) {\n bindings[toPropertyName] = new Set();\n }\n // Pass the binding to a corresponding Set in `observable._boundObservables`.\n bindings[toPropertyName].add(binding);\n if (!bindingsToObservable) {\n boundObservables.set(toObservable, bindings);\n }\n}\n/**\n * Synchronizes {@link Observable#_boundProperties} and {@link Observable#_boundObservables}\n * with {@link BindChain}.\n *\n * Assuming the following binding being created\n *\n * ```ts\n * A.bind( 'a', 'b' ).to( B, 'x', 'y' );\n * ```\n *\n * the following bindings were initialized by {@link Observable#bind} in {@link BindChain#_bindings}:\n *\n * ```ts\n * {\n * \ta: { observable: A, property: 'a', to: [] },\n * \tb: { observable: A, property: 'b', to: [] },\n * }\n * ```\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 * ```ts\n * {\n * \ta: { observable: A, property: 'a', to: [ B, 'x' ] },\n * \tb: { observable: A, property: 'b', to: [ B, 'y' ] },\n * }\n * ```\n *\n * Then update the structure of {@link Observable#_boundObservables} with updated\n * binding, so it becomes:\n *\n * ```ts\n * Map( {\n * \tB: {\n * \t\tx: Set( [\n * \t\t\t{ observable: A, property: 'a', to: [ [ B, 'x' ] ] }\n * \t\t] ),\n * \t\ty: Set( [\n * \t\t\t{ observable: A, property: 'b', to: [ [ B, 'y' ] ] },\n * \t\t] )\n * \t}\n * } )\n * ```\n *\n * @param chain The binding initialized by {@link Observable#bind}.\n */\nfunction updateBindToBound(chain) {\n let toProperty;\n chain._bindings.forEach((binding, propertyName) => {\n // Note: For a binding without a callback, this will run only once\n // like in A.bind( 'x', 'y' ).to( B, 'a', 'b' )\n // TODO: ES6 destructuring.\n chain._to.forEach(to => {\n toProperty = to.properties[binding.callback ? 0 : chain._bindProperties.indexOf(propertyName)];\n binding.to.push([to.observable, toProperty]);\n updateBoundObservables(chain._observable, binding, to.observable, toProperty);\n });\n });\n}\n/**\n * Updates an property of a {@link Observable} with a value\n * determined by an entry in {@link Observable#_boundProperties}.\n *\n * @param observable A observable which property is to be updated.\n * @param propertyName An property to be updated.\n */\nfunction updateBoundObservableProperty(observable, propertyName) {\n const boundProperties = observable[boundPropertiesSymbol];\n const binding = boundProperties.get(propertyName);\n let propertyValue;\n // When a binding with callback is created like\n //\n // \t\tA.bind( 'a' ).to( B, 'b', C, 'c', callback );\n //\n // collect B.b and C.c, then pass them to callback to set A.a.\n if (binding.callback) {\n propertyValue = binding.callback.apply(observable, binding.to.map(to => to[0][to[1]]));\n }\n else {\n propertyValue = binding.to[0];\n propertyValue = propertyValue[0][propertyValue[1]];\n }\n if (Object.prototype.hasOwnProperty.call(observable, propertyName)) {\n observable[propertyName] = propertyValue;\n }\n else {\n observable.set(propertyName, propertyValue);\n }\n}\n/**\n * Starts listening to changes in {@link BindChain._to} observables to update\n * {@link BindChain._observable} {@link BindChain._bindProperties}. Also sets the\n * initial state of {@link BindChain._observable}.\n *\n * @param chain The chain initialized by {@link Observable#bind}.\n */\nfunction attachBindToListeners(observable, toBindings) {\n toBindings.forEach(to => {\n const boundObservables = observable[boundObservablesSymbol];\n let bindings;\n // If there's already a chain between the observables (`observable` listens to\n // `to.observable`), there's no need to create another `change` event listener.\n if (!boundObservables.get(to.observable)) {\n observable.listenTo(to.observable, 'change', (evt, propertyName) => {\n bindings = boundObservables.get(to.observable)[propertyName];\n // Note: to.observable will fire for any property change, react\n // to changes of properties which are bound only.\n if (bindings) {\n bindings.forEach(binding => {\n updateBoundObservableProperty(observable, binding.property);\n });\n }\n });\n }\n });\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/elementreplacer\n */\n/**\n * Utility class allowing to hide existing HTML elements or replace them with given ones in a way that doesn't remove\n * the original elements from the DOM.\n */\nexport default class ElementReplacer {\n constructor() {\n this._replacedElements = [];\n }\n /**\n * Hides the `element` and, if specified, inserts the the given element next to it.\n *\n * The effect of this method can be reverted by {@link #restore}.\n *\n * @param element The element to replace.\n * @param newElement The replacement element. If not passed, then the `element` will just be hidden.\n */\n replace(element, newElement) {\n this._replacedElements.push({ element, newElement });\n element.style.display = 'none';\n if (newElement) {\n element.parentNode.insertBefore(newElement, element.nextSibling);\n }\n }\n /**\n * Restores what {@link #replace} did.\n */\n restore() {\n this._replacedElements.forEach(({ element, newElement }) => {\n element.style.display = '';\n if (newElement) {\n newElement.remove();\n }\n });\n this._replacedElements = [];\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/count\n */\n/**\n * Returns the number of items return by the iterator.\n *\n * ```ts\n * count( [ 1, 2, 3, 4, 5 ] ); // 5;\n * ```\n *\n * @param iterable Any iterable.\n * @returns Number of items returned by that iterable.\n */\nexport default function count(iterable) {\n let count = 0;\n for (const _ of iterable) { // eslint-disable-line no-unused-vars\n count++;\n }\n return count;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/comparearrays\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 * ```ts\n * compareArrays( [ 0, 2 ], [ 0, 2 ] );\t\t// 'same'\n * compareArrays( [ 0, 2 ], [ 0, 2, 1 ] );\t\t// 'prefix'\n * compareArrays( [ 0, 2 ], [ 0 ] );\t\t\t// 'extension'\n * compareArrays( [ 0, 2 ], [ 1, 2 ] );\t\t// 0\n * compareArrays( [ 0, 2 ], [ 0, 1 ] );\t\t// 1\n * ```\n *\n * @param a Array that is compared.\n * @param b Array to compare with.\n * @returns How array `a` is related to `b`.\n */\nexport default function compareArrays(a, b) {\n const minLen = Math.min(a.length, b.length);\n for (let i = 0; i < minLen; i++) {\n if (a[i] != b[i]) {\n // The arrays are different.\n return i;\n }\n }\n // Both arrays were same at all points.\n if (a.length == b.length) {\n // If their length is also same, they are the same.\n return 'same';\n }\n else if (a.length < b.length) {\n // Compared array is shorter so it is a prefix of the other array.\n return 'prefix';\n }\n else {\n // Compared array is longer so it is an extension of the other array.\n return 'extension';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/isiterable\n */\n/**\n * Checks if value implements iterator interface.\n *\n * @param value The value to check.\n * @returns True if value implements iterator interface.\n */\nexport default function isIterable(value) {\n return !!(value && value[Symbol.iterator]);\n}\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n","import Symbol from './_Symbol.js';\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/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\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/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n","/**\n * Checks if `value` is classified as an `Array` 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 an array, 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 * 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 != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n","import baseGetTag from './_baseGetTag.js';\nimport isArray from './isArray.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\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 a string, 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) && baseGetTag(value) == stringTag);\n}\n\nexport default isString;\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/createelement\n */\nimport isIterable from '../isiterable';\nimport { isString } from 'lodash-es';\n/**\n * Creates an HTML or SVG element with attributes and children elements.\n *\n * ```ts\n * createElement( document, 'p' ); // <p>\n * createElement( document, 'mask', { xmlns: 'http://www.w3.org/2000/svg' } ); // <mask>\n * ```\n *\n * @param doc Document used to create the element.\n * @param name Name of the element.\n * @param attributes Object where keys represent attribute keys and values represent attribute values.\n * @param children Child or any iterable of children. Strings will be automatically turned into Text nodes.\n * @returns HTML or SVG element.\n */\nexport default function createElement(doc, name, attributes = {}, children = []) {\n const namespace = attributes && attributes.xmlns;\n const element = namespace ? doc.createElementNS(namespace, name) : doc.createElement(name);\n for (const key in attributes) {\n element.setAttribute(key, attributes[key]);\n }\n if (isString(children) || !isIterable(children)) {\n children = [children];\n }\n for (let child of children) {\n if (isString(child)) {\n child = doc.createTextNode(child);\n }\n element.appendChild(child);\n }\n return element;\n}\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n","import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n","import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.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 * 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, 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) || baseGetTag(value) != objectTag) {\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' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nexport default listCacheClear;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.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 = { 'a': 1 };\n * var other = { 'a': 1 };\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","import eq from './eq.js';\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 inspect.\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","import assocIndexOf from './_assocIndexOf.js';\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 * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nexport default listCacheDelete;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nexport default listCacheGet;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\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 listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nexport default listCacheHas;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nexport default listCacheSet;\n","import listCacheClear from './_listCacheClear.js';\nimport listCacheDelete from './_listCacheDelete.js';\nimport listCacheGet from './_listCacheGet.js';\nimport listCacheHas from './_listCacheHas.js';\nimport listCacheSet from './_listCacheSet.js';\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 == null ? 0 : entries.length;\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","import ListCache from './_ListCache.js';\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nexport default stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nexport default stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nexport default stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\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 stackHas(key) {\n return this.__data__.has(key);\n}\n\nexport default stackHas;\n","import baseGetTag from './_baseGetTag.js';\nimport isObject from './isObject.js';\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\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 a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nexport default isFunction;\n","import root from './_root.js';\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nexport default coreJsData;\n","import coreJsData from './_coreJsData.js';\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nexport default isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nexport default toSource;\n","import isFunction from './isFunction.js';\nimport isMasked from './_isMasked.js';\nimport isObject from './isObject.js';\nimport toSource from './_toSource.js';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nexport default baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nexport default getValue;\n","import baseIsNative from './_baseIsNative.js';\nimport getValue from './_getValue.js';\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 = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nexport default getNative;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nexport default Map;\n","import getNative from './_getNative.js';\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nexport default nativeCreate;\n","import nativeCreate from './_nativeCreate.js';\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nexport default hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default hashDelete;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\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 * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nexport default hashGet;\n","import nativeCreate from './_nativeCreate.js';\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 * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\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 hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nexport default hashHas;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nexport default hashSet;\n","import hashClear from './_hashClear.js';\nimport hashDelete from './_hashDelete.js';\nimport hashGet from './_hashGet.js';\nimport hashHas from './_hashHas.js';\nimport hashSet from './_hashSet.js';\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\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 `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nexport default Hash;\n","import Hash from './_Hash.js';\nimport ListCache from './_ListCache.js';\nimport Map from './_Map.js';\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nexport default mapCacheClear;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nexport default isKeyable;\n","import isKeyable from './_isKeyable.js';\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","import getMapData from './_getMapData.js';\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default mapCacheDelete;\n","import getMapData from './_getMapData.js';\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nexport default mapCacheGet;\n","import getMapData from './_getMapData.js';\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\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 mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nexport default mapCacheHas;\n","import getMapData from './_getMapData.js';\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nexport default mapCacheSet;\n","import mapCacheClear from './_mapCacheClear.js';\nimport mapCacheDelete from './_mapCacheDelete.js';\nimport mapCacheGet from './_mapCacheGet.js';\nimport mapCacheHas from './_mapCacheHas.js';\nimport mapCacheSet from './_mapCacheSet.js';\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 == null ? 0 : entries.length;\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","import ListCache from './_ListCache.js';\nimport Map from './_Map.js';\nimport MapCache from './_MapCache.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nexport default stackSet;\n","import ListCache from './_ListCache.js';\nimport stackClear from './_stackClear.js';\nimport stackDelete from './_stackDelete.js';\nimport stackGet from './_stackGet.js';\nimport stackHas from './_stackHas.js';\nimport stackSet from './_stackSet.js';\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 var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\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 * A specialized version of `_.forEach` for arrays without support for\n * iteratee 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 `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nexport default arrayEach;\n","import getNative from './_getNative.js';\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nexport default defineProperty;\n","import defineProperty from './_defineProperty.js';\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\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 baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nexport default baseAssignValue;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\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/7.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 baseAssignValue(object, key, value);\n }\n}\n\nexport default assignValue;\n","import assignValue from './_assignValue.js';\nimport baseAssignValue from './_baseAssignValue.js';\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 var isNew = !object;\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 : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nexport default copyObject;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nexport default baseTimes;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nexport default baseIsArguments;\n","import baseIsArguments from './_baseIsArguments.js';\nimport isObjectLike from './isObjectLike.js';\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/** 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 an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nexport default isArguments;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nexport default stubFalse;\n","import root from './_root.js';\nimport stubFalse from './stubFalse.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nexport default isBuffer;\n","/** 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 var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nexport default isIndex;\n","/** 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 method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.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, 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","import baseGetTag from './_baseGetTag.js';\nimport isLength from './isLength.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nexport default baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing 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","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nexport default nodeUtil;\n","import baseIsTypedArray from './_baseIsTypedArray.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nexport default isTypedArray;\n","import baseTimes from './_baseTimes.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isIndex from './_isIndex.js';\nimport isTypedArray from './isTypedArray.js';\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 * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default arrayLikeKeys;\n","/** 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","import overArg from './_overArg.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nexport default nativeKeys;\n","import isPrototype from './_isPrototype.js';\nimport nativeKeys from './_nativeKeys.js';\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 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeys;\n","import isFunction from './isFunction.js';\nimport isLength from './isLength.js';\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(value.length) && !isFunction(value);\n}\n\nexport default isArrayLike;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeys from './_baseKeys.js';\nimport isArrayLike from './isArrayLike.js';\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/7.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 return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nexport default keys;\n","import copyObject from './_copyObject.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nexport default baseAssign;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default nativeKeysIn;\n","import isObject from './isObject.js';\nimport isPrototype from './_isPrototype.js';\nimport nativeKeysIn from './_nativeKeysIn.js';\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 * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeysIn;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeysIn from './_baseKeysIn.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\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 * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nexport default keysIn;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nexport default baseAssignIn;\n","import root from './_root.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nexport default cloneBuffer;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nexport default copyArray;\n","/**\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 == null ? 0 : 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 * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nexport default stubArray;\n","import arrayFilter from './_arrayFilter.js';\nimport stubArray from './stubArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nexport default getSymbols;\n","import copyObject from './_copyObject.js';\nimport getSymbols from './_getSymbols.js';\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nexport default copySymbols;\n","/**\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","import arrayPush from './_arrayPush.js';\nimport getPrototype from './_getPrototype.js';\nimport getSymbols from './_getSymbols.js';\nimport stubArray from './stubArray.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nexport default getSymbolsIn;\n","import copyObject from './_copyObject.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nexport default copySymbolsIn;\n","import arrayPush from './_arrayPush.js';\nimport isArray from './isArray.js';\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nexport default baseGetAllKeys;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbols from './_getSymbols.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nexport default getAllKeys;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nexport default getAllKeysIn;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nexport default DataView;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nexport default Promise;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nexport default Set;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nexport default WeakMap;\n","import DataView from './_DataView.js';\nimport Map from './_Map.js';\nimport Promise from './_Promise.js';\nimport Set from './_Set.js';\nimport WeakMap from './_WeakMap.js';\nimport baseGetTag from './_baseGetTag.js';\nimport toSource from './_toSource.js';\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 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 */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\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 = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\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","/** 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 * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nexport default initCloneArray;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nexport default Uint8Array;\n","import Uint8Array from './_Uint8Array.js';\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","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nexport default cloneDataView;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nexport default cloneRegExp;\n","import Symbol from './_Symbol.js';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nexport default cloneSymbol;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nexport default cloneTypedArray;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\nimport cloneDataView from './_cloneDataView.js';\nimport cloneRegExp from './_cloneRegExp.js';\nimport cloneSymbol from './_cloneSymbol.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nexport default initCloneByTag;\n","import isObject from './isObject.js';\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nexport default baseCreate;\n","import baseCreate from './_baseCreate.js';\nimport getPrototype from './_getPrototype.js';\nimport isPrototype from './_isPrototype.js';\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nexport default initCloneObject;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nexport default baseIsMap;\n","import baseIsMap from './_baseIsMap.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nexport default isMap;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nexport default baseIsSet;\n","import baseIsSet from './_baseIsSet.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nexport default isSet;\n","import Stack from './_Stack.js';\nimport arrayEach from './_arrayEach.js';\nimport assignValue from './_assignValue.js';\nimport baseAssign from './_baseAssign.js';\nimport baseAssignIn from './_baseAssignIn.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport copyArray from './_copyArray.js';\nimport copySymbols from './_copySymbols.js';\nimport copySymbolsIn from './_copySymbolsIn.js';\nimport getAllKeys from './_getAllKeys.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\nimport getTag from './_getTag.js';\nimport initCloneArray from './_initCloneArray.js';\nimport initCloneByTag from './_initCloneByTag.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isMap from './isMap.js';\nimport isObject from './isObject.js';\nimport isSet from './isSet.js';\nimport keys from './keys.js';\nimport keysIn from './keysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nexport default baseClone;\n","import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\nfunction cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n}\n\nexport default cloneDeepWith;\n","import isObjectLike from './isObjectLike.js';\nimport isPlainObject from './isPlainObject.js';\n\n/**\n * Checks if `value` is likely a DOM element.\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 a DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('<body>');\n * // => false\n */\nfunction isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n}\n\nexport default isElement;\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/config\n */\nimport { isPlainObject, isElement, cloneDeepWith } from 'lodash-es';\n/**\n * Handles a configuration dictionary.\n *\n * @typeParam Cfg A type of the configuration dictionary.\n */\nexport default class Config {\n /**\n * Creates an instance of the {@link ~Config} class.\n *\n * @param configurations The initial configurations to be set. Usually, provided by the user.\n * @param defaultConfigurations The default configurations. Usually, provided by the system.\n */\n constructor(configurations, defaultConfigurations) {\n this._config = {};\n // Set default configuration.\n if (defaultConfigurations) {\n // Clone the configuration to make sure that the properties will not be shared\n // between editors and make the watchdog feature work correctly.\n this.define(cloneConfig(defaultConfigurations));\n }\n // Set initial configuration.\n if (configurations) {\n this._setObjectToTarget(this._config, configurations);\n }\n }\n set(name, value) {\n this._setToTarget(this._config, name, value);\n }\n define(name, value) {\n const isDefine = true;\n this._setToTarget(this._config, name, value, isDefine);\n }\n /**\n * Gets the value for a configuration entry.\n *\n * ```ts\n * config.get( 'name' );\n * ```\n *\n * Deep configurations can be retrieved by separating each part with a dot.\n *\n * ```ts\n * config.get( 'toolbar.collapsed' );\n * ```\n *\n * @param name The configuration name. Configuration names are case-sensitive.\n * @returns The configuration value or `undefined` if the configuration entry was not found.\n */\n get(name) {\n return this._getFromSource(this._config, name);\n }\n /**\n * Iterates over all top level configuration names.\n */\n *names() {\n for (const name of Object.keys(this._config)) {\n yield name;\n }\n }\n /**\n * Saves passed configuration to the specified target (nested object).\n *\n * @param target Nested config object.\n * @param name The configuration name or an object from which take properties as\n * configuration entries. Configuration names are case-sensitive.\n * @param value The configuration value. Used if a name is passed.\n * @param isDefine Define if passed configuration should overwrite existing one.\n */\n _setToTarget(target, name, value, isDefine = false) {\n // In case of an object, iterate through it and call `_setToTarget` again for each property.\n if (isPlainObject(name)) {\n this._setObjectToTarget(target, name, isDefine);\n return;\n }\n // The configuration name should be split into parts if it has dots. E.g. `resize.width` -> [`resize`, `width`].\n const parts = name.split('.');\n // Take the name of the configuration out of the parts. E.g. `resize.width` -> `width`.\n name = parts.pop();\n // Iterate over parts to check if currently stored configuration has proper structure.\n for (const part of parts) {\n // If there is no object for specified part then create one.\n if (!isPlainObject(target[part])) {\n target[part] = {};\n }\n // Nested object becomes a target.\n target = target[part];\n }\n // In case of value is an object.\n if (isPlainObject(value)) {\n // We take care of proper config structure.\n if (!isPlainObject(target[name])) {\n target[name] = {};\n }\n target = target[name];\n // And iterate through this object calling `_setToTarget` again for each property.\n this._setObjectToTarget(target, value, isDefine);\n return;\n }\n // Do nothing if we are defining configuration for non empty name.\n if (isDefine && typeof target[name] != 'undefined') {\n return;\n }\n target[name] = value;\n }\n /**\n * Get specified configuration from specified source (nested object).\n *\n * @param source level of nested object.\n * @param name The configuration name. Configuration names are case-sensitive.\n * @returns The configuration value or `undefined` if the configuration entry was not found.\n */\n _getFromSource(source, name) {\n // The configuration name should be split into parts if it has dots. E.g. `resize.width` -> [`resize`, `width`].\n const parts = name.split('.');\n // Take the name of the configuration out of the parts. E.g. `resize.width` -> `width`.\n name = parts.pop();\n // Iterate over parts to check if currently stored configuration has proper structure.\n for (const part of parts) {\n if (!isPlainObject(source[part])) {\n source = null;\n break;\n }\n // Nested object becomes a source.\n source = source[part];\n }\n // Always returns undefined for non existing configuration.\n return source ? cloneConfig(source[name]) : undefined;\n }\n /**\n * Iterates through passed object and calls {@link #_setToTarget} method with object key and value for each property.\n *\n * @param target Nested config object.\n * @param configuration Configuration data set\n * @param isDefine Defines if passed configuration is default configuration or not.\n */\n _setObjectToTarget(target, configuration, isDefine) {\n Object.keys(configuration).forEach(key => {\n this._setToTarget(target, key, configuration[key], isDefine);\n });\n }\n}\n/**\n * Clones configuration object or value.\n */\nfunction cloneConfig(source) {\n return cloneDeepWith(source, leaveDOMReferences);\n}\n/**\n * A customized function for cloneDeepWith.\n * It will leave references to DOM Elements instead of cloning them.\n */\nfunction leaveDOMReferences(value) {\n return isElement(value) ? value : undefined;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/isnode\n */\n/**\n * Checks if the object is a native DOM Node.\n */\nexport default function isNode(obj) {\n if (obj) {\n if (obj.defaultView) {\n return obj instanceof obj.defaultView.Document;\n }\n else if (obj.ownerDocument && obj.ownerDocument.defaultView) {\n return obj instanceof obj.ownerDocument.defaultView.Node;\n }\n }\n return false;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/iswindow\n */\n/**\n * Checks if the object is a native DOM Window.\n */\nexport default function isWindow(obj) {\n const stringifiedObject = Object.prototype.toString.apply(obj);\n // Returns `true` for the `window` object in browser environments.\n if (stringifiedObject == '[object Window]') {\n return true;\n }\n // Returns `true` for the `window` object in the Electron environment.\n if (stringifiedObject == '[object global]') {\n return true;\n }\n return false;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/emittermixin\n */\nimport EmitterMixin, { _getEmitterListenedTo, _setEmitterId } from '../emittermixin';\nimport uid from '../uid';\nimport isNode from './isnode';\nimport isWindow from './iswindow';\nconst defaultEmitterClass = DomEmitterMixin(EmitterMixin());\nexport default function DomEmitterMixin(base) {\n if (!base) {\n return defaultEmitterClass;\n }\n class Mixin extends base {\n listenTo(emitter, event, callback, options = {}) {\n // Check if emitter is an instance of DOM Node. If so, use corresponding ProxyEmitter (or create one if not existing).\n if (isNode(emitter) || isWindow(emitter)) {\n const proxyOptions = {\n capture: !!options.useCapture,\n passive: !!options.usePassive\n };\n const proxyEmitter = this._getProxyEmitter(emitter, proxyOptions) || new ProxyEmitter(emitter, proxyOptions);\n this.listenTo(proxyEmitter, event, callback, options);\n }\n else {\n // Execute parent class method with Emitter (or ProxyEmitter) instance.\n super.listenTo(emitter, event, callback, options);\n }\n }\n stopListening(emitter, event, callback) {\n // Check if the emitter is an instance of DOM Node. If so, forward the call to the corresponding ProxyEmitters.\n if (isNode(emitter) || isWindow(emitter)) {\n const proxyEmitters = this._getAllProxyEmitters(emitter);\n for (const proxy of proxyEmitters) {\n this.stopListening(proxy, event, callback);\n }\n }\n else {\n // Execute parent class method with Emitter (or ProxyEmitter) instance.\n super.stopListening(emitter, event, callback);\n }\n }\n /**\n * Retrieves ProxyEmitter instance for given DOM Node residing in this Host and given options.\n *\n * @param node DOM Node of the ProxyEmitter.\n * @param options Additional options.\n * @param options.useCapture Indicates that events of this type will be dispatched to the registered\n * listener before being dispatched to any EventTarget beneath it in the DOM tree.\n * @param options.usePassive Indicates that the function specified by listener will never call preventDefault()\n * and prevents blocking browser's main thread by this event handler.\n * @returns ProxyEmitter instance bound to the DOM Node.\n */\n _getProxyEmitter(node, options) {\n return _getEmitterListenedTo(this, getProxyEmitterId(node, options));\n }\n /**\n * Retrieves all the ProxyEmitter instances for given DOM Node residing in this Host.\n *\n * @param node DOM Node of the ProxyEmitter.\n */\n _getAllProxyEmitters(node) {\n return [\n { capture: false, passive: false },\n { capture: false, passive: true },\n { capture: true, passive: false },\n { capture: true, passive: true }\n ].map(options => this._getProxyEmitter(node, options)).filter(proxy => !!proxy);\n }\n }\n return Mixin;\n}\n// Backward compatibility with `mix`\n([\n '_getProxyEmitter', '_getAllProxyEmitters',\n 'on', 'once', 'off', 'listenTo',\n 'stopListening', 'fire', 'delegate', 'stopDelegating',\n '_addEventListener', '_removeEventListener'\n]).forEach(key => {\n DomEmitterMixin[key] = defaultEmitterClass.prototype[key];\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~Emitter#on}.\n * There is a separate instance for each combination of modes (useCapture & usePassive). The mode is concatenated with\n * UID stored in HTMLElement to give each instance unique identifier.\n *\n * listenTo( click, ... )\n * +-----------------------------------------+\n * | stopListening( ... ) |\n * +----------------------------+ | addEventListener( click, ... )\n * | Host | | +---------------------------------------------+\n * +----------------------------+ | | removeEventListener( click, ... ) |\n * | _listeningTo: { | +----------v-------------+ |\n * | UID+mode: { | | 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+mode | |\n * | | DomEmitterMixin | | +--------------^---------+ |\n * | +------------------------+ | | | |\n * +--------------^-------------+ | +---------------------------------------------+\n * | | click (DOM Event)\n * +-----------------------------------------+\n * fire( click, DOM Event )\n */\nclass ProxyEmitter extends EmitterMixin() {\n /**\n * @param node DOM Node that fires events.\n * @param options Additional options.\n * @param options.useCapture Indicates that events of this type will be dispatched to the registered\n * listener before being dispatched to any EventTarget beneath it in the DOM tree.\n * @param options.usePassive Indicates that the function specified by listener will never call preventDefault()\n * and prevents blocking browser's main thread by this event handler.\n */\n constructor(node, options) {\n super();\n // Set emitter ID to match DOM Node \"expando\" property.\n _setEmitterId(this, getProxyEmitterId(node, options));\n // Remember the DOM Node this ProxyEmitter is bound to.\n this._domNode = node;\n // And given options.\n this._options = options;\n }\n /**\n * Registers a callback function to be executed when an event is fired.\n *\n * It attaches a native DOM listener to the DOM Node. When fired,\n * a corresponding Emitter event will also fire with DOM Event object as an argument.\n *\n * **Note**: This is automatically called by the\n * {@link module:utils/emittermixin~Emitter#listenTo `Emitter#listenTo()`}.\n *\n * @param event The name of the event.\n */\n attach(event) {\n // If the DOM Listener for given event already exist it is pointless\n // to attach another one.\n if (this._domListeners && this._domListeners[event]) {\n return;\n }\n const domListener = this._createDomListener(event);\n // Attach the native DOM listener to DOM Node.\n this._domNode.addEventListener(event, domListener, this._options);\n if (!this._domListeners) {\n this._domListeners = {};\n }\n // Store the native DOM listener in this ProxyEmitter. It will be helpful\n // when stopping listening to the event.\n this._domListeners[event] = domListener;\n }\n /**\n * Stops executing the callback on the given event.\n *\n * **Note**: This is automatically called by the\n * {@link module:utils/emittermixin~Emitter#stopListening `Emitter#stopListening()`}.\n *\n * @param event The name of the event.\n */\n detach(event) {\n let events;\n // Remove native DOM listeners which are orphans. If no callbacks\n // are awaiting given event, detach native DOM listener from DOM Node.\n // See: {@link attach}.\n if (this._domListeners[event] && (!(events = this._events[event]) || !events.callbacks.length)) {\n this._domListeners[event].removeListener();\n }\n }\n /**\n * Adds callback to emitter for given event.\n *\n * @internal\n * @param event The name of the event.\n * @param callback The function to be called on event.\n * @param options Additional options.\n */\n _addEventListener(event, callback, options) {\n this.attach(event);\n EmitterMixin().prototype._addEventListener.call(this, event, callback, options);\n }\n /**\n * Removes callback from emitter for given event.\n *\n * @internal\n * @param event The name of the event.\n * @param callback The function to stop being called.\n */\n _removeEventListener(event, callback) {\n EmitterMixin().prototype._removeEventListener.call(this, event, callback);\n this.detach(event);\n }\n /**\n * Creates a native DOM listener callback. When the native DOM event\n * is fired it will fire corresponding event on this ProxyEmitter.\n * Note: A native DOM Event is passed as an argument.\n *\n * @param event The name of the event.\n * @returns The DOM listener callback.\n */\n _createDomListener(event) {\n const domListener = (domEvt) => {\n this.fire(event, domEvt);\n };\n // Supply the DOM listener callback with a function that will help\n // detach it from the DOM Node, when it is no longer necessary.\n // See: {@link detach}.\n domListener.removeListener = () => {\n this._domNode.removeEventListener(event, domListener, this._options);\n delete this._domListeners[event];\n };\n return domListener;\n }\n}\n/**\n * Gets an unique DOM Node identifier. The identifier will be set if not defined.\n *\n * @returns UID for given DOM Node.\n */\nfunction getNodeUID(node) {\n return node['data-ck-expando'] || (node['data-ck-expando'] = uid());\n}\n/**\n * Gets id of the ProxyEmitter for the given node.\n */\nfunction getProxyEmitterId(node, options) {\n let id = getNodeUID(node);\n for (const option of Object.keys(options).sort()) {\n if (options[option]) {\n id += '-' + option;\n }\n }\n return id;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\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 * ```ts\n * import { global } from 'ckeditor5/utils';\n *\n * // This stub will work for any code using global module.\n * testUtils.sinon.stub( global, 'window', {\n * \tinnerWidth: 10000\n * } );\n *\n * console.log( global.window.innerWidth );\n * ```\n */\nlet globalVar; // named globalVar instead of global: https://github.com/ckeditor/ckeditor5/issues/12971\n// In some environments window and document API might not be available.\ntry {\n globalVar = { window, document };\n}\ncatch (e) {\n // It's not possible to mock a window object to simulate lack of a window object without writing extremely convoluted code.\n /* istanbul ignore next -- @preserve */\n // Let's cast it to not change module's API.\n // We only handle this so loading editor in environments without window and document doesn't fail.\n // For better DX we shouldn't introduce mixed types and require developers to check the type manually.\n // This module should not be used on purpose in any environment outside browser.\n globalVar = { window: {}, document: {} };\n}\nexport default globalVar;\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* globals Node */\n/**\n * @module utils/dom/getancestors\n */\n/**\n * Returns all ancestors of given DOM node, starting from the top-most (root). Includes the given node itself. If the\n * node is a part of `DocumentFragment` that `DocumentFragment` will be returned. In contrary, if the node is\n * appended to a `Document`, that `Document` will not be returned (algorithms operating on DOM tree care for `Document#documentElement`\n * at most, which will be returned).\n *\n * @param node DOM node.\n * @returns Array of given `node` parents.\n */\nexport default function getAncestors(node) {\n const nodes = [];\n let currentNode = node;\n // We are interested in `Node`s `DocumentFragment`s only.\n while (currentNode && currentNode.nodeType != Node.DOCUMENT_NODE) {\n nodes.unshift(currentNode);\n currentNode = currentNode.parentNode;\n }\n return nodes;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/istext\n */\n/**\n * Checks if the object is a native DOM Text node.\n */\nexport default function isText(obj) {\n return Object.prototype.toString.call(obj) == '[object Text]';\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/isrange\n */\n/**\n * Checks if the object is a native DOM Range.\n */\nexport default function isRange(obj) {\n return Object.prototype.toString.apply(obj) == '[object Range]';\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/getborderwidths\n */\n/**\n * Returns an object containing CSS border widths of a specified HTML element.\n *\n * @param element An element which has CSS borders.\n * @returns An object containing `top`, `left`, `right` and `bottom` properties\n * with numerical values of the `border-[top,left,right,bottom]-width` CSS styles.\n */\nexport default function getBorderWidths(element) {\n // Call getComputedStyle on the window the element document belongs to.\n const style = element.ownerDocument.defaultView.getComputedStyle(element);\n return {\n top: parseInt(style.borderTopWidth, 10),\n right: parseInt(style.borderRightWidth, 10),\n bottom: parseInt(style.borderBottomWidth, 10),\n left: parseInt(style.borderLeftWidth, 10)\n };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/rect\n */\nimport isRange from './isrange';\nimport isWindow from './iswindow';\nimport getBorderWidths from './getborderwidths';\nimport isText from './istext';\nconst rectProperties = ['top', 'right', 'bottom', 'left', 'width', 'height'];\n/**\n * A helper class representing a `ClientRect` object, e.g. value returned by\n * the native `object.getBoundingClientRect()` method. Provides a set of methods\n * to manipulate the rect and compare it against other rect instances.\n */\nexport default class Rect {\n /**\n * Creates an instance of rect.\n *\n * ```ts\n * // Rect of an HTMLElement.\n * const rectA = new Rect( document.body );\n *\n * // Rect of a DOM Range.\n * const rectB = new Rect( document.getSelection().getRangeAt( 0 ) );\n *\n * // Rect of a window (web browser viewport).\n * const rectC = new Rect( window );\n *\n * // Rect out of an object.\n * const rectD = new Rect( { top: 0, right: 10, bottom: 10, left: 0, width: 10, height: 10 } );\n *\n * // Rect out of another Rect instance.\n * const rectE = new Rect( rectD );\n *\n * // Rect out of a ClientRect.\n * const rectF = new Rect( document.body.getClientRects().item( 0 ) );\n * ```\n *\n * **Note**: By default a rect of an HTML element includes its CSS borders and scrollbars (if any)\n * ant the rect of a `window` includes scrollbars too. Use {@link #excludeScrollbarsAndBorders}\n * to get the inner part of the rect.\n *\n * @param source A source object to create the rect.\n */\n constructor(source) {\n const isSourceRange = isRange(source);\n Object.defineProperty(this, '_source', {\n // If the source is a Rect instance, copy it's #_source.\n value: source._source || source,\n writable: true,\n enumerable: false\n });\n if (isDomElement(source) || isSourceRange) {\n // The `Rect` class depends on `getBoundingClientRect` and `getClientRects` DOM methods. If the source\n // of a rect in an HTML element or a DOM range but it does not belong to any rendered DOM tree, these methods\n // will fail to obtain the geometry and the rect instance makes little sense to the features using it.\n // To get rid of this warning make sure the source passed to the constructor is a descendant of `window.document.body`.\n // @if CK_DEBUG // const sourceNode = isSourceRange ? source.startContainer : source;\n // @if CK_DEBUG // if ( !sourceNode.ownerDocument || !sourceNode.ownerDocument.body.contains( sourceNode ) ) {\n // @if CK_DEBUG // \tconsole.warn(\n // @if CK_DEBUG // \t\t'rect-source-not-in-dom: The source of this rect does not belong to any rendered DOM tree.',\n // @if CK_DEBUG // \t\t{ source } );\n // @if CK_DEBUG // }\n if (isSourceRange) {\n const rangeRects = Rect.getDomRangeRects(source);\n copyRectProperties(this, Rect.getBoundingRect(rangeRects));\n }\n else {\n copyRectProperties(this, source.getBoundingClientRect());\n }\n }\n else if (isWindow(source)) {\n const { innerWidth, innerHeight } = source;\n copyRectProperties(this, {\n top: 0,\n right: innerWidth,\n bottom: innerHeight,\n left: 0,\n width: innerWidth,\n height: innerHeight\n });\n }\n else {\n copyRectProperties(this, source);\n }\n }\n /**\n * Returns a clone of the rect.\n *\n * @returns A cloned rect.\n */\n clone() {\n return new Rect(this);\n }\n /**\n * Moves the rect so that its upperleft corner lands in desired `[ x, y ]` location.\n *\n * @param x Desired horizontal location.\n * @param y Desired vertical location.\n * @returns A rect which has been moved.\n */\n moveTo(x, y) {\n this.top = y;\n this.right = x + this.width;\n this.bottom = y + this.height;\n this.left = x;\n return this;\n }\n /**\n * Moves the rect inplace by a dedicated offset.\n *\n * @param x A horizontal offset.\n * @param y A vertical offset\n * @returns A rect which has been moved.\n */\n moveBy(x, y) {\n this.top += y;\n this.right += x;\n this.left += x;\n this.bottom += y;\n return this;\n }\n /**\n * Returns a new rect a a result of intersection with another rect.\n */\n getIntersection(anotherRect) {\n const rect = {\n top: Math.max(this.top, anotherRect.top),\n right: Math.min(this.right, anotherRect.right),\n bottom: Math.min(this.bottom, anotherRect.bottom),\n left: Math.max(this.left, anotherRect.left),\n width: 0,\n height: 0\n };\n rect.width = rect.right - rect.left;\n rect.height = rect.bottom - rect.top;\n if (rect.width < 0 || rect.height < 0) {\n return null;\n }\n else {\n return new Rect(rect);\n }\n }\n /**\n * Returns the area of intersection with another rect.\n *\n * @returns Area of intersection.\n */\n getIntersectionArea(anotherRect) {\n const rect = this.getIntersection(anotherRect);\n if (rect) {\n return rect.getArea();\n }\n else {\n return 0;\n }\n }\n /**\n * Returns the area of the rect.\n */\n getArea() {\n return this.width * this.height;\n }\n /**\n * Returns a new rect, a part of the original rect, which is actually visible to the user,\n * e.g. an original rect cropped by parent element rects which have `overflow` set in CSS\n * other than `\"visible\"`.\n *\n * If there's no such visible rect, which is when the rect is limited by one or many of\n * the ancestors, `null` is returned.\n *\n * @returns A visible rect instance or `null`, if there's none.\n */\n getVisible() {\n const source = this._source;\n let visibleRect = this.clone();\n // There's no ancestor to crop <body> with the overflow.\n if (!isBody(source)) {\n let parent = source.parentNode || source.commonAncestorContainer;\n // Check the ancestors all the way up to the <body>.\n while (parent && !isBody(parent)) {\n const parentRect = new Rect(parent);\n const intersectionRect = visibleRect.getIntersection(parentRect);\n if (intersectionRect) {\n if (intersectionRect.getArea() < visibleRect.getArea()) {\n // Reduce the visible rect to the intersection.\n visibleRect = intersectionRect;\n }\n }\n else {\n // There's no intersection, the rect is completely invisible.\n return null;\n }\n parent = parent.parentNode;\n }\n }\n return visibleRect;\n }\n /**\n * Checks if all property values ({@link #top}, {@link #left}, {@link #right},\n * {@link #bottom}, {@link #width} and {@link #height}) are the equal in both rect\n * instances.\n *\n * @param anotherRect A rect instance to compare with.\n * @returns `true` when Rects are equal. `false` otherwise.\n */\n isEqual(anotherRect) {\n for (const prop of rectProperties) {\n if (this[prop] !== anotherRect[prop]) {\n return false;\n }\n }\n return true;\n }\n /**\n * Checks whether a rect fully contains another rect instance.\n *\n * @param anotherRect\n * @returns `true` if contains, `false` otherwise.\n */\n contains(anotherRect) {\n const intersectRect = this.getIntersection(anotherRect);\n return !!(intersectRect && intersectRect.isEqual(anotherRect));\n }\n /**\n * Excludes scrollbars and CSS borders from the rect.\n *\n * * Borders are removed when {@link #_source} is an HTML element.\n * * Scrollbars are excluded from HTML elements and the `window`.\n *\n * @returns A rect which has been updated.\n */\n excludeScrollbarsAndBorders() {\n const source = this._source;\n let scrollBarWidth, scrollBarHeight, direction;\n if (isWindow(source)) {\n scrollBarWidth = source.innerWidth - source.document.documentElement.clientWidth;\n scrollBarHeight = source.innerHeight - source.document.documentElement.clientHeight;\n direction = source.getComputedStyle(source.document.documentElement).direction;\n }\n else {\n const borderWidths = getBorderWidths(source);\n scrollBarWidth = source.offsetWidth - source.clientWidth - borderWidths.left - borderWidths.right;\n scrollBarHeight = source.offsetHeight - source.clientHeight - borderWidths.top - borderWidths.bottom;\n direction = source.ownerDocument.defaultView.getComputedStyle(source).direction;\n this.left += borderWidths.left;\n this.top += borderWidths.top;\n this.right -= borderWidths.right;\n this.bottom -= borderWidths.bottom;\n this.width = this.right - this.left;\n this.height = this.bottom - this.top;\n }\n this.width -= scrollBarWidth;\n if (direction === 'ltr') {\n this.right -= scrollBarWidth;\n }\n else {\n this.left += scrollBarWidth;\n }\n this.height -= scrollBarHeight;\n this.bottom -= scrollBarHeight;\n return this;\n }\n /**\n * Returns an array of rects of the given native DOM Range.\n *\n * @param range A native DOM range.\n * @returns DOM Range rects.\n */\n static getDomRangeRects(range) {\n const rects = [];\n // Safari does not iterate over ClientRectList using for...of loop.\n const clientRects = Array.from(range.getClientRects());\n if (clientRects.length) {\n for (const rect of clientRects) {\n rects.push(new Rect(rect));\n }\n }\n // If there's no client rects for the Range, use parent container's bounding rect\n // instead and adjust rect's width to simulate the actual geometry of such range.\n // https://github.com/ckeditor/ckeditor5-utils/issues/153\n // https://github.com/ckeditor/ckeditor5-ui/issues/317\n else {\n let startContainer = range.startContainer;\n if (isText(startContainer)) {\n startContainer = startContainer.parentNode;\n }\n const rect = new Rect(startContainer.getBoundingClientRect());\n rect.right = rect.left;\n rect.width = 0;\n rects.push(rect);\n }\n return rects;\n }\n /**\n * Returns a bounding rectangle that contains all the given `rects`.\n *\n * @param rects A list of rectangles that should be contained in the result rectangle.\n * @returns Bounding rectangle or `null` if no `rects` were given.\n */\n static getBoundingRect(rects) {\n const boundingRectData = {\n left: Number.POSITIVE_INFINITY,\n top: Number.POSITIVE_INFINITY,\n right: Number.NEGATIVE_INFINITY,\n bottom: Number.NEGATIVE_INFINITY,\n width: 0,\n height: 0\n };\n let rectangleCount = 0;\n for (const rect of rects) {\n rectangleCount++;\n boundingRectData.left = Math.min(boundingRectData.left, rect.left);\n boundingRectData.top = Math.min(boundingRectData.top, rect.top);\n boundingRectData.right = Math.max(boundingRectData.right, rect.right);\n boundingRectData.bottom = Math.max(boundingRectData.bottom, rect.bottom);\n }\n if (rectangleCount == 0) {\n return null;\n }\n boundingRectData.width = boundingRectData.right - boundingRectData.left;\n boundingRectData.height = boundingRectData.bottom - boundingRectData.top;\n return new Rect(boundingRectData);\n }\n}\n/**\n * Acquires all the rect properties from the passed source.\n */\nfunction copyRectProperties(rect, source) {\n for (const p of rectProperties) {\n rect[p] = source[p];\n }\n}\n/**\n * Checks if provided object is a <body> HTML element.\n */\nfunction isBody(value) {\n if (!isDomElement(value)) {\n return false;\n }\n return value === value.ownerDocument.body;\n}\n/**\n * Checks if provided object \"looks like\" a DOM Element and has API required by `Rect` class.\n */\nfunction isDomElement(value) {\n // Note: earlier we used `isElement()` from lodash library, however that function is less performant because\n // it makes complicated checks to make sure that given value is a DOM element.\n return value !== null && typeof value === 'object' && value.nodeType === 1 && typeof value.getBoundingClientRect === 'function';\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/resizeobserver\n */\nimport global from './global';\n/**\n * A helper class which instances allow performing custom actions when native DOM elements are resized.\n *\n * ```ts\n * const editableElement = editor.editing.view.getDomRoot();\n *\n * const observer = new ResizeObserver( editableElement, entry => {\n * \tconsole.log( 'The editable element has been resized in DOM.' );\n * \tconsole.log( entry.target ); // -> editableElement\n * \tconsole.log( entry.contentRect.width ); // -> e.g. '423px'\n * } );\n * ```\n *\n * It uses the [native DOM resize observer](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver)\n * under the hood.\n */\nexport default class ResizeObserver {\n /**\n * Creates an instance of the `ResizeObserver` class.\n *\n * @param element A DOM element that is to be observed for resizing. Note that\n * the element must be visible (i.e. not detached from DOM) for the observer to work.\n * @param callback A function called when the observed element was resized. It passes\n * the [`ResizeObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry)\n * object with information about the resize event.\n */\n constructor(element, callback) {\n // **Note**: For the maximum performance, this class ensures only a single instance of the native\n // observer is used no matter how many instances of this class were created.\n if (!ResizeObserver._observerInstance) {\n ResizeObserver._createObserver();\n }\n this._element = element;\n this._callback = callback;\n ResizeObserver._addElementCallback(element, callback);\n ResizeObserver._observerInstance.observe(element);\n }\n /**\n * Destroys the observer which disables the `callback` passed to the {@link #constructor}.\n */\n destroy() {\n ResizeObserver._deleteElementCallback(this._element, this._callback);\n }\n /**\n * Registers a new resize callback for the DOM element.\n */\n static _addElementCallback(element, callback) {\n if (!ResizeObserver._elementCallbacks) {\n ResizeObserver._elementCallbacks = new Map();\n }\n let callbacks = ResizeObserver._elementCallbacks.get(element);\n if (!callbacks) {\n callbacks = new Set();\n ResizeObserver._elementCallbacks.set(element, callbacks);\n }\n callbacks.add(callback);\n }\n /**\n * Removes a resize callback from the DOM element. If no callbacks are left\n * for the element, it removes the element from the native observer.\n */\n static _deleteElementCallback(element, callback) {\n const callbacks = ResizeObserver._getElementCallbacks(element);\n // Remove the element callback. Check if exist first in case someone\n // called destroy() twice.\n if (callbacks) {\n callbacks.delete(callback);\n // If no callbacks left for the element, also remove the element.\n if (!callbacks.size) {\n ResizeObserver._elementCallbacks.delete(element);\n ResizeObserver._observerInstance.unobserve(element);\n }\n }\n if (ResizeObserver._elementCallbacks && !ResizeObserver._elementCallbacks.size) {\n ResizeObserver._observerInstance = null;\n ResizeObserver._elementCallbacks = null;\n }\n }\n /**\n * Returns are registered resize callbacks for the DOM element.\n */\n static _getElementCallbacks(element) {\n if (!ResizeObserver._elementCallbacks) {\n return null;\n }\n return ResizeObserver._elementCallbacks.get(element);\n }\n /**\n * Creates the single native observer shared across all `ResizeObserver` instances.\n */\n static _createObserver() {\n ResizeObserver._observerInstance = new global.window.ResizeObserver(entries => {\n for (const entry of entries) {\n const callbacks = ResizeObserver._getElementCallbacks(entry.target);\n if (callbacks) {\n for (const callback of callbacks) {\n callback(entry);\n }\n }\n }\n });\n }\n}\n/**\n * The single native observer instance shared across all {@link module:utils/dom/resizeobserver~ResizeObserver} instances.\n */\nResizeObserver._observerInstance = null;\n/**\n * A mapping of native DOM elements and their callbacks shared across all\n * {@link module:utils/dom/resizeobserver~ResizeObserver} instances.\n */\nResizeObserver._elementCallbacks = null;\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/setdatainelement\n */\n/* globals HTMLTextAreaElement */\n/**\n * Sets data in a given element.\n *\n * @param el The element in which the data will be set.\n * @param data The data string.\n */\nexport default function setDataInElement(el, data) {\n if (el instanceof HTMLTextAreaElement) {\n el.value = data;\n }\n el.innerHTML = data;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/tounit\n */\n/**\n * Returns a helper function, which adds a desired trailing\n * `unit` to the passed value.\n *\n * @param unit An unit like \"px\" or \"em\".\n */\nexport default function toUnit(unit) {\n return value => value + unit;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/indexof\n */\n/**\n * Returns index of the node in the parent element.\n *\n * @param node Node which index is tested.\n * @returns Index of the node in the parent element. Returns 0 if node has no parent.\n */\nexport default function indexOf(node) {\n let index = 0;\n while (node.previousSibling) {\n node = node.previousSibling;\n index++;\n }\n return index;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/insertat\n */\n/**\n * Inserts node to the parent at given index.\n *\n * @param parentElement Parent element.\n * @param index Insertions index.\n * @param nodeToInsert Node to insert.\n */\nexport default function insertAt(parentElement, index, nodeToInsert) {\n parentElement.insertBefore(nodeToInsert, parentElement.childNodes[index] || null);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* globals Node */\n/**\n * @module utils/dom/iscomment\n */\n/**\n * Checks whether the object is a native DOM Comment node.\n */\nexport default function isComment(obj) {\n return obj && obj.nodeType === Node.COMMENT_NODE;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/isvalidattributename\n */\nimport global from './global';\n/**\n * Checks if the given attribute name is valid in terms of HTML.\n *\n * @param name Attribute name.\n */\nexport default function isValidAttributeName(name) {\n try {\n global.document.createAttribute(name);\n }\n catch (error) {\n return false;\n }\n return true;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/isvisible\n */\n/**\n * Checks whether the element is visible to the user in DOM:\n *\n * * connected to the root of the document,\n * * has no `display: none`,\n * * has no ancestors with `display: none`.\n *\n * **Note**: This helper does not check whether the element is hidden by cropping, overflow, etc..\n * To check that, use {@link module:utils/dom/rect~Rect} instead.\n */\nexport default function isVisible(element) {\n return !!(element && element.getClientRects && element.getClientRects().length);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/position\n */\nimport global from './global';\nimport Rect from './rect';\nimport getPositionedAncestor from './getpositionedancestor';\nimport getBorderWidths from './getborderwidths';\nimport { isFunction } from 'lodash-es';\n// @if CK_DEBUG_POSITION // const RectDrawer = require( '@ckeditor/ckeditor5-utils/tests/_utils/rectdrawer' ).default\n/**\n * Calculates the `position: absolute` coordinates of a given element so it can be positioned with respect to the\n * target in the visually most efficient way, taking various restrictions like viewport or limiter geometry\n * into consideration.\n *\n * ```ts\n * // The element which is to be positioned.\n * const element = document.body.querySelector( '#toolbar' );\n *\n * // A target to which the element is positioned relatively.\n * const target = document.body.querySelector( '#container' );\n *\n * // Finding the optimal coordinates for the positioning.\n * const { left, top, name } = getOptimalPosition( {\n * \telement: element,\n * \ttarget: target,\n *\n * \t// The algorithm will chose among these positions to meet the requirements such\n * \t// as \"limiter\" element or \"fitInViewport\", set below. The positions are considered\n * \t// in the order of the array.\n * \tpositions: [\n * \t\t//\n * \t \t//\t[ Target ]\n * \t\t//\t+-----------------+\n * \t\t//\t| Element |\n * \t\t//\t+-----------------+\n * \t\t//\n * \t\ttargetRect => ( {\n * \t\t\ttop: targetRect.bottom,\n * \t\t\tleft: targetRect.left,\n * \t\t\tname: 'mySouthEastPosition'\n * \t\t} ),\n *\n * \t\t//\n * \t\t//\t+-----------------+\n * \t\t//\t| Element |\n * \t\t//\t+-----------------+\n * \t\t//\t[ Target ]\n * \t\t//\n * \t\t( targetRect, elementRect ) => ( {\n * \t\t\ttop: targetRect.top - elementRect.height,\n * \t\t\tleft: targetRect.left,\n * \t\t\tname: 'myNorthEastPosition'\n * \t\t} )\n * \t],\n *\n * \t// Find a position such guarantees the element remains within visible boundaries of <body>.\n * \tlimiter: document.body,\n *\n * \t// Find a position such guarantees the element remains within visible boundaries of the browser viewport.\n * \tfitInViewport: true\n * } );\n *\n * // The best position which fits into document.body and the viewport. May be useful\n * // to set proper class on the `element`.\n * console.log( name ); // -> \"myNorthEastPosition\"\n *\n * // Using the absolute coordinates which has been found to position the element\n * // as in the diagram depicting the \"myNorthEastPosition\" position.\n * element.style.top = top;\n * element.style.left = left;\n * ```\n *\n * @param options The input data and configuration of the helper.\n */\nexport function getOptimalPosition({ element, target, positions, limiter, fitInViewport, viewportOffsetConfig }) {\n // If the {@link module:utils/dom/position~Options#target} is a function, use what it returns.\n // https://github.com/ckeditor/ckeditor5-utils/issues/157\n if (isFunction(target)) {\n target = target();\n }\n // If the {@link module:utils/dom/position~Options#limiter} is a function, use what it returns.\n // https://github.com/ckeditor/ckeditor5-ui/issues/260\n if (isFunction(limiter)) {\n limiter = limiter();\n }\n const positionedElementAncestor = getPositionedAncestor(element);\n const elementRect = new Rect(element);\n const targetRect = new Rect(target);\n let bestPosition;\n // @if CK_DEBUG_POSITION // RectDrawer.clear();\n // @if CK_DEBUG_POSITION // RectDrawer.draw( targetRect, { outlineWidth: '5px' }, 'Target' );\n const viewportRect = fitInViewport && getConstrainedViewportRect(viewportOffsetConfig) || null;\n const positionOptions = { targetRect, elementRect, positionedElementAncestor, viewportRect };\n // If there are no limits, just grab the very first position and be done with that drama.\n if (!limiter && !fitInViewport) {\n bestPosition = new PositionObject(positions[0], positionOptions);\n }\n else {\n const limiterRect = limiter && new Rect(limiter).getVisible();\n // @if CK_DEBUG_POSITION // if ( viewportRect ) {\n // @if CK_DEBUG_POSITION //\t\tRectDrawer.draw( viewportRect, { outlineWidth: '5px' }, 'Viewport' );\n // @if CK_DEBUG_POSITION // }\n // @if CK_DEBUG_POSITION // if ( limiter ) {\n // @if CK_DEBUG_POSITION // \tRectDrawer.draw( limiterRect, { outlineWidth: '5px', outlineColor: 'green' }, 'Visible limiter' );\n // @if CK_DEBUG_POSITION // }\n Object.assign(positionOptions, { limiterRect, viewportRect });\n // If there's no best position found, i.e. when all intersections have no area because\n // rects have no width or height, then just use the first available position.\n bestPosition = getBestPosition(positions, positionOptions) || new PositionObject(positions[0], positionOptions);\n }\n return bestPosition;\n}\n/**\n * Returns a viewport `Rect` shrunk by the viewport offset config from all sides.\n */\nfunction getConstrainedViewportRect(viewportOffsetConfig) {\n viewportOffsetConfig = Object.assign({ top: 0, bottom: 0, left: 0, right: 0 }, viewportOffsetConfig);\n const viewportRect = new Rect(global.window);\n viewportRect.top += viewportOffsetConfig.top;\n viewportRect.height -= viewportOffsetConfig.top;\n viewportRect.bottom -= viewportOffsetConfig.bottom;\n viewportRect.height -= viewportOffsetConfig.bottom;\n return viewportRect;\n}\n/**\n * For a given array of positioning functions, returns such that provides the best\n * fit of the `elementRect` into the `limiterRect` and `viewportRect`.\n */\nfunction getBestPosition(positions, options) {\n const { elementRect } = options;\n // This is when element is fully visible.\n const elementRectArea = elementRect.getArea();\n const positionInstances = positions\n .map(positioningFunction => new PositionObject(positioningFunction, options))\n // Some positioning functions may return `null` if they don't want to participate.\n .filter(position => !!position.name);\n let maxFitFactor = 0;\n let bestPosition = null;\n for (const position of positionInstances) {\n const { limiterIntersectionArea, viewportIntersectionArea } = position;\n // If a such position is found that element is fully contained by the limiter then, obviously,\n // there will be no better one, so finishing.\n if (limiterIntersectionArea === elementRectArea) {\n return position;\n }\n // To maximize both viewport and limiter intersection areas we use distance on _viewportIntersectionArea\n // and _limiterIntersectionArea plane (without sqrt because we are looking for max value).\n const fitFactor = viewportIntersectionArea ** 2 + limiterIntersectionArea ** 2;\n if (fitFactor > maxFitFactor) {\n maxFitFactor = fitFactor;\n bestPosition = position;\n }\n }\n return bestPosition;\n}\n/**\n * For a given absolute Rect coordinates object and a positioned element ancestor, it updates its\n * coordinates that make up for the position and the scroll of the ancestor.\n *\n * This is necessary because while Rects (and DOMRects) are relative to the browser's viewport, their coordinates\n * are used in reallife to position elements with `position: absolute`, which are scoped by any positioned\n * (and scrollable) ancestors.\n */\nfunction shiftRectToCompensatePositionedAncestor(rect, positionedElementAncestor) {\n const ancestorPosition = getRectForAbsolutePositioning(new Rect(positionedElementAncestor));\n const ancestorBorderWidths = getBorderWidths(positionedElementAncestor);\n let moveX = 0;\n let moveY = 0;\n // (https://github.com/ckeditor/ckeditor5-ui-default/issues/126)\n // If there's some positioned ancestor of the panel, then its `Rect` must be taken into\n // consideration. `Rect` is always relative to the viewport while `position: absolute` works\n // with respect to that positioned ancestor.\n moveX -= ancestorPosition.left;\n moveY -= ancestorPosition.top;\n // (https://github.com/ckeditor/ckeditor5-utils/issues/139)\n // If there's some positioned ancestor of the panel, not only its position must be taken into\n // consideration (see above) but also its internal scrolls. Scroll have an impact here because `Rect`\n // is relative to the viewport (it doesn't care about scrolling), while `position: absolute`\n // must compensate that scrolling.\n moveX += positionedElementAncestor.scrollLeft;\n moveY += positionedElementAncestor.scrollTop;\n // (https://github.com/ckeditor/ckeditor5-utils/issues/139)\n // If there's some positioned ancestor of the panel, then its `Rect` includes its CSS `borderWidth`\n // while `position: absolute` positioning does not consider it.\n // E.g. `{ position: absolute, top: 0, left: 0 }` means upper left corner of the element,\n // not upper-left corner of its border.\n moveX -= ancestorBorderWidths.left;\n moveY -= ancestorBorderWidths.top;\n rect.moveBy(moveX, moveY);\n}\n/**\n * DOMRect (also Rect) works in a scrollindependent geometry but `position: absolute` doesn't.\n * This function converts Rect to `position: absolute` coordinates.\n */\nfunction getRectForAbsolutePositioning(rect) {\n const { scrollX, scrollY } = global.window;\n return rect.clone().moveBy(scrollX, scrollY);\n}\n/**\n * A position class which instances are created and used by the {@link module:utils/dom/position~getOptimalPosition} helper.\n *\n * {@link module:utils/dom/position~Position#top} and {@link module:utils/dom/position~Position#left} properties of the position instance\n * translate directly to the `top` and `left` properties in CSS \"`position: absolute` coordinate system\". If set on the positioned element\n * in DOM, they will make it display it in the right place in the viewport.\n */\nclass PositionObject {\n /**\n * Creates an instance of the {@link module:utils/dom/position~PositionObject} class.\n *\n * @param positioningFunction function The function that defines the expected\n * coordinates the positioned element should move to.\n * @param options options object.\n * @param options.elementRect The positioned element rect.\n * @param options.targetRect The target element rect.\n * @param options.viewportRect The viewport rect.\n * @param options.limiterRect The limiter rect.\n * @param options.positionedElementAncestor Nearest element ancestor element which CSS position is not \"static\".\n */\n constructor(positioningFunction, options) {\n const positioningFunctionOutput = positioningFunction(options.targetRect, options.elementRect, options.viewportRect);\n // Nameless position for a function that didn't participate.\n if (!positioningFunctionOutput) {\n return;\n }\n const { left, top, name, config } = positioningFunctionOutput;\n this.name = name;\n this.config = config;\n this._positioningFunctionCorrdinates = { left, top };\n this._options = options;\n }\n /**\n * The left value in pixels in the CSS `position: absolute` coordinate system.\n * Set it on the positioned element in DOM to move it to the position.\n */\n get left() {\n return this._absoluteRect.left;\n }\n /**\n * The top value in pixels in the CSS `position: absolute` coordinate system.\n * Set it on the positioned element in DOM to move it to the position.\n */\n get top() {\n return this._absoluteRect.top;\n }\n /**\n * An intersection area between positioned element and limiter within viewport constraints.\n */\n get limiterIntersectionArea() {\n const limiterRect = this._options.limiterRect;\n if (limiterRect) {\n const viewportRect = this._options.viewportRect;\n if (viewportRect) {\n // Consider only the part of the limiter which is visible in the viewport. So the limiter is getting limited.\n const limiterViewportIntersectRect = limiterRect.getIntersection(viewportRect);\n if (limiterViewportIntersectRect) {\n // If the limiter is within the viewport, then check the intersection between that part of the\n // limiter and actual position.\n return limiterViewportIntersectRect.getIntersectionArea(this._rect);\n }\n }\n else {\n return limiterRect.getIntersectionArea(this._rect);\n }\n }\n return 0;\n }\n /**\n * An intersection area between positioned element and viewport.\n */\n get viewportIntersectionArea() {\n const viewportRect = this._options.viewportRect;\n if (viewportRect) {\n return viewportRect.getIntersectionArea(this._rect);\n }\n return 0;\n }\n /**\n * An already positioned element rect. A clone of the element rect passed to the constructor\n * but placed in the viewport according to the positioning function.\n */\n get _rect() {\n if (this._cachedRect) {\n return this._cachedRect;\n }\n this._cachedRect = this._options.elementRect.clone().moveTo(this._positioningFunctionCorrdinates.left, this._positioningFunctionCorrdinates.top);\n return this._cachedRect;\n }\n /**\n * An already absolutely positioned element rect. See ({@link #_rect}).\n */\n get _absoluteRect() {\n if (this._cachedAbsoluteRect) {\n return this._cachedAbsoluteRect;\n }\n this._cachedAbsoluteRect = getRectForAbsolutePositioning(this._rect);\n if (this._options.positionedElementAncestor) {\n shiftRectToCompensatePositionedAncestor(this._cachedAbsoluteRect, this._options.positionedElementAncestor);\n }\n return this._cachedAbsoluteRect;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/getpositionedancestor\n */\nimport global from './global';\n/**\n * For a given element, returns the nearest ancestor element which CSS position is not \"static\".\n *\n * @param element The native DOM element to be checked.\n */\nexport default function getPositionedAncestor(element) {\n if (!element || !element.parentNode) {\n return null;\n }\n if (element.offsetParent === global.document.body) {\n return null;\n }\n return element.offsetParent;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/remove\n */\n/**\n * Removes given node from parent.\n *\n * @param node Node to remove.\n */\nexport default function remove(node) {\n const parent = node.parentNode;\n if (parent) {\n parent.removeChild(node);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/scroll\n */\nimport isRange from './isrange';\nimport Rect from './rect';\nimport isText from './istext';\n/**\n * Makes any page `HTMLElement` or `Range` (`target`) visible inside the browser viewport.\n * This helper will scroll all `target` ancestors and the web browser viewport to reveal the target to\n * the user. If the `target` is already visible, nothing will happen.\n *\n * @param options Additional configuration of the scrolling behavior.\n * @param options.target A target, which supposed to become visible to the user.\n * @param options.viewportOffset An offset from the edge of the viewport (in pixels)\n * the `target` will be moved by if the viewport is scrolled. It enhances the user experience\n * by keeping the `target` some distance from the edge of the viewport and thus making it easier to\n * read or edit by the user.\n * @param options.ancestorOffset An offset from the boundary of scrollable ancestors (if any)\n * the `target` will be moved by if the viewport is scrolled. It enhances the user experience\n * by keeping the `target` some distance from the edge of the ancestors and thus making it easier to\n * read or edit by the user.\n * @param options.alignToTop When set `true`, the helper will make sure the `target` is scrolled up\n * to the top boundary of the viewport and/or scrollable ancestors if scrolled up. When not set\n * (default), the `target` will be revealed by scrolling as little as possible. This option will\n * not affect `targets` that must be scrolled down because they will appear at the top of the boundary\n * anyway.\n *\n * ```\n * scrollViewportToShowTarget() with scrollViewportToShowTarget() with\n * Initial state alignToTop unset (default) alignToTop = true\n *\n * ┌────────────────────────────────┬─┐ ┌────────────────────────────────┬─┐ ┌────────────────────────────────┬─┐\n * │ │▲│ │ │▲│ │ [ Target to be revealed ] │▲│\n * │ │ │ │ │ │ │ │ │\n * │ │█│ │ │ │ │ │ │\n * │ │█│ │ │ │ │ │ │\n * │ │ │ │ │█│ │ │ │\n * │ │ │ │ │█│ │ │█│\n * │ │ │ │ │ │ │ │█│\n * │ │▼│ │ [ Target to be revealed ] │▼│ │ │▼│\n * └────────────────────────────────┴─┘ └────────────────────────────────┴─┘ └────────────────────────────────┴─┘\n *\n *\n * [ Target to be revealed ]\n *```\n *\n * @param options.forceScroll When set `true`, the `target` will be aligned to the top of the viewport\n * and scrollable ancestors whether it is already visible or not. This option will only work when `alignToTop`\n * is `true`\n */\nexport function scrollViewportToShowTarget({ target, viewportOffset = 0, ancestorOffset = 0, alignToTop, forceScroll }) {\n const targetWindow = getWindow(target);\n let currentWindow = targetWindow;\n let currentFrame = null;\n // Iterate over all windows, starting from target's parent window up to window#top.\n while (currentWindow) {\n let firstAncestorToScroll;\n // Let's scroll target's ancestors first to reveal it. Then, once the ancestor scrolls\n // settled down, the algorithm can eventually scroll the viewport of the current window.\n //\n // Note: If the current window is target's **original** window (e.g. the first one),\n // start scrolling the closest parent of the target. If not, scroll the closest parent\n // of an iframe that resides in the current window.\n if (currentWindow == targetWindow) {\n firstAncestorToScroll = getParentElement(target);\n }\n else {\n firstAncestorToScroll = getParentElement(currentFrame);\n }\n // Scroll the target's ancestors first. Once done, scrolling the viewport is easy.\n scrollAncestorsToShowRect({\n parent: firstAncestorToScroll,\n getRect: () => {\n // Note: If the target does not belong to the current window **directly**,\n // i.e. it resides in an iframe belonging to the window, obtain the target's rect\n // in the coordinates of the current window. By default, a Rect returns geometry\n // relative to the current window's viewport. To make it work in a parent window,\n // it must be shifted.\n return getRectRelativeToWindow(target, currentWindow);\n },\n alignToTop,\n ancestorOffset,\n forceScroll\n });\n // Obtain the rect of the target after it has been scrolled within its ancestors.\n // It's time to scroll the viewport.\n const targetRect = getRectRelativeToWindow(target, currentWindow);\n scrollWindowToShowRect({\n window: currentWindow,\n rect: targetRect,\n viewportOffset,\n alignToTop,\n forceScroll\n });\n if (currentWindow.parent != currentWindow) {\n // Keep the reference to the <iframe> element the \"previous current window\" was\n // rendered within. It will be useful to recalculate the rect of the target\n // in the parent window's relative geometry. The target's rect must be shifted\n // by it's iframe's position.\n currentFrame = currentWindow.frameElement;\n currentWindow = currentWindow.parent;\n // If the current window has some parent but frameElement is inaccessible, then they have\n // different domains/ports and, due to security reasons, accessing and scrolling\n // the parent window won't be possible.\n // See https://github.com/ckeditor/ckeditor5/issues/930.\n if (!currentFrame) {\n return;\n }\n }\n else {\n currentWindow = null;\n }\n }\n}\n/**\n * Makes any page `HTMLElement` or `Range` (target) visible within its scrollable ancestors,\n * e.g. if they have `overflow: scroll` CSS style.\n *\n * @param target A target, which supposed to become visible to the user.\n * @param ancestorOffset An offset between the target and the boundary of scrollable ancestors\n * to be maintained while scrolling.\n */\nexport function scrollAncestorsToShowTarget(target, ancestorOffset) {\n const targetParent = getParentElement(target);\n scrollAncestorsToShowRect({\n parent: targetParent,\n getRect: () => new Rect(target),\n ancestorOffset\n });\n}\n/**\n * Makes a given rect visible within its parent window.\n *\n * Note: Avoid the situation where the caret is still in the viewport, but totally\n * at the edge of it. In such situation, if it moved beyond the viewport in the next\n * action e.g. after paste, the scrolling would move it to the viewportOffset level\n * and it all would look like the caret visually moved up/down:\n *\n * 1.\n * ```\n * | foo[]\n * | <--- N px of space below the caret\n * +---------------------------------...\n * ```\n *\n * 2. *paste*\n * 3.\n * ```\n * |\n * |\n * +-foo-----------------------------...\n * bar[] <--- caret below viewport, scrolling...\n * ```\n *\n * 4. *scrolling*\n * 5.\n * ```\n * |\n * | foo\n * | bar[] <--- caret precisely at the edge\n * +---------------------------------...\n * ```\n *\n * To prevent this, this method checks the rects moved by the viewportOffset to cover\n * the upper/lower edge of the viewport. It makes sure if the action repeats, there's\n * no twitching it's a purely visual improvement:\n *\n * 5. (after fix)\n * ```\n * |\n * | foo\n * | bar[]\n * | <--- N px of space below the caret\n * +---------------------------------...\n * ```\n *\n * @param options Additional configuration of the scrolling behavior.\n * @param options.window A window which is scrolled to reveal the rect.\n * @param options.rect A rect which is to be revealed.\n * @param options.viewportOffset An offset from the edge of the viewport (in pixels) the `rect` will be\n * moved by if the viewport is scrolled.\n * @param options.alignToTop When set `true`, the helper will make sure the `rect` is scrolled up\n * to the top boundary of the viewport if scrolled up. When not set (default), the `rect` will be\n * revealed by scrolling as little as possible. This option will not affect rects that must be scrolled\n * down because they will appear at the top of the boundary anyway.\n * @param options.forceScroll When set `true`, the `rect` will be aligned to the top of the viewport\n * whether it is already visible or not. This option will only work when `alignToTop` is `true`\n */\nfunction scrollWindowToShowRect({ window, rect, alignToTop, forceScroll, viewportOffset }) {\n const targetShiftedDownRect = rect.clone().moveBy(0, viewportOffset);\n const targetShiftedUpRect = rect.clone().moveBy(0, -viewportOffset);\n const viewportRect = new Rect(window).excludeScrollbarsAndBorders();\n const rects = [targetShiftedUpRect, targetShiftedDownRect];\n const forceScrollToTop = alignToTop && forceScroll;\n const allRectsFitInViewport = rects.every(rect => viewportRect.contains(rect));\n let { scrollX, scrollY } = window;\n const initialScrollX = scrollX;\n const initialScrollY = scrollY;\n if (forceScrollToTop) {\n scrollY -= (viewportRect.top - rect.top) + viewportOffset;\n }\n else if (!allRectsFitInViewport) {\n if (isAbove(targetShiftedUpRect, viewportRect)) {\n scrollY -= viewportRect.top - rect.top + viewportOffset;\n }\n else if (isBelow(targetShiftedDownRect, viewportRect)) {\n if (alignToTop) {\n scrollY += rect.top - viewportRect.top - viewportOffset;\n }\n else {\n scrollY += rect.bottom - viewportRect.bottom + viewportOffset;\n }\n }\n }\n if (!allRectsFitInViewport) {\n // TODO: Web browsers scroll natively to place the target in the middle\n // of the viewport. It's not a very popular case, though.\n if (isLeftOf(rect, viewportRect)) {\n scrollX -= viewportRect.left - rect.left + viewportOffset;\n }\n else if (isRightOf(rect, viewportRect)) {\n scrollX += rect.right - viewportRect.right + viewportOffset;\n }\n }\n if (scrollX != initialScrollX || scrollY !== initialScrollY) {\n window.scrollTo(scrollX, scrollY);\n }\n}\n/**\n * Recursively scrolls element ancestors to visually reveal a rect.\n *\n * @param options Additional configuration of the scrolling behavior.\n * @param options.parent The first parent ancestor to start scrolling.\n * @param options.getRect A function which returns the Rect, which is to be revealed.\n * @param options.ancestorOffset An offset from the boundary of scrollable ancestors (if any)\n * the `Rect` instance will be moved by if the viewport is scrolled.\n * @param options.alignToTop When set `true`, the helper will make sure the `Rect` instance is scrolled up\n * to the top boundary of the scrollable ancestors if scrolled up. When not set (default), the `rect`\n * will be revealed by scrolling as little as possible. This option will not affect rects that must be\n * scrolled down because they will appear at the top of the boundary\n * anyway.\n * @param options.forceScroll When set `true`, the `rect` will be aligned to the top of scrollable ancestors\n * whether it is already visible or not. This option will only work when `alignToTop` is `true`\n */\nfunction scrollAncestorsToShowRect({ parent, getRect, alignToTop, forceScroll, ancestorOffset = 0 }) {\n const parentWindow = getWindow(parent);\n const forceScrollToTop = alignToTop && forceScroll;\n let parentRect, targetRect, targetFitsInTarget;\n while (parent != parentWindow.document.body) {\n targetRect = getRect();\n parentRect = new Rect(parent).excludeScrollbarsAndBorders();\n targetFitsInTarget = parentRect.contains(targetRect);\n if (forceScrollToTop) {\n parent.scrollTop -= (parentRect.top - targetRect.top) + ancestorOffset;\n }\n else if (!targetFitsInTarget) {\n if (isAbove(targetRect, parentRect)) {\n parent.scrollTop -= parentRect.top - targetRect.top + ancestorOffset;\n }\n else if (isBelow(targetRect, parentRect)) {\n if (alignToTop) {\n parent.scrollTop += targetRect.top - parentRect.top - ancestorOffset;\n }\n else {\n parent.scrollTop += targetRect.bottom - parentRect.bottom + ancestorOffset;\n }\n }\n }\n if (!targetFitsInTarget) {\n if (isLeftOf(targetRect, parentRect)) {\n parent.scrollLeft -= parentRect.left - targetRect.left + ancestorOffset;\n }\n else if (isRightOf(targetRect, parentRect)) {\n parent.scrollLeft += targetRect.right - parentRect.right + ancestorOffset;\n }\n }\n parent = parent.parentNode;\n }\n}\n/**\n * Determines if a given `Rect` extends beyond the bottom edge of the second `Rect`.\n */\nfunction isBelow(firstRect, secondRect) {\n return firstRect.bottom > secondRect.bottom;\n}\n/**\n * Determines if a given `Rect` extends beyond the top edge of the second `Rect`.\n */\nfunction isAbove(firstRect, secondRect) {\n return firstRect.top < secondRect.top;\n}\n/**\n * Determines if a given `Rect` extends beyond the left edge of the second `Rect`.\n */\nfunction isLeftOf(firstRect, secondRect) {\n return firstRect.left < secondRect.left;\n}\n/**\n * Determines if a given `Rect` extends beyond the right edge of the second `Rect`.\n */\nfunction isRightOf(firstRect, secondRect) {\n return firstRect.right > secondRect.right;\n}\n/**\n * Returns the closest window of an element or range.\n */\nfunction getWindow(elementOrRange) {\n if (isRange(elementOrRange)) {\n return elementOrRange.startContainer.ownerDocument.defaultView;\n }\n else {\n return elementOrRange.ownerDocument.defaultView;\n }\n}\n/**\n * Returns the closest parent of an element or DOM range.\n */\nfunction getParentElement(elementOrRange) {\n if (isRange(elementOrRange)) {\n let parent = elementOrRange.commonAncestorContainer;\n // If a Range is attached to the Text, use the closest element ancestor.\n if (isText(parent)) {\n parent = parent.parentNode;\n }\n return parent;\n }\n else {\n return elementOrRange.parentNode;\n }\n}\n/**\n * Returns the rect of an element or range residing in an iframe.\n * The result rect is relative to the geometry of the passed window instance.\n *\n * @param target Element or range which rect should be returned.\n * @param relativeWindow A window the rect should be relative to.\n */\nfunction getRectRelativeToWindow(target, relativeWindow) {\n const targetWindow = getWindow(target);\n const rect = new Rect(target);\n if (targetWindow === relativeWindow) {\n return rect;\n }\n else {\n let currentWindow = targetWindow;\n while (currentWindow != relativeWindow) {\n const frame = currentWindow.frameElement;\n const frameRect = new Rect(frame).excludeScrollbarsAndBorders();\n rect.moveBy(frameRect.left, frameRect.top);\n currentWindow = currentWindow.parent;\n }\n }\n return rect;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport CKEditorError from './ckeditorerror';\nimport env from './env';\nconst modifiersToGlyphsMac = {\n ctrl: '⌃',\n cmd: '⌘',\n alt: '⌥',\n shift: '⇧'\n};\nconst modifiersToGlyphsNonMac = {\n ctrl: 'Ctrl+',\n alt: 'Alt+',\n shift: 'Shift+'\n};\n/**\n * An 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 * * `` ` ``, `-`, `=`, `[`, `]`, `;`, `'`, `,`, `.`, `/`, `\\`,\n * * `arrow(left|up|right|bottom)`,\n * * `backspace`, `delete`, `enter`, `esc`, `tab`,\n * * `ctrl`, `cmd`, `shift`, `alt`.\n */\nexport const keyCodes = generateKnownKeyCodes();\nconst keyCodeNames = Object.fromEntries(Object.entries(keyCodes).map(([name, code]) => [code, name.charAt(0).toUpperCase() + name.slice(1)]));\n/**\n * Converts a key name or {@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 key A key name (see {@link module:utils/keyboard#keyCodes}) or a keystroke data object.\n * @returns Key or keystroke code.\n */\nexport function getCode(key) {\n let keyCode;\n if (typeof key == 'string') {\n keyCode = keyCodes[key.toLowerCase()];\n if (!keyCode) {\n /**\n * Unknown key name. Only key names included in the {@link module:utils/keyboard#keyCodes} can be used.\n *\n * @error keyboard-unknown-key\n * @param {String} key\n */\n throw new CKEditorError('keyboard-unknown-key', null, { key });\n }\n }\n else {\n keyCode = key.keyCode +\n (key.altKey ? keyCodes.alt : 0) +\n (key.ctrlKey ? keyCodes.ctrl : 0) +\n (key.shiftKey ? keyCodes.shift : 0) +\n (key.metaKey ? keyCodes.cmd : 0);\n }\n return keyCode;\n}\n/**\n * Parses the keystroke and returns a keystroke code that will match the code returned by\n * {@link module:utils/keyboard~getCode} for the 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 * Note: On macOS, keystroke handling is translating the `Ctrl` key to the `Cmd` key and handling only that keystroke.\n * For example, a registered keystroke `Ctrl+A` will be translated to `Cmd+A` on macOS. To disable the translation of some keystroke,\n * use the forced modifier: `Ctrl!+A` (note the exclamation mark).\n *\n * @param keystroke The keystroke definition.\n * @returns Keystroke code.\n */\nexport function parseKeystroke(keystroke) {\n if (typeof keystroke == 'string') {\n keystroke = splitKeystrokeText(keystroke);\n }\n return keystroke\n .map(key => (typeof key == 'string') ? getEnvKeyCode(key) : key)\n .reduce((key, sum) => sum + key, 0);\n}\n/**\n * Translates any keystroke string text like `\"Ctrl+A\"` to an\n * environmentspecific keystroke, i.e. `\"⌘A\"` on macOS.\n *\n * @param keystroke The keystroke text.\n * @returns The keystroke text specific for the environment.\n */\nexport function getEnvKeystrokeText(keystroke) {\n let keystrokeCode = parseKeystroke(keystroke);\n const modifiersToGlyphs = Object.entries(env.isMac ? modifiersToGlyphsMac : modifiersToGlyphsNonMac);\n const modifiers = modifiersToGlyphs.reduce((modifiers, [name, glyph]) => {\n // Modifier keys are stored as a bit mask so extract those from the keystroke code.\n if ((keystrokeCode & keyCodes[name]) != 0) {\n keystrokeCode &= ~keyCodes[name];\n modifiers += glyph;\n }\n return modifiers;\n }, '');\n return modifiers + (keystrokeCode ? keyCodeNames[keystrokeCode] : '');\n}\n/**\n * Returns `true` if the provided key code represents one of the arrow keys.\n *\n * @param keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.\n */\nexport function isArrowKeyCode(keyCode) {\n return keyCode == keyCodes.arrowright ||\n keyCode == keyCodes.arrowleft ||\n keyCode == keyCodes.arrowup ||\n keyCode == keyCodes.arrowdown;\n}\n/**\n * Returns the direction in which the {@link module:engine/model/documentselection~DocumentSelection selection}\n * will move when the provided arrow key code is pressed considering the language direction of the editor content.\n *\n * For instance, in righttoleft (RTL) content languages, pressing the left arrow means moving the selection right (forward)\n * in the model structure. Similarly, pressing the right arrow moves the selection left (backward).\n *\n * @param keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.\n * @param contentLanguageDirection The content language direction, corresponding to\n * {@link module:utils/locale~Locale#contentLanguageDirection}.\n * @returns Localized arrow direction or `undefined` for non-arrow key codes.\n */\nexport function getLocalizedArrowKeyCodeDirection(keyCode, contentLanguageDirection) {\n const isLtrContent = contentLanguageDirection === 'ltr';\n switch (keyCode) {\n case keyCodes.arrowleft:\n return isLtrContent ? 'left' : 'right';\n case keyCodes.arrowright:\n return isLtrContent ? 'right' : 'left';\n case keyCodes.arrowup:\n return 'up';\n case keyCodes.arrowdown:\n return 'down';\n }\n}\n/**\n * Converts a key name to the key code with mapping based on the env.\n *\n * See: {@link module:utils/keyboard~getCode}.\n *\n * @param key The key name (see {@link module:utils/keyboard#keyCodes}).\n * @returns Key code.\n */\nfunction getEnvKeyCode(key) {\n // Don't remap modifier key for forced modifiers.\n if (key.endsWith('!')) {\n return getCode(key.slice(0, -1));\n }\n const code = getCode(key);\n return env.isMac && code == keyCodes.ctrl ? keyCodes.cmd : code;\n}\n/**\n * Determines if the provided key code moves the {@link module:engine/model/documentselection~DocumentSelection selection}\n * forward or backward considering the language direction of the editor content.\n *\n * For instance, in righttoleft (RTL) languages, pressing the left arrow means moving forward\n * in the model structure. Similarly, pressing the right arrow moves the selection backward.\n *\n * @param keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.\n * @param contentLanguageDirection The content language direction, corresponding to\n * {@link module:utils/locale~Locale#contentLanguageDirection}.\n */\nexport function isForwardArrowKeyCode(keyCode, contentLanguageDirection) {\n const localizedKeyCodeDirection = getLocalizedArrowKeyCodeDirection(keyCode, contentLanguageDirection);\n return localizedKeyCodeDirection === 'down' || localizedKeyCodeDirection === 'right';\n}\nfunction generateKnownKeyCodes() {\n const keyCodes = {\n arrowleft: 37,\n arrowup: 38,\n arrowright: 39,\n arrowdown: 40,\n backspace: 8,\n delete: 46,\n enter: 13,\n space: 32,\n esc: 27,\n tab: 9,\n // The idea about these numbers is that they do not collide with any real key codes, so we can use them\n // like bit masks.\n ctrl: 0x110000,\n shift: 0x220000,\n alt: 0x440000,\n cmd: 0x880000\n };\n // a-z\n for (let code = 65; code <= 90; code++) {\n const letter = String.fromCharCode(code);\n keyCodes[letter.toLowerCase()] = code;\n }\n // 0-9\n for (let code = 48; code <= 57; code++) {\n keyCodes[code - 48] = code;\n }\n // F1-F12\n for (let code = 112; code <= 123; code++) {\n keyCodes['f' + (code - 111)] = code;\n }\n // other characters\n for (const char of '`-=[];\\',./\\\\') {\n keyCodes[char] = char.charCodeAt(0);\n }\n return keyCodes;\n}\nfunction splitKeystrokeText(keystroke) {\n return keystroke.split('+').map(key => key.trim());\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nconst RTL_LANGUAGE_CODES = [\n 'ar', 'ara',\n 'fa', 'per', 'fas',\n 'he', 'heb',\n 'ku', 'kur',\n 'ug', 'uig' // Uighur, Uyghur\n];\n/**\n * Helps determine whether a language text direction is LTR or RTL.\n *\n * @param languageCode The ISO 639-1 or ISO 639-2 language code.\n */\nexport function getLanguageDirection(languageCode) {\n return RTL_LANGUAGE_CODES.includes(languageCode) ? 'rtl' : 'ltr';\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nexport default function toArray(data) {\n return Array.isArray(data) ? data : [data];\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* eslint-disable no-var */\n/**\n * @module utils/translation-service\n */\nimport CKEditorError from './ckeditorerror';\nimport global from './dom/global';\n/* istanbul ignore else -- @preserve */\nif (!global.window.CKEDITOR_TRANSLATIONS) {\n global.window.CKEDITOR_TRANSLATIONS = {};\n}\n/**\n * Adds translations to existing ones or overrides the existing translations. These translations will later\n * be available for the {@link module:utils/locale~Locale#t `t()`} function.\n *\n * The `translations` is an object which consists of `messageId: translation` pairs. Note that the message ID can be\n * either constructed from the message string or from the message ID if it was passed\n * (this happens rarely and mostly for short messages or messages with placeholders).\n * Since the editor displays only the message string, the message ID can be found either in the source code or in the\n * built translations for another language.\n *\n * ```ts\n * add( 'pl', {\n * \t'Cancel': 'Anuluj',\n * \t'IMAGE': 'obraz', // Note that the `IMAGE` comes from the message ID, while the string can be `image`.\n * } );\n * ```\n *\n * If the message is supposed to support various plural forms, make sure to provide an array with the singular form and all plural forms:\n *\n * ```ts\n * add( 'pl', {\n * \t'Add space': [ 'Dodaj spację', 'Dodaj %0 spacje', 'Dodaj %0 spacji' ]\n * } );\n * ```\n *\n * You should also specify the third argument (the `getPluralForm()` function) that will be used to determine the plural form if no\n * language file was loaded for that language. All language files coming from CKEditor 5 sources will have this option set, so\n * these plural form rules will be reused by other translations added to the registered languages. The `getPluralForm()` function\n * can return either a Boolean or a number.\n *\n * ```ts\n * add( 'en', {\n * \t// ... Translations.\n * }, n => n !== 1 );\n * add( 'pl', {\n * \t// ... Translations.\n * }, n => n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && ( n % 100 < 10 || n % 100 >= 20 ) ? 1 : 2 );\n * ```\n *\n * All translations extend the global `window.CKEDITOR_TRANSLATIONS` object. An example of this object can be found below:\n *\n * ```ts\n * {\n * \tpl: {\n * \t\tdictionary: {\n * \t\t\t'Cancel': 'Anuluj',\n * \t\t\t'Add space': [ 'Dodaj spację', 'Dodaj %0 spacje', 'Dodaj %0 spacji' ]\n * \t\t},\n * \t\t// A function that returns the plural form index.\n * \t\tgetPluralForm: n => n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && ( n % 100 < 10 || n % 100 >= 20 ) ? 1 : 2 );\n * \t}\n * \t// Other languages.\n * \t}\n * ```\n *\n * If you cannot import this function from this module (e.g. because you use a CKEditor 5 build), you can\n * still add translations by extending the global `window.CKEDITOR_TRANSLATIONS` object by using a function like\n * the one below:\n *\n * ```ts\n * function addTranslations( language, translations, getPluralForm ) {\n * \tif ( !global.window.CKEDITOR_TRANSLATIONS ) {\n * \t\tglobal.window.CKEDITOR_TRANSLATIONS = {};\n * \t}\n\n * \tif ( !global.window.CKEDITOR_TRANSLATIONS[ language ] ) {\n * \t\tglobal.window.CKEDITOR_TRANSLATIONS[ language ] = {};\n * \t}\n *\n * \tconst languageTranslations = global.window.CKEDITOR_TRANSLATIONS[ language ];\n *\n * \tlanguageTranslations.dictionary = languageTranslations.dictionary || {};\n * \tlanguageTranslations.getPluralForm = getPluralForm || languageTranslations.getPluralForm;\n *\n * \t// Extend the dictionary for the given language.\n * \tObject.assign( languageTranslations.dictionary, translations );\n * }\n * ```\n *\n * @param language Target language.\n * @param translations An object with translations which will be added to the dictionary.\n * For each message ID the value should be either a translation or an array of translations if the message\n * should support plural forms.\n * @param getPluralForm A function that returns the plural form index (a number).\n */\nexport function add(language, translations, getPluralForm) {\n if (!global.window.CKEDITOR_TRANSLATIONS[language]) {\n global.window.CKEDITOR_TRANSLATIONS[language] = {};\n }\n const languageTranslations = global.window.CKEDITOR_TRANSLATIONS[language];\n languageTranslations.dictionary = languageTranslations.dictionary || {};\n languageTranslations.getPluralForm = getPluralForm || languageTranslations.getPluralForm;\n Object.assign(languageTranslations.dictionary, translations);\n}\n/**\n * **Note:** This method is internal, use {@link module:utils/locale~Locale#t the `t()` function} instead to translate\n * the editor UI parts.\n *\n * This function is responsible for translating messages to the specified language. It uses translations added perviously\n * by {@link module:utils/translation-service~add} (a translations dictionary and the `getPluralForm()` function\n * to provide accurate translations of plural forms).\n *\n * When no translation is defined in the dictionary or the dictionary does not exist, this function returns\n * the original message string or the message plural depending on the number of elements.\n *\n * ```ts\n * translate( 'pl', { string: 'Cancel' } ); // 'Cancel'\n * ```\n *\n * The third optional argument is the number of elements, based on which the single form or one of the plural forms\n * should be picked when the message is supposed to support various plural forms.\n *\n * ```ts\n * translate( 'en', { string: 'Add a space', plural: 'Add %0 spaces' }, 1 ); // 'Add a space'\n * translate( 'en', { string: 'Add a space', plural: 'Add %0 spaces' }, 3 ); // 'Add %0 spaces'\n * ```\n *\n * The message should provide an ID using the `id` property when the message strings are not unique and their\n * translations should be different.\n *\n * ```ts\n * translate( 'en', { string: 'image', id: 'ADD_IMAGE' } );\n * translate( 'en', { string: 'image', id: 'AN_IMAGE' } );\n * ```\n *\n * @internal\n * @param language Target language.\n * @param message A message that will be translated.\n * @param quantity The number of elements for which a plural form should be picked from the target language dictionary.\n * @returns Translated sentence.\n */\nexport function _translate(language, message, quantity = 1) {\n if (typeof quantity !== 'number') {\n /**\n * An incorrect value was passed to the translation function. This was probably caused\n * by an incorrect message interpolation of a plural form. Note that for messages supporting plural forms\n * the second argument of the `t()` function should always be a number or an array with a number as the first element.\n *\n * @error translation-service-quantity-not-a-number\n */\n throw new CKEditorError('translation-service-quantity-not-a-number', null, { quantity });\n }\n const numberOfLanguages = getNumberOfLanguages();\n if (numberOfLanguages === 1) {\n // Override the language to the only supported one.\n // This can't be done in the `Locale` class, because the translations comes after the `Locale` class initialization.\n language = Object.keys(global.window.CKEDITOR_TRANSLATIONS)[0];\n }\n const messageId = message.id || message.string;\n if (numberOfLanguages === 0 || !hasTranslation(language, messageId)) {\n if (quantity !== 1) {\n // Return the default plural form that was passed in the `message.plural` parameter.\n return message.plural;\n }\n return message.string;\n }\n const dictionary = global.window.CKEDITOR_TRANSLATIONS[language].dictionary;\n const getPluralForm = global.window.CKEDITOR_TRANSLATIONS[language].getPluralForm || (n => n === 1 ? 0 : 1);\n const translation = dictionary[messageId];\n if (typeof translation === 'string') {\n return translation;\n }\n const pluralFormIndex = Number(getPluralForm(quantity));\n // Note: The `translate` function is not responsible for replacing `%0, %1, ...` with values.\n return translation[pluralFormIndex];\n}\n/**\n * Clears dictionaries for test purposes.\n *\n * @internal\n */\nexport function _clear() {\n global.window.CKEDITOR_TRANSLATIONS = {};\n}\n/**\n * Checks whether the dictionary exists and translation in that dictionary exists.\n */\nfunction hasTranslation(language, messageId) {\n return (!!global.window.CKEDITOR_TRANSLATIONS[language] &&\n !!global.window.CKEDITOR_TRANSLATIONS[language].dictionary[messageId]);\n}\nfunction getNumberOfLanguages() {\n return Object.keys(global.window.CKEDITOR_TRANSLATIONS).length;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/locale\n */\n/* globals console */\nimport toArray from './toarray';\nimport { _translate } from './translation-service';\nimport { getLanguageDirection } from './language';\n/**\n * Represents the localization services.\n */\nexport default class Locale {\n /**\n * Creates a new instance of the locale class. Learn more about\n * {@glink features/ui-language configuring the language of the editor}.\n *\n * @param options Locale configuration.\n * @param options.uiLanguage The editor UI language code in the\n * [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format. See {@link #uiLanguage}.\n * @param options.contentLanguage The editor content language code in the\n * [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format. If not specified, the same as `options.language`.\n * See {@link #contentLanguage}.\n */\n constructor({ uiLanguage = 'en', contentLanguage } = {}) {\n this.uiLanguage = uiLanguage;\n this.contentLanguage = contentLanguage || this.uiLanguage;\n this.uiLanguageDirection = getLanguageDirection(this.uiLanguage);\n this.contentLanguageDirection = getLanguageDirection(this.contentLanguage);\n this.t = (message, values) => this._t(message, values);\n }\n /**\n * The editor UI language code in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format.\n *\n * **Note**: This property was deprecated. Please use {@link #uiLanguage} and {@link #contentLanguage}\n * properties instead.\n *\n * @deprecated\n */\n get language() {\n /**\n * The {@link module:utils/locale~Locale#language `Locale#language`} property was deprecated and will\n * be removed in the near future. Please use the {@link module:utils/locale~Locale#uiLanguage `Locale#uiLanguage`} and\n * {@link module:utils/locale~Locale#contentLanguage `Locale#contentLanguage`} properties instead.\n *\n * @error locale-deprecated-language-property\n */\n console.warn('locale-deprecated-language-property: ' +\n 'The Locale#language property has been deprecated and will be removed in the near future. ' +\n 'Please use #uiLanguage and #contentLanguage properties instead.');\n return this.uiLanguage;\n }\n /**\n * An unbound version of the {@link #t} method.\n */\n _t(message, values = []) {\n values = toArray(values);\n if (typeof message === 'string') {\n message = { string: message };\n }\n const hasPluralForm = !!message.plural;\n const quantity = hasPluralForm ? values[0] : 1;\n const translatedString = _translate(this.uiLanguage, message, quantity);\n return interpolateString(translatedString, values);\n }\n}\n/**\n * Fills the `%0, %1, ...` string placeholders with values.\n */\nfunction interpolateString(string, values) {\n return string.replace(/%(\\d+)/g, (match, index) => {\n return (index < values.length) ? values[index] : match;\n });\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/collection\n */\nimport EmitterMixin from './emittermixin';\nimport CKEditorError from './ckeditorerror';\nimport uid from './uid';\nimport isIterable from './isiterable';\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 * @typeParam T The type of the collection element.\n */\nexport default class Collection extends EmitterMixin() {\n constructor(initialItemsOrOptions = {}, options = {}) {\n super();\n const hasInitialItems = isIterable(initialItemsOrOptions);\n if (!hasInitialItems) {\n options = initialItemsOrOptions;\n }\n this._items = [];\n this._itemMap = new Map();\n this._idProperty = options.idProperty || 'id';\n this._bindToExternalToInternalMap = new WeakMap();\n this._bindToInternalToExternalMap = new WeakMap();\n this._skippedIndexesFromExternal = [];\n // Set the initial content of the collection (if provided in the constructor).\n if (hasInitialItems) {\n for (const item of initialItemsOrOptions) {\n this._items.push(item);\n this._itemMap.set(this._getItemIdBeforeAdding(item), item);\n }\n }\n }\n /**\n * The number of items available in the collection.\n */\n get length() {\n return this._items.length;\n }\n /**\n * Returns the first item from the collection or null when collection is empty.\n */\n get first() {\n return this._items[0] || null;\n }\n /**\n * Returns the last item from the collection or null when collection is empty.\n */\n get last() {\n return this._items[this.length - 1] || null;\n }\n /**\n * Adds an item into the collection.\n *\n * If the item does not have an id, then it will be automatically generated and set on the item.\n *\n * @param item\n * @param index The position of the item in the collection. The item\n * is pushed to the collection when `index` not specified.\n * @fires add\n * @fires change\n */\n add(item, index) {\n return this.addMany([item], index);\n }\n /**\n * Adds multiple items into the collection.\n *\n * Any item not containing an id will get an automatically generated one.\n *\n * @param items\n * @param index The position of the insertion. Items will be appended if no `index` is specified.\n * @fires add\n * @fires change\n */\n addMany(items, index) {\n if (index === undefined) {\n index = this._items.length;\n }\n else if (index > this._items.length || index < 0) {\n /**\n * The `index` passed to {@link module:utils/collection~Collection#addMany `Collection#addMany()`}\n * is invalid. It must be a number between 0 and the collection's length.\n *\n * @error collection-add-item-invalid-index\n */\n throw new CKEditorError('collection-add-item-invalid-index', this);\n }\n let offset = 0;\n for (const item of items) {\n const itemId = this._getItemIdBeforeAdding(item);\n const currentItemIndex = index + offset;\n this._items.splice(currentItemIndex, 0, item);\n this._itemMap.set(itemId, item);\n this.fire('add', item, currentItemIndex);\n offset++;\n }\n this.fire('change', {\n added: items,\n removed: [],\n index\n });\n return this;\n }\n /**\n * Gets an item by its ID or index.\n *\n * @param idOrIndex The item ID or index in the collection.\n * @returns The requested item or `null` if such item does not exist.\n */\n get(idOrIndex) {\n let item;\n if (typeof idOrIndex == 'string') {\n item = this._itemMap.get(idOrIndex);\n }\n else if (typeof idOrIndex == 'number') {\n item = this._items[idOrIndex];\n }\n else {\n /**\n * An index or ID must be given.\n *\n * @error collection-get-invalid-arg\n */\n throw new CKEditorError('collection-get-invalid-arg', this);\n }\n return item || null;\n }\n /**\n * Returns a Boolean indicating whether the collection contains an item.\n *\n * @param itemOrId The item or its ID in the collection.\n * @returns `true` if the collection contains the item, `false` otherwise.\n */\n has(itemOrId) {\n if (typeof itemOrId == 'string') {\n return this._itemMap.has(itemOrId);\n }\n else { // Object\n const idProperty = this._idProperty;\n const id = itemOrId[idProperty];\n return id && this._itemMap.has(id);\n }\n }\n /**\n * Gets an index of an item in the collection.\n * When an item is not defined in the collection, the index will equal -1.\n *\n * @param itemOrId The item or its ID in the collection.\n * @returns The index of a given item.\n */\n getIndex(itemOrId) {\n let item;\n if (typeof itemOrId == 'string') {\n item = this._itemMap.get(itemOrId);\n }\n else {\n item = itemOrId;\n }\n return item ? this._items.indexOf(item) : -1;\n }\n /**\n * Removes an item from the collection.\n *\n * @param subject The item to remove, its ID or index in the collection.\n * @returns The removed item.\n * @fires remove\n * @fires change\n */\n remove(subject) {\n const [item, index] = this._remove(subject);\n this.fire('change', {\n added: [],\n removed: [item],\n index\n });\n return item;\n }\n /**\n * Executes the callback for each item in the collection and composes an array or values returned by this callback.\n *\n * @typeParam U The result type of the callback.\n * @param callback\n * @param ctx Context in which the `callback` will be called.\n * @returns The result of mapping.\n */\n map(callback, ctx) {\n return this._items.map(callback, ctx);\n }\n /**\n * Finds the first item in the collection for which the `callback` returns a true value.\n *\n * @param callback\n * @param ctx Context in which the `callback` will be called.\n * @returns The item for which `callback` returned a true value.\n */\n find(callback, ctx) {\n return this._items.find(callback, ctx);\n }\n /**\n * Returns an array with items for which the `callback` returned a true value.\n *\n * @param callback\n * @param ctx Context in which the `callback` will be called.\n * @returns The array with matching items.\n */\n filter(callback, ctx) {\n return this._items.filter(callback, ctx);\n }\n /**\n * Removes all items from the collection and destroys the binding created using\n * {@link #bindTo}.\n *\n * @fires remove\n * @fires change\n */\n clear() {\n if (this._bindToCollection) {\n this.stopListening(this._bindToCollection);\n this._bindToCollection = null;\n }\n const removedItems = Array.from(this._items);\n while (this.length) {\n this._remove(0);\n }\n this.fire('change', {\n added: [],\n removed: removedItems,\n index: 0\n });\n }\n /**\n * Binds and synchronizes the collection with another one.\n *\n * The binding can be a simple factory:\n *\n * ```ts\n * class FactoryClass {\n * \tpublic label: string;\n *\n * \tconstructor( data: { label: string } ) {\n * \t\tthis.label = data.label;\n * \t}\n * }\n *\n * const source = new Collection<{ label: string }>( { idProperty: 'label' } );\n * const target = new Collection<FactoryClass>();\n *\n * target.bindTo( source ).as( FactoryClass );\n *\n * source.add( { label: 'foo' } );\n * source.add( { label: 'bar' } );\n *\n * console.log( target.length ); // 2\n * console.log( target.get( 1 ).label ); // 'bar'\n *\n * source.remove( 0 );\n * console.log( target.length ); // 1\n * console.log( target.get( 0 ).label ); // 'bar'\n * ```\n *\n * or the factory driven by a custom callback:\n *\n * ```ts\n * class FooClass {\n * \tpublic label: string;\n *\n * \tconstructor( data: { label: string } ) {\n * \t\tthis.label = data.label;\n * \t}\n * }\n *\n * class BarClass {\n * \tpublic label: string;\n *\n * \tconstructor( data: { label: string } ) {\n * \t\tthis.label = data.label;\n * \t}\n * }\n *\n * const source = new Collection<{ label: string }>( { idProperty: 'label' } );\n * const target = new Collection<FooClass | BarClass>();\n *\n * target.bindTo( source ).using( ( item ) => {\n * \tif ( item.label == 'foo' ) {\n * \t\treturn new FooClass( item );\n * \t} else {\n * \t\treturn new BarClass( item );\n * \t}\n * } );\n *\n * source.add( { label: 'foo' } );\n * source.add( { label: 'bar' } );\n *\n * console.log( target.length ); // 2\n * console.log( target.get( 0 ) instanceof FooClass ); // true\n * console.log( target.get( 1 ) instanceof BarClass ); // true\n * ```\n *\n * or the factory out of property name:\n *\n * ```ts\n * const source = new Collection<{ nested: { value: string } }>();\n * const target = new Collection<{ value: string }>();\n *\n * target.bindTo( source ).using( 'nested' );\n *\n * source.add( { nested: { value: 'foo' } } );\n * source.add( { nested: { value: 'bar' } } );\n *\n * console.log( target.length ); // 2\n * console.log( target.get( 0 ).value ); // 'foo'\n * console.log( target.get( 1 ).value ); // 'bar'\n * ```\n *\n * It's possible to skip specified items by returning null value:\n *\n * ```ts\n * const source = new Collection<{ hidden: boolean }>();\n * const target = new Collection<{ hidden: boolean }>();\n *\n * target.bindTo( source ).using( item => {\n * \tif ( item.hidden ) {\n * \t\treturn null;\n * \t}\n *\n * \treturn item;\n * } );\n *\n * source.add( { hidden: true } );\n * source.add( { hidden: false } );\n *\n * console.log( source.length ); // 2\n * console.log( target.length ); // 1\n * ```\n *\n * **Note**: {@link #clear} can be used to break the binding.\n *\n * @typeParam S The type of `externalCollection` element.\n * @param externalCollection A collection to be bound.\n * @returns The binding chain object.\n */\n bindTo(externalCollection) {\n if (this._bindToCollection) {\n /**\n * The collection cannot be bound more than once.\n *\n * @error collection-bind-to-rebind\n */\n throw new CKEditorError('collection-bind-to-rebind', this);\n }\n this._bindToCollection = externalCollection;\n return {\n as: Class => {\n this._setUpBindToBinding(item => new Class(item));\n },\n using: callbackOrProperty => {\n if (typeof callbackOrProperty == 'function') {\n this._setUpBindToBinding(callbackOrProperty);\n }\n else {\n this._setUpBindToBinding(item => item[callbackOrProperty]);\n }\n }\n };\n }\n /**\n * Finalizes and activates a binding initiated by {@link #bindTo}.\n *\n * @param factory A function which produces collection items.\n */\n _setUpBindToBinding(factory) {\n const externalCollection = this._bindToCollection;\n // Adds the item to the collection once a change has been done to the external collection.\n const addItem = (evt, externalItem, index) => {\n const isExternalBoundToThis = externalCollection._bindToCollection == this;\n const externalItemBound = externalCollection._bindToInternalToExternalMap.get(externalItem);\n // If an external collection is bound to this collection, which makes it a 2way binding,\n // and the particular external collection item is already bound, don't add it here.\n // The external item has been created **out of this collection's item** and (re)adding it will\n // cause a loop.\n if (isExternalBoundToThis && externalItemBound) {\n this._bindToExternalToInternalMap.set(externalItem, externalItemBound);\n this._bindToInternalToExternalMap.set(externalItemBound, externalItem);\n }\n else {\n const item = factory(externalItem);\n // When there is no item we need to remember skipped index first and then we can skip this item.\n if (!item) {\n this._skippedIndexesFromExternal.push(index);\n return;\n }\n // Lets try to put item at the same index as index in external collection\n // but when there are a skipped items in one or both collections we need to recalculate this index.\n let finalIndex = index;\n // When we try to insert item after some skipped items from external collection we need\n // to include this skipped items and decrease index.\n //\n // For the following example:\n // external -> [ 'A', 'B - skipped for internal', 'C - skipped for internal' ]\n // internal -> [ A ]\n //\n // Another item is been added at the end of external collection:\n // external.add( 'D' )\n // external -> [ 'A', 'B - skipped for internal', 'C - skipped for internal', 'D' ]\n //\n // We can't just add 'D' to internal at the same index as index in external because\n // this will produce empty indexes what is invalid:\n // internal -> [ 'A', empty, empty, 'D' ]\n //\n // So we need to include skipped items and decrease index\n // internal -> [ 'A', 'D' ]\n for (const skipped of this._skippedIndexesFromExternal) {\n if (index > skipped) {\n finalIndex--;\n }\n }\n // We need to take into consideration that external collection could skip some items from\n // internal collection.\n //\n // For the following example:\n // internal -> [ 'A', 'B - skipped for external', 'C - skipped for external' ]\n // external -> [ A ]\n //\n // Another item is been added at the end of external collection:\n // external.add( 'D' )\n // external -> [ 'A', 'D' ]\n //\n // We need to include skipped items and place new item after them:\n // internal -> [ 'A', 'B - skipped for external', 'C - skipped for external', 'D' ]\n for (const skipped of externalCollection._skippedIndexesFromExternal) {\n if (finalIndex >= skipped) {\n finalIndex++;\n }\n }\n this._bindToExternalToInternalMap.set(externalItem, item);\n this._bindToInternalToExternalMap.set(item, externalItem);\n this.add(item, finalIndex);\n // After adding new element to internal collection we need update indexes\n // of skipped items in external collection.\n for (let i = 0; i < externalCollection._skippedIndexesFromExternal.length; i++) {\n if (finalIndex <= externalCollection._skippedIndexesFromExternal[i]) {\n externalCollection._skippedIndexesFromExternal[i]++;\n }\n }\n }\n };\n // Load the initial content of the collection.\n for (const externalItem of externalCollection) {\n addItem(null, externalItem, externalCollection.getIndex(externalItem));\n }\n // Synchronize the with collection as new items are added.\n this.listenTo(externalCollection, 'add', addItem);\n // Synchronize the with collection as new items are removed.\n this.listenTo(externalCollection, 'remove', (evt, externalItem, index) => {\n const item = this._bindToExternalToInternalMap.get(externalItem);\n if (item) {\n this.remove(item);\n }\n // After removing element from external collection we need update/remove indexes\n // of skipped items in internal collection.\n this._skippedIndexesFromExternal = this._skippedIndexesFromExternal.reduce((result, skipped) => {\n if (index < skipped) {\n result.push(skipped - 1);\n }\n if (index > skipped) {\n result.push(skipped);\n }\n return result;\n }, []);\n });\n }\n /**\n * Returns an unique id property for a given `item`.\n *\n * The method will generate new id and assign it to the `item` if it doesn't have any.\n *\n * @param item Item to be added.\n */\n _getItemIdBeforeAdding(item) {\n const idProperty = this._idProperty;\n let itemId;\n if ((idProperty in item)) {\n itemId = item[idProperty];\n if (typeof itemId != 'string') {\n /**\n * This item's ID should be a string.\n *\n * @error collection-add-invalid-id\n */\n throw new CKEditorError('collection-add-invalid-id', this);\n }\n if (this.get(itemId)) {\n /**\n * This item already exists in the collection.\n *\n * @error collection-add-item-already-exists\n */\n throw new CKEditorError('collection-add-item-already-exists', this);\n }\n }\n else {\n item[idProperty] = itemId = uid();\n }\n return itemId;\n }\n /**\n * Core {@link #remove} method implementation shared in other functions.\n *\n * In contrast this method **does not** fire the {@link #event:change} event.\n *\n * @param subject The item to remove, its id or index in the collection.\n * @returns Returns an array with the removed item and its index.\n * @fires remove\n */\n _remove(subject) {\n let index, id, item;\n let itemDoesNotExist = false;\n const idProperty = this._idProperty;\n if (typeof subject == 'string') {\n id = subject;\n item = this._itemMap.get(id);\n itemDoesNotExist = !item;\n if (item) {\n index = this._items.indexOf(item);\n }\n }\n else if (typeof subject == 'number') {\n index = subject;\n item = this._items[index];\n itemDoesNotExist = !item;\n if (item) {\n id = item[idProperty];\n }\n }\n else {\n item = subject;\n id = item[idProperty];\n index = this._items.indexOf(item);\n itemDoesNotExist = (index == -1 || !this._itemMap.get(id));\n }\n if (itemDoesNotExist) {\n /**\n * Item not found.\n *\n * @error collection-remove-404\n */\n throw new CKEditorError('collection-remove-404', this);\n }\n this._items.splice(index, 1);\n this._itemMap.delete(id);\n const externalItem = this._bindToInternalToExternalMap.get(item);\n this._bindToInternalToExternalMap.delete(item);\n this._bindToExternalToInternalMap.delete(externalItem);\n this.fire('remove', item, index);\n return [item, index];\n }\n /**\n * Iterable interface.\n */\n [Symbol.iterator]() {\n return this._items[Symbol.iterator]();\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/first\n */\n/**\n * Returns first item of the given `iterator`.\n */\nexport default function first(iterator) {\n const iteratorItem = iterator.next();\n if (iteratorItem.done) {\n return null;\n }\n return iteratorItem.value;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* global setTimeout, clearTimeout */\n/**\n * @module utils/focustracker\n */\nimport DomEmitterMixin from './dom/emittermixin';\nimport ObservableMixin from './observablemixin';\nimport CKEditorError from './ckeditorerror';\n/**\n * Allows observing a group of `Element`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 `Element`\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 * Check out the {@glink framework/deep-dive/ui/focus-tracking \"Deep dive into focus tracking\"} guide to learn more.\n */\nexport default class FocusTracker extends DomEmitterMixin(ObservableMixin()) {\n constructor() {\n super();\n /**\n * List of registered elements.\n */\n this._elements = new Set();\n /**\n * Event loop timeout.\n */\n this._nextEventLoopTimeout = null;\n this.set('isFocused', false);\n this.set('focusedElement', null);\n }\n /**\n * Starts tracking the specified element.\n */\n add(element) {\n if (this._elements.has(element)) {\n /**\n * This element is already tracked by {@link module:utils/focustracker~FocusTracker}.\n *\n * @error focustracker-add-element-already-exist\n */\n throw new CKEditorError('focustracker-add-element-already-exist', this);\n }\n this.listenTo(element, 'focus', () => this._focus(element), { useCapture: true });\n this.listenTo(element, 'blur', () => this._blur(), { useCapture: true });\n this._elements.add(element);\n }\n /**\n * Stops tracking the specified element and stops listening on this element.\n */\n remove(element) {\n if (element === this.focusedElement) {\n this._blur();\n }\n if (this._elements.has(element)) {\n this.stopListening(element);\n this._elements.delete(element);\n }\n }\n /**\n * Destroys the focus tracker by:\n * - Disabling all event listeners attached to tracked elements.\n * - Removing all tracked elements that were previously added.\n */\n destroy() {\n this.stopListening();\n }\n /**\n * Stores currently focused element and set {@link #isFocused} as `true`.\n */\n _focus(element) {\n clearTimeout(this._nextEventLoopTimeout);\n this.focusedElement = element;\n this.isFocused = true;\n }\n /**\n * Clears currently focused element and set {@link #isFocused} as `false`.\n * This method uses `setTimeout` to change order of fires `blur` and `focus` events.\n */\n _blur() {\n clearTimeout(this._nextEventLoopTimeout);\n this._nextEventLoopTimeout = setTimeout(() => {\n this.focusedElement = null;\n this.isFocused = false;\n }, 0);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/keystrokehandler\n */\nimport DomEmitterMixin from './dom/emittermixin';\nimport { getCode, parseKeystroke } from './keyboard';\n/**\n * Keystroke handler allows registering callbacks for given keystrokes.\n *\n * The most frequent use of this class is through the {@link module:core/editor/editor~Editor#keystrokes `editor.keystrokes`}\n * property. It allows listening to keystrokes executed in the editing view:\n *\n * ```ts\n * editor.keystrokes.set( 'Ctrl+A', ( keyEvtData, cancel ) => {\n * \tconsole.log( 'Ctrl+A has been pressed' );\n * \tcancel();\n * } );\n * ```\n *\n * However, this utility class can be used in various part of the UI. For instance, a certain {@link module:ui/view~View}\n * can use it like this:\n *\n * ```ts\n * class MyView extends View {\n * \tconstructor() {\n * \t\tthis.keystrokes = new KeystrokeHandler();\n *\n * \t\tthis.keystrokes.set( 'tab', handleTabKey );\n * \t}\n *\n * \trender() {\n * \t\tsuper.render();\n *\n * \t\tthis.keystrokes.listenTo( this.element );\n * \t}\n * }\n * ```\n *\n * That keystroke handler will listen to `keydown` events fired in this view's main element.\n *\n */\nexport default class KeystrokeHandler {\n /**\n * Creates an instance of the keystroke handler.\n */\n constructor() {\n this._listener = new (DomEmitterMixin())();\n }\n /**\n * Starts listening for `keydown` events from a given emitter.\n */\n listenTo(emitter) {\n // The #_listener works here as a kind of dispatcher. It groups the events coming from the same\n // keystroke so the listeners can be attached to them with different priorities.\n //\n // E.g. all the keystrokes with the `keyCode` of 42 coming from the `emitter` are propagated\n // as a `_keydown:42` event by the `_listener`. If there's a callback created by the `set`\n // method for this 42 keystroke, it listens to the `_listener#_keydown:42` event only and interacts\n // only with other listeners of this particular event, thus making it possible to prioritize\n // the listeners and safely cancel execution, when needed. Instead of duplicating the Emitter logic,\n // the KeystrokeHandler reuses it to do its job.\n this._listener.listenTo(emitter, 'keydown', (evt, keyEvtData) => {\n this._listener.fire('_keydown:' + getCode(keyEvtData), keyEvtData);\n });\n }\n /**\n * Registers a handler for the specified keystroke.\n *\n * @param keystroke Keystroke defined in a format accepted by\n * the {@link module:utils/keyboard~parseKeystroke} function.\n * @param callback A function called with the\n * {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and\n * a helper function to call both `preventDefault()` and `stopPropagation()` on the underlying event.\n * @param options Additional options.\n * @param options.priority The priority of the keystroke\n * callback. The higher the priority value the sooner the callback will be executed. Keystrokes having the same priority\n * are called in the order they were added.\n */\n set(keystroke, callback, options = {}) {\n const keyCode = parseKeystroke(keystroke);\n const priority = options.priority;\n // Execute the passed callback on KeystrokeHandler#_keydown.\n // TODO: https://github.com/ckeditor/ckeditor5-utils/issues/144\n this._listener.listenTo(this._listener, '_keydown:' + keyCode, (evt, keyEvtData) => {\n callback(keyEvtData, () => {\n // Stop the event in the DOM: no listener in the web page\n // will be triggered by this event.\n keyEvtData.preventDefault();\n keyEvtData.stopPropagation();\n // Stop the event in the KeystrokeHandler: no more callbacks\n // will be executed for this keystroke.\n evt.stop();\n });\n // Mark this keystroke as handled by the callback. See: #press.\n evt.return = true;\n }, { priority });\n }\n /**\n * Triggers a keystroke handler for a specified key combination, if such a keystroke was {@link #set defined}.\n *\n * @param keyEvtData Key event data.\n * @returns Whether the keystroke was handled.\n */\n press(keyEvtData) {\n return !!this._listener.fire('_keydown:' + getCode(keyEvtData), keyEvtData);\n }\n /**\n * Stops listening to `keydown` events from the given emitter.\n */\n stopListening(emitter) {\n this._listener.stopListening(emitter);\n }\n /**\n * Destroys the keystroke handler.\n */\n destroy() {\n this.stopListening();\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/tomap\n */\nimport objectToMap from './objecttomap';\nimport isIterable from './isiterable';\n/**\n * Transforms object or iterable to map. Iterable needs to be in the format acceptable by the `Map` constructor.\n *\n * ```ts\n * map = toMap( { 'foo': 1, 'bar': 2 } );\n * map = toMap( [ [ 'foo', 1 ], [ 'bar', 2 ] ] );\n * map = toMap( anotherMap );\n * ```\n *\n * @param data Object or iterable to transform.\n * @returns Map created from data.\n */\nexport default function toMap(data) {\n if (isIterable(data)) {\n return new Map(data);\n }\n else {\n return objectToMap(data);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/objecttomap\n */\n/**\n * Transforms object to map.\n *\n * ```ts\n * const map = objectToMap( { 'foo': 1, 'bar': 2 } );\n * map.get( 'foo' ); // 1\n * ```\n *\n * **Note**: For mixed data (`Object` or `Iterable`) there's a dedicated {@link module:utils/tomap~toMap} function.\n *\n * @param obj Object to transform.\n * @returns Map created from object.\n */\nexport default function objectToMap(obj) {\n const map = new Map();\n for (const key in obj) {\n map.set(key, obj[key]);\n }\n return map;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/delay\n */\n/* globals setTimeout, clearTimeout */\n/**\n * Returns a function wrapper that will trigger a function after a specified wait time.\n * The timeout can be canceled by calling the cancel function on the returned wrapped function.\n *\n * @param func The function to wrap.\n * @param wait The timeout in ms.\n */\nexport default function delay(func, wait) {\n let timer;\n function delayed(...args) {\n delayed.cancel();\n timer = setTimeout(() => func(...args), wait);\n }\n delayed.cancel = () => {\n clearTimeout(timer);\n };\n return delayed;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Set of utils to handle unicode characters.\n *\n * @module utils/unicode\n */\n/**\n * Checks whether given `character` is a combining mark.\n *\n * @param character Character to check.\n */\nexport function isCombiningMark(character) {\n // eslint-disable-next-line no-misleading-character-class\n return !!character && character.length == 1 && /[\\u0300-\\u036f\\u1ab0-\\u1aff\\u1dc0-\\u1dff\\u20d0-\\u20ff\\ufe20-\\ufe2f]/.test(character);\n}\n/**\n * Checks whether given `character` is a high half of surrogate pair.\n *\n * Using UTF-16 terminology, a surrogate pair denotes UTF-16 character using two UTF-8 characters. The surrogate pair\n * consist of high surrogate pair character followed by low surrogate pair character.\n *\n * @param character Character to check.\n */\nexport function isHighSurrogateHalf(character) {\n return !!character && character.length == 1 && /[\\ud800-\\udbff]/.test(character);\n}\n/**\n * Checks whether given `character` is a low half of surrogate pair.\n *\n * Using UTF-16 terminology, a surrogate pair denotes UTF-16 character using two UTF-8 characters. The surrogate pair\n * consist of high surrogate pair character followed by low surrogate pair character.\n *\n * @param character Character to check.\n */\nexport function isLowSurrogateHalf(character) {\n return !!character && character.length == 1 && /[\\udc00-\\udfff]/.test(character);\n}\n/**\n * Checks whether given offset in a string is inside a surrogate pair (between two surrogate halves).\n *\n * @param string String to check.\n * @param offset Offset to check.\n */\nexport function isInsideSurrogatePair(string, offset) {\n return isHighSurrogateHalf(string.charAt(offset - 1)) && isLowSurrogateHalf(string.charAt(offset));\n}\n/**\n * Checks whether given offset in a string is between base character and combining mark or between two combining marks.\n *\n * @param string String to check.\n * @param offset Offset to check.\n */\nexport function isInsideCombinedSymbol(string, offset) {\n return isCombiningMark(string.charAt(offset));\n}\nconst EMOJI_PATTERN = buildEmojiRegexp();\n/**\n * Checks whether given offset in a string is inside multi-character emoji sequence.\n *\n * @param string String to check.\n * @param offset Offset to check.\n */\nexport function isInsideEmojiSequence(string, offset) {\n const matches = String(string).matchAll(EMOJI_PATTERN);\n return Array.from(matches).some(match => match.index < offset && offset < match.index + match[0].length);\n}\nfunction buildEmojiRegexp() {\n const parts = [\n // Emoji Tag Sequence (ETS)\n /\\p{Emoji}[\\u{E0020}-\\u{E007E}]+\\u{E007F}/u,\n // Emoji Keycap Sequence\n /\\p{Emoji}\\u{FE0F}?\\u{20E3}/u,\n // Emoji Presentation Sequence\n /\\p{Emoji}\\u{FE0F}/u,\n // Single-Character Emoji / Emoji Modifier Sequence\n /(?=\\p{General_Category=Other_Symbol})\\p{Emoji}\\p{Emoji_Modifier}*/u\n ];\n const flagSequence = /\\p{Regional_Indicator}{2}/u.source;\n const emoji = '(?:' + parts.map(part => part.source).join('|') + ')';\n const sequence = `${flagSequence}|${emoji}(?:\\u{200D}${emoji})*`;\n return new RegExp(sequence, 'ug');\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/viewcollection\n */\nimport { CKEditorError, Collection } from '@ckeditor/ckeditor5-utils';\n/**\n * Collects {@link module:ui/view~View} instances.\n *\n * ```ts\n * const parentView = new ParentView( locale );\n * const collection = new ViewCollection( locale );\n *\n * collection.setParent( parentView.element );\n *\n * const viewA = new ChildView( locale );\n * const viewB = new ChildView( locale );\n * ```\n *\n * View collection renders and manages view {@link module:ui/view~View#element elements}:\n *\n * ```ts\n * collection.add( viewA );\n * collection.add( viewB );\n *\n * console.log( parentView.element.firsChild ); // -> viewA.element\n * console.log( parentView.element.lastChild ); // -> viewB.element\n * ```\n *\n * It {@link module:ui/viewcollection~ViewCollection#delegate propagates} DOM events too:\n *\n * ```ts\n * // Delegate #click and #keydown events from viewA and viewB to the parentView.\n * collection.delegate( 'click' ).to( parentView );\n *\n * parentView.on( 'click', ( evt ) => {\n * \tconsole.log( `${ evt.source } has been clicked.` );\n * } );\n *\n * // This event will be delegated to the parentView.\n * viewB.fire( 'click' );\n * ```\n *\n * **Note**: A view collection can be used directly in the {@link module:ui/template~TemplateDefinition definition}\n * of a {@link module:ui/template~Template template}.\n */\nexport default class ViewCollection extends Collection {\n /**\n * Creates a new instance of the {@link module:ui/viewcollection~ViewCollection}.\n *\n * @param initialItems The initial items of the collection.\n */\n constructor(initialItems = []) {\n super(initialItems, {\n // An #id Number attribute should be legal and not break the `ViewCollection` instance.\n // https://github.com/ckeditor/ckeditor5-ui/issues/93\n idProperty: 'viewUid'\n });\n // Handle {@link module:ui/view~View#element} in DOM when a new view is added to the collection.\n this.on('add', (evt, view, index) => {\n this._renderViewIntoCollectionParent(view, index);\n });\n // Handle {@link module:ui/view~View#element} in DOM when a view is removed from the collection.\n this.on('remove', (evt, view) => {\n if (view.element && this._parentElement) {\n view.element.remove();\n }\n });\n this._parentElement = null;\n }\n /**\n * Destroys the view collection along with child views.\n * See the view {@link module:ui/view~View#destroy} method.\n */\n destroy() {\n this.map(view => view.destroy());\n }\n /**\n * Sets the parent HTML element of this collection. When parent is set, {@link #add adding} and\n * {@link #remove removing} views in the collection synchronizes their\n * {@link module:ui/view~View#element elements} in the parent element.\n *\n * @param element A new parent element.\n */\n setParent(elementOrDocFragment) {\n this._parentElement = elementOrDocFragment;\n // Take care of the initial collection items passed to the constructor.\n for (const view of this) {\n this._renderViewIntoCollectionParent(view);\n }\n }\n /**\n * Delegates selected events coming from within views in the collection to any\n * {@link module:utils/emittermixin~Emitter}.\n *\n * For the following views and collection:\n *\n * ```ts\n * const viewA = new View();\n * const viewB = new View();\n * const viewC = new View();\n *\n * const views = parentView.createCollection();\n *\n * views.delegate( 'eventX' ).to( viewB );\n * views.delegate( 'eventX', 'eventY' ).to( viewC );\n *\n * views.add( viewA );\n * ```\n *\n * the `eventX` is delegated (fired by) `viewB` and `viewC` along with `customData`:\n *\n * ```ts\n * viewA.fire( 'eventX', customData );\n * ```\n *\n * and `eventY` is delegated (fired by) `viewC` along with `customData`:\n *\n * ```ts\n * viewA.fire( 'eventY', customData );\n * ```\n *\n * See {@link module:utils/emittermixin~Emitter#delegate}.\n *\n * @param events {@link module:ui/view~View} event names to be delegated to another\n * {@link module:utils/emittermixin~Emitter}.\n * @returns Object with `to` property, a function which accepts the destination\n * of {@link module:utils/emittermixin~Emitter#delegate delegated} events.\n */\n delegate(...events) {\n if (!events.length || !isStringArray(events)) {\n /**\n * All event names must be strings.\n *\n * @error ui-viewcollection-delegate-wrong-events\n */\n throw new CKEditorError('ui-viewcollection-delegate-wrong-events', this);\n }\n return {\n to: dest => {\n // Activate delegating on existing views in this collection.\n for (const view of this) {\n for (const evtName of events) {\n view.delegate(evtName).to(dest);\n }\n }\n // Activate delegating on future views in this collection.\n this.on('add', (evt, view) => {\n for (const evtName of events) {\n view.delegate(evtName).to(dest);\n }\n });\n // Deactivate delegating when view is removed from this collection.\n this.on('remove', (evt, view) => {\n for (const evtName of events) {\n view.stopDelegating(evtName, dest);\n }\n });\n }\n };\n }\n /**\n * This method {@link module:ui/view~View#render renders} a new view added to the collection.\n *\n * If the {@link #_parentElement parent element} of the collection is set, this method also adds\n * the view's {@link module:ui/view~View#element} as a child of the parent in DOM at a specified index.\n *\n * **Note**: If index is not specified, the view's element is pushed as the last child\n * of the parent element.\n *\n * @param view A new view added to the collection.\n * @param index An index the view holds in the collection. When not specified,\n * the view is added at the end.\n */\n _renderViewIntoCollectionParent(view, index) {\n if (!view.isRendered) {\n view.render();\n }\n if (view.element && this._parentElement) {\n this._parentElement.insertBefore(view.element, this._parentElement.children[index]);\n }\n }\n /**\n * Removes a child view from the collection. If the {@link #setParent parent element} of the\n * collection has been set, the {@link module:ui/view~View#element element} of the view is also removed\n * in DOM, reflecting the order of the collection.\n *\n * See the {@link #add} method.\n *\n * @param subject The view to remove, its id or index in the collection.\n * @returns The removed view.\n */\n remove(subject) {\n return super.remove(subject);\n }\n}\n/**\n * Check if all entries of the array are of `String` type.\n *\n * @param arr An array to be checked.\n */\nfunction isStringArray(arr) {\n return arr.every(a => typeof a == 'string');\n}\n","import api from \"!../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../css-loader/dist/cjs.js!../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./globals.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* eslint-disable @typescript-eslint/no-invalid-void-type */\n/**\n * @module ui/view\n */\nimport ViewCollection from './viewcollection';\nimport Template from './template';\nimport { CKEditorError, Collection, DomEmitterMixin, ObservableMixin, isIterable } from '@ckeditor/ckeditor5-utils';\nimport '../theme/globals/globals.css';\n/**\n * The basic view class, which represents an HTML element created out of a\n * {@link module:ui/view~View#template}. Views are building blocks of the user interface and handle\n * interaction\n *\n * Views {@link module:ui/view~View#registerChild aggregate} children in\n * {@link module:ui/view~View#createCollection collections} and manage the life cycle of DOM\n * listeners e.g. by handling rendering and destruction.\n *\n * See the {@link module:ui/template~TemplateDefinition} syntax to learn more about shaping view\n * elements, attributes and listeners.\n *\n * ```ts\n * class SampleView extends View {\n * \tconstructor( locale ) {\n * \t\tsuper( locale );\n *\n * \t\tconst bind = this.bindTemplate;\n *\n * \t\t// Views define their interface (state) using observable attributes.\n * \t\tthis.set( 'elementClass', 'bar' );\n *\n * \t\tthis.setTemplate( {\n * \t\t\ttag: 'p',\n *\n * \t\t\t// The element of the view can be defined with its children.\n * \t\t\tchildren: [\n * \t\t\t\t'Hello',\n * \t\t\t\t{\n * \t\t\t\t\ttag: 'b',\n * \t\t\t\t\tchildren: [ 'world!' ]\n * \t\t\t\t}\n * \t\t\t],\n * \t\t\tattributes: {\n * \t\t\t\tclass: [\n * \t\t\t\t\t'foo',\n *\n * \t\t\t\t\t// Observable attributes control the state of the view in DOM.\n * \t\t\t\t\tbind.to( 'elementClass' )\n * \t\t\t\t]\n * \t\t\t},\n * \t\t\ton: {\n * \t\t\t\t// Views listen to DOM events and propagate them.\n * \t\t\t\tclick: bind.to( 'clicked' )\n * \t\t\t}\n * \t\t} );\n * \t}\n * }\n *\n * const view = new SampleView( locale );\n *\n * view.render();\n *\n * // Append <p class=\"foo bar\">Hello<b>world</b></p> to the <body>\n * document.body.appendChild( view.element );\n *\n * // Change the class attribute to <p class=\"foo baz\">Hello<b>world</b></p>\n * view.elementClass = 'baz';\n *\n * // Respond to the \"click\" event in DOM by executing a custom action.\n * view.on( 'clicked', () => {\n * \tconsole.log( 'The view has been clicked!' );\n * } );\n * ```\n */\nexport default class View extends DomEmitterMixin(ObservableMixin()) {\n /**\n * Creates an instance of the {@link module:ui/view~View} class.\n *\n * Also see {@link #render}.\n *\n * @param locale The localization services instance.\n */\n constructor(locale) {\n super();\n this.element = null;\n this.isRendered = false;\n this.locale = locale;\n this.t = locale && locale.t;\n this._viewCollections = new Collection();\n this._unboundChildren = this.createCollection();\n // Pass parent locale to its children.\n this._viewCollections.on('add', (evt, collection) => {\n collection.locale = locale;\n collection.t = locale && locale.t;\n });\n this.decorate('render');\n }\n /**\n * Shorthand for {@link module:ui/template~Template.bind}, a binding\n * {@link module:ui/template~BindChain interface} preconfigured for the view instance.\n *\n * It provides {@link module:ui/template~BindChain#to `to()`} and\n * {@link module:ui/template~BindChain#if `if()`} methods that initialize bindings with\n * observable attributes and attach DOM listeners.\n *\n * ```ts\n * class SampleView extends View {\n * \tconstructor( locale ) {\n * \t\tsuper( locale );\n *\n * \t\tconst bind = this.bindTemplate;\n *\n * \t\t// These {@link module:utils/observablemixin~Observable observable} attributes will control\n * \t\t// the state of the view in DOM.\n * \t\tthis.set( {\n * \t\t\telementClass: 'foo',\n * \t\t \tisEnabled: true\n * \t\t } );\n *\n * \t\tthis.setTemplate( {\n * \t\t\ttag: 'p',\n *\n * \t\t\tattributes: {\n * \t\t\t\t// The class HTML attribute will follow elementClass\n * \t\t\t\t// and isEnabled view attributes.\n * \t\t\t\tclass: [\n * \t\t\t\t\tbind.to( 'elementClass' )\n * \t\t\t\t\tbind.if( 'isEnabled', 'present-when-enabled' )\n * \t\t\t\t]\n * \t\t\t},\n *\n * \t\t\ton: {\n * \t\t\t\t// The view will fire the \"clicked\" event upon clicking <p> in DOM.\n * \t\t\t\tclick: bind.to( 'clicked' )\n * \t\t\t}\n * \t\t} );\n * \t}\n * }\n * ```\n */\n get bindTemplate() {\n if (this._bindTemplate) {\n return this._bindTemplate;\n }\n return (this._bindTemplate = Template.bind(this, this));\n }\n /**\n * Creates a new collection of views, which can be used as\n * {@link module:ui/template~Template#children} of this view.\n *\n * ```ts\n * class SampleView extends View {\n * \tconstructor( locale ) {\n * \t\tsuper( locale );\n *\n * \t\tconst child = new ChildView( locale );\n * \t\tthis.items = this.createCollection( [ child ] );\n *\n * \t\tthis.setTemplate( {\n * \t\t\ttag: 'p',\n *\n * \t\t\t// `items` collection will render here.\n * \t\t\tchildren: this.items\n * \t\t} );\n * \t}\n * }\n *\n * const view = new SampleView( locale );\n * view.render();\n *\n * // It will append <p><child#element></p> to the <body>.\n * document.body.appendChild( view.element );\n * ```\n *\n * @param views Initial views of the collection.\n * @returns A new collection of view instances.\n */\n createCollection(views) {\n const collection = new ViewCollection(views);\n this._viewCollections.add(collection);\n return collection;\n }\n /**\n * Registers a new child view under the view instance. Once registered, a child\n * view is managed by its parent, including {@link #render rendering}\n * and {@link #destroy destruction}.\n *\n * To revert this, use {@link #deregisterChild}.\n *\n * ```ts\n * class SampleView extends View {\n * \tconstructor( locale ) {\n * \t\tsuper( locale );\n *\n * \t\tthis.childA = new SomeChildView( locale );\n * \t\tthis.childB = new SomeChildView( locale );\n *\n * \t\tthis.setTemplate( { tag: 'p' } );\n *\n * \t\t// Register the children.\n * \t\tthis.registerChild( [ this.childA, this.childB ] );\n * \t}\n *\n * \trender() {\n * \t\tsuper.render();\n *\n * \t\tthis.element.appendChild( this.childA.element );\n * \t\tthis.element.appendChild( this.childB.element );\n * \t}\n * }\n *\n * const view = new SampleView( locale );\n *\n * view.render();\n *\n * // Will append <p><childA#element><b></b><childB#element></p>.\n * document.body.appendChild( view.element );\n * ```\n *\n * **Note**: There's no need to add child views if they're already referenced in the\n * {@link #template}:\n *\n * ```ts\n * class SampleView extends View {\n * \tconstructor( locale ) {\n * \t\tsuper( locale );\n *\n * \t\tthis.childA = new SomeChildView( locale );\n * \t\tthis.childB = new SomeChildView( locale );\n *\n * \t\tthis.setTemplate( {\n * \t\t\ttag: 'p',\n *\n * \t\t\t// These children will be added automatically. There's no\n * \t\t\t// need to call {@link #registerChild} for any of them.\n * \t\t\tchildren: [ this.childA, this.childB ]\n * \t\t} );\n * \t}\n *\n * \t// ...\n * }\n * ```\n *\n * @param children Children views to be registered.\n */\n registerChild(children) {\n if (!isIterable(children)) {\n children = [children];\n }\n for (const child of children) {\n this._unboundChildren.add(child);\n }\n }\n /**\n * The opposite of {@link #registerChild}. Removes a child view from this view instance.\n * Once removed, the child is no longer managed by its parent, e.g. it can safely\n * become a child of another parent view.\n *\n * @see #registerChild\n * @param children Child views to be removed.\n */\n deregisterChild(children) {\n if (!isIterable(children)) {\n children = [children];\n }\n for (const child of children) {\n this._unboundChildren.remove(child);\n }\n }\n /**\n * Sets the {@link #template} of the view with with given definition.\n *\n * A shorthand for:\n *\n * ```ts\n * view.setTemplate( definition );\n * ```\n *\n * @param definition Definition of view's template.\n */\n setTemplate(definition) {\n this.template = new Template(definition);\n }\n /**\n * {@link module:ui/template~Template.extend Extends} the {@link #template} of the view with\n * with given definition.\n *\n * A shorthand for:\n *\n * ```ts\n * Template.extend( view.template, definition );\n * ```\n *\n * **Note**: Is requires the {@link #template} to be already set. See {@link #setTemplate}.\n *\n * @param definition Definition which extends the {@link #template}.\n */\n extendTemplate(definition) {\n Template.extend(this.template, definition);\n }\n /**\n * Recursively renders the view.\n *\n * Once the view is rendered:\n * * the {@link #element} becomes an HTML element out of {@link #template},\n * * the {@link #isRendered} flag is set `true`.\n *\n * **Note**: The children of the view:\n * * defined directly in the {@link #template}\n * * residing in collections created by the {@link #createCollection} method,\n * * and added by {@link #registerChild}\n * are also rendered in the process.\n *\n * In general, `render()` method is the right place to keep the code which refers to the\n * {@link #element} and should be executed at the very beginning of the view's life cycle.\n *\n * It is possible to {@link module:ui/template~Template.extend} the {@link #template} before\n * the view is rendered. To allow an early customization of the view (e.g. by its parent),\n * such references should be done in `render()`.\n *\n * ```ts\n * class SampleView extends View {\n * \tconstructor() {\n * \t\tthis.setTemplate( {\n * \t\t\t// ...\n * \t\t} );\n * \t},\n *\n * \trender() {\n * \t\t// View#element becomes available.\n * \t\tsuper.render();\n *\n * \t\t// The \"scroll\" listener depends on #element.\n * \t\tthis.listenTo( window, 'scroll', () => {\n * \t\t\t// A reference to #element would render the #template and make it non-extendable.\n * \t\t\tif ( window.scrollY > 0 ) {\n * \t\t\t\tthis.element.scrollLeft = 100;\n * \t\t\t} else {\n * \t\t\t\tthis.element.scrollLeft = 0;\n * \t\t\t}\n * \t\t} );\n * \t}\n * }\n *\n * const view = new SampleView();\n *\n * // Let's customize the view before it gets rendered.\n * view.extendTemplate( {\n * \tattributes: {\n * \t\tclass: [\n * \t\t\t'additional-class'\n * \t\t]\n * \t}\n * } );\n *\n * // Late rendering allows customization of the view.\n * view.render();\n * ```\n */\n render() {\n if (this.isRendered) {\n /**\n * This View has already been rendered.\n *\n * @error ui-view-render-already-rendered\n */\n throw new CKEditorError('ui-view-render-already-rendered', this);\n }\n // Render #element of the view.\n if (this.template) {\n this.element = this.template.render();\n // Autoregister view children from #template.\n this.registerChild(this.template.getViews());\n }\n this.isRendered = true;\n }\n /**\n * Recursively destroys the view instance and child views added by {@link #registerChild} and\n * residing in collections created by the {@link #createCollection}.\n *\n * Destruction disables all event listeners:\n * * created on the view, e.g. `view.on( 'event', () => {} )`,\n * * defined in the {@link #template} for DOM events.\n */\n destroy() {\n this.stopListening();\n this._viewCollections.map(c => c.destroy());\n // Template isn't obligatory for views.\n if (this.template && this.template._revertData) {\n this.template.revert(this.element);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/template\n */\n/* global document */\nimport View from './view';\nimport ViewCollection from './viewcollection';\nimport { CKEditorError, EmitterMixin, isNode, toArray } from '@ckeditor/ckeditor5-utils';\nimport { isObject, cloneDeepWith } from 'lodash-es';\nconst xhtmlNs = 'http://www.w3.org/1999/xhtml';\n/**\n * A basic Template class. It renders a DOM HTML element or text from a\n * {@link module:ui/template~TemplateDefinition definition} and supports element attributes, children,\n * bindings to {@link module:utils/observablemixin~Observable observables} and DOM event propagation.\n *\n * A simple template can look like this:\n *\n * ```ts\n * const bind = Template.bind( observable, emitter );\n *\n * new Template( {\n * \ttag: 'p',\n * \tattributes: {\n * \t\tclass: 'foo',\n * \t\tstyle: {\n * \t\t\tbackgroundColor: 'yellow'\n * \t\t}\n * \t},\n * \ton: {\n * \t\tclick: bind.to( 'clicked' )\n * \t},\n * \tchildren: [\n * \t\t'A paragraph.'\n * \t]\n * } ).render();\n * ```\n *\n * and it will render the following HTML element:\n *\n * ```html\n * <p class=\"foo\" style=\"background-color: yellow;\">A paragraph.</p>\n * ```\n *\n * Additionally, the `observable` will always fire `clicked` upon clicking `<p>` in the DOM.\n *\n * See {@link module:ui/template~TemplateDefinition} to know more about templates and complex\n * template definitions.\n */\nexport default class Template extends EmitterMixin() {\n /**\n * Creates an instance of the {@link ~Template} class.\n *\n * @param def The definition of the template.\n */\n constructor(def) {\n super();\n Object.assign(this, normalize(clone(def)));\n this._isRendered = false;\n this._revertData = null;\n }\n /**\n * Renders a DOM Node (an HTML element or text) out of the template.\n *\n * ```ts\n * const domNode = new Template( { ... } ).render();\n * ```\n *\n * See: {@link #apply}.\n */\n render() {\n const node = this._renderNode({\n intoFragment: true\n });\n this._isRendered = true;\n return node;\n }\n /**\n * Applies the template to an existing DOM Node, either HTML element or text.\n *\n * **Note:** No new DOM nodes will be created. Applying extends:\n *\n * {@link module:ui/template~TemplateDefinition attributes},\n * {@link module:ui/template~TemplateDefinition event listeners}, and\n * `textContent` of {@link module:ui/template~TemplateDefinition children} only.\n *\n * **Note:** Existing `class` and `style` attributes are extended when a template\n * is applied to an HTML element, while other attributes and `textContent` are overridden.\n *\n * **Note:** The process of applying a template can be easily reverted using the\n * {@link module:ui/template~Template#revert} method.\n *\n * ```ts\n * const element = document.createElement( 'div' );\n * const observable = new Model( { divClass: 'my-div' } );\n * const emitter = Object.create( EmitterMixin );\n * const bind = Template.bind( observable, emitter );\n *\n * new Template( {\n * \tattributes: {\n * \t\tid: 'first-div',\n * \t\tclass: bind.to( 'divClass' )\n * \t},\n * \ton: {\n * \t\tclick: bind( 'elementClicked' ) // Will be fired by the observable.\n * \t},\n * \tchildren: [\n * \t\t'Div text.'\n * \t]\n * } ).apply( element );\n *\n * console.log( element.outerHTML ); // -> '<div id=\"first-div\" class=\"my-div\"></div>'\n * ```\n *\n * @see module:ui/template~Template#render\n * @see module:ui/template~Template#revert\n * @param node Root node for the template to apply.\n */\n apply(node) {\n this._revertData = getEmptyRevertData();\n this._renderNode({\n node,\n intoFragment: false,\n isApplying: true,\n revertData: this._revertData\n });\n return node;\n }\n /**\n * Reverts a template {@link module:ui/template~Template#apply applied} to a DOM node.\n *\n * @param node The root node for the template to revert. In most of the cases, it is the\n * same node used by {@link module:ui/template~Template#apply}.\n */\n revert(node) {\n if (!this._revertData) {\n /**\n * Attempting to revert a template which has not been applied yet.\n *\n * @error ui-template-revert-not-applied\n */\n throw new CKEditorError('ui-template-revert-not-applied', [this, node]);\n }\n this._revertTemplateFromNode(node, this._revertData);\n }\n /**\n * Returns an iterator which traverses the template in search of {@link module:ui/view~View}\n * instances and returns them one by one.\n *\n * ```ts\n * const viewFoo = new View();\n * const viewBar = new View();\n * const viewBaz = new View();\n * const template = new Template( {\n * \ttag: 'div',\n * \tchildren: [\n * \t\tviewFoo,\n * \t\t{\n * \t\t\ttag: 'div',\n * \t\t\tchildren: [\n * \t\t\t\tviewBar\n * \t\t\t]\n * \t\t},\n * \t\tviewBaz\n * \t]\n * } );\n *\n * // Logs: viewFoo, viewBar, viewBaz\n * for ( const view of template.getViews() ) {\n * \tconsole.log( view );\n * }\n * ```\n */\n *getViews() {\n function* search(def) {\n if (def.children) {\n for (const child of def.children) {\n if (isView(child)) {\n yield child;\n }\n else if (isTemplate(child)) {\n yield* search(child);\n }\n }\n }\n }\n yield* search(this);\n }\n /**\n * An entry point to the interface which binds DOM nodes to\n * {@link module:utils/observablemixin~Observable observables}.\n * There are two types of bindings:\n *\n * * HTML element attributes or text `textContent` synchronized with attributes of an\n * {@link module:utils/observablemixin~Observable}. Learn more about {@link module:ui/template~BindChain#to}\n * and {@link module:ui/template~BindChain#if}.\n *\n * ```ts\n * const bind = Template.bind( observable, emitter );\n *\n * new Template( {\n * \tattributes: {\n * \t\t// Binds the element \"class\" attribute to observable#classAttribute.\n * \t\tclass: bind.to( 'classAttribute' )\n * \t}\n * } ).render();\n * ```\n *\n * * DOM events fired on HTML element propagated through\n * {@link module:utils/observablemixin~Observable}. Learn more about {@link module:ui/template~BindChain#to}.\n *\n * ```ts\n * const bind = Template.bind( observable, emitter );\n *\n * new Template( {\n * \ton: {\n * \t\t// Will be fired by the observable.\n * \t\tclick: bind( 'elementClicked' )\n * \t}\n * } ).render();\n * ```\n *\n * Also see {@link module:ui/view~View#bindTemplate}.\n *\n * @param observable An observable which provides boundable attributes.\n * @param emitter An emitter that listens to observable attribute\n * changes or DOM Events (depending on the kind of the binding). Usually, a {@link module:ui/view~View} instance.\n */\n static bind(observable, emitter) {\n return {\n to(eventNameOrFunctionOrAttribute, callback) {\n return new TemplateToBinding({\n eventNameOrFunction: eventNameOrFunctionOrAttribute,\n attribute: eventNameOrFunctionOrAttribute,\n observable, emitter, callback\n });\n },\n if(attribute, valueIfTrue, callback) {\n return new TemplateIfBinding({\n observable, emitter, attribute, valueIfTrue, callback\n });\n }\n };\n }\n /**\n * Extends an existing {@link module:ui/template~Template} instance with some additional content\n * from another {@link module:ui/template~TemplateDefinition}.\n *\n * ```ts\n * const bind = Template.bind( observable, emitter );\n *\n * const template = new Template( {\n * \ttag: 'p',\n * \tattributes: {\n * \t\tclass: 'a',\n * \t\tdata-x: bind.to( 'foo' )\n * \t},\n * \tchildren: [\n * \t\t{\n * \t\t\ttag: 'span',\n * \t\t\tattributes: {\n * \t\t\t\tclass: 'b'\n * \t\t\t},\n * \t\t\tchildren: [\n * \t\t\t\t'Span'\n * \t\t\t]\n * \t\t}\n * \t]\n * } );\n *\n * // Instance-level extension.\n * Template.extend( template, {\n * \tattributes: {\n * \t\tclass: 'b',\n * \t\tdata-x: bind.to( 'bar' )\n * \t},\n * \tchildren: [\n * \t\t{\n * \t\t\tattributes: {\n * \t\t\t\tclass: 'c'\n * \t\t\t}\n * \t\t}\n * \t]\n * } );\n *\n * // Child extension.\n * Template.extend( template.children[ 0 ], {\n * \tattributes: {\n * \t\tclass: 'd'\n * \t}\n * } );\n * ```\n *\n * the `outerHTML` of `template.render()` is:\n *\n * ```html\n * <p class=\"a b\" data-x=\"{ observable.foo } { observable.bar }\">\n * \t<span class=\"b c d\">Span</span>\n * </p>\n * ```\n *\n * @param template An existing template instance to be extended.\n * @param def Additional definition to be applied to a template.\n */\n static extend(template, def) {\n if (template._isRendered) {\n /**\n * Extending a template after rendering may not work as expected. To make sure\n * the {@link module:ui/template~Template.extend extending} works for an element,\n * make sure it happens before {@link module:ui/template~Template#render} is called.\n *\n * @error template-extend-render\n */\n throw new CKEditorError('template-extend-render', [this, template]);\n }\n extendTemplate(template, normalize(clone(def)));\n }\n /**\n * Renders a DOM Node (either an HTML element or text) out of the template.\n *\n * @param data Rendering data.\n */\n _renderNode(data) {\n let isInvalid;\n if (data.node) {\n // When applying, a definition cannot have \"tag\" and \"text\" at the same time.\n isInvalid = this.tag && this.text;\n }\n else {\n // When rendering, a definition must have either \"tag\" or \"text\": XOR( this.tag, this.text ).\n isInvalid = this.tag ? this.text : !this.text;\n }\n if (isInvalid) {\n /**\n * Node definition cannot have the \"tag\" and \"text\" properties at the same time.\n * Node definition must have either \"tag\" or \"text\" when rendering a new Node.\n *\n * @error ui-template-wrong-syntax\n */\n throw new CKEditorError('ui-template-wrong-syntax', this);\n }\n if (this.text) {\n return this._renderText(data);\n }\n else {\n return this._renderElement(data);\n }\n }\n /**\n * Renders an HTML element out of the template.\n *\n * @param data Rendering data.\n */\n _renderElement(data) {\n let node = data.node;\n if (!node) {\n node = data.node = document.createElementNS(this.ns || xhtmlNs, this.tag);\n }\n this._renderAttributes(data);\n this._renderElementChildren(data);\n this._setUpListeners(data);\n return node;\n }\n /**\n * Renders a text node out of {@link module:ui/template~Template#text}.\n *\n * @param data Rendering data.\n */\n _renderText(data) {\n let node = data.node;\n // Save the original textContent to revert it in #revert().\n if (node) {\n data.revertData.text = node.textContent;\n }\n else {\n node = data.node = document.createTextNode('');\n }\n // Check if this Text Node is bound to Observable. Cases:\n //\n //\t\ttext: [ Template.bind( ... ).to( ... ) ]\n //\n //\t\ttext: [\n //\t\t\t'foo',\n //\t\t\tTemplate.bind( ... ).to( ... ),\n //\t\t\t...\n //\t\t]\n //\n if (hasTemplateBinding(this.text)) {\n this._bindToObservable({\n schema: this.text,\n updater: getTextUpdater(node),\n data\n });\n }\n // Simply set text. Cases:\n //\n //\t\ttext: [ 'all', 'are', 'static' ]\n //\n //\t\ttext: [ 'foo' ]\n //\n else {\n node.textContent = this.text.join('');\n }\n return node;\n }\n /**\n * Renders HTML element attributes out of {@link module:ui/template~Template#attributes}.\n *\n * @param data Rendering data.\n */\n _renderAttributes(data) {\n if (!this.attributes) {\n return;\n }\n const node = data.node;\n const revertData = data.revertData;\n for (const attrName in this.attributes) {\n // Current attribute value in DOM.\n const domAttrValue = node.getAttribute(attrName);\n // The value to be set.\n const attrValue = this.attributes[attrName];\n // Save revert data.\n if (revertData) {\n revertData.attributes[attrName] = domAttrValue;\n }\n // Detect custom namespace:\n //\n //\t\tclass: {\n //\t\t\tns: 'abc',\n //\t\t\tvalue: Template.bind( ... ).to( ... )\n //\t\t}\n //\n const attrNs = isNamespaced(attrValue) ? attrValue[0].ns : null;\n // Activate binding if one is found. Cases:\n //\n //\t\tclass: [\n //\t\t\tTemplate.bind( ... ).to( ... )\n //\t\t]\n //\n //\t\tclass: [\n //\t\t\t'bar',\n //\t\t\tTemplate.bind( ... ).to( ... ),\n //\t\t\t'baz'\n //\t\t]\n //\n //\t\tclass: {\n //\t\t\tns: 'abc',\n //\t\t\tvalue: Template.bind( ... ).to( ... )\n //\t\t}\n //\n if (hasTemplateBinding(attrValue)) {\n // Normalize attributes with additional data like namespace:\n //\n //\t\tclass: {\n //\t\t\tns: 'abc',\n //\t\t\tvalue: [ ... ]\n //\t\t}\n //\n const valueToBind = isNamespaced(attrValue) ? attrValue[0].value : attrValue;\n // Extend the original value of attributes like \"style\" and \"class\",\n // don't override them.\n if (revertData && shouldExtend(attrName)) {\n valueToBind.unshift(domAttrValue);\n }\n this._bindToObservable({\n schema: valueToBind,\n updater: getAttributeUpdater(node, attrName, attrNs),\n data\n });\n }\n // Style attribute could be an Object so it needs to be parsed in a specific way.\n //\n //\t\tstyle: {\n //\t\t\twidth: '100px',\n //\t\t\theight: Template.bind( ... ).to( ... )\n //\t\t}\n //\n else if (attrName == 'style' && typeof attrValue[0] !== 'string') {\n this._renderStyleAttribute(attrValue[0], data);\n }\n // Otherwise simply set the static attribute:\n //\n //\t\tclass: [ 'foo' ]\n //\n //\t\tclass: [ 'all', 'are', 'static' ]\n //\n //\t\tclass: [\n //\t\t\t{\n //\t\t\t\tns: 'abc',\n //\t\t\t\tvalue: [ 'foo' ]\n //\t\t\t}\n //\t\t]\n //\n else {\n // Extend the original value of attributes like \"style\" and \"class\",\n // don't override them.\n if (revertData && domAttrValue && shouldExtend(attrName)) {\n attrValue.unshift(domAttrValue);\n }\n const value = attrValue\n // Retrieve \"values\" from:\n //\n //\t\tclass: [\n //\t\t\t{\n //\t\t\t\tns: 'abc',\n //\t\t\t\tvalue: [ ... ]\n //\t\t\t}\n //\t\t]\n //\n .map((val) => val ? (val.value || val) : val)\n // Flatten the array.\n .reduce((prev, next) => prev.concat(next), [])\n // Convert into string.\n .reduce(arrayValueReducer, '');\n if (!isFalsy(value)) {\n node.setAttributeNS(attrNs, attrName, value);\n }\n }\n }\n }\n /**\n * Renders the `style` attribute of an HTML element based on\n * {@link module:ui/template~Template#attributes}.\n *\n * A style attribute is an object with static values:\n *\n * ```ts\n * attributes: {\n * \tstyle: {\n * \t\tcolor: 'red'\n * \t}\n * }\n * ```\n *\n * or values bound to {@link module:ui/model~Model} properties:\n *\n * ```ts\n * attributes: {\n * \tstyle: {\n * \t\tcolor: bind.to( ... )\n * \t}\n * }\n * ```\n *\n * Note: The `style` attribute is rendered without setting the namespace. It does not seem to be\n * needed.\n *\n * @param styles Styles located in `attributes.style` of {@link module:ui/template~TemplateDefinition}.\n * @param data Rendering data.\n */\n _renderStyleAttribute(styles, data) {\n const node = data.node;\n for (const styleName in styles) {\n const styleValue = styles[styleName];\n // Cases:\n //\n //\t\tstyle: {\n //\t\t\tcolor: bind.to( 'attribute' )\n //\t\t}\n //\n if (hasTemplateBinding(styleValue)) {\n this._bindToObservable({\n schema: [styleValue],\n updater: getStyleUpdater(node, styleName),\n data\n });\n }\n // Cases:\n //\n //\t\tstyle: {\n //\t\t\tcolor: 'red'\n //\t\t}\n //\n else {\n node.style[styleName] = styleValue;\n }\n }\n }\n /**\n * Recursively renders HTML element's children from {@link module:ui/template~Template#children}.\n *\n * @param data Rendering data.\n */\n _renderElementChildren(data) {\n const node = data.node;\n const container = data.intoFragment ? document.createDocumentFragment() : node;\n const isApplying = data.isApplying;\n let childIndex = 0;\n for (const child of this.children) {\n if (isViewCollection(child)) {\n if (!isApplying) {\n child.setParent(node);\n // Note: ViewCollection renders its children.\n for (const view of child) {\n container.appendChild(view.element);\n }\n }\n }\n else if (isView(child)) {\n if (!isApplying) {\n if (!child.isRendered) {\n child.render();\n }\n container.appendChild(child.element);\n }\n }\n else if (isNode(child)) {\n container.appendChild(child);\n }\n else {\n if (isApplying) {\n const revertData = data.revertData;\n const childRevertData = getEmptyRevertData();\n revertData.children.push(childRevertData);\n child._renderNode({\n intoFragment: false,\n node: container.childNodes[childIndex++],\n isApplying: true,\n revertData: childRevertData\n });\n }\n else {\n container.appendChild(child.render());\n }\n }\n }\n if (data.intoFragment) {\n node.appendChild(container);\n }\n }\n /**\n * Activates `on` event listeners from the {@link module:ui/template~TemplateDefinition}\n * on an HTML element.\n *\n * @param data Rendering data.\n */\n _setUpListeners(data) {\n if (!this.eventListeners) {\n return;\n }\n for (const key in this.eventListeners) {\n const revertBindings = this.eventListeners[key].map(schemaItem => {\n const [domEvtName, domSelector] = key.split('@');\n return schemaItem.activateDomEventListener(domEvtName, domSelector, data);\n });\n if (data.revertData) {\n data.revertData.bindings.push(revertBindings);\n }\n }\n }\n /**\n * For a given {@link module:ui/template~TemplateValueSchema} containing {@link module:ui/template~TemplateBinding}\n * activates the binding and sets its initial value.\n *\n * Note: {@link module:ui/template~TemplateValueSchema} can be for HTML element attributes or\n * text node `textContent`.\n *\n * @param options Binding options.\n * @param options.updater A function which updates the DOM (like attribute or text).\n * @param options.data Rendering data.\n */\n _bindToObservable({ schema, updater, data }) {\n const revertData = data.revertData;\n // Set initial values.\n syncValueSchemaValue(schema, updater, data);\n const revertBindings = schema\n // Filter \"falsy\" (false, undefined, null, '') value schema components out.\n .filter(item => !isFalsy(item))\n // Filter inactive bindings from schema, like static strings ('foo'), numbers (42), etc.\n .filter((item) => item.observable)\n // Once only the actual binding are left, let the emitter listen to observable change:attribute event.\n // TODO: Reduce the number of listeners attached as many bindings may listen\n // to the same observable attribute.\n .map(templateBinding => templateBinding.activateAttributeListener(schema, updater, data));\n if (revertData) {\n revertData.bindings.push(revertBindings);\n }\n }\n /**\n * Reverts {@link module:ui/template~RenderData#revertData template data} from a node to\n * return it to the original state.\n *\n * @param node A node to be reverted.\n * @param revertData An object that stores information about what changes have been made by\n * {@link #apply} to the node. See {@link module:ui/template~RenderData#revertData} for more information.\n */\n _revertTemplateFromNode(node, revertData) {\n for (const binding of revertData.bindings) {\n // Each binding may consist of several observable+observable#attribute.\n // like the following has 2:\n //\n //\t\tclass: [\n //\t\t\t'x',\n //\t\t\tbind.to( 'foo' ),\n //\t\t\t'y',\n //\t\t\tbind.to( 'bar' )\n //\t\t]\n //\n for (const revertBinding of binding) {\n revertBinding();\n }\n }\n if (revertData.text) {\n node.textContent = revertData.text;\n return;\n }\n const element = node;\n for (const attrName in revertData.attributes) {\n const attrValue = revertData.attributes[attrName];\n // When the attribute has **not** been set before #apply().\n if (attrValue === null) {\n element.removeAttribute(attrName);\n }\n else {\n element.setAttribute(attrName, attrValue);\n }\n }\n for (let i = 0; i < revertData.children.length; ++i) {\n this._revertTemplateFromNode(element.childNodes[i], revertData.children[i]);\n }\n }\n}\n/**\n * Describes a binding created by the {@link module:ui/template~Template.bind} interface.\n *\n * @internal\n */\nexport class TemplateBinding {\n /**\n * Creates an instance of the {@link module:ui/template~TemplateBinding} class.\n *\n * @param def The definition of the binding.\n */\n constructor(def) {\n this.attribute = def.attribute;\n this.observable = def.observable;\n this.emitter = def.emitter;\n this.callback = def.callback;\n }\n /**\n * Returns the value of the binding. It is the value of the {@link module:ui/template~TemplateBinding#attribute} in\n * {@link module:ui/template~TemplateBinding#observable}. The value may be processed by the\n * {@link module:ui/template~TemplateBinding#callback}, if such has been passed to the binding.\n *\n * @param node A native DOM node, passed to the custom {@link module:ui/template~TemplateBinding#callback}.\n * @returns The value of {@link module:ui/template~TemplateBinding#attribute} in\n * {@link module:ui/template~TemplateBinding#observable}.\n */\n getValue(node) {\n const value = this.observable[this.attribute];\n return this.callback ? this.callback(value, node) : value;\n }\n /**\n * Activates the listener which waits for changes of the {@link module:ui/template~TemplateBinding#attribute} in\n * {@link module:ui/template~TemplateBinding#observable}, then updates the DOM with the aggregated\n * value of {@link module:ui/template~TemplateValueSchema}.\n *\n * @param schema A full schema to generate an attribute or text in the DOM.\n * @param updater A DOM updater function used to update the native DOM attribute or text.\n * @param data Rendering data.\n * @returns A function to sever the listener binding.\n */\n activateAttributeListener(schema, updater, data) {\n const callback = () => syncValueSchemaValue(schema, updater, data);\n this.emitter.listenTo(this.observable, `change:${this.attribute}`, callback);\n // Allows revert of the listener.\n return () => {\n this.emitter.stopListening(this.observable, `change:${this.attribute}`, callback);\n };\n }\n}\n/**\n * Describes either:\n *\n * * a binding to an {@link module:utils/observablemixin~Observable},\n * * or a native DOM event binding.\n *\n * It is created by the {@link module:ui/template~BindChain#to} method.\n *\n * @internal\n */\nexport class TemplateToBinding extends TemplateBinding {\n constructor(def) {\n super(def);\n this.eventNameOrFunction = def.eventNameOrFunction;\n }\n /**\n * Activates the listener for the native DOM event, which when fired, is propagated by\n * the {@link module:ui/template~TemplateBinding#emitter}.\n *\n * @param domEvtName The name of the native DOM event.\n * @param domSelector The selector in the DOM to filter delegated events.\n * @param data Rendering data.\n * @returns A function to sever the listener binding.\n */\n activateDomEventListener(domEvtName, domSelector, data) {\n const callback = (evt, domEvt) => {\n if (!domSelector || domEvt.target.matches(domSelector)) {\n if (typeof this.eventNameOrFunction == 'function') {\n this.eventNameOrFunction(domEvt);\n }\n else {\n this.observable.fire(this.eventNameOrFunction, domEvt);\n }\n }\n };\n this.emitter.listenTo(data.node, domEvtName, callback);\n // Allows revert of the listener.\n return () => {\n this.emitter.stopListening(data.node, domEvtName, callback);\n };\n }\n}\n/**\n * Describes a binding to {@link module:utils/observablemixin~Observable} created by the {@link module:ui/template~BindChain#if}\n * method.\n *\n * @internal\n */\nexport class TemplateIfBinding extends TemplateBinding {\n constructor(def) {\n super(def);\n this.valueIfTrue = def.valueIfTrue;\n }\n /**\n * @inheritDoc\n */\n getValue(node) {\n const value = super.getValue(node);\n return isFalsy(value) ? false : (this.valueIfTrue || true);\n }\n}\n/**\n * Checks whether given {@link module:ui/template~TemplateValueSchema} contains a\n * {@link module:ui/template~TemplateBinding}.\n */\nfunction hasTemplateBinding(schema) {\n if (!schema) {\n return false;\n }\n // Normalize attributes with additional data like namespace:\n //\n //\t\tclass: {\n //\t\t\tns: 'abc',\n //\t\t\tvalue: [ ... ]\n //\t\t}\n //\n if (schema.value) {\n schema = schema.value;\n }\n if (Array.isArray(schema)) {\n return schema.some(hasTemplateBinding);\n }\n else if (schema instanceof TemplateBinding) {\n return true;\n }\n return 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 the Array corresponds to one of {@link module:ui/template~TemplateValueSchema}\n * items.\n *\n * @param node DOM Node updated when {@link module:utils/observablemixin~Observable} changes.\n */\nfunction getValueSchemaValue(schema, node) {\n return schema.map(schemaItem => {\n // Process {@link module:ui/template~TemplateBinding} bindings.\n if (schemaItem instanceof TemplateBinding) {\n return schemaItem.getValue(node);\n }\n // All static values like strings, numbers, and \"falsy\" values (false, null, undefined, '', etc.) just pass.\n return schemaItem;\n });\n}\n/**\n * A function executed each time the bound Observable attribute changes, which updates the DOM with a value\n * constructed from {@link module:ui/template~TemplateValueSchema}.\n *\n * @param updater A function which updates the DOM (like attribute or text).\n * @param node DOM Node updated when {@link module:utils/observablemixin~Observable} changes.\n */\nfunction syncValueSchemaValue(schema, updater, { node }) {\n const values = getValueSchemaValue(schema, node);\n let value;\n // Check if schema is a single Template.bind.if, like:\n //\n //\t\tclass: Template.bind.if( 'foo' )\n //\n if (schema.length == 1 && schema[0] instanceof TemplateIfBinding) {\n value = values[0];\n }\n else {\n value = values.reduce(arrayValueReducer, '');\n }\n if (isFalsy(value)) {\n updater.remove();\n }\n else {\n updater.set(value);\n }\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 DOM Node to be modified.\n */\nfunction getTextUpdater(node) {\n return {\n set(value) {\n node.textContent = value;\n },\n remove() {\n node.textContent = '';\n }\n };\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 el DOM Node to be modified.\n * @param attrName Name of the attribute to be modified.\n * @param ns Namespace to use.\n */\nfunction getAttributeUpdater(el, attrName, ns) {\n return {\n set(value) {\n el.setAttributeNS(ns, attrName, value);\n },\n remove() {\n el.removeAttributeNS(ns, attrName);\n }\n };\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 el DOM Node to be modified.\n * @param styleName Name of the style to be modified.\n */\nfunction getStyleUpdater(el, styleName) {\n return {\n set(value) {\n el.style[styleName] = value;\n },\n remove() {\n el.style[styleName] = null;\n }\n };\n}\n/**\n * Clones definition of the template.\n */\nfunction clone(def) {\n const clone = cloneDeepWith(def, value => {\n // Don't clone the `Template.bind`* bindings because of the references to Observable\n // and DomEmitterMixin instances inside, which would also be traversed and cloned by greedy\n // cloneDeepWith algorithm. There's no point in cloning Observable/DomEmitterMixins\n // along with the definition.\n //\n // Don't clone Template instances if provided as a child. They're simply #render()ed\n // and nothing should interfere.\n //\n // Also don't clone View instances if provided as a child of the Template. The template\n // instance will be extracted from the View during the normalization and there's no need\n // to clone it.\n if (value && (value instanceof TemplateBinding || isTemplate(value) || isView(value) || isViewCollection(value))) {\n return value;\n }\n });\n return 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 def A template definition.\n * @returns Normalized definition.\n */\nfunction normalize(def) {\n if (typeof def == 'string') {\n def = normalizePlainTextDefinition(def);\n }\n else if (def.text) {\n normalizeTextDefinition(def);\n }\n if (def.on) {\n def.eventListeners = normalizeListeners(def.on);\n // Template mixes EmitterMixin, so delete #on to avoid collision.\n delete def.on;\n }\n if (!def.text) {\n if (def.attributes) {\n normalizeAttributes(def.attributes);\n }\n const children = [];\n if (def.children) {\n if (isViewCollection(def.children)) {\n children.push(def.children);\n }\n else {\n for (const child of def.children) {\n if (isTemplate(child) || isView(child) || isNode(child)) {\n children.push(child);\n }\n else {\n children.push(new Template(child));\n }\n }\n }\n }\n def.children = children;\n }\n return def;\n}\n/**\n * Normalizes \"attributes\" section of {@link module:ui/template~TemplateDefinition}.\n *\n * ```\n * attributes: {\n * \ta: 'bar',\n * \tb: {@link module:ui/template~TemplateBinding},\n * \tc: {\n * \t\tvalue: 'bar'\n * \t}\n * }\n * ```\n *\n * becomes\n *\n * ```\n * attributes: {\n * \ta: [ 'bar' ],\n * \tb: [ {@link module:ui/template~TemplateBinding} ],\n * \tc: {\n * \t\tvalue: [ 'bar' ]\n * \t}\n * }\n * ```\n */\nfunction normalizeAttributes(attributes) {\n for (const a in attributes) {\n if (attributes[a].value) {\n attributes[a].value = toArray(attributes[a].value);\n }\n arrayify(attributes, a);\n }\n}\n/**\n * Normalizes \"on\" section of {@link module:ui/template~TemplateDefinition}.\n *\n * ```\n * on: {\n * \ta: 'bar',\n * \tb: {@link module:ui/template~TemplateBinding},\n * \tc: [ {@link module:ui/template~TemplateBinding}, () => { ... } ]\n * }\n * ```\n *\n * becomes\n *\n * ```\n * on: {\n * \ta: [ 'bar' ],\n * \tb: [ {@link module:ui/template~TemplateBinding} ],\n * \tc: [ {@link module:ui/template~TemplateBinding}, () => { ... } ]\n * }\n * ```\n *\n * @returns Object containing normalized listeners.\n */\nfunction normalizeListeners(listeners) {\n for (const l in listeners) {\n arrayify(listeners, l);\n }\n return listeners;\n}\n/**\n * Normalizes \"string\" {@link module:ui/template~TemplateDefinition}.\n *\n * ```\n * \"foo\"\n * ```\n *\n * becomes\n *\n * ```\n * { text: [ 'foo' ] },\n * ```\n *\n * @returns Normalized template definition.\n */\nfunction normalizePlainTextDefinition(def) {\n return {\n text: [def]\n };\n}\n/**\n * Normalizes text {@link module:ui/template~TemplateDefinition}.\n *\n * ```\n * children: [\n * \t{ text: 'def' },\n * \t{ text: {@link module:ui/template~TemplateBinding} }\n * ]\n * ```\n *\n * becomes\n *\n * ```\n * children: [\n * \t{ text: [ 'def' ] },\n * \t{ text: [ {@link module:ui/template~TemplateBinding} ] }\n * ]\n * ```\n */\nfunction normalizeTextDefinition(def) {\n def.text = toArray(def.text);\n}\n/**\n * Wraps an entry in Object in an Array, if not already one.\n *\n * ```\n * {\n * \tx: 'y',\n * \ta: [ 'b' ]\n * }\n * ```\n *\n * becomes\n *\n * ```\n * {\n * \tx: [ 'y' ],\n * \ta: [ 'b' ]\n * }\n * ```\n */\nfunction arrayify(obj, key) {\n obj[key] = toArray(obj[key]);\n}\n/**\n * A helper which concatenates the value avoiding unwanted\n * leading white spaces.\n */\nfunction arrayValueReducer(prev, cur) {\n if (isFalsy(cur)) {\n return prev;\n }\n else if (isFalsy(prev)) {\n return cur;\n }\n else {\n return `${prev} ${cur}`;\n }\n}\n/**\n * Extends one object defined in the following format:\n *\n * ```\n * {\n * \tkey1: [Array1],\n * \tkey2: [Array2],\n * \t...\n * \tkeyN: [ArrayN]\n * }\n * ```\n *\n * with another object of the same data format.\n *\n * @param obj Base object.\n * @param ext Object extending base.\n */\nfunction extendObjectValueArray(obj, ext) {\n for (const a in ext) {\n if (obj[a]) {\n obj[a].push(...ext[a]);\n }\n else {\n obj[a] = ext[a];\n }\n }\n}\n/**\n * A helper for {@link module:ui/template~Template#extend}. Recursively extends {@link module:ui/template~Template} instance\n * with content from {@link module:ui/template~TemplateDefinition}. See {@link module:ui/template~Template#extend} to learn more.\n *\n * @param def A template instance to be extended.\n * @param def A definition which is to extend the template instance.\n * @param Error context.\n */\nfunction extendTemplate(template, def) {\n if (def.attributes) {\n if (!template.attributes) {\n template.attributes = {};\n }\n extendObjectValueArray(template.attributes, def.attributes);\n }\n if (def.eventListeners) {\n if (!template.eventListeners) {\n template.eventListeners = {};\n }\n extendObjectValueArray(template.eventListeners, def.eventListeners);\n }\n if (def.text) {\n template.text.push(...def.text);\n }\n if (def.children && def.children.length) {\n if (template.children.length != def.children.length) {\n /**\n * The number of children in extended definition does not match.\n *\n * @error ui-template-extend-children-mismatch\n */\n throw new CKEditorError('ui-template-extend-children-mismatch', template);\n }\n let childIndex = 0;\n for (const childDef of def.children) {\n extendTemplate(template.children[childIndex++], childDef);\n }\n }\n}\n/**\n * Checks if value is \"falsy\".\n * Note: 0 (Number) is not \"falsy\" in this context.\n *\n * @param value Value to be checked.\n */\nfunction isFalsy(value) {\n return !value && value !== 0;\n}\n/**\n * Checks if the item is an instance of {@link module:ui/view~View}\n *\n * @param value Value to be checked.\n */\nfunction isView(item) {\n return item instanceof View;\n}\n/**\n * Checks if the item is an instance of {@link module:ui/template~Template}\n *\n * @param value Value to be checked.\n */\nfunction isTemplate(item) {\n return item instanceof Template;\n}\n/**\n * Checks if the item is an instance of {@link module:ui/viewcollection~ViewCollection}\n *\n * @param value Value to be checked.\n */\nfunction isViewCollection(item) {\n return item instanceof ViewCollection;\n}\n/**\n * Checks if value array contains the one with namespace.\n */\nfunction isNamespaced(attrValue) {\n return isObject(attrValue[0]) && attrValue[0].ns;\n}\n/**\n * Creates an empty skeleton for {@link module:ui/template~Template#revert}\n * data.\n */\nfunction getEmptyRevertData() {\n return {\n children: [],\n bindings: [],\n attributes: {}\n };\n}\n/**\n * Checks whether an attribute should be extended when\n * {@link module:ui/template~Template#apply} is called.\n *\n * @param attrName Attribute name to check.\n */\nfunction shouldExtend(attrName) {\n return attrName == 'class' || attrName == 'style';\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/editorui/bodycollection\n */\n/* globals document */\nimport Template from '../template';\nimport ViewCollection from '../viewcollection';\nimport { createElement } from '@ckeditor/ckeditor5-utils';\n/**\n * This is a special {@link module:ui/viewcollection~ViewCollection} dedicated to elements that are detached\n * from the DOM structure of the editor, like panels, icons, etc.\n *\n * The body collection is available in the {@link module:ui/editorui/editoruiview~EditorUIView#body `editor.ui.view.body`} property.\n * Any plugin can add a {@link module:ui/view~View view} to this collection.\n * These views will render in a container placed directly in the `<body>` element.\n * The editor will detach and destroy this collection when the editor will be {@link module:core/editor/editor~Editor#destroy destroyed}.\n *\n * If you need to control the life cycle of the body collection on your own, you can create your own instance of this class.\n *\n * A body collection will render itself automatically in the DOM body element as soon as you call {@link ~BodyCollection#attachToDom}.\n * If you create multiple body collections, this class will create a special wrapper element in the DOM to limit the number of\n * elements created directly in the body and remove it when the last body collection will be\n * {@link ~BodyCollection#detachFromDom detached}.\n */\nexport default class BodyCollection extends ViewCollection {\n /**\n * Creates a new instance of the {@link module:ui/editorui/bodycollection~BodyCollection}.\n *\n * @param locale The {@link module:core/editor/editor~Editor editor's locale} instance.\n * @param initialItems The initial items of the collection.\n */\n constructor(locale, initialItems = []) {\n super(initialItems);\n this.locale = locale;\n }\n /**\n * Attaches the body collection to the DOM body element. You need to execute this method to render the content of\n * the body collection.\n */\n attachToDom() {\n this._bodyCollectionContainer = new Template({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-reset_all',\n 'ck-body',\n 'ck-rounded-corners'\n ],\n dir: this.locale.uiLanguageDirection\n },\n children: this\n }).render();\n let wrapper = document.querySelector('.ck-body-wrapper');\n if (!wrapper) {\n wrapper = createElement(document, 'div', { class: 'ck-body-wrapper' });\n document.body.appendChild(wrapper);\n }\n wrapper.appendChild(this._bodyCollectionContainer);\n }\n /**\n * Detaches the collection from the DOM structure. Use this method when you do not need to use the body collection\n * anymore to clean-up the DOM structure.\n */\n detachFromDom() {\n super.destroy();\n if (this._bodyCollectionContainer) {\n this._bodyCollectionContainer.remove();\n }\n const wrapper = document.querySelector('.ck-body-wrapper');\n if (wrapper && wrapper.childElementCount == 0) {\n wrapper.remove();\n }\n }\n}\n","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./icon.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* global DOMParser */\n/**\n * @module ui/icon/iconview\n */\nimport View from '../view';\nimport '../../theme/components/icon/icon.css';\n/**\n * The icon view class.\n */\nexport default class IconView extends View {\n /**\n * @inheritDoc\n */\n constructor() {\n super();\n const bind = this.bindTemplate;\n this.set('content', '');\n this.set('viewBox', '0 0 20 20');\n this.set('fillColor', '');\n this.set('isColorInherited', true);\n this.setTemplate({\n tag: 'svg',\n ns: 'http://www.w3.org/2000/svg',\n attributes: {\n class: [\n 'ck',\n 'ck-icon',\n // Exclude icon internals from the CSS reset to allow rich (non-monochromatic) icons\n // (https://github.com/ckeditor/ckeditor5/issues/12599).\n 'ck-reset_all-excluded',\n // The class to remove the dynamic color inheritance is toggleable\n // (https://github.com/ckeditor/ckeditor5/issues/12599).\n bind.if('isColorInherited', 'ck-icon_inherit-color')\n ],\n viewBox: bind.to('viewBox')\n }\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this._updateXMLContent();\n this._colorFillPaths();\n // This is a hack for lack of innerHTML binding.\n // See: https://github.com/ckeditor/ckeditor5-ui/issues/99.\n this.on('change:content', () => {\n this._updateXMLContent();\n this._colorFillPaths();\n });\n this.on('change:fillColor', () => {\n this._colorFillPaths();\n });\n }\n /**\n * Updates the {@link #element} with the value of {@link #content}.\n */\n _updateXMLContent() {\n if (this.content) {\n const parsed = new DOMParser().parseFromString(this.content.trim(), 'image/svg+xml');\n const svg = parsed.querySelector('svg');\n const viewBox = svg.getAttribute('viewBox');\n if (viewBox) {\n this.viewBox = viewBox;\n }\n // Preserve presentational attributes of the <svg> element from the source.\n // They can affect rendering of the entire icon (https://github.com/ckeditor/ckeditor5/issues/12597).\n for (const { name, value } of Array.from(svg.attributes)) {\n if (IconView.presentationalAttributeNames.includes(name)) {\n this.element.setAttribute(name, value);\n }\n }\n while (this.element.firstChild) {\n this.element.removeChild(this.element.firstChild);\n }\n while (svg.childNodes.length > 0) {\n this.element.appendChild(svg.childNodes[0]);\n }\n }\n }\n /**\n * Fills all child `path.ck-icon__fill` with the `#fillColor`.\n */\n _colorFillPaths() {\n if (this.fillColor) {\n this.element.querySelectorAll('.ck-icon__fill').forEach(path => {\n path.style.fill = this.fillColor;\n });\n }\n }\n}\n/**\n * A list of presentational attributes that can be set on the `<svg>` element and should be preserved\n * when the icon {@link module:ui/icon/iconview~IconView#content content} is loaded.\n *\n * See the [specification](https://www.w3.org/TR/SVG/styling.html#TermPresentationAttribute) to learn more.\n */\nIconView.presentationalAttributeNames = [\n 'alignment-baseline', 'baseline-shift', 'clip-path', 'clip-rule', 'color', 'color-interpolation',\n 'color-interpolation-filters', 'color-rendering', 'cursor', 'direction', 'display', 'dominant-baseline', 'fill', 'fill-opacity',\n 'fill-rule', 'filter', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style',\n 'font-variant', 'font-weight', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start',\n 'mask', 'opacity', 'overflow', 'paint-order', 'pointer-events', 'shape-rendering', 'stop-color', 'stop-opacity', 'stroke',\n 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width',\n 'text-anchor', 'text-decoration', 'text-overflow', 'text-rendering', 'transform', 'unicode-bidi', 'vector-effect',\n 'visibility', 'white-space', 'word-spacing', 'writing-mode'\n];\n","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./button.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/button/buttonview\n */\nimport View from '../view';\nimport IconView from '../icon/iconview';\nimport { env, getEnvKeystrokeText, uid, delay } from '@ckeditor/ckeditor5-utils';\nimport '../../theme/components/button/button.css';\n/**\n * The button view class.\n *\n * ```ts\n * const view = new ButtonView();\n *\n * view.set( {\n * \tlabel: 'A button',\n * \tkeystroke: 'Ctrl+B',\n * \ttooltip: true,\n * \twithText: true\n * } );\n *\n * view.render();\n *\n * document.body.append( view.element );\n * ```\n */\nexport default class ButtonView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n /**\n * Delayed focus function for focus handling in Safari.\n */\n this._focusDelayed = null;\n const bind = this.bindTemplate;\n const ariaLabelUid = uid();\n // Implement the Button interface.\n this.set('ariaChecked', undefined);\n this.set('ariaLabel', undefined);\n this.set('ariaLabelledBy', `ck-editor__aria-label_${ariaLabelUid}`);\n this.set('class', undefined);\n this.set('labelStyle', undefined);\n this.set('icon', undefined);\n this.set('isEnabled', true);\n this.set('isOn', false);\n this.set('isVisible', true);\n this.set('isToggleable', false);\n this.set('keystroke', undefined);\n this.set('label', undefined);\n this.set('role', undefined);\n this.set('tabindex', -1);\n this.set('tooltip', false);\n this.set('tooltipPosition', 's');\n this.set('type', 'button');\n this.set('withText', false);\n this.set('withKeystroke', false);\n this.children = this.createCollection();\n this.labelView = this._createLabelView();\n this.iconView = new IconView();\n this.iconView.extendTemplate({\n attributes: {\n class: 'ck-button__icon'\n }\n });\n this.keystrokeView = this._createKeystrokeView();\n this.bind('_tooltipString').to(this, 'tooltip', this, 'label', this, 'keystroke', this._getTooltipString.bind(this));\n const template = {\n tag: 'button',\n attributes: {\n class: [\n 'ck',\n 'ck-button',\n bind.to('class'),\n bind.if('isEnabled', 'ck-disabled', value => !value),\n bind.if('isVisible', 'ck-hidden', value => !value),\n bind.to('isOn', value => value ? 'ck-on' : 'ck-off'),\n bind.if('withText', 'ck-button_with-text'),\n bind.if('withKeystroke', 'ck-button_with-keystroke')\n ],\n role: bind.to('role'),\n type: bind.to('type', value => value ? value : 'button'),\n tabindex: bind.to('tabindex'),\n 'aria-label': bind.to('ariaLabel'),\n 'aria-labelledby': bind.to('ariaLabelledBy'),\n 'aria-disabled': bind.if('isEnabled', true, value => !value),\n 'aria-checked': bind.to('isOn'),\n 'aria-pressed': bind.to('isOn', value => this.isToggleable ? String(!!value) : false),\n 'data-cke-tooltip-text': bind.to('_tooltipString'),\n 'data-cke-tooltip-position': bind.to('tooltipPosition')\n },\n children: this.children,\n on: {\n click: bind.to(evt => {\n // We can't make the button disabled using the disabled attribute, because it won't be focusable.\n // Though, shouldn't this condition be moved to the button controller?\n if (this.isEnabled) {\n this.fire('execute');\n }\n else {\n // Prevent the default when button is disabled, to block e.g.\n // automatic form submitting. See ckeditor/ckeditor5-link#74.\n evt.preventDefault();\n }\n })\n }\n };\n // On Safari we have to force the focus on a button on click as it's the only browser\n // that doesn't do that automatically. See #12115.\n if (env.isSafari) {\n if (!this._focusDelayed) {\n this._focusDelayed = delay(() => this.focus(), 0);\n }\n template.on.mousedown = bind.to(() => {\n this._focusDelayed();\n });\n template.on.mouseup = bind.to(() => {\n this._focusDelayed.cancel();\n });\n }\n this.setTemplate(template);\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n if (this.icon) {\n this.iconView.bind('content').to(this, 'icon');\n this.children.add(this.iconView);\n }\n this.children.add(this.labelView);\n if (this.withKeystroke && this.keystroke) {\n this.children.add(this.keystrokeView);\n }\n }\n /**\n * Focuses the {@link #element} of the button.\n */\n focus() {\n this.element.focus();\n }\n /**\n * @inheritDoc\n */\n destroy() {\n if (this._focusDelayed) {\n this._focusDelayed.cancel();\n }\n super.destroy();\n }\n /**\n * Creates a label view instance and binds it with button attributes.\n */\n _createLabelView() {\n const labelView = new View();\n const bind = this.bindTemplate;\n labelView.setTemplate({\n tag: 'span',\n attributes: {\n class: [\n 'ck',\n 'ck-button__label'\n ],\n style: bind.to('labelStyle'),\n id: this.ariaLabelledBy\n },\n children: [\n {\n text: bind.to('label')\n }\n ]\n });\n return labelView;\n }\n /**\n * Creates a view that displays a keystroke next to a {@link #labelView label }\n * and binds it with button attributes.\n */\n _createKeystrokeView() {\n const keystrokeView = new View();\n keystrokeView.setTemplate({\n tag: 'span',\n attributes: {\n class: [\n 'ck',\n 'ck-button__keystroke'\n ]\n },\n children: [\n {\n text: this.bindTemplate.to('keystroke', text => getEnvKeystrokeText(text))\n }\n ]\n });\n return keystrokeView;\n }\n /**\n * Gets the text for the tooltip from the combination of\n * {@link #tooltip}, {@link #label} and {@link #keystroke} attributes.\n *\n * @see #tooltip\n * @see #_tooltipString\n * @param tooltip Button tooltip.\n * @param label Button label.\n * @param keystroke Button keystroke.\n */\n _getTooltipString(tooltip, label, keystroke) {\n if (tooltip) {\n if (typeof tooltip == 'string') {\n return tooltip;\n }\n else {\n if (keystroke) {\n keystroke = getEnvKeystrokeText(keystroke);\n }\n if (tooltip instanceof Function) {\n return tooltip(label, keystroke);\n }\n else {\n return `${label}${keystroke ? ` (${keystroke})` : ''}`;\n }\n }\n }\n return '';\n }\n}\n","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./switchbutton.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/button/switchbuttonview\n */\nimport View from '../view';\nimport ButtonView from './buttonview';\nimport '../../theme/components/button/switchbutton.css';\n/**\n * The switch button view class.\n *\n * ```ts\n * const view = new SwitchButtonView();\n *\n * view.set( {\n * \twithText: true,\n * \tlabel: 'Switch me!'\n * } );\n *\n * view.render();\n *\n * document.body.append( view.element );\n * ```\n */\nexport default class SwitchButtonView extends ButtonView {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.isToggleable = true;\n this.toggleSwitchView = this._createToggleView();\n this.extendTemplate({\n attributes: {\n class: 'ck-switchbutton'\n }\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.children.add(this.toggleSwitchView);\n }\n /**\n * Creates a toggle child view.\n */\n _createToggleView() {\n const toggleSwitchView = new View();\n toggleSwitchView.setTemplate({\n tag: 'span',\n attributes: {\n class: [\n 'ck',\n 'ck-button__toggle'\n ]\n },\n children: [\n {\n tag: 'span',\n attributes: {\n class: [\n 'ck',\n 'ck-button__toggle__inner'\n ]\n }\n }\n ]\n });\n return toggleSwitchView;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Returns color configuration options as defined in `editor.config.(fontColor|fontBackgroundColor).colors` or\n * `editor.config.table.(tableProperties|tableCellProperties).(background|border).colors\n * but processed to account for editor localization in the correct language.\n *\n * Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}\n * when the user configuration is defined because the editor does not exist yet.\n *\n * @param locale The {@link module:core/editor/editor~Editor#locale} instance.\n */\nexport function getLocalizedColorOptions(locale, options) {\n const t = locale.t;\n const localizedColorNames = {\n Black: t('Black'),\n 'Dim grey': t('Dim grey'),\n Grey: t('Grey'),\n 'Light grey': t('Light grey'),\n White: t('White'),\n Red: t('Red'),\n Orange: t('Orange'),\n Yellow: t('Yellow'),\n 'Light green': t('Light green'),\n Green: t('Green'),\n Aquamarine: t('Aquamarine'),\n Turquoise: t('Turquoise'),\n 'Light blue': t('Light blue'),\n Blue: t('Blue'),\n Purple: t('Purple')\n };\n return options.map(colorOption => {\n const label = localizedColorNames[colorOption.label];\n if (label && label != colorOption.label) {\n colorOption.label = label;\n }\n return colorOption;\n });\n}\n/**\n * Creates a unified color definition object from color configuration options.\n * The object contains the information necessary to both render the UI and initialize the conversion.\n */\nexport function normalizeColorOptions(options) {\n return options\n .map(normalizeSingleColorDefinition)\n .filter(option => !!option);\n}\n/**\n * Creates a normalized color definition from the user-defined configuration.\n * The \"normalization\" means it will create full\n * {@link module:ui/colorgrid/colorgridview~ColorDefinition `ColorDefinition-like`}\n * object for string values, and add a `view` property, for each definition.\n */\nexport function normalizeSingleColorDefinition(color) {\n if (typeof color === 'string') {\n return {\n model: color,\n label: color,\n hasBorder: false,\n view: {\n name: 'span',\n styles: {\n color\n }\n }\n };\n }\n else {\n return {\n model: color.color,\n label: color.label || color.color,\n hasBorder: color.hasBorder === undefined ? false : color.hasBorder,\n view: {\n name: 'span',\n styles: {\n color: `${color.color}`\n }\n }\n };\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/colorgrid/colortileview\n */\nimport ButtonView from '../button/buttonview';\nimport checkIcon from '../../theme/icons/color-tile-check.svg';\n/**\n * This class represents a single color tile in the {@link module:ui/colorgrid/colorgridview~ColorGridView}.\n */\nexport default class ColorTileView extends ButtonView {\n constructor(locale) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('color', undefined);\n this.set('hasBorder', false);\n this.icon = checkIcon;\n this.extendTemplate({\n attributes: {\n style: {\n backgroundColor: bind.to('color')\n },\n class: [\n 'ck',\n 'ck-color-grid__tile',\n bind.if('hasBorder', 'ck-color-table__color-tile_bordered')\n ]\n }\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.iconView.fillColor = 'hsl(0, 0%, 100%)';\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path class=\\\"ck-icon__fill\\\" d=\\\"M16.935 5.328a2 2 0 0 1 0 2.829l-7.778 7.778a2 2 0 0 1-2.829 0L3.5 13.107a1.999 1.999 0 1 1 2.828-2.829l.707.707a1 1 0 0 0 1.414 0l5.658-5.657a2 2 0 0 1 2.828 0z\\\"/><path d=\\\"M14.814 6.035 8.448 12.4a1 1 0 0 1-1.414 0l-1.413-1.415A1 1 0 1 0 4.207 12.4l2.829 2.829a1 1 0 0 0 1.414 0l7.778-7.778a1 1 0 1 0-1.414-1.415z\\\"/></svg>\";","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./colorgrid.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/colorgrid/colorgridview\n */\nimport View from '../view';\nimport ColorTileView from './colortileview';\nimport addKeyboardHandlingForGrid from '../bindings/addkeyboardhandlingforgrid';\nimport { FocusTracker, KeystrokeHandler } from '@ckeditor/ckeditor5-utils';\nimport '../../theme/components/colorgrid/colorgrid.css';\n/**\n * A grid of {@link module:ui/colorgrid/colortileview~ColorTileView color tiles}.\n */\nexport default class ColorGridView extends View {\n /**\n * Creates an instance of a color grid containing {@link module:ui/colorgrid/colortileview~ColorTileView tiles}.\n *\n * @fires execute\n * @param locale The localization services instance.\n * @param options Component configuration\n * @param options.colorDefinitions Array with definitions\n * required to create the {@link module:ui/colorgrid/colortileview~ColorTileView tiles}.\n * @param options.columns A number of columns to display the tiles.\n */\n constructor(locale, options) {\n super(locale);\n const colorDefinitions = options && options.colorDefinitions ? options.colorDefinitions : [];\n this.columns = options && options.columns ? options.columns : 5;\n const viewStyleAttribute = {\n gridTemplateColumns: `repeat( ${this.columns}, 1fr)`\n };\n this.set('selectedColor', undefined);\n this.items = this.createCollection();\n this.focusTracker = new FocusTracker();\n this.keystrokes = new KeystrokeHandler();\n this.items.on('add', (evt, colorTile) => {\n colorTile.isOn = colorTile.color === this.selectedColor;\n });\n colorDefinitions.forEach(color => {\n const colorTile = new ColorTileView();\n colorTile.set({\n color: color.color,\n label: color.label,\n tooltip: true,\n hasBorder: color.options.hasBorder\n });\n colorTile.on('execute', () => {\n this.fire('execute', {\n value: color.color,\n hasBorder: color.options.hasBorder,\n label: color.label\n });\n });\n this.items.add(colorTile);\n });\n this.setTemplate({\n tag: 'div',\n children: this.items,\n attributes: {\n class: [\n 'ck',\n 'ck-color-grid'\n ],\n style: viewStyleAttribute\n }\n });\n this.on('change:selectedColor', (evt, name, selectedColor) => {\n for (const item of this.items) {\n item.isOn = item.color === selectedColor;\n }\n });\n }\n /**\n * Focuses the first focusable in {@link #items}.\n */\n focus() {\n if (this.items.length) {\n this.items.first.focus();\n }\n }\n /**\n * Focuses the last focusable in {@link #items}.\n */\n focusLast() {\n if (this.items.length) {\n this.items.last.focus();\n }\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n // Items added before rendering should be known to the #focusTracker.\n for (const item of this.items) {\n this.focusTracker.add(item.element);\n }\n this.items.on('add', (evt, item) => {\n this.focusTracker.add(item.element);\n });\n this.items.on('remove', (evt, item) => {\n this.focusTracker.remove(item.element);\n });\n // Start listening for the keystrokes coming from #element.\n this.keystrokes.listenTo(this.element);\n addKeyboardHandlingForGrid({\n keystrokeHandler: this.keystrokes,\n focusTracker: this.focusTracker,\n gridItems: this.items,\n numberOfColumns: this.columns,\n uiLanguageDirection: this.locale && this.locale.uiLanguageDirection\n });\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n}\n","/**\r\n * @module color-parse\r\n */\r\nimport names from 'color-name'\r\n\r\nexport default parse\r\n\r\n/**\r\n * Base hues\r\n * http://dev.w3.org/csswg/css-color/#typedef-named-hue\r\n */\r\n//FIXME: use external hue detector\r\nvar baseHues = {\r\n\tred: 0,\r\n\torange: 60,\r\n\tyellow: 120,\r\n\tgreen: 180,\r\n\tblue: 240,\r\n\tpurple: 300\r\n}\r\n\r\n/**\r\n * Parse color from the string passed\r\n *\r\n * @return {Object} A space indicator `space`, an array `values` and `alpha`\r\n */\r\nfunction parse (cstr) {\r\n\tvar m, parts = [], alpha = 1, space\r\n\r\n\tif (typeof cstr === 'string') {\r\n\t\t//keyword\r\n\t\tif (names[cstr]) {\r\n\t\t\tparts = names[cstr].slice()\r\n\t\t\tspace = 'rgb'\r\n\t\t}\r\n\r\n\t\t//reserved words\r\n\t\telse if (cstr === 'transparent') {\r\n\t\t\talpha = 0\r\n\t\t\tspace = 'rgb'\r\n\t\t\tparts = [0,0,0]\r\n\t\t}\r\n\r\n\t\t//hex\r\n\t\telse if (/^#[A-Fa-f0-9]+$/.test(cstr)) {\r\n\t\t\tvar base = cstr.slice(1)\r\n\t\t\tvar size = base.length\r\n\t\t\tvar isShort = size <= 4\r\n\t\t\talpha = 1\r\n\r\n\t\t\tif (isShort) {\r\n\t\t\t\tparts = [\r\n\t\t\t\t\tparseInt(base[0] + base[0], 16),\r\n\t\t\t\t\tparseInt(base[1] + base[1], 16),\r\n\t\t\t\t\tparseInt(base[2] + base[2], 16)\r\n\t\t\t\t]\r\n\t\t\t\tif (size === 4) {\r\n\t\t\t\t\talpha = parseInt(base[3] + base[3], 16) / 255\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tparts = [\r\n\t\t\t\t\tparseInt(base[0] + base[1], 16),\r\n\t\t\t\t\tparseInt(base[2] + base[3], 16),\r\n\t\t\t\t\tparseInt(base[4] + base[5], 16)\r\n\t\t\t\t]\r\n\t\t\t\tif (size === 8) {\r\n\t\t\t\t\talpha = parseInt(base[6] + base[7], 16) / 255\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!parts[0]) parts[0] = 0\r\n\t\t\tif (!parts[1]) parts[1] = 0\r\n\t\t\tif (!parts[2]) parts[2] = 0\r\n\r\n\t\t\tspace = 'rgb'\r\n\t\t}\r\n\r\n\t\t//color space\r\n\t\telse if (m = /^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\\s*\\(([^\\)]*)\\)/.exec(cstr)) {\r\n\t\t\tvar name = m[1]\r\n\t\t\tvar isRGB = name === 'rgb'\r\n\t\t\tvar base = name.replace(/a$/, '')\r\n\t\t\tspace = base\r\n\t\t\tvar size = base === 'cmyk' ? 4 : base === 'gray' ? 1 : 3\r\n\t\t\tparts = m[2].trim()\r\n\t\t\t\t.split(/\\s*[,\\/]\\s*|\\s+/)\r\n\t\t\t\t.map(function (x, i) {\r\n\t\t\t\t\t//<percentage>\r\n\t\t\t\t\tif (/%$/.test(x)) {\r\n\t\t\t\t\t\t//alpha\r\n\t\t\t\t\t\tif (i === size)\treturn parseFloat(x) / 100\r\n\t\t\t\t\t\t//rgb\r\n\t\t\t\t\t\tif (base === 'rgb') return parseFloat(x) * 255 / 100\r\n\t\t\t\t\t\treturn parseFloat(x)\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//hue\r\n\t\t\t\t\telse if (base[i] === 'h') {\r\n\t\t\t\t\t\t//<deg>\r\n\t\t\t\t\t\tif (/deg$/.test(x)) {\r\n\t\t\t\t\t\t\treturn parseFloat(x)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//<base-hue>\r\n\t\t\t\t\t\telse if (baseHues[x] !== undefined) {\r\n\t\t\t\t\t\t\treturn baseHues[x]\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn parseFloat(x)\r\n\t\t\t\t})\r\n\r\n\t\t\tif (name === base) parts.push(1)\r\n\t\t\talpha = (isRGB) ? 1 : (parts[size] === undefined) ? 1 : parts[size]\r\n\t\t\tparts = parts.slice(0, size)\r\n\t\t}\r\n\r\n\t\t//named channels case\r\n\t\telse if (cstr.length > 10 && /[0-9](?:\\s|\\/)/.test(cstr)) {\r\n\t\t\tparts = cstr.match(/([0-9]+)/g).map(function (value) {\r\n\t\t\t\treturn parseFloat(value)\r\n\t\t\t})\r\n\r\n\t\t\tspace = cstr.match(/([a-z])/ig).join('').toLowerCase()\r\n\t\t}\r\n\t}\r\n\r\n\t//numeric case\r\n\telse if (!isNaN(cstr)) {\r\n\t\tspace = 'rgb'\r\n\t\tparts = [cstr >>> 16, (cstr & 0x00ff00) >>> 8, cstr & 0x0000ff]\r\n\t}\r\n\r\n\t//array-like\r\n\telse if (Array.isArray(cstr) || cstr.length) {\r\n\t\tparts = [cstr[0], cstr[1], cstr[2]]\r\n\t\tspace = 'rgb'\r\n\t\talpha = cstr.length === 4 ? cstr[3] : 1\r\n\t}\r\n\r\n\t//object case - detects css cases of rgb and hsl\r\n\telse if (cstr instanceof Object) {\r\n\t\tif (cstr.r != null || cstr.red != null || cstr.R != null) {\r\n\t\t\tspace = 'rgb'\r\n\t\t\tparts = [\r\n\t\t\t\tcstr.r || cstr.red || cstr.R || 0,\r\n\t\t\t\tcstr.g || cstr.green || cstr.G || 0,\r\n\t\t\t\tcstr.b || cstr.blue || cstr.B || 0\r\n\t\t\t]\r\n\t\t}\r\n\t\telse {\r\n\t\t\tspace = 'hsl'\r\n\t\t\tparts = [\r\n\t\t\t\tcstr.h || cstr.hue || cstr.H || 0,\r\n\t\t\t\tcstr.s || cstr.saturation || cstr.S || 0,\r\n\t\t\t\tcstr.l || cstr.lightness || cstr.L || cstr.b || cstr.brightness\r\n\t\t\t]\r\n\t\t}\r\n\r\n\t\talpha = cstr.a || cstr.alpha || cstr.opacity || 1\r\n\r\n\t\tif (cstr.opacity != null) alpha /= 100\r\n\t}\r\n\r\n\treturn {\r\n\t\tspace: space,\r\n\t\tvalues: parts,\r\n\t\talpha: alpha\r\n\t}\r\n}\r\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/colorpicker/utils\n */\n/* eslint-disable @typescript-eslint/ban-ts-comment */\n// There are no available types for 'color-parse' module.\n// @ts-ignore\nimport { default as parse } from 'color-parse';\nimport * as convert from 'color-convert';\n/**\n * Parses and converts the color string to requested format. Handles variety of color spaces\n * like `hsl`, `hex` or `rgb`.\n *\n * @param color\n * @returns A color string.\n */\nexport function convertColor(color, outputFormat) {\n if (!color) {\n return '';\n }\n const colorObject = parseColorString(color);\n if (!colorObject) {\n return '';\n }\n if (colorObject.space === outputFormat) {\n return color;\n }\n if (!canConvertParsedColor(colorObject)) {\n return '';\n }\n const fromColorSpace = convert[colorObject.space];\n const toColorSpace = fromColorSpace[outputFormat];\n if (!toColorSpace) {\n return '';\n }\n const convertedColorChannels = toColorSpace(colorObject.space === 'hex' ? colorObject.hexValue : colorObject.values);\n return formatColorOutput(convertedColorChannels, outputFormat);\n}\n/**\n * Converts a color string to hex format.\n *\n * @param color\n * @returns A color string.\n */\nexport function convertToHex(color) {\n if (!color) {\n return '';\n }\n const colorObject = parseColorString(color);\n if (!colorObject) {\n return '#000';\n }\n if (colorObject.space === 'hex') {\n return colorObject.hexValue;\n }\n return convertColor(color, 'hex');\n}\n/**\n * Formats the passed color channels according to the requested format.\n *\n * @param values\n * @param format\n * @returns A color string.\n */\nfunction formatColorOutput(values, format) {\n switch (format) {\n case 'hex': return `#${values}`;\n case 'rgb': return `rgb( ${values[0]}, ${values[1]}, ${values[2]} )`;\n case 'hsl': return `hsl( ${values[0]}, ${values[1]}%, ${values[2]}% )`;\n case 'hwb': return `hwb( ${values[0]}, ${values[1]}, ${values[2]} )`;\n case 'lab': return `lab( ${values[0]}% ${values[1]} ${values[2]} )`;\n case 'lch': return `lch( ${values[0]}% ${values[1]} ${values[2]} )`;\n default: return '';\n }\n}\nfunction parseColorString(colorString) {\n // Parser library treats `hex` format as belonging to `rgb` space | which messes up further conversion.\n // Let's parse such strings on our own.\n if (colorString.startsWith('#')) {\n const parsedHex = parse(colorString);\n return {\n space: 'hex',\n values: parsedHex.values,\n hexValue: colorString,\n alpha: parsedHex.alpha\n };\n }\n const parsed = parse(colorString);\n if (!parsed.space) {\n return null;\n }\n return parsed;\n}\nfunction canConvertParsedColor(parsedColor) {\n return Object.keys(convert).includes(parsedColor.space);\n}\n","import root from './_root.js';\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nexport default now;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nexport default trimmedEndIndex;\n","import trimmedEndIndex from './_trimmedEndIndex.js';\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nexport default baseTrim;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\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 a symbol, 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) && baseGetTag(value) == symbolTag);\n}\n\nexport default isSymbol;\n","import baseTrim from './_baseTrim.js';\nimport isObject from './isObject.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nexport default toNumber;\n","import isObject from './isObject.js';\nimport now from './now.js';\nimport toNumber from './toNumber.js';\n\n/** Error message constants. */\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 `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\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,\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 timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\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 === undefined || (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 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 lastInvokeTime = 0;\n lastArgs = lastCallTime = 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","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./label.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/label/labelview\n */\nimport View from '../view';\nimport { uid } from '@ckeditor/ckeditor5-utils';\nimport '../../theme/components/label/label.css';\n/**\n * The label view class.\n */\nexport default class LabelView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.set('text', undefined);\n this.set('for', undefined);\n this.id = `ck-editor__label_${uid()}`;\n const bind = this.bindTemplate;\n this.setTemplate({\n tag: 'label',\n attributes: {\n class: [\n 'ck',\n 'ck-label'\n ],\n id: this.id,\n for: bind.to('for')\n },\n children: [\n {\n text: bind.to('text')\n }\n ]\n });\n }\n}\n","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./labeledfieldview.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/labeledfield/labeledfieldview\n */\nimport View from '../view';\nimport LabelView from '../label/labelview';\nimport { uid } from '@ckeditor/ckeditor5-utils';\nimport '../../theme/components/labeledfield/labeledfieldview.css';\n/**\n * The labeled field view class. It can be used to enhance any view with the following features:\n *\n * * a label,\n * * (optional) an error message,\n * * (optional) an info (status) text,\n *\n * all bound logically by proper DOM attributes for UX and accessibility. It also provides an interface\n * (e.g. observable properties) that allows controlling those additional features.\n *\n * The constructor of this class requires a callback that returns a view to be labeled. The callback\n * is called with unique ids that allow binding of DOM properties:\n *\n * ```ts\n * const labeledInputView = new LabeledFieldView( locale, ( labeledFieldView, viewUid, statusUid ) => {\n * \tconst inputView = new InputTextView( labeledFieldView.locale );\n *\n * \tinputView.set( {\n * \t\tid: viewUid,\n * \t\tariaDescribedById: statusUid\n * \t} );\n *\n * \tinputView.bind( 'isReadOnly' ).to( labeledFieldView, 'isEnabled', value => !value );\n * \tinputView.bind( 'hasError' ).to( labeledFieldView, 'errorText', value => !!value );\n *\n * \treturn inputView;\n * } );\n *\n * labeledInputView.label = 'User name';\n * labeledInputView.infoText = 'Full name like for instance, John Doe.';\n * labeledInputView.render();\n *\n * document.body.append( labeledInputView.element );\n * ```\n *\n * See {@link module:ui/labeledfield/utils} to discover readytouse labeled input helpers for common\n * UI components.\n */\nexport default class LabeledFieldView extends View {\n /**\n * Creates an instance of the labeled field view class using a provided creator function\n * that provides the view to be labeled.\n *\n * @param locale The locale instance.\n * @param viewCreator A function that returns a {@link module:ui/view~View}\n * that will be labeled. The following arguments are passed to the creator function:\n *\n * * an instance of the `LabeledFieldView` to allow binding observable properties,\n * * an UID string that connects the {@link #labelView label} and the labeled field view in DOM,\n * * an UID string that connects the {@link #statusView status} and the labeled field view in DOM.\n */\n constructor(locale, viewCreator) {\n super(locale);\n const viewUid = `ck-labeled-field-view-${uid()}`;\n const statusUid = `ck-labeled-field-view-status-${uid()}`;\n this.fieldView = viewCreator(this, viewUid, statusUid);\n this.set('label', undefined);\n this.set('isEnabled', true);\n this.set('isEmpty', true);\n this.set('isFocused', false);\n this.set('errorText', null);\n this.set('infoText', null);\n this.set('class', undefined);\n this.set('placeholder', undefined);\n this.labelView = this._createLabelView(viewUid);\n this.statusView = this._createStatusView(statusUid);\n this.fieldWrapperChildren = this.createCollection([this.fieldView, this.labelView]);\n this.bind('_statusText').to(this, 'errorText', this, 'infoText', (errorText, infoText) => errorText || infoText);\n const bind = this.bindTemplate;\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-labeled-field-view',\n bind.to('class'),\n bind.if('isEnabled', 'ck-disabled', value => !value),\n bind.if('isEmpty', 'ck-labeled-field-view_empty'),\n bind.if('isFocused', 'ck-labeled-field-view_focused'),\n bind.if('placeholder', 'ck-labeled-field-view_placeholder'),\n bind.if('errorText', 'ck-error')\n ]\n },\n children: [\n {\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-labeled-field-view__input-wrapper'\n ]\n },\n children: this.fieldWrapperChildren\n },\n this.statusView\n ]\n });\n }\n /**\n * Creates label view class instance and bind with view.\n *\n * @param id Unique id to set as labelView#for attribute.\n */\n _createLabelView(id) {\n const labelView = new LabelView(this.locale);\n labelView.for = id;\n labelView.bind('text').to(this, 'label');\n return labelView;\n }\n /**\n * Creates the status view instance. It displays {@link #errorText} and {@link #infoText}\n * next to the {@link #fieldView}. See {@link #_statusText}.\n *\n * @param statusUid Unique id of the status, shared with the {@link #fieldView view's}\n * `aria-describedby` attribute.\n */\n _createStatusView(statusUid) {\n const statusView = new View(this.locale);\n const bind = this.bindTemplate;\n statusView.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-labeled-field-view__status',\n bind.if('errorText', 'ck-labeled-field-view__status_error'),\n bind.if('_statusText', 'ck-hidden', value => !value)\n ],\n id: statusUid,\n role: bind.if('errorText', 'alert')\n },\n children: [\n {\n text: bind.to('_statusText')\n }\n ]\n });\n return statusView;\n }\n /**\n * Focuses the {@link #fieldView}.\n */\n focus() {\n this.fieldView.focus();\n }\n}\n","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./input.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/input/inputview\n */\nimport View from '../view';\nimport { FocusTracker } from '@ckeditor/ckeditor5-utils';\nimport '../../theme/components/input/input.css';\n/**\n * The base input view class.\n */\nexport default class InputView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.set('value', undefined);\n this.set('id', undefined);\n this.set('placeholder', undefined);\n this.set('isReadOnly', false);\n this.set('hasError', false);\n this.set('ariaDescribedById', undefined);\n this.focusTracker = new FocusTracker();\n this.bind('isFocused').to(this.focusTracker);\n this.set('isEmpty', true);\n this.set('inputMode', 'text');\n const bind = this.bindTemplate;\n this.setTemplate({\n tag: 'input',\n attributes: {\n class: [\n 'ck',\n 'ck-input',\n bind.if('isFocused', 'ck-input_focused'),\n bind.if('isEmpty', 'ck-input-text_empty'),\n bind.if('hasError', 'ck-error')\n ],\n id: bind.to('id'),\n placeholder: bind.to('placeholder'),\n readonly: bind.to('isReadOnly'),\n inputmode: bind.to('inputMode'),\n 'aria-invalid': bind.if('hasError', true),\n 'aria-describedby': bind.to('ariaDescribedById')\n },\n on: {\n input: bind.to((...args) => {\n this.fire('input', ...args);\n this._updateIsEmpty();\n }),\n change: bind.to(this._updateIsEmpty.bind(this))\n }\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.focusTracker.add(this.element);\n this._setDomElementValue(this.value);\n this._updateIsEmpty();\n // Bind `this.value` to the DOM element's value.\n // We cannot use `value` DOM attribute because removing it on Edge does not clear the DOM element's value property.\n this.on('change:value', (evt, name, value) => {\n this._setDomElementValue(value);\n this._updateIsEmpty();\n });\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n }\n /**\n * Moves the focus to the input and selects the value.\n */\n select() {\n this.element.select();\n }\n /**\n * Focuses the input.\n */\n focus() {\n this.element.focus();\n }\n /**\n * Updates the {@link #isEmpty} property value on demand.\n */\n _updateIsEmpty() {\n this.isEmpty = isInputElementEmpty(this.element);\n }\n /**\n * Sets the `value` property of the {@link #element DOM element} on demand.\n */\n _setDomElementValue(value) {\n this.element.value = (!value && value !== 0) ? '' : value;\n }\n}\nfunction isInputElementEmpty(domElement) {\n return !domElement.value;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/inputtext/inputtextview\n */\nimport InputView from '../input/inputview';\n/**\n * The text input view class.\n */\nexport default class InputTextView extends InputView {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.extendTemplate({\n attributes: {\n type: 'text',\n class: [\n 'ck-input-text'\n ]\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/inputnumber/inputnumberview\n */\nimport InputView from '../input/inputview';\n/**\n * The number input view class.\n */\nexport default class InputNumberView extends InputView {\n /**\n * Creates an instance of the input number view.\n *\n * @param locale The {@link module:core/editor/editor~Editor#locale} instance.\n * @param options The options of the input.\n * @param options.min The value of the `min` DOM attribute (the lowest accepted value).\n * @param options.max The value of the `max` DOM attribute (the highest accepted value).\n * @param options.step The value of the `step` DOM attribute.\n */\n constructor(locale, { min, max, step } = {}) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('min', min);\n this.set('max', max);\n this.set('step', step);\n this.extendTemplate({\n attributes: {\n type: 'number',\n class: [\n 'ck-input-number'\n ],\n min: bind.to('min'),\n max: bind.to('max'),\n step: bind.to('step')\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/dropdown/dropdownpanelview\n */\nimport View from '../view';\nimport { logWarning } from '@ckeditor/ckeditor5-utils';\n/**\n * The dropdown panel view class.\n *\n * See {@link module:ui/dropdown/dropdownview~DropdownView} to learn about the common usage.\n */\nexport default class DropdownPanelView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('isVisible', false);\n this.set('position', 'se');\n this.children = this.createCollection();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-reset',\n 'ck-dropdown__panel',\n bind.to('position', value => `ck-dropdown__panel_${value}`),\n bind.if('isVisible', 'ck-dropdown__panel-visible')\n ]\n },\n children: this.children,\n on: {\n // Drag and drop in the panel should not break the selection in the editor.\n // https://github.com/ckeditor/ckeditor5-ui/issues/228\n selectstart: bind.to(evt => {\n if (evt.target.tagName.toLocaleLowerCase() === 'input') {\n return;\n }\n evt.preventDefault();\n })\n }\n });\n }\n /**\n * Focuses the first view in the {@link #children} collection.\n *\n * See also {@link module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable}.\n */\n focus() {\n if (this.children.length) {\n const firstChild = this.children.first;\n if (typeof firstChild.focus === 'function') {\n firstChild.focus();\n }\n else {\n /**\n * The child view of a dropdown could not be focused because it is missing the `focus()` method.\n *\n * This warning appears when a dropdown {@link module:ui/dropdown/dropdownview~DropdownView#isOpen gets open} and it\n * attempts to focus the {@link module:ui/dropdown/dropdownpanelview~DropdownPanelView#children first child} of its panel\n * but the child does not implement the\n * {@link module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable focusable interface}.\n *\n * Focusing the content of a dropdown on open greatly improves the accessibility. Please make sure the view instance\n * provides the `focus()` method for the best user experience.\n *\n * @error ui-dropdown-panel-focus-child-missing-focus\n * @param childView\n * @param dropdownPanel\n */\n logWarning('ui-dropdown-panel-focus-child-missing-focus', { childView: this.children.first, dropdownPanel: this });\n }\n }\n }\n /**\n * Focuses the view element or last item in view collection on opening dropdown's panel.\n *\n * See also {@link module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable}.\n */\n focusLast() {\n if (this.children.length) {\n const lastChild = this.children.last;\n if (typeof lastChild.focusLast === 'function') {\n lastChild.focusLast();\n }\n else {\n lastChild.focus();\n }\n }\n }\n}\n","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./dropdown.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/dropdown/dropdownview\n */\nimport View from '../view';\nimport { KeystrokeHandler, FocusTracker, getOptimalPosition } from '@ckeditor/ckeditor5-utils';\nimport '../../theme/components/dropdown/dropdown.css';\n/**\n * The dropdown view class. It manages the dropdown button and dropdown panel.\n *\n * In most cases, the easiest way to create a dropdown is by using the {@link module:ui/dropdown/utils~createDropdown}\n * util:\n *\n * ```ts\n * const dropdown = createDropdown( locale );\n *\n * // Configure dropdown's button properties:\n * dropdown.buttonView.set( {\n * \tlabel: 'A dropdown',\n * \twithText: true\n * } );\n *\n * dropdown.render();\n *\n * dropdown.panelView.element.textContent = 'Content of the panel';\n *\n * // Will render a dropdown with a panel containing a \"Content of the panel\" text.\n * document.body.appendChild( dropdown.element );\n * ```\n *\n * If you want to add a richer content to the dropdown panel, you can use the {@link module:ui/dropdown/utils~addListToDropdown}\n * and {@link module:ui/dropdown/utils~addToolbarToDropdown} helpers. See more examples in\n * {@link module:ui/dropdown/utils~createDropdown} documentation.\n *\n * If you want to create a completely custom dropdown, then you can compose it manually:\n *\n * ```ts\n * const button = new DropdownButtonView( locale );\n * const panel = new DropdownPanelView( locale );\n * const dropdown = new DropdownView( locale, button, panel );\n *\n * button.set( {\n * \tlabel: 'A dropdown',\n * \twithText: true\n * } );\n *\n * dropdown.render();\n *\n * panel.element.textContent = 'Content of the panel';\n *\n * // Will render a dropdown with a panel containing a \"Content of the panel\" text.\n * document.body.appendChild( dropdown.element );\n * ```\n *\n * However, dropdown created this way will contain little behavior. You will need to implement handlers for actions\n * such as {@link module:ui/bindings/clickoutsidehandler~clickOutsideHandler clicking outside an open dropdown}\n * (which should close it) and support for arrow keys inside the panel. Therefore, unless you really know what\n * you do and you really need to do it, it is recommended to use the {@link module:ui/dropdown/utils~createDropdown} helper.\n */\nexport default class DropdownView extends View {\n /**\n * Creates an instance of the dropdown.\n *\n * Also see {@link #render}.\n *\n * @param locale The localization services instance.\n */\n constructor(locale, buttonView, panelView) {\n super(locale);\n const bind = this.bindTemplate;\n this.buttonView = buttonView;\n this.panelView = panelView;\n this.set('isOpen', false);\n this.set('isEnabled', true);\n this.set('class', undefined);\n this.set('id', undefined);\n this.set('panelPosition', 'auto');\n this.keystrokes = new KeystrokeHandler();\n this.focusTracker = new FocusTracker();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-dropdown',\n bind.to('class'),\n bind.if('isEnabled', 'ck-disabled', value => !value)\n ],\n id: bind.to('id'),\n 'aria-describedby': bind.to('ariaDescribedById')\n },\n children: [\n buttonView,\n panelView\n ]\n });\n buttonView.extendTemplate({\n attributes: {\n class: [\n 'ck-dropdown__button'\n ],\n 'data-cke-tooltip-disabled': bind.to('isOpen')\n }\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.focusTracker.add(this.buttonView.element);\n this.focusTracker.add(this.panelView.element);\n // Toggle the dropdown when its button has been clicked.\n this.listenTo(this.buttonView, 'open', () => {\n this.isOpen = !this.isOpen;\n });\n // Toggle the visibility of the panel when the dropdown becomes open.\n this.panelView.bind('isVisible').to(this, 'isOpen');\n // Let the dropdown control the position of the panel. The position must\n // be updated every time the dropdown is open.\n this.on('change:isOpen', (evt, name, isOpen) => {\n if (!isOpen) {\n return;\n }\n // If \"auto\", find the best position of the panel to fit into the viewport.\n // Otherwise, simply assign the static position.\n if (this.panelPosition === 'auto') {\n this.panelView.position = DropdownView._getOptimalPosition({\n element: this.panelView.element,\n target: this.buttonView.element,\n fitInViewport: true,\n positions: this._panelPositions\n }).name;\n }\n else {\n this.panelView.position = this.panelPosition;\n }\n });\n // Listen for keystrokes coming from within #element.\n this.keystrokes.listenTo(this.element);\n const closeDropdown = (data, cancel) => {\n if (this.isOpen) {\n this.isOpen = false;\n cancel();\n }\n };\n // Open the dropdown panel using the arrow down key, just like with return or space.\n this.keystrokes.set('arrowdown', (data, cancel) => {\n // Don't open if the dropdown is disabled or already open.\n if (this.buttonView.isEnabled && !this.isOpen) {\n this.isOpen = true;\n cancel();\n }\n });\n // Block the right arrow key (until nested dropdowns are implemented).\n this.keystrokes.set('arrowright', (data, cancel) => {\n if (this.isOpen) {\n cancel();\n }\n });\n // Close the dropdown using the arrow left/escape key.\n this.keystrokes.set('arrowleft', closeDropdown);\n this.keystrokes.set('esc', closeDropdown);\n }\n /**\n * Focuses the {@link #buttonView}.\n */\n focus() {\n this.buttonView.focus();\n }\n /**\n * Returns {@link #panelView panel} positions to be used by the\n * {@link module:utils/dom/position~getOptimalPosition `getOptimalPosition()`}\n * utility considering the direction of the language the UI of the editor is displayed in.\n */\n get _panelPositions() {\n const { south, north, southEast, southWest, northEast, northWest, southMiddleEast, southMiddleWest, northMiddleEast, northMiddleWest } = DropdownView.defaultPanelPositions;\n if (this.locale.uiLanguageDirection !== 'rtl') {\n return [\n southEast, southWest, southMiddleEast, southMiddleWest, south,\n northEast, northWest, northMiddleEast, northMiddleWest, north\n ];\n }\n else {\n return [\n southWest, southEast, southMiddleWest, southMiddleEast, south,\n northWest, northEast, northMiddleWest, northMiddleEast, north\n ];\n }\n }\n}\n/**\n * A set of positioning functions used by the dropdown view to determine\n * the optimal position (i.e. fitting into the browser viewport) of its\n * {@link module:ui/dropdown/dropdownview~DropdownView#panelView panel} when\n * {@link module:ui/dropdown/dropdownview~DropdownView#panelPosition} is set to 'auto'`.\n *\n * The available positioning functions are as follow:\n *\n * **South**\n *\n * * `south`\n *\n * ```\n *\t\t\t[ Button ]\n *\t\t+-----------------+\n *\t\t| Panel |\n *\t\t+-----------------+\n * ```\n *\n * * `southEast`\n *\n * ```\n *\t\t[ Button ]\n *\t\t+-----------------+\n *\t\t| Panel |\n *\t\t+-----------------+\n * ```\n *\n * * `southWest`\n *\n * ```\n *\t\t [ Button ]\n *\t\t+-----------------+\n *\t\t| Panel |\n *\t\t+-----------------+\n * ```\n *\n * * `southMiddleEast`\n *\n * ```\n *\t\t [ Button ]\n *\t\t+-----------------+\n *\t\t| Panel |\n *\t\t+-----------------+\n * ```\n *\n * * `southMiddleWest`\n *\n * ```\n *\t\t [ Button ]\n *\t\t+-----------------+\n *\t\t| Panel |\n *\t\t+-----------------+\n * ```\n *\n * **North**\n *\n * * `north`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Panel |\n *\t\t+-----------------+\n *\t\t [ Button ]\n * ```\n *\n * * `northEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Panel |\n *\t\t+-----------------+\n *\t\t[ Button ]\n * ```\n *\n * * `northWest`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Panel |\n *\t\t+-----------------+\n *\t\t [ Button ]\n * ```\n *\n * * `northMiddleEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Panel |\n *\t\t+-----------------+\n *\t\t [ Button ]\n * ```\n *\n * * `northMiddleWest`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Panel |\n *\t\t+-----------------+\n *\t\t [ Button ]\n * ```\n *\n * Positioning functions are compatible with {@link module:utils/dom/position~Position}.\n *\n * The name that position function returns will be reflected in dropdown panel's class that\n * controls its placement. See {@link module:ui/dropdown/dropdownview~DropdownView#panelPosition}\n * to learn more.\n */\nDropdownView.defaultPanelPositions = {\n south: (buttonRect, panelRect) => {\n return {\n top: buttonRect.bottom,\n left: buttonRect.left - (panelRect.width - buttonRect.width) / 2,\n name: 's'\n };\n },\n southEast: buttonRect => {\n return {\n top: buttonRect.bottom,\n left: buttonRect.left,\n name: 'se'\n };\n },\n southWest: (buttonRect, panelRect) => {\n return {\n top: buttonRect.bottom,\n left: buttonRect.left - panelRect.width + buttonRect.width,\n name: 'sw'\n };\n },\n southMiddleEast: (buttonRect, panelRect) => {\n return {\n top: buttonRect.bottom,\n left: buttonRect.left - (panelRect.width - buttonRect.width) / 4,\n name: 'sme'\n };\n },\n southMiddleWest: (buttonRect, panelRect) => {\n return {\n top: buttonRect.bottom,\n left: buttonRect.left - (panelRect.width - buttonRect.width) * 3 / 4,\n name: 'smw'\n };\n },\n north: (buttonRect, panelRect) => {\n return {\n top: buttonRect.top - panelRect.height,\n left: buttonRect.left - (panelRect.width - buttonRect.width) / 2,\n name: 'n'\n };\n },\n northEast: (buttonRect, panelRect) => {\n return {\n top: buttonRect.top - panelRect.height,\n left: buttonRect.left,\n name: 'ne'\n };\n },\n northWest: (buttonRect, panelRect) => {\n return {\n top: buttonRect.top - panelRect.height,\n left: buttonRect.left - panelRect.width + buttonRect.width,\n name: 'nw'\n };\n },\n northMiddleEast: (buttonRect, panelRect) => {\n return {\n top: buttonRect.top - panelRect.height,\n left: buttonRect.left - (panelRect.width - buttonRect.width) / 4,\n name: 'nme'\n };\n },\n northMiddleWest: (buttonRect, panelRect) => {\n return {\n top: buttonRect.top - panelRect.height,\n left: buttonRect.left - (panelRect.width - buttonRect.width) * 3 / 4,\n name: 'nmw'\n };\n }\n};\n/**\n * A function used to calculate the optimal position for the dropdown panel.\n */\nDropdownView._getOptimalPosition = getOptimalPosition;\n","export default \"<svg viewBox=\\\"0 0 10 10\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M.941 4.523a.75.75 0 1 1 1.06-1.06l3.006 3.005 3.005-3.005a.75.75 0 1 1 1.06 1.06l-3.549 3.55a.75.75 0 0 1-1.168-.136L.941 4.523z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/dropdown/button/dropdownbuttonview\n */\nimport ButtonView from '../../button/buttonview';\nimport IconView from '../../icon/iconview';\nimport dropdownArrowIcon from '../../../theme/icons/dropdown-arrow.svg';\n/**\n * The default dropdown button view class.\n *\n * ```ts\n * const view = new DropdownButtonView();\n *\n * view.set( {\n * \tlabel: 'A button',\n * \tkeystroke: 'Ctrl+B',\n * \ttooltip: true\n * } );\n *\n * view.render();\n *\n * document.body.append( view.element );\n * ```\n *\n * Also see the {@link module:ui/dropdown/utils~createDropdown `createDropdown()` util}.\n */\nexport default class DropdownButtonView extends ButtonView {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.arrowView = this._createArrowView();\n this.extendTemplate({\n attributes: {\n 'aria-haspopup': true,\n 'aria-expanded': this.bindTemplate.to('isOn', value => String(value))\n }\n });\n // The DropdownButton interface expects the open event upon which will open the dropdown.\n this.delegate('execute').to(this, 'open');\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.children.add(this.arrowView);\n }\n /**\n * Creates a {@link module:ui/icon/iconview~IconView} instance as {@link #arrowView}.\n */\n _createArrowView() {\n const arrowView = new IconView();\n arrowView.content = dropdownArrowIcon;\n arrowView.extendTemplate({\n attributes: {\n class: 'ck-dropdown__arrow'\n }\n });\n return arrowView;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/focuscycler\n */\nimport { isVisible } from '@ckeditor/ckeditor5-utils';\n/**\n * A utility class that helps cycling over focusable {@link module:ui/view~View views} in a\n * {@link module:ui/viewcollection~ViewCollection} when the focus is tracked by the\n * {@link module:utils/focustracker~FocusTracker} instance. It helps implementing keyboard\n * navigation in HTML forms, toolbars, lists and the like.\n *\n * To work properly it requires:\n * * a collection of focusable (HTML `tabindex` attribute) views that implement the `focus()` method,\n * * an associated focus tracker to determine which view is focused.\n *\n * A simple cycler setup can look like this:\n *\n * ```ts\n * const focusables = new ViewCollection();\n * const focusTracker = new FocusTracker();\n *\n * // Add focusable views to the focus tracker.\n * focusTracker.add( ... );\n * ```\n *\n * Then, the cycler can be used manually:\n *\n * ```ts\n * const cycler = new FocusCycler( { focusables, focusTracker } );\n *\n * // Will focus the first focusable view in #focusables.\n * cycler.focusFirst();\n *\n * // Will log the next focusable item in #focusables.\n * console.log( cycler.next );\n * ```\n *\n * Alternatively, it can work side by side with the {@link module:utils/keystrokehandler~KeystrokeHandler}:\n *\n * ```ts\n * const keystrokeHandler = new KeystrokeHandler();\n *\n * // Activate the keystroke handler.\n * keystrokeHandler.listenTo( sourceOfEvents );\n *\n * const cycler = new FocusCycler( {\n * \tfocusables, focusTracker, keystrokeHandler,\n * \tactions: {\n * \t\t// When arrowup of arrowleft is detected by the #keystrokeHandler,\n * \t\t// focusPrevious() will be called on the cycler.\n * \t\tfocusPrevious: [ 'arrowup', 'arrowleft' ],\n * \t}\n * } );\n * ```\n *\n * Check out the {@glink framework/deep-dive/ui/focus-tracking \"Deep dive into focus tracking\"} guide to learn more.\n */\nexport default class FocusCycler {\n /**\n * Creates an instance of the focus cycler utility.\n *\n * @param options Configuration options.\n */\n constructor(options) {\n this.focusables = options.focusables;\n this.focusTracker = options.focusTracker;\n this.keystrokeHandler = options.keystrokeHandler;\n this.actions = options.actions;\n if (options.actions && options.keystrokeHandler) {\n for (const methodName in options.actions) {\n let actions = options.actions[methodName];\n if (typeof actions == 'string') {\n actions = [actions];\n }\n for (const keystroke of actions) {\n options.keystrokeHandler.set(keystroke, (data, cancel) => {\n this[methodName]();\n cancel();\n });\n }\n }\n }\n }\n /**\n * Returns the first focusable view in {@link #focusables}.\n * Returns `null` if there is none.\n *\n * **Note**: Hidden views (e.g. with `display: none`) are ignored.\n */\n get first() {\n return (this.focusables.find(isFocusable) || null);\n }\n /**\n * Returns the last focusable view in {@link #focusables}.\n * Returns `null` if there is none.\n *\n * **Note**: Hidden views (e.g. with `display: none`) are ignored.\n */\n get last() {\n return (this.focusables.filter(isFocusable).slice(-1)[0] || null);\n }\n /**\n * Returns the next focusable view in {@link #focusables} based on {@link #current}.\n * Returns `null` if there is none.\n *\n * **Note**: Hidden views (e.g. with `display: none`) are ignored.\n */\n get next() {\n return this._getFocusableItem(1);\n }\n /**\n * Returns the previous focusable view in {@link #focusables} based on {@link #current}.\n * Returns `null` if there is none.\n *\n * **Note**: Hidden views (e.g. with `display: none`) are ignored.\n */\n get previous() {\n return this._getFocusableItem(-1);\n }\n /**\n * An index of the view in the {@link #focusables} which is focused according\n * to {@link #focusTracker}. Returns `null` when there is no such view.\n */\n get current() {\n let index = null;\n // There's no focused view in the focusables.\n if (this.focusTracker.focusedElement === null) {\n return null;\n }\n this.focusables.find((view, viewIndex) => {\n const focused = view.element === this.focusTracker.focusedElement;\n if (focused) {\n index = viewIndex;\n }\n return focused;\n });\n return index;\n }\n /**\n * Focuses the {@link #first} item in {@link #focusables}.\n *\n * **Note**: Hidden views (e.g. with `display: none`) are ignored.\n */\n focusFirst() {\n this._focus(this.first);\n }\n /**\n * Focuses the {@link #last} item in {@link #focusables}.\n *\n * **Note**: Hidden views (e.g. with `display: none`) are ignored.\n */\n focusLast() {\n this._focus(this.last);\n }\n /**\n * Focuses the {@link #next} item in {@link #focusables}.\n *\n * **Note**: Hidden views (e.g. with `display: none`) are ignored.\n */\n focusNext() {\n this._focus(this.next);\n }\n /**\n * Focuses the {@link #previous} item in {@link #focusables}.\n *\n * **Note**: Hidden views (e.g. with `display: none`) are ignored.\n */\n focusPrevious() {\n this._focus(this.previous);\n }\n /**\n * Focuses the given view if it exists.\n */\n _focus(view) {\n if (view) {\n view.focus();\n }\n }\n /**\n * Returns the next or previous focusable view in {@link #focusables} with respect\n * to {@link #current}.\n *\n * @param step Either `1` for checking forward from {@link #current} or `-1` for checking backwards.\n */\n _getFocusableItem(step) {\n // Cache for speed.\n const current = this.current;\n const collectionLength = this.focusables.length;\n if (!collectionLength) {\n return null;\n }\n // Start from the beginning if no view is focused.\n // https://github.com/ckeditor/ckeditor5-ui/issues/206\n if (current === null) {\n return this[step === 1 ? 'first' : 'last'];\n }\n // Cycle in both directions.\n let index = (current + collectionLength + step) % collectionLength;\n do {\n const view = this.focusables.get(index);\n if (isFocusable(view)) {\n return view;\n }\n // Cycle in both directions.\n index = (index + collectionLength + step) % collectionLength;\n } while (index !== current);\n return null;\n }\n}\n/**\n * Checks whether a view is focusable.\n *\n * @param view A view to be checked.\n */\nfunction isFocusable(view) {\n return !!(view.focus && isVisible(view.element));\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/toolbar/toolbarseparatorview\n */\nimport View from '../view';\n/**\n * The toolbar separator view class.\n */\nexport default class ToolbarSeparatorView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.setTemplate({\n tag: 'span',\n attributes: {\n class: [\n 'ck',\n 'ck-toolbar__separator'\n ]\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/toolbar/toolbarlinebreakview\n */\nimport View from '../view';\n/**\n * The toolbar line break view class.\n */\nexport default class ToolbarLineBreakView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.setTemplate({\n tag: 'span',\n attributes: {\n class: [\n 'ck',\n 'ck-toolbar__line-break'\n ]\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/toolbar/normalizetoolbarconfig\n */\n/**\n * Normalizes the toolbar configuration (`config.toolbar`), which:\n *\n * * may be defined as an `Array`:\n *\n * ```\n * toolbar: [ 'heading', 'bold', 'italic', 'link', ... ]\n * ```\n *\n * * or an `Object`:\n *\n * ```\n * toolbar: {\n * \titems: [ 'heading', 'bold', 'italic', 'link', ... ],\n * \tremoveItems: [ 'bold' ],\n * \t...\n * }\n * ```\n *\n * * or may not be defined at all (`undefined`)\n *\n * and returns it in the object form.\n *\n * @param config The value of `config.toolbar`.\n * @returns A normalized toolbar config object.\n */\nexport default function normalizeToolbarConfig(config) {\n if (Array.isArray(config)) {\n return {\n items: config,\n removeItems: []\n };\n }\n if (!config) {\n return {\n items: [],\n removeItems: []\n };\n }\n return Object.assign({\n items: [],\n removeItems: []\n }, config);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/plugin\n */\n/* eslint-disable @typescript-eslint/no-invalid-void-type */\nimport { ObservableMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * The base class for CKEditor plugin classes.\n */\nexport default class Plugin extends ObservableMixin() {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super();\n /**\n * Holds identifiers for {@link #forceDisabled} mechanism.\n */\n this._disableStack = new Set();\n this.editor = editor;\n this.set('isEnabled', true);\n }\n /**\n * Disables the plugin.\n *\n * Plugin may be disabled by multiple features or algorithms (at once). When disabling a plugin, unique id should be passed\n * (e.g. feature name). The same identifier should be used when {@link #clearForceDisabled enabling back} the plugin.\n * The plugin becomes enabled only after all features {@link #clearForceDisabled enabled it back}.\n *\n * Disabling and enabling a plugin:\n *\n * ```ts\n * plugin.isEnabled; // -> true\n * plugin.forceDisabled( 'MyFeature' );\n * plugin.isEnabled; // -> false\n * plugin.clearForceDisabled( 'MyFeature' );\n * plugin.isEnabled; // -> true\n * ```\n *\n * Plugin disabled by multiple features:\n *\n * ```ts\n * plugin.forceDisabled( 'MyFeature' );\n * plugin.forceDisabled( 'OtherFeature' );\n * plugin.clearForceDisabled( 'MyFeature' );\n * plugin.isEnabled; // -> false\n * plugin.clearForceDisabled( 'OtherFeature' );\n * plugin.isEnabled; // -> true\n * ```\n *\n * Multiple disabling with the same identifier is redundant:\n *\n * ```ts\n * plugin.forceDisabled( 'MyFeature' );\n * plugin.forceDisabled( 'MyFeature' );\n * plugin.clearForceDisabled( 'MyFeature' );\n * plugin.isEnabled; // -> true\n * ```\n *\n * **Note:** some plugins or algorithms may have more complex logic when it comes to enabling or disabling certain plugins,\n * so the plugin might be still disabled after {@link #clearForceDisabled} was used.\n *\n * @param id Unique identifier for disabling. Use the same id when {@link #clearForceDisabled enabling back} the plugin.\n */\n forceDisabled(id) {\n this._disableStack.add(id);\n if (this._disableStack.size == 1) {\n this.on('set:isEnabled', forceDisable, { priority: 'highest' });\n this.isEnabled = false;\n }\n }\n /**\n * Clears forced disable previously set through {@link #forceDisabled}. See {@link #forceDisabled}.\n *\n * @param id Unique identifier, equal to the one passed in {@link #forceDisabled} call.\n */\n clearForceDisabled(id) {\n this._disableStack.delete(id);\n if (this._disableStack.size == 0) {\n this.off('set:isEnabled', forceDisable);\n this.isEnabled = true;\n }\n }\n /**\n * @inheritDoc\n */\n destroy() {\n this.stopListening();\n }\n /**\n * @inheritDoc\n */\n static get isContextPlugin() {\n return false;\n }\n}\n/**\n * Helper function that forces plugin to be disabled.\n */\nfunction forceDisable(evt) {\n evt.return = false;\n evt.stop();\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/command\n */\nimport { ObservableMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * Base class for the CKEditor commands.\n *\n * Commands are the main way to manipulate the editor contents and state. They are mostly used by UI elements (or by other\n * commands) to make changes in the model. Commands are available in every part of the code that has access to\n * the {@link module:core/editor/editor~Editor editor} instance.\n *\n * Instances of registered commands can be retrieved from {@link module:core/editor/editor~Editor#commands `editor.commands`}.\n * The easiest way to execute a command is through {@link module:core/editor/editor~Editor#execute `editor.execute()`}.\n *\n * By default, commands are disabled when the editor is in the {@link module:core/editor/editor~Editor#isReadOnly read-only} mode\n * but commands with the {@link module:core/command~Command#affectsData `affectsData`} flag set to `false` will not be disabled.\n */\nexport default class Command extends ObservableMixin() {\n /**\n * Creates a new `Command` instance.\n *\n * @param editor The editor on which this command will be used.\n */\n constructor(editor) {\n super();\n this.editor = editor;\n this.set('value', undefined);\n this.set('isEnabled', false);\n this._affectsData = true;\n this._isEnabledBasedOnSelection = true;\n this._disableStack = new Set();\n this.decorate('execute');\n // By default, every command is refreshed when changes are applied to the model.\n this.listenTo(this.editor.model.document, 'change', () => {\n this.refresh();\n });\n this.listenTo(editor, 'change:isReadOnly', () => {\n this.refresh();\n });\n // By default, commands are disabled if the selection is in non-editable place or editor is in read-only mode.\n this.on('set:isEnabled', evt => {\n if (!this.affectsData) {\n return;\n }\n // Checking `editor.isReadOnly` is needed for all commands that have `_isEnabledBasedOnSelection == false`.\n // E.g. undo does not base on selection, but affects data and should be disabled when the editor is in read-only mode.\n if (editor.isReadOnly || this._isEnabledBasedOnSelection && !editor.model.canEditAt(editor.model.document.selection)) {\n evt.return = false;\n evt.stop();\n }\n }, { priority: 'highest' });\n this.on('execute', evt => {\n if (!this.isEnabled) {\n evt.stop();\n }\n }, { priority: 'high' });\n }\n /**\n * A flag indicating whether a command execution changes the editor data or not.\n *\n * Commands with `affectsData` set to `false` will not be automatically disabled in\n * the {@link module:core/editor/editor~Editor#isReadOnly read-only mode} and\n * {@glink features/read-only#related-features other editor modes} with restricted user write permissions.\n *\n * **Note:** You do not have to set it for your every command. It is `true` by default.\n *\n * @default true\n */\n get affectsData() {\n return this._affectsData;\n }\n set affectsData(affectsData) {\n this._affectsData = affectsData;\n }\n /**\n * Refreshes the command. The command should update its {@link #isEnabled} and {@link #value} properties\n * in this method.\n *\n * This method is automatically called when\n * {@link module:engine/model/document~Document#event:change any changes are applied to the document}.\n */\n refresh() {\n this.isEnabled = true;\n }\n /**\n * Disables the command.\n *\n * Command may be disabled by multiple features or algorithms (at once). When disabling a command, unique id should be passed\n * (e.g. the feature name). The same identifier should be used when {@link #clearForceDisabled enabling back} the command.\n * The command becomes enabled only after all features {@link #clearForceDisabled enabled it back}.\n *\n * Disabling and enabling a command:\n *\n * ```ts\n * command.isEnabled; // -> true\n * command.forceDisabled( 'MyFeature' );\n * command.isEnabled; // -> false\n * command.clearForceDisabled( 'MyFeature' );\n * command.isEnabled; // -> true\n * ```\n *\n * Command disabled by multiple features:\n *\n * ```ts\n * command.forceDisabled( 'MyFeature' );\n * command.forceDisabled( 'OtherFeature' );\n * command.clearForceDisabled( 'MyFeature' );\n * command.isEnabled; // -> false\n * command.clearForceDisabled( 'OtherFeature' );\n * command.isEnabled; // -> true\n * ```\n *\n * Multiple disabling with the same identifier is redundant:\n *\n * ```ts\n * command.forceDisabled( 'MyFeature' );\n * command.forceDisabled( 'MyFeature' );\n * command.clearForceDisabled( 'MyFeature' );\n * command.isEnabled; // -> true\n * ```\n *\n * **Note:** some commands or algorithms may have more complex logic when it comes to enabling or disabling certain commands,\n * so the command might be still disabled after {@link #clearForceDisabled} was used.\n *\n * @param id Unique identifier for disabling. Use the same id when {@link #clearForceDisabled enabling back} the command.\n */\n forceDisabled(id) {\n this._disableStack.add(id);\n if (this._disableStack.size == 1) {\n this.on('set:isEnabled', forceDisable, { priority: 'highest' });\n this.isEnabled = false;\n }\n }\n /**\n * Clears forced disable previously set through {@link #forceDisabled}. See {@link #forceDisabled}.\n *\n * @param id Unique identifier, equal to the one passed in {@link #forceDisabled} call.\n */\n clearForceDisabled(id) {\n this._disableStack.delete(id);\n if (this._disableStack.size == 0) {\n this.off('set:isEnabled', forceDisable);\n this.refresh();\n }\n }\n /**\n * Executes the command.\n *\n * A command may accept parameters. They will be passed from {@link module:core/editor/editor~Editor#execute `editor.execute()`}\n * to the command.\n *\n * The `execute()` method will automatically abort when the command is disabled ({@link #isEnabled} is `false`).\n * This behavior is implemented by a high priority listener to the {@link #event:execute} event.\n *\n * In order to see how to disable a command from \"outside\" see the {@link #isEnabled} documentation.\n *\n * This method may return a value, which would be forwarded all the way down to the\n * {@link module:core/editor/editor~Editor#execute `editor.execute()`}.\n *\n * @fires execute\n */\n execute(...args) { return undefined; }\n /**\n * Destroys the command.\n */\n destroy() {\n this.stopListening();\n }\n}\n/**\n * Helper function that forces command to be disabled.\n */\nfunction forceDisable(evt) {\n evt.return = false;\n evt.stop();\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/multicommand\n */\nimport Command from './command';\nimport { insertToPriorityArray } from '@ckeditor/ckeditor5-utils';\n/**\n * A CKEditor command that aggregates other commands.\n *\n * This command is used to proxy multiple commands. The multi-command is enabled when\n * at least one of its registered child commands is enabled.\n * When executing a multi-command, the first enabled command with highest priority will be executed.\n *\n * ```ts\n * const multiCommand = new MultiCommand( editor );\n *\n * const commandFoo = new Command( editor );\n * const commandBar = new Command( editor );\n *\n * // Register a child command.\n * multiCommand.registerChildCommand( commandFoo );\n * // Register a child command with a low priority.\n * multiCommand.registerChildCommand( commandBar, { priority: 'low' } );\n *\n * // Enable one of the commands.\n * commandBar.isEnabled = true;\n *\n * multiCommand.execute(); // Will execute commandBar.\n * ```\n */\nexport default class MultiCommand extends Command {\n constructor() {\n super(...arguments);\n /**\n * Registered child commands definitions.\n */\n this._childCommandsDefinitions = [];\n }\n /**\n * @inheritDoc\n */\n refresh() {\n // Override base command refresh(): the command's state is changed when one of child commands changes states.\n }\n /**\n * Executes the first enabled command which has the highest priority of all registered child commands.\n *\n * @returns The value returned by the {@link module:core/command~Command#execute `command.execute()`}.\n */\n execute(...args) {\n const command = this._getFirstEnabledCommand();\n return !!command && command.execute(args);\n }\n /**\n * Registers a child command.\n *\n * @param options An object with configuration options.\n * @param options.priority Priority of a command to register.\n */\n registerChildCommand(command, options = {}) {\n insertToPriorityArray(this._childCommandsDefinitions, { command, priority: options.priority || 'normal' });\n // Change multi-command enabled state when one of registered commands changes state.\n command.on('change:isEnabled', () => this._checkEnabled());\n this._checkEnabled();\n }\n /**\n * Checks if any of child commands is enabled.\n */\n _checkEnabled() {\n this.isEnabled = !!this._getFirstEnabledCommand();\n }\n /**\n * Returns a first enabled command with the highest priority or `undefined` if none of them is enabled.\n */\n _getFirstEnabledCommand() {\n const commandDefinition = this._childCommandsDefinitions.find(({ command }) => command.isEnabled);\n return commandDefinition && commandDefinition.command;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/plugincollection\n */\nimport { CKEditorError, EmitterMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * Manages a list of CKEditor plugins, including loading, resolving dependencies and initialization.\n */\nexport default class PluginCollection extends EmitterMixin() {\n /**\n * Creates an instance of the plugin collection class.\n * Allows loading and initializing plugins and their dependencies.\n * Allows providing a list of already loaded plugins. These plugins will not be destroyed along with this collection.\n *\n * @param availablePlugins Plugins (constructors) which the collection will be able to use\n * when {@link module:core/plugincollection~PluginCollection#init} is used with the plugin names (strings, instead of constructors).\n * Usually, the editor will pass its built-in plugins to the collection so they can later be\n * used in `config.plugins` or `config.removePlugins` by names.\n * @param contextPlugins A list of already initialized plugins represented by a `[ PluginConstructor, pluginInstance ]` pair.\n */\n constructor(context, availablePlugins = [], contextPlugins = []) {\n super();\n this._plugins = new Map();\n this._context = context;\n this._availablePlugins = new Map();\n for (const PluginConstructor of availablePlugins) {\n if (PluginConstructor.pluginName) {\n this._availablePlugins.set(PluginConstructor.pluginName, PluginConstructor);\n }\n }\n this._contextPlugins = new Map();\n for (const [PluginConstructor, pluginInstance] of contextPlugins) {\n this._contextPlugins.set(PluginConstructor, pluginInstance);\n this._contextPlugins.set(pluginInstance, PluginConstructor);\n // To make it possible to require a plugin by its name.\n if (PluginConstructor.pluginName) {\n this._availablePlugins.set(PluginConstructor.pluginName, PluginConstructor);\n }\n }\n }\n /**\n * Iterable interface.\n *\n * Returns `[ PluginConstructor, pluginInstance ]` pairs.\n */\n *[Symbol.iterator]() {\n for (const entry of this._plugins) {\n if (typeof entry[0] == 'function') {\n yield entry;\n }\n }\n }\n /**\n * Gets the plugin instance by its constructor or name.\n *\n * ```ts\n * // Check if 'Clipboard' plugin was loaded.\n * if ( editor.plugins.has( 'ClipboardPipeline' ) ) {\n * \t// Get clipboard plugin instance\n * \tconst clipboard = editor.plugins.get( 'ClipboardPipeline' );\n *\n * \tthis.listenTo( clipboard, 'inputTransformation', ( evt, data ) => {\n * \t\t// Do something on clipboard input.\n * \t} );\n * }\n * ```\n *\n * **Note**: This method will throw an error if a plugin is not loaded. Use `{@link #has editor.plugins.has()}`\n * to check if a plugin is available.\n *\n * @param key The plugin constructor or {@link module:core/plugin~PluginStaticMembers#pluginName name}.\n */\n get(key) {\n const plugin = this._plugins.get(key);\n if (!plugin) {\n let pluginName = key;\n if (typeof key == 'function') {\n pluginName = key.pluginName || key.name;\n }\n /**\n * The plugin is not loaded and could not be obtained.\n *\n * Plugin classes (constructors) need to be provided to the editor and must be loaded before they can be obtained from\n * the plugin collection.\n * This is usually done in CKEditor 5 builds by setting the {@link module:core/editor/editor~Editor.builtinPlugins}\n * property.\n *\n * **Note**: You can use `{@link module:core/plugincollection~PluginCollection#has editor.plugins.has()}`\n * to check if a plugin was loaded.\n *\n * @error plugincollection-plugin-not-loaded\n * @param plugin The name of the plugin which is not loaded.\n */\n throw new CKEditorError('plugincollection-plugin-not-loaded', this._context, { plugin: pluginName });\n }\n return plugin;\n }\n /**\n * Checks if a plugin is loaded.\n *\n * ```ts\n * // Check if the 'Clipboard' plugin was loaded.\n * if ( editor.plugins.has( 'ClipboardPipeline' ) ) {\n * \t// Now use the clipboard plugin instance:\n * \tconst clipboard = editor.plugins.get( 'ClipboardPipeline' );\n *\n * \t// ...\n * }\n * ```\n *\n * @param key The plugin constructor or {@link module:core/plugin~PluginStaticMembers#pluginName name}.\n */\n has(key) {\n return this._plugins.has(key);\n }\n /**\n * Initializes a set of plugins and adds them to the collection.\n *\n * @param plugins An array of {@link module:core/plugin~PluginInterface plugin constructors}\n * or {@link module:core/plugin~PluginStaticMembers#pluginName plugin names}.\n * @param pluginsToRemove Names of the plugins or plugin constructors\n * that should not be loaded (despite being specified in the `plugins` array).\n * @param pluginsSubstitutions An array of {@link module:core/plugin~PluginInterface plugin constructors}\n * that will be used to replace plugins of the same names that were passed in `plugins` or that are in their dependency tree.\n * A useful option for replacing built-in plugins while creating tests (for mocking their APIs). Plugins that will be replaced\n * must follow these rules:\n * * The new plugin must be a class.\n * * The new plugin must be named.\n * * Both plugins must not depend on other plugins.\n * @returns A promise which gets resolved once all plugins are loaded and available in the collection.\n */\n init(plugins, pluginsToRemove = [], pluginsSubstitutions = []) {\n // Plugin initialization procedure consists of 2 main steps:\n // 1) collecting all available plugin constructors,\n // 2) verification whether all required plugins can be instantiated.\n //\n // In the first step, all plugin constructors, available in the provided `plugins` array and inside\n // plugin's dependencies (from the `Plugin.requires` array), are recursively collected and added to the existing\n // `this._availablePlugins` map, but without any verification at the given moment. Performing the verification\n // at this point (during the plugin constructor searching) would cause false errors to occur, that some plugin\n // is missing but in fact it may be defined further in the array as the dependency of other plugin. After\n // traversing the entire dependency tree, it will be checked if all required \"top level\" plugins are available.\n //\n // In the second step, the list of plugins that have not been explicitly removed is traversed to get all the\n // plugin constructors to be instantiated in the correct order and to validate against some rules. Finally, if\n // no plugin is missing and no other error has been found, they all will be instantiated.\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this;\n const context = this._context;\n findAvailablePluginConstructors(plugins);\n validatePlugins(plugins);\n const pluginsToLoad = plugins.filter(plugin => !isPluginRemoved(plugin, pluginsToRemove));\n const pluginConstructors = [...getPluginConstructors(pluginsToLoad)];\n substitutePlugins(pluginConstructors, pluginsSubstitutions);\n const pluginInstances = loadPlugins(pluginConstructors);\n return initPlugins(pluginInstances, 'init')\n .then(() => initPlugins(pluginInstances, 'afterInit'))\n .then(() => pluginInstances);\n function isPluginConstructor(plugin) {\n return typeof plugin === 'function';\n }\n function isContextPlugin(plugin) {\n return isPluginConstructor(plugin) && !!plugin.isContextPlugin;\n }\n function isPluginRemoved(plugin, pluginsToRemove) {\n return pluginsToRemove.some(removedPlugin => {\n if (removedPlugin === plugin) {\n return true;\n }\n if (getPluginName(plugin) === removedPlugin) {\n return true;\n }\n if (getPluginName(removedPlugin) === plugin) {\n return true;\n }\n return false;\n });\n }\n function getPluginName(plugin) {\n return isPluginConstructor(plugin) ?\n plugin.pluginName || plugin.name :\n plugin;\n }\n function findAvailablePluginConstructors(plugins, processed = new Set()) {\n plugins.forEach(plugin => {\n if (!isPluginConstructor(plugin)) {\n return;\n }\n if (processed.has(plugin)) {\n return;\n }\n processed.add(plugin);\n if (plugin.pluginName && !that._availablePlugins.has(plugin.pluginName)) {\n that._availablePlugins.set(plugin.pluginName, plugin);\n }\n if (plugin.requires) {\n findAvailablePluginConstructors(plugin.requires, processed);\n }\n });\n }\n function getPluginConstructors(plugins, processed = new Set()) {\n return plugins\n .map(plugin => {\n return isPluginConstructor(plugin) ?\n plugin :\n that._availablePlugins.get(plugin);\n })\n .reduce((result, plugin) => {\n if (processed.has(plugin)) {\n return result;\n }\n processed.add(plugin);\n if (plugin.requires) {\n validatePlugins(plugin.requires, plugin);\n getPluginConstructors(plugin.requires, processed).forEach(plugin => result.add(plugin));\n }\n return result.add(plugin);\n }, new Set());\n }\n function validatePlugins(plugins, parentPluginConstructor = null) {\n plugins\n .map(plugin => {\n return isPluginConstructor(plugin) ?\n plugin :\n that._availablePlugins.get(plugin) || plugin;\n })\n .forEach(plugin => {\n checkMissingPlugin(plugin, parentPluginConstructor);\n checkContextPlugin(plugin, parentPluginConstructor);\n checkRemovedPlugin(plugin, parentPluginConstructor);\n });\n }\n function checkMissingPlugin(plugin, parentPluginConstructor) {\n if (isPluginConstructor(plugin)) {\n return;\n }\n if (parentPluginConstructor) {\n /**\n * A required \"soft\" dependency was not found on the plugin list.\n *\n * When configuring the editor, either prior to building (via\n * {@link module:core/editor/editor~Editor.builtinPlugins `Editor.builtinPlugins`}) or when\n * creating a new instance of the editor (e.g. via\n * {@link module:core/editor/editorconfig~EditorConfig#plugins `config.plugins`}), you need to provide\n * some of the dependencies for other plugins that you used.\n *\n * This error is thrown when one of these dependencies was not provided. The name of the missing plugin\n * can be found in `missingPlugin` and the plugin that required it in `requiredBy`.\n *\n * In order to resolve it, you need to import the missing plugin and add it to the\n * current list of plugins (`Editor.builtinPlugins` or `config.plugins`/`config.extraPlugins`).\n *\n * Soft requirements were introduced in version 26.0.0. If you happen to stumble upon this error\n * when upgrading to version 26.0.0, read also the\n * {@glink updating/guides/update-to-26 Migration to 26.0.0} guide.\n *\n * @error plugincollection-soft-required\n * @param missingPlugin The name of the required plugin.\n * @param requiredBy The name of the plugin that requires the other plugin.\n */\n throw new CKEditorError('plugincollection-soft-required', context, { missingPlugin: plugin, requiredBy: getPluginName(parentPluginConstructor) });\n }\n /**\n * A plugin is not available and could not be loaded.\n *\n * Plugin classes (constructors) need to be provided to the editor before they can be loaded by name.\n * This is usually done in CKEditor 5 builds by setting the {@link module:core/editor/editor~Editor.builtinPlugins}\n * property.\n *\n * **If you see this warning when using one of the {@glink installation/getting-started/predefined-builds\n * CKEditor 5 Builds}**,\n * it means that you try to enable a plugin which was not included in that build. This may be due to a typo\n * in the plugin name or simply because that plugin is not a part of this build. In the latter scenario,\n * read more about {@glink installation/getting-started/quick-start custom builds}.\n *\n * **If you see this warning when using one of the editor creators directly** (not a build), then it means\n * that you tried loading plugins by name. However, unlike CKEditor 4, CKEditor 5 does not implement a \"plugin loader\".\n * This means that CKEditor 5 does not know where to load the plugin modules from. Therefore, you need to\n * provide each plugin through a reference (as a constructor function). Check out the examples in\n * {@glink installation/advanced/alternative-setups/integrating-from-source-webpack \"Building from source\"}.\n *\n * @error plugincollection-plugin-not-found\n * @param plugin The name of the plugin which could not be loaded.\n */\n throw new CKEditorError('plugincollection-plugin-not-found', context, { plugin });\n }\n function checkContextPlugin(plugin, parentPluginConstructor) {\n if (!isContextPlugin(parentPluginConstructor)) {\n return;\n }\n if (isContextPlugin(plugin)) {\n return;\n }\n /**\n * If a plugin is a context plugin, all plugins it requires should also be context plugins\n * instead of plugins. In other words, if one plugin can be used in the context,\n * all its requirements should also be ready to be used in the context. Note that the context\n * provides only a part of the API provided by the editor. If one plugin needs a full\n * editor API, all plugins which require it are considered as plugins that need a full\n * editor API.\n *\n * @error plugincollection-context-required\n * @param plugin The name of the required plugin.\n * @param requiredBy The name of the parent plugin.\n */\n throw new CKEditorError('plugincollection-context-required', context, { plugin: getPluginName(plugin), requiredBy: getPluginName(parentPluginConstructor) });\n }\n function checkRemovedPlugin(plugin, parentPluginConstructor) {\n if (!parentPluginConstructor) {\n return;\n }\n if (!isPluginRemoved(plugin, pluginsToRemove)) {\n return;\n }\n /**\n * Cannot load a plugin because one of its dependencies is listed in the `removePlugins` option.\n *\n * @error plugincollection-required\n * @param plugin The name of the required plugin.\n * @param requiredBy The name of the parent plugin.\n */\n throw new CKEditorError('plugincollection-required', context, { plugin: getPluginName(plugin), requiredBy: getPluginName(parentPluginConstructor) });\n }\n function loadPlugins(pluginConstructors) {\n return pluginConstructors.map(PluginConstructor => {\n let pluginInstance = that._contextPlugins.get(PluginConstructor);\n pluginInstance = pluginInstance || new PluginConstructor(context);\n that._add(PluginConstructor, pluginInstance);\n return pluginInstance;\n });\n }\n function initPlugins(pluginInstances, method) {\n return pluginInstances.reduce((promise, plugin) => {\n if (!plugin[method]) {\n return promise;\n }\n if (that._contextPlugins.has(plugin)) {\n return promise;\n }\n return promise.then(plugin[method].bind(plugin));\n }, Promise.resolve());\n }\n /**\n * Replaces plugin constructors with the specified set of plugins.\n */\n function substitutePlugins(pluginConstructors, pluginsSubstitutions) {\n for (const pluginItem of pluginsSubstitutions) {\n if (typeof pluginItem != 'function') {\n /**\n * The plugin replacing an existing plugin must be a function.\n *\n * @error plugincollection-replace-plugin-invalid-type\n */\n throw new CKEditorError('plugincollection-replace-plugin-invalid-type', null, { pluginItem });\n }\n const pluginName = pluginItem.pluginName;\n if (!pluginName) {\n /**\n * The plugin replacing an existing plugin must have a name.\n *\n * @error plugincollection-replace-plugin-missing-name\n */\n throw new CKEditorError('plugincollection-replace-plugin-missing-name', null, { pluginItem });\n }\n if (pluginItem.requires && pluginItem.requires.length) {\n /**\n * The plugin replacing an existing plugin cannot depend on other plugins.\n *\n * @error plugincollection-plugin-for-replacing-cannot-have-dependencies\n */\n throw new CKEditorError('plugincollection-plugin-for-replacing-cannot-have-dependencies', null, { pluginName });\n }\n const pluginToReplace = that._availablePlugins.get(pluginName);\n if (!pluginToReplace) {\n /**\n * The replaced plugin does not exist in the\n * {@link module:core/plugincollection~PluginCollection available plugins} collection.\n *\n * @error plugincollection-plugin-for-replacing-not-exist\n */\n throw new CKEditorError('plugincollection-plugin-for-replacing-not-exist', null, { pluginName });\n }\n const indexInPluginConstructors = pluginConstructors.indexOf(pluginToReplace);\n if (indexInPluginConstructors === -1) {\n // The Context feature can substitute plugins as well.\n // It may happen that the editor will be created with the given context, where the plugin for substitute\n // was already replaced. In such a case, we don't want to do it again.\n if (that._contextPlugins.has(pluginToReplace)) {\n return;\n }\n /**\n * The replaced plugin will not be loaded so it cannot be replaced.\n *\n * @error plugincollection-plugin-for-replacing-not-loaded\n */\n throw new CKEditorError('plugincollection-plugin-for-replacing-not-loaded', null, { pluginName });\n }\n if (pluginToReplace.requires && pluginToReplace.requires.length) {\n /**\n * The replaced plugin cannot depend on other plugins.\n *\n * @error plugincollection-replaced-plugin-cannot-have-dependencies\n */\n throw new CKEditorError('plugincollection-replaced-plugin-cannot-have-dependencies', null, { pluginName });\n }\n pluginConstructors.splice(indexInPluginConstructors, 1, pluginItem);\n that._availablePlugins.set(pluginName, pluginItem);\n }\n }\n }\n /**\n * Destroys all loaded plugins.\n */\n destroy() {\n const promises = [];\n for (const [, pluginInstance] of this) {\n if (typeof pluginInstance.destroy == 'function' && !this._contextPlugins.has(pluginInstance)) {\n promises.push(pluginInstance.destroy());\n }\n }\n return Promise.all(promises);\n }\n /**\n * Adds the plugin to the collection. Exposed mainly for testing purposes.\n *\n * @param PluginConstructor The plugin constructor.\n * @param plugin The instance of the plugin.\n */\n _add(PluginConstructor, plugin) {\n this._plugins.set(PluginConstructor, plugin);\n const pluginName = PluginConstructor.pluginName;\n if (!pluginName) {\n return;\n }\n if (this._plugins.has(pluginName)) {\n /**\n * Two plugins with the same {@link module:core/plugin~PluginStaticMembers#pluginName} were loaded.\n * This will lead to runtime conflicts between these plugins.\n *\n * In practice, this warning usually means that new plugins were added to an existing CKEditor 5 build.\n * Plugins should always be added to a source version of the editor (`@ckeditor/ckeditor5-editor-*`),\n * not to an editor imported from one of the `@ckeditor/ckeditor5-build-*` packages.\n *\n * Check your import paths and the list of plugins passed to\n * {@link module:core/editor/editor~Editor.create `Editor.create()`}\n * or specified in {@link module:core/editor/editor~Editor.builtinPlugins `Editor.builtinPlugins`}.\n *\n * The second option is that your `node_modules/` directory contains duplicated versions of the same\n * CKEditor 5 packages. Normally, on clean installations, npm deduplicates packages in `node_modules/`, so\n * it may be enough to call `rm -rf node_modules && npm i`. However, if you installed conflicting versions\n * of some packages, their dependencies may need to be installed in more than one version which may lead to this\n * warning.\n *\n * Technically speaking, this error occurs because after adding a plugin to an existing editor build\n * the dependencies of this plugin are being duplicated.\n * They are already built into that editor build and now get added for the second time as dependencies\n * of the plugin you are installing.\n *\n * Read more about {@glink installation/plugins/installing-plugins Installing plugins}.\n *\n * @error plugincollection-plugin-name-conflict\n * @param pluginName The duplicated plugin name.\n * @param plugin1 The first plugin constructor.\n * @param plugin2 The second plugin constructor.\n */\n throw new CKEditorError('plugincollection-plugin-name-conflict', null, { pluginName, plugin1: this._plugins.get(pluginName).constructor, plugin2: PluginConstructor });\n }\n this._plugins.set(pluginName, plugin);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/context\n */\nimport { Config, Collection, CKEditorError, Locale } from '@ckeditor/ckeditor5-utils';\nimport PluginCollection from './plugincollection';\n/**\n * Provides a common, higher-level environment for solutions that use multiple {@link module:core/editor/editor~Editor editors}\n * or plugins that work outside the editor. Use it instead of {@link module:core/editor/editor~Editor.create `Editor.create()`}\n * in advanced application integrations.\n *\n * All configuration options passed to a context will be used as default options for the editor instances initialized in that context.\n *\n * {@link module:core/contextplugin~ContextPlugin Context plugins} passed to a context instance will be shared among all\n * editor instances initialized in this context. These will be the same plugin instances for all the editors.\n *\n * **Note:** The context can only be initialized with {@link module:core/contextplugin~ContextPlugin context plugins}\n * (e.g. [comments](https://ckeditor.com/collaboration/comments/)). Regular {@link module:core/plugin~Plugin plugins} require an\n * editor instance to work and cannot be added to a context.\n *\n * **Note:** You can add a context plugin to an editor instance, though.\n *\n * If you are using multiple editor instances on one page and use any context plugins, create a context to share the configuration and\n * plugins among these editors. Some plugins will use the information about all existing editors to better integrate between them.\n *\n * If you are using plugins that do not require an editor to work (e.g. [comments](https://ckeditor.com/collaboration/comments/)),\n * enable and configure them using the context.\n *\n * If you are using only a single editor on each page, use {@link module:core/editor/editor~Editor.create `Editor.create()`} instead.\n * In such a case, a context instance will be created by the editor instance in a transparent way.\n *\n * See {@link ~Context.create `Context.create()`} for usage examples.\n */\nexport default class Context {\n /**\n * Creates a context instance with a given configuration.\n *\n * Usually not to be used directly. See the static {@link module:core/context~Context.create `create()`} method.\n *\n * @param config The context configuration.\n */\n constructor(config) {\n /**\n * Reference to the editor which created the context.\n * Null when the context was created outside of the editor.\n *\n * It is used to destroy the context when removing the editor that has created the context.\n */\n this._contextOwner = null;\n this.config = new Config(config, this.constructor.defaultConfig);\n const availablePlugins = this.constructor.builtinPlugins;\n this.config.define('plugins', availablePlugins);\n this.plugins = new PluginCollection(this, availablePlugins);\n const languageConfig = this.config.get('language') || {};\n this.locale = new Locale({\n uiLanguage: typeof languageConfig === 'string' ? languageConfig : languageConfig.ui,\n contentLanguage: this.config.get('language.content')\n });\n this.t = this.locale.t;\n this.editors = new Collection();\n }\n /**\n * Loads and initializes plugins specified in the configuration.\n *\n * @returns A promise which resolves once the initialization is completed, providing an array of loaded plugins.\n */\n initPlugins() {\n const plugins = this.config.get('plugins') || [];\n const substitutePlugins = this.config.get('substitutePlugins') || [];\n // Plugins for substitution should be checked as well.\n for (const Plugin of plugins.concat(substitutePlugins)) {\n if (typeof Plugin != 'function') {\n /**\n * Only a constructor function is allowed as a {@link module:core/contextplugin~ContextPlugin context plugin}.\n *\n * @error context-initplugins-constructor-only\n */\n throw new CKEditorError('context-initplugins-constructor-only', null, { Plugin });\n }\n if (Plugin.isContextPlugin !== true) {\n /**\n * Only a plugin marked as a {@link module:core/contextplugin~ContextPlugin.isContextPlugin context plugin}\n * is allowed to be used with a context.\n *\n * @error context-initplugins-invalid-plugin\n */\n throw new CKEditorError('context-initplugins-invalid-plugin', null, { Plugin });\n }\n }\n return this.plugins.init(plugins, [], substitutePlugins);\n }\n /**\n * Destroys the context instance and all editors used with the context,\n * releasing all resources used by the context.\n *\n * @returns A promise that resolves once the context instance is fully destroyed.\n */\n destroy() {\n return Promise.all(Array.from(this.editors, editor => editor.destroy()))\n .then(() => this.plugins.destroy());\n }\n /**\n * Adds a reference to the editor which is used with this context.\n *\n * When the given editor has created the context, the reference to this editor will be stored\n * as a {@link ~Context#_contextOwner}.\n *\n * This method should only be used by the editor.\n *\n * @internal\n * @param isContextOwner Stores the given editor as a context owner.\n */\n _addEditor(editor, isContextOwner) {\n if (this._contextOwner) {\n /**\n * Cannot add multiple editors to the context which is created by the editor.\n *\n * @error context-addeditor-private-context\n */\n throw new CKEditorError('context-addeditor-private-context');\n }\n this.editors.add(editor);\n if (isContextOwner) {\n this._contextOwner = editor;\n }\n }\n /**\n * Removes a reference to the editor which was used with this context.\n * When the context was created by the given editor, the context will be destroyed.\n *\n * This method should only be used by the editor.\n *\n * @internal\n * @return A promise that resolves once the editor is removed from the context or when the context was destroyed.\n */\n _removeEditor(editor) {\n if (this.editors.has(editor)) {\n this.editors.remove(editor);\n }\n if (this._contextOwner === editor) {\n return this.destroy();\n }\n return Promise.resolve();\n }\n /**\n * Returns the context configuration which will be copied to the editors created using this context.\n *\n * The configuration returned by this method has the plugins configuration removed &mdash; plugins are shared with all editors\n * through another mechanism.\n *\n * This method should only be used by the editor.\n *\n * @internal\n * @returns Configuration as a plain object.\n */\n _getEditorConfig() {\n const result = {};\n for (const name of this.config.names()) {\n if (!['plugins', 'removePlugins', 'extraPlugins'].includes(name)) {\n result[name] = this.config.get(name);\n }\n }\n return result;\n }\n /**\n * Creates and initializes a new context instance.\n *\n * ```ts\n * const commonConfig = { ... }; // Configuration for all the plugins and editors.\n * const editorPlugins = [ ... ]; // Regular plugins here.\n *\n * Context\n * \t.create( {\n * \t\t// Only context plugins here.\n * \t\tplugins: [ ... ],\n *\n * \t\t// Configure the language for all the editors (it cannot be overwritten).\n * \t\tlanguage: { ... },\n *\n * \t\t// Configuration for context plugins.\n * \t\tcomments: { ... },\n * \t\t...\n *\n * \t\t// Default configuration for editor plugins.\n * \t\ttoolbar: { ... },\n * \t\timage: { ... },\n * \t\t...\n * \t} )\n * \t.then( context => {\n * \t\tconst promises = [];\n *\n * \t\tpromises.push( ClassicEditor.create(\n * \t\t\tdocument.getElementById( 'editor1' ),\n * \t\t\t{\n * \t\t\t\teditorPlugins,\n * \t\t\t\tcontext\n * \t\t\t}\n * \t\t) );\n *\n * \t\tpromises.push( ClassicEditor.create(\n * \t\t\tdocument.getElementById( 'editor2' ),\n * \t\t\t{\n * \t\t\t\teditorPlugins,\n * \t\t\t\tcontext,\n * \t\t\t\ttoolbar: { ... } // You can overwrite the configuration of the context.\n * \t\t\t}\n * \t\t) );\n *\n * \t\treturn Promise.all( promises );\n * \t} );\n * ```\n *\n * @param config The context configuration.\n * @returns A promise resolved once the context is ready. The promise resolves with the created context instance.\n */\n static create(config) {\n return new Promise(resolve => {\n const context = new this(config);\n resolve(context.initPlugins().then(() => context));\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/contextplugin\n */\nimport { ObservableMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * The base class for {@link module:core/context~Context} plugin classes.\n *\n * A context plugin can either be initialized for an {@link module:core/editor/editor~Editor editor} or for\n * a {@link module:core/context~Context context}. In other words, it can either\n * work within one editor instance or with one or more editor instances that use a single context.\n * It is the context plugin's role to implement handling for both modes.\n *\n * There are a few rules for interaction between the editor plugins and context plugins:\n *\n * * A context plugin can require another context plugin.\n * * An {@link module:core/plugin~Plugin editor plugin} can require a context plugin.\n * * A context plugin MUST NOT require an {@link module:core/plugin~Plugin editor plugin}.\n */\nexport default class ContextPlugin extends ObservableMixin() {\n /**\n * Creates a new plugin instance.\n */\n constructor(context) {\n super();\n this.context = context;\n }\n /**\n * @inheritDoc\n */\n destroy() {\n this.stopListening();\n }\n /**\n * @inheritDoc\n */\n static get isContextPlugin() {\n return true;\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./placeholder.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/placeholder\n */\nimport '../../theme/placeholder.css';\n// Each document stores information about its placeholder elements and check functions.\nconst documentPlaceholders = new WeakMap();\n/**\n * A helper that enables a placeholder on the provided view element (also updates its visibility).\n * The placeholder is a CSS pseudoelement (with a text content) attached to the element.\n *\n * To change the placeholder text, simply call this method again with new options.\n *\n * To disable the placeholder, use {@link module:engine/view/placeholder~disablePlaceholder `disablePlaceholder()`} helper.\n *\n * @param options Configuration options of the placeholder.\n * @param options.view Editing view instance.\n * @param options.element Element that will gain a placeholder. See `options.isDirectHost` to learn more.\n * @param options.text Placeholder text.\n * @param options.isDirectHost If set `false`, the placeholder will not be enabled directly\n * in the passed `element` but in one of its children (selected automatically, i.e. a first empty child element).\n * Useful when attaching placeholders to elements that can host other elements (not just text), for instance,\n * editable root elements.\n * @param options.keepOnFocus If set `true`, the placeholder stay visible when the host element is focused.\n */\nexport function enablePlaceholder({ view, element, text, isDirectHost = true, keepOnFocus = false }) {\n const doc = view.document;\n // Use a single a single post fixer per—document to update all placeholders.\n if (!documentPlaceholders.has(doc)) {\n documentPlaceholders.set(doc, new Map());\n // If a post-fixer callback makes a change, it should return `true` so other postfixers\n // can reevaluate the document again.\n doc.registerPostFixer(writer => updateDocumentPlaceholders(doc, writer));\n // Update placeholders on isComposing state change since rendering is disabled while in composition mode.\n doc.on('change:isComposing', () => {\n view.change(writer => updateDocumentPlaceholders(doc, writer));\n }, { priority: 'high' });\n }\n // Store information about the element placeholder under its document.\n documentPlaceholders.get(doc).set(element, {\n text,\n isDirectHost,\n keepOnFocus,\n hostElement: isDirectHost ? element : null\n });\n // Update the placeholders right away.\n view.change(writer => updateDocumentPlaceholders(doc, writer));\n}\n/**\n * Disables the placeholder functionality from a given element.\n *\n * See {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} to learn more.\n */\nexport function disablePlaceholder(view, element) {\n const doc = element.document;\n if (!documentPlaceholders.has(doc)) {\n return;\n }\n view.change(writer => {\n const placeholders = documentPlaceholders.get(doc);\n const config = placeholders.get(element);\n writer.removeAttribute('data-placeholder', config.hostElement);\n hidePlaceholder(writer, config.hostElement);\n placeholders.delete(element);\n });\n}\n/**\n * Shows a placeholder in the provided element by changing related attributes and CSS classes.\n *\n * **Note**: This helper will not update the placeholder visibility nor manage the\n * it in any way in the future. What it does is a onetime state change of an element. Use\n * {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} and\n * {@link module:engine/view/placeholder~disablePlaceholder `disablePlaceholder()`} for full\n * placeholder functionality.\n *\n * **Note**: This helper will blindly show the placeholder directly in the root editable element if\n * one is passed, which could result in a visual clash if the editable element has some children\n * (for instance, an empty paragraph). Use {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`}\n * in that case or make sure the correct element is passed to the helper.\n *\n * @returns `true`, if any changes were made to the `element`.\n */\nexport function showPlaceholder(writer, element) {\n if (!element.hasClass('ck-placeholder')) {\n writer.addClass('ck-placeholder', element);\n return true;\n }\n return false;\n}\n/**\n * Hides a placeholder in the element by changing related attributes and CSS classes.\n *\n * **Note**: This helper will not update the placeholder visibility nor manage the\n * it in any way in the future. What it does is a onetime state change of an element. Use\n * {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} and\n * {@link module:engine/view/placeholder~disablePlaceholder `disablePlaceholder()`} for full\n * placeholder functionality.\n *\n * @returns `true`, if any changes were made to the `element`.\n */\nexport function hidePlaceholder(writer, element) {\n if (element.hasClass('ck-placeholder')) {\n writer.removeClass('ck-placeholder', element);\n return true;\n }\n return false;\n}\n/**\n * Checks if a placeholder should be displayed in the element.\n *\n * **Note**: This helper will blindly check the possibility of showing a placeholder directly in the\n * root editable element if one is passed, which may not be the expected result. If an element can\n * host other elements (not just text), most likely one of its children should be checked instead\n * because it will be the final host for the placeholder. Use\n * {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} in that case or make\n * sure the correct element is passed to the helper.\n *\n * @param element Element that holds the placeholder.\n * @param keepOnFocus Focusing the element will keep the placeholder visible.\n */\nexport function needsPlaceholder(element, keepOnFocus) {\n if (!element.isAttached()) {\n return false;\n }\n // Anything but uiElement(s) counts as content.\n const hasContent = Array.from(element.getChildren())\n .some(element => !element.is('uiElement'));\n if (hasContent) {\n return false;\n }\n const doc = element.document;\n const viewSelection = doc.selection;\n const selectionAnchor = viewSelection.anchor;\n if (doc.isComposing && selectionAnchor && selectionAnchor.parent === element) {\n return false;\n }\n // Skip the focus check and make the placeholder visible already regardless of document focus state.\n if (keepOnFocus) {\n return true;\n }\n // If the document is blurred.\n if (!doc.isFocused) {\n return true;\n }\n // If document is focused and the element is empty but the selection is not anchored inside it.\n return !!selectionAnchor && selectionAnchor.parent !== element;\n}\n/**\n * Updates all placeholders associated with a document in a postfixer callback.\n *\n * @returns True if any changes were made to the view document.\n */\nfunction updateDocumentPlaceholders(doc, writer) {\n const placeholders = documentPlaceholders.get(doc);\n const directHostElements = [];\n let wasViewModified = false;\n // First set placeholders on the direct hosts.\n for (const [element, config] of placeholders) {\n if (config.isDirectHost) {\n directHostElements.push(element);\n if (updatePlaceholder(writer, element, config)) {\n wasViewModified = true;\n }\n }\n }\n // Then set placeholders on the indirect hosts but only on those that does not already have an direct host placeholder.\n for (const [element, config] of placeholders) {\n if (config.isDirectHost) {\n continue;\n }\n const hostElement = getChildPlaceholderHostSubstitute(element);\n // When not a direct host, it could happen that there is no child element\n // capable of displaying a placeholder.\n if (!hostElement) {\n continue;\n }\n // Don't override placeholder if the host element already has some direct placeholder.\n if (directHostElements.includes(hostElement)) {\n continue;\n }\n // Update the host element (used for setting and removing the placeholder).\n config.hostElement = hostElement;\n if (updatePlaceholder(writer, element, config)) {\n wasViewModified = true;\n }\n }\n return wasViewModified;\n}\n/**\n * Updates a single placeholder in a postfixer callback.\n *\n * @returns True if any changes were made to the view document.\n */\nfunction updatePlaceholder(writer, element, config) {\n const { text, isDirectHost, hostElement } = config;\n let wasViewModified = false;\n // This may be necessary when updating the placeholder text to something else.\n if (hostElement.getAttribute('data-placeholder') !== text) {\n writer.setAttribute('data-placeholder', text, hostElement);\n wasViewModified = true;\n }\n // If the host element is not a direct host then placeholder is needed only when there is only one element.\n const isOnlyChild = isDirectHost || element.childCount == 1;\n if (isOnlyChild && needsPlaceholder(hostElement, config.keepOnFocus)) {\n if (showPlaceholder(writer, hostElement)) {\n wasViewModified = true;\n }\n }\n else if (hidePlaceholder(writer, hostElement)) {\n wasViewModified = true;\n }\n return wasViewModified;\n}\n/**\n * Gets a child element capable of displaying a placeholder if a parent element can host more\n * than just text (for instance, when it is a root editable element). The child element\n * can then be used in other placeholder helpers as a substitute of its parent.\n */\nfunction getChildPlaceholderHostSubstitute(parent) {\n if (parent.childCount) {\n const firstChild = parent.getChild(0);\n if (firstChild.is('element') && !firstChild.is('uiElement') && !firstChild.is('attributeElement')) {\n return firstChild;\n }\n }\n return null;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/typecheckable\n */\nexport default class TypeCheckable {\n /* istanbul ignore next -- @preserve */\n is() {\n // There are a lot of overloads above.\n // Overriding method in derived classes remove them and only `is( type: string ): boolean` is visible which we don't want.\n // One option would be to copy them all to all classes, but that's ugly.\n // It's best when TypeScript compiler doesn't see those overloads, except the one in the top base class.\n // To overload a method, but not let the compiler see it, do after class definition:\n // `MyClass.prototype.is = function( type: string ) {...}`\n throw new Error('is() method is abstract');\n }\n}\n","import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_SYMBOLS_FLAG = 4;\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, CLONE_SYMBOLS_FLAG);\n}\n\nexport default clone;\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/node\n */\nimport TypeCheckable from './typecheckable';\nimport { CKEditorError, EmitterMixin, compareArrays } from '@ckeditor/ckeditor5-utils';\nimport { clone } from 'lodash-es';\n// To check if component is loaded more than once.\nimport '@ckeditor/ckeditor5-utils/src/version';\n/**\n * Abstract view node class.\n *\n * This is an abstract class. Its constructor should not be used directly.\n * Use the {@link module:engine/view/downcastwriter~DowncastWriter} or {@link module:engine/view/upcastwriter~UpcastWriter}\n * to create new instances of view nodes.\n */\nexport default class Node extends EmitterMixin(TypeCheckable) {\n /**\n * Creates a tree view node.\n *\n * @param document The document instance to which this node belongs.\n */\n constructor(document) {\n super();\n this.document = document;\n this.parent = null;\n }\n /**\n * Index of the node in the parent element or null if the node has no parent.\n *\n * Accessing this property throws an error if this node's parent element does not contain it.\n * This means that view tree got broken.\n */\n get index() {\n let pos;\n if (!this.parent) {\n return null;\n }\n // No parent or child doesn't exist in parent's children.\n if ((pos = this.parent.getChildIndex(this)) == -1) {\n /**\n * The node's parent does not contain this node. It means that the document tree is corrupted.\n *\n * @error view-node-not-found-in-parent\n */\n throw new CKEditorError('view-node-not-found-in-parent', this);\n }\n return pos;\n }\n /**\n * Node's next sibling, or `null` if it is the last child.\n */\n get nextSibling() {\n const index = this.index;\n return (index !== null && this.parent.getChild(index + 1)) || null;\n }\n /**\n * Node's previous sibling, or `null` if it is the first child.\n */\n get previousSibling() {\n const index = this.index;\n return (index !== null && this.parent.getChild(index - 1)) || null;\n }\n /**\n * Top-most ancestor of the node. If the node has no parent it is the root itself.\n */\n get root() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias, consistent-this\n let root = this;\n while (root.parent) {\n root = root.parent;\n }\n return root;\n }\n /**\n * Returns true if the node is in a tree rooted in the document (is a descendant of one of its roots).\n */\n isAttached() {\n return this.root.is('rootElement');\n }\n /**\n * Gets a path to the node. The path is an array containing indices of consecutive ancestors of this node,\n * beginning from {@link module:engine/view/node~Node#root root}, down to this node's index.\n *\n * ```ts\n * const abc = downcastWriter.createText( 'abc' );\n * const foo = downcastWriter.createText( 'foo' );\n * const h1 = downcastWriter.createElement( 'h1', null, downcastWriter.createText( 'header' ) );\n * const p = downcastWriter.createElement( 'p', null, [ abc, foo ] );\n * const div = downcastWriter.createElement( 'div', null, [ h1, p ] );\n * foo.getPath(); // Returns [ 1, 3 ]. `foo` is in `p` which is in `div`. `p` starts at offset 1, while `foo` at 3.\n * h1.getPath(); // Returns [ 0 ].\n * div.getPath(); // Returns [].\n * ```\n *\n * @returns The path.\n */\n getPath() {\n const path = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias, consistent-this\n let node = this;\n while (node.parent) {\n path.unshift(node.index);\n node = node.parent;\n }\n return path;\n }\n /**\n * Returns ancestors array of this node.\n *\n * @param options Options object.\n * @param options.includeSelf When set to `true` this node will be also included in parent's array.\n * @param options.parentFirst When set to `true`, array will be sorted from node's parent to root element,\n * otherwise root element will be the first item in the array.\n * @returns Array with ancestors.\n */\n getAncestors(options = {}) {\n const ancestors = [];\n let parent = options.includeSelf ? this : this.parent;\n while (parent) {\n ancestors[options.parentFirst ? 'push' : 'unshift'](parent);\n parent = parent.parent;\n }\n return ancestors;\n }\n /**\n * Returns a {@link module:engine/view/element~Element} or {@link module:engine/view/documentfragment~DocumentFragment}\n * which is a common ancestor of both nodes.\n *\n * @param node The second node.\n * @param options Options object.\n * @param options.includeSelf When set to `true` both nodes will be considered \"ancestors\" too.\n * Which means that if e.g. node A is inside B, then their common ancestor will be B.\n */\n getCommonAncestor(node, options = {}) {\n const ancestorsA = this.getAncestors(options);\n const ancestorsB = node.getAncestors(options);\n let i = 0;\n while (ancestorsA[i] == ancestorsB[i] && ancestorsA[i]) {\n i++;\n }\n return i === 0 ? null : ancestorsA[i - 1];\n }\n /**\n * Returns whether this node is before given node. `false` is returned if nodes are in different trees (for example,\n * in different {@link module:engine/view/documentfragment~DocumentFragment}s).\n *\n * @param node Node to compare with.\n */\n isBefore(node) {\n // Given node is not before this node if they are same.\n if (this == node) {\n return false;\n }\n // Return `false` if it is impossible to compare nodes.\n if (this.root !== node.root) {\n return false;\n }\n const thisPath = this.getPath();\n const nodePath = node.getPath();\n const result = compareArrays(thisPath, nodePath);\n switch (result) {\n case 'prefix':\n return true;\n case 'extension':\n return false;\n default:\n return thisPath[result] < nodePath[result];\n }\n }\n /**\n * Returns whether this node is after given node. `false` is returned if nodes are in different trees (for example,\n * in different {@link module:engine/view/documentfragment~DocumentFragment}s).\n *\n * @param node Node to compare with.\n */\n isAfter(node) {\n // Given node is not before this node if they are same.\n if (this == node) {\n return false;\n }\n // Return `false` if it is impossible to compare nodes.\n if (this.root !== node.root) {\n return false;\n }\n // In other cases, just check if the `node` is before, and return the opposite.\n return !this.isBefore(node);\n }\n /**\n * Removes node from parent.\n *\n * @internal\n */\n _remove() {\n this.parent._removeChildren(this.index);\n }\n /**\n * @internal\n * @param type Type of the change.\n * @param node Changed node.\n * @fires change\n */\n _fireChange(type, node) {\n this.fire(`change:${type}`, node);\n if (this.parent) {\n this.parent._fireChange(type, node);\n }\n }\n /**\n * Custom toJSON method to solve child-parent circular dependencies.\n *\n * @returns Clone of this object with the parent property removed.\n */\n toJSON() {\n const json = clone(this);\n // Due to circular references we need to remove parent reference.\n delete json.parent;\n return json;\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nNode.prototype.is = function (type) {\n return type === 'node' || type === 'view:node';\n};\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/text\n */\nimport Node from './node';\n/**\n * Tree view text node.\n *\n * The constructor of this class should not be used directly. To create a new text node instance\n * use the {@link module:engine/view/downcastwriter~DowncastWriter#createText `DowncastWriter#createText()`}\n * method when working on data downcasted from the model or the\n * {@link module:engine/view/upcastwriter~UpcastWriter#createText `UpcastWriter#createText()`}\n * method when working on non-semantic views.\n */\nexport default class Text extends Node {\n /**\n * Creates a tree view text node.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#createText\n * @internal\n * @param document The document instance to which this text node belongs.\n * @param data The text's data.\n */\n constructor(document, data) {\n super(document);\n this._textData = data;\n }\n /**\n * The text content.\n */\n get data() {\n return this._textData;\n }\n /**\n * The `_data` property is controlled by a getter and a setter.\n *\n * The getter is required when using the addition assignment operator on protected property:\n *\n * ```ts\n * const foo = downcastWriter.createText( 'foo' );\n * const bar = downcastWriter.createText( 'bar' );\n *\n * foo._data += bar.data; // executes: `foo._data = foo._data + bar.data`\n * console.log( foo.data ); // prints: 'foobar'\n * ```\n *\n * If the protected getter didn't exist, `foo._data` will return `undefined` and result of the merge will be invalid.\n *\n * The setter sets data and fires the {@link module:engine/view/node~Node#event:change:text change event}.\n *\n * @internal\n */\n get _data() {\n return this.data;\n }\n set _data(data) {\n this._fireChange('text', this);\n this._textData = data;\n }\n /**\n * Checks if this text node is similar to other text node.\n * Both nodes should have the same data to be considered as similar.\n *\n * @param otherNode Node to check if it is same as this node.\n */\n isSimilar(otherNode) {\n if (!(otherNode instanceof Text)) {\n return false;\n }\n return this === otherNode || this.data === otherNode.data;\n }\n /**\n * Clones this node.\n *\n * @internal\n * @returns Text node that is a clone of this node.\n */\n _clone() {\n return new Text(this.document, this.data);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nText.prototype.is = function (type) {\n return type === '$text' || type === 'view:$text' ||\n // This are legacy values kept for backward compatibility.\n type === 'text' || type === 'view:text' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'node' || type === 'view:node';\n};\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/textproxy\n */\nimport TypeCheckable from './typecheckable';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * TextProxy is a wrapper for substring of {@link module:engine/view/text~Text}. Instance of this class is created by\n * {@link module:engine/view/treewalker~TreeWalker} when only a part of {@link module:engine/view/text~Text} needs to be returned.\n *\n * `TextProxy` has an API similar to {@link module:engine/view/text~Text Text} and allows to do most of the common tasks performed\n * on view nodes.\n *\n * **Note:** Some `TextProxy` instances may represent whole text node, not just a part of it.\n * See {@link module:engine/view/textproxy~TextProxy#isPartial}.\n *\n * **Note:** `TextProxy` is a readonly interface.\n *\n * **Note:** `TextProxy` instances are created on the fly basing on the current state of parent {@link module:engine/view/text~Text}.\n * Because of this it is highly unrecommended to store references to `TextProxy instances because they might get\n * invalidated due to operations on Document. Also TextProxy is not a {@link module:engine/view/node~Node} so it can not be\n * inserted as a child of {@link module:engine/view/element~Element}.\n *\n * `TextProxy` instances are created by {@link module:engine/view/treewalker~TreeWalker view tree walker}. You should not need to create\n * an instance of this class by your own.\n */\nexport default class TextProxy extends TypeCheckable {\n /**\n * Creates a text proxy.\n *\n * @internal\n * @param textNode Text node which part is represented by this text proxy.\n * @param offsetInText Offset in {@link module:engine/view/textproxy~TextProxy#textNode text node}\n * from which the text proxy starts.\n * @param length Text proxy length, that is how many text node's characters, starting from `offsetInText` it represents.\n * @constructor\n */\n constructor(textNode, offsetInText, length) {\n super();\n this.textNode = textNode;\n if (offsetInText < 0 || offsetInText > textNode.data.length) {\n /**\n * Given offsetInText value is incorrect.\n *\n * @error view-textproxy-wrong-offsetintext\n */\n throw new CKEditorError('view-textproxy-wrong-offsetintext', this);\n }\n if (length < 0 || offsetInText + length > textNode.data.length) {\n /**\n * Given length value is incorrect.\n *\n * @error view-textproxy-wrong-length\n */\n throw new CKEditorError('view-textproxy-wrong-length', this);\n }\n this.data = textNode.data.substring(offsetInText, offsetInText + length);\n this.offsetInText = offsetInText;\n }\n /**\n * Offset size of this node.\n */\n get offsetSize() {\n return this.data.length;\n }\n /**\n * Flag indicating whether `TextProxy` instance covers only part of the original {@link module:engine/view/text~Text text node}\n * (`true`) or the whole text node (`false`).\n *\n * This is `false` when text proxy starts at the very beginning of {@link module:engine/view/textproxy~TextProxy#textNode textNode}\n * ({@link module:engine/view/textproxy~TextProxy#offsetInText offsetInText} equals `0`) and text proxy sizes is equal to\n * text node size.\n */\n get isPartial() {\n return this.data.length !== this.textNode.data.length;\n }\n /**\n * Parent of this text proxy, which is same as parent of text node represented by this text proxy.\n */\n get parent() {\n return this.textNode.parent;\n }\n /**\n * Root of this text proxy, which is same as root of text node represented by this text proxy.\n */\n get root() {\n return this.textNode.root;\n }\n /**\n * {@link module:engine/view/document~Document View document} that owns this text proxy, or `null` if the text proxy is inside\n * {@link module:engine/view/documentfragment~DocumentFragment document fragment}.\n */\n get document() {\n return this.textNode.document;\n }\n /**\n * Returns ancestors array of this text proxy.\n *\n * @param options Options object.\n * @param options.includeSelf When set to `true`, textNode will be also included in parent's array.\n * @param options.parentFirst When set to `true`, array will be sorted from text proxy parent to\n * root element, otherwise root element will be the first item in the array.\n * @returns Array with ancestors.\n */\n getAncestors(options = {}) {\n const ancestors = [];\n let parent = options.includeSelf ? this.textNode : this.parent;\n while (parent !== null) {\n ancestors[options.parentFirst ? 'push' : 'unshift'](parent);\n parent = parent.parent;\n }\n return ancestors;\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nTextProxy.prototype.is = function (type) {\n return type === '$textProxy' || type === 'view:$textProxy' ||\n // This are legacy values kept for backward compatibility.\n type === 'textProxy' || type === 'view:textProxy';\n};\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { isPlainObject } from 'lodash-es';\nimport { logWarning } from '@ckeditor/ckeditor5-utils';\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 /**\n * Creates new instance of Matcher.\n *\n * @param pattern Match patterns. See {@link module:engine/view/matcher~Matcher#add add method} for more information.\n */\n constructor(...pattern) {\n this._patterns = [];\n this.add(...pattern);\n }\n /**\n * Adds pattern or patterns to matcher instance.\n *\n * ```ts\n * // String.\n * matcher.add( 'div' );\n *\n * // Regular expression.\n * matcher.add( /^\\w/ );\n *\n * // Single class.\n * matcher.add( {\n * \tclasses: 'foobar'\n * } );\n * ```\n *\n * See {@link module:engine/view/matcher~MatcherPattern} for more examples.\n *\n * Multiple patterns can be added in one call:\n *\n * ```ts\n * matcher.add( 'div', { classes: 'foobar' } );\n * ```\n *\n * @param pattern Object describing pattern details. If string or regular expression\n * is provided it will be used to match element's name. Pattern can be also provided in a form\n * of a function - then this function will be called with each {@link module:engine/view/element~Element element} as a parameter.\n * Function's return value will be stored under `match` key of the object returned from\n * {@link module:engine/view/matcher~Matcher#match match} or {@link module:engine/view/matcher~Matcher#matchAll matchAll} methods.\n */\n add(...pattern) {\n for (let item of pattern) {\n // String or RegExp pattern is used as element's name.\n if (typeof item == 'string' || item instanceof RegExp) {\n item = { name: item };\n }\n this._patterns.push(item);\n }\n }\n /**\n * Matches elements for currently stored patterns. Returns match information about first found\n * {@link module:engine/view/element~Element element}, otherwise returns `null`.\n *\n * Example of returned object:\n *\n * ```ts\n * {\n * \telement: <instance of found element>,\n * \tpattern: <pattern used to match found element>,\n * \tmatch: {\n * \t\tname: true,\n * \t\tattributes: [ 'title', 'href' ],\n * \t\tclasses: [ 'foo' ],\n * \t\tstyles: [ 'color', 'position' ]\n * \t}\n * }\n * ```\n *\n * @see module:engine/view/matcher~Matcher#add\n * @see module:engine/view/matcher~Matcher#matchAll\n * @param element View element to match against stored patterns.\n */\n match(...element) {\n for (const singleElement of element) {\n for (const pattern of this._patterns) {\n const match = isElementMatching(singleElement, pattern);\n if (match) {\n return {\n element: singleElement,\n pattern,\n match\n };\n }\n }\n }\n return null;\n }\n /**\n * Matches elements for currently stored patterns. Returns array of match information with all found\n * {@link module:engine/view/element~Element elements}. If no element is found - returns `null`.\n *\n * @see module:engine/view/matcher~Matcher#add\n * @see module:engine/view/matcher~Matcher#match\n * @param element View element to match against stored patterns.\n * @returns Array with match information about found elements or `null`. For more information\n * see {@link module:engine/view/matcher~Matcher#match match method} description.\n */\n matchAll(...element) {\n const results = [];\n for (const singleElement of element) {\n for (const pattern of this._patterns) {\n const match = isElementMatching(singleElement, pattern);\n if (match) {\n results.push({\n element: singleElement,\n pattern,\n match\n });\n }\n }\n }\n return results.length > 0 ? results : null;\n }\n /**\n * Returns the name of the element to match if there is exactly one pattern added to the matcher instance\n * and it matches element name defined by `string` (not `RegExp`). Otherwise, returns `null`.\n *\n * @returns Element name trying to match.\n */\n getElementName() {\n if (this._patterns.length !== 1) {\n return null;\n }\n const pattern = this._patterns[0];\n const name = pattern.name;\n return (typeof pattern != 'function' && name && !(name instanceof RegExp)) ? name : null;\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 * @returns Returns object with match information or null if element is not matching.\n */\nfunction isElementMatching(element, pattern) {\n // If pattern is provided as function - return result of that function;\n if (typeof pattern == 'function') {\n return pattern(element);\n }\n const match = {};\n // Check element's name.\n if (pattern.name) {\n match.name = matchName(pattern.name, element.name);\n if (!match.name) {\n return null;\n }\n }\n // Check element's attributes.\n if (pattern.attributes) {\n match.attributes = matchAttributes(pattern.attributes, element);\n if (!match.attributes) {\n return null;\n }\n }\n // Check element's classes.\n if (pattern.classes) {\n match.classes = matchClasses(pattern.classes, element);\n if (!match.classes) {\n return null;\n }\n }\n // Check element's styles.\n if (pattern.styles) {\n match.styles = matchStyles(pattern.styles, element);\n if (!match.styles) {\n return null;\n }\n }\n return match;\n}\n/**\n * Checks if name can be matched by provided pattern.\n *\n * @returns Returns `true` if name can be matched, `false` otherwise.\n */\nfunction matchName(pattern, name) {\n // If pattern is provided as RegExp - test against this regexp.\n if (pattern instanceof RegExp) {\n return !!name.match(pattern);\n }\n return pattern === name;\n}\n/**\n * Checks if an array of key/value pairs can be matched against provided patterns.\n *\n * Patterns can be provided in a following ways:\n * - a boolean value matches any attribute with any value (or no value):\n *\n * ```ts\n * pattern: true\n * ```\n *\n * - a RegExp expression or object matches any attribute name:\n *\n * ```ts\n * pattern: /h[1-6]/\n * ```\n *\n * - an object matches any attribute that has the same name as the object item's key, where object item's value is:\n * \t- equal to `true`, which matches any attribute value:\n *\n * ```ts\n * pattern: {\n * \trequired: true\n * }\n * ```\n *\n * \t- a string that is equal to attribute value:\n *\n * ```ts\n * pattern: {\n * \trel: 'nofollow'\n * }\n * ```\n *\n * \t- a regular expression that matches attribute value,\n *\n * ```ts\n * pattern: {\n * \tsrc: /^https/\n * }\n * ```\n *\n * - an array with items, where the item is:\n * \t- a string that is equal to attribute value:\n *\n * ```ts\n * pattern: [ 'data-property-1', 'data-property-2' ],\n * ```\n *\n * \t- an object with `key` and `value` property, where `key` is a regular expression matching attribute name and\n * \t\t`value` is either regular expression matching attribute value or a string equal to attribute value:\n *\n * ```ts\n * pattern: [\n * \t{ key: /^data-property-/, value: true },\n * \t// or:\n * \t{ key: /^data-property-/, value: 'foobar' },\n * \t// or:\n * \t{ key: /^data-property-/, value: /^foo/ }\n * ]\n * ```\n *\n * @param patterns Object with information about attributes to match.\n * @param keys Attribute, style or class keys.\n * @param valueGetter A function providing value for a given item key.\n * @returns Returns array with matched attribute names or `null` if no attributes were matched.\n */\nfunction matchPatterns(patterns, keys, valueGetter) {\n const normalizedPatterns = normalizePatterns(patterns);\n const normalizedItems = Array.from(keys);\n const match = [];\n normalizedPatterns.forEach(([patternKey, patternValue]) => {\n normalizedItems.forEach(itemKey => {\n if (isKeyMatched(patternKey, itemKey) &&\n isValueMatched(patternValue, itemKey, valueGetter)) {\n match.push(itemKey);\n }\n });\n });\n // Return matches only if there are at least as many of them as there are patterns.\n // The RegExp pattern can match more than one item.\n if (!normalizedPatterns.length || match.length < normalizedPatterns.length) {\n return undefined;\n }\n return match;\n}\n/**\n * Bring all the possible pattern forms to an array of arrays where first item is a key and second is a value.\n *\n * Examples:\n *\n * Boolean pattern value:\n *\n * ```ts\n * true\n * ```\n *\n * to\n *\n * ```ts\n * [ [ true, true ] ]\n * ```\n *\n * Textual pattern value:\n *\n * ```ts\n * 'attribute-name-or-class-or-style'\n * ```\n *\n * to\n *\n * ```ts\n * [ [ 'attribute-name-or-class-or-style', true ] ]\n * ```\n *\n * Regular expression:\n *\n * ```ts\n * /^data-.*$/\n * ```\n *\n * to\n *\n * ```ts\n * [ [ /^data-.*$/, true ] ]\n * ```\n *\n * Objects (plain or with `key` and `value` specified explicitly):\n *\n * ```ts\n * {\n * \tsrc: /^https:.*$/\n * }\n * ```\n *\n * or\n *\n * ```ts\n * [ {\n * \tkey: 'src',\n * \tvalue: /^https:.*$/\n * } ]\n * ```\n *\n * to:\n *\n * ```ts\n * [ [ 'src', /^https:.*$/ ] ]\n * ```\n *\n * @returns Returns an array of objects or null if provided patterns were not in an expected form.\n */\nfunction normalizePatterns(patterns) {\n if (Array.isArray(patterns)) {\n return patterns.map((pattern) => {\n if (isPlainObject(pattern)) {\n if (pattern.key === undefined || pattern.value === undefined) {\n // Documented at the end of matcher.js.\n logWarning('matcher-pattern-missing-key-or-value', pattern);\n }\n return [pattern.key, pattern.value];\n }\n // Assume the pattern is either String or RegExp.\n return [pattern, true];\n });\n }\n if (isPlainObject(patterns)) {\n return Object.entries(patterns);\n }\n // Other cases (true, string or regexp).\n return [[patterns, true]];\n}\n/**\n * @param patternKey A pattern representing a key we want to match.\n * @param itemKey An actual item key (e.g. `'src'`, `'background-color'`, `'ck-widget'`) we're testing against pattern.\n */\nfunction isKeyMatched(patternKey, itemKey) {\n return patternKey === true ||\n patternKey === itemKey ||\n patternKey instanceof RegExp && itemKey.match(patternKey);\n}\n/**\n * @param patternValue A pattern representing a value we want to match.\n * @param itemKey An item key, e.g. `background`, `href`, 'rel', etc.\n * @param valueGetter A function used to provide a value for a given `itemKey`.\n */\nfunction isValueMatched(patternValue, itemKey, valueGetter) {\n if (patternValue === true) {\n return true;\n }\n const itemValue = valueGetter(itemKey);\n // For now, the reducers are not returning the full tree of properties.\n // Casting to string preserves the old behavior until the root cause is fixed.\n // More can be found in https://github.com/ckeditor/ckeditor5/issues/10399.\n return patternValue === itemValue ||\n patternValue instanceof RegExp && !!String(itemValue).match(patternValue);\n}\n/**\n * Checks if attributes of provided element can be matched against provided patterns.\n *\n * @param 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 element Element which attributes will be tested.\n * @returns Returns array with matched attribute names or `null` if no attributes were matched.\n */\nfunction matchAttributes(patterns, element) {\n const attributeKeys = new Set(element.getAttributeKeys());\n // `style` and `class` attribute keys are deprecated. Only allow them in object pattern\n // for backward compatibility.\n if (isPlainObject(patterns)) {\n if (patterns.style !== undefined) {\n // Documented at the end of matcher.js.\n logWarning('matcher-pattern-deprecated-attributes-style-key', patterns);\n }\n if (patterns.class !== undefined) {\n // Documented at the end of matcher.js.\n logWarning('matcher-pattern-deprecated-attributes-class-key', patterns);\n }\n }\n else {\n attributeKeys.delete('style');\n attributeKeys.delete('class');\n }\n return matchPatterns(patterns, attributeKeys, key => element.getAttribute(key));\n}\n/**\n * Checks if classes of provided element can be matched against provided patterns.\n *\n * @param patterns Array of strings or regular expressions to match against element's classes.\n * @param element Element which classes will be tested.\n * @returns Returns array with matched class names or `null` if no classes were matched.\n */\nfunction matchClasses(patterns, element) {\n // We don't need `getter` here because patterns for classes are always normalized to `[ className, true ]`.\n return matchPatterns(patterns, element.getClassNames(), /* istanbul ignore next -- @preserve */ () => { });\n}\n/**\n * Checks if styles of provided element can be matched against provided patterns.\n *\n * @param 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 element Element which styles will be tested.\n * @returns Returns array with matched style names or `null` if no styles were matched.\n */\nfunction matchStyles(patterns, element) {\n return matchPatterns(patterns, element.getStyleNames(true), key => element.getStyle(key));\n}\n/**\n * The key-value matcher pattern is missing key or value. Both must be present.\n * Refer the documentation: {@link module:engine/view/matcher~MatcherPattern}.\n *\n * @param pattern Pattern with missing properties.\n * @error matcher-pattern-missing-key-or-value\n */\n/**\n * The key-value matcher pattern for `attributes` option is using deprecated `style` key.\n *\n * Use `styles` matcher pattern option instead:\n *\n * ```ts\n * // Instead of:\n * const pattern = {\n * \tattributes: {\n * \t\tkey1: 'value1',\n * \t\tkey2: 'value2',\n * \t\tstyle: /^border.*$/\n * \t}\n * }\n *\n * // Use:\n * const pattern = {\n * \tattributes: {\n * \t\tkey1: 'value1',\n * \t\tkey2: 'value2'\n * \t},\n * \tstyles: /^border.*$/\n * }\n * ```\n *\n * Refer to the {@glink updating/guides/update-to-29##update-to-ckeditor-5-v2910 Migration to v29.1.0} guide\n * and {@link module:engine/view/matcher~MatcherPattern} documentation.\n *\n * @param pattern Pattern with missing properties.\n * @error matcher-pattern-deprecated-attributes-style-key\n */\n/**\n * The key-value matcher pattern for `attributes` option is using deprecated `class` key.\n *\n * Use `classes` matcher pattern option instead:\n *\n * ```ts\n * // Instead of:\n * const pattern = {\n * \tattributes: {\n * \t\tkey1: 'value1',\n * \t\tkey2: 'value2',\n * \t\tclass: 'foobar'\n * \t}\n * }\n *\n * // Use:\n * const pattern = {\n * \tattributes: {\n * \t\tkey1: 'value1',\n * \t\tkey2: 'value2'\n * \t},\n * \tclasses: 'foobar'\n * }\n * ```\n *\n * Refer to the {@glink updating/guides/update-to-29##update-to-ckeditor-5-v2910 Migration to v29.1.0} guide\n * and the {@link module:engine/view/matcher~MatcherPattern} documentation.\n *\n * @param pattern Pattern with missing properties.\n * @error matcher-pattern-deprecated-attributes-class-key\n */\n","import isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\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","import MapCache from './_MapCache.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nexport default memoize;\n","import memoize from './memoize.js';\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nexport default memoizeCapped;\n","import memoizeCapped from './_memoizeCapped.js';\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nexport default stringToPath;\n","/**\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 == null ? 0 : 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","import Symbol from './_Symbol.js';\nimport arrayMap from './_arrayMap.js';\nimport isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default baseToString;\n","import baseToString from './_baseToString.js';\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nexport default toString;\n","import isArray from './isArray.js';\nimport isKey from './_isKey.js';\nimport stringToPath from './_stringToPath.js';\nimport toString from './toString.js';\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 * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nexport default castPath;\n","/**\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 == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n}\n\nexport default last;\n","import isSymbol from './isSymbol.js';\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","import castPath from './_castPath.js';\nimport toKey from './_toKey.js';\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 = castPath(path, object);\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 * 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","import baseGet from './_baseGet.js';\nimport baseSlice from './_baseSlice.js';\n\n/**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\nfunction parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n}\n\nexport default parent;\n","import castPath from './_castPath.js';\nimport last from './last.js';\nimport parent from './_parent.js';\nimport toKey from './_toKey.js';\n\n/**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\nfunction baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n}\n\nexport default baseUnset;\n","import baseUnset from './_baseUnset.js';\n\n/**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\nfunction unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n}\n\nexport default unset;\n","import baseGet from './_baseGet.js';\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nexport default get;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\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 assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignMergeValue;\n","import createBaseFor from './_createBaseFor.js';\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nexport default baseFor;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nexport default createBaseFor;\n","import isArrayLike from './isArrayLike.js';\nimport isObjectLike from './isObjectLike.js';\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 * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nexport default safeGet;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nexport default toPlainObject;\n","import assignMergeValue from './_assignMergeValue.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\nimport copyArray from './_copyArray.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isArrayLikeObject from './isArrayLikeObject.js';\nimport isBuffer from './isBuffer.js';\nimport isFunction from './isFunction.js';\nimport isObject from './isObject.js';\nimport isPlainObject from './isPlainObject.js';\nimport isTypedArray from './isTypedArray.js';\nimport safeGet from './_safeGet.js';\nimport toPlainObject from './toPlainObject.js';\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nexport default baseMergeDeep;\n","import Stack from './_Stack.js';\nimport assignMergeValue from './_assignMergeValue.js';\nimport baseFor from './_baseFor.js';\nimport baseMergeDeep from './_baseMergeDeep.js';\nimport isObject from './isObject.js';\nimport keysIn from './keysIn.js';\nimport safeGet from './_safeGet.js';\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nexport default baseMerge;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nexport default identity;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nexport default apply;\n","import apply from './_apply.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\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 * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : 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 index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nexport default overRest;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nexport default constant;\n","import constant from './constant.js';\nimport defineProperty from './_defineProperty.js';\nimport identity from './identity.js';\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nexport default baseSetToString;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nexport default shortOut;\n","import baseSetToString from './_baseSetToString.js';\nimport shortOut from './_shortOut.js';\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nexport default setToString;\n","import identity from './identity.js';\nimport overRest from './_overRest.js';\nimport setToString from './_setToString.js';\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\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 */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nexport default baseRest;\n","import eq from './eq.js';\nimport isArrayLike from './isArrayLike.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\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","import baseRest from './_baseRest.js';\nimport isIterateeCall from './_isIterateeCall.js';\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nexport default createAssigner;\n","import baseMerge from './_baseMerge.js';\nimport createAssigner from './_createAssigner.js';\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\nexport default merge;\n","import assignValue from './_assignValue.js';\nimport castPath from './_castPath.js';\nimport isIndex from './_isIndex.js';\nimport isObject from './isObject.js';\nimport toKey from './_toKey.js';\n\n/**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\nfunction baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n}\n\nexport default baseSet;\n","import baseSet from './_baseSet.js';\n\n/**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\nfunction set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n}\n\nexport default set;\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/stylesmap\n */\nimport { get, isObject, merge, set, unset } from 'lodash-es';\n/**\n * Styles map. Allows handling (adding, removing, retrieving) a set of style rules (usually, of an element).\n *\n * The styles map is capable of normalizing style names so e.g. the following operations are possible:\n */\nexport default class StylesMap {\n /**\n * Creates Styles instance.\n */\n constructor(styleProcessor) {\n this._styles = {};\n this._styleProcessor = styleProcessor;\n }\n /**\n * Returns true if style map has no styles set.\n */\n get isEmpty() {\n const entries = Object.entries(this._styles);\n const from = Array.from(entries);\n return !from.length;\n }\n /**\n * Number of styles defined.\n */\n get size() {\n if (this.isEmpty) {\n return 0;\n }\n return this.getStyleNames().length;\n }\n /**\n * Set styles map to a new value.\n *\n * ```ts\n * styles.setTo( 'border:1px solid blue;margin-top:1px;' );\n * ```\n */\n setTo(inlineStyle) {\n this.clear();\n const parsedStyles = Array.from(parseInlineStyles(inlineStyle).entries());\n for (const [key, value] of parsedStyles) {\n this._styleProcessor.toNormalizedForm(key, value, this._styles);\n }\n }\n /**\n * Checks if a given style is set.\n *\n * ```ts\n * styles.setTo( 'margin-left:1px;' );\n *\n * styles.has( 'margin-left' ); // -> true\n * styles.has( 'padding' ); // -> false\n * ```\n *\n * **Note**: This check supports normalized style names.\n *\n * ```ts\n * // Enable 'margin' shorthand processing:\n * editor.data.addStyleProcessorRules( addMarginRules );\n *\n * styles.setTo( 'margin:2px;' );\n *\n * styles.has( 'margin' ); // -> true\n * styles.has( 'margin-top' ); // -> true\n * styles.has( 'margin-left' ); // -> true\n *\n * styles.remove( 'margin-top' );\n *\n * styles.has( 'margin' ); // -> false\n * styles.has( 'margin-top' ); // -> false\n * styles.has( 'margin-left' ); // -> true\n * ```\n *\n * @param name Style name.\n */\n has(name) {\n if (this.isEmpty) {\n return false;\n }\n const styles = this._styleProcessor.getReducedForm(name, this._styles);\n const propertyDescriptor = styles.find(([property]) => property === name);\n // Only return a value if it is set;\n return Array.isArray(propertyDescriptor);\n }\n set(nameOrObject, valueOrObject) {\n if (isObject(nameOrObject)) {\n for (const [key, value] of Object.entries(nameOrObject)) {\n this._styleProcessor.toNormalizedForm(key, value, this._styles);\n }\n }\n else {\n this._styleProcessor.toNormalizedForm(nameOrObject, valueOrObject, this._styles);\n }\n }\n /**\n * Removes given style.\n *\n * ```ts\n * styles.setTo( 'background:#f00;margin-right:2px;' );\n *\n * styles.remove( 'background' );\n *\n * styles.toString(); // -> 'margin-right:2px;'\n * ```\n *\n * ***Note**:* This method uses {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules\n * enabled style processor rules} to normalize passed values.\n *\n * ```ts\n * // Enable 'margin' shorthand processing:\n * editor.data.addStyleProcessorRules( addMarginRules );\n *\n * styles.setTo( 'margin:1px' );\n *\n * styles.remove( 'margin-top' );\n * styles.remove( 'margin-right' );\n *\n * styles.toString(); // -> 'margin-bottom:1px;margin-left:1px;'\n * ```\n *\n * @param name Style name.\n */\n remove(name) {\n const path = toPath(name);\n unset(this._styles, path);\n delete this._styles[name];\n this._cleanEmptyObjectsOnPath(path);\n }\n /**\n * Returns a normalized style object or a single value.\n *\n * ```ts\n * // Enable 'margin' shorthand processing:\n * editor.data.addStyleProcessorRules( addMarginRules );\n *\n * const styles = new Styles();\n * styles.setTo( 'margin:1px 2px 3em;' );\n *\n * styles.getNormalized( 'margin' );\n * // will log:\n * // {\n * // top: '1px',\n * // right: '2px',\n * // bottom: '3em',\n * // left: '2px' // normalized value from margin shorthand\n * // }\n *\n * styles.getNormalized( 'margin-left' ); // -> '2px'\n * ```\n *\n * **Note**: This method will only return normalized styles if a style processor was defined.\n *\n * @param name Style name.\n */\n getNormalized(name) {\n return this._styleProcessor.getNormalized(name, this._styles);\n }\n /**\n * Returns a normalized style string. Styles are sorted by name.\n *\n * ```ts\n * styles.set( 'margin' , '1px' );\n * styles.set( 'background', '#f00' );\n *\n * styles.toString(); // -> 'background:#f00;margin:1px;'\n * ```\n *\n * **Note**: This method supports normalized styles if defined.\n *\n * ```ts\n * // Enable 'margin' shorthand processing:\n * editor.data.addStyleProcessorRules( addMarginRules );\n *\n * styles.set( 'margin' , '1px' );\n * styles.set( 'background', '#f00' );\n * styles.remove( 'margin-top' );\n * styles.remove( 'margin-right' );\n *\n * styles.toString(); // -> 'background:#f00;margin-bottom:1px;margin-left:1px;'\n * ```\n */\n toString() {\n if (this.isEmpty) {\n return '';\n }\n return this._getStylesEntries()\n .map(arr => arr.join(':'))\n .sort()\n .join(';') + ';';\n }\n /**\n * Returns property as a value string or undefined if property is not set.\n *\n * ```ts\n * // Enable 'margin' shorthand processing:\n * editor.data.addStyleProcessorRules( addMarginRules );\n *\n * const styles = new Styles();\n * styles.setTo( 'margin:1px;' );\n * styles.set( 'margin-bottom', '3em' );\n *\n * styles.getAsString( 'margin' ); // -> 'margin: 1px 1px 3em;'\n * ```\n *\n * Note, however, that all sub-values must be set for the longhand property name to return a value:\n *\n * ```ts\n * const styles = new Styles();\n * styles.setTo( 'margin:1px;' );\n * styles.remove( 'margin-bottom' );\n *\n * styles.getAsString( 'margin' ); // -> undefined\n * ```\n *\n * In the above scenario, it is not possible to return a `margin` value, so `undefined` is returned.\n * Instead, you should use:\n *\n * ```ts\n * const styles = new Styles();\n * styles.setTo( 'margin:1px;' );\n * styles.remove( 'margin-bottom' );\n *\n * for ( const styleName of styles.getStyleNames() ) {\n * \tconsole.log( styleName, styles.getAsString( styleName ) );\n * }\n * // 'margin-top', '1px'\n * // 'margin-right', '1px'\n * // 'margin-left', '1px'\n * ```\n *\n * In general, it is recommend to iterate over style names like in the example above. This way, you will always get all\n * the currently set style values. So, if all the 4 margin values would be set\n * the for-of loop above would yield only `'margin'`, `'1px'`:\n *\n * ```ts\n * const styles = new Styles();\n * styles.setTo( 'margin:1px;' );\n *\n * for ( const styleName of styles.getStyleNames() ) {\n * \tconsole.log( styleName, styles.getAsString( styleName ) );\n * }\n * // 'margin', '1px'\n * ```\n *\n * **Note**: To get a normalized version of a longhand property use the {@link #getNormalized `#getNormalized()`} method.\n */\n getAsString(propertyName) {\n if (this.isEmpty) {\n return;\n }\n if (this._styles[propertyName] && !isObject(this._styles[propertyName])) {\n // Try return styles set directly - values that are not parsed.\n return this._styles[propertyName];\n }\n const styles = this._styleProcessor.getReducedForm(propertyName, this._styles);\n const propertyDescriptor = styles.find(([property]) => property === propertyName);\n // Only return a value if it is set;\n if (Array.isArray(propertyDescriptor)) {\n return propertyDescriptor[1];\n }\n }\n /**\n * Returns all style properties names as they would appear when using {@link #toString `#toString()`}.\n *\n * When `expand` is set to true and there's a shorthand style property set, it will also return all equivalent styles:\n *\n * ```ts\n * stylesMap.setTo( 'margin: 1em' )\n * ```\n *\n * will be expanded to:\n *\n * ```ts\n * [ 'margin', 'margin-top', 'margin-right', 'margin-bottom', 'margin-left' ]\n * ```\n *\n * @param expand Expand shorthand style properties and all return equivalent style representations.\n */\n getStyleNames(expand = false) {\n if (this.isEmpty) {\n return [];\n }\n if (expand) {\n return this._styleProcessor.getStyleNames(this._styles);\n }\n const entries = this._getStylesEntries();\n return entries.map(([key]) => key);\n }\n /**\n * Removes all styles.\n */\n clear() {\n this._styles = {};\n }\n /**\n * Returns normalized styles entries for further processing.\n */\n _getStylesEntries() {\n const parsed = [];\n const keys = Object.keys(this._styles);\n for (const key of keys) {\n parsed.push(...this._styleProcessor.getReducedForm(key, this._styles));\n }\n return parsed;\n }\n /**\n * Removes empty objects upon removing an entry from internal object.\n */\n _cleanEmptyObjectsOnPath(path) {\n const pathParts = path.split('.');\n const isChildPath = pathParts.length > 1;\n if (!isChildPath) {\n return;\n }\n const parentPath = pathParts.splice(0, pathParts.length - 1).join('.');\n const parentObject = get(this._styles, parentPath);\n if (!parentObject) {\n return;\n }\n const isParentEmpty = !Array.from(Object.keys(parentObject)).length;\n if (isParentEmpty) {\n this.remove(parentPath);\n }\n }\n}\n/**\n * Style processor is responsible for writing and reading a normalized styles object.\n */\nexport class StylesProcessor {\n /**\n * Creates StylesProcessor instance.\n *\n * @internal\n */\n constructor() {\n this._normalizers = new Map();\n this._extractors = new Map();\n this._reducers = new Map();\n this._consumables = new Map();\n }\n /**\n * Parse style string value to a normalized object and appends it to styles object.\n *\n * ```ts\n * const styles = {};\n *\n * stylesProcessor.toNormalizedForm( 'margin', '1px', styles );\n *\n * // styles will consist: { margin: { top: '1px', right: '1px', bottom: '1px', left: '1px; } }\n * ```\n *\n * **Note**: To define normalizer callbacks use {@link #setNormalizer}.\n *\n * @param name Name of style property.\n * @param propertyValue Value of style property.\n * @param styles Object holding normalized styles.\n */\n toNormalizedForm(name, propertyValue, styles) {\n if (isObject(propertyValue)) {\n appendStyleValue(styles, toPath(name), propertyValue);\n return;\n }\n if (this._normalizers.has(name)) {\n const normalizer = this._normalizers.get(name);\n const { path, value } = normalizer(propertyValue);\n appendStyleValue(styles, path, value);\n }\n else {\n appendStyleValue(styles, name, propertyValue);\n }\n }\n /**\n * Returns a normalized version of a style property.\n *\n * ```ts\n * const styles = {\n * \tmargin: { top: '1px', right: '1px', bottom: '1px', left: '1px; },\n * \tbackground: { color: '#f00' }\n * };\n *\n * stylesProcessor.getNormalized( 'background' );\n * // will return: { color: '#f00' }\n *\n * stylesProcessor.getNormalized( 'margin-top' );\n * // will return: '1px'\n * ```\n *\n * **Note**: In some cases extracting single value requires defining an extractor callback {@link #setExtractor}.\n *\n * @param name Name of style property.\n * @param styles Object holding normalized styles.\n */\n getNormalized(name, styles) {\n if (!name) {\n return merge({}, styles);\n }\n // Might be empty string.\n if (styles[name] !== undefined) {\n return styles[name];\n }\n if (this._extractors.has(name)) {\n const extractor = this._extractors.get(name);\n if (typeof extractor === 'string') {\n return get(styles, extractor);\n }\n const value = extractor(name, styles);\n if (value) {\n return value;\n }\n }\n return get(styles, toPath(name));\n }\n /**\n * Returns a reduced form of style property form normalized object.\n *\n * For default margin reducer, the below code:\n *\n * ```ts\n * stylesProcessor.getReducedForm( 'margin', {\n * \tmargin: { top: '1px', right: '1px', bottom: '2px', left: '1px; }\n * } );\n * ```\n *\n * will return:\n *\n * ```ts\n * [\n * \t[ 'margin', '1px 1px 2px' ]\n * ]\n * ```\n *\n * because it might be represented as a shorthand 'margin' value. However if one of margin long hand values is missing it should return:\n *\n * ```ts\n * [\n * \t[ 'margin-top', '1px' ],\n * \t[ 'margin-right', '1px' ],\n * \t[ 'margin-bottom', '2px' ]\n * \t// the 'left' value is missing - cannot use 'margin' shorthand.\n * ]\n * ```\n *\n * **Note**: To define reducer callbacks use {@link #setReducer}.\n *\n * @param name Name of style property.\n */\n getReducedForm(name, styles) {\n const normalizedValue = this.getNormalized(name, styles);\n // Might be empty string.\n if (normalizedValue === undefined) {\n return [];\n }\n if (this._reducers.has(name)) {\n const reducer = this._reducers.get(name);\n return reducer(normalizedValue);\n }\n return [[name, normalizedValue]];\n }\n /**\n * Return all style properties. Also expand shorthand properties (e.g. `margin`, `background`) if respective extractor is available.\n *\n * @param styles Object holding normalized styles.\n */\n getStyleNames(styles) {\n // Find all extractable styles that have a value.\n const expandedStyleNames = Array.from(this._consumables.keys()).filter(name => {\n const style = this.getNormalized(name, styles);\n if (style && typeof style == 'object') {\n return Object.keys(style).length;\n }\n return style;\n });\n // For simple styles (for example `color`) we don't have a map of those styles\n // but they are 1 to 1 with normalized object keys.\n const styleNamesKeysSet = new Set([\n ...expandedStyleNames,\n ...Object.keys(styles)\n ]);\n return Array.from(styleNamesKeysSet.values());\n }\n /**\n * Returns related style names.\n *\n * ```ts\n * stylesProcessor.getRelatedStyles( 'margin' );\n * // will return: [ 'margin-top', 'margin-right', 'margin-bottom', 'margin-left' ];\n *\n * stylesProcessor.getRelatedStyles( 'margin-top' );\n * // will return: [ 'margin' ];\n * ```\n *\n * **Note**: To define new style relations load an existing style processor or use\n * {@link module:engine/view/stylesmap~StylesProcessor#setStyleRelation `StylesProcessor.setStyleRelation()`}.\n */\n getRelatedStyles(name) {\n return this._consumables.get(name) || [];\n }\n /**\n * Adds a normalizer method for a style property.\n *\n * A normalizer returns describing how the value should be normalized.\n *\n * For instance 'margin' style is a shorthand for four margin values:\n *\n * - 'margin-top'\n * - 'margin-right'\n * - 'margin-bottom'\n * - 'margin-left'\n *\n * and can be written in various ways if some values are equal to others. For instance `'margin: 1px 2em;'` is a shorthand for\n * `'margin-top: 1px;margin-right: 2em;margin-bottom: 1px;margin-left: 2em'`.\n *\n * A normalizer should parse various margin notations as a single object:\n *\n * ```ts\n * const styles = {\n * \tmargin: {\n * \t\ttop: '1px',\n * \t\tright: '2em',\n * \t\tbottom: '1px',\n * \t\tleft: '2em'\n * \t}\n * };\n * ```\n *\n * Thus a normalizer for 'margin' style should return an object defining style path and value to store:\n *\n * ```ts\n * const returnValue = {\n * \tpath: 'margin',\n * \tvalue: {\n * \t\ttop: '1px',\n * \t\tright: '2em',\n * \t\tbottom: '1px',\n * \t\tleft: '2em'\n * \t}\n * };\n * ```\n *\n * Additionally to fully support all margin notations there should be also defined 4 normalizers for longhand margin notations. Below\n * is an example for 'margin-top' style property normalizer:\n *\n * ```ts\n * stylesProcessor.setNormalizer( 'margin-top', valueString => {\n * \treturn {\n * \t\tpath: 'margin.top',\n * \t\tvalue: valueString\n * \t}\n * } );\n * ```\n */\n setNormalizer(name, callback) {\n this._normalizers.set(name, callback);\n }\n /**\n * Adds a extractor callback for a style property.\n *\n * Most normalized style values are stored as one level objects. It is assumed that `'margin-top'` style will be stored as:\n *\n * ```ts\n * const styles = {\n * \tmargin: {\n * \t\ttop: 'value'\n * \t}\n * }\n * ```\n *\n * However, some styles can have conflicting notations and thus it might be harder to extract a style value from shorthand. For instance\n * the 'border-top-style' can be defined using `'border-top:solid'`, `'border-style:solid none none none'` or by `'border:solid'`\n * shorthands. The default border styles processors stores styles as:\n *\n * ```ts\n * const styles = {\n * \tborder: {\n * \t\tstyle: {\n * \t\t\ttop: 'solid'\n * \t\t}\n * \t}\n * }\n * ```\n *\n * as it is better to modify border style independently from other values. On the other part the output of the border might be\n * desired as `border-top`, `border-left`, etc notation.\n *\n * In the above example an extractor should return a side border value that combines style, color and width:\n *\n * ```ts\n * styleProcessor.setExtractor( 'border-top', styles => {\n * \treturn {\n * \t\tcolor: styles.border.color.top,\n * \t\tstyle: styles.border.style.top,\n * \t\twidth: styles.border.width.top\n * \t}\n * } );\n * ```\n *\n * @param callbackOrPath Callback that return a requested value or path string for single values.\n */\n setExtractor(name, callbackOrPath) {\n this._extractors.set(name, callbackOrPath);\n }\n /**\n * Adds a reducer callback for a style property.\n *\n * Reducer returns a minimal notation for given style name. For longhand properties it is not required to write a reducer as\n * by default the direct value from style path is taken.\n *\n * For shorthand styles a reducer should return minimal style notation either by returning single name-value tuple or multiple tuples\n * if a shorthand cannot be used. For instance for a margin shorthand a reducer might return:\n *\n * ```ts\n * const marginShortHandTuple = [\n * \t[ 'margin', '1px 1px 2px' ]\n * ];\n * ```\n *\n * or a longhand tuples for defined values:\n *\n * ```ts\n * // Considering margin.bottom and margin.left are undefined.\n * const marginLonghandsTuples = [\n * \t[ 'margin-top', '1px' ],\n * \t[ 'margin-right', '1px' ]\n * ];\n * ```\n *\n * A reducer obtains a normalized style value:\n *\n * ```ts\n * // Simplified reducer that always outputs 4 values which are always present:\n * stylesProcessor.setReducer( 'margin', margin => {\n * \treturn [\n * \t\t[ 'margin', `${ margin.top } ${ margin.right } ${ margin.bottom } ${ margin.left }` ]\n * \t]\n * } );\n * ```\n */\n setReducer(name, callback) {\n this._reducers.set(name, callback);\n }\n /**\n * Defines a style shorthand relation to other style notations.\n *\n * ```ts\n * stylesProcessor.setStyleRelation( 'margin', [\n * \t'margin-top',\n * \t'margin-right',\n * \t'margin-bottom',\n * \t'margin-left'\n * ] );\n * ```\n *\n * This enables expanding of style names for shorthands. For instance, if defined,\n * {@link module:engine/conversion/viewconsumable~ViewConsumable view consumable} items are automatically created\n * for long-hand margin style notation alongside the `'margin'` item.\n *\n * This means that when an element being converted has a style `margin`, a converter for `margin-left` will work just\n * fine since the view consumable will contain a consumable `margin-left` item (thanks to the relation) and\n * `element.getStyle( 'margin-left' )` will work as well assuming that the style processor was correctly configured.\n * However, once `margin-left` is consumed, `margin` will not be consumable anymore.\n */\n setStyleRelation(shorthandName, styleNames) {\n this._mapStyleNames(shorthandName, styleNames);\n for (const alsoName of styleNames) {\n this._mapStyleNames(alsoName, [shorthandName]);\n }\n }\n /**\n * Set two-way binding of style names.\n */\n _mapStyleNames(name, styleNames) {\n if (!this._consumables.has(name)) {\n this._consumables.set(name, []);\n }\n this._consumables.get(name).push(...styleNames);\n }\n}\n/**\n * Parses inline styles and puts property - value pairs into styles map.\n *\n * @param stylesString Styles to parse.\n * @returns Map of parsed properties and values.\n */\nfunction parseInlineStyles(stylesString) {\n // `null` if no quote was found in input string or last found quote was a closing quote. See below.\n let quoteType = null;\n let propertyNameStart = 0;\n let propertyValueStart = 0;\n let propertyName = null;\n const stylesMap = new Map();\n // Do not set anything if input string is empty.\n if (stylesString === '') {\n return stylesMap;\n }\n // Fix inline styles that do not end with `;` so they are compatible with algorithm below.\n if (stylesString.charAt(stylesString.length - 1) != ';') {\n stylesString = stylesString + ';';\n }\n // Seek the whole string for \"special characters\".\n for (let i = 0; i < stylesString.length; i++) {\n const char = stylesString.charAt(i);\n if (quoteType === null) {\n // No quote found yet or last found quote was a closing quote.\n switch (char) {\n case ':':\n // Most of time colon means that property name just ended.\n // Sometimes however `:` is found inside property value (for example in background image url).\n if (!propertyName) {\n // Treat this as end of property only if property name is not already saved.\n // Save property name.\n propertyName = stylesString.substr(propertyNameStart, i - propertyNameStart);\n // Save this point as the start of property value.\n propertyValueStart = i + 1;\n }\n break;\n case '\"':\n case '\\'':\n // Opening quote found (this is an opening quote, because `quoteType` is `null`).\n quoteType = char;\n break;\n case ';': {\n // Property value just ended.\n // Use previously stored property value start to obtain property value.\n const propertyValue = stylesString.substr(propertyValueStart, i - propertyValueStart);\n if (propertyName) {\n // Save parsed part.\n stylesMap.set(propertyName.trim(), propertyValue.trim());\n }\n propertyName = null;\n // Save this point as property name start. Property name starts immediately after previous property value ends.\n propertyNameStart = i + 1;\n break;\n }\n }\n }\n else if (char === quoteType) {\n // If a quote char is found and it is a closing quote, mark this fact by `null`-ing `quoteType`.\n quoteType = null;\n }\n }\n return stylesMap;\n}\n/**\n * Return lodash compatible path from style name.\n */\nfunction toPath(name) {\n return name.replace('-', '.');\n}\n/**\n * Appends style definition to the styles object.\n */\nfunction appendStyleValue(stylesObject, nameOrPath, valueOrObject) {\n let valueToSet = valueOrObject;\n if (isObject(valueOrObject)) {\n valueToSet = merge({}, get(stylesObject, nameOrPath), valueOrObject);\n }\n set(stylesObject, nameOrPath, valueToSet);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/element\n */\nimport Node from './node';\nimport Text from './text';\nimport TextProxy from './textproxy';\nimport { isIterable, toArray, toMap } from '@ckeditor/ckeditor5-utils';\nimport { default as Matcher } from './matcher';\nimport { default as StylesMap } from './stylesmap';\n// @if CK_DEBUG_ENGINE // const { convertMapToTags } = require( '../dev-utils/utils' );\n/**\n * View element.\n *\n * The editing engine does not define a fixed semantics of its elements (it is \"DTD-free\").\n * This is why the type of the {@link module:engine/view/element~Element} need to\n * be defined by the feature developer. When creating an element you should use one of the following methods:\n *\n * * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement `downcastWriter#createContainerElement()`}\n * in order to create a {@link module:engine/view/containerelement~ContainerElement},\n * * {@link module:engine/view/downcastwriter~DowncastWriter#createAttributeElement `downcastWriter#createAttributeElement()`}\n * in order to create a {@link module:engine/view/attributeelement~AttributeElement},\n * * {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement `downcastWriter#createEmptyElement()`}\n * in order to create a {@link module:engine/view/emptyelement~EmptyElement}.\n * * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `downcastWriter#createUIElement()`}\n * in order to create a {@link module:engine/view/uielement~UIElement}.\n * * {@link module:engine/view/downcastwriter~DowncastWriter#createEditableElement `downcastWriter#createEditableElement()`}\n * in order to create a {@link module:engine/view/editableelement~EditableElement}.\n *\n * Note that for view elements which are not created from the 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.\n * In such cases the {@link module:engine/view/upcastwriter~UpcastWriter#createElement `UpcastWriter#createElement()`} method\n * should be used to create generic view elements.\n */\nexport default class Element extends Node {\n /**\n * Creates a view element.\n *\n * Attributes can be passed in various formats:\n *\n * ```ts\n * new Element( viewDocument, 'div', { class: 'editor', contentEditable: 'true' } ); // object\n * new Element( viewDocument, 'div', [ [ 'class', 'editor' ], [ 'contentEditable', 'true' ] ] ); // map-like iterator\n * new Element( viewDocument, 'div', mapOfAttributes ); // map\n * ```\n *\n * @internal\n * @param document The document instance to which this element belongs.\n * @param name Node name.\n * @param attrs Collection of attributes.\n * @param children A list of nodes to be inserted into created element.\n */\n constructor(document, name, attrs, children) {\n super(document);\n /**\n * A list of attribute names that should be rendered in the editing pipeline even though filtering mechanisms\n * implemented in the {@link module:engine/view/domconverter~DomConverter} (for instance,\n * {@link module:engine/view/domconverter~DomConverter#shouldRenderAttribute}) would filter them out.\n *\n * These attributes can be specified as an option when the element is created by\n * the {@link module:engine/view/downcastwriter~DowncastWriter}. To check whether an unsafe an attribute should\n * be permitted, use the {@link #shouldRenderUnsafeAttribute} method.\n *\n * @internal\n */\n this._unsafeAttributesToRender = [];\n /**\n * Map of custom properties.\n * Custom properties can be added to element instance, will be cloned but not rendered into DOM.\n */\n this._customProperties = new Map();\n this.name = name;\n this._attrs = parseAttributes(attrs);\n this._children = [];\n if (children) {\n this._insertChild(0, children);\n }\n this._classes = new Set();\n if (this._attrs.has('class')) {\n // Remove class attribute and handle it by class set.\n const classString = this._attrs.get('class');\n parseClasses(this._classes, classString);\n this._attrs.delete('class');\n }\n this._styles = new StylesMap(this.document.stylesProcessor);\n if (this._attrs.has('style')) {\n // Remove style attribute and handle it by styles map.\n this._styles.setTo(this._attrs.get('style'));\n this._attrs.delete('style');\n }\n }\n /**\n * Number of element's children.\n */\n get childCount() {\n return this._children.length;\n }\n /**\n * Is `true` if there are no nodes inside this element, `false` otherwise.\n */\n get isEmpty() {\n return this._children.length === 0;\n }\n /**\n * Gets child at the given index.\n *\n * @param index Index of child.\n * @returns Child node.\n */\n getChild(index) {\n return this._children[index];\n }\n /**\n * Gets index of the given child node. Returns `-1` if child node is not found.\n *\n * @param node Child node.\n * @returns Index of the child node.\n */\n getChildIndex(node) {\n return this._children.indexOf(node);\n }\n /**\n * Gets child nodes iterator.\n *\n * @returns Child nodes iterator.\n */\n getChildren() {\n return this._children[Symbol.iterator]();\n }\n /**\n * Returns an iterator that contains the keys for attributes. Order of inserting attributes is not preserved.\n *\n * @returns Keys for attributes.\n */\n *getAttributeKeys() {\n if (this._classes.size > 0) {\n yield 'class';\n }\n if (!this._styles.isEmpty) {\n yield 'style';\n }\n yield* this._attrs.keys();\n }\n /**\n * Returns iterator that iterates over this element's attributes.\n *\n * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.\n * This format is accepted by native `Map` object and also can be passed in `Node` constructor.\n */\n *getAttributes() {\n yield* this._attrs.entries();\n if (this._classes.size > 0) {\n yield ['class', this.getAttribute('class')];\n }\n if (!this._styles.isEmpty) {\n yield ['style', this.getAttribute('style')];\n }\n }\n /**\n * Gets attribute by key. If attribute is not present - returns undefined.\n *\n * @param key Attribute key.\n * @returns Attribute value.\n */\n getAttribute(key) {\n if (key == 'class') {\n if (this._classes.size > 0) {\n return [...this._classes].join(' ');\n }\n return undefined;\n }\n if (key == 'style') {\n const inlineStyle = this._styles.toString();\n return inlineStyle == '' ? undefined : inlineStyle;\n }\n return this._attrs.get(key);\n }\n /**\n * Returns a boolean indicating whether an attribute with the specified key exists in the element.\n *\n * @param key Attribute key.\n * @returns `true` if attribute with the specified key exists in the element, `false` otherwise.\n */\n hasAttribute(key) {\n if (key == 'class') {\n return this._classes.size > 0;\n }\n if (key == 'style') {\n return !this._styles.isEmpty;\n }\n return this._attrs.has(key);\n }\n /**\n * Checks if this element is similar to other element.\n * Both elements should have the same name and attributes to be considered as similar. Two similar elements\n * can contain different set of children nodes.\n */\n isSimilar(otherElement) {\n if (!(otherElement instanceof Element)) {\n return false;\n }\n // If exactly the same Element is provided - return true immediately.\n if (this === otherElement) {\n return true;\n }\n // Check element name.\n if (this.name != otherElement.name) {\n return false;\n }\n // Check number of attributes, classes and styles.\n if (this._attrs.size !== otherElement._attrs.size || this._classes.size !== otherElement._classes.size ||\n this._styles.size !== otherElement._styles.size) {\n return false;\n }\n // Check if attributes are the same.\n for (const [key, value] of this._attrs) {\n if (!otherElement._attrs.has(key) || otherElement._attrs.get(key) !== value) {\n return false;\n }\n }\n // Check if classes are the same.\n for (const className of this._classes) {\n if (!otherElement._classes.has(className)) {\n return false;\n }\n }\n // Check if styles are the same.\n for (const property of this._styles.getStyleNames()) {\n if (!otherElement._styles.has(property) ||\n otherElement._styles.getAsString(property) !== this._styles.getAsString(property)) {\n return false;\n }\n }\n return true;\n }\n /**\n * Returns true if class is present.\n * If more then one class is provided - returns true only when all classes are present.\n *\n * ```ts\n * element.hasClass( 'foo' ); // Returns true if 'foo' class is present.\n * element.hasClass( 'foo', 'bar' ); // Returns true if 'foo' and 'bar' classes are both present.\n * ```\n */\n hasClass(...className) {\n for (const name of className) {\n if (!this._classes.has(name)) {\n return false;\n }\n }\n return true;\n }\n /**\n * Returns iterator that contains all class names.\n */\n getClassNames() {\n return this._classes.keys();\n }\n /**\n * Returns style value for the given property mae.\n * If the style does not exist `undefined` is returned.\n *\n * **Note**: This method can work with normalized style names if\n * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.\n * See {@link module:engine/view/stylesmap~StylesMap#getAsString `StylesMap#getAsString()`} for details.\n *\n * For an element with style set to `'margin:1px'`:\n *\n * ```ts\n * // Enable 'margin' shorthand processing:\n * editor.data.addStyleProcessorRules( addMarginRules );\n *\n * const element = view.change( writer => {\n * \tconst element = writer.createElement();\n * \twriter.setStyle( 'margin', '1px' );\n * \twriter.setStyle( 'margin-bottom', '3em' );\n *\n * \treturn element;\n * } );\n *\n * element.getStyle( 'margin' ); // -> 'margin: 1px 1px 3em;'\n * ```\n */\n getStyle(property) {\n return this._styles.getAsString(property);\n }\n /**\n * Returns a normalized style object or single style value.\n *\n * For an element with style set to: margin:1px 2px 3em;\n *\n * ```ts\n * element.getNormalizedStyle( 'margin' ) );\n * ```\n *\n * will return:\n *\n * ```ts\n * {\n * \ttop: '1px',\n * \tright: '2px',\n * \tbottom: '3em',\n * \tleft: '2px' // a normalized value from margin shorthand\n * }\n * ```\n *\n * and reading for single style value:\n *\n * ```ts\n * styles.getNormalizedStyle( 'margin-left' );\n * ```\n *\n * Will return a `2px` string.\n *\n * **Note**: This method will return normalized values only if\n * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.\n * See {@link module:engine/view/stylesmap~StylesMap#getNormalized `StylesMap#getNormalized()`} for details.\n *\n * @param property Name of CSS property\n */\n getNormalizedStyle(property) {\n return this._styles.getNormalized(property);\n }\n /**\n * Returns iterator that contains all style names.\n *\n * @param expand Expand shorthand style properties and return all equivalent style representations.\n */\n getStyleNames(expand) {\n return this._styles.getStyleNames(expand);\n }\n /**\n * Returns true if style keys are present.\n * If more then one style property is provided - returns true only when all properties are present.\n *\n * ```ts\n * element.hasStyle( 'color' ); // Returns true if 'border-top' style is present.\n * element.hasStyle( 'color', 'border-top' ); // Returns true if 'color' and 'border-top' styles are both present.\n * ```\n */\n hasStyle(...property) {\n for (const name of property) {\n if (!this._styles.has(name)) {\n return false;\n }\n }\n return true;\n }\n /**\n * Returns ancestor element that match specified pattern.\n * Provided patterns should be compatible with {@link module:engine/view/matcher~Matcher Matcher} as it is used internally.\n *\n * @see module:engine/view/matcher~Matcher\n * @param patterns Patterns used to match correct ancestor. See {@link module:engine/view/matcher~Matcher}.\n * @returns Found element or `null` if no matching ancestor was found.\n */\n findAncestor(...patterns) {\n const matcher = new Matcher(...patterns);\n let parent = this.parent;\n while (parent && !parent.is('documentFragment')) {\n if (matcher.match(parent)) {\n return parent;\n }\n parent = parent.parent;\n }\n return null;\n }\n /**\n * Returns the custom property value for the given key.\n */\n getCustomProperty(key) {\n return this._customProperties.get(key);\n }\n /**\n * Returns an iterator which iterates over this element's custom properties.\n * Iterator provides `[ key, value ]` pairs for each stored property.\n */\n *getCustomProperties() {\n yield* this._customProperties.entries();\n }\n /**\n * Returns identity string based on element's name, styles, classes and other attributes.\n * Two elements that {@link #isSimilar are similar} will have same identity string.\n * It has the following format:\n *\n * ```ts\n * 'name class=\"class1,class2\" style=\"style1:value1;style2:value2\" attr1=\"val1\" attr2=\"val2\"'\n * ```\n *\n * For example:\n *\n * ```ts\n * const element = writer.createContainerElement( 'foo', {\n * \tbanana: '10',\n * \tapple: '20',\n * \tstyle: 'color: red; border-color: white;',\n * \tclass: 'baz'\n * } );\n *\n * // returns 'foo class=\"baz\" style=\"border-color:white;color:red\" apple=\"20\" banana=\"10\"'\n * element.getIdentity();\n * ```\n *\n * **Note**: Classes, styles and other attributes are sorted alphabetically.\n */\n getIdentity() {\n const classes = Array.from(this._classes).sort().join(',');\n const styles = this._styles.toString();\n const attributes = Array.from(this._attrs).map(i => `${i[0]}=\"${i[1]}\"`).sort().join(' ');\n return this.name +\n (classes == '' ? '' : ` class=\"${classes}\"`) +\n (!styles ? '' : ` style=\"${styles}\"`) +\n (attributes == '' ? '' : ` ${attributes}`);\n }\n /**\n * Decides whether an unsafe attribute is whitelisted and should be rendered in the editing pipeline even though filtering mechanisms\n * like {@link module:engine/view/domconverter~DomConverter#shouldRenderAttribute} say it should not.\n *\n * Unsafe attribute names can be specified when creating an element via {@link module:engine/view/downcastwriter~DowncastWriter}.\n *\n * @param attributeName The name of the attribute to be checked.\n */\n shouldRenderUnsafeAttribute(attributeName) {\n return this._unsafeAttributesToRender.includes(attributeName);\n }\n /**\n * Clones provided element.\n *\n * @internal\n * @param deep If set to `true` clones element and all its children recursively. When set to `false`,\n * element will be cloned without any children.\n * @returns Clone of this element.\n */\n _clone(deep = false) {\n const childrenClone = [];\n if (deep) {\n for (const child of this.getChildren()) {\n childrenClone.push(child._clone(deep));\n }\n }\n // ContainerElement and AttributeElement should be also cloned properly.\n const cloned = new this.constructor(this.document, this.name, this._attrs, childrenClone);\n // Classes and styles are cloned separately - this solution is faster than adding them back to attributes and\n // parse once again in constructor.\n cloned._classes = new Set(this._classes);\n cloned._styles.set(this._styles.getNormalized());\n // Clone custom properties.\n cloned._customProperties = new Map(this._customProperties);\n // Clone filler offset method.\n // We can't define this method in a prototype because it's behavior which\n // is changed by e.g. toWidget() function from ckeditor5-widget. Perhaps this should be one of custom props.\n cloned.getFillerOffset = this.getFillerOffset;\n // Clone unsafe attributes list.\n cloned._unsafeAttributesToRender = this._unsafeAttributesToRender;\n return cloned;\n }\n /**\n * {@link module:engine/view/element~Element#_insertChild Insert} a child node or a list of child nodes at the end of this node\n * and sets the parent of these nodes to this element.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#insert\n * @internal\n * @param items Items to be inserted.\n * @fires change\n * @returns Number of appended nodes.\n */\n _appendChild(items) {\n return this._insertChild(this.childCount, items);\n }\n /**\n * Inserts a child node or a list of child nodes on the given index and sets the parent of these nodes to\n * this element.\n *\n * @internal\n * @see module:engine/view/downcastwriter~DowncastWriter#insert\n * @param index Position where nodes should be inserted.\n * @param items Items to be inserted.\n * @fires change\n * @returns Number of inserted nodes.\n */\n _insertChild(index, items) {\n this._fireChange('children', this);\n let count = 0;\n const nodes = normalize(this.document, items);\n for (const node of nodes) {\n // If node that is being added to this element is already inside another element, first remove it from the old parent.\n if (node.parent !== null) {\n node._remove();\n }\n node.parent = this;\n node.document = this.document;\n this._children.splice(index, 0, node);\n index++;\n count++;\n }\n return count;\n }\n /**\n * Removes number of child nodes starting at the given index and set the parent of these nodes to `null`.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#remove\n * @internal\n * @param index Number of the first node to remove.\n * @param howMany Number of nodes to remove.\n * @fires change\n * @returns The array of removed nodes.\n */\n _removeChildren(index, howMany = 1) {\n this._fireChange('children', this);\n for (let i = index; i < index + howMany; i++) {\n this._children[i].parent = null;\n }\n return this._children.splice(index, howMany);\n }\n /**\n * Adds or overwrite attribute with a specified key and value.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#setAttribute\n * @internal\n * @param key Attribute key.\n * @param value Attribute value.\n * @fires change\n */\n _setAttribute(key, value) {\n const stringValue = String(value);\n this._fireChange('attributes', this);\n if (key == 'class') {\n parseClasses(this._classes, stringValue);\n }\n else if (key == 'style') {\n this._styles.setTo(stringValue);\n }\n else {\n this._attrs.set(key, stringValue);\n }\n }\n /**\n * Removes attribute from the element.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#removeAttribute\n * @internal\n * @param key Attribute key.\n * @returns Returns true if an attribute existed and has been removed.\n * @fires change\n */\n _removeAttribute(key) {\n this._fireChange('attributes', this);\n // Remove class attribute.\n if (key == 'class') {\n if (this._classes.size > 0) {\n this._classes.clear();\n return true;\n }\n return false;\n }\n // Remove style attribute.\n if (key == 'style') {\n if (!this._styles.isEmpty) {\n this._styles.clear();\n return true;\n }\n return false;\n }\n // Remove other attributes.\n return this._attrs.delete(key);\n }\n /**\n * Adds specified class.\n *\n * ```ts\n * element._addClass( 'foo' ); // Adds 'foo' class.\n * element._addClass( [ 'foo', 'bar' ] ); // Adds 'foo' and 'bar' classes.\n * ```\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#addClass\n * @internal\n * @fires change\n */\n _addClass(className) {\n this._fireChange('attributes', this);\n for (const name of toArray(className)) {\n this._classes.add(name);\n }\n }\n /**\n * Removes specified class.\n *\n * ```ts\n * element._removeClass( 'foo' ); // Removes 'foo' class.\n * element._removeClass( [ 'foo', 'bar' ] ); // Removes both 'foo' and 'bar' classes.\n * ```\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#removeClass\n * @internal\n * @fires change\n */\n _removeClass(className) {\n this._fireChange('attributes', this);\n for (const name of toArray(className)) {\n this._classes.delete(name);\n }\n }\n _setStyle(property, value) {\n this._fireChange('attributes', this);\n if (typeof property != 'string') {\n this._styles.set(property);\n }\n else {\n this._styles.set(property, value);\n }\n }\n /**\n * Removes specified style.\n *\n * ```ts\n * element._removeStyle( 'color' ); // Removes 'color' style.\n * element._removeStyle( [ 'color', 'border-top' ] ); // Removes both 'color' and 'border-top' styles.\n * ```\n *\n * **Note**: This method can work with normalized style names if\n * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.\n * See {@link module:engine/view/stylesmap~StylesMap#remove `StylesMap#remove()`} for details.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#removeStyle\n * @internal\n * @fires change\n */\n _removeStyle(property) {\n this._fireChange('attributes', this);\n for (const name of toArray(property)) {\n this._styles.remove(name);\n }\n }\n /**\n * Sets a custom property. Unlike attributes, custom properties are not rendered to the DOM,\n * so they can be used to add special data to elements.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#setCustomProperty\n * @internal\n */\n _setCustomProperty(key, value) {\n this._customProperties.set(key, value);\n }\n /**\n * Removes the custom property stored under the given key.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#removeCustomProperty\n * @internal\n * @returns Returns true if property was removed.\n */\n _removeCustomProperty(key) {\n return this._customProperties.delete(key);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nElement.prototype.is = function (type, name) {\n if (!name) {\n return type === 'element' || type === 'view:element' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'node' || type === 'view:node';\n }\n else {\n return name === this.name && (type === 'element' || type === 'view:element');\n }\n};\n/**\n * Parses attributes provided to the element constructor before they are applied to an element. If attributes are passed\n * as an object (instead of `Iterable`), the object is transformed to the map. Attributes with `null` value are removed.\n * Attributes with non-`String` value are converted to `String`.\n *\n * @param attrs Attributes to parse.\n * @returns Parsed attributes.\n */\nfunction parseAttributes(attrs) {\n const attrsMap = toMap(attrs);\n for (const [key, value] of attrsMap) {\n if (value === null) {\n attrsMap.delete(key);\n }\n else if (typeof value != 'string') {\n attrsMap.set(key, String(value));\n }\n }\n return attrsMap;\n}\n/**\n * Parses class attribute and puts all classes into classes set.\n * Classes set s cleared before insertion.\n *\n * @param classesSet Set to insert parsed classes.\n * @param classesString String with classes to parse.\n */\nfunction parseClasses(classesSet, classesString) {\n const classArray = classesString.split(/\\s+/);\n classesSet.clear();\n classArray.forEach(name => classesSet.add(name));\n}\n/**\n * Converts strings to Text and non-iterables to arrays.\n */\nfunction normalize(document, nodes) {\n // Separate condition because string is iterable.\n if (typeof nodes == 'string') {\n return [new Text(document, nodes)];\n }\n if (!isIterable(nodes)) {\n nodes = [nodes];\n }\n // Array.from to enable .map() on non-arrays.\n return Array.from(nodes)\n .map(node => {\n if (typeof node == 'string') {\n return new Text(document, node);\n }\n if (node instanceof TextProxy) {\n return new Text(document, node.data);\n }\n return node;\n });\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/containerelement\n */\nimport Element from './element';\n/**\n * Containers are elements which define document structure. They define boundaries for\n * {@link module:engine/view/attributeelement~AttributeElement attributes}. They are mostly used for block elements like `<p>` or `<div>`.\n *\n * Editing engine does not define a fixed HTML DTD. This is why a feature developer needs to choose between various\n * types (container element, {@link module:engine/view/attributeelement~AttributeElement attribute element},\n * {@link module:engine/view/emptyelement~EmptyElement empty element}, etc) when developing a feature.\n *\n * The container element should be your default choice when writing a converter, unless:\n *\n * * this element represents a model text attribute (then use {@link module:engine/view/attributeelement~AttributeElement}),\n * * this is an empty element like `<img>` (then use {@link module:engine/view/emptyelement~EmptyElement}),\n * * this is a root element,\n * * this is a nested editable element (then use {@link module:engine/view/editableelement~EditableElement}).\n *\n * To create a new container element instance use the\n * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement `DowncastWriter#createContainerElement()`}\n * method.\n */\nexport default class ContainerElement extends Element {\n /**\n * Creates a container element.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#createContainerElement\n * @see module:engine/view/element~Element\n * @internal\n * @param document The document instance to which this element belongs.\n * @param name Node name.\n * @param attrs Collection of attributes.\n * @param children A list of nodes to be inserted into created element.\n */\n constructor(document, name, attrs, children) {\n super(document, name, attrs, children);\n this.getFillerOffset = getFillerOffset;\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nContainerElement.prototype.is = function (type, name) {\n if (!name) {\n return type === 'containerElement' || type === 'view:containerElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'element' || type === 'view:element' ||\n type === 'node' || type === 'view:node';\n }\n else {\n return name === this.name && (type === 'containerElement' || type === 'view:containerElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'element' || type === 'view:element');\n }\n};\n/**\n * Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed.\n *\n * @returns Block filler offset or `null` if block filler is not needed.\n */\nexport function getFillerOffset() {\n const children = [...this.getChildren()];\n const lastChild = children[this.childCount - 1];\n // Block filler is required after a `<br>` if it's the last element in its container. See #1422.\n if (lastChild && lastChild.is('element', 'br')) {\n return this.childCount;\n }\n for (const child of children) {\n // If there's any non-UI element don't render the bogus.\n if (!child.is('uiElement')) {\n return null;\n }\n }\n // If there are only UI elements render the bogus at the end of the element.\n return this.childCount;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/editableelement\n */\nimport ContainerElement from './containerelement';\nimport { ObservableMixin } from '@ckeditor/ckeditor5-utils';\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 * Editable is automatically read-only when its {@link module:engine/view/document~Document Document} is read-only.\n *\n * The constructor of this class shouldn't be used directly. To create new `EditableElement` use the\n * {@link module:engine/view/downcastwriter~DowncastWriter#createEditableElement `downcastWriter#createEditableElement()`} method.\n */\nexport default class EditableElement extends ObservableMixin(ContainerElement) {\n /**\n * Creates an editable element.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#createEditableElement\n * @internal\n * @param document The document instance to which this element belongs.\n * @param name Node name.\n * @param attrs Collection of attributes.\n * @param children A list of nodes to be inserted into created element.\n */\n constructor(document, name, attributes, children) {\n super(document, name, attributes, children);\n this.set('isReadOnly', false);\n this.set('isFocused', false);\n this.bind('isReadOnly').to(document);\n this.bind('isFocused').to(document, 'isFocused', isFocused => isFocused && document.selection.editableElement == this);\n // Update focus state based on selection changes.\n this.listenTo(document.selection, 'change', () => {\n this.isFocused = document.isFocused && document.selection.editableElement == this;\n });\n }\n destroy() {\n this.stopListening();\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nEditableElement.prototype.is = function (type, name) {\n if (!name) {\n return type === 'editableElement' || type === 'view:editableElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'containerElement' || type === 'view:containerElement' ||\n type === 'element' || type === 'view:element' ||\n type === 'node' || type === 'view:node';\n }\n else {\n return name === this.name && (type === 'editableElement' || type === 'view:editableElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'containerElement' || type === 'view:containerElement' ||\n type === 'element' || type === 'view:element');\n }\n};\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/rooteditableelement\n */\nimport EditableElement from './editableelement';\nconst rootNameSymbol = Symbol('rootName');\n/**\n * Class representing a single root in the data view. A root can be either {@link ~RootEditableElement#isReadOnly editable or read-only},\n * but in both cases it is called \"an editable\". Roots can contain other {@link module:engine/view/editableelement~EditableElement\n * editable elements} making them \"nested editables\".\n */\nexport default class RootEditableElement extends EditableElement {\n /**\n * Creates root editable element.\n *\n * @param document The document instance to which this element belongs.\n * @param name Node name.\n */\n constructor(document, name) {\n super(document, name);\n this.rootName = 'main';\n }\n /**\n * Name of this root inside {@link module:engine/view/document~Document} that is an owner of this root. If no\n * other name is set, `main` name is used.\n *\n * @readonly\n */\n get rootName() {\n return this.getCustomProperty(rootNameSymbol);\n }\n set rootName(rootName) {\n this._setCustomProperty(rootNameSymbol, rootName);\n }\n /**\n * Overrides old element name and sets new one.\n * This is needed because view roots are created before they are attached to the DOM.\n * The name of the root element is temporary at this stage. It has to be changed when the\n * view root element is attached to the DOM element.\n *\n * @internal\n * @param name The new name of element.\n */\n set _name(name) {\n this.name = name;\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nRootEditableElement.prototype.is = function (type, name) {\n if (!name) {\n return type === 'rootElement' || type === 'view:rootElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'editableElement' || type === 'view:editableElement' ||\n type === 'containerElement' || type === 'view:containerElement' ||\n type === 'element' || type === 'view:element' ||\n type === 'node' || type === 'view:node';\n }\n else {\n return name === this.name && (type === 'rootElement' || type === 'view:rootElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'editableElement' || type === 'view:editableElement' ||\n type === 'containerElement' || type === 'view:containerElement' ||\n type === 'element' || type === 'view:element');\n }\n};\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/treewalker\n */\nimport Element from './element';\nimport Text from './text';\nimport TextProxy from './textproxy';\nimport Position from './position';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Position iterator class. It allows to iterate forward and backward over the document.\n */\nexport default class TreeWalker {\n /**\n * Creates a range iterator. All parameters are optional, but you have to specify either `boundaries` or `startPosition`.\n *\n * @param options Object with configuration.\n */\n constructor(options = {}) {\n if (!options.boundaries && !options.startPosition) {\n /**\n * Neither boundaries nor starting position have been defined.\n *\n * @error view-tree-walker-no-start-position\n */\n throw new CKEditorError('view-tree-walker-no-start-position', null);\n }\n if (options.direction && options.direction != 'forward' && options.direction != 'backward') {\n /**\n * Only `backward` and `forward` direction allowed.\n *\n * @error view-tree-walker-unknown-direction\n */\n throw new CKEditorError('view-tree-walker-unknown-direction', options.startPosition, { direction: options.direction });\n }\n this.boundaries = options.boundaries || null;\n if (options.startPosition) {\n this._position = Position._createAt(options.startPosition);\n }\n else {\n this._position = Position._createAt(options.boundaries[options.direction == 'backward' ? 'end' : 'start']);\n }\n this.direction = options.direction || 'forward';\n this.singleCharacters = !!options.singleCharacters;\n this.shallow = !!options.shallow;\n this.ignoreElementEnd = !!options.ignoreElementEnd;\n this._boundaryStartParent = this.boundaries ? this.boundaries.start.parent : null;\n this._boundaryEndParent = this.boundaries ? this.boundaries.end.parent : null;\n }\n /**\n * Iterable interface.\n */\n [Symbol.iterator]() {\n return this;\n }\n /**\n * Iterator position. If start position is not defined then position depends on {@link #direction}. If direction is\n * `'forward'` position starts form the beginning, when direction is `'backward'` position starts from the end.\n */\n get position() {\n return this._position;\n }\n /**\n * Moves {@link #position} in the {@link #direction} skipping values as long as the callback function returns `true`.\n *\n * For example:\n *\n * ```ts\n * walker.skip( value => value.type == 'text' ); // <p>{}foo</p> -> <p>foo[]</p>\n * walker.skip( value => true ); // Move the position to the end: <p>{}foo</p> -> <p>foo</p>[]\n * walker.skip( value => false ); // Do not move the position.\n * ```\n *\n * @param skip Callback function. Gets {@link module:engine/view/treewalker~TreeWalkerValue} and should\n * return `true` if the value should be skipped or `false` if not.\n */\n skip(skip) {\n let nextResult;\n let prevPosition;\n do {\n prevPosition = this.position;\n nextResult = this.next();\n } while (!nextResult.done && skip(nextResult.value));\n if (!nextResult.done) {\n this._position = prevPosition;\n }\n }\n /**\n * Gets the next tree walker's value.\n *\n * @returns Object implementing iterator interface, returning\n * information about taken step.\n */\n next() {\n if (this.direction == 'forward') {\n return this._next();\n }\n else {\n return this._previous();\n }\n }\n /**\n * Makes a step forward in view. Moves the {@link #position} to the next position and returns the encountered value.\n */\n _next() {\n let position = this.position.clone();\n const previousPosition = this.position;\n const parent = position.parent;\n // We are at the end of the root.\n if (parent.parent === null && position.offset === parent.childCount) {\n return { done: true, value: undefined };\n }\n // We reached the walker boundary.\n if (parent === this._boundaryEndParent && position.offset == this.boundaries.end.offset) {\n return { done: true, value: undefined };\n }\n // Get node just after current position.\n let node;\n // Text is a specific parent because it contains string instead of child nodes.\n if (parent instanceof Text) {\n if (position.isAtEnd) {\n // Prevent returning \"elementEnd\" for Text node. Skip that value and return the next walker step.\n this._position = Position._createAfter(parent);\n return this._next();\n }\n node = parent.data[position.offset];\n }\n else {\n node = parent.getChild(position.offset);\n }\n if (node instanceof Element) {\n if (!this.shallow) {\n position = new Position(node, 0);\n }\n else {\n position.offset++;\n }\n this._position = position;\n return this._formatReturnValue('elementStart', node, previousPosition, position, 1);\n }\n else if (node instanceof Text) {\n if (this.singleCharacters) {\n position = new Position(node, 0);\n this._position = position;\n return this._next();\n }\n else {\n let charactersCount = node.data.length;\n let item;\n // If text stick out of walker range, we need to cut it and wrap in TextProxy.\n if (node == this._boundaryEndParent) {\n charactersCount = this.boundaries.end.offset;\n item = new TextProxy(node, 0, charactersCount);\n position = Position._createAfter(item);\n }\n else {\n item = new TextProxy(node, 0, node.data.length);\n // If not just keep moving forward.\n position.offset++;\n }\n this._position = position;\n return this._formatReturnValue('text', item, previousPosition, position, charactersCount);\n }\n }\n else if (typeof node == 'string') {\n let textLength;\n if (this.singleCharacters) {\n textLength = 1;\n }\n else {\n // Check if text stick out of walker range.\n const endOffset = parent === this._boundaryEndParent ? this.boundaries.end.offset : parent.data.length;\n textLength = endOffset - position.offset;\n }\n const textProxy = new TextProxy(parent, position.offset, textLength);\n position.offset += textLength;\n this._position = position;\n return this._formatReturnValue('text', textProxy, previousPosition, position, textLength);\n }\n else {\n // `node` is not set, we reached the end of current `parent`.\n position = Position._createAfter(parent);\n this._position = position;\n if (this.ignoreElementEnd) {\n return this._next();\n }\n else {\n return this._formatReturnValue('elementEnd', parent, previousPosition, position);\n }\n }\n }\n /**\n * Makes a step backward in view. Moves the {@link #position} to the previous position and returns the encountered value.\n */\n _previous() {\n let position = this.position.clone();\n const previousPosition = this.position;\n const parent = position.parent;\n // We are at the beginning of the root.\n if (parent.parent === null && position.offset === 0) {\n return { done: true, value: undefined };\n }\n // We reached the walker boundary.\n if (parent == this._boundaryStartParent && position.offset == this.boundaries.start.offset) {\n return { done: true, value: undefined };\n }\n // Get node just before current position.\n let node;\n // Text {@link module:engine/view/text~Text} element is a specific parent because contains string instead of child nodes.\n if (parent instanceof Text) {\n if (position.isAtStart) {\n // Prevent returning \"elementStart\" for Text node. Skip that value and return the next walker step.\n this._position = Position._createBefore(parent);\n return this._previous();\n }\n node = parent.data[position.offset - 1];\n }\n else {\n node = parent.getChild(position.offset - 1);\n }\n if (node instanceof Element) {\n if (!this.shallow) {\n position = new Position(node, node.childCount);\n this._position = position;\n if (this.ignoreElementEnd) {\n return this._previous();\n }\n else {\n return this._formatReturnValue('elementEnd', node, previousPosition, position);\n }\n }\n else {\n position.offset--;\n this._position = position;\n return this._formatReturnValue('elementStart', node, previousPosition, position, 1);\n }\n }\n else if (node instanceof Text) {\n if (this.singleCharacters) {\n position = new Position(node, node.data.length);\n this._position = position;\n return this._previous();\n }\n else {\n let charactersCount = node.data.length;\n let item;\n // If text stick out of walker range, we need to cut it and wrap in TextProxy.\n if (node == this._boundaryStartParent) {\n const offset = this.boundaries.start.offset;\n item = new TextProxy(node, offset, node.data.length - offset);\n charactersCount = item.data.length;\n position = Position._createBefore(item);\n }\n else {\n item = new TextProxy(node, 0, node.data.length);\n // If not just keep moving backward.\n position.offset--;\n }\n this._position = position;\n return this._formatReturnValue('text', item, previousPosition, position, charactersCount);\n }\n }\n else if (typeof node == 'string') {\n let textLength;\n if (!this.singleCharacters) {\n // Check if text stick out of walker range.\n const startOffset = parent === this._boundaryStartParent ? this.boundaries.start.offset : 0;\n textLength = position.offset - startOffset;\n }\n else {\n textLength = 1;\n }\n position.offset -= textLength;\n const textProxy = new TextProxy(parent, position.offset, textLength);\n this._position = position;\n return this._formatReturnValue('text', textProxy, previousPosition, position, textLength);\n }\n else {\n // `node` is not set, we reached the beginning of current `parent`.\n position = Position._createBefore(parent);\n this._position = position;\n return this._formatReturnValue('elementStart', parent, previousPosition, position, 1);\n }\n }\n /**\n * Format returned data and adjust `previousPosition` and `nextPosition` if reach the bound of the {@link module:engine/view/text~Text}.\n *\n * @param type Type of step.\n * @param item Item between old and new position.\n * @param previousPosition Previous position of iterator.\n * @param nextPosition Next position of iterator.\n * @param length Length of the item.\n */\n _formatReturnValue(type, item, previousPosition, nextPosition, length) {\n // Text is a specific parent, because contains string instead of children.\n // Walker doesn't enter to the Text except situations when walker is iterating over every single character,\n // or the bound starts/ends inside the Text. So when the position is at the beginning or at the end of the Text\n // we move it just before or just after Text.\n if (item instanceof TextProxy) {\n // Position is at the end of Text.\n if (item.offsetInText + item.data.length == item.textNode.data.length) {\n if (this.direction == 'forward' && !(this.boundaries && this.boundaries.end.isEqual(this.position))) {\n nextPosition = Position._createAfter(item.textNode);\n // When we change nextPosition of returned value we need also update walker current position.\n this._position = nextPosition;\n }\n else {\n previousPosition = Position._createAfter(item.textNode);\n }\n }\n // Position is at the begining ot the text.\n if (item.offsetInText === 0) {\n if (this.direction == 'backward' && !(this.boundaries && this.boundaries.start.isEqual(this.position))) {\n nextPosition = Position._createBefore(item.textNode);\n // When we change nextPosition of returned value we need also update walker current position.\n this._position = nextPosition;\n }\n else {\n previousPosition = Position._createBefore(item.textNode);\n }\n }\n }\n return {\n done: false,\n value: {\n type,\n item,\n previousPosition,\n nextPosition,\n length\n }\n };\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/position\n */\nimport TypeCheckable from './typecheckable';\nimport { CKEditorError, compareArrays } from '@ckeditor/ckeditor5-utils';\nimport EditableElement from './editableelement';\n// To check if component is loaded more than once.\nimport '@ckeditor/ckeditor5-utils/src/version';\nimport { default as TreeWalker } from './treewalker';\n/**\n * Position in the view tree. Position is represented by its parent node and an offset in this parent.\n *\n * In order to create a new position instance use the `createPosition*()` factory methods available in:\n *\n * * {@link module:engine/view/view~View}\n * * {@link module:engine/view/downcastwriter~DowncastWriter}\n * * {@link module:engine/view/upcastwriter~UpcastWriter}\n */\nexport default class Position extends TypeCheckable {\n /**\n * Creates a position.\n *\n * @param parent Position parent.\n * @param offset Position offset.\n */\n constructor(parent, offset) {\n super();\n this.parent = parent;\n this.offset = offset;\n }\n /**\n * Node directly after the position. Equals `null` when there is no node after position or position is located\n * inside text node.\n */\n get nodeAfter() {\n if (this.parent.is('$text')) {\n return null;\n }\n return this.parent.getChild(this.offset) || null;\n }\n /**\n * Node directly before the position. Equals `null` when there is no node before position or position is located\n * inside text node.\n */\n get nodeBefore() {\n if (this.parent.is('$text')) {\n return null;\n }\n return this.parent.getChild(this.offset - 1) || null;\n }\n /**\n * Is `true` if position is at the beginning of its {@link module:engine/view/position~Position#parent parent}, `false` otherwise.\n */\n get isAtStart() {\n return this.offset === 0;\n }\n /**\n * Is `true` if position is at the end of its {@link module:engine/view/position~Position#parent parent}, `false` otherwise.\n */\n get isAtEnd() {\n const endOffset = this.parent.is('$text') ? this.parent.data.length : this.parent.childCount;\n return this.offset === endOffset;\n }\n /**\n * Position's root, that is the root of the position's parent element.\n */\n get root() {\n return this.parent.root;\n }\n /**\n * {@link module:engine/view/editableelement~EditableElement EditableElement} instance that contains this position, or `null` if\n * position is not inside an editable element.\n */\n get editableElement() {\n let editable = this.parent;\n while (!(editable instanceof EditableElement)) {\n if (editable.parent) {\n editable = editable.parent;\n }\n else {\n return null;\n }\n }\n return editable;\n }\n /**\n * Returns a new instance of Position with offset incremented by `shift` value.\n *\n * @param shift How position offset should get changed. Accepts negative values.\n * @returns Shifted position.\n */\n getShiftedBy(shift) {\n const shifted = Position._createAt(this);\n const offset = shifted.offset + shift;\n shifted.offset = offset < 0 ? 0 : offset;\n return shifted;\n }\n /**\n * Gets the farthest position which matches the callback using\n * {@link module:engine/view/treewalker~TreeWalker TreeWalker}.\n *\n * For example:\n *\n * ```ts\n * getLastMatchingPosition( value => value.type == 'text' ); // <p>{}foo</p> -> <p>foo[]</p>\n * getLastMatchingPosition( value => value.type == 'text', { direction: 'backward' } ); // <p>foo[]</p> -> <p>{}foo</p>\n * getLastMatchingPosition( value => false ); // Do not move the position.\n * ```\n *\n * @param skip Callback function. Gets {@link module:engine/view/treewalker~TreeWalkerValue} and should\n * return `true` if the value should be skipped or `false` if not.\n * @param options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.\n * @returns The position after the last item which matches the `skip` callback test.\n */\n getLastMatchingPosition(skip, options = {}) {\n options.startPosition = this;\n const treeWalker = new TreeWalker(options);\n treeWalker.skip(skip);\n return treeWalker.position;\n }\n /**\n * Returns ancestors array of this position, that is this position's parent and it's ancestors.\n *\n * @returns Array with ancestors.\n */\n getAncestors() {\n if (this.parent.is('documentFragment')) {\n return [this.parent];\n }\n else {\n return this.parent.getAncestors({ includeSelf: true });\n }\n }\n /**\n * Returns a {@link module:engine/view/node~Node} or {@link module:engine/view/documentfragment~DocumentFragment}\n * which is a common ancestor of both positions.\n */\n getCommonAncestor(position) {\n const ancestorsA = this.getAncestors();\n const ancestorsB = position.getAncestors();\n let i = 0;\n while (ancestorsA[i] == ancestorsB[i] && ancestorsA[i]) {\n i++;\n }\n return i === 0 ? null : ancestorsA[i - 1];\n }\n /**\n * Checks whether this position equals given position.\n *\n * @param otherPosition Position to compare with.\n * @returns True if positions are same.\n */\n isEqual(otherPosition) {\n return (this.parent == otherPosition.parent && this.offset == otherPosition.offset);\n }\n /**\n * Checks whether this position is located before given position. When method returns `false` it does not mean that\n * this position is after give one. Two positions may be located inside separate roots and in that situation this\n * method will still return `false`.\n *\n * @see module:engine/view/position~Position#isAfter\n * @see module:engine/view/position~Position#compareWith\n * @param otherPosition Position to compare with.\n * @returns Returns `true` if this position is before given position.\n */\n isBefore(otherPosition) {\n return this.compareWith(otherPosition) == 'before';\n }\n /**\n * Checks whether this position is located after given position. When method returns `false` it does not mean that\n * this position is before give one. Two positions may be located inside separate roots and in that situation this\n * method will still return `false`.\n *\n * @see module:engine/view/position~Position#isBefore\n * @see module:engine/view/position~Position#compareWith\n * @param otherPosition Position to compare with.\n * @returns Returns `true` if this position is after given position.\n */\n isAfter(otherPosition) {\n return this.compareWith(otherPosition) == 'after';\n }\n /**\n * Checks whether this position is before, after or in same position that other position. Two positions may be also\n * different when they are located in separate roots.\n *\n * @param otherPosition Position to compare with.\n */\n compareWith(otherPosition) {\n if (this.root !== otherPosition.root) {\n return 'different';\n }\n if (this.isEqual(otherPosition)) {\n return 'same';\n }\n // Get path from root to position's parent element.\n const thisPath = this.parent.is('node') ? this.parent.getPath() : [];\n const otherPath = otherPosition.parent.is('node') ? otherPosition.parent.getPath() : [];\n // Add the positions' offsets to the parents offsets.\n thisPath.push(this.offset);\n otherPath.push(otherPosition.offset);\n // Compare both path arrays to find common ancestor.\n const result = compareArrays(thisPath, otherPath);\n switch (result) {\n case 'prefix':\n return 'before';\n case 'extension':\n return 'after';\n default:\n // Cast to number to avoid having 'same' as a type of `result`.\n return thisPath[result] < otherPath[result] ? 'before' : 'after';\n }\n }\n /**\n * Creates a {@link module:engine/view/treewalker~TreeWalker TreeWalker} instance with this positions as a start position.\n *\n * @param options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}\n */\n getWalker(options = {}) {\n options.startPosition = this;\n return new TreeWalker(options);\n }\n /**\n * Clones this position.\n */\n clone() {\n return new Position(this.parent, this.offset);\n }\n /**\n * Creates position at the given location. The location can be specified as:\n *\n * * a {@link module:engine/view/position~Position position},\n * * parent element and offset (offset defaults to `0`),\n * * parent element and `'end'` (sets position at the end of that element),\n * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).\n *\n * This method is a shortcut to other constructors such as:\n *\n * * {@link module:engine/view/position~Position._createBefore},\n * * {@link module:engine/view/position~Position._createAfter}.\n *\n * @internal\n * @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/view/item~Item view item}.\n */\n static _createAt(itemOrPosition, offset) {\n if (itemOrPosition instanceof Position) {\n return new this(itemOrPosition.parent, itemOrPosition.offset);\n }\n else {\n const node = itemOrPosition;\n if (offset == 'end') {\n offset = node.is('$text') ? node.data.length : node.childCount;\n }\n else if (offset == 'before') {\n return this._createBefore(node);\n }\n else if (offset == 'after') {\n return this._createAfter(node);\n }\n else if (offset !== 0 && !offset) {\n /**\n * {@link module:engine/view/view~View#createPositionAt `View#createPositionAt()`}\n * requires the offset to be specified when the first parameter is a view item.\n *\n * @error view-createpositionat-offset-required\n */\n throw new CKEditorError('view-createpositionat-offset-required', node);\n }\n return new Position(node, offset);\n }\n }\n /**\n * Creates a new position after given view item.\n *\n * @internal\n * @param item View item after which the position should be located.\n */\n static _createAfter(item) {\n // TextProxy is not a instance of Node so we need do handle it in specific way.\n if (item.is('$textProxy')) {\n return new Position(item.textNode, item.offsetInText + item.data.length);\n }\n if (!item.parent) {\n /**\n * You can not make a position after a root.\n *\n * @error view-position-after-root\n * @param {module:engine/view/node~Node} root\n */\n throw new CKEditorError('view-position-after-root', item, { root: item });\n }\n return new Position(item.parent, item.index + 1);\n }\n /**\n * Creates a new position before given view item.\n *\n * @internal\n * @param item View item before which the position should be located.\n */\n static _createBefore(item) {\n // TextProxy is not a instance of Node so we need do handle it in specific way.\n if (item.is('$textProxy')) {\n return new Position(item.textNode, item.offsetInText);\n }\n if (!item.parent) {\n /**\n * You cannot make a position before a root.\n *\n * @error view-position-before-root\n * @param {module:engine/view/node~Node} root\n */\n throw new CKEditorError('view-position-before-root', item, { root: item });\n }\n return new Position(item.parent, item.index);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nPosition.prototype.is = function (type) {\n return type === 'position' || type === 'view:position';\n};\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/range\n */\nimport TypeCheckable from './typecheckable';\nimport Position from './position';\nimport { default as TreeWalker } from './treewalker';\n/**\n * Range in the view tree. A range is represented by its start and end {@link module:engine/view/position~Position positions}.\n *\n * In order to create a new position instance use the `createPosition*()` factory methods available in:\n *\n * * {@link module:engine/view/view~View}\n * * {@link module:engine/view/downcastwriter~DowncastWriter}\n * * {@link module:engine/view/upcastwriter~UpcastWriter}\n */\nexport default class Range extends TypeCheckable {\n /**\n * Creates a range spanning from `start` position to `end` position.\n *\n * **Note:** Constructor creates it's own {@link module:engine/view/position~Position} instances basing on passed values.\n *\n * @param start Start position.\n * @param end End position. If not set, range will be collapsed at the `start` position.\n */\n constructor(start, end = null) {\n super();\n this.start = start.clone();\n this.end = end ? end.clone() : start.clone();\n }\n /**\n * Iterable interface.\n *\n * Iterates over all {@link module:engine/view/item~Item view items} that are in this range and returns\n * them together with additional information like length or {@link module:engine/view/position~Position positions},\n * grouped as {@link module:engine/view/treewalker~TreeWalkerValue}.\n *\n * This iterator uses {@link module:engine/view/treewalker~TreeWalker TreeWalker} with `boundaries` set to this range and\n * `ignoreElementEnd` option\n * set to `true`.\n */\n *[Symbol.iterator]() {\n yield* new TreeWalker({ boundaries: this, ignoreElementEnd: true });\n }\n /**\n * Returns whether the range is collapsed, that is it start and end positions are equal.\n */\n get isCollapsed() {\n return this.start.isEqual(this.end);\n }\n /**\n * Returns whether this range is flat, that is if {@link module:engine/view/range~Range#start start} position and\n * {@link module:engine/view/range~Range#end end} position are in the same {@link module:engine/view/position~Position#parent parent}.\n */\n get isFlat() {\n return this.start.parent === this.end.parent;\n }\n /**\n * Range root element.\n */\n get root() {\n return this.start.root;\n }\n /**\n * Creates a maximal range that has the same content as this range but is expanded in both ways (at the beginning\n * and at the end).\n *\n * For example:\n *\n * ```html\n * <p>Foo</p><p><b>{Bar}</b></p> -> <p>Foo</p>[<p><b>Bar</b>]</p>\n * <p><b>foo</b>{bar}<span></span></p> -> <p><b>foo[</b>bar<span></span>]</p>\n * ```\n *\n * Note that in the sample above:\n *\n * - `<p>` have type of {@link module:engine/view/containerelement~ContainerElement},\n * - `<b>` have type of {@link module:engine/view/attributeelement~AttributeElement},\n * - `<span>` have type of {@link module:engine/view/uielement~UIElement}.\n *\n * @returns Enlarged range.\n */\n getEnlarged() {\n let start = this.start.getLastMatchingPosition(enlargeTrimSkip, { direction: 'backward' });\n let end = this.end.getLastMatchingPosition(enlargeTrimSkip);\n // Fix positions, in case if they are in Text node.\n if (start.parent.is('$text') && start.isAtStart) {\n start = Position._createBefore(start.parent);\n }\n if (end.parent.is('$text') && end.isAtEnd) {\n end = Position._createAfter(end.parent);\n }\n return new Range(start, end);\n }\n /**\n * Creates a minimum range that has the same content as this range but is trimmed in both ways (at the beginning\n * and at the end).\n *\n * For example:\n *\n * ```html\n * <p>Foo</p>[<p><b>Bar</b>]</p> -> <p>Foo</p><p><b>{Bar}</b></p>\n * <p><b>foo[</b>bar<span></span>]</p> -> <p><b>foo</b>{bar}<span></span></p>\n * ```\n *\n * Note that in the sample above:\n *\n * - `<p>` have type of {@link module:engine/view/containerelement~ContainerElement},\n * - `<b>` have type of {@link module:engine/view/attributeelement~AttributeElement},\n * - `<span>` have type of {@link module:engine/view/uielement~UIElement}.\n *\n * @returns Shrunk range.\n */\n getTrimmed() {\n let start = this.start.getLastMatchingPosition(enlargeTrimSkip);\n if (start.isAfter(this.end) || start.isEqual(this.end)) {\n return new Range(start, start);\n }\n let end = this.end.getLastMatchingPosition(enlargeTrimSkip, { direction: 'backward' });\n const nodeAfterStart = start.nodeAfter;\n const nodeBeforeEnd = end.nodeBefore;\n // Because TreeWalker prefers positions next to text node, we need to move them manually into these text nodes.\n if (nodeAfterStart && nodeAfterStart.is('$text')) {\n start = new Position(nodeAfterStart, 0);\n }\n if (nodeBeforeEnd && nodeBeforeEnd.is('$text')) {\n end = new Position(nodeBeforeEnd, nodeBeforeEnd.data.length);\n }\n return new Range(start, end);\n }\n /**\n * Two ranges are equal if their start and end positions are equal.\n *\n * @param otherRange Range to compare with.\n * @returns `true` if ranges are equal, `false` otherwise\n */\n isEqual(otherRange) {\n return this == otherRange || (this.start.isEqual(otherRange.start) && this.end.isEqual(otherRange.end));\n }\n /**\n * Checks whether this range contains given {@link module:engine/view/position~Position position}.\n *\n * @param position Position to check.\n * @returns `true` if given {@link module:engine/view/position~Position position} is contained in this range, `false` otherwise.\n */\n containsPosition(position) {\n return position.isAfter(this.start) && position.isBefore(this.end);\n }\n /**\n * Checks whether this range contains given {@link module:engine/view/range~Range range}.\n *\n * @param otherRange Range to check.\n * @param loose Whether the check is loose or strict. If the check is strict (`false`), compared range cannot\n * start or end at the same position as this range boundaries. If the check is loose (`true`), compared range can start, end or\n * even be equal to this range. Note that collapsed ranges are always compared in strict mode.\n * @returns `true` if given {@link module:engine/view/range~Range range} boundaries are contained by this range, `false`\n * otherwise.\n */\n containsRange(otherRange, loose = false) {\n if (otherRange.isCollapsed) {\n loose = false;\n }\n const containsStart = this.containsPosition(otherRange.start) || (loose && this.start.isEqual(otherRange.start));\n const containsEnd = this.containsPosition(otherRange.end) || (loose && this.end.isEqual(otherRange.end));\n return containsStart && containsEnd;\n }\n /**\n * Computes which part(s) of this {@link module:engine/view/range~Range range} is not a part of given\n * {@link module:engine/view/range~Range range}.\n * Returned array contains zero, one or two {@link module:engine/view/range~Range ranges}.\n *\n * Examples:\n *\n * ```ts\n * let foo = downcastWriter.createText( 'foo' );\n * let img = downcastWriter.createContainerElement( 'img' );\n * let bar = downcastWriter.createText( 'bar' );\n * let p = downcastWriter.createContainerElement( 'p', null, [ foo, img, bar ] );\n *\n * let range = view.createRange( view.createPositionAt( foo, 2 ), view.createPositionAt( bar, 1 ); // \"o\", img, \"b\" are in range.\n * let otherRange = view.createRange( // \"oo\", img, \"ba\" are in range.\n * \tview.createPositionAt( foo, 1 ),\n * \tview.createPositionAt( bar, 2 )\n * );\n * let transformed = range.getDifference( otherRange );\n * // transformed array has no ranges because `otherRange` contains `range`\n *\n * otherRange = view.createRange( view.createPositionAt( foo, 1 ), view.createPositionAt( p, 2 ); // \"oo\", img are in range.\n * transformed = range.getDifference( otherRange );\n * // transformed array has one range: from ( p, 2 ) to ( bar, 1 )\n *\n * otherRange = view.createRange( view.createPositionAt( p, 1 ), view.createPositionAt( p, 2 ) ); // img is in range.\n * transformed = range.getDifference( otherRange );\n * // transformed array has two ranges: from ( foo, 1 ) to ( p, 1 ) and from ( p, 2 ) to ( bar, 1 )\n * ```\n *\n * @param otherRange Range to differentiate against.\n * @returns The difference between ranges.\n */\n getDifference(otherRange) {\n const ranges = [];\n if (this.isIntersecting(otherRange)) {\n // Ranges intersect.\n if (this.containsPosition(otherRange.start)) {\n // Given range start is inside this range. This means that we have to\n // add shrunken range - from the start to the middle of this range.\n ranges.push(new Range(this.start, otherRange.start));\n }\n if (this.containsPosition(otherRange.end)) {\n // Given range end is inside this range. This means that we have to\n // add shrunken range - from the middle of this range to the end.\n ranges.push(new Range(otherRange.end, this.end));\n }\n }\n else {\n // Ranges do not intersect, return the original range.\n ranges.push(this.clone());\n }\n return ranges;\n }\n /**\n * Returns an intersection of this {@link module:engine/view/range~Range range} and given {@link module:engine/view/range~Range range}.\n * Intersection is a common part of both of those ranges. If ranges has no common part, returns `null`.\n *\n * Examples:\n *\n * ```ts\n * let foo = downcastWriter.createText( 'foo' );\n * let img = downcastWriter.createContainerElement( 'img' );\n * let bar = downcastWriter.createText( 'bar' );\n * let p = downcastWriter.createContainerElement( 'p', null, [ foo, img, bar ] );\n *\n * let range = view.createRange( view.createPositionAt( foo, 2 ), view.createPositionAt( bar, 1 ); // \"o\", img, \"b\" are in range.\n * let otherRange = view.createRange( view.createPositionAt( foo, 1 ), view.createPositionAt( p, 2 ); // \"oo\", img are in range.\n * let transformed = range.getIntersection( otherRange ); // range from ( foo, 1 ) to ( p, 2 ).\n *\n * otherRange = view.createRange( view.createPositionAt( bar, 1 ), view.createPositionAt( bar, 3 ); \"ar\" is in range.\n * transformed = range.getIntersection( otherRange ); // null - no common part.\n * ```\n *\n * @param otherRange Range to check for intersection.\n * @returns A common part of given ranges or `null` if ranges have no common part.\n */\n getIntersection(otherRange) {\n if (this.isIntersecting(otherRange)) {\n // Ranges intersect, so a common range will be returned.\n // At most, it will be same as this range.\n let commonRangeStart = this.start;\n let commonRangeEnd = this.end;\n if (this.containsPosition(otherRange.start)) {\n // Given range start is inside this range. This means thaNt we have to\n // shrink common range to the given range start.\n commonRangeStart = otherRange.start;\n }\n if (this.containsPosition(otherRange.end)) {\n // Given range end is inside this range. This means that we have to\n // shrink common range to the given range end.\n commonRangeEnd = otherRange.end;\n }\n return new Range(commonRangeStart, commonRangeEnd);\n }\n // Ranges do not intersect, so they do not have common part.\n return null;\n }\n /**\n * Creates a {@link module:engine/view/treewalker~TreeWalker TreeWalker} instance with this range as a boundary.\n *\n * @param options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.\n */\n getWalker(options = {}) {\n options.boundaries = this;\n return new TreeWalker(options);\n }\n /**\n * Returns a {@link module:engine/view/node~Node} or {@link module:engine/view/documentfragment~DocumentFragment}\n * which is a common ancestor of range's both ends (in which the entire range is contained).\n */\n getCommonAncestor() {\n return this.start.getCommonAncestor(this.end);\n }\n /**\n * Returns an {@link module:engine/view/element~Element Element} contained by the range.\n * The element will be returned when it is the **only** node within the range and **fullycontained**\n * at the same time.\n */\n getContainedElement() {\n if (this.isCollapsed) {\n return null;\n }\n let nodeAfterStart = this.start.nodeAfter;\n let nodeBeforeEnd = this.end.nodeBefore;\n // Handle the situation when the range position is at the beginning / at the end of a text node.\n // In such situation `.nodeAfter` and `.nodeBefore` are `null` but the range still might be spanning\n // over one element.\n //\n // <p>Foo{<span class=\"widget\"></span>}bar</p> vs <p>Foo[<span class=\"widget\"></span>]bar</p>\n //\n // These are basically the same range, only the difference is if the range position is at\n // at the end/at the beginning of a text node or just before/just after the text node.\n //\n if (this.start.parent.is('$text') && this.start.isAtEnd && this.start.parent.nextSibling) {\n nodeAfterStart = this.start.parent.nextSibling;\n }\n if (this.end.parent.is('$text') && this.end.isAtStart && this.end.parent.previousSibling) {\n nodeBeforeEnd = this.end.parent.previousSibling;\n }\n if (nodeAfterStart && nodeAfterStart.is('element') && nodeAfterStart === nodeBeforeEnd) {\n return nodeAfterStart;\n }\n return null;\n }\n /**\n * Clones this range.\n */\n clone() {\n return new Range(this.start, this.end);\n }\n /**\n * Returns an iterator that iterates over all {@link module:engine/view/item~Item view items} that are in this range and returns\n * them.\n *\n * This method uses {@link module:engine/view/treewalker~TreeWalker} with `boundaries` set to this range and `ignoreElementEnd` option\n * set to `true`. However it returns only {@link module:engine/view/item~Item items},\n * not {@link module:engine/view/treewalker~TreeWalkerValue}.\n *\n * You may specify additional options for the tree walker. See {@link module:engine/view/treewalker~TreeWalker} for\n * a full list of available options.\n *\n * @param options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.\n */\n *getItems(options = {}) {\n options.boundaries = this;\n options.ignoreElementEnd = true;\n const treeWalker = new TreeWalker(options);\n for (const value of treeWalker) {\n yield value.item;\n }\n }\n /**\n * Returns an iterator that iterates over all {@link module:engine/view/position~Position positions} that are boundaries or\n * contained in this range.\n *\n * This method uses {@link module:engine/view/treewalker~TreeWalker} with `boundaries` set to this range. However it returns only\n * {@link module:engine/view/position~Position positions}, not {@link module:engine/view/treewalker~TreeWalkerValue}.\n *\n * You may specify additional options for the tree walker. See {@link module:engine/view/treewalker~TreeWalker} for\n * a full list of available options.\n *\n * @param options Object with configuration options. See {@link module:engine/view/treewalker~TreeWalker}.\n */\n *getPositions(options = {}) {\n options.boundaries = this;\n const treeWalker = new TreeWalker(options);\n yield treeWalker.position;\n for (const value of treeWalker) {\n yield value.nextPosition;\n }\n }\n /**\n * Checks and returns whether this range intersects with the given range.\n *\n * @param otherRange Range to compare with.\n * @returns True if ranges intersect.\n */\n isIntersecting(otherRange) {\n return this.start.isBefore(otherRange.end) && this.end.isAfter(otherRange.start);\n }\n /**\n * Creates a range from the given parents and offsets.\n *\n * @internal\n * @param startElement Start position parent element.\n * @param startOffset Start position offset.\n * @param endElement End position parent element.\n * @param endOffset End position offset.\n * @returns Created range.\n */\n static _createFromParentsAndOffsets(startElement, startOffset, endElement, endOffset) {\n return new this(new Position(startElement, startOffset), new Position(endElement, endOffset));\n }\n /**\n * Creates a new range, spreading from specified {@link module:engine/view/position~Position position} to a position moved by\n * given `shift`. If `shift` is a negative value, shifted position is treated as the beginning of the range.\n *\n * @internal\n * @param position Beginning of the range.\n * @param shift How long the range should be.\n */\n static _createFromPositionAndShift(position, shift) {\n const start = position;\n const end = position.getShiftedBy(shift);\n return shift > 0 ? new this(start, end) : new this(end, start);\n }\n /**\n * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of\n * that element and ends after the last child of that element.\n *\n * @internal\n * @param element Element which is a parent for the range.\n */\n static _createIn(element) {\n return this._createFromParentsAndOffsets(element, 0, element, element.childCount);\n }\n /**\n * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.\n *\n * @internal\n */\n static _createOn(item) {\n const size = item.is('$textProxy') ? item.offsetSize : 1;\n return this._createFromPositionAndShift(Position._createBefore(item), size);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nRange.prototype.is = function (type) {\n return type === 'range' || type === 'view:range';\n};\n/**\n * Function used by getEnlarged and getTrimmed methods.\n */\nfunction enlargeTrimSkip(value) {\n if (value.item.is('attributeElement') || value.item.is('uiElement')) {\n return true;\n }\n return false;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/selection\n */\nimport TypeCheckable from './typecheckable';\nimport Range from './range';\nimport Position from './position';\nimport Node from './node';\nimport DocumentSelection from './documentselection';\nimport { CKEditorError, EmitterMixin, count, isIterable } from '@ckeditor/ckeditor5-utils';\n/**\n * Class representing an arbirtary selection in the view.\n * See also {@link module:engine/view/documentselection~DocumentSelection}.\n *\n * New selection instances can be created via the constructor or one these methods:\n *\n * * {@link module:engine/view/view~View#createSelection `View#createSelection()`},\n * * {@link module:engine/view/upcastwriter~UpcastWriter#createSelection `UpcastWriter#createSelection()`}.\n *\n * A selection can consist of {@link module:engine/view/range~Range ranges} that can be set by using\n * the {@link module:engine/view/selection~Selection#setTo `Selection#setTo()`} method.\n */\nexport default class Selection extends EmitterMixin(TypeCheckable) {\n /**\n * Creates new selection instance.\n *\n * **Note**: The selection constructor is available as a factory method:\n *\n * * {@link module:engine/view/view~View#createSelection `View#createSelection()`},\n * * {@link module:engine/view/upcastwriter~UpcastWriter#createSelection `UpcastWriter#createSelection()`}.\n *\n * ```ts\n * // Creates empty selection without ranges.\n * const selection = writer.createSelection();\n *\n * // Creates selection at the given range.\n * const range = writer.createRange( start, end );\n * const selection = writer.createSelection( range );\n *\n * // Creates selection at the given ranges\n * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];\n * const selection = writer.createSelection( ranges );\n *\n * // Creates selection from the other selection.\n * const otherSelection = writer.createSelection();\n * const selection = writer.createSelection( otherSelection );\n *\n * // Creates selection from the document selection.\n * const selection = writer.createSelection( editor.editing.view.document.selection );\n *\n * // Creates selection at the given position.\n * const position = writer.createPositionFromPath( root, path );\n * const selection = writer.createSelection( position );\n *\n * // Creates collapsed selection at the position of given item and offset.\n * const paragraph = writer.createContainerElement( 'paragraph' );\n * const selection = writer.createSelection( paragraph, offset );\n *\n * // Creates a range inside an {@link module:engine/view/element~Element element} which starts before the\n * // first child of that element and ends after the last child of that element.\n * const selection = writer.createSelection( paragraph, 'in' );\n *\n * // Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends\n * // just after the item.\n * const selection = writer.createSelection( paragraph, 'on' );\n * ```\n *\n * `Selection`'s constructor allow passing additional options (`backward`, `fake` and `label`) as the last argument.\n *\n * ```ts\n * // Creates backward selection.\n * const selection = writer.createSelection( range, { backward: true } );\n * ```\n *\n * Fake selection does not render as browser native selection over selected elements and is hidden to the user.\n * This way, no native selection UI artifacts are displayed to the user and selection over elements can be\n * represented in other way, for example by applying proper CSS class.\n *\n * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM\n * (and be properly handled by screen readers).\n *\n * ```ts\n * // Creates fake selection with label.\n * const selection = writer.createSelection( range, { fake: true, label: 'foo' } );\n * ```\n *\n * @internal\n */\n constructor(...args) {\n super();\n this._ranges = [];\n this._lastRangeBackward = false;\n this._isFake = false;\n this._fakeSelectionLabel = '';\n if (args.length) {\n this.setTo(...args);\n }\n }\n /**\n * Returns true if selection instance is marked as `fake`.\n *\n * @see #setTo\n */\n get isFake() {\n return this._isFake;\n }\n /**\n * Returns fake selection label.\n *\n * @see #setTo\n */\n get fakeSelectionLabel() {\n return this._fakeSelectionLabel;\n }\n /**\n * Selection anchor. Anchor may be described as a position where the selection starts. Together with\n * {@link #focus focus} they define the direction of selection, which is important\n * when expanding/shrinking selection. Anchor is always the start or end of the most recent added range.\n * It may be a bit unintuitive when there are multiple ranges in selection.\n *\n * @see #focus\n */\n get anchor() {\n if (!this._ranges.length) {\n return null;\n }\n const range = this._ranges[this._ranges.length - 1];\n const anchor = this._lastRangeBackward ? range.end : range.start;\n return anchor.clone();\n }\n /**\n * Selection focus. Focus is a position where the selection ends.\n *\n * @see #anchor\n */\n get focus() {\n if (!this._ranges.length) {\n return null;\n }\n const range = this._ranges[this._ranges.length - 1];\n const focus = this._lastRangeBackward ? range.start : range.end;\n return focus.clone();\n }\n /**\n * Returns whether the selection is collapsed. Selection is collapsed when there is exactly one range which is\n * collapsed.\n */\n get isCollapsed() {\n return this.rangeCount === 1 && this._ranges[0].isCollapsed;\n }\n /**\n * Returns number of ranges in selection.\n */\n get rangeCount() {\n return this._ranges.length;\n }\n /**\n * Specifies whether the {@link #focus} precedes {@link #anchor}.\n */\n get isBackward() {\n return !this.isCollapsed && this._lastRangeBackward;\n }\n /**\n * {@link module:engine/view/editableelement~EditableElement EditableElement} instance that contains this selection, or `null`\n * if the selection is not inside an editable element.\n */\n get editableElement() {\n if (this.anchor) {\n return this.anchor.editableElement;\n }\n return null;\n }\n /**\n * Returns an iterable that contains copies of all ranges added to the selection.\n */\n *getRanges() {\n for (const range of this._ranges) {\n yield range.clone();\n }\n }\n /**\n * Returns copy of the first range in the selection. First range is the one which\n * {@link module:engine/view/range~Range#start start} position {@link module:engine/view/position~Position#isBefore is before} start\n * position of all other ranges (not to confuse with the first range added to the selection).\n * Returns `null` if no ranges are added to selection.\n */\n getFirstRange() {\n let first = null;\n for (const range of this._ranges) {\n if (!first || range.start.isBefore(first.start)) {\n first = range;\n }\n }\n return first ? first.clone() : null;\n }\n /**\n * Returns copy of the last range in the selection. Last range is the one which {@link module:engine/view/range~Range#end end}\n * position {@link module:engine/view/position~Position#isAfter is after} end position of all other ranges (not to confuse\n * with the last range added to the selection). Returns `null` if no ranges are added to selection.\n */\n getLastRange() {\n let last = null;\n for (const range of this._ranges) {\n if (!last || range.end.isAfter(last.end)) {\n last = range;\n }\n }\n return last ? last.clone() : null;\n }\n /**\n * Returns copy of the first position in the selection. First position is the position that\n * {@link module:engine/view/position~Position#isBefore is before} any other position in the selection ranges.\n * Returns `null` if no ranges are added to selection.\n */\n getFirstPosition() {\n const firstRange = this.getFirstRange();\n return firstRange ? firstRange.start.clone() : null;\n }\n /**\n * Returns copy of the last position in the selection. Last position is the position that\n * {@link module:engine/view/position~Position#isAfter is after} any other position in the selection ranges.\n * Returns `null` if no ranges are added to selection.\n */\n getLastPosition() {\n const lastRange = this.getLastRange();\n return lastRange ? lastRange.end.clone() : null;\n }\n /**\n * Checks whether, this selection is equal to given selection. Selections are equal if they have same directions,\n * same number of ranges and all ranges from one selection equal to a range from other selection.\n *\n * @param otherSelection Selection to compare with.\n * @returns `true` if selections are equal, `false` otherwise.\n */\n isEqual(otherSelection) {\n if (this.isFake != otherSelection.isFake) {\n return false;\n }\n if (this.isFake && this.fakeSelectionLabel != otherSelection.fakeSelectionLabel) {\n return false;\n }\n if (this.rangeCount != otherSelection.rangeCount) {\n return false;\n }\n else if (this.rangeCount === 0) {\n return true;\n }\n if (!this.anchor.isEqual(otherSelection.anchor) || !this.focus.isEqual(otherSelection.focus)) {\n return false;\n }\n for (const thisRange of this._ranges) {\n let found = false;\n for (const otherRange of otherSelection._ranges) {\n if (thisRange.isEqual(otherRange)) {\n found = true;\n break;\n }\n }\n if (!found) {\n return false;\n }\n }\n return true;\n }\n /**\n * Checks whether this selection is similar to given selection. Selections are similar if they have same directions, same\n * number of ranges, and all {@link module:engine/view/range~Range#getTrimmed trimmed} ranges from one selection are\n * equal to any trimmed range from other selection.\n *\n * @param otherSelection Selection to compare with.\n * @returns `true` if selections are similar, `false` otherwise.\n */\n isSimilar(otherSelection) {\n if (this.isBackward != otherSelection.isBackward) {\n return false;\n }\n const numOfRangesA = count(this.getRanges());\n const numOfRangesB = count(otherSelection.getRanges());\n // If selections have different number of ranges, they cannot be similar.\n if (numOfRangesA != numOfRangesB) {\n return false;\n }\n // If both selections have no ranges, they are similar.\n if (numOfRangesA == 0) {\n return true;\n }\n // Check if each range in one selection has a similar range in other selection.\n for (let rangeA of this.getRanges()) {\n rangeA = rangeA.getTrimmed();\n let found = false;\n for (let rangeB of otherSelection.getRanges()) {\n rangeB = rangeB.getTrimmed();\n if (rangeA.start.isEqual(rangeB.start) && rangeA.end.isEqual(rangeB.end)) {\n found = true;\n break;\n }\n }\n // For `rangeA`, neither range in `otherSelection` was similar. So selections are not similar.\n if (!found) {\n return false;\n }\n }\n // There were no ranges that weren't matched. Selections are similar.\n return true;\n }\n /**\n * Returns the selected element. {@link module:engine/view/element~Element Element} is considered as selected if there is only\n * one range in the selection, and that range contains exactly one element.\n * Returns `null` if there is no selected element.\n */\n getSelectedElement() {\n if (this.rangeCount !== 1) {\n return null;\n }\n return this.getFirstRange().getContainedElement();\n }\n /**\n * Sets this selection's ranges and direction to the specified location based on the given\n * {@link module:engine/view/selection~Selectable selectable}.\n *\n * ```ts\n * // Sets selection to the given range.\n * const range = writer.createRange( start, end );\n * selection.setTo( range );\n *\n * // Sets selection to given ranges.\n * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];\n * selection.setTo( range );\n *\n * // Sets selection to the other selection.\n * const otherSelection = writer.createSelection();\n * selection.setTo( otherSelection );\n *\n * // Sets selection to contents of DocumentSelection.\n * selection.setTo( editor.editing.view.document.selection );\n *\n * // Sets collapsed selection at the given position.\n * const position = writer.createPositionAt( root, path );\n * selection.setTo( position );\n *\n * // Sets collapsed selection at the position of given item and offset.\n * selection.setTo( paragraph, offset );\n * ```\n *\n * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of\n * that element and ends after the last child of that element.\n *\n * ```ts\n * selection.setTo( paragraph, 'in' );\n * ```\n *\n * Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends just after the item.\n *\n * ```ts\n * selection.setTo( paragraph, 'on' );\n *\n * // Clears selection. Removes all ranges.\n * selection.setTo( null );\n * ```\n *\n * `Selection#setTo()` method allow passing additional options (`backward`, `fake` and `label`) as the last argument.\n *\n * ```ts\n * // Sets selection as backward.\n * selection.setTo( range, { backward: true } );\n * ```\n *\n * Fake selection does not render as browser native selection over selected elements and is hidden to the user.\n * This way, no native selection UI artifacts are displayed to the user and selection over elements can be\n * represented in other way, for example by applying proper CSS class.\n *\n * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM\n * (and be properly handled by screen readers).\n *\n * ```ts\n * // Creates fake selection with label.\n * selection.setTo( range, { fake: true, label: 'foo' } );\n * ```\n *\n * @fires change\n */\n setTo(...args) {\n let [selectable, placeOrOffset, options] = args;\n if (typeof placeOrOffset == 'object') {\n options = placeOrOffset;\n placeOrOffset = undefined;\n }\n if (selectable === null) {\n this._setRanges([]);\n this._setFakeOptions(options);\n }\n else if (selectable instanceof Selection || selectable instanceof DocumentSelection) {\n this._setRanges(selectable.getRanges(), selectable.isBackward);\n this._setFakeOptions({ fake: selectable.isFake, label: selectable.fakeSelectionLabel });\n }\n else if (selectable instanceof Range) {\n this._setRanges([selectable], options && options.backward);\n this._setFakeOptions(options);\n }\n else if (selectable instanceof Position) {\n this._setRanges([new Range(selectable)]);\n this._setFakeOptions(options);\n }\n else if (selectable instanceof Node) {\n const backward = !!options && !!options.backward;\n let range;\n if (placeOrOffset === undefined) {\n /**\n * selection.setTo requires the second parameter when the first parameter is a node.\n *\n * @error view-selection-setto-required-second-parameter\n */\n throw new CKEditorError('view-selection-setto-required-second-parameter', this);\n }\n else if (placeOrOffset == 'in') {\n range = Range._createIn(selectable);\n }\n else if (placeOrOffset == 'on') {\n range = Range._createOn(selectable);\n }\n else {\n range = new Range(Position._createAt(selectable, placeOrOffset));\n }\n this._setRanges([range], backward);\n this._setFakeOptions(options);\n }\n else if (isIterable(selectable)) {\n // We assume that the selectable is an iterable of ranges.\n // Array.from() is used to prevent setting ranges to the old iterable\n this._setRanges(selectable, options && options.backward);\n this._setFakeOptions(options);\n }\n else {\n /**\n * Cannot set selection to given place.\n *\n * @error view-selection-setto-not-selectable\n */\n throw new CKEditorError('view-selection-setto-not-selectable', this);\n }\n this.fire('change');\n }\n /**\n * Moves {@link #focus} to the specified location.\n *\n * The location can be specified in the same form as {@link module:engine/view/view~View#createPositionAt view.createPositionAt()}\n * parameters.\n *\n * @fires change\n * @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/view/item~Item view item}.\n */\n setFocus(itemOrPosition, offset) {\n if (this.anchor === null) {\n /**\n * Cannot set selection focus if there are no ranges in selection.\n *\n * @error view-selection-setfocus-no-ranges\n */\n throw new CKEditorError('view-selection-setfocus-no-ranges', this);\n }\n const newFocus = Position._createAt(itemOrPosition, offset);\n if (newFocus.compareWith(this.focus) == 'same') {\n return;\n }\n const anchor = this.anchor;\n this._ranges.pop();\n if (newFocus.compareWith(anchor) == 'before') {\n this._addRange(new Range(newFocus, anchor), true);\n }\n else {\n this._addRange(new Range(anchor, newFocus));\n }\n this.fire('change');\n }\n /**\n * Replaces all ranges that were added to the selection with given array of ranges. Last range of the array\n * is treated like the last added range and is used to set {@link #anchor anchor} and {@link #focus focus}.\n * Accepts a flag describing in which way the selection is made.\n *\n * @param newRanges Iterable object of ranges to set.\n * @param isLastBackward Flag describing if last added range was selected forward - from start to end\n * (`false`) or backward - from end to start (`true`). Defaults to `false`.\n */\n _setRanges(newRanges, isLastBackward = false) {\n // New ranges should be copied to prevent removing them by setting them to `[]` first.\n // Only applies to situations when selection is set to the same selection or same selection's ranges.\n newRanges = Array.from(newRanges);\n this._ranges = [];\n for (const range of newRanges) {\n this._addRange(range);\n }\n this._lastRangeBackward = !!isLastBackward;\n }\n /**\n * Sets this selection instance to be marked as `fake`. A fake selection does not render as browser native selection\n * over selected elements and is hidden to the user. This way, no native selection UI artifacts are displayed to\n * the user and selection over elements can be represented in other way, for example by applying proper CSS class.\n *\n * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM (and be\n * properly handled by screen readers).\n */\n _setFakeOptions(options = {}) {\n this._isFake = !!options.fake;\n this._fakeSelectionLabel = options.fake ? options.label || '' : '';\n }\n /**\n * Adds a range to the selection. Added range is copied. This means that passed range is not saved in the\n * selection instance and you can safely operate on it.\n *\n * Accepts a flag describing in which way the selection is made - passed range might be selected from\n * {@link module:engine/view/range~Range#start start} to {@link module:engine/view/range~Range#end end}\n * or from {@link module:engine/view/range~Range#end end} to {@link module:engine/view/range~Range#start start}.\n * The flag is used to set {@link #anchor anchor} and {@link #focus focus} properties.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-selection-range-intersects` if added range intersects\n * with ranges already stored in Selection instance.\n */\n _addRange(range, isBackward = false) {\n if (!(range instanceof Range)) {\n /**\n * Selection range set to an object that is not an instance of {@link module:engine/view/range~Range}.\n *\n * @error view-selection-add-range-not-range\n */\n throw new CKEditorError('view-selection-add-range-not-range', this);\n }\n this._pushRange(range);\n this._lastRangeBackward = !!isBackward;\n }\n /**\n * Adds range to selection - creates copy of given range so it can be safely used and modified.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-selection-range-intersects` if added range intersects\n * with ranges already stored in selection instance.\n */\n _pushRange(range) {\n for (const storedRange of this._ranges) {\n if (range.isIntersecting(storedRange)) {\n /**\n * Trying to add a range that intersects with another range from selection.\n *\n * @error view-selection-range-intersects\n * @param {module:engine/view/range~Range} addedRange Range that was added to the selection.\n * @param {module:engine/view/range~Range} intersectingRange Range from selection that intersects with `addedRange`.\n */\n throw new CKEditorError('view-selection-range-intersects', this, { addedRange: range, intersectingRange: storedRange });\n }\n }\n this._ranges.push(new Range(range.start, range.end));\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nSelection.prototype.is = function (type) {\n return type === 'selection' || type === 'view:selection';\n};\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/documentselection\n */\nimport TypeCheckable from './typecheckable';\nimport Selection from './selection';\nimport { EmitterMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * Class representing the document selection in the view.\n *\n * Its instance is available in {@link module:engine/view/document~Document#selection `Document#selection`}.\n *\n * It is similar to {@link module:engine/view/selection~Selection} but\n * it has a read-only API and can be modified only by the writer available in\n * the {@link module:engine/view/view~View#change `View#change()`} block\n * (so via {@link module:engine/view/downcastwriter~DowncastWriter#setSelection `DowncastWriter#setSelection()`}).\n */\nexport default class DocumentSelection extends EmitterMixin(TypeCheckable) {\n constructor(...args) {\n super();\n this._selection = new Selection();\n // Delegate change event to be fired on DocumentSelection instance.\n this._selection.delegate('change').to(this);\n // Set selection data.\n if (args.length) {\n this._selection.setTo(...args);\n }\n }\n /**\n * Returns true if selection instance is marked as `fake`.\n *\n * @see #_setTo\n */\n get isFake() {\n return this._selection.isFake;\n }\n /**\n * Returns fake selection label.\n *\n * @see #_setTo\n */\n get fakeSelectionLabel() {\n return this._selection.fakeSelectionLabel;\n }\n /**\n * Selection anchor. Anchor may be described as a position where the selection starts. Together with\n * {@link #focus focus} they define the direction of selection, which is important\n * when expanding/shrinking selection. Anchor is always the start or end of the most recent added range.\n * It may be a bit unintuitive when there are multiple ranges in selection.\n *\n * @see #focus\n */\n get anchor() {\n return this._selection.anchor;\n }\n /**\n * Selection focus. Focus is a position where the selection ends.\n *\n * @see #anchor\n */\n get focus() {\n return this._selection.focus;\n }\n /**\n * Returns whether the selection is collapsed. Selection is collapsed when there is exactly one range which is\n * collapsed.\n */\n get isCollapsed() {\n return this._selection.isCollapsed;\n }\n /**\n * Returns number of ranges in selection.\n */\n get rangeCount() {\n return this._selection.rangeCount;\n }\n /**\n * Specifies whether the {@link #focus} precedes {@link #anchor}.\n */\n get isBackward() {\n return this._selection.isBackward;\n }\n /**\n * {@link module:engine/view/editableelement~EditableElement EditableElement} instance that contains this selection, or `null`\n * if the selection is not inside an editable element.\n */\n get editableElement() {\n return this._selection.editableElement;\n }\n /**\n * Used for the compatibility with the {@link module:engine/view/selection~Selection#isEqual} method.\n *\n * @internal\n */\n get _ranges() {\n return this._selection._ranges;\n }\n /**\n * Returns an iterable that contains copies of all ranges added to the selection.\n */\n *getRanges() {\n yield* this._selection.getRanges();\n }\n /**\n * Returns copy of the first range in the selection. First range is the one which\n * {@link module:engine/view/range~Range#start start} position {@link module:engine/view/position~Position#isBefore is before} start\n * position of all other ranges (not to confuse with the first range added to the selection).\n * Returns `null` if no ranges are added to selection.\n */\n getFirstRange() {\n return this._selection.getFirstRange();\n }\n /**\n * Returns copy of the last range in the selection. Last range is the one which {@link module:engine/view/range~Range#end end}\n * position {@link module:engine/view/position~Position#isAfter is after} end position of all other ranges (not to confuse\n * with the last range added to the selection). Returns `null` if no ranges are added to selection.\n */\n getLastRange() {\n return this._selection.getLastRange();\n }\n /**\n * Returns copy of the first position in the selection. First position is the position that\n * {@link module:engine/view/position~Position#isBefore is before} any other position in the selection ranges.\n * Returns `null` if no ranges are added to selection.\n */\n getFirstPosition() {\n return this._selection.getFirstPosition();\n }\n /**\n * Returns copy of the last position in the selection. Last position is the position that\n * {@link module:engine/view/position~Position#isAfter is after} any other position in the selection ranges.\n * Returns `null` if no ranges are added to selection.\n */\n getLastPosition() {\n return this._selection.getLastPosition();\n }\n /**\n * Returns the selected element. {@link module:engine/view/element~Element Element} is considered as selected if there is only\n * one range in the selection, and that range contains exactly one element.\n * Returns `null` if there is no selected element.\n */\n getSelectedElement() {\n return this._selection.getSelectedElement();\n }\n /**\n * Checks whether, this selection is equal to given selection. Selections are equal if they have same directions,\n * same number of ranges and all ranges from one selection equal to a range from other selection.\n *\n * @param otherSelection Selection to compare with.\n * @returns `true` if selections are equal, `false` otherwise.\n */\n isEqual(otherSelection) {\n return this._selection.isEqual(otherSelection);\n }\n /**\n * Checks whether this selection is similar to given selection. Selections are similar if they have same directions, same\n * number of ranges, and all {@link module:engine/view/range~Range#getTrimmed trimmed} ranges from one selection are\n * equal to any trimmed range from other selection.\n *\n * @param otherSelection Selection to compare with.\n * @returns `true` if selections are similar, `false` otherwise.\n */\n isSimilar(otherSelection) {\n return this._selection.isSimilar(otherSelection);\n }\n /**\n * Sets this selection's ranges and direction to the specified location based on the given\n * {@link module:engine/view/selection~Selectable selectable}.\n *\n * ```ts\n * // Sets selection to the given range.\n * const range = writer.createRange( start, end );\n * documentSelection._setTo( range );\n *\n * // Sets selection to given ranges.\n * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( start2, end2 ) ];\n * documentSelection._setTo( range );\n *\n * // Sets selection to the other selection.\n * const otherSelection = writer.createSelection();\n * documentSelection._setTo( otherSelection );\n *\n * // Sets collapsed selection at the given position.\n * const position = writer.createPositionAt( root, offset );\n * documentSelection._setTo( position );\n *\n * // Sets collapsed selection at the position of given item and offset.\n * documentSelection._setTo( paragraph, offset );\n * ```\n *\n * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of\n * that element and ends after the last child of that element.\n *\n * ```ts\n * documentSelection._setTo( paragraph, 'in' );\n * ```\n *\n * Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends just after the item.\n *\n * ```ts\n * documentSelection._setTo( paragraph, 'on' );\n *\n * // Clears selection. Removes all ranges.\n * documentSelection._setTo( null );\n * ```\n *\n * `Selection#_setTo()` method allow passing additional options (`backward`, `fake` and `label`) as the last argument.\n *\n * ```ts\n * // Sets selection as backward.\n * documentSelection._setTo( range, { backward: true } );\n * ```\n *\n * Fake selection does not render as browser native selection over selected elements and is hidden to the user.\n * This way, no native selection UI artifacts are displayed to the user and selection over elements can be\n * represented in other way, for example by applying proper CSS class.\n *\n * Additionally fake's selection label can be provided. It will be used to des cribe fake selection in DOM\n * (and be properly handled by screen readers).\n *\n * ```ts\n * // Creates fake selection with label.\n * documentSelection._setTo( range, { fake: true, label: 'foo' } );\n * ```\n *\n * @internal\n * @fires change\n */\n _setTo(...args) {\n this._selection.setTo(...args);\n }\n /**\n * Moves {@link #focus} to the specified location.\n *\n * The location can be specified in the same form as {@link module:engine/view/view~View#createPositionAt view.createPositionAt()}\n * parameters.\n *\n * @internal\n * @fires change\n * @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/view/item~Item view item}.\n */\n _setFocus(itemOrPosition, offset) {\n this._selection.setFocus(itemOrPosition, offset);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nDocumentSelection.prototype.is = function (type) {\n return type === 'selection' ||\n type == 'documentSelection' ||\n type == 'view:selection' ||\n type == 'view:documentSelection';\n};\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/bubblingeventinfo\n */\nimport { EventInfo } from '@ckeditor/ckeditor5-utils';\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 */\nexport default class BubblingEventInfo extends EventInfo {\n /**\n * @param source The emitter.\n * @param name The event name.\n * @param startRange The view range that the bubbling should start from.\n */\n constructor(source, name, startRange) {\n super(source, name);\n this.startRange = startRange;\n this._eventPhase = 'none';\n this._currentTarget = null;\n }\n /**\n * The current event phase.\n */\n get eventPhase() {\n return this._eventPhase;\n }\n /**\n * The current bubbling target.\n */\n get currentTarget() {\n return this._currentTarget;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/bubblingemittermixin\n */\nimport { CKEditorError, EmitterMixin, EventInfo, toArray } from '@ckeditor/ckeditor5-utils';\nimport BubblingEventInfo from './bubblingeventinfo';\nconst contextsSymbol = Symbol('bubbling contexts');\n/**\n * Bubbling emitter mixin for the view document as described in the {@link ~BubblingEmitter} interface.\n *\n * This function creates a class that inherits from the provided `base` and implements `Emitter` interface.\n * The base class must implement {@link module:utils/emittermixin~Emitter} interface.\n *\n * ```ts\n * class BaseClass extends EmitterMixin() {\n * \t// ...\n * }\n *\n * class MyClass extends BubblingEmitterMixin( BaseClass ) {\n * \t// This class derives from `BaseClass` and implements the `BubblingEmitter` interface.\n * }\n * ```\n */\nexport default function BubblingEmitterMixin(base) {\n class Mixin extends base {\n fire(eventOrInfo, ...eventArgs) {\n try {\n const eventInfo = eventOrInfo instanceof EventInfo ? eventOrInfo : new EventInfo(this, eventOrInfo);\n const eventContexts = getBubblingContexts(this);\n if (!eventContexts.size) {\n return;\n }\n updateEventInfo(eventInfo, 'capturing', this);\n // The capture phase of the event.\n if (fireListenerFor(eventContexts, '$capture', eventInfo, ...eventArgs)) {\n return eventInfo.return;\n }\n const startRange = eventInfo.startRange || this.selection.getFirstRange();\n const selectedElement = startRange ? startRange.getContainedElement() : null;\n const isCustomContext = selectedElement ? Boolean(getCustomContext(eventContexts, selectedElement)) : false;\n let node = selectedElement || getDeeperRangeParent(startRange);\n updateEventInfo(eventInfo, 'atTarget', node);\n // For the not yet bubbling event trigger for $text node if selection can be there and it's not a custom context selected.\n if (!isCustomContext) {\n if (fireListenerFor(eventContexts, '$text', eventInfo, ...eventArgs)) {\n return eventInfo.return;\n }\n updateEventInfo(eventInfo, 'bubbling', node);\n }\n while (node) {\n // Root node handling.\n if (node.is('rootElement')) {\n if (fireListenerFor(eventContexts, '$root', eventInfo, ...eventArgs)) {\n return eventInfo.return;\n }\n }\n // Element node handling.\n else if (node.is('element')) {\n if (fireListenerFor(eventContexts, node.name, eventInfo, ...eventArgs)) {\n return eventInfo.return;\n }\n }\n // Check custom contexts (i.e., a widget).\n if (fireListenerFor(eventContexts, node, eventInfo, ...eventArgs)) {\n return eventInfo.return;\n }\n node = node.parent;\n updateEventInfo(eventInfo, 'bubbling', node);\n }\n updateEventInfo(eventInfo, 'bubbling', this);\n // Document context.\n fireListenerFor(eventContexts, '$document', eventInfo, ...eventArgs);\n return eventInfo.return;\n }\n catch (err) {\n // @if CK_DEBUG // throw err;\n /* istanbul ignore next -- @preserve */\n CKEditorError.rethrowUnexpectedError(err, this);\n }\n }\n _addEventListener(event, callback, options) {\n const contexts = toArray(options.context || '$document');\n const eventContexts = getBubblingContexts(this);\n for (const context of contexts) {\n let emitter = eventContexts.get(context);\n if (!emitter) {\n emitter = new (EmitterMixin())();\n eventContexts.set(context, emitter);\n }\n this.listenTo(emitter, event, callback, options);\n }\n }\n _removeEventListener(event, callback) {\n const eventContexts = getBubblingContexts(this);\n for (const emitter of eventContexts.values()) {\n this.stopListening(emitter, event, callback);\n }\n }\n }\n return Mixin;\n}\n// Backward compatibility with `mix`.\n{\n const mixin = BubblingEmitterMixin(Object);\n ['fire', '_addEventListener', '_removeEventListener'].forEach(key => {\n BubblingEmitterMixin[key] = mixin.prototype[key];\n });\n}\n/**\n * Update the event info bubbling fields.\n *\n * @param eventInfo The event info object to update.\n * @param eventPhase The current event phase.\n * @param currentTarget The current bubbling target.\n */\nfunction updateEventInfo(eventInfo, eventPhase, currentTarget) {\n if (eventInfo instanceof BubblingEventInfo) {\n eventInfo._eventPhase = eventPhase;\n eventInfo._currentTarget = currentTarget;\n }\n}\n/**\n * Fires the listener for the specified context. Returns `true` if event was stopped.\n *\n * @param eventInfo The `EventInfo` object.\n * @param eventArgs Additional arguments to be passed to the callbacks.\n * @returns True if event stop was called.\n */\nfunction fireListenerFor(eventContexts, context, eventInfo, ...eventArgs) {\n const emitter = typeof context == 'string' ? eventContexts.get(context) : getCustomContext(eventContexts, context);\n if (!emitter) {\n return false;\n }\n emitter.fire(eventInfo, ...eventArgs);\n return eventInfo.stop.called;\n}\n/**\n * Returns an emitter for a specified view node.\n */\nfunction getCustomContext(eventContexts, node) {\n for (const [context, emitter] of eventContexts) {\n if (typeof context == 'function' && context(node)) {\n return emitter;\n }\n }\n return null;\n}\n/**\n * Returns bubbling contexts map for the source (emitter).\n */\nfunction getBubblingContexts(source) {\n if (!source[contextsSymbol]) {\n source[contextsSymbol] = new Map();\n }\n return source[contextsSymbol];\n}\n/**\n * Returns the deeper parent element for the range.\n */\nfunction getDeeperRangeParent(range) {\n if (!range) {\n return null;\n }\n const startParent = range.start.parent;\n const endParent = range.end.parent;\n const startPath = startParent.getPath();\n const endPath = endParent.getPath();\n return startPath.length > endPath.length ? startParent : endParent;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/document\n */\nimport DocumentSelection from './documentselection';\nimport BubblingEmitterMixin from './observer/bubblingemittermixin';\nimport { Collection, ObservableMixin } from '@ckeditor/ckeditor5-utils';\n// @if CK_DEBUG_ENGINE // const { logDocument } = require( '../dev-utils/utils' );\n/**\n * Document class creates an abstract layer over the content editable area, contains a tree of view elements and\n * {@link module:engine/view/documentselection~DocumentSelection view selection} associated with this document.\n */\nexport default class Document extends BubblingEmitterMixin(ObservableMixin()) {\n /**\n * Creates a Document instance.\n *\n * @param stylesProcessor The styles processor instance.\n */\n constructor(stylesProcessor) {\n super();\n /**\n * Post-fixer callbacks registered to the view document.\n */\n this._postFixers = new Set();\n this.selection = new DocumentSelection();\n this.roots = new Collection({ idProperty: 'rootName' });\n this.stylesProcessor = stylesProcessor;\n this.set('isReadOnly', false);\n this.set('isFocused', false);\n this.set('isSelecting', false);\n this.set('isComposing', false);\n }\n /**\n * Gets a {@link module:engine/view/document~Document#roots view root element} with the specified name. If the name is not\n * specific \"main\" root is returned.\n *\n * @param name Name of the root.\n * @returns The view root element with the specified name or null when there is no root of given name.\n */\n getRoot(name = 'main') {\n return this.roots.get(name);\n }\n /**\n * Allows registering post-fixer callbacks. A post-fixers mechanism allows to update the view tree just before it is rendered\n * to the DOM.\n *\n * Post-fixers are executed right after all changes from the outermost change block were applied but\n * before the {@link module:engine/view/view~View#event:render render event} is fired. If a post-fixer callback made\n * a change, it should return `true`. When this happens, all post-fixers are fired again to check if something else should\n * not be fixed in the new document tree state.\n *\n * View post-fixers are useful when you want to apply some fixes whenever the view structure changes. Keep in mind that\n * changes executed in a view post-fixer should not break model-view mapping.\n *\n * The types of changes which should be safe:\n *\n * * adding or removing attribute from elements,\n * * changes inside of {@link module:engine/view/uielement~UIElement UI elements},\n * * {@link module:engine/controller/editingcontroller~EditingController#reconvertItem marking some of the model elements to be\n * re-converted}.\n *\n * Try to avoid changes which touch view structure:\n *\n * * you should not add or remove nor wrap or unwrap any view elements,\n * * you should not change the editor data model in a view post-fixer.\n *\n * As a parameter, a post-fixer callback receives a {@link module:engine/view/downcastwriter~DowncastWriter downcast writer}.\n *\n * Typically, a post-fixer will look like this:\n *\n * ```ts\n * editor.editing.view.document.registerPostFixer( writer => {\n * \tif ( checkSomeCondition() ) {\n * \t\twriter.doSomething();\n *\n * \t\t// Let other post-fixers know that something changed.\n * \t\treturn true;\n * \t}\n * } );\n * ```\n *\n * Note that nothing happens right after you register a post-fixer (e.g. execute such a code in the console).\n * That is because adding a post-fixer does not execute it.\n * The post-fixer will be executed as soon as any change in the document needs to cause its rendering.\n * If you want to re-render the editor's view after registering the post-fixer then you should do it manually by calling\n * {@link module:engine/view/view~View#forceRender `view.forceRender()`}.\n *\n * If you need to register a callback which is executed when DOM elements are already updated,\n * use {@link module:engine/view/view~View#event:render render event}.\n */\n registerPostFixer(postFixer) {\n this._postFixers.add(postFixer);\n }\n /**\n * Destroys this instance. Makes sure that all observers are destroyed and listeners removed.\n */\n destroy() {\n this.roots.map(root => root.destroy());\n this.stopListening();\n }\n /**\n * Performs post-fixer loops. Executes post-fixer callbacks as long as none of them has done any changes to the model.\n *\n * @internal\n */\n _callPostFixers(writer) {\n let wasFixed = false;\n do {\n for (const callback of this._postFixers) {\n wasFixed = callback(writer);\n if (wasFixed) {\n break;\n }\n }\n } while (wasFixed);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/attributeelement\n */\nimport Element from './element';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n// Default attribute priority.\nconst DEFAULT_PRIORITY = 10;\n/**\n * Attribute elements are used to represent formatting elements in the view (think `<b>`, `<span style=\"font-size: 2em\">`, etc.).\n * Most often they are created when downcasting model text attributes.\n *\n * Editing engine does not define a fixed HTML DTD. This is why a feature developer needs to choose between various\n * types (container element, {@link module:engine/view/attributeelement~AttributeElement attribute element},\n * {@link module:engine/view/emptyelement~EmptyElement empty element}, etc) when developing a feature.\n *\n * To create a new attribute element instance use the\n * {@link module:engine/view/downcastwriter~DowncastWriter#createAttributeElement `DowncastWriter#createAttributeElement()`} method.\n */\nexport default class AttributeElement extends Element {\n /**\n * Creates an attribute element.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#createAttributeElement\n * @see module:engine/view/element~Element\n * @protected\n * @param document The document instance to which this element belongs.\n * @param name Node name.\n * @param attrs Collection of attributes.\n * @param children A list of nodes to be inserted into created element.\n */\n constructor(document, name, attrs, children) {\n super(document, name, attrs, children);\n /**\n * Element priority. Decides in what order elements are wrapped by {@link module:engine/view/downcastwriter~DowncastWriter}.\n *\n * @internal\n * @readonly\n */\n this._priority = DEFAULT_PRIORITY;\n /**\n * Element identifier. If set, it is used by {@link module:engine/view/element~Element#isSimilar},\n * and then two elements are considered similar if, and only if they have the same `_id`.\n *\n * @internal\n * @readonly\n */\n this._id = null;\n /**\n * Keeps all the attribute elements that have the same {@link module:engine/view/attributeelement~AttributeElement#id ids}\n * and still exist in the view tree.\n *\n * This property is managed by {@link module:engine/view/downcastwriter~DowncastWriter}.\n */\n this._clonesGroup = null;\n this.getFillerOffset = getFillerOffset;\n }\n /**\n * Element priority. Decides in what order elements are wrapped by {@link module:engine/view/downcastwriter~DowncastWriter}.\n */\n get priority() {\n return this._priority;\n }\n /**\n * Element identifier. If set, it is used by {@link module:engine/view/element~Element#isSimilar},\n * and then two elements are considered similar if, and only if they have the same `id`.\n */\n get id() {\n return this._id;\n }\n /**\n * Returns all {@link module:engine/view/attributeelement~AttributeElement attribute elements} that has the\n * same {@link module:engine/view/attributeelement~AttributeElement#id id} and are in the view tree (were not removed).\n *\n * Note: If this element has been removed from the tree, returned set will not include it.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError attribute-element-get-elements-with-same-id-no-id}\n * if this element has no `id`.\n *\n * @returns Set containing all the attribute elements\n * with the same `id` that were added and not removed from the view tree.\n */\n getElementsWithSameId() {\n if (this.id === null) {\n /**\n * Cannot get elements with the same id for an attribute element without id.\n *\n * @error attribute-element-get-elements-with-same-id-no-id\n */\n throw new CKEditorError('attribute-element-get-elements-with-same-id-no-id', this);\n }\n return new Set(this._clonesGroup);\n }\n /**\n * Checks if this element is similar to other element.\n *\n * If none of elements has set {@link module:engine/view/attributeelement~AttributeElement#id}, then both elements\n * should have the same name, attributes and priority to be considered as similar. Two similar elements can contain\n * different set of children nodes.\n *\n * If at least one element has {@link module:engine/view/attributeelement~AttributeElement#id} set, then both\n * elements have to have the same {@link module:engine/view/attributeelement~AttributeElement#id} value to be\n * considered similar.\n *\n * Similarity is important for {@link module:engine/view/downcastwriter~DowncastWriter}. For example:\n *\n * * two following similar elements can be merged together into one, longer element,\n * * {@link module:engine/view/downcastwriter~DowncastWriter#unwrap} checks similarity of passed element and processed element to\n * decide whether processed element should be unwrapped,\n * * etc.\n */\n isSimilar(otherElement) {\n // If any element has an `id` set, just compare the ids.\n if (this.id !== null || otherElement.id !== null) {\n return this.id === otherElement.id;\n }\n return super.isSimilar(otherElement) && this.priority == otherElement.priority;\n }\n /**\n * Clones provided element with priority.\n *\n * @internal\n * @param deep If set to `true` clones element and all its children recursively. When set to `false`,\n * element will be cloned without any children.\n * @returns Clone of this element.\n */\n _clone(deep = false) {\n const cloned = super._clone(deep);\n // Clone priority too.\n cloned._priority = this._priority;\n // And id too.\n cloned._id = this._id;\n return cloned;\n }\n}\nAttributeElement.DEFAULT_PRIORITY = DEFAULT_PRIORITY;\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nAttributeElement.prototype.is = function (type, name) {\n if (!name) {\n return type === 'attributeElement' || type === 'view:attributeElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'element' || type === 'view:element' ||\n type === 'node' || type === 'view:node';\n }\n else {\n return name === this.name && (type === 'attributeElement' || type === 'view:attributeElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'element' || type === 'view:element');\n }\n};\n/**\n * Returns block {@link module:engine/view/filler~Filler filler} offset or `null` if block filler is not needed.\n *\n * @returns Block filler offset or `null` if block filler is not needed.\n */\nfunction getFillerOffset() {\n // <b>foo</b> does not need filler.\n if (nonUiChildrenCount(this)) {\n return null;\n }\n let element = this.parent;\n // <p><b></b></p> needs filler -> <p><b><br></b></p>\n while (element && element.is('attributeElement')) {\n if (nonUiChildrenCount(element) > 1) {\n return null;\n }\n element = element.parent;\n }\n if (!element || nonUiChildrenCount(element) > 1) {\n return null;\n }\n // Render block filler at the end of element (after all ui elements).\n return this.childCount;\n}\n/**\n * Returns total count of children that are not {@link module:engine/view/uielement~UIElement UIElements}.\n */\nfunction nonUiChildrenCount(element) {\n return Array.from(element.getChildren()).filter(element => !element.is('uiElement')).length;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/emptyelement\n */\nimport Element from './element';\nimport Node from './node';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Empty element class. It is used to represent elements that cannot contain any child nodes (for example `<img>` elements).\n *\n * To create a new empty element use the\n * {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement `downcastWriter#createEmptyElement()`} method.\n */\nexport default class EmptyElement extends Element {\n /**\n * Creates new instance of EmptyElement.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-emptyelement-cannot-add` when third parameter is passed,\n * to inform that usage of EmptyElement is incorrect (adding child nodes to EmptyElement is forbidden).\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#createEmptyElement\n * @internal\n * @param document The document instance to which this element belongs.\n * @param name Node name.\n * @param attrs Collection of attributes.\n * @param children A list of nodes to be inserted into created element.\n */\n constructor(document, name, attributes, children) {\n super(document, name, attributes, children);\n this.getFillerOffset = getFillerOffset;\n }\n /**\n * Overrides {@link module:engine/view/element~Element#_insertChild} method.\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-emptyelement-cannot-add` to prevent\n * adding any child nodes to EmptyElement.\n *\n * @internal\n */\n _insertChild(index, items) {\n if (items && (items instanceof Node || Array.from(items).length > 0)) {\n /**\n * Cannot add children to {@link module:engine/view/emptyelement~EmptyElement}.\n *\n * @error view-emptyelement-cannot-add\n */\n throw new CKEditorError('view-emptyelement-cannot-add', [this, items]);\n }\n return 0;\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nEmptyElement.prototype.is = function (type, name) {\n if (!name) {\n return type === 'emptyElement' || type === 'view:emptyElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'element' || type === 'view:element' ||\n type === 'node' || type === 'view:node';\n }\n else {\n return name === this.name && (type === 'emptyElement' || type === 'view:emptyElement' ||\n type === 'element' || type === 'view:element');\n }\n};\n/**\n * Returns `null` because block filler is not needed for EmptyElements.\n */\nfunction getFillerOffset() {\n return null;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/uielement\n */\nimport Element from './element';\nimport Node from './node';\nimport { CKEditorError, keyCodes } from '@ckeditor/ckeditor5-utils';\n/**\n * UI element class. It should be used to represent editing UI which needs to be injected into the editing view\n * If possible, you should keep your UI outside the editing view. However, if that is not possible,\n * UI elements can be used.\n *\n * How a UI element is rendered is in your control (you pass a callback to\n * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `downcastWriter#createUIElement()`}).\n * The editor will ignore your UI element the selection cannot be placed in it, it is skipped (invisible) when\n * the user modifies the selection by using arrow keys and the editor does not listen to any mutations which\n * happen inside your UI elements.\n *\n * The limitation is that you cannot convert a model element to a UI element. UI elements need to be\n * created for {@link module:engine/model/markercollection~Marker markers} or as additinal elements\n * inside normal {@link module:engine/view/containerelement~ContainerElement container elements}.\n *\n * To create a new UI element use the\n * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `downcastWriter#createUIElement()`} method.\n */\nexport default class UIElement extends Element {\n /**\n * Creates new instance of UIElement.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-uielement-cannot-add` when third parameter is passed,\n * to inform that usage of UIElement is incorrect (adding child nodes to UIElement is forbidden).\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#createUIElement\n * @internal\n * @param document The document instance to which this element belongs.\n * @param name Node name.\n * @param attrs Collection of attributes.\n * @param children A list of nodes to be inserted into created element.\n */\n constructor(document, name, attrs, children) {\n super(document, name, attrs, children);\n this.getFillerOffset = getFillerOffset;\n }\n /**\n * Overrides {@link module:engine/view/element~Element#_insertChild} method.\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-uielement-cannot-add` to prevent adding any child nodes\n * to UIElement.\n *\n * @internal\n */\n _insertChild(index, items) {\n if (items && (items instanceof Node || Array.from(items).length > 0)) {\n /**\n * Cannot add children to {@link module:engine/view/uielement~UIElement}.\n *\n * @error view-uielement-cannot-add\n */\n throw new CKEditorError('view-uielement-cannot-add', [this, items]);\n }\n return 0;\n }\n /**\n * Renders this {@link module:engine/view/uielement~UIElement} to DOM. This method is called by\n * {@link module:engine/view/domconverter~DomConverter}.\n * Do not use inheritance to create custom rendering method, replace `render()` method instead:\n *\n * ```ts\n * const myUIElement = downcastWriter.createUIElement( 'span' );\n * myUIElement.render = function( domDocument, domConverter ) {\n * \tconst domElement = this.toDomElement( domDocument );\n *\n * \tdomConverter.setContentOf( domElement, '<b>this is ui element</b>' );\n *\n * \treturn domElement;\n * };\n * ```\n *\n * If changes in your UI element should trigger some editor UI update you should call\n * the {@link module:ui/editorui/editorui~EditorUI#update `editor.ui.update()`} method\n * after rendering your UI element.\n *\n * @param domConverter Instance of the DomConverter used to optimize the output.\n */\n render(domDocument, domConverter) {\n // Provide basic, default output.\n return this.toDomElement(domDocument);\n }\n /**\n * Creates DOM element based on this view UIElement.\n * Note that each time this method is called new DOM element is created.\n */\n toDomElement(domDocument) {\n const domElement = domDocument.createElement(this.name);\n for (const key of this.getAttributeKeys()) {\n domElement.setAttribute(key, this.getAttribute(key));\n }\n return domElement;\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nUIElement.prototype.is = function (type, name) {\n if (!name) {\n return type === 'uiElement' || type === 'view:uiElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'element' || type === 'view:element' ||\n type === 'node' || type === 'view:node';\n }\n else {\n return name === this.name && (type === 'uiElement' || type === 'view:uiElement' ||\n type === 'element' || type === 'view:element');\n }\n};\n/**\n * This function injects UI element handling to the given {@link module:engine/view/document~Document document}.\n *\n * A callback is added to {@link module:engine/view/document~Document#event:keydown document keydown event}.\n * The callback handles the situation when right arrow key is pressed and selection is collapsed before a UI element.\n * Without this handler, it would be impossible to \"jump over\" UI element using right arrow key.\n *\n * @param view View controller to which the quirks handling will be injected.\n */\nexport function injectUiElementHandling(view) {\n view.document.on('arrowKey', (evt, data) => jumpOverUiElement(evt, data, view.domConverter), { priority: 'low' });\n}\n/**\n * Returns `null` because block filler is not needed for UIElements.\n */\nfunction getFillerOffset() {\n return null;\n}\n/**\n * Selection cannot be placed in a `UIElement`. Whenever it is placed there, it is moved before it. This\n * causes a situation when it is impossible to jump over `UIElement` using right arrow key, because the selection\n * ends up in ui element (in DOM) and is moved back to the left. This handler fixes this situation.\n */\nfunction jumpOverUiElement(evt, data, domConverter) {\n if (data.keyCode == keyCodes.arrowright) {\n const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();\n const domSelectionCollapsed = domSelection.rangeCount == 1 && domSelection.getRangeAt(0).collapsed;\n // Jump over UI element if selection is collapsed or shift key is pressed. These are the cases when selection would extend.\n if (domSelectionCollapsed || data.shiftKey) {\n const domParent = domSelection.focusNode;\n const domOffset = domSelection.focusOffset;\n const viewPosition = domConverter.domPositionToView(domParent, domOffset);\n // In case if dom element is not converted to view or is not mapped or something. Happens for example in some tests.\n if (viewPosition === null) {\n return;\n }\n // Skip all following ui elements.\n let jumpedOverAnyUiElement = false;\n const nextViewPosition = viewPosition.getLastMatchingPosition(value => {\n if (value.item.is('uiElement')) {\n // Remember that there was at least one ui element.\n jumpedOverAnyUiElement = true;\n }\n // Jump over ui elements, jump over empty attribute elements, move up from inside of attribute element.\n if (value.item.is('uiElement') || value.item.is('attributeElement')) {\n return true;\n }\n // Don't jump over text or don't get out of container element.\n return false;\n });\n // If anything has been skipped, fix position.\n // This `if` could be possibly omitted but maybe it is better not to mess with DOM selection if not needed.\n if (jumpedOverAnyUiElement) {\n const newDomPosition = domConverter.viewPositionToDom(nextViewPosition);\n if (domSelectionCollapsed) {\n // Selection was collapsed, so collapse it at further position.\n domSelection.collapse(newDomPosition.parent, newDomPosition.offset);\n }\n else {\n // Selection was not collapse, so extend it instead of collapsing.\n domSelection.extend(newDomPosition.parent, newDomPosition.offset);\n }\n }\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/**\n * @module engine/view/rawelement\n */\nimport Element from './element';\nimport Node from './node';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * The raw element class.\n *\n * The raw elements work as data containers (\"wrappers\", \"sandboxes\") but their children are not managed or\n * even recognized by the editor. This encapsulation allows integrations to maintain custom DOM structures\n * in the editor content without, for instance, worrying about compatibility with other editor features.\n * Raw elements are a perfect tool for integration with external frameworks and data sources.\n *\n * Unlike {@link module:engine/view/uielement~UIElement UI elements}, raw elements act like real editor\n * content (similar to {@link module:engine/view/containerelement~ContainerElement} or\n * {@link module:engine/view/emptyelement~EmptyElement}), they are considered by the editor selection and\n * {@link module:widget/utils~toWidget they can work as widgets}.\n *\n * To create a new raw element, use the\n * {@link module:engine/view/downcastwriter~DowncastWriter#createRawElement `downcastWriter#createRawElement()`} method.\n */\nexport default class RawElement extends Element {\n /**\n * Creates a new instance of a raw element.\n *\n * Throws the `view-rawelement-cannot-add` {@link module:utils/ckeditorerror~CKEditorError CKEditorError} when the `children`\n * parameter is passed to inform that the usage of `RawElement` is incorrect (adding child nodes to `RawElement` is forbidden).\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#createRawElement\n * @internal\n * @param document The document instance to which this element belongs.\n * @param name Node name.\n * @param attrs Collection of attributes.\n * @param children A list of nodes to be inserted into created element.\n */\n constructor(document, name, attrs, children) {\n super(document, name, attrs, children);\n // Returns `null` because filler is not needed for raw elements.\n this.getFillerOffset = getFillerOffset;\n }\n /**\n * Overrides the {@link module:engine/view/element~Element#_insertChild} method.\n * Throws the `view-rawelement-cannot-add` {@link module:utils/ckeditorerror~CKEditorError CKEditorError} to prevent\n * adding any child nodes to a raw element.\n *\n * @internal\n */\n _insertChild(index, items) {\n if (items && (items instanceof Node || Array.from(items).length > 0)) {\n /**\n * Cannot add children to a {@link module:engine/view/rawelement~RawElement} instance.\n *\n * @error view-rawelement-cannot-add\n */\n throw new CKEditorError('view-rawelement-cannot-add', [this, items]);\n }\n return 0;\n }\n /**\n * This allows rendering the children of a {@link module:engine/view/rawelement~RawElement} on the DOM level.\n * This method is called by the {@link module:engine/view/domconverter~DomConverter} with the raw DOM element\n * passed as an argument, leaving the number and shape of the children up to the integrator.\n *\n * This method **must be defined** for the raw element to work:\n *\n * ```ts\n * const myRawElement = downcastWriter.createRawElement( 'div' );\n *\n * myRawElement.render = function( domElement, domConverter ) {\n * \tdomConverter.setContentOf( domElement, '<b>This is the raw content of myRawElement.</b>' );\n * };\n * ```\n *\n * @param domElement The native DOM element representing the raw view element.\n * @param domConverter Instance of the DomConverter used to optimize the output.\n */\n render(domElement, domConverter) { }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nRawElement.prototype.is = function (type, name) {\n if (!name) {\n return type === 'rawElement' || type === 'view:rawElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === this.name || type === 'view:' + this.name ||\n type === 'element' || type === 'view:element' ||\n type === 'node' || type === 'view:node';\n }\n else {\n return name === this.name && (type === 'rawElement' || type === 'view:rawElement' ||\n type === 'element' || type === 'view:element');\n }\n};\n/**\n * Returns `null` because block filler is not needed for raw elements.\n */\nfunction getFillerOffset() {\n return null;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/documentfragment\n */\nimport TypeCheckable from './typecheckable';\nimport Text from './text';\nimport TextProxy from './textproxy';\nimport { EmitterMixin, isIterable } from '@ckeditor/ckeditor5-utils';\n/**\n * Document fragment.\n *\n * To create a new document fragment instance use the\n * {@link module:engine/view/upcastwriter~UpcastWriter#createDocumentFragment `UpcastWriter#createDocumentFragment()`}\n * method.\n */\nexport default class DocumentFragment extends EmitterMixin(TypeCheckable) {\n /**\n * Creates new DocumentFragment instance.\n *\n * @internal\n * @param document The document to which this document fragment belongs.\n * @param children A list of nodes to be inserted into the created document fragment.\n */\n constructor(document, children) {\n super();\n /**\n * Array of child nodes.\n */\n this._children = [];\n /**\n * Map of custom properties.\n * Custom properties can be added to document fragment instance.\n */\n this._customProperties = new Map();\n this.document = document;\n if (children) {\n this._insertChild(0, children);\n }\n }\n /**\n * Iterable interface.\n *\n * Iterates over nodes added to this document fragment.\n */\n [Symbol.iterator]() {\n return this._children[Symbol.iterator]();\n }\n /**\n * Number of child nodes in this document fragment.\n */\n get childCount() {\n return this._children.length;\n }\n /**\n * Is `true` if there are no nodes inside this document fragment, `false` otherwise.\n */\n get isEmpty() {\n return this.childCount === 0;\n }\n /**\n * Artificial root of `DocumentFragment`. Returns itself. Added for compatibility reasons.\n */\n get root() {\n return this;\n }\n /**\n * Artificial parent of `DocumentFragment`. Returns `null`. Added for compatibility reasons.\n */\n get parent() {\n return null;\n }\n /**\n * Artificial element name. Returns `undefined`. Added for compatibility reasons.\n */\n get name() {\n return undefined;\n }\n /**\n * Returns the custom property value for the given key.\n */\n getCustomProperty(key) {\n return this._customProperties.get(key);\n }\n /**\n * Returns an iterator which iterates over this document fragment's custom properties.\n * Iterator provides `[ key, value ]` pairs for each stored property.\n */\n *getCustomProperties() {\n yield* this._customProperties.entries();\n }\n /**\n * {@link module:engine/view/documentfragment~DocumentFragment#_insertChild Insert} a child node or a list of child nodes at the end\n * and sets the parent of these nodes to this fragment.\n *\n * @internal\n * @param items Items to be inserted.\n * @returns Number of appended nodes.\n */\n _appendChild(items) {\n return this._insertChild(this.childCount, items);\n }\n /**\n * Gets child at the given index.\n *\n * @param index Index of child.\n * @returns Child node.\n */\n getChild(index) {\n return this._children[index];\n }\n /**\n * Gets index of the given child node. Returns `-1` if child node is not found.\n *\n * @param node Child node.\n * @returns Index of the child node.\n */\n getChildIndex(node) {\n return this._children.indexOf(node);\n }\n /**\n * Gets child nodes iterator.\n *\n * @returns Child nodes iterator.\n */\n getChildren() {\n return this._children[Symbol.iterator]();\n }\n /**\n * Inserts a child node or a list of child nodes on the given index and sets the parent of these nodes to\n * this fragment.\n *\n * @internal\n * @param index Position where nodes should be inserted.\n * @param items Items to be inserted.\n * @returns Number of inserted nodes.\n */\n _insertChild(index, items) {\n this._fireChange('children', this);\n let count = 0;\n const nodes = normalize(this.document, items);\n for (const node of nodes) {\n // If node that is being added to this element is already inside another element, first remove it from the old parent.\n if (node.parent !== null) {\n node._remove();\n }\n node.parent = this;\n this._children.splice(index, 0, node);\n index++;\n count++;\n }\n return count;\n }\n /**\n * Removes number of child nodes starting at the given index and set the parent of these nodes to `null`.\n *\n * @internal\n * @param index Number of the first node to remove.\n * @param howMany Number of nodes to remove.\n * @returns The array of removed nodes.\n */\n _removeChildren(index, howMany = 1) {\n this._fireChange('children', this);\n for (let i = index; i < index + howMany; i++) {\n this._children[i].parent = null;\n }\n return this._children.splice(index, howMany);\n }\n /**\n * Fires `change` event with given type of the change.\n *\n * @internal\n * @param type Type of the change.\n * @param node Changed node.\n */\n _fireChange(type, node) {\n this.fire('change:' + type, node);\n }\n /**\n * Sets a custom property. They can be used to add special data to elements.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#setCustomProperty\n * @internal\n */\n _setCustomProperty(key, value) {\n this._customProperties.set(key, value);\n }\n /**\n * Removes the custom property stored under the given key.\n *\n * @see module:engine/view/downcastwriter~DowncastWriter#removeCustomProperty\n * @internal\n * @returns Returns true if property was removed.\n */\n _removeCustomProperty(key) {\n return this._customProperties.delete(key);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nDocumentFragment.prototype.is = function (type) {\n return type === 'documentFragment' || type === 'view:documentFragment';\n};\n/**\n * Converts strings to Text and non-iterables to arrays.\n */\nfunction normalize(document, nodes) {\n // Separate condition because string is iterable.\n if (typeof nodes == 'string') {\n return [new Text(document, nodes)];\n }\n if (!isIterable(nodes)) {\n nodes = [nodes];\n }\n // Array.from to enable .map() on non-arrays.\n return Array.from(nodes)\n .map(node => {\n if (typeof node == 'string') {\n return new Text(document, node);\n }\n if (node instanceof TextProxy) {\n return new Text(document, node.data);\n }\n return node;\n });\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/downcastwriter\n */\nimport Position from './position';\nimport Range from './range';\nimport Selection from './selection';\nimport ContainerElement from './containerelement';\nimport AttributeElement from './attributeelement';\nimport EmptyElement from './emptyelement';\nimport UIElement from './uielement';\nimport RawElement from './rawelement';\nimport { CKEditorError, isIterable } from '@ckeditor/ckeditor5-utils';\nimport DocumentFragment from './documentfragment';\nimport Text from './text';\nimport EditableElement from './editableelement';\nimport { isPlainObject } from 'lodash-es';\n/**\n * View downcast writer.\n *\n * It provides a set of methods used to manipulate view nodes.\n *\n * Do not create an instance of this writer manually. To modify a view structure, use\n * the {@link module:engine/view/view~View#change `View#change()`} block.\n *\n * The `DowncastWriter` is designed to work with semantic views which are the views that were/are being downcasted from the model.\n * To work with ordinary views (e.g. parsed from a pasted content) use the\n * {@link module:engine/view/upcastwriter~UpcastWriter upcast writer}.\n *\n * Read more about changing the view in the {@glink framework/architecture/editing-engine#changing-the-view Changing the view}\n * section of the {@glink framework/architecture/editing-engine Editing engine architecture} guide.\n */\nexport default class DowncastWriter {\n /**\n * @param document The view document instance.\n */\n constructor(document) {\n /**\n * Holds references to the attribute groups that share the same {@link module:engine/view/attributeelement~AttributeElement#id id}.\n * The keys are `id`s, the values are `Set`s holding {@link module:engine/view/attributeelement~AttributeElement}s.\n */\n this._cloneGroups = new Map();\n /**\n * The slot factory used by the `elementToStructure` downcast helper.\n */\n this._slotFactory = null;\n this.document = document;\n }\n setSelection(...args) {\n this.document.selection._setTo(...args);\n }\n /**\n * Moves {@link module:engine/view/documentselection~DocumentSelection#focus selection's focus} to the specified location.\n *\n * The location can be specified in the same form as {@link module:engine/view/view~View#createPositionAt view.createPositionAt()}\n * parameters.\n *\n * @param Offset or one of the flags. Used only when the first parameter is a {@link module:engine/view/item~Item view item}.\n */\n setSelectionFocus(itemOrPosition, offset) {\n this.document.selection._setFocus(itemOrPosition, offset);\n }\n /**\n * Creates a new {@link module:engine/view/documentfragment~DocumentFragment} instance.\n *\n * @param children A list of nodes to be inserted into the created document fragment.\n * @returns The created document fragment.\n */\n createDocumentFragment(children) {\n return new DocumentFragment(this.document, children);\n }\n /**\n * Creates a new {@link module:engine/view/text~Text text node}.\n *\n * ```ts\n * writer.createText( 'foo' );\n * ```\n *\n * @param data The text's data.\n * @returns The created text node.\n */\n createText(data) {\n return new Text(this.document, data);\n }\n /**\n * Creates a new {@link module:engine/view/attributeelement~AttributeElement}.\n *\n * ```ts\n * writer.createAttributeElement( 'strong' );\n * writer.createAttributeElement( 'a', { href: 'foo.bar' } );\n *\n * // Make `<a>` element contain other attributes element so the `<a>` element is not broken.\n * writer.createAttributeElement( 'a', { href: 'foo.bar' }, { priority: 5 } );\n *\n * // Set `id` of a marker element so it is not joined or merged with \"normal\" elements.\n * writer.createAttributeElement( 'span', { class: 'my-marker' }, { id: 'marker:my' } );\n * ```\n *\n * @param name Name of the element.\n * @param attributes Element's attributes.\n * @param options Element's options.\n * @param options.priority Element's {@link module:engine/view/attributeelement~AttributeElement#priority priority}.\n * @param options.id Element's {@link module:engine/view/attributeelement~AttributeElement#id id}.\n * @param options.renderUnsafeAttributes A list of attribute names that should be rendered in the editing\n * pipeline even though they would normally be filtered out by unsafe attribute detection mechanisms.\n * @returns Created element.\n */\n createAttributeElement(name, attributes, options = {}) {\n const attributeElement = new AttributeElement(this.document, name, attributes);\n if (typeof options.priority === 'number') {\n attributeElement._priority = options.priority;\n }\n if (options.id) {\n attributeElement._id = options.id;\n }\n if (options.renderUnsafeAttributes) {\n attributeElement._unsafeAttributesToRender.push(...options.renderUnsafeAttributes);\n }\n return attributeElement;\n }\n createContainerElement(name, attributes, childrenOrOptions = {}, options = {}) {\n let children = null;\n if (isPlainObject(childrenOrOptions)) {\n options = childrenOrOptions;\n }\n else {\n children = childrenOrOptions;\n }\n const containerElement = new ContainerElement(this.document, name, attributes, children);\n if (options.renderUnsafeAttributes) {\n containerElement._unsafeAttributesToRender.push(...options.renderUnsafeAttributes);\n }\n return containerElement;\n }\n /**\n * Creates a new {@link module:engine/view/editableelement~EditableElement}.\n *\n * ```ts\n * writer.createEditableElement( 'div' );\n * writer.createEditableElement( 'div', { id: 'foo-1234' } );\n * ```\n *\n * Note: The editable element is to be used in the editing pipeline. Usually, together with\n * {@link module:widget/utils~toWidgetEditable `toWidgetEditable()`}.\n *\n * @param name Name of the element.\n * @param attributes Elements attributes.\n * @param options Element's options.\n * @param options.renderUnsafeAttributes A list of attribute names that should be rendered in the editing\n * pipeline even though they would normally be filtered out by unsafe attribute detection mechanisms.\n * @returns Created element.\n */\n createEditableElement(name, attributes, options = {}) {\n const editableElement = new EditableElement(this.document, name, attributes);\n if (options.renderUnsafeAttributes) {\n editableElement._unsafeAttributesToRender.push(...options.renderUnsafeAttributes);\n }\n return editableElement;\n }\n /**\n * Creates a new {@link module:engine/view/emptyelement~EmptyElement}.\n *\n * ```ts\n * writer.createEmptyElement( 'img' );\n * writer.createEmptyElement( 'img', { id: 'foo-1234' } );\n * ```\n *\n * @param name Name of the element.\n * @param attributes Elements attributes.\n * @param options Element's options.\n * @param options.renderUnsafeAttributes A list of attribute names that should be rendered in the editing\n * pipeline even though they would normally be filtered out by unsafe attribute detection mechanisms.\n * @returns Created element.\n */\n createEmptyElement(name, attributes, options = {}) {\n const emptyElement = new EmptyElement(this.document, name, attributes);\n if (options.renderUnsafeAttributes) {\n emptyElement._unsafeAttributesToRender.push(...options.renderUnsafeAttributes);\n }\n return emptyElement;\n }\n /**\n * Creates a new {@link module:engine/view/uielement~UIElement}.\n *\n * ```ts\n * writer.createUIElement( 'span' );\n * writer.createUIElement( 'span', { id: 'foo-1234' } );\n * ```\n *\n * A custom render function can be provided as the third parameter:\n *\n * ```ts\n * writer.createUIElement( 'span', null, function( domDocument ) {\n * \tconst domElement = this.toDomElement( domDocument );\n * \tdomElement.innerHTML = '<b>this is ui element</b>';\n *\n * \treturn domElement;\n * } );\n * ```\n *\n * Unlike {@link #createRawElement raw elements}, UI elements are by no means editor content, for instance,\n * they are ignored by the editor selection system.\n *\n * You should not use UI elements as data containers. Check out {@link #createRawElement} instead.\n *\n * @param name The name of the element.\n * @param attributes Element attributes.\n * @param renderFunction A custom render function.\n * @returns The created element.\n */\n createUIElement(name, attributes, renderFunction) {\n const uiElement = new UIElement(this.document, name, attributes);\n if (renderFunction) {\n uiElement.render = renderFunction;\n }\n return uiElement;\n }\n /**\n * Creates a new {@link module:engine/view/rawelement~RawElement}.\n *\n * ```ts\n * writer.createRawElement( 'span', { id: 'foo-1234' }, function( domElement ) {\n * \tdomElement.innerHTML = '<b>This is the raw content of the raw element.</b>';\n * } );\n * ```\n *\n * Raw elements work as data containers (\"wrappers\", \"sandboxes\") but their children are not managed or\n * even recognized by the editor. This encapsulation allows integrations to maintain custom DOM structures\n * in the editor content without, for instance, worrying about compatibility with other editor features.\n * Raw elements are a perfect tool for integration with external frameworks and data sources.\n *\n * Unlike {@link #createUIElement UI elements}, raw elements act like \"real\" editor content (similar to\n * {@link module:engine/view/containerelement~ContainerElement} or {@link module:engine/view/emptyelement~EmptyElement}),\n * and they are considered by the editor selection.\n *\n * You should not use raw elements to render the UI in the editor content. Check out {@link #createUIElement `#createUIElement()`}\n * instead.\n *\n * @param name The name of the element.\n * @param attributes Element attributes.\n * @param renderFunction A custom render function.\n * @param options Element's options.\n * @param options.renderUnsafeAttributes A list of attribute names that should be rendered in the editing\n * pipeline even though they would normally be filtered out by unsafe attribute detection mechanisms.\n * @returns The created element.\n */\n createRawElement(name, attributes, renderFunction, options = {}) {\n const rawElement = new RawElement(this.document, name, attributes);\n if (renderFunction) {\n rawElement.render = renderFunction;\n }\n if (options.renderUnsafeAttributes) {\n rawElement._unsafeAttributesToRender.push(...options.renderUnsafeAttributes);\n }\n return rawElement;\n }\n /**\n * Adds or overwrites the element's attribute with a specified key and value.\n *\n * ```ts\n * writer.setAttribute( 'href', 'http://ckeditor.com', linkElement );\n * ```\n *\n * @param key The attribute key.\n * @param value The attribute value.\n */\n setAttribute(key, value, element) {\n element._setAttribute(key, value);\n }\n /**\n * Removes attribute from the element.\n *\n * ```ts\n * writer.removeAttribute( 'href', linkElement );\n * ```\n *\n * @param key Attribute key.\n */\n removeAttribute(key, element) {\n element._removeAttribute(key);\n }\n /**\n * Adds specified class to the element.\n *\n * ```ts\n * writer.addClass( 'foo', linkElement );\n * writer.addClass( [ 'foo', 'bar' ], linkElement );\n * ```\n */\n addClass(className, element) {\n element._addClass(className);\n }\n /**\n * Removes specified class from the element.\n *\n * ```ts\n * writer.removeClass( 'foo', linkElement );\n * writer.removeClass( [ 'foo', 'bar' ], linkElement );\n * ```\n */\n removeClass(className, element) {\n element._removeClass(className);\n }\n setStyle(property, value, element) {\n if (isPlainObject(property) && element === undefined) {\n value._setStyle(property);\n }\n else {\n element._setStyle(property, value);\n }\n }\n /**\n * Removes specified style from the element.\n *\n * ```ts\n * writer.removeStyle( 'color', element ); // Removes 'color' style.\n * writer.removeStyle( [ 'color', 'border-top' ], element ); // Removes both 'color' and 'border-top' styles.\n * ```\n *\n * **Note**: This method can work with normalized style names if\n * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.\n * See {@link module:engine/view/stylesmap~StylesMap#remove `StylesMap#remove()`} for details.\n */\n removeStyle(property, element) {\n element._removeStyle(property);\n }\n /**\n * Sets a custom property on element. Unlike attributes, custom properties are not rendered to the DOM,\n * so they can be used to add special data to elements.\n */\n setCustomProperty(key, value, element) {\n element._setCustomProperty(key, value);\n }\n /**\n * Removes a custom property stored under the given key.\n *\n * @returns Returns true if property was removed.\n */\n removeCustomProperty(key, element) {\n return element._removeCustomProperty(key);\n }\n /**\n * Breaks attribute elements at the provided position or at the boundaries of a provided range. It breaks attribute elements\n * up to their first ancestor that is a container element.\n *\n * In following examples `<p>` is a container, `<b>` and `<u>` are attribute elements:\n *\n * ```html\n * <p>foo<b><u>bar{}</u></b></p> -> <p>foo<b><u>bar</u></b>[]</p>\n * <p>foo<b><u>{}bar</u></b></p> -> <p>foo{}<b><u>bar</u></b></p>\n * <p>foo<b><u>b{}ar</u></b></p> -> <p>foo<b><u>b</u></b>[]<b><u>ar</u></b></p>\n * <p><b>fo{o</b><u>ba}r</u></p> -> <p><b>fo</b><b>o</b><u>ba</u><u>r</u></b></p>\n * ```\n *\n * **Note:** {@link module:engine/view/documentfragment~DocumentFragment DocumentFragment} is treated like a container.\n *\n * **Note:** The difference between {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes breakAttributes()} and\n * {@link module:engine/view/downcastwriter~DowncastWriter#breakContainer breakContainer()} is that `breakAttributes()` breaks all\n * {@link module:engine/view/attributeelement~AttributeElement attribute elements} that are ancestors of a given `position`,\n * up to the first encountered {@link module:engine/view/containerelement~ContainerElement container element}.\n * `breakContainer()` assumes that a given `position` is directly in the container element and breaks that container element.\n *\n * Throws the `view-writer-invalid-range-container` {@link module:utils/ckeditorerror~CKEditorError CKEditorError}\n * when the {@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 the `view-writer-cannot-break-empty-element` {@link module:utils/ckeditorerror~CKEditorError CKEditorError}\n * when trying to break attributes inside an {@link module:engine/view/emptyelement~EmptyElement EmptyElement}.\n *\n * Throws the `view-writer-cannot-break-ui-element` {@link module:utils/ckeditorerror~CKEditorError CKEditorError}\n * when trying to break attributes inside a {@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/downcastwriter~DowncastWriter#breakContainer\n * @param positionOrRange The position where to break attribute elements.\n * @returns The new position or range, after breaking the attribute elements.\n */\n breakAttributes(positionOrRange) {\n if (positionOrRange instanceof Position) {\n return this._breakAttributes(positionOrRange);\n }\n else {\n return this._breakAttributesRange(positionOrRange);\n }\n }\n /**\n * Breaks a {@link module:engine/view/containerelement~ContainerElement container view element} into two, at the given position.\n * The position has to be directly inside the container element and cannot be in the root. It does not break the conrainer view element\n * if the position is at the beginning or at the end of its parent element.\n *\n * ```html\n * <p>foo^bar</p> -> <p>foo</p><p>bar</p>\n * <div><p>foo</p>^<p>bar</p></div> -> <div><p>foo</p></div><div><p>bar</p></div>\n * <p>^foobar</p> -> ^<p>foobar</p>\n * <p>foobar^</p> -> <p>foobar</p>^\n * ```\n *\n * **Note:** The difference between {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes breakAttributes()} and\n * {@link module:engine/view/downcastwriter~DowncastWriter#breakContainer breakContainer()} is that `breakAttributes()` breaks all\n * {@link module:engine/view/attributeelement~AttributeElement attribute elements} that are ancestors of a given `position`,\n * up to the first encountered {@link module:engine/view/containerelement~ContainerElement container element}.\n * `breakContainer()` assumes that the given `position` is directly in the 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/downcastwriter~DowncastWriter#breakAttributes\n * @param position The position where to break the element.\n * @returns The position between broken elements. If an element has not been broken,\n * the returned position is placed either before or after it.\n */\n breakContainer(position) {\n const element = position.parent;\n if (!(element.is('containerElement'))) {\n /**\n * Trying to break an element which is not a container element.\n *\n * @error view-writer-break-non-container-element\n */\n throw new CKEditorError('view-writer-break-non-container-element', this.document);\n }\n if (!element.parent) {\n /**\n * Trying to break root element.\n *\n * @error view-writer-break-root\n */\n throw new CKEditorError('view-writer-break-root', this.document);\n }\n if (position.isAtStart) {\n return Position._createBefore(element);\n }\n else if (!position.isAtEnd) {\n const newElement = element._clone(false);\n this.insert(Position._createAfter(element), newElement);\n const sourceRange = new Range(position, Position._createAt(element, 'end'));\n const targetPosition = new Position(newElement, 0);\n this.move(sourceRange, targetPosition);\n }\n return Position._createAfter(element);\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 `<p>` is a container and `<b>` is an attribute element:\n *\n * ```html\n * <p>foo[]bar</p> -> <p>foo{}bar</p>\n * <p><b>foo</b>[]<b>bar</b></p> -> <p><b>foo{}bar</b></p>\n * <p><b foo=\"bar\">a</b>[]<b foo=\"baz\">b</b></p> -> <p><b foo=\"bar\">a</b>[]<b foo=\"baz\">b</b></p>\n * ```\n *\n * It will also take care about empty attributes when merging:\n *\n * ```html\n * <p><b>[]</b></p> -> <p>[]</p>\n * <p><b>foo</b><i>[]</i><b>bar</b></p> -> <p><b>foo{}bar</b></p>\n * ```\n *\n * **Note:** Difference between {@link module:engine/view/downcastwriter~DowncastWriter#mergeAttributes mergeAttributes} and\n * {@link module:engine/view/downcastwriter~DowncastWriter#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/downcastwriter~DowncastWriter#mergeContainers\n * @param position Merge position.\n * @returns Position after merge.\n */\n mergeAttributes(position) {\n const positionOffset = position.offset;\n const positionParent = position.parent;\n // When inside text node - nothing to merge.\n if (positionParent.is('$text')) {\n return position;\n }\n // When inside empty attribute - remove it.\n if (positionParent.is('attributeElement') && positionParent.childCount === 0) {\n const parent = positionParent.parent;\n const offset = positionParent.index;\n positionParent._remove();\n this._removeFromClonedElementsGroup(positionParent);\n return this.mergeAttributes(new Position(parent, offset));\n }\n const nodeBefore = positionParent.getChild(positionOffset - 1);\n const nodeAfter = positionParent.getChild(positionOffset);\n // Position should be placed between two nodes.\n if (!nodeBefore || !nodeAfter) {\n return position;\n }\n // When position is between two text nodes.\n if (nodeBefore.is('$text') && nodeAfter.is('$text')) {\n return mergeTextNodes(nodeBefore, nodeAfter);\n }\n // When position is between two same attribute elements.\n else if (nodeBefore.is('attributeElement') && nodeAfter.is('attributeElement') && nodeBefore.isSimilar(nodeAfter)) {\n // Move all children nodes from node placed after selection and remove that node.\n const count = nodeBefore.childCount;\n nodeBefore._appendChild(nodeAfter.getChildren());\n nodeAfter._remove();\n this._removeFromClonedElementsGroup(nodeAfter);\n // New position is located inside the first node, before new nodes.\n // Call this method recursively to merge again if needed.\n return this.mergeAttributes(new Position(nodeBefore, count));\n }\n return position;\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 * ```html\n * <p>foo</p>^<p>bar</p> -> <p>foo^bar</p>\n * <div>foo</div>^<p>bar</p> -> <div>foo^bar</div>\n * ```\n *\n * **Note:** Difference between {@link module:engine/view/downcastwriter~DowncastWriter#mergeAttributes mergeAttributes} and\n * {@link module:engine/view/downcastwriter~DowncastWriter#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/downcastwriter~DowncastWriter#mergeAttributes\n * @param position Merge position.\n * @returns Position after merge.\n */\n mergeContainers(position) {\n const prev = position.nodeBefore;\n const next = position.nodeAfter;\n if (!prev || !next || !prev.is('containerElement') || !next.is('containerElement')) {\n /**\n * Element before and after given position cannot be merged.\n *\n * @error view-writer-merge-containers-invalid-position\n */\n throw new CKEditorError('view-writer-merge-containers-invalid-position', this.document);\n }\n const lastChild = prev.getChild(prev.childCount - 1);\n const newPosition = lastChild instanceof Text ? Position._createAt(lastChild, 'end') : Position._createAt(prev, 'end');\n this.move(Range._createIn(next), Position._createAt(prev, 'end'));\n this.remove(Range._createOn(next));\n return newPosition;\n }\n /**\n * Inserts a 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},\n * {@link module:engine/view/rawelement~RawElement RawElements} or\n * {@link module:engine/view/uielement~UIElement UIElements}.\n *\n * @param position Insertion position.\n * @param nodes Node or nodes to insert.\n * @returns Range around inserted nodes.\n */\n insert(position, nodes) {\n nodes = isIterable(nodes) ? [...nodes] : [nodes];\n // Check if nodes to insert are instances of AttributeElements, ContainerElements, EmptyElements, UIElements or Text.\n validateNodesToInsert(nodes, this.document);\n // Group nodes in batches of nodes that require or do not require breaking an AttributeElements.\n const nodeGroups = nodes.reduce((groups, node) => {\n const lastGroup = groups[groups.length - 1];\n // Break attributes on nodes that do exist in the model tree so they can have attributes, other elements\n // can't have an attribute in model and won't get wrapped with an AttributeElement while down-casted.\n const breakAttributes = !node.is('uiElement');\n if (!lastGroup || lastGroup.breakAttributes != breakAttributes) {\n groups.push({\n breakAttributes,\n nodes: [node]\n });\n }\n else {\n lastGroup.nodes.push(node);\n }\n return groups;\n }, []);\n // Insert nodes in batches.\n let start = null;\n let end = position;\n for (const { nodes, breakAttributes } of nodeGroups) {\n const range = this._insertNodes(end, nodes, breakAttributes);\n if (!start) {\n start = range.start;\n }\n end = range.end;\n }\n // When no nodes were inserted - return collapsed range.\n if (!start) {\n return new Range(position);\n }\n return new Range(start, end);\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 * @param rangeOrItem Range to remove from container\n * or an {@link module:engine/view/item~Item item} to remove. If range is provided, after removing, it will be updated\n * to a collapsed range showing the new position.\n * @returns Document fragment containing removed nodes.\n */\n remove(rangeOrItem) {\n const range = rangeOrItem instanceof Range ? rangeOrItem : Range._createOn(rangeOrItem);\n validateRangeContainer(range, this.document);\n // If range is collapsed - nothing to remove.\n if (range.isCollapsed) {\n return new DocumentFragment(this.document);\n }\n // Break attributes at range start and end.\n const { start: breakStart, end: breakEnd } = this._breakAttributesRange(range, true);\n const parentContainer = breakStart.parent;\n const count = breakEnd.offset - breakStart.offset;\n // Remove nodes in range.\n const removed = parentContainer._removeChildren(breakStart.offset, count);\n for (const node of removed) {\n this._removeFromClonedElementsGroup(node);\n }\n // Merge after removing.\n const mergePosition = this.mergeAttributes(breakStart);\n range.start = mergePosition;\n range.end = mergePosition.clone();\n // Return removed nodes.\n return new DocumentFragment(this.document, removed);\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 * @param range Range to clear.\n * @param element Element to remove.\n */\n clear(range, element) {\n validateRangeContainer(range, this.document);\n // Create walker on given range.\n // We walk backward because when we remove element during walk it modifies range end position.\n const walker = range.getWalker({\n direction: 'backward',\n ignoreElementEnd: true\n });\n // Let's walk.\n for (const current of walker) {\n const item = current.item;\n let rangeToRemove;\n // When current item matches to the given element.\n if (item.is('element') && element.isSimilar(item)) {\n // Create range on this element.\n rangeToRemove = Range._createOn(item);\n // When range starts inside Text or TextProxy element.\n }\n else if (!current.nextPosition.isAfter(range.start) && item.is('$textProxy')) {\n // We need to check if parent of this text matches to given element.\n const parentElement = item.getAncestors().find(ancestor => {\n return ancestor.is('element') && element.isSimilar(ancestor);\n });\n // If it is then create range inside this element.\n if (parentElement) {\n rangeToRemove = Range._createIn(parentElement);\n }\n }\n // If we have found element to remove.\n if (rangeToRemove) {\n // We need to check if element range stick out of the given range and truncate if it is.\n if (rangeToRemove.end.isAfter(range.end)) {\n rangeToRemove.end = range.end;\n }\n if (rangeToRemove.start.isBefore(range.start)) {\n rangeToRemove.start = range.start;\n }\n // At the end we remove range with found element.\n this.remove(rangeToRemove);\n }\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 * @param sourceRange Range containing nodes to move.\n * @param targetPosition Position to insert.\n * @returns 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 */\n move(sourceRange, targetPosition) {\n let nodes;\n if (targetPosition.isAfter(sourceRange.end)) {\n targetPosition = this._breakAttributes(targetPosition, true);\n const parent = targetPosition.parent;\n const countBefore = parent.childCount;\n sourceRange = this._breakAttributesRange(sourceRange, true);\n nodes = this.remove(sourceRange);\n targetPosition.offset += (parent.childCount - countBefore);\n }\n else {\n nodes = this.remove(sourceRange);\n }\n return this.insert(targetPosition, nodes);\n }\n /**\n * Wraps elements within range with provided {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.\n * If a collapsed range is provided, it will be wrapped only if it is equal to view selection.\n *\n * If a collapsed range was passed and is same as selection, the selection\n * will be moved to the inside of the wrapped attribute element.\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 *\n * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-invalid-attribute` when passed attribute element is not\n * an instance of {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError} `view-writer-wrap-nonselection-collapsed-range` when passed range\n * is collapsed and different than view selection.\n *\n * @param range Range to wrap.\n * @param attribute Attribute element to use as wrapper.\n * @returns range Range after wrapping, spanning over wrapping attribute element.\n */\n wrap(range, attribute) {\n if (!(attribute instanceof AttributeElement)) {\n throw new CKEditorError('view-writer-wrap-invalid-attribute', this.document);\n }\n validateRangeContainer(range, this.document);\n if (!range.isCollapsed) {\n // Non-collapsed range. Wrap it with the attribute element.\n return this._wrapRange(range, attribute);\n }\n else {\n // Collapsed range. Wrap position.\n let position = range.start;\n if (position.parent.is('element') && !_hasNonUiChildren(position.parent)) {\n position = position.getLastMatchingPosition(value => value.item.is('uiElement'));\n }\n position = this._wrapPosition(position, attribute);\n const viewSelection = this.document.selection;\n // If wrapping position is equal to view selection, move view selection inside wrapping attribute element.\n if (viewSelection.isCollapsed && viewSelection.getFirstPosition().isEqual(range.start)) {\n this.setSelection(position);\n }\n return new Range(position);\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 unwrap(range, attribute) {\n if (!(attribute instanceof AttributeElement)) {\n /**\n * The `attribute` passed to {@link module:engine/view/downcastwriter~DowncastWriter#unwrap `DowncastWriter#unwrap()`}\n * must be an instance of {@link module:engine/view/attributeelement~AttributeElement `AttributeElement`}.\n *\n * @error view-writer-unwrap-invalid-attribute\n */\n throw new CKEditorError('view-writer-unwrap-invalid-attribute', this.document);\n }\n validateRangeContainer(range, this.document);\n // If range is collapsed - nothing to unwrap.\n if (range.isCollapsed) {\n return range;\n }\n // Break attributes at range start and end.\n const { start: breakStart, end: breakEnd } = this._breakAttributesRange(range, true);\n const parentContainer = breakStart.parent;\n // Unwrap children located between break points.\n const newRange = this._unwrapChildren(parentContainer, breakStart.offset, breakEnd.offset, attribute);\n // Merge attributes at the both ends and return a new range.\n const start = this.mergeAttributes(newRange.start);\n // If start position was merged - move end position back.\n if (!start.isEqual(newRange.start)) {\n newRange.end.offset--;\n }\n const end = this.mergeAttributes(newRange.end);\n return new Range(start, end);\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 newName New name for element.\n * @param viewElement Element to be renamed.\n * @returns Element created due to rename.\n */\n rename(newName, viewElement) {\n const newElement = new ContainerElement(this.document, newName, viewElement.getAttributes());\n this.insert(Position._createAfter(viewElement), newElement);\n this.move(Range._createIn(viewElement), Position._createAt(newElement, 0));\n this.remove(Range._createOn(viewElement));\n return newElement;\n }\n /**\n * Cleans up memory by removing obsolete cloned elements group from the writer.\n *\n * Should be used whenever all {@link module:engine/view/attributeelement~AttributeElement attribute elements}\n * with the same {@link module:engine/view/attributeelement~AttributeElement#id id} are going to be removed from the view and\n * the group will no longer be needed.\n *\n * Cloned elements group are not removed automatically in case if the group is still needed after all its elements\n * were removed from the view.\n *\n * Keep in mind that group names are equal to the `id` property of the attribute element.\n *\n * @param groupName Name of the group to clear.\n */\n clearClonedElementsGroup(groupName) {\n this._cloneGroups.delete(groupName);\n }\n /**\n * Creates position at the given location. The location can be specified as:\n *\n * * a {@link module:engine/view/position~Position position},\n * * parent element and offset (offset defaults to `0`),\n * * parent element and `'end'` (sets position at the end of that element),\n * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).\n *\n * This method is a shortcut to other constructors such as:\n *\n * * {@link #createPositionBefore},\n * * {@link #createPositionAfter},\n *\n * @param offset Offset or one of the flags. Used only when the first parameter is a {@link module:engine/view/item~Item view item}.\n */\n createPositionAt(itemOrPosition, offset) {\n return Position._createAt(itemOrPosition, offset);\n }\n /**\n * Creates a new position after given view item.\n *\n * @param item View item after which the position should be located.\n */\n createPositionAfter(item) {\n return Position._createAfter(item);\n }\n /**\n * Creates a new position before given view item.\n *\n * @param item View item before which the position should be located.\n */\n createPositionBefore(item) {\n return Position._createBefore(item);\n }\n /**\n * Creates a range spanning from `start` position to `end` position.\n *\n * **Note:** This factory method creates its own {@link module:engine/view/position~Position} instances basing on passed values.\n *\n * @param start Start position.\n * @param end End position. If not set, range will be collapsed at `start` position.\n */\n createRange(start, end) {\n return new Range(start, end);\n }\n /**\n * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.\n */\n createRangeOn(item) {\n return Range._createOn(item);\n }\n /**\n * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of\n * that element and ends after the last child of that element.\n *\n * @param element Element which is a parent for the range.\n */\n createRangeIn(element) {\n return Range._createIn(element);\n }\n createSelection(...args) {\n return new Selection(...args);\n }\n /**\n * Creates placeholders for child elements of the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToStructure\n * `elementToStructure()`} conversion helper.\n *\n * ```ts\n * const viewSlot = conversionApi.writer.createSlot();\n * const viewPosition = conversionApi.writer.createPositionAt( viewElement, 0 );\n *\n * conversionApi.writer.insert( viewPosition, viewSlot );\n * ```\n *\n * It could be filtered down to a specific subset of children (only `<foo>` model elements in this case):\n *\n * ```ts\n * const viewSlot = conversionApi.writer.createSlot( node => node.is( 'element', 'foo' ) );\n * const viewPosition = conversionApi.writer.createPositionAt( viewElement, 0 );\n *\n * conversionApi.writer.insert( viewPosition, viewSlot );\n * ```\n *\n * While providing a filtered slot, make sure to provide slots for all child nodes. A single node can not be downcasted into\n * multiple slots.\n *\n * **Note**: You should not change the order of nodes. View elements should be in the same order as model nodes.\n *\n * @param modeOrFilter The filter for child nodes.\n * @returns The slot element to be placed in to the view structure while processing\n * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToStructure `elementToStructure()`}.\n */\n createSlot(modeOrFilter = 'children') {\n if (!this._slotFactory) {\n /**\n * The `createSlot()` method is only allowed inside the `elementToStructure` downcast helper callback.\n *\n * @error view-writer-invalid-create-slot-context\n */\n throw new CKEditorError('view-writer-invalid-create-slot-context', this.document);\n }\n return this._slotFactory(this, modeOrFilter);\n }\n /**\n * Registers a slot factory.\n *\n * @internal\n * @param slotFactory The slot factory.\n */\n _registerSlotFactory(slotFactory) {\n this._slotFactory = slotFactory;\n }\n /**\n * Clears the registered slot factory.\n *\n * @internal\n */\n _clearSlotFactory() {\n this._slotFactory = null;\n }\n /**\n * Inserts a node or nodes at the specified position. Takes care of breaking attributes before insertion\n * and merging them afterwards if requested by the breakAttributes param.\n *\n * @param position Insertion position.\n * @param nodes Node or nodes to insert.\n * @param breakAttributes Whether attributes should be broken.\n * @returns Range around inserted nodes.\n */\n _insertNodes(position, nodes, breakAttributes) {\n let parentElement;\n // Break attributes on nodes that do exist in the model tree so they can have attributes, other elements\n // can't have an attribute in model and won't get wrapped with an AttributeElement while down-casted.\n if (breakAttributes) {\n parentElement = getParentContainer(position);\n }\n else {\n parentElement = position.parent.is('$text') ? position.parent.parent : position.parent;\n }\n if (!parentElement) {\n /**\n * Position's parent container cannot be found.\n *\n * @error view-writer-invalid-position-container\n */\n throw new CKEditorError('view-writer-invalid-position-container', this.document);\n }\n let insertionPosition;\n if (breakAttributes) {\n insertionPosition = this._breakAttributes(position, true);\n }\n else {\n insertionPosition = position.parent.is('$text') ? breakTextNode(position) : position;\n }\n const length = parentElement._insertChild(insertionPosition.offset, nodes);\n for (const node of nodes) {\n this._addToClonedElementsGroup(node);\n }\n const endPosition = insertionPosition.getShiftedBy(length);\n const start = this.mergeAttributes(insertionPosition);\n // If start position was merged - move end position.\n if (!start.isEqual(insertionPosition)) {\n endPosition.offset--;\n }\n const end = this.mergeAttributes(endPosition);\n return new Range(start, end);\n }\n /**\n * Wraps children with provided `wrapElement`. Only children contained in `parent` element between\n * `startOffset` and `endOffset` will be wrapped.\n */\n _wrapChildren(parent, startOffset, endOffset, wrapElement) {\n let i = startOffset;\n const wrapPositions = [];\n while (i < endOffset) {\n const child = parent.getChild(i);\n const isText = child.is('$text');\n const isAttribute = child.is('attributeElement');\n //\n // (In all examples, assume that `wrapElement` is `<span class=\"foo\">` element.)\n //\n // Check if `wrapElement` can be joined with the wrapped element. One of requirements is having same name.\n // If possible, join elements.\n //\n // <p><span class=\"bar\">abc</span></p> --> <p><span class=\"foo bar\">abc</span></p>\n //\n if (isAttribute && this._wrapAttributeElement(wrapElement, child)) {\n wrapPositions.push(new Position(parent, i));\n }\n //\n // Wrap the child if it is not an attribute element or if it is an attribute element that should be inside\n // `wrapElement` (due to priority).\n //\n // <p>abc</p> --> <p><span class=\"foo\">abc</span></p>\n // <p><strong>abc</strong></p> --> <p><span class=\"foo\"><strong>abc</strong></span></p>\n else if (isText || !isAttribute || shouldABeOutsideB(wrapElement, child)) {\n // Clone attribute.\n const newAttribute = wrapElement._clone();\n // Wrap current node with new attribute.\n child._remove();\n newAttribute._appendChild(child);\n parent._insertChild(i, newAttribute);\n this._addToClonedElementsGroup(newAttribute);\n wrapPositions.push(new Position(parent, i));\n }\n //\n // If other nested attribute is found and it wasn't wrapped (see above), continue wrapping inside it.\n //\n // <p><a href=\"foo.html\">abc</a></p> --> <p><a href=\"foo.html\"><span class=\"foo\">abc</span></a></p>\n //\n else /* if ( isAttribute ) */ {\n this._wrapChildren(child, 0, child.childCount, wrapElement);\n }\n i++;\n }\n // Merge at each wrap.\n let offsetChange = 0;\n for (const position of wrapPositions) {\n position.offset -= offsetChange;\n // Do not merge with elements outside selected children.\n if (position.offset == startOffset) {\n continue;\n }\n const newPosition = this.mergeAttributes(position);\n // If nodes were merged - other merge offsets will change.\n if (!newPosition.isEqual(position)) {\n offsetChange++;\n endOffset--;\n }\n }\n return Range._createFromParentsAndOffsets(parent, startOffset, parent, endOffset);\n }\n /**\n * Unwraps children from provided `unwrapElement`. Only children contained in `parent` element between\n * `startOffset` and `endOffset` will be unwrapped.\n */\n _unwrapChildren(parent, startOffset, endOffset, unwrapElement) {\n let i = startOffset;\n const unwrapPositions = [];\n // Iterate over each element between provided offsets inside parent.\n // We don't use tree walker or range iterator because we will be removing and merging potentially multiple nodes,\n // so it could get messy. It is safer to it manually in this case.\n while (i < endOffset) {\n const child = parent.getChild(i);\n // Skip all text nodes. There should be no container element's here either.\n if (!child.is('attributeElement')) {\n i++;\n continue;\n }\n //\n // (In all examples, assume that `unwrapElement` is `<span class=\"foo\">` element.)\n //\n // If the child is similar to the given attribute element, unwrap it - it will be completely removed.\n //\n // <p><span class=\"foo\">abc</span>xyz</p> --> <p>abcxyz</p>\n //\n if (child.isSimilar(unwrapElement)) {\n const unwrapped = child.getChildren();\n const count = child.childCount;\n // Replace wrapper element with its children\n child._remove();\n parent._insertChild(i, unwrapped);\n this._removeFromClonedElementsGroup(child);\n // Save start and end position of moved items.\n unwrapPositions.push(new Position(parent, i), new Position(parent, i + count));\n // Skip elements that were unwrapped. Assuming there won't be another element to unwrap in child elements.\n i += count;\n endOffset += count - 1;\n continue;\n }\n //\n // If the child is not similar but is an attribute element, try partial unwrapping - remove the same attributes/styles/classes.\n // Partial unwrapping will happen only if the elements have the same name.\n //\n // <p><span class=\"foo bar\">abc</span>xyz</p> --> <p><span class=\"bar\">abc</span>xyz</p>\n // <p><i class=\"foo\">abc</i>xyz</p> --> <p><i class=\"foo\">abc</i>xyz</p>\n //\n if (this._unwrapAttributeElement(unwrapElement, child)) {\n unwrapPositions.push(new Position(parent, i), new Position(parent, i + 1));\n i++;\n continue;\n }\n //\n // If other nested attribute is found, look through it's children for elements to unwrap.\n //\n // <p><i><span class=\"foo\">abc</span></i><p> --> <p><i>abc</i><p>\n //\n this._unwrapChildren(child, 0, child.childCount, unwrapElement);\n i++;\n }\n // Merge at each unwrap.\n let offsetChange = 0;\n for (const position of unwrapPositions) {\n position.offset -= offsetChange;\n // Do not merge with elements outside selected children.\n if (position.offset == startOffset || position.offset == endOffset) {\n continue;\n }\n const newPosition = this.mergeAttributes(position);\n // If nodes were merged - other merge offsets will change.\n if (!newPosition.isEqual(position)) {\n offsetChange++;\n endOffset--;\n }\n }\n return Range._createFromParentsAndOffsets(parent, startOffset, parent, endOffset);\n }\n /**\n * Helper function for `view.writer.wrap`. Wraps range with provided attribute element.\n * This method will also merge newly added attribute element 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 {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.\n *\n * @returns New range after wrapping, spanning over wrapping attribute element.\n */\n _wrapRange(range, attribute) {\n // Break attributes at range start and end.\n const { start: breakStart, end: breakEnd } = this._breakAttributesRange(range, true);\n const parentContainer = breakStart.parent;\n // Wrap all children with attribute.\n const newRange = this._wrapChildren(parentContainer, breakStart.offset, breakEnd.offset, attribute);\n // Merge attributes at the both ends and return a new range.\n const start = this.mergeAttributes(newRange.start);\n // If start position was merged - move end position back.\n if (!start.isEqual(newRange.start)) {\n newRange.end.offset--;\n }\n const end = this.mergeAttributes(newRange.end);\n return new Range(start, end);\n }\n /**\n * Helper function for {@link #wrap}. Wraps position with provided attribute element.\n * This method will also merge newly added attribute element 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 {@link module:engine/view/attributeelement~AttributeElement AttributeElement}.\n *\n * @returns New position after wrapping.\n */\n _wrapPosition(position, attribute) {\n // Return same position when trying to wrap with attribute similar to position parent.\n if (attribute.isSimilar(position.parent)) {\n return movePositionToTextNode(position.clone());\n }\n // When position is inside text node - break it and place new position between two text nodes.\n if (position.parent.is('$text')) {\n position = breakTextNode(position);\n }\n // Create fake element that will represent position, and will not be merged with other attributes.\n const fakeElement = this.createAttributeElement('_wrapPosition-fake-element');\n fakeElement._priority = Number.POSITIVE_INFINITY;\n fakeElement.isSimilar = () => false;\n // Insert fake element in position location.\n position.parent._insertChild(position.offset, fakeElement);\n // Range around inserted fake attribute element.\n const wrapRange = new Range(position, position.getShiftedBy(1));\n // Wrap fake element with attribute (it will also merge if possible).\n this.wrap(wrapRange, attribute);\n // Remove fake element and place new position there.\n const newPosition = new Position(fakeElement.parent, fakeElement.index);\n fakeElement._remove();\n // If position is placed between text nodes - merge them and return position inside.\n const nodeBefore = newPosition.nodeBefore;\n const nodeAfter = newPosition.nodeAfter;\n if (nodeBefore instanceof Text && nodeAfter instanceof Text) {\n return mergeTextNodes(nodeBefore, nodeAfter);\n }\n // If position is next to text node - move position inside.\n return movePositionToTextNode(newPosition);\n }\n /**\n * Wraps one {@link module:engine/view/attributeelement~AttributeElement AttributeElement} into another by\n * merging them if possible. When merging is possible - all attributes, styles and classes are moved from wrapper\n * element to element being wrapped.\n *\n * @param wrapper Wrapper AttributeElement.\n * @param toWrap AttributeElement to wrap using wrapper element.\n * @returns Returns `true` if elements are merged.\n */\n _wrapAttributeElement(wrapper, toWrap) {\n if (!canBeJoined(wrapper, toWrap)) {\n return false;\n }\n // Can't merge if name or priority differs.\n if (wrapper.name !== toWrap.name || wrapper.priority !== toWrap.priority) {\n return false;\n }\n // Check if attributes can be merged.\n for (const key of wrapper.getAttributeKeys()) {\n // Classes and styles should be checked separately.\n if (key === 'class' || key === 'style') {\n continue;\n }\n // If some attributes are different we cannot wrap.\n if (toWrap.hasAttribute(key) && toWrap.getAttribute(key) !== wrapper.getAttribute(key)) {\n return false;\n }\n }\n // Check if styles can be merged.\n for (const key of wrapper.getStyleNames()) {\n if (toWrap.hasStyle(key) && toWrap.getStyle(key) !== wrapper.getStyle(key)) {\n return false;\n }\n }\n // Move all attributes/classes/styles from wrapper to wrapped AttributeElement.\n for (const key of wrapper.getAttributeKeys()) {\n // Classes and styles should be checked separately.\n if (key === 'class' || key === 'style') {\n continue;\n }\n // Move only these attributes that are not present - other are similar.\n if (!toWrap.hasAttribute(key)) {\n this.setAttribute(key, wrapper.getAttribute(key), toWrap);\n }\n }\n for (const key of wrapper.getStyleNames()) {\n if (!toWrap.hasStyle(key)) {\n this.setStyle(key, wrapper.getStyle(key), toWrap);\n }\n }\n for (const key of wrapper.getClassNames()) {\n if (!toWrap.hasClass(key)) {\n this.addClass(key, toWrap);\n }\n }\n return true;\n }\n /**\n * Unwraps {@link module:engine/view/attributeelement~AttributeElement AttributeElement} from another by removing\n * corresponding attributes, classes and styles. All attributes, classes and styles from wrapper should be present\n * inside element being unwrapped.\n *\n * @param wrapper Wrapper AttributeElement.\n * @param toUnwrap AttributeElement to unwrap using wrapper element.\n * @returns Returns `true` if elements are unwrapped.\n **/\n _unwrapAttributeElement(wrapper, toUnwrap) {\n if (!canBeJoined(wrapper, toUnwrap)) {\n return false;\n }\n // Can't unwrap if name or priority differs.\n if (wrapper.name !== toUnwrap.name || wrapper.priority !== toUnwrap.priority) {\n return false;\n }\n // Check if AttributeElement has all wrapper attributes.\n for (const key of wrapper.getAttributeKeys()) {\n // Classes and styles should be checked separately.\n if (key === 'class' || key === 'style') {\n continue;\n }\n // If some attributes are missing or different we cannot unwrap.\n if (!toUnwrap.hasAttribute(key) || toUnwrap.getAttribute(key) !== wrapper.getAttribute(key)) {\n return false;\n }\n }\n // Check if AttributeElement has all wrapper classes.\n if (!toUnwrap.hasClass(...wrapper.getClassNames())) {\n return false;\n }\n // Check if AttributeElement has all wrapper styles.\n for (const key of wrapper.getStyleNames()) {\n // If some styles are missing or different we cannot unwrap.\n if (!toUnwrap.hasStyle(key) || toUnwrap.getStyle(key) !== wrapper.getStyle(key)) {\n return false;\n }\n }\n // Remove all wrapper's attributes from unwrapped element.\n for (const key of wrapper.getAttributeKeys()) {\n // Classes and styles should be checked separately.\n if (key === 'class' || key === 'style') {\n continue;\n }\n this.removeAttribute(key, toUnwrap);\n }\n // Remove all wrapper's classes from unwrapped element.\n this.removeClass(Array.from(wrapper.getClassNames()), toUnwrap);\n // Remove all wrapper's styles from unwrapped element.\n this.removeStyle(Array.from(wrapper.getStyleNames()), toUnwrap);\n return true;\n }\n /**\n * Helper function used by other `DowncastWriter` methods. Breaks attribute elements at the boundaries of given range.\n *\n * @param range Range which `start` and `end` positions will be used to break attributes.\n * @param forceSplitText If set to `true`, will break text nodes even if they are directly in container element.\n * This behavior will result in incorrect view state, but is needed by other view writing methods which then fixes view state.\n * @returns New range with located at break positions.\n */\n _breakAttributesRange(range, forceSplitText = false) {\n const rangeStart = range.start;\n const rangeEnd = range.end;\n validateRangeContainer(range, this.document);\n // Break at the collapsed position. Return new collapsed range.\n if (range.isCollapsed) {\n const position = this._breakAttributes(range.start, forceSplitText);\n return new Range(position, position);\n }\n const breakEnd = this._breakAttributes(rangeEnd, forceSplitText);\n const count = breakEnd.parent.childCount;\n const breakStart = this._breakAttributes(rangeStart, forceSplitText);\n // Calculate new break end offset.\n breakEnd.offset += breakEnd.parent.childCount - count;\n return new Range(breakStart, breakEnd);\n }\n /**\n * Helper function used by other `DowncastWriter` methods. Breaks attribute elements at given position.\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 position Position where to break attributes.\n * @param forceSplitText If set to `true`, will break text nodes even if they are directly in container element.\n * This behavior will result in incorrect view state, but is needed by other view writing methods which then fixes view state.\n * @returns New position after breaking the attributes.\n */\n _breakAttributes(position, forceSplitText = false) {\n const positionOffset = position.offset;\n const positionParent = position.parent;\n // If position is placed inside EmptyElement - throw an exception as we cannot break inside.\n if (position.parent.is('emptyElement')) {\n /**\n * Cannot break an `EmptyElement` instance.\n *\n * This error is thrown if\n * {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes `DowncastWriter#breakAttributes()`}\n * was executed in an incorrect position.\n *\n * @error view-writer-cannot-break-empty-element\n */\n throw new CKEditorError('view-writer-cannot-break-empty-element', this.document);\n }\n // If position is placed inside UIElement - throw an exception as we cannot break inside.\n if (position.parent.is('uiElement')) {\n /**\n * Cannot break a `UIElement` instance.\n *\n * This error is thrown if\n * {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes `DowncastWriter#breakAttributes()`}\n * was executed in an incorrect position.\n *\n * @error view-writer-cannot-break-ui-element\n */\n throw new CKEditorError('view-writer-cannot-break-ui-element', this.document);\n }\n // If position is placed inside RawElement - throw an exception as we cannot break inside.\n if (position.parent.is('rawElement')) {\n /**\n * Cannot break a `RawElement` instance.\n *\n * This error is thrown if\n * {@link module:engine/view/downcastwriter~DowncastWriter#breakAttributes `DowncastWriter#breakAttributes()`}\n * was executed in an incorrect position.\n *\n * @error view-writer-cannot-break-raw-element\n */\n throw new CKEditorError('view-writer-cannot-break-raw-element', this.document);\n }\n // There are no attributes to break and text nodes breaking is not forced.\n if (!forceSplitText && positionParent.is('$text') && isContainerOrFragment(positionParent.parent)) {\n return position.clone();\n }\n // Position's parent is container, so no attributes to break.\n if (isContainerOrFragment(positionParent)) {\n return position.clone();\n }\n // Break text and start again in new position.\n if (positionParent.is('$text')) {\n return this._breakAttributes(breakTextNode(position), forceSplitText);\n }\n const length = positionParent.childCount;\n // <p>foo<b><u>bar{}</u></b></p>\n // <p>foo<b><u>bar</u>[]</b></p>\n // <p>foo<b><u>bar</u></b>[]</p>\n if (positionOffset == length) {\n const newPosition = new Position(positionParent.parent, positionParent.index + 1);\n return this._breakAttributes(newPosition, forceSplitText);\n }\n else {\n // <p>foo<b><u>{}bar</u></b></p>\n // <p>foo<b>[]<u>bar</u></b></p>\n // <p>foo{}<b><u>bar</u></b></p>\n if (positionOffset === 0) {\n const newPosition = new Position(positionParent.parent, positionParent.index);\n return this._breakAttributes(newPosition, forceSplitText);\n }\n // <p>foo<b><u>b{}ar</u></b></p>\n // <p>foo<b><u>b[]ar</u></b></p>\n // <p>foo<b><u>b</u>[]<u>ar</u></b></p>\n // <p>foo<b><u>b</u></b>[]<b><u>ar</u></b></p>\n else {\n const offsetAfter = positionParent.index + 1;\n // Break element.\n const clonedNode = positionParent._clone();\n // Insert cloned node to position's parent node.\n positionParent.parent._insertChild(offsetAfter, clonedNode);\n this._addToClonedElementsGroup(clonedNode);\n // Get nodes to move.\n const count = positionParent.childCount - positionOffset;\n const nodesToMove = positionParent._removeChildren(positionOffset, count);\n // Move nodes to cloned node.\n clonedNode._appendChild(nodesToMove);\n // Create new position to work on.\n const newPosition = new Position(positionParent.parent, offsetAfter);\n return this._breakAttributes(newPosition, forceSplitText);\n }\n }\n }\n /**\n * Stores the information that an {@link module:engine/view/attributeelement~AttributeElement attribute element} was\n * added to the tree. Saves the reference to the group in the given element and updates the group, so other elements\n * from the group now keep a reference to the given attribute element.\n *\n * The clones group can be obtained using {@link module:engine/view/attributeelement~AttributeElement#getElementsWithSameId}.\n *\n * Does nothing if added element has no {@link module:engine/view/attributeelement~AttributeElement#id id}.\n *\n * @param element Attribute element to save.\n */\n _addToClonedElementsGroup(element) {\n // Add only if the element is in document tree.\n if (!element.root.is('rootElement')) {\n return;\n }\n // Traverse the element's children recursively to find other attribute elements that also might got inserted.\n // The loop is at the beginning so we can make fast returns later in the code.\n if (element.is('element')) {\n for (const child of element.getChildren()) {\n this._addToClonedElementsGroup(child);\n }\n }\n const id = element.id;\n if (!id) {\n return;\n }\n let group = this._cloneGroups.get(id);\n if (!group) {\n group = new Set();\n this._cloneGroups.set(id, group);\n }\n group.add(element);\n element._clonesGroup = group;\n }\n /**\n * Removes all the information about the given {@link module:engine/view/attributeelement~AttributeElement attribute element}\n * from its clones group.\n *\n * Keep in mind, that the element will still keep a reference to the group (but the group will not keep a reference to it).\n * This allows to reference the whole group even if the element was already removed from the tree.\n *\n * Does nothing if the element has no {@link module:engine/view/attributeelement~AttributeElement#id id}.\n *\n * @param element Attribute element to remove.\n */\n _removeFromClonedElementsGroup(element) {\n // Traverse the element's children recursively to find other attribute elements that also got removed.\n // The loop is at the beginning so we can make fast returns later in the code.\n if (element.is('element')) {\n for (const child of element.getChildren()) {\n this._removeFromClonedElementsGroup(child);\n }\n }\n const id = element.id;\n if (!id) {\n return;\n }\n const group = this._cloneGroups.get(id);\n if (!group) {\n return;\n }\n group.delete(element);\n // Not removing group from element on purpose!\n // If other parts of code have reference to this element, they will be able to get references to other elements from the group.\n }\n}\n// Helper function for `view.writer.wrap`. Checks if given element has any children that are not ui elements.\nfunction _hasNonUiChildren(parent) {\n return Array.from(parent.getChildren()).some(child => !child.is('uiElement'));\n}\n/**\n * The `attribute` passed to {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#wrap()`}\n * must be an instance of {@link module:engine/view/attributeelement~AttributeElement `AttributeElement`}.\n *\n * @error view-writer-wrap-invalid-attribute\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 position Position used as a start point to locate parent container.\n * @returns Parent container element or `undefined` if container is not found.\n */\nfunction getParentContainer(position) {\n let parent = position.parent;\n while (!isContainerOrFragment(parent)) {\n if (!parent) {\n return undefined;\n }\n parent = parent.parent;\n }\n return parent;\n}\n/**\n * Checks if first {@link module:engine/view/attributeelement~AttributeElement AttributeElement} provided to the function\n * can be wrapped outside second element. It is done by comparing elements'\n * {@link module:engine/view/attributeelement~AttributeElement#priority priorities}, if both have same priority\n * {@link module:engine/view/element~Element#getIdentity identities} are compared.\n */\nfunction shouldABeOutsideB(a, b) {\n if (a.priority < b.priority) {\n return true;\n }\n else if (a.priority > b.priority) {\n return false;\n }\n // When priorities are equal and names are different - use identities.\n return a.getIdentity() < b.getIdentity();\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 * ```html\n * <p>foo[]</p> -> <p>foo{}</p>\n * <p>[]foo</p> -> <p>{}foo</p>\n * ```\n *\n * @returns Position located inside text node or same position if there is no text nodes\n * before or after position location.\n */\nfunction movePositionToTextNode(position) {\n const nodeBefore = position.nodeBefore;\n if (nodeBefore && nodeBefore.is('$text')) {\n return new Position(nodeBefore, nodeBefore.data.length);\n }\n const nodeAfter = position.nodeAfter;\n if (nodeAfter && nodeAfter.is('$text')) {\n return new Position(nodeAfter, 0);\n }\n return position;\n}\n/**\n * Breaks text node into two text nodes when possible.\n *\n * ```html\n * <p>foo{}bar</p> -> <p>foo[]bar</p>\n * <p>{}foobar</p> -> <p>[]foobar</p>\n * <p>foobar{}</p> -> <p>foobar[]</p>\n * ```\n *\n * @param position Position that need to be placed inside text node.\n * @returns New position after breaking text node.\n */\nfunction breakTextNode(position) {\n if (position.offset == position.parent.data.length) {\n return new Position(position.parent.parent, position.parent.index + 1);\n }\n if (position.offset === 0) {\n return new Position(position.parent.parent, position.parent.index);\n }\n // Get part of the text that need to be moved.\n const textToMove = position.parent.data.slice(position.offset);\n // Leave rest of the text in position's parent.\n position.parent._data = position.parent.data.slice(0, position.offset);\n // Insert new text node after position's parent text node.\n position.parent.parent._insertChild(position.parent.index + 1, new Text(position.root.document, textToMove));\n // Return new position between two newly created text nodes.\n return 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 t1 First text node to merge. Data from second text node will be moved at the end of this text node.\n * @param t2 Second text node to merge. This node will be removed after merging.\n * @returns Position after merging text nodes.\n */\nfunction mergeTextNodes(t1, t2) {\n // Merge text data into first text node and remove second one.\n const nodeBeforeLength = t1.data.length;\n t1._data += t2.data;\n t2._remove();\n return new Position(t1, nodeBeforeLength);\n}\nconst validNodesToInsert = [Text, AttributeElement, ContainerElement, EmptyElement, RawElement, UIElement];\n/**\n * Checks if provided nodes are valid to insert.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `view-writer-insert-invalid-node` when nodes to insert\n * contains instances that are not supported ones (see error description for valid ones.\n */\nfunction validateNodesToInsert(nodes, errorContext) {\n for (const node of nodes) {\n if (!validNodesToInsert.some((validNode => node instanceof validNode))) { // eslint-disable-line no-use-before-define\n /**\n * One of the nodes to be inserted is of an invalid type.\n *\n * Nodes to be inserted with {@link module:engine/view/downcastwriter~DowncastWriter#insert `DowncastWriter#insert()`} should be\n * of the following types:\n *\n * * {@link module:engine/view/attributeelement~AttributeElement AttributeElement},\n * * {@link module:engine/view/containerelement~ContainerElement ContainerElement},\n * * {@link module:engine/view/emptyelement~EmptyElement EmptyElement},\n * * {@link module:engine/view/uielement~UIElement UIElement},\n * * {@link module:engine/view/rawelement~RawElement RawElement},\n * * {@link module:engine/view/text~Text Text}.\n *\n * @error view-writer-insert-invalid-node-type\n */\n throw new CKEditorError('view-writer-insert-invalid-node-type', errorContext);\n }\n if (!node.is('$text')) {\n validateNodesToInsert(node.getChildren(), errorContext);\n }\n }\n}\n/**\n * Checks if node is ContainerElement or DocumentFragment, because in most cases they should be treated the same way.\n *\n * @returns Returns `true` if node is instance of ContainerElement or DocumentFragment.\n */\nfunction isContainerOrFragment(node) {\n return 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 */\nfunction validateRangeContainer(range, errorContext) {\n const startContainer = getParentContainer(range.start);\n const endContainer = getParentContainer(range.end);\n if (!startContainer || !endContainer || startContainer !== endContainer) {\n /**\n * The container of the given range is invalid.\n *\n * This may happen if {@link module:engine/view/range~Range#start range start} and\n * {@link module:engine/view/range~Range#end range end} positions are not placed inside the same container element or\n * a parent container for these positions cannot be found.\n *\n * Methods like {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#remove()`},\n * {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#clean()`},\n * {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#wrap()`},\n * {@link module:engine/view/downcastwriter~DowncastWriter#wrap `DowncastWriter#unwrap()`} need to be called\n * on a range that has its start and end positions located in the same container element. Both positions can be\n * nested within other elements (e.g. an attribute element) but the closest container ancestor must be the same.\n *\n * @error view-writer-invalid-range-container\n */\n throw new CKEditorError('view-writer-invalid-range-container', errorContext);\n }\n}\n/**\n * Checks if two attribute elements can be joined together. Elements can be joined together if, and only if\n * they do not have ids specified.\n */\nfunction canBeJoined(a, b) {\n return a.id === null && b.id === null;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { keyCodes, isText } from '@ckeditor/ckeditor5-utils';\n/**\n * Set of utilities related to handling block and inline fillers.\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 `<p>`. CKEditor uses `<br>` as a block filler during the editing,\n * as browsers do natively. So instead of an empty `<p>` there will be `<p><br></p>`. The advantage of block filler is that\n * it is transparent for the selection, so when the caret is before the `<br>` and user presses right arrow he will be\n * moved to the next paragraph, not after the `<br>`. 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 `<br>` 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} or\n * {@link module:engine/view/filler~MARKED_NBSP_FILLER marked 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 * `<b>` surrendered by text: `foo<b></b>bar`, 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 * Non-breaking space filler creator. This function creates the `&nbsp;` text node.\n * It defines how the filler is created.\n *\n * @see module:engine/view/filler~MARKED_NBSP_FILLER\n * @see module:engine/view/filler~BR_FILLER\n */\nexport const NBSP_FILLER = (domDocument) => domDocument.createTextNode('\\u00A0');\n/**\n * Marked non-breaking space filler creator. This function creates the `<span data-cke-filler=\"true\">&nbsp;</span>` element.\n * It defines how the filler is created.\n *\n * @see module:engine/view/filler~NBSP_FILLER\n * @see module:engine/view/filler~BR_FILLER\n */\nexport const MARKED_NBSP_FILLER = (domDocument) => {\n const span = domDocument.createElement('span');\n span.dataset.ckeFiller = 'true';\n span.innerText = '\\u00A0';\n return span;\n};\n/**\n * `<br>` filler creator. This function creates the `<br data-cke-filler=\"true\">` element.\n * It defines how the filler is created.\n *\n * @see module:engine/view/filler~NBSP_FILLER\n * @see module:engine/view/filler~MARKED_NBSP_FILLER\n */\nexport const BR_FILLER = (domDocument) => {\n const fillerBr = domDocument.createElement('br');\n fillerBr.dataset.ckeFiller = 'true';\n return fillerBr;\n};\n/**\n * Length of the {@link module:engine/view/filler~INLINE_FILLER INLINE_FILLER}.\n */\nexport const INLINE_FILLER_LENGTH = 7;\n/**\n * Inline filler which is a sequence of the word joiners.\n */\nexport const INLINE_FILLER = '\\u2060'.repeat(INLINE_FILLER_LENGTH);\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 * ```ts\n * startsWithFiller( document.createTextNode( INLINE_FILLER ) ); // true\n * startsWithFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ); // true\n * startsWithFiller( document.createTextNode( 'foo' ) ); // false\n * startsWithFiller( document.createElement( 'p' ) ); // false\n * ```\n *\n * @param domNode DOM node.\n * @returns True if the text node starts with the {@link module:engine/view/filler~INLINE_FILLER inline filler}.\n */\nexport function startsWithFiller(domNode) {\n return isText(domNode) && (domNode.data.substr(0, INLINE_FILLER_LENGTH) === INLINE_FILLER);\n}\n/**\n * Checks if the text node contains only the {@link module:engine/view/filler~INLINE_FILLER inline filler}.\n *\n * ```ts\n * isInlineFiller( document.createTextNode( INLINE_FILLER ) ); // true\n * isInlineFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ); // false\n * ```\n *\n * @param domText DOM text node.\n * @returns True if the text node contains only the {@link module:engine/view/filler~INLINE_FILLER inline filler}.\n */\nexport function isInlineFiller(domText) {\n return domText.data.length == INLINE_FILLER_LENGTH && startsWithFiller(domText);\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 * ```ts\n * getDataWithoutFiller( document.createTextNode( INLINE_FILLER + 'foo' ) ) == 'foo' // true\n * getDataWithoutFiller( document.createTextNode( 'foo' ) ) == 'foo' // true\n * ```\n *\n * @param domText DOM text node, possible with inline filler.\n * @returns Data without filler.\n */\nexport function getDataWithoutFiller(domText) {\n if (startsWithFiller(domText)) {\n return domText.data.slice(INLINE_FILLER_LENGTH);\n }\n else {\n return domText.data;\n }\n}\n/**\n * Assign key observer which move cursor from the end of the inline filler to the beginning of it when\n * the left arrow is pressed, so the filler does not break navigation.\n *\n * @param view View controller instance we should inject quirks handling on.\n */\nexport function injectQuirksHandling(view) {\n view.document.on('arrowKey', jumpOverInlineFiller, { priority: 'low' });\n}\n/**\n * Move cursor from the end of the inline filler to the beginning of it when, so the filler does not break navigation.\n */\nfunction jumpOverInlineFiller(evt, data) {\n if (data.keyCode == keyCodes.arrowleft) {\n const domSelection = data.domTarget.ownerDocument.defaultView.getSelection();\n if (domSelection.rangeCount == 1 && domSelection.getRangeAt(0).collapsed) {\n const domParent = domSelection.getRangeAt(0).startContainer;\n const domOffset = domSelection.getRangeAt(0).startOffset;\n if (startsWithFiller(domParent) && domOffset <= INLINE_FILLER_LENGTH) {\n domSelection.collapse(domParent, 0);\n }\n }\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./renderer.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/renderer\n */\nimport ViewText from './text';\nimport ViewPosition from './position';\nimport { INLINE_FILLER, INLINE_FILLER_LENGTH, startsWithFiller, isInlineFiller } from './filler';\nimport { CKEditorError, ObservableMixin, diff, env, fastDiff, insertAt, isComment, isNode, isText, remove } from '@ckeditor/ckeditor5-utils';\nimport '../../theme/renderer.css';\n/**\n * Renderer is responsible for updating the DOM structure and the DOM selection based on\n * the {@link module:engine/view/renderer~Renderer#markToSync information about updated view nodes}.\n * In other words, it renders the view to the DOM.\n *\n * Its main responsibility is to make only the necessary, minimal changes to the DOM. However, unlike in many\n * virtual DOM implementations, the primary reason for doing minimal changes is not the performance but ensuring\n * that native editing features such as text composition, autocompletion, spell checking, selection's x-index are\n * affected as little as possible.\n *\n * Renderer uses {@link module:engine/view/domconverter~DomConverter} to transform view nodes and positions\n * to and from the DOM.\n */\nexport default class Renderer extends ObservableMixin() {\n /**\n * Creates a renderer instance.\n *\n * @param domConverter Converter instance.\n * @param selection View selection.\n */\n constructor(domConverter, selection) {\n super();\n /**\n * Set of DOM Documents instances.\n */\n this.domDocuments = new Set();\n /**\n * Set of nodes which attributes changed and may need to be rendered.\n */\n this.markedAttributes = new Set();\n /**\n * Set of elements which child lists changed and may need to be rendered.\n */\n this.markedChildren = new Set();\n /**\n * Set of text nodes which text data changed and may need to be rendered.\n */\n this.markedTexts = new Set();\n /**\n * The text node in which the inline filler was rendered.\n */\n this._inlineFiller = null;\n /**\n * DOM element containing fake selection.\n */\n this._fakeSelectionContainer = null;\n this.domConverter = domConverter;\n this.selection = selection;\n this.set('isFocused', false);\n this.set('isSelecting', false);\n // Rendering the selection and inline filler manipulation should be postponed in (non-Android) Blink until the user finishes\n // creating the selection in DOM to avoid accidental selection collapsing\n // (https://github.com/ckeditor/ckeditor5/issues/10562, https://github.com/ckeditor/ckeditor5/issues/10723).\n // When the user stops selecting, all pending changes should be rendered ASAP, though.\n if (env.isBlink && !env.isAndroid) {\n this.on('change:isSelecting', () => {\n if (!this.isSelecting) {\n this.render();\n }\n });\n }\n this.set('isComposing', false);\n this.on('change:isComposing', () => {\n if (!this.isComposing) {\n this.render();\n }\n });\n }\n /**\n * Marks a view node to be updated in the DOM by {@link #render `render()`}.\n *\n * Note that only view nodes whose parents have corresponding DOM elements need to be marked to be synchronized.\n *\n * @see #markedAttributes\n * @see #markedChildren\n * @see #markedTexts\n *\n * @param type Type of the change.\n * @param node ViewNode to be marked.\n */\n markToSync(type, node) {\n if (type === 'text') {\n if (this.domConverter.mapViewToDom(node.parent)) {\n this.markedTexts.add(node);\n }\n }\n else {\n // If the node has no DOM element it is not rendered yet,\n // its children/attributes do not need to be marked to be sync.\n if (!this.domConverter.mapViewToDom(node)) {\n return;\n }\n if (type === 'attributes') {\n this.markedAttributes.add(node);\n }\n else if (type === 'children') {\n this.markedChildren.add(node);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const unreachable = type;\n /**\n * Unknown type passed to Renderer.markToSync.\n *\n * @error view-renderer-unknown-type\n */\n throw new CKEditorError('view-renderer-unknown-type', this);\n }\n }\n }\n /**\n * Renders all buffered changes ({@link #markedAttributes}, {@link #markedChildren} and {@link #markedTexts}) and\n * the current view selection (if needed) to the DOM by applying a minimal set of changes to it.\n *\n * Renderer tries not to break the text composition (e.g. IME) and x-index of the selection,\n * so it does as little as it is needed to update the DOM.\n *\n * Renderer also handles {@link module:engine/view/filler fillers}. Especially, it checks if the inline filler is needed\n * at the selection position and adds or removes it. To prevent breaking text composition inline filler will not be\n * removed as long as the selection is in the text node which needed it at first.\n */\n render() {\n // Ignore rendering while in the composition mode. Composition events are not cancellable and browser will modify the DOM tree.\n // All marked elements, attributes, etc. will wait until next render after the composition ends.\n // On Android composition events are immediately applied to the model, so we don't need to skip rendering,\n // and we should not do it because the difference between view and DOM could lead to position mapping problems.\n if (this.isComposing && !env.isAndroid) {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[Renderer]%c Rendering aborted while isComposing',\n // @if CK_DEBUG_TYPING // \t\t'color: green;font-weight: bold', ''\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n return;\n }\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.group( '%c[Renderer]%c Rendering',\n // @if CK_DEBUG_TYPING // \t\t'color: green;font-weight: bold', ''\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n let inlineFillerPosition = null;\n const isInlineFillerRenderingPossible = env.isBlink && !env.isAndroid ? !this.isSelecting : true;\n // Refresh mappings.\n for (const element of this.markedChildren) {\n this._updateChildrenMappings(element);\n }\n // Don't manipulate inline fillers while the selection is being made in (non-Android) Blink to prevent accidental\n // DOM selection collapsing\n // (https://github.com/ckeditor/ckeditor5/issues/10562, https://github.com/ckeditor/ckeditor5/issues/10723).\n if (isInlineFillerRenderingPossible) {\n // There was inline filler rendered in the DOM but it's not\n // at the selection position any more, so we can remove it\n // (cause even if it's needed, it must be placed in another location).\n if (this._inlineFiller && !this._isSelectionInInlineFiller()) {\n this._removeInlineFiller();\n }\n // If we've got the filler, let's try to guess its position in the view.\n if (this._inlineFiller) {\n inlineFillerPosition = this._getInlineFillerPosition();\n }\n // Otherwise, if it's needed, create it at the selection position.\n else if (this._needsInlineFillerAtSelection()) {\n inlineFillerPosition = this.selection.getFirstPosition();\n // Do not use `markToSync` so it will be added even if the parent is already added.\n this.markedChildren.add(inlineFillerPosition.parent);\n }\n }\n // Make sure the inline filler has any parent, so it can be mapped to view position by DomConverter.\n else if (this._inlineFiller && this._inlineFiller.parentNode) {\n // While the user is making selection, preserve the inline filler at its original position.\n inlineFillerPosition = this.domConverter.domPositionToView(this._inlineFiller);\n // While down-casting the document selection attributes, all existing empty\n // attribute elements (for selection position) are removed from the view and DOM,\n // so make sure that we were able to map filler position.\n // https://github.com/ckeditor/ckeditor5/issues/12026\n if (inlineFillerPosition && inlineFillerPosition.parent.is('$text')) {\n // The inline filler position is expected to be before the text node.\n inlineFillerPosition = ViewPosition._createBefore(inlineFillerPosition.parent);\n }\n }\n for (const element of this.markedAttributes) {\n this._updateAttrs(element);\n }\n for (const element of this.markedChildren) {\n this._updateChildren(element, { inlineFillerPosition });\n }\n for (const node of this.markedTexts) {\n if (!this.markedChildren.has(node.parent) && this.domConverter.mapViewToDom(node.parent)) {\n this._updateText(node, { inlineFillerPosition });\n }\n }\n // * Check whether the inline filler is required and where it really is in the DOM.\n // At this point in most cases it will be in the DOM, but there are exceptions.\n // For example, if the inline filler was deep in the created DOM structure, it will not be created.\n // Similarly, if it was removed at the beginning of this function and then neither text nor children were updated,\n // it will not be present. Fix those and similar scenarios.\n // * Don't manipulate inline fillers while the selection is being made in (non-Android) Blink to prevent accidental\n // DOM selection collapsing\n // (https://github.com/ckeditor/ckeditor5/issues/10562, https://github.com/ckeditor/ckeditor5/issues/10723).\n if (isInlineFillerRenderingPossible) {\n if (inlineFillerPosition) {\n const fillerDomPosition = this.domConverter.viewPositionToDom(inlineFillerPosition);\n const domDocument = fillerDomPosition.parent.ownerDocument;\n if (!startsWithFiller(fillerDomPosition.parent)) {\n // Filler has not been created at filler position. Create it now.\n this._inlineFiller = addInlineFiller(domDocument, fillerDomPosition.parent, fillerDomPosition.offset);\n }\n else {\n // Filler has been found, save it.\n this._inlineFiller = fillerDomPosition.parent;\n }\n }\n else {\n // There is no filler needed.\n this._inlineFiller = null;\n }\n }\n // First focus the new editing host, then update the selection.\n // Otherwise, FF may throw an error (https://github.com/ckeditor/ckeditor5/issues/721).\n this._updateFocus();\n this._updateSelection();\n this.markedTexts.clear();\n this.markedAttributes.clear();\n this.markedChildren.clear();\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n }\n /**\n * Updates mappings of view element's children.\n *\n * Children that were replaced in the view structure by similar elements (same tag name) are treated as 'replaced'.\n * This means that their mappings can be updated so the new view elements are mapped to the existing DOM elements.\n * Thanks to that these elements do not need to be re-rendered completely.\n *\n * @param viewElement The view element whose children mappings will be updated.\n */\n _updateChildrenMappings(viewElement) {\n const domElement = this.domConverter.mapViewToDom(viewElement);\n if (!domElement) {\n // If there is no `domElement` it means that it was already removed from DOM and there is no need to process it.\n return;\n }\n // Removing nodes from the DOM as we iterate can cause `actualDomChildren`\n // (which is a live-updating `NodeList`) to get out of sync with the\n // indices that we compute as we iterate over `actions`.\n // This would produce incorrect element mappings.\n //\n // Converting live list to an array to make the list static.\n const actualDomChildren = Array.from(this.domConverter.mapViewToDom(viewElement).childNodes);\n const expectedDomChildren = Array.from(this.domConverter.viewChildrenToDom(viewElement, { withChildren: false }));\n const diff = this._diffNodeLists(actualDomChildren, expectedDomChildren);\n const actions = this._findUpdateActions(diff, actualDomChildren, expectedDomChildren, areSimilarElements);\n if (actions.indexOf('update') !== -1) {\n const counter = { equal: 0, insert: 0, delete: 0 };\n for (const action of actions) {\n if (action === 'update') {\n const insertIndex = counter.equal + counter.insert;\n const deleteIndex = counter.equal + counter.delete;\n const viewChild = viewElement.getChild(insertIndex);\n // UIElement and RawElement are special cases. Their children are not stored in a view (#799)\n // so we cannot use them with replacing flow (since they use view children during rendering\n // which will always result in rendering empty elements).\n if (viewChild && !(viewChild.is('uiElement') || viewChild.is('rawElement'))) {\n this._updateElementMappings(viewChild, actualDomChildren[deleteIndex]);\n }\n remove(expectedDomChildren[insertIndex]);\n counter.equal++;\n }\n else {\n counter[action]++;\n }\n }\n }\n }\n /**\n * Updates mappings of a given view element.\n *\n * @param viewElement The view element whose mappings will be updated.\n * @param domElement The DOM element representing the given view element.\n */\n _updateElementMappings(viewElement, domElement) {\n // Remap 'DomConverter' bindings.\n this.domConverter.unbindDomElement(domElement);\n this.domConverter.bindElements(domElement, viewElement);\n // View element may have children which needs to be updated, but are not marked, mark them to update.\n this.markedChildren.add(viewElement);\n // Because we replace new view element mapping with the existing one, the corresponding DOM element\n // will not be rerendered. The new view element may have different attributes than the previous one.\n // Since its corresponding DOM element will not be rerendered, new attributes will not be added\n // to the DOM, so we need to mark it here to make sure its attributes gets updated. See #1427 for more\n // detailed case study.\n // Also there are cases where replaced element is removed from the view structure and then has\n // its attributes changed or removed. In such cases the element will not be present in `markedAttributes`\n // and also may be the same (`element.isSimilar()`) as the reused element not having its attributes updated.\n // To prevent such situations we always mark reused element to have its attributes rerenderd (#1560).\n this.markedAttributes.add(viewElement);\n }\n /**\n * Gets the position of the inline filler based on the current selection.\n * Here, we assume that we know that the filler is needed and\n * {@link #_isSelectionInInlineFiller is at the selection position}, and, since it is needed,\n * it is somewhere at the selection position.\n *\n * Note: The filler position cannot be restored based on the filler's DOM text node, because\n * when this method is called (before rendering), the bindings will often be broken. View-to-DOM\n * bindings are only dependable after rendering.\n */\n _getInlineFillerPosition() {\n const firstPos = this.selection.getFirstPosition();\n if (firstPos.parent.is('$text')) {\n return ViewPosition._createBefore(firstPos.parent);\n }\n else {\n return firstPos;\n }\n }\n /**\n * Returns `true` if the selection has not left the inline filler's text node.\n * If it is `true`, it means that the filler had been added for a reason and the selection did not\n * leave the filler's text node. For example, the user can be in the middle of a composition so it should not be touched.\n *\n * @returns `true` if the inline filler and selection are in the same place.\n */\n _isSelectionInInlineFiller() {\n if (this.selection.rangeCount != 1 || !this.selection.isCollapsed) {\n return false;\n }\n // Note, we can't check if selection's position equals position of the\n // this._inlineFiller node, because of #663. We may not be able to calculate\n // the filler's position in the view at this stage.\n // Instead, we check it the other way whether selection is anchored in\n // that text node or next to it.\n // Possible options are:\n // \"FILLER{}\"\n // \"FILLERadded-text{}\"\n const selectionPosition = this.selection.getFirstPosition();\n const position = this.domConverter.viewPositionToDom(selectionPosition);\n if (position && isText(position.parent) && startsWithFiller(position.parent)) {\n return true;\n }\n return false;\n }\n /**\n * Removes the inline filler.\n */\n _removeInlineFiller() {\n const domFillerNode = this._inlineFiller;\n // Something weird happened and the stored node doesn't contain the filler's text.\n if (!startsWithFiller(domFillerNode)) {\n /**\n * The inline filler node was lost. Most likely, something overwrote the filler text node\n * in the DOM.\n *\n * @error view-renderer-filler-was-lost\n */\n throw new CKEditorError('view-renderer-filler-was-lost', this);\n }\n if (isInlineFiller(domFillerNode)) {\n domFillerNode.remove();\n }\n else {\n domFillerNode.data = domFillerNode.data.substr(INLINE_FILLER_LENGTH);\n }\n this._inlineFiller = null;\n }\n /**\n * Checks if the inline {@link module:engine/view/filler filler} should be added.\n *\n * @returns `true` if the inline filler should be added.\n */\n _needsInlineFillerAtSelection() {\n if (this.selection.rangeCount != 1 || !this.selection.isCollapsed) {\n return false;\n }\n const selectionPosition = this.selection.getFirstPosition();\n const selectionParent = selectionPosition.parent;\n const selectionOffset = selectionPosition.offset;\n // If there is no DOM root we do not care about fillers.\n if (!this.domConverter.mapViewToDom(selectionParent.root)) {\n return false;\n }\n if (!(selectionParent.is('element'))) {\n return false;\n }\n // Prevent adding inline filler inside elements with contenteditable=false.\n // https://github.com/ckeditor/ckeditor5-engine/issues/1170\n if (!isEditable(selectionParent)) {\n return false;\n }\n // We have block filler, we do not need inline one.\n if (selectionOffset === selectionParent.getFillerOffset()) {\n return false;\n }\n const nodeBefore = selectionPosition.nodeBefore;\n const nodeAfter = selectionPosition.nodeAfter;\n if (nodeBefore instanceof ViewText || nodeAfter instanceof ViewText) {\n return false;\n }\n // Do not use inline filler while typing outside inline elements on Android.\n // The deleteContentBackward would remove part of the inline filler instead of removing last letter in a link.\n if (env.isAndroid && (nodeBefore || nodeAfter)) {\n return false;\n }\n return true;\n }\n /**\n * Checks if text needs to be updated and possibly updates it.\n *\n * @param viewText View text to update.\n * @param options.inlineFillerPosition The position where the inline filler should be rendered.\n */\n _updateText(viewText, options) {\n const domText = this.domConverter.findCorrespondingDomText(viewText);\n const newDomText = this.domConverter.viewToDom(viewText);\n let expectedText = newDomText.data;\n const filler = options.inlineFillerPosition;\n if (filler && filler.parent == viewText.parent && filler.offset == viewText.index) {\n expectedText = INLINE_FILLER + expectedText;\n }\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.group( '%c[Renderer]%c Update text',\n // @if CK_DEBUG_TYPING // \t\t'color: green;font-weight: bold', ''\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n updateTextNode(domText, expectedText);\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n }\n /**\n * Checks if attribute list needs to be updated and possibly updates it.\n *\n * @param viewElement The view element to update.\n */\n _updateAttrs(viewElement) {\n const domElement = this.domConverter.mapViewToDom(viewElement);\n if (!domElement) {\n // If there is no `domElement` it means that 'viewElement' is outdated as its mapping was updated\n // in 'this._updateChildrenMappings()'. There is no need to process it as new view element which\n // replaced old 'viewElement' mapping was also added to 'this.markedAttributes'\n // in 'this._updateChildrenMappings()' so it will be processed separately.\n return;\n }\n const domAttrKeys = Array.from(domElement.attributes).map(attr => attr.name);\n const viewAttrKeys = viewElement.getAttributeKeys();\n // Add or overwrite attributes.\n for (const key of viewAttrKeys) {\n this.domConverter.setDomElementAttribute(domElement, key, viewElement.getAttribute(key), viewElement);\n }\n // Remove from DOM attributes which do not exists in the view.\n for (const key of domAttrKeys) {\n // All other attributes not present in the DOM should be removed.\n if (!viewElement.hasAttribute(key)) {\n this.domConverter.removeDomElementAttribute(domElement, key);\n }\n }\n }\n /**\n * Checks if elements child list needs to be updated and possibly updates it.\n *\n * Note that on Android, to reduce the risk of composition breaks, it tries to update data of an existing\n * child text nodes instead of replacing them completely.\n *\n * @param viewElement View element to update.\n * @param options.inlineFillerPosition The position where the inline filler should be rendered.\n */\n _updateChildren(viewElement, options) {\n const domElement = this.domConverter.mapViewToDom(viewElement);\n if (!domElement) {\n // If there is no `domElement` it means that it was already removed from DOM.\n // There is no need to process it. It will be processed when re-inserted.\n return;\n }\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.group( '%c[Renderer]%c Update children',\n // @if CK_DEBUG_TYPING // \t\t'color: green;font-weight: bold', ''\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n // IME on Android inserts a new text node while typing after a link\n // instead of updating an existing text node that follows the link.\n // We must normalize those text nodes so the diff won't get confused.\n // https://github.com/ckeditor/ckeditor5/issues/12574.\n if (env.isAndroid) {\n let previousDomNode = null;\n for (const domNode of Array.from(domElement.childNodes)) {\n if (previousDomNode && isText(previousDomNode) && isText(domNode)) {\n domElement.normalize();\n break;\n }\n previousDomNode = domNode;\n }\n }\n const inlineFillerPosition = options.inlineFillerPosition;\n const actualDomChildren = domElement.childNodes;\n const expectedDomChildren = Array.from(this.domConverter.viewChildrenToDom(viewElement, { bind: true }));\n // Inline filler element has to be created as it is present in the DOM, but not in the view. It is required\n // during diffing so text nodes could be compared correctly and also during rendering to maintain\n // proper order and indexes while updating the DOM.\n if (inlineFillerPosition && inlineFillerPosition.parent === viewElement) {\n addInlineFiller(domElement.ownerDocument, expectedDomChildren, inlineFillerPosition.offset);\n }\n const diff = this._diffNodeLists(actualDomChildren, expectedDomChildren);\n // We need to make sure that we update the existing text node and not replace it with another one.\n // The composition and different \"language\" browser extensions are fragile to text node being completely replaced.\n const actions = this._findUpdateActions(diff, actualDomChildren, expectedDomChildren, areTextNodes);\n let i = 0;\n const nodesToUnbind = new Set();\n // Handle deletions first.\n // This is to prevent a situation where an element that already exists in `actualDomChildren` is inserted at a different\n // index in `actualDomChildren`. Since `actualDomChildren` is a `NodeList`, this works like move, not like an insert,\n // and it disrupts the whole algorithm. See https://github.com/ckeditor/ckeditor5/issues/6367.\n //\n // It doesn't matter in what order we remove or add nodes, as long as we remove and add correct nodes at correct indexes.\n for (const action of actions) {\n if (action === 'delete') {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[Renderer]%c Remove node',\n // @if CK_DEBUG_TYPING // \t\t'color: green;font-weight: bold', '', actualDomChildren[ i ]\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n nodesToUnbind.add(actualDomChildren[i]);\n remove(actualDomChildren[i]);\n }\n else if (action === 'equal' || action === 'update') {\n i++;\n }\n }\n i = 0;\n for (const action of actions) {\n if (action === 'insert') {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[Renderer]%c Insert node',\n // @if CK_DEBUG_TYPING // \t\t'color: green;font-weight: bold', '', expectedDomChildren[ i ]\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n insertAt(domElement, i, expectedDomChildren[i]);\n i++;\n }\n // Update the existing text node data. Note that replace action is generated only for Android for now.\n else if (action === 'update') {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.group( '%c[Renderer]%c Update text node',\n // @if CK_DEBUG_TYPING // \t\t'color: green;font-weight: bold', ''\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n updateTextNode(actualDomChildren[i], expectedDomChildren[i].data);\n i++;\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n }\n else if (action === 'equal') {\n // Force updating text nodes inside elements which did not change and do not need to be re-rendered (#1125).\n // Do it here (not in the loop above) because only after insertions the `i` index is correct.\n this._markDescendantTextToSync(this.domConverter.domToView(expectedDomChildren[i]));\n i++;\n }\n }\n // Unbind removed nodes. When node does not have a parent it means that it was removed from DOM tree during\n // comparison with the expected DOM. We don't need to check child nodes, because if child node was reinserted,\n // it was moved to DOM tree out of the removed node.\n for (const node of nodesToUnbind) {\n if (!node.parentNode) {\n this.domConverter.unbindDomElement(node);\n }\n }\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n }\n /**\n * Shorthand for diffing two arrays or node lists of DOM nodes.\n *\n * @param actualDomChildren Actual DOM children\n * @param expectedDomChildren Expected DOM children.\n * @returns The list of actions based on the {@link module:utils/diff~diff} function.\n */\n _diffNodeLists(actualDomChildren, expectedDomChildren) {\n actualDomChildren = filterOutFakeSelectionContainer(actualDomChildren, this._fakeSelectionContainer);\n return diff(actualDomChildren, expectedDomChildren, sameNodes.bind(null, this.domConverter));\n }\n /**\n * Finds DOM nodes that were replaced with the similar nodes (same tag name) in the view. All nodes are compared\n * within one `insert`/`delete` action group, for example:\n *\n * ```\n * Actual DOM:\t\t<p><b>Foo</b>Bar<i>Baz</i><b>Bax</b></p>\n * Expected DOM:\t<p>Bar<b>123</b><i>Baz</i><b>456</b></p>\n * Input actions:\t[ insert, insert, delete, delete, equal, insert, delete ]\n * Output actions:\t[ insert, replace, delete, equal, replace ]\n * ```\n *\n * @param actions Actions array which is a result of the {@link module:utils/diff~diff} function.\n * @param actualDom Actual DOM children\n * @param expectedDom Expected DOM children.\n * @param comparator A comparator function that should return `true` if the given node should be reused\n * (either by the update of a text node data or an element children list for similar elements).\n * @returns Actions array modified with the `update` actions.\n */\n _findUpdateActions(actions, actualDom, expectedDom, comparator) {\n // If there is no both 'insert' and 'delete' actions, no need to check for replaced elements.\n if (actions.indexOf('insert') === -1 || actions.indexOf('delete') === -1) {\n return actions;\n }\n let newActions = [];\n let actualSlice = [];\n let expectedSlice = [];\n const counter = { equal: 0, insert: 0, delete: 0 };\n for (const action of actions) {\n if (action === 'insert') {\n expectedSlice.push(expectedDom[counter.equal + counter.insert]);\n }\n else if (action === 'delete') {\n actualSlice.push(actualDom[counter.equal + counter.delete]);\n }\n else { // equal\n newActions = newActions.concat(diff(actualSlice, expectedSlice, comparator)\n .map(action => action === 'equal' ? 'update' : action));\n newActions.push('equal');\n // Reset stored elements on 'equal'.\n actualSlice = [];\n expectedSlice = [];\n }\n counter[action]++;\n }\n return newActions.concat(diff(actualSlice, expectedSlice, comparator)\n .map(action => action === 'equal' ? 'update' : action));\n }\n /**\n * Marks text nodes to be synchronized.\n *\n * If a text node is passed, it will be marked. If an element is passed, all descendant text nodes inside it will be marked.\n *\n * @param viewNode View node to sync.\n */\n _markDescendantTextToSync(viewNode) {\n if (!viewNode) {\n return;\n }\n if (viewNode.is('$text')) {\n this.markedTexts.add(viewNode);\n }\n else if (viewNode.is('element')) {\n for (const child of viewNode.getChildren()) {\n this._markDescendantTextToSync(child);\n }\n }\n }\n /**\n * Checks if the selection needs to be updated and possibly updates it.\n */\n _updateSelection() {\n // Block updating DOM selection in (non-Android) Blink while the user is selecting to prevent accidental selection collapsing.\n // Note: Structural changes in DOM must trigger selection rendering, though. Nodes the selection was anchored\n // to, may disappear in DOM which would break the selection (e.g. in real-time collaboration scenarios).\n // https://github.com/ckeditor/ckeditor5/issues/10562, https://github.com/ckeditor/ckeditor5/issues/10723\n if (env.isBlink && !env.isAndroid && this.isSelecting && !this.markedChildren.size) {\n return;\n }\n // If there is no selection - remove DOM and fake selections.\n if (this.selection.rangeCount === 0) {\n this._removeDomSelection();\n this._removeFakeSelection();\n return;\n }\n const domRoot = this.domConverter.mapViewToDom(this.selection.editableElement);\n // Do nothing if there is no focus, or there is no DOM element corresponding to selection's editable element.\n if (!this.isFocused || !domRoot) {\n return;\n }\n // Render fake selection - create the fake selection container (if needed) and move DOM selection to it.\n if (this.selection.isFake) {\n this._updateFakeSelection(domRoot);\n }\n // There was a fake selection so remove it and update the DOM selection.\n // This is especially important on Android because otherwise IME will try to compose over the fake selection container.\n else if (this._fakeSelectionContainer && this._fakeSelectionContainer.isConnected) {\n this._removeFakeSelection();\n this._updateDomSelection(domRoot);\n }\n // Update the DOM selection in case of a plain selection change (no fake selection is involved).\n // On non-Android the whole rendering is disabled in composition mode (including DOM selection update),\n // but updating DOM selection should be also disabled on Android if in the middle of the composition\n // (to not interrupt it).\n else if (!(this.isComposing && env.isAndroid)) {\n this._updateDomSelection(domRoot);\n }\n }\n /**\n * Updates the fake selection.\n *\n * @param domRoot A valid DOM root where the fake selection container should be added.\n */\n _updateFakeSelection(domRoot) {\n const domDocument = domRoot.ownerDocument;\n if (!this._fakeSelectionContainer) {\n this._fakeSelectionContainer = createFakeSelectionContainer(domDocument);\n }\n const container = this._fakeSelectionContainer;\n // Bind fake selection container with the current selection *position*.\n this.domConverter.bindFakeSelection(container, this.selection);\n if (!this._fakeSelectionNeedsUpdate(domRoot)) {\n return;\n }\n if (!container.parentElement || container.parentElement != domRoot) {\n domRoot.appendChild(container);\n }\n container.textContent = this.selection.fakeSelectionLabel || '\\u00A0';\n const domSelection = domDocument.getSelection();\n const domRange = domDocument.createRange();\n domSelection.removeAllRanges();\n domRange.selectNodeContents(container);\n domSelection.addRange(domRange);\n }\n /**\n * Updates the DOM selection.\n *\n * @param domRoot A valid DOM root where the DOM selection should be rendered.\n */\n _updateDomSelection(domRoot) {\n const domSelection = domRoot.ownerDocument.defaultView.getSelection();\n // Let's check whether DOM selection needs updating at all.\n if (!this._domSelectionNeedsUpdate(domSelection)) {\n return;\n }\n // Multi-range selection is not available in most browsers, and, at least in Chrome, trying to\n // set such selection, that is not continuous, throws an error. Because of that, we will just use anchor\n // and focus of view selection.\n // Since we are not supporting multi-range selection, we also do not need to check if proper editable is\n // selected. If there is any editable selected, it is okay (editable is taken from selection anchor).\n const anchor = this.domConverter.viewPositionToDom(this.selection.anchor);\n const focus = this.domConverter.viewPositionToDom(this.selection.focus);\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[Renderer]%c Update DOM selection:',\n // @if CK_DEBUG_TYPING // \t\t'color: green;font-weight: bold', '', anchor, focus\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n domSelection.collapse(anchor.parent, anchor.offset);\n domSelection.extend(focus.parent, focus.offset);\n // Firefoxspecific hack (https://github.com/ckeditor/ckeditor5-engine/issues/1439).\n if (env.isGecko) {\n fixGeckoSelectionAfterBr(focus, domSelection);\n }\n }\n /**\n * Checks whether a given DOM selection needs to be updated.\n *\n * @param domSelection The DOM selection to check.\n */\n _domSelectionNeedsUpdate(domSelection) {\n if (!this.domConverter.isDomSelectionCorrect(domSelection)) {\n // Current DOM selection is in incorrect position. We need to update it.\n return true;\n }\n const oldViewSelection = domSelection && this.domConverter.domSelectionToView(domSelection);\n if (oldViewSelection && this.selection.isEqual(oldViewSelection)) {\n return false;\n }\n // If selection is not collapsed, it does not need to be updated if it is similar.\n if (!this.selection.isCollapsed && this.selection.isSimilar(oldViewSelection)) {\n // Selection did not changed and is correct, do not update.\n return false;\n }\n // Selections are not similar.\n return true;\n }\n /**\n * Checks whether the fake selection needs to be updated.\n *\n * @param domRoot A valid DOM root where a new fake selection container should be added.\n */\n _fakeSelectionNeedsUpdate(domRoot) {\n const container = this._fakeSelectionContainer;\n const domSelection = domRoot.ownerDocument.getSelection();\n // Fake selection needs to be updated if there's no fake selection container, or the container currently sits\n // in a different root.\n if (!container || container.parentElement !== domRoot) {\n return true;\n }\n // Make sure that the selection actually is within the fake selection.\n if (domSelection.anchorNode !== container && !container.contains(domSelection.anchorNode)) {\n return true;\n }\n return container.textContent !== this.selection.fakeSelectionLabel;\n }\n /**\n * Removes the DOM selection.\n */\n _removeDomSelection() {\n for (const doc of this.domDocuments) {\n const domSelection = doc.getSelection();\n if (domSelection.rangeCount) {\n const activeDomElement = doc.activeElement;\n const viewElement = this.domConverter.mapDomToView(activeDomElement);\n if (activeDomElement && viewElement) {\n domSelection.removeAllRanges();\n }\n }\n }\n }\n /**\n * Removes the fake selection.\n */\n _removeFakeSelection() {\n const container = this._fakeSelectionContainer;\n if (container) {\n container.remove();\n }\n }\n /**\n * Checks if focus needs to be updated and possibly updates it.\n */\n _updateFocus() {\n if (this.isFocused) {\n const editable = this.selection.editableElement;\n if (editable) {\n this.domConverter.focus(editable);\n }\n }\n }\n}\n/**\n * Checks if provided element is editable.\n */\nfunction isEditable(element) {\n if (element.getAttribute('contenteditable') == 'false') {\n return false;\n }\n const parent = element.findAncestor(element => element.hasAttribute('contenteditable'));\n return !parent || parent.getAttribute('contenteditable') == 'true';\n}\n/**\n * Adds inline filler at a given position.\n *\n * The position can be given as an array of DOM nodes and an offset in that array,\n * or a DOM parent element and an offset in that element.\n *\n * @returns The DOM text node that contains an inline filler.\n */\nfunction addInlineFiller(domDocument, domParentOrArray, offset) {\n const childNodes = domParentOrArray instanceof Array ? domParentOrArray : domParentOrArray.childNodes;\n const nodeAfterFiller = childNodes[offset];\n if (isText(nodeAfterFiller)) {\n nodeAfterFiller.data = INLINE_FILLER + nodeAfterFiller.data;\n return nodeAfterFiller;\n }\n else {\n const fillerNode = domDocument.createTextNode(INLINE_FILLER);\n if (Array.isArray(domParentOrArray)) {\n childNodes.splice(offset, 0, fillerNode);\n }\n else {\n insertAt(domParentOrArray, offset, fillerNode);\n }\n return fillerNode;\n }\n}\n/**\n * Whether two DOM nodes should be considered as similar.\n * Nodes are considered similar if they have the same tag name.\n */\nfunction areSimilarElements(node1, node2) {\n return isNode(node1) && isNode(node2) &&\n !isText(node1) && !isText(node2) &&\n !isComment(node1) && !isComment(node2) &&\n node1.tagName.toLowerCase() === node2.tagName.toLowerCase();\n}\n/**\n * Whether two DOM nodes are text nodes.\n */\nfunction areTextNodes(node1, node2) {\n return isNode(node1) && isNode(node2) &&\n isText(node1) && isText(node2);\n}\n/**\n * Whether two dom nodes should be considered as the same.\n * Two nodes which are considered the same are:\n *\n * * Text nodes with the same text.\n * * Element nodes represented by the same object.\n * * Two block filler elements.\n *\n * @param blockFillerMode Block filler mode, see {@link module:engine/view/domconverter~DomConverter#blockFillerMode}.\n */\nfunction sameNodes(domConverter, actualDomChild, expectedDomChild) {\n // Elements.\n if (actualDomChild === expectedDomChild) {\n return true;\n }\n // Texts.\n else if (isText(actualDomChild) && isText(expectedDomChild)) {\n return actualDomChild.data === expectedDomChild.data;\n }\n // Block fillers.\n else if (domConverter.isBlockFiller(actualDomChild) &&\n domConverter.isBlockFiller(expectedDomChild)) {\n return true;\n }\n // Not matching types.\n return false;\n}\n/**\n * The following is a Firefoxspecific hack (https://github.com/ckeditor/ckeditor5-engine/issues/1439).\n * When the native DOM selection is at the end of the block and preceded by <br /> e.g.\n *\n * ```html\n * <p>foo<br/>[]</p>\n * ```\n *\n * which happens a lot when using the soft line break, the browser fails to (visually) move the\n * caret to the new line. A quick fix is as simple as forcerefreshing the selection with the same range.\n */\nfunction fixGeckoSelectionAfterBr(focus, domSelection) {\n const parent = focus.parent;\n // This fix works only when the focus point is at the very end of an element.\n // There is no point in running it in cases unrelated to the browser bug.\n if (parent.nodeType != Node.ELEMENT_NODE || focus.offset != parent.childNodes.length - 1) {\n return;\n }\n const childAtOffset = parent.childNodes[focus.offset];\n // To stay on the safe side, the fix being as specific as possible, it targets only the\n // selection which is at the very end of the element and preceded by <br />.\n if (childAtOffset && childAtOffset.tagName == 'BR') {\n domSelection.addRange(domSelection.getRangeAt(0));\n }\n}\nfunction filterOutFakeSelectionContainer(domChildList, fakeSelectionContainer) {\n const childList = Array.from(domChildList);\n if (childList.length == 0 || !fakeSelectionContainer) {\n return childList;\n }\n const last = childList[childList.length - 1];\n if (last == fakeSelectionContainer) {\n childList.pop();\n }\n return childList;\n}\n/**\n * Creates a fake selection container for a given document.\n */\nfunction createFakeSelectionContainer(domDocument) {\n const container = domDocument.createElement('div');\n container.className = 'ck-fake-selection-container';\n Object.assign(container.style, {\n position: 'fixed',\n top: 0,\n left: '-9999px',\n // See https://github.com/ckeditor/ckeditor5/issues/752.\n width: '42px'\n });\n // Fill it with a text node so we can update it later.\n container.textContent = '\\u00A0';\n return container;\n}\n/**\n * Checks if text needs to be updated and possibly updates it by removing and inserting only parts\n * of the data from the existing text node to reduce impact on the IME composition.\n *\n * @param domText DOM text node to update.\n * @param expectedText The expected data of a text node.\n */\nfunction updateTextNode(domText, expectedText) {\n const actualText = domText.data;\n if (actualText == expectedText) {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[Renderer]%c Text node does not need update:',\n // @if CK_DEBUG_TYPING // \t\t'color: green;font-weight: bold', '',\n // @if CK_DEBUG_TYPING // \t\t`\"${ domText.data }\" (${ domText.data.length })`\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n return;\n }\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[Renderer]%c Update text node:',\n // @if CK_DEBUG_TYPING // \t\t'color: green;font-weight: bold', '',\n // @if CK_DEBUG_TYPING // \t\t`\"${ domText.data }\" (${ domText.data.length }) -> \"${ expectedText }\" (${ expectedText.length })`\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n const actions = fastDiff(actualText, expectedText);\n for (const action of actions) {\n if (action.type === 'insert') {\n domText.insertData(action.index, action.values.join(''));\n }\n else { // 'delete'\n domText.deleteData(action.index, action.howMany);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/domconverter\n */\n/* globals Node, NodeFilter, DOMParser, Text */\nimport ViewText from './text';\nimport ViewElement from './element';\nimport ViewUIElement from './uielement';\nimport ViewPosition from './position';\nimport ViewRange from './range';\nimport ViewSelection from './selection';\nimport ViewDocumentFragment from './documentfragment';\nimport ViewTreeWalker from './treewalker';\nimport { default as Matcher } from './matcher';\nimport { BR_FILLER, INLINE_FILLER_LENGTH, NBSP_FILLER, MARKED_NBSP_FILLER, getDataWithoutFiller, isInlineFiller, startsWithFiller } from './filler';\nimport { global, logWarning, indexOf, getAncestors, isText, isComment, isValidAttributeName, first } from '@ckeditor/ckeditor5-utils';\nconst BR_FILLER_REF = BR_FILLER(global.document); // eslint-disable-line new-cap\nconst NBSP_FILLER_REF = NBSP_FILLER(global.document); // eslint-disable-line new-cap\nconst MARKED_NBSP_FILLER_REF = MARKED_NBSP_FILLER(global.document); // eslint-disable-line new-cap\nconst UNSAFE_ATTRIBUTE_NAME_PREFIX = 'data-ck-unsafe-attribute-';\nconst UNSAFE_ELEMENT_REPLACEMENT_ATTRIBUTE = 'data-ck-unsafe-element';\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 bindings} between these nodes.\n *\n * An instance of the DOM converter is available under\n * {@link module:engine/view/view~View#domConverter `editor.editing.view.domConverter`}.\n *\n * The DOM converter does not check which nodes should be rendered (use {@link module:engine/view/renderer~Renderer}), does not keep the\n * state of a tree nor keeps the synchronization between the tree view and the DOM tree (use {@link module:engine/view/document~Document}).\n *\n * The DOM converter keeps DOM elements to view element bindings, so when the converter gets destroyed, the bindings are lost.\n * Two converters will keep separate binding maps, so one tree view can be bound with two DOM trees.\n */\nexport default class DomConverter {\n /**\n * Creates a DOM converter.\n *\n * @param document The view document instance.\n * @param options An object with configuration options.\n * @param options.blockFillerMode The type of the block filler to use.\n * Default value depends on the options.renderingMode:\n * 'nbsp' when options.renderingMode == 'data',\n * 'br' when options.renderingMode == 'editing'.\n * @param options.renderingMode Whether to leave the View-to-DOM conversion result unchanged\n * or improve editing experience by filtering out interactive data.\n */\n constructor(document, { blockFillerMode, renderingMode = 'editing' } = {}) {\n /**\n * The DOM-to-view mapping.\n */\n this._domToViewMapping = new WeakMap();\n /**\n * The view-to-DOM mapping.\n */\n this._viewToDomMapping = new WeakMap();\n /**\n * Holds the mapping between fake selection containers and corresponding view selections.\n */\n this._fakeSelectionMapping = new WeakMap();\n /**\n * Matcher for view elements whose content should be treated as raw data\n * and not processed during the conversion from DOM nodes to view elements.\n */\n this._rawContentElementMatcher = new Matcher();\n /**\n * A set of encountered raw content DOM nodes. It is used for preventing left trimming of the following text node.\n */\n this._encounteredRawContentDomNodes = new WeakSet();\n this.document = document;\n this.renderingMode = renderingMode;\n this.blockFillerMode = blockFillerMode || (renderingMode === 'editing' ? 'br' : 'nbsp');\n this.preElements = ['pre'];\n this.blockElements = [\n 'address', 'article', 'aside', 'blockquote', 'caption', 'center', 'dd', 'details', 'dir', 'div',\n 'dl', 'dt', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header',\n 'hgroup', 'legend', 'li', 'main', 'menu', 'nav', 'ol', 'p', 'pre', 'section', 'summary', 'table', 'tbody',\n 'td', 'tfoot', 'th', 'thead', 'tr', 'ul'\n ];\n this.inlineObjectElements = [\n 'object', 'iframe', 'input', 'button', 'textarea', 'select', 'option', 'video', 'embed', 'audio', 'img', 'canvas'\n ];\n this.unsafeElements = ['script', 'style'];\n this._domDocument = this.renderingMode === 'editing' ? global.document : global.document.implementation.createHTMLDocument('');\n }\n /**\n * Binds a given DOM element that represents fake selection to a **position** of a\n * {@link module:engine/view/documentselection~DocumentSelection document selection}.\n * Document selection copy is stored and can be retrieved by the\n * {@link module:engine/view/domconverter~DomConverter#fakeSelectionToView} method.\n */\n bindFakeSelection(domElement, viewDocumentSelection) {\n this._fakeSelectionMapping.set(domElement, new ViewSelection(viewDocumentSelection));\n }\n /**\n * Returns a {@link module:engine/view/selection~Selection view selection} instance corresponding to a given\n * DOM element that represents fake selection. Returns `undefined` if binding to the given DOM element does not exist.\n */\n fakeSelectionToView(domElement) {\n return this._fakeSelectionMapping.get(domElement);\n }\n /**\n * Binds DOM and view elements, so it will be possible to get corresponding elements using\n * {@link module:engine/view/domconverter~DomConverter#mapDomToView} and\n * {@link module:engine/view/domconverter~DomConverter#mapViewToDom}.\n *\n * @param domElement The DOM element to bind.\n * @param viewElement The view element to bind.\n */\n bindElements(domElement, viewElement) {\n this._domToViewMapping.set(domElement, viewElement);\n this._viewToDomMapping.set(viewElement, domElement);\n }\n /**\n * Unbinds a given DOM element from the view element it was bound to. Unbinding is deep, meaning that all children of\n * the DOM element will be unbound too.\n *\n * @param domElement The DOM element to unbind.\n */\n unbindDomElement(domElement) {\n const viewElement = this._domToViewMapping.get(domElement);\n if (viewElement) {\n this._domToViewMapping.delete(domElement);\n this._viewToDomMapping.delete(viewElement);\n for (const child of Array.from(domElement.children)) {\n this.unbindDomElement(child);\n }\n }\n }\n /**\n * Binds DOM and view document fragments, so it will be possible to get corresponding document fragments using\n * {@link module:engine/view/domconverter~DomConverter#mapDomToView} and\n * {@link module:engine/view/domconverter~DomConverter#mapViewToDom}.\n *\n * @param domFragment The DOM document fragment to bind.\n * @param viewFragment The view document fragment to bind.\n */\n bindDocumentFragments(domFragment, viewFragment) {\n this._domToViewMapping.set(domFragment, viewFragment);\n this._viewToDomMapping.set(viewFragment, domFragment);\n }\n /**\n * Decides whether a given pair of attribute key and value should be passed further down the pipeline.\n *\n * @param elementName Element name in lower case.\n */\n shouldRenderAttribute(attributeKey, attributeValue, elementName) {\n if (this.renderingMode === 'data') {\n return true;\n }\n attributeKey = attributeKey.toLowerCase();\n if (attributeKey.startsWith('on')) {\n return false;\n }\n if (attributeKey === 'srcdoc' &&\n attributeValue.match(/\\bon\\S+\\s*=|javascript:|<\\s*\\/*script/i)) {\n return false;\n }\n if (elementName === 'img' &&\n (attributeKey === 'src' || attributeKey === 'srcset')) {\n return true;\n }\n if (elementName === 'source' && attributeKey === 'srcset') {\n return true;\n }\n if (attributeValue.match(/^\\s*(javascript:|data:(image\\/svg|text\\/x?html))/i)) {\n return false;\n }\n return true;\n }\n /**\n * Set `domElement`'s content using provided `html` argument. Apply necessary filtering for the editing pipeline.\n *\n * @param domElement DOM element that should have `html` set as its content.\n * @param html Textual representation of the HTML that will be set on `domElement`.\n */\n setContentOf(domElement, html) {\n // For data pipeline we pass the HTML as-is.\n if (this.renderingMode === 'data') {\n domElement.innerHTML = html;\n return;\n }\n const document = new DOMParser().parseFromString(html, 'text/html');\n const fragment = document.createDocumentFragment();\n const bodyChildNodes = document.body.childNodes;\n while (bodyChildNodes.length > 0) {\n fragment.appendChild(bodyChildNodes[0]);\n }\n const treeWalker = document.createTreeWalker(fragment, NodeFilter.SHOW_ELEMENT);\n const nodes = [];\n let currentNode;\n // eslint-disable-next-line no-cond-assign\n while (currentNode = treeWalker.nextNode()) {\n nodes.push(currentNode);\n }\n for (const currentNode of nodes) {\n // Go through nodes to remove those that are prohibited in editing pipeline.\n for (const attributeName of currentNode.getAttributeNames()) {\n this.setDomElementAttribute(currentNode, attributeName, currentNode.getAttribute(attributeName));\n }\n const elementName = currentNode.tagName.toLowerCase();\n // There are certain nodes, that should be renamed to <span> in editing pipeline.\n if (this._shouldRenameElement(elementName)) {\n _logUnsafeElement(elementName);\n currentNode.replaceWith(this._createReplacementDomElement(elementName, currentNode));\n }\n }\n // Empty the target element.\n while (domElement.firstChild) {\n domElement.firstChild.remove();\n }\n domElement.append(fragment);\n }\n /**\n * Converts the view to the DOM. For all text nodes, not bound elements and document fragments new items will\n * be created. For bound elements and document fragments the method will return corresponding items.\n *\n * @param viewNode View node or document fragment to transform.\n * @param options Conversion options.\n * @param options.bind Determines whether new elements will be bound.\n * @param options.withChildren If `false`, node's and document fragment's children will not be converted.\n * @returns Converted node or DocumentFragment.\n */\n viewToDom(viewNode, options = {}) {\n if (viewNode.is('$text')) {\n const textData = this._processDataFromViewText(viewNode);\n return this._domDocument.createTextNode(textData);\n }\n else {\n if (this.mapViewToDom(viewNode)) {\n return this.mapViewToDom(viewNode);\n }\n let domElement;\n if (viewNode.is('documentFragment')) {\n // Create DOM document fragment.\n domElement = this._domDocument.createDocumentFragment();\n if (options.bind) {\n this.bindDocumentFragments(domElement, viewNode);\n }\n }\n else if (viewNode.is('uiElement')) {\n if (viewNode.name === '$comment') {\n domElement = this._domDocument.createComment(viewNode.getCustomProperty('$rawContent'));\n }\n else {\n // UIElement has its own render() method (see #799).\n domElement = viewNode.render(this._domDocument, this);\n }\n if (options.bind) {\n this.bindElements(domElement, viewNode);\n }\n return domElement;\n }\n else {\n // Create DOM element.\n if (this._shouldRenameElement(viewNode.name)) {\n _logUnsafeElement(viewNode.name);\n domElement = this._createReplacementDomElement(viewNode.name);\n }\n else if (viewNode.hasAttribute('xmlns')) {\n domElement = this._domDocument.createElementNS(viewNode.getAttribute('xmlns'), viewNode.name);\n }\n else {\n domElement = this._domDocument.createElement(viewNode.name);\n }\n // RawElement take care of their children in RawElement#render() method which can be customized\n // (see https://github.com/ckeditor/ckeditor5/issues/4469).\n if (viewNode.is('rawElement')) {\n viewNode.render(domElement, this);\n }\n if (options.bind) {\n this.bindElements(domElement, viewNode);\n }\n // Copy element's attributes.\n for (const key of viewNode.getAttributeKeys()) {\n this.setDomElementAttribute(domElement, key, viewNode.getAttribute(key), viewNode);\n }\n }\n if (options.withChildren !== false) {\n for (const child of this.viewChildrenToDom(viewNode, options)) {\n domElement.appendChild(child);\n }\n }\n return domElement;\n }\n }\n /**\n * Sets the attribute on a DOM element.\n *\n * **Note**: To remove the attribute, use {@link #removeDomElementAttribute}.\n *\n * @param domElement The DOM element the attribute should be set on.\n * @param key The name of the attribute.\n * @param value The value of the attribute.\n * @param relatedViewElement The view element related to the `domElement` (if there is any).\n * It helps decide whether the attribute set is unsafe. For instance, view elements created via the\n * {@link module:engine/view/downcastwriter~DowncastWriter} methods can allow certain attributes that would normally be filtered out.\n */\n setDomElementAttribute(domElement, key, value, relatedViewElement) {\n const shouldRenderAttribute = this.shouldRenderAttribute(key, value, domElement.tagName.toLowerCase()) ||\n relatedViewElement && relatedViewElement.shouldRenderUnsafeAttribute(key);\n if (!shouldRenderAttribute) {\n logWarning('domconverter-unsafe-attribute-detected', { domElement, key, value });\n }\n if (!isValidAttributeName(key)) {\n /**\n * Invalid attribute name was ignored during rendering.\n *\n * @error domconverter-invalid-attribute-detected\n */\n logWarning('domconverter-invalid-attribute-detected', { domElement, key, value });\n return;\n }\n // The old value was safe but the new value is unsafe.\n if (domElement.hasAttribute(key) && !shouldRenderAttribute) {\n domElement.removeAttribute(key);\n }\n // The old value was unsafe (but prefixed) but the new value will be safe (will be unprefixed).\n else if (domElement.hasAttribute(UNSAFE_ATTRIBUTE_NAME_PREFIX + key) && shouldRenderAttribute) {\n domElement.removeAttribute(UNSAFE_ATTRIBUTE_NAME_PREFIX + key);\n }\n // If the attribute should not be rendered, rename it (instead of removing) to give developers some idea of what\n // is going on (https://github.com/ckeditor/ckeditor5/issues/10801).\n domElement.setAttribute(shouldRenderAttribute ? key : UNSAFE_ATTRIBUTE_NAME_PREFIX + key, value);\n }\n /**\n * Removes an attribute from a DOM element.\n *\n * **Note**: To set the attribute, use {@link #setDomElementAttribute}.\n *\n * @param domElement The DOM element the attribute should be removed from.\n * @param key The name of the attribute.\n */\n removeDomElementAttribute(domElement, key) {\n // See #_createReplacementDomElement() to learn what this is.\n if (key == UNSAFE_ELEMENT_REPLACEMENT_ATTRIBUTE) {\n return;\n }\n domElement.removeAttribute(key);\n // See setDomElementAttribute() to learn what this is.\n domElement.removeAttribute(UNSAFE_ATTRIBUTE_NAME_PREFIX + key);\n }\n /**\n * Converts children of the view element to DOM using the\n * {@link module:engine/view/domconverter~DomConverter#viewToDom} method.\n * Additionally, this method adds block {@link module:engine/view/filler filler} to the list of children, if needed.\n *\n * @param viewElement Parent view element.\n * @param options See {@link module:engine/view/domconverter~DomConverter#viewToDom} options parameter.\n * @returns DOM nodes.\n */\n *viewChildrenToDom(viewElement, options = {}) {\n const fillerPositionOffset = viewElement.getFillerOffset && viewElement.getFillerOffset();\n let offset = 0;\n for (const childView of viewElement.getChildren()) {\n if (fillerPositionOffset === offset) {\n yield this._getBlockFiller();\n }\n const transparentRendering = childView.is('element') &&\n !!childView.getCustomProperty('dataPipeline:transparentRendering') &&\n !first(childView.getAttributes());\n if (transparentRendering && this.renderingMode == 'data') {\n yield* this.viewChildrenToDom(childView, options);\n }\n else {\n if (transparentRendering) {\n /**\n * The `dataPipeline:transparentRendering` flag is supported only in the data pipeline.\n *\n * @error domconverter-transparent-rendering-unsupported-in-editing-pipeline\n */\n logWarning('domconverter-transparent-rendering-unsupported-in-editing-pipeline', { viewElement: childView });\n }\n yield this.viewToDom(childView, options);\n }\n offset++;\n }\n if (fillerPositionOffset === offset) {\n yield this._getBlockFiller();\n }\n }\n /**\n * Converts view {@link module:engine/view/range~Range} to DOM range.\n * Inline and block {@link module:engine/view/filler fillers} are handled during the conversion.\n *\n * @param viewRange View range.\n * @returns DOM range.\n */\n viewRangeToDom(viewRange) {\n const domStart = this.viewPositionToDom(viewRange.start);\n const domEnd = this.viewPositionToDom(viewRange.end);\n const domRange = this._domDocument.createRange();\n domRange.setStart(domStart.parent, domStart.offset);\n domRange.setEnd(domEnd.parent, domEnd.offset);\n return domRange;\n }\n /**\n * Converts view {@link module:engine/view/position~Position} to DOM parent and offset.\n *\n * Inline and block {@link module:engine/view/filler fillers} are handled during the conversion.\n * If the converted position is directly before inline filler it is moved inside the filler.\n *\n * @param viewPosition View position.\n * @returns DOM position or `null` if view position could not be converted to DOM.\n * DOM position has two properties:\n * * `parent` - DOM position parent.\n * * `offset` - DOM position offset.\n */\n viewPositionToDom(viewPosition) {\n const viewParent = viewPosition.parent;\n if (viewParent.is('$text')) {\n const domParent = this.findCorrespondingDomText(viewParent);\n if (!domParent) {\n // Position is in a view text node that has not been rendered to DOM yet.\n return null;\n }\n let offset = viewPosition.offset;\n if (startsWithFiller(domParent)) {\n offset += INLINE_FILLER_LENGTH;\n }\n return { parent: domParent, offset };\n }\n else {\n // viewParent is instance of ViewElement.\n let domParent, domBefore, domAfter;\n if (viewPosition.offset === 0) {\n domParent = this.mapViewToDom(viewParent);\n if (!domParent) {\n // Position is in a view element that has not been rendered to DOM yet.\n return null;\n }\n domAfter = domParent.childNodes[0];\n }\n else {\n const nodeBefore = viewPosition.nodeBefore;\n domBefore = nodeBefore.is('$text') ?\n this.findCorrespondingDomText(nodeBefore) :\n this.mapViewToDom(nodeBefore);\n if (!domBefore) {\n // Position is after a view element that has not been rendered to DOM yet.\n return null;\n }\n domParent = domBefore.parentNode;\n domAfter = domBefore.nextSibling;\n }\n // If there is an inline filler at position return position inside the filler. We should never return\n // the position before the inline filler.\n if (isText(domAfter) && startsWithFiller(domAfter)) {\n return { parent: domAfter, offset: INLINE_FILLER_LENGTH };\n }\n const offset = domBefore ? indexOf(domBefore) + 1 : 0;\n return { parent: domParent, offset };\n }\n }\n /**\n * Converts DOM to view. For all text nodes, not bound elements and document fragments new items will\n * be created. For bound elements and document fragments function will return corresponding items. For\n * {@link module:engine/view/filler fillers} `null` will be returned.\n * For all DOM elements rendered by {@link module:engine/view/uielement~UIElement} that UIElement will be returned.\n *\n * @param domNode DOM node or document fragment to transform.\n * @param options Conversion options.\n * @param options.bind Determines whether new elements will be bound. False by default.\n * @param options.withChildren If `true`, node's and document fragment's children will be converted too. True by default.\n * @param options.keepOriginalCase If `false`, node's tag name will be converted to lower case. False by default.\n * @param options.skipComments If `false`, comment nodes will be converted to `$comment`\n * {@link module:engine/view/uielement~UIElement view UI elements}. False by default.\n * @returns Converted node or document fragment or `null` if DOM node is a {@link module:engine/view/filler filler}\n * or the given node is an empty text node.\n */\n domToView(domNode, options = {}) {\n if (this.isBlockFiller(domNode)) {\n return null;\n }\n // When node is inside a UIElement or a RawElement return that parent as it's view representation.\n const hostElement = this.getHostViewElement(domNode);\n if (hostElement) {\n return hostElement;\n }\n if (isComment(domNode) && options.skipComments) {\n return null;\n }\n if (isText(domNode)) {\n if (isInlineFiller(domNode)) {\n return null;\n }\n else {\n const textData = this._processDataFromDomText(domNode);\n return textData === '' ? null : new ViewText(this.document, textData);\n }\n }\n else {\n if (this.mapDomToView(domNode)) {\n return this.mapDomToView(domNode);\n }\n let viewElement;\n if (this.isDocumentFragment(domNode)) {\n // Create view document fragment.\n viewElement = new ViewDocumentFragment(this.document);\n if (options.bind) {\n this.bindDocumentFragments(domNode, viewElement);\n }\n }\n else {\n // Create view element.\n viewElement = this._createViewElement(domNode, options);\n if (options.bind) {\n this.bindElements(domNode, viewElement);\n }\n // Copy element's attributes.\n const attrs = domNode.attributes;\n if (attrs) {\n for (let l = attrs.length, i = 0; i < l; i++) {\n viewElement._setAttribute(attrs[i].name, attrs[i].value);\n }\n }\n // Treat this element's content as a raw data if it was registered as such.\n // Comment node is also treated as an element with raw data.\n if (this._isViewElementWithRawContent(viewElement, options) || isComment(domNode)) {\n const rawContent = isComment(domNode) ? domNode.data : domNode.innerHTML;\n viewElement._setCustomProperty('$rawContent', rawContent);\n // Store a DOM node to prevent left trimming of the following text node.\n this._encounteredRawContentDomNodes.add(domNode);\n return viewElement;\n }\n }\n if (options.withChildren !== false) {\n for (const child of this.domChildrenToView(domNode, options)) {\n viewElement._appendChild(child);\n }\n }\n return viewElement;\n }\n }\n /**\n * Converts children of the DOM element to view nodes using\n * the {@link module:engine/view/domconverter~DomConverter#domToView} method.\n * Additionally this method omits block {@link module:engine/view/filler filler}, if it exists in the DOM parent.\n *\n * @param domElement Parent DOM element.\n * @param options See {@link module:engine/view/domconverter~DomConverter#domToView} options parameter.\n * @returns View nodes.\n */\n *domChildrenToView(domElement, options) {\n for (let i = 0; i < domElement.childNodes.length; i++) {\n const domChild = domElement.childNodes[i];\n const viewChild = this.domToView(domChild, options);\n if (viewChild !== null) {\n yield viewChild;\n }\n }\n }\n /**\n * Converts DOM selection to view {@link module:engine/view/selection~Selection}.\n * Ranges which cannot be converted will be omitted.\n *\n * @param domSelection DOM selection.\n * @returns View selection.\n */\n domSelectionToView(domSelection) {\n // DOM selection might be placed in fake selection container.\n // If container contains fake selection - return corresponding view selection.\n if (domSelection.rangeCount === 1) {\n let container = domSelection.getRangeAt(0).startContainer;\n // The DOM selection might be moved to the text node inside the fake selection container.\n if (isText(container)) {\n container = container.parentNode;\n }\n const viewSelection = this.fakeSelectionToView(container);\n if (viewSelection) {\n return viewSelection;\n }\n }\n const isBackward = this.isDomSelectionBackward(domSelection);\n const viewRanges = [];\n for (let i = 0; i < domSelection.rangeCount; i++) {\n // DOM Range have correct start and end, no matter what is the DOM Selection direction. So we don't have to fix anything.\n const domRange = domSelection.getRangeAt(i);\n const viewRange = this.domRangeToView(domRange);\n if (viewRange) {\n viewRanges.push(viewRange);\n }\n }\n return new ViewSelection(viewRanges, { backward: isBackward });\n }\n /**\n * Converts DOM Range to view {@link module:engine/view/range~Range}.\n * If the start or end position can not be converted `null` is returned.\n *\n * @param domRange DOM range.\n * @returns View range.\n */\n domRangeToView(domRange) {\n const viewStart = this.domPositionToView(domRange.startContainer, domRange.startOffset);\n const viewEnd = this.domPositionToView(domRange.endContainer, domRange.endOffset);\n if (viewStart && viewEnd) {\n return new ViewRange(viewStart, viewEnd);\n }\n return null;\n }\n /**\n * Converts DOM parent and offset to view {@link module:engine/view/position~Position}.\n *\n * If the position is inside a {@link module:engine/view/filler filler} which has no corresponding view node,\n * position of the filler will be converted and returned.\n *\n * If the position is inside DOM element rendered by {@link module:engine/view/uielement~UIElement}\n * that position will be converted to view position before that UIElement.\n *\n * If structures are too different and it is not possible to find corresponding position then `null` will be returned.\n *\n * @param domParent DOM position parent.\n * @param domOffset DOM position offset. You can skip it when converting the inline filler node.\n * @returns View position.\n */\n domPositionToView(domParent, domOffset = 0) {\n if (this.isBlockFiller(domParent)) {\n return this.domPositionToView(domParent.parentNode, indexOf(domParent));\n }\n // If position is somewhere inside UIElement or a RawElement - return position before that element.\n const viewElement = this.mapDomToView(domParent);\n if (viewElement && (viewElement.is('uiElement') || viewElement.is('rawElement'))) {\n return ViewPosition._createBefore(viewElement);\n }\n if (isText(domParent)) {\n if (isInlineFiller(domParent)) {\n return this.domPositionToView(domParent.parentNode, indexOf(domParent));\n }\n const viewParent = this.findCorrespondingViewText(domParent);\n let offset = domOffset;\n if (!viewParent) {\n return null;\n }\n if (startsWithFiller(domParent)) {\n offset -= INLINE_FILLER_LENGTH;\n offset = offset < 0 ? 0 : offset;\n }\n return new ViewPosition(viewParent, offset);\n }\n // domParent instanceof HTMLElement.\n else {\n if (domOffset === 0) {\n const viewParent = this.mapDomToView(domParent);\n if (viewParent) {\n return new ViewPosition(viewParent, 0);\n }\n }\n else {\n const domBefore = domParent.childNodes[domOffset - 1];\n // Jump over an inline filler (and also on Firefox jump over a block filler while pressing backspace in an empty paragraph).\n if (isText(domBefore) && isInlineFiller(domBefore) || domBefore && this.isBlockFiller(domBefore)) {\n return this.domPositionToView(domBefore.parentNode, indexOf(domBefore));\n }\n const viewBefore = isText(domBefore) ?\n this.findCorrespondingViewText(domBefore) :\n this.mapDomToView(domBefore);\n // TODO #663\n if (viewBefore && viewBefore.parent) {\n return new ViewPosition(viewBefore.parent, viewBefore.index + 1);\n }\n }\n return null;\n }\n }\n /**\n * Returns corresponding view {@link module:engine/view/element~Element Element} or\n * {@link module:engine/view/documentfragment~DocumentFragment} for provided DOM element or\n * document fragment. If there is no view item {@link module:engine/view/domconverter~DomConverter#bindElements bound}\n * to the given DOM - `undefined` is returned.\n *\n * For all DOM elements rendered by a {@link module:engine/view/uielement~UIElement} or\n * a {@link module:engine/view/rawelement~RawElement}, the parent `UIElement` or `RawElement` will be returned.\n *\n * @param domElementOrDocumentFragment DOM element or document fragment.\n * @returns Corresponding view element, document fragment or `undefined` if no element was bound.\n */\n mapDomToView(domElementOrDocumentFragment) {\n const hostElement = this.getHostViewElement(domElementOrDocumentFragment);\n return hostElement || this._domToViewMapping.get(domElementOrDocumentFragment);\n }\n /**\n * Finds corresponding text node. Text nodes are not {@link module:engine/view/domconverter~DomConverter#bindElements bound},\n * corresponding text node is returned based on the sibling or parent.\n *\n * If the directly previous sibling is a {@link module:engine/view/domconverter~DomConverter#bindElements bound} element, it is used\n * to find the corresponding text node.\n *\n * If this is a first child in the parent and the parent is a {@link module:engine/view/domconverter~DomConverter#bindElements bound}\n * element, it is used to find the corresponding text node.\n *\n * For all text nodes rendered by a {@link module:engine/view/uielement~UIElement} or\n * a {@link module:engine/view/rawelement~RawElement}, the parent `UIElement` or `RawElement` will be returned.\n *\n * Otherwise `null` is returned.\n *\n * Note that for the block or inline {@link module:engine/view/filler filler} this method returns `null`.\n *\n * @param domText DOM text node.\n * @returns Corresponding view text node or `null`, if it was not possible to find a corresponding node.\n */\n findCorrespondingViewText(domText) {\n if (isInlineFiller(domText)) {\n return null;\n }\n // If DOM text was rendered by a UIElement or a RawElement - return this parent element.\n const hostElement = this.getHostViewElement(domText);\n if (hostElement) {\n return hostElement;\n }\n const previousSibling = domText.previousSibling;\n // Try to use previous sibling to find the corresponding text node.\n if (previousSibling) {\n if (!(this.isElement(previousSibling))) {\n // The previous is text or comment.\n return null;\n }\n const viewElement = this.mapDomToView(previousSibling);\n if (viewElement) {\n const nextSibling = viewElement.nextSibling;\n // It might be filler which has no corresponding view node.\n if (nextSibling instanceof ViewText) {\n return nextSibling;\n }\n else {\n return null;\n }\n }\n }\n // Try to use parent to find the corresponding text node.\n else {\n const viewElement = this.mapDomToView(domText.parentNode);\n if (viewElement) {\n const firstChild = viewElement.getChild(0);\n // It might be filler which has no corresponding view node.\n if (firstChild instanceof ViewText) {\n return firstChild;\n }\n else {\n return null;\n }\n }\n }\n return null;\n }\n mapViewToDom(documentFragmentOrElement) {\n return this._viewToDomMapping.get(documentFragmentOrElement);\n }\n /**\n * Finds corresponding text node. Text nodes are not {@link module:engine/view/domconverter~DomConverter#bindElements bound},\n * corresponding text node is returned based on the sibling or parent.\n *\n * If the directly previous sibling is a {@link module:engine/view/domconverter~DomConverter#bindElements bound} element, it is used\n * to find the corresponding text node.\n *\n * If this is a first child in the parent and the parent is a {@link module:engine/view/domconverter~DomConverter#bindElements bound}\n * element, it is used to find the corresponding text node.\n *\n * Otherwise `null` is returned.\n *\n * @param viewText View text node.\n * @returns Corresponding DOM text node or `null`, if it was not possible to find a corresponding node.\n */\n findCorrespondingDomText(viewText) {\n const previousSibling = viewText.previousSibling;\n // Try to use previous sibling to find the corresponding text node.\n if (previousSibling && this.mapViewToDom(previousSibling)) {\n return this.mapViewToDom(previousSibling).nextSibling;\n }\n // If this is a first node, try to use parent to find the corresponding text node.\n if (!previousSibling && viewText.parent && this.mapViewToDom(viewText.parent)) {\n return this.mapViewToDom(viewText.parent).childNodes[0];\n }\n return null;\n }\n /**\n * Focuses DOM editable that is corresponding to provided {@link module:engine/view/editableelement~EditableElement}.\n */\n focus(viewEditable) {\n const domEditable = this.mapViewToDom(viewEditable);\n if (domEditable && domEditable.ownerDocument.activeElement !== domEditable) {\n // Save the scrollX and scrollY positions before the focus.\n const { scrollX, scrollY } = global.window;\n const scrollPositions = [];\n // Save all scrollLeft and scrollTop values starting from domEditable up to\n // document#documentElement.\n forEachDomElementAncestor(domEditable, node => {\n const { scrollLeft, scrollTop } = node;\n scrollPositions.push([scrollLeft, scrollTop]);\n });\n domEditable.focus();\n // Restore scrollLeft and scrollTop values starting from domEditable up to\n // document#documentElement.\n // https://github.com/ckeditor/ckeditor5-engine/issues/951\n // https://github.com/ckeditor/ckeditor5-engine/issues/957\n forEachDomElementAncestor(domEditable, node => {\n const [scrollLeft, scrollTop] = scrollPositions.shift();\n node.scrollLeft = scrollLeft;\n node.scrollTop = scrollTop;\n });\n // Restore the scrollX and scrollY positions after the focus.\n // https://github.com/ckeditor/ckeditor5-engine/issues/951\n global.window.scrollTo(scrollX, scrollY);\n }\n }\n /**\n * Returns `true` when `node.nodeType` equals `Node.ELEMENT_NODE`.\n *\n * @param node Node to check.\n */\n isElement(node) {\n return node && node.nodeType == Node.ELEMENT_NODE;\n }\n /**\n * Returns `true` when `node.nodeType` equals `Node.DOCUMENT_FRAGMENT_NODE`.\n *\n * @param node Node to check.\n */\n isDocumentFragment(node) {\n return node && node.nodeType == Node.DOCUMENT_FRAGMENT_NODE;\n }\n /**\n * Checks if the node is an instance of the block filler for this DOM converter.\n *\n * ```ts\n * const converter = new DomConverter( viewDocument, { blockFillerMode: 'br' } );\n *\n * converter.isBlockFiller( BR_FILLER( document ) ); // true\n * converter.isBlockFiller( NBSP_FILLER( document ) ); // false\n * ```\n *\n * **Note:**: For the `'nbsp'` mode the method also checks context of a node so it cannot be a detached node.\n *\n * **Note:** A special case in the `'nbsp'` mode exists where the `<br>` in `<p><br></p>` is treated as a block filler.\n *\n * @param domNode DOM node to check.\n * @returns True if a node is considered a block filler for given mode.\n */\n isBlockFiller(domNode) {\n if (this.blockFillerMode == 'br') {\n return domNode.isEqualNode(BR_FILLER_REF);\n }\n // Special case for <p><br></p> in which <br> should be treated as filler even when we are not in the 'br' mode. See ckeditor5#5564.\n if (domNode.tagName === 'BR' &&\n hasBlockParent(domNode, this.blockElements) &&\n domNode.parentNode.childNodes.length === 1) {\n return true;\n }\n // If not in 'br' mode, try recognizing both marked and regular nbsp block fillers.\n return domNode.isEqualNode(MARKED_NBSP_FILLER_REF) || isNbspBlockFiller(domNode, this.blockElements);\n }\n /**\n * Returns `true` if given selection is a backward selection, that is, if it's `focus` is before `anchor`.\n *\n * @param DOM Selection instance to check.\n */\n isDomSelectionBackward(selection) {\n if (selection.isCollapsed) {\n return false;\n }\n // Since it takes multiple lines of code to check whether a \"DOM Position\" is before/after another \"DOM Position\",\n // we will use the fact that range will collapse if it's end is before it's start.\n const range = this._domDocument.createRange();\n try {\n range.setStart(selection.anchorNode, selection.anchorOffset);\n range.setEnd(selection.focusNode, selection.focusOffset);\n }\n catch (e) {\n // Safari sometimes gives us a selection that makes Range.set{Start,End} throw.\n // See https://github.com/ckeditor/ckeditor5/issues/12375.\n return false;\n }\n const backward = range.collapsed;\n range.detach();\n return backward;\n }\n /**\n * Returns a parent {@link module:engine/view/uielement~UIElement} or {@link module:engine/view/rawelement~RawElement}\n * that hosts the provided DOM node. Returns `null` if there is no such parent.\n */\n getHostViewElement(domNode) {\n const ancestors = getAncestors(domNode);\n // Remove domNode from the list.\n ancestors.pop();\n while (ancestors.length) {\n const domNode = ancestors.pop();\n const viewNode = this._domToViewMapping.get(domNode);\n if (viewNode && (viewNode.is('uiElement') || viewNode.is('rawElement'))) {\n return viewNode;\n }\n }\n return null;\n }\n /**\n * Checks if the given selection's boundaries are at correct places.\n *\n * The following places are considered as incorrect for selection boundaries:\n *\n * * before or in the middle of an inline filler sequence,\n * * inside a DOM element which represents {@link module:engine/view/uielement~UIElement a view UI element},\n * * inside a DOM element which represents {@link module:engine/view/rawelement~RawElement a view raw element}.\n *\n * @param domSelection The DOM selection object to be checked.\n * @returns `true` if the given selection is at a correct place, `false` otherwise.\n */\n isDomSelectionCorrect(domSelection) {\n return this._isDomSelectionPositionCorrect(domSelection.anchorNode, domSelection.anchorOffset) &&\n this._isDomSelectionPositionCorrect(domSelection.focusNode, domSelection.focusOffset);\n }\n /**\n * Registers a {@link module:engine/view/matcher~MatcherPattern} for view elements whose content should be treated as raw data\n * and not processed during the conversion from DOM nodes to view elements.\n *\n * This is affecting how {@link module:engine/view/domconverter~DomConverter#domToView} and\n * {@link module:engine/view/domconverter~DomConverter#domChildrenToView} process DOM nodes.\n *\n * The raw data can be later accessed by a\n * {@link module:engine/view/element~Element#getCustomProperty custom property of a view element} called `\"$rawContent\"`.\n *\n * @param pattern Pattern matching a view element whose content should\n * be treated as raw data.\n */\n registerRawContentMatcher(pattern) {\n this._rawContentElementMatcher.add(pattern);\n }\n /**\n * Returns the block {@link module:engine/view/filler filler} node based on the current {@link #blockFillerMode} setting.\n */\n _getBlockFiller() {\n switch (this.blockFillerMode) {\n case 'nbsp':\n return NBSP_FILLER(this._domDocument); // eslint-disable-line new-cap\n case 'markedNbsp':\n return MARKED_NBSP_FILLER(this._domDocument); // eslint-disable-line new-cap\n case 'br':\n return BR_FILLER(this._domDocument); // eslint-disable-line new-cap\n }\n }\n /**\n * Checks if the given DOM position is a correct place for selection boundary. See {@link #isDomSelectionCorrect}.\n *\n * @param domParent Position parent.\n * @param offset Position offset.\n * @returns `true` if given position is at a correct place for selection boundary, `false` otherwise.\n */\n _isDomSelectionPositionCorrect(domParent, offset) {\n // If selection is before or in the middle of inline filler string, it is incorrect.\n if (isText(domParent) && startsWithFiller(domParent) && offset < INLINE_FILLER_LENGTH) {\n // Selection in a text node, at wrong position (before or in the middle of filler).\n return false;\n }\n if (this.isElement(domParent) && startsWithFiller(domParent.childNodes[offset])) {\n // Selection in an element node, before filler text node.\n return false;\n }\n const viewParent = this.mapDomToView(domParent);\n // The position is incorrect when anchored inside a UIElement or a RawElement.\n // Note: In case of UIElement and RawElement, mapDomToView() returns a parent element for any DOM child\n // so there's no need to perform any additional checks.\n if (viewParent && (viewParent.is('uiElement') || viewParent.is('rawElement'))) {\n return false;\n }\n return true;\n }\n /**\n * Takes text data from a given {@link module:engine/view/text~Text#data} and processes it so\n * it is correctly displayed in the DOM.\n *\n * Following changes are done:\n *\n * * a space at the beginning is changed to `&nbsp;` if this is the first text node in its container\n * element or if a previous text node ends with a space character,\n * * space at the end of the text node is changed to `&nbsp;` if there are two spaces at the end of a node or if next node\n * starts with a space or if it is the last text node in its container,\n * * remaining spaces are replaced to a chain of spaces and `&nbsp;` (e.g. `'x x'` becomes `'x &nbsp; x'`).\n *\n * Content of {@link #preElements} is not processed.\n *\n * @param node View text node to process.\n * @returns Processed text data.\n */\n _processDataFromViewText(node) {\n let data = node.data;\n // If any of node ancestors has a name which is in `preElements` array, then currently processed\n // view text node is (will be) in preformatted element. We should not change whitespaces then.\n if (node.getAncestors().some(parent => this.preElements.includes(parent.name))) {\n return data;\n }\n // 1. Replace the first space with a nbsp if the previous node ends with a space or there is no previous node\n // (container element boundary).\n if (data.charAt(0) == ' ') {\n const prevNode = this._getTouchingInlineViewNode(node, false);\n const prevEndsWithSpace = prevNode && prevNode.is('$textProxy') && this._nodeEndsWithSpace(prevNode);\n if (prevEndsWithSpace || !prevNode) {\n data = '\\u00A0' + data.substr(1);\n }\n }\n // 2. Replace the last space with nbsp if there are two spaces at the end or if the next node starts with space or there is no\n // next node (container element boundary).\n //\n // Keep in mind that Firefox prefers $nbsp; before tag, not inside it:\n //\n // Foo <span>&nbsp;bar</span> <-- bad.\n // Foo&nbsp;<span> bar</span> <-- good.\n //\n // More here: https://github.com/ckeditor/ckeditor5-engine/issues/1747.\n if (data.charAt(data.length - 1) == ' ') {\n const nextNode = this._getTouchingInlineViewNode(node, true);\n const nextStartsWithSpace = nextNode && nextNode.is('$textProxy') && nextNode.data.charAt(0) == ' ';\n if (data.charAt(data.length - 2) == ' ' || !nextNode || nextStartsWithSpace) {\n data = data.substr(0, data.length - 1) + '\\u00A0';\n }\n }\n // 3. Create space+nbsp pairs.\n return data.replace(/ {2}/g, ' \\u00A0');\n }\n /**\n * Checks whether given node ends with a space character after changing appropriate space characters to `&nbsp;`s.\n *\n * @param node Node to check.\n * @returns `true` if given `node` ends with space, `false` otherwise.\n */\n _nodeEndsWithSpace(node) {\n if (node.getAncestors().some(parent => this.preElements.includes(parent.name))) {\n return false;\n }\n const data = this._processDataFromViewText(node);\n return data.charAt(data.length - 1) == ' ';\n }\n /**\n * Takes text data from native `Text` node and processes it to a correct {@link module:engine/view/text~Text view text node} data.\n *\n * Following changes are done:\n *\n * * multiple whitespaces are replaced to a single space,\n * * space at the beginning of a text node is removed if it is the first text node in its container\n * element or if the previous text node ends with a space character,\n * * space at the end of the text node is removed if there are two spaces at the end of a node or if next node\n * starts with a space or if it is the last text node in its container\n * * nbsps are converted to spaces.\n *\n * @param node DOM text node to process.\n * @returns Processed data.\n */\n _processDataFromDomText(node) {\n let data = node.data;\n if (_hasDomParentOfType(node, this.preElements)) {\n return getDataWithoutFiller(node);\n }\n // Change all consecutive whitespace characters (from the [ \\n\\t\\r] set \n // see https://github.com/ckeditor/ckeditor5-engine/issues/822#issuecomment-311670249) to a single space character.\n // That's how multiple whitespaces are treated when rendered, so we normalize those whitespaces.\n // We're replacing 1+ (and not 2+) to also normalize singular \\n\\t\\r characters (#822).\n data = data.replace(/[ \\n\\t\\r]{1,}/g, ' ');\n const prevNode = this._getTouchingInlineDomNode(node, false);\n const nextNode = this._getTouchingInlineDomNode(node, true);\n const shouldLeftTrim = this._checkShouldLeftTrimDomText(node, prevNode);\n const shouldRightTrim = this._checkShouldRightTrimDomText(node, nextNode);\n // If the previous dom text node does not exist or it ends by whitespace character, remove space character from the beginning\n // of this text node. Such space character is treated as a whitespace.\n if (shouldLeftTrim) {\n data = data.replace(/^ /, '');\n }\n // If the next text node does not exist remove space character from the end of this text node.\n if (shouldRightTrim) {\n data = data.replace(/ $/, '');\n }\n // At the beginning and end of a block element, Firefox inserts normal space + <br> instead of non-breaking space.\n // This means that the text node starts/end with normal space instead of non-breaking space.\n // This causes a problem because the normal space would be removed in `.replace` calls above. To prevent that,\n // the inline filler is removed only after the data is initially processed (by the `.replace` above). See ckeditor5#692.\n data = getDataWithoutFiller(new Text(data));\n // At this point we should have removed all whitespaces from DOM text data.\n //\n // Now, We will reverse the process that happens in `_processDataFromViewText`.\n //\n // We have to change &nbsp; chars, that were in DOM text data because of rendering reasons, to spaces.\n // First, change all ` \\u00A0` pairs (space + &nbsp;) to two spaces. DOM converter changes two spaces from model/view to\n // ` \\u00A0` to ensure proper rendering. Since here we convert back, we recognize those pairs and change them back to ` `.\n data = data.replace(/ \\u00A0/g, ' ');\n const isNextNodeInlineObjectElement = nextNode && this.isElement(nextNode) && nextNode.tagName != 'BR';\n const isNextNodeStartingWithSpace = nextNode && isText(nextNode) && nextNode.data.charAt(0) == ' ';\n // Then, let's change the last nbsp to a space.\n if (/( |\\u00A0)\\u00A0$/.test(data) || !nextNode || isNextNodeInlineObjectElement || isNextNodeStartingWithSpace) {\n data = data.replace(/\\u00A0$/, ' ');\n }\n // Then, change &nbsp; character that is at the beginning of the text node to space character.\n // We do that replacement only if this is the first node or the previous node ends on whitespace character.\n if (shouldLeftTrim || prevNode && this.isElement(prevNode) && prevNode.tagName != 'BR') {\n data = data.replace(/^\\u00A0/, ' ');\n }\n // At this point, all whitespaces should be removed and all &nbsp; created for rendering reasons should be\n // changed to normal space. All left &nbsp; are &nbsp; inserted intentionally.\n return data;\n }\n /**\n * Helper function which checks if a DOM text node, preceded by the given `prevNode` should\n * be trimmed from the left side.\n *\n * @param prevNode Either DOM text or `<br>` or one of `#inlineObjectElements`.\n */\n _checkShouldLeftTrimDomText(node, prevNode) {\n if (!prevNode) {\n return true;\n }\n if (this.isElement(prevNode)) {\n return prevNode.tagName === 'BR';\n }\n // Shouldn't left trim if previous node is a node that was encountered as a raw content node.\n if (this._encounteredRawContentDomNodes.has(node.previousSibling)) {\n return false;\n }\n return /[^\\S\\u00A0]/.test(prevNode.data.charAt(prevNode.data.length - 1));\n }\n /**\n * Helper function which checks if a DOM text node, succeeded by the given `nextNode` should\n * be trimmed from the right side.\n *\n * @param nextNode Either DOM text or `<br>` or one of `#inlineObjectElements`.\n */\n _checkShouldRightTrimDomText(node, nextNode) {\n if (nextNode) {\n return false;\n }\n return !startsWithFiller(node);\n }\n /**\n * Helper function. For given {@link module:engine/view/text~Text view text node}, it finds previous or next sibling\n * that is contained in the same container element. If there is no such sibling, `null` is returned.\n *\n * @param node Reference node.\n * @returns Touching text node, an inline object\n * or `null` if there is no next or previous touching text node.\n */\n _getTouchingInlineViewNode(node, getNext) {\n const treeWalker = new ViewTreeWalker({\n startPosition: getNext ? ViewPosition._createAfter(node) : ViewPosition._createBefore(node),\n direction: getNext ? 'forward' : 'backward'\n });\n for (const value of treeWalker) {\n // Found an inline object (for example an image).\n if (value.item.is('element') && this.inlineObjectElements.includes(value.item.name)) {\n return value.item;\n }\n // ViewContainerElement is found on a way to next ViewText node, so given `node` was first/last\n // text node in its container element.\n else if (value.item.is('containerElement')) {\n return null;\n }\n // <br> found it works like a block boundary, so do not scan further.\n else if (value.item.is('element', 'br')) {\n return null;\n }\n // Found a text node in the same container element.\n else if (value.item.is('$textProxy')) {\n return value.item;\n }\n }\n return null;\n }\n /**\n * Helper function. For the given text node, it finds the closest touching node which is either\n * a text, `<br>` or an {@link #inlineObjectElements inline object}.\n *\n * If no such node is found, `null` is returned.\n *\n * For instance, in the following DOM structure:\n *\n * ```html\n * <p>foo<b>bar</b><br>bom</p>\n * ```\n *\n * * `foo` doesn't have its previous touching inline node (`null` is returned),\n * * `foo`'s next touching inline node is `bar`\n * * `bar`'s next touching inline node is `<br>`\n *\n * This method returns text nodes and `<br>` elements because these types of nodes affect how\n * spaces in the given text node need to be converted.\n */\n _getTouchingInlineDomNode(node, getNext) {\n if (!node.parentNode) {\n return null;\n }\n const stepInto = getNext ? 'firstChild' : 'lastChild';\n const stepOver = getNext ? 'nextSibling' : 'previousSibling';\n let skipChildren = true;\n let returnNode = node;\n do {\n if (!skipChildren && returnNode[stepInto]) {\n returnNode = returnNode[stepInto];\n }\n else if (returnNode[stepOver]) {\n returnNode = returnNode[stepOver];\n skipChildren = false;\n }\n else {\n returnNode = returnNode.parentNode;\n skipChildren = true;\n }\n if (!returnNode || this._isBlockElement(returnNode)) {\n return null;\n }\n } while (!(isText(returnNode) || returnNode.tagName == 'BR' || this._isInlineObjectElement(returnNode)));\n return returnNode;\n }\n /**\n * Returns `true` if a DOM node belongs to {@link #blockElements}. `false` otherwise.\n */\n _isBlockElement(node) {\n return this.isElement(node) && this.blockElements.includes(node.tagName.toLowerCase());\n }\n /**\n * Returns `true` if a DOM node belongs to {@link #inlineObjectElements}. `false` otherwise.\n */\n _isInlineObjectElement(node) {\n return this.isElement(node) && this.inlineObjectElements.includes(node.tagName.toLowerCase());\n }\n /**\n * Creates view element basing on the node type.\n *\n * @param node DOM node to check.\n * @param options Conversion options. See {@link module:engine/view/domconverter~DomConverter#domToView} options parameter.\n */\n _createViewElement(node, options) {\n if (isComment(node)) {\n return new ViewUIElement(this.document, '$comment');\n }\n const viewName = options.keepOriginalCase ? node.tagName : node.tagName.toLowerCase();\n return new ViewElement(this.document, viewName);\n }\n /**\n * Checks if view element's content should be treated as a raw data.\n *\n * @param viewElement View element to check.\n * @param options Conversion options. See {@link module:engine/view/domconverter~DomConverter#domToView} options parameter.\n */\n _isViewElementWithRawContent(viewElement, options) {\n return options.withChildren !== false && !!this._rawContentElementMatcher.match(viewElement);\n }\n /**\n * Checks whether a given element name should be renamed in a current rendering mode.\n *\n * @param elementName The name of view element.\n */\n _shouldRenameElement(elementName) {\n const name = elementName.toLowerCase();\n return this.renderingMode === 'editing' && this.unsafeElements.includes(name);\n }\n /**\n * Return a <span> element with a special attribute holding the name of the original element.\n * Optionally, copy all the attributes of the original element if that element is provided.\n *\n * @param elementName The name of view element.\n * @param originalDomElement The original DOM element to copy attributes and content from.\n */\n _createReplacementDomElement(elementName, originalDomElement) {\n const newDomElement = this._domDocument.createElement('span');\n // Mark the span replacing a script as hidden.\n newDomElement.setAttribute(UNSAFE_ELEMENT_REPLACEMENT_ATTRIBUTE, elementName);\n if (originalDomElement) {\n while (originalDomElement.firstChild) {\n newDomElement.appendChild(originalDomElement.firstChild);\n }\n for (const attributeName of originalDomElement.getAttributeNames()) {\n newDomElement.setAttribute(attributeName, originalDomElement.getAttribute(attributeName));\n }\n }\n return newDomElement;\n }\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 * @returns`true` if such parent exists or `false` if it does not.\n */\nfunction _hasDomParentOfType(node, types) {\n const parents = getAncestors(node);\n return parents.some(parent => parent.tagName && types.includes(parent.tagName.toLowerCase()));\n}\n/**\n * A helper that executes given callback for each DOM node's ancestor, starting from the given node\n * and ending in document#documentElement.\n *\n * @param callback A callback to be executed for each ancestor.\n */\nfunction forEachDomElementAncestor(element, callback) {\n let node = element;\n while (node) {\n callback(node);\n node = node.parentElement;\n }\n}\n/**\n * Checks if given node is a nbsp block filler.\n *\n * A &nbsp; is a block filler only if it is a single child of a block element.\n *\n * @param domNode DOM node.\n */\nfunction isNbspBlockFiller(domNode, blockElements) {\n const isNBSP = domNode.isEqualNode(NBSP_FILLER_REF);\n return isNBSP && hasBlockParent(domNode, blockElements) && domNode.parentNode.childNodes.length === 1;\n}\n/**\n * Checks if domNode has block parent.\n *\n * @param domNode DOM node.\n */\nfunction hasBlockParent(domNode, blockElements) {\n const parent = domNode.parentNode;\n return !!parent && !!parent.tagName && blockElements.includes(parent.tagName.toLowerCase());\n}\n/**\n * Log to console the information about element that was replaced.\n * Check UNSAFE_ELEMENTS for all recognized unsafe elements.\n *\n * @param elementName The name of the view element.\n */\nfunction _logUnsafeElement(elementName) {\n if (elementName === 'script') {\n logWarning('domconverter-unsafe-script-element-detected');\n }\n if (elementName === 'style') {\n logWarning('domconverter-unsafe-style-element-detected');\n }\n}\n/**\n * While rendering the editor content, the {@link module:engine/view/domconverter~DomConverter} detected a `<script>` element that may\n * disrupt the editing experience. To avoid this, the `<script>` element was replaced with `<span data-ck-unsafe-element=\"script\"></span>`.\n *\n * @error domconverter-unsafe-script-element-detected\n */\n/**\n * While rendering the editor content, the {@link module:engine/view/domconverter~DomConverter} detected a `<style>` element that may affect\n * the editing experience. To avoid this, the `<style>` element was replaced with `<span data-ck-unsafe-element=\"style\"></span>`.\n *\n * @error domconverter-unsafe-style-element-detected\n */\n/**\n * The {@link module:engine/view/domconverter~DomConverter} detected an interactive attribute in the\n * {@glink framework/architecture/editing-engine#editing-pipeline editing pipeline}. For the best\n * editing experience, the attribute was renamed to `data-ck-unsafe-attribute-[original attribute name]`.\n *\n * If you are the author of the plugin that generated this attribute and you want it to be preserved\n * in the editing pipeline, you can configure this when creating the element\n * using {@link module:engine/view/downcastwriter~DowncastWriter} during the\n * {@glink framework/architecture/editing-engine#conversion modelview conversion}. Methods such as\n * {@link module:engine/view/downcastwriter~DowncastWriter#createContainerElement},\n * {@link module:engine/view/downcastwriter~DowncastWriter#createAttributeElement}, or\n * {@link module:engine/view/downcastwriter~DowncastWriter#createEmptyElement}\n * accept an option that will disable filtering of specific attributes:\n *\n * ```ts\n * const paragraph = writer.createContainerElement( 'p',\n * \t{\n * \t\tclass: 'clickable-paragraph',\n * \t\tonclick: 'alert( \"Paragraph clicked!\" )'\n * \t},\n * \t{\n * \t\t// Make sure the \"onclick\" attribute will pass through.\n * \t\trenderUnsafeAttributes: [ 'onclick' ]\n * \t}\n * );\n * ```\n *\n * @error domconverter-unsafe-attribute-detected\n * @param domElement The DOM element the attribute was set on.\n * @param key The original name of the attribute\n * @param value The value of the original attribute\n */\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/observer\n */\nimport { DomEmitterMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * Abstract base observer class. Observers are classes which listen to DOM events, do the preliminary\n * processing and fire events on the {@link module:engine/view/document~Document} objects.\n * Observers can also add features to the view, for instance by updating its status or marking elements\n * which need a refresh on DOM events.\n */\nexport default class Observer extends DomEmitterMixin() {\n /**\n * Creates an instance of the observer.\n */\n constructor(view) {\n super();\n /**\n * The state of the observer. If it is disabled, no events will be fired.\n */\n this._isEnabled = false;\n this.view = view;\n this.document = view.document;\n }\n /**\n * The state of the observer. If it is disabled, no events will be fired.\n */\n get isEnabled() {\n return this._isEnabled;\n }\n /**\n * Enables the observer. This method is called when the observer is registered to the\n * {@link module:engine/view/view~View} and after {@link module:engine/view/view~View#forceRender rendering}\n * (all observers are {@link #disable disabled} before rendering).\n *\n * A typical use case for disabling observers is that mutation observers need to be disabled for the rendering.\n * However, a child class may not need to be disabled, so it can implement an empty method.\n *\n * @see module:engine/view/observer/observer~Observer#disable\n */\n enable() {\n this._isEnabled = true;\n }\n /**\n * Disables the observer. This method is called before\n * {@link module:engine/view/view~View#forceRender rendering} to prevent firing events during rendering.\n *\n * @see module:engine/view/observer/observer~Observer#enable\n */\n disable() {\n this._isEnabled = false;\n }\n /**\n * Disables and destroys the observer, among others removes event listeners created by the observer.\n */\n destroy() {\n this.disable();\n this.stopListening();\n }\n /**\n * Checks whether a given DOM event should be ignored (should not be turned into a synthetic view document event).\n *\n * Currently, an event will be ignored only if its target or any of its ancestors has the `data-cke-ignore-events` attribute.\n * This attribute can be used inside the structures generated by\n * {@link module:engine/view/downcastwriter~DowncastWriter#createUIElement `DowncastWriter#createUIElement()`} to ignore events\n * fired within a UI that should be excluded from CKEditor 5's realms.\n *\n * @param domTarget The DOM event target to check (usually an element, sometimes a text node and\n * potentially sometimes a document, too).\n * @returns Whether this event should be ignored by the observer.\n */\n checkShouldIgnoreEventFromTarget(domTarget) {\n if (domTarget && domTarget.nodeType === 3) {\n domTarget = domTarget.parentNode;\n }\n if (!domTarget || domTarget.nodeType !== 1) {\n return false;\n }\n return domTarget.matches('[data-cke-ignore-events], [data-cke-ignore-events] *');\n }\n}\n","import copyObject from './_copyObject.js';\nimport createAssigner from './_createAssigner.js';\nimport keysIn from './keysIn.js';\n\n/**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\nvar assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n});\n\nexport default assignIn;\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/domeventdata\n */\nimport { extend } from 'lodash-es';\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 *\n * @typeParam TEvent The type of DOM Event that this class represents.\n */\nexport default class DomEventData {\n /**\n * @param view The instance of the view controller.\n * @param domEvent The DOM event.\n * @param additionalData Additional properties that the instance should contain.\n */\n constructor(view, domEvent, additionalData) {\n this.view = view;\n this.document = view.document;\n this.domEvent = domEvent;\n this.domTarget = domEvent.target;\n extend(this, additionalData);\n }\n /**\n * The tree view element representing the target.\n */\n get target() {\n return this.view.domConverter.mapDomToView(this.domTarget);\n }\n /**\n * Prevents the native's event default action.\n */\n preventDefault() {\n this.domEvent.preventDefault();\n }\n /**\n * Stops native event propagation.\n */\n stopPropagation() {\n this.domEvent.stopPropagation();\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/domeventobserver\n */\nimport Observer from './observer';\nimport DomEventData from './domeventdata';\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 * ```ts\n * class ClickObserver extends DomEventObserver<'click'> {\n * \t// It can also be defined as a normal property in the constructor.\n * \tget domEventType(): 'click' {\n * \t\treturn 'click';\n * \t}\n *\n * \tonDomEvent( domEvent: MouseEvent ): void {\n * \t\tthis.fire( 'click', domEvent );\n * \t}\n * }\n * ```\n *\n * @typeParam EventType DOM Event type name or an union of those.\n * @typeParam AdditionalData Additional data passed along with the event.\n */\nexport default class DomEventObserver extends Observer {\n constructor() {\n super(...arguments);\n /**\n * If set to `true` DOM events will be listened on the capturing phase.\n * Default value is `false`.\n */\n this.useCapture = false;\n }\n /**\n * @inheritDoc\n */\n observe(domElement) {\n const types = typeof this.domEventType == 'string' ? [this.domEventType] : this.domEventType;\n types.forEach(type => {\n this.listenTo(domElement, type, (eventInfo, domEvent) => {\n if (this.isEnabled && !this.checkShouldIgnoreEventFromTarget(domEvent.target)) {\n this.onDomEvent(domEvent);\n }\n }, { useCapture: this.useCapture });\n });\n }\n /**\n * @inheritDoc\n */\n stopObserving(domElement) {\n this.stopListening(domElement);\n }\n /**\n * Calls `Document#fire()` if observer {@link #isEnabled is enabled}.\n *\n * @see module:utils/emittermixin~Emitter#fire\n * @param eventType The event type (name).\n * @param domEvent The DOM event.\n * @param additionalData The additional data which should extend the\n * {@link module:engine/view/observer/domeventdata~DomEventData event data} object.\n */\n fire(eventType, domEvent, additionalData) {\n if (this.isEnabled) {\n this.document.fire(eventType, new DomEventData(this.view, domEvent, additionalData));\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/keyobserver\n */\nimport DomEventObserver from './domeventobserver';\nimport { getCode } from '@ckeditor/ckeditor5-utils';\n/**\n * Observer for events connected with pressing keyboard keys.\n *\n * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.\n */\nexport default class KeyObserver extends DomEventObserver {\n constructor() {\n super(...arguments);\n /**\n * @inheritDoc\n */\n this.domEventType = ['keydown', 'keyup'];\n }\n /**\n * @inheritDoc\n */\n onDomEvent(domEvt) {\n const data = {\n keyCode: domEvt.keyCode,\n altKey: domEvt.altKey,\n ctrlKey: domEvt.ctrlKey,\n shiftKey: domEvt.shiftKey,\n metaKey: domEvt.metaKey,\n get keystroke() {\n return getCode(this);\n }\n };\n this.fire(domEvt.type, domEvt, data);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/fakeselectionobserver\n */\nimport Observer from './observer';\nimport ViewSelection from '../selection';\nimport { keyCodes } from '@ckeditor/ckeditor5-utils';\nimport { debounce } from 'lodash-es';\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 */\nexport default class FakeSelectionObserver extends Observer {\n /**\n * Creates new FakeSelectionObserver instance.\n */\n constructor(view) {\n super(view);\n this._fireSelectionChangeDoneDebounced = debounce(data => {\n this.document.fire('selectionChangeDone', data);\n }, 200);\n }\n /**\n * @inheritDoc\n */\n observe() {\n const document = this.document;\n document.on('arrowKey', (eventInfo, data) => {\n const selection = document.selection;\n if (selection.isFake && this.isEnabled) {\n // Prevents default key down handling - no selection change will occur.\n data.preventDefault();\n }\n }, { context: '$capture' });\n document.on('arrowKey', (eventInfo, data) => {\n const selection = document.selection;\n if (selection.isFake && this.isEnabled) {\n this._handleSelectionMove(data.keyCode);\n }\n }, { priority: 'lowest' });\n }\n /**\n * @inheritDoc\n */\n stopObserving() { }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this._fireSelectionChangeDoneDebounced.cancel();\n }\n /**\n * Handles collapsing view selection according to given key code. If left or up key is provided - new selection will be\n * collapsed to left. If right or down key is pressed - new selection will be collapsed to right.\n *\n * This method fires {@link module:engine/view/document~Document#event:selectionChange} and\n * {@link module:engine/view/document~Document#event:selectionChangeDone} events imitating behaviour of\n * {@link module:engine/view/observer/selectionobserver~SelectionObserver}.\n */\n _handleSelectionMove(keyCode) {\n const selection = this.document.selection;\n const newSelection = new ViewSelection(selection.getRanges(), { backward: selection.isBackward, fake: false });\n // Left or up arrow pressed - move selection to start.\n if (keyCode == keyCodes.arrowleft || keyCode == keyCodes.arrowup) {\n newSelection.setTo(newSelection.getFirstPosition());\n }\n // Right or down arrow pressed - move selection to end.\n if (keyCode == keyCodes.arrowright || keyCode == keyCodes.arrowdown) {\n newSelection.setTo(newSelection.getLastPosition());\n }\n const data = {\n oldSelection: selection,\n newSelection,\n domSelection: null\n };\n // Fire dummy selection change event.\n this.document.fire('selectionChange', data);\n // Call` #_fireSelectionChangeDoneDebounced` every time when `selectionChange` event is fired.\n // This function is debounced what means that `selectionChangeDone` event will be fired only when\n // defined int the function time will elapse since the last time the function was called.\n // So `selectionChangeDone` will be fired when selection will stop changing.\n this._fireSelectionChangeDoneDebounced(data);\n }\n}\n","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nexport default setCacheAdd;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nexport default setCacheHas;\n","import MapCache from './_MapCache.js';\nimport setCacheAdd from './_setCacheAdd.js';\nimport setCacheHas from './_setCacheHas.js';\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 == null ? 0 : values.length;\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 * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nexport default arraySome;\n","/**\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","import SetCache from './_SetCache.js';\nimport arraySome from './_arraySome.js';\nimport cacheHas from './_cacheHas.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nexport default equalArrays;\n","/**\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 * 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","import Symbol from './_Symbol.js';\nimport Uint8Array from './_Uint8Array.js';\nimport eq from './eq.js';\nimport equalArrays from './_equalArrays.js';\nimport mapToArray from './_mapToArray.js';\nimport setToArray from './_setToArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nexport default equalByTag;\n","import getAllKeys from './_getAllKeys.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\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 * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nexport default equalObjects;\n","import Stack from './_Stack.js';\nimport equalArrays from './_equalArrays.js';\nimport equalByTag from './_equalByTag.js';\nimport equalObjects from './_equalObjects.js';\nimport getTag from './_getTag.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\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 * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nexport default baseIsEqualDeep;\n","import baseIsEqualDeep from './_baseIsEqualDeep.js';\nimport isObjectLike from './isObjectLike.js';\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 {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\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, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nexport default baseIsEqual;\n","import baseIsEqual from './_baseIsEqual.js';\n\n/**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\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 * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\nfunction isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;\n}\n\nexport default isEqualWith;\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/mutationobserver\n */\n/* globals window */\nimport Observer from './observer';\nimport { startsWithFiller } from '../filler';\nimport { isEqualWith } from 'lodash-es';\n/**\n * Mutation observer's role is to watch for any DOM changes inside the editor that weren't\n * done by the editor's {@link module:engine/view/renderer~Renderer} itself and reverting these changes.\n *\n * It does this by observing all mutations in the DOM, marking related view elements as changed and calling\n * {@link module:engine/view/renderer~Renderer#render}. Because all mutated nodes are marked as\n * \"to be rendered\" and the {@link module:engine/view/renderer~Renderer#render `render()`} method is called,\n * all changes are reverted in the DOM (the DOM is synced with the editor's view structure).\n *\n * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.\n */\nexport default class MutationObserver extends Observer {\n /**\n * @inheritDoc\n */\n constructor(view) {\n super(view);\n this._config = {\n childList: true,\n characterData: true,\n subtree: true\n };\n this.domConverter = view.domConverter;\n this.renderer = view._renderer;\n this._domElements = new Set();\n this._mutationObserver = new window.MutationObserver(this._onMutations.bind(this));\n }\n /**\n * Synchronously handles mutations and empties the queue.\n */\n flush() {\n this._onMutations(this._mutationObserver.takeRecords());\n }\n /**\n * @inheritDoc\n */\n observe(domElement) {\n this._domElements.add(domElement);\n if (this.isEnabled) {\n this._mutationObserver.observe(domElement, this._config);\n }\n }\n /**\n * @inheritDoc\n */\n stopObserving(domElement) {\n this._domElements.delete(domElement);\n if (this.isEnabled) {\n // Unfortunately, it is not possible to stop observing particular DOM element.\n // In order to stop observing one of multiple DOM elements, we need to re-connect the mutation observer.\n this._mutationObserver.disconnect();\n for (const domElement of this._domElements) {\n this._mutationObserver.observe(domElement, this._config);\n }\n }\n }\n /**\n * @inheritDoc\n */\n enable() {\n super.enable();\n for (const domElement of this._domElements) {\n this._mutationObserver.observe(domElement, this._config);\n }\n }\n /**\n * @inheritDoc\n */\n disable() {\n super.disable();\n this._mutationObserver.disconnect();\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this._mutationObserver.disconnect();\n }\n /**\n * Handles mutations. Mark view elements to sync and call render.\n *\n * @param domMutations Array of native mutations.\n */\n _onMutations(domMutations) {\n // As a result of this.flush() we can have an empty collection.\n if (domMutations.length === 0) {\n return;\n }\n const domConverter = this.domConverter;\n // Use map and set for deduplication.\n const mutatedTextNodes = new Set();\n const elementsWithMutatedChildren = new Set();\n // Handle `childList` mutations first, so we will be able to check if the `characterData` mutation is in the\n // element with changed structure anyway.\n for (const mutation of domMutations) {\n const element = domConverter.mapDomToView(mutation.target);\n if (!element) {\n continue;\n }\n // Do not collect mutations from UIElements and RawElements.\n if (element.is('uiElement') || element.is('rawElement')) {\n continue;\n }\n if (mutation.type === 'childList' && !this._isBogusBrMutation(mutation)) {\n elementsWithMutatedChildren.add(element);\n }\n }\n // Handle `characterData` mutations later, when we have the full list of nodes which changed structure.\n for (const mutation of domMutations) {\n const element = domConverter.mapDomToView(mutation.target);\n // Do not collect mutations from UIElements and RawElements.\n if (element && (element.is('uiElement') || element.is('rawElement'))) {\n continue;\n }\n if (mutation.type === 'characterData') {\n const text = domConverter.findCorrespondingViewText(mutation.target);\n if (text && !elementsWithMutatedChildren.has(text.parent)) {\n mutatedTextNodes.add(text);\n }\n // When we added first letter to the text node which had only inline filler, for the DOM it is mutation\n // on text, but for the view, where filler text node did not exist, new text node was created, so we\n // need to handle it as a 'children' mutation instead of 'text'.\n else if (!text && startsWithFiller(mutation.target)) {\n elementsWithMutatedChildren.add(domConverter.mapDomToView(mutation.target.parentNode));\n }\n }\n }\n // Now we build the list of mutations to mark elements. We did not do it earlier to avoid marking the\n // same node multiple times in case of duplication.\n let hasMutations = false;\n for (const textNode of mutatedTextNodes) {\n hasMutations = true;\n this.renderer.markToSync('text', textNode);\n }\n for (const viewElement of elementsWithMutatedChildren) {\n const domElement = domConverter.mapViewToDom(viewElement);\n const viewChildren = Array.from(viewElement.getChildren());\n const newViewChildren = Array.from(domConverter.domChildrenToView(domElement, { withChildren: false }));\n // It may happen that as a result of many changes (sth was inserted and then removed),\n // both elements haven't really changed. #1031\n if (!isEqualWith(viewChildren, newViewChildren, sameNodes)) {\n hasMutations = true;\n this.renderer.markToSync('children', viewElement);\n }\n }\n // In case only non-relevant mutations were recorded it skips the event and force render (#5600).\n if (hasMutations) {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.group( '%c[MutationObserver]%c Mutations detected',\n // @if CK_DEBUG_TYPING // \t\t'font-weight:bold;color:green', ''\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n // At this point we have \"dirty DOM\" (changed) and de-synched view (which has not been changed).\n // In order to \"reset DOM\" we render the view again.\n this.view.forceRender();\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n }\n }\n /**\n * Checks if mutation was generated by the browser inserting bogus br on the end of the block element.\n * Such mutations are generated while pressing space or performing native spellchecker correction\n * on the end of the block element in Firefox browser.\n *\n * @param mutation Native mutation object.\n */\n _isBogusBrMutation(mutation) {\n let addedNode = null;\n // Check if mutation added only one node on the end of its parent.\n if (mutation.nextSibling === null && mutation.removedNodes.length === 0 && mutation.addedNodes.length == 1) {\n addedNode = this.domConverter.domToView(mutation.addedNodes[0], {\n withChildren: false\n });\n }\n return addedNode && addedNode.is('element', 'br');\n }\n}\nfunction sameNodes(child1, child2) {\n // First level of comparison (array of children vs array of children) use the Lodash's default behavior.\n if (Array.isArray(child1)) {\n return;\n }\n // Elements.\n if (child1 === child2) {\n return true;\n }\n // Texts.\n else if (child1.is('$text') && child2.is('$text')) {\n return child1.data === child2.data;\n }\n // Not matching types.\n return false;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/focusobserver\n */\n/* globals setTimeout, clearTimeout */\nimport DomEventObserver from './domeventobserver';\n/**\n * {@link module:engine/view/document~Document#event:focus Focus}\n * and {@link module:engine/view/document~Document#event:blur blur} events observer.\n * Focus observer handle also {@link module:engine/view/rooteditableelement~RootEditableElement#isFocused isFocused} property of the\n * {@link module:engine/view/rooteditableelement~RootEditableElement root elements}.\n *\n * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.\n */\nexport default class FocusObserver extends DomEventObserver {\n /**\n * @inheritDoc\n */\n constructor(view) {\n super(view);\n /**\n * Set to `true` if the document is in the process of setting the focus.\n *\n * The flag is used to indicate that setting the focus is in progress.\n */\n this._isFocusChanging = false;\n /**\n * @inheritDoc\n */\n this.domEventType = ['focus', 'blur'];\n this.useCapture = true;\n const document = this.document;\n document.on('focus', () => {\n this._isFocusChanging = true;\n // Unfortunately native `selectionchange` event is fired asynchronously.\n // We need to wait until `SelectionObserver` handle the event and then render. Otherwise rendering will\n // overwrite new DOM selection with selection from the view.\n // See https://github.com/ckeditor/ckeditor5-engine/issues/795 for more details.\n // Long timeout is needed to solve #676 and https://github.com/ckeditor/ckeditor5-engine/issues/1157 issues.\n //\n // Using `view.change()` instead of `view.forceRender()` to prevent double rendering\n // in a situation where `selectionchange` already caused selection change.\n this._renderTimeoutId = setTimeout(() => {\n this.flush();\n view.change(() => { });\n }, 50);\n });\n document.on('blur', (evt, data) => {\n const selectedEditable = document.selection.editableElement;\n if (selectedEditable === null || selectedEditable === data.target) {\n document.isFocused = false;\n this._isFocusChanging = false;\n // Re-render the document to update view elements\n // (changing document.isFocused already marked view as changed since last rendering).\n view.change(() => { });\n }\n });\n }\n /**\n * Finishes setting the document focus state.\n */\n flush() {\n if (this._isFocusChanging) {\n this._isFocusChanging = false;\n this.document.isFocused = true;\n }\n }\n /**\n * @inheritDoc\n */\n onDomEvent(domEvent) {\n this.fire(domEvent.type, domEvent);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n if (this._renderTimeoutId) {\n clearTimeout(this._renderTimeoutId);\n }\n super.destroy();\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/selectionobserver\n */\n/* global setInterval, clearInterval */\nimport Observer from './observer';\nimport MutationObserver from './mutationobserver';\nimport { env } from '@ckeditor/ckeditor5-utils';\nimport { debounce } from 'lodash-es';\nimport FocusObserver from './focusobserver';\n/**\n * Selection observer class observes selection changes in the document. If a selection changes on the document this\n * observer checks if the DOM selection is different from the {@link module:engine/view/document~Document#selection view selection}.\n * The selection observer fires {@link module:engine/view/document~Document#event:selectionChange} event only if\n * a selection change was the only change in the document and the DOM selection is different from the view selection.\n *\n * This observer also manages the {@link module:engine/view/document~Document#isSelecting} property of the view document.\n *\n * Note that this observer is attached by the {@link module:engine/view/view~View} and is available by default.\n */\nexport default class SelectionObserver extends Observer {\n constructor(view) {\n super(view);\n this.mutationObserver = view.getObserver(MutationObserver);\n this.focusObserver = view.getObserver(FocusObserver);\n this.selection = this.document.selection;\n this.domConverter = view.domConverter;\n this._documents = new WeakSet();\n this._fireSelectionChangeDoneDebounced = debounce(data => {\n this.document.fire('selectionChangeDone', data);\n }, 200);\n this._clearInfiniteLoopInterval = setInterval(() => this._clearInfiniteLoop(), 1000);\n this._documentIsSelectingInactivityTimeoutDebounced = debounce(() => (this.document.isSelecting = false), 5000);\n this._loopbackCounter = 0;\n }\n /**\n * @inheritDoc\n */\n observe(domElement) {\n const domDocument = domElement.ownerDocument;\n const startDocumentIsSelecting = () => {\n this.document.isSelecting = true;\n // Let's activate the safety timeout each time the document enters the \"is selecting\" state.\n this._documentIsSelectingInactivityTimeoutDebounced();\n };\n const endDocumentIsSelecting = () => {\n if (!this.document.isSelecting) {\n return;\n }\n // Make sure that model selection is up-to-date at the end of selecting process.\n // Sometimes `selectionchange` events could arrive after the `mouseup` event and that selection could be already outdated.\n this._handleSelectionChange(null, domDocument);\n this.document.isSelecting = false;\n // The safety timeout can be canceled when the document leaves the \"is selecting\" state.\n this._documentIsSelectingInactivityTimeoutDebounced.cancel();\n };\n // The document has the \"is selecting\" state while the user keeps making (extending) the selection\n // (e.g. by holding the mouse button and moving the cursor). The state resets when they either released\n // the mouse button or interrupted the process by pressing or releasing any key.\n this.listenTo(domElement, 'selectstart', startDocumentIsSelecting, { priority: 'highest' });\n this.listenTo(domElement, 'keydown', endDocumentIsSelecting, { priority: 'highest', useCapture: true });\n this.listenTo(domElement, 'keyup', endDocumentIsSelecting, { priority: 'highest', useCapture: true });\n // Add document-wide listeners only once. This method could be called for multiple editing roots.\n if (this._documents.has(domDocument)) {\n return;\n }\n // This listener is using capture mode to make sure that selection is upcasted before any other\n // handler would like to check it and update (for example table multi cell selection).\n this.listenTo(domDocument, 'mouseup', endDocumentIsSelecting, { priority: 'highest', useCapture: true });\n this.listenTo(domDocument, 'selectionchange', (evt, domEvent) => {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconst domSelection = domDocument.defaultView!.getSelection();\n // @if CK_DEBUG_TYPING // \tconsole.group( '%c[SelectionObserver]%c selectionchange', 'color:green', ''\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[SelectionObserver]%c DOM Selection:', 'font-weight:bold;color:green', '',\n // @if CK_DEBUG_TYPING // \t\t{ node: domSelection!.anchorNode, offset: domSelection!.anchorOffset },\n // @if CK_DEBUG_TYPING // \t\t{ node: domSelection!.focusNode, offset: domSelection!.focusOffset }\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n // The Renderer is disabled while composing on non-android browsers, so we can't update the view selection\n // because the DOM and view tree drifted apart. Position mapping could fail because of it.\n if (this.document.isComposing && !env.isAndroid) {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[SelectionObserver]%c Selection change ignored (isComposing)',\n // @if CK_DEBUG_TYPING // \t\t'font-weight:bold;color:green', ''\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n return;\n }\n this._handleSelectionChange(domEvent, domDocument);\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n // Defer the safety timeout when the selection changes (e.g. the user keeps extending the selection\n // using their mouse).\n this._documentIsSelectingInactivityTimeoutDebounced();\n });\n this._documents.add(domDocument);\n }\n /**\n * @inheritDoc\n */\n stopObserving(domElement) {\n this.stopListening(domElement);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n clearInterval(this._clearInfiniteLoopInterval);\n this._fireSelectionChangeDoneDebounced.cancel();\n this._documentIsSelectingInactivityTimeoutDebounced.cancel();\n }\n /* istanbul ignore next -- @preserve */\n _reportInfiniteLoop() {\n // @if CK_DEBUG //\t\tthrow new Error(\n // @if CK_DEBUG //\t\t\t'Selection change observer detected an infinite rendering loop.\\n\\n' +\n // @if CK_DEBUG //\t \t\t'⚠️⚠️ Report this error on https://github.com/ckeditor/ckeditor5/issues/11658.'\n // @if CK_DEBUG //\t\t);\n }\n /**\n * Selection change listener. {@link module:engine/view/observer/mutationobserver~MutationObserver#flush Flush} mutations, check if\n * a selection changes and fires {@link module:engine/view/document~Document#event:selectionChange} event on every change\n * and {@link module:engine/view/document~Document#event:selectionChangeDone} when a selection stop changing.\n *\n * @param domEvent DOM event.\n * @param domDocument DOM document.\n */\n _handleSelectionChange(domEvent, domDocument) {\n if (!this.isEnabled) {\n return;\n }\n const domSelection = domDocument.defaultView.getSelection();\n if (this.checkShouldIgnoreEventFromTarget(domSelection.anchorNode)) {\n return;\n }\n // Ensure the mutation event will be before selection event on all browsers.\n this.mutationObserver.flush();\n const newViewSelection = this.domConverter.domSelectionToView(domSelection);\n // Do not convert selection change if the new view selection has no ranges in it.\n //\n // It means that the DOM selection is in some way incorrect. Ranges that were in the DOM selection could not be\n // converted to the view. This happens when the DOM selection was moved outside of the editable element.\n if (newViewSelection.rangeCount == 0) {\n this.view.hasDomSelection = false;\n return;\n }\n this.view.hasDomSelection = true;\n if (this.selection.isEqual(newViewSelection) && this.domConverter.isDomSelectionCorrect(domSelection)) {\n return;\n }\n // Ensure we are not in the infinite loop (#400).\n // This counter is reset each second. 60 selection changes in 1 second is enough high number\n // to be very difficult (impossible) to achieve using just keyboard keys (during normal editor use).\n if (++this._loopbackCounter > 60) {\n // Selection change observer detected an infinite rendering loop.\n // Most probably you try to put the selection in the position which is not allowed\n // by the browser and browser fixes it automatically what causes `selectionchange` event on\n // which a loopback through a model tries to re-render the wrong selection and again.\n this._reportInfiniteLoop();\n return;\n }\n // Mark the latest focus change as complete (we got new selection after the focus so the selection is in the focused element).\n this.focusObserver.flush();\n if (this.selection.isSimilar(newViewSelection)) {\n // If selection was equal and we are at this point of algorithm, it means that it was incorrect.\n // Just re-render it, no need to fire any events, etc.\n this.view.forceRender();\n }\n else {\n const data = {\n oldSelection: this.selection,\n newSelection: newViewSelection,\n domSelection\n };\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[SelectionObserver]%c Fire selection change:',\n // @if CK_DEBUG_TYPING // \t\t'font-weight:bold;color:green', '',\n // @if CK_DEBUG_TYPING // \t\tnewViewSelection.getFirstRange()\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n // Prepare data for new selection and fire appropriate events.\n this.document.fire('selectionChange', data);\n // Call `#_fireSelectionChangeDoneDebounced` every time when `selectionChange` event is fired.\n // This function is debounced what means that `selectionChangeDone` event will be fired only when\n // defined int the function time will elapse since the last time the function was called.\n // So `selectionChangeDone` will be fired when selection will stop changing.\n this._fireSelectionChangeDoneDebounced(data);\n }\n }\n /**\n * Clears `SelectionObserver` internal properties connected with preventing infinite loop.\n */\n _clearInfiniteLoop() {\n this._loopbackCounter = 0;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/compositionobserver\n */\nimport DomEventObserver from './domeventobserver';\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 */\nexport default class CompositionObserver extends DomEventObserver {\n /**\n * @inheritDoc\n */\n constructor(view) {\n super(view);\n /**\n * @inheritDoc\n */\n this.domEventType = ['compositionstart', 'compositionupdate', 'compositionend'];\n const document = this.document;\n document.on('compositionstart', () => {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.log( '%c[CompositionObserver] ' +\n // @if CK_DEBUG_TYPING // \t\t'┌───────────────────────────── isComposing = true ─────────────────────────────┐',\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green'\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n document.isComposing = true;\n }, { priority: 'low' });\n document.on('compositionend', () => {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.log( '%c[CompositionObserver] ' +\n // @if CK_DEBUG_TYPING // \t\t'└───────────────────────────── isComposing = false ─────────────────────────────┘',\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green'\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n document.isComposing = false;\n }, { priority: 'low' });\n }\n /**\n * @inheritDoc\n */\n onDomEvent(domEvent) {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.group( `%c[CompositionObserver]%c ${ domEvent.type }`, 'color: green', '' );\n // @if CK_DEBUG_TYPING // }\n this.fire(domEvent.type, domEvent, {\n data: domEvent.data\n });\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * A facade over the native [`DataTransfer`](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer) object.\n */\nexport default class DataTransfer {\n /**\n * @param nativeDataTransfer The native [`DataTransfer`](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer) object.\n * @param options.cacheFiles Whether `files` list should be initialized in the constructor.\n */\n constructor(nativeDataTransfer, options = {}) {\n // We should store references to the File instances in case someone would like to process this files\n // outside the event handler. Files are stored only for `drop` and `paste` events because they are not usable\n // in other events and are generating a huge delay on Firefox while dragging.\n // See https://github.com/ckeditor/ckeditor5/issues/13366.\n this._files = options.cacheFiles ? getFiles(nativeDataTransfer) : null;\n this._native = nativeDataTransfer;\n }\n /**\n * The array of files created from the native `DataTransfer#files` or `DataTransfer#items`.\n */\n get files() {\n if (!this._files) {\n this._files = getFiles(this._native);\n }\n return this._files;\n }\n /**\n * Returns an array of available native content types.\n */\n get types() {\n return this._native.types;\n }\n /**\n * Gets the data from the data transfer by its MIME type.\n *\n * ```ts\n * dataTransfer.getData( 'text/plain' );\n * ```\n *\n * @param type The MIME type. E.g. `text/html` or `text/plain`.\n */\n getData(type) {\n return this._native.getData(type);\n }\n /**\n * Sets the data in the data transfer.\n *\n * @param type The MIME type. E.g. `text/html` or `text/plain`.\n */\n setData(type, data) {\n this._native.setData(type, data);\n }\n /**\n * The effect that is allowed for a drag operation.\n */\n set effectAllowed(value) {\n this._native.effectAllowed = value;\n }\n get effectAllowed() {\n return this._native.effectAllowed;\n }\n /**\n * The actual drop effect.\n */\n set dropEffect(value) {\n this._native.dropEffect = value;\n }\n get dropEffect() {\n return this._native.dropEffect;\n }\n /**\n * Set a preview image of the dragged content.\n */\n setDragImage(image, x, y) {\n this._native.setDragImage(image, x, y);\n }\n /**\n * Whether the dragging operation was canceled.\n */\n get isCanceled() {\n return this._native.dropEffect == 'none' || !!this._native.mozUserCancelled;\n }\n}\nfunction getFiles(nativeDataTransfer) {\n // DataTransfer.files and items are array-like and might not have an iterable interface.\n const files = Array.from(nativeDataTransfer.files || []);\n const items = Array.from(nativeDataTransfer.items || []);\n if (files.length) {\n return files;\n }\n // Chrome has empty DataTransfer.files, but allows getting files through the items interface.\n return items\n .filter(item => item.kind === 'file')\n .map(item => item.getAsFile());\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/inputobserver\n */\nimport DomEventObserver from './domeventobserver';\nimport DataTransfer from '../datatransfer';\nimport { env } from '@ckeditor/ckeditor5-utils';\n/**\n * Observer for events connected with data input.\n *\n * **Note**: This observer is attached by {@link module:engine/view/view~View} and available by default in all\n * editor instances.\n */\nexport default class InputObserver extends DomEventObserver {\n constructor() {\n super(...arguments);\n /**\n * @inheritDoc\n */\n this.domEventType = 'beforeinput';\n }\n /**\n * @inheritDoc\n */\n onDomEvent(domEvent) {\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.group( `%c[InputObserver]%c ${ domEvent.type }: ${ domEvent.inputType }`,\n // @if CK_DEBUG_TYPING // \t\t'color: green', 'color: default'\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n const domTargetRanges = domEvent.getTargetRanges();\n const view = this.view;\n const viewDocument = view.document;\n let dataTransfer = null;\n let data = null;\n let targetRanges = [];\n if (domEvent.dataTransfer) {\n dataTransfer = new DataTransfer(domEvent.dataTransfer);\n }\n if (domEvent.data !== null) {\n data = domEvent.data;\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( `%c[InputObserver]%c event data: %c${ JSON.stringify( data ) }`,\n // @if CK_DEBUG_TYPING // \t\t'color: green;font-weight: bold', 'font-weight:bold', 'color: blue;'\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n }\n else if (dataTransfer) {\n data = dataTransfer.getData('text/plain');\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( `%c[InputObserver]%c event data transfer: %c${ JSON.stringify( data ) }`,\n // @if CK_DEBUG_TYPING // \t\t'color: green;font-weight: bold', 'font-weight:bold', 'color: blue;'\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n }\n // If the editor selection is fake (an object is selected), the DOM range does not make sense because it is anchored\n // in the fake selection container.\n if (viewDocument.selection.isFake) {\n // Future-proof: in case of multi-range fake selections being possible.\n targetRanges = Array.from(viewDocument.selection.getRanges());\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[InputObserver]%c using fake selection:',\n // @if CK_DEBUG_TYPING // \t\t'color: green;font-weight: bold', 'font-weight:bold', targetRanges,\n // @if CK_DEBUG_TYPING // \t\tviewDocument.selection.isFake ? 'fake view selection' : 'fake DOM parent'\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n }\n else if (domTargetRanges.length) {\n targetRanges = domTargetRanges.map(domRange => {\n return view.domConverter.domRangeToView(domRange);\n });\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[InputObserver]%c using target ranges:',\n // @if CK_DEBUG_TYPING // \t\t'color: green;font-weight: bold', 'font-weight:bold', targetRanges\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n }\n // For Android devices we use a fallback to the current DOM selection, Android modifies it according\n // to the expected target ranges of input event.\n else if (env.isAndroid) {\n const domSelection = domEvent.target.ownerDocument.defaultView.getSelection();\n targetRanges = Array.from(view.domConverter.domSelectionToView(domSelection).getRanges());\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[InputObserver]%c using selection ranges:',\n // @if CK_DEBUG_TYPING // \t\t'color: green;font-weight: bold', 'font-weight:bold', targetRanges\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n }\n // Android sometimes fires insertCompositionText with a new-line character at the end of the data\n // instead of firing insertParagraph beforeInput event.\n // Fire the correct type of beforeInput event and ignore the replaced fragment of text because\n // it wants to replace \"test\" with \"test\\n\".\n // https://github.com/ckeditor/ckeditor5/issues/12368.\n if (env.isAndroid && domEvent.inputType == 'insertCompositionText' && data && data.endsWith('\\n')) {\n this.fire(domEvent.type, domEvent, {\n inputType: 'insertParagraph',\n targetRanges: [view.createRange(targetRanges[0].end)]\n });\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n return;\n }\n // Normalize the insertText data that includes new-line characters.\n // https://github.com/ckeditor/ckeditor5/issues/2045.\n if (domEvent.inputType == 'insertText' && data && data.includes('\\n')) {\n // There might be a single new-line or double for new paragraph, but we translate\n // it to paragraphs as it is our default action for enter handling.\n const parts = data.split(/\\n{1,2}/g);\n let partTargetRanges = targetRanges;\n for (let i = 0; i < parts.length; i++) {\n const dataPart = parts[i];\n if (dataPart != '') {\n this.fire(domEvent.type, domEvent, {\n data: dataPart,\n dataTransfer,\n targetRanges: partTargetRanges,\n inputType: domEvent.inputType,\n isComposing: domEvent.isComposing\n });\n // Use the result view selection so following events will be added one after another.\n partTargetRanges = [viewDocument.selection.getFirstRange()];\n }\n if (i + 1 < parts.length) {\n this.fire(domEvent.type, domEvent, {\n inputType: 'insertParagraph',\n targetRanges: partTargetRanges\n });\n // Use the result view selection so following events will be added one after another.\n partTargetRanges = [viewDocument.selection.getFirstRange()];\n }\n }\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n return;\n }\n // Fire the normalized beforeInput event.\n this.fire(domEvent.type, domEvent, {\n data,\n dataTransfer,\n targetRanges,\n inputType: domEvent.inputType,\n isComposing: domEvent.isComposing\n });\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.groupEnd();\n // @if CK_DEBUG_TYPING // }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/arrowkeysobserver\n */\nimport Observer from './observer';\nimport BubblingEventInfo from './bubblingeventinfo';\nimport { isArrowKeyCode } from '@ckeditor/ckeditor5-utils';\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 */\nexport default class ArrowKeysObserver extends Observer {\n /**\n * @inheritDoc\n */\n constructor(view) {\n super(view);\n this.document.on('keydown', (event, data) => {\n if (this.isEnabled && isArrowKeyCode(data.keyCode)) {\n const eventInfo = new BubblingEventInfo(this.document, 'arrowKey', this.document.selection.getFirstRange());\n this.document.fire(eventInfo, data);\n if (eventInfo.stop.called) {\n event.stop();\n }\n }\n });\n }\n /**\n * @inheritDoc\n */\n observe() { }\n /**\n * @inheritDoc\n */\n stopObserving() { }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport Observer from './observer';\nimport BubblingEventInfo from './bubblingeventinfo';\nimport { keyCodes } from '@ckeditor/ckeditor5-utils';\n/**\n * Tab observer introduces the {@link module:engine/view/document~Document#event:tab `Document#tab`} event.\n *\n * Note that because {@link module:engine/view/observer/tabobserver~TabObserver} is attached by the\n * {@link module:engine/view/view~View}, this event is available by default.\n */\nexport default class TabObserver extends Observer {\n /**\n * @inheritDoc\n */\n constructor(view) {\n super(view);\n const doc = this.document;\n doc.on('keydown', (evt, data) => {\n if (!this.isEnabled ||\n data.keyCode != keyCodes.tab ||\n data.ctrlKey) {\n return;\n }\n const event = new BubblingEventInfo(doc, 'tab', doc.selection.getFirstRange());\n doc.fire(event, data);\n if (event.stop.called) {\n evt.stop();\n }\n });\n }\n /**\n * @inheritDoc\n */\n observe() { }\n /**\n * @inheritDoc\n */\n stopObserving() { }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/view\n */\nimport Document from './document';\nimport DowncastWriter from './downcastwriter';\nimport Renderer from './renderer';\nimport DomConverter from './domconverter';\nimport Position from './position';\nimport Range from './range';\nimport Selection from './selection';\nimport KeyObserver from './observer/keyobserver';\nimport FakeSelectionObserver from './observer/fakeselectionobserver';\nimport MutationObserver from './observer/mutationobserver';\nimport SelectionObserver from './observer/selectionobserver';\nimport FocusObserver from './observer/focusobserver';\nimport CompositionObserver from './observer/compositionobserver';\nimport InputObserver from './observer/inputobserver';\nimport ArrowKeysObserver from './observer/arrowkeysobserver';\nimport TabObserver from './observer/tabobserver';\nimport { CKEditorError, ObservableMixin, scrollViewportToShowTarget } from '@ckeditor/ckeditor5-utils';\nimport { injectUiElementHandling } from './uielement';\nimport { injectQuirksHandling } from './filler';\n/**\n * Editor's view controller class. Its main responsibility is DOM - View management for editing purposes, to provide\n * abstraction over the DOM structure and events and hide all browsers quirks.\n *\n * View controller renders view document to DOM whenever view structure changes. To determine when view can be rendered,\n * all changes need to be done using the {@link module:engine/view/view~View#change} method, using\n * {@link module:engine/view/downcastwriter~DowncastWriter}:\n *\n * ```ts\n * view.change( writer => {\n * \twriter.insert( position, writer.createText( 'foo' ) );\n * } );\n * ```\n *\n * View controller also register {@link module:engine/view/observer/observer~Observer observers} which observes changes\n * on DOM and fire events on the {@link module:engine/view/document~Document Document}.\n * Note that the following observers are added by the class constructor and are always available:\n *\n * * {@link module:engine/view/observer/selectionobserver~SelectionObserver},\n * * {@link module:engine/view/observer/focusobserver~FocusObserver},\n * * {@link module:engine/view/observer/keyobserver~KeyObserver},\n * * {@link module:engine/view/observer/fakeselectionobserver~FakeSelectionObserver}.\n * * {@link module:engine/view/observer/compositionobserver~CompositionObserver}.\n * * {@link module:engine/view/observer/inputobserver~InputObserver}.\n * * {@link module:engine/view/observer/arrowkeysobserver~ArrowKeysObserver}.\n * * {@link module:engine/view/observer/tabobserver~TabObserver}.\n *\n * This class also {@link module:engine/view/view~View#attachDomRoot binds the DOM and the view elements}.\n *\n * If you do not need full a DOM - view management, and only want to transform a tree of view elements to a tree of DOM\n * elements you do not need this controller. You can use the {@link module:engine/view/domconverter~DomConverter DomConverter} instead.\n */\nexport default class View extends ObservableMixin() {\n /**\n * @param stylesProcessor The styles processor instance.\n */\n constructor(stylesProcessor) {\n super();\n /**\n * Roots of the DOM tree. Map on the `HTMLElement`s with roots names as keys.\n */\n this.domRoots = new Map();\n /**\n * A DOM root attributes cache. It saves the initial values of DOM root attributes before the DOM element\n * is {@link module:engine/view/view~View#attachDomRoot attached} to the view so later on, when\n * the view is destroyed ({@link module:engine/view/view~View#detachDomRoot}), they can be easily restored.\n * This way, the DOM element can go back to the (clean) state as if the editing view never used it.\n */\n this._initialDomRootAttributes = new WeakMap();\n /**\n * Map of registered {@link module:engine/view/observer/observer~Observer observers}.\n */\n this._observers = new Map();\n /**\n * Is set to `true` when {@link #change view changes} are currently in progress.\n */\n this._ongoingChange = false;\n /**\n * Used to prevent calling {@link #forceRender} and {@link #change} during rendering view to the DOM.\n */\n this._postFixersInProgress = false;\n /**\n * Internal flag to temporary disable rendering. See the usage in the {@link #_disableRendering}.\n */\n this._renderingDisabled = false;\n /**\n * Internal flag that disables rendering when there are no changes since the last rendering.\n * It stores information about changed selection and changed elements from attached document roots.\n */\n this._hasChangedSinceTheLastRendering = false;\n this.document = new Document(stylesProcessor);\n this.domConverter = new DomConverter(this.document);\n this.set('isRenderingInProgress', false);\n this.set('hasDomSelection', false);\n this._renderer = new Renderer(this.domConverter, this.document.selection);\n this._renderer.bind('isFocused', 'isSelecting', 'isComposing')\n .to(this.document, 'isFocused', 'isSelecting', 'isComposing');\n this._writer = new DowncastWriter(this.document);\n // Add default observers.\n this.addObserver(MutationObserver);\n this.addObserver(FocusObserver);\n this.addObserver(SelectionObserver);\n this.addObserver(KeyObserver);\n this.addObserver(FakeSelectionObserver);\n this.addObserver(CompositionObserver);\n this.addObserver(ArrowKeysObserver);\n this.addObserver(InputObserver);\n this.addObserver(TabObserver);\n // Inject quirks handlers.\n injectQuirksHandling(this);\n injectUiElementHandling(this);\n // Use 'normal' priority so that rendering is performed as first when using that priority.\n this.on('render', () => {\n this._render();\n // Informs that layout has changed after render.\n this.document.fire('layoutChanged');\n // Reset the `_hasChangedSinceTheLastRendering` flag after rendering.\n this._hasChangedSinceTheLastRendering = false;\n });\n // Listen to the document selection changes directly.\n this.listenTo(this.document.selection, 'change', () => {\n this._hasChangedSinceTheLastRendering = true;\n });\n // Trigger re-render if only the focus changed.\n this.listenTo(this.document, 'change:isFocused', () => {\n this._hasChangedSinceTheLastRendering = true;\n });\n }\n /**\n * Attaches a DOM root element to the view element and enable all observers on that element.\n * Also {@link module:engine/view/renderer~Renderer#markToSync mark element} to be synchronized\n * with the view what means that all child nodes will be removed and replaced with content of the view root.\n *\n * This method also will change view element name as the same as tag name of given dom root.\n * Name is always transformed to lower case.\n *\n * **Note:** Use {@link #detachDomRoot `detachDomRoot()`} to revert this action.\n *\n * @param domRoot DOM root element.\n * @param name Name of the root.\n */\n attachDomRoot(domRoot, name = 'main') {\n const viewRoot = this.document.getRoot(name);\n // Set view root name the same as DOM root tag name.\n viewRoot._name = domRoot.tagName.toLowerCase();\n const initialDomRootAttributes = {};\n // 1. Copy and cache the attributes to remember the state of the element before attaching.\n // The cached attributes will be restored in detachDomRoot() so the element goes to the\n // clean state as if the editing view never used it.\n // 2. Apply the attributes using the view writer, so they all go under the control of the engine.\n // The editing view takes over the attribute management completely because various\n // features (e.g. addPlaceholder()) require dynamic changes of those attributes and they\n // cannot be managed by the engine and the UI library at the same time.\n for (const { name, value } of Array.from(domRoot.attributes)) {\n initialDomRootAttributes[name] = value;\n // Do not use writer.setAttribute() for the class attribute. The EditableUIView class\n // and its descendants could have already set some using the writer.addClass() on the view\n // document root. They haven't been rendered yet so they are not present in the DOM root.\n // Using writer.setAttribute( 'class', ... ) would override them completely.\n if (name === 'class') {\n this._writer.addClass(value.split(' '), viewRoot);\n }\n else {\n this._writer.setAttribute(name, value, viewRoot);\n }\n }\n this._initialDomRootAttributes.set(domRoot, initialDomRootAttributes);\n const updateContenteditableAttribute = () => {\n this._writer.setAttribute('contenteditable', (!viewRoot.isReadOnly).toString(), viewRoot);\n if (viewRoot.isReadOnly) {\n this._writer.addClass('ck-read-only', viewRoot);\n }\n else {\n this._writer.removeClass('ck-read-only', viewRoot);\n }\n };\n // Set initial value.\n updateContenteditableAttribute();\n this.domRoots.set(name, domRoot);\n this.domConverter.bindElements(domRoot, viewRoot);\n this._renderer.markToSync('children', viewRoot);\n this._renderer.markToSync('attributes', viewRoot);\n this._renderer.domDocuments.add(domRoot.ownerDocument);\n viewRoot.on('change:children', (evt, node) => this._renderer.markToSync('children', node));\n viewRoot.on('change:attributes', (evt, node) => this._renderer.markToSync('attributes', node));\n viewRoot.on('change:text', (evt, node) => this._renderer.markToSync('text', node));\n viewRoot.on('change:isReadOnly', () => this.change(updateContenteditableAttribute));\n viewRoot.on('change', () => {\n this._hasChangedSinceTheLastRendering = true;\n });\n for (const observer of this._observers.values()) {\n observer.observe(domRoot, name);\n }\n }\n /**\n * Detaches a DOM root element from the view element and restores its attributes to the state before\n * {@link #attachDomRoot `attachDomRoot()`}.\n *\n * @param name Name of the root to detach.\n */\n detachDomRoot(name) {\n const domRoot = this.domRoots.get(name);\n // Remove all root attributes so the DOM element is \"bare\".\n Array.from(domRoot.attributes).forEach(({ name }) => domRoot.removeAttribute(name));\n const initialDomRootAttributes = this._initialDomRootAttributes.get(domRoot);\n // Revert all view root attributes back to the state before attachDomRoot was called.\n for (const attribute in initialDomRootAttributes) {\n domRoot.setAttribute(attribute, initialDomRootAttributes[attribute]);\n }\n this.domRoots.delete(name);\n this.domConverter.unbindDomElement(domRoot);\n for (const observer of this._observers.values()) {\n observer.stopObserving(domRoot);\n }\n }\n /**\n * Gets DOM root element.\n *\n * @param name Name of the root.\n * @returns DOM root element instance.\n */\n getDomRoot(name = 'main') {\n return this.domRoots.get(name);\n }\n /**\n * Creates observer of the given type if not yet created, {@link module:engine/view/observer/observer~Observer#enable enables} it\n * and {@link module:engine/view/observer/observer~Observer#observe attaches} to all existing and future\n * {@link #domRoots DOM roots}.\n *\n * Note: Observers are recognized by their constructor (classes). A single observer will be instantiated and used only\n * when registered for the first time. This means that features and other components can register a single observer\n * multiple times without caring whether it has been already added or not.\n *\n * @param ObserverConstructor The constructor of an observer to add.\n * Should create an instance inheriting from {@link module:engine/view/observer/observer~Observer}.\n * @returns Added observer instance.\n */\n addObserver(ObserverConstructor) {\n let observer = this._observers.get(ObserverConstructor);\n if (observer) {\n return observer;\n }\n observer = new ObserverConstructor(this);\n this._observers.set(ObserverConstructor, observer);\n for (const [name, domElement] of this.domRoots) {\n observer.observe(domElement, name);\n }\n observer.enable();\n return observer;\n }\n /**\n * Returns observer of the given type or `undefined` if such observer has not been added yet.\n *\n * @param ObserverConstructor The constructor of an observer to get.\n * @returns Observer instance or undefined.\n */\n getObserver(ObserverConstructor) {\n return this._observers.get(ObserverConstructor);\n }\n /**\n * Disables all added observers.\n */\n disableObservers() {\n for (const observer of this._observers.values()) {\n observer.disable();\n }\n }\n /**\n * Enables all added observers.\n */\n enableObservers() {\n for (const observer of this._observers.values()) {\n observer.enable();\n }\n }\n /**\n * Scrolls the page viewport and {@link #domRoots} with their ancestors to reveal the\n * caret, **if not already visible to the user**.\n *\n * @param options Additional configuration of the scrolling behavior.\n * @param options.viewportOffset A distance between the DOM selection and the viewport boundary to be maintained\n * while scrolling to the selection (default is 20px). Setting this value to `0` will reveal the selection precisely at\n * the viewport boundary.\n * @param options.ancestorOffset A distance between the DOM selection and scrollable DOM root ancestor(s) to be maintained\n * while scrolling to the selection (default is 20px). Setting this value to `0` will reveal the selection precisely at\n * the scrollable ancestor(s) boundary.\n * @param options.alignToTop When set `true`, the DOM selection will be aligned to the top of the viewport if not already visible\n * (see `forceScroll` to learn more).\n * @param options.forceScroll When set `true`, the DOM selection will be aligned to the top of the viewport and scrollable ancestors\n * whether it is already visible or not. This option will only work when `alignToTop` is `true`.\n */\n scrollToTheSelection({ alignToTop, forceScroll, viewportOffset = 20, ancestorOffset = 20 } = {}) {\n const range = this.document.selection.getFirstRange();\n if (range) {\n scrollViewportToShowTarget({\n target: this.domConverter.viewRangeToDom(range),\n viewportOffset,\n ancestorOffset,\n alignToTop,\n forceScroll\n });\n }\n }\n /**\n * It will focus DOM element representing {@link module:engine/view/editableelement~EditableElement EditableElement}\n * that is currently having selection inside.\n */\n focus() {\n if (!this.document.isFocused) {\n const editable = this.document.selection.editableElement;\n if (editable) {\n this.domConverter.focus(editable);\n this.forceRender();\n }\n else {\n // Before focusing view document, selection should be placed inside one of the view's editables.\n // Normally its selection will be converted from model document (which have default selection), but\n // when using view document on its own, we need to manually place selection before focusing it.\n //\n // @if CK_DEBUG // console.warn( 'There is no selection in any editable to focus.' );\n }\n }\n }\n /**\n * The `change()` method is the primary way of changing the view. You should use it to modify any node in the view tree.\n * It makes sure that after all changes are made the view is rendered to the DOM (assuming that the view will be changed\n * inside the callback). It prevents situations when the DOM is updated when the view state is not yet correct. It allows\n * to nest calls one inside another and still performs a single rendering after all those changes are made.\n * It also returns the return value of its callback.\n *\n * ```ts\n * const text = view.change( writer => {\n * \tconst newText = writer.createText( 'foo' );\n * \twriter.insert( position1, newText );\n *\n * \tview.change( writer => {\n * \t\twriter.insert( position2, writer.createText( 'bar' ) );\n * \t} );\n *\n * \twriter.remove( range );\n *\n * \treturn newText;\n * } );\n * ```\n *\n * When the outermost change block is done and rendering to the DOM is over the\n * {@link module:engine/view/view~View#event:render `View#render`} event is fired.\n *\n * This method throws a `applying-view-changes-on-rendering` error when\n * the change block is used after rendering to the DOM has started.\n *\n * @param callback Callback function which may modify the view.\n * @returns Value returned by the callback.\n */\n change(callback) {\n if (this.isRenderingInProgress || this._postFixersInProgress) {\n /**\n * Thrown when there is an attempt to make changes to the view tree when it is in incorrect state. This may\n * cause some unexpected behaviour and inconsistency between the DOM and the view.\n * This may be caused by:\n *\n * * calling {@link module:engine/view/view~View#change} or {@link module:engine/view/view~View#forceRender} during rendering\n * process,\n * * calling {@link module:engine/view/view~View#change} or {@link module:engine/view/view~View#forceRender} inside of\n * {@link module:engine/view/document~Document#registerPostFixer post-fixer function}.\n *\n * @error cannot-change-view-tree\n */\n throw new CKEditorError('cannot-change-view-tree', this);\n }\n try {\n // Recursive call to view.change() method - execute listener immediately.\n if (this._ongoingChange) {\n return callback(this._writer);\n }\n // This lock will assure that all recursive calls to view.change() will end up in same block - one \"render\"\n // event for all nested calls.\n this._ongoingChange = true;\n const callbackResult = callback(this._writer);\n this._ongoingChange = false;\n // This lock is used by editing controller to render changes from outer most model.change() once. As plugins might call\n // view.change() inside model.change() block - this will ensures that postfixers and rendering are called once after all\n // changes. Also, we don't need to render anything if there're no changes since last rendering.\n if (!this._renderingDisabled && this._hasChangedSinceTheLastRendering) {\n this._postFixersInProgress = true;\n this.document._callPostFixers(this._writer);\n this._postFixersInProgress = false;\n this.fire('render');\n }\n return callbackResult;\n }\n catch (err) {\n // @if CK_DEBUG // throw err;\n /* istanbul ignore next -- @preserve */\n CKEditorError.rethrowUnexpectedError(err, this);\n }\n }\n /**\n * Forces rendering {@link module:engine/view/document~Document view document} to DOM. If any view changes are\n * currently in progress, rendering will start after all {@link #change change blocks} are processed.\n *\n * Note that this method is dedicated for special cases. All view changes should be wrapped in the {@link #change}\n * block and the view will automatically check whether it needs to render DOM or not.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `applying-view-changes-on-rendering` when\n * trying to re-render when rendering to DOM has already started.\n */\n forceRender() {\n this._hasChangedSinceTheLastRendering = true;\n this.getObserver(FocusObserver).flush();\n this.change(() => { });\n }\n /**\n * Destroys this instance. Makes sure that all observers are destroyed and listeners removed.\n */\n destroy() {\n for (const observer of this._observers.values()) {\n observer.destroy();\n }\n this.document.destroy();\n this.stopListening();\n }\n /**\n * Creates position at the given location. The location can be specified as:\n *\n * * a {@link module:engine/view/position~Position position},\n * * parent element and offset (offset defaults to `0`),\n * * parent element and `'end'` (sets position at the end of that element),\n * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).\n *\n * This method is a shortcut to other constructors such as:\n *\n * * {@link #createPositionBefore},\n * * {@link #createPositionAfter},\n *\n * @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/view/item~Item view item}.\n */\n createPositionAt(itemOrPosition, offset) {\n return Position._createAt(itemOrPosition, offset);\n }\n /**\n * Creates a new position after given view item.\n *\n * @param item View item after which the position should be located.\n */\n createPositionAfter(item) {\n return Position._createAfter(item);\n }\n /**\n * Creates a new position before given view item.\n *\n * @param item View item before which the position should be located.\n */\n createPositionBefore(item) {\n return Position._createBefore(item);\n }\n /**\n * Creates a range spanning from `start` position to `end` position.\n *\n * **Note:** This factory method creates it's own {@link module:engine/view/position~Position} instances basing on passed values.\n *\n * @param start Start position.\n * @param end End position. If not set, range will be collapsed at `start` position.\n */\n createRange(start, end) {\n return new Range(start, end);\n }\n /**\n * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.\n */\n createRangeOn(item) {\n return Range._createOn(item);\n }\n /**\n * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of\n * that element and ends after the last child of that element.\n *\n * @param element Element which is a parent for the range.\n */\n createRangeIn(element) {\n return Range._createIn(element);\n }\n createSelection(...args) {\n return new Selection(...args);\n }\n /**\n * Disables or enables rendering. If the flag is set to `true` then the rendering will be disabled.\n * If the flag is set to `false` and if there was some change in the meantime, then the rendering action will be performed.\n *\n * @internal\n * @param flag A flag indicates whether the rendering should be disabled.\n */\n _disableRendering(flag) {\n this._renderingDisabled = flag;\n if (flag == false) {\n // Render when you stop blocking rendering.\n this.change(() => { });\n }\n }\n /**\n * Renders all changes. In order to avoid triggering the observers (e.g. selection) all observers are disabled\n * before rendering and re-enabled after that.\n */\n _render() {\n this.isRenderingInProgress = true;\n this.disableObservers();\n this._renderer.render();\n this.enableObservers();\n this.isRenderingInProgress = false;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nexport default class TypeCheckable {\n /* istanbul ignore next -- @preserve */\n is() {\n // There are a lot of overloads above.\n // Overriding method in derived classes remove them and only `is( type: string ): boolean` is visible which we don't want.\n // One option would be to copy them all to all classes, but that's ugly.\n // It's best when TypeScript compiler doesn't see those overloads, except the one in the top base class.\n // To overload a method, but not let the compiler see it, do after class definition:\n // `MyClass.prototype.is = function( type: string ) {...}`\n throw new Error('is() method is abstract');\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/**\n * @module engine/model/node\n */\nimport TypeCheckable from './typecheckable';\nimport { CKEditorError, compareArrays, toMap } from '@ckeditor/ckeditor5-utils';\n// To check if component is loaded more than once.\nimport '@ckeditor/ckeditor5-utils/src/version';\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/writer~Writer Writer API}.\n *\n * Changes done by `Node` methods, like {@link module:engine/model/element~Element#_insertChild _insertChild} 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/writer~Writer#insert inserting} that node to the model tree.\n *\n * Be aware that using {@link module:engine/model/writer~Writer#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 extends TypeCheckable {\n /**\n * Creates a model node.\n *\n * This is an abstract class, so this constructor should not be used directly.\n *\n * @param attrs Node's attributes. See {@link module:utils/tomap~toMap} for a list of accepted values.\n */\n constructor(attrs) {\n super();\n /**\n * Parent of this node. It could be {@link module:engine/model/element~Element}\n * or {@link module:engine/model/documentfragment~DocumentFragment}.\n * Equals to `null` if the node has no parent.\n */\n this.parent = null;\n this._attrs = toMap(attrs);\n }\n /**\n * {@link module:engine/model/document~Document Document} that owns this root element.\n */\n get document() {\n return null;\n }\n /**\n * Index of this node in its parent or `null` if the node has no parent.\n *\n * Accessing this property throws an error if this node's parent element does not contain it.\n * This means that model tree got broken.\n */\n get index() {\n let pos;\n if (!this.parent) {\n return null;\n }\n if ((pos = this.parent.getChildIndex(this)) === null) {\n throw new CKEditorError('model-node-not-found-in-parent', this);\n }\n return pos;\n }\n /**\n * Offset at which this node starts in its parent. It is equal to the sum of {@link #offsetSize offsetSize}\n * of all its previous siblings. Equals to `null` if node has no parent.\n *\n * Accessing this property throws an error if this node's parent element does not contain it.\n * This means that model tree got broken.\n */\n get startOffset() {\n let pos;\n if (!this.parent) {\n return null;\n }\n if ((pos = this.parent.getChildStartOffset(this)) === null) {\n throw new CKEditorError('model-node-not-found-in-parent', this);\n }\n return pos;\n }\n /**\n * Offset size of this node. Represents how much \"offset space\" is occupied by the node in it's parent.\n * It is important for {@link module:engine/model/position~Position position}. When node has `offsetSize` greater than `1`, position\n * can be placed between that node start and end. `offsetSize` greater than `1` is for nodes that represents more\n * than one entity, i.e. {@link module:engine/model/text~Text text node}.\n */\n get offsetSize() {\n return 1;\n }\n /**\n * Offset at which this node ends in it's parent. It is equal to the sum of this node's\n * {@link module:engine/model/node~Node#startOffset start offset} and {@link #offsetSize offset size}.\n * Equals to `null` if the node has no parent.\n */\n get endOffset() {\n if (!this.parent) {\n return null;\n }\n return this.startOffset + this.offsetSize;\n }\n /**\n * 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 */\n get nextSibling() {\n const index = this.index;\n return (index !== null && this.parent.getChild(index + 1)) || null;\n }\n /**\n * 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 */\n get previousSibling() {\n const index = this.index;\n return (index !== null && this.parent.getChild(index - 1)) || null;\n }\n /**\n * The top-most ancestor of the node. If node has no parent it is the root itself. If the node is a part\n * of {@link module:engine/model/documentfragment~DocumentFragment}, it's `root` is equal to that `DocumentFragment`.\n */\n get root() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias, consistent-this\n let root = this;\n while (root.parent) {\n root = root.parent;\n }\n return root;\n }\n /**\n * Returns `true` if the node is inside a document root that is attached to the document.\n */\n isAttached() {\n // If the node has no parent it means that it is a root.\n // But this is not a `RootElement`, so it means that it is not attached.\n //\n // If this is not the root, check if this element's root is attached.\n return this.parent === null ? false : this.root.isAttached();\n }\n /**\n * Gets path to the node. The path is an array containing starting offsets of consecutive ancestors of this node,\n * beginning from {@link module:engine/model/node~Node#root root}, down to this node's starting offset. The path can be used to\n * create {@link module:engine/model/position~Position Position} instance.\n *\n * ```ts\n * const abc = new Text( 'abc' );\n * const foo = new Text( 'foo' );\n * const h1 = new Element( 'h1', null, new Text( 'header' ) );\n * const p = new Element( 'p', null, [ abc, foo ] );\n * const div = new Element( 'div', null, [ h1, p ] );\n * foo.getPath(); // Returns [ 1, 3 ]. `foo` is in `p` which is in `div`. `p` starts at offset 1, while `foo` at 3.\n * h1.getPath(); // Returns [ 0 ].\n * div.getPath(); // Returns [].\n * ```\n */\n getPath() {\n const path = [];\n // eslint-disable-next-line @typescript-eslint/no-this-alias, consistent-this\n let node = this;\n while (node.parent) {\n path.unshift(node.startOffset);\n node = node.parent;\n }\n return path;\n }\n /**\n * Returns ancestors array of this node.\n *\n * @param options Options object.\n * @param options.includeSelf When set to `true` this node will be also included in parent's array.\n * @param options.parentFirst When set to `true`, array will be sorted from node's parent to root element,\n * otherwise root element will be the first item in the array.\n * @returns Array with ancestors.\n */\n getAncestors(options = {}) {\n const ancestors = [];\n let parent = options.includeSelf ? this : this.parent;\n while (parent) {\n ancestors[options.parentFirst ? 'push' : 'unshift'](parent);\n parent = parent.parent;\n }\n return ancestors;\n }\n /**\n * Returns a {@link module:engine/model/element~Element} or {@link module:engine/model/documentfragment~DocumentFragment}\n * which is a common ancestor of both nodes.\n *\n * @param node The second node.\n * @param options Options object.\n * @param options.includeSelf When set to `true` both nodes will be considered \"ancestors\" too.\n * Which means that if e.g. node A is inside B, then their common ancestor will be B.\n */\n getCommonAncestor(node, options = {}) {\n const ancestorsA = this.getAncestors(options);\n const ancestorsB = node.getAncestors(options);\n let i = 0;\n while (ancestorsA[i] == ancestorsB[i] && ancestorsA[i]) {\n i++;\n }\n return i === 0 ? null : ancestorsA[i - 1];\n }\n /**\n * Returns whether this node is before given node. `false` is returned if nodes are in different trees (for example,\n * in different {@link module:engine/model/documentfragment~DocumentFragment}s).\n *\n * @param node Node to compare with.\n */\n isBefore(node) {\n // Given node is not before this node if they are same.\n if (this == node) {\n return false;\n }\n // Return `false` if it is impossible to compare nodes.\n if (this.root !== node.root) {\n return false;\n }\n const thisPath = this.getPath();\n const nodePath = node.getPath();\n const result = compareArrays(thisPath, nodePath);\n switch (result) {\n case 'prefix':\n return true;\n case 'extension':\n return false;\n default:\n return thisPath[result] < nodePath[result];\n }\n }\n /**\n * Returns whether this node is after given node. `false` is returned if nodes are in different trees (for example,\n * in different {@link module:engine/model/documentfragment~DocumentFragment}s).\n *\n * @param node Node to compare with.\n */\n isAfter(node) {\n // Given node is not before this node if they are same.\n if (this == node) {\n return false;\n }\n // Return `false` if it is impossible to compare nodes.\n if (this.root !== node.root) {\n return false;\n }\n // In other cases, just check if the `node` is before, and return the opposite.\n return !this.isBefore(node);\n }\n /**\n * Checks if the node has an attribute with given key.\n *\n * @param key Key of attribute to check.\n * @returns `true` if attribute with given key is set on node, `false` otherwise.\n */\n hasAttribute(key) {\n return this._attrs.has(key);\n }\n /**\n * Gets an attribute value for given key or `undefined` if that attribute is not set on node.\n *\n * @param key Key of attribute to look for.\n * @returns Attribute value or `undefined`.\n */\n getAttribute(key) {\n return this._attrs.get(key);\n }\n /**\n * Returns iterator that iterates over this node's attributes.\n *\n * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.\n * This format is accepted by native `Map` object and also can be passed in `Node` constructor.\n */\n getAttributes() {\n return this._attrs.entries();\n }\n /**\n * Returns iterator that iterates over this node's attribute keys.\n */\n getAttributeKeys() {\n return this._attrs.keys();\n }\n /**\n * Converts `Node` to plain object and returns it.\n *\n * @returns `Node` converted to plain object.\n */\n toJSON() {\n const json = {};\n // Serializes attributes to the object.\n // attributes = { a: 'foo', b: 1, c: true }.\n if (this._attrs.size) {\n json.attributes = Array.from(this._attrs).reduce((result, attr) => {\n result[attr[0]] = attr[1];\n return result;\n }, {});\n }\n return json;\n }\n /**\n * Creates a copy of this node, that is a node with exactly same attributes, and returns it.\n *\n * @internal\n * @returns Node with same attributes as this node.\n */\n _clone(_deep) {\n return new this.constructor(this._attrs);\n }\n /**\n * Removes this node from it's parent.\n *\n * @internal\n * @see module:engine/model/writer~Writer#remove\n */\n _remove() {\n this.parent._removeChildren(this.index);\n }\n /**\n * Sets attribute on the node. If attribute with the same key already is set, it's value is overwritten.\n *\n * @see module:engine/model/writer~Writer#setAttribute\n * @internal\n * @param key Key of attribute to set.\n * @param value Attribute value.\n */\n _setAttribute(key, value) {\n this._attrs.set(key, value);\n }\n /**\n * Removes all attributes from the node and sets given attributes.\n *\n * @see module:engine/model/writer~Writer#setAttributes\n * @internal\n * @param attrs Attributes to set. See {@link module:utils/tomap~toMap} for a list of accepted values.\n */\n _setAttributesTo(attrs) {\n this._attrs = toMap(attrs);\n }\n /**\n * Removes an attribute with given key from the node.\n *\n * @see module:engine/model/writer~Writer#removeAttribute\n * @internal\n * @param key Key of attribute to remove.\n * @returns `true` if the attribute was set on the element, `false` otherwise.\n */\n _removeAttribute(key) {\n return this._attrs.delete(key);\n }\n /**\n * Removes all attributes from the node.\n *\n * @see module:engine/model/writer~Writer#clearAttributes\n * @internal\n */\n _clearAttributes() {\n this._attrs.clear();\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nNode.prototype.is = function (type) {\n return type === 'node' || type === 'model:node';\n};\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/nodelist\n */\nimport Node from './node';\nimport { CKEditorError, spliceArray } from '@ckeditor/ckeditor5-utils';\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 /**\n * Creates an empty node list.\n *\n * @internal\n * @param nodes Nodes contained in this node list.\n */\n constructor(nodes) {\n /**\n * Nodes contained in this node list.\n */\n this._nodes = [];\n if (nodes) {\n this._insertNodes(0, nodes);\n }\n }\n /**\n * Iterable interface.\n *\n * Iterates over all nodes contained inside this node list.\n */\n [Symbol.iterator]() {\n return this._nodes[Symbol.iterator]();\n }\n /**\n * Number of nodes contained inside this node list.\n */\n get length() {\n return this._nodes.length;\n }\n /**\n * Sum of {@link module:engine/model/node~Node#offsetSize offset sizes} of all nodes contained inside this node list.\n */\n get maxOffset() {\n return this._nodes.reduce((sum, node) => sum + node.offsetSize, 0);\n }\n /**\n * Gets the node at the given index. Returns `null` if incorrect index was passed.\n */\n getNode(index) {\n return this._nodes[index] || null;\n }\n /**\n * Returns an index of the given node. Returns `null` if given node is not inside this node list.\n */\n getNodeIndex(node) {\n const index = this._nodes.indexOf(node);\n return index == -1 ? null : index;\n }\n /**\n * Returns the starting offset of given node. Starting offset is equal to the sum of\n * {@link module:engine/model/node~Node#offsetSize offset sizes} of all nodes that are before this node in this node list.\n */\n getNodeStartOffset(node) {\n const index = this.getNodeIndex(node);\n return index === null ? null : this._nodes.slice(0, index).reduce((sum, node) => sum + node.offsetSize, 0);\n }\n /**\n * Converts index to offset in node list.\n *\n * Returns starting offset of a node that is at given index. Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError}\n * `model-nodelist-index-out-of-bounds` if given index is less than `0` or more than {@link #length}.\n */\n indexToOffset(index) {\n if (index == this._nodes.length) {\n return this.maxOffset;\n }\n const node = this._nodes[index];\n if (!node) {\n /**\n * Given index cannot be found in the node list.\n *\n * @error model-nodelist-index-out-of-bounds\n */\n throw new CKEditorError('model-nodelist-index-out-of-bounds', this);\n }\n return this.getNodeStartOffset(node);\n }\n /**\n * Converts offset in node list to index.\n *\n * Returns index of a node that occupies given offset. Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError}\n * `model-nodelist-offset-out-of-bounds` if given offset is less than `0` or more than {@link #maxOffset}.\n */\n offsetToIndex(offset) {\n let totalOffset = 0;\n for (const node of this._nodes) {\n if (offset >= totalOffset && offset < totalOffset + node.offsetSize) {\n return this.getNodeIndex(node);\n }\n totalOffset += node.offsetSize;\n }\n if (totalOffset != offset) {\n /**\n * Given offset cannot be found in the node list.\n *\n * @error model-nodelist-offset-out-of-bounds\n * @param offset\n * @param nodeList Stringified node list.\n */\n throw new CKEditorError('model-nodelist-offset-out-of-bounds', this, {\n offset,\n nodeList: this\n });\n }\n return this.length;\n }\n /**\n * Inserts given nodes at given index.\n *\n * @internal\n * @param index Index at which nodes should be inserted.\n * @param nodes Nodes to be inserted.\n */\n _insertNodes(index, nodes) {\n // Validation.\n for (const node of nodes) {\n if (!(node instanceof Node)) {\n /**\n * Trying to insert an object which is not a Node instance.\n *\n * @error model-nodelist-insertnodes-not-node\n */\n throw new CKEditorError('model-nodelist-insertnodes-not-node', this);\n }\n }\n this._nodes = spliceArray(this._nodes, Array.from(nodes), index, 0);\n }\n /**\n * Removes one or more nodes starting at the given index.\n *\n * @internal\n * @param indexStart Index of the first node to remove.\n * @param howMany Number of nodes to remove.\n * @returns Array containing removed nodes.\n */\n _removeNodes(indexStart, howMany = 1) {\n return this._nodes.splice(indexStart, howMany);\n }\n /**\n * Converts `NodeList` instance to an array containing nodes that were inserted in the node list. Nodes\n * are also converted to their plain object representation.\n *\n * @returns `NodeList` instance converted to `Array`.\n */\n toJSON() {\n return this._nodes.map(node => node.toJSON());\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/splicearray\n */\nconst BIG_CHUNK_SIZE = 10000;\n/**\n * Splices one array into another. To be used instead of `Array.prototype.splice` as the latter may\n * throw \"Maximum call stack size exceeded\" when passed huge number of items to insert.\n *\n * Note: in contrary to Array.splice, this function does not modify the original `target`.\n *\n * ```ts\n * spliceArray( [ 1, 2 ], [ 3, 4 ], 0, 0 );\t// [ 3, 4, 1, 2 ]\n * spliceArray( [ 1, 2 ], [ 3, 4 ], 1, 1 );\t// [ 1, 3, 4 ]\n * spliceArray( [ 1, 2 ], [ 3, 4 ], 1, 0 );\t// [ 1, 3, 4, 2 ]\n * spliceArray( [ 1, 2 ], [ 3, 4 ], 2, 0 );\t// [ 1, 2, 3, 4 ]\n * spliceArray( [ 1, 2 ], [], 0, 1 );\t// [ 2 ]\n * ```\n *\n * @param target Array to be spliced.\n * @param source Array of elements to be inserted to target.\n * @param start Index at which nodes should be inserted/removed.\n * @param count Number of items.\n *\n * @returns New spliced array.\n */\nexport default function spliceArray(target, source, start, count) {\n // In case of performance problems, see: https://github.com/ckeditor/ckeditor5/pull/12429/files#r965850568\n if (Math.max(source.length, target.length) > BIG_CHUNK_SIZE) {\n return target.slice(0, start).concat(source).concat(target.slice(start + count, target.length));\n }\n else {\n const newTarget = Array.from(target);\n newTarget.splice(start, count, ...source);\n return newTarget;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/text\n */\nimport Node from './node';\n// @if CK_DEBUG_ENGINE // const { convertMapToStringifiedObject } = require( '../dev-utils/utils' );\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 /**\n * Creates a text node.\n *\n * **Note:** Constructor of this class shouldn't be used directly in the code.\n * Use the {@link module:engine/model/writer~Writer#createText} method instead.\n *\n * @internal\n * @param data Node's text.\n * @param attrs Node's attributes. See {@link module:utils/tomap~toMap} for a list of accepted values.\n */\n constructor(data, attrs) {\n super(attrs);\n this._data = data || '';\n }\n /**\n * @inheritDoc\n */\n get offsetSize() {\n return this.data.length;\n }\n /**\n * Returns a text data contained in the node.\n */\n get data() {\n return this._data;\n }\n /**\n * Converts `Text` instance to plain object and returns it.\n *\n * @returns`Text` instance converted to plain object.\n */\n toJSON() {\n const json = super.toJSON();\n json.data = this.data;\n return json;\n }\n /**\n * Creates a copy of this text node and returns it. Created text node has same text data and attributes as original text node.\n *\n * @internal\n * @returns `Text` instance created using given plain object.\n */\n _clone() {\n return new Text(this.data, this.getAttributes());\n }\n /**\n * Creates a `Text` instance from given plain object (i.e. parsed JSON string).\n *\n * @param json Plain object to be converted to `Text`.\n * @returns `Text` instance created using given plain object.\n */\n static fromJSON(json) {\n return new Text(json.data, json.attributes);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nText.prototype.is = function (type) {\n return type === '$text' || type === 'model:$text' ||\n // This are legacy values kept for backward compatibility.\n type === 'text' || type === 'model:text' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'node' || type === 'model:node';\n};\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/textproxy\n */\nimport TypeCheckable from './typecheckable';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n// @if CK_DEBUG_ENGINE // const { convertMapToStringifiedObject } = require( '../dev-utils/utils' );\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 extends TypeCheckable {\n /**\n * Creates a text proxy.\n *\n * @internal\n * @param textNode Text node which part is represented by this text proxy.\n * @param offsetInText Offset in {@link module:engine/model/textproxy~TextProxy#textNode text node} from which the text proxy\n * starts.\n * @param length Text proxy length, that is how many text node's characters, starting from `offsetInText` it represents.\n */\n constructor(textNode, offsetInText, length) {\n super();\n this.textNode = textNode;\n if (offsetInText < 0 || offsetInText > textNode.offsetSize) {\n /**\n * Given `offsetInText` value is incorrect.\n *\n * @error model-textproxy-wrong-offsetintext\n */\n throw new CKEditorError('model-textproxy-wrong-offsetintext', this);\n }\n if (length < 0 || offsetInText + length > textNode.offsetSize) {\n /**\n * Given `length` value is incorrect.\n *\n * @error model-textproxy-wrong-length\n */\n throw new CKEditorError('model-textproxy-wrong-length', this);\n }\n this.data = textNode.data.substring(offsetInText, offsetInText + length);\n this.offsetInText = offsetInText;\n }\n /**\n * Offset at which this text proxy starts in it's parent.\n *\n * @see module:engine/model/node~Node#startOffset\n */\n get startOffset() {\n return this.textNode.startOffset !== null ? this.textNode.startOffset + this.offsetInText : null;\n }\n /**\n * Offset size of this text proxy. Equal to the number of characters represented by the text proxy.\n *\n * @see module:engine/model/node~Node#offsetSize\n */\n get offsetSize() {\n return this.data.length;\n }\n /**\n * Offset at which this text proxy ends in it's parent.\n *\n * @see module:engine/model/node~Node#endOffset\n */\n get endOffset() {\n return this.startOffset !== null ? this.startOffset + this.offsetSize : null;\n }\n /**\n * Flag indicating whether `TextProxy` instance covers only part of the original {@link module:engine/model/text~Text text node}\n * (`true`) or the whole text node (`false`).\n *\n * This is `false` when text proxy starts at the very beginning of {@link module:engine/model/textproxy~TextProxy#textNode textNode}\n * ({@link module:engine/model/textproxy~TextProxy#offsetInText offsetInText} equals `0`) and text proxy sizes is equal to\n * text node size.\n */\n get isPartial() {\n return this.offsetSize !== this.textNode.offsetSize;\n }\n /**\n * Parent of this text proxy, which is same as parent of text node represented by this text proxy.\n */\n get parent() {\n return this.textNode.parent;\n }\n /**\n * Root of this text proxy, which is same as root of text node represented by this text proxy.\n */\n get root() {\n return this.textNode.root;\n }\n /**\n * Gets path to this text proxy.\n *\n * @see module:engine/model/node~Node#getPath\n */\n getPath() {\n const path = this.textNode.getPath();\n if (path.length > 0) {\n path[path.length - 1] += this.offsetInText;\n }\n return path;\n }\n /**\n * Returns ancestors array of this text proxy.\n *\n * @param options Options object.\n * @param options.includeSelf When set to `true` this text proxy will be also included in parent's array.\n * @param options.parentFirst When set to `true`, array will be sorted from text proxy parent to root element,\n * otherwise root element will be the first item in the array.\n * @returns Array with ancestors.\n */\n getAncestors(options = {}) {\n const ancestors = [];\n let parent = options.includeSelf ? this : this.parent;\n while (parent) {\n ancestors[options.parentFirst ? 'push' : 'unshift'](parent);\n parent = parent.parent;\n }\n return ancestors;\n }\n /**\n * Checks if this text proxy has an attribute for given key.\n *\n * @param key Key of attribute to check.\n * @returns `true` if attribute with given key is set on text proxy, `false` otherwise.\n */\n hasAttribute(key) {\n return this.textNode.hasAttribute(key);\n }\n /**\n * Gets an attribute value for given key or `undefined` if that attribute is not set on text proxy.\n *\n * @param key Key of attribute to look for.\n * @returns Attribute value or `undefined`.\n */\n getAttribute(key) {\n return this.textNode.getAttribute(key);\n }\n /**\n * Returns iterator that iterates over this node's attributes. Attributes are returned as arrays containing two\n * items. First one is attribute key and second is attribute value.\n *\n * This format is accepted by native `Map` object and also can be passed in `Node` constructor.\n */\n getAttributes() {\n return this.textNode.getAttributes();\n }\n /**\n * Returns iterator that iterates over this node's attribute keys.\n */\n getAttributeKeys() {\n return this.textNode.getAttributeKeys();\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nTextProxy.prototype.is = function (type) {\n return type === '$textProxy' || type === 'model:$textProxy' ||\n // This are legacy values kept for backward compatibility.\n type === 'textProxy' || type === 'model:textProxy';\n};\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/element\n */\nimport Node from './node';\nimport NodeList from './nodelist';\nimport Text from './text';\nimport TextProxy from './textproxy';\nimport { isIterable } from '@ckeditor/ckeditor5-utils';\n// @if CK_DEBUG_ENGINE // const { stringifyMap, convertMapToStringifiedObject, convertMapToTags } = require( '../dev-utils/utils' );\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 /**\n * Creates a model element.\n *\n * **Note:** Constructor of this class shouldn't be used directly in the code.\n * Use the {@link module:engine/model/writer~Writer#createElement} method instead.\n *\n * @internal\n * @param name Element's name.\n * @param attrs Element's attributes. See {@link module:utils/tomap~toMap} for a list of accepted values.\n * @param children One or more nodes to be inserted as children of created element.\n */\n constructor(name, attrs, children) {\n super(attrs);\n /**\n * List of children nodes.\n */\n this._children = new NodeList();\n this.name = name;\n if (children) {\n this._insertChild(0, children);\n }\n }\n /**\n * Number of this element's children.\n */\n get childCount() {\n return this._children.length;\n }\n /**\n * Sum of {@link module:engine/model/node~Node#offsetSize offset sizes} of all of this element's children.\n */\n get maxOffset() {\n return this._children.maxOffset;\n }\n /**\n * Is `true` if there are no nodes inside this element, `false` otherwise.\n */\n get isEmpty() {\n return this.childCount === 0;\n }\n /**\n * Gets the child at the given index.\n */\n getChild(index) {\n return this._children.getNode(index);\n }\n /**\n * Returns an iterator that iterates over all of this element's children.\n */\n getChildren() {\n return this._children[Symbol.iterator]();\n }\n /**\n * Returns an index of the given child node. Returns `null` if given node is not a child of this element.\n *\n * @param node Child node to look for.\n * @returns Child node's index in this element.\n */\n getChildIndex(node) {\n return this._children.getNodeIndex(node);\n }\n /**\n * Returns the starting offset of given child. Starting offset is equal to the sum of\n * {@link module:engine/model/node~Node#offsetSize offset sizes} of all node's siblings that are before it. Returns `null` if\n * given node is not a child of this element.\n *\n * @param node Child node to look for.\n * @returns Child node's starting offset.\n */\n getChildStartOffset(node) {\n return this._children.getNodeStartOffset(node);\n }\n /**\n * Returns index of a node that occupies given offset. If given offset is too low, returns `0`. If given offset is\n * too high, returns {@link module:engine/model/element~Element#getChildIndex index after last child}.\n *\n * ```ts\n * const textNode = new Text( 'foo' );\n * const pElement = new Element( 'p' );\n * const divElement = new Element( [ textNode, pElement ] );\n * divElement.offsetToIndex( -1 ); // Returns 0, because offset is too low.\n * divElement.offsetToIndex( 0 ); // Returns 0, because offset 0 is taken by `textNode` which is at index 0.\n * divElement.offsetToIndex( 1 ); // Returns 0, because `textNode` has `offsetSize` equal to 3, so it occupies offset 1 too.\n * divElement.offsetToIndex( 2 ); // Returns 0.\n * divElement.offsetToIndex( 3 ); // Returns 1.\n * divElement.offsetToIndex( 4 ); // Returns 2. There are no nodes at offset 4, so last available index is returned.\n * ```\n */\n offsetToIndex(offset) {\n return this._children.offsetToIndex(offset);\n }\n /**\n * Returns a descendant node by its path relative to this element.\n *\n * ```ts\n * // <this>a<b>c</b></this>\n * this.getNodeByPath( [ 0 ] ); // -> \"a\"\n * this.getNodeByPath( [ 1 ] ); // -> <b>\n * this.getNodeByPath( [ 1, 0 ] ); // -> \"c\"\n * ```\n *\n * @param relativePath Path of the node to find, relative to this element.\n */\n getNodeByPath(relativePath) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias, consistent-this\n let node = this;\n for (const index of relativePath) {\n node = node.getChild(node.offsetToIndex(index));\n }\n return node;\n }\n /**\n * Returns the parent element of the given name. Returns null if the element is not inside the desired parent.\n *\n * @param parentName The name of the parent element to find.\n * @param options Options object.\n * @param options.includeSelf When set to `true` this node will be also included while searching.\n */\n findAncestor(parentName, options = {}) {\n let parent = options.includeSelf ? this : this.parent;\n while (parent) {\n if (parent.name === parentName) {\n return parent;\n }\n parent = parent.parent;\n }\n return null;\n }\n /**\n * Converts `Element` instance to plain object and returns it. Takes care of converting all of this element's children.\n *\n * @returns `Element` instance converted to plain object.\n */\n toJSON() {\n const json = super.toJSON();\n json.name = this.name;\n if (this._children.length > 0) {\n json.children = [];\n for (const node of this._children) {\n json.children.push(node.toJSON());\n }\n }\n return json;\n }\n /**\n * Creates a copy of this element and returns it. Created element has the same name and attributes as the original element.\n * If clone is deep, the original element's children are also cloned. If not, then empty element is returned.\n *\n * @internal\n * @param deep If set to `true` clones element and all its children recursively. When set to `false`,\n * element will be cloned without any child.\n */\n _clone(deep = false) {\n const children = deep ? Array.from(this._children).map(node => node._clone(true)) : undefined;\n return new Element(this.name, this.getAttributes(), children);\n }\n /**\n * {@link module:engine/model/element~Element#_insertChild Inserts} one or more nodes at the end of this element.\n *\n * @see module:engine/model/writer~Writer#append\n * @internal\n * @param nodes Nodes to be inserted.\n */\n _appendChild(nodes) {\n this._insertChild(this.childCount, nodes);\n }\n /**\n * Inserts one or more nodes at the given index and sets {@link module:engine/model/node~Node#parent parent} of these nodes\n * to this element.\n *\n * @see module:engine/model/writer~Writer#insert\n * @internal\n * @param index Index at which nodes should be inserted.\n * @param items Items to be inserted.\n */\n _insertChild(index, items) {\n const nodes = normalize(items);\n for (const node of nodes) {\n // If node that is being added to this element is already inside another element, first remove it from the old parent.\n if (node.parent !== null) {\n node._remove();\n }\n node.parent = this;\n }\n this._children._insertNodes(index, nodes);\n }\n /**\n * Removes one or more nodes starting at the given index and sets\n * {@link module:engine/model/node~Node#parent parent} of these nodes to `null`.\n *\n * @see module:engine/model/writer~Writer#remove\n * @internal\n * @param index Index of the first node to remove.\n * @param howMany Number of nodes to remove.\n * @returns Array containing removed nodes.\n */\n _removeChildren(index, howMany = 1) {\n const nodes = this._children._removeNodes(index, howMany);\n for (const node of nodes) {\n node.parent = null;\n }\n return nodes;\n }\n /**\n * Creates an `Element` instance from given plain object (i.e. parsed JSON string).\n * Converts `Element` children to proper nodes.\n *\n * @param json Plain object to be converted to `Element`.\n * @returns `Element` instance created using given plain object.\n */\n static fromJSON(json) {\n let children;\n if (json.children) {\n children = [];\n for (const child of json.children) {\n if (child.name) {\n // If child has name property, it is an Element.\n children.push(Element.fromJSON(child));\n }\n else {\n // Otherwise, it is a Text node.\n children.push(Text.fromJSON(child));\n }\n }\n }\n return new Element(json.name, json.attributes, children);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nElement.prototype.is = function (type, name) {\n if (!name) {\n return type === 'element' || type === 'model:element' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'node' || type === 'model:node';\n }\n return name === this.name && (type === 'element' || type === 'model:element');\n};\n/**\n * Converts strings to Text and non-iterables to arrays.\n */\nfunction normalize(nodes) {\n // Separate condition because string is iterable.\n if (typeof nodes == 'string') {\n return [new Text(nodes)];\n }\n if (!isIterable(nodes)) {\n nodes = [nodes];\n }\n // Array.from to enable .map() on non-arrays.\n return Array.from(nodes)\n .map(node => {\n if (typeof node == 'string') {\n return new Text(node);\n }\n if (node instanceof TextProxy) {\n return new Text(node.data, node.getAttributes());\n }\n return node;\n });\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/treewalker\n */\nimport Element from './element';\nimport { default as Position, getTextNodeAtPosition, getNodeAfterPosition, getNodeBeforePosition } from './position';\nimport Text from './text';\nimport TextProxy from './textproxy';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Position iterator class. It allows to iterate forward and backward over the document.\n */\nexport default class TreeWalker {\n /**\n * Creates a range iterator. All parameters are optional, but you have to specify either `boundaries` or `startPosition`.\n *\n * @param options Object with configuration.\n */\n constructor(options) {\n if (!options || (!options.boundaries && !options.startPosition)) {\n /**\n * Neither boundaries nor starting position of a `TreeWalker` have been defined.\n *\n * @error model-tree-walker-no-start-position\n */\n throw new CKEditorError('model-tree-walker-no-start-position', null);\n }\n const direction = options.direction || 'forward';\n if (direction != 'forward' && direction != 'backward') {\n /**\n * Only `backward` and `forward` direction allowed.\n *\n * @error model-tree-walker-unknown-direction\n */\n throw new CKEditorError('model-tree-walker-unknown-direction', options, { direction });\n }\n this.direction = direction;\n this.boundaries = options.boundaries || null;\n if (options.startPosition) {\n this._position = options.startPosition.clone();\n }\n else {\n this._position = Position._createAt(this.boundaries[this.direction == 'backward' ? 'end' : 'start']);\n }\n // Reset position stickiness in case it was set to other value, as the stickiness is kept after cloning.\n this.position.stickiness = 'toNone';\n this.singleCharacters = !!options.singleCharacters;\n this.shallow = !!options.shallow;\n this.ignoreElementEnd = !!options.ignoreElementEnd;\n this._boundaryStartParent = this.boundaries ? this.boundaries.start.parent : null;\n this._boundaryEndParent = this.boundaries ? this.boundaries.end.parent : null;\n this._visitedParent = this.position.parent;\n }\n /**\n * Iterable interface.\n *\n * @returns {Iterable.<module:engine/model/treewalker~TreeWalkerValue>}\n */\n [Symbol.iterator]() {\n return this;\n }\n /**\n * Iterator position. This is always static position, even if the initial position was a\n * {@link module:engine/model/liveposition~LivePosition live position}. If start position is not defined then position depends\n * on {@link #direction}. If direction is `'forward'` position starts form the beginning, when direction\n * is `'backward'` position starts from the end.\n */\n get position() {\n return this._position;\n }\n /**\n * Moves {@link #position} in the {@link #direction} skipping values as long as the callback function returns `true`.\n *\n * For example:\n *\n * ```ts\n * walker.skip( value => value.type == 'text' ); // <paragraph>[]foo</paragraph> -> <paragraph>foo[]</paragraph>\n * walker.skip( () => true ); // Move the position to the end: <paragraph>[]foo</paragraph> -> <paragraph>foo</paragraph>[]\n * walker.skip( () => false ); // Do not move the position.\n * ```\n *\n * @param skip Callback function. Gets {@link module:engine/model/treewalker~TreeWalkerValue} and should\n * return `true` if the value should be skipped or `false` if not.\n */\n skip(skip) {\n let done, value, prevPosition, prevVisitedParent;\n do {\n prevPosition = this.position;\n prevVisitedParent = this._visitedParent;\n ({ done, value } = this.next());\n } while (!done && skip(value));\n if (!done) {\n this._position = prevPosition;\n this._visitedParent = prevVisitedParent;\n }\n }\n /**\n * Gets the next tree walker's value.\n */\n next() {\n if (this.direction == 'forward') {\n return this._next();\n }\n else {\n return this._previous();\n }\n }\n /**\n * Makes a step forward in model. Moves the {@link #position} to the next position and returns the encountered value.\n */\n _next() {\n const previousPosition = this.position;\n const position = this.position.clone();\n const parent = this._visitedParent;\n // We are at the end of the root.\n if (parent.parent === null && position.offset === parent.maxOffset) {\n return { done: true, value: undefined };\n }\n // We reached the walker boundary.\n if (parent === this._boundaryEndParent && position.offset == this.boundaries.end.offset) {\n return { done: true, value: undefined };\n }\n // Get node just after the current position.\n // Use a highly optimized version instead of checking the text node first and then getting the node after. See #6582.\n const textNodeAtPosition = getTextNodeAtPosition(position, parent);\n const node = textNodeAtPosition ? textNodeAtPosition : getNodeAfterPosition(position, parent, textNodeAtPosition);\n if (node instanceof Element) {\n if (!this.shallow) {\n // Manual operations on path internals for optimization purposes. Here and in the rest of the method.\n position.path.push(0);\n this._visitedParent = node;\n }\n else {\n position.offset++;\n }\n this._position = position;\n return formatReturnValue('elementStart', node, previousPosition, position, 1);\n }\n else if (node instanceof Text) {\n let charactersCount;\n if (this.singleCharacters) {\n charactersCount = 1;\n }\n else {\n let offset = node.endOffset;\n if (this._boundaryEndParent == parent && this.boundaries.end.offset < offset) {\n offset = this.boundaries.end.offset;\n }\n charactersCount = offset - position.offset;\n }\n const offsetInTextNode = position.offset - node.startOffset;\n const item = new TextProxy(node, offsetInTextNode, charactersCount);\n position.offset += charactersCount;\n this._position = position;\n return formatReturnValue('text', item, previousPosition, position, charactersCount);\n }\n else {\n // `node` is not set, we reached the end of current `parent`.\n position.path.pop();\n position.offset++;\n this._position = position;\n this._visitedParent = parent.parent;\n if (this.ignoreElementEnd) {\n return this._next();\n }\n else {\n return formatReturnValue('elementEnd', parent, previousPosition, position);\n }\n }\n }\n /**\n * Makes a step backward in model. Moves the {@link #position} to the previous position and returns the encountered value.\n */\n _previous() {\n const previousPosition = this.position;\n const position = this.position.clone();\n const parent = this._visitedParent;\n // We are at the beginning of the root.\n if (parent.parent === null && position.offset === 0) {\n return { done: true, value: undefined };\n }\n // We reached the walker boundary.\n if (parent == this._boundaryStartParent && position.offset == this.boundaries.start.offset) {\n return { done: true, value: undefined };\n }\n // Get node just before the current position.\n // Use a highly optimized version instead of checking the text node first and then getting the node before. See #6582.\n const positionParent = position.parent;\n const textNodeAtPosition = getTextNodeAtPosition(position, positionParent);\n const node = textNodeAtPosition ? textNodeAtPosition : getNodeBeforePosition(position, positionParent, textNodeAtPosition);\n if (node instanceof Element) {\n position.offset--;\n if (!this.shallow) {\n position.path.push(node.maxOffset);\n this._position = position;\n this._visitedParent = node;\n if (this.ignoreElementEnd) {\n return this._previous();\n }\n else {\n return formatReturnValue('elementEnd', node, previousPosition, position);\n }\n }\n else {\n this._position = position;\n return formatReturnValue('elementStart', node, previousPosition, position, 1);\n }\n }\n else if (node instanceof Text) {\n let charactersCount;\n if (this.singleCharacters) {\n charactersCount = 1;\n }\n else {\n let offset = node.startOffset;\n if (this._boundaryStartParent == parent && this.boundaries.start.offset > offset) {\n offset = this.boundaries.start.offset;\n }\n charactersCount = position.offset - offset;\n }\n const offsetInTextNode = position.offset - node.startOffset;\n const item = new TextProxy(node, offsetInTextNode - charactersCount, charactersCount);\n position.offset -= charactersCount;\n this._position = position;\n return formatReturnValue('text', item, previousPosition, position, charactersCount);\n }\n else {\n // `node` is not set, we reached the beginning of current `parent`.\n position.path.pop();\n this._position = position;\n this._visitedParent = parent.parent;\n return formatReturnValue('elementStart', parent, previousPosition, position, 1);\n }\n }\n}\nfunction formatReturnValue(type, item, previousPosition, nextPosition, length) {\n return {\n done: false,\n value: {\n type,\n item,\n previousPosition,\n nextPosition,\n length\n }\n };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/position\n */\nimport TypeCheckable from './typecheckable';\nimport TreeWalker from './treewalker';\nimport { CKEditorError, compareArrays } from '@ckeditor/ckeditor5-utils';\n// To check if component is loaded more than once.\nimport '@ckeditor/ckeditor5-utils/src/version';\n/**\n * Represents a position in the model tree.\n *\n * A position is represented by its {@link module:engine/model/position~Position#root} and\n * a {@link module:engine/model/position~Position#path} in that root.\n *\n * You can create position instances via its constructor or the `createPosition*()` factory methods of\n * {@link module:engine/model/model~Model} and {@link module:engine/model/writer~Writer}.\n *\n * **Note:** Position is based on offsets, not indexes. This means that a position between two text nodes\n * `foo` and `bar` has offset `3`, not `1`. See {@link module:engine/model/position~Position#path} for more information.\n *\n * Since a position in the 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 places.\n * This requirement is important for operational transformation algorithms.\n *\n * Also, {@link module:engine/model/operation/operation~Operation operations}\n * kept in the {@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 the document has changed.\n *\n * When changes are applied to the 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 extends TypeCheckable {\n /**\n * Creates a position.\n *\n * @param root Root of the position.\n * @param path Position path. See {@link module:engine/model/position~Position#path}.\n * @param stickiness Position stickiness. See {@link module:engine/model/position~PositionStickiness}.\n */\n constructor(root, path, stickiness = 'toNone') {\n super();\n if (!root.is('element') && !root.is('documentFragment')) {\n /**\n * Position root is invalid.\n *\n * Positions can only be anchored in elements or document fragments.\n *\n * @error model-position-root-invalid\n */\n throw new CKEditorError('model-position-root-invalid', root);\n }\n if (!(path instanceof Array) || path.length === 0) {\n /**\n * Position path must be an array with at least one item.\n *\n * @error model-position-path-incorrect-format\n * @param path\n */\n throw new CKEditorError('model-position-path-incorrect-format', root, { path });\n }\n // Normalize the root and path when element (not root) is passed.\n if (root.is('rootElement')) {\n path = path.slice();\n }\n else {\n path = [...root.getPath(), ...path];\n root = root.root;\n }\n this.root = root;\n this.path = path;\n this.stickiness = stickiness;\n }\n /**\n * Offset at which this position is located in its {@link module:engine/model/position~Position#parent parent}. It is equal\n * to the last item in position {@link module:engine/model/position~Position#path path}.\n *\n * @type {Number}\n */\n get offset() {\n return this.path[this.path.length - 1];\n }\n set offset(newOffset) {\n this.path[this.path.length - 1] = newOffset;\n }\n /**\n * Parent element of this position.\n *\n * Keep in mind that `parent` value is calculated when the property is accessed.\n * If {@link module:engine/model/position~Position#path position path}\n * leads to a non-existing element, `parent` property will throw error.\n *\n * 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 */\n get parent() {\n let parent = this.root;\n for (let i = 0; i < this.path.length - 1; i++) {\n parent = parent.getChild(parent.offsetToIndex(this.path[i]));\n if (!parent) {\n /**\n * The position's path is incorrect. This means that a position does not point to\n * a correct place in the tree and hence, some of its methods and getters cannot work correctly.\n *\n * **Note**: Unlike DOM and view positions, in the model, the\n * {@link module:engine/model/position~Position#parent position's parent} is always an element or a document fragment.\n * The last offset in the {@link module:engine/model/position~Position#path position's path} is the point in this element\n * where this position points.\n *\n * Read more about model positions and offsets in\n * the {@glink framework/architecture/editing-engine#indexes-and-offsets Editing engine architecture} guide.\n *\n * @error model-position-path-incorrect\n * @param position The incorrect position.\n */\n throw new CKEditorError('model-position-path-incorrect', this, { position: this });\n }\n }\n if (parent.is('$text')) {\n throw new CKEditorError('model-position-path-incorrect', this, { position: this });\n }\n return parent;\n }\n /**\n * Position {@link module:engine/model/position~Position#offset offset} converted to an index in position's parent node. It is\n * equal to the {@link module:engine/model/node~Node#index index} of a node after this position. If position is placed\n * in text node, position index is equal to the index of that text node.\n */\n get index() {\n return this.parent.offsetToIndex(this.offset);\n }\n /**\n * Returns {@link module:engine/model/text~Text text node} instance in which this position is placed or `null` if this\n * position is not in a text node.\n */\n get textNode() {\n return getTextNodeAtPosition(this, this.parent);\n }\n /**\n * Node directly after this position or `null` if this position is in text node.\n */\n get nodeAfter() {\n // Cache the parent and reuse for performance reasons. See #6579 and #6582.\n const parent = this.parent;\n return getNodeAfterPosition(this, parent, getTextNodeAtPosition(this, parent));\n }\n /**\n * Node directly before this position or `null` if this position is in text node.\n */\n get nodeBefore() {\n // Cache the parent and reuse for performance reasons. See #6579 and #6582.\n const parent = this.parent;\n return getNodeBeforePosition(this, parent, getTextNodeAtPosition(this, parent));\n }\n /**\n * Is `true` if position is at the beginning of its {@link module:engine/model/position~Position#parent parent}, `false` otherwise.\n */\n get isAtStart() {\n return this.offset === 0;\n }\n /**\n * Is `true` if position is at the end of its {@link module:engine/model/position~Position#parent parent}, `false` otherwise.\n */\n get isAtEnd() {\n return this.offset == this.parent.maxOffset;\n }\n /**\n * Checks whether this position is before or after given position.\n *\n * This method is safe to use it on non-existing positions (for example during operational transformation).\n */\n compareWith(otherPosition) {\n if (this.root != otherPosition.root) {\n return 'different';\n }\n const result = compareArrays(this.path, otherPosition.path);\n switch (result) {\n case 'same':\n return 'same';\n case 'prefix':\n return 'before';\n case 'extension':\n return 'after';\n default:\n return this.path[result] < otherPosition.path[result] ? 'before' : 'after';\n }\n }\n /**\n * Gets the farthest position which matches the callback using\n * {@link module:engine/model/treewalker~TreeWalker TreeWalker}.\n *\n * For example:\n *\n * ```ts\n * getLastMatchingPosition( value => value.type == 'text' );\n * // <paragraph>[]foo</paragraph> -> <paragraph>foo[]</paragraph>\n *\n * getLastMatchingPosition( value => value.type == 'text', { direction: 'backward' } );\n * // <paragraph>foo[]</paragraph> -> <paragraph>[]foo</paragraph>\n *\n * getLastMatchingPosition( value => false );\n * // Do not move the position.\n * ```\n *\n * @param skip Callback function. Gets {@link module:engine/model/treewalker~TreeWalkerValue} and should\n * return `true` if the value should be skipped or `false` if not.\n * @param options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.\n *\n * @returns The position after the last item which matches the `skip` callback test.\n */\n getLastMatchingPosition(skip, options = {}) {\n options.startPosition = this;\n const treeWalker = new TreeWalker(options);\n treeWalker.skip(skip);\n return treeWalker.position;\n }\n /**\n * Returns a path to this position's parent. Parent path is equal to position {@link module:engine/model/position~Position#path path}\n * but without the last item.\n *\n * This method is safe to use it on non-existing positions (for example during operational transformation).\n *\n * @returns Path to the parent.\n */\n getParentPath() {\n return this.path.slice(0, -1);\n }\n /**\n * Returns ancestors array of this position, that is this position's parent and its ancestors.\n *\n * @returns Array with ancestors.\n */\n getAncestors() {\n const parent = this.parent;\n if (parent.is('documentFragment')) {\n return [parent];\n }\n else {\n return parent.getAncestors({ includeSelf: true });\n }\n }\n /**\n * Returns the parent element of the given name. Returns null if the position is not inside the desired parent.\n *\n * @param parentName The name of the parent element to find.\n */\n findAncestor(parentName) {\n const parent = this.parent;\n if (parent.is('element')) {\n return parent.findAncestor(parentName, { includeSelf: true });\n }\n return null;\n }\n /**\n * Returns the slice of two position {@link #path paths} which is identical. The {@link #root roots}\n * of these two paths must be identical.\n *\n * This method is safe to use it on non-existing positions (for example during operational transformation).\n *\n * @param position The second position.\n * @returns The common path.\n */\n getCommonPath(position) {\n if (this.root != position.root) {\n return [];\n }\n // We find on which tree-level start and end have the lowest common ancestor\n const cmp = compareArrays(this.path, position.path);\n // If comparison returned string it means that arrays are same.\n const diffAt = (typeof cmp == 'string') ? Math.min(this.path.length, position.path.length) : cmp;\n return this.path.slice(0, diffAt);\n }\n /**\n * Returns an {@link module:engine/model/element~Element} or {@link module:engine/model/documentfragment~DocumentFragment}\n * which is a common ancestor of both positions. The {@link #root roots} of these two positions must be identical.\n *\n * @param position The second position.\n */\n getCommonAncestor(position) {\n const ancestorsA = this.getAncestors();\n const ancestorsB = position.getAncestors();\n let i = 0;\n while (ancestorsA[i] == ancestorsB[i] && ancestorsA[i]) {\n i++;\n }\n return i === 0 ? null : ancestorsA[i - 1];\n }\n /**\n * Returns a new instance of `Position`, that has same {@link #parent parent} but it's offset\n * is shifted by `shift` value (can be a negative value).\n *\n * This method is safe to use it on non-existing positions (for example during operational transformation).\n *\n * @param shift Offset shift. Can be a negative value.\n * @returns Shifted position.\n */\n getShiftedBy(shift) {\n const shifted = this.clone();\n const offset = shifted.offset + shift;\n shifted.offset = offset < 0 ? 0 : offset;\n return shifted;\n }\n /**\n * Checks whether this position is after given position.\n *\n * This method is safe to use it on non-existing positions (for example during operational transformation).\n *\n * @see module:engine/model/position~Position#isBefore\n * @param otherPosition Position to compare with.\n * @returns True if this position is after given position.\n */\n isAfter(otherPosition) {\n return this.compareWith(otherPosition) == 'after';\n }\n /**\n * Checks whether this position is before given position.\n *\n * **Note:** watch out when using negation of the value returned by this method, because the negation will also\n * be `true` if positions are in different roots and you might not expect this. You should probably use\n * `a.isAfter( b ) || a.isEqual( b )` or `!a.isBefore( p ) && a.root == b.root` in most scenarios. If your\n * condition uses multiple `isAfter` and `isBefore` checks, build them so they do not use negated values, i.e.:\n *\n * ```ts\n * if ( a.isBefore( b ) && c.isAfter( d ) ) {\n * \t// do A.\n * } else {\n * \t// do B.\n * }\n * ```\n *\n * or, if you have only one if-branch:\n *\n * ```ts\n * if ( !( a.isBefore( b ) && c.isAfter( d ) ) {\n * \t// do B.\n * }\n * ```\n *\n * rather than:\n *\n * ```ts\n * if ( !a.isBefore( b ) || && !c.isAfter( d ) ) {\n * \t// do B.\n * } else {\n * \t// do A.\n * }\n * ```\n *\n * This method is safe to use it on non-existing positions (for example during operational transformation).\n *\n * @param otherPosition Position to compare with.\n * @returns True if this position is before given position.\n */\n isBefore(otherPosition) {\n return this.compareWith(otherPosition) == 'before';\n }\n /**\n * Checks whether this position is equal to given position.\n *\n * This method is safe to use it on non-existing positions (for example during operational transformation).\n *\n * @param otherPosition Position to compare with.\n * @returns True if positions are same.\n */\n isEqual(otherPosition) {\n return this.compareWith(otherPosition) == 'same';\n }\n /**\n * Checks whether this position is touching given position. Positions touch when there are no text nodes\n * or empty nodes in a range between them. Technically, those positions are not equal but in many cases\n * they are very similar or even indistinguishable.\n *\n * @param otherPosition Position to compare with.\n * @returns True if positions touch.\n */\n isTouching(otherPosition) {\n if (this.root !== otherPosition.root) {\n return false;\n }\n const commonLevel = Math.min(this.path.length, otherPosition.path.length);\n for (let level = 0; level < commonLevel; level++) {\n const diff = this.path[level] - otherPosition.path[level];\n // Positions are spread by a node, so they are not touching.\n if (diff < -1 || diff > 1) {\n return false;\n }\n else if (diff === 1) {\n // `otherPosition` is on the left.\n // `this` is on the right.\n return checkTouchingBranch(otherPosition, this, level);\n }\n else if (diff === -1) {\n // `this` is on the left.\n // `otherPosition` is on the right.\n return checkTouchingBranch(this, otherPosition, level);\n }\n // `diff === 0`.\n // Positions are inside the same element on this level, compare deeper.\n }\n // If we ended up here, it means that positions paths have the same beginning.\n // If the paths have the same length, then it means that they are identical, so the positions are same.\n if (this.path.length === otherPosition.path.length) {\n return true;\n }\n // If positions have different length of paths, then the common part is the same.\n // In this case, the \"shorter\" position is on the left, the \"longer\" position is on the right.\n //\n // If the positions are touching, the \"longer\" position must have only zeroes. For example:\n // [ 1, 2 ] vs [ 1, 2, 0 ]\n // [ 1, 2 ] vs [ 1, 2, 0, 0, 0 ]\n else if (this.path.length > otherPosition.path.length) {\n return checkOnlyZeroes(this.path, commonLevel);\n }\n else {\n return checkOnlyZeroes(otherPosition.path, commonLevel);\n }\n }\n /**\n * Checks if two positions are in the same parent.\n *\n * This method is safe to use it on non-existing positions (for example during operational transformation).\n *\n * @param position Position to compare with.\n * @returns `true` if positions have the same parent, `false` otherwise.\n */\n hasSameParentAs(position) {\n if (this.root !== position.root) {\n return false;\n }\n const thisParentPath = this.getParentPath();\n const posParentPath = position.getParentPath();\n return compareArrays(thisParentPath, posParentPath) == 'same';\n }\n /**\n * Returns a copy of this position that is transformed by given `operation`.\n *\n * The new position's parameters are updated accordingly to the effect of the `operation`.\n *\n * For example, if `n` nodes are inserted before the position, the returned position {@link ~Position#offset} will be\n * increased by `n`. If the position was in a merged element, it will be accordingly moved to the new element, etc.\n *\n * This method is safe to use it on non-existing positions (for example during operational transformation).\n *\n * @param operation Operation to transform by.\n * @returns Transformed position.\n */\n getTransformedByOperation(operation) {\n let result;\n switch (operation.type) {\n case 'insert':\n result = this._getTransformedByInsertOperation(operation);\n break;\n case 'move':\n case 'remove':\n case 'reinsert':\n result = this._getTransformedByMoveOperation(operation);\n break;\n case 'split':\n result = this._getTransformedBySplitOperation(operation);\n break;\n case 'merge':\n result = this._getTransformedByMergeOperation(operation);\n break;\n default:\n result = Position._createAt(this);\n break;\n }\n return result;\n }\n /**\n * Returns a copy of this position transformed by an insert operation.\n *\n * @internal\n */\n _getTransformedByInsertOperation(operation) {\n return this._getTransformedByInsertion(operation.position, operation.howMany);\n }\n /**\n * Returns a copy of this position transformed by a move operation.\n *\n * @internal\n */\n _getTransformedByMoveOperation(operation) {\n return this._getTransformedByMove(operation.sourcePosition, operation.targetPosition, operation.howMany);\n }\n /**\n * Returns a copy of this position transformed by a split operation.\n *\n * @internal\n */\n _getTransformedBySplitOperation(operation) {\n const movedRange = operation.movedRange;\n const isContained = movedRange.containsPosition(this) ||\n (movedRange.start.isEqual(this) && this.stickiness == 'toNext');\n if (isContained) {\n return this._getCombined(operation.splitPosition, operation.moveTargetPosition);\n }\n else {\n if (operation.graveyardPosition) {\n return this._getTransformedByMove(operation.graveyardPosition, operation.insertionPosition, 1);\n }\n else {\n return this._getTransformedByInsertion(operation.insertionPosition, 1);\n }\n }\n }\n /**\n * Returns a copy of this position transformed by merge operation.\n *\n * @internal\n */\n _getTransformedByMergeOperation(operation) {\n const movedRange = operation.movedRange;\n const isContained = movedRange.containsPosition(this) || movedRange.start.isEqual(this);\n let pos;\n if (isContained) {\n pos = this._getCombined(operation.sourcePosition, operation.targetPosition);\n if (operation.sourcePosition.isBefore(operation.targetPosition)) {\n // Above happens during OT when the merged element is moved before the merged-to element.\n pos = pos._getTransformedByDeletion(operation.deletionPosition, 1);\n }\n }\n else if (this.isEqual(operation.deletionPosition)) {\n pos = Position._createAt(operation.deletionPosition);\n }\n else {\n pos = this._getTransformedByMove(operation.deletionPosition, operation.graveyardPosition, 1);\n }\n return pos;\n }\n /**\n * Returns a copy of this position that is updated by removing `howMany` nodes starting from `deletePosition`.\n * It may happen that this position is in a removed node. If that is the case, `null` is returned instead.\n *\n * @internal\n * @param deletePosition Position before the first removed node.\n * @param howMany How many nodes are removed.\n * @returns Transformed position or `null`.\n */\n _getTransformedByDeletion(deletePosition, howMany) {\n const transformed = Position._createAt(this);\n // This position can't be affected if deletion was in a different root.\n if (this.root != deletePosition.root) {\n return transformed;\n }\n if (compareArrays(deletePosition.getParentPath(), this.getParentPath()) == 'same') {\n // If nodes are removed from the node that is pointed by this position...\n if (deletePosition.offset < this.offset) {\n // And are removed from before an offset of that position...\n if (deletePosition.offset + howMany > this.offset) {\n // Position is in removed range, it's no longer in the tree.\n return null;\n }\n else {\n // Decrement the offset accordingly.\n transformed.offset -= howMany;\n }\n }\n }\n else if (compareArrays(deletePosition.getParentPath(), this.getParentPath()) == 'prefix') {\n // If nodes are removed from a node that is on a path to this position...\n const i = deletePosition.path.length - 1;\n if (deletePosition.offset <= this.path[i]) {\n // And are removed from before next node of that path...\n if (deletePosition.offset + howMany > this.path[i]) {\n // If the next node of that path is removed return null\n // because the node containing this position got removed.\n return null;\n }\n else {\n // Otherwise, decrement index on that path.\n transformed.path[i] -= howMany;\n }\n }\n }\n return transformed;\n }\n /**\n * Returns a copy of this position that is updated by inserting `howMany` nodes at `insertPosition`.\n *\n * @internal\n * @param insertPosition Position where nodes are inserted.\n * @param howMany How many nodes are inserted.\n * @returns Transformed position.\n */\n _getTransformedByInsertion(insertPosition, howMany) {\n const transformed = Position._createAt(this);\n // This position can't be affected if insertion was in a different root.\n if (this.root != insertPosition.root) {\n return transformed;\n }\n if (compareArrays(insertPosition.getParentPath(), this.getParentPath()) == 'same') {\n // If nodes are inserted in the node that is pointed by this position...\n if (insertPosition.offset < this.offset || (insertPosition.offset == this.offset && this.stickiness != 'toPrevious')) {\n // And are inserted before an offset of that position...\n // \"Push\" this positions offset.\n transformed.offset += howMany;\n }\n }\n else if (compareArrays(insertPosition.getParentPath(), this.getParentPath()) == 'prefix') {\n // If nodes are inserted in a node that is on a path to this position...\n const i = insertPosition.path.length - 1;\n if (insertPosition.offset <= this.path[i]) {\n // And are inserted before next node of that path...\n // \"Push\" the index on that path.\n transformed.path[i] += howMany;\n }\n }\n return transformed;\n }\n /**\n * Returns a copy of this position that is updated by moving `howMany` nodes from `sourcePosition` to `targetPosition`.\n *\n * @internal\n * @param sourcePosition Position before the first element to move.\n * @param targetPosition Position where moved elements will be inserted.\n * @param howMany How many consecutive nodes to move, starting from `sourcePosition`.\n * @returns Transformed position.\n */\n _getTransformedByMove(sourcePosition, targetPosition, howMany) {\n // Update target position, as it could be affected by nodes removal.\n targetPosition = targetPosition._getTransformedByDeletion(sourcePosition, howMany);\n if (sourcePosition.isEqual(targetPosition)) {\n // If `targetPosition` is equal to `sourcePosition` this isn't really any move. Just return position as it is.\n return Position._createAt(this);\n }\n // Moving a range removes nodes from their original position. We acknowledge this by proper transformation.\n const transformed = this._getTransformedByDeletion(sourcePosition, howMany);\n const isMoved = transformed === null ||\n (sourcePosition.isEqual(this) && this.stickiness == 'toNext') ||\n (sourcePosition.getShiftedBy(howMany).isEqual(this) && this.stickiness == 'toPrevious');\n if (isMoved) {\n // This position is inside moved range (or sticks to it).\n // In this case, we calculate a combination of this position, move source position and target position.\n return this._getCombined(sourcePosition, targetPosition);\n }\n else {\n // This position is not inside a removed range.\n //\n // In next step, we simply reflect inserting `howMany` nodes, which might further affect the position.\n return transformed._getTransformedByInsertion(targetPosition, howMany);\n }\n }\n /**\n * Returns a new position that is a combination of this position and given positions.\n *\n * The combined position is a copy of this position transformed by moving a range starting at `source` position\n * to the `target` position. It is expected that this position is inside the moved range.\n *\n * Example:\n *\n * ```ts\n * let original = model.createPositionFromPath( root, [ 2, 3, 1 ] );\n * let source = model.createPositionFromPath( root, [ 2, 2 ] );\n * let target = model.createPositionFromPath( otherRoot, [ 1, 1, 3 ] );\n * original._getCombined( source, target ); // path is [ 1, 1, 4, 1 ], root is `otherRoot`\n * ```\n *\n * Explanation:\n *\n * We have a position `[ 2, 3, 1 ]` and move some nodes from `[ 2, 2 ]` to `[ 1, 1, 3 ]`. The original position\n * was inside moved nodes and now should point to the new place. The moved nodes will be after\n * positions `[ 1, 1, 3 ]`, `[ 1, 1, 4 ]`, `[ 1, 1, 5 ]`. Since our position was in the second moved node,\n * the transformed position will be in a sub-tree of a node at `[ 1, 1, 4 ]`. Looking at original path, we\n * took care of `[ 2, 3 ]` part of it. Now we have to add the rest of the original path to the transformed path.\n * Finally, the transformed position will point to `[ 1, 1, 4, 1 ]`.\n *\n * @internal\n * @param source Beginning of the moved range.\n * @param target Position where the range is moved.\n * @returns Combined position.\n */\n _getCombined(source, target) {\n const i = source.path.length - 1;\n // The first part of a path to combined position is a path to the place where nodes were moved.\n const combined = Position._createAt(target);\n combined.stickiness = this.stickiness;\n // Then we have to update the rest of the path.\n // Fix the offset because this position might be after `from` position and we have to reflect that.\n combined.offset = combined.offset + this.path[i] - source.offset;\n // Then, add the rest of the path.\n // If this position is at the same level as `from` position nothing will get added.\n combined.path = [...combined.path, ...this.path.slice(i + 1)];\n return combined;\n }\n /**\n * @inheritDoc\n */\n toJSON() {\n return {\n root: this.root.toJSON(),\n path: Array.from(this.path),\n stickiness: this.stickiness\n };\n }\n /**\n * Returns a new position that is equal to current position.\n */\n clone() {\n return new this.constructor(this.root, this.path, this.stickiness);\n }\n /**\n * Creates position at the given location. The location can be specified as:\n *\n * * a {@link module:engine/model/position~Position position},\n * * parent element and offset (offset defaults to `0`),\n * * parent element and `'end'` (sets position at the end of that element),\n * * {@link module:engine/model/item~Item model item} and `'before'` or `'after'` (sets position before or after given model item).\n *\n * This method is a shortcut to other factory methods such as:\n *\n * * {@link module:engine/model/position~Position._createBefore},\n * * {@link module:engine/model/position~Position._createAfter}.\n *\n * @internal\n * @param offset Offset or one of the flags. Used only when the first parameter is a {@link module:engine/model/item~Item model item}.\n * @param stickiness Position stickiness. Used only when the first parameter is a {@link module:engine/model/item~Item model item}.\n */\n static _createAt(itemOrPosition, offset, stickiness = 'toNone') {\n if (itemOrPosition instanceof Position) {\n return new Position(itemOrPosition.root, itemOrPosition.path, itemOrPosition.stickiness);\n }\n else {\n const node = itemOrPosition;\n if (offset == 'end') {\n offset = node.maxOffset;\n }\n else if (offset == 'before') {\n return this._createBefore(node, stickiness);\n }\n else if (offset == 'after') {\n return this._createAfter(node, stickiness);\n }\n else if (offset !== 0 && !offset) {\n /**\n * {@link module:engine/model/model~Model#createPositionAt `Model#createPositionAt()`}\n * requires the offset to be specified when the first parameter is a model item.\n *\n * @error model-createpositionat-offset-required\n */\n throw new CKEditorError('model-createpositionat-offset-required', [this, itemOrPosition]);\n }\n if (!node.is('element') && !node.is('documentFragment')) {\n /**\n * Position parent have to be a model element or model document fragment.\n *\n * @error model-position-parent-incorrect\n */\n throw new CKEditorError('model-position-parent-incorrect', [this, itemOrPosition]);\n }\n const path = node.getPath();\n path.push(offset);\n return new this(node.root, path, stickiness);\n }\n }\n /**\n * Creates a new position, after given {@link module:engine/model/item~Item model item}.\n *\n * @internal\n * @param item Item after which the position should be placed.\n * @param stickiness Position stickiness.\n */\n static _createAfter(item, stickiness) {\n if (!item.parent) {\n /**\n * You can not make a position after a root element.\n *\n * @error model-position-after-root\n * @param root\n */\n throw new CKEditorError('model-position-after-root', [this, item], { root: item });\n }\n return this._createAt(item.parent, item.endOffset, stickiness);\n }\n /**\n * Creates a new position, before the given {@link module:engine/model/item~Item model item}.\n *\n * @internal\n * @param item Item before which the position should be placed.\n * @param stickiness Position stickiness.\n */\n static _createBefore(item, stickiness) {\n if (!item.parent) {\n /**\n * You can not make a position before a root element.\n *\n * @error model-position-before-root\n * @param root\n */\n throw new CKEditorError('model-position-before-root', item, { root: item });\n }\n return this._createAt(item.parent, item.startOffset, stickiness);\n }\n /**\n * Creates a `Position` instance from given plain object (i.e. parsed JSON string).\n *\n * @param json Plain object to be converted to `Position`.\n * @param doc Document object that will be position owner.\n * @returns `Position` instance created using given plain object.\n */\n static fromJSON(json, doc) {\n if (json.root === '$graveyard') {\n const pos = new Position(doc.graveyard, json.path);\n pos.stickiness = json.stickiness;\n return pos;\n }\n if (!doc.getRoot(json.root)) {\n /**\n * Cannot create position for document. Root with specified name does not exist.\n *\n * @error model-position-fromjson-no-root\n * @param rootName\n */\n throw new CKEditorError('model-position-fromjson-no-root', doc, { rootName: json.root });\n }\n return new Position(doc.getRoot(json.root), json.path, json.stickiness);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nPosition.prototype.is = function (type) {\n return type === 'position' || type === 'model:position';\n};\n/**\n * Returns a text node at the given position.\n *\n * This is a helper function optimized to reuse the position parent instance for performance reasons.\n *\n * Normally, you should use {@link module:engine/model/position~Position#textNode `Position#textNode`}.\n * If you start hitting performance issues with {@link module:engine/model/position~Position#parent `Position#parent`}\n * check if your algorithm does not access it multiple times (which can happen directly or indirectly via other position properties).\n *\n * See https://github.com/ckeditor/ckeditor5/issues/6579.\n *\n * See also:\n *\n * * {@link module:engine/model/position~getNodeAfterPosition}\n * * {@link module:engine/model/position~getNodeBeforePosition}\n *\n * @param positionParent The parent of the given position.\n */\nexport function getTextNodeAtPosition(position, positionParent) {\n const node = positionParent.getChild(positionParent.offsetToIndex(position.offset));\n if (node && node.is('$text') && node.startOffset < position.offset) {\n return node;\n }\n return null;\n}\n/**\n * Returns the node after the given position.\n *\n * This is a helper function optimized to reuse the position parent instance and the calculation of the text node at the\n * specific position for performance reasons.\n *\n * Normally, you should use {@link module:engine/model/position~Position#nodeAfter `Position#nodeAfter`}.\n * If you start hitting performance issues with {@link module:engine/model/position~Position#parent `Position#parent`} and/or\n * {@link module:engine/model/position~Position#textNode `Position#textNode`}\n * check if your algorithm does not access those properties multiple times\n * (which can happen directly or indirectly via other position properties).\n *\n * See https://github.com/ckeditor/ckeditor5/issues/6579 and https://github.com/ckeditor/ckeditor5/issues/6582.\n *\n * See also:\n *\n * * {@link module:engine/model/position~getTextNodeAtPosition}\n * * {@link module:engine/model/position~getNodeBeforePosition}\n *\n * @param positionParent The parent of the given position.\n * @param textNode Text node at the given position.\n */\nexport function getNodeAfterPosition(position, positionParent, textNode) {\n if (textNode !== null) {\n return null;\n }\n return positionParent.getChild(positionParent.offsetToIndex(position.offset));\n}\n/**\n * Returns the node before the given position.\n *\n * Refer to {@link module:engine/model/position~getNodeBeforePosition} for documentation on when to use this util method.\n *\n * See also:\n *\n * * {@link module:engine/model/position~getTextNodeAtPosition}\n * * {@link module:engine/model/position~getNodeAfterPosition}\n *\n * @param positionParent The parent of the given position.\n * @param textNode Text node at the given position.\n */\nexport function getNodeBeforePosition(position, positionParent, textNode) {\n if (textNode !== null) {\n return null;\n }\n return positionParent.getChild(positionParent.offsetToIndex(position.offset) - 1);\n}\n/**\n * This is a helper function for `Position#isTouching()`.\n *\n * It checks whether to given positions are touching, considering that they have the same root and paths\n * until given level, and at given level they differ by 1 (so they are branching at `level` point).\n *\n * The exact requirements for touching positions are described in `Position#isTouching()` and also\n * in the body of this function.\n *\n * @param left Position \"on the left\" (it is before `right`).\n * @param right Position \"on the right\" (it is after `left`).\n * @param level Level on which the positions are different.\n */\nfunction checkTouchingBranch(left, right, level) {\n if (level + 1 === left.path.length) {\n // Left position does not have any more entries after the point where the positions differ.\n // [ 2 ] vs [ 3 ]\n // [ 2 ] vs [ 3, 0, 0 ]\n // The positions are spread by node at [ 2 ].\n return false;\n }\n if (!checkOnlyZeroes(right.path, level + 1)) {\n // Right position does not have only zeroes, so we have situation like:\n // [ 2, maxOffset ] vs [ 3, 1 ]\n // [ 2, maxOffset ] vs [ 3, 1, 0, 0 ]\n // The positions are spread by node at [ 3, 0 ].\n return false;\n }\n if (!checkOnlyMaxOffset(left, level + 1)) {\n // Left position does not have only max offsets, so we have situation like:\n // [ 2, 4 ] vs [ 3 ]\n // [ 2, 4 ] vs [ 3, 0, 0 ]\n // The positions are spread by node at [ 2, 5 ].\n return false;\n }\n // Left position has only max offsets and right position has only zeroes or nothing.\n // [ 2, maxOffset ] vs [ 3 ]\n // [ 2, maxOffset, maxOffset ] vs [ 3, 0 ]\n // There are not elements between positions. The positions are touching.\n return true;\n}\n/**\n * Checks whether for given array, starting from given index until the end of the array, all items are `0`s.\n *\n * This is a helper function for `Position#isTouching()`.\n */\nfunction checkOnlyZeroes(arr, idx) {\n while (idx < arr.length) {\n if (arr[idx] !== 0) {\n return false;\n }\n idx++;\n }\n return true;\n}\n/**\n * Checks whether for given position, starting from given path level, whether the position is at the end of\n * its parent and whether each element on the path to the position is also at at the end of its parent.\n *\n * This is a helper function for `Position#isTouching()`.\n */\nfunction checkOnlyMaxOffset(pos, level) {\n let parent = pos.parent;\n let idx = pos.path.length - 1;\n let add = 0;\n while (idx >= level) {\n if (pos.path[idx] + add !== parent.maxOffset) {\n return false;\n }\n // After the first check, we \"go up\", and check whether the position's parent-parent is the last element.\n // However, we need to add 1 to the value in the path to \"simulate\" moving the path after the parent.\n // It happens just once.\n add = 1;\n idx--;\n parent = parent.parent;\n }\n return true;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/range\n */\nimport TypeCheckable from './typecheckable';\nimport Position from './position';\nimport TreeWalker from './treewalker';\nimport { CKEditorError, compareArrays } from '@ckeditor/ckeditor5-utils';\n/**\n * Represents a range in the model tree.\n *\n * A range is defined by its {@link module:engine/model/range~Range#start} and {@link module:engine/model/range~Range#end}\n * positions.\n *\n * You can create range instances via its constructor or the `createRange*()` factory methods of\n * {@link module:engine/model/model~Model} and {@link module:engine/model/writer~Writer}.\n */\nexport default class Range extends TypeCheckable {\n /**\n * Creates a range spanning from `start` position to `end` position.\n *\n * @param start The start position.\n * @param end The end position. If not set, the range will be collapsed at the `start` position.\n */\n constructor(start, end) {\n super();\n this.start = Position._createAt(start);\n this.end = end ? Position._createAt(end) : Position._createAt(start);\n // If the range is collapsed, treat in a similar way as a position and set its boundaries stickiness to 'toNone'.\n // In other case, make the boundaries stick to the \"inside\" of the range.\n this.start.stickiness = this.isCollapsed ? 'toNone' : 'toNext';\n this.end.stickiness = this.isCollapsed ? 'toNone' : 'toPrevious';\n }\n /**\n * Iterable interface.\n *\n * Iterates over all {@link module:engine/model/item~Item items} that are in this range and returns\n * them together with additional information like length or {@link module:engine/model/position~Position positions},\n * grouped as {@link module:engine/model/treewalker~TreeWalkerValue}.\n * It iterates over all {@link module:engine/model/textproxy~TextProxy text contents} that are inside the range\n * and all the {@link module:engine/model/element~Element}s that are entered into when iterating over this range.\n *\n * This iterator uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range\n * and `ignoreElementEnd` option set to `true`.\n */\n *[Symbol.iterator]() {\n yield* new TreeWalker({ boundaries: this, ignoreElementEnd: true });\n }\n /**\n * Describes whether the range is collapsed, that is if {@link #start} and\n * {@link #end} positions are equal.\n */\n get isCollapsed() {\n return this.start.isEqual(this.end);\n }\n /**\n * Describes whether this range is flat, that is if {@link #start} position and\n * {@link #end} position are in the same {@link module:engine/model/position~Position#parent}.\n */\n get isFlat() {\n const startParentPath = this.start.getParentPath();\n const endParentPath = this.end.getParentPath();\n return compareArrays(startParentPath, endParentPath) == 'same';\n }\n /**\n * Range root element.\n */\n get root() {\n return this.start.root;\n }\n /**\n * Checks whether this range contains given {@link module:engine/model/position~Position position}.\n *\n * @param position Position to check.\n * @returns `true` if given {@link module:engine/model/position~Position position} is contained\n * in this range,`false` otherwise.\n */\n containsPosition(position) {\n return position.isAfter(this.start) && position.isBefore(this.end);\n }\n /**\n * Checks whether this range contains given {@link ~Range range}.\n *\n * @param otherRange Range to check.\n * @param loose Whether the check is loose or strict. If the check is strict (`false`), compared range cannot\n * start or end at the same position as this range boundaries. If the check is loose (`true`), compared range can start, end or\n * even be equal to this range. Note that collapsed ranges are always compared in strict mode.\n * @returns {Boolean} `true` if given {@link ~Range range} boundaries are contained by this range, `false` otherwise.\n */\n containsRange(otherRange, loose = false) {\n if (otherRange.isCollapsed) {\n loose = false;\n }\n const containsStart = this.containsPosition(otherRange.start) || (loose && this.start.isEqual(otherRange.start));\n const containsEnd = this.containsPosition(otherRange.end) || (loose && this.end.isEqual(otherRange.end));\n return containsStart && containsEnd;\n }\n /**\n * Checks whether given {@link module:engine/model/item~Item} is inside this range.\n */\n containsItem(item) {\n const pos = Position._createBefore(item);\n return this.containsPosition(pos) || this.start.isEqual(pos);\n }\n /**\n * Two ranges are equal if their {@link #start} and {@link #end} positions are equal.\n *\n * @param otherRange Range to compare with.\n * @returns `true` if ranges are equal, `false` otherwise.\n */\n isEqual(otherRange) {\n return this.start.isEqual(otherRange.start) && this.end.isEqual(otherRange.end);\n }\n /**\n * Checks and returns whether this range intersects with given range.\n *\n * @param otherRange Range to compare with.\n * @returns `true` if ranges intersect, `false` otherwise.\n */\n isIntersecting(otherRange) {\n return this.start.isBefore(otherRange.end) && this.end.isAfter(otherRange.start);\n }\n /**\n * Computes which part(s) of this {@link ~Range range} is not a part of given {@link ~Range range}.\n * Returned array contains zero, one or two {@link ~Range ranges}.\n *\n * Examples:\n *\n * ```ts\n * let range = model.createRange(\n * \tmodel.createPositionFromPath( root, [ 2, 7 ] ),\n * \tmodel.createPositionFromPath( root, [ 4, 0, 1 ] )\n * );\n * let otherRange = model.createRange( model.createPositionFromPath( root, [ 1 ] ), model.createPositionFromPath( root, [ 5 ] ) );\n * let transformed = range.getDifference( otherRange );\n * // transformed array has no ranges because `otherRange` contains `range`\n *\n * otherRange = model.createRange( model.createPositionFromPath( root, [ 1 ] ), model.createPositionFromPath( root, [ 3 ] ) );\n * transformed = range.getDifference( otherRange );\n * // transformed array has one range: from [ 3 ] to [ 4, 0, 1 ]\n *\n * otherRange = model.createRange( model.createPositionFromPath( root, [ 3 ] ), model.createPositionFromPath( root, [ 4 ] ) );\n * transformed = range.getDifference( otherRange );\n * // transformed array has two ranges: from [ 2, 7 ] to [ 3 ] and from [ 4 ] to [ 4, 0, 1 ]\n * ```\n *\n * @param otherRange Range to differentiate against.\n * @returns The difference between ranges.\n */\n getDifference(otherRange) {\n const ranges = [];\n if (this.isIntersecting(otherRange)) {\n // Ranges intersect.\n if (this.containsPosition(otherRange.start)) {\n // Given range start is inside this range. This means that we have to\n // add shrunken range - from the start to the middle of this range.\n ranges.push(new Range(this.start, otherRange.start));\n }\n if (this.containsPosition(otherRange.end)) {\n // Given range end is inside this range. This means that we have to\n // add shrunken range - from the middle of this range to the end.\n ranges.push(new Range(otherRange.end, this.end));\n }\n }\n else {\n // Ranges do not intersect, return the original range.\n ranges.push(new Range(this.start, this.end));\n }\n return ranges;\n }\n /**\n * Returns an intersection of this {@link ~Range range} and given {@link ~Range range}.\n * Intersection is a common part of both of those ranges. If ranges has no common part, returns `null`.\n *\n * Examples:\n *\n * ```ts\n * let range = model.createRange(\n * \tmodel.createPositionFromPath( root, [ 2, 7 ] ),\n * \tmodel.createPositionFromPath( root, [ 4, 0, 1 ] )\n * );\n * let otherRange = model.createRange( model.createPositionFromPath( root, [ 1 ] ), model.createPositionFromPath( root, [ 2 ] ) );\n * let transformed = range.getIntersection( otherRange ); // null - ranges have no common part\n *\n * otherRange = model.createRange( model.createPositionFromPath( root, [ 3 ] ), model.createPositionFromPath( root, [ 5 ] ) );\n * transformed = range.getIntersection( otherRange ); // range from [ 3 ] to [ 4, 0, 1 ]\n * ```\n *\n * @param otherRange Range to check for intersection.\n * @returns A common part of given ranges or `null` if ranges have no common part.\n */\n getIntersection(otherRange) {\n if (this.isIntersecting(otherRange)) {\n // Ranges intersect, so a common range will be returned.\n // At most, it will be same as this range.\n let commonRangeStart = this.start;\n let commonRangeEnd = this.end;\n if (this.containsPosition(otherRange.start)) {\n // Given range start is inside this range. This means thaNt we have to\n // shrink common range to the given range start.\n commonRangeStart = otherRange.start;\n }\n if (this.containsPosition(otherRange.end)) {\n // Given range end is inside this range. This means that we have to\n // shrink common range to the given range end.\n commonRangeEnd = otherRange.end;\n }\n return new Range(commonRangeStart, commonRangeEnd);\n }\n // Ranges do not intersect, so they do not have common part.\n return null;\n }\n /**\n * Returns a range created by joining this {@link ~Range range} with the given {@link ~Range range}.\n * If ranges have no common part, returns `null`.\n *\n * Examples:\n *\n * ```ts\n * let range = model.createRange(\n * \tmodel.createPositionFromPath( root, [ 2, 7 ] ),\n * \tmodel.createPositionFromPath( root, [ 4, 0, 1 ] )\n * );\n * let otherRange = model.createRange(\n * \tmodel.createPositionFromPath( root, [ 1 ] ),\n * \tmodel.createPositionFromPath( root, [ 2 ] )\n * );\n * let transformed = range.getJoined( otherRange ); // null - ranges have no common part\n *\n * otherRange = model.createRange(\n * \tmodel.createPositionFromPath( root, [ 3 ] ),\n * \tmodel.createPositionFromPath( root, [ 5 ] )\n * );\n * transformed = range.getJoined( otherRange ); // range from [ 2, 7 ] to [ 5 ]\n * ```\n *\n * @param otherRange Range to be joined.\n * @param loose Whether the intersection check is loose or strict. If the check is strict (`false`),\n * ranges are tested for intersection or whether start/end positions are equal. If the check is loose (`true`),\n * compared range is also checked if it's {@link module:engine/model/position~Position#isTouching touching} current range.\n * @returns A sum of given ranges or `null` if ranges have no common part.\n */\n getJoined(otherRange, loose = false) {\n let shouldJoin = this.isIntersecting(otherRange);\n if (!shouldJoin) {\n if (this.start.isBefore(otherRange.start)) {\n shouldJoin = loose ? this.end.isTouching(otherRange.start) : this.end.isEqual(otherRange.start);\n }\n else {\n shouldJoin = loose ? otherRange.end.isTouching(this.start) : otherRange.end.isEqual(this.start);\n }\n }\n if (!shouldJoin) {\n return null;\n }\n let startPosition = this.start;\n let endPosition = this.end;\n if (otherRange.start.isBefore(startPosition)) {\n startPosition = otherRange.start;\n }\n if (otherRange.end.isAfter(endPosition)) {\n endPosition = otherRange.end;\n }\n return new Range(startPosition, endPosition);\n }\n /**\n * Computes and returns the smallest set of {@link #isFlat flat} ranges, that covers this range in whole.\n *\n * See an example of a model structure (`[` and `]` are range boundaries):\n *\n * ```\n * root root\n * |- element DIV DIV P2 P3 DIV\n * | |- element H H P1 f o o b a r H P4\n * | | |- \"fir[st\" fir[st lorem se]cond ipsum\n * | |- element P1\n * | | |- \"lorem\" ||\n * |- element P2 ||\n * | |- \"foo\" VV\n * |- element P3\n * | |- \"bar\" root\n * |- element DIV DIV [P2 P3] DIV\n * | |- element H H [P1] f o o b a r H P4\n * | | |- \"se]cond\" fir[st] lorem [se]cond ipsum\n * | |- element P4\n * | | |- \"ipsum\"\n * ```\n *\n * As it can be seen, letters contained in the range are: `stloremfoobarse`, spread across different parents.\n * We are looking for minimal set of flat ranges that contains the same nodes.\n *\n * Minimal flat ranges for above range `( [ 0, 0, 3 ], [ 3, 0, 2 ] )` will be:\n *\n * ```\n * ( [ 0, 0, 3 ], [ 0, 0, 5 ] ) = \"st\"\n * ( [ 0, 1 ], [ 0, 2 ] ) = element P1 (\"lorem\")\n * ( [ 1 ], [ 3 ] ) = element P2, element P3 (\"foobar\")\n * ( [ 3, 0, 0 ], [ 3, 0, 2 ] ) = \"se\"\n * ```\n *\n * **Note:** if an {@link module:engine/model/element~Element element} is not wholly contained in this range, it won't be returned\n * 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 * were omitted. Only their parts that were wholly in the range were returned.\n *\n * **Note:** this method is not returning flat ranges that contain no nodes.\n *\n * @returns Array of flat ranges covering this range.\n */\n getMinimalFlatRanges() {\n const ranges = [];\n const diffAt = this.start.getCommonPath(this.end).length;\n const pos = Position._createAt(this.start);\n let posParent = pos.parent;\n // Go up.\n while (pos.path.length > diffAt + 1) {\n const howMany = posParent.maxOffset - pos.offset;\n if (howMany !== 0) {\n ranges.push(new Range(pos, pos.getShiftedBy(howMany)));\n }\n pos.path = pos.path.slice(0, -1);\n pos.offset++;\n posParent = posParent.parent;\n }\n // Go down.\n while (pos.path.length <= this.end.path.length) {\n const offset = this.end.path[pos.path.length - 1];\n const howMany = offset - pos.offset;\n if (howMany !== 0) {\n ranges.push(new Range(pos, pos.getShiftedBy(howMany)));\n }\n pos.offset = offset;\n pos.path.push(0);\n }\n return ranges;\n }\n /**\n * Creates a {@link module:engine/model/treewalker~TreeWalker TreeWalker} instance with this range as a boundary.\n *\n * For example, to iterate over all items in the entire document root:\n *\n * ```ts\n * // Create a range spanning over the entire root content:\n * const range = editor.model.createRangeIn( editor.model.document.getRoot() );\n *\n * // Iterate over all items in this range:\n * for ( const value of range.getWalker() ) {\n * \tconsole.log( value.item );\n * }\n * ```\n *\n * @param options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.\n */\n getWalker(options = {}) {\n options.boundaries = this;\n return new TreeWalker(options);\n }\n /**\n * Returns an iterator that iterates over all {@link module:engine/model/item~Item items} that are in this range and returns\n * them.\n *\n * This method uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range and `ignoreElementEnd` option\n * set to `true`. However it returns only {@link module:engine/model/item~Item model items},\n * not {@link module:engine/model/treewalker~TreeWalkerValue}.\n *\n * You may specify additional options for the tree walker. See {@link module:engine/model/treewalker~TreeWalker} for\n * a full list of available options.\n *\n * @param options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.\n */\n *getItems(options = {}) {\n options.boundaries = this;\n options.ignoreElementEnd = true;\n const treeWalker = new TreeWalker(options);\n for (const value of treeWalker) {\n yield value.item;\n }\n }\n /**\n * Returns an iterator that iterates over all {@link module:engine/model/position~Position positions} that are boundaries or\n * contained in this range.\n *\n * This method uses {@link module:engine/model/treewalker~TreeWalker} with `boundaries` set to this range. However it returns only\n * {@link module:engine/model/position~Position positions}, not {@link module:engine/model/treewalker~TreeWalkerValue}.\n *\n * You may specify additional options for the tree walker. See {@link module:engine/model/treewalker~TreeWalker} for\n * a full list of available options.\n *\n * @param options Object with configuration options. See {@link module:engine/model/treewalker~TreeWalker}.\n */\n *getPositions(options = {}) {\n options.boundaries = this;\n const treeWalker = new TreeWalker(options);\n yield treeWalker.position;\n for (const value of treeWalker) {\n yield value.nextPosition;\n }\n }\n /**\n * Returns a range that is a result of transforming this range by given `operation`.\n *\n * **Note:** transformation may break one range into multiple ranges (for example, when a part of the range is\n * moved to a different part of document tree). For this reason, an array is returned by this method and it\n * may contain one or more `Range` instances.\n *\n * @param operation Operation to transform range by.\n * @returns Range which is the result of transformation.\n */\n getTransformedByOperation(operation) {\n switch (operation.type) {\n case 'insert':\n return this._getTransformedByInsertOperation(operation);\n case 'move':\n case 'remove':\n case 'reinsert':\n return this._getTransformedByMoveOperation(operation);\n case 'split':\n return [this._getTransformedBySplitOperation(operation)];\n case 'merge':\n return [this._getTransformedByMergeOperation(operation)];\n }\n return [new Range(this.start, this.end)];\n }\n /**\n * Returns a range that is a result of transforming this range by multiple `operations`.\n *\n * @see ~Range#getTransformedByOperation\n * @param operations Operations to transform the range by.\n * @returns Range which is the result of transformation.\n */\n getTransformedByOperations(operations) {\n const ranges = [new Range(this.start, this.end)];\n for (const operation of operations) {\n for (let i = 0; i < ranges.length; i++) {\n const result = ranges[i].getTransformedByOperation(operation);\n ranges.splice(i, 1, ...result);\n i += result.length - 1;\n }\n }\n // It may happen that a range is split into two, and then the part of second \"piece\" is moved into first\n // \"piece\". In this case we will have incorrect third range, which should not be included in the result --\n // because it is already included in the first \"piece\". In this loop we are looking for all such ranges that\n // are inside other ranges and we simply remove them.\n for (let i = 0; i < ranges.length; i++) {\n const range = ranges[i];\n for (let j = i + 1; j < ranges.length; j++) {\n const next = ranges[j];\n if (range.containsRange(next) || next.containsRange(range) || range.isEqual(next)) {\n ranges.splice(j, 1);\n }\n }\n }\n return ranges;\n }\n /**\n * Returns an {@link module:engine/model/element~Element} or {@link module:engine/model/documentfragment~DocumentFragment}\n * which is a common ancestor of the range's both ends (in which the entire range is contained).\n */\n getCommonAncestor() {\n return this.start.getCommonAncestor(this.end);\n }\n /**\n * Returns an {@link module:engine/model/element~Element Element} contained by the range.\n * The element will be returned when it is the **only** node within the range and **fullycontained**\n * at the same time.\n */\n getContainedElement() {\n if (this.isCollapsed) {\n return null;\n }\n const nodeAfterStart = this.start.nodeAfter;\n const nodeBeforeEnd = this.end.nodeBefore;\n if (nodeAfterStart && nodeAfterStart.is('element') && nodeAfterStart === nodeBeforeEnd) {\n return nodeAfterStart;\n }\n return null;\n }\n /**\n * Converts `Range` to plain object and returns it.\n *\n * @returns `Node` converted to plain object.\n */\n toJSON() {\n return {\n start: this.start.toJSON(),\n end: this.end.toJSON()\n };\n }\n /**\n * Returns a new range that is equal to current range.\n */\n clone() {\n return new this.constructor(this.start, this.end);\n }\n /**\n * Returns a result of transforming a copy of this range by insert operation.\n *\n * One or more ranges may be returned as a result of this transformation.\n *\n * @internal\n */\n _getTransformedByInsertOperation(operation, spread = false) {\n return this._getTransformedByInsertion(operation.position, operation.howMany, spread);\n }\n /**\n * Returns a result of transforming a copy of this range by move operation.\n *\n * One or more ranges may be returned as a result of this transformation.\n *\n * @internal\n */\n _getTransformedByMoveOperation(operation, spread = false) {\n const sourcePosition = operation.sourcePosition;\n const howMany = operation.howMany;\n const targetPosition = operation.targetPosition;\n return this._getTransformedByMove(sourcePosition, targetPosition, howMany, spread);\n }\n /**\n * Returns a result of transforming a copy of this range by split operation.\n *\n * Always one range is returned. The transformation is done in a way to not break the range.\n *\n * @internal\n */\n _getTransformedBySplitOperation(operation) {\n const start = this.start._getTransformedBySplitOperation(operation);\n let end = this.end._getTransformedBySplitOperation(operation);\n if (this.end.isEqual(operation.insertionPosition)) {\n end = this.end.getShiftedBy(1);\n }\n // Below may happen when range contains graveyard element used by split operation.\n if (start.root != end.root) {\n // End position was next to the moved graveyard element and was moved with it.\n // Fix it by using old `end` which has proper `root`.\n end = this.end.getShiftedBy(-1);\n }\n return new Range(start, end);\n }\n /**\n * Returns a result of transforming a copy of this range by merge operation.\n *\n * Always one range is returned. The transformation is done in a way to not break the range.\n *\n * @internal\n */\n _getTransformedByMergeOperation(operation) {\n // Special case when the marker is set on \"the closing tag\" of an element. Marker can be set like that during\n // transformations, especially when a content of a few block elements were removed. For example:\n //\n // {} is the transformed range, [] is the removed range.\n // <p>F[o{o</p><p>B}ar</p><p>Xy]z</p>\n //\n // <p>Fo{o</p><p>B}ar</p><p>z</p>\n // <p>F{</p><p>B}ar</p><p>z</p>\n // <p>F{</p>}<p>z</p>\n // <p>F{}z</p>\n //\n if (this.start.isEqual(operation.targetPosition) && this.end.isEqual(operation.deletionPosition)) {\n return new Range(this.start);\n }\n let start = this.start._getTransformedByMergeOperation(operation);\n let end = this.end._getTransformedByMergeOperation(operation);\n if (start.root != end.root) {\n // This happens when the end position was next to the merged (deleted) element.\n // Then, the end position was moved to the graveyard root. In this case we need to fix\n // the range cause its boundaries would be in different roots.\n end = this.end.getShiftedBy(-1);\n }\n if (start.isAfter(end)) {\n // This happens in three following cases:\n //\n // Case 1: Merge operation source position is before the target position (due to some transformations, OT, etc.)\n // This means that start can be moved before the end of the range.\n //\n // Before: <p>a{a</p><p>b}b</p><p>cc</p>\n // Merge: <p>b}b</p><p>cca{a</p>\n // Fix: <p>{b}b</p><p>ccaa</p>\n //\n // Case 2: Range start is before merged node but not directly.\n // Result should include all nodes that were in the original range.\n //\n // Before: <p>aa</p>{<p>cc</p><p>b}b</p>\n // Merge: <p>aab}b</p>{<p>cc</p>\n // Fix: <p>aa{bb</p><p>cc</p>}\n //\n // The range is expanded by an additional `b` letter but it is better than dropping the whole `cc` paragraph.\n //\n // Case 3: Range start is directly before merged node.\n // Resulting range should include only nodes from the merged element:\n //\n // Before: <p>aa</p>{<p>b}b</p><p>cc</p>\n // Merge: <p>aab}b</p>{<p>cc</p>\n // Fix: <p>aa{b}b</p><p>cc</p>\n //\n if (operation.sourcePosition.isBefore(operation.targetPosition)) {\n // Case 1.\n start = Position._createAt(end);\n start.offset = 0;\n }\n else {\n if (!operation.deletionPosition.isEqual(start)) {\n // Case 2.\n end = operation.deletionPosition;\n }\n // In both case 2 and 3 start is at the end of the merge-to element.\n start = operation.targetPosition;\n }\n return new Range(start, end);\n }\n return new Range(start, end);\n }\n /**\n * Returns an array containing one or two {@link ~Range ranges} that are a result of transforming this\n * {@link ~Range range} by inserting `howMany` nodes at `insertPosition`. Two {@link ~Range ranges} are\n * returned if the insertion was inside this {@link ~Range range} and `spread` is set to `true`.\n *\n * Examples:\n *\n * ```ts\n * let range = model.createRange(\n * \tmodel.createPositionFromPath( root, [ 2, 7 ] ),\n * \tmodel.createPositionFromPath( root, [ 4, 0, 1 ] )\n * );\n * let transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 1 ] ), 2 );\n * // transformed array has one range from [ 4, 7 ] to [ 6, 0, 1 ]\n *\n * transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 4, 0, 0 ] ), 4 );\n * // transformed array has one range from [ 2, 7 ] to [ 4, 0, 5 ]\n *\n * transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 3, 2 ] ), 4 );\n * // transformed array has one range, which is equal to original range\n *\n * transformed = range._getTransformedByInsertion( model.createPositionFromPath( root, [ 3, 2 ] ), 4, true );\n * // transformed array has two ranges: from [ 2, 7 ] to [ 3, 2 ] and from [ 3, 6 ] to [ 4, 0, 1 ]\n * ```\n *\n * @internal\n * @param insertPosition Position where nodes are inserted.\n * @param howMany How many nodes are inserted.\n * @param spread Flag indicating whether this range should be spread if insertion\n * was inside the range. Defaults to `false`.\n * @returns Result of the transformation.\n */\n _getTransformedByInsertion(insertPosition, howMany, spread = false) {\n if (spread && this.containsPosition(insertPosition)) {\n // Range has to be spread. The first part is from original start to the spread point.\n // The other part is from spread point to the original end, but transformed by\n // insertion to reflect insertion changes.\n return [\n new Range(this.start, insertPosition),\n new Range(insertPosition.getShiftedBy(howMany), this.end._getTransformedByInsertion(insertPosition, howMany))\n ];\n }\n else {\n const range = new Range(this.start, this.end);\n range.start = range.start._getTransformedByInsertion(insertPosition, howMany);\n range.end = range.end._getTransformedByInsertion(insertPosition, howMany);\n return [range];\n }\n }\n /**\n * Returns an array containing {@link ~Range ranges} that are a result of transforming this\n * {@link ~Range range} by moving `howMany` nodes from `sourcePosition` to `targetPosition`.\n *\n * @internal\n * @param sourcePosition Position from which nodes are moved.\n * @param targetPosition Position to where nodes are moved.\n * @param howMany How many nodes are moved.\n * @param spread Whether the range should be spread if the move points inside the range.\n * @returns Result of the transformation.\n */\n _getTransformedByMove(sourcePosition, targetPosition, howMany, spread = false) {\n // Special case for transforming a collapsed range. Just transform it like a position.\n if (this.isCollapsed) {\n const newPos = this.start._getTransformedByMove(sourcePosition, targetPosition, howMany);\n return [new Range(newPos)];\n }\n // Special case for transformation when a part of the range is moved towards the range.\n //\n // Examples:\n //\n // <div><p>ab</p><p>c[d</p></div><p>e]f</p> --> <div><p>ab</p></div><p>c[d</p><p>e]f</p>\n // <p>e[f</p><div><p>a]b</p><p>cd</p></div> --> <p>e[f</p><p>a]b</p><div><p>cd</p></div>\n //\n // Without this special condition, the default algorithm leaves an \"artifact\" range from one of `differenceSet` parts:\n //\n // <div><p>ab</p><p>c[d</p></div><p>e]f</p> --> <div><p>ab</p>{</div>}<p>c[d</p><p>e]f</p>\n //\n // This special case is applied only if the range is to be kept together (not spread).\n const moveRange = Range._createFromPositionAndShift(sourcePosition, howMany);\n const insertPosition = targetPosition._getTransformedByDeletion(sourcePosition, howMany);\n if (this.containsPosition(targetPosition) && !spread) {\n if (moveRange.containsPosition(this.start) || moveRange.containsPosition(this.end)) {\n const start = this.start._getTransformedByMove(sourcePosition, targetPosition, howMany);\n const end = this.end._getTransformedByMove(sourcePosition, targetPosition, howMany);\n return [new Range(start, end)];\n }\n }\n // Default algorithm.\n let result;\n const differenceSet = this.getDifference(moveRange);\n let difference = null;\n const common = this.getIntersection(moveRange);\n if (differenceSet.length == 1) {\n // `moveRange` and this range may intersect but may be separate.\n difference = new Range(differenceSet[0].start._getTransformedByDeletion(sourcePosition, howMany), differenceSet[0].end._getTransformedByDeletion(sourcePosition, howMany));\n }\n else if (differenceSet.length == 2) {\n // `moveRange` is inside this range.\n difference = new Range(this.start, this.end._getTransformedByDeletion(sourcePosition, howMany));\n } // else, `moveRange` contains this range.\n if (difference) {\n result = difference._getTransformedByInsertion(insertPosition, howMany, common !== null || spread);\n }\n else {\n result = [];\n }\n if (common) {\n const transformedCommon = new Range(common.start._getCombined(moveRange.start, insertPosition), common.end._getCombined(moveRange.start, insertPosition));\n if (result.length == 2) {\n result.splice(1, 0, transformedCommon);\n }\n else {\n result.push(transformedCommon);\n }\n }\n return result;\n }\n /**\n * Returns a copy of this range that is transformed by deletion of `howMany` nodes from `deletePosition`.\n *\n * If the deleted range is intersecting with the transformed range, the transformed range will be shrank.\n *\n * If the deleted range contains transformed range, `null` will be returned.\n *\n * @internal\n * @param deletionPosition Position from which nodes are removed.\n * @param howMany How many nodes are removed.\n * @returns Result of the transformation.\n */\n _getTransformedByDeletion(deletePosition, howMany) {\n let newStart = this.start._getTransformedByDeletion(deletePosition, howMany);\n let newEnd = this.end._getTransformedByDeletion(deletePosition, howMany);\n if (newStart == null && newEnd == null) {\n return null;\n }\n if (newStart == null) {\n newStart = deletePosition;\n }\n if (newEnd == null) {\n newEnd = deletePosition;\n }\n return new Range(newStart, newEnd);\n }\n /**\n * Creates a new range, spreading from specified {@link module:engine/model/position~Position position} to a position moved by\n * given `shift`. If `shift` is a negative value, shifted position is treated as the beginning of the range.\n *\n * @internal\n * @param position Beginning of the range.\n * @param shift How long the range should be.\n */\n static _createFromPositionAndShift(position, shift) {\n const start = position;\n const end = position.getShiftedBy(shift);\n return shift > 0 ? new this(start, end) : new this(end, start);\n }\n /**\n * Creates a range inside an {@link module:engine/model/element~Element element} which starts before the first child of\n * that element and ends after the last child of that element.\n *\n * @internal\n * @param element Element which is a parent for the range.\n */\n static _createIn(element) {\n return new this(Position._createAt(element, 0), Position._createAt(element, element.maxOffset));\n }\n /**\n * Creates a range that starts before given {@link module:engine/model/item~Item model item} and ends after it.\n *\n * @internal\n */\n static _createOn(item) {\n return this._createFromPositionAndShift(Position._createBefore(item), item.offsetSize);\n }\n /**\n * Combines all ranges from the passed array into a one range. At least one range has to be passed.\n * Passed ranges must not have common parts.\n *\n * The first range from the array is a reference range. If other ranges start or end on the exactly same position where\n * the reference range, they get combined into one range.\n *\n * ```\n * [ ][] [ ][ ][ ][ ][] [ ] // Passed ranges, shown sorted\n * [ ] // The result of the function if the first range was a reference range.\n * [ ] // The result of the function if the third-to-seventh range was a reference range.\n * [ ] // The result of the function if the last range was a reference range.\n * ```\n *\n * @internal\n * @param ranges Ranges to combine.\n * @returns Combined range.\n */\n static _createFromRanges(ranges) {\n if (ranges.length === 0) {\n /**\n * At least one range has to be passed to\n * {@link module:engine/model/range~Range._createFromRanges `Range._createFromRanges()`}.\n *\n * @error range-create-from-ranges-empty-array\n */\n throw new CKEditorError('range-create-from-ranges-empty-array', null);\n }\n else if (ranges.length == 1) {\n return ranges[0].clone();\n }\n // 1. Set the first range in `ranges` array as a reference range.\n // If we are going to return just a one range, one of the ranges need to be the reference one.\n // Other ranges will be stuck to that range, if possible.\n const ref = ranges[0];\n // 2. Sort all the ranges so it's easier to process them.\n ranges.sort((a, b) => {\n return a.start.isAfter(b.start) ? 1 : -1;\n });\n // 3. Check at which index the reference range is now.\n const refIndex = ranges.indexOf(ref);\n // 4. At this moment we don't need the original range.\n // We are going to modify the result and we need to return a new instance of Range.\n // We have to create a copy of the reference range.\n const result = new this(ref.start, ref.end);\n // 5. Ranges should be checked and glued starting from the range that is closest to the reference range.\n // Since ranges are sorted, start with the range with index that is closest to reference range index.\n if (refIndex > 0) {\n // eslint-disable-next-line no-constant-condition\n for (let i = refIndex - 1; true; i++) {\n if (ranges[i].end.isEqual(result.start)) {\n result.start = Position._createAt(ranges[i].start);\n }\n else {\n // If ranges are not starting/ending at the same position there is no point in looking further.\n break;\n }\n }\n }\n // 6. Ranges should be checked and glued starting from the range that is closest to the reference range.\n // Since ranges are sorted, start with the range with index that is closest to reference range index.\n for (let i = refIndex + 1; i < ranges.length; i++) {\n if (ranges[i].start.isEqual(result.end)) {\n result.end = Position._createAt(ranges[i].end);\n }\n else {\n // If ranges are not starting/ending at the same position there is no point in looking further.\n break;\n }\n }\n return result;\n }\n /**\n * Creates a `Range` instance from given plain object (i.e. parsed JSON string).\n *\n * @param json Plain object to be converted to `Range`.\n * @param doc Document object that will be range owner.\n * @returns `Range` instance created using given plain object.\n */\n static fromJSON(json, doc) {\n return new this(Position.fromJSON(json.start, doc), Position.fromJSON(json.end, doc));\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nRange.prototype.is = function (type) {\n return type === 'range' || type === 'model:range';\n};\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/conversion/mapper\n */\nimport ModelPosition from '../model/position';\nimport ModelRange from '../model/range';\nimport ViewPosition from '../view/position';\nimport ViewRange from '../view/range';\nimport ViewText from '../view/text';\nimport { CKEditorError, EmitterMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * Maps elements, positions and markers between the {@link module:engine/view/document~Document view} and\n * the {@link module:engine/model/model model}.\n *\n * The instance of the Mapper used for the editing pipeline is available in\n * {@link module:engine/controller/editingcontroller~EditingController#mapper `editor.editing.mapper`}.\n *\n * Mapper uses 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 the complex model to/from view relations, you may provide custom callbacks for the\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 the {@link module:engine/conversion/mapper~Mapper#toViewPosition toViewPosition}\n * and {@link module:engine/conversion/mapper~Mapper#toModelPosition toModelPosition} methods. `Mapper` adds its 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 extends EmitterMixin() {\n /**\n * Creates an instance of the mapper.\n */\n constructor() {\n super();\n /**\n * Model element to view element mapping.\n */\n this._modelToViewMapping = new WeakMap();\n /**\n * View element to model element mapping.\n */\n this._viewToModelMapping = new WeakMap();\n /**\n * A map containing callbacks between view element names and functions evaluating length of view elements\n * in model.\n */\n this._viewToModelLengthCallbacks = new Map();\n /**\n * Model marker name to view elements mapping.\n *\n * Keys are `String`s while values are `Set`s with {@link module:engine/view/element~Element view elements}.\n * One marker (name) can be mapped to multiple elements.\n */\n this._markerNameToElements = new Map();\n /**\n * View element to model marker names mapping.\n *\n * This is reverse to {@link ~Mapper#_markerNameToElements} map.\n */\n this._elementToMarkerNames = new Map();\n /**\n * The map of removed view elements with their current root (used for deferred unbinding).\n */\n this._deferredBindingRemovals = new Map();\n /**\n * Stores marker names of markers which have changed due to unbinding a view element (so it is assumed that the view element\n * has been removed, moved or renamed).\n */\n this._unboundMarkerNames = new Set();\n // Default mapper algorithm for mapping model position to view position.\n this.on('modelToViewPosition', (evt, data) => {\n if (data.viewPosition) {\n return;\n }\n const viewContainer = this._modelToViewMapping.get(data.modelPosition.parent);\n if (!viewContainer) {\n /**\n * A model position could not be mapped to the view because the parent of the model position\n * does not have a mapped view element (might have not been converted yet or it has no converter).\n *\n * Make sure that the model element is correctly converted to the view.\n *\n * @error mapping-model-position-view-parent-not-found\n */\n throw new CKEditorError('mapping-model-position-view-parent-not-found', this, { modelPosition: data.modelPosition });\n }\n data.viewPosition = this.findPositionIn(viewContainer, data.modelPosition.offset);\n }, { priority: 'low' });\n // Default mapper algorithm for mapping view position to model position.\n this.on('viewToModelPosition', (evt, data) => {\n if (data.modelPosition) {\n return;\n }\n const viewBlock = this.findMappedViewAncestor(data.viewPosition);\n const modelParent = this._viewToModelMapping.get(viewBlock);\n const modelOffset = this._toModelOffset(data.viewPosition.parent, data.viewPosition.offset, viewBlock);\n data.modelPosition = ModelPosition._createAt(modelParent, modelOffset);\n }, { priority: 'low' });\n }\n /**\n * Marks model and view elements as corresponding. Corresponding elements can be retrieved by using\n * the {@link module:engine/conversion/mapper~Mapper#toModelElement toModelElement} and\n * {@link module:engine/conversion/mapper~Mapper#toViewElement toViewElement} methods.\n * The information that elements are bound is also used to translate positions.\n *\n * @param modelElement Model element.\n * @param viewElement View element.\n */\n bindElements(modelElement, viewElement) {\n this._modelToViewMapping.set(modelElement, viewElement);\n this._viewToModelMapping.set(viewElement, modelElement);\n }\n /**\n * Unbinds the given {@link module:engine/view/element~Element view element} from the map.\n *\n * **Note:** view-to-model binding will be removed, if it existed. However, corresponding model-to-view binding\n * will be removed only if model element is still bound to the passed `viewElement`.\n *\n * This behavior allows for re-binding model element to another view element without fear of losing the new binding\n * when the previously bound view element is unbound.\n *\n * @param viewElement View element to unbind.\n * @param options The options object.\n * @param options.defer Controls whether the binding should be removed immediately or deferred until a\n * {@link #flushDeferredBindings `flushDeferredBindings()`} call.\n */\n unbindViewElement(viewElement, options = {}) {\n const modelElement = this.toModelElement(viewElement);\n if (this._elementToMarkerNames.has(viewElement)) {\n for (const markerName of this._elementToMarkerNames.get(viewElement)) {\n this._unboundMarkerNames.add(markerName);\n }\n }\n if (options.defer) {\n this._deferredBindingRemovals.set(viewElement, viewElement.root);\n }\n else {\n this._viewToModelMapping.delete(viewElement);\n if (this._modelToViewMapping.get(modelElement) == viewElement) {\n this._modelToViewMapping.delete(modelElement);\n }\n }\n }\n /**\n * Unbinds the given {@link module:engine/model/element~Element model element} from the map.\n *\n * **Note:** the model-to-view binding will be removed, if it existed. However, the corresponding view-to-model binding\n * will be removed only if the view element is still bound to the passed `modelElement`.\n *\n * This behavior lets for re-binding view element to another model element without fear of losing the new binding\n * when the previously bound model element is unbound.\n *\n * @param modelElement Model element to unbind.\n */\n unbindModelElement(modelElement) {\n const viewElement = this.toViewElement(modelElement);\n this._modelToViewMapping.delete(modelElement);\n if (this._viewToModelMapping.get(viewElement) == modelElement) {\n this._viewToModelMapping.delete(viewElement);\n }\n }\n /**\n * Binds the given marker name with the given {@link module:engine/view/element~Element view element}. The element\n * will be added to the current set of elements bound with the given marker name.\n *\n * @param element Element to bind.\n * @param name Marker name.\n */\n bindElementToMarker(element, name) {\n const elements = this._markerNameToElements.get(name) || new Set();\n elements.add(element);\n const names = this._elementToMarkerNames.get(element) || new Set();\n names.add(name);\n this._markerNameToElements.set(name, elements);\n this._elementToMarkerNames.set(element, names);\n }\n /**\n * Unbinds an element from given marker name.\n *\n * @param element Element to unbind.\n * @param name Marker name.\n */\n unbindElementFromMarkerName(element, name) {\n const nameToElements = this._markerNameToElements.get(name);\n if (nameToElements) {\n nameToElements.delete(element);\n if (nameToElements.size == 0) {\n this._markerNameToElements.delete(name);\n }\n }\n const elementToNames = this._elementToMarkerNames.get(element);\n if (elementToNames) {\n elementToNames.delete(name);\n if (elementToNames.size == 0) {\n this._elementToMarkerNames.delete(element);\n }\n }\n }\n /**\n * Returns all marker names of markers which have changed due to unbinding a view element (so it is assumed that the view element\n * has been removed, moved or renamed) since the last flush. After returning, the marker names list is cleared.\n */\n flushUnboundMarkerNames() {\n const markerNames = Array.from(this._unboundMarkerNames);\n this._unboundMarkerNames.clear();\n return markerNames;\n }\n /**\n * Unbinds all deferred binding removals of view elements that in the meantime were not re-attached to some root or document fragment.\n *\n * See: {@link #unbindViewElement `unbindViewElement()`}.\n */\n flushDeferredBindings() {\n for (const [viewElement, root] of this._deferredBindingRemovals) {\n // Unbind it only if it wasn't re-attached to some root or document fragment.\n if (viewElement.root == root) {\n this.unbindViewElement(viewElement);\n }\n }\n this._deferredBindingRemovals = new Map();\n }\n /**\n * Removes all model to view and view to model bindings.\n */\n clearBindings() {\n this._modelToViewMapping = new WeakMap();\n this._viewToModelMapping = new WeakMap();\n this._markerNameToElements = new Map();\n this._elementToMarkerNames = new Map();\n this._unboundMarkerNames = new Set();\n this._deferredBindingRemovals = new Map();\n }\n toModelElement(viewElement) {\n return this._viewToModelMapping.get(viewElement);\n }\n toViewElement(modelElement) {\n return this._modelToViewMapping.get(modelElement);\n }\n /**\n * Gets the corresponding model range.\n *\n * @param viewRange View range.\n * @returns Corresponding model range.\n */\n toModelRange(viewRange) {\n return new ModelRange(this.toModelPosition(viewRange.start), this.toModelPosition(viewRange.end));\n }\n /**\n * Gets the corresponding view range.\n *\n * @param modelRange Model range.\n * @returns Corresponding view range.\n */\n toViewRange(modelRange) {\n return new ViewRange(this.toViewPosition(modelRange.start), this.toViewPosition(modelRange.end));\n }\n /**\n * Gets the corresponding model position.\n *\n * @fires viewToModelPosition\n * @param viewPosition View position.\n * @returns Corresponding model position.\n */\n toModelPosition(viewPosition) {\n const data = {\n viewPosition,\n mapper: this\n };\n this.fire('viewToModelPosition', data);\n return data.modelPosition;\n }\n /**\n * Gets the corresponding view position.\n *\n * @fires modelToViewPosition\n * @param modelPosition Model position.\n * @param options Additional options for position mapping process.\n * @param options.isPhantom Should be set to `true` if the model position to map is pointing to a place\n * in model tree which no longer exists. For example, it could be an end of a removed model range.\n * @returns Corresponding view position.\n */\n toViewPosition(modelPosition, options = {}) {\n const data = {\n modelPosition,\n mapper: this,\n isPhantom: options.isPhantom\n };\n this.fire('modelToViewPosition', data);\n return data.viewPosition;\n }\n /**\n * Gets all view elements bound to the given marker name.\n *\n * @param name Marker name.\n * @returns View elements bound with the given marker name or `null`\n * if no elements are bound to the given marker name.\n */\n markerNameToElements(name) {\n const boundElements = this._markerNameToElements.get(name);\n if (!boundElements) {\n return null;\n }\n const elements = new Set();\n for (const element of boundElements) {\n if (element.is('attributeElement')) {\n for (const clone of element.getElementsWithSameId()) {\n elements.add(clone);\n }\n }\n else {\n elements.add(element);\n }\n }\n return elements;\n }\n /**\n * Registers a callback that evaluates the length in the model of a view element with the given name.\n *\n * The callback is fired with one argument, which is a view element instance. The callback is expected to return\n * a number representing the length of the view element in the model.\n *\n * ```ts\n * // List item in view may contain nested list, which have other list items. In model though,\n * // the lists are represented by flat structure. Because of those differences, length of list view element\n * // may be greater than one. In the callback it's checked how many nested list items are in evaluated list item.\n *\n * function 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 * mapper.registerViewToModelLength( 'li', getViewListItemLength );\n * ```\n *\n * @param viewElementName Name of view element for which callback is registered.\n * @param lengthCallback Function return a length of view element instance in model.\n */\n registerViewToModelLength(viewElementName, lengthCallback) {\n this._viewToModelLengthCallbacks.set(viewElementName, lengthCallback);\n }\n /**\n * For the given `viewPosition`, finds and returns the closest ancestor of this position that has a mapping to\n * the model.\n *\n * @param viewPosition Position for which a mapped ancestor should be found.\n */\n findMappedViewAncestor(viewPosition) {\n let parent = viewPosition.parent;\n while (!this._viewToModelMapping.has(parent)) {\n parent = parent.parent;\n }\n return parent;\n }\n /**\n * Calculates model offset based on the view position and the block element.\n *\n * Example:\n *\n * ```html\n * <p>foo<b>ba|r</b></p> // _toModelOffset( b, 2, p ) -> 5\n * ```\n *\n * Is a sum of:\n *\n * ```html\n * <p>foo|<b>bar</b></p> // _toModelOffset( p, 3, p ) -> 3\n * <p>foo<b>ba|r</b></p> // _toModelOffset( b, 2, b ) -> 2\n * ```\n *\n * @param viewParent Position parent.\n * @param viewOffset Position offset.\n * @param viewBlock Block used as a base to calculate offset.\n * @returns Offset in the model.\n */\n _toModelOffset(viewParent, viewOffset, viewBlock) {\n if (viewBlock != viewParent) {\n // See example.\n const offsetToParentStart = this._toModelOffset(viewParent.parent, viewParent.index, viewBlock);\n const offsetInParent = this._toModelOffset(viewParent, viewOffset, viewParent);\n return offsetToParentStart + offsetInParent;\n }\n // viewBlock == viewParent, so we need to calculate the offset in the parent element.\n // If the position is a text it is simple (\"ba|r\" -> 2).\n if (viewParent.is('$text')) {\n return viewOffset;\n }\n // If the position is in an element we need to sum lengths of siblings ( <b> bar </b> foo | -> 3 + 3 = 6 ).\n let modelOffset = 0;\n for (let i = 0; i < viewOffset; i++) {\n modelOffset += this.getModelLength(viewParent.getChild(i));\n }\n return modelOffset;\n }\n /**\n * Gets the length of the view element in the model.\n *\n * The length is calculated as follows:\n * * if a {@link #registerViewToModelLength length mapping callback} is provided for the given `viewNode`, it is used to\n * evaluate the model length (`viewNode` is used as first and only parameter passed to the callback),\n * * length of a {@link module:engine/view/text~Text text node} is equal to the length of its\n * {@link module:engine/view/text~Text#data data},\n * * length of a {@link module:engine/view/uielement~UIElement ui element} is equal to 0,\n * * length of a mapped {@link module:engine/view/element~Element element} is equal to 1,\n * * length of a non-mapped {@link module:engine/view/element~Element element} is equal to the length of its children.\n *\n * Examples:\n *\n * ```\n * foo -> 3 // Text length is equal to its data length.\n * <p>foo</p> -> 1 // Length of an element which is mapped is by default equal to 1.\n * <b>foo</b> -> 3 // Length of an element which is not mapped is a length of its children.\n * <div><p>x</p><p>y</p></div> -> 2 // Assuming that <div> is not mapped and <p> are mapped.\n * ```\n *\n * @param viewNode View node.\n * @returns Length of the node in the tree model.\n */\n getModelLength(viewNode) {\n if (this._viewToModelLengthCallbacks.get(viewNode.name)) {\n const callback = this._viewToModelLengthCallbacks.get(viewNode.name);\n return callback(viewNode);\n }\n else if (this._viewToModelMapping.has(viewNode)) {\n return 1;\n }\n else if (viewNode.is('$text')) {\n return viewNode.data.length;\n }\n else if (viewNode.is('uiElement')) {\n return 0;\n }\n else {\n let len = 0;\n for (const child of viewNode.getChildren()) {\n len += this.getModelLength(child);\n }\n return len;\n }\n }\n /**\n * Finds the position in the view node (or in its children) with the expected model offset.\n *\n * Example:\n *\n * ```\n * <p>fo<b>bar</b>bom</p> -> expected offset: 4\n *\n * findPositionIn( p, 4 ):\n * <p>|fo<b>bar</b>bom</p> -> expected offset: 4, actual offset: 0\n * <p>fo|<b>bar</b>bom</p> -> expected offset: 4, actual offset: 2\n * <p>fo<b>bar</b>|bom</p> -> expected offset: 4, actual offset: 5 -> we are too far\n *\n * findPositionIn( b, 4 - ( 5 - 3 ) ):\n * <p>fo<b>|bar</b>bom</p> -> expected offset: 2, actual offset: 0\n * <p>fo<b>bar|</b>bom</p> -> expected offset: 2, actual offset: 3 -> we are too far\n *\n * findPositionIn( bar, 2 - ( 3 - 3 ) ):\n * We are in the text node so we can simple find the offset.\n * <p>fo<b>ba|r</b>bom</p> -> expected offset: 2, actual offset: 2 -> position found\n * ```\n *\n * @param viewParent Tree view element in which we are looking for the position.\n * @param expectedOffset Expected offset.\n * @returns Found position.\n */\n findPositionIn(viewParent, expectedOffset) {\n // Last scanned view node.\n let viewNode;\n // Length of the last scanned view node.\n let lastLength = 0;\n let modelOffset = 0;\n let viewOffset = 0;\n // In the text node it is simple: the offset in the model equals the offset in the text.\n if (viewParent.is('$text')) {\n return new ViewPosition(viewParent, expectedOffset);\n }\n // In other cases we add lengths of child nodes to find the proper offset.\n // If it is smaller we add the length.\n while (modelOffset < expectedOffset) {\n viewNode = viewParent.getChild(viewOffset);\n lastLength = this.getModelLength(viewNode);\n modelOffset += lastLength;\n viewOffset++;\n }\n // If it equals we found the position.\n if (modelOffset == expectedOffset) {\n return this._moveViewPositionToTextNode(new ViewPosition(viewParent, viewOffset));\n }\n // If it is higher we need to enter last child.\n else {\n // ( modelOffset - lastLength ) is the offset to the child we enter,\n // so we subtract it from the expected offset to fine the offset in the child.\n return this.findPositionIn(viewNode, expectedOffset - (modelOffset - lastLength));\n }\n }\n /**\n * Because we prefer positions in the text nodes over positions next to text nodes, if the view position was next to a text node,\n * it moves it into the text node instead.\n *\n * ```\n * <p>[]<b>foo</b></p> -> <p>[]<b>foo</b></p> // do not touch if position is not directly next to text\n * <p>foo[]<b>foo</b></p> -> <p>foo{}<b>foo</b></p> // move to text node\n * <p><b>[]foo</b></p> -> <p><b>{}foo</b></p> // move to text node\n * ```\n *\n * @param viewPosition Position potentially next to the text node.\n * @returns Position in the text node if possible.\n */\n _moveViewPositionToTextNode(viewPosition) {\n // If the position is just after a text node, put it at the end of that text node.\n // If the position is just before a text node, put it at the beginning of that text node.\n const nodeBefore = viewPosition.nodeBefore;\n const nodeAfter = viewPosition.nodeAfter;\n if (nodeBefore instanceof ViewText) {\n return new ViewPosition(nodeBefore, nodeBefore.data.length);\n }\n else if (nodeAfter instanceof ViewText) {\n return new ViewPosition(nodeAfter, 0);\n }\n // Otherwise, just return the given position.\n return viewPosition;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/conversion/modelconsumable\n */\nimport TextProxy from '../model/textproxy';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Manages a list of consumable values for the {@link module:engine/model/item~Item model items}.\n *\n * Consumables are various aspects of the model. A model item can be broken down into separate, single properties that might be\n * taken into consideration when converting that item.\n *\n * `ModelConsumable` is used by {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} while analyzing the changed\n * parts of {@link module:engine/model/document~Document the document}. The added / changed / removed model items are broken down\n * into singular properties (the item itself and its attributes). All those parts are saved in `ModelConsumable`. Then,\n * during conversion, when the given part of a model item is converted (i.e. the view element has been inserted into the view,\n * but without attributes), the consumable value is removed from `ModelConsumable`.\n *\n * For model items, `ModelConsumable` stores consumable values of one of following types: `insert`, `addattribute:<attributeKey>`,\n * `changeattributes:<attributeKey>`, `removeattributes:<attributeKey>`.\n *\n * In most cases, it is enough to let th {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}\n * gather consumable values, so there is no need to use\n * the {@link module:engine/conversion/modelconsumable~ModelConsumable#add add method} directly.\n * However, it is important to understand how consumable values can be\n * {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed}.\n * See {@link module:engine/conversion/downcasthelpers default downcast converters} for more information.\n *\n * Keep in mind that one conversion event may have multiple callbacks (converters) attached to it. Each of those is\n * able to convert one or more parts of the model. However, when one of those callbacks actually converts\n * something, the others should not, because they would duplicate the results. Using `ModelConsumable` helps to avoid\n * this situation, because callbacks should only convert these values that were not yet consumed from `ModelConsumable`.\n *\n * Consuming multiple values in a single callback:\n *\n * ```ts\n * // Converter for custom `imageBlock` element that might have a `caption` element inside which changes\n * // how the image is displayed in the view:\n * //\n * // Model:\n * //\n * // [imageBlock]\n * // └─ [caption]\n * // └─ foo\n * //\n * // View:\n * //\n * // <figure>\n * // ├─ <img />\n * // └─ <caption>\n * // └─ foo\n * modelConversionDispatcher.on( 'insert:imageBlock', ( evt, data, conversionApi ) => {\n * \t// First, consume the `imageBlock` element.\n * \tconversionApi.consumable.consume( data.item, 'insert' );\n *\n * \t// Just create normal image element for the view.\n * \t// Maybe it will be \"decorated\" later.\n * \tconst viewImage = new ViewElement( 'img' );\n * \tconst insertPosition = conversionApi.mapper.toViewPosition( data.range.start );\n * \tconst viewWriter = conversionApi.writer;\n *\n * \t// Check if the `imageBlock` element has children.\n * \tif ( data.item.childCount > 0 ) {\n * \t\tconst modelCaption = data.item.getChild( 0 );\n *\n * \t\t// `modelCaption` insertion change is consumed from consumable values.\n * \t\t// It will not be converted by other converters, but it's children (probably some text) will be.\n * \t\t// Through mapping, converters for text will know where to insert contents of `modelCaption`.\n * \t\tif ( conversionApi.consumable.consume( modelCaption, 'insert' ) ) {\n * \t\t\tconst viewCaption = new ViewElement( 'figcaption' );\n *\n * \t\t\tconst viewImageHolder = new ViewElement( 'figure', null, [ viewImage, viewCaption ] );\n *\n * \t\t\tconversionApi.mapper.bindElements( modelCaption, viewCaption );\n * \t\t\tconversionApi.mapper.bindElements( data.item, viewImageHolder );\n * \t\t\tviewWriter.insert( insertPosition, viewImageHolder );\n * \t\t}\n * \t} else {\n * \t\tconversionApi.mapper.bindElements( data.item, viewImage );\n * \t\tviewWriter.insert( insertPosition, viewImage );\n * \t}\n *\n * \tevt.stop();\n * } );\n * ```\n */\nexport default class ModelConsumable {\n constructor() {\n /**\n * Contains list of consumable values.\n */\n this._consumable = new Map();\n /**\n * For each {@link module:engine/model/textproxy~TextProxy} added to `ModelConsumable`, this registry holds a parent\n * of that `TextProxy` and the start and end indices of that `TextProxy`. This allows identification of the `TextProxy`\n * instances that point to the same part of the model but are different instances. Each distinct `TextProxy`\n * is given a unique `Symbol` which is then registered as consumable. This process is transparent for the `ModelConsumable`\n * API user because whenever `TextProxy` is added, tested, consumed or reverted, the internal mechanisms of\n * `ModelConsumable` translate `TextProxy` to that unique `Symbol`.\n */\n this._textProxyRegistry = new Map();\n }\n /**\n * Adds a consumable value to the consumables list and links it with a given model item.\n *\n * ```ts\n * modelConsumable.add( modelElement, 'insert' ); // Add `modelElement` insertion change to consumable values.\n * modelConsumable.add( modelElement, 'addAttribute:bold' ); // Add `bold` attribute insertion on `modelElement` change.\n * modelConsumable.add( modelElement, 'removeAttribute:bold' ); // Add `bold` attribute removal on `modelElement` change.\n * modelConsumable.add( modelSelection, 'selection' ); // Add `modelSelection` to consumable values.\n * modelConsumable.add( modelRange, 'range' ); // Add `modelRange` to consumable values.\n * ```\n *\n * @param item Model item, range or selection that has the consumable.\n * @param type Consumable type. Will be normalized to a proper form, that is either `<word>` or `<part>:<part>`.\n * Second colon and everything after will be cut. Passing event name is a safe and good practice.\n */\n add(item, type) {\n type = _normalizeConsumableType(type);\n if (item instanceof TextProxy) {\n item = this._getSymbolForTextProxy(item);\n }\n if (!this._consumable.has(item)) {\n this._consumable.set(item, new Map());\n }\n this._consumable.get(item).set(type, true);\n }\n /**\n * Removes a given consumable value from a given model item.\n *\n * ```ts\n * modelConsumable.consume( modelElement, 'insert' ); // Remove `modelElement` insertion change from consumable values.\n * modelConsumable.consume( modelElement, 'addAttribute:bold' ); // Remove `bold` attribute insertion on `modelElement` change.\n * modelConsumable.consume( modelElement, 'removeAttribute:bold' ); // Remove `bold` attribute removal on `modelElement` change.\n * modelConsumable.consume( modelSelection, 'selection' ); // Remove `modelSelection` from consumable values.\n * modelConsumable.consume( modelRange, 'range' ); // Remove 'modelRange' from consumable values.\n * ```\n *\n * @param item Model item, range or selection from which consumable will be consumed.\n * @param type Consumable type. Will be normalized to a proper form, that is either `<word>` or `<part>:<part>`.\n * Second colon and everything after will be cut. Passing event name is a safe and good practice.\n * @returns `true` if consumable value was available and was consumed, `false` otherwise.\n */\n consume(item, type) {\n type = _normalizeConsumableType(type);\n if (item instanceof TextProxy) {\n item = this._getSymbolForTextProxy(item);\n }\n if (this.test(item, type)) {\n this._consumable.get(item).set(type, false);\n return true;\n }\n else {\n return false;\n }\n }\n /**\n * Tests whether there is a consumable value of a given type connected with a given model item.\n *\n * ```ts\n * modelConsumable.test( modelElement, 'insert' ); // Check for `modelElement` insertion change.\n * modelConsumable.test( modelElement, 'addAttribute:bold' ); // Check for `bold` attribute insertion on `modelElement` change.\n * modelConsumable.test( modelElement, 'removeAttribute:bold' ); // Check for `bold` attribute removal on `modelElement` change.\n * modelConsumable.test( modelSelection, 'selection' ); // Check if `modelSelection` is consumable.\n * modelConsumable.test( modelRange, 'range' ); // Check if `modelRange` is consumable.\n * ```\n *\n * @param item Model item, range or selection to be tested.\n * @param type Consumable type. Will be normalized to a proper form, that is either `<word>` or `<part>:<part>`.\n * Second colon and everything after will be cut. Passing event name is a safe and good practice.\n * @returns `null` if such consumable was never added, `false` if the consumable values was\n * already consumed or `true` if it was added and not consumed yet.\n */\n test(item, type) {\n type = _normalizeConsumableType(type);\n if (item instanceof TextProxy) {\n item = this._getSymbolForTextProxy(item);\n }\n const itemConsumables = this._consumable.get(item);\n if (itemConsumables === undefined) {\n return null;\n }\n const value = itemConsumables.get(type);\n if (value === undefined) {\n return null;\n }\n return value;\n }\n /**\n * Reverts consuming of a consumable value.\n *\n * ```ts\n * modelConsumable.revert( modelElement, 'insert' ); // Revert consuming `modelElement` insertion change.\n * modelConsumable.revert( modelElement, 'addAttribute:bold' ); // Revert consuming `bold` attribute insert from `modelElement`.\n * modelConsumable.revert( modelElement, 'removeAttribute:bold' ); // Revert consuming `bold` attribute remove from `modelElement`.\n * modelConsumable.revert( modelSelection, 'selection' ); // Revert consuming `modelSelection`.\n * modelConsumable.revert( modelRange, 'range' ); // Revert consuming `modelRange`.\n * ```\n *\n * @param item Model item, range or selection to be reverted.\n * @param type Consumable type.\n * @returns `true` if consumable has been reversed, `false` otherwise. `null` if the consumable has\n * never been added.\n */\n revert(item, type) {\n type = _normalizeConsumableType(type);\n if (item instanceof TextProxy) {\n item = this._getSymbolForTextProxy(item);\n }\n const test = this.test(item, type);\n if (test === false) {\n this._consumable.get(item).set(type, true);\n return true;\n }\n else if (test === true) {\n return false;\n }\n return null;\n }\n /**\n * Verifies if all events from the specified group were consumed.\n *\n * @param eventGroup The events group to verify.\n */\n verifyAllConsumed(eventGroup) {\n const items = [];\n for (const [item, consumables] of this._consumable) {\n for (const [event, canConsume] of consumables) {\n const eventPrefix = event.split(':')[0];\n if (canConsume && eventGroup == eventPrefix) {\n items.push({\n event,\n item: item.name || item.description\n });\n }\n }\n }\n if (items.length) {\n /**\n * Some of the {@link module:engine/model/item~Item model items} were not consumed while downcasting the model to view.\n *\n * This might be the effect of:\n *\n * * A missing converter for some model elements. Make sure that you registered downcast converters for all model elements.\n * * A custom converter that does not consume converted items. Make sure that you\n * {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed} all model elements that you converted\n * from the model to the view.\n * * A custom converter that called `event.stop()`. When providing a custom converter, keep in mind that you should not stop\n * the event. If you stop it then the default converter at the `lowest` priority will not trigger the conversion of this node's\n * attributes and child nodes.\n *\n * @error conversion-model-consumable-not-consumed\n * @param {Array.<module:engine/model/item~Item>} items Items that were not consumed.\n */\n throw new CKEditorError('conversion-model-consumable-not-consumed', null, { items });\n }\n }\n /**\n * Gets a unique symbol for the passed {@link module:engine/model/textproxy~TextProxy} instance. All `TextProxy` instances that\n * have same parent, same start index and same end index will get the same symbol.\n *\n * Used internally to correctly consume `TextProxy` instances.\n *\n * @internal\n * @param textProxy `TextProxy` instance to get a symbol for.\n * @returns Symbol representing all equal instances of `TextProxy`.\n */\n _getSymbolForTextProxy(textProxy) {\n let symbol = null;\n const startMap = this._textProxyRegistry.get(textProxy.startOffset);\n if (startMap) {\n const endMap = startMap.get(textProxy.endOffset);\n if (endMap) {\n symbol = endMap.get(textProxy.parent);\n }\n }\n if (!symbol) {\n symbol = this._addSymbolForTextProxy(textProxy);\n }\n return symbol;\n }\n /**\n * Adds a symbol for the given {@link module:engine/model/textproxy~TextProxy} instance.\n *\n * Used internally to correctly consume `TextProxy` instances.\n *\n * @param textProxy Text proxy instance.\n * @returns Symbol generated for given `TextProxy`.\n */\n _addSymbolForTextProxy(textProxy) {\n const start = textProxy.startOffset;\n const end = textProxy.endOffset;\n const parent = textProxy.parent;\n const symbol = Symbol('$textProxy:' + textProxy.data);\n let startMap;\n let endMap;\n startMap = this._textProxyRegistry.get(start);\n if (!startMap) {\n startMap = new Map();\n this._textProxyRegistry.set(start, startMap);\n }\n endMap = startMap.get(end);\n if (!endMap) {\n endMap = new Map();\n startMap.set(end, endMap);\n }\n endMap.set(parent, symbol);\n return symbol;\n }\n}\n/**\n * Returns a normalized consumable type name from the given string. A normalized consumable type name is a string that has\n * at most one colon, for example: `insert` or `addMarker:highlight`. If a string to normalize has more \"parts\" (more colons),\n * the further parts are dropped, for example: `addattribute:bold:$text` -> `addattributes:bold`.\n *\n * @param type Consumable type.\n * @returns Normalized consumable type.\n */\nfunction _normalizeConsumableType(type) {\n const parts = type.split(':');\n // For inserts allow passing event name, it's stored in the context of a specified element so the element name is not needed.\n if (parts[0] == 'insert') {\n return parts[0];\n }\n // Markers are identified by the whole name (otherwise we would consume the whole markers group).\n if (parts[0] == 'addMarker' || parts[0] == 'removeMarker') {\n return type;\n }\n return parts.length > 1 ? parts[0] + ':' + parts[1] : parts[0];\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/conversion/downcastdispatcher\n */\nimport Consumable from './modelconsumable';\nimport Range from '../model/range';\nimport { EmitterMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * The downcast dispatcher is a central point of downcasting (conversion from the model to the view), which is a process of reacting\n * to changes in the model and firing a set of events. The callbacks listening to these events are called converters. The\n * converters' role is to convert the model changes to changes in view (for example, adding view nodes or\n * changing attributes on view elements).\n *\n * During the conversion process, downcast dispatcher fires events basing on the state of the model and prepares\n * data for these events. It is important to understand that the events are connected with the changes done on the model,\n * for example: \"a node has been inserted\" or \"an attribute has changed\". This is in contrary to upcasting (a view-to-model conversion)\n * where you convert the view state (view nodes) to a model tree.\n *\n * The events are prepared basing on a diff created by the {@link module:engine/model/differ~Differ Differ}, which buffers them\n * and then passes to the downcast dispatcher as a diff between the old model state and the new model state.\n *\n * Note that because the changes are converted, there is a need to have a mapping between the model structure and the view structure.\n * To map positions and elements during the downcast (a model-to-view conversion), use {@link module:engine/conversion/mapper~Mapper}.\n *\n * Downcast dispatcher fires the following events for model tree changes:\n *\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert `insert`} &ndash;\n * If a range of nodes was inserted to the model tree.\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:remove `remove`} &ndash;\n * If a range of nodes was removed from the model tree.\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute `attribute`} &ndash;\n * If an attribute was added, changed or removed from a model node.\n *\n * For {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert `insert`}\n * and {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute `attribute`},\n * the downcast dispatcher generates {@link module:engine/conversion/modelconsumable~ModelConsumable consumables}.\n * These are used to have control over which changes have already been consumed. It is useful when some converters\n * overwrite others or convert multiple changes (for example, it converts an insertion of an element and also converts that\n * element's attributes during the insertion).\n *\n * Additionally, downcast dispatcher fires events for {@link module:engine/model/markercollection~Marker marker} changes:\n *\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker `addMarker`} &ndash; If a marker was added.\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:removeMarker `removeMarker`} &ndash; If a marker was\n * removed.\n *\n * Note that changing a marker is done through removing the marker from the old range and adding it to the new range,\n * so both of these events are fired.\n *\n * Finally, a downcast dispatcher also handles firing events for the {@link module:engine/model/selection model selection}\n * conversion:\n *\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:selection `selection`}\n * &ndash; Converts the selection from the model to the view.\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute `attribute`}\n * &ndash; Fired for every selection attribute.\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker `addMarker`}\n * &ndash; Fired for every marker that contains a selection.\n *\n * Unlike the model tree and the markers, the events for selection are not fired for changes but for a selection state.\n *\n * When providing custom listeners for a downcast dispatcher, remember to check whether a given change has not been\n * {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed} yet.\n *\n * When providing custom listeners for a downcast dispatcher, keep in mind that you **should not** stop the event. If you stop it,\n * then the default converter at the `lowest` priority will not trigger the conversion of this node's attributes and child nodes.\n *\n * When providing custom listeners for a downcast dispatcher, remember to use the provided\n * {@link module:engine/view/downcastwriter~DowncastWriter view downcast writer} to apply changes to the view document.\n *\n * You can read more about conversion in the following guide:\n *\n * * {@glink framework/deep-dive/conversion/downcast Downcast conversion}\n *\n * An example of a custom converter for the downcast dispatcher:\n *\n * ```ts\n * // You will convert inserting a \"paragraph\" model element into the model.\n * downcastDispatcher.on( 'insert:paragraph', ( evt, data, conversionApi ) => {\n * \t// Remember to check whether the change has not been consumed yet and consume it.\n * \tif ( !conversionApi.consumable.consume( data.item, 'insert' ) ) {\n * \t\treturn;\n * \t}\n *\n * \t// Translate the position in the model to a position in the view.\n * \tconst viewPosition = conversionApi.mapper.toViewPosition( data.range.start );\n *\n * \t// Create a <p> element that will be inserted into the view at the `viewPosition`.\n * \tconst viewElement = conversionApi.writer.createContainerElement( 'p' );\n *\n * \t// Bind the newly created view element to the model element so positions will map accordingly in the future.\n * \tconversionApi.mapper.bindElements( data.item, viewElement );\n *\n * \t// Add the newly created view element to the view.\n * \tconversionApi.writer.insert( viewPosition, viewElement );\n * } );\n * ```\n */\nexport default class DowncastDispatcher extends EmitterMixin() {\n /**\n * Creates a downcast dispatcher instance.\n *\n * @see module:engine/conversion/downcastdispatcher~DowncastConversionApi\n *\n * @param conversionApi Additional properties for an interface that will be passed to events fired\n * by the downcast dispatcher.\n */\n constructor(conversionApi) {\n super();\n this._conversionApi = { dispatcher: this, ...conversionApi };\n this._firedEventsMap = new WeakMap();\n }\n /**\n * Converts changes buffered in the given {@link module:engine/model/differ~Differ model differ}\n * and fires conversion events based on it.\n *\n * @fires insert\n * @fires remove\n * @fires attribute\n * @fires addMarker\n * @fires removeMarker\n * @fires reduceChanges\n * @param differ The differ object with buffered changes.\n * @param markers Markers related to the model fragment to convert.\n * @param writer The view writer that should be used to modify the view document.\n */\n convertChanges(differ, markers, writer) {\n const conversionApi = this._createConversionApi(writer, differ.getRefreshedItems());\n // Before the view is updated, remove markers which have changed.\n for (const change of differ.getMarkersToRemove()) {\n this._convertMarkerRemove(change.name, change.range, conversionApi);\n }\n // Let features modify the change list (for example to allow reconversion).\n const changes = this._reduceChanges(differ.getChanges());\n // Convert changes that happened on model tree.\n for (const entry of changes) {\n if (entry.type === 'insert') {\n this._convertInsert(Range._createFromPositionAndShift(entry.position, entry.length), conversionApi);\n }\n else if (entry.type === 'reinsert') {\n this._convertReinsert(Range._createFromPositionAndShift(entry.position, entry.length), conversionApi);\n }\n else if (entry.type === 'remove') {\n this._convertRemove(entry.position, entry.length, entry.name, conversionApi);\n }\n else {\n // Defaults to 'attribute' change.\n this._convertAttribute(entry.range, entry.attributeKey, entry.attributeOldValue, entry.attributeNewValue, conversionApi);\n }\n }\n for (const markerName of conversionApi.mapper.flushUnboundMarkerNames()) {\n const markerRange = markers.get(markerName).getRange();\n this._convertMarkerRemove(markerName, markerRange, conversionApi);\n this._convertMarkerAdd(markerName, markerRange, conversionApi);\n }\n // After the view is updated, convert markers which have changed.\n for (const change of differ.getMarkersToAdd()) {\n this._convertMarkerAdd(change.name, change.range, conversionApi);\n }\n // Remove mappings for all removed view elements.\n conversionApi.mapper.flushDeferredBindings();\n // Verify if all insert consumables were consumed.\n conversionApi.consumable.verifyAllConsumed('insert');\n }\n /**\n * Starts a conversion of a model range and the provided markers.\n *\n * @fires insert\n * @fires attribute\n * @fires addMarker\n * @param range The inserted range.\n * @param markers The map of markers that should be down-casted.\n * @param writer The view writer that should be used to modify the view document.\n * @param options Optional options object passed to `convertionApi.options`.\n */\n convert(range, markers, writer, options = {}) {\n const conversionApi = this._createConversionApi(writer, undefined, options);\n this._convertInsert(range, conversionApi);\n for (const [name, range] of markers) {\n this._convertMarkerAdd(name, range, conversionApi);\n }\n // Verify if all insert consumables were consumed.\n conversionApi.consumable.verifyAllConsumed('insert');\n }\n /**\n * Starts the model selection conversion.\n *\n * Fires events for a given {@link module:engine/model/selection~Selection selection} to start the selection conversion.\n *\n * @fires selection\n * @fires addMarker\n * @fires attribute\n * @param selection The selection to convert.\n * @param markers Markers connected with the converted model.\n * @param writer View writer that should be used to modify the view document.\n */\n convertSelection(selection, markers, writer) {\n const markersAtSelection = Array.from(markers.getMarkersAtPosition(selection.getFirstPosition()));\n const conversionApi = this._createConversionApi(writer);\n this._addConsumablesForSelection(conversionApi.consumable, selection, markersAtSelection);\n this.fire('selection', { selection }, conversionApi);\n if (!selection.isCollapsed) {\n return;\n }\n for (const marker of markersAtSelection) {\n const markerRange = marker.getRange();\n if (!shouldMarkerChangeBeConverted(selection.getFirstPosition(), marker, conversionApi.mapper)) {\n continue;\n }\n const data = {\n item: selection,\n markerName: marker.name,\n markerRange\n };\n if (conversionApi.consumable.test(selection, 'addMarker:' + marker.name)) {\n this.fire(`addMarker:${marker.name}`, data, conversionApi);\n }\n }\n for (const key of selection.getAttributeKeys()) {\n const data = {\n item: selection,\n range: selection.getFirstRange(),\n attributeKey: key,\n attributeOldValue: null,\n attributeNewValue: selection.getAttribute(key)\n };\n // Do not fire event if the attribute has been consumed.\n if (conversionApi.consumable.test(selection, 'attribute:' + data.attributeKey)) {\n this.fire(`attribute:${data.attributeKey}:$text`, data, conversionApi);\n }\n }\n }\n /**\n * Fires insertion conversion of a range of nodes.\n *\n * For each node in the range, {@link #event:insert `insert` event is fired}. For each attribute on each node,\n * {@link #event:attribute `attribute` event is fired}.\n *\n * @fires insert\n * @fires attribute\n * @param range The inserted range.\n * @param conversionApi The conversion API object.\n * @param options.doNotAddConsumables Whether the ModelConsumable should not get populated\n * for items in the provided range.\n */\n _convertInsert(range, conversionApi, options = {}) {\n if (!options.doNotAddConsumables) {\n // Collect a list of things that can be consumed, consisting of nodes and their attributes.\n this._addConsumablesForInsert(conversionApi.consumable, Array.from(range));\n }\n // Fire a separate insert event for each node and text fragment contained in the range.\n for (const data of Array.from(range.getWalker({ shallow: true })).map(walkerValueToEventData)) {\n this._testAndFire('insert', data, conversionApi);\n }\n }\n /**\n * Fires conversion of a single node removal. Fires {@link #event:remove remove event} with provided data.\n *\n * @param position Position from which node was removed.\n * @param length Offset size of removed node.\n * @param name Name of removed node.\n * @param conversionApi The conversion API object.\n */\n _convertRemove(position, length, name, conversionApi) {\n this.fire(`remove:${name}`, { position, length }, conversionApi);\n }\n /**\n * Starts a conversion of an attribute change on a given `range`.\n *\n * For each node in the given `range`, {@link #event:attribute attribute event} is fired with the passed data.\n *\n * @fires attribute\n * @param range Changed range.\n * @param key Key of the attribute that has changed.\n * @param oldValue Attribute value before the change or `null` if the attribute has not been set before.\n * @param newValue New attribute value or `null` if the attribute has been removed.\n * @param conversionApi The conversion API object.\n */\n _convertAttribute(range, key, oldValue, newValue, conversionApi) {\n // Create a list with attributes to consume.\n this._addConsumablesForRange(conversionApi.consumable, range, `attribute:${key}`);\n // Create a separate attribute event for each node in the range.\n for (const value of range) {\n const data = {\n item: value.item,\n range: Range._createFromPositionAndShift(value.previousPosition, value.length),\n attributeKey: key,\n attributeOldValue: oldValue,\n attributeNewValue: newValue\n };\n this._testAndFire(`attribute:${key}`, data, conversionApi);\n }\n }\n /**\n * Fires re-insertion conversion (with a `reconversion` flag passed to `insert` events)\n * of a range of elements (only elements on the range depth, without children).\n *\n * For each node in the range on its depth (without children), {@link #event:insert `insert` event} is fired.\n * For each attribute on each node, {@link #event:attribute `attribute` event} is fired.\n *\n * @fires insert\n * @fires attribute\n * @param range The range to reinsert.\n * @param conversionApi The conversion API object.\n */\n _convertReinsert(range, conversionApi) {\n // Convert the elements - without converting children.\n const walkerValues = Array.from(range.getWalker({ shallow: true }));\n // Collect a list of things that can be consumed, consisting of nodes and their attributes.\n this._addConsumablesForInsert(conversionApi.consumable, walkerValues);\n // Fire a separate insert event for each node and text fragment contained shallowly in the range.\n for (const data of walkerValues.map(walkerValueToEventData)) {\n this._testAndFire('insert', { ...data, reconversion: true }, conversionApi);\n }\n }\n /**\n * Converts the added marker. Fires the {@link #event:addMarker `addMarker`} event for each item\n * in the marker's range. If the range is collapsed, a single event is dispatched. See the event description for more details.\n *\n * @fires addMarker\n * @param markerName Marker name.\n * @param markerRange The marker range.\n * @param conversionApi The conversion API object.\n */\n _convertMarkerAdd(markerName, markerRange, conversionApi) {\n // Do not convert if range is in graveyard.\n if (markerRange.root.rootName == '$graveyard') {\n return;\n }\n // In markers' case, event name == consumable name.\n const eventName = `addMarker:${markerName}`;\n //\n // First, fire an event for the whole marker.\n //\n conversionApi.consumable.add(markerRange, eventName);\n this.fire(eventName, { markerName, markerRange }, conversionApi);\n //\n // Do not fire events for each item inside the range if the range got consumed.\n // Also consume the whole marker consumable if it wasn't consumed.\n //\n if (!conversionApi.consumable.consume(markerRange, eventName)) {\n return;\n }\n //\n // Then, fire an event for each item inside the marker range.\n //\n this._addConsumablesForRange(conversionApi.consumable, markerRange, eventName);\n for (const item of markerRange.getItems()) {\n // Do not fire event for already consumed items.\n if (!conversionApi.consumable.test(item, eventName)) {\n continue;\n }\n const data = { item, range: Range._createOn(item), markerName, markerRange };\n this.fire(eventName, data, conversionApi);\n }\n }\n /**\n * Fires the conversion of the marker removal. Fires the {@link #event:removeMarker `removeMarker`} event with the provided data.\n *\n * @fires removeMarker\n * @param markerName Marker name.\n * @param markerRange The marker range.\n * @param conversionApi The conversion API object.\n */\n _convertMarkerRemove(markerName, markerRange, conversionApi) {\n // Do not convert if range is in graveyard.\n if (markerRange.root.rootName == '$graveyard') {\n return;\n }\n this.fire(`removeMarker:${markerName}`, { markerName, markerRange }, conversionApi);\n }\n /**\n * Fires the reduction of changes buffered in the {@link module:engine/model/differ~Differ `Differ`}.\n *\n * Features can replace selected {@link module:engine/model/differ~DiffItem `DiffItem`}s with `reinsert` entries to trigger\n * reconversion. The {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToStructure\n * `DowncastHelpers.elementToStructure()`} is using this event to trigger reconversion.\n *\n * @fires reduceChanges\n */\n _reduceChanges(changes) {\n const data = { changes };\n this.fire('reduceChanges', data);\n return data.changes;\n }\n /**\n * Populates provided {@link module:engine/conversion/modelconsumable~ModelConsumable} with values to consume from a given range,\n * assuming that the range has just been inserted to the model.\n *\n * @param consumable The consumable.\n * @param walkerValues The walker values for the inserted range.\n * @returns The values to consume.\n */\n _addConsumablesForInsert(consumable, walkerValues) {\n for (const value of walkerValues) {\n const item = value.item;\n // Add consumable if it wasn't there yet.\n if (consumable.test(item, 'insert') === null) {\n consumable.add(item, 'insert');\n for (const key of item.getAttributeKeys()) {\n consumable.add(item, 'attribute:' + key);\n }\n }\n }\n return consumable;\n }\n /**\n * Populates provided {@link module:engine/conversion/modelconsumable~ModelConsumable} with values to consume for a given range.\n *\n * @param consumable The consumable.\n * @param range The affected range.\n * @param type Consumable type.\n * @returns The values to consume.\n */\n _addConsumablesForRange(consumable, range, type) {\n for (const item of range.getItems()) {\n consumable.add(item, type);\n }\n return consumable;\n }\n /**\n * Populates provided {@link module:engine/conversion/modelconsumable~ModelConsumable} with selection consumable values.\n *\n * @param consumable The consumable.\n * @param selection The selection to create the consumable from.\n * @param markers Markers that contain the selection.\n * @returns The values to consume.\n */\n _addConsumablesForSelection(consumable, selection, markers) {\n consumable.add(selection, 'selection');\n for (const marker of markers) {\n consumable.add(selection, 'addMarker:' + marker.name);\n }\n for (const key of selection.getAttributeKeys()) {\n consumable.add(selection, 'attribute:' + key);\n }\n return consumable;\n }\n /**\n * Tests whether given event wasn't already fired and if so, fires it.\n *\n * @fires insert\n * @fires attribute\n * @param type Event type.\n * @param data Event data.\n * @param conversionApi The conversion API object.\n */\n _testAndFire(type, data, conversionApi) {\n const eventName = getEventName(type, data);\n const itemKey = data.item.is('$textProxy') ? conversionApi.consumable._getSymbolForTextProxy(data.item) : data.item;\n const eventsFiredForConversion = this._firedEventsMap.get(conversionApi);\n const eventsFiredForItem = eventsFiredForConversion.get(itemKey);\n if (!eventsFiredForItem) {\n eventsFiredForConversion.set(itemKey, new Set([eventName]));\n }\n else if (!eventsFiredForItem.has(eventName)) {\n eventsFiredForItem.add(eventName);\n }\n else {\n return;\n }\n this.fire(eventName, data, conversionApi);\n }\n /**\n * Fires not already fired events for setting attributes on just inserted item.\n *\n * @param item The model item to convert attributes for.\n * @param conversionApi The conversion API object.\n */\n _testAndFireAddAttributes(item, conversionApi) {\n const data = {\n item,\n range: Range._createOn(item)\n };\n for (const key of data.item.getAttributeKeys()) {\n data.attributeKey = key;\n data.attributeOldValue = null;\n data.attributeNewValue = data.item.getAttribute(key);\n this._testAndFire(`attribute:${key}`, data, conversionApi);\n }\n }\n /**\n * Builds an instance of the {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi} from a template and a given\n * {@link module:engine/view/downcastwriter~DowncastWriter `DowncastWriter`} and options object.\n *\n * @param writer View writer that should be used to modify the view document.\n * @param refreshedItems A set of model elements that should not reuse their\n * previous view representations.\n * @param options Optional options passed to `convertionApi.options`.\n * @return The conversion API object.\n */\n _createConversionApi(writer, refreshedItems = new Set(), options = {}) {\n const conversionApi = {\n ...this._conversionApi,\n consumable: new Consumable(),\n writer,\n options,\n convertItem: item => this._convertInsert(Range._createOn(item), conversionApi),\n convertChildren: element => this._convertInsert(Range._createIn(element), conversionApi, { doNotAddConsumables: true }),\n convertAttributes: item => this._testAndFireAddAttributes(item, conversionApi),\n canReuseView: viewElement => !refreshedItems.has(conversionApi.mapper.toModelElement(viewElement))\n };\n this._firedEventsMap.set(conversionApi, new Map());\n return conversionApi;\n }\n}\n/**\n * Helper function, checks whether change of `marker` at `modelPosition` should be converted. Marker changes are not\n * converted if they happen inside an element with custom conversion method.\n */\nfunction shouldMarkerChangeBeConverted(modelPosition, marker, mapper) {\n const range = marker.getRange();\n const ancestors = Array.from(modelPosition.getAncestors());\n ancestors.shift(); // Remove root element. It cannot be passed to `model.Range#containsItem`.\n ancestors.reverse();\n const hasCustomHandling = ancestors.some(element => {\n if (range.containsItem(element)) {\n const viewElement = mapper.toViewElement(element);\n return !!viewElement.getCustomProperty('addHighlight');\n }\n });\n return !hasCustomHandling;\n}\nfunction getEventName(type, data) {\n const name = data.item.is('element') ? data.item.name : '$text';\n return `${type}:${name}`;\n}\nfunction walkerValueToEventData(value) {\n const item = value.item;\n const itemRange = Range._createFromPositionAndShift(value.previousPosition, value.length);\n return {\n item,\n range: itemRange\n };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/selection\n */\nimport TypeCheckable from './typecheckable';\nimport Node from './node';\nimport Position from './position';\nimport Range from './range';\nimport { CKEditorError, EmitterMixin, isIterable } from '@ckeditor/ckeditor5-utils';\n/**\n * Selection is a set of {@link module:engine/model/range~Range ranges}. It has a direction specified by its\n * {@link module:engine/model/selection~Selection#anchor anchor} and {@link module:engine/model/selection~Selection#focus focus}\n * (it can be {@link module:engine/model/selection~Selection#isBackward forward or backward}).\n * Additionally, selection may have its own attributes (think whether text typed in in this selection\n * should have those attributes e.g. whether you type a bolded text).\n */\nexport default class Selection extends EmitterMixin(TypeCheckable) {\n /**\n * Creates a new selection instance based on the given {@link module:engine/model/selection~Selectable selectable}\n * or creates an empty selection if no arguments were passed.\n *\n * ```ts\n * // Creates empty selection without ranges.\n * const selection = writer.createSelection();\n *\n * // Creates selection at the given range.\n * const range = writer.createRange( start, end );\n * const selection = writer.createSelection( range );\n *\n * // Creates selection at the given ranges\n * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];\n * const selection = writer.createSelection( ranges );\n *\n * // Creates selection from the other selection.\n * // Note: It doesn't copy selection attributes.\n * const otherSelection = writer.createSelection();\n * const selection = writer.createSelection( otherSelection );\n *\n * // Creates selection from the given document selection.\n * // Note: It doesn't copy selection attributes.\n * const documentSelection = model.document.selection;\n * const selection = writer.createSelection( documentSelection );\n *\n * // Creates selection at the given position.\n * const position = writer.createPositionFromPath( root, path );\n * const selection = writer.createSelection( position );\n *\n * // Creates selection at the given offset in the given element.\n * const paragraph = writer.createElement( 'paragraph' );\n * const selection = writer.createSelection( paragraph, offset );\n *\n * // Creates a range inside an {@link module:engine/model/element~Element element} which starts before the\n * // first child of that element and ends after the last child of that element.\n * const selection = writer.createSelection( paragraph, 'in' );\n *\n * // Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends\n * // just after the item.\n * const selection = writer.createSelection( paragraph, 'on' );\n * ```\n *\n * Selection's constructor allow passing additional options (`'backward'`) as the last argument.\n *\n * ```ts\n * // Creates backward selection.\n * const selection = writer.createSelection( range, { backward: true } );\n * ```\n *\n * @internal\n */\n constructor(...args) {\n super();\n /**\n * Specifies whether the last added range was added as a backward or forward range.\n */\n this._lastRangeBackward = false;\n /**\n * List of attributes set on current selection.\n */\n this._attrs = new Map();\n /** @internal */\n this._ranges = [];\n if (args.length) {\n this.setTo(...args);\n }\n }\n /**\n * Selection anchor. Anchor is the position from which the selection was started. If a user is making a selection\n * by dragging the mouse, the anchor is where the user pressed the mouse button (the beginning of the selection).\n *\n * Anchor and {@link #focus} define the direction of the selection, which is important\n * when expanding/shrinking selection. The focus moves, while the anchor should remain in the same place.\n *\n * Anchor is always set to the {@link module:engine/model/range~Range#start start} or\n * {@link module:engine/model/range~Range#end end} position of the last of selection's ranges. Whether it is\n * the `start` or `end` depends on the specified `options.backward`. See the {@link #setTo `setTo()`} method.\n *\n * May be set to `null` if there are no ranges in the selection.\n *\n * @see #focus\n */\n get anchor() {\n if (this._ranges.length > 0) {\n const range = this._ranges[this._ranges.length - 1];\n return this._lastRangeBackward ? range.end : range.start;\n }\n return null;\n }\n /**\n * Selection focus. Focus is the position where the selection ends. If a user is making a selection\n * by dragging the mouse, the focus is where the mouse cursor is.\n *\n * May be set to `null` if there are no ranges in the selection.\n *\n * @see #anchor\n */\n get focus() {\n if (this._ranges.length > 0) {\n const range = this._ranges[this._ranges.length - 1];\n return this._lastRangeBackward ? range.start : range.end;\n }\n return null;\n }\n /**\n * Whether the selection is collapsed. Selection is collapsed when there is exactly one range in it\n * and it is collapsed.\n */\n get isCollapsed() {\n const length = this._ranges.length;\n if (length === 1) {\n return this._ranges[0].isCollapsed;\n }\n else {\n return false;\n }\n }\n /**\n * Returns the number of ranges in the selection.\n */\n get rangeCount() {\n return this._ranges.length;\n }\n /**\n * Specifies whether the selection's {@link #focus} precedes the selection's {@link #anchor}.\n */\n get isBackward() {\n return !this.isCollapsed && this._lastRangeBackward;\n }\n /**\n * Checks whether this selection is equal to the given selection. Selections are equal if they have the same directions,\n * the same number of ranges and all ranges from one selection equal to ranges from the another selection.\n *\n * @param otherSelection Selection to compare with.\n * @returns `true` if selections are equal, `false` otherwise.\n */\n isEqual(otherSelection) {\n if (this.rangeCount != otherSelection.rangeCount) {\n return false;\n }\n else if (this.rangeCount === 0) {\n return true;\n }\n if (!this.anchor.isEqual(otherSelection.anchor) || !this.focus.isEqual(otherSelection.focus)) {\n return false;\n }\n for (const thisRange of this._ranges) {\n let found = false;\n for (const otherRange of otherSelection._ranges) {\n if (thisRange.isEqual(otherRange)) {\n found = true;\n break;\n }\n }\n if (!found) {\n return false;\n }\n }\n return true;\n }\n /**\n * Returns an iterable object that iterates over copies of selection ranges.\n */\n *getRanges() {\n for (const range of this._ranges) {\n yield new Range(range.start, range.end);\n }\n }\n /**\n * Returns a copy of the first range in the selection.\n * First range is the one which {@link module:engine/model/range~Range#start start} position\n * {@link module:engine/model/position~Position#isBefore is before} start position of all other ranges\n * (not to confuse with the first range added to the selection).\n *\n * Returns `null` if there are no ranges in selection.\n */\n getFirstRange() {\n let first = null;\n for (const range of this._ranges) {\n if (!first || range.start.isBefore(first.start)) {\n first = range;\n }\n }\n return first ? new Range(first.start, first.end) : null;\n }\n /**\n * Returns a copy of the last range in the selection.\n * Last range is the one which {@link module:engine/model/range~Range#end end} position\n * {@link module:engine/model/position~Position#isAfter is after} end position of all other ranges (not to confuse with the range most\n * recently added to the selection).\n *\n * Returns `null` if there are no ranges in selection.\n */\n getLastRange() {\n let last = null;\n for (const range of this._ranges) {\n if (!last || range.end.isAfter(last.end)) {\n last = range;\n }\n }\n return last ? new Range(last.start, last.end) : null;\n }\n /**\n * Returns the first position in the selection.\n * First position is the position that {@link module:engine/model/position~Position#isBefore is before}\n * any other position in the selection.\n *\n * Returns `null` if there are no ranges in selection.\n */\n getFirstPosition() {\n const first = this.getFirstRange();\n return first ? first.start.clone() : null;\n }\n /**\n * Returns the last position in the selection.\n * Last position is the position that {@link module:engine/model/position~Position#isAfter is after}\n * any other position in the selection.\n *\n * Returns `null` if there are no ranges in selection.\n */\n getLastPosition() {\n const lastRange = this.getLastRange();\n return lastRange ? lastRange.end.clone() : null;\n }\n /**\n * Sets this selection's ranges and direction to the specified location based on the given\n * {@link module:engine/model/selection~Selectable selectable}.\n *\n * ```ts\n * // Removes all selection's ranges.\n * selection.setTo( null );\n *\n * // Sets selection to the given range.\n * const range = writer.createRange( start, end );\n * selection.setTo( range );\n *\n * // Sets selection to given ranges.\n * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];\n * selection.setTo( ranges );\n *\n * // Sets selection to other selection.\n * // Note: It doesn't copy selection attributes.\n * const otherSelection = writer.createSelection();\n * selection.setTo( otherSelection );\n *\n * // Sets selection to the given document selection.\n * // Note: It doesn't copy selection attributes.\n * const documentSelection = new DocumentSelection( doc );\n * selection.setTo( documentSelection );\n *\n * // Sets collapsed selection at the given position.\n * const position = writer.createPositionFromPath( root, path );\n * selection.setTo( position );\n *\n * // Sets collapsed selection at the position of the given node and an offset.\n * selection.setTo( paragraph, offset );\n * ```\n *\n * Creates a range inside an {@link module:engine/model/element~Element element} which starts before the first child of\n * that element and ends after the last child of that element.\n *\n * ```ts\n * selection.setTo( paragraph, 'in' );\n * ```\n *\n * Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends just after the item.\n *\n * ```ts\n * selection.setTo( paragraph, 'on' );\n * ```\n *\n * `Selection#setTo()`' method allow passing additional options (`backward`) as the last argument.\n *\n * ```ts\n * // Sets backward selection.\n * const selection = writer.createSelection( range, { backward: true } );\n * ```\n */\n setTo(...args) {\n let [selectable, placeOrOffset, options] = args;\n if (typeof placeOrOffset == 'object') {\n options = placeOrOffset;\n placeOrOffset = undefined;\n }\n if (selectable === null) {\n this._setRanges([]);\n }\n else if (selectable instanceof Selection) {\n this._setRanges(selectable.getRanges(), selectable.isBackward);\n }\n else if (selectable && typeof selectable.getRanges == 'function') {\n // We assume that the selectable is a DocumentSelection.\n // It can't be imported here, because it would lead to circular imports.\n this._setRanges(selectable.getRanges(), selectable.isBackward);\n }\n else if (selectable instanceof Range) {\n this._setRanges([selectable], !!options && !!options.backward);\n }\n else if (selectable instanceof Position) {\n this._setRanges([new Range(selectable)]);\n }\n else if (selectable instanceof Node) {\n const backward = !!options && !!options.backward;\n let range;\n if (placeOrOffset == 'in') {\n range = Range._createIn(selectable);\n }\n else if (placeOrOffset == 'on') {\n range = Range._createOn(selectable);\n }\n else if (placeOrOffset !== undefined) {\n range = new Range(Position._createAt(selectable, placeOrOffset));\n }\n else {\n /**\n * selection.setTo requires the second parameter when the first parameter is a node.\n *\n * @error model-selection-setto-required-second-parameter\n */\n throw new CKEditorError('model-selection-setto-required-second-parameter', [this, selectable]);\n }\n this._setRanges([range], backward);\n }\n else if (isIterable(selectable)) {\n // We assume that the selectable is an iterable of ranges.\n this._setRanges(selectable, options && !!options.backward);\n }\n else {\n /**\n * Cannot set the selection to the given place.\n *\n * Invalid parameters were specified when setting the selection. Common issues:\n *\n * * A {@link module:engine/model/textproxy~TextProxy} instance was passed instead of\n * a real {@link module:engine/model/text~Text}.\n * * View nodes were passed instead of model nodes.\n * * `null`/`undefined` was passed.\n *\n * @error model-selection-setto-not-selectable\n */\n throw new CKEditorError('model-selection-setto-not-selectable', [this, selectable]);\n }\n }\n /**\n * Replaces all ranges that were added to the selection with given array of ranges. Last range of the array\n * is treated like the last added range and is used to set {@link module:engine/model/selection~Selection#anchor} and\n * {@link module:engine/model/selection~Selection#focus}. Accepts a flag describing in which direction the selection is made.\n *\n * @fires change:range\n * @param newRanges Ranges to set.\n * @param isLastBackward Flag describing if last added range was selected forward - from start to end (`false`)\n * or backward - from end to start (`true`).\n */\n _setRanges(newRanges, isLastBackward = false) {\n const ranges = Array.from(newRanges);\n // Check whether there is any range in new ranges set that is different than all already added ranges.\n const anyNewRange = ranges.some(newRange => {\n if (!(newRange instanceof Range)) {\n /**\n * Selection range set to an object that is not an instance of {@link module:engine/model/range~Range}.\n *\n * Only {@link module:engine/model/range~Range} instances can be used to set a selection.\n * Common mistakes leading to this error are:\n *\n * * using DOM `Range` object,\n * * incorrect CKEditor 5 installation with multiple `ckeditor5-engine` packages having different versions.\n *\n * @error model-selection-set-ranges-not-range\n */\n throw new CKEditorError('model-selection-set-ranges-not-range', [this, newRanges]);\n }\n return this._ranges.every(oldRange => {\n return !oldRange.isEqual(newRange);\n });\n });\n // Don't do anything if nothing changed.\n if (ranges.length === this._ranges.length && !anyNewRange) {\n return;\n }\n this._replaceAllRanges(ranges);\n this._lastRangeBackward = !!isLastBackward;\n this.fire('change:range', { directChange: true });\n }\n /**\n * Moves {@link module:engine/model/selection~Selection#focus} to the specified location.\n *\n * The location can be specified in the same form as\n * {@link module:engine/model/writer~Writer#createPositionAt writer.createPositionAt()} parameters.\n *\n * @fires change:range\n * @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/model/item~Item model item}.\n */\n setFocus(itemOrPosition, offset) {\n if (this.anchor === null) {\n /**\n * Cannot set selection focus if there are no ranges in selection.\n *\n * @error model-selection-setfocus-no-ranges\n */\n throw new CKEditorError('model-selection-setfocus-no-ranges', [this, itemOrPosition]);\n }\n const newFocus = Position._createAt(itemOrPosition, offset);\n if (newFocus.compareWith(this.focus) == 'same') {\n return;\n }\n const anchor = this.anchor;\n if (this._ranges.length) {\n this._popRange();\n }\n if (newFocus.compareWith(anchor) == 'before') {\n this._pushRange(new Range(newFocus, anchor));\n this._lastRangeBackward = true;\n }\n else {\n this._pushRange(new Range(anchor, newFocus));\n this._lastRangeBackward = false;\n }\n this.fire('change:range', { directChange: true });\n }\n /**\n * Gets an attribute value for given key or `undefined` if that attribute is not set on the selection.\n *\n * @param key Key of attribute to look for.\n * @returns Attribute value or `undefined`.\n */\n getAttribute(key) {\n return this._attrs.get(key);\n }\n /**\n * Returns iterable that iterates over this selection's attributes.\n *\n * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.\n * This format is accepted by native `Map` object and also can be passed in `Node` constructor.\n */\n getAttributes() {\n return this._attrs.entries();\n }\n /**\n * Returns iterable that iterates over this selection's attribute keys.\n */\n getAttributeKeys() {\n return this._attrs.keys();\n }\n /**\n * Checks if the selection has an attribute for given key.\n *\n * @param key Key of attribute to check.\n * @returns `true` if attribute with given key is set on selection, `false` otherwise.\n */\n hasAttribute(key) {\n return this._attrs.has(key);\n }\n /**\n * Removes an attribute with given key from the selection.\n *\n * If given attribute was set on the selection, fires the {@link #event:change:range} event with\n * removed attribute key.\n *\n * @fires change:attribute\n * @param key Key of attribute to remove.\n */\n removeAttribute(key) {\n if (this.hasAttribute(key)) {\n this._attrs.delete(key);\n this.fire('change:attribute', { attributeKeys: [key], directChange: true });\n }\n }\n /**\n * Sets attribute on the selection. If attribute with the same key already is set, it's value is overwritten.\n *\n * If the attribute value has changed, fires the {@link #event:change:range} event with\n * the attribute key.\n *\n * @fires change:attribute\n * @param key Key of attribute to set.\n * @param value Attribute value.\n */\n setAttribute(key, value) {\n if (this.getAttribute(key) !== value) {\n this._attrs.set(key, value);\n this.fire('change:attribute', { attributeKeys: [key], directChange: true });\n }\n }\n /**\n * Returns the selected element. {@link module:engine/model/element~Element Element} is considered as selected if there is only\n * one range in the selection, and that range contains exactly one element.\n * Returns `null` if there is no selected element.\n */\n getSelectedElement() {\n if (this.rangeCount !== 1) {\n return null;\n }\n return this.getFirstRange().getContainedElement();\n }\n /**\n * Gets elements of type {@link module:engine/model/schema~Schema#isBlock \"block\"} touched by the selection.\n *\n * This method's result can be used for example to apply block styling to all blocks covered by this selection.\n *\n * **Note:** `getSelectedBlocks()` returns blocks that are nested in other non-block elements\n * but will not return blocks nested in other blocks.\n *\n * In this case the function will return exactly all 3 paragraphs (note: `<blockQuote>` is not a block itself):\n *\n * ```xml\n * <paragraph>[a</paragraph>\n * <blockQuote>\n * \t<paragraph>b</paragraph>\n * </blockQuote>\n * <paragraph>c]d</paragraph>\n * ```\n *\n * In this case the paragraph will also be returned, despite the collapsed selection:\n *\n * ```xml\n * <paragraph>[]a</paragraph>\n * ```\n *\n * In such a scenario, however, only blocks A, B & E will be returned as blocks C & D are nested in block B:\n *\n * ```xml\n * [<blockA></blockA>\n * <blockB>\n * \t<blockC></blockC>\n * \t<blockD></blockD>\n * </blockB>\n * <blockE></blockE>]\n * ```\n *\n * If the selection is inside a block all the inner blocks (A & B) are returned:\n *\n * ```xml\n * <block>\n * \t<blockA>[a</blockA>\n * \t<blockB>b]</blockB>\n * </block>\n * ```\n *\n * **Special case**: Selection ignores first and/or last blocks if nothing (from user perspective) is selected in them.\n *\n * ```xml\n * // Selection ends and the beginning of the last block.\n * <paragraph>[a</paragraph>\n * <paragraph>b</paragraph>\n * <paragraph>]c</paragraph> // This block will not be returned\n *\n * // Selection begins at the end of the first block.\n * <paragraph>a[</paragraph> // This block will not be returned\n * <paragraph>b</paragraph>\n * <paragraph>c]</paragraph>\n *\n * // Selection begings at the end of the first block and ends at the beginning of the last block.\n * <paragraph>a[</paragraph> // This block will not be returned\n * <paragraph>b</paragraph>\n * <paragraph>]c</paragraph> // This block will not be returned\n * ```\n */\n *getSelectedBlocks() {\n const visited = new WeakSet();\n for (const range of this.getRanges()) {\n // Get start block of range in case of a collapsed range.\n const startBlock = getParentBlock(range.start, visited);\n if (isStartBlockSelected(startBlock, range)) {\n yield startBlock;\n }\n for (const value of range.getWalker()) {\n const block = value.item;\n if (value.type == 'elementEnd' && isUnvisitedTopBlock(block, visited, range)) {\n yield block;\n }\n }\n const endBlock = getParentBlock(range.end, visited);\n if (isEndBlockSelected(endBlock, range)) {\n yield endBlock;\n }\n }\n }\n /**\n * Checks whether the selection contains the entire content of the given element. This means that selection must start\n * at a position {@link module:engine/model/position~Position#isTouching touching} the element's start and ends at position\n * touching the element's end.\n *\n * By default, this method will check whether the entire content of the selection's current root is selected.\n * Useful to check if e.g. the user has just pressed <kbd>Ctrl</kbd> + <kbd>A</kbd>.\n */\n containsEntireContent(element = this.anchor.root) {\n const limitStartPosition = Position._createAt(element, 0);\n const limitEndPosition = Position._createAt(element, 'end');\n return limitStartPosition.isTouching(this.getFirstPosition()) &&\n limitEndPosition.isTouching(this.getLastPosition());\n }\n /**\n * Adds given range to internal {@link #_ranges ranges array}. Throws an error\n * if given range is intersecting with any range that is already stored in this selection.\n */\n _pushRange(range) {\n this._checkRange(range);\n this._ranges.push(new Range(range.start, range.end));\n }\n /**\n * Checks if given range intersects with ranges that are already in the selection. Throws an error if it does.\n */\n _checkRange(range) {\n for (let i = 0; i < this._ranges.length; i++) {\n if (range.isIntersecting(this._ranges[i])) {\n /**\n * Trying to add a range that intersects with another range in the selection.\n *\n * @error model-selection-range-intersects\n * @param addedRange Range that was added to the selection.\n * @param intersectingRange Range in the selection that intersects with `addedRange`.\n */\n throw new CKEditorError('model-selection-range-intersects', [this, range], { addedRange: range, intersectingRange: this._ranges[i] });\n }\n }\n }\n /**\n * Replaces all the ranges by the given ones.\n * Uses {@link #_popRange _popRange} and {@link #_pushRange _pushRange} to ensure proper ranges removal and addition.\n */\n _replaceAllRanges(ranges) {\n this._removeAllRanges();\n for (const range of ranges) {\n this._pushRange(range);\n }\n }\n /**\n * Deletes ranges from internal range array. Uses {@link #_popRange _popRange} to\n * ensure proper ranges removal.\n */\n _removeAllRanges() {\n while (this._ranges.length > 0) {\n this._popRange();\n }\n }\n /**\n * Removes most recently added range from the selection.\n */\n _popRange() {\n this._ranges.pop();\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nSelection.prototype.is = function (type) {\n return type === 'selection' || type === 'model:selection';\n};\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.\n */\nfunction isUnvisitedBlock(element, visited) {\n if (visited.has(element)) {\n return false;\n }\n visited.add(element);\n return element.root.document.model.schema.isBlock(element) && !!element.parent;\n}\n/**\n * Checks if the given element is a $block was not previously visited and is a top block in a range.\n */\nfunction isUnvisitedTopBlock(element, visited, range) {\n return isUnvisitedBlock(element, visited) && isTopBlockInRange(element, range);\n}\n/**\n * Finds the lowest element in position's ancestors which is a block.\n * It will search until first ancestor that is a limit element.\n * Marks all ancestors as already visited to not include any of them later on.\n */\nfunction getParentBlock(position, visited) {\n const element = position.parent;\n const schema = element.root.document.model.schema;\n const ancestors = position.parent.getAncestors({ parentFirst: true, includeSelf: true });\n let hasParentLimit = false;\n const block = ancestors.find((element) => {\n // Stop searching after first parent node that is limit element.\n if (hasParentLimit) {\n return false;\n }\n hasParentLimit = schema.isLimit(element);\n return !hasParentLimit && isUnvisitedBlock(element, visited);\n });\n // Mark all ancestors of this position's parent, because find() might've stopped early and\n // the found block may be a child of another block.\n ancestors.forEach(element => visited.add(element));\n return block;\n}\n/**\n * Checks if the blocks is not nested in other block inside a range.\n */\nfunction isTopBlockInRange(block, range) {\n const parentBlock = findAncestorBlock(block);\n if (!parentBlock) {\n return true;\n }\n // Add loose flag to check as parentRange can be equal to range.\n const isParentInRange = range.containsRange(Range._createOn(parentBlock), true);\n return !isParentInRange;\n}\n/**\n * If a selection starts at the end of a block, that block is not returned as from the user's perspective this block wasn't selected.\n * See [#11585](https://github.com/ckeditor/ckeditor5/issues/11585) for more details.\n *\n * ```xml\n * <paragraph>a[</paragraph> // This block will not be returned\n * <paragraph>b</paragraph>\n * <paragraph>c]</paragraph>\n * ```\n *\n * Collapsed selection is not affected by it:\n *\n * ```xml\n * <paragraph>a[]</paragraph> // This block will be returned\n * ```\n */\nfunction isStartBlockSelected(startBlock, range) {\n if (!startBlock) {\n return false;\n }\n if (range.isCollapsed || startBlock.isEmpty) {\n return true;\n }\n if (range.start.isTouching(Position._createAt(startBlock, startBlock.maxOffset))) {\n return false;\n }\n return isTopBlockInRange(startBlock, range);\n}\n/**\n * If a selection ends at the beginning of a block, that block is not returned as from the user's perspective this block wasn't selected.\n * See [#984](https://github.com/ckeditor/ckeditor5-engine/issues/984) for more details.\n *\n * ```xml\n * <paragraph>[a</paragraph>\n * <paragraph>b</paragraph>\n * <paragraph>]c</paragraph> // this block will not be returned\n * ```\n *\n * Collapsed selection is not affected by it:\n *\n * ```xml\n * <paragraph>[]a</paragraph> // this block will be returned\n * ```\n */\nfunction isEndBlockSelected(endBlock, range) {\n if (!endBlock) {\n return false;\n }\n if (range.isCollapsed || endBlock.isEmpty) {\n return true;\n }\n if (range.end.isTouching(Position._createAt(endBlock, 0))) {\n return false;\n }\n return isTopBlockInRange(endBlock, range);\n}\n/**\n * Returns first ancestor block of a node.\n */\nfunction findAncestorBlock(node) {\n const schema = node.root.document.model.schema;\n let parent = node.parent;\n while (parent) {\n if (schema.isBlock(parent)) {\n return parent;\n }\n parent = parent.parent;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/liverange\n */\nimport Range from './range';\nimport { EmitterMixin } from '@ckeditor/ckeditor5-utils';\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 EmitterMixin(Range) {\n /**\n * Creates a live range.\n *\n * @see module:engine/model/range~Range\n */\n constructor(start, end) {\n super(start, end);\n bindWithDocument.call(this);\n }\n /**\n * Unbinds all events previously bound by `LiveRange`. Use it whenever you don't need `LiveRange` instance\n * anymore (i.e. when leaving scope in which it was declared or before re-assigning variable that was\n * referring to it).\n */\n detach() {\n this.stopListening();\n }\n /**\n * Creates a {@link module:engine/model/range~Range range instance} that is equal to this live range.\n */\n toRange() {\n return new Range(this.start, this.end);\n }\n /**\n * Creates a `LiveRange` instance that is equal to the given range.\n */\n static fromRange(range) {\n return new LiveRange(range.start, range.end);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nLiveRange.prototype.is = function (type) {\n return type === 'liveRange' || type === 'model:liveRange' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type == 'range' || type === 'model:range';\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 */\nfunction bindWithDocument() {\n this.listenTo(this.root.document.model, 'applyOperation', (event, args) => {\n const operation = args[0];\n if (!operation.isDocumentOperation) {\n return;\n }\n transform.call(this, operation);\n }, { priority: 'low' });\n}\n/**\n * Updates this range accordingly to the updates applied to the model. Bases on change events.\n */\nfunction transform(operation) {\n // Transform the range by the operation. Join the result ranges if needed.\n const ranges = this.getTransformedByOperation(operation);\n const result = Range._createFromRanges(ranges);\n const boundariesChanged = !result.isEqual(this);\n const contentChanged = doesOperationChangeRangeContent(this, operation);\n let deletionPosition = null;\n if (boundariesChanged) {\n // If range boundaries have changed, fire `change:range` event.\n //\n if (result.root.rootName == '$graveyard') {\n // If the range was moved to the graveyard root, set `deletionPosition`.\n if (operation.type == 'remove') {\n deletionPosition = operation.sourcePosition;\n }\n else {\n // Merge operation.\n deletionPosition = operation.deletionPosition;\n }\n }\n const oldRange = this.toRange();\n this.start = result.start;\n this.end = result.end;\n this.fire('change:range', oldRange, { deletionPosition });\n }\n else if (contentChanged) {\n // If range boundaries have not changed, but there was change inside the range, fire `change:content` event.\n this.fire('change:content', this.toRange(), { deletionPosition });\n }\n}\n/**\n * Checks whether given operation changes something inside the range (even if it does not change boundaries).\n */\nfunction doesOperationChangeRangeContent(range, operation) {\n switch (operation.type) {\n case 'insert':\n return range.containsPosition(operation.position);\n case 'move':\n case 'remove':\n case 'reinsert':\n case 'merge':\n return range.containsPosition(operation.sourcePosition) ||\n range.start.isEqual(operation.sourcePosition) ||\n range.containsPosition(operation.targetPosition);\n case 'split':\n return range.containsPosition(operation.splitPosition) || range.containsPosition(operation.insertionPosition);\n }\n return false;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/documentselection\n */\nimport TypeCheckable from './typecheckable';\nimport LiveRange from './liverange';\nimport Selection from './selection';\nimport Text from './text';\nimport TextProxy from './textproxy';\nimport { CKEditorError, Collection, EmitterMixin, toMap, uid } from '@ckeditor/ckeditor5-utils';\nconst storePrefix = 'selection:';\n/**\n * `DocumentSelection` is a special selection which is used as the\n * {@link module:engine/model/document~Document#selection document's selection}.\n * There can be only one instance of `DocumentSelection` per document.\n *\n * Document selection can only be changed by using the {@link module:engine/model/writer~Writer} instance\n * inside the {@link module:engine/model/model~Model#change `change()`} block, as it provides a secure way to modify model.\n *\n * `DocumentSelection` is automatically updated upon changes in the {@link module:engine/model/document~Document document}\n * to always contain valid ranges. Its attributes are inherited from the text unless set explicitly.\n *\n * Differences between {@link module:engine/model/selection~Selection} and `DocumentSelection` are:\n * * there is always a range in `DocumentSelection` - even if no ranges were added there is a \"default range\"\n * present in the selection,\n * * ranges added to this selection updates automatically when the document changes,\n * * attributes of `DocumentSelection` are updated automatically according to selection ranges.\n *\n * Since `DocumentSelection` uses {@link module:engine/model/liverange~LiveRange live ranges}\n * and is updated when {@link module:engine/model/document~Document document}\n * changes, it cannot be set on {@link module:engine/model/node~Node nodes}\n * that are inside {@link module:engine/model/documentfragment~DocumentFragment document fragment}.\n * If you need to represent a selection in document fragment,\n * use {@link module:engine/model/selection~Selection Selection class} instead.\n */\nexport default class DocumentSelection extends EmitterMixin(TypeCheckable) {\n /**\n * Creates an empty live selection for given {@link module:engine/model/document~Document}.\n *\n * @param doc Document which owns this selection.\n */\n constructor(doc) {\n super();\n this._selection = new LiveSelection(doc);\n this._selection.delegate('change:range').to(this);\n this._selection.delegate('change:attribute').to(this);\n this._selection.delegate('change:marker').to(this);\n }\n /**\n * Describes whether the selection is collapsed. Selection is collapsed when there is exactly one range which is\n * collapsed.\n */\n get isCollapsed() {\n return this._selection.isCollapsed;\n }\n /**\n * Selection anchor. Anchor may be described as a position where the most recent part of the selection starts.\n * Together with {@link #focus} they define the direction of selection, which is important\n * when expanding/shrinking selection. Anchor is always {@link module:engine/model/range~Range#start start} or\n * {@link module:engine/model/range~Range#end end} position of the most recently added range.\n *\n * Is set to `null` if there are no ranges in selection.\n *\n * @see #focus\n */\n get anchor() {\n return this._selection.anchor;\n }\n /**\n * Selection focus. Focus is a position where the selection ends.\n *\n * Is set to `null` if there are no ranges in selection.\n *\n * @see #anchor\n */\n get focus() {\n return this._selection.focus;\n }\n /**\n * Number of ranges in selection.\n */\n get rangeCount() {\n return this._selection.rangeCount;\n }\n /**\n * Describes whether `Documentselection` has own range(s) set, or if it is defaulted to\n * {@link module:engine/model/document~Document#_getDefaultRange document's default range}.\n */\n get hasOwnRange() {\n return this._selection.hasOwnRange;\n }\n /**\n * Specifies whether the {@link #focus}\n * precedes {@link #anchor}.\n *\n * @readonly\n * @type {Boolean}\n */\n get isBackward() {\n return this._selection.isBackward;\n }\n /**\n * Describes whether the gravity is overridden (using {@link module:engine/model/writer~Writer#overrideSelectionGravity}) or not.\n *\n * Note that the gravity remains overridden as long as will not be restored the same number of times as it was overridden.\n */\n get isGravityOverridden() {\n return this._selection.isGravityOverridden;\n }\n /**\n * A collection of selection {@link module:engine/model/markercollection~Marker markers}.\n * Marker is a selection marker when selection range is inside the marker range.\n *\n * **Note**: Only markers from {@link ~DocumentSelection#observeMarkers observed markers groups} are collected.\n */\n get markers() {\n return this._selection.markers;\n }\n /**\n * Used for the compatibility with the {@link module:engine/model/selection~Selection#isEqual} method.\n *\n * @internal\n */\n get _ranges() {\n return this._selection._ranges;\n }\n /**\n * Returns an iterable that iterates over copies of selection ranges.\n */\n getRanges() {\n return this._selection.getRanges();\n }\n /**\n * Returns the first position in the selection.\n * First position is the position that {@link module:engine/model/position~Position#isBefore is before}\n * any other position in the selection.\n *\n * Returns `null` if there are no ranges in selection.\n */\n getFirstPosition() {\n return this._selection.getFirstPosition();\n }\n /**\n * Returns the last position in the selection.\n * Last position is the position that {@link module:engine/model/position~Position#isAfter is after}\n * any other position in the selection.\n *\n * Returns `null` if there are no ranges in selection.\n */\n getLastPosition() {\n return this._selection.getLastPosition();\n }\n /**\n * Returns a copy of the first range in the selection.\n * First range is the one which {@link module:engine/model/range~Range#start start} position\n * {@link module:engine/model/position~Position#isBefore is before} start position of all other ranges\n * (not to confuse with the first range added to the selection).\n *\n * Returns `null` if there are no ranges in selection.\n */\n getFirstRange() {\n return this._selection.getFirstRange();\n }\n /**\n * Returns a copy of the last range in the selection.\n * Last range is the one which {@link module:engine/model/range~Range#end end} position\n * {@link module:engine/model/position~Position#isAfter is after} end position of all other ranges (not to confuse with the range most\n * recently added to the selection).\n *\n * Returns `null` if there are no ranges in selection.\n */\n getLastRange() {\n return this._selection.getLastRange();\n }\n /**\n * Gets elements of type {@link module:engine/model/schema~Schema#isBlock \"block\"} touched by the selection.\n *\n * This method's result can be used for example to apply block styling to all blocks covered by this selection.\n *\n * **Note:** `getSelectedBlocks()` returns blocks that are nested in other non-block elements\n * but will not return blocks nested in other blocks.\n *\n * In this case the function will return exactly all 3 paragraphs (note: `<blockQuote>` is not a block itself):\n *\n * ```\n * <paragraph>[a</paragraph>\n * <blockQuote>\n * \t<paragraph>b</paragraph>\n * </blockQuote>\n * <paragraph>c]d</paragraph>\n * ```\n *\n * In this case the paragraph will also be returned, despite the collapsed selection:\n *\n * ```\n * <paragraph>[]a</paragraph>\n * ```\n *\n * In such a scenario, however, only blocks A, B & E will be returned as blocks C & D are nested in block B:\n *\n * ```\n * [<blockA></blockA>\n * <blockB>\n * \t<blockC></blockC>\n * \t<blockD></blockD>\n * </blockB>\n * <blockE></blockE>]\n * ```\n *\n * If the selection is inside a block all the inner blocks (A & B) are returned:\n *\n * ```\n * <block>\n * \t<blockA>[a</blockA>\n * \t<blockB>b]</blockB>\n * </block>\n * ```\n *\n * **Special case**: If a selection ends at the beginning of a block, that block is not returned as from user perspective\n * this block wasn't selected. See [#984](https://github.com/ckeditor/ckeditor5-engine/issues/984) for more details.\n *\n * ```\n * <paragraph>[a</paragraph>\n * <paragraph>b</paragraph>\n * <paragraph>]c</paragraph> // this block will not be returned\n * ```\n */\n getSelectedBlocks() {\n return this._selection.getSelectedBlocks();\n }\n /**\n * Returns the selected element. {@link module:engine/model/element~Element Element} is considered as selected if there is only\n * one range in the selection, and that range contains exactly one element.\n * Returns `null` if there is no selected element.\n */\n getSelectedElement() {\n return this._selection.getSelectedElement();\n }\n /**\n * Checks whether the selection contains the entire content of the given element. This means that selection must start\n * at a position {@link module:engine/model/position~Position#isTouching touching} the element's start and ends at position\n * touching the element's end.\n *\n * By default, this method will check whether the entire content of the selection's current root is selected.\n * Useful to check if e.g. the user has just pressed <kbd>Ctrl</kbd> + <kbd>A</kbd>.\n */\n containsEntireContent(element) {\n return this._selection.containsEntireContent(element);\n }\n /**\n * Unbinds all events previously bound by document selection.\n */\n destroy() {\n this._selection.destroy();\n }\n /**\n * Returns iterable that iterates over this selection's attribute keys.\n */\n getAttributeKeys() {\n return this._selection.getAttributeKeys();\n }\n /**\n * Returns iterable that iterates over this selection's attributes.\n *\n * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.\n * This format is accepted by native `Map` object and also can be passed in `Node` constructor.\n */\n getAttributes() {\n return this._selection.getAttributes();\n }\n /**\n * Gets an attribute value for given key or `undefined` if that attribute is not set on the selection.\n *\n * @param key Key of attribute to look for.\n * @returns Attribute value or `undefined`.\n */\n getAttribute(key) {\n return this._selection.getAttribute(key);\n }\n /**\n * Checks if the selection has an attribute for given key.\n *\n * @param key Key of attribute to check.\n * @returns `true` if attribute with given key is set on selection, `false` otherwise.\n */\n hasAttribute(key) {\n return this._selection.hasAttribute(key);\n }\n /**\n * Refreshes selection attributes and markers according to the current position in the model.\n */\n refresh() {\n this._selection.updateMarkers();\n this._selection._updateAttributes(false);\n }\n /**\n * Registers a marker group prefix or a marker name to be collected in the\n * {@link ~DocumentSelection#markers selection markers collection}.\n *\n * See also {@link module:engine/model/markercollection~MarkerCollection#getMarkersGroup `MarkerCollection#getMarkersGroup()`}.\n *\n * @param prefixOrName The marker group prefix or marker name.\n */\n observeMarkers(prefixOrName) {\n this._selection.observeMarkers(prefixOrName);\n }\n /**\n * Moves {@link module:engine/model/documentselection~DocumentSelection#focus} to the specified location.\n * Should be used only within the {@link module:engine/model/writer~Writer#setSelectionFocus} method.\n *\n * The location can be specified in the same form as\n * {@link module:engine/model/writer~Writer#createPositionAt writer.createPositionAt()} parameters.\n *\n * @see module:engine/model/writer~Writer#setSelectionFocus\n * @internal\n * @param offset Offset or one of the flags. Used only when\n * first parameter is a {@link module:engine/model/item~Item model item}.\n */\n _setFocus(itemOrPosition, offset) {\n this._selection.setFocus(itemOrPosition, offset);\n }\n /**\n * Sets this selection's ranges and direction to the specified location based on the given\n * {@link module:engine/model/selection~Selectable selectable}.\n * Should be used only within the {@link module:engine/model/writer~Writer#setSelection} method.\n *\n * @see module:engine/model/writer~Writer#setSelection\n * @internal\n */\n _setTo(...args) {\n this._selection.setTo(...args);\n }\n /**\n * Sets attribute on the selection. If attribute with the same key already is set, it's value is overwritten.\n * Should be used only within the {@link module:engine/model/writer~Writer#setSelectionAttribute} method.\n *\n * @see module:engine/model/writer~Writer#setSelectionAttribute\n * @internal\n * @param key Key of the attribute to set.\n * @param value Attribute value.\n */\n _setAttribute(key, value) {\n this._selection.setAttribute(key, value);\n }\n /**\n * Removes an attribute with given key from the selection.\n * If the given attribute was set on the selection, fires the {@link module:engine/model/selection~Selection#event:change:range}\n * event with removed attribute key.\n * Should be used only within the {@link module:engine/model/writer~Writer#removeSelectionAttribute} method.\n *\n * @see module:engine/model/writer~Writer#removeSelectionAttribute\n * @internal\n * @param key Key of the attribute to remove.\n */\n _removeAttribute(key) {\n this._selection.removeAttribute(key);\n }\n /**\n * Returns an iterable that iterates through all selection attributes stored in current selection's parent.\n *\n * @internal\n */\n _getStoredAttributes() {\n return this._selection.getStoredAttributes();\n }\n /**\n * Temporarily changes the gravity of the selection from the left to the right.\n *\n * The gravity defines from which direction the selection inherits its attributes. If it's the default left\n * gravity, the selection (after being moved by the the user) inherits attributes from its left hand side.\n * This method allows to temporarily override this behavior by forcing the gravity to the right.\n *\n * It returns an unique identifier which is required to restore the gravity. It guarantees the symmetry\n * of the process.\n *\n * @see module:engine/model/writer~Writer#overrideSelectionGravity\n * @internal\n * @returns The unique id which allows restoring the gravity.\n */\n _overrideGravity() {\n return this._selection.overrideGravity();\n }\n /**\n * Restores the {@link ~DocumentSelection#_overrideGravity overridden gravity}.\n *\n * Restoring the gravity is only possible using the unique identifier returned by\n * {@link ~DocumentSelection#_overrideGravity}. Note that the gravity remains overridden as long as won't be restored\n * the same number of times it was overridden.\n *\n * @see module:engine/model/writer~Writer#restoreSelectionGravity\n * @internal\n * @param uid The unique id returned by {@link #_overrideGravity}.\n */\n _restoreGravity(uid) {\n this._selection.restoreGravity(uid);\n }\n /**\n * Generates and returns an attribute key for selection attributes store, basing on original attribute key.\n *\n * @internal\n * @param key Attribute key to convert.\n * @returns Converted attribute key, applicable for selection store.\n */\n static _getStoreAttributeKey(key) {\n return storePrefix + key;\n }\n /**\n * Checks whether the given attribute key is an attribute stored on an element.\n *\n * @internal\n */\n static _isStoreAttributeKey(key) {\n return key.startsWith(storePrefix);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nDocumentSelection.prototype.is = function (type) {\n return type === 'selection' ||\n type == 'model:selection' ||\n type == 'documentSelection' ||\n type == 'model:documentSelection';\n};\n/**\n * `LiveSelection` is used internally by {@link module:engine/model/documentselection~DocumentSelection} and shouldn't be used directly.\n *\n * LiveSelection` is automatically updated upon changes in the {@link module:engine/model/document~Document document}\n * to always contain valid ranges. Its attributes are inherited from the text unless set explicitly.\n *\n * Differences between {@link module:engine/model/selection~Selection} and `LiveSelection` are:\n * * there is always a range in `LiveSelection` - even if no ranges were added there is a \"default range\"\n * present in the selection,\n * * ranges added to this selection updates automatically when the document changes,\n * * attributes of `LiveSelection` are updated automatically according to selection ranges.\n */\nclass LiveSelection extends Selection {\n /**\n * Creates an empty live selection for given {@link module:engine/model/document~Document}.\n *\n * @param doc Document which owns this selection.\n */\n constructor(doc) {\n super();\n /**\n * List of selection markers.\n * Marker is a selection marker when selection range is inside the marker range.\n */\n this.markers = new Collection({ idProperty: 'name' });\n /**\n * Keeps mapping of attribute name to priority with which the attribute got modified (added/changed/removed)\n * last time. Possible values of priority are: `'low'` and `'normal'`.\n *\n * Priorities are used by internal `LiveSelection` mechanisms. All attributes set using `LiveSelection`\n * attributes API are set with `'normal'` priority.\n */\n this._attributePriority = new Map();\n /**\n * Position to which the selection should be set if the last selection range was moved to the graveyard.\n */\n this._selectionRestorePosition = null;\n /**\n * Flag that informs whether the selection ranges have changed. It is changed on true when `LiveRange#change:range` event is fired.\n */\n this._hasChangedRange = false;\n /**\n * Each overriding gravity adds an UID to the set and each removal removes it.\n * Gravity is overridden when there's at least one UID in the set.\n * Gravity is restored when the set is empty.\n * This is to prevent conflicts when gravity is overridden by more than one feature at the same time.\n */\n this._overriddenGravityRegister = new Set();\n /**\n * Prefixes of marker names that should affect `LiveSelection#markers` collection.\n */\n this._observedMarkers = new Set();\n this._model = doc.model;\n this._document = doc;\n // Ensure selection is correct after each operation.\n this.listenTo(this._model, 'applyOperation', (evt, args) => {\n const operation = args[0];\n if (!operation.isDocumentOperation || operation.type == 'marker' || operation.type == 'rename' || operation.type == 'noop') {\n return;\n }\n // Fix selection if the last range was removed from it and we have a position to which we can restore the selection.\n if (this._ranges.length == 0 && this._selectionRestorePosition) {\n this._fixGraveyardSelection(this._selectionRestorePosition);\n }\n // \"Forget\" the restore position even if it was not \"used\".\n this._selectionRestorePosition = null;\n if (this._hasChangedRange) {\n this._hasChangedRange = false;\n this.fire('change:range', { directChange: false });\n }\n }, { priority: 'lowest' });\n // Ensure selection is correct and up to date after each range change.\n this.on('change:range', () => {\n this._validateSelectionRanges(this.getRanges());\n });\n // Update markers data stored by the selection after each marker change.\n // This handles only marker changes done through marker operations (not model tree changes).\n this.listenTo(this._model.markers, 'update', (evt, marker, oldRange, newRange) => {\n this._updateMarker(marker, newRange);\n });\n // Ensure selection is up to date after each change block.\n this.listenTo(this._document, 'change', (evt, batch) => {\n clearAttributesStoredInElement(this._model, batch);\n });\n }\n get isCollapsed() {\n const length = this._ranges.length;\n return length === 0 ? this._document._getDefaultRange().isCollapsed : super.isCollapsed;\n }\n get anchor() {\n return super.anchor || this._document._getDefaultRange().start;\n }\n get focus() {\n return super.focus || this._document._getDefaultRange().end;\n }\n get rangeCount() {\n return this._ranges.length ? this._ranges.length : 1;\n }\n /**\n * Describes whether `LiveSelection` has own range(s) set, or if it is defaulted to\n * {@link module:engine/model/document~Document#_getDefaultRange document's default range}.\n */\n get hasOwnRange() {\n return this._ranges.length > 0;\n }\n /**\n * When set to `true` then selection attributes on node before the caret won't be taken\n * into consideration while updating selection attributes.\n */\n get isGravityOverridden() {\n return !!this._overriddenGravityRegister.size;\n }\n /**\n * Unbinds all events previously bound by live selection.\n */\n destroy() {\n for (let i = 0; i < this._ranges.length; i++) {\n this._ranges[i].detach();\n }\n this.stopListening();\n }\n *getRanges() {\n if (this._ranges.length) {\n yield* super.getRanges();\n }\n else {\n yield this._document._getDefaultRange();\n }\n }\n getFirstRange() {\n return super.getFirstRange() || this._document._getDefaultRange();\n }\n getLastRange() {\n return super.getLastRange() || this._document._getDefaultRange();\n }\n setTo(...args) {\n super.setTo(...args);\n this._updateAttributes(true);\n this.updateMarkers();\n }\n setFocus(itemOrPosition, offset) {\n super.setFocus(itemOrPosition, offset);\n this._updateAttributes(true);\n this.updateMarkers();\n }\n setAttribute(key, value) {\n if (this._setAttribute(key, value)) {\n // Fire event with exact data.\n const attributeKeys = [key];\n this.fire('change:attribute', { attributeKeys, directChange: true });\n }\n }\n removeAttribute(key) {\n if (this._removeAttribute(key)) {\n // Fire event with exact data.\n const attributeKeys = [key];\n this.fire('change:attribute', { attributeKeys, directChange: true });\n }\n }\n overrideGravity() {\n const overrideUid = uid();\n // Remember that another overriding has been requested. It will need to be removed\n // before the gravity is to be restored.\n this._overriddenGravityRegister.add(overrideUid);\n if (this._overriddenGravityRegister.size === 1) {\n this._updateAttributes(true);\n }\n return overrideUid;\n }\n restoreGravity(uid) {\n if (!this._overriddenGravityRegister.has(uid)) {\n /**\n * Restoring gravity for an unknown UID is not possible. Make sure you are using a correct\n * UID obtained from the {@link module:engine/model/writer~Writer#overrideSelectionGravity} to restore.\n *\n * @error document-selection-gravity-wrong-restore\n * @param uid The unique identifier returned by\n * {@link module:engine/model/documentselection~DocumentSelection#_overrideGravity}.\n */\n throw new CKEditorError('document-selection-gravity-wrong-restore', this, { uid });\n }\n this._overriddenGravityRegister.delete(uid);\n // Restore gravity only when all overriding have been restored.\n if (!this.isGravityOverridden) {\n this._updateAttributes(true);\n }\n }\n observeMarkers(prefixOrName) {\n this._observedMarkers.add(prefixOrName);\n this.updateMarkers();\n }\n _replaceAllRanges(ranges) {\n this._validateSelectionRanges(ranges);\n super._replaceAllRanges(ranges);\n }\n _popRange() {\n this._ranges.pop().detach();\n }\n _pushRange(range) {\n const liveRange = this._prepareRange(range);\n // `undefined` is returned when given `range` is in graveyard root.\n if (liveRange) {\n this._ranges.push(liveRange);\n }\n }\n _validateSelectionRanges(ranges) {\n for (const range of ranges) {\n if (!this._document._validateSelectionRange(range)) {\n /**\n * Range from {@link module:engine/model/documentselection~DocumentSelection document selection}\n * starts or ends at incorrect position.\n *\n * @error document-selection-wrong-position\n * @param range\n */\n throw new CKEditorError('document-selection-wrong-position', this, { range });\n }\n }\n }\n /**\n * Prepares given range to be added to selection. Checks if it is correct,\n * converts it to {@link module:engine/model/liverange~LiveRange LiveRange}\n * and sets listeners listening to the range's change event.\n */\n _prepareRange(range) {\n this._checkRange(range);\n if (range.root == this._document.graveyard) {\n // @if CK_DEBUG // console.warn( 'Trying to add a Range that is in the graveyard root. Range rejected.' );\n return;\n }\n const liveRange = LiveRange.fromRange(range);\n // If selection range is moved to the graveyard remove it from the selection object.\n // Also, save some data that can be used to restore selection later, on `Model#applyOperation` event.\n liveRange.on('change:range', (evt, oldRange, data) => {\n this._hasChangedRange = true;\n if (liveRange.root == this._document.graveyard) {\n this._selectionRestorePosition = data.deletionPosition;\n const index = this._ranges.indexOf(liveRange);\n this._ranges.splice(index, 1);\n liveRange.detach();\n }\n });\n return liveRange;\n }\n updateMarkers() {\n if (!this._observedMarkers.size) {\n return;\n }\n const markers = [];\n let changed = false;\n for (const marker of this._model.markers) {\n const markerGroup = marker.name.split(':', 1)[0];\n if (!this._observedMarkers.has(markerGroup)) {\n continue;\n }\n const markerRange = marker.getRange();\n for (const selectionRange of this.getRanges()) {\n if (markerRange.containsRange(selectionRange, !selectionRange.isCollapsed)) {\n markers.push(marker);\n }\n }\n }\n const oldMarkers = Array.from(this.markers);\n for (const marker of markers) {\n if (!this.markers.has(marker)) {\n this.markers.add(marker);\n changed = true;\n }\n }\n for (const marker of Array.from(this.markers)) {\n if (!markers.includes(marker)) {\n this.markers.remove(marker);\n changed = true;\n }\n }\n if (changed) {\n this.fire('change:marker', { oldMarkers, directChange: false });\n }\n }\n _updateMarker(marker, markerRange) {\n const markerGroup = marker.name.split(':', 1)[0];\n if (!this._observedMarkers.has(markerGroup)) {\n return;\n }\n let changed = false;\n const oldMarkers = Array.from(this.markers);\n const hasMarker = this.markers.has(marker);\n if (!markerRange) {\n if (hasMarker) {\n this.markers.remove(marker);\n changed = true;\n }\n }\n else {\n let contained = false;\n for (const selectionRange of this.getRanges()) {\n if (markerRange.containsRange(selectionRange, !selectionRange.isCollapsed)) {\n contained = true;\n break;\n }\n }\n if (contained && !hasMarker) {\n this.markers.add(marker);\n changed = true;\n }\n else if (!contained && hasMarker) {\n this.markers.remove(marker);\n changed = true;\n }\n }\n if (changed) {\n this.fire('change:marker', { oldMarkers, directChange: false });\n }\n }\n /**\n * Updates this selection attributes according to its ranges and the {@link module:engine/model/document~Document model document}.\n */\n _updateAttributes(clearAll) {\n const newAttributes = toMap(this._getSurroundingAttributes());\n const oldAttributes = toMap(this.getAttributes());\n if (clearAll) {\n // If `clearAll` remove all attributes and reset priorities.\n this._attributePriority = new Map();\n this._attrs = new Map();\n }\n else {\n // If not, remove only attributes added with `low` priority.\n for (const [key, priority] of this._attributePriority) {\n if (priority == 'low') {\n this._attrs.delete(key);\n this._attributePriority.delete(key);\n }\n }\n }\n this._setAttributesTo(newAttributes);\n // Let's evaluate which attributes really changed.\n const changed = [];\n // First, loop through all attributes that are set on selection right now.\n // Check which of them are different than old attributes.\n for (const [newKey, newValue] of this.getAttributes()) {\n if (!oldAttributes.has(newKey) || oldAttributes.get(newKey) !== newValue) {\n changed.push(newKey);\n }\n }\n // Then, check which of old attributes got removed.\n for (const [oldKey] of oldAttributes) {\n if (!this.hasAttribute(oldKey)) {\n changed.push(oldKey);\n }\n }\n // Fire event with exact data (fire only if anything changed).\n if (changed.length > 0) {\n this.fire('change:attribute', { attributeKeys: changed, directChange: false });\n }\n }\n /**\n * Internal method for setting `LiveSelection` attribute. Supports attribute priorities (through `directChange`\n * parameter).\n */\n _setAttribute(key, value, directChange = true) {\n const priority = directChange ? 'normal' : 'low';\n if (priority == 'low' && this._attributePriority.get(key) == 'normal') {\n // Priority too low.\n return false;\n }\n const oldValue = super.getAttribute(key);\n // Don't do anything if value has not changed.\n if (oldValue === value) {\n return false;\n }\n this._attrs.set(key, value);\n // Update priorities map.\n this._attributePriority.set(key, priority);\n return true;\n }\n /**\n * Internal method for removing `LiveSelection` attribute. Supports attribute priorities (through `directChange`\n * parameter).\n *\n * NOTE: Even if attribute is not present in the selection but is provided to this method, it's priority will\n * be changed according to `directChange` parameter.\n */\n _removeAttribute(key, directChange = true) {\n const priority = directChange ? 'normal' : 'low';\n if (priority == 'low' && this._attributePriority.get(key) == 'normal') {\n // Priority too low.\n return false;\n }\n // Update priorities map.\n this._attributePriority.set(key, priority);\n // Don't do anything if value has not changed.\n if (!super.hasAttribute(key)) {\n return false;\n }\n this._attrs.delete(key);\n return true;\n }\n /**\n * Internal method for setting multiple `LiveSelection` attributes. Supports attribute priorities (through\n * `directChange` parameter).\n */\n _setAttributesTo(attrs) {\n const changed = new Set();\n for (const [oldKey, oldValue] of this.getAttributes()) {\n // Do not remove attribute if attribute with same key and value is about to be set.\n if (attrs.get(oldKey) === oldValue) {\n continue;\n }\n // All rest attributes will be removed so changed attributes won't change .\n this._removeAttribute(oldKey, false);\n }\n for (const [key, value] of attrs) {\n // Attribute may not be set because of attributes or because same key/value is already added.\n const gotAdded = this._setAttribute(key, value, false);\n if (gotAdded) {\n changed.add(key);\n }\n }\n return changed;\n }\n /**\n * Returns an iterable that iterates through all selection attributes stored in current selection's parent.\n */\n *getStoredAttributes() {\n const selectionParent = this.getFirstPosition().parent;\n if (this.isCollapsed && selectionParent.isEmpty) {\n for (const key of selectionParent.getAttributeKeys()) {\n if (key.startsWith(storePrefix)) {\n const realKey = key.substr(storePrefix.length);\n yield [realKey, selectionParent.getAttribute(key)];\n }\n }\n }\n }\n /**\n * Checks model text nodes that are closest to the selection's first position and returns attributes of first\n * found element. If there are no text nodes in selection's first position parent, it returns selection\n * attributes stored in that parent.\n */\n _getSurroundingAttributes() {\n const position = this.getFirstPosition();\n const schema = this._model.schema;\n let attrs = null;\n if (!this.isCollapsed) {\n // 1. If selection is a range...\n const range = this.getFirstRange();\n // ...look for a first character node in that range and take attributes from it.\n for (const value of range) {\n // If the item is an object, we don't want to get attributes from its children.\n if (value.item.is('element') && schema.isObject(value.item)) {\n break;\n }\n if (value.type == 'text') {\n attrs = value.item.getAttributes();\n break;\n }\n }\n }\n else {\n // 2. If the selection is a caret or the range does not contain a character node...\n const nodeBefore = position.textNode ? position.textNode : position.nodeBefore;\n const nodeAfter = position.textNode ? position.textNode : position.nodeAfter;\n // When gravity is overridden then don't take node before into consideration.\n if (!this.isGravityOverridden) {\n // ...look at the node before caret and take attributes from it if it is a character node.\n attrs = getAttrsIfCharacter(nodeBefore);\n }\n // 3. If not, look at the node after caret...\n if (!attrs) {\n attrs = getAttrsIfCharacter(nodeAfter);\n }\n // 4. If not, try to find the first character on the left, that is in the same node.\n // When gravity is overridden then don't take node before into consideration.\n if (!this.isGravityOverridden && !attrs) {\n let node = nodeBefore;\n while (node && !schema.isInline(node) && !attrs) {\n node = node.previousSibling;\n attrs = getAttrsIfCharacter(node);\n }\n }\n // 5. If not found, try to find the first character on the right, that is in the same node.\n if (!attrs) {\n let node = nodeAfter;\n while (node && !schema.isInline(node) && !attrs) {\n node = node.nextSibling;\n attrs = getAttrsIfCharacter(node);\n }\n }\n // 6. If not found, selection should retrieve attributes from parent.\n if (!attrs) {\n attrs = this.getStoredAttributes();\n }\n }\n return attrs;\n }\n /**\n * Fixes the selection after all its ranges got removed.\n * @param deletionPosition Position where the deletion happened.\n */\n _fixGraveyardSelection(deletionPosition) {\n // Find a range that is a correct selection range and is closest to the position where the deletion happened.\n const selectionRange = this._model.schema.getNearestSelectionRange(deletionPosition);\n // If nearest valid selection range has been found - add it in the place of old range.\n if (selectionRange) {\n // Check the range, convert it to live range, bind events, etc.\n this._pushRange(selectionRange);\n }\n // If nearest valid selection range cannot be found don't add any range. Selection will be set to the default range.\n }\n}\n/**\n * Helper function for {@link module:engine/model/liveselection~LiveSelection#_updateAttributes}.\n *\n * It takes model item, checks whether it is a text node (or text proxy) and, if so, returns it's attributes. If not, returns `null`.\n */\nfunction getAttrsIfCharacter(node) {\n if (node instanceof TextProxy || node instanceof Text) {\n return node.getAttributes();\n }\n return null;\n}\n/**\n * Removes selection attributes from element which is not empty anymore.\n */\nfunction clearAttributesStoredInElement(model, batch) {\n const differ = model.document.differ;\n for (const entry of differ.getChanges()) {\n if (entry.type != 'insert') {\n continue;\n }\n const changeParent = entry.position.parent;\n const isNoLongerEmpty = entry.length === changeParent.maxOffset;\n if (isNoLongerEmpty) {\n model.enqueueChange(batch, writer => {\n const storedAttributes = Array.from(changeParent.getAttributeKeys())\n .filter(key => key.startsWith(storePrefix));\n for (const key of storedAttributes) {\n writer.removeAttribute(key, changeParent);\n }\n });\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/conversion/conversionhelpers\n */\n/**\n * Base class for conversion helpers.\n */\nexport default class ConversionHelpers {\n /**\n * Creates a conversion helpers instance.\n */\n constructor(dispatchers) {\n this._dispatchers = dispatchers;\n }\n /**\n * Registers a conversion helper.\n *\n * **Note**: See full usage example in the `{@link module:engine/conversion/conversion~Conversion#for conversion.for()}`\n * method description.\n *\n * @param conversionHelper The function to be called on event.\n */\n add(conversionHelper) {\n for (const dispatcher of this._dispatchers) {\n conversionHelper(dispatcher);\n }\n return this;\n }\n}\n","import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nexport default cloneDeep;\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Contains downcast (model-to-view) converters for {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}.\n *\n * @module engine/conversion/downcasthelpers\n */\nimport ModelRange from '../model/range';\nimport ModelSelection from '../model/selection';\nimport ModelDocumentSelection from '../model/documentselection';\nimport ModelElement from '../model/element';\nimport ModelPosition from '../model/position';\nimport ViewAttributeElement from '../view/attributeelement';\nimport ConversionHelpers from './conversionhelpers';\nimport { CKEditorError, toArray } from '@ckeditor/ckeditor5-utils';\nimport { cloneDeep } from 'lodash-es';\n/**\n * Downcast conversion helper functions.\n *\n * Learn more about {@glink framework/deep-dive/conversion/downcast downcast helpers}.\n *\n * @extends module:engine/conversion/conversionhelpers~ConversionHelpers\n */\nexport default class DowncastHelpers extends ConversionHelpers {\n /**\n * Model element to view element conversion helper.\n *\n * This conversion results in creating a view element. For example, model `<paragraph>Foo</paragraph>` becomes `<p>Foo</p>` in the view.\n *\n * ```ts\n * editor.conversion.for( 'downcast' ).elementToElement( {\n * \tmodel: 'paragraph',\n * \tview: 'p'\n * } );\n *\n * editor.conversion.for( 'downcast' ).elementToElement( {\n * \tmodel: 'paragraph',\n * \tview: 'div',\n * \tconverterPriority: 'high'\n * } );\n *\n * editor.conversion.for( 'downcast' ).elementToElement( {\n * \tmodel: 'fancyParagraph',\n * \tview: {\n * \t\tname: 'p',\n * \t\tclasses: 'fancy'\n * \t}\n * } );\n *\n * editor.conversion.for( 'downcast' ).elementToElement( {\n * \tmodel: 'heading',\n * \tview: ( modelElement, conversionApi ) => {\n * \t\tconst { writer } = conversionApi;\n *\n * \t\treturn writer.createContainerElement( 'h' + modelElement.getAttribute( 'level' ) );\n * \t}\n * } );\n * ```\n *\n * The element-to-element conversion supports the reconversion mechanism. It can be enabled by using either the `attributes` or\n * the `children` props on a model description. You will find a couple examples below.\n *\n * In order to reconvert an element if any of its direct children have been added or removed, use the `children` property on a `model`\n * description. For example, this model:\n *\n * ```xml\n * <box>\n * \t<paragraph>Some text.</paragraph>\n * </box>\n * ```\n *\n * will be converted into this structure in the view:\n *\n * ```html\n * <div class=\"box\" data-type=\"single\">\n * \t<p>Some text.</p>\n * </div>\n * ```\n *\n * But if more items were inserted in the model:\n *\n * ```xml\n * <box>\n * \t<paragraph>Some text.</paragraph>\n * \t<paragraph>Other item.</paragraph>\n * </box>\n * ```\n *\n * it will be converted into this structure in the view (note the element `data-type` change):\n *\n * ```html\n * <div class=\"box\" data-type=\"multiple\">\n * \t<p>Some text.</p>\n * \t<p>Other item.</p>\n * </div>\n * ```\n *\n * Such a converter would look like this (note that the `paragraph` elements are converted separately):\n *\n * ```ts\n * editor.conversion.for( 'downcast' ).elementToElement( {\n * \tmodel: {\n * \t\tname: 'box',\n * \t\tchildren: true\n * \t},\n * \tview: ( modelElement, conversionApi ) => {\n * \t\tconst { writer } = conversionApi;\n *\n * \t\treturn writer.createContainerElement( 'div', {\n * \t\t\tclass: 'box',\n * \t\t\t'data-type': modelElement.childCount == 1 ? 'single' : 'multiple'\n * \t\t} );\n * \t}\n * } );\n * ```\n *\n * In order to reconvert element if any of its attributes have been updated, use the `attributes` property on a `model`\n * description. For example, this model:\n *\n * ```xml\n * <heading level=\"2\">Some text.</heading>\n * ```\n *\n * will be converted into this structure in the view:\n *\n * ```html\n * <h2>Some text.</h2>\n * ```\n *\n * But if the `heading` element's `level` attribute has been updated to `3` for example, then\n * it will be converted into this structure in the view:\n *\n * ```html\n * <h3>Some text.</h3>\n * ```\n *\n * Such a converter would look as follows:\n *\n * ```ts\n * editor.conversion.for( 'downcast' ).elementToElement( {\n * \tmodel: {\n * \t\tname: 'heading',\n * \t\tattributes: 'level'\n * \t},\n * \tview: ( modelElement, conversionApi ) => {\n * \t\tconst { writer } = conversionApi;\n *\n * \t\treturn writer.createContainerElement( 'h' + modelElement.getAttribute( 'level' ) );\n * \t}\n * } );\n * ```\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n * to the conversion process.\n *\n * You can read more about the element-to-element conversion in the\n * {@glink framework/deep-dive/conversion/downcast downcast conversion} guide.\n *\n * @param config Conversion configuration.\n * @param config.model The description or a name of the model element to convert.\n * @param config.model.attributes The list of attribute names that should be consumed while creating\n * the view element. Note that the view will be reconverted if any of the listed attributes changes.\n * @param config.model.children Specifies whether the view element requires reconversion if the list\n * of the model child nodes changed.\n * @param config.view A view element definition or a function that takes the model element and\n * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}\n * as parameters and returns a view container element.\n */\n elementToElement(config) {\n return this.add(downcastElementToElement(config));\n }\n /**\n * The model element to view structure (several elements) conversion helper.\n *\n * This conversion results in creating a view structure with one or more slots defined for the child nodes.\n * For example, a model `<table>` may become this structure in the view:\n *\n * ```html\n * <figure class=\"table\">\n * \t<table>\n * \t\t<tbody>${ slot for table rows }</tbody>\n * \t</table>\n * </figure>\n * ```\n *\n * The children of the model's `<table>` element will be inserted into the `<tbody>` element.\n * If the `elementToElement()` helper was used, the children would be inserted into the `<figure>`.\n *\n * An example converter that converts the following model structure:\n *\n * ```xml\n * <wrappedParagraph>Some text.</wrappedParagraph>\n * ```\n *\n * into this structure in the view:\n *\n * ```html\n * <div class=\"wrapper\">\n * \t<p>Some text.</p>\n * </div>\n * ```\n *\n * would look like this:\n *\n * ```ts\n * editor.conversion.for( 'downcast' ).elementToStructure( {\n * \tmodel: 'wrappedParagraph',\n * \tview: ( modelElement, conversionApi ) => {\n * \t\tconst { writer } = conversionApi;\n *\n * \t\tconst wrapperViewElement = writer.createContainerElement( 'div', { class: 'wrapper' } );\n * \t\tconst paragraphViewElement = writer.createContainerElement( 'p' );\n *\n * \t\twriter.insert( writer.createPositionAt( wrapperViewElement, 0 ), paragraphViewElement );\n * \t\twriter.insert( writer.createPositionAt( paragraphViewElement, 0 ), writer.createSlot() );\n *\n * \t\treturn wrapperViewElement;\n * \t}\n * } );\n * ```\n *\n * The `slorFor()` function can also take a callback that allows filtering which children of the model element\n * should be converted into this slot.\n *\n * Imagine a table feature where for this model structure:\n *\n * ```xml\n * <table headingRows=\"1\">\n * \t<tableRow> ... table cells 1 ... </tableRow>\n * \t<tableRow> ... table cells 2 ... </tableRow>\n * \t<tableRow> ... table cells 3 ... </tableRow>\n * \t<caption>Caption text</caption>\n * </table>\n * ```\n *\n * we want to generate this view structure:\n *\n * ```html\n * <figure class=\"table\">\n * \t<table>\n * \t\t<thead>\n * \t\t\t<tr> ... table cells 1 ... </tr>\n * \t\t</thead>\n * \t\t<tbody>\n * \t\t\t<tr> ... table cells 2 ... </tr>\n * \t\t\t<tr> ... table cells 3 ... </tr>\n * \t\t</tbody>\n * \t</table>\n * \t<figcaption>Caption text</figcaption>\n * </figure>\n * ```\n *\n * The converter has to take the `headingRows` attribute into consideration when allocating the `<tableRow>` elements\n * into the `<tbody>` and `<thead>` elements. Hence, we need two slots and need to define proper filter callbacks for them.\n *\n * Additionally, all elements other than `<tableRow>` should be placed outside the `<table>` tag.\n * In the example above, this will handle the table caption.\n *\n * Such a converter would look like this:\n *\n * ```ts\n * editor.conversion.for( 'downcast' ).elementToStructure( {\n * \tmodel: {\n * \t\tname: 'table',\n * \t\tattributes: [ 'headingRows' ]\n * \t},\n * \tview: ( modelElement, conversionApi ) => {\n * \t\tconst { writer } = conversionApi;\n *\n * \t\tconst figureElement = writer.createContainerElement( 'figure', { class: 'table' } );\n * \t\tconst tableElement = writer.createContainerElement( 'table' );\n *\n * \t\twriter.insert( writer.createPositionAt( figureElement, 0 ), tableElement );\n *\n * \t\tconst headingRows = modelElement.getAttribute( 'headingRows' ) || 0;\n *\n * \t\tif ( headingRows > 0 ) {\n * \t\t\tconst tableHead = writer.createContainerElement( 'thead' );\n *\n * \t\t\tconst headSlot = writer.createSlot( node => node.is( 'element', 'tableRow' ) && node.index < headingRows );\n *\n * \t\t\twriter.insert( writer.createPositionAt( tableElement, 'end' ), tableHead );\n * \t\t\twriter.insert( writer.createPositionAt( tableHead, 0 ), headSlot );\n * \t\t}\n *\n * \t\tif ( headingRows < tableUtils.getRows( table ) ) {\n * \t\t\tconst tableBody = writer.createContainerElement( 'tbody' );\n *\n * \t\t\tconst bodySlot = writer.createSlot( node => node.is( 'element', 'tableRow' ) && node.index >= headingRows );\n *\n * \t\t\twriter.insert( writer.createPositionAt( tableElement, 'end' ), tableBody );\n * \t\t\twriter.insert( writer.createPositionAt( tableBody, 0 ), bodySlot );\n * \t\t}\n *\n * \t\tconst restSlot = writer.createSlot( node => !node.is( 'element', 'tableRow' ) );\n *\n * \t\twriter.insert( writer.createPositionAt( figureElement, 'end' ), restSlot );\n *\n * \t\treturn figureElement;\n * \t}\n * } );\n * ```\n *\n * Note: The children of a model element that's being converted must be allocated in the same order in the view\n * in which they are placed in the model.\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n * to the conversion process.\n *\n * @param config Conversion configuration.\n * @param config.model The description or a name of the model element to convert.\n * @param config.model.name The name of the model element to convert.\n * @param config.model.attributes The list of attribute names that should be consumed while creating\n * the view structure. Note that the view will be reconverted if any of the listed attributes will change.\n * @param config.view A function that takes the model element and\n * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API} as parameters\n * and returns a view container element with slots for model child nodes to be converted into.\n */\n elementToStructure(config) {\n return this.add(downcastElementToStructure(config));\n }\n /**\n * Model attribute to view element conversion helper.\n *\n * This conversion results in wrapping view nodes with a view attribute element. For example, a model text node with\n * `\"Foo\"` as data and the `bold` attribute becomes `<strong>Foo</strong>` in the view.\n *\n * ```ts\n * editor.conversion.for( 'downcast' ).attributeToElement( {\n * \tmodel: 'bold',\n * \tview: 'strong'\n * } );\n *\n * editor.conversion.for( 'downcast' ).attributeToElement( {\n * \tmodel: 'bold',\n * \tview: 'b',\n * \tconverterPriority: 'high'\n * } );\n *\n * editor.conversion.for( 'downcast' ).attributeToElement( {\n * \tmodel: 'invert',\n * \tview: {\n * \t\tname: 'span',\n * \t\tclasses: [ 'font-light', 'bg-dark' ]\n * \t}\n * } );\n *\n * editor.conversion.for( 'downcast' ).attributeToElement( {\n * \tmodel: {\n * \t\tkey: 'fontSize',\n * \t\tvalues: [ 'big', 'small' ]\n * \t},\n * \tview: {\n * \t\tbig: {\n * \t\t\tname: 'span',\n * \t\t\tstyles: {\n * \t\t\t\t'font-size': '1.2em'\n * \t\t\t}\n * \t\t},\n * \t\tsmall: {\n * \t\t\tname: 'span',\n * \t\t\tstyles: {\n * \t\t\t\t'font-size': '0.8em'\n * \t\t\t}\n * \t\t}\n * \t}\n * } );\n *\n * editor.conversion.for( 'downcast' ).attributeToElement( {\n * \tmodel: 'bold',\n * \tview: ( modelAttributeValue, conversionApi ) => {\n * \t\tconst { writer } = conversionApi;\n *\n * \t\treturn writer.createAttributeElement( 'span', {\n * \t\t\tstyle: 'font-weight:' + modelAttributeValue\n * \t\t} );\n * \t}\n * } );\n *\n * editor.conversion.for( 'downcast' ).attributeToElement( {\n * \tmodel: {\n * \t\tkey: 'color',\n * \t\tname: '$text'\n * \t},\n * \tview: ( modelAttributeValue, conversionApi ) => {\n * \t\tconst { writer } = conversionApi;\n *\n * \t\treturn writer.createAttributeElement( 'span', {\n * \t\t\tstyle: 'color:' + modelAttributeValue\n * \t\t} );\n * \t}\n * } );\n * ```\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n * to the conversion process.\n *\n * @param config Conversion configuration.\n * @param config.model The key of the attribute to convert from or a `{ key, values }` object. `values` is an array\n * of `String`s with possible values if the model attribute is an enumerable.\n * @param config.view A view element definition or a function\n * that takes the model attribute value and\n * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API} as parameters and returns a view\n * attribute element. If `config.model.values` is given, `config.view` should be an object assigning values from `config.model.values`\n * to view element definitions or functions.\n * @param config.converterPriority Converter priority.\n */\n attributeToElement(config) {\n return this.add(downcastAttributeToElement(config));\n }\n /**\n * Model attribute to view attribute conversion helper.\n *\n * This conversion results in adding an attribute to a view node, basing on an attribute from a model node. For example,\n * `<imageInline src='foo.jpg'></imageInline>` is converted to `<img src='foo.jpg'></img>`.\n *\n * ```ts\n * editor.conversion.for( 'downcast' ).attributeToAttribute( {\n * \tmodel: 'source',\n * \tview: 'src'\n * } );\n *\n * editor.conversion.for( 'downcast' ).attributeToAttribute( {\n * \tmodel: 'source',\n * \tview: 'href',\n * \tconverterPriority: 'high'\n * } );\n *\n * editor.conversion.for( 'downcast' ).attributeToAttribute( {\n * \tmodel: {\n * \t\tname: 'imageInline',\n * \t\tkey: 'source'\n * \t},\n * \tview: 'src'\n * } );\n *\n * editor.conversion.for( 'downcast' ).attributeToAttribute( {\n * \tmodel: {\n * \t\tname: 'styled',\n * \t\tvalues: [ 'dark', 'light' ]\n * \t},\n * \tview: {\n * \t\tdark: {\n * \t\t\tkey: 'class',\n * \t\t\tvalue: [ 'styled', 'styled-dark' ]\n * \t\t},\n * \t\tlight: {\n * \t\t\tkey: 'class',\n * \t\t\tvalue: [ 'styled', 'styled-light' ]\n * \t\t}\n * \t}\n * } );\n *\n * editor.conversion.for( 'downcast' ).attributeToAttribute( {\n * \tmodel: 'styled',\n * \tview: modelAttributeValue => ( {\n * \t\tkey: 'class',\n * \t\tvalue: 'styled-' + modelAttributeValue\n * \t} )\n * } );\n * ```\n *\n * **Note**: Downcasting to a style property requires providing `value` as an object:\n *\n * ```ts\n * editor.conversion.for( 'downcast' ).attributeToAttribute( {\n * \tmodel: 'lineHeight',\n * \tview: modelAttributeValue => ( {\n * \t\tkey: 'style',\n * \t\tvalue: {\n * \t\t\t'line-height': modelAttributeValue,\n * \t\t\t'border-bottom': '1px dotted #ba2'\n * \t\t}\n * \t} )\n * } );\n * ```\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n * to the conversion process.\n *\n * @param config Conversion configuration.\n * @param config.model The key of the attribute to convert from or a `{ key, values, [ name ] }` object describing\n * the attribute key, possible values and, optionally, an element name to convert from.\n * @param config.view A view attribute key, or a `{ key, value }` object or a function that takes the model attribute value and\n * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}\n * as parameters and returns a `{ key, value }` object. If the `key` is `'class'`, the `value` can be a `String` or an\n * array of `String`s. If the `key` is `'style'`, the `value` is an object with key-value pairs. In other cases, `value` is a `String`.\n * If `config.model.values` is set, `config.view` should be an object assigning values from `config.model.values` to\n * `{ key, value }` objects or a functions.\n * @param config.converterPriority Converter priority.\n */\n attributeToAttribute(config) {\n return this.add(downcastAttributeToAttribute(config));\n }\n /**\n * Model marker to view element conversion helper.\n *\n * **Note**: This method should be used mainly for editing the downcast and it is recommended\n * to use the {@link #markerToData `#markerToData()`} helper instead.\n *\n * This helper may produce invalid HTML code (e.g. a span between table cells).\n * It should only be used when you are sure that the produced HTML will be semantically correct.\n *\n * This conversion results in creating a view element on the boundaries of the converted marker. If the converted marker\n * is collapsed, only one element is created. For example, a model marker set like this: `<paragraph>F[oo b]ar</paragraph>`\n * becomes `<p>F<span data-marker=\"search\"></span>oo b<span data-marker=\"search\"></span>ar</p>` in the view.\n *\n * ```ts\n * editor.conversion.for( 'editingDowncast' ).markerToElement( {\n * \tmodel: 'search',\n * \tview: 'marker-search'\n * } );\n *\n * editor.conversion.for( 'editingDowncast' ).markerToElement( {\n * \tmodel: 'search',\n * \tview: 'search-result',\n * \tconverterPriority: 'high'\n * } );\n *\n * editor.conversion.for( 'editingDowncast' ).markerToElement( {\n * \tmodel: 'search',\n * \tview: {\n * \t\tname: 'span',\n * \t\tattributes: {\n * \t\t\t'data-marker': 'search'\n * \t\t}\n * \t}\n * } );\n *\n * editor.conversion.for( 'editingDowncast' ).markerToElement( {\n * \tmodel: 'search',\n * \tview: ( markerData, conversionApi ) => {\n * \t\tconst { writer } = conversionApi;\n *\n * \t\treturn writer.createUIElement( 'span', {\n * \t\t\t'data-marker': 'search',\n * \t\t\t'data-start': markerData.isOpening\n * \t\t} );\n * \t}\n * } );\n * ```\n *\n * If a function is passed as the `config.view` parameter, it will be used to generate both boundary elements. The function\n * receives the `data` object and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}\n * as a parameters and should return an instance of the\n * {@link module:engine/view/uielement~UIElement view UI element}. The `data` object and\n * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi `conversionApi`} are passed from\n * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker}. Additionally,\n * the `data.isOpening` parameter is passed, which is set to `true` for the marker start boundary element, and `false` for\n * the marker end boundary element.\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n * to the conversion process.\n *\n * @param config Conversion configuration.\n * @param config.model The name of the model marker (or model marker group) to convert.\n * @param config.view A view element definition or a function that takes the model marker data and\n * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API} as a parameters\n * and returns a view UI element.\n * @param config.converterPriority Converter priority.\n */\n markerToElement(config) {\n return this.add(downcastMarkerToElement(config));\n }\n /**\n * Model marker to highlight conversion helper.\n *\n * This conversion results in creating a highlight on view nodes. For this kind of conversion,\n * the {@link module:engine/conversion/downcasthelpers~HighlightDescriptor} should be provided.\n *\n * For text nodes, a `<span>` {@link module:engine/view/attributeelement~AttributeElement} is created and it wraps all text nodes\n * in the converted marker range. For example, a model marker set like this: `<paragraph>F[oo b]ar</paragraph>` becomes\n * `<p>F<span class=\"comment\">oo b</span>ar</p>` in the view.\n *\n * {@link module:engine/view/containerelement~ContainerElement} may provide a custom way of handling highlight. Most often,\n * the element itself is given classes and attributes described in the highlight descriptor (instead of being wrapped in `<span>`).\n * For example, a model marker set like this:\n * `[<imageInline src=\"foo.jpg\"></imageInline>]` becomes `<img src=\"foo.jpg\" class=\"comment\"></img>` in the view.\n *\n * For container elements, the conversion is two-step. While the converter processes the highlight descriptor and passes it\n * to a container element, it is the container element instance itself that applies values from the highlight descriptor.\n * So, in a sense, the converter takes care of stating what should be applied on what, while the element decides how to apply that.\n *\n * ```ts\n * editor.conversion.for( 'downcast' ).markerToHighlight( { model: 'comment', view: { classes: 'comment' } } );\n *\n * editor.conversion.for( 'downcast' ).markerToHighlight( {\n * \tmodel: 'comment',\n * \tview: { classes: 'comment' },\n * \tconverterPriority: 'high'\n * } );\n *\n * editor.conversion.for( 'downcast' ).markerToHighlight( {\n * \tmodel: 'comment',\n * \tview: ( data, conversionApi ) => {\n * \t\t// Assuming that the marker name is in a form of comment:commentType:commentId.\n * \t\tconst [ , commentType, commentId ] = data.markerName.split( ':' );\n *\n * \t\treturn {\n * \t\t\tclasses: [ 'comment', 'comment-' + commentType ],\n * \t\t\tattributes: { 'data-comment-id': commentId }\n * \t\t};\n * \t}\n * } );\n * ```\n *\n * If a function is passed as the `config.view` parameter, it will be used to generate the highlight descriptor. The function\n * receives the `data` object and {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API}\n * as the parameters and should return a\n * {@link module:engine/conversion/downcasthelpers~HighlightDescriptor highlight descriptor}.\n * The `data` object properties are passed from {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker}.\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n * to the conversion process.\n *\n * @param config Conversion configuration.\n * @param config.model The name of the model marker (or model marker group) to convert.\n * @param config.view A highlight descriptor that will be used for highlighting or a function that takes the model marker data and\n * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API} as a parameters\n * and returns a highlight descriptor.\n * @param config.converterPriority Converter priority.\n */\n markerToHighlight(config) {\n return this.add(downcastMarkerToHighlight(config));\n }\n /**\n * Model marker converter for data downcast.\n *\n * This conversion creates a representation for model marker boundaries in the view:\n *\n * * If the marker boundary is before or after a model element, a view attribute is set on a corresponding view element.\n * * In other cases, a view element with the specified tag name is inserted at the corresponding view position.\n *\n * Typically, the marker names use the `group:uniqueId:otherData` convention. For example: `comment:e34zfk9k2n459df53sjl34:zx32c`.\n * The default configuration for this conversion is that the first part is the `group` part and the rest of\n * the marker name becomes the `name` part.\n *\n * Tag and attribute names and values are generated from the marker name:\n *\n * * The templates for attributes are `data-[group]-start-before=\"[name]\"`, `data-[group]-start-after=\"[name]\"`,\n * `data-[group]-end-before=\"[name]\"` and `data-[group]-end-after=\"[name]\"`.\n * * The templates for view elements are `<[group]-start name=\"[name]\">` and `<[group]-end name=\"[name]\">`.\n *\n * Attributes mark whether the given marker's start or end boundary is before or after the given element.\n * The `data-[group]-start-before` and `data-[group]-end-after` attributes are favored.\n * The other two are used when the former two cannot be used.\n *\n * The conversion configuration can take a function that will generate different group and name parts.\n * If such a function is set as the `config.view` parameter, it is passed a marker name and it is expected to return an object with two\n * properties: `group` and `name`. If the function returns a falsy value, the conversion will not take place.\n *\n * Basic usage:\n *\n * ```ts\n * // Using the default conversion.\n * // In this case, all markers with names starting with 'comment:' will be converted.\n * // The `group` parameter will be set to `comment`.\n * // The `name` parameter will be the rest of the marker name (without the `:`).\n * editor.conversion.for( 'dataDowncast' ).markerToData( {\n * \tmodel: 'comment'\n * } );\n * ```\n *\n * An example of a view that may be generated by this conversion (assuming a marker with the name `comment:commentId:uid` marked\n * by `[]`):\n *\n * ```\n * // Model:\n * <paragraph>Foo[bar</paragraph>\n * <imageBlock src=\"abc.jpg\"></imageBlock>]\n *\n * // View:\n * <p>Foo<comment-start name=\"commentId:uid\"></comment-start>bar</p>\n * <figure data-comment-end-after=\"commentId:uid\" class=\"image\"><img src=\"abc.jpg\" /></figure>\n * ```\n *\n * In the example above, the comment starts before \"bar\" and ends after the image.\n *\n * If the `name` part is empty, the following view may be generated:\n *\n * ```html\n * <p>Foo <myMarker-start></myMarker-start>bar</p>\n * <figure data-myMarker-end-after=\"\" class=\"image\"><img src=\"abc.jpg\" /></figure>\n * ```\n *\n * **Note:** A situation where some markers have the `name` part and some do not, is incorrect and should be avoided.\n *\n * Examples where `data-group-start-after` and `data-group-end-before` are used:\n *\n * ```\n * // Model:\n * <blockQuote>[]<paragraph>Foo</paragraph></blockQuote>\n *\n * // View:\n * <blockquote><p data-group-end-before=\"name\" data-group-start-before=\"name\">Foo</p></blockquote>\n * ```\n *\n * Similarly, when a marker is collapsed after the last element:\n *\n * ```\n * // Model:\n * <blockQuote><paragraph>Foo</paragraph>[]</blockQuote>\n *\n * // View:\n * <blockquote><p data-group-end-after=\"name\" data-group-start-after=\"name\">Foo</p></blockquote>\n * ```\n *\n * When there are multiple markers from the same group stored in the same attribute of the same element, their\n * name parts are put together in the attribute value, for example: `data-group-start-before=\"name1,name2,name3\"`.\n *\n * Other examples of usage:\n *\n * ```ts\n * // Using a custom function which is the same as the default conversion:\n * editor.conversion.for( 'dataDowncast' ).markerToData( {\n * \tmodel: 'comment'\n * \tview: markerName => ( {\n * \t\tgroup: 'comment',\n * \t\tname: markerName.substr( 8 ) // Removes 'comment:' part.\n * \t} )\n * } );\n *\n * // Using the converter priority:\n * editor.conversion.for( 'dataDowncast' ).markerToData( {\n * \tmodel: 'comment'\n * \tview: markerName => ( {\n * \t\tgroup: 'comment',\n * \t\tname: markerName.substr( 8 ) // Removes 'comment:' part.\n * \t} ),\n * \tconverterPriority: 'high'\n * } );\n * ```\n *\n * This kind of conversion is useful for saving data into the database, so it should be used in the data conversion pipeline.\n *\n * See the {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} API guide to learn how to\n * add a converter to the conversion process.\n *\n * @param config Conversion configuration.\n * @param config.model The name of the model marker (or the model marker group) to convert.\n * @param config.view A function that takes the model marker name and\n * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi downcast conversion API} as the parameters\n * and returns an object with the `group` and `name` properties.\n * @param config.converterPriority Converter priority.\n */\n markerToData(config) {\n return this.add(downcastMarkerToData(config));\n }\n}\n/**\n * Function factory that creates a default downcast converter for text insertion changes.\n *\n * The converter automatically consumes the corresponding value from the consumables list and stops the event (see\n * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}).\n *\n * ```ts\n * modelDispatcher.on( 'insert:$text', insertText() );\n * ```\n *\n * @returns Insert text event converter.\n */\nexport function insertText() {\n return (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const viewWriter = conversionApi.writer;\n const viewPosition = conversionApi.mapper.toViewPosition(data.range.start);\n const viewText = viewWriter.createText(data.item.data);\n viewWriter.insert(viewPosition, viewText);\n };\n}\n/**\n * Function factory that creates a default downcast converter for triggering attributes and children conversion.\n *\n * @returns The converter.\n */\nexport function insertAttributesAndChildren() {\n return (evt, data, conversionApi) => {\n conversionApi.convertAttributes(data.item);\n // Start converting children of the current item.\n // In case of reconversion children were already re-inserted or converted separately.\n if (!data.reconversion && data.item.is('element') && !data.item.isEmpty) {\n conversionApi.convertChildren(data.item);\n }\n };\n}\n/**\n * Function factory that creates a default downcast converter for node remove changes.\n *\n * ```ts\n * modelDispatcher.on( 'remove', remove() );\n * ```\n *\n * @returns Remove event converter.\n */\nexport function remove() {\n return (evt, data, conversionApi) => {\n // Find the view range start position by mapping the model position at which the remove happened.\n const viewStart = conversionApi.mapper.toViewPosition(data.position);\n const modelEnd = data.position.getShiftedBy(data.length);\n const viewEnd = conversionApi.mapper.toViewPosition(modelEnd, { isPhantom: true });\n const viewRange = conversionApi.writer.createRange(viewStart, viewEnd);\n // Trim the range to remove in case some UI elements are on the view range boundaries.\n const removed = conversionApi.writer.remove(viewRange.getTrimmed());\n // After the range is removed, unbind all view elements from the model.\n // Range inside view document fragment is used to unbind deeply.\n for (const child of conversionApi.writer.createRangeIn(removed).getItems()) {\n conversionApi.mapper.unbindViewElement(child, { defer: true });\n }\n };\n}\n/**\n * Creates a `<span>` {@link module:engine/view/attributeelement~AttributeElement view attribute element} from the information\n * provided by the {@link module:engine/conversion/downcasthelpers~HighlightDescriptor highlight descriptor} object. If the priority\n * is not provided in the descriptor, the default priority will be used.\n */\nexport function createViewElementFromHighlightDescriptor(writer, descriptor) {\n const viewElement = writer.createAttributeElement('span', descriptor.attributes);\n if (descriptor.classes) {\n viewElement._addClass(descriptor.classes);\n }\n if (typeof descriptor.priority === 'number') {\n viewElement._priority = descriptor.priority;\n }\n viewElement._id = descriptor.id;\n return viewElement;\n}\n/**\n * Function factory that creates a converter which converts a non-collapsed {@link module:engine/model/selection~Selection model selection}\n * to a {@link module:engine/view/documentselection~DocumentSelection view selection}. The converter consumes appropriate\n * value from the `consumable` object and maps model positions from the selection to view positions.\n *\n * ```ts\n * modelDispatcher.on( 'selection', convertRangeSelection() );\n * ```\n *\n * @returns Selection converter.\n */\nexport function convertRangeSelection() {\n return (evt, data, conversionApi) => {\n const selection = data.selection;\n if (selection.isCollapsed) {\n return;\n }\n if (!conversionApi.consumable.consume(selection, 'selection')) {\n return;\n }\n const viewRanges = [];\n for (const range of selection.getRanges()) {\n viewRanges.push(conversionApi.mapper.toViewRange(range));\n }\n conversionApi.writer.setSelection(viewRanges, { backward: selection.isBackward });\n };\n}\n/**\n * Function factory that creates a converter which converts a collapsed {@link module:engine/model/selection~Selection model selection} to\n * a {@link module:engine/view/documentselection~DocumentSelection view selection}. The converter consumes appropriate\n * value from the `consumable` object, maps the model selection position to the view position and breaks\n * {@link module:engine/view/attributeelement~AttributeElement attribute elements} at the selection position.\n *\n * ```ts\n * modelDispatcher.on( 'selection', convertCollapsedSelection() );\n * ```\n *\n * An example of the view state before and after converting the collapsed selection:\n *\n * ```\n * <p><strong>f^oo<strong>bar</p>\n * -> <p><strong>f</strong>^<strong>oo</strong>bar</p>\n * ```\n *\n * By breaking attribute elements like `<strong>`, the selection is in a correct element. Then, when the selection attribute is\n * converted, broken attributes might be merged again, or the position where the selection is may be wrapped\n * with different, appropriate attribute elements.\n *\n * See also {@link module:engine/conversion/downcasthelpers~clearAttributes} which does a clean-up\n * by merging attributes.\n *\n * @returns Selection converter.\n */\nexport function convertCollapsedSelection() {\n return (evt, data, conversionApi) => {\n const selection = data.selection;\n if (!selection.isCollapsed) {\n return;\n }\n if (!conversionApi.consumable.consume(selection, 'selection')) {\n return;\n }\n const viewWriter = conversionApi.writer;\n const modelPosition = selection.getFirstPosition();\n const viewPosition = conversionApi.mapper.toViewPosition(modelPosition);\n const brokenPosition = viewWriter.breakAttributes(viewPosition);\n viewWriter.setSelection(brokenPosition);\n };\n}\n/**\n * Function factory that creates a converter which 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 merges sibling attributes at all start and end\n * positions of all ranges.\n *\n * ```\n * <p><strong>^</strong></p>\n * -> <p>^</p>\n *\n * <p><strong>foo</strong>^<strong>bar</strong>bar</p>\n * -> <p><strong>foo^bar<strong>bar</p>\n *\n * <p><strong>foo</strong><em>^</em><strong>bar</strong>bar</p>\n * -> <p><strong>foo^bar<strong>bar</p>\n * ```\n *\n * This listener should be assigned before any converter for the new selection:\n *\n * ```ts\n * modelDispatcher.on( 'selection', clearAttributes() );\n * ```\n *\n * See {@link module:engine/conversion/downcasthelpers~convertCollapsedSelection}\n * which does the opposite by breaking attributes in the selection position.\n *\n * @returns Selection converter.\n */\nexport function clearAttributes() {\n return (evt, data, conversionApi) => {\n const viewWriter = conversionApi.writer;\n const viewSelection = viewWriter.document.selection;\n for (const range of viewSelection.getRanges()) {\n // Not collapsed selection should not have artifacts.\n if (range.isCollapsed) {\n // Position might be in the node removed by the view writer.\n if (range.end.parent.isAttached()) {\n conversionApi.writer.mergeAttributes(range.start);\n }\n }\n }\n viewWriter.setSelection(null);\n };\n}\n/**\n * Function factory that creates a converter which converts the set/change/remove attribute changes from the model to the view.\n * It can also be used to convert selection attributes. In that case, an empty attribute element will be created and the\n * selection will be put inside it.\n *\n * Attributes from the model are converted to a view element that will be wrapping these view nodes that are bound to\n * model elements having the given attribute. This is useful for attributes like `bold` that may be set on text nodes in the model\n * but are represented as an element in the view:\n *\n * ```\n * [paragraph] MODEL ====> VIEW <p>\n * \t|- a {bold: true} |- <b>\n * \t|- b {bold: true} | |- ab\n * \t|- c |- c\n * \t```\n *\n * Passed `Function` will be provided with the attribute value and then all the parameters of the\n * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute `attribute` event}.\n * It is expected that the function returns an {@link module:engine/view/element~Element}.\n * The result of the function will be the wrapping element.\n * When the provided `Function` does not return any element, no conversion will take place.\n *\n * The converter automatically consumes the corresponding value from the consumables list and stops the event (see\n * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}).\n *\n * ```ts\n * modelDispatcher.on( 'attribute:bold', wrap( ( modelAttributeValue, { writer } ) => {\n * \treturn writer.createAttributeElement( 'strong' );\n * } );\n * ```\n *\n * @internal\n * @param elementCreator Function returning a view element that will be used for wrapping.\n * @returns Set/change attribute converter.\n */\nexport function wrap(elementCreator) {\n return (evt, data, conversionApi) => {\n if (!conversionApi.consumable.test(data.item, evt.name)) {\n return;\n }\n // Recreate current wrapping node. It will be used to unwrap view range if the attribute value has changed\n // or the attribute was removed.\n const oldViewElement = elementCreator(data.attributeOldValue, conversionApi, data);\n // Create node to wrap with.\n const newViewElement = elementCreator(data.attributeNewValue, conversionApi, data);\n if (!oldViewElement && !newViewElement) {\n return;\n }\n conversionApi.consumable.consume(data.item, evt.name);\n const viewWriter = conversionApi.writer;\n const viewSelection = viewWriter.document.selection;\n if (data.item instanceof ModelSelection || data.item instanceof ModelDocumentSelection) {\n // Selection attribute conversion.\n viewWriter.wrap(viewSelection.getFirstRange(), newViewElement);\n }\n else {\n // Node attribute conversion.\n let viewRange = conversionApi.mapper.toViewRange(data.range);\n // First, unwrap the range from current wrapper.\n if (data.attributeOldValue !== null && oldViewElement) {\n viewRange = viewWriter.unwrap(viewRange, oldViewElement);\n }\n if (data.attributeNewValue !== null && newViewElement) {\n viewWriter.wrap(viewRange, newViewElement);\n }\n }\n };\n}\n/**\n * Function factory that creates a converter which converts node insertion changes from the model to the view.\n * The function passed will be provided with all the parameters of the dispatcher's\n * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert `insert` event}.\n * It is expected that the function returns an {@link module:engine/view/element~Element}.\n * The result of the function will be inserted into the view.\n *\n * The converter automatically consumes the corresponding value from the consumables list and binds the model and view elements.\n *\n * ```ts\n * downcastDispatcher.on(\n * \t'insert:myElem',\n * \tinsertElement( ( modelItem, { writer } ) => {\n * \t\tconst text = writer.createText( 'myText' );\n * \t\tconst myElem = writer.createElement( 'myElem', { myAttr: 'my-' + modelItem.getAttribute( 'myAttr' ) }, text );\n *\n * \t\t// Do something fancy with `myElem` using `modelItem` or other parameters.\n *\n * \t\treturn myElem;\n * \t}\n * ) );\n * ```\n *\n * @internal\n * @param elementCreator Function returning a view element, which will be inserted.\n * @param consumer Function defining element consumption process.\n * By default this function just consume passed item insertion.\n * @returns Insert element event converter.\n */\nexport function insertElement(elementCreator, consumer = defaultConsumer) {\n return (evt, data, conversionApi) => {\n if (!consumer(data.item, conversionApi.consumable, { preflight: true })) {\n return;\n }\n const viewElement = elementCreator(data.item, conversionApi, data);\n if (!viewElement) {\n return;\n }\n // Consume an element insertion and all present attributes that are specified as a reconversion triggers.\n consumer(data.item, conversionApi.consumable);\n const viewPosition = conversionApi.mapper.toViewPosition(data.range.start);\n conversionApi.mapper.bindElements(data.item, viewElement);\n conversionApi.writer.insert(viewPosition, viewElement);\n // Convert attributes before converting children.\n conversionApi.convertAttributes(data.item);\n // Convert children or reinsert previous view elements.\n reinsertOrConvertNodes(viewElement, data.item.getChildren(), conversionApi, { reconversion: data.reconversion });\n };\n}\n/**\n * Function factory that creates a converter which converts a single model node insertion to a view structure.\n *\n * It is expected that the passed element creator function returns an {@link module:engine/view/element~Element} with attached slots\n * created with `writer.createSlot()` to indicate where child nodes should be converted.\n *\n * @see module:engine/conversion/downcasthelpers~DowncastHelpers#elementToStructure\n *\n * @internal\n * @param elementCreator Function returning a view structure, which will be inserted.\n * @param consumer A callback that is expected to consume all the consumables\n * that were used by the element creator.\n * @returns Insert element event converter.\n*/\nexport function insertStructure(elementCreator, consumer) {\n return (evt, data, conversionApi) => {\n if (!consumer(data.item, conversionApi.consumable, { preflight: true })) {\n return;\n }\n const slotsMap = new Map();\n conversionApi.writer._registerSlotFactory(createSlotFactory(data.item, slotsMap, conversionApi));\n // View creation.\n const viewElement = elementCreator(data.item, conversionApi, data);\n conversionApi.writer._clearSlotFactory();\n if (!viewElement) {\n return;\n }\n // Check if all children are covered by slots and there is no child that landed in multiple slots.\n validateSlotsChildren(data.item, slotsMap, conversionApi);\n // Consume an element insertion and all present attributes that are specified as a reconversion triggers.\n consumer(data.item, conversionApi.consumable);\n const viewPosition = conversionApi.mapper.toViewPosition(data.range.start);\n conversionApi.mapper.bindElements(data.item, viewElement);\n conversionApi.writer.insert(viewPosition, viewElement);\n // Convert attributes before converting children.\n conversionApi.convertAttributes(data.item);\n // Fill view slots with previous view elements or create new ones.\n fillSlots(viewElement, slotsMap, conversionApi, { reconversion: data.reconversion });\n };\n}\n/**\n * Function factory that creates a converter which converts marker adding change to the\n * {@link module:engine/view/uielement~UIElement view UI element}.\n *\n * The view UI element that will be added to the view depends on the passed parameter. See {@link ~insertElement}.\n * In case of a non-collapsed range, the UI element will not wrap nodes but separate elements will be placed at the beginning\n * and at the end of the range.\n *\n * This converter binds created UI elements with the marker name using {@link module:engine/conversion/mapper~Mapper#bindElementToMarker}.\n *\n * @internal\n * @param elementCreator A view UI element or a function returning the view element that will be inserted.\n * @returns Insert element event converter.\n */\nexport function insertUIElement(elementCreator) {\n return (evt, data, conversionApi) => {\n // Create two view elements. One will be inserted at the beginning of marker, one at the end.\n // If marker is collapsed, only \"opening\" element will be inserted.\n data.isOpening = true;\n const viewStartElement = elementCreator(data, conversionApi);\n data.isOpening = false;\n const viewEndElement = elementCreator(data, conversionApi);\n if (!viewStartElement || !viewEndElement) {\n return;\n }\n const markerRange = data.markerRange;\n // Marker that is collapsed has consumable build differently that non-collapsed one.\n // For more information see `addMarker` event description.\n // If marker's range is collapsed - check if it can be consumed.\n if (markerRange.isCollapsed && !conversionApi.consumable.consume(markerRange, evt.name)) {\n return;\n }\n // If marker's range is not collapsed - consume all items inside.\n for (const value of markerRange) {\n if (!conversionApi.consumable.consume(value.item, evt.name)) {\n return;\n }\n }\n const mapper = conversionApi.mapper;\n const viewWriter = conversionApi.writer;\n // Add \"opening\" element.\n viewWriter.insert(mapper.toViewPosition(markerRange.start), viewStartElement);\n conversionApi.mapper.bindElementToMarker(viewStartElement, data.markerName);\n // Add \"closing\" element only if range is not collapsed.\n if (!markerRange.isCollapsed) {\n viewWriter.insert(mapper.toViewPosition(markerRange.end), viewEndElement);\n conversionApi.mapper.bindElementToMarker(viewEndElement, data.markerName);\n }\n evt.stop();\n };\n}\n/**\n * Function factory that returns a default downcast converter for removing a {@link module:engine/view/uielement~UIElement UI element}\n * based on marker remove change.\n *\n * This converter unbinds elements from the marker name.\n *\n * @returns Removed UI element converter.\n */\nfunction removeUIElement() {\n return (evt, data, conversionApi) => {\n const elements = conversionApi.mapper.markerNameToElements(data.markerName);\n if (!elements) {\n return;\n }\n for (const element of elements) {\n conversionApi.mapper.unbindElementFromMarkerName(element, data.markerName);\n conversionApi.writer.clear(conversionApi.writer.createRangeOn(element), element);\n }\n conversionApi.writer.clearClonedElementsGroup(data.markerName);\n evt.stop();\n };\n}\n/**\n * Function factory that creates a default converter for model markers.\n *\n * See {@link DowncastHelpers#markerToData} for more information what type of view is generated.\n *\n * This converter binds created UI elements and affected view elements with the marker name\n * using {@link module:engine/conversion/mapper~Mapper#bindElementToMarker}.\n *\n * @returns Add marker converter.\n */\nfunction insertMarkerData(viewCreator) {\n return (evt, data, conversionApi) => {\n const viewMarkerData = viewCreator(data.markerName, conversionApi);\n if (!viewMarkerData) {\n return;\n }\n const markerRange = data.markerRange;\n if (!conversionApi.consumable.consume(markerRange, evt.name)) {\n return;\n }\n // Adding closing data first to keep the proper order in the view.\n handleMarkerBoundary(markerRange, false, conversionApi, data, viewMarkerData);\n handleMarkerBoundary(markerRange, true, conversionApi, data, viewMarkerData);\n evt.stop();\n };\n}\n/**\n * Helper function for `insertMarkerData()` that marks a marker boundary at the beginning or end of given `range`.\n */\nfunction handleMarkerBoundary(range, isStart, conversionApi, data, viewMarkerData) {\n const modelPosition = isStart ? range.start : range.end;\n const elementAfter = modelPosition.nodeAfter && modelPosition.nodeAfter.is('element') ? modelPosition.nodeAfter : null;\n const elementBefore = modelPosition.nodeBefore && modelPosition.nodeBefore.is('element') ? modelPosition.nodeBefore : null;\n if (elementAfter || elementBefore) {\n let modelElement;\n let isBefore;\n // If possible, we want to add `data-group-start-before` and `data-group-end-after` attributes.\n if (isStart && elementAfter || !isStart && !elementBefore) {\n // [<elementAfter>...</elementAfter> -> <elementAfter data-group-start-before=\"...\">...</elementAfter>\n // <parent>]<elementAfter> -> <parent><elementAfter data-group-end-before=\"...\">\n modelElement = elementAfter;\n isBefore = true;\n }\n else {\n // <elementBefore>...</elementBefore>] -> <elementBefore data-group-end-after=\"...\">...</elementBefore>\n // </elementBefore>[</parent> -> </elementBefore data-group-start-after=\"...\"></parent>\n modelElement = elementBefore;\n isBefore = false;\n }\n const viewElement = conversionApi.mapper.toViewElement(modelElement);\n // In rare circumstances, the model element may be not mapped to any view element and that would cause an error.\n // One of those situations is a soft break inside code block.\n if (viewElement) {\n insertMarkerAsAttribute(viewElement, isStart, isBefore, conversionApi, data, viewMarkerData);\n return;\n }\n }\n const viewPosition = conversionApi.mapper.toViewPosition(modelPosition);\n insertMarkerAsElement(viewPosition, isStart, conversionApi, data, viewMarkerData);\n}\n/**\n * Helper function for `insertMarkerData()` that marks a marker boundary in the view as an attribute on a view element.\n */\nfunction insertMarkerAsAttribute(viewElement, isStart, isBefore, conversionApi, data, viewMarkerData) {\n const attributeName = `data-${viewMarkerData.group}-${isStart ? 'start' : 'end'}-${isBefore ? 'before' : 'after'}`;\n const markerNames = viewElement.hasAttribute(attributeName) ? viewElement.getAttribute(attributeName).split(',') : [];\n // Adding marker name at the beginning to have the same order in the attribute as there is with marker elements.\n markerNames.unshift(viewMarkerData.name);\n conversionApi.writer.setAttribute(attributeName, markerNames.join(','), viewElement);\n conversionApi.mapper.bindElementToMarker(viewElement, data.markerName);\n}\n/**\n * Helper function for `insertMarkerData()` that marks a marker boundary in the view as a separate view ui element.\n */\nfunction insertMarkerAsElement(position, isStart, conversionApi, data, viewMarkerData) {\n const viewElementName = `${viewMarkerData.group}-${isStart ? 'start' : 'end'}`;\n const attrs = viewMarkerData.name ? { 'name': viewMarkerData.name } : null;\n const viewElement = conversionApi.writer.createUIElement(viewElementName, attrs);\n conversionApi.writer.insert(position, viewElement);\n conversionApi.mapper.bindElementToMarker(viewElement, data.markerName);\n}\n/**\n * Function factory that creates a converter for removing a model marker data added by the {@link #insertMarkerData} converter.\n *\n * @returns Remove marker converter.\n */\nfunction removeMarkerData(viewCreator) {\n return (evt, data, conversionApi) => {\n const viewData = viewCreator(data.markerName, conversionApi);\n if (!viewData) {\n return;\n }\n const elements = conversionApi.mapper.markerNameToElements(data.markerName);\n if (!elements) {\n return;\n }\n for (const element of elements) {\n conversionApi.mapper.unbindElementFromMarkerName(element, data.markerName);\n if (element.is('containerElement')) {\n removeMarkerFromAttribute(`data-${viewData.group}-start-before`, element);\n removeMarkerFromAttribute(`data-${viewData.group}-start-after`, element);\n removeMarkerFromAttribute(`data-${viewData.group}-end-before`, element);\n removeMarkerFromAttribute(`data-${viewData.group}-end-after`, element);\n }\n else {\n conversionApi.writer.clear(conversionApi.writer.createRangeOn(element), element);\n }\n }\n conversionApi.writer.clearClonedElementsGroup(data.markerName);\n evt.stop();\n function removeMarkerFromAttribute(attributeName, element) {\n if (element.hasAttribute(attributeName)) {\n const markerNames = new Set(element.getAttribute(attributeName).split(','));\n markerNames.delete(viewData.name);\n if (markerNames.size == 0) {\n conversionApi.writer.removeAttribute(attributeName, element);\n }\n else {\n conversionApi.writer.setAttribute(attributeName, Array.from(markerNames).join(','), element);\n }\n }\n }\n };\n}\n/**\n * Function factory that creates a converter which converts the set/change/remove attribute changes from the model to the view.\n *\n * Attributes from the model are converted to the view element attributes in the view. You may provide a custom function to generate\n * a key-value attribute pair to add/change/remove. If not provided, model attributes will be converted to view element\n * attributes on a one-to-one basis.\n *\n * *Note:** The provided attribute creator should always return the same `key` for a given attribute from the model.\n *\n * The converter automatically consumes the corresponding value from the consumables list and stops the event (see\n * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}).\n *\n * ```ts\n * modelDispatcher.on( 'attribute:customAttr:myElem', changeAttribute( ( value, data ) => {\n * \t// Change attribute key from `customAttr` to `class` in the view.\n * \tconst key = 'class';\n * \tlet value = data.attributeNewValue;\n *\n * \t// Force attribute value to 'empty' if the model element is empty.\n * \tif ( data.item.childCount === 0 ) {\n * \t\tvalue = 'empty';\n * \t}\n *\n * \t// Return the key-value pair.\n * \treturn { key, value };\n * } ) );\n * ```\n *\n * @param attributeCreator Function returning an object with two properties: `key` and `value`, which\n * represent the attribute key and attribute value to be set on a {@link module:engine/view/element~Element view element}.\n * The function is passed the model attribute value as the first parameter and additional data about the change as the second parameter.\n * @returns Set/change attribute converter.\n */\nfunction changeAttribute(attributeCreator) {\n return (evt, data, conversionApi) => {\n if (!conversionApi.consumable.test(data.item, evt.name)) {\n return;\n }\n const oldAttribute = attributeCreator(data.attributeOldValue, conversionApi, data);\n const newAttribute = attributeCreator(data.attributeNewValue, conversionApi, data);\n if (!oldAttribute && !newAttribute) {\n return;\n }\n conversionApi.consumable.consume(data.item, evt.name);\n const viewElement = conversionApi.mapper.toViewElement(data.item);\n const viewWriter = conversionApi.writer;\n // If model item cannot be mapped to a view element, it means item is not an `Element` instance but a `TextProxy` node.\n // Only elements can have attributes in a view so do not proceed for anything else (#1587).\n if (!viewElement) {\n /**\n * This error occurs when a {@link module:engine/model/textproxy~TextProxy text node's} attribute is to be downcasted\n * by an {@link module:engine/conversion/conversion~Conversion#attributeToAttribute `Attribute to Attribute converter`}.\n * In most cases it is caused by converters misconfiguration when only \"generic\" converter is defined:\n *\n * ```ts\n * editor.conversion.for( 'downcast' ).attributeToAttribute( {\n * \tmodel: 'attribute-name',\n * \tview: 'attribute-name'\n * } ) );\n * ```\n *\n * and given attribute is used on text node, for example:\n *\n * ```ts\n * model.change( writer => {\n * \twriter.insertText( 'Foo', { 'attribute-name': 'bar' }, parent, 0 );\n * } );\n * ```\n *\n * In such cases, to convert the same attribute for both {@link module:engine/model/element~Element}\n * and {@link module:engine/model/textproxy~TextProxy `Text`} nodes, text specific\n * {@link module:engine/conversion/conversion~Conversion#attributeToElement `Attribute to Element converter`}\n * with higher {@link module:utils/priorities~PriorityString priority} must also be defined:\n *\n * ```ts\n * editor.conversion.for( 'downcast' ).attributeToElement( {\n * \tmodel: {\n * \t\tkey: 'attribute-name',\n * \t\tname: '$text'\n * \t},\n * \tview: ( value, { writer } ) => {\n * \t\treturn writer.createAttributeElement( 'span', { 'attribute-name': value } );\n * \t},\n * \tconverterPriority: 'high'\n * } ) );\n * ```\n *\n * @error conversion-attribute-to-attribute-on-text\n */\n throw new CKEditorError('conversion-attribute-to-attribute-on-text', conversionApi.dispatcher, data);\n }\n // First remove the old attribute if there was one.\n if (data.attributeOldValue !== null && oldAttribute) {\n if (oldAttribute.key == 'class') {\n const classes = toArray(oldAttribute.value);\n for (const className of classes) {\n viewWriter.removeClass(className, viewElement);\n }\n }\n else if (oldAttribute.key == 'style') {\n const keys = Object.keys(oldAttribute.value);\n for (const key of keys) {\n viewWriter.removeStyle(key, viewElement);\n }\n }\n else {\n viewWriter.removeAttribute(oldAttribute.key, viewElement);\n }\n }\n // Then set the new attribute.\n if (data.attributeNewValue !== null && newAttribute) {\n if (newAttribute.key == 'class') {\n const classes = toArray(newAttribute.value);\n for (const className of classes) {\n viewWriter.addClass(className, viewElement);\n }\n }\n else if (newAttribute.key == 'style') {\n const keys = Object.keys(newAttribute.value);\n for (const key of keys) {\n viewWriter.setStyle(key, newAttribute.value[key], viewElement);\n }\n }\n else {\n viewWriter.setAttribute(newAttribute.key, newAttribute.value, viewElement);\n }\n }\n };\n}\n/**\n * Function factory that creates a converter which converts the text inside marker's range. The converter wraps the text with\n * {@link module:engine/view/attributeelement~AttributeElement} created from the provided descriptor.\n * See {link module:engine/conversion/downcasthelpers~createViewElementFromHighlightDescriptor}.\n *\n * It can also be used to convert the selection that is inside a marker. In that case, an empty attribute element will be\n * created and the selection will be put inside it.\n *\n * If the highlight descriptor does not provide the `priority` property, `10` will be used.\n *\n * If the highlight descriptor does not provide the `id` property, the name of the marker will be used.\n *\n * This converter binds the created {@link module:engine/view/attributeelement~AttributeElement attribute elemens} with the marker name\n * using the {@link module:engine/conversion/mapper~Mapper#bindElementToMarker} method.\n */\nfunction highlightText(highlightDescriptor) {\n return (evt, data, conversionApi) => {\n if (!data.item) {\n return;\n }\n if (!(data.item instanceof ModelSelection || data.item instanceof ModelDocumentSelection) && !data.item.is('$textProxy')) {\n return;\n }\n const descriptor = prepareDescriptor(highlightDescriptor, data, conversionApi);\n if (!descriptor) {\n return;\n }\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const viewWriter = conversionApi.writer;\n const viewElement = createViewElementFromHighlightDescriptor(viewWriter, descriptor);\n const viewSelection = viewWriter.document.selection;\n if (data.item instanceof ModelSelection || data.item instanceof ModelDocumentSelection) {\n viewWriter.wrap(viewSelection.getFirstRange(), viewElement);\n }\n else {\n const viewRange = conversionApi.mapper.toViewRange(data.range);\n const rangeAfterWrap = viewWriter.wrap(viewRange, viewElement);\n for (const element of rangeAfterWrap.getItems()) {\n if (element.is('attributeElement') && element.isSimilar(viewElement)) {\n conversionApi.mapper.bindElementToMarker(element, data.markerName);\n // One attribute element is enough, because all of them are bound together by the view writer.\n // Mapper uses this binding to get all the elements no matter how many of them are registered in the mapper.\n break;\n }\n }\n }\n };\n}\n/**\n * Converter function factory. It creates a function which applies the marker's highlight to an element inside the marker's range.\n *\n * The converter checks if an element has the `addHighlight` function stored as a\n * {@link module:engine/view/element~Element#_setCustomProperty custom property} and, if so, uses it to apply the highlight.\n * In such case the converter will consume all element's children, assuming that they were handled by the element itself.\n *\n * When the `addHighlight` custom property is not present, the element is not converted in any special way.\n * This means that converters will proceed to convert the element's child nodes.\n *\n * If the highlight descriptor does not provide the `priority` property, `10` will be used.\n *\n * If the highlight descriptor does not provide the `id` property, the name of the marker will be used.\n *\n * This converter binds altered {@link module:engine/view/containerelement~ContainerElement container elements} with the marker name using\n * the {@link module:engine/conversion/mapper~Mapper#bindElementToMarker} method.\n */\nfunction highlightElement(highlightDescriptor) {\n return (evt, data, conversionApi) => {\n if (!data.item) {\n return;\n }\n if (!(data.item instanceof ModelElement)) {\n return;\n }\n const descriptor = prepareDescriptor(highlightDescriptor, data, conversionApi);\n if (!descriptor) {\n return;\n }\n if (!conversionApi.consumable.test(data.item, evt.name)) {\n return;\n }\n const viewElement = conversionApi.mapper.toViewElement(data.item);\n if (viewElement && viewElement.getCustomProperty('addHighlight')) {\n // Consume element itself.\n conversionApi.consumable.consume(data.item, evt.name);\n // Consume all children nodes.\n for (const value of ModelRange._createIn(data.item)) {\n conversionApi.consumable.consume(value.item, evt.name);\n }\n const addHighlightCallback = viewElement.getCustomProperty('addHighlight');\n addHighlightCallback(viewElement, descriptor, conversionApi.writer);\n conversionApi.mapper.bindElementToMarker(viewElement, data.markerName);\n }\n };\n}\n/**\n * Function factory that creates a converter which converts the removing model marker to the view.\n *\n * Both text nodes and elements are handled by this converter but they are handled a bit differently.\n *\n * Text nodes are unwrapped using the {@link module:engine/view/attributeelement~AttributeElement attribute element} created from the\n * provided highlight descriptor. See {link module:engine/conversion/downcasthelpers~HighlightDescriptor}.\n *\n * For elements, the converter checks if an element has the `removeHighlight` function stored as a\n * {@link module:engine/view/element~Element#_setCustomProperty custom property}. If so, it uses it to remove the highlight.\n * In such case, the children of that element will not be converted.\n *\n * When `removeHighlight` is not present, the element is not converted in any special way.\n * The converter will proceed to convert the element's child nodes instead.\n *\n * If the highlight descriptor does not provide the `priority` property, `10` will be used.\n *\n * If the highlight descriptor does not provide the `id` property, the name of the marker will be used.\n *\n * This converter unbinds elements from the marker name.\n */\nfunction removeHighlight(highlightDescriptor) {\n return (evt, data, conversionApi) => {\n // This conversion makes sense only for non-collapsed range.\n if (data.markerRange.isCollapsed) {\n return;\n }\n const descriptor = prepareDescriptor(highlightDescriptor, data, conversionApi);\n if (!descriptor) {\n return;\n }\n // View element that will be used to unwrap `AttributeElement`s.\n const viewHighlightElement = createViewElementFromHighlightDescriptor(conversionApi.writer, descriptor);\n // Get all elements bound with given marker name.\n const elements = conversionApi.mapper.markerNameToElements(data.markerName);\n if (!elements) {\n return;\n }\n for (const element of elements) {\n conversionApi.mapper.unbindElementFromMarkerName(element, data.markerName);\n if (element.is('attributeElement')) {\n conversionApi.writer.unwrap(conversionApi.writer.createRangeOn(element), viewHighlightElement);\n }\n else {\n // if element.is( 'containerElement' ).\n const removeHighlightCallback = element.getCustomProperty('removeHighlight');\n removeHighlightCallback(element, descriptor.id, conversionApi.writer);\n }\n }\n conversionApi.writer.clearClonedElementsGroup(data.markerName);\n evt.stop();\n };\n}\n/**\n * Model element to view element conversion helper.\n *\n * See {@link ~DowncastHelpers#elementToElement `.elementToElement()` downcast helper} for examples and config params description.\n *\n * @param config Conversion configuration.\n * @param config.model The description or a name of the model element to convert.\n * @param config.model.attributes List of attributes triggering element reconversion.\n * @param config.model.children Should reconvert element if the list of model child nodes changed.\n * @returns Conversion helper.\n */\nfunction downcastElementToElement(config) {\n const model = normalizeModelElementConfig(config.model);\n const view = normalizeToElementConfig(config.view, 'container');\n // Trigger reconversion on children list change if element is a subject to any reconversion.\n // This is required to be able to trigger Differ#refreshItem() on a direct child of the reconverted element.\n if (model.attributes.length) {\n model.children = true;\n }\n return (dispatcher) => {\n dispatcher.on(`insert:${model.name}`, insertElement(view, createConsumer(model)), { priority: config.converterPriority || 'normal' });\n if (model.children || model.attributes.length) {\n dispatcher.on('reduceChanges', createChangeReducer(model), { priority: 'low' });\n }\n };\n}\n/**\n * Model element to view structure conversion helper.\n *\n * See {@link ~DowncastHelpers#elementToStructure `.elementToStructure()` downcast helper} for examples and config params description.\n *\n * @param config Conversion configuration.\n * @returns Conversion helper.\n */\nfunction downcastElementToStructure(config) {\n const model = normalizeModelElementConfig(config.model);\n const view = normalizeToElementConfig(config.view, 'container');\n // Trigger reconversion on children list change because it always needs to use slots to put children in proper places.\n // This is required to be able to trigger Differ#refreshItem() on a direct child of the reconverted element.\n model.children = true;\n return (dispatcher) => {\n if (dispatcher._conversionApi.schema.checkChild(model.name, '$text')) {\n /**\n * This error occurs when a {@link module:engine/model/element~Element model element} is downcasted\n * via {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToStructure} helper but the element was\n * allowed to host `$text` by the {@link module:engine/model/schema~Schema model schema}.\n *\n * For instance, this may be the result of `myElement` allowing the content of\n * {@glink framework/deep-dive/schema#generic-items `$block`} in its schema definition:\n *\n * ```ts\n * // Element definition in schema.\n * schema.register( 'myElement', {\n * \tallowContentOf: '$block',\n *\n * \t// ...\n * } );\n *\n * // ...\n *\n * // Conversion of myElement with the use of elementToStructure().\n * editor.conversion.for( 'downcast' ).elementToStructure( {\n * \tmodel: 'myElement',\n * \tview: ( modelElement, { writer } ) => {\n * \t\t// ...\n * \t}\n * } );\n * ```\n *\n * In such case, {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`} helper\n * can be used instead to get around this problem:\n *\n * ```ts\n * editor.conversion.for( 'downcast' ).elementToElement( {\n * \tmodel: 'myElement',\n * \tview: ( modelElement, { writer } ) => {\n * \t\t// ...\n * \t}\n * } );\n * ```\n *\n * @error conversion-element-to-structure-disallowed-text\n * @param {String} elementName The name of the element the structure is to be created for.\n */\n throw new CKEditorError('conversion-element-to-structure-disallowed-text', dispatcher, { elementName: model.name });\n }\n dispatcher.on(`insert:${model.name}`, insertStructure(view, createConsumer(model)), { priority: config.converterPriority || 'normal' });\n dispatcher.on('reduceChanges', createChangeReducer(model), { priority: 'low' });\n };\n}\n/**\n * Model attribute to view element conversion helper.\n *\n * See {@link ~DowncastHelpers#attributeToElement `.attributeToElement()` downcast helper} for examples.\n *\n * @param config Conversion configuration.\n * @param config.model The key of the attribute to convert from or a `{ key, values }` object. `values` is an array\n * of `String`s with possible values if the model attribute is an enumerable.\n * @param config.view A view element definition or a function that takes the model attribute value and\n * {@link module:engine/view/downcastwriter~DowncastWriter view downcast writer} as parameters and returns a view attribute element.\n * If `config.model.values` is given, `config.view` should be an object assigning values from `config.model.values` to view element\n * definitions or functions.\n * @param config.converterPriority Converter priority.\n * @returns Conversion helper.\n */\nfunction downcastAttributeToElement(config) {\n config = cloneDeep(config);\n let model = config.model;\n if (typeof model == 'string') {\n model = { key: model };\n }\n let eventName = `attribute:${model.key}`;\n if (model.name) {\n eventName += ':' + model.name;\n }\n if (model.values) {\n for (const modelValue of model.values) {\n config.view[modelValue] = normalizeToElementConfig(config.view[modelValue], 'attribute');\n }\n }\n else {\n config.view = normalizeToElementConfig(config.view, 'attribute');\n }\n const elementCreator = getFromAttributeCreator(config);\n return (dispatcher) => {\n dispatcher.on(eventName, wrap(elementCreator), { priority: config.converterPriority || 'normal' });\n };\n}\n/**\n * Model attribute to view attribute conversion helper.\n *\n * See {@link ~DowncastHelpers#attributeToAttribute `.attributeToAttribute()` downcast helper} for examples.\n *\n * @param config Conversion configuration.\n * @param config.model The key of the attribute to convert from or a `{ key, values, [ name ] }` object describing\n * the attribute key, possible values and, optionally, an element name to convert from.\n * @param config.view A view attribute key, or a `{ key, value }` object or a function that takes the model attribute value and returns\n * a `{ key, value }` object.\n * If `key` is `'class'`, `value` can be a `String` or an array of `String`s. If `key` is `'style'`, `value` is an object with\n * key-value pairs. In other cases, `value` is a `String`.\n * If `config.model.values` is set, `config.view` should be an object assigning values from `config.model.values` to\n * `{ key, value }` objects or a functions.\n * @param config.converterPriority Converter priority.\n * @returns Conversion helper.\n */\nfunction downcastAttributeToAttribute(config) {\n config = cloneDeep(config);\n let model = config.model;\n if (typeof model == 'string') {\n model = { key: model };\n }\n let eventName = `attribute:${model.key}`;\n if (model.name) {\n eventName += ':' + model.name;\n }\n if (model.values) {\n for (const modelValue of model.values) {\n config.view[modelValue] = normalizeToAttributeConfig(config.view[modelValue]);\n }\n }\n else {\n config.view = normalizeToAttributeConfig(config.view);\n }\n const elementCreator = getFromAttributeCreator(config);\n return (dispatcher) => {\n dispatcher.on(eventName, changeAttribute(elementCreator), { priority: config.converterPriority || 'normal' });\n };\n}\n/**\n * Model marker to view element conversion helper.\n *\n * See {@link ~DowncastHelpers#markerToElement `.markerToElement()` downcast helper} for examples.\n *\n * @param config Conversion configuration.\n * @param config.model The name of the model marker (or model marker group) to convert.\n * @param config.view A view element definition or a function that takes the model marker data as a parameter and returns a view UI element.\n * @param config.converterPriority Converter priority.\n * @returns Conversion helper.\n */\nfunction downcastMarkerToElement(config) {\n const view = normalizeToElementConfig(config.view, 'ui');\n return (dispatcher) => {\n dispatcher.on(`addMarker:${config.model}`, insertUIElement(view), { priority: config.converterPriority || 'normal' });\n dispatcher.on(`removeMarker:${config.model}`, removeUIElement(), { priority: config.converterPriority || 'normal' });\n };\n}\n/**\n * Model marker to view data conversion helper.\n *\n * See {@link ~DowncastHelpers#markerToData `markerToData()` downcast helper} to learn more.\n *\n * @returns Conversion helper.\n */\nfunction downcastMarkerToData(config) {\n config = cloneDeep(config);\n const group = config.model;\n let view = config.view;\n // Default conversion.\n if (!view) {\n view = markerName => ({\n group,\n name: markerName.substr(config.model.length + 1)\n });\n }\n return (dispatcher) => {\n dispatcher.on(`addMarker:${group}`, insertMarkerData(view), { priority: config.converterPriority || 'normal' });\n dispatcher.on(`removeMarker:${group}`, removeMarkerData(view), { priority: config.converterPriority || 'normal' });\n };\n}\n/**\n * Model marker to highlight conversion helper.\n *\n * See {@link ~DowncastHelpers#markerToElement `.markerToElement()` downcast helper} for examples.\n *\n * @param config Conversion configuration.\n * @param config.model The name of the model marker (or model marker group) to convert.\n * @param config.view A highlight descriptor that will be used for highlighting or a function that takes\n * the model marker data as a parameter and returns a highlight descriptor.\n * @param config.converterPriority Converter priority.\n * @returns Conversion helper.\n */\nfunction downcastMarkerToHighlight(config) {\n return (dispatcher) => {\n dispatcher.on(`addMarker:${config.model}`, highlightText(config.view), { priority: config.converterPriority || 'normal' });\n dispatcher.on(`addMarker:${config.model}`, highlightElement(config.view), { priority: config.converterPriority || 'normal' });\n dispatcher.on(`removeMarker:${config.model}`, removeHighlight(config.view), { priority: config.converterPriority || 'normal' });\n };\n}\n/**\n * Takes `config.model`, and converts it to an object with normalized structure.\n *\n * @param model Model configuration or element name.\n */\nfunction normalizeModelElementConfig(model) {\n if (typeof model == 'string') {\n model = { name: model };\n }\n // List of attributes that should trigger reconversion.\n if (!model.attributes) {\n model.attributes = [];\n }\n else if (!Array.isArray(model.attributes)) {\n model.attributes = [model.attributes];\n }\n // Whether a children insertion/deletion should trigger reconversion.\n model.children = !!model.children;\n return model;\n}\n/**\n * Takes `config.view`, and if it is an {@link module:engine/view/elementdefinition~ElementDefinition}, converts it\n * to a function (because lower level converters accept only element creator functions).\n *\n * @param view View configuration.\n * @param viewElementType View element type to create.\n * @returns Element creator function to use in lower level converters.\n */\nfunction normalizeToElementConfig(view, viewElementType) {\n if (typeof view == 'function') {\n // If `view` is already a function, don't do anything.\n return view;\n }\n return ((modelData, conversionApi) => createViewElementFromDefinition(view, conversionApi, viewElementType));\n}\n/**\n * Creates a view element instance from the provided {@link module:engine/view/elementdefinition~ElementDefinition} and class.\n */\nfunction createViewElementFromDefinition(viewElementDefinition, conversionApi, viewElementType) {\n if (typeof viewElementDefinition == 'string') {\n // If `viewElementDefinition` is given as a `String`, normalize it to an object with `name` property.\n viewElementDefinition = { name: viewElementDefinition };\n }\n let element;\n const viewWriter = conversionApi.writer;\n const attributes = Object.assign({}, viewElementDefinition.attributes);\n if (viewElementType == 'container') {\n element = viewWriter.createContainerElement(viewElementDefinition.name, attributes);\n }\n else if (viewElementType == 'attribute') {\n const options = {\n priority: viewElementDefinition.priority || ViewAttributeElement.DEFAULT_PRIORITY\n };\n element = viewWriter.createAttributeElement(viewElementDefinition.name, attributes, options);\n }\n else {\n // 'ui'.\n element = viewWriter.createUIElement(viewElementDefinition.name, attributes);\n }\n if (viewElementDefinition.styles) {\n const keys = Object.keys(viewElementDefinition.styles);\n for (const key of keys) {\n viewWriter.setStyle(key, viewElementDefinition.styles[key], element);\n }\n }\n if (viewElementDefinition.classes) {\n const classes = viewElementDefinition.classes;\n if (typeof classes == 'string') {\n viewWriter.addClass(classes, element);\n }\n else {\n for (const className of classes) {\n viewWriter.addClass(className, element);\n }\n }\n }\n return element;\n}\nfunction getFromAttributeCreator(config) {\n if (config.model.values) {\n return ((modelAttributeValue, conversionApi, data) => {\n const view = config.view[modelAttributeValue];\n if (view) {\n return view(modelAttributeValue, conversionApi, data);\n }\n return null;\n });\n }\n else {\n return config.view;\n }\n}\n/**\n * Takes the configuration, adds default parameters if they do not exist and normalizes other parameters to be used in downcast converters\n * for generating a view attribute.\n *\n * @param view View configuration.\n */\nfunction normalizeToAttributeConfig(view) {\n if (typeof view == 'string') {\n return modelAttributeValue => ({ key: view, value: modelAttributeValue });\n }\n else if (typeof view == 'object') {\n // { key, value, ... }\n if (view.value) {\n return () => view;\n }\n // { key, ... }\n else {\n return modelAttributeValue => ({ key: view.key, value: modelAttributeValue });\n }\n }\n else {\n // function.\n return view;\n }\n}\n/**\n * Helper function for `highlight`. Prepares the actual descriptor object using value passed to the converter.\n */\nfunction prepareDescriptor(highlightDescriptor, data, conversionApi) {\n // If passed descriptor is a creator function, call it. If not, just use passed value.\n const descriptor = typeof highlightDescriptor == 'function' ?\n highlightDescriptor(data, conversionApi) :\n highlightDescriptor;\n if (!descriptor) {\n return null;\n }\n // Apply default descriptor priority.\n if (!descriptor.priority) {\n descriptor.priority = 10;\n }\n // Default descriptor id is marker name.\n if (!descriptor.id) {\n descriptor.id = data.markerName;\n }\n return descriptor;\n}\n/**\n * Creates a function that checks a single differ diff item whether it should trigger reconversion.\n *\n * @param model A normalized `config.model` converter configuration.\n * @param model.name The name of element.\n * @param model.attributes The list of attribute names that should trigger reconversion.\n * @param model.children Whether the child list change should trigger reconversion.\n */\nfunction createChangeReducerCallback(model) {\n return (node, change) => {\n if (!node.is('element', model.name)) {\n return false;\n }\n if (change.type == 'attribute') {\n if (model.attributes.includes(change.attributeKey)) {\n return true;\n }\n }\n else {\n /* istanbul ignore else: This is always true because otherwise it would not register a reducer callback. -- @preserve */\n if (model.children) {\n return true;\n }\n }\n return false;\n };\n}\n/**\n * Creates a `reduceChanges` event handler for reconversion.\n *\n * @param model A normalized `config.model` converter configuration.\n * @param model.name The name of element.\n * @param model.attributes The list of attribute names that should trigger reconversion.\n * @param model.children Whether the child list change should trigger reconversion.\n */\nfunction createChangeReducer(model) {\n const shouldReplace = createChangeReducerCallback(model);\n return (evt, data) => {\n const reducedChanges = [];\n if (!data.reconvertedElements) {\n data.reconvertedElements = new Set();\n }\n for (const change of data.changes) {\n // For attribute use node affected by the change.\n // For insert or remove use parent element because we need to check if it's added/removed child.\n const node = change.type == 'attribute' ? change.range.start.nodeAfter : change.position.parent;\n if (!node || !shouldReplace(node, change)) {\n reducedChanges.push(change);\n continue;\n }\n // If it's already marked for reconversion, so skip this change, otherwise add the diff items.\n if (!data.reconvertedElements.has(node)) {\n data.reconvertedElements.add(node);\n const position = ModelPosition._createBefore(node);\n let changeIndex = reducedChanges.length;\n // We need to insert remove+reinsert before any other change on and inside the re-converted element.\n // This is important because otherwise we would remove element that had already been modified by the previous change.\n // Note that there could be some element removed before the re-converted element, so we must not break this behavior.\n for (let i = reducedChanges.length - 1; i >= 0; i--) {\n const change = reducedChanges[i];\n const changePosition = change.type == 'attribute' ? change.range.start : change.position;\n const positionRelation = changePosition.compareWith(position);\n if (positionRelation == 'before' || change.type == 'remove' && positionRelation == 'same') {\n break;\n }\n changeIndex = i;\n }\n reducedChanges.splice(changeIndex, 0, {\n type: 'remove',\n name: node.name,\n position,\n length: 1\n }, {\n type: 'reinsert',\n name: node.name,\n position,\n length: 1\n });\n }\n }\n data.changes = reducedChanges;\n };\n}\n/**\n * Creates a function that checks if an element and its watched attributes can be consumed and consumes them.\n *\n * @param model A normalized `config.model` converter configuration.\n * @param model.name The name of element.\n * @param model.attributes The list of attribute names that should trigger reconversion.\n * @param model.children Whether the child list change should trigger reconversion.\n */\nfunction createConsumer(model) {\n return (node, consumable, options = {}) => {\n const events = ['insert'];\n // Collect all set attributes that are triggering conversion.\n for (const attributeName of model.attributes) {\n if (node.hasAttribute(attributeName)) {\n events.push(`attribute:${attributeName}`);\n }\n }\n if (!events.every(event => consumable.test(node, event))) {\n return false;\n }\n if (!options.preflight) {\n events.forEach(event => consumable.consume(node, event));\n }\n return true;\n };\n}\n/**\n * Creates a function that create view slots.\n *\n * @returns Function exposed by writer as createSlot().\n */\nfunction createSlotFactory(element, slotsMap, conversionApi) {\n return (writer, modeOrFilter) => {\n const slot = writer.createContainerElement('$slot');\n let children = null;\n if (modeOrFilter === 'children') {\n children = Array.from(element.getChildren());\n }\n else if (typeof modeOrFilter == 'function') {\n children = Array.from(element.getChildren()).filter(element => modeOrFilter(element));\n }\n else {\n /**\n * Unknown slot mode was provided to `writer.createSlot()` in downcast converter.\n *\n * @error conversion-slot-mode-unknown\n */\n throw new CKEditorError('conversion-slot-mode-unknown', conversionApi.dispatcher, { modeOrFilter });\n }\n slotsMap.set(slot, children);\n return slot;\n };\n}\n/**\n * Checks if all children are covered by slots and there is no child that landed in multiple slots.\n */\nfunction validateSlotsChildren(element, slotsMap, conversionApi) {\n const childrenInSlots = Array.from(slotsMap.values()).flat();\n const uniqueChildrenInSlots = new Set(childrenInSlots);\n if (uniqueChildrenInSlots.size != childrenInSlots.length) {\n /**\n * Filters provided to `writer.createSlot()` overlap (at least two filters accept the same child element).\n *\n * @error conversion-slot-filter-overlap\n * @param {module:engine/model/element~Element} element The element of which children would not be properly\n * allocated to multiple slots.\n */\n throw new CKEditorError('conversion-slot-filter-overlap', conversionApi.dispatcher, { element });\n }\n if (uniqueChildrenInSlots.size != element.childCount) {\n /**\n * Filters provided to `writer.createSlot()` are incomplete and exclude at least one children element (one of\n * the children elements would not be assigned to any of the slots).\n *\n * @error conversion-slot-filter-incomplete\n * @param {module:engine/model/element~Element} element The element of which children would not be properly\n * allocated to multiple slots.\n */\n throw new CKEditorError('conversion-slot-filter-incomplete', conversionApi.dispatcher, { element });\n }\n}\n/**\n * Fill slots with appropriate view elements.\n */\nfunction fillSlots(viewElement, slotsMap, conversionApi, options) {\n // Set temporary position mapping to redirect child view elements into a proper slots.\n conversionApi.mapper.on('modelToViewPosition', toViewPositionMapping, { priority: 'highest' });\n let currentSlot = null;\n let currentSlotNodes = null;\n // Fill slots with nested view nodes.\n for ([currentSlot, currentSlotNodes] of slotsMap) {\n reinsertOrConvertNodes(viewElement, currentSlotNodes, conversionApi, options);\n conversionApi.writer.move(conversionApi.writer.createRangeIn(currentSlot), conversionApi.writer.createPositionBefore(currentSlot));\n conversionApi.writer.remove(currentSlot);\n }\n conversionApi.mapper.off('modelToViewPosition', toViewPositionMapping);\n function toViewPositionMapping(evt, data) {\n const element = data.modelPosition.nodeAfter;\n // Find the proper offset within the slot.\n const index = currentSlotNodes.indexOf(element);\n if (index < 0) {\n return;\n }\n data.viewPosition = data.mapper.findPositionIn(currentSlot, index);\n }\n}\n/**\n * Inserts view representation of `nodes` into the `viewElement` either by bringing back just removed view nodes\n * or by triggering conversion for them.\n */\nfunction reinsertOrConvertNodes(viewElement, modelNodes, conversionApi, options) {\n // Fill with nested view nodes.\n for (const modelChildNode of modelNodes) {\n // Try reinserting the view node for the specified model node...\n if (!reinsertNode(viewElement.root, modelChildNode, conversionApi, options)) {\n // ...or else convert the model element to the view.\n conversionApi.convertItem(modelChildNode);\n }\n }\n}\n/**\n * Checks if the view for the given model element could be reused and reinserts it to the view.\n *\n * @returns `false` if view element can't be reused.\n */\nfunction reinsertNode(viewRoot, modelNode, conversionApi, options) {\n const { writer, mapper } = conversionApi;\n // Don't reinsert if this is not a reconversion...\n if (!options.reconversion) {\n return false;\n }\n const viewChildNode = mapper.toViewElement(modelNode);\n // ...or there is no view to reinsert or it was already inserted to the view structure...\n if (!viewChildNode || viewChildNode.root == viewRoot) {\n return false;\n }\n // ...or it was strictly marked as not to be reused.\n if (!conversionApi.canReuseView(viewChildNode)) {\n return false;\n }\n // Otherwise reinsert the view node.\n writer.move(writer.createRangeOn(viewChildNode), mapper.toViewPosition(ModelPosition._createBefore(modelNode)));\n return true;\n}\n/**\n * The default consumer for insert events.\n *\n * @param item Model item.\n * @param consumable The model consumable.\n * @param options.preflight Whether should consume or just check if can be consumed.\n */\nfunction defaultConsumer(item, consumable, { preflight } = {}) {\n if (preflight) {\n return consumable.test(item, 'insert');\n }\n else {\n return consumable.consume(item, 'insert');\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/utils/autoparagraphing\n */\n/**\n * Fixes all empty roots.\n *\n * @internal\n * @param writer The model writer.\n * @returns `true` if any change has been applied, `false` otherwise.\n */\nexport function autoParagraphEmptyRoots(writer) {\n const { schema, document } = writer.model;\n for (const rootName of document.getRootNames()) {\n const root = document.getRoot(rootName);\n if (root.isEmpty && !schema.checkChild(root, '$text')) {\n // If paragraph element is allowed in the root, create paragraph element.\n if (schema.checkChild(root, 'paragraph')) {\n writer.insertElement('paragraph', root);\n // Other roots will get fixed in the next post-fixer round. Those will be triggered\n // in the same batch no matter if this method was triggered by the post-fixing or not\n // (the above insertElement call will trigger the post-fixers).\n return true;\n }\n }\n }\n return false;\n}\n/**\n * Checks if the given node wrapped with a paragraph would be accepted by the schema in the given position.\n *\n * @internal\n * @param position The position at which to check.\n * @param nodeOrType The child node or child type to check.\n * @param schema A schema instance used for element validation.\n */\nexport function isParagraphable(position, nodeOrType, schema) {\n const context = schema.createContext(position);\n // When paragraph is allowed in this context...\n if (!schema.checkChild(context, 'paragraph')) {\n return false;\n }\n // And a node would be allowed in this paragraph...\n if (!schema.checkChild(context.push('paragraph'), nodeOrType)) {\n return false;\n }\n return true;\n}\n/**\n * Inserts a new paragraph at the given position and returns a position inside that paragraph.\n *\n * @internal\n * @param position The position where a paragraph should be inserted.\n * @param writer The model writer.\n * @returns Position inside the created paragraph.\n */\nexport function wrapInParagraph(position, writer) {\n const paragraph = writer.createElement('paragraph');\n writer.insert(paragraph, position);\n return writer.createPositionAt(paragraph, 0);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport Matcher from '../view/matcher';\nimport ConversionHelpers from './conversionhelpers';\nimport { isParagraphable, wrapInParagraph } from '../model/utils/autoparagraphing';\nimport { priorities } from '@ckeditor/ckeditor5-utils';\nimport { cloneDeep } from 'lodash-es';\n/**\n * Contains the {@link module:engine/view/view view} to {@link module:engine/model/model model} converters for\n * {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher}.\n *\n * @module engine/conversion/upcasthelpers\n */\n/**\n * Upcast conversion helper functions.\n *\n * Learn more about {@glink framework/deep-dive/conversion/upcast upcast helpers}.\n *\n * @extends module:engine/conversion/conversionhelpers~ConversionHelpers\n */\nexport default class UpcastHelpers extends ConversionHelpers {\n /**\n * View element to model element conversion helper.\n *\n * This conversion results in creating a model element. For example,\n * view `<p>Foo</p>` becomes `<paragraph>Foo</paragraph>` in the model.\n *\n * Keep in mind that the element will be inserted only if it is allowed\n * by {@link module:engine/model/schema~Schema schema} configuration.\n *\n * ```ts\n * editor.conversion.for( 'upcast' ).elementToElement( {\n * \tview: 'p',\n * \tmodel: 'paragraph'\n * } );\n *\n * editor.conversion.for( 'upcast' ).elementToElement( {\n * \tview: 'p',\n * \tmodel: 'paragraph',\n * \tconverterPriority: 'high'\n * } );\n *\n * editor.conversion.for( 'upcast' ).elementToElement( {\n * \tview: {\n * \t\tname: 'p',\n * \t\tclasses: 'fancy'\n * \t},\n * \tmodel: 'fancyParagraph'\n * } );\n *\n * editor.conversion.for( 'upcast' ).elementToElement( {\n * \tview: {\n * \t\tname: 'p',\n * \t\tclasses: 'heading'\n * \t},\n * \tmodel: ( viewElement, conversionApi ) => {\n * \t\tconst modelWriter = conversionApi.writer;\n *\n * \t\treturn modelWriter.createElement( 'heading', { level: viewElement.getAttribute( 'data-level' ) } );\n * \t}\n * } );\n * ```\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n * to the conversion process.\n *\n * @param config Conversion configuration.\n * @param config.view Pattern matching all view elements which should be converted. If not set, the converter\n * will fire for every view element.\n * @param config.model Name of the model element, a model element instance or a function that takes a view element\n * and {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API}\n * and returns a model element. The model element will be inserted in the model.\n * @param config.converterPriority Converter priority.\n */\n elementToElement(config) {\n return this.add(upcastElementToElement(config));\n }\n /**\n * View element to model attribute conversion helper.\n *\n * This conversion results in setting an attribute on a model node. For example, view `<strong>Foo</strong>` becomes\n * `Foo` {@link module:engine/model/text~Text model text node} with `bold` attribute set to `true`.\n *\n * This helper is meant to set a model attribute on all the elements that are inside the converted element:\n *\n * ```\n * <strong>Foo</strong> --> <strong><p>Foo</p></strong> --> <paragraph><$text bold=\"true\">Foo</$text></paragraph>\n * ```\n *\n * Above is a sample of HTML code, that goes through autoparagraphing (first step) and then is converted (second step).\n * Even though `<strong>` is over `<p>` element, `bold=\"true\"` was added to the text. See\n * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#attributeToAttribute} for comparison.\n *\n * Keep in mind that the attribute will be set only if it is allowed by {@link module:engine/model/schema~Schema schema} configuration.\n *\n * ```ts\n * editor.conversion.for( 'upcast' ).elementToAttribute( {\n * \tview: 'strong',\n * \tmodel: 'bold'\n * } );\n *\n * editor.conversion.for( 'upcast' ).elementToAttribute( {\n * \tview: 'strong',\n * \tmodel: 'bold',\n * \tconverterPriority: 'high'\n * } );\n *\n * editor.conversion.for( 'upcast' ).elementToAttribute( {\n * \tview: {\n * \t\tname: 'span',\n * \t\tclasses: 'bold'\n * \t},\n * \tmodel: 'bold'\n * } );\n *\n * editor.conversion.for( 'upcast' ).elementToAttribute( {\n * \tview: {\n * \t\tname: 'span',\n * \t\tclasses: [ 'styled', 'styled-dark' ]\n * \t},\n * \tmodel: {\n * \t\tkey: 'styled',\n * \t\tvalue: 'dark'\n * \t}\n * } );\n *\n * editor.conversion.for( 'upcast' ).elementToAttribute( {\n * \tview: {\n * \t\tname: 'span',\n * \t\tstyles: {\n * \t\t\t'font-size': /[\\s\\S]+/\n * \t\t}\n * \t},\n * \tmodel: {\n * \t\tkey: 'fontSize',\n * \t\tvalue: ( viewElement, conversionApi ) => {\n * \t\t\tconst fontSize = viewElement.getStyle( 'font-size' );\n * \t\t\tconst value = fontSize.substr( 0, fontSize.length - 2 );\n *\n * \t\t\tif ( value <= 10 ) {\n * \t\t\t\treturn 'small';\n * \t\t\t} else if ( value > 12 ) {\n * \t\t\t\treturn 'big';\n * \t\t\t}\n *\n * \t\t\treturn null;\n * \t\t}\n * \t}\n * } );\n * ```\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n * to the conversion process.\n *\n * @param config Conversion configuration.\n * @param config.view Pattern matching all view elements which should be converted.\n * @param config.model Model attribute key or an object with `key` and `value` properties, describing\n * the model attribute. `value` property may be set as a function that takes a view element and\n * {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API} and returns the value.\n * If `String` is given, the model attribute value will be set to `true`.\n * @param config.converterPriority Converter priority. Defaults to `low`.\n */\n elementToAttribute(config) {\n return this.add(upcastElementToAttribute(config));\n }\n /**\n * View attribute to model attribute conversion helper.\n *\n * This conversion results in setting an attribute on a model node. For example, view `<img src=\"foo.jpg\"></img>` becomes\n * `<imageBlock source=\"foo.jpg\"></imageBlock>` in the model.\n *\n * This helper is meant to convert view attributes from view elements which got converted to the model, so the view attribute\n * is set only on the corresponding model node:\n *\n * ```\n * <div class=\"dark\"><div>foo</div></div> --> <div dark=\"true\"><div>foo</div></div>\n * ```\n *\n * Above, `class=\"dark\"` attribute is added only to the `<div>` elements that has it. This is in contrary to\n * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToAttribute} which sets attributes for\n * all the children in the model:\n *\n * ```\n * <strong>Foo</strong> --> <strong><p>Foo</p></strong> --> <paragraph><$text bold=\"true\">Foo</$text></paragraph>\n * ```\n *\n * Above is a sample of HTML code, that goes through autoparagraphing (first step) and then is converted (second step).\n * Even though `<strong>` is over `<p>` element, `bold=\"true\"` was added to the text.\n *\n * Keep in mind that the attribute will be set only if it is allowed by {@link module:engine/model/schema~Schema schema} configuration.\n *\n * ```ts\n * editor.conversion.for( 'upcast' ).attributeToAttribute( {\n * \tview: 'src',\n * \tmodel: 'source'\n * } );\n *\n * editor.conversion.for( 'upcast' ).attributeToAttribute( {\n * \tview: { key: 'src' },\n * \tmodel: 'source'\n * } );\n *\n * editor.conversion.for( 'upcast' ).attributeToAttribute( {\n * \tview: { key: 'src' },\n * \tmodel: 'source',\n * \tconverterPriority: 'normal'\n * } );\n *\n * editor.conversion.for( 'upcast' ).attributeToAttribute( {\n * \tview: {\n * \t\tkey: 'data-style',\n * \t\tvalue: /[\\s\\S]+/\n * \t},\n * \tmodel: 'styled'\n * } );\n *\n * editor.conversion.for( 'upcast' ).attributeToAttribute( {\n * \tview: {\n * \t\tname: 'img',\n * \t\tkey: 'class',\n * \t\tvalue: 'styled-dark'\n * \t},\n * \tmodel: {\n * \t\tkey: 'styled',\n * \t\tvalue: 'dark'\n * \t}\n * } );\n *\n * editor.conversion.for( 'upcast' ).attributeToAttribute( {\n * \tview: {\n * \t\tkey: 'class',\n * \t\tvalue: /styled-[\\S]+/\n * \t},\n * \tmodel: {\n * \t\tkey: 'styled'\n * \t\tvalue: ( viewElement, conversionApi ) => {\n * \t\t\tconst regexp = /styled-([\\S]+)/;\n * \t\t\tconst match = viewElement.getAttribute( 'class' ).match( regexp );\n *\n * \t\t\treturn match[ 1 ];\n * \t\t}\n * \t}\n * } );\n * ```\n *\n * Converting styles works a bit differently as it requires `view.styles` to be an object and by default\n * a model attribute will be set to `true` by such a converter. You can set the model attribute to any value by providing the `value`\n * callback that returns the desired value.\n *\n * ```ts\n * // Default conversion of font-weight style will result in setting bold attribute to true.\n * editor.conversion.for( 'upcast' ).attributeToAttribute( {\n * \tview: {\n * \t\tstyles: {\n * \t\t\t'font-weight': 'bold'\n * \t\t}\n * \t},\n * \tmodel: 'bold'\n * } );\n *\n * // This converter will pass any style value to the `lineHeight` model attribute.\n * editor.conversion.for( 'upcast' ).attributeToAttribute( {\n * \tview: {\n * \t\tstyles: {\n * \t\t\t'line-height': /[\\s\\S]+/\n * \t\t}\n * \t},\n * \tmodel: {\n * \t\tkey: 'lineHeight',\n * \t\tvalue: ( viewElement, conversionApi ) => viewElement.getStyle( 'line-height' )\n * \t}\n * } );\n * ```\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n * to the conversion process.\n *\n * @param config Conversion configuration.\n * @param config.view Specifies which view attribute will be converted. If a `String` is passed,\n * attributes with given key will be converted. If an `Object` is passed, it must have a required `key` property,\n * specifying view attribute key, and may have an optional `value` property, specifying view attribute value and optional `name`\n * property specifying a view element name from/on which the attribute should be converted. `value` can be given as a `String`,\n * a `RegExp` or a function callback, that takes view attribute value as the only parameter and returns `Boolean`.\n * @param config.model Model attribute key or an object with `key` and `value` properties, describing\n * the model attribute. `value` property may be set as a function that takes a view element and\n * {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API} and returns the value.\n * If `String` is given, the model attribute value will be same as view attribute value.\n * @param config.converterPriority Converter priority. Defaults to `low`.\n */\n attributeToAttribute(config) {\n return this.add(upcastAttributeToAttribute(config));\n }\n /**\n * View element to model marker conversion helper.\n *\n * This conversion results in creating a model marker. For example, if the marker was stored in a view as an element:\n * `<p>Fo<span data-marker=\"comment\" data-comment-id=\"7\"></span>o</p><p>B<span data-marker=\"comment\" data-comment-id=\"7\"></span>ar</p>`,\n * after the conversion is done, the marker will be available in\n * {@link module:engine/model/model~Model#markers model document markers}.\n *\n * **Note**: When this helper is used in the data upcast in combination with\n * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToData `#markerToData()`} in the data downcast,\n * then invalid HTML code (e.g. a span between table cells) may be produced by the latter converter.\n *\n * In most of the cases, the {@link #dataToMarker} should be used instead.\n *\n * ```ts\n * editor.conversion.for( 'upcast' ).elementToMarker( {\n * \tview: 'marker-search',\n * \tmodel: 'search'\n * } );\n *\n * editor.conversion.for( 'upcast' ).elementToMarker( {\n * \tview: 'marker-search',\n * \tmodel: 'search',\n * \tconverterPriority: 'high'\n * } );\n *\n * editor.conversion.for( 'upcast' ).elementToMarker( {\n * \tview: 'marker-search',\n * \tmodel: ( viewElement, conversionApi ) => 'comment:' + viewElement.getAttribute( 'data-comment-id' )\n * } );\n *\n * editor.conversion.for( 'upcast' ).elementToMarker( {\n * \tview: {\n * \t\tname: 'span',\n * \t\tattributes: {\n * \t\t\t'data-marker': 'search'\n * \t\t}\n * \t},\n * \tmodel: 'search'\n * } );\n * ```\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n * to the conversion process.\n *\n * @param config Conversion configuration.\n * @param config.view Pattern matching all view elements which should be converted.\n * @param config.model Name of the model marker, or a function that takes a view element and returns\n * a model marker name.\n * @param config.converterPriority Converter priority.\n */\n elementToMarker(config) {\n return this.add(upcastElementToMarker(config));\n }\n /**\n * View-to-model marker conversion helper.\n *\n * Converts view data created by {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToData `#markerToData()`}\n * back to a model marker.\n *\n * This converter looks for specific view elements and view attributes that mark marker boundaries. See\n * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToData `#markerToData()`} to learn what view data\n * is expected by this converter.\n *\n * The `config.view` property is equal to the marker group name to convert.\n *\n * By default, this converter creates markers with the `group:name` name convention (to match the default `markerToData` conversion).\n *\n * The conversion configuration can take a function that will generate a marker name.\n * If such function is set as the `config.model` parameter, it is passed the `name` part from the view element or attribute and it is\n * expected to return a string with the marker name.\n *\n * Basic usage:\n *\n * ```ts\n * // Using the default conversion.\n * // In this case, all markers from the `comment` group will be converted.\n * // The conversion will look for `<comment-start>` and `<comment-end>` tags and\n * // `data-comment-start-before`, `data-comment-start-after`,\n * // `data-comment-end-before` and `data-comment-end-after` attributes.\n * editor.conversion.for( 'upcast' ).dataToMarker( {\n * \tview: 'comment'\n * } );\n * ```\n *\n * An example of a model that may be generated by this conversion:\n *\n * ```\n * // View:\n * <p>Foo<comment-start name=\"commentId:uid\"></comment-start>bar</p>\n * <figure data-comment-end-after=\"commentId:uid\" class=\"image\"><img src=\"abc.jpg\" /></figure>\n *\n * // Model:\n * <paragraph>Foo[bar</paragraph>\n * <imageBlock src=\"abc.jpg\"></imageBlock>]\n * ```\n *\n * Where `[]` are boundaries of a marker that will receive the `comment:commentId:uid` name.\n *\n * Other examples of usage:\n *\n * ```ts\n * // Using a custom function which is the same as the default conversion:\n * editor.conversion.for( 'upcast' ).dataToMarker( {\n * \tview: 'comment',\n * \tmodel: ( name, conversionApi ) => 'comment:' + name,\n * } );\n *\n * // Using the converter priority:\n * editor.conversion.for( 'upcast' ).dataToMarker( {\n * \tview: 'comment',\n * \tmodel: ( name, conversionApi ) => 'comment:' + name,\n * \tconverterPriority: 'high'\n * } );\n * ```\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n * to the conversion process.\n *\n * @param config Conversion configuration.\n * @param config.view The marker group name to convert.\n * @param config.model A function that takes the `name` part from the view element or attribute and\n * {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi upcast conversion API} and returns the marker name.\n * @param config.converterPriority Converter priority.\n */\n dataToMarker(config) {\n return this.add(upcastDataToMarker(config));\n }\n}\n/**\n * Function factory, creates a converter that converts {@link module:engine/view/documentfragment~DocumentFragment view document fragment}\n * or all children of {@link module:engine/view/element~Element} into\n * {@link module:engine/model/documentfragment~DocumentFragment model document fragment}.\n * This is the \"entry-point\" converter for upcast (view to model conversion). This converter starts the conversion of all children\n * of passed view document fragment. Those children {@link module:engine/view/node~Node view nodes} are then handled by other converters.\n *\n * This also a \"default\", last resort converter for all view elements that has not been converted by other converters.\n * When a view element is being converted to the model but it does not have converter specified, that view element\n * will be converted to {@link module:engine/model/documentfragment~DocumentFragment model document fragment} and returned.\n *\n * @returns Universal converter for view {@link module:engine/view/documentfragment~DocumentFragment fragments} and\n * {@link module:engine/view/element~Element elements} that returns\n * {@link module:engine/model/documentfragment~DocumentFragment model fragment} with children of converted view item.\n */\nexport function convertToModelFragment() {\n return (evt, data, conversionApi) => {\n // Second argument in `consumable.consume` is discarded for ViewDocumentFragment but is needed for ViewElement.\n if (!data.modelRange && conversionApi.consumable.consume(data.viewItem, { name: true })) {\n const { modelRange, modelCursor } = conversionApi.convertChildren(data.viewItem, data.modelCursor);\n data.modelRange = modelRange;\n data.modelCursor = modelCursor;\n }\n };\n}\n/**\n * Function factory, creates a converter that converts {@link module:engine/view/text~Text} to {@link module:engine/model/text~Text}.\n *\n * @returns {@link module:engine/view/text~Text View text} converter.\n */\nexport function convertText() {\n return (evt, data, { schema, consumable, writer }) => {\n let position = data.modelCursor;\n // When node is already converted then do nothing.\n if (!consumable.test(data.viewItem)) {\n return;\n }\n if (!schema.checkChild(position, '$text')) {\n if (!isParagraphable(position, '$text', schema)) {\n return;\n }\n // Do not auto-paragraph whitespaces.\n if (data.viewItem.data.trim().length == 0) {\n return;\n }\n // Wrap `$text` in paragraph and include any marker that is directly before `$text`. See #13053.\n const nodeBefore = position.nodeBefore;\n position = wrapInParagraph(position, writer);\n if (nodeBefore && nodeBefore.is('element', '$marker')) {\n // Move `$marker` to the paragraph.\n writer.move(writer.createRangeOn(nodeBefore), position);\n position = writer.createPositionAfter(nodeBefore);\n }\n }\n consumable.consume(data.viewItem);\n const text = writer.createText(data.viewItem.data);\n writer.insert(text, position);\n data.modelRange = writer.createRange(position, position.getShiftedBy(text.offsetSize));\n data.modelCursor = data.modelRange.end;\n };\n}\n/**\n * Function factory, creates a callback function which converts a {@link module:engine/view/selection~Selection\n * view selection} taken from the {@link module:engine/view/document~Document#event:selectionChange} event\n * and sets in on the {@link module:engine/model/document~Document#selection model}.\n *\n * **Note**: because there is no view selection change dispatcher nor any other advanced view selection to model\n * conversion mechanism, the callback should be set directly on view document.\n *\n * ```ts\n * view.document.on( 'selectionChange', convertSelectionChange( modelDocument, mapper ) );\n * ```\n *\n * @param model Data model.\n * @param mapper Conversion mapper.\n * @returns {@link module:engine/view/document~Document#event:selectionChange} callback function.\n */\nexport function convertSelectionChange(model, mapper) {\n return (evt, data) => {\n const viewSelection = data.newSelection;\n const ranges = [];\n for (const viewRange of viewSelection.getRanges()) {\n ranges.push(mapper.toModelRange(viewRange));\n }\n const modelSelection = model.createSelection(ranges, { backward: viewSelection.isBackward });\n if (!modelSelection.isEqual(model.document.selection)) {\n model.change(writer => {\n writer.setSelection(modelSelection);\n });\n }\n };\n}\n/**\n * View element to model element conversion helper.\n *\n * See {@link ~UpcastHelpers#elementToElement `.elementToElement()` upcast helper} for examples.\n *\n * @param config Conversion configuration.\n * @param config.view Pattern matching all view elements which should be converted. If not\n * set, the converter will fire for every view element.\n * @param config.model Name of the model element, a model element\n * instance or a function that takes a view element and returns a model element. The model element will be inserted in the model.\n * @param config.converterPriority Converter priority.\n * @returns Conversion helper.\n */\nfunction upcastElementToElement(config) {\n config = cloneDeep(config);\n const converter = prepareToElementConverter(config);\n const elementName = getViewElementNameFromConfig(config.view);\n const eventName = elementName ? `element:${elementName}` : 'element';\n return (dispatcher) => {\n dispatcher.on(eventName, converter, { priority: config.converterPriority || 'normal' });\n };\n}\n/**\n * View element to model attribute conversion helper.\n *\n * See {@link ~UpcastHelpers#elementToAttribute `.elementToAttribute()` upcast helper} for examples.\n *\n * @param config Conversion configuration.\n * @param config.view Pattern matching all view elements which should be converted.\n * @param config.model Model attribute key or an object with `key` and `value` properties, describing\n * the model attribute. `value` property may be set as a function that takes a view element and returns the value.\n * If `String` is given, the model attribute value will be set to `true`.\n * @param config.converterPriority Converter priority. Defaults to `low`.\n * @returns Conversion helper.\n */\nfunction upcastElementToAttribute(config) {\n config = cloneDeep(config);\n normalizeModelAttributeConfig(config);\n const converter = prepareToAttributeConverter(config, false);\n const elementName = getViewElementNameFromConfig(config.view);\n const eventName = elementName ? `element:${elementName}` : 'element';\n return (dispatcher) => {\n dispatcher.on(eventName, converter, { priority: config.converterPriority || 'low' });\n };\n}\n/**\n * View attribute to model attribute conversion helper.\n *\n * See {@link ~UpcastHelpers#attributeToAttribute `.attributeToAttribute()` upcast helper} for examples.\n *\n * @param config Conversion configuration.\n * @param config.view Specifies which view attribute will be converted. If a `String` is passed,\n * attributes with given key will be converted. If an `Object` is passed, it must have a required `key` property,\n * specifying view attribute key, and may have an optional `value` property, specifying view attribute value and optional `name`\n * property specifying a view element name from/on which the attribute should be converted. `value` can be given as a `String`,\n * a `RegExp` or a function callback, that takes view attribute value as the only parameter and returns `Boolean`.\n * @param config.model Model attribute key or an object with `key` and `value` properties, describing\n * the model attribute. `value` property may be set as a function that takes a view element and returns the value.\n * If `String` is given, the model attribute value will be same as view attribute value.\n * @param config.converterPriority Converter priority. Defaults to `low`.\n * @returns Conversion helper.\n */\nfunction upcastAttributeToAttribute(config) {\n config = cloneDeep(config);\n let viewKey = null;\n if (typeof config.view == 'string' || config.view.key) {\n viewKey = normalizeViewAttributeKeyValueConfig(config);\n }\n normalizeModelAttributeConfig(config, viewKey);\n const converter = prepareToAttributeConverter(config, true);\n return (dispatcher) => {\n dispatcher.on('element', converter, { priority: config.converterPriority || 'low' });\n };\n}\n/**\n * View element to model marker conversion helper.\n *\n * See {@link ~UpcastHelpers#elementToMarker `.elementToMarker()` upcast helper} for examples.\n *\n * @param config Conversion configuration.\n * @param config.view Pattern matching all view elements which should be converted.\n * @param config.model Name of the model marker, or a function that takes a view element and returns\n * a model marker name.\n * @param config.converterPriority Converter priority.\n * @returns Conversion helper.\n */\nfunction upcastElementToMarker(config) {\n const model = normalizeElementToMarkerModelConfig(config.model);\n return upcastElementToElement({ ...config, model });\n}\n/**\n * View data to model marker conversion helper.\n *\n * See {@link ~UpcastHelpers#dataToMarker} to learn more.\n *\n * @returns Conversion helper.\n */\nfunction upcastDataToMarker(config) {\n config = cloneDeep(config);\n // Default conversion.\n if (!config.model) {\n config.model = name => {\n return name ? config.view + ':' + name : config.view;\n };\n }\n const normalizedConfig = {\n view: config.view,\n model: config.model\n };\n const converterStart = prepareToElementConverter(normalizeDataToMarkerConfig(normalizedConfig, 'start'));\n const converterEnd = prepareToElementConverter(normalizeDataToMarkerConfig(normalizedConfig, 'end'));\n return (dispatcher) => {\n dispatcher.on(`element:${config.view}-start`, converterStart, { priority: config.converterPriority || 'normal' });\n dispatcher.on(`element:${config.view}-end`, converterEnd, { priority: config.converterPriority || 'normal' });\n // Below is a hack that is needed to properly handle `converterPriority` for both elements and attributes.\n // Attribute conversion needs to be performed *after* element conversion.\n // This converter handles both element conversion and attribute conversion, which means that if a single\n // `config.converterPriority` is used, it will lead to problems. For example, if the `'high'` priority is used,\n // the attribute conversion will be performed before a lot of element upcast converters.\n // On the other hand, we want to support `config.converterPriority` and converter overwriting.\n //\n // To make it work, we need to do some extra processing for priority for attribute converter.\n // Priority `'low'` value should be the base value and then we will change it depending on `config.converterPriority` value.\n //\n // This hack probably would not be needed if attributes are upcasted separately.\n //\n const basePriority = priorities.get('low');\n const maxPriority = priorities.get('highest');\n const priorityFactor = priorities.get(config.converterPriority) / maxPriority; // Number in range [ -1, 1 ].\n dispatcher.on('element', upcastAttributeToMarker(normalizedConfig), { priority: basePriority + priorityFactor });\n };\n}\n/**\n * Function factory, returns a callback function which converts view attributes to a model marker.\n *\n * The converter looks for elements with `data-group-start-before`, `data-group-start-after`, `data-group-end-before`\n * and `data-group-end-after` attributes and inserts `$marker` model elements before/after those elements.\n * `group` part is specified in `config.view`.\n *\n * @returns Marker converter.\n */\nfunction upcastAttributeToMarker(config) {\n return (evt, data, conversionApi) => {\n const attrName = `data-${config.view}`;\n // Check if any attribute for the given view item can be consumed before changing the conversion data\n // and consuming view items with these attributes.\n if (!conversionApi.consumable.test(data.viewItem, { attributes: attrName + '-end-after' }) &&\n !conversionApi.consumable.test(data.viewItem, { attributes: attrName + '-start-after' }) &&\n !conversionApi.consumable.test(data.viewItem, { attributes: attrName + '-end-before' }) &&\n !conversionApi.consumable.test(data.viewItem, { attributes: attrName + '-start-before' })) {\n return;\n }\n // This converter wants to add a model element, marking a marker, before/after an element (or maybe even group of elements).\n // To do that, we can use `data.modelRange` which is set on an element (or a group of elements) that has been upcasted.\n // But, if the processed view element has not been upcasted yet (it does not have been converted), we need to\n // fire conversion for its children first, then we will have `data.modelRange` available.\n if (!data.modelRange) {\n Object.assign(data, conversionApi.convertChildren(data.viewItem, data.modelCursor));\n }\n if (conversionApi.consumable.consume(data.viewItem, { attributes: attrName + '-end-after' })) {\n addMarkerElements(data.modelRange.end, data.viewItem.getAttribute(attrName + '-end-after').split(','));\n }\n if (conversionApi.consumable.consume(data.viewItem, { attributes: attrName + '-start-after' })) {\n addMarkerElements(data.modelRange.end, data.viewItem.getAttribute(attrName + '-start-after').split(','));\n }\n if (conversionApi.consumable.consume(data.viewItem, { attributes: attrName + '-end-before' })) {\n addMarkerElements(data.modelRange.start, data.viewItem.getAttribute(attrName + '-end-before').split(','));\n }\n if (conversionApi.consumable.consume(data.viewItem, { attributes: attrName + '-start-before' })) {\n addMarkerElements(data.modelRange.start, data.viewItem.getAttribute(attrName + '-start-before').split(','));\n }\n function addMarkerElements(position, markerViewNames) {\n for (const markerViewName of markerViewNames) {\n const markerName = config.model(markerViewName, conversionApi);\n const element = conversionApi.writer.createElement('$marker', { 'data-name': markerName });\n conversionApi.writer.insert(element, position);\n if (data.modelCursor.isEqual(position)) {\n data.modelCursor = data.modelCursor.getShiftedBy(1);\n }\n else {\n data.modelCursor = data.modelCursor._getTransformedByInsertion(position, 1);\n }\n data.modelRange = data.modelRange._getTransformedByInsertion(position, 1)[0];\n }\n }\n };\n}\n/**\n * Helper function for from-view-element conversion. Checks if `config.view` directly specifies converted view element's name\n * and if so, returns it.\n *\n * @param config Conversion view config.\n * @returns View element name or `null` if name is not directly set.\n */\nfunction getViewElementNameFromConfig(viewConfig) {\n if (typeof viewConfig == 'string') {\n return viewConfig;\n }\n if (typeof viewConfig == 'object' && typeof viewConfig.name == 'string') {\n return viewConfig.name;\n }\n return null;\n}\n/**\n * Helper for to-model-element conversion. Takes a config object and returns a proper converter function.\n *\n * @param config Conversion configuration.\n * @returns View to model converter.\n */\nfunction prepareToElementConverter(config) {\n const matcher = new Matcher(config.view);\n return (evt, data, conversionApi) => {\n const matcherResult = matcher.match(data.viewItem);\n if (!matcherResult) {\n return;\n }\n const match = matcherResult.match;\n // Force consuming element's name.\n match.name = true;\n if (!conversionApi.consumable.test(data.viewItem, match)) {\n return;\n }\n const modelElement = getModelElement(config.model, data.viewItem, conversionApi);\n if (!modelElement) {\n return;\n }\n if (!conversionApi.safeInsert(modelElement, data.modelCursor)) {\n return;\n }\n conversionApi.consumable.consume(data.viewItem, match);\n conversionApi.convertChildren(data.viewItem, modelElement);\n conversionApi.updateConversionResult(modelElement, data);\n };\n}\n/**\n * Helper function for upcasting-to-element converter. Takes the model configuration, the converted view element\n * and a writer instance and returns a model element instance to be inserted in the model.\n *\n * @param model Model conversion configuration.\n * @param input The converted view node.\n * @param conversionApi The upcast conversion API.\n */\nfunction getModelElement(model, input, conversionApi) {\n if (model instanceof Function) {\n return model(input, conversionApi);\n }\n else {\n return conversionApi.writer.createElement(model);\n }\n}\n/**\n * Helper function view-attribute-to-model-attribute helper. Normalizes `config.view` which was set as `String` or\n * as an `Object` with `key`, `value` and `name` properties. Normalized `config.view` has is compatible with\n * {@link module:engine/view/matcher~MatcherPattern}.\n *\n * @param config Conversion config.\n * @returns Key of the converted view attribute.\n */\nfunction normalizeViewAttributeKeyValueConfig(config) {\n if (typeof config.view == 'string') {\n config.view = { key: config.view };\n }\n const key = config.view.key;\n let normalized;\n if (key == 'class' || key == 'style') {\n const keyName = key == 'class' ? 'classes' : 'styles';\n normalized = {\n [keyName]: config.view.value\n };\n }\n else {\n const value = typeof config.view.value == 'undefined' ? /[\\s\\S]*/ : config.view.value;\n normalized = {\n attributes: {\n [key]: value\n }\n };\n }\n if (config.view.name) {\n normalized.name = config.view.name;\n }\n config.view = normalized;\n return key;\n}\n/**\n * Helper function that normalizes `config.model` in from-model-attribute conversion. `config.model` can be set\n * as a `String`, an `Object` with only `key` property or an `Object` with `key` and `value` properties. Normalized\n * `config.model` is an `Object` with `key` and `value` properties.\n *\n * @param config Conversion config.\n * @param viewAttributeKeyToCopy Key of the converted view attribute. If it is set, model attribute value\n * will be equal to view attribute value.\n */\nfunction normalizeModelAttributeConfig(config, viewAttributeKeyToCopy = null) {\n const defaultModelValue = viewAttributeKeyToCopy === null ? true :\n (viewElement) => viewElement.getAttribute(viewAttributeKeyToCopy);\n const key = typeof config.model != 'object' ? config.model : config.model.key;\n const value = typeof config.model != 'object' || typeof config.model.value == 'undefined' ? defaultModelValue : config.model.value;\n config.model = { key, value };\n}\n/**\n * Helper for to-model-attribute conversion. Takes the model attribute name and conversion configuration and returns\n * a proper converter function.\n *\n * @param config Conversion configuration. It is possible to provide multiple configurations in an array.\n * @param shallow If set to `true` the attribute will be set only on top-level nodes. Otherwise, it will be set\n * on all elements in the range.\n */\nfunction prepareToAttributeConverter(config, shallow) {\n const matcher = new Matcher(config.view);\n return (evt, data, conversionApi) => {\n // Converting an attribute of an element that has not been converted to anything does not make sense\n // because there will be nowhere to set that attribute on. At this stage, the element should've already\n // been converted (https://github.com/ckeditor/ckeditor5/issues/11000).\n if (!data.modelRange && shallow) {\n return;\n }\n const match = matcher.match(data.viewItem);\n // If there is no match, this callback should not do anything.\n if (!match) {\n return;\n }\n if (onlyViewNameIsDefined(config.view, data.viewItem)) {\n match.match.name = true;\n }\n else {\n // Do not test `name` consumable because it could get consumed already while upcasting some other attribute\n // on the same element (for example <span class=\"big\" style=\"color: red\">foo</span>).\n delete match.match.name;\n }\n // Try to consume appropriate values from consumable values list.\n if (!conversionApi.consumable.test(data.viewItem, match.match)) {\n return;\n }\n const modelKey = config.model.key;\n const modelValue = typeof config.model.value == 'function' ?\n config.model.value(data.viewItem, conversionApi) : config.model.value;\n // Do not convert if attribute building function returned falsy value.\n if (modelValue === null) {\n return;\n }\n // Since we are converting to attribute we need a range on which we will set the attribute.\n // If the range is not created yet, let's create it by converting children of the current node first.\n if (!data.modelRange) {\n // Convert children and set conversion result as a current data.\n Object.assign(data, conversionApi.convertChildren(data.viewItem, data.modelCursor));\n }\n // Set attribute on current `output`. `Schema` is checked inside this helper function.\n const attributeWasSet = setAttributeOn(data.modelRange, { key: modelKey, value: modelValue }, shallow, conversionApi);\n // It may happen that a converter will try to set an attribute that is not allowed in the given context.\n // In such a situation we cannot consume the attribute. See: https://github.com/ckeditor/ckeditor5/pull/9249#issuecomment-815658459.\n if (attributeWasSet) {\n // Verify if the element itself wasn't consumed yet. It could be consumed already while upcasting some other attribute\n // on the same element (for example <span class=\"big\" style=\"color: red\">foo</span>).\n // We need to consume it so other features (especially GHS) won't try to convert it.\n // Note that it's not tested by the other element-to-attribute converters whether an element was consumed before\n // (in case of converters that the element itself is just a context and not the primary information to convert).\n if (conversionApi.consumable.test(data.viewItem, { name: true })) {\n match.match.name = true;\n }\n conversionApi.consumable.consume(data.viewItem, match.match);\n }\n };\n}\n/**\n * Helper function that checks if element name should be consumed in attribute converters.\n *\n * @param viewConfig Conversion view config.\n */\nfunction onlyViewNameIsDefined(viewConfig, viewItem) {\n // https://github.com/ckeditor/ckeditor5-engine/issues/1786\n const configToTest = typeof viewConfig == 'function' ? viewConfig(viewItem) : viewConfig;\n if (typeof configToTest == 'object' && !getViewElementNameFromConfig(configToTest)) {\n return false;\n }\n return !configToTest.classes && !configToTest.attributes && !configToTest.styles;\n}\n/**\n * Helper function for to-model-attribute converter. Sets model attribute on given range. Checks {@link module:engine/model/schema~Schema}\n * to ensure proper model structure.\n *\n * If any node on the given range has already defined an attribute with the same name, its value will not be updated.\n *\n * @param modelRange Model range on which attribute should be set.\n * @param modelAttribute Model attribute to set.\n * @param conversionApi Conversion API.\n * @param shallow If set to `true` the attribute will be set only on top-level nodes. Otherwise, it will be set\n * on all elements in the range.\n * @returns `true` if attribute was set on at least one node from given `modelRange`.\n */\nfunction setAttributeOn(modelRange, modelAttribute, shallow, conversionApi) {\n let result = false;\n // Set attribute on each item in range according to Schema.\n for (const node of Array.from(modelRange.getItems({ shallow }))) {\n // Skip if not allowed.\n if (!conversionApi.schema.checkAttribute(node, modelAttribute.key)) {\n continue;\n }\n // Mark the node as consumed even if the attribute will not be updated because it's in a valid context (schema)\n // and would be converted if the attribute wouldn't be present. See #8921.\n result = true;\n // Do not override the attribute if it's already present.\n if (node.hasAttribute(modelAttribute.key)) {\n continue;\n }\n conversionApi.writer.setAttribute(modelAttribute.key, modelAttribute.value, node);\n }\n return result;\n}\n/**\n * Helper function for upcasting-to-marker conversion. Takes the config in a format requested by `upcastElementToMarker()`\n * function and converts it to a format that is supported by `upcastElementToElement()` function.\n */\nfunction normalizeElementToMarkerModelConfig(model) {\n return (viewElement, conversionApi) => {\n const markerName = typeof model == 'string' ? model : model(viewElement, conversionApi);\n return conversionApi.writer.createElement('$marker', { 'data-name': markerName });\n };\n}\n/**\n * Helper function for upcasting-to-marker conversion. Takes the config in a format requested by `upcastDataToMarker()`\n * function and converts it to a format that is supported by `upcastElementToElement()` function.\n */\nfunction normalizeDataToMarkerConfig(config, type) {\n const elementCreatorFunction = (viewElement, conversionApi) => {\n const viewName = viewElement.getAttribute('name');\n const markerName = config.model(viewName, conversionApi);\n return conversionApi.writer.createElement('$marker', { 'data-name': markerName });\n };\n return {\n // Upcast <markerGroup-start> and <markerGroup-end> elements.\n view: `${config.view}-${type}`,\n model: elementCreatorFunction\n };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/utils/selection-post-fixer\n */\nimport Position from '../position';\nimport Range from '../range';\n/**\n * Injects selection post-fixer to the model.\n *\n * The role of the selection post-fixer is to ensure that the selection is in a correct place\n * after a {@link module:engine/model/model~Model#change `change()`} block was executed.\n *\n * The correct position means that:\n *\n * * All collapsed selection ranges are in a place where the {@link module:engine/model/schema~Schema}\n * allows a `$text`.\n * * None of the selection's non-collapsed ranges crosses a {@link module:engine/model/schema~Schema#isLimit limit element}\n * boundary (a range must be rooted within one limit element).\n * * Only {@link module:engine/model/schema~Schema#isSelectable selectable elements} can be selected from the outside\n * (e.g. `[<paragraph>foo</paragraph>]` is invalid). This rule applies independently to both selection ends, so this\n * selection is correct: `<paragraph>f[oo</paragraph><imageBlock></imageBlock>]`.\n *\n * If the position is not correct, the post-fixer will automatically correct it.\n *\n * ## Fixing a non-collapsed selection\n *\n * See as an example a selection that starts in a P1 element and ends inside the text of a TD element\n * (`[` and `]` are range boundaries and `(l)` denotes an element defined as `isLimit=true`):\n *\n * ```\n * root\n * |- element P1\n * | |- \"foo\" root\n * |- element TABLE (l) P1 TABLE P2\n * | |- element TR (l) f o[o TR TR b a r\n * | | |- element TD (l) TD TD\n * | | |- \"aaa\" a]a a b b b\n * | |- element TR (l)\n * | | |- element TD (l) ||\n * | | |- \"bbb\" ||\n * |- element P2 VV\n * | |- \"bar\"\n * root\n * P1 TABLE] P2\n * f o[o TR TR b a r\n * TD TD\n * a a a b b b\n * ```\n *\n * In the example above, the TABLE, TR and TD are defined as `isLimit=true` in the schema. The range which is not contained within\n * a single limit element must be expanded to select the outermost limit element. The range end is inside the text node of the TD element.\n * As the TD element is a child of the TR and TABLE elements, where both are defined as `isLimit=true` in the schema, the range must be\n * expanded to select the whole TABLE element.\n *\n * **Note** If the selection contains multiple ranges, the method returns a minimal set of ranges that are not intersecting after expanding\n * them to select `isLimit=true` elements.\n */\nexport function injectSelectionPostFixer(model) {\n model.document.registerPostFixer(writer => selectionPostFixer(writer, model));\n}\n/**\n * The selection post-fixer.\n */\nfunction selectionPostFixer(writer, model) {\n const selection = model.document.selection;\n const schema = model.schema;\n const ranges = [];\n let wasFixed = false;\n for (const modelRange of selection.getRanges()) {\n // Go through all ranges in selection and try fixing each of them.\n // Those ranges might overlap but will be corrected later.\n const correctedRange = tryFixingRange(modelRange, schema);\n // \"Selection fixing\" algorithms sometimes get lost. In consequence, it may happen\n // that a new range is returned but, in fact, it has the same positions as the original\n // range anyway. If this range is not discarded, a new selection will be set and that,\n // for instance, would destroy the selection attributes. Let's make sure that the post-fixer\n // actually worked first before setting a new selection.\n //\n // https://github.com/ckeditor/ckeditor5/issues/6693\n if (correctedRange && !correctedRange.isEqual(modelRange)) {\n ranges.push(correctedRange);\n wasFixed = true;\n }\n else {\n ranges.push(modelRange);\n }\n }\n // If any of ranges were corrected update the selection.\n if (wasFixed) {\n writer.setSelection(mergeIntersectingRanges(ranges), { backward: selection.isBackward });\n }\n return false;\n}\n/**\n * Tries fixing a range if it's incorrect.\n *\n * **Note:** This helper is used by the selection post-fixer and to fix the `beforeinput` target ranges.\n *\n * @returns Returns fixed range or null if range is valid.\n */\nexport function tryFixingRange(range, schema) {\n if (range.isCollapsed) {\n return tryFixingCollapsedRange(range, schema);\n }\n return tryFixingNonCollapsedRage(range, schema);\n}\n/**\n * Tries to fix collapsed ranges.\n *\n * * Fixes situation when a range is in a place where $text is not allowed\n *\n * @param range Collapsed range to fix.\n * @returns Returns fixed range or null if range is valid.\n */\nfunction tryFixingCollapsedRange(range, schema) {\n const originalPosition = range.start;\n const nearestSelectionRange = schema.getNearestSelectionRange(originalPosition);\n // This might be null, i.e. when the editor data is empty or the selection is inside a limit element\n // that doesn't allow text inside.\n // In the first case, there is no need to fix the selection range.\n // In the second, let's go up to the outer selectable element\n if (!nearestSelectionRange) {\n const ancestorObject = originalPosition.getAncestors().reverse().find((item) => schema.isObject(item));\n if (ancestorObject) {\n return Range._createOn(ancestorObject);\n }\n return null;\n }\n if (!nearestSelectionRange.isCollapsed) {\n return nearestSelectionRange;\n }\n const fixedPosition = nearestSelectionRange.start;\n // Fixed position is the same as original - no need to return corrected range.\n if (originalPosition.isEqual(fixedPosition)) {\n return null;\n }\n return new Range(fixedPosition);\n}\n/**\n * Tries to fix an expanded range.\n *\n * @param range Expanded range to fix.\n * @returns Returns fixed range or null if range is valid.\n */\nfunction tryFixingNonCollapsedRage(range, schema) {\n const { start, end } = range;\n const isTextAllowedOnStart = schema.checkChild(start, '$text');\n const isTextAllowedOnEnd = schema.checkChild(end, '$text');\n const startLimitElement = schema.getLimitElement(start);\n const endLimitElement = schema.getLimitElement(end);\n // Ranges which both end are inside the same limit element (or root) might needs only minor fix.\n if (startLimitElement === endLimitElement) {\n // Range is valid when both position allows to place a text:\n // - <block>f[oobarba]z</block>\n // This would be \"fixed\" by a next check but as it will be the same it's better to return null so the selection stays the same.\n if (isTextAllowedOnStart && isTextAllowedOnEnd) {\n return null;\n }\n // Range that is on non-limit element (or is partially) must be fixed so it is placed inside the block around $text:\n // - [<block>foo</block>] -> <block>[foo]</block>\n // - [<block>foo]</block> -> <block>[foo]</block>\n // - <block>f[oo</block>] -> <block>f[oo]</block>\n // - [<block>foo</block><selectable></selectable>] -> <block>[foo</block><selectable></selectable>]\n if (checkSelectionOnNonLimitElements(start, end, schema)) {\n const isStartBeforeSelectable = start.nodeAfter && schema.isSelectable(start.nodeAfter);\n const fixedStart = isStartBeforeSelectable ? null : schema.getNearestSelectionRange(start, 'forward');\n const isEndAfterSelectable = end.nodeBefore && schema.isSelectable(end.nodeBefore);\n const fixedEnd = isEndAfterSelectable ? null : schema.getNearestSelectionRange(end, 'backward');\n // The schema.getNearestSelectionRange might return null - if that happens use original position.\n const rangeStart = fixedStart ? fixedStart.start : start;\n const rangeEnd = fixedEnd ? fixedEnd.end : end;\n return new Range(rangeStart, rangeEnd);\n }\n }\n const isStartInLimit = startLimitElement && !startLimitElement.is('rootElement');\n const isEndInLimit = endLimitElement && !endLimitElement.is('rootElement');\n // At this point we eliminated valid positions on text nodes so if one of range positions is placed inside a limit element\n // then the range crossed limit element boundaries and needs to be fixed.\n if (isStartInLimit || isEndInLimit) {\n const bothInSameParent = (start.nodeAfter && end.nodeBefore) && start.nodeAfter.parent === end.nodeBefore.parent;\n const expandStart = isStartInLimit && (!bothInSameParent || !isSelectable(start.nodeAfter, schema));\n const expandEnd = isEndInLimit && (!bothInSameParent || !isSelectable(end.nodeBefore, schema));\n // Although we've already found limit element on start/end positions we must find the outer-most limit element.\n // as limit elements might be nested directly inside (ie table > tableRow > tableCell).\n let fixedStart = start;\n let fixedEnd = end;\n if (expandStart) {\n fixedStart = Position._createBefore(findOutermostLimitAncestor(startLimitElement, schema));\n }\n if (expandEnd) {\n fixedEnd = Position._createAfter(findOutermostLimitAncestor(endLimitElement, schema));\n }\n return new Range(fixedStart, fixedEnd);\n }\n // Range was not fixed at this point so it is valid - ie it was placed around limit element already.\n return null;\n}\n/**\n * Finds the outer-most ancestor.\n */\nfunction findOutermostLimitAncestor(startingNode, schema) {\n let isLimitNode = startingNode;\n let parent = isLimitNode;\n // Find outer most isLimit block as such blocks might be nested (ie. in tables).\n while (schema.isLimit(parent) && parent.parent) {\n isLimitNode = parent;\n parent = parent.parent;\n }\n return isLimitNode;\n}\n/**\n * Checks whether any of range boundaries is placed around non-limit elements.\n */\nfunction checkSelectionOnNonLimitElements(start, end, schema) {\n const startIsOnBlock = (start.nodeAfter && !schema.isLimit(start.nodeAfter)) || schema.checkChild(start, '$text');\n const endIsOnBlock = (end.nodeBefore && !schema.isLimit(end.nodeBefore)) || schema.checkChild(end, '$text');\n // We should fix such selection when one of those nodes needs fixing.\n return startIsOnBlock || endIsOnBlock;\n}\n/**\n * Returns a minimal non-intersecting array of ranges without duplicates.\n *\n * @param ranges Ranges to merge.\n * @returns Array of unique and non-intersecting ranges.\n */\nexport function mergeIntersectingRanges(ranges) {\n const rangesToMerge = [...ranges];\n const rangeIndexesToRemove = new Set();\n let currentRangeIndex = 1;\n while (currentRangeIndex < rangesToMerge.length) {\n const currentRange = rangesToMerge[currentRangeIndex];\n const previousRanges = rangesToMerge.slice(0, currentRangeIndex);\n for (const [previousRangeIndex, previousRange] of previousRanges.entries()) {\n if (rangeIndexesToRemove.has(previousRangeIndex)) {\n continue;\n }\n if (currentRange.isEqual(previousRange)) {\n rangeIndexesToRemove.add(previousRangeIndex);\n }\n else if (currentRange.isIntersecting(previousRange)) {\n rangeIndexesToRemove.add(previousRangeIndex);\n rangeIndexesToRemove.add(currentRangeIndex);\n const mergedRange = currentRange.getJoined(previousRange);\n rangesToMerge.push(mergedRange);\n }\n }\n currentRangeIndex++;\n }\n const nonIntersectingRanges = rangesToMerge.filter((_, index) => !rangeIndexesToRemove.has(index));\n return nonIntersectingRanges;\n}\n/**\n * Checks if node exists and if it's a selectable.\n */\nfunction isSelectable(node, schema) {\n return node && schema.isSelectable(node);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/controller/editingcontroller\n */\nimport { CKEditorError, ObservableMixin, env } from '@ckeditor/ckeditor5-utils';\nimport RootEditableElement from '../view/rooteditableelement';\nimport View from '../view/view';\nimport Mapper from '../conversion/mapper';\nimport DowncastDispatcher from '../conversion/downcastdispatcher';\nimport { clearAttributes, convertCollapsedSelection, convertRangeSelection, insertAttributesAndChildren, insertText, remove } from '../conversion/downcasthelpers';\nimport { convertSelectionChange } from '../conversion/upcasthelpers';\nimport { tryFixingRange } from '../model/utils/selection-post-fixer';\n// @if CK_DEBUG_ENGINE // const { dumpTrees, initDocumentDumping } = require( '../dev-utils/utils' );\n/**\n * A controller for the editing pipeline. The editing pipeline controls the {@link ~EditingController#model model} rendering,\n * including selection handling. It also creates the {@link ~EditingController#view view} which builds a\n * browser-independent virtualization over the DOM elements. The editing controller also attaches default converters.\n */\nexport default class EditingController extends ObservableMixin() {\n /**\n * Creates an editing controller instance.\n *\n * @param model Editing model.\n * @param stylesProcessor The styles processor instance.\n */\n constructor(model, stylesProcessor) {\n super();\n this.model = model;\n this.view = new View(stylesProcessor);\n this.mapper = new Mapper();\n this.downcastDispatcher = new DowncastDispatcher({\n mapper: this.mapper,\n schema: model.schema\n });\n const doc = this.model.document;\n const selection = doc.selection;\n const markers = this.model.markers;\n // When plugins listen on model changes (on selection change, post fixers, etc.) and change the view as a result of\n // the model's change, they might trigger view rendering before the conversion is completed (e.g. before the selection\n // is converted). We disable rendering for the length of the outermost model change() block to prevent that.\n //\n // See https://github.com/ckeditor/ckeditor5-engine/issues/1528\n this.listenTo(this.model, '_beforeChanges', () => {\n this.view._disableRendering(true);\n }, { priority: 'highest' });\n this.listenTo(this.model, '_afterChanges', () => {\n this.view._disableRendering(false);\n }, { priority: 'lowest' });\n // Whenever model document is changed, convert those changes to the view (using model.Document#differ).\n // Do it on 'low' priority, so changes are converted after other listeners did their job.\n // Also convert model selection.\n this.listenTo(doc, 'change', () => {\n this.view.change(writer => {\n this.downcastDispatcher.convertChanges(doc.differ, markers, writer);\n this.downcastDispatcher.convertSelection(selection, markers, writer);\n });\n }, { priority: 'low' });\n // Convert selection from the view to the model when it changes in the view.\n this.listenTo(this.view.document, 'selectionChange', convertSelectionChange(this.model, this.mapper));\n // Fix `beforeinput` target ranges so that they map to the valid model ranges.\n this.listenTo(this.view.document, 'beforeinput', fixTargetRanges(this.mapper, this.model.schema, this.view), { priority: 'high' });\n // Attach default model converters.\n this.downcastDispatcher.on('insert:$text', insertText(), { priority: 'lowest' });\n this.downcastDispatcher.on('insert', insertAttributesAndChildren(), { priority: 'lowest' });\n this.downcastDispatcher.on('remove', remove(), { priority: 'low' });\n // Attach default model selection converters.\n this.downcastDispatcher.on('selection', clearAttributes(), { priority: 'high' });\n this.downcastDispatcher.on('selection', convertRangeSelection(), { priority: 'low' });\n this.downcastDispatcher.on('selection', convertCollapsedSelection(), { priority: 'low' });\n // Binds {@link module:engine/view/document~Document#roots view roots collection} to\n // {@link module:engine/model/document~Document#roots model roots collection} so creating\n // model root automatically creates corresponding view root.\n this.view.document.roots.bindTo(this.model.document.roots).using(root => {\n // $graveyard is a special root that has no reflection in the view.\n if (root.rootName == '$graveyard') {\n return null;\n }\n const viewRoot = new RootEditableElement(this.view.document, root.name);\n viewRoot.rootName = root.rootName;\n this.mapper.bindElements(root, viewRoot);\n return viewRoot;\n });\n // @if CK_DEBUG_ENGINE // initDocumentDumping( this.model.document );\n // @if CK_DEBUG_ENGINE // initDocumentDumping( this.view.document );\n // @if CK_DEBUG_ENGINE // dumpTrees( this.model.document, this.model.document.version );\n // @if CK_DEBUG_ENGINE // dumpTrees( this.view.document, this.model.document.version );\n // @if CK_DEBUG_ENGINE // this.model.document.on( 'change', () => {\n // @if CK_DEBUG_ENGINE //\tdumpTrees( this.view.document, this.model.document.version );\n // @if CK_DEBUG_ENGINE // }, { priority: 'lowest' } );\n }\n /**\n * Removes all event listeners attached to the `EditingController`. Destroys all objects created\n * by `EditingController` that need to be destroyed.\n */\n destroy() {\n this.view.destroy();\n this.stopListening();\n }\n /**\n * Calling this method will refresh the marker by triggering the downcast conversion for it.\n *\n * Reconverting the marker is useful when you want to change its {@link module:engine/view/element~Element view element}\n * without changing any marker data. For instance:\n *\n * ```ts\n * let isCommentActive = false;\n *\n * model.conversion.markerToHighlight( {\n * \tmodel: 'comment',\n * \tview: data => {\n * \t\tconst classes = [ 'comment-marker' ];\n *\n * \t\tif ( isCommentActive ) {\n * \t\t\tclasses.push( 'comment-marker--active' );\n * \t\t}\n *\n * \t\treturn { classes };\n * \t}\n * } );\n *\n * // ...\n *\n * // Change the property that indicates if marker is displayed as active or not.\n * isCommentActive = true;\n *\n * // Reconverting will downcast and synchronize the marker with the new isCommentActive state value.\n * editor.editing.reconvertMarker( 'comment' );\n * ```\n *\n * **Note**: If you want to reconvert a model item, use {@link #reconvertItem} instead.\n *\n * @param markerOrName Name of a marker to update, or a marker instance.\n */\n reconvertMarker(markerOrName) {\n const markerName = typeof markerOrName == 'string' ? markerOrName : markerOrName.name;\n const currentMarker = this.model.markers.get(markerName);\n if (!currentMarker) {\n /**\n * The marker with the provided name does not exist and cannot be reconverted.\n *\n * @error editingcontroller-reconvertmarker-marker-not-exist\n * @param {String} markerName The name of the reconverted marker.\n */\n throw new CKEditorError('editingcontroller-reconvertmarker-marker-not-exist', this, { markerName });\n }\n this.model.change(() => {\n this.model.markers._refresh(currentMarker);\n });\n }\n /**\n * Calling this method will downcast a model item on demand (by requesting a refresh in the {@link module:engine/model/differ~Differ}).\n *\n * You can use it if you want the view representation of a specific item updated as a response to external modifications. For instance,\n * when the view structure depends not only on the associated model data but also on some external state.\n *\n * **Note**: If you want to reconvert a model marker, use {@link #reconvertMarker} instead.\n *\n * @param item Item to refresh.\n */\n reconvertItem(item) {\n this.model.change(() => {\n this.model.document.differ._refreshItem(item);\n });\n }\n}\n/**\n * Checks whether the target ranges provided by the `beforeInput` event can be properly mapped to model ranges and fixes them if needed.\n *\n * This is using the same logic as the selection post-fixer.\n */\nfunction fixTargetRanges(mapper, schema, view) {\n return (evt, data) => {\n // The Renderer is disabled while composing on non-android browsers, so we can't be sure that target ranges\n // could be properly mapped to view and model because the DOM and view tree drifted apart.\n if (view.document.isComposing && !env.isAndroid) {\n return;\n }\n for (let i = 0; i < data.targetRanges.length; i++) {\n const viewRange = data.targetRanges[i];\n const modelRange = mapper.toModelRange(viewRange);\n const correctedRange = tryFixingRange(modelRange, schema);\n if (!correctedRange || correctedRange.isEqual(modelRange)) {\n continue;\n }\n data.targetRanges[i] = mapper.toViewRange(correctedRange);\n }\n };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/conversion/viewconsumable\n */\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\nimport { isArray } from 'lodash-es';\n/**\n * Class used for handling consumption of view {@link module:engine/view/element~Element elements},\n * {@link module:engine/view/text~Text text nodes} and {@link module:engine/view/documentfragment~DocumentFragment document fragments}.\n * Element's name and its parts (attributes, classes and styles) can be consumed separately. Consuming an element's name\n * does not consume its attributes, classes and styles.\n * To add items for consumption use {@link module:engine/conversion/viewconsumable~ViewConsumable#add add method}.\n * To test items use {@link module:engine/conversion/viewconsumable~ViewConsumable#test test method}.\n * To consume items use {@link module:engine/conversion/viewconsumable~ViewConsumable#consume consume method}.\n * To revert already consumed items use {@link module:engine/conversion/viewconsumable~ViewConsumable#revert revert method}.\n *\n * ```ts\n * viewConsumable.add( element, { name: true } ); // Adds element's name as ready to be consumed.\n * viewConsumable.add( textNode ); // Adds text node for consumption.\n * viewConsumable.add( docFragment ); // Adds document fragment for consumption.\n * viewConsumable.test( element, { name: true } ); // Tests if element's name can be consumed.\n * viewConsumable.test( textNode ); // Tests if text node can be consumed.\n * viewConsumable.test( docFragment ); // Tests if document fragment can be consumed.\n * viewConsumable.consume( element, { name: true } ); // Consume element's name.\n * viewConsumable.consume( textNode ); // Consume text node.\n * viewConsumable.consume( docFragment ); // Consume document fragment.\n * viewConsumable.revert( element, { name: true } ); // Revert already consumed element's name.\n * viewConsumable.revert( textNode ); // Revert already consumed text node.\n * viewConsumable.revert( docFragment ); // Revert already consumed document fragment.\n * ```\n */\nexport default class ViewConsumable {\n constructor() {\n /**\n * Map of consumable elements. If {@link module:engine/view/element~Element element} is used as a key,\n * {@link module:engine/conversion/viewconsumable~ViewElementConsumables ViewElementConsumables} instance is stored as value.\n * For {@link module:engine/view/text~Text text nodes} and\n * {@link module:engine/view/documentfragment~DocumentFragment document fragments} boolean value is stored as value.\n */\n this._consumables = new Map();\n }\n add(element, consumables) {\n let elementConsumables;\n // For text nodes and document fragments just mark them as consumable.\n if (element.is('$text') || element.is('documentFragment')) {\n this._consumables.set(element, true);\n return;\n }\n // For elements create new ViewElementConsumables or update already existing one.\n if (!this._consumables.has(element)) {\n elementConsumables = new ViewElementConsumables(element);\n this._consumables.set(element, elementConsumables);\n }\n else {\n elementConsumables = this._consumables.get(element);\n }\n elementConsumables.add(consumables);\n }\n /**\n * Tests if {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or\n * {@link module:engine/view/documentfragment~DocumentFragment document fragment} can be consumed.\n * It returns `true` when all items included in method's call can be consumed. Returns `false` when\n * first already consumed item is found and `null` when first non-consumable item is found.\n *\n * ```ts\n * viewConsumable.test( p, { name: true } ); // Tests element's name.\n * viewConsumable.test( p, { attributes: 'name' } ); // Tests attribute.\n * viewConsumable.test( p, { classes: 'foobar' } ); // Tests class.\n * viewConsumable.test( p, { styles: 'color' } ); // Tests style.\n * viewConsumable.test( p, { attributes: 'name', styles: 'color' } ); // Tests attribute and style.\n * viewConsumable.test( p, { classes: [ 'baz', 'bar' ] } ); // Multiple consumables can be tested.\n * viewConsumable.test( textNode ); // Tests text node.\n * viewConsumable.test( docFragment ); // Tests document fragment.\n * ```\n *\n * Testing classes and styles as attribute will test if all added classes/styles can be consumed.\n *\n * ```ts\n * viewConsumable.test( p, { attributes: 'class' } ); // Tests if all added classes can be consumed.\n * viewConsumable.test( p, { attributes: 'style' } ); // Tests if all added styles can be consumed.\n * ```\n *\n * @param consumables Used only if first parameter is {@link module:engine/view/element~Element view element} instance.\n * @param consumables.name If set to true element's name will be included.\n * @param consumables.attributes Attribute name or array of attribute names.\n * @param consumables.classes Class name or array of class names.\n * @param consumables.styles Style name or array of style names.\n * @returns Returns `true` when all items included in method's call can be consumed. Returns `false`\n * when first already consumed item is found and `null` when first non-consumable item is found.\n */\n test(element, consumables) {\n const elementConsumables = this._consumables.get(element);\n if (elementConsumables === undefined) {\n return null;\n }\n // For text nodes and document fragments return stored boolean value.\n if (element.is('$text') || element.is('documentFragment')) {\n return elementConsumables;\n }\n // For elements test consumables object.\n return elementConsumables.test(consumables);\n }\n /**\n * Consumes {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or\n * {@link module:engine/view/documentfragment~DocumentFragment document fragment}.\n * It returns `true` when all items included in method's call can be consumed, otherwise returns `false`.\n *\n * ```ts\n * viewConsumable.consume( p, { name: true } ); // Consumes element's name.\n * viewConsumable.consume( p, { attributes: 'name' } ); // Consumes element's attribute.\n * viewConsumable.consume( p, { classes: 'foobar' } ); // Consumes element's class.\n * viewConsumable.consume( p, { styles: 'color' } ); // Consumes element's style.\n * viewConsumable.consume( p, { attributes: 'name', styles: 'color' } ); // Consumes attribute and style.\n * viewConsumable.consume( p, { classes: [ 'baz', 'bar' ] } ); // Multiple consumables can be consumed.\n * viewConsumable.consume( textNode ); // Consumes text node.\n * viewConsumable.consume( docFragment ); // Consumes document fragment.\n * ```\n *\n * Consuming classes and styles as attribute will test if all added classes/styles can be consumed.\n *\n * ```ts\n * viewConsumable.consume( p, { attributes: 'class' } ); // Consume only if all added classes can be consumed.\n * viewConsumable.consume( p, { attributes: 'style' } ); // Consume only if all added styles can be consumed.\n * ```\n *\n * @param consumables Used only if first parameter is {@link module:engine/view/element~Element view element} instance.\n * @param consumables.name If set to true element's name will be included.\n * @param consumables.attributes Attribute name or array of attribute names.\n * @param consumables.classes Class name or array of class names.\n * @param consumables.styles Style name or array of style names.\n * @returns Returns `true` when all items included in method's call can be consumed,\n * otherwise returns `false`.\n */\n consume(element, consumables) {\n if (this.test(element, consumables)) {\n if (element.is('$text') || element.is('documentFragment')) {\n // For text nodes and document fragments set value to false.\n this._consumables.set(element, false);\n }\n else {\n // For elements - consume consumables object.\n this._consumables.get(element).consume(consumables);\n }\n return true;\n }\n return false;\n }\n /**\n * Reverts {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or\n * {@link module:engine/view/documentfragment~DocumentFragment document fragment} so they can be consumed once again.\n * Method does not revert items that were never previously added for consumption, even if they are included in\n * method's call.\n *\n * ```ts\n * viewConsumable.revert( p, { name: true } ); // Reverts element's name.\n * viewConsumable.revert( p, { attributes: 'name' } ); // Reverts element's attribute.\n * viewConsumable.revert( p, { classes: 'foobar' } ); // Reverts element's class.\n * viewConsumable.revert( p, { styles: 'color' } ); // Reverts element's style.\n * viewConsumable.revert( p, { attributes: 'name', styles: 'color' } ); // Reverts attribute and style.\n * viewConsumable.revert( p, { classes: [ 'baz', 'bar' ] } ); // Multiple names can be reverted.\n * viewConsumable.revert( textNode ); // Reverts text node.\n * viewConsumable.revert( docFragment ); // Reverts document fragment.\n * ```\n *\n * Reverting classes and styles as attribute will revert all classes/styles that were previously added for\n * consumption.\n *\n * ```ts\n * viewConsumable.revert( p, { attributes: 'class' } ); // Reverts all classes added for consumption.\n * viewConsumable.revert( p, { attributes: 'style' } ); // Reverts all styles added for consumption.\n * ```\n *\n * @param consumables Used only if first parameter is {@link module:engine/view/element~Element view element} instance.\n * @param consumables.name If set to true element's name will be included.\n * @param consumables.attributes Attribute name or array of attribute names.\n * @param consumables.classes Class name or array of class names.\n * @param consumables.styles Style name or array of style names.\n */\n revert(element, consumables) {\n const elementConsumables = this._consumables.get(element);\n if (elementConsumables !== undefined) {\n if (element.is('$text') || element.is('documentFragment')) {\n // For text nodes and document fragments - set consumable to true.\n this._consumables.set(element, true);\n }\n else {\n // For elements - revert items from consumables object.\n elementConsumables.revert(consumables);\n }\n }\n }\n /**\n * Creates consumable object from {@link module:engine/view/element~Element view element}. Consumable object will include\n * element's name and all its attributes, classes and styles.\n */\n static consumablesFromElement(element) {\n const consumables = {\n element,\n name: true,\n attributes: [],\n classes: [],\n styles: []\n };\n const attributes = element.getAttributeKeys();\n for (const attribute of attributes) {\n // Skip classes and styles - will be added separately.\n if (attribute == 'style' || attribute == 'class') {\n continue;\n }\n consumables.attributes.push(attribute);\n }\n const classes = element.getClassNames();\n for (const className of classes) {\n consumables.classes.push(className);\n }\n const styles = element.getStyleNames();\n for (const style of styles) {\n consumables.styles.push(style);\n }\n return consumables;\n }\n /**\n * Creates {@link module:engine/conversion/viewconsumable~ViewConsumable ViewConsumable} instance from\n * {@link module:engine/view/node~Node node} or {@link module:engine/view/documentfragment~DocumentFragment document fragment}.\n * Instance will contain all elements, child nodes, attributes, styles and classes added for consumption.\n *\n * @param from View node or document fragment from which `ViewConsumable` will be created.\n * @param instance If provided, given `ViewConsumable` instance will be used\n * to add all consumables. It will be returned instead of a new instance.\n */\n static createFrom(from, instance) {\n if (!instance) {\n instance = new ViewConsumable();\n }\n if (from.is('$text')) {\n instance.add(from);\n return instance;\n }\n // Add `from` itself, if it is an element.\n if (from.is('element')) {\n instance.add(from, ViewConsumable.consumablesFromElement(from));\n }\n if (from.is('documentFragment')) {\n instance.add(from);\n }\n for (const child of from.getChildren()) {\n instance = ViewConsumable.createFrom(child, instance);\n }\n return instance;\n }\n}\nconst CONSUMABLE_TYPES = ['attributes', 'classes', 'styles'];\n/**\n * This is a private helper-class for {@link module:engine/conversion/viewconsumable~ViewConsumable}.\n * It represents and manipulates consumable parts of a single {@link module:engine/view/element~Element}.\n */\nexport class ViewElementConsumables {\n /**\n * Creates ViewElementConsumables instance.\n *\n * @param from View node or document fragment from which `ViewElementConsumables` is being created.\n */\n constructor(from) {\n this.element = from;\n this._canConsumeName = null;\n this._consumables = {\n attributes: new Map(),\n styles: new Map(),\n classes: new Map()\n };\n }\n /**\n * Adds consumable parts of the {@link module:engine/view/element~Element view element}.\n * Element's name itself can be marked to be consumed (when element's name is consumed its attributes, classes and\n * styles still could be consumed):\n *\n * ```ts\n * consumables.add( { name: true } );\n * ```\n *\n * Attributes classes and styles:\n *\n * ```ts\n * consumables.add( { attributes: 'title', classes: 'foo', styles: 'color' } );\n * consumables.add( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );\n * ```\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `viewconsumable-invalid-attribute` when `class` or `style`\n * attribute is provided - it should be handled separately by providing `style` and `class` in consumables object.\n *\n * @param consumables Object describing which parts of the element can be consumed.\n * @param consumables.name If set to `true` element's name will be added as consumable.\n * @param consumables.attributes Attribute name or array of attribute names to add as consumable.\n * @param consumables.classes Class name or array of class names to add as consumable.\n * @param consumables.styles Style name or array of style names to add as consumable.\n */\n add(consumables) {\n if (consumables.name) {\n this._canConsumeName = true;\n }\n for (const type of CONSUMABLE_TYPES) {\n if (type in consumables) {\n this._add(type, consumables[type]);\n }\n }\n }\n /**\n * Tests if parts of the {@link module:engine/view/node~Node view node} can be consumed.\n *\n * Element's name can be tested:\n *\n * ```ts\n * consumables.test( { name: true } );\n * ```\n *\n * Attributes classes and styles:\n *\n * ```ts\n * consumables.test( { attributes: 'title', classes: 'foo', styles: 'color' } );\n * consumables.test( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );\n * ```\n *\n * @param consumables Object describing which parts of the element should be tested.\n * @param consumables.name If set to `true` element's name will be tested.\n * @param consumables.attributes Attribute name or array of attribute names to test.\n * @param consumables.classes Class name or array of class names to test.\n * @param consumables.styles Style name or array of style names to test.\n * @returns `true` when all tested items can be consumed, `null` when even one of the items\n * was never marked for consumption and `false` when even one of the items was already consumed.\n */\n test(consumables) {\n // Check if name can be consumed.\n if (consumables.name && !this._canConsumeName) {\n return this._canConsumeName;\n }\n for (const type of CONSUMABLE_TYPES) {\n if (type in consumables) {\n const value = this._test(type, consumables[type]);\n if (value !== true) {\n return value;\n }\n }\n }\n // Return true only if all can be consumed.\n return true;\n }\n /**\n * Consumes parts of {@link module:engine/view/element~Element view element}. This function does not check if consumable item\n * is already consumed - it consumes all consumable items provided.\n * Element's name can be consumed:\n *\n * ```ts\n * consumables.consume( { name: true } );\n * ```\n *\n * Attributes classes and styles:\n *\n * ```ts\n * consumables.consume( { attributes: 'title', classes: 'foo', styles: 'color' } );\n * consumables.consume( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );\n * ```\n *\n * @param consumables Object describing which parts of the element should be consumed.\n * @param consumables.name If set to `true` element's name will be consumed.\n * @param consumables.attributes Attribute name or array of attribute names to consume.\n * @param consumables.classes Class name or array of class names to consume.\n * @param consumables.styles Style name or array of style names to consume.\n */\n consume(consumables) {\n if (consumables.name) {\n this._canConsumeName = false;\n }\n for (const type of CONSUMABLE_TYPES) {\n if (type in consumables) {\n this._consume(type, consumables[type]);\n }\n }\n }\n /**\n * Revert already consumed parts of {@link module:engine/view/element~Element view Element}, so they can be consumed once again.\n * Element's name can be reverted:\n *\n * ```ts\n * consumables.revert( { name: true } );\n * ```\n *\n * Attributes classes and styles:\n *\n * ```ts\n * consumables.revert( { attributes: 'title', classes: 'foo', styles: 'color' } );\n * consumables.revert( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );\n * ```\n *\n * @param consumables Object describing which parts of the element should be reverted.\n * @param consumables.name If set to `true` element's name will be reverted.\n * @param consumables.attributes Attribute name or array of attribute names to revert.\n * @param consumables.classes Class name or array of class names to revert.\n * @param consumables.styles Style name or array of style names to revert.\n */\n revert(consumables) {\n if (consumables.name) {\n this._canConsumeName = true;\n }\n for (const type of CONSUMABLE_TYPES) {\n if (type in consumables) {\n this._revert(type, consumables[type]);\n }\n }\n }\n /**\n * Helper method that adds consumables of a given type: attribute, class or style.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `viewconsumable-invalid-attribute` when `class` or `style`\n * type is provided - it should be handled separately by providing actual style/class type.\n *\n * @param type Type of the consumable item: `attributes`, `classes` or `styles`.\n * @param item Consumable item or array of items.\n */\n _add(type, item) {\n const items = isArray(item) ? item : [item];\n const consumables = this._consumables[type];\n for (const name of items) {\n if (type === 'attributes' && (name === 'class' || name === 'style')) {\n /**\n * Class and style attributes should be handled separately in\n * {@link module:engine/conversion/viewconsumable~ViewConsumable#add `ViewConsumable#add()`}.\n *\n * What you have done is trying to use:\n *\n *\t\tconsumables.add( { attributes: [ 'class', 'style' ] } );\n *\n * While each class and style should be registered separately:\n *\n *\t\tconsumables.add( { classes: 'some-class', styles: 'font-weight' } );\n *\n * @error viewconsumable-invalid-attribute\n */\n throw new CKEditorError('viewconsumable-invalid-attribute', this);\n }\n consumables.set(name, true);\n if (type === 'styles') {\n for (const alsoName of this.element.document.stylesProcessor.getRelatedStyles(name)) {\n consumables.set(alsoName, true);\n }\n }\n }\n }\n /**\n * Helper method that tests consumables of a given type: attribute, class or style.\n *\n * @param type Type of the consumable item: `attributes`, `classes` or `styles`.\n * @param item Consumable item or array of items.\n * @returns Returns `true` if all items can be consumed, `null` when one of the items cannot be\n * consumed and `false` when one of the items is already consumed.\n */\n _test(type, item) {\n const items = isArray(item) ? item : [item];\n const consumables = this._consumables[type];\n for (const name of items) {\n if (type === 'attributes' && (name === 'class' || name === 'style')) {\n const consumableName = name == 'class' ? 'classes' : 'styles';\n // Check all classes/styles if class/style attribute is tested.\n const value = this._test(consumableName, [...this._consumables[consumableName].keys()]);\n if (value !== true) {\n return value;\n }\n }\n else {\n const value = consumables.get(name);\n // Return null if attribute is not found.\n if (value === undefined) {\n return null;\n }\n if (!value) {\n return false;\n }\n }\n }\n return true;\n }\n /**\n * Helper method that consumes items of a given type: attribute, class or style.\n *\n * @param type Type of the consumable item: `attributes`, `classes` or `styles`.\n * @param item Consumable item or array of items.\n */\n _consume(type, item) {\n const items = isArray(item) ? item : [item];\n const consumables = this._consumables[type];\n for (const name of items) {\n if (type === 'attributes' && (name === 'class' || name === 'style')) {\n const consumableName = name == 'class' ? 'classes' : 'styles';\n // If class or style is provided for consumption - consume them all.\n this._consume(consumableName, [...this._consumables[consumableName].keys()]);\n }\n else {\n consumables.set(name, false);\n if (type == 'styles') {\n for (const toConsume of this.element.document.stylesProcessor.getRelatedStyles(name)) {\n consumables.set(toConsume, false);\n }\n }\n }\n }\n }\n /**\n * Helper method that reverts items of a given type: attribute, class or style.\n *\n * @param type Type of the consumable item: `attributes`, `classes` or , `styles`.\n * @param item Consumable item or array of items.\n */\n _revert(type, item) {\n const items = isArray(item) ? item : [item];\n const consumables = this._consumables[type];\n for (const name of items) {\n if (type === 'attributes' && (name === 'class' || name === 'style')) {\n const consumableName = name == 'class' ? 'classes' : 'styles';\n // If class or style is provided for reverting - revert them all.\n this._revert(consumableName, [...this._consumables[consumableName].keys()]);\n }\n else {\n const value = consumables.get(name);\n if (value === false) {\n consumables.set(name, true);\n }\n }\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/schema\n */\nimport Element from './element';\nimport Position from './position';\nimport Range from './range';\nimport Text from './text';\nimport TreeWalker from './treewalker';\nimport { CKEditorError, ObservableMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * The model's schema. It defines the allowed and disallowed structures of nodes as well as nodes' attributes.\n * The schema is usually defined by the features and based on them, the editing framework and features\n * make decisions on how to change and process the model.\n *\n * The instance of schema is available in {@link module:engine/model/model~Model#schema `editor.model.schema`}.\n *\n * Read more about the schema in:\n *\n * * The {@glink framework/architecture/editing-engine#schema schema section} of the\n * {@glink framework/architecture/editing-engine Introduction to the Editing engine architecture} guide.\n * * The {@glink framework/deep-dive/schema Schema deep-dive} guide.\n */\nexport default class Schema extends ObservableMixin() {\n /**\n * Creates a schema instance.\n */\n constructor() {\n super();\n this._sourceDefinitions = {};\n /**\n * A dictionary containing attribute properties.\n */\n this._attributeProperties = {};\n this.decorate('checkChild');\n this.decorate('checkAttribute');\n this.on('checkAttribute', (evt, args) => {\n args[0] = new SchemaContext(args[0]);\n }, { priority: 'highest' });\n this.on('checkChild', (evt, args) => {\n args[0] = new SchemaContext(args[0]);\n args[1] = this.getDefinition(args[1]);\n }, { priority: 'highest' });\n }\n /**\n * Registers a schema item. Can only be called once for every item name.\n *\n * ```ts\n * schema.register( 'paragraph', {\n * \tinheritAllFrom: '$block'\n * } );\n * ```\n */\n register(itemName, definition) {\n if (this._sourceDefinitions[itemName]) {\n /**\n * A single item cannot be registered twice in the schema.\n *\n * This situation may happen when:\n *\n * * Two or more plugins called {@link module:engine/model/schema~Schema#register `register()`} with the same name.\n * This will usually mean that there is a collision between plugins which try to use the same element in the model.\n * Unfortunately, the only way to solve this is by modifying one of these plugins to use a unique model element name.\n * * A single plugin was loaded twice. This happens when it is installed by npm/yarn in two versions\n * and usually means one or more of the following issues:\n * * a version mismatch (two of your dependencies require two different versions of this plugin),\n * * incorrect imports (this plugin is somehow imported twice in a way which confuses webpack),\n * * mess in `node_modules/` (`rm -rf node_modules/` may help).\n *\n * **Note:** Check the logged `itemName` to better understand which plugin was duplicated/conflicting.\n *\n * @param itemName The name of the model element that is being registered twice.\n * @error schema-cannot-register-item-twice\n */\n throw new CKEditorError('schema-cannot-register-item-twice', this, {\n itemName\n });\n }\n this._sourceDefinitions[itemName] = [\n Object.assign({}, definition)\n ];\n this._clearCache();\n }\n /**\n * Extends a {@link #register registered} item's definition.\n *\n * Extending properties such as `allowIn` will add more items to the existing properties,\n * while redefining properties such as `isBlock` will override the previously defined ones.\n *\n * ```ts\n * schema.register( 'foo', {\n * \tallowIn: '$root',\n * \tisBlock: true;\n * } );\n * schema.extend( 'foo', {\n * \tallowIn: 'blockQuote',\n * \tisBlock: false\n * } );\n *\n * schema.getDefinition( 'foo' );\n * //\t{\n * //\t\tallowIn: [ '$root', 'blockQuote' ],\n * // \t\tisBlock: false\n * //\t}\n * ```\n */\n extend(itemName, definition) {\n if (!this._sourceDefinitions[itemName]) {\n /**\n * Cannot extend an item which was not registered yet.\n *\n * This error happens when a plugin tries to extend the schema definition of an item which was not\n * {@link module:engine/model/schema~Schema#register registered} yet.\n *\n * @param itemName The name of the model element which is being extended.\n * @error schema-cannot-extend-missing-item\n */\n throw new CKEditorError('schema-cannot-extend-missing-item', this, {\n itemName\n });\n }\n this._sourceDefinitions[itemName].push(Object.assign({}, definition));\n this._clearCache();\n }\n /**\n * Returns data of all registered items.\n *\n * This method should normally be used for reflection purposes (e.g. defining a clone of a certain element,\n * checking a list of all block elements, etc).\n * Use specific methods (such as {@link #checkChild `checkChild()`} or {@link #isLimit `isLimit()`})\n * in other cases.\n */\n getDefinitions() {\n if (!this._compiledDefinitions) {\n this._compile();\n }\n return this._compiledDefinitions;\n }\n /**\n * Returns a definition of the given item or `undefined` if an item is not registered.\n *\n * This method should normally be used for reflection purposes (e.g. defining a clone of a certain element,\n * checking a list of all block elements, etc).\n * Use specific methods (such as {@link #checkChild `checkChild()`} or {@link #isLimit `isLimit()`})\n * in other cases.\n */\n getDefinition(item) {\n let itemName;\n if (typeof item == 'string') {\n itemName = item;\n }\n else if ('is' in item && (item.is('$text') || item.is('$textProxy'))) {\n itemName = '$text';\n }\n // Element or module:engine/model/schema~SchemaContextItem.\n else {\n itemName = item.name;\n }\n return this.getDefinitions()[itemName];\n }\n /**\n * Returns `true` if the given item is registered in the schema.\n *\n * ```ts\n * schema.isRegistered( 'paragraph' ); // -> true\n * schema.isRegistered( editor.model.document.getRoot() ); // -> true\n * schema.isRegistered( 'foo' ); // -> false\n * ```\n */\n isRegistered(item) {\n return !!this.getDefinition(item);\n }\n /**\n * Returns `true` if the given item is defined to be\n * a block by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isBlock` property.\n *\n * ```ts\n * schema.isBlock( 'paragraph' ); // -> true\n * schema.isBlock( '$root' ); // -> false\n *\n * const paragraphElement = writer.createElement( 'paragraph' );\n * schema.isBlock( paragraphElement ); // -> true\n * ```\n *\n * See the {@glink framework/deep-dive/schema#block-elements Block elements} section of\n * the {@glink framework/deep-dive/schema Schema deep-dive} guide for more details.\n */\n isBlock(item) {\n const def = this.getDefinition(item);\n return !!(def && def.isBlock);\n }\n /**\n * Returns `true` if the given item should be treated as a limit element.\n *\n * It considers an item to be a limit element if its\n * {@link module:engine/model/schema~SchemaItemDefinition}'s\n * {@link module:engine/model/schema~SchemaItemDefinition#isLimit `isLimit`} or\n * {@link module:engine/model/schema~SchemaItemDefinition#isObject `isObject`} property\n * was set to `true`.\n *\n * ```ts\n * schema.isLimit( 'paragraph' ); // -> false\n * schema.isLimit( '$root' ); // -> true\n * schema.isLimit( editor.model.document.getRoot() ); // -> true\n * schema.isLimit( 'imageBlock' ); // -> true\n * ```\n *\n * See the {@glink framework/deep-dive/schema#limit-elements Limit elements} section of\n * the {@glink framework/deep-dive/schema Schema deep-dive} guide for more details.\n */\n isLimit(item) {\n const def = this.getDefinition(item);\n if (!def) {\n return false;\n }\n return !!(def.isLimit || def.isObject);\n }\n /**\n * Returns `true` if the given item should be treated as an object element.\n *\n * It considers an item to be an object element if its\n * {@link module:engine/model/schema~SchemaItemDefinition}'s\n * {@link module:engine/model/schema~SchemaItemDefinition#isObject `isObject`} property\n * was set to `true`.\n *\n * ```ts\n * schema.isObject( 'paragraph' ); // -> false\n * schema.isObject( 'imageBlock' ); // -> true\n *\n * const imageElement = writer.createElement( 'imageBlock' );\n * schema.isObject( imageElement ); // -> true\n * ```\n *\n * See the {@glink framework/deep-dive/schema#object-elements Object elements} section of\n * the {@glink framework/deep-dive/schema Schema deep-dive} guide for more details.\n */\n isObject(item) {\n const def = this.getDefinition(item);\n if (!def) {\n return false;\n }\n // Note: Check out the implementation of #isLimit(), #isSelectable(), and #isContent()\n // to understand why these three constitute an object.\n return !!(def.isObject || (def.isLimit && def.isSelectable && def.isContent));\n }\n /**\n * Returns `true` if the given item is defined to be\n * an inline element by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isInline` property.\n *\n * ```ts\n * schema.isInline( 'paragraph' ); // -> false\n * schema.isInline( 'softBreak' ); // -> true\n *\n * const text = writer.createText( 'foo' );\n * schema.isInline( text ); // -> true\n * ```\n *\n * See the {@glink framework/deep-dive/schema#inline-elements Inline elements} section of\n * the {@glink framework/deep-dive/schema Schema deep-dive} guide for more details.\n */\n isInline(item) {\n const def = this.getDefinition(item);\n return !!(def && def.isInline);\n }\n /**\n * Returns `true` if the given item is defined to be\n * a selectable element by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isSelectable` property.\n *\n * ```ts\n * schema.isSelectable( 'paragraph' ); // -> false\n * schema.isSelectable( 'heading1' ); // -> false\n * schema.isSelectable( 'imageBlock' ); // -> true\n * schema.isSelectable( 'tableCell' ); // -> true\n *\n * const text = writer.createText( 'foo' );\n * schema.isSelectable( text ); // -> false\n * ```\n *\n * See the {@glink framework/deep-dive/schema#selectable-elements Selectable elements section} of\n * the {@glink framework/deep-dive/schema Schema deep-dive} guide for more details.\n */\n isSelectable(item) {\n const def = this.getDefinition(item);\n if (!def) {\n return false;\n }\n return !!(def.isSelectable || def.isObject);\n }\n /**\n * Returns `true` if the given item is defined to be\n * a content by the {@link module:engine/model/schema~SchemaItemDefinition}'s `isContent` property.\n *\n * ```ts\n * schema.isContent( 'paragraph' ); // -> false\n * schema.isContent( 'heading1' ); // -> false\n * schema.isContent( 'imageBlock' ); // -> true\n * schema.isContent( 'horizontalLine' ); // -> true\n *\n * const text = writer.createText( 'foo' );\n * schema.isContent( text ); // -> true\n * ```\n *\n * See the {@glink framework/deep-dive/schema#content-elements Content elements section} of\n * the {@glink framework/deep-dive/schema Schema deep-dive} guide for more details.\n */\n isContent(item) {\n const def = this.getDefinition(item);\n if (!def) {\n return false;\n }\n return !!(def.isContent || def.isObject);\n }\n /**\n * Checks whether the given node (`child`) can be a child of the given context.\n *\n * ```ts\n * schema.checkChild( model.document.getRoot(), paragraph ); // -> false\n *\n * schema.register( 'paragraph', {\n * \tallowIn: '$root'\n * } );\n * schema.checkChild( model.document.getRoot(), paragraph ); // -> true\n * ```\n *\n * Note: When verifying whether the given node can be a child of the given context, the\n * schema also verifies the entire context &mdash; from its root to its last element. Therefore, it is possible\n * for `checkChild()` to return `false` even though the context's last element can contain the checked child.\n * It happens if one of the context's elements does not allow its child.\n *\n * @fires checkChild\n * @param context The context in which the child will be checked.\n * @param def The child to check.\n */\n checkChild(context, def) {\n // Note: context and child are already normalized here to a SchemaContext and SchemaCompiledItemDefinition.\n if (!def) {\n return false;\n }\n return this._checkContextMatch(def, context);\n }\n /**\n * Checks whether the given attribute can be applied in the given context (on the last\n * item of the context).\n *\n * ```ts\n * schema.checkAttribute( textNode, 'bold' ); // -> false\n *\n * schema.extend( '$text', {\n * \tallowAttributes: 'bold'\n * } );\n * schema.checkAttribute( textNode, 'bold' ); // -> true\n * ```\n *\n * @fires checkAttribute\n * @param context The context in which the attribute will be checked.\n */\n checkAttribute(context, attributeName) {\n const def = this.getDefinition(context.last);\n if (!def) {\n return false;\n }\n return def.allowAttributes.includes(attributeName);\n }\n /**\n * Checks whether the given element (`elementToMerge`) can be merged with the specified base element (`positionOrBaseElement`).\n *\n * In other words &mdash; whether `elementToMerge`'s children {@link #checkChild are allowed} in the `positionOrBaseElement`.\n *\n * This check ensures that elements merged with {@link module:engine/model/writer~Writer#merge `Writer#merge()`}\n * will be valid.\n *\n * Instead of elements, you can pass the instance of the {@link module:engine/model/position~Position} class as the\n * `positionOrBaseElement`. It means that the elements before and after the position will be checked whether they can be merged.\n *\n * @param positionOrBaseElement The position or base element to which the `elementToMerge` will be merged.\n * @param elementToMerge The element to merge. Required if `positionOrBaseElement` is an element.\n */\n checkMerge(positionOrBaseElement, elementToMerge) {\n if (positionOrBaseElement instanceof Position) {\n const nodeBefore = positionOrBaseElement.nodeBefore;\n const nodeAfter = positionOrBaseElement.nodeAfter;\n if (!(nodeBefore instanceof Element)) {\n /**\n * The node before the merge position must be an element.\n *\n * @error schema-check-merge-no-element-before\n */\n throw new CKEditorError('schema-check-merge-no-element-before', this);\n }\n if (!(nodeAfter instanceof Element)) {\n /**\n * The node after the merge position must be an element.\n *\n * @error schema-check-merge-no-element-after\n */\n throw new CKEditorError('schema-check-merge-no-element-after', this);\n }\n return this.checkMerge(nodeBefore, nodeAfter);\n }\n for (const child of elementToMerge.getChildren()) {\n if (!this.checkChild(positionOrBaseElement, child)) {\n return false;\n }\n }\n return true;\n }\n /**\n * Allows registering a callback to the {@link #checkChild} method calls.\n *\n * Callbacks allow you to implement rules which are not otherwise possible to achieve\n * by using the declarative API of {@link module:engine/model/schema~SchemaItemDefinition}.\n * For example, by using this method you can disallow elements in specific contexts.\n *\n * This method is a shorthand for using the {@link #event:checkChild} event. For even better control,\n * you can use that event instead.\n *\n * Example:\n *\n * ```ts\n * // Disallow heading1 directly inside a blockQuote.\n * schema.addChildCheck( ( context, childDefinition ) => {\n * \tif ( context.endsWith( 'blockQuote' ) && childDefinition.name == 'heading1' ) {\n * \t\treturn false;\n * \t}\n * } );\n * ```\n *\n * Which translates to:\n *\n * ```ts\n * schema.on( 'checkChild', ( evt, args ) => {\n * \tconst context = args[ 0 ];\n * \tconst childDefinition = args[ 1 ];\n *\n * \tif ( context.endsWith( 'blockQuote' ) && childDefinition && childDefinition.name == 'heading1' ) {\n * \t\t// Prevent next listeners from being called.\n * \t\tevt.stop();\n * \t\t// Set the checkChild()'s return value.\n * \t\tevt.return = false;\n * \t}\n * }, { priority: 'high' } );\n * ```\n *\n * @param callback The callback to be called. It is called with two parameters:\n * {@link module:engine/model/schema~SchemaContext} (context) instance and\n * {@link module:engine/model/schema~SchemaCompiledItemDefinition} (child-to-check definition).\n * The callback may return `true/false` to override `checkChild()`'s return value. If it does not return\n * a boolean value, the default algorithm (or other callbacks) will define `checkChild()`'s return value.\n */\n addChildCheck(callback) {\n this.on('checkChild', (evt, [ctx, childDef]) => {\n // checkChild() was called with a non-registered child.\n // In 99% cases such check should return false, so not to overcomplicate all callbacks\n // don't even execute them.\n if (!childDef) {\n return;\n }\n const retValue = callback(ctx, childDef);\n if (typeof retValue == 'boolean') {\n evt.stop();\n evt.return = retValue;\n }\n }, { priority: 'high' });\n }\n /**\n * Allows registering a callback to the {@link #checkAttribute} method calls.\n *\n * Callbacks allow you to implement rules which are not otherwise possible to achieve\n * by using the declarative API of {@link module:engine/model/schema~SchemaItemDefinition}.\n * For example, by using this method you can disallow attribute if node to which it is applied\n * is contained within some other element (e.g. you want to disallow `bold` on `$text` within `heading1`).\n *\n * This method is a shorthand for using the {@link #event:checkAttribute} event. For even better control,\n * you can use that event instead.\n *\n * Example:\n *\n * ```ts\n * // Disallow bold on $text inside heading1.\n * schema.addAttributeCheck( ( context, attributeName ) => {\n * \tif ( context.endsWith( 'heading1 $text' ) && attributeName == 'bold' ) {\n * \t\treturn false;\n * \t}\n * } );\n * ```\n *\n * Which translates to:\n *\n * ```ts\n * schema.on( 'checkAttribute', ( evt, args ) => {\n * \tconst context = args[ 0 ];\n * \tconst attributeName = args[ 1 ];\n *\n * \tif ( context.endsWith( 'heading1 $text' ) && attributeName == 'bold' ) {\n * \t\t// Prevent next listeners from being called.\n * \t\tevt.stop();\n * \t\t// Set the checkAttribute()'s return value.\n * \t\tevt.return = false;\n * \t}\n * }, { priority: 'high' } );\n * ```\n *\n * @param callback The callback to be called. It is called with two parameters:\n * {@link module:engine/model/schema~SchemaContext} (context) instance and attribute name.\n * The callback may return `true/false` to override `checkAttribute()`'s return value. If it does not return\n * a boolean value, the default algorithm (or other callbacks) will define `checkAttribute()`'s return value.\n */\n addAttributeCheck(callback) {\n this.on('checkAttribute', (evt, [ctx, attributeName]) => {\n const retValue = callback(ctx, attributeName);\n if (typeof retValue == 'boolean') {\n evt.stop();\n evt.return = retValue;\n }\n }, { priority: 'high' });\n }\n /**\n * This method allows assigning additional metadata to the model attributes. For example,\n * {@link module:engine/model/schema~AttributeProperties `AttributeProperties#isFormatting` property} is\n * used to mark formatting attributes (like `bold` or `italic`).\n *\n * ```ts\n * // Mark bold as a formatting attribute.\n * schema.setAttributeProperties( 'bold', {\n * \tisFormatting: true\n * } );\n *\n * // Override code not to be considered a formatting markup.\n * schema.setAttributeProperties( 'code', {\n * \tisFormatting: false\n * } );\n * ```\n *\n * Properties are not limited to members defined in the\n * {@link module:engine/model/schema~AttributeProperties `AttributeProperties` type} and you can also use custom properties:\n *\n * ```ts\n * schema.setAttributeProperties( 'blockQuote', {\n * \tcustomProperty: 'value'\n * } );\n * ```\n *\n * Subsequent calls with the same attribute will extend its custom properties:\n *\n * ```ts\n * schema.setAttributeProperties( 'blockQuote', {\n * \tone: 1\n * } );\n *\n * schema.setAttributeProperties( 'blockQuote', {\n * \ttwo: 2\n * } );\n *\n * console.log( schema.getAttributeProperties( 'blockQuote' ) );\n * // Logs: { one: 1, two: 2 }\n * ```\n *\n * @param attributeName A name of the attribute to receive the properties.\n * @param properties A dictionary of properties.\n */\n setAttributeProperties(attributeName, properties) {\n this._attributeProperties[attributeName] = Object.assign(this.getAttributeProperties(attributeName), properties);\n }\n /**\n * Returns properties associated with a given model attribute. See {@link #setAttributeProperties `setAttributeProperties()`}.\n *\n * @param attributeName A name of the attribute.\n */\n getAttributeProperties(attributeName) {\n return this._attributeProperties[attributeName] || {};\n }\n /**\n * Returns the lowest {@link module:engine/model/schema~Schema#isLimit limit element} containing the entire\n * selection/range/position or the root otherwise.\n *\n * @param selectionOrRangeOrPosition The selection/range/position to check.\n * @returns The lowest limit element containing the entire `selectionOrRangeOrPosition`.\n */\n getLimitElement(selectionOrRangeOrPosition) {\n let element;\n if (selectionOrRangeOrPosition instanceof Position) {\n element = selectionOrRangeOrPosition.parent;\n }\n else {\n const ranges = selectionOrRangeOrPosition instanceof Range ?\n [selectionOrRangeOrPosition] :\n Array.from(selectionOrRangeOrPosition.getRanges());\n // Find the common ancestor for all selection's ranges.\n element = ranges\n .reduce((element, range) => {\n const rangeCommonAncestor = range.getCommonAncestor();\n if (!element) {\n return rangeCommonAncestor;\n }\n return element.getCommonAncestor(rangeCommonAncestor, { includeSelf: true });\n }, null);\n }\n while (!this.isLimit(element)) {\n if (element.parent) {\n element = element.parent;\n }\n else {\n break;\n }\n }\n return element;\n }\n /**\n * Checks whether the attribute is allowed in selection:\n *\n * * if the selection is not collapsed, then checks if the attribute is allowed on any of nodes in that range,\n * * if the selection is collapsed, then checks if on the selection position there's a text with the\n * specified attribute allowed.\n *\n * @param selection Selection which will be checked.\n * @param attribute The name of the attribute to check.\n */\n checkAttributeInSelection(selection, attribute) {\n if (selection.isCollapsed) {\n const firstPosition = selection.getFirstPosition();\n const context = [\n ...firstPosition.getAncestors(),\n new Text('', selection.getAttributes())\n ];\n // Check whether schema allows for a text with the attribute in the selection.\n return this.checkAttribute(context, attribute);\n }\n else {\n const ranges = selection.getRanges();\n // For all ranges, check nodes in them until you find a node that is allowed to have the attribute.\n for (const range of ranges) {\n for (const value of range) {\n if (this.checkAttribute(value.item, attribute)) {\n // If we found a node that is allowed to have the attribute, return true.\n return true;\n }\n }\n }\n }\n // If we haven't found such node, return false.\n return false;\n }\n /**\n * Transforms the given set of ranges into a set of ranges where the given attribute is allowed (and can be applied).\n *\n * @param ranges Ranges to be validated.\n * @param attribute The name of the attribute to check.\n * @returns Ranges in which the attribute is allowed.\n */\n *getValidRanges(ranges, attribute) {\n ranges = convertToMinimalFlatRanges(ranges);\n for (const range of ranges) {\n yield* this._getValidRangesForRange(range, attribute);\n }\n }\n /**\n * Basing on given `position`, finds and returns a {@link module:engine/model/range~Range range} which is\n * nearest to that `position` and is a correct range for selection.\n *\n * The correct selection range might be collapsed when it is located in a position where the text node can be placed.\n * Non-collapsed range is returned when selection can be placed around element marked as an \"object\" in\n * the {@link module:engine/model/schema~Schema schema}.\n *\n * Direction of searching for the nearest correct selection range can be specified as:\n *\n * * `both` - searching will be performed in both ways,\n * * `forward` - searching will be performed only forward,\n * * `backward` - searching will be performed only backward.\n *\n * When valid selection range cannot be found, `null` is returned.\n *\n * @param position Reference position where new selection range should be looked for.\n * @param direction Search direction.\n * @returns Nearest selection range or `null` if one cannot be found.\n */\n getNearestSelectionRange(position, direction = 'both') {\n // Return collapsed range if provided position is valid.\n if (this.checkChild(position, '$text')) {\n return new Range(position);\n }\n let backwardWalker, forwardWalker;\n // Never leave a limit element.\n const limitElement = position.getAncestors().reverse().find(item => this.isLimit(item)) ||\n position.root;\n if (direction == 'both' || direction == 'backward') {\n backwardWalker = new TreeWalker({\n boundaries: Range._createIn(limitElement),\n startPosition: position,\n direction: 'backward'\n });\n }\n if (direction == 'both' || direction == 'forward') {\n forwardWalker = new TreeWalker({\n boundaries: Range._createIn(limitElement),\n startPosition: position\n });\n }\n for (const data of combineWalkers(backwardWalker, forwardWalker)) {\n const type = (data.walker == backwardWalker ? 'elementEnd' : 'elementStart');\n const value = data.value;\n if (value.type == type && this.isObject(value.item)) {\n return Range._createOn(value.item);\n }\n if (this.checkChild(value.nextPosition, '$text')) {\n return new Range(value.nextPosition);\n }\n }\n return null;\n }\n /**\n * Tries to find position ancestors that allow to insert a given node.\n * It starts searching from the given position and goes node by node to the top of the model tree\n * as long as a {@link module:engine/model/schema~Schema#isLimit limit element}, an\n * {@link module:engine/model/schema~Schema#isObject object element} or a topmost ancestor is not reached.\n *\n * @param position The position that the search will start from.\n * @param node The node for which an allowed parent should be found or its name.\n * @returns Allowed parent or null if nothing was found.\n */\n findAllowedParent(position, node) {\n let parent = position.parent;\n while (parent) {\n if (this.checkChild(parent, node)) {\n return parent;\n }\n // Do not split limit elements.\n if (this.isLimit(parent)) {\n return null;\n }\n parent = parent.parent;\n }\n return null;\n }\n /**\n * Sets attributes allowed by the schema on a given node.\n *\n * @param node A node to set attributes on.\n * @param attributes Attributes keys and values.\n * @param writer An instance of the model writer.\n */\n setAllowedAttributes(node, attributes, writer) {\n const model = writer.model;\n for (const [attributeName, attributeValue] of Object.entries(attributes)) {\n if (model.schema.checkAttribute(node, attributeName)) {\n writer.setAttribute(attributeName, attributeValue, node);\n }\n }\n }\n /**\n * Removes attributes disallowed by the schema.\n *\n * @param nodes Nodes that will be filtered.\n */\n removeDisallowedAttributes(nodes, writer) {\n for (const node of nodes) {\n // When node is a `Text` it has no children, so just filter it out.\n if (node.is('$text')) {\n removeDisallowedAttributeFromNode(this, node, writer);\n }\n // In a case of `Element` iterates through positions between nodes inside this element\n // and filter out node before the current position, or position parent when position\n // is at start of an element. Using positions prevent from omitting merged nodes\n // see https://github.com/ckeditor/ckeditor5-engine/issues/1789.\n else {\n const rangeInNode = Range._createIn(node);\n const positionsInRange = rangeInNode.getPositions();\n for (const position of positionsInRange) {\n const item = position.nodeBefore || position.parent;\n removeDisallowedAttributeFromNode(this, item, writer);\n }\n }\n }\n }\n /**\n * Gets attributes of a node that have a given property.\n *\n * @param node Node to get attributes from.\n * @param propertyName Name of the property that attribute must have to return it.\n * @param propertyValue Desired value of the property that we want to check.\n * When `undefined` attributes will be returned if they have set a given property no matter what the value is. If specified it will\n * return attributes which given property's value is equal to this parameter.\n * @returns Object with attributes' names as key and attributes' values as value.\n */\n getAttributesWithProperty(node, propertyName, propertyValue) {\n const attributes = {};\n for (const [attributeName, attributeValue] of node.getAttributes()) {\n const attributeProperties = this.getAttributeProperties(attributeName);\n if (attributeProperties[propertyName] === undefined) {\n continue;\n }\n if (propertyValue === undefined || propertyValue === attributeProperties[propertyName]) {\n attributes[attributeName] = attributeValue;\n }\n }\n return attributes;\n }\n /**\n * Creates an instance of the schema context.\n */\n createContext(context) {\n return new SchemaContext(context);\n }\n _clearCache() {\n this._compiledDefinitions = null;\n }\n _compile() {\n const compiledDefinitions = {};\n const sourceRules = this._sourceDefinitions;\n const itemNames = Object.keys(sourceRules);\n for (const itemName of itemNames) {\n compiledDefinitions[itemName] = compileBaseItemRule(sourceRules[itemName], itemName);\n }\n for (const itemName of itemNames) {\n compileAllowChildren(compiledDefinitions, itemName);\n }\n for (const itemName of itemNames) {\n compileAllowContentOf(compiledDefinitions, itemName);\n }\n for (const itemName of itemNames) {\n compileAllowWhere(compiledDefinitions, itemName);\n }\n for (const itemName of itemNames) {\n compileAllowAttributesOf(compiledDefinitions, itemName);\n compileInheritPropertiesFrom(compiledDefinitions, itemName);\n }\n for (const itemName of itemNames) {\n cleanUpAllowIn(compiledDefinitions, itemName);\n setupAllowChildren(compiledDefinitions, itemName);\n cleanUpAllowAttributes(compiledDefinitions, itemName);\n }\n this._compiledDefinitions = compiledDefinitions;\n }\n _checkContextMatch(def, context, contextItemIndex = context.length - 1) {\n const contextItem = context.getItem(contextItemIndex);\n if (def.allowIn.includes(contextItem.name)) {\n if (contextItemIndex == 0) {\n return true;\n }\n else {\n const parentRule = this.getDefinition(contextItem);\n return this._checkContextMatch(parentRule, context, contextItemIndex - 1);\n }\n }\n else {\n return false;\n }\n }\n /**\n * Takes a flat range and an attribute name. Traverses the range recursively and deeply to find and return all ranges\n * inside the given range on which the attribute can be applied.\n *\n * This is a helper function for {@link ~Schema#getValidRanges}.\n *\n * @param range The range to process.\n * @param attribute The name of the attribute to check.\n * @returns Ranges in which the attribute is allowed.\n */\n *_getValidRangesForRange(range, attribute) {\n let start = range.start;\n let end = range.start;\n for (const item of range.getItems({ shallow: true })) {\n if (item.is('element')) {\n yield* this._getValidRangesForRange(Range._createIn(item), attribute);\n }\n if (!this.checkAttribute(item, attribute)) {\n if (!start.isEqual(end)) {\n yield new Range(start, end);\n }\n start = Position._createAfter(item);\n }\n end = Position._createAfter(item);\n }\n if (!start.isEqual(end)) {\n yield new Range(start, end);\n }\n }\n}\n/**\n * A schema context &mdash; a list of ancestors of a given position in the document.\n *\n * Considering such position:\n *\n * ```xml\n * <$root>\n * \t<blockQuote>\n * \t\t<paragraph>\n * \t\t\t^\n * \t\t</paragraph>\n * \t</blockQuote>\n * </$root>\n * ```\n *\n * The context of this position is its {@link module:engine/model/position~Position#getAncestors lists of ancestors}:\n *\n *\t\t[ rootElement, blockQuoteElement, paragraphElement ]\n *\n * Contexts are used in the {@link module:engine/model/schema~Schema#event:checkChild `Schema#checkChild`} and\n * {@link module:engine/model/schema~Schema#event:checkAttribute `Schema#checkAttribute`} events as a definition\n * of a place in the document where the check occurs. The context instances are created based on the first arguments\n * of the {@link module:engine/model/schema~Schema#checkChild `Schema#checkChild()`} and\n * {@link module:engine/model/schema~Schema#checkAttribute `Schema#checkAttribute()`} methods so when\n * using these methods you need to use {@link module:engine/model/schema~SchemaContextDefinition}s.\n */\nexport class SchemaContext {\n /**\n * Creates an instance of the context.\n */\n constructor(context) {\n if (context instanceof SchemaContext) {\n return context;\n }\n let items;\n if (typeof context == 'string') {\n items = [context];\n }\n else if (!Array.isArray(context)) {\n // `context` is item or position.\n // Position#getAncestors() doesn't accept any parameters but it works just fine here.\n items = context.getAncestors({ includeSelf: true });\n }\n else {\n items = context;\n }\n this._items = items.map(mapContextItem);\n }\n /**\n * The number of items.\n */\n get length() {\n return this._items.length;\n }\n /**\n * The last item (the lowest node).\n */\n get last() {\n return this._items[this._items.length - 1];\n }\n /**\n * Iterable interface.\n *\n * Iterates over all context items.\n */\n [Symbol.iterator]() {\n return this._items[Symbol.iterator]();\n }\n /**\n * Returns a new schema context instance with an additional item.\n *\n * Item can be added as:\n *\n * ```ts\n * const context = new SchemaContext( [ '$root' ] );\n *\n * // An element.\n * const fooElement = writer.createElement( 'fooElement' );\n * const newContext = context.push( fooElement ); // [ '$root', 'fooElement' ]\n *\n * // A text node.\n * const text = writer.createText( 'foobar' );\n * const newContext = context.push( text ); // [ '$root', '$text' ]\n *\n * // A string (element name).\n * const newContext = context.push( 'barElement' ); // [ '$root', 'barElement' ]\n * ```\n *\n * **Note** {@link module:engine/model/node~Node} that is already in the model tree will be added as the only item\n * (without ancestors).\n *\n * @param item An item that will be added to the current context.\n * @returns A new schema context instance with an additional item.\n */\n push(item) {\n const ctx = new SchemaContext([item]);\n ctx._items = [...this._items, ...ctx._items];\n return ctx;\n }\n /**\n * Gets an item on the given index.\n */\n getItem(index) {\n return this._items[index];\n }\n /**\n * Returns the names of items.\n */\n *getNames() {\n yield* this._items.map(item => item.name);\n }\n /**\n * Checks whether the context ends with the given nodes.\n *\n * ```ts\n * const ctx = new SchemaContext( [ rootElement, paragraphElement, textNode ] );\n *\n * ctx.endsWith( '$text' ); // -> true\n * ctx.endsWith( 'paragraph $text' ); // -> true\n * ctx.endsWith( '$root' ); // -> false\n * ctx.endsWith( 'paragraph' ); // -> false\n * ```\n */\n endsWith(query) {\n return Array.from(this.getNames()).join(' ').endsWith(query);\n }\n /**\n * Checks whether the context starts with the given nodes.\n *\n * ```ts\n * const ctx = new SchemaContext( [ rootElement, paragraphElement, textNode ] );\n *\n * ctx.endsWith( '$root' ); // -> true\n * ctx.endsWith( '$root paragraph' ); // -> true\n * ctx.endsWith( '$text' ); // -> false\n * ctx.endsWith( 'paragraph' ); // -> false\n * ```\n */\n startsWith(query) {\n return Array.from(this.getNames()).join(' ').startsWith(query);\n }\n}\nfunction compileBaseItemRule(sourceItemRules, itemName) {\n const itemRule = {\n name: itemName,\n allowIn: [],\n allowContentOf: [],\n allowWhere: [],\n allowAttributes: [],\n allowAttributesOf: [],\n allowChildren: [],\n inheritTypesFrom: []\n };\n copyTypes(sourceItemRules, itemRule);\n copyProperty(sourceItemRules, itemRule, 'allowIn');\n copyProperty(sourceItemRules, itemRule, 'allowContentOf');\n copyProperty(sourceItemRules, itemRule, 'allowWhere');\n copyProperty(sourceItemRules, itemRule, 'allowAttributes');\n copyProperty(sourceItemRules, itemRule, 'allowAttributesOf');\n copyProperty(sourceItemRules, itemRule, 'allowChildren');\n copyProperty(sourceItemRules, itemRule, 'inheritTypesFrom');\n makeInheritAllWork(sourceItemRules, itemRule);\n return itemRule;\n}\nfunction compileAllowChildren(compiledDefinitions, itemName) {\n const item = compiledDefinitions[itemName];\n for (const allowChildrenItem of item.allowChildren) {\n const allowedChildren = compiledDefinitions[allowChildrenItem];\n // The allowChildren property may point to an unregistered element.\n if (!allowedChildren) {\n continue;\n }\n allowedChildren.allowIn.push(itemName);\n }\n // The allowIn property already includes correct items, reset the allowChildren property\n // to avoid duplicates later when setting up compilation results.\n item.allowChildren.length = 0;\n}\nfunction compileAllowContentOf(compiledDefinitions, itemName) {\n for (const allowContentOfItemName of compiledDefinitions[itemName].allowContentOf) {\n // The allowContentOf property may point to an unregistered element.\n if (compiledDefinitions[allowContentOfItemName]) {\n const allowedChildren = getAllowedChildren(compiledDefinitions, allowContentOfItemName);\n allowedChildren.forEach(allowedItem => {\n allowedItem.allowIn.push(itemName);\n });\n }\n }\n delete compiledDefinitions[itemName].allowContentOf;\n}\nfunction compileAllowWhere(compiledDefinitions, itemName) {\n for (const allowWhereItemName of compiledDefinitions[itemName].allowWhere) {\n const inheritFrom = compiledDefinitions[allowWhereItemName];\n // The allowWhere property may point to an unregistered element.\n if (inheritFrom) {\n const allowedIn = inheritFrom.allowIn;\n compiledDefinitions[itemName].allowIn.push(...allowedIn);\n }\n }\n delete compiledDefinitions[itemName].allowWhere;\n}\nfunction compileAllowAttributesOf(compiledDefinitions, itemName) {\n for (const allowAttributeOfItem of compiledDefinitions[itemName].allowAttributesOf) {\n const inheritFrom = compiledDefinitions[allowAttributeOfItem];\n if (inheritFrom) {\n const inheritAttributes = inheritFrom.allowAttributes;\n compiledDefinitions[itemName].allowAttributes.push(...inheritAttributes);\n }\n }\n delete compiledDefinitions[itemName].allowAttributesOf;\n}\nfunction compileInheritPropertiesFrom(compiledDefinitions, itemName) {\n const item = compiledDefinitions[itemName];\n for (const inheritPropertiesOfItem of item.inheritTypesFrom) {\n const inheritFrom = compiledDefinitions[inheritPropertiesOfItem];\n if (inheritFrom) {\n const typeNames = Object.keys(inheritFrom).filter(name => name.startsWith('is'));\n for (const name of typeNames) {\n if (!(name in item)) {\n item[name] = inheritFrom[name];\n }\n }\n }\n }\n delete item.inheritTypesFrom;\n}\n// Remove items which weren't registered (because it may break some checks or we'd need to complicate them).\n// Make sure allowIn doesn't contain repeated values.\nfunction cleanUpAllowIn(compiledDefinitions, itemName) {\n const itemRule = compiledDefinitions[itemName];\n const existingItems = itemRule.allowIn.filter(itemToCheck => compiledDefinitions[itemToCheck]);\n itemRule.allowIn = Array.from(new Set(existingItems));\n}\n// Setup allowChildren items based on allowIn.\nfunction setupAllowChildren(compiledDefinitions, itemName) {\n const itemRule = compiledDefinitions[itemName];\n for (const allowedParentItemName of itemRule.allowIn) {\n const allowedParentItem = compiledDefinitions[allowedParentItemName];\n allowedParentItem.allowChildren.push(itemName);\n }\n}\nfunction cleanUpAllowAttributes(compiledDefinitions, itemName) {\n const itemRule = compiledDefinitions[itemName];\n itemRule.allowAttributes = Array.from(new Set(itemRule.allowAttributes));\n}\nfunction copyTypes(sourceItemRules, itemRule) {\n for (const sourceItemRule of sourceItemRules) {\n const typeNames = Object.keys(sourceItemRule).filter(name => name.startsWith('is'));\n for (const name of typeNames) {\n itemRule[name] = !!sourceItemRule[name];\n }\n }\n}\nfunction copyProperty(sourceItemRules, itemRule, propertyName) {\n for (const sourceItemRule of sourceItemRules) {\n const value = sourceItemRule[propertyName];\n if (typeof value == 'string') {\n itemRule[propertyName].push(value);\n }\n else if (Array.isArray(value)) {\n itemRule[propertyName].push(...value);\n }\n }\n}\nfunction makeInheritAllWork(sourceItemRules, itemRule) {\n for (const sourceItemRule of sourceItemRules) {\n const inheritFrom = sourceItemRule.inheritAllFrom;\n if (inheritFrom) {\n itemRule.allowContentOf.push(inheritFrom);\n itemRule.allowWhere.push(inheritFrom);\n itemRule.allowAttributesOf.push(inheritFrom);\n itemRule.inheritTypesFrom.push(inheritFrom);\n }\n }\n}\nfunction getAllowedChildren(compiledDefinitions, itemName) {\n const itemRule = compiledDefinitions[itemName];\n return getValues(compiledDefinitions).filter(def => def.allowIn.includes(itemRule.name));\n}\nfunction getValues(obj) {\n return Object.keys(obj).map(key => obj[key]);\n}\nfunction mapContextItem(ctxItem) {\n if (typeof ctxItem == 'string' || ctxItem.is('documentFragment')) {\n return {\n name: typeof ctxItem == 'string' ? ctxItem : '$documentFragment',\n *getAttributeKeys() { },\n getAttribute() { }\n };\n }\n else {\n return {\n // '$text' means text nodes and text proxies.\n name: ctxItem.is('element') ? ctxItem.name : '$text',\n *getAttributeKeys() {\n yield* ctxItem.getAttributeKeys();\n },\n getAttribute(key) {\n return ctxItem.getAttribute(key);\n }\n };\n }\n}\n/**\n * Generator function returning values from provided walkers, switching between them at each iteration. If only one walker\n * is provided it will return data only from that walker.\n *\n * @param backward Walker iterating in backward direction.\n * @param forward Walker iterating in forward direction.\n * @returns Object returned at each iteration contains `value` and `walker` (informing which walker returned\n * given value) fields.\n */\nfunction* combineWalkers(backward, forward) {\n let done = false;\n while (!done) {\n done = true;\n if (backward) {\n const step = backward.next();\n if (!step.done) {\n done = false;\n yield {\n walker: backward,\n value: step.value\n };\n }\n }\n if (forward) {\n const step = forward.next();\n if (!step.done) {\n done = false;\n yield {\n walker: forward,\n value: step.value\n };\n }\n }\n }\n}\n/**\n * Takes an array of non-intersecting ranges. For each of them gets minimal flat ranges covering that range and returns\n * all those minimal flat ranges.\n *\n * @param ranges Ranges to process.\n * @returns Minimal flat ranges of given `ranges`.\n */\nfunction* convertToMinimalFlatRanges(ranges) {\n for (const range of ranges) {\n yield* range.getMinimalFlatRanges();\n }\n}\nfunction removeDisallowedAttributeFromNode(schema, node, writer) {\n for (const attribute of node.getAttributeKeys()) {\n if (!schema.checkAttribute(node, attribute)) {\n writer.removeAttribute(attribute, node);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/conversion/upcastdispatcher\n */\nimport ViewConsumable from './viewconsumable';\nimport ModelRange from '../model/range';\nimport ModelPosition from '../model/position';\nimport { SchemaContext } from '../model/schema'; // eslint-disable-line no-duplicate-imports\nimport { isParagraphable, wrapInParagraph } from '../model/utils/autoparagraphing';\nimport { CKEditorError, EmitterMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * Upcast dispatcher is a central point of the view-to-model conversion, which is a process of\n * converting a given {@link module:engine/view/documentfragment~DocumentFragment view document fragment} or\n * {@link module:engine/view/element~Element view element} into a correct model structure.\n *\n * During the conversion process, the dispatcher fires events for all {@link module:engine/view/node~Node view nodes}\n * from the converted view document fragment.\n * Special callbacks called \"converters\" should listen to these events in order to convert the view nodes.\n *\n * The second parameter of the callback is the `data` object with the following properties:\n *\n * * `data.viewItem` contains a {@link module:engine/view/node~Node view node} or a\n * {@link module:engine/view/documentfragment~DocumentFragment view document fragment}\n * that is converted at the moment and might be handled by the callback.\n * * `data.modelRange` is used to point to the result\n * of the current conversion (e.g. the element that is being inserted)\n * and is always a {@link module:engine/model/range~Range} when the conversion succeeds.\n * * `data.modelCursor` is a {@link module:engine/model/position~Position position} on which the converter should insert\n * the newly created items.\n *\n * The third parameter of the callback is an instance of {@link module:engine/conversion/upcastdispatcher~UpcastConversionApi}\n * which provides additional tools for converters.\n *\n * You can read more about conversion in the {@glink framework/deep-dive/conversion/upcast Upcast conversion} guide.\n *\n * Examples of event-based converters:\n *\n * ```ts\n * // A converter for links (<a>).\n * editor.data.upcastDispatcher.on( 'element:a', ( evt, data, conversionApi ) => {\n * \tif ( conversionApi.consumable.consume( data.viewItem, { name: true, attributes: [ 'href' ] } ) ) {\n * \t\t// The <a> element is inline and is represented by an attribute in the model.\n * \t\t// This is why you need to convert only children.\n * \t\tconst { modelRange } = conversionApi.convertChildren( data.viewItem, data.modelCursor );\n *\n * \t\tfor ( let item of modelRange.getItems() ) {\n * \t\t\tif ( conversionApi.schema.checkAttribute( item, 'linkHref' ) ) {\n * \t\t\t\tconversionApi.writer.setAttribute( 'linkHref', data.viewItem.getAttribute( 'href' ), item );\n * \t\t\t}\n * \t\t}\n * \t}\n * } );\n *\n * // Convert <p> element's font-size style.\n * // Note: You should use a low-priority observer in order to ensure that\n * // it is executed after the element-to-element converter.\n * editor.data.upcastDispatcher.on( 'element:p', ( evt, data, conversionApi ) => {\n * \tconst { consumable, schema, writer } = conversionApi;\n *\n * \tif ( !consumable.consume( data.viewItem, { style: 'font-size' } ) ) {\n * \t\treturn;\n * \t}\n *\n * \tconst fontSize = data.viewItem.getStyle( 'font-size' );\n *\n * \t// Do not go for the model element after data.modelCursor because it might happen\n * \t// that a single view element was converted to multiple model elements. Get all of them.\n * \tfor ( const item of data.modelRange.getItems( { shallow: true } ) ) {\n * \t\tif ( schema.checkAttribute( item, 'fontSize' ) ) {\n * \t\t\twriter.setAttribute( 'fontSize', fontSize, item );\n * \t\t}\n * \t}\n * }, { priority: 'low' } );\n *\n * // Convert all elements which have no custom converter into a paragraph (autoparagraphing).\n * editor.data.upcastDispatcher.on( 'element', ( evt, data, conversionApi ) => {\n * \t// Check if an element can be converted.\n * \tif ( !conversionApi.consumable.test( data.viewItem, { name: data.viewItem.name } ) ) {\n * \t\t// When an element is already consumed by higher priority converters, do nothing.\n * \t\treturn;\n * \t}\n *\n * \tconst paragraph = conversionApi.writer.createElement( 'paragraph' );\n *\n * \t// Try to safely insert a paragraph at the model cursor - it will find an allowed parent for the current element.\n * \tif ( !conversionApi.safeInsert( paragraph, data.modelCursor ) ) {\n * \t\t// When an element was not inserted, it means that you cannot insert a paragraph at this position.\n * \t\treturn;\n * \t}\n *\n * \t// Consume the inserted element.\n * \tconversionApi.consumable.consume( data.viewItem, { name: data.viewItem.name } ) );\n *\n * \t// Convert the children to a paragraph.\n * \tconst { modelRange } = conversionApi.convertChildren( data.viewItem, paragraph ) );\n *\n * \t// Update `modelRange` and `modelCursor` in the `data` as a conversion result.\n * \tconversionApi.updateConversionResult( paragraph, data );\n * }, { priority: 'low' } );\n * ```\n *\n * @fires viewCleanup\n * @fires element\n * @fires text\n * @fires documentFragment\n */\nexport default class UpcastDispatcher extends EmitterMixin() {\n /**\n * Creates an upcast dispatcher that operates using the passed API.\n *\n * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi\n * @param conversionApi Additional properties for an interface that will be passed to events fired\n * by the upcast dispatcher.\n */\n constructor(conversionApi) {\n super();\n /**\n * The list of elements that were created during splitting.\n *\n * After the conversion process, the list is cleared.\n */\n this._splitParts = new Map();\n /**\n * The list of cursor parent elements that were created during splitting.\n *\n * After the conversion process the list is cleared.\n */\n this._cursorParents = new Map();\n /**\n * The position in the temporary structure where the converted content is inserted. The structure reflects the context of\n * the target position where the content will be inserted. This property is built based on the context parameter of the\n * convert method.\n */\n this._modelCursor = null;\n /**\n * The list of elements that were created during the splitting but should not get removed on conversion end even if they are empty.\n *\n * The list is cleared after the conversion process.\n */\n this._emptyElementsToKeep = new Set();\n this.conversionApi = {\n ...conversionApi,\n consumable: null,\n writer: null,\n store: null,\n convertItem: (viewItem, modelCursor) => this._convertItem(viewItem, modelCursor),\n convertChildren: (viewElement, positionOrElement) => this._convertChildren(viewElement, positionOrElement),\n safeInsert: (modelNode, position) => this._safeInsert(modelNode, position),\n updateConversionResult: (modelElement, data) => this._updateConversionResult(modelElement, data),\n // Advanced API - use only if custom position handling is needed.\n splitToAllowedParent: (modelNode, modelCursor) => this._splitToAllowedParent(modelNode, modelCursor),\n getSplitParts: modelElement => this._getSplitParts(modelElement),\n keepEmptyElement: modelElement => this._keepEmptyElement(modelElement)\n };\n }\n /**\n * Starts the conversion process. The entry point for the conversion.\n *\n * @fires element\n * @fires text\n * @fires documentFragment\n * @param viewElement The part of the view to be converted.\n * @param writer An instance of the model writer.\n * @param context Elements will be converted according to this context.\n * @returns Model data that is the result of the conversion process\n * wrapped in `DocumentFragment`. Converted marker elements will be set as the document fragment's\n * {@link module:engine/model/documentfragment~DocumentFragment#markers static markers map}.\n */\n convert(viewElement, writer, context = ['$root']) {\n this.fire('viewCleanup', viewElement);\n // Create context tree and set position in the top element.\n // Items will be converted according to this position.\n this._modelCursor = createContextTree(context, writer);\n // Store writer in conversion as a conversion API\n // to be sure that conversion process will use the same batch.\n this.conversionApi.writer = writer;\n // Create consumable values list for conversion process.\n this.conversionApi.consumable = ViewConsumable.createFrom(viewElement);\n // Custom data stored by converter for conversion process.\n this.conversionApi.store = {};\n // Do the conversion.\n const { modelRange } = this._convertItem(viewElement, this._modelCursor);\n // Conversion result is always a document fragment so let's create it.\n const documentFragment = writer.createDocumentFragment();\n // When there is a conversion result.\n if (modelRange) {\n // Remove all empty elements that were create while splitting.\n this._removeEmptyElements();\n // Move all items that were converted in context tree to the document fragment.\n for (const item of Array.from(this._modelCursor.parent.getChildren())) {\n writer.append(item, documentFragment);\n }\n // Extract temporary markers elements from model and set as static markers collection.\n documentFragment.markers = extractMarkersFromModelFragment(documentFragment, writer);\n }\n // Clear context position.\n this._modelCursor = null;\n // Clear split elements & parents lists.\n this._splitParts.clear();\n this._cursorParents.clear();\n this._emptyElementsToKeep.clear();\n // Clear conversion API.\n this.conversionApi.writer = null;\n this.conversionApi.store = null;\n // Return fragment as conversion result.\n return documentFragment;\n }\n /**\n * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#convertItem\n */\n _convertItem(viewItem, modelCursor) {\n const data = { viewItem, modelCursor, modelRange: null };\n if (viewItem.is('element')) {\n this.fire(`element:${viewItem.name}`, data, this.conversionApi);\n }\n else if (viewItem.is('$text')) {\n this.fire('text', data, this.conversionApi);\n }\n else {\n this.fire('documentFragment', data, this.conversionApi);\n }\n // Handle incorrect conversion result.\n if (data.modelRange && !(data.modelRange instanceof ModelRange)) {\n /**\n * Incorrect conversion result was dropped.\n *\n * {@link module:engine/model/range~Range Model range} should be a conversion result.\n *\n * @error view-conversion-dispatcher-incorrect-result\n */\n throw new CKEditorError('view-conversion-dispatcher-incorrect-result', this);\n }\n return { modelRange: data.modelRange, modelCursor: data.modelCursor };\n }\n /**\n * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#convertChildren\n */\n _convertChildren(viewItem, elementOrModelCursor) {\n let nextModelCursor = elementOrModelCursor.is('position') ?\n elementOrModelCursor : ModelPosition._createAt(elementOrModelCursor, 0);\n const modelRange = new ModelRange(nextModelCursor);\n for (const viewChild of Array.from(viewItem.getChildren())) {\n const result = this._convertItem(viewChild, nextModelCursor);\n if (result.modelRange instanceof ModelRange) {\n modelRange.end = result.modelRange.end;\n nextModelCursor = result.modelCursor;\n }\n }\n return { modelRange, modelCursor: nextModelCursor };\n }\n /**\n * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#safeInsert\n */\n _safeInsert(modelNode, position) {\n // Find allowed parent for element that we are going to insert.\n // If current parent does not allow to insert element but one of the ancestors does\n // then split nodes to allowed parent.\n const splitResult = this._splitToAllowedParent(modelNode, position);\n // When there is no split result it means that we can't insert element to model tree, so let's skip it.\n if (!splitResult) {\n return false;\n }\n // Insert element on allowed position.\n this.conversionApi.writer.insert(modelNode, splitResult.position);\n return true;\n }\n /**\n * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#updateConversionResult\n */\n _updateConversionResult(modelElement, data) {\n const parts = this._getSplitParts(modelElement);\n const writer = this.conversionApi.writer;\n // Set conversion result range - only if not set already.\n if (!data.modelRange) {\n data.modelRange = writer.createRange(writer.createPositionBefore(modelElement), writer.createPositionAfter(parts[parts.length - 1]));\n }\n const savedCursorParent = this._cursorParents.get(modelElement);\n // Now we need to check where the `modelCursor` should be.\n if (savedCursorParent) {\n // If we split parent to insert our element then we want to continue conversion in the new part of the split parent.\n //\n // before: <allowed><notAllowed>foo[]</notAllowed></allowed>\n // after: <allowed><notAllowed>foo</notAllowed> <converted></converted> <notAllowed>[]</notAllowed></allowed>\n data.modelCursor = writer.createPositionAt(savedCursorParent, 0);\n }\n else {\n // Otherwise just continue after inserted element.\n data.modelCursor = data.modelRange.end;\n }\n }\n /**\n * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#splitToAllowedParent\n */\n _splitToAllowedParent(node, modelCursor) {\n const { schema, writer } = this.conversionApi;\n // Try to find allowed parent.\n let allowedParent = schema.findAllowedParent(modelCursor, node);\n if (allowedParent) {\n // When current position parent allows to insert node then return this position.\n if (allowedParent === modelCursor.parent) {\n return { position: modelCursor };\n }\n // When allowed parent is in context tree (it's outside the converted tree).\n if (this._modelCursor.parent.getAncestors().includes(allowedParent)) {\n allowedParent = null;\n }\n }\n if (!allowedParent) {\n // Check if the node wrapped with a paragraph would be accepted by the schema.\n if (!isParagraphable(modelCursor, node, schema)) {\n return null;\n }\n return {\n position: wrapInParagraph(modelCursor, writer)\n };\n }\n // Split element to allowed parent.\n const splitResult = this.conversionApi.writer.split(modelCursor, allowedParent);\n // Using the range returned by `model.Writer#split`, we will pair original elements with their split parts.\n //\n // The range returned from the writer spans \"over the split\" or, precisely saying, from the end of the original element (the one\n // that got split) to the beginning of the other part of that element:\n //\n // <limit><a><b><c>X[]Y</c></b><a></limit> ->\n // <limit><a><b><c>X[</c></b></a><a><b><c>]Y</c></b></a>\n //\n // After the split there cannot be any full node between the positions in `splitRange`. The positions are touching.\n // Also, because of how splitting works, it is easy to notice, that \"closing tags\" are in the reverse order than \"opening tags\".\n // Also, since we split all those elements, each of them has to have the other part.\n //\n // With those observations in mind, we will pair the original elements with their split parts by saving \"closing tags\" and matching\n // them with \"opening tags\" in the reverse order. For that we can use a stack.\n const stack = [];\n for (const treeWalkerValue of splitResult.range.getWalker()) {\n if (treeWalkerValue.type == 'elementEnd') {\n stack.push(treeWalkerValue.item);\n }\n else {\n // There should not be any text nodes after the element is split, so the only other value is `elementStart`.\n const originalPart = stack.pop();\n const splitPart = treeWalkerValue.item;\n this._registerSplitPair(originalPart, splitPart);\n }\n }\n const cursorParent = splitResult.range.end.parent;\n this._cursorParents.set(node, cursorParent);\n return {\n position: splitResult.position,\n cursorParent\n };\n }\n /**\n * Registers that a `splitPart` element is a split part of the `originalPart` element.\n *\n * The data set by this method is used by {@link #_getSplitParts} and {@link #_removeEmptyElements}.\n */\n _registerSplitPair(originalPart, splitPart) {\n if (!this._splitParts.has(originalPart)) {\n this._splitParts.set(originalPart, [originalPart]);\n }\n const list = this._splitParts.get(originalPart);\n this._splitParts.set(splitPart, list);\n list.push(splitPart);\n }\n /**\n * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#getSplitParts\n */\n _getSplitParts(element) {\n let parts;\n if (!this._splitParts.has(element)) {\n parts = [element];\n }\n else {\n parts = this._splitParts.get(element);\n }\n return parts;\n }\n /**\n * Mark an element that were created during the splitting to not get removed on conversion end even if it is empty.\n */\n _keepEmptyElement(element) {\n this._emptyElementsToKeep.add(element);\n }\n /**\n * Checks if there are any empty elements created while splitting and removes them.\n *\n * This method works recursively to re-check empty elements again after at least one element was removed in the initial call,\n * as some elements might have become empty after other empty elements were removed from them.\n */\n _removeEmptyElements() {\n let anyRemoved = false;\n for (const element of this._splitParts.keys()) {\n if (element.isEmpty && !this._emptyElementsToKeep.has(element)) {\n this.conversionApi.writer.remove(element);\n this._splitParts.delete(element);\n anyRemoved = true;\n }\n }\n if (anyRemoved) {\n this._removeEmptyElements();\n }\n }\n}\n/**\n * Traverses given model item and searches elements which marks marker range. Found element is removed from\n * DocumentFragment but path of this element is stored in a Map which is then returned.\n *\n * @param modelItem Fragment of model.\n * @returns List of static markers.\n */\nfunction extractMarkersFromModelFragment(modelItem, writer) {\n const markerElements = new Set();\n const markers = new Map();\n // Create ModelTreeWalker.\n const range = ModelRange._createIn(modelItem).getItems();\n // Walk through DocumentFragment and collect marker elements.\n for (const item of range) {\n // Check if current element is a marker.\n if (item.is('element', '$marker')) {\n markerElements.add(item);\n }\n }\n // Walk through collected marker elements store its path and remove its from the DocumentFragment.\n for (const markerElement of markerElements) {\n const markerName = markerElement.getAttribute('data-name');\n const currentPosition = writer.createPositionBefore(markerElement);\n // When marker of given name is not stored it means that we have found the beginning of the range.\n if (!markers.has(markerName)) {\n markers.set(markerName, new ModelRange(currentPosition.clone()));\n // Otherwise is means that we have found end of the marker range.\n }\n else {\n markers.get(markerName).end = currentPosition.clone();\n }\n // Remove marker element from DocumentFragment.\n writer.remove(markerElement);\n }\n return markers;\n}\n/**\n * Creates model fragment according to given context and returns position in the bottom (the deepest) element.\n */\nfunction createContextTree(contextDefinition, writer) {\n let position;\n for (const item of new SchemaContext(contextDefinition)) {\n const attributes = {};\n for (const key of item.getAttributeKeys()) {\n attributes[key] = item.getAttribute(key);\n }\n const current = writer.createElement(item.name, attributes);\n if (position) {\n writer.insert(current, position);\n }\n position = ModelPosition._createAt(current, 0);\n }\n return position;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Basic HTML writer. It uses the native `innerHTML` property for basic conversion\n * from a document fragment to an HTML string.\n */\nexport default class BasicHtmlWriter {\n /**\n * Returns an HTML string created from the document fragment.\n */\n getHtml(fragment) {\n const doc = document.implementation.createHTMLDocument('');\n const container = doc.createElement('div');\n container.appendChild(fragment);\n return container.innerHTML;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/dataprocessor/htmldataprocessor\n */\n/* globals DOMParser */\nimport BasicHtmlWriter from './basichtmlwriter';\nimport DomConverter from '../view/domconverter';\n/**\n * The HTML data processor class.\n * This data processor implementation uses HTML as input and output data.\n */\nexport default class HtmlDataProcessor {\n /**\n * Creates a new instance of the HTML data processor class.\n *\n * @param document The view document instance.\n */\n constructor(document) {\n this.skipComments = true;\n this.domParser = new DOMParser();\n this.domConverter = new DomConverter(document, { renderingMode: 'data' });\n this.htmlWriter = new BasicHtmlWriter();\n }\n /**\n * Converts a provided {@link module:engine/view/documentfragment~DocumentFragment document fragment}\n * to data format &mdash; in this case to an HTML string.\n *\n * @returns HTML string.\n */\n toData(viewFragment) {\n // Convert view DocumentFragment to DOM DocumentFragment.\n const domFragment = this.domConverter.viewToDom(viewFragment);\n // Convert DOM DocumentFragment to HTML output.\n return this.htmlWriter.getHtml(domFragment);\n }\n /**\n * Converts the provided HTML string to a view tree.\n *\n * @param data An HTML string.\n * @returns A converted view element.\n */\n toView(data) {\n // Convert input HTML data to DOM DocumentFragment.\n const domFragment = this._toDom(data);\n // Convert DOM DocumentFragment to view DocumentFragment.\n return this.domConverter.domToView(domFragment, { skipComments: this.skipComments });\n }\n /**\n * Registers a {@link module:engine/view/matcher~MatcherPattern} for view elements whose content should be treated as raw data\n * and not processed during the conversion from the DOM to the view elements.\n *\n * The raw data can be later accessed by a\n * {@link module:engine/view/element~Element#getCustomProperty custom property of a view element} called `\"$rawContent\"`.\n *\n * @param pattern Pattern matching all view elements whose content should be treated as raw data.\n */\n registerRawContentMatcher(pattern) {\n this.domConverter.registerRawContentMatcher(pattern);\n }\n /**\n * If the processor is set to use marked fillers, it will insert `&nbsp;` fillers wrapped in `<span>` elements\n * (`<span data-cke-filler=\"true\">&nbsp;</span>`) instead of regular `&nbsp;` characters.\n *\n * This mode allows for a more precise handling of the block fillers (so they do not leak into the editor content) but\n * bloats the editor data with additional markup.\n *\n * This mode may be required by some features and will be turned on by them automatically.\n *\n * @param type Whether to use the default or the marked `&nbsp;` block fillers.\n */\n useFillerType(type) {\n this.domConverter.blockFillerMode = type == 'marked' ? 'markedNbsp' : 'nbsp';\n }\n /**\n * Converts an HTML string to its DOM representation. Returns a document fragment containing nodes parsed from\n * the provided data.\n */\n _toDom(data) {\n // Wrap data with a <body> tag so leading non-layout nodes (like <script>, <style>, HTML comment)\n // will be preserved in the body collection.\n // Do it only for data that is not a full HTML document.\n if (!data.match(/<(?:html|body|head|meta)(?:\\s[^>]*)?>/i)) {\n data = `<body>${data}</body>`;\n }\n const document = this.domParser.parseFromString(data, 'text/html');\n const fragment = document.createDocumentFragment();\n const bodyChildNodes = document.body.childNodes;\n while (bodyChildNodes.length > 0) {\n fragment.appendChild(bodyChildNodes[0]);\n }\n return fragment;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/controller/datacontroller\n */\nimport { CKEditorError, EmitterMixin, ObservableMixin } from '@ckeditor/ckeditor5-utils';\nimport Mapper from '../conversion/mapper';\nimport DowncastDispatcher from '../conversion/downcastdispatcher';\nimport { insertAttributesAndChildren, insertText } from '../conversion/downcasthelpers';\nimport UpcastDispatcher from '../conversion/upcastdispatcher';\nimport { convertText, convertToModelFragment } from '../conversion/upcasthelpers';\nimport ViewDocumentFragment from '../view/documentfragment';\nimport ViewDocument from '../view/document';\nimport ViewDowncastWriter from '../view/downcastwriter';\nimport ModelRange from '../model/range';\nimport { autoParagraphEmptyRoots } from '../model/utils/autoparagraphing';\nimport HtmlDataProcessor from '../dataprocessor/htmldataprocessor';\nimport { logWarning } from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n/**\n * Controller for the data pipeline. The data pipeline controls how data is retrieved from the document\n * and set inside it. Hence, the controller features two methods which allow to {@link ~DataController#get get}\n * and {@link ~DataController#set set} data of the {@link ~DataController#model model}\n * using the given:\n *\n * * {@link module:engine/dataprocessor/dataprocessor~DataProcessor data processor},\n * * downcast converters,\n * * upcast converters.\n *\n * An instance of the data controller is always available in the {@link module:core/editor/editor~Editor#data `editor.data`}\n * property:\n *\n * ```ts\n * editor.data.get( { rootName: 'customRoot' } ); // -> '<p>Hello!</p>'\n * ```\n */\nexport default class DataController extends EmitterMixin() {\n /**\n * Creates a data controller instance.\n *\n * @param model Data model.\n * @param stylesProcessor The styles processor instance.\n */\n constructor(model, stylesProcessor) {\n super();\n this.model = model;\n this.mapper = new Mapper();\n this.downcastDispatcher = new DowncastDispatcher({\n mapper: this.mapper,\n schema: model.schema\n });\n this.downcastDispatcher.on('insert:$text', insertText(), { priority: 'lowest' });\n this.downcastDispatcher.on('insert', insertAttributesAndChildren(), { priority: 'lowest' });\n this.upcastDispatcher = new UpcastDispatcher({\n schema: model.schema\n });\n this.viewDocument = new ViewDocument(stylesProcessor);\n this.stylesProcessor = stylesProcessor;\n this.htmlProcessor = new HtmlDataProcessor(this.viewDocument);\n this.processor = this.htmlProcessor;\n this._viewWriter = new ViewDowncastWriter(this.viewDocument);\n // Define default converters for text and elements.\n //\n // Note that if there is no default converter for the element it will be skipped, for instance `<b>foo</b>` will be\n // converted to nothing. We therefore add `convertToModelFragment` as a last converter so it converts children of that\n // element to the document fragment so `<b>foo</b>` will still be converted to `foo` even if there is no converter for `<b>`.\n this.upcastDispatcher.on('text', convertText(), { priority: 'lowest' });\n this.upcastDispatcher.on('element', convertToModelFragment(), { priority: 'lowest' });\n this.upcastDispatcher.on('documentFragment', convertToModelFragment(), { priority: 'lowest' });\n ObservableMixin().prototype.decorate.call(this, 'init');\n ObservableMixin().prototype.decorate.call(this, 'set');\n ObservableMixin().prototype.decorate.call(this, 'get');\n ObservableMixin().prototype.decorate.call(this, 'toView');\n ObservableMixin().prototype.decorate.call(this, 'toModel');\n // Fire the `ready` event when the initialization has completed. Such low-level listener offers the possibility\n // to plug into the initialization pipeline without interrupting the initialization flow.\n this.on('init', () => {\n this.fire('ready');\n }, { priority: 'lowest' });\n // Fix empty roots after DataController is 'ready' (note that the init method could be decorated and stopped).\n // We need to handle this event because initial data could be empty and the post-fixer would not get triggered.\n this.on('ready', () => {\n this.model.enqueueChange({ isUndoable: false }, autoParagraphEmptyRoots);\n }, { priority: 'lowest' });\n }\n /**\n * Returns the model's data converted by downcast dispatchers attached to {@link #downcastDispatcher} and\n * formatted by the {@link #processor data processor}.\n *\n * A warning is logged when you try to retrieve data for a detached root, as most probably this is a mistake. A detached root should\n * be treated like it is removed, and you should not save its data. Note, that the detached root data is always an empty string.\n *\n * @fires get\n * @param options Additional configuration for the retrieved data. `DataController` provides two optional\n * properties: `rootName` and `trim`. Other properties of this object are specified by various editor features.\n * @param options.rootName Root name. Default 'main'.\n * @param options.trim Whether returned data should be trimmed. This option is set to `empty` by default,\n * which means whenever editor content is considered empty, an empty string will be returned. To turn off trimming completely\n * use `'none'`. In such cases the exact content will be returned (for example a `<p>&nbsp;</p>` for an empty editor).\n * @returns Output data.\n */\n get(options = {}) {\n const { rootName = 'main', trim = 'empty' } = options;\n if (!this._checkIfRootsExists([rootName])) {\n /**\n * Cannot get data from a non-existing root. This error is thrown when\n * {@link module:engine/controller/datacontroller~DataController#get `DataController#get()` method}\n * is called with a non-existent root name. For example, if there is an editor instance with only `main` root,\n * calling {@link module:engine/controller/datacontroller~DataController#get} like:\n *\n * ```ts\n * data.get( { rootName: 'root2' } );\n * ```\n *\n * will throw this error.\n *\n * @error datacontroller-get-non-existent-root\n */\n throw new CKEditorError('datacontroller-get-non-existent-root', this);\n }\n const root = this.model.document.getRoot(rootName);\n if (!root.isAttached()) {\n /**\n * Retrieving document data for a detached root.\n *\n * This usually indicates an error as a detached root should be considered \"removed\" and should not be included in the\n * document data.\n *\n * @error datacontroller-get-detached-root\n */\n logWarning('datacontroller-get-detached-root', this);\n }\n if (trim === 'empty' && !this.model.hasContent(root, { ignoreWhitespaces: true })) {\n return '';\n }\n return this.stringify(root, options);\n }\n /**\n * Returns the content of the given {@link module:engine/model/element~Element model's element} or\n * {@link module:engine/model/documentfragment~DocumentFragment model document fragment} converted by the downcast converters\n * attached to the {@link #downcastDispatcher} and formatted by the {@link #processor data processor}.\n *\n * @param modelElementOrFragment The element whose content will be stringified.\n * @param options Additional configuration passed to the conversion process.\n * @returns Output data.\n */\n stringify(modelElementOrFragment, options = {}) {\n // Model -> view.\n const viewDocumentFragment = this.toView(modelElementOrFragment, options);\n // View -> data.\n return this.processor.toData(viewDocumentFragment);\n }\n /**\n * Returns the content of the given {@link module:engine/model/element~Element model element} or\n * {@link module:engine/model/documentfragment~DocumentFragment model document fragment} converted by the downcast\n * converters attached to {@link #downcastDispatcher} into a\n * {@link module:engine/view/documentfragment~DocumentFragment view document fragment}.\n *\n * @fires toView\n * @param modelElementOrFragment Element or document fragment whose content will be converted.\n * @param options Additional configuration that will be available through the\n * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi#options} during the conversion process.\n * @returns Output view DocumentFragment.\n */\n toView(modelElementOrFragment, options = {}) {\n const viewDocument = this.viewDocument;\n const viewWriter = this._viewWriter;\n // Clear bindings so the call to this method returns correct results.\n this.mapper.clearBindings();\n // First, convert elements.\n const modelRange = ModelRange._createIn(modelElementOrFragment);\n const viewDocumentFragment = new ViewDocumentFragment(viewDocument);\n this.mapper.bindElements(modelElementOrFragment, viewDocumentFragment);\n // Prepare list of markers.\n // For document fragment, simply take the markers assigned to this document fragment.\n // For model root, all markers in that root will be taken.\n // For model element, we need to check which markers are intersecting with this element and relatively modify the markers' ranges.\n // Collapsed markers at element boundary, although considered as not intersecting with the element, will also be returned.\n const markers = modelElementOrFragment.is('documentFragment') ?\n modelElementOrFragment.markers :\n _getMarkersRelativeToElement(modelElementOrFragment);\n this.downcastDispatcher.convert(modelRange, markers, viewWriter, options);\n return viewDocumentFragment;\n }\n /**\n * Sets the initial input data parsed by the {@link #processor data processor} and\n * converted by the {@link #upcastDispatcher view-to-model converters}.\n * Initial data can be only set to a document whose {@link module:engine/model/document~Document#version} is equal 0.\n *\n * **Note** This method is {@link module:utils/observablemixin~Observable#decorate decorated} which is\n * used by e.g. collaborative editing plugin that syncs remote data on init.\n *\n * When data is passed as a string, it is initialized on the default `main` root:\n *\n * ```ts\n * dataController.init( '<p>Foo</p>' ); // Initializes data on the `main` root only, as no other is specified.\n * ```\n *\n * To initialize data on a different root or multiple roots at once, an object containing `rootName` - `data` pairs should be passed:\n *\n * ```ts\n * dataController.init( { main: '<p>Foo</p>', title: '<h1>Bar</h1>' } ); // Initializes data on both the `main` and `title` roots.\n * ```\n *\n * @fires init\n * @param data Input data as a string or an object containing the `rootName` - `data`\n * pairs to initialize data on multiple roots at once.\n * @returns Promise that is resolved after the data is set on the editor.\n */\n init(data) {\n if (this.model.document.version) {\n /**\n * Cannot set initial data to a non-empty {@link module:engine/model/document~Document}.\n * Initial data should be set once, during the {@link module:core/editor/editor~Editor} initialization,\n * when the {@link module:engine/model/document~Document#version} is equal 0.\n *\n * @error datacontroller-init-document-not-empty\n */\n throw new CKEditorError('datacontroller-init-document-not-empty', this);\n }\n let initialData = {};\n if (typeof data === 'string') {\n initialData.main = data; // Default root is 'main'. To initiate data on a different root, object should be passed.\n }\n else {\n initialData = data;\n }\n if (!this._checkIfRootsExists(Object.keys(initialData))) {\n /**\n * Cannot init data on a non-existent root. This error is thrown when\n * {@link module:engine/controller/datacontroller~DataController#init DataController#init() method}\n * is called with non-existent root name. For example, if there is an editor instance with only `main` root,\n * calling {@link module:engine/controller/datacontroller~DataController#init} like:\n *\n * ```ts\n * data.init( { main: '<p>Foo</p>', root2: '<p>Bar</p>' } );\n * ```\n *\n * will throw this error.\n *\n * @error datacontroller-init-non-existent-root\n */\n throw new CKEditorError('datacontroller-init-non-existent-root', this);\n }\n this.model.enqueueChange({ isUndoable: false }, writer => {\n for (const rootName of Object.keys(initialData)) {\n const modelRoot = this.model.document.getRoot(rootName);\n writer.insert(this.parse(initialData[rootName], modelRoot), modelRoot, 0);\n }\n });\n return Promise.resolve();\n }\n /**\n * Sets the input data parsed by the {@link #processor data processor} and\n * converted by the {@link #upcastDispatcher view-to-model converters}.\n * This method can be used any time to replace existing editor data with the new one without clearing the\n * {@link module:engine/model/document~Document#history document history}.\n *\n * This method also creates a batch with all the changes applied. If all you need is to parse data, use\n * the {@link #parse} method.\n *\n * When data is passed as a string it is set on the default `main` root:\n *\n * ```ts\n * dataController.set( '<p>Foo</p>' ); // Sets data on the `main` root, as no other is specified.\n * ```\n *\n * To set data on a different root or multiple roots at once, an object containing `rootName` - `data` pairs should be passed:\n *\n * ```ts\n * dataController.set( { main: '<p>Foo</p>', title: '<h1>Bar</h1>' } ); // Sets data on the `main` and `title` roots as specified.\n * ```\n *\n * To set the data with a preserved undo stack and add the change to the undo stack, set `{ isUndoable: true }` as a `batchType` option.\n *\n * ```ts\n * dataController.set( '<p>Foo</p>', { batchType: { isUndoable: true } } );\n * ```\n *\n * @fires set\n * @param data Input data as a string or an object containing the `rootName` - `data`\n * pairs to set data on multiple roots at once.\n * @param options Options for setting data.\n * @param options.batchType The batch type that will be used to create a batch for the changes applied by this method.\n * By default, the batch will be set as {@link module:engine/model/batch~Batch#isUndoable not undoable} and the undo stack will be\n * cleared after the new data is applied (all undo steps will be removed). If the batch type `isUndoable` flag is be set to `true`,\n * the undo stack will be preserved instead and not cleared when new data is applied.\n */\n set(data, options = {}) {\n let newData = {};\n if (typeof data === 'string') {\n newData.main = data; // The default root is 'main'. To set data on a different root, an object should be passed.\n }\n else {\n newData = data;\n }\n if (!this._checkIfRootsExists(Object.keys(newData))) {\n /**\n * Cannot set data on a non-existent root. This error is thrown when the\n * {@link module:engine/controller/datacontroller~DataController#set DataController#set() method}\n * is called with non-existent root name. For example, if there is an editor instance with only the default `main` root,\n * calling {@link module:engine/controller/datacontroller~DataController#set} like:\n *\n * ```ts\n * data.set( { main: '<p>Foo</p>', root2: '<p>Bar</p>' } );\n * ```\n *\n * will throw this error.\n *\n * @error datacontroller-set-non-existent-root\n */\n throw new CKEditorError('datacontroller-set-non-existent-root', this);\n }\n this.model.enqueueChange(options.batchType || {}, writer => {\n writer.setSelection(null);\n writer.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());\n for (const rootName of Object.keys(newData)) {\n // Save to model.\n const modelRoot = this.model.document.getRoot(rootName);\n writer.remove(writer.createRangeIn(modelRoot));\n writer.insert(this.parse(newData[rootName], modelRoot), modelRoot, 0);\n }\n });\n }\n /**\n * Returns the data parsed by the {@link #processor data processor} and then converted by upcast converters\n * attached to the {@link #upcastDispatcher}.\n *\n * @see #set\n * @param data Data to parse.\n * @param context Base context in which the view will be converted to the model.\n * See: {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#convert}.\n * @returns Parsed data.\n */\n parse(data, context = '$root') {\n // data -> view\n const viewDocumentFragment = this.processor.toView(data);\n // view -> model\n return this.toModel(viewDocumentFragment, context);\n }\n /**\n * Returns the result of the given {@link module:engine/view/element~Element view element} or\n * {@link module:engine/view/documentfragment~DocumentFragment view document fragment} converted by the\n * {@link #upcastDispatcher view-to-model converters}, wrapped by {@link module:engine/model/documentfragment~DocumentFragment}.\n *\n * When marker elements were converted during the conversion process, it will be set as a document fragment's\n * {@link module:engine/model/documentfragment~DocumentFragment#markers static markers map}.\n *\n * @fires toModel\n * @param viewElementOrFragment The element or document fragment whose content will be converted.\n * @param context Base context in which the view will be converted to the model.\n * See: {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#convert}.\n * @returns Output document fragment.\n */\n toModel(viewElementOrFragment, context = '$root') {\n return this.model.change(writer => {\n return this.upcastDispatcher.convert(viewElementOrFragment, writer, context);\n });\n }\n /**\n * Adds the style processor normalization rules.\n *\n * You can implement your own rules as well as use one of the available processor rules:\n *\n * * background: {@link module:engine/view/styles/background~addBackgroundRules}\n * * border: {@link module:engine/view/styles/border~addBorderRules}\n * * margin: {@link module:engine/view/styles/margin~addMarginRules}\n * * padding: {@link module:engine/view/styles/padding~addPaddingRules}\n */\n addStyleProcessorRules(callback) {\n callback(this.stylesProcessor);\n }\n /**\n * Registers a {@link module:engine/view/matcher~MatcherPattern} on an {@link #htmlProcessor htmlProcessor}\n * and a {@link #processor processor} for view elements whose content should be treated as raw data\n * and not processed during the conversion from DOM to view elements.\n *\n * The raw data can be later accessed by the {@link module:engine/view/element~Element#getCustomProperty view element custom property}\n * `\"$rawContent\"`.\n *\n * @param pattern Pattern matching all view elements whose content should be treated as a raw data.\n */\n registerRawContentMatcher(pattern) {\n // No need to register the pattern if both the `htmlProcessor` and `processor` are the same instances.\n if (this.processor && this.processor !== this.htmlProcessor) {\n this.processor.registerRawContentMatcher(pattern);\n }\n this.htmlProcessor.registerRawContentMatcher(pattern);\n }\n /**\n * Removes all event listeners set by the DataController.\n */\n destroy() {\n this.stopListening();\n }\n /**\n * Checks whether all provided root names are actually existing editor roots.\n *\n * @param rootNames Root names to check.\n * @returns Whether all provided root names are existing editor roots.\n */\n _checkIfRootsExists(rootNames) {\n for (const rootName of rootNames) {\n if (!this.model.document.getRoot(rootName)) {\n return false;\n }\n }\n return true;\n }\n}\n/**\n * Helper function for downcast conversion.\n *\n * Takes a document element (element that is added to a model document) and checks which markers are inside it. If the marker is collapsed\n * at element boundary, it is considered as contained inside the element and marker range is returned. Otherwise, if the marker is\n * intersecting with the element, the intersection is returned.\n */\nfunction _getMarkersRelativeToElement(element) {\n const result = [];\n const doc = element.root.document;\n if (!doc) {\n return new Map();\n }\n const elementRange = ModelRange._createIn(element);\n for (const marker of doc.model.markers) {\n const markerRange = marker.getRange();\n const isMarkerCollapsed = markerRange.isCollapsed;\n const isMarkerAtElementBoundary = markerRange.start.isEqual(elementRange.start) || markerRange.end.isEqual(elementRange.end);\n if (isMarkerCollapsed && isMarkerAtElementBoundary) {\n result.push([marker.name, markerRange]);\n }\n else {\n const updatedMarkerRange = elementRange.getIntersection(markerRange);\n if (updatedMarkerRange) {\n result.push([marker.name, updatedMarkerRange]);\n }\n }\n }\n // Sort the markers in a stable fashion to ensure that the order in which they are\n // added to the model's marker collection does not affect how they are\n // downcast. One particular use case that we are targeting here, is one where\n // two markers are adjacent but not overlapping, such as an insertion/deletion\n // suggestion pair representing the replacement of a range of text. In this\n // case, putting the markers in DOM order causes the first marker's end to be\n // serialized right after the second marker's start, while putting the markers\n // in reverse DOM order causes it to be right before the second marker's\n // start. So, we sort these in a way that ensures non-intersecting ranges are in\n // reverse DOM order, and intersecting ranges are in something approximating\n // reverse DOM order (since reverse DOM order doesn't have a precise meaning\n // when working with intersecting ranges).\n result.sort(([n1, r1], [n2, r2]) => {\n if (r1.end.compareWith(r2.start) !== 'after') {\n // m1.end <= m2.start -- m1 is entirely <= m2\n return 1;\n }\n else if (r1.start.compareWith(r2.end) !== 'before') {\n // m1.start >= m2.end -- m1 is entirely >= m2\n return -1;\n }\n else {\n // they overlap, so use their start positions as the primary sort key and\n // end positions as the secondary sort key\n switch (r1.start.compareWith(r2.start)) {\n case 'before':\n return 1;\n case 'after':\n return -1;\n default:\n switch (r1.end.compareWith(r2.end)) {\n case 'before':\n return 1;\n case 'after':\n return -1;\n default:\n return n2.localeCompare(n1);\n }\n }\n }\n });\n return new Map(result);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/conversion/conversion\n */\nimport { CKEditorError, toArray } from '@ckeditor/ckeditor5-utils';\nimport UpcastHelpers from './upcasthelpers';\nimport DowncastHelpers from './downcasthelpers';\n/**\n * A utility class that helps add converters to upcast and downcast dispatchers.\n *\n * We recommend reading the {@glink framework/deep-dive/conversion/intro editor conversion} guide first to\n * understand the core concepts of the conversion mechanisms.\n *\n * An instance of the conversion manager is available in the\n * {@link module:core/editor/editor~Editor#conversion `editor.conversion`} property\n * and by default has the following groups of dispatchers (i.e. directions of conversion):\n *\n * * `downcast` (editing and data downcasts)\n * * `editingDowncast`\n * * `dataDowncast`\n * * `upcast`\n *\n * # One-way converters\n *\n * To add a converter to a specific group, use the {@link module:engine/conversion/conversion~Conversion#for `for()`}\n * method:\n *\n * ```ts\n * // Add a converter to editing downcast and data downcast.\n * editor.conversion.for( 'downcast' ).elementToElement( config ) );\n *\n * // Add a converter to the data pipepline only:\n * editor.conversion.for( 'dataDowncast' ).elementToElement( dataConversionConfig ) );\n *\n * // And a slightly different one for the editing pipeline:\n * editor.conversion.for( 'editingDowncast' ).elementToElement( editingConversionConfig ) );\n * ```\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `for()`} method documentation to learn more about\n * available conversion helpers and how to use your custom ones.\n *\n * # Two-way converters\n *\n * Besides using one-way converters via the `for()` method, you can also use other methods available in this\n * class to add two-way converters (upcast and downcast):\n *\n * * {@link module:engine/conversion/conversion~Conversion#elementToElement `elementToElement()`} &ndash;\n * Model element to view element and vice versa.\n * * {@link module:engine/conversion/conversion~Conversion#attributeToElement `attributeToElement()`} &ndash;\n * Model attribute to view element and vice versa.\n * * {@link module:engine/conversion/conversion~Conversion#attributeToAttribute `attributeToAttribute()`} &ndash;\n * Model attribute to view attribute and vice versa.\n */\nexport default class Conversion {\n /**\n * Creates a new conversion instance.\n */\n constructor(downcastDispatchers, upcastDispatchers) {\n /**\n * Maps dispatchers group name to ConversionHelpers instances.\n */\n this._helpers = new Map();\n // Define default 'downcast' & 'upcast' dispatchers groups. Those groups are always available as two-way converters needs them.\n this._downcast = toArray(downcastDispatchers);\n this._createConversionHelpers({ name: 'downcast', dispatchers: this._downcast, isDowncast: true });\n this._upcast = toArray(upcastDispatchers);\n this._createConversionHelpers({ name: 'upcast', dispatchers: this._upcast, isDowncast: false });\n }\n /**\n * Define an alias for registered dispatcher.\n *\n * ```ts\n * const conversion = new Conversion(\n * \t[ dataDowncastDispatcher, editingDowncastDispatcher ],\n * \tupcastDispatcher\n * );\n *\n * conversion.addAlias( 'dataDowncast', dataDowncastDispatcher );\n * ```\n *\n * @param alias An alias of a dispatcher.\n * @param dispatcher Dispatcher which should have an alias.\n */\n addAlias(alias, dispatcher) {\n const isDowncast = this._downcast.includes(dispatcher);\n const isUpcast = this._upcast.includes(dispatcher);\n if (!isUpcast && !isDowncast) {\n /**\n * Trying to register an alias for a dispatcher that nas not been registered.\n *\n * @error conversion-add-alias-dispatcher-not-registered\n */\n throw new CKEditorError('conversion-add-alias-dispatcher-not-registered', this);\n }\n this._createConversionHelpers({ name: alias, dispatchers: [dispatcher], isDowncast });\n }\n /**\n * Provides a chainable API to assign converters to a conversion dispatchers group.\n *\n * If the given group name has not been registered, the\n * {@link module:utils/ckeditorerror~CKEditorError `conversion-for-unknown-group` error} is thrown.\n *\n * You can use conversion helpers available directly in the `for()` chain or your custom ones via\n * the {@link module:engine/conversion/conversionhelpers~ConversionHelpers#add `add()`} method.\n *\n * # Using built-in conversion helpers\n *\n * The `for()` chain comes with a set of conversion helpers which you can use like this:\n *\n * ```ts\n * editor.conversion.for( 'downcast' )\n * \t.elementToElement( config1 ) // Adds an element-to-element downcast converter.\n * \t.attributeToElement( config2 ); // Adds an attribute-to-element downcast converter.\n *\n * editor.conversion.for( 'upcast' )\n * \t.elementToAttribute( config3 ); // Adds an element-to-attribute upcast converter.\n * ```\n *\n * Refer to the documentation of built-in conversion helpers to learn about their configuration options.\n *\n * * downcast (model-to-view) conversion helpers:\n *\n *\t* {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`},\n *\t* {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement `attributeToElement()`},\n *\t* {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToAttribute `attributeToAttribute()`}.\n *\t* {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToElement `markerToElement()`}.\n *\t* {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToHighlight `markerToHighlight()`}.\n *\n * * upcast (view-to-model) conversion helpers:\n *\n *\t* {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToElement `elementToElement()`},\n *\t* {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToAttribute `elementToAttribute()`},\n *\t* {@link module:engine/conversion/upcasthelpers~UpcastHelpers#attributeToAttribute `attributeToAttribute()`}.\n *\t* {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToMarker `elementToMarker()`}.\n *\n * # Using custom conversion helpers\n *\n * If you need to implement an atypical converter, you can do so by calling:\n *\n * ```ts\n * editor.conversion.for( direction ).add( customHelper );\n * ```\n *\n * The `.add()` method takes exactly one parameter, which is a function. This function should accept one parameter that\n * is a dispatcher instance. The function should add an actual converter to the passed dispatcher instance.\n *\n * Example:\n *\n * ```ts\n * editor.conversion.for( 'upcast' ).add( dispatcher => {\n * \tdispatcher.on( 'element:a', ( evt, data, conversionApi ) => {\n * \t\t// Do something with a view <a> element.\n * \t} );\n * } );\n * ```\n *\n * Refer to the documentation of {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher}\n * and {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} to learn how to write\n * custom converters.\n *\n * @param groupName The name of dispatchers group to add the converters to.\n */\n for(groupName) {\n if (!this._helpers.has(groupName)) {\n /**\n * Trying to add a converter to an unknown dispatchers group.\n *\n * @error conversion-for-unknown-group\n */\n throw new CKEditorError('conversion-for-unknown-group', this);\n }\n return this._helpers.get(groupName);\n }\n /**\n * Sets up converters between the model and the view that convert a model element to a view element (and vice versa).\n * For example, the model `<paragraph>Foo</paragraph>` is turned into `<p>Foo</p>` in the view.\n *\n * ```ts\n * // A simple conversion from the `paragraph` model element to the `<p>` view element (and vice versa).\n * editor.conversion.elementToElement( { model: 'paragraph', view: 'p' } );\n *\n * // Override other converters by specifying a converter definition with a higher priority.\n * editor.conversion.elementToElement( { model: 'paragraph', view: 'div', converterPriority: 'high' } );\n *\n * // View specified as an object instead of a string.\n * editor.conversion.elementToElement( {\n * \tmodel: 'fancyParagraph',\n * \tview: {\n * \t\tname: 'p',\n * \t\tclasses: 'fancy'\n * \t}\n * } );\n *\n * // Use `upcastAlso` to define other view elements that should also be converted to a `paragraph` element.\n * editor.conversion.elementToElement( {\n * \tmodel: 'paragraph',\n * \tview: 'p',\n * \tupcastAlso: [\n * \t\t'div',\n * \t\t{\n * \t\t\t// Any element with the `display: block` style.\n * \t\t\tstyles: {\n * \t\t\t\tdisplay: 'block'\n * \t\t\t}\n * \t\t}\n * \t]\n * } );\n *\n * // `upcastAlso` set as callback enables a conversion of a wide range of different view elements.\n * editor.conversion.elementToElement( {\n * \tmodel: 'heading',\n * \tview: 'h2',\n * \t// Convert \"heading-like\" paragraphs to headings.\n * \tupcastAlso: viewElement => {\n * \t\tconst fontSize = viewElement.getStyle( 'font-size' );\n *\n * \t\tif ( !fontSize ) {\n * \t\t\treturn null;\n * \t\t}\n *\n * \t\tconst match = fontSize.match( /(\\d+)\\s*px/ );\n *\n * \t\tif ( !match ) {\n * \t\t\treturn null;\n * \t\t}\n *\n * \t\tconst size = Number( match[ 1 ] );\n *\n * \t\tif ( size > 26 ) {\n * \t\t\t// Returned value can be an object with the matched properties.\n * \t\t\t// These properties will be \"consumed\" during the conversion.\n * \t\t\t// See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.\n *\n * \t\t\treturn { name: true, styles: [ 'font-size' ] };\n * \t\t}\n *\n * \t\treturn null;\n * \t}\n * } );\n * ```\n *\n * `definition.model` is a `String` with a model element name to convert from or to.\n *\n * @param definition The converter definition.\n */\n elementToElement(definition) {\n // Set up downcast converter.\n this.for('downcast').elementToElement(definition);\n // Set up upcast converter.\n for (const { model, view } of _getAllUpcastDefinitions(definition)) {\n this.for('upcast')\n .elementToElement({\n model,\n view,\n converterPriority: definition.converterPriority\n });\n }\n }\n /**\n * Sets up converters between the model and the view that convert a model attribute to a view element (and vice versa).\n * For example, a model text node with `\"Foo\"` as data and the `bold` attribute will be turned to `<strong>Foo</strong>` in the view.\n *\n * ```ts\n * // A simple conversion from the `bold=true` attribute to the `<strong>` view element (and vice versa).\n * editor.conversion.attributeToElement( { model: 'bold', view: 'strong' } );\n *\n * // Override other converters by specifying a converter definition with a higher priority.\n * editor.conversion.attributeToElement( { model: 'bold', view: 'b', converterPriority: 'high' } );\n *\n * // View specified as an object instead of a string.\n * editor.conversion.attributeToElement( {\n * \tmodel: 'bold',\n * \tview: {\n * \t\tname: 'span',\n * \t\tclasses: 'bold'\n * \t}\n * } );\n *\n * // Use `config.model.name` to define the conversion only from a given node type, `$text` in this case.\n * // The same attribute on different elements may then be handled by a different converter.\n * editor.conversion.attributeToElement( {\n * \tmodel: {\n * \t\tkey: 'textDecoration',\n * \t\tvalues: [ 'underline', 'lineThrough' ],\n * \t\tname: '$text'\n * \t},\n * \tview: {\n * \t\tunderline: {\n * \t\t\tname: 'span',\n * \t\t\tstyles: {\n * \t\t\t\t'text-decoration': 'underline'\n * \t\t\t}\n * \t\t},\n * \t\tlineThrough: {\n * \t\t\tname: 'span',\n * \t\t\tstyles: {\n * \t\t\t\t'text-decoration': 'line-through'\n * \t\t\t}\n * \t\t}\n * \t}\n * } );\n *\n * // Use `upcastAlso` to define other view elements that should also be converted to the `bold` attribute.\n * editor.conversion.attributeToElement( {\n * \tmodel: 'bold',\n * \tview: 'strong',\n * \tupcastAlso: [\n * \t\t'b',\n * \t\t{\n * \t\t\tname: 'span',\n * \t\t\tclasses: 'bold'\n * \t\t},\n * \t\t{\n * \t\t\tname: 'span',\n * \t\t\tstyles: {\n * \t\t\t\t'font-weight': 'bold'\n * \t\t\t}\n * \t\t},\n * \t\tviewElement => {\n * \t\t\tconst fontWeight = viewElement.getStyle( 'font-weight' );\n *\n * \t\t\tif ( viewElement.is( 'element', 'span' ) && fontWeight && /\\d+/.test() && Number( fontWeight ) > 500 ) {\n * \t\t\t\t// Returned value can be an object with the matched properties.\n * \t\t\t\t// These properties will be \"consumed\" during the conversion.\n * \t\t\t\t// See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.\n *\n * \t\t\t\treturn {\n * \t\t\t\t\tname: true,\n * \t\t\t\t\tstyles: [ 'font-weight' ]\n * \t\t\t\t};\n * \t\t\t}\n * \t\t}\n * \t]\n * } );\n *\n * // Conversion from and to a model attribute key whose value is an enum (`fontSize=big|small`).\n * // `upcastAlso` set as callback enables a conversion of a wide range of different view elements.\n * editor.conversion.attributeToElement( {\n * \tmodel: {\n * \t\tkey: 'fontSize',\n * \t\tvalues: [ 'big', 'small' ]\n * \t},\n * \tview: {\n * \t\tbig: {\n * \t\t\tname: 'span',\n * \t\t\tstyles: {\n * \t\t\t\t'font-size': '1.2em'\n * \t\t\t}\n * \t\t},\n * \t\tsmall: {\n * \t\t\tname: 'span',\n * \t\t\tstyles: {\n * \t\t\t\t'font-size': '0.8em'\n * \t\t\t}\n * \t\t}\n * \t},\n * \tupcastAlso: {\n * \t\tbig: viewElement => {\n * \t\t\tconst fontSize = viewElement.getStyle( 'font-size' );\n *\n * \t\t\tif ( !fontSize ) {\n * \t\t\t\treturn null;\n * \t\t\t}\n *\n * \t\t\tconst match = fontSize.match( /(\\d+)\\s*px/ );\n *\n * \t\t\tif ( !match ) {\n * \t\t\t\treturn null;\n * \t\t\t}\n *\n * \t\t\tconst size = Number( match[ 1 ] );\n *\n * \t\t\tif ( viewElement.is( 'element', 'span' ) && size > 10 ) {\n * \t\t\t\t// Returned value can be an object with the matched properties.\n * \t\t\t\t// These properties will be \"consumed\" during the conversion.\n * \t\t\t\t// See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.\n *\n * \t\t\t\treturn { name: true, styles: [ 'font-size' ] };\n * \t\t\t}\n *\n * \t\t\treturn null;\n * \t\t},\n * \t\tsmall: viewElement => {\n * \t\t\tconst fontSize = viewElement.getStyle( 'font-size' );\n *\n * \t\t\tif ( !fontSize ) {\n * \t\t\t\treturn null;\n * \t\t\t}\n *\n * \t\t\tconst match = fontSize.match( /(\\d+)\\s*px/ );\n *\n * \t\t\tif ( !match ) {\n * \t\t\t\treturn null;\n * \t\t\t}\n *\n * \t\t\tconst size = Number( match[ 1 ] );\n *\n * \t\t\tif ( viewElement.is( 'element', 'span' ) && size < 10 ) {\n * \t\t\t\t// Returned value can be an object with the matched properties.\n * \t\t\t\t// These properties will be \"consumed\" during the conversion.\n * \t\t\t\t// See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.\n *\n * \t\t\t\treturn { name: true, styles: [ 'font-size' ] };\n * \t\t\t}\n *\n * \t\t\treturn null;\n * \t\t}\n * \t}\n * } );\n * ```\n *\n * The `definition.model` parameter specifies which model attribute should be converted from or to. It can be a `{ key, value }` object\n * describing the attribute key and value to convert or a `String` specifying just the attribute key (in such a case\n * `value` is set to `true`).\n *\n * @param definition The converter definition.\n */\n attributeToElement(definition) {\n // Set up downcast converter.\n this.for('downcast').attributeToElement(definition);\n // Set up upcast converter.\n for (const { model, view } of _getAllUpcastDefinitions(definition)) {\n this.for('upcast')\n .elementToAttribute({\n view,\n model,\n converterPriority: definition.converterPriority\n });\n }\n }\n /**\n * Sets up converters between the model and the view that convert a model attribute to a view attribute (and vice versa). For example,\n * `<imageBlock src='foo.jpg'></imageBlock>` is converted to `<img src='foo.jpg'></img>` (the same attribute key and value).\n * This type of converters is intended to be used with {@link module:engine/model/element~Element model element} nodes.\n * To convert the text attributes,\n * the {@link module:engine/conversion/conversion~Conversion#attributeToElement `attributeToElement converter`}should be set up.\n *\n * ```ts\n * // A simple conversion from the `source` model attribute to the `src` view attribute (and vice versa).\n * editor.conversion.attributeToAttribute( { model: 'source', view: 'src' } );\n *\n * // Attribute values are strictly specified.\n * editor.conversion.attributeToAttribute( {\n * \tmodel: {\n * \t\tname: 'imageInline',\n * \t\tkey: 'aside',\n * \t\tvalues: [ 'aside' ]\n * \t},\n * \tview: {\n * \t\taside: {\n * \t\t\tname: 'img',\n * \t\t\tkey: 'class',\n * \t\t\tvalue: [ 'aside', 'half-size' ]\n * \t\t}\n * \t}\n * } );\n *\n * // Set the style attribute.\n * editor.conversion.attributeToAttribute( {\n * \tmodel: {\n * \t\tname: 'imageInline',\n * \t\tkey: 'aside',\n * \t\tvalues: [ 'aside' ]\n * \t},\n * \tview: {\n * \t\taside: {\n * \t\t\tname: 'img',\n * \t\t\tkey: 'style',\n * \t\t\tvalue: {\n * \t\t\t\tfloat: 'right',\n * \t\t\t\twidth: '50%',\n * \t\t\t\tmargin: '5px'\n * \t\t\t}\n * \t\t}\n * \t}\n * } );\n *\n * // Conversion from and to a model attribute key whose value is an enum (`align=right|center`).\n * // Use `upcastAlso` to define other view elements that should also be converted to the `align=right` attribute.\n * editor.conversion.attributeToAttribute( {\n * \tmodel: {\n * \t\tkey: 'align',\n * \t\tvalues: [ 'right', 'center' ]\n * \t},\n * \tview: {\n * \t\tright: {\n * \t\t\tkey: 'class',\n * \t\t\tvalue: 'align-right'\n * \t\t},\n * \t\tcenter: {\n * \t\t\tkey: 'class',\n * \t\t\tvalue: 'align-center'\n * \t\t}\n * \t},\n * \tupcastAlso: {\n * \t\tright: {\n * \t\t\tstyles: {\n * \t\t\t\t'text-align': 'right'\n * \t\t\t}\n * \t\t},\n * \t\tcenter: {\n * \t\t\tstyles: {\n * \t\t\t\t'text-align': 'center'\n * \t\t\t}\n * \t\t}\n * \t}\n * } );\n * ```\n *\n * The `definition.model` parameter specifies which model attribute should be converted from and to.\n * It can be a `{ key, [ values ], [ name ] }` object or a `String`, which will be treated like `{ key: definition.model }`.\n * The `key` property is the model attribute key to convert from and to.\n * The `values` are the possible model attribute values. If the `values` parameter is not set, the model attribute value\n * will be the same as the view attribute value.\n * If `name` is set, the conversion will be set up only for model elements with the given name.\n *\n * The `definition.view` parameter specifies which view attribute should be converted from and to.\n * It can be a `{ key, value, [ name ] }` object or a `String`, which will be treated like `{ key: definition.view }`.\n * The `key` property is the view attribute key to convert from and to.\n * The `value` is the view attribute value to convert from and to. If `definition.value` is not set, the view attribute value will be\n * the same as the model attribute value.\n * If `key` is `'class'`, `value` can be a `String` or an array of `String`s.\n * If `key` is `'style'`, `value` is an object with key-value pairs.\n * In other cases, `value` is a `String`.\n * If `name` is set, the conversion will be set up only for model elements with the given name.\n * If `definition.model.values` is set, `definition.view` is an object that assigns values from `definition.model.values`\n * to `{ key, value, [ name ] }` objects.\n *\n * `definition.upcastAlso` specifies which other matching view elements should also be upcast to the given model configuration.\n * If `definition.model.values` is set, `definition.upcastAlso` should be an object assigning values from `definition.model.values`\n * to {@link module:engine/view/matcher~MatcherPattern}s or arrays of {@link module:engine/view/matcher~MatcherPattern}s.\n *\n * **Note:** `definition.model` and `definition.view` form should be mirrored, so the same types of parameters should\n * be given in both parameters.\n *\n * @param definition The converter definition.\n * @param definition.model The model attribute to convert from and to.\n * @param definition.view The view attribute to convert from and to.\n * @param definition.upcastAlso Any view element matching `definition.upcastAlso` will also be converted to the given model attribute.\n * `definition.upcastAlso` is used only if `config.model.values` is specified.\n */\n attributeToAttribute(definition) {\n // Set up downcast converter.\n this.for('downcast').attributeToAttribute(definition);\n // Set up upcast converter.\n for (const { model, view } of _getAllUpcastDefinitions(definition)) {\n this.for('upcast')\n .attributeToAttribute({\n view,\n model\n });\n }\n }\n /**\n * Creates and caches conversion helpers for given dispatchers group.\n *\n * @param options.name Group name.\n */\n _createConversionHelpers({ name, dispatchers, isDowncast }) {\n if (this._helpers.has(name)) {\n /**\n * Trying to register a group name that has already been registered.\n *\n * @error conversion-group-exists\n */\n throw new CKEditorError('conversion-group-exists', this);\n }\n const helpers = isDowncast ?\n new DowncastHelpers(dispatchers) :\n new UpcastHelpers(dispatchers);\n this._helpers.set(name, helpers);\n }\n}\n/**\n * Helper function that creates a joint array out of an item passed in `definition.view` and items passed in\n * `definition.upcastAlso`.\n */\nfunction* _getAllUpcastDefinitions(definition) {\n if (definition.model.values) {\n for (const value of definition.model.values) {\n const model = { key: definition.model.key, value };\n const view = definition.view[value];\n const upcastAlso = definition.upcastAlso ? definition.upcastAlso[value] : undefined;\n yield* _getUpcastDefinition(model, view, upcastAlso);\n }\n }\n else {\n yield* _getUpcastDefinition(definition.model, definition.view, definition.upcastAlso);\n }\n}\nfunction* _getUpcastDefinition(model, view, upcastAlso) {\n yield { model, view };\n if (upcastAlso) {\n for (const upcastAlsoItem of toArray(upcastAlso)) {\n yield { model, view: upcastAlsoItem };\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/operation\n */\n/**\n * Abstract base operation class.\n */\nexport default class Operation {\n /**\n * Base operation constructor.\n *\n * @param baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n * can be applied or `null` if the operation operates on detached (non-document) tree.\n */\n constructor(baseVersion) {\n this.baseVersion = baseVersion;\n this.isDocumentOperation = this.baseVersion !== null;\n this.batch = null;\n }\n /**\n * Checks whether the operation's parameters are correct and the operation can be correctly executed. Throws\n * an error if operation is not valid.\n *\n * @internal\n */\n _validate() {\n }\n /**\n * Custom toJSON method to solve child-parent circular dependencies.\n *\n * @returns Clone of this object with the operation property replaced with string.\n */\n toJSON() {\n // This method creates only a shallow copy, all nested objects should be defined separately.\n // See https://github.com/ckeditor/ckeditor5-engine/issues/1477.\n const json = Object.assign({}, this);\n json.__className = this.constructor.className;\n // Remove reference to the parent `Batch` to avoid circular dependencies.\n delete json.batch;\n // Only document operations are shared with other clients so it is not necessary to keep this information.\n delete json.isDocumentOperation;\n return json;\n }\n /**\n * Name of the operation class used for serialization.\n */\n static get className() {\n return 'Operation';\n }\n /**\n * Creates `Operation` object from deserialized object, i.e. from parsed JSON string.\n *\n * @param json Deserialized JSON object.\n * @param doc Document on which this operation will be applied.\n */\n static fromJSON(json, document) {\n return new this(json.baseVersion);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/utils\n */\nimport Node from '../node';\nimport Range from '../range';\nimport Text from '../text';\nimport TextProxy from '../textproxy';\nimport { CKEditorError, isIterable } from '@ckeditor/ckeditor5-utils';\n/**\n * Inserts given nodes at given position.\n *\n * @internal\n * @param position Position at which nodes should be inserted.\n * @param normalizedNodes Nodes to insert.\n * @returns Range spanning over inserted elements.\n */\nexport function _insert(position, nodes) {\n const normalizedNodes = _normalizeNodes(nodes);\n // We have to count offset before inserting nodes because they can get merged and we would get wrong offsets.\n const offset = normalizedNodes.reduce((sum, node) => sum + node.offsetSize, 0);\n const parent = position.parent;\n // Insertion might be in a text node, we should split it if that's the case.\n _splitNodeAtPosition(position);\n const index = position.index;\n // Insert nodes at given index. After splitting we have a proper index and insertion is between nodes,\n // using basic `Element` API.\n parent._insertChild(index, normalizedNodes);\n // Merge text nodes, if possible. Merging is needed only at points where inserted nodes \"touch\" \"old\" nodes.\n _mergeNodesAtIndex(parent, index + normalizedNodes.length);\n _mergeNodesAtIndex(parent, index);\n return new Range(position, position.getShiftedBy(offset));\n}\n/**\n * Removed nodes in given range. Only {@link module:engine/model/range~Range#isFlat flat} ranges are accepted.\n *\n * @internal\n * @param range Range containing nodes to remove.\n */\nexport function _remove(range) {\n if (!range.isFlat) {\n /**\n * Trying to remove a range which starts and ends in different element.\n *\n * @error operation-utils-remove-range-not-flat\n */\n throw new CKEditorError('operation-utils-remove-range-not-flat', this);\n }\n const parent = range.start.parent;\n // Range may be inside text nodes, we have to split them if that's the case.\n _splitNodeAtPosition(range.start);\n _splitNodeAtPosition(range.end);\n // Remove the text nodes using basic `Element` API.\n const removed = parent._removeChildren(range.start.index, range.end.index - range.start.index);\n // Merge text nodes, if possible. After some nodes were removed, node before and after removed range will be\n // touching at the position equal to the removed range beginning. We check merging possibility there.\n _mergeNodesAtIndex(parent, range.start.index);\n return removed;\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 * @internal\n * @param sourceRange Range containing nodes to move.\n * @param targetPosition Position to which nodes should be moved.\n * @returns Range containing moved nodes.\n */\nexport function _move(sourceRange, targetPosition) {\n if (!sourceRange.isFlat) {\n /**\n * Trying to move a range which starts and ends in different element.\n *\n * @error operation-utils-move-range-not-flat\n */\n throw new CKEditorError('operation-utils-move-range-not-flat', this);\n }\n const nodes = _remove(sourceRange);\n // We have to fix `targetPosition` because model changed after nodes from `sourceRange` got removed and\n // that change might have an impact on `targetPosition`.\n targetPosition = targetPosition._getTransformedByDeletion(sourceRange.start, sourceRange.end.offset - sourceRange.start.offset);\n return _insert(targetPosition, nodes);\n}\n/**\n * Sets given attribute on nodes in given range. The attributes are only set on top-level nodes of the range, not on its children.\n *\n * @internal\n * @param range Range containing nodes that should have the attribute set. Must be a flat range.\n * @param key Key of attribute to set.\n * @param value Attribute value.\n */\nexport function _setAttribute(range, key, value) {\n // Range might start or end in text nodes, so we have to split them.\n _splitNodeAtPosition(range.start);\n _splitNodeAtPosition(range.end);\n // Iterate over all items in the range.\n for (const item of range.getItems({ shallow: true })) {\n // Iterator will return `TextProxy` instances but we know that those text proxies will\n // always represent full text nodes (this is guaranteed thanks to splitting we did before).\n // So, we can operate on those text proxies' text nodes.\n const node = item.is('$textProxy') ? item.textNode : item;\n if (value !== null) {\n node._setAttribute(key, value);\n }\n else {\n node._removeAttribute(key);\n }\n // After attributes changing it may happen that some text nodes can be merged. Try to merge with previous node.\n _mergeNodesAtIndex(node.parent, node.index);\n }\n // Try to merge last changed node with it's previous sibling (not covered by the loop above).\n _mergeNodesAtIndex(range.end.parent, range.end.index);\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 ~NodeSet NodeSet} for details on how normalization is performed.\n *\n * @internal\n * @param nodes Objects to normalize.\n * @returns Normalized nodes.\n */\nexport function _normalizeNodes(nodes) {\n const normalized = [];\n function convert(nodes) {\n if (typeof nodes == 'string') {\n normalized.push(new Text(nodes));\n }\n else if (nodes instanceof TextProxy) {\n normalized.push(new Text(nodes.data, nodes.getAttributes()));\n }\n else if (nodes instanceof Node) {\n normalized.push(nodes);\n }\n else if (isIterable(nodes)) {\n for (const node of nodes) {\n convert(node);\n }\n }\n // Skip unrecognized type.\n }\n convert(nodes);\n // Merge text nodes.\n for (let i = 1; i < normalized.length; i++) {\n const node = normalized[i];\n const prev = normalized[i - 1];\n if (node instanceof Text && prev instanceof Text && _haveSameAttributes(node, prev)) {\n // Doing this instead changing `prev.data` because `data` is readonly.\n normalized.splice(i - 1, 2, new Text(prev.data + node.data, prev.getAttributes()));\n i--;\n }\n }\n return normalized;\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 * @param element Parent element of nodes to merge.\n * @param index Index between nodes to merge.\n */\nfunction _mergeNodesAtIndex(element, index) {\n const nodeBefore = element.getChild(index - 1);\n const nodeAfter = element.getChild(index);\n // Check if both of those nodes are text objects with same attributes.\n if (nodeBefore && nodeAfter && nodeBefore.is('$text') && nodeAfter.is('$text') && _haveSameAttributes(nodeBefore, nodeAfter)) {\n // Append text of text node after index to the before one.\n const mergedNode = new Text(nodeBefore.data + nodeAfter.data, nodeBefore.getAttributes());\n // Remove separate text nodes.\n element._removeChildren(index - 1, 2);\n // Insert merged text node.\n element._insertChild(index - 1, mergedNode);\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 * @param position Position at which node should be split.\n */\nfunction _splitNodeAtPosition(position) {\n const textNode = position.textNode;\n const element = position.parent;\n if (textNode) {\n const offsetDiff = position.offset - textNode.startOffset;\n const index = textNode.index;\n element._removeChildren(index, 1);\n const firstPart = new Text(textNode.data.substr(0, offsetDiff), textNode.getAttributes());\n const secondPart = new Text(textNode.data.substr(offsetDiff), textNode.getAttributes());\n element._insertChild(index, [firstPart, secondPart]);\n }\n}\n/**\n * Checks whether two given nodes have same attributes.\n *\n * @param nodeA Node to check.\n * @param nodeB Node to check.\n * @returns `true` if nodes have same attributes, `false` otherwise.\n */\nfunction _haveSameAttributes(nodeA, nodeB) {\n const iteratorA = nodeA.getAttributes();\n const iteratorB = nodeB.getAttributes();\n for (const attr of iteratorA) {\n if (attr[1] !== nodeB.getAttribute(attr[0])) {\n return false;\n }\n iteratorB.next();\n }\n return iteratorB.next().done;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/moveoperation\n */\nimport Operation from './operation';\nimport Position from '../position';\nimport Range from '../range';\nimport { _move } from './utils';\nimport { CKEditorError, compareArrays } from '@ckeditor/ckeditor5-utils';\n// @if CK_DEBUG_ENGINE // const ModelRange = require( '../range' ).default;\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 /**\n * Creates a move operation.\n *\n * @param sourcePosition Position before the first {@link module:engine/model/item~Item model item} to move.\n * @param howMany Offset size of moved range. Moved range will start from `sourcePosition` and end at\n * `sourcePosition` with offset shifted by `howMany`.\n * @param targetPosition Position at which moved nodes will be inserted.\n * @param baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n * can be applied or `null` if the operation operates on detached (non-document) tree.\n */\n constructor(sourcePosition, howMany, targetPosition, baseVersion) {\n super(baseVersion);\n this.sourcePosition = sourcePosition.clone();\n // `'toNext'` because `sourcePosition` is a bit like a start of the moved range.\n this.sourcePosition.stickiness = 'toNext';\n this.howMany = howMany;\n this.targetPosition = targetPosition.clone();\n this.targetPosition.stickiness = 'toNone';\n }\n /**\n * @inheritDoc\n */\n get type() {\n if (this.targetPosition.root.rootName == '$graveyard') {\n return 'remove';\n }\n else if (this.sourcePosition.root.rootName == '$graveyard') {\n return 'reinsert';\n }\n return 'move';\n }\n /**\n * @inheritDoc\n */\n get affectedSelectable() {\n return [\n Range._createFromPositionAndShift(this.sourcePosition, this.howMany),\n Range._createFromPositionAndShift(this.targetPosition, 0)\n ];\n }\n /**\n * Creates and returns an operation that has the same parameters as this operation.\n */\n clone() {\n return new MoveOperation(this.sourcePosition, this.howMany, this.targetPosition, this.baseVersion);\n }\n /**\n * Returns the start position of the moved range after it got moved. This may be different than\n * {@link module:engine/model/operation/moveoperation~MoveOperation#targetPosition} in some cases, i.e. when a range is moved\n * inside the same parent but {@link module:engine/model/operation/moveoperation~MoveOperation#targetPosition targetPosition}\n * is after {@link module:engine/model/operation/moveoperation~MoveOperation#sourcePosition sourcePosition}.\n *\n * ```\n * vv vv\n * abcdefg ===> adefbcg\n * ^ ^\n * targetPos movedRangeStart\n * offset 6 offset 4\n *```\n */\n getMovedRangeStart() {\n return this.targetPosition._getTransformedByDeletion(this.sourcePosition, this.howMany);\n }\n /**\n * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n */\n getReversed() {\n const newTargetPosition = this.sourcePosition._getTransformedByInsertion(this.targetPosition, this.howMany);\n return new MoveOperation(this.getMovedRangeStart(), this.howMany, newTargetPosition, this.baseVersion + 1);\n }\n /**\n * @inheritDoc\n * @internal\n */\n _validate() {\n const sourceElement = this.sourcePosition.parent;\n const targetElement = this.targetPosition.parent;\n const sourceOffset = this.sourcePosition.offset;\n const targetOffset = this.targetPosition.offset;\n // Validate whether move operation has correct parameters.\n // Validation is pretty complex but move operation is one of the core ways to manipulate the document state.\n // We expect that many errors might be connected with one of scenarios described below.\n if (sourceOffset + this.howMany > sourceElement.maxOffset) {\n /**\n * The nodes which should be moved do not exist.\n *\n * @error move-operation-nodes-do-not-exist\n */\n throw new CKEditorError('move-operation-nodes-do-not-exist', this);\n }\n else if (sourceElement === targetElement && sourceOffset < targetOffset && targetOffset < sourceOffset + this.howMany) {\n /**\n * Trying to move a range of nodes into the middle of that range.\n *\n * @error move-operation-range-into-itself\n */\n throw new CKEditorError('move-operation-range-into-itself', this);\n }\n else if (this.sourcePosition.root == this.targetPosition.root) {\n if (compareArrays(this.sourcePosition.getParentPath(), this.targetPosition.getParentPath()) == 'prefix') {\n const i = this.sourcePosition.path.length - 1;\n if (this.targetPosition.path[i] >= sourceOffset && this.targetPosition.path[i] < sourceOffset + this.howMany) {\n /**\n * Trying to move a range of nodes into one of nodes from that range.\n *\n * @error move-operation-node-into-itself\n */\n throw new CKEditorError('move-operation-node-into-itself', this);\n }\n }\n }\n }\n /**\n * @inheritDoc\n * @internal\n */\n _execute() {\n _move(Range._createFromPositionAndShift(this.sourcePosition, this.howMany), this.targetPosition);\n }\n /**\n * @inheritDoc\n */\n toJSON() {\n const json = super.toJSON();\n json.sourcePosition = this.sourcePosition.toJSON();\n json.targetPosition = this.targetPosition.toJSON();\n return json;\n }\n /**\n * @inheritDoc\n */\n static get className() {\n return 'MoveOperation';\n }\n /**\n * Creates `MoveOperation` object from deserialized object, i.e. from parsed JSON string.\n *\n * @param json Deserialized JSON object.\n * @param document Document on which this operation will be applied.\n */\n static fromJSON(json, document) {\n const sourcePosition = Position.fromJSON(json.sourcePosition, document);\n const targetPosition = Position.fromJSON(json.targetPosition, document);\n return new this(sourcePosition, json.howMany, targetPosition, json.baseVersion);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/insertoperation\n */\nimport Operation from './operation';\nimport Position from '../position';\nimport NodeList from '../nodelist';\nimport MoveOperation from './moveoperation';\nimport { _insert, _normalizeNodes } from './utils';\nimport Text from '../text';\nimport Element from '../element';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Operation to insert one or more nodes at given position in the model.\n */\nexport default class InsertOperation extends Operation {\n /**\n * Creates an insert operation.\n *\n * @param position Position of insertion.\n * @param nodes The list of nodes to be inserted.\n * @param baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n * can be applied or `null` if the operation operates on detached (non-document) tree.\n */\n constructor(position, nodes, baseVersion) {\n super(baseVersion);\n this.position = position.clone();\n this.position.stickiness = 'toNone';\n this.nodes = new NodeList(_normalizeNodes(nodes));\n this.shouldReceiveAttributes = false;\n }\n /**\n * @inheritDoc\n */\n get type() {\n return 'insert';\n }\n /**\n * Total offset size of inserted nodes.\n */\n get howMany() {\n return this.nodes.maxOffset;\n }\n /**\n * @inheritDoc\n */\n get affectedSelectable() {\n return this.position.clone();\n }\n /**\n * Creates and returns an operation that has the same parameters as this operation.\n */\n clone() {\n const nodes = new NodeList([...this.nodes].map(node => node._clone(true)));\n const insert = new InsertOperation(this.position, nodes, this.baseVersion);\n insert.shouldReceiveAttributes = this.shouldReceiveAttributes;\n return insert;\n }\n /**\n * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n */\n getReversed() {\n const graveyard = this.position.root.document.graveyard;\n const gyPosition = new Position(graveyard, [0]);\n return new MoveOperation(this.position, this.nodes.maxOffset, gyPosition, this.baseVersion + 1);\n }\n /**\n * @inheritDoc\n * @internal\n */\n _validate() {\n const targetElement = this.position.parent;\n if (!targetElement || targetElement.maxOffset < this.position.offset) {\n /**\n * Insertion position is invalid.\n *\n * @error insert-operation-position-invalid\n */\n throw new CKEditorError('insert-operation-position-invalid', this);\n }\n }\n /**\n * @inheritDoc\n * @internal\n */\n _execute() {\n // What happens here is that we want original nodes be passed to writer because we want original nodes\n // to be inserted to the model. But in InsertOperation, we want to keep those nodes as they were added\n // to the operation, not modified. For example, text nodes can get merged or cropped while Elements can\n // get children. It is important that InsertOperation has the copy of original nodes in intact state.\n const originalNodes = this.nodes;\n this.nodes = new NodeList([...originalNodes].map(node => node._clone(true)));\n _insert(this.position, originalNodes);\n }\n /**\n * @inheritDoc\n */\n toJSON() {\n const json = super.toJSON();\n json.position = this.position.toJSON();\n json.nodes = this.nodes.toJSON();\n return json;\n }\n /**\n * @inheritDoc\n */\n static get className() {\n return 'InsertOperation';\n }\n /**\n * Creates `InsertOperation` object from deserialized object, i.e. from parsed JSON string.\n *\n * @param json Deserialized JSON object.\n * @param document Document on which this operation will be applied.\n */\n static fromJSON(json, document) {\n const children = [];\n for (const child of json.nodes) {\n if (child.name) {\n // If child has name property, it is an Element.\n children.push(Element.fromJSON(child));\n }\n else {\n // Otherwise, it is a Text node.\n children.push(Text.fromJSON(child));\n }\n }\n const insert = new InsertOperation(Position.fromJSON(json.position, document), children, json.baseVersion);\n insert.shouldReceiveAttributes = json.shouldReceiveAttributes;\n return insert;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/splitoperation\n */\nimport Operation from './operation';\nimport MergeOperation from './mergeoperation';\nimport Position from '../position';\nimport Range from '../range';\nimport { _insert, _move } from './utils';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Operation to split {@link module:engine/model/element~Element an element} at given\n * {@link module:engine/model/operation/splitoperation~SplitOperation#splitPosition split position} into two elements,\n * both containing a part of the element's original content.\n */\nexport default class SplitOperation extends Operation {\n /**\n * Creates a split operation.\n *\n * @param splitPosition Position at which an element should be split.\n * @param howMany Total offset size of elements that are in the split element after `position`.\n * @param insertionPosition Position at which the clone of split element (or element from graveyard) will be inserted.\n * @param graveyardPosition Position in the graveyard root before the element which\n * should be used as a parent of the nodes after `position`. If it is not set, a copy of the the `position` parent will be used.\n * @param baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n * can be applied or `null` if the operation operates on detached (non-document) tree.\n */\n constructor(splitPosition, howMany, insertionPosition, graveyardPosition, baseVersion) {\n super(baseVersion);\n this.splitPosition = splitPosition.clone();\n // Keep position sticking to the next node. This way any new content added at the place where the element is split\n // will be left in the original element.\n this.splitPosition.stickiness = 'toNext';\n this.howMany = howMany;\n this.insertionPosition = insertionPosition;\n this.graveyardPosition = graveyardPosition ? graveyardPosition.clone() : null;\n if (this.graveyardPosition) {\n this.graveyardPosition.stickiness = 'toNext';\n }\n }\n /**\n * @inheritDoc\n */\n get type() {\n return 'split';\n }\n /**\n * Position inside the new clone of a split element.\n *\n * This is a position where nodes that are after the split position will be moved to.\n */\n get moveTargetPosition() {\n const path = this.insertionPosition.path.slice();\n path.push(0);\n return new Position(this.insertionPosition.root, path);\n }\n /**\n * Artificial range that contains all the nodes from the split element that will be moved to the new element.\n * The range starts at {@link #splitPosition} and ends in the same parent, at `POSITIVE_INFINITY` offset.\n */\n get movedRange() {\n const end = this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);\n return new Range(this.splitPosition, end);\n }\n /**\n * @inheritDoc\n */\n get affectedSelectable() {\n // These could be positions but `Selectable` type only supports `Iterable<Range>`.\n const ranges = [\n Range._createFromPositionAndShift(this.splitPosition, 0),\n Range._createFromPositionAndShift(this.insertionPosition, 0)\n ];\n if (this.graveyardPosition) {\n ranges.push(Range._createFromPositionAndShift(this.graveyardPosition, 0));\n }\n return ranges;\n }\n /**\n * Creates and returns an operation that has the same parameters as this operation.\n *\n * @returns Clone of this operation.\n */\n clone() {\n return new SplitOperation(this.splitPosition, this.howMany, this.insertionPosition, this.graveyardPosition, this.baseVersion);\n }\n /**\n * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n */\n getReversed() {\n const graveyard = this.splitPosition.root.document.graveyard;\n const graveyardPosition = new Position(graveyard, [0]);\n return new MergeOperation(this.moveTargetPosition, this.howMany, this.splitPosition, graveyardPosition, this.baseVersion + 1);\n }\n /**\n * @inheritDoc\n * @internal\n */\n _validate() {\n const element = this.splitPosition.parent;\n const offset = this.splitPosition.offset;\n // Validate whether split operation has correct parameters.\n if (!element || element.maxOffset < offset) {\n /**\n * Split position is invalid.\n *\n * @error split-operation-position-invalid\n */\n throw new CKEditorError('split-operation-position-invalid', this);\n }\n else if (!element.parent) {\n /**\n * Cannot split root element.\n *\n * @error split-operation-split-in-root\n */\n throw new CKEditorError('split-operation-split-in-root', this);\n }\n else if (this.howMany != element.maxOffset - this.splitPosition.offset) {\n /**\n * Split operation specifies wrong number of nodes to move.\n *\n * @error split-operation-how-many-invalid\n */\n throw new CKEditorError('split-operation-how-many-invalid', this);\n }\n else if (this.graveyardPosition && !this.graveyardPosition.nodeAfter) {\n /**\n * Graveyard position invalid.\n *\n * @error split-operation-graveyard-position-invalid\n */\n throw new CKEditorError('split-operation-graveyard-position-invalid', this);\n }\n }\n /**\n * @inheritDoc\n * @internal\n */\n _execute() {\n const splitElement = this.splitPosition.parent;\n if (this.graveyardPosition) {\n _move(Range._createFromPositionAndShift(this.graveyardPosition, 1), this.insertionPosition);\n }\n else {\n const newElement = splitElement._clone();\n _insert(this.insertionPosition, newElement);\n }\n const sourceRange = new Range(Position._createAt(splitElement, this.splitPosition.offset), Position._createAt(splitElement, splitElement.maxOffset));\n _move(sourceRange, this.moveTargetPosition);\n }\n /**\n * @inheritDoc\n */\n toJSON() {\n const json = super.toJSON();\n json.splitPosition = this.splitPosition.toJSON();\n json.insertionPosition = this.insertionPosition.toJSON();\n if (this.graveyardPosition) {\n json.graveyardPosition = this.graveyardPosition.toJSON();\n }\n return json;\n }\n /**\n * @inheritDoc\n */\n static get className() {\n return 'SplitOperation';\n }\n /**\n * Helper function that returns a default insertion position basing on given `splitPosition`. The default insertion\n * position is after the split element.\n */\n static getInsertionPosition(splitPosition) {\n const path = splitPosition.path.slice(0, -1);\n path[path.length - 1]++;\n return new Position(splitPosition.root, path, 'toPrevious');\n }\n /**\n * Creates `SplitOperation` object from deserialized object, i.e. from parsed JSON string.\n *\n * @param json Deserialized JSON object.\n * @param document Document on which this operation will be applied.\n */\n static fromJSON(json, document) {\n const splitPosition = Position.fromJSON(json.splitPosition, document);\n const insertionPosition = Position.fromJSON(json.insertionPosition, document);\n const graveyardPosition = json.graveyardPosition ? Position.fromJSON(json.graveyardPosition, document) : null;\n return new this(splitPosition, json.howMany, insertionPosition, graveyardPosition, json.baseVersion);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/mergeoperation\n */\nimport Operation from './operation';\nimport SplitOperation from './splitoperation';\nimport Position from '../position';\nimport Range from '../range';\nimport { _move } from './utils';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Operation to merge two {@link module:engine/model/element~Element elements}.\n *\n * The merged element is the parent of {@link ~MergeOperation#sourcePosition} and it is merged into the parent of\n * {@link ~MergeOperation#targetPosition}. All nodes from the merged element are moved to {@link ~MergeOperation#targetPosition}.\n *\n * The merged element is moved to the graveyard at {@link ~MergeOperation#graveyardPosition}.\n */\nexport default class MergeOperation extends Operation {\n /**\n * Creates a merge operation.\n *\n * @param sourcePosition Position inside the merged element. All nodes from that\n * element after that position will be moved to {@link #targetPosition}.\n * @param howMany Summary offset size of nodes which will be moved from the merged element to the new parent.\n * @param targetPosition Position which the nodes from the merged elements will be moved to.\n * @param graveyardPosition Position in graveyard to which the merged element will be moved.\n * @param baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n * can be applied or `null` if the operation operates on detached (non-document) tree.\n */\n constructor(sourcePosition, howMany, targetPosition, graveyardPosition, baseVersion) {\n super(baseVersion);\n this.sourcePosition = sourcePosition.clone();\n // This is, and should always remain, the first position in its parent.\n this.sourcePosition.stickiness = 'toPrevious';\n this.howMany = howMany;\n this.targetPosition = targetPosition.clone();\n // Except of a rare scenario in `MergeOperation` x `MergeOperation` transformation,\n // this is, and should always remain, the last position in its parent.\n this.targetPosition.stickiness = 'toNext';\n this.graveyardPosition = graveyardPosition.clone();\n }\n /**\n * @inheritDoc\n */\n get type() {\n return 'merge';\n }\n /**\n * Position before the merged element (which will be deleted).\n */\n get deletionPosition() {\n return new Position(this.sourcePosition.root, this.sourcePosition.path.slice(0, -1));\n }\n /**\n * Artificial range that contains all the nodes from the merged element that will be moved to {@link ~MergeOperation#sourcePosition}.\n * The range starts at {@link ~MergeOperation#sourcePosition} and ends in the same parent, at `POSITIVE_INFINITY` offset.\n */\n get movedRange() {\n const end = this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);\n return new Range(this.sourcePosition, end);\n }\n /**\n * @inheritDoc\n */\n get affectedSelectable() {\n const mergedElement = this.sourcePosition.parent;\n return [\n Range._createOn(mergedElement),\n // These could be positions but `Selectable` type only supports `Iterable<Range>`.\n Range._createFromPositionAndShift(this.targetPosition, 0),\n Range._createFromPositionAndShift(this.graveyardPosition, 0)\n ];\n }\n /**\n * Creates and returns an operation that has the same parameters as this operation.\n */\n clone() {\n return new MergeOperation(this.sourcePosition, this.howMany, this.targetPosition, this.graveyardPosition, this.baseVersion);\n }\n /**\n * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n */\n getReversed() {\n // Positions in this method are transformed by this merge operation because the split operation bases on\n // the context after this merge operation happened (because split operation reverses it).\n // So we need to acknowledge that the merge operation happened and those positions changed a little.\n const targetPosition = this.targetPosition._getTransformedByMergeOperation(this);\n const path = this.sourcePosition.path.slice(0, -1);\n const insertionPosition = new Position(this.sourcePosition.root, path)._getTransformedByMergeOperation(this);\n return new SplitOperation(targetPosition, this.howMany, insertionPosition, this.graveyardPosition, this.baseVersion + 1);\n }\n /**\n * @inheritDoc\n * @internal\n */\n _validate() {\n const sourceElement = this.sourcePosition.parent;\n const targetElement = this.targetPosition.parent;\n // Validate whether merge operation has correct parameters.\n if (!sourceElement.parent) {\n /**\n * Merge source position is invalid. The element to be merged must have a parent node.\n *\n * @error merge-operation-source-position-invalid\n */\n throw new CKEditorError('merge-operation-source-position-invalid', this);\n }\n else if (!targetElement.parent) {\n /**\n * Merge target position is invalid. The element to be merged must have a parent node.\n *\n * @error merge-operation-target-position-invalid\n */\n throw new CKEditorError('merge-operation-target-position-invalid', this);\n }\n else if (this.howMany != sourceElement.maxOffset) {\n /**\n * Merge operation specifies wrong number of nodes to move.\n *\n * @error merge-operation-how-many-invalid\n */\n throw new CKEditorError('merge-operation-how-many-invalid', this);\n }\n }\n /**\n * @inheritDoc\n * @internal\n */\n _execute() {\n const mergedElement = this.sourcePosition.parent;\n const sourceRange = Range._createIn(mergedElement);\n _move(sourceRange, this.targetPosition);\n _move(Range._createOn(mergedElement), this.graveyardPosition);\n }\n /**\n * @inheritDoc\n */\n toJSON() {\n const json = super.toJSON();\n json.sourcePosition = json.sourcePosition.toJSON();\n json.targetPosition = json.targetPosition.toJSON();\n json.graveyardPosition = json.graveyardPosition.toJSON();\n return json;\n }\n /**\n * @inheritDoc\n */\n static get className() {\n return 'MergeOperation';\n }\n /**\n * Creates `MergeOperation` object from deserialized object, i.e. from parsed JSON string.\n *\n * @param json Deserialized JSON object.\n * @param document Document on which this operation will be applied.\n */\n static fromJSON(json, document) {\n const sourcePosition = Position.fromJSON(json.sourcePosition, document);\n const targetPosition = Position.fromJSON(json.targetPosition, document);\n const graveyardPosition = Position.fromJSON(json.graveyardPosition, document);\n return new this(sourcePosition, json.howMany, targetPosition, graveyardPosition, json.baseVersion);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/markeroperation\n */\nimport Operation from './operation';\nimport Range from '../range';\nexport default class MarkerOperation extends Operation {\n /**\n * @param name Marker name.\n * @param oldRange Marker range before the change.\n * @param newRange Marker range after the change.\n * @param markers Marker collection on which change should be executed.\n * @param affectsData Specifies whether the marker operation affects the data produced by the data pipeline\n * (is persisted in the editor's data).\n * @param baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n * can be applied or `null` if the operation operates on detached (non-document) tree.\n */\n constructor(name, oldRange, newRange, markers, affectsData, baseVersion) {\n super(baseVersion);\n this.name = name;\n this.oldRange = oldRange ? oldRange.clone() : null;\n this.newRange = newRange ? newRange.clone() : null;\n this.affectsData = affectsData;\n this._markers = markers;\n }\n /**\n * @inheritDoc\n */\n get type() {\n return 'marker';\n }\n /**\n * @inheritDoc\n */\n get affectedSelectable() {\n const ranges = [];\n if (this.oldRange) {\n ranges.push(this.oldRange.clone());\n }\n if (this.newRange) {\n if (this.oldRange) {\n ranges.push(...this.newRange.getDifference(this.oldRange));\n }\n else {\n ranges.push(this.newRange.clone());\n }\n }\n return ranges;\n }\n /**\n * Creates and returns an operation that has the same parameters as this operation.\n */\n clone() {\n return new MarkerOperation(this.name, this.oldRange, this.newRange, this._markers, this.affectsData, this.baseVersion);\n }\n /**\n * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n */\n getReversed() {\n return new MarkerOperation(this.name, this.newRange, this.oldRange, this._markers, this.affectsData, this.baseVersion + 1);\n }\n /**\n * @inheritDoc\n * @internal\n */\n _execute() {\n if (this.newRange) {\n this._markers._set(this.name, this.newRange, true, this.affectsData);\n }\n else {\n this._markers._remove(this.name);\n }\n }\n /**\n * @inheritDoc\n * @internal\n */\n toJSON() {\n const json = super.toJSON();\n if (this.oldRange) {\n json.oldRange = this.oldRange.toJSON();\n }\n if (this.newRange) {\n json.newRange = this.newRange.toJSON();\n }\n delete json._markers;\n return json;\n }\n /**\n * @inheritDoc\n */\n static get className() {\n return 'MarkerOperation';\n }\n /**\n * Creates `MarkerOperation` object from deserialized object, i.e. from parsed JSON string.\n *\n * @param json Deserialized JSON object.\n * @param document Document on which this operation will be applied.\n */\n static fromJSON(json, document) {\n return new MarkerOperation(json.name, json.oldRange ? Range.fromJSON(json.oldRange, document) : null, json.newRange ? Range.fromJSON(json.newRange, document) : null, document.model.markers, json.affectsData, json.baseVersion);\n }\n}\n","import baseIsEqual from './_baseIsEqual.js';\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.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 = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nexport default isEqual;\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/attributeoperation\n */\nimport Operation from './operation';\nimport { _setAttribute } from './utils';\nimport Range from '../range';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\nimport { isEqual } from 'lodash-es';\n/**\n * Operation to change nodes' attribute.\n *\n * Using this class you can add, remove or change value of the attribute.\n */\nexport default class AttributeOperation extends Operation {\n /**\n * Creates an operation that changes, removes or adds attributes.\n *\n * If only `newValue` is set, attribute will be added on a node. Note that all nodes in operation's range must not\n * have an attribute with the same key as the added attribute.\n *\n * If only `oldValue` is set, then attribute with given key will be removed. Note that all nodes in operation's range\n * must have an attribute with that key added.\n *\n * If both `newValue` and `oldValue` are set, then the operation will change the attribute value. Note that all nodes in\n * operation's ranges must already have an attribute with given key and `oldValue` as value\n *\n * @param range Range on which the operation should be applied. Must be a flat range.\n * @param key Key of an attribute to change or remove.\n * @param oldValue Old value of the attribute with given key or `null`, if attribute was not set before.\n * @param newValue New value of the attribute with given key or `null`, if operation should remove attribute.\n * @param baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n * can be applied or `null` if the operation operates on detached (non-document) tree.\n */\n constructor(range, key, oldValue, newValue, baseVersion) {\n super(baseVersion);\n this.range = range.clone();\n this.key = key;\n this.oldValue = oldValue === undefined ? null : oldValue;\n this.newValue = newValue === undefined ? null : newValue;\n }\n /**\n * @inheritDoc\n */\n get type() {\n if (this.oldValue === null) {\n return 'addAttribute';\n }\n else if (this.newValue === null) {\n return 'removeAttribute';\n }\n else {\n return 'changeAttribute';\n }\n }\n /**\n * @inheritDoc\n */\n get affectedSelectable() {\n return this.range.clone();\n }\n /**\n * Creates and returns an operation that has the same parameters as this operation.\n */\n clone() {\n return new AttributeOperation(this.range, this.key, this.oldValue, this.newValue, this.baseVersion);\n }\n /**\n * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n */\n getReversed() {\n return new AttributeOperation(this.range, this.key, this.newValue, this.oldValue, this.baseVersion + 1);\n }\n /**\n * @inheritDoc\n */\n toJSON() {\n const json = super.toJSON();\n json.range = this.range.toJSON();\n return json;\n }\n /**\n * @inheritDoc\n * @internal\n */\n _validate() {\n if (!this.range.isFlat) {\n /**\n * The range to change is not flat.\n *\n * @error attribute-operation-range-not-flat\n */\n throw new CKEditorError('attribute-operation-range-not-flat', this);\n }\n for (const item of this.range.getItems({ shallow: true })) {\n if (this.oldValue !== null && !isEqual(item.getAttribute(this.key), this.oldValue)) {\n /**\n * Changed node has different attribute value than operation's old attribute value.\n *\n * @error attribute-operation-wrong-old-value\n * @param item\n * @param key\n * @param value\n */\n throw new CKEditorError('attribute-operation-wrong-old-value', this, { item, key: this.key, value: this.oldValue });\n }\n if (this.oldValue === null && this.newValue !== null && item.hasAttribute(this.key)) {\n /**\n * The attribute with given key already exists for the given node.\n *\n * @error attribute-operation-attribute-exists\n * @param node\n * @param key\n */\n throw new CKEditorError('attribute-operation-attribute-exists', this, { node: item, key: this.key });\n }\n }\n }\n /**\n * @inheritDoc\n * @internal\n */\n _execute() {\n // If value to set is same as old value, don't do anything.\n if (!isEqual(this.oldValue, this.newValue)) {\n // Execution.\n _setAttribute(this.range, this.key, this.newValue);\n }\n }\n /**\n * @inheritDoc\n */\n static get className() {\n return 'AttributeOperation';\n }\n /**\n * Creates `AttributeOperation` object from deserialized object, i.e. from parsed JSON string.\n *\n * @param json Deserialized JSON object.\n * @param document Document on which this operation will be applied.\n */\n static fromJSON(json, document) {\n return new AttributeOperation(Range.fromJSON(json.range, document), json.key, json.oldValue, json.newValue, json.baseVersion);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/nooperation\n */\nimport Operation from './operation';\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 */\nexport default class NoOperation extends Operation {\n get type() {\n return 'noop';\n }\n /**\n * @inheritDoc\n */\n get affectedSelectable() {\n return null;\n }\n /**\n * Creates and returns an operation that has the same parameters as this operation.\n */\n clone() {\n return new NoOperation(this.baseVersion);\n }\n /**\n * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n */\n getReversed() {\n return new NoOperation(this.baseVersion + 1);\n }\n /** @internal */\n _execute() {\n }\n /**\n * @inheritDoc\n */\n static get className() {\n return 'NoOperation';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/renameoperation\n */\nimport Operation from './operation';\nimport Element from '../element';\nimport Position from '../position';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Operation to change element's name.\n *\n * Using this class you can change element's name.\n */\nexport default class RenameOperation extends Operation {\n /**\n * Creates an operation that changes element's name.\n *\n * @param position Position before an element to change.\n * @param oldName Current name of the element.\n * @param newName New name for the element.\n * @param baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n * can be applied or `null` if the operation operates on detached (non-document) tree.\n */\n constructor(position, oldName, newName, baseVersion) {\n super(baseVersion);\n this.position = position;\n // This position sticks to the next node because it is a position before the node that we want to change.\n this.position.stickiness = 'toNext';\n this.oldName = oldName;\n this.newName = newName;\n }\n /**\n * @inheritDoc\n */\n get type() {\n return 'rename';\n }\n /**\n * @inheritDoc\n */\n get affectedSelectable() {\n return this.position.nodeAfter;\n }\n /**\n * Creates and returns an operation that has the same parameters as this operation.\n *\n * @returns Clone of this operation.\n */\n clone() {\n return new RenameOperation(this.position.clone(), this.oldName, this.newName, this.baseVersion);\n }\n /**\n * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n */\n getReversed() {\n return new RenameOperation(this.position.clone(), this.newName, this.oldName, this.baseVersion + 1);\n }\n /**\n * @inheritDoc\n * @internal\n */\n _validate() {\n const element = this.position.nodeAfter;\n if (!(element instanceof Element)) {\n /**\n * Given position is invalid or node after it is not instance of Element.\n *\n * @error rename-operation-wrong-position\n */\n throw new CKEditorError('rename-operation-wrong-position', this);\n }\n else if (element.name !== this.oldName) {\n /**\n * Element to change has different name than operation's old name.\n *\n * @error rename-operation-wrong-name\n */\n throw new CKEditorError('rename-operation-wrong-name', this);\n }\n }\n /**\n * @inheritDoc\n * @internal\n */\n _execute() {\n const element = this.position.nodeAfter;\n element.name = this.newName;\n }\n /**\n * @inheritDoc\n */\n toJSON() {\n const json = super.toJSON();\n json.position = this.position.toJSON();\n return json;\n }\n /**\n * @inheritDoc\n */\n static get className() {\n return 'RenameOperation';\n }\n /**\n * Creates `RenameOperation` object from deserialized object, i.e. from parsed JSON string.\n *\n * @param json Deserialized JSON object.\n * @param document Document on which this operation will be applied.\n */\n static fromJSON(json, document) {\n return new RenameOperation(Position.fromJSON(json.position, document), json.oldName, json.newName, json.baseVersion);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/rootattributeoperation\n */\nimport Operation from './operation';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\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 */\nexport default class RootAttributeOperation extends Operation {\n /**\n * Creates an operation that changes, removes or adds attributes on root element.\n *\n * @see module:engine/model/operation/attributeoperation~AttributeOperation\n * @param root Root element to change.\n * @param key Key of an attribute to change or remove.\n * @param oldValue Old value of the attribute with given key or `null`, if attribute was not set before.\n * @param newValue New value of the attribute with given key or `null`, if operation should remove attribute.\n * @param baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n * can be applied or `null` if the operation operates on detached (non-document) tree.\n */\n constructor(root, key, oldValue, newValue, baseVersion) {\n super(baseVersion);\n this.root = root;\n this.key = key;\n this.oldValue = oldValue === undefined ? null : oldValue;\n this.newValue = newValue === undefined ? null : newValue;\n }\n /**\n * @inheritDoc\n */\n get type() {\n if (this.oldValue === null) {\n return 'addRootAttribute';\n }\n else if (this.newValue === null) {\n return 'removeRootAttribute';\n }\n else {\n return 'changeRootAttribute';\n }\n }\n /**\n * @inheritDoc\n */\n get affectedSelectable() {\n return this.root;\n }\n /**\n * Creates and returns an operation that has the same parameters as this operation.\n *\n * @returns Clone of this operation.\n */\n clone() {\n return new RootAttributeOperation(this.root, this.key, this.oldValue, this.newValue, this.baseVersion);\n }\n /**\n * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n */\n getReversed() {\n return new RootAttributeOperation(this.root, this.key, this.newValue, this.oldValue, this.baseVersion + 1);\n }\n /**\n * @inheritDoc\n * @internal\n */\n _validate() {\n if (this.root != this.root.root || this.root.is('documentFragment')) {\n /**\n * The element to change is not a root element.\n *\n * @error rootattribute-operation-not-a-root\n * @param root\n * @param key\n * @param value\n */\n throw new CKEditorError('rootattribute-operation-not-a-root', this, { root: this.root, key: this.key });\n }\n if (this.oldValue !== null && this.root.getAttribute(this.key) !== this.oldValue) {\n /**\n * The attribute which should be removed does not exist for the given node.\n *\n * @error rootattribute-operation-wrong-old-value\n * @param root\n * @param key\n * @param value\n */\n throw new CKEditorError('rootattribute-operation-wrong-old-value', this, { root: this.root, key: this.key });\n }\n if (this.oldValue === null && this.newValue !== null && this.root.hasAttribute(this.key)) {\n /**\n * The attribute with given key already exists for the given node.\n *\n * @error rootattribute-operation-attribute-exists\n * @param root\n * @param key\n */\n throw new CKEditorError('rootattribute-operation-attribute-exists', this, { root: this.root, key: this.key });\n }\n }\n /**\n * @inheritDoc\n * @internal\n */\n _execute() {\n if (this.newValue !== null) {\n this.root._setAttribute(this.key, this.newValue);\n }\n else {\n this.root._removeAttribute(this.key);\n }\n }\n /**\n * @inheritDoc\n */\n toJSON() {\n const json = super.toJSON();\n json.root = this.root.toJSON();\n return json;\n }\n /**\n * @inheritDoc\n */\n static get className() {\n return 'RootAttributeOperation';\n }\n /**\n * Creates `RootAttributeOperation` object from deserialized object, i.e. from parsed JSON string.\n *\n * @param json Deserialized JSON object.\n * @param document Document on which this operation will be applied.\n */\n static fromJSON(json, document) {\n if (!document.getRoot(json.root)) {\n /**\n * Cannot create RootAttributeOperation for document. Root with specified name does not exist.\n *\n * @error rootattribute-operation-fromjson-no-root\n * @param rootName\n */\n throw new CKEditorError('rootattribute-operation-fromjson-no-root', this, { rootName: json.root });\n }\n return new RootAttributeOperation(document.getRoot(json.root), json.key, json.oldValue, json.newValue, json.baseVersion);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/rootoperation\n */\nimport Operation from './operation';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Operation that creates (or attaches) or detaches a root element.\n */\nexport default class RootOperation extends Operation {\n /**\n * Creates an operation that creates or removes a root element.\n *\n * @param rootName Root name to create or detach.\n * @param elementName Root element name.\n * @param isAdd Specifies whether the operation adds (`true`) or detaches the root (`false`).\n * @param document Document which owns the root.\n * @param baseVersion Document {@link module:engine/model/document~Document#version} on which operation can be applied.\n */\n constructor(rootName, elementName, isAdd, document, baseVersion) {\n super(baseVersion);\n this.rootName = rootName;\n this.elementName = elementName;\n this.isAdd = isAdd;\n this._document = document;\n // Make sure that the root exists ASAP, this is important for RTC.\n // If the root was dynamically added, there will be more operations that operate on/in this root.\n // These operations will require root element instance (in operation property or in position instance).\n // If the root is not created ahead of time, instantiating such operations may fail.\n if (!this._document.getRoot(this.rootName)) {\n const root = this._document.createRoot(this.elementName, this.rootName);\n root._isAttached = false;\n }\n }\n /**\n * @inheritDoc\n */\n get type() {\n return this.isAdd ? 'addRoot' : 'detachRoot';\n }\n /**\n * @inheritDoc\n */\n get affectedSelectable() {\n return this._document.getRoot(this.rootName);\n }\n /**\n * @inheritDoc\n */\n clone() {\n return new RootOperation(this.rootName, this.elementName, this.isAdd, this._document, this.baseVersion);\n }\n /**\n * @inheritDoc\n */\n getReversed() {\n return new RootOperation(this.rootName, this.elementName, !this.isAdd, this._document, this.baseVersion + 1);\n }\n /**\n * @inheritDoc\n */\n _validate() {\n // Keep in mind that at this point the root will always exist as it was created in the `constructor()`, even for detach operation.\n const root = this._document.getRoot(this.rootName);\n if (root.isAttached() && this.isAdd) {\n /**\n * Trying to attach a root that is already attached.\n *\n * @error root-operation-root-attached\n */\n throw new CKEditorError('root-operation-root-attached', this);\n }\n else if (!root.isAttached() && !this.isAdd) {\n /**\n * Trying to detach a root that is already detached.\n *\n * @error root-operation-root-detached\n */\n throw new CKEditorError('root-operation-root-detached', this);\n }\n }\n /**\n * @inheritDoc\n */\n _execute() {\n this._document.getRoot(this.rootName)._isAttached = this.isAdd;\n }\n /**\n * @inheritDoc\n */\n toJSON() {\n const json = super.toJSON();\n delete json._document;\n return json;\n }\n /**\n * @inheritDoc\n */\n static get className() {\n return 'RootOperation';\n }\n /**\n * Creates `RootOperation` object from deserialized object, i.e. from parsed JSON string.\n *\n * @param json Deserialized JSON object.\n * @param document Document on which this operation will be applied.\n */\n static fromJSON(json, document) {\n return new RootOperation(json.rootName, json.elementName, json.isAdd, document, json.baseVersion);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/operationfactory\n */\nimport AttributeOperation from './attributeoperation';\nimport InsertOperation from './insertoperation';\nimport MarkerOperation from './markeroperation';\nimport MoveOperation from './moveoperation';\nimport NoOperation from './nooperation';\nimport Operation from './operation';\nimport RenameOperation from './renameoperation';\nimport RootAttributeOperation from './rootattributeoperation';\nimport RootOperation from './rootoperation';\nimport SplitOperation from './splitoperation';\nimport MergeOperation from './mergeoperation';\nconst operations = {};\noperations[AttributeOperation.className] = AttributeOperation;\noperations[InsertOperation.className] = InsertOperation;\noperations[MarkerOperation.className] = MarkerOperation;\noperations[MoveOperation.className] = MoveOperation;\noperations[NoOperation.className] = NoOperation;\noperations[Operation.className] = Operation;\noperations[RenameOperation.className] = RenameOperation;\noperations[RootAttributeOperation.className] = RootAttributeOperation;\noperations[RootOperation.className] = RootOperation;\noperations[SplitOperation.className] = SplitOperation;\noperations[MergeOperation.className] = MergeOperation;\n/**\n * A factory class for creating operations.\n */\nexport default class OperationFactory {\n /**\n * Creates an operation instance from a JSON object (parsed JSON string).\n *\n * @param json Deserialized JSON object.\n * @param document Document on which this operation will be applied.\n */\n static fromJSON(json, document) {\n return operations[json.__className].fromJSON(json, document);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport InsertOperation from './insertoperation';\nimport AttributeOperation from './attributeoperation';\nimport RenameOperation from './renameoperation';\nimport MarkerOperation from './markeroperation';\nimport MoveOperation from './moveoperation';\nimport RootAttributeOperation from './rootattributeoperation';\nimport RootOperation from './rootoperation';\nimport MergeOperation from './mergeoperation';\nimport SplitOperation from './splitoperation';\nimport NoOperation from './nooperation';\nimport Range from '../range';\nimport Position from '../position';\nimport { compareArrays } from '@ckeditor/ckeditor5-utils';\nconst transformations = new Map();\n/**\n * @module engine/model/operation/transform\n */\n/**\n * Sets a transformation function to be be used to transform instances of class `OperationA` by instances of class `OperationB`.\n *\n * The `transformationFunction` is passed three parameters:\n *\n * * `a` - operation to be transformed, an instance of `OperationA`,\n * * `b` - operation to be transformed by, an instance of `OperationB`,\n * * {@link module:engine/model/operation/transform~TransformationContext `context`} - object with additional information about\n * transformation context.\n *\n * The `transformationFunction` should return transformation result, which is an array with one or multiple\n * {@link module:engine/model/operation/operation~Operation operation} instances.\n *\n * @param transformationFunction Function to use for transforming.\n */\nfunction setTransformation(OperationA, OperationB, transformationFunction) {\n let aGroup = transformations.get(OperationA);\n if (!aGroup) {\n aGroup = new Map();\n transformations.set(OperationA, aGroup);\n }\n aGroup.set(OperationB, transformationFunction);\n}\n/**\n * Returns a previously set transformation function for transforming an instance of `OperationA` by an instance of `OperationB`.\n *\n * If no transformation was set for given pair of operations, {@link module:engine/model/operation/transform~noUpdateTransformation}\n * is returned. This means that if no transformation was set, the `OperationA` instance will not change when transformed\n * by the `OperationB` instance.\n *\n * @returns Function set to transform an instance of `OperationA` by an instance of `OperationB`.\n */\nfunction getTransformation(OperationA, OperationB) {\n const aGroup = transformations.get(OperationA);\n if (aGroup && aGroup.has(OperationB)) {\n return aGroup.get(OperationB);\n }\n return noUpdateTransformation;\n}\n/**\n * A transformation function that only clones operation to transform, without changing it.\n */\nfunction noUpdateTransformation(a) {\n return [a];\n}\n/**\n * Transforms operation `a` by operation `b`.\n *\n * @param a Operation to be transformed.\n * @param b Operation to transform by.\n * @param context Transformation context for this transformation.\n * @returns Transformation result.\n */\nexport function transform(a, b, context = {}) {\n const transformationFunction = getTransformation(a.constructor, b.constructor);\n /* eslint-disable no-useless-catch */\n try {\n a = a.clone();\n return transformationFunction(a, b, context);\n }\n catch (e) {\n // @if CK_DEBUG // console.warn( 'Error during operation transformation!', e.message );\n // @if CK_DEBUG // console.warn( 'Transformed operation', a );\n // @if CK_DEBUG // console.warn( 'Operation transformed by', b );\n // @if CK_DEBUG // console.warn( 'context.aIsStrong', context.aIsStrong );\n // @if CK_DEBUG // console.warn( 'context.aWasUndone', context.aWasUndone );\n // @if CK_DEBUG // console.warn( 'context.bWasUndone', context.bWasUndone );\n // @if CK_DEBUG // console.warn( 'context.abRelation', context.abRelation );\n // @if CK_DEBUG // console.warn( 'context.baRelation', context.baRelation );\n throw e;\n }\n /* eslint-enable no-useless-catch */\n}\n/**\n * Performs a transformation of two sets of operations - `operationsA` and `operationsB`. The transformation is two-way -\n * both transformed `operationsA` and transformed `operationsB` are returned.\n *\n * Note, that the first operation in each set should base on the same document state (\n * {@link module:engine/model/document~Document#version document version}).\n *\n * It is assumed that `operationsA` are \"more important\" during conflict resolution between two operations.\n *\n * New copies of both passed arrays and operations inside them are returned. Passed arguments are not altered.\n *\n * Base versions of the transformed operations sets are updated accordingly. For example, assume that base versions are `4`\n * and there are `3` operations in `operationsA` and `5` operations in `operationsB`. Then:\n *\n * * transformed `operationsA` will start from base version `9` (`4` base version + `5` operations B),\n * * transformed `operationsB` will start from base version `7` (`4` base version + `3` operations A).\n *\n * If no operation was broken into two during transformation, then both sets will end up with an operation that bases on version `11`:\n *\n * * transformed `operationsA` start from `9` and there are `3` of them, so the last will have `baseVersion` equal to `11`,\n * * transformed `operationsB` start from `7` and there are `5` of them, so the last will have `baseVersion` equal to `11`.\n *\n * @param operationsA\n * @param operationsB\n * @param options Additional transformation options.\n * @param options.document Document which the operations change.\n * @param options.useRelations Whether during transformation relations should be used (used during undo for better conflict resolution).\n * @param options.padWithNoOps Whether additional {@link module:engine/model/operation/nooperation~NoOperation}s\n * should be added to the transformation results to force the same last base version for both transformed sets (in case\n * if some operations got broken into multiple operations during transformation).\n * @param options.forceWeakRemove If set to `false`, remove operation will be always stronger than move operation,\n * so the removed nodes won't end up back in the document root. When set to `true`, context data will be used.\n * @returns Transformation result.\n */\nexport function transformSets(operationsA, operationsB, options) {\n // Create new arrays so the originally passed arguments are not changed.\n // No need to clone operations, they are cloned as they are transformed.\n operationsA = operationsA.slice();\n operationsB = operationsB.slice();\n const contextFactory = new ContextFactory(options.document, options.useRelations, options.forceWeakRemove);\n contextFactory.setOriginalOperations(operationsA);\n contextFactory.setOriginalOperations(operationsB);\n const originalOperations = contextFactory.originalOperations;\n // If one of sets is empty there is simply nothing to transform, so return sets as they are.\n if (operationsA.length == 0 || operationsB.length == 0) {\n return { operationsA, operationsB, originalOperations };\n }\n //\n // Following is a description of transformation process:\n //\n // There are `operationsA` and `operationsB` to be transformed, both by both.\n //\n // So, suppose we have sets of two operations each: `operationsA` = `[ a1, a2 ]`, `operationsB` = `[ b1, b2 ]`.\n //\n // Remember, that we can only transform operations that base on the same context. We assert that `a1` and `b1` base on\n // the same context and we transform them. Then, we get `a1'` and `b1'`. `a2` bases on a context with `a1` -- `a2`\n // is an operation that followed `a1`. Similarly, `b2` bases on a context with `b1`.\n //\n // However, since `a1'` is a result of transformation by `b1`, `a1'` now also has a context with `b1`. This means that\n // we can safely transform `a1'` by `b2`. As we finish transforming `a1`, we also transformed all `operationsB`.\n // All `operationsB` also have context including `a1`. Now, we can properly transform `a2` by those operations.\n //\n // The transformation process can be visualized on a transformation diagram (\"diamond diagram\"):\n //\n // [the initial state]\n // [common for a1 and b1]\n //\n // *\n // / \\\n // / \\\n // b1 a1\n // / \\\n // / \\\n // * *\n // / \\ / \\\n // / \\ / \\\n // b2 a1' b1' a2\n // / \\ / \\\n // / \\ / \\\n // * * *\n // \\ / \\ /\n // \\ / \\ /\n // a1'' b2' a2' b1''\n // \\ / \\ /\n // \\ / \\ /\n // * *\n // \\ /\n // \\ /\n // a2'' b2''\n // \\ /\n // \\ /\n // *\n //\n // [the final state]\n //\n // The final state can be reached from the initial state by applying `a1`, `a2`, `b1''` and `b2''`, as well as by\n // applying `b1`, `b2`, `a1''`, `a2''`. Note how the operations get to a proper common state before each pair is\n // transformed.\n //\n // Another thing to consider is that an operation during transformation can be broken into multiple operations.\n // Suppose that `a1` * `b1` = `[ a11', a12' ]` (instead of `a1'` that we considered previously).\n //\n // In that case, we leave `a12'` for later and we continue transforming `a11'` until it is transformed by all `operationsB`\n // (in our case it is just `b2`). At this point, `b1` is transformed by \"whole\" `a1`, while `b2` is only transformed\n // by `a11'`. Similarly, `a12'` is only transformed by `b1`. This leads to a conclusion that we need to start transforming `a12'`\n // from the moment just after it was broken. So, `a12'` is transformed by `b2`. Now, \"the whole\" `a1` is transformed\n // by `operationsB`, while all `operationsB` are transformed by \"the whole\" `a1`. This means that we can continue with\n // following `operationsA` (in our case it is just `a2`).\n //\n // Of course, also `operationsB` can be broken. However, since we focus on transforming operation `a` to the end,\n // the only thing to do is to store both pieces of operation `b`, so that the next transformed operation `a` will\n // be transformed by both of them.\n //\n // *\n // / \\\n // / \\\n // / \\\n // b1 a1\n // / \\\n // / \\\n // / \\\n // * *\n // / \\ / \\\n // / a11' / \\\n // / \\ / \\\n // b2 * b1' a2\n // / / \\ / \\\n // / / a12' / \\\n // / / \\ / \\\n // * b2' * *\n // \\ / / \\ /\n // a11'' / b21'' \\ /\n // \\ / / \\ /\n // * * a2' b1''\n // \\ / \\ \\ /\n // a12'' b22''\\ \\ /\n // \\ / \\ \\ /\n // * a2'' *\n // \\ \\ /\n // \\ \\ b21'''\n // \\ \\ /\n // a2''' *\n // \\ /\n // \\ b22'''\n // \\ /\n // *\n //\n // Note, how `a1` is broken and transformed into `a11'` and `a12'`, while `b2'` got broken and transformed into `b21''` and `b22''`.\n //\n // Having all that on mind, here is an outline for the transformation process algorithm:\n //\n // 1. We have `operationsA` and `operationsB` array, which we dynamically update as the transformation process goes.\n //\n // 2. We take next (or first) operation from `operationsA` and check from which operation `b` we need to start transforming it.\n // All original `operationsA` are set to be transformed starting from the first operation `b`.\n //\n // 3. We take operations from `operationsB`, one by one, starting from the correct one, and transform operation `a`\n // by operation `b` (and vice versa). We update `operationsA` and `operationsB` by replacing the original operations\n // with the transformation results.\n //\n // 4. If operation is broken into multiple operations, we save all the new operations in the place of the\n // original operation.\n //\n // 5. Additionally, if operation `a` was broken, for the \"new\" operation, we remember from which operation `b` it should\n // be transformed by.\n //\n // 6. We continue transforming \"current\" operation `a` until it is transformed by all `operationsB`. Then, go to 2.\n // unless the last operation `a` was transformed.\n //\n // The actual implementation of the above algorithm is slightly different, as only one loop (while) is used.\n // The difference is that we have \"current\" `a` operation to transform and we store the index of the next `b` operation\n // to transform by. Each loop operates on two indexes then: index pointing to currently processed `a` operation and\n // index pointing to next `b` operation. Each loop is just one `a * b` + `b * a` transformation. After each loop\n // operation `b` index is updated. If all `b` operations were visited for the current `a` operation, we change\n // current `a` operation index to the next one.\n //\n // For each operation `a`, keeps information what is the index in `operationsB` from which the transformation should start.\n const nextTransformIndex = new WeakMap();\n // For all the original `operationsA`, set that they should be transformed starting from the first of `operationsB`.\n for (const op of operationsA) {\n nextTransformIndex.set(op, 0);\n }\n // Additional data that is used for some postprocessing after the main transformation process is done.\n const data = {\n nextBaseVersionA: operationsA[operationsA.length - 1].baseVersion + 1,\n nextBaseVersionB: operationsB[operationsB.length - 1].baseVersion + 1,\n originalOperationsACount: operationsA.length,\n originalOperationsBCount: operationsB.length\n };\n // Index of currently transformed operation `a`.\n let i = 0;\n // While not all `operationsA` are transformed...\n while (i < operationsA.length) {\n // Get \"current\" operation `a`.\n const opA = operationsA[i];\n // For the \"current\" operation `a`, get the index of the next operation `b` to transform by.\n const indexB = nextTransformIndex.get(opA);\n // If operation `a` was already transformed by every operation `b`, change \"current\" operation `a` to the next one.\n if (indexB == operationsB.length) {\n i++;\n continue;\n }\n const opB = operationsB[indexB];\n // Transform `a` by `b` and `b` by `a`.\n const newOpsA = transform(opA, opB, contextFactory.getContext(opA, opB, true));\n const newOpsB = transform(opB, opA, contextFactory.getContext(opB, opA, false));\n // As a result we get one or more `newOpsA` and one or more `newOpsB` operations.\n // Update contextual information about operations.\n contextFactory.updateRelation(opA, opB);\n contextFactory.setOriginalOperations(newOpsA, opA);\n contextFactory.setOriginalOperations(newOpsB, opB);\n // For new `a` operations, update their index of the next operation `b` to transform them by.\n //\n // This is needed even if there was only one result (`a` was not broken) because that information is used\n // at the beginning of this loop every time.\n for (const newOpA of newOpsA) {\n // Acknowledge, that operation `b` also might be broken into multiple operations.\n //\n // This is why we raise `indexB` not just by 1. If `newOpsB` are multiple operations, they will be\n // spliced in the place of `opB`. So we need to change `transformBy` accordingly, so that an operation won't\n // be transformed by the same operation (part of it) again.\n nextTransformIndex.set(newOpA, indexB + newOpsB.length);\n }\n // Update `operationsA` and `operationsB` with the transformed versions.\n operationsA.splice(i, 1, ...newOpsA);\n operationsB.splice(indexB, 1, ...newOpsB);\n }\n if (options.padWithNoOps) {\n // If no-operations padding is enabled, count how many extra `a` and `b` operations were generated.\n const brokenOperationsACount = operationsA.length - data.originalOperationsACount;\n const brokenOperationsBCount = operationsB.length - data.originalOperationsBCount;\n // Then, if that number is not the same, pad `operationsA` or `operationsB` with correct number of no-ops so\n // that the base versions are equalled.\n //\n // Note that only one array will be updated, as only one of those subtractions can be greater than zero.\n padWithNoOps(operationsA, brokenOperationsBCount - brokenOperationsACount);\n padWithNoOps(operationsB, brokenOperationsACount - brokenOperationsBCount);\n }\n // Finally, update base versions of transformed operations.\n updateBaseVersions(operationsA, data.nextBaseVersionB);\n updateBaseVersions(operationsB, data.nextBaseVersionA);\n return { operationsA, operationsB, originalOperations };\n}\n/**\n * Gathers additional data about operations processed during transformation. Can be used to obtain contextual information\n * about two operations that are about to be transformed. This contextual information can be used for better conflict resolution.\n */\nclass ContextFactory {\n /**\n * Creates `ContextFactory` instance.\n *\n * @param document Document which the operations change.\n * @param useRelations Whether during transformation relations should be used (used during undo for\n * better conflict resolution).\n * @param forceWeakRemove If set to `false`, remove operation will be always stronger than move operation,\n * so the removed nodes won't end up back in the document root. When set to `true`, context data will be used.\n */\n constructor(document, useRelations, forceWeakRemove = false) {\n // For each operation that is created during transformation process, we keep a reference to the original operation\n // which it comes from. The original operation works as a kind of \"identifier\". Every contextual information\n // gathered during transformation that we want to save for given operation, is actually saved for the original operation.\n // This way no matter if operation `a` is cloned, then transformed, even breaks, we still have access to the previously\n // gathered data through original operation reference.\n this.originalOperations = new Map();\n // `model.History` instance which information about undone operations will be taken from.\n this._history = document.history;\n // Whether additional context should be used.\n this._useRelations = useRelations;\n this._forceWeakRemove = !!forceWeakRemove;\n // Relations is a double-map structure (maps in map) where for two operations we store how those operations were related\n // to each other. Those relations are evaluated during transformation process. For every transformated pair of operations\n // we keep relations between them.\n this._relations = new Map();\n }\n /**\n * Sets \"original operation\" for given operations.\n *\n * During transformation process, operations are cloned, then changed, then processed again, sometimes broken into two\n * or multiple operations. When gathering additional data it is important that all operations can be somehow linked\n * so a cloned and transformed \"version\" still kept track of the data assigned earlier to it.\n *\n * The original operation object will be used as such an universal linking id. Throughout the transformation process\n * all cloned operations will refer to \"the original operation\" when storing and reading additional data.\n *\n * If `takeFrom` is not set, each operation from `operations` array will be assigned itself as \"the original operation\".\n * This should be used as an initialization step.\n *\n * If `takeFrom` is set, each operation from `operations` will be assigned the same original operation as assigned\n * for `takeFrom` operation. This should be used to update original operations. It should be used in a way that\n * `operations` are the result of `takeFrom` transformation to ensure proper \"original operation propagation\".\n */\n setOriginalOperations(operations, takeFrom = null) {\n const originalOperation = takeFrom ? this.originalOperations.get(takeFrom) : null;\n for (const operation of operations) {\n this.originalOperations.set(operation, originalOperation || operation);\n }\n }\n /**\n * Saves a relation between operations `opA` and `opB`.\n *\n * Relations are then later used to help solve conflicts when operations are transformed.\n */\n updateRelation(opA, opB) {\n // The use of relations is described in a bigger detail in transformation functions.\n //\n // In brief, this function, for specified pairs of operation types, checks how positions defined in those operations relate.\n // Then those relations are saved. For example, for two move operations, it is saved if one of those operations target\n // position is before the other operation source position. This kind of information gives contextual information when\n // transformation is used during undo. Similar checks are done for other pairs of operations.\n //\n if (opA instanceof MoveOperation) {\n if (opB instanceof MergeOperation) {\n if (opA.targetPosition.isEqual(opB.sourcePosition) || opB.movedRange.containsPosition(opA.targetPosition)) {\n this._setRelation(opA, opB, 'insertAtSource');\n }\n else if (opA.targetPosition.isEqual(opB.deletionPosition)) {\n this._setRelation(opA, opB, 'insertBetween');\n }\n else if (opA.targetPosition.isAfter(opB.sourcePosition)) {\n this._setRelation(opA, opB, 'moveTargetAfter');\n }\n }\n else if (opB instanceof MoveOperation) {\n if (opA.targetPosition.isEqual(opB.sourcePosition) || opA.targetPosition.isBefore(opB.sourcePosition)) {\n this._setRelation(opA, opB, 'insertBefore');\n }\n else {\n this._setRelation(opA, opB, 'insertAfter');\n }\n }\n }\n else if (opA instanceof SplitOperation) {\n if (opB instanceof MergeOperation) {\n if (opA.splitPosition.isBefore(opB.sourcePosition)) {\n this._setRelation(opA, opB, 'splitBefore');\n }\n }\n else if (opB instanceof MoveOperation) {\n if (opA.splitPosition.isEqual(opB.sourcePosition) || opA.splitPosition.isBefore(opB.sourcePosition)) {\n this._setRelation(opA, opB, 'splitBefore');\n }\n else {\n const range = Range._createFromPositionAndShift(opB.sourcePosition, opB.howMany);\n if (opA.splitPosition.hasSameParentAs(opB.sourcePosition) && range.containsPosition(opA.splitPosition)) {\n const howMany = range.end.offset - opA.splitPosition.offset;\n const offset = opA.splitPosition.offset - range.start.offset;\n this._setRelation(opA, opB, { howMany, offset });\n }\n }\n }\n }\n else if (opA instanceof MergeOperation) {\n if (opB instanceof MergeOperation) {\n if (!opA.targetPosition.isEqual(opB.sourcePosition)) {\n this._setRelation(opA, opB, 'mergeTargetNotMoved');\n }\n if (opA.sourcePosition.isEqual(opB.targetPosition)) {\n this._setRelation(opA, opB, 'mergeSourceNotMoved');\n }\n if (opA.sourcePosition.isEqual(opB.sourcePosition)) {\n this._setRelation(opA, opB, 'mergeSameElement');\n }\n }\n else if (opB instanceof SplitOperation) {\n if (opA.sourcePosition.isEqual(opB.splitPosition)) {\n this._setRelation(opA, opB, 'splitAtSource');\n }\n }\n }\n else if (opA instanceof MarkerOperation) {\n const markerRange = opA.newRange;\n if (!markerRange) {\n return;\n }\n if (opB instanceof MoveOperation) {\n const movedRange = Range._createFromPositionAndShift(opB.sourcePosition, opB.howMany);\n const affectedLeft = movedRange.containsPosition(markerRange.start) ||\n movedRange.start.isEqual(markerRange.start);\n const affectedRight = movedRange.containsPosition(markerRange.end) ||\n movedRange.end.isEqual(markerRange.end);\n if ((affectedLeft || affectedRight) && !movedRange.containsRange(markerRange)) {\n this._setRelation(opA, opB, {\n side: affectedLeft ? 'left' : 'right',\n path: affectedLeft ? markerRange.start.path.slice() : markerRange.end.path.slice()\n });\n }\n }\n else if (opB instanceof MergeOperation) {\n const wasInLeftElement = markerRange.start.isEqual(opB.targetPosition);\n const wasStartBeforeMergedElement = markerRange.start.isEqual(opB.deletionPosition);\n const wasEndBeforeMergedElement = markerRange.end.isEqual(opB.deletionPosition);\n const wasInRightElement = markerRange.end.isEqual(opB.sourcePosition);\n if (wasInLeftElement || wasStartBeforeMergedElement || wasEndBeforeMergedElement || wasInRightElement) {\n this._setRelation(opA, opB, {\n wasInLeftElement,\n wasStartBeforeMergedElement,\n wasEndBeforeMergedElement,\n wasInRightElement\n });\n }\n }\n }\n }\n /**\n * Evaluates and returns contextual information about two given operations `opA` and `opB` which are about to be transformed.\n */\n getContext(opA, opB, aIsStrong) {\n return {\n aIsStrong,\n aWasUndone: this._wasUndone(opA),\n bWasUndone: this._wasUndone(opB),\n abRelation: this._useRelations ? this._getRelation(opA, opB) : null,\n baRelation: this._useRelations ? this._getRelation(opB, opA) : null,\n forceWeakRemove: this._forceWeakRemove\n };\n }\n /**\n * Returns whether given operation `op` has already been undone.\n *\n * Information whether an operation was undone gives more context when making a decision when two operations are in conflict.\n */\n _wasUndone(op) {\n // For `op`, get its original operation. After all, if `op` is a clone (or even transformed clone) of another\n // operation, literally `op` couldn't be undone. It was just generated. If anything, it was the operation it origins\n // from which was undone. So get that original operation.\n const originalOp = this.originalOperations.get(op);\n // And check with the document if the original operation was undone.\n return originalOp.wasUndone || this._history.isUndoneOperation(originalOp);\n }\n /**\n * Returns a relation between `opA` and an operation which is undone by `opB`. This can be `String` value if a relation\n * was set earlier or `null` if there was no relation between those operations.\n *\n * This is a little tricky to understand, so let's compare it to `ContextFactory#_wasUndone`.\n *\n * When `wasUndone( opB )` is used, we check if the `opB` has already been undone. It is obvious, that the\n * undoing operation must happen after the undone operation. So, essentially, we have `opB`, we take document history,\n * we look forward in the future and ask if in that future `opB` was undone.\n *\n * Relations is a backward process to `wasUndone()`.\n *\n * Long story short - using relations is asking what happened in the past. Looking back. This time we have an undoing\n * operation `opB` which has undone some other operation. When there is a transformation `opA` x `opB` and there is\n * a conflict to solve and `opB` is an undoing operation, we can look back in the history and see what was a relation\n * between `opA` and the operation which `opB` undone. Basing on that relation from the past, we can now make\n * a better decision when resolving a conflict between two operations, because we know more about the context of\n * those two operations.\n *\n * This is why this function does not return a relation directly between `opA` and `opB` because we need to look\n * back to search for a meaningful contextual information.\n */\n _getRelation(opA, opB) {\n // Get the original operation. Similarly as in `wasUndone()` it is used as an universal identifier for stored data.\n const origB = this.originalOperations.get(opB);\n const undoneB = this._history.getUndoneOperation(origB);\n // If `opB` is not undoing any operation, there is no relation.\n if (!undoneB) {\n return null;\n }\n const origA = this.originalOperations.get(opA);\n const relationsA = this._relations.get(origA);\n // Get all relations for `opA`, and check if there is a relation with `opB`-undone-counterpart. If so, return it.\n if (relationsA) {\n return relationsA.get(undoneB) || null;\n }\n return null;\n }\n /**\n * Helper function for `ContextFactory#updateRelations`.\n */\n _setRelation(opA, opB, relation) {\n // As always, setting is for original operations, not the clones/transformed operations.\n const origA = this.originalOperations.get(opA);\n const origB = this.originalOperations.get(opB);\n let relationsA = this._relations.get(origA);\n if (!relationsA) {\n relationsA = new Map();\n this._relations.set(origA, relationsA);\n }\n relationsA.set(origB, relation);\n }\n}\n/**\n * An utility function that updates {@link module:engine/model/operation/operation~Operation#baseVersion base versions}\n * of passed operations.\n *\n * The function simply sets `baseVersion` as a base version of the first passed operation and then increments it for\n * each following operation in `operations`.\n *\n * @param operations Operations to update.\n * @param baseVersion Base version to set for the first operation in `operations`.\n */\nfunction updateBaseVersions(operations, baseVersion) {\n for (const operation of operations) {\n operation.baseVersion = baseVersion++;\n }\n}\n/**\n * Adds `howMany` instances of {@link module:engine/model/operation/nooperation~NoOperation} to `operations` set.\n */\nfunction padWithNoOps(operations, howMany) {\n for (let i = 0; i < howMany; i++) {\n operations.push(new NoOperation(0));\n }\n}\n// -----------------------\nsetTransformation(AttributeOperation, AttributeOperation, (a, b, context) => {\n // If operations in conflict, check if their ranges intersect and manage them properly.\n //\n // Operations can be in conflict only if:\n //\n // * their key is the same (they change the same attribute), and\n // * they are in the same parent (operations for ranges [ 1 ] - [ 3 ] and [ 2, 0 ] - [ 2, 5 ] change different\n // elements and can't be in conflict).\n if (a.key === b.key && a.range.start.hasSameParentAs(b.range.start)) {\n // First, we want to apply change to the part of a range that has not been changed by the other operation.\n const operations = a.range.getDifference(b.range).map(range => {\n return new AttributeOperation(range, a.key, a.oldValue, a.newValue, 0);\n });\n // Then we take care of the common part of ranges.\n const common = a.range.getIntersection(b.range);\n if (common) {\n // If this operation is more important, we also want to apply change to the part of the\n // original range that has already been changed by the other operation. Since that range\n // got changed we also have to update `oldValue`.\n if (context.aIsStrong) {\n operations.push(new AttributeOperation(common, b.key, b.newValue, a.newValue, 0));\n }\n }\n if (operations.length == 0) {\n return [new NoOperation(0)];\n }\n return operations;\n }\n else {\n // If operations don't conflict, simply return an array containing just a clone of this operation.\n return [a];\n }\n});\nsetTransformation(AttributeOperation, InsertOperation, (a, b) => {\n // Case 1:\n //\n // The attribute operation range includes the position where nodes were inserted.\n // There are two possible scenarios: the inserted nodes were text and they should receive attributes or\n // the inserted nodes were elements and they should not receive attributes.\n //\n if (a.range.start.hasSameParentAs(b.position) && a.range.containsPosition(b.position)) {\n // If new nodes should not receive attributes, two separated ranges will be returned.\n // Otherwise, one expanded range will be returned.\n const range = a.range._getTransformedByInsertion(b.position, b.howMany, !b.shouldReceiveAttributes);\n const result = range.map(r => {\n return new AttributeOperation(r, a.key, a.oldValue, a.newValue, a.baseVersion);\n });\n if (b.shouldReceiveAttributes) {\n // `AttributeOperation#range` includes some newly inserted text.\n // The operation should also change the attribute of that text. An example:\n //\n // Bold should be applied on the following range:\n // <p>Fo[zb]ar</p>\n //\n // In meantime, new text is typed:\n // <p>Fozxxbar</p>\n //\n // Bold should be applied also on the new text:\n // <p>Fo[zxxb]ar</p>\n // <p>Fo<$text bold=\"true\">zxxb</$text>ar</p>\n //\n // There is a special case to consider here to consider.\n //\n // Consider setting an attribute with multiple possible values, for example `highlight`. The inserted text might\n // have already an attribute value applied and the `oldValue` property of the attribute operation might be wrong:\n //\n // Attribute `highlight=\"yellow\"` should be applied on the following range:\n // <p>Fo[zb]ar<p>\n //\n // In meantime, character `x` with `highlight=\"red\"` is typed:\n // <p>Fo[z<$text highlight=\"red\">x</$text>b]ar</p>\n //\n // In this case we cannot simply apply operation changing the attribute value from `null` to `\"yellow\"` for the whole range\n // because that would lead to an exception (`oldValue` is incorrect for `x`).\n //\n // We also cannot break the original range as this would mess up a scenario when there are multiple following\n // insert operations, because then only the first inserted character is included in those ranges:\n // <p>Fo[z][x][b]ar</p> --> <p>Fo[z][x]x[b]ar</p> --> <p>Fo[z][x]xx[b]ar</p>\n //\n // So, the attribute range needs be expanded, no matter what attributes are set on the inserted nodes:\n //\n // <p>Fo[z<$text highlight=\"red\">x</$text>b]ar</p> <--- Change from `null` to `yellow`, throwing an exception.\n //\n // But before that operation would be applied, we will add an additional attribute operation that will change\n // attributes on the inserted nodes in a way which would make the original operation correct:\n //\n // <p>Fo[z{<$text highlight=\"red\">}x</$text>b]ar</p> <--- Change range `{}` from `red` to `null`.\n // <p>Fo[zxb]ar</p> <--- Now change from `null` to `yellow` is completely fine.\n //\n // Generate complementary attribute operation. Be sure to add it before the original operation.\n const op = _getComplementaryAttributeOperations(b, a.key, a.oldValue);\n if (op) {\n result.unshift(op);\n }\n }\n // If nodes should not receive new attribute, we are done here.\n return result;\n }\n // If insert operation is not expanding the attribute operation range, simply transform the range.\n a.range = a.range._getTransformedByInsertion(b.position, b.howMany, false)[0];\n return [a];\n});\n/**\n * Helper function for `AttributeOperation` x `InsertOperation` (and reverse) transformation.\n *\n * For given `insertOperation` it checks the inserted node if it has an attribute `key` set to a value different\n * than `newValue`. If so, it generates an `AttributeOperation` which changes the value of `key` attribute to `newValue`.\n */\nfunction _getComplementaryAttributeOperations(insertOperation, key, newValue) {\n const nodes = insertOperation.nodes;\n // At the beginning we store the attribute value from the first node.\n const insertValue = nodes.getNode(0).getAttribute(key);\n if (insertValue == newValue) {\n return null;\n }\n const range = new Range(insertOperation.position, insertOperation.position.getShiftedBy(insertOperation.howMany));\n return new AttributeOperation(range, key, insertValue, newValue, 0);\n}\nsetTransformation(AttributeOperation, MergeOperation, (a, b) => {\n const ranges = [];\n // Case 1:\n //\n // Attribute change on the merged element. In this case, the merged element was moved to the graveyard.\n // An additional attribute operation that will change the (re)moved element needs to be generated.\n //\n if (a.range.start.hasSameParentAs(b.deletionPosition)) {\n if (a.range.containsPosition(b.deletionPosition) || a.range.start.isEqual(b.deletionPosition)) {\n ranges.push(Range._createFromPositionAndShift(b.graveyardPosition, 1));\n }\n }\n const range = a.range._getTransformedByMergeOperation(b);\n // Do not add empty (collapsed) ranges to the result. `range` may be collapsed if it contained only the merged element.\n if (!range.isCollapsed) {\n ranges.push(range);\n }\n // Create `AttributeOperation`s out of the ranges.\n return ranges.map(range => {\n return new AttributeOperation(range, a.key, a.oldValue, a.newValue, a.baseVersion);\n });\n});\nsetTransformation(AttributeOperation, MoveOperation, (a, b) => {\n const ranges = _breakRangeByMoveOperation(a.range, b);\n // Create `AttributeOperation`s out of the ranges.\n return ranges.map(range => new AttributeOperation(range, a.key, a.oldValue, a.newValue, a.baseVersion));\n});\n/**\n * Helper function for `AttributeOperation` x `MoveOperation` transformation.\n *\n * Takes the passed `range` and transforms it by move operation `moveOp` in a specific way. Only top-level nodes of `range`\n * are considered to be in the range. If move operation moves nodes deep from inside of the range, those nodes won't\n * be included in the result. In other words, top-level nodes of the ranges from the result are exactly the same as\n * top-level nodes of the original `range`.\n *\n * This is important for `AttributeOperation` because, for its range, it changes only the top-level nodes. So we need to\n * track only how those nodes have been affected by `MoveOperation`.\n */\nfunction _breakRangeByMoveOperation(range, moveOp) {\n const moveRange = Range._createFromPositionAndShift(moveOp.sourcePosition, moveOp.howMany);\n // We are transforming `range` (original range) by `moveRange` (range moved by move operation). As usual when it comes to\n // transforming a ranges, we may have a common part of the ranges and we may have a difference part (zero to two ranges).\n let common = null;\n let difference = [];\n // Let's compare the ranges.\n if (moveRange.containsRange(range, true)) {\n // If the whole original range is moved, treat it whole as a common part. There's also no difference part.\n common = range;\n }\n else if (range.start.hasSameParentAs(moveRange.start)) {\n // If the ranges are \"on the same level\" (in the same parent) then move operation may move exactly those nodes\n // that are changed by the attribute operation. In this case we get common part and difference part in the usual way.\n difference = range.getDifference(moveRange);\n common = range.getIntersection(moveRange);\n }\n else {\n // In any other situation we assume that original range is different than move range, that is that move operation\n // moves other nodes that attribute operation change. Even if the moved range is deep inside in the original range.\n //\n // Note that this is different than in `.getIntersection` (we would get a common part in that case) and different\n // than `.getDifference` (we would get two ranges).\n difference = [range];\n }\n const result = [];\n // The default behaviour of `_getTransformedByMove` might get wrong results for difference part, though, so\n // we do it by hand.\n for (let diff of difference) {\n // First, transform the range by removing moved nodes. Since this is a difference, this is safe, `null` won't be returned\n // as the range is different than the moved range.\n diff = diff._getTransformedByDeletion(moveOp.sourcePosition, moveOp.howMany);\n // Transform also `targetPosition`.\n const targetPosition = moveOp.getMovedRangeStart();\n // Spread the range only if moved nodes are inserted only between the top-level nodes of the `diff` range.\n const spread = diff.start.hasSameParentAs(targetPosition);\n // Transform by insertion of moved nodes.\n const diffs = diff._getTransformedByInsertion(targetPosition, moveOp.howMany, spread);\n result.push(...diffs);\n }\n // Common part can be simply transformed by the move operation. This is because move operation will not target to\n // that common part (the operation would have to target inside its own moved range).\n if (common) {\n result.push(common._getTransformedByMove(moveOp.sourcePosition, moveOp.targetPosition, moveOp.howMany, false)[0]);\n }\n return result;\n}\nsetTransformation(AttributeOperation, SplitOperation, (a, b) => {\n // Case 1:\n //\n // Split node is the last node in `AttributeOperation#range`.\n // `AttributeOperation#range` needs to be expanded to include the new (split) node.\n //\n // Attribute `type` to be changed to `numbered` but the `listItem` is split.\n // <listItem type=\"bulleted\">foobar</listItem>\n //\n // After split:\n // <listItem type=\"bulleted\">foo</listItem><listItem type=\"bulleted\">bar</listItem>\n //\n // After attribute change:\n // <listItem type=\"numbered\">foo</listItem><listItem type=\"numbered\">foo</listItem>\n //\n if (a.range.end.isEqual(b.insertionPosition)) {\n if (!b.graveyardPosition) {\n a.range.end.offset++;\n }\n return [a];\n }\n // Case 2:\n //\n // Split position is inside `AttributeOperation#range`, at the same level, so the nodes to change are\n // not going to make a flat range.\n //\n // Content with range-to-change and split position:\n // <p>Fo[zb^a]r</p>\n //\n // After split:\n // <p>Fozb</p><p>ar</p>\n //\n // Make two separate ranges containing all nodes to change:\n // <p>Fo[zb]</p><p>[a]r</p>\n //\n if (a.range.start.hasSameParentAs(b.splitPosition) && a.range.containsPosition(b.splitPosition)) {\n const secondPart = a.clone();\n secondPart.range = new Range(b.moveTargetPosition.clone(), a.range.end._getCombined(b.splitPosition, b.moveTargetPosition));\n a.range.end = b.splitPosition.clone();\n a.range.end.stickiness = 'toPrevious';\n return [a, secondPart];\n }\n // The default case.\n //\n a.range = a.range._getTransformedBySplitOperation(b);\n return [a];\n});\nsetTransformation(InsertOperation, AttributeOperation, (a, b) => {\n const result = [a];\n // Case 1:\n //\n // The attribute operation range includes the position where nodes were inserted.\n // There are two possible scenarios: the inserted nodes were text and they should receive attributes or\n // the inserted nodes were elements and they should not receive attributes.\n //\n // This is a mirror scenario to the one described in `AttributeOperation` x `InsertOperation` transformation,\n // although this case is a little less complicated. In this case we simply need to change attributes of the\n // inserted nodes and that's it.\n //\n if (a.shouldReceiveAttributes && a.position.hasSameParentAs(b.range.start) && b.range.containsPosition(a.position)) {\n const op = _getComplementaryAttributeOperations(a, b.key, b.newValue);\n if (op) {\n result.push(op);\n }\n }\n // The default case is: do nothing.\n // `AttributeOperation` does not change the model tree structure so `InsertOperation` does not need to be changed.\n //\n return result;\n});\nsetTransformation(InsertOperation, InsertOperation, (a, b, context) => {\n // Case 1:\n //\n // Two insert operations insert nodes at the same position. Since they are the same, it needs to be decided\n // what will be the order of inserted nodes. However, there is no additional information to help in that\n // decision. Also, when `b` will be transformed by `a`, the same order must be maintained.\n //\n // To achieve that, we will check if the operation is strong.\n // If it is, it won't get transformed. If it is not, it will be moved.\n //\n if (a.position.isEqual(b.position) && context.aIsStrong) {\n return [a];\n }\n // The default case.\n //\n a.position = a.position._getTransformedByInsertOperation(b);\n return [a];\n});\nsetTransformation(InsertOperation, MoveOperation, (a, b) => {\n // The default case.\n //\n a.position = a.position._getTransformedByMoveOperation(b);\n return [a];\n});\nsetTransformation(InsertOperation, SplitOperation, (a, b) => {\n // The default case.\n //\n a.position = a.position._getTransformedBySplitOperation(b);\n return [a];\n});\nsetTransformation(InsertOperation, MergeOperation, (a, b) => {\n a.position = a.position._getTransformedByMergeOperation(b);\n return [a];\n});\n// -----------------------\nsetTransformation(MarkerOperation, InsertOperation, (a, b) => {\n if (a.oldRange) {\n a.oldRange = a.oldRange._getTransformedByInsertOperation(b)[0];\n }\n if (a.newRange) {\n a.newRange = a.newRange._getTransformedByInsertOperation(b)[0];\n }\n return [a];\n});\nsetTransformation(MarkerOperation, MarkerOperation, (a, b, context) => {\n if (a.name == b.name) {\n if (context.aIsStrong) {\n a.oldRange = b.newRange ? b.newRange.clone() : null;\n }\n else {\n return [new NoOperation(0)];\n }\n }\n return [a];\n});\nsetTransformation(MarkerOperation, MergeOperation, (a, b) => {\n if (a.oldRange) {\n a.oldRange = a.oldRange._getTransformedByMergeOperation(b);\n }\n if (a.newRange) {\n a.newRange = a.newRange._getTransformedByMergeOperation(b);\n }\n return [a];\n});\nsetTransformation(MarkerOperation, MoveOperation, (a, b, context) => {\n if (a.oldRange) {\n a.oldRange = Range._createFromRanges(a.oldRange._getTransformedByMoveOperation(b));\n }\n if (a.newRange) {\n if (context.abRelation) {\n const aNewRange = Range._createFromRanges(a.newRange._getTransformedByMoveOperation(b));\n if (context.abRelation.side == 'left' && b.targetPosition.isEqual(a.newRange.start)) {\n a.newRange.end = aNewRange.end;\n a.newRange.start.path = context.abRelation.path;\n return [a];\n }\n else if (context.abRelation.side == 'right' && b.targetPosition.isEqual(a.newRange.end)) {\n a.newRange.start = aNewRange.start;\n a.newRange.end.path = context.abRelation.path;\n return [a];\n }\n }\n a.newRange = Range._createFromRanges(a.newRange._getTransformedByMoveOperation(b));\n }\n return [a];\n});\nsetTransformation(MarkerOperation, SplitOperation, (a, b, context) => {\n if (a.oldRange) {\n a.oldRange = a.oldRange._getTransformedBySplitOperation(b);\n }\n if (a.newRange) {\n if (context.abRelation) {\n const aNewRange = a.newRange._getTransformedBySplitOperation(b);\n if (a.newRange.start.isEqual(b.splitPosition) && context.abRelation.wasStartBeforeMergedElement) {\n a.newRange.start = Position._createAt(b.insertionPosition);\n }\n else if (a.newRange.start.isEqual(b.splitPosition) && !context.abRelation.wasInLeftElement) {\n a.newRange.start = Position._createAt(b.moveTargetPosition);\n }\n if (a.newRange.end.isEqual(b.splitPosition) && context.abRelation.wasInRightElement) {\n a.newRange.end = Position._createAt(b.moveTargetPosition);\n }\n else if (a.newRange.end.isEqual(b.splitPosition) && context.abRelation.wasEndBeforeMergedElement) {\n a.newRange.end = Position._createAt(b.insertionPosition);\n }\n else {\n a.newRange.end = aNewRange.end;\n }\n return [a];\n }\n a.newRange = a.newRange._getTransformedBySplitOperation(b);\n }\n return [a];\n});\n// -----------------------\nsetTransformation(MergeOperation, InsertOperation, (a, b) => {\n if (a.sourcePosition.hasSameParentAs(b.position)) {\n a.howMany += b.howMany;\n }\n a.sourcePosition = a.sourcePosition._getTransformedByInsertOperation(b);\n a.targetPosition = a.targetPosition._getTransformedByInsertOperation(b);\n return [a];\n});\nsetTransformation(MergeOperation, MergeOperation, (a, b, context) => {\n // Case 1:\n //\n // Same merge operations.\n //\n // Both operations have same source and target positions. So the element already got merged and there is\n // theoretically nothing to do.\n //\n if (a.sourcePosition.isEqual(b.sourcePosition) && a.targetPosition.isEqual(b.targetPosition)) {\n // There are two ways that we can provide a do-nothing operation.\n //\n // First is simply a NoOperation instance. We will use it if `b` operation was not undone.\n //\n // Second is a merge operation that has the source operation in the merged element - in the graveyard -\n // same target position and `howMany` equal to `0`. So it is basically merging an empty element from graveyard\n // which is almost the same as NoOperation.\n //\n // This way the merge operation can be later transformed by split operation\n // to provide correct undo. This will be used if `b` operation was undone (only then it is correct).\n //\n if (!context.bWasUndone) {\n return [new NoOperation(0)];\n }\n else {\n const path = b.graveyardPosition.path.slice();\n path.push(0);\n a.sourcePosition = new Position(b.graveyardPosition.root, path);\n a.howMany = 0;\n return [a];\n }\n }\n // Case 2:\n //\n // Same merge source position but different target position.\n //\n // This can happen during collaboration. For example, if one client merged a paragraph to the previous paragraph\n // and the other person removed that paragraph and merged the same paragraph to something before:\n //\n // Client A:\n // <p>Foo</p><p>Bar</p><p>[]Xyz</p>\n // <p>Foo</p><p>BarXyz</p>\n //\n // Client B:\n // <p>Foo</p>[<p>Bar</p>]<p>Xyz</p>\n // <p>Foo</p><p>[]Xyz</p>\n // <p>FooXyz</p>\n //\n // In this case we need to decide where finally \"Xyz\" will land:\n //\n // <p>FooXyz</p> graveyard: <p>Bar</p>\n // <p>Foo</p> graveyard: <p>BarXyz</p>\n //\n // Let's move it in a way so that a merge operation that does not target to graveyard is more important so that\n // nodes does not end up in the graveyard. It makes sense. Both for Client A and for Client B \"Xyz\" finally did not\n // end up in the graveyard (see above).\n //\n // If neither or both operations point to graveyard, then let `aIsStrong` decide.\n //\n if (a.sourcePosition.isEqual(b.sourcePosition) && !a.targetPosition.isEqual(b.targetPosition) &&\n !context.bWasUndone && context.abRelation != 'splitAtSource') {\n const aToGraveyard = a.targetPosition.root.rootName == '$graveyard';\n const bToGraveyard = b.targetPosition.root.rootName == '$graveyard';\n // If `aIsWeak` it means that `a` points to graveyard while `b` doesn't. Don't move nodes then.\n const aIsWeak = aToGraveyard && !bToGraveyard;\n // If `bIsWeak` it means that `b` points to graveyard while `a` doesn't. Force moving nodes then.\n const bIsWeak = bToGraveyard && !aToGraveyard;\n // Force move if `b` is weak or neither operation is weak but `a` is stronger through `context.aIsStrong`.\n const forceMove = bIsWeak || (!aIsWeak && context.aIsStrong);\n if (forceMove) {\n const sourcePosition = b.targetPosition._getTransformedByMergeOperation(b);\n const targetPosition = a.targetPosition._getTransformedByMergeOperation(b);\n return [new MoveOperation(sourcePosition, a.howMany, targetPosition, 0)];\n }\n else {\n return [new NoOperation(0)];\n }\n }\n // The default case.\n //\n if (a.sourcePosition.hasSameParentAs(b.targetPosition)) {\n a.howMany += b.howMany;\n }\n a.sourcePosition = a.sourcePosition._getTransformedByMergeOperation(b);\n a.targetPosition = a.targetPosition._getTransformedByMergeOperation(b);\n // Handle positions in graveyard.\n // If graveyard positions are same and `a` operation is strong - do not transform.\n if (!a.graveyardPosition.isEqual(b.graveyardPosition) || !context.aIsStrong) {\n a.graveyardPosition = a.graveyardPosition._getTransformedByMergeOperation(b);\n }\n return [a];\n});\nsetTransformation(MergeOperation, MoveOperation, (a, b, context) => {\n // Case 1:\n //\n // The element to merge got removed.\n //\n // Merge operation does support merging elements which are not siblings. So it would not be a problem\n // from technical point of view. However, if the element was removed, the intention of the user deleting it\n // was to have it all deleted, together with its children. From user experience point of view, moving back the\n // removed nodes might be unexpected. This means that in this scenario we will block the merging.\n //\n // The exception of this rule would be if the remove operation was later undone.\n //\n const removedRange = Range._createFromPositionAndShift(b.sourcePosition, b.howMany);\n if (b.type == 'remove' && !context.bWasUndone && !context.forceWeakRemove) {\n if (a.deletionPosition.hasSameParentAs(b.sourcePosition) && removedRange.containsPosition(a.sourcePosition)) {\n return [new NoOperation(0)];\n }\n }\n // The default case.\n //\n if (a.sourcePosition.hasSameParentAs(b.targetPosition)) {\n a.howMany += b.howMany;\n }\n if (a.sourcePosition.hasSameParentAs(b.sourcePosition)) {\n a.howMany -= b.howMany;\n }\n a.sourcePosition = a.sourcePosition._getTransformedByMoveOperation(b);\n a.targetPosition = a.targetPosition._getTransformedByMoveOperation(b);\n // `MergeOperation` graveyard position is like `MoveOperation` target position. It is a position where element(s) will\n // be moved. Like in other similar cases, we need to consider the scenario when those positions are same.\n // Here, we will treat `MergeOperation` like it is always strong (see `InsertOperation` x `InsertOperation` for comparison).\n // This means that we won't transform graveyard position if it is equal to move operation target position.\n if (!a.graveyardPosition.isEqual(b.targetPosition)) {\n a.graveyardPosition = a.graveyardPosition._getTransformedByMoveOperation(b);\n }\n return [a];\n});\nsetTransformation(MergeOperation, SplitOperation, (a, b, context) => {\n if (b.graveyardPosition) {\n // If `b` operation defines graveyard position, a node from graveyard will be moved. This means that we need to\n // transform `a.graveyardPosition` accordingly.\n a.graveyardPosition = a.graveyardPosition._getTransformedByDeletion(b.graveyardPosition, 1);\n // This is a scenario foreseen in `MergeOperation` x `MergeOperation`, with two identical merge operations.\n //\n // So, there was `MergeOperation` x `MergeOperation` transformation earlier. Now, `a` is a merge operation which\n // source position is in graveyard. Interestingly, split operation wants to use the node to be merged by `a`. This\n // means that `b` is undoing that merge operation from earlier, which caused `a` to be in graveyard.\n //\n // If that's the case, at this point, we will only \"fix\" `a.howMany`. It was earlier set to `0` in\n // `MergeOperation` x `MergeOperation` transformation. Later transformations in this function will change other\n // properties.\n //\n if (a.deletionPosition.isEqual(b.graveyardPosition)) {\n a.howMany = b.howMany;\n }\n }\n // Case 1:\n //\n // Merge operation moves nodes to the place where split happens.\n // This is a classic situation when there are two paragraphs, and there is a split (enter) after the first\n // paragraph and there is a merge (delete) at the beginning of the second paragraph:\n //\n // <p>Foo{}</p><p>[]Bar</p>.\n //\n // Split is after `Foo`, while merge is from `Bar` to the end of `Foo`.\n //\n // State after split:\n // <p>Foo</p><p></p><p>Bar</p>\n //\n // Now, `Bar` should be merged to the new paragraph:\n // <p>Foo</p><p>Bar</p>\n //\n // Instead of merging it to the original paragraph:\n // <p>FooBar</p><p></p>\n //\n // This means that `targetPosition` needs to be transformed. This is the default case though.\n // For example, if the split would be after `F`, `targetPosition` should also be transformed.\n //\n // There are three exceptions, though, when we want to keep `targetPosition` as it was.\n //\n // First exception is when the merge target position is inside an element (not at the end, as usual). This\n // happens when the merge operation earlier was transformed by \"the same\" merge operation. If merge operation\n // targets inside the element we want to keep the original target position (and not transform it) because\n // we have additional context telling us that we want to merge to the original element. We can check if the\n // merge operation points inside element by checking what is `SplitOperation#howMany`. Since merge target position\n // is same as split position, if `howMany` is non-zero, it means that the merge target position is inside an element.\n //\n // Second exception is when the element to merge is in the graveyard and split operation uses it. In that case\n // if target position would be transformed, the merge operation would target at the source position:\n //\n // root: <p>Foo</p>\t\t\t\tgraveyard: <p></p>\n //\n // SplitOperation: root [ 0, 3 ] using graveyard [ 0 ] (howMany = 0)\n // MergeOperation: graveyard [ 0, 0 ] -> root [ 0, 3 ] (howMany = 0)\n //\n // Since split operation moves the graveyard node back to the root, the merge operation source position changes.\n // We would like to merge from the empty <p> to the \"Foo\" <p>:\n //\n // root: <p>Foo</p><p></p>\t\t\tgraveyard:\n //\n // MergeOperation#sourcePosition = root [ 1, 0 ]\n //\n // If `targetPosition` is transformed, it would become root [ 1, 0 ] as well. It has to be kept as it was.\n //\n // Third exception is connected with relations. If this happens during undo and we have explicit information\n // that target position has not been affected by the operation which is undone by this split then this split should\n // not move the target position either.\n //\n if (a.targetPosition.isEqual(b.splitPosition)) {\n const mergeInside = b.howMany != 0;\n const mergeSplittingElement = b.graveyardPosition && a.deletionPosition.isEqual(b.graveyardPosition);\n if (mergeInside || mergeSplittingElement || context.abRelation == 'mergeTargetNotMoved') {\n a.sourcePosition = a.sourcePosition._getTransformedBySplitOperation(b);\n return [a];\n }\n }\n // Case 2:\n //\n // Merge source is at the same position as split position. This sometimes happen, mostly during undo.\n // The decision here is mostly to choose whether merge source position should stay where it is (so it will be at the end of the\n // split element) or should be move to the beginning of the new element.\n //\n if (a.sourcePosition.isEqual(b.splitPosition)) {\n // Use context to check if `SplitOperation` is not undoing a merge operation, that didn't change the `a` operation.\n // This scenario happens the undone merge operation moved nodes at the source position of `a` operation.\n // In that case `a` operation source position should stay where it is.\n if (context.abRelation == 'mergeSourceNotMoved') {\n a.howMany = 0;\n a.targetPosition = a.targetPosition._getTransformedBySplitOperation(b);\n return [a];\n }\n // This merge operation might have been earlier transformed by a merge operation which both merged the same element.\n // See that case in `MergeOperation` x `MergeOperation` transformation. In that scenario, if the merge operation has been undone,\n // the special case is not applied.\n //\n // Now, the merge operation is transformed by the split which has undone that previous merge operation.\n // So now we are fixing situation which was skipped in `MergeOperation` x `MergeOperation` case.\n //\n if (context.abRelation == 'mergeSameElement' || a.sourcePosition.offset > 0) {\n a.sourcePosition = b.moveTargetPosition.clone();\n a.targetPosition = a.targetPosition._getTransformedBySplitOperation(b);\n return [a];\n }\n }\n // The default case.\n //\n if (a.sourcePosition.hasSameParentAs(b.splitPosition)) {\n a.howMany = b.splitPosition.offset;\n }\n a.sourcePosition = a.sourcePosition._getTransformedBySplitOperation(b);\n a.targetPosition = a.targetPosition._getTransformedBySplitOperation(b);\n return [a];\n});\n// -----------------------\nsetTransformation(MoveOperation, InsertOperation, (a, b) => {\n const moveRange = Range._createFromPositionAndShift(a.sourcePosition, a.howMany);\n const transformed = moveRange._getTransformedByInsertOperation(b, false)[0];\n a.sourcePosition = transformed.start;\n a.howMany = transformed.end.offset - transformed.start.offset;\n // See `InsertOperation` x `MoveOperation` transformation for details on this case.\n //\n // In summary, both operations point to the same place, so the order of nodes needs to be decided.\n // `MoveOperation` is considered weaker, so it is always transformed, unless there was a certain relation\n // between operations.\n //\n if (!a.targetPosition.isEqual(b.position)) {\n a.targetPosition = a.targetPosition._getTransformedByInsertOperation(b);\n }\n return [a];\n});\nsetTransformation(MoveOperation, MoveOperation, (a, b, context) => {\n //\n // Setting and evaluating some variables that will be used in special cases and default algorithm.\n //\n // Create ranges from `MoveOperations` properties.\n const rangeA = Range._createFromPositionAndShift(a.sourcePosition, a.howMany);\n const rangeB = Range._createFromPositionAndShift(b.sourcePosition, b.howMany);\n // Assign `context.aIsStrong` to a different variable, because the value may change during execution of\n // this algorithm and we do not want to override original `context.aIsStrong` that will be used in later transformations.\n let aIsStrong = context.aIsStrong;\n // This will be used to decide the order of nodes if both operations target at the same position.\n // By default, use strong/weak operation mechanism.\n let insertBefore = !context.aIsStrong;\n // If the relation is set, then use it to decide nodes order.\n if (context.abRelation == 'insertBefore' || context.baRelation == 'insertAfter') {\n insertBefore = true;\n }\n else if (context.abRelation == 'insertAfter' || context.baRelation == 'insertBefore') {\n insertBefore = false;\n }\n // `a.targetPosition` could be affected by the `b` operation. We will transform it.\n let newTargetPosition;\n if (a.targetPosition.isEqual(b.targetPosition) && insertBefore) {\n newTargetPosition = a.targetPosition._getTransformedByDeletion(b.sourcePosition, b.howMany);\n }\n else {\n newTargetPosition = a.targetPosition._getTransformedByMove(b.sourcePosition, b.targetPosition, b.howMany);\n }\n //\n // Special case #1 + mirror.\n //\n // Special case when both move operations' target positions are inside nodes that are\n // being moved by the other move operation. So in other words, we move ranges into inside of each other.\n // This case can't be solved reasonably (on the other hand, it should not happen often).\n if (_moveTargetIntoMovedRange(a, b) && _moveTargetIntoMovedRange(b, a)) {\n // Instead of transforming operation, we return a reverse of the operation that we transform by.\n // So when the results of this \"transformation\" will be applied, `b` MoveOperation will get reversed.\n return [b.getReversed()];\n }\n //\n // End of special case #1.\n //\n //\n // Special case #2.\n //\n // Check if `b` operation targets inside `rangeA`.\n const bTargetsToA = rangeA.containsPosition(b.targetPosition);\n // If `b` targets to `rangeA` and `rangeA` contains `rangeB`, `b` operation has no influence on `a` operation.\n // You might say that operation `b` is captured inside operation `a`.\n if (bTargetsToA && rangeA.containsRange(rangeB, true)) {\n // There is a mini-special case here, where `rangeB` is on other level than `rangeA`. That's why\n // we need to transform `a` operation anyway.\n rangeA.start = rangeA.start._getTransformedByMove(b.sourcePosition, b.targetPosition, b.howMany);\n rangeA.end = rangeA.end._getTransformedByMove(b.sourcePosition, b.targetPosition, b.howMany);\n return _makeMoveOperationsFromRanges([rangeA], newTargetPosition);\n }\n //\n // Special case #2 mirror.\n //\n const aTargetsToB = rangeB.containsPosition(a.targetPosition);\n if (aTargetsToB && rangeB.containsRange(rangeA, true)) {\n // `a` operation is \"moved together\" with `b` operation.\n // Here, just move `rangeA` \"inside\" `rangeB`.\n rangeA.start = rangeA.start._getCombined(b.sourcePosition, b.getMovedRangeStart());\n rangeA.end = rangeA.end._getCombined(b.sourcePosition, b.getMovedRangeStart());\n return _makeMoveOperationsFromRanges([rangeA], newTargetPosition);\n }\n //\n // End of special case #2.\n //\n //\n // Special case #3 + mirror.\n //\n // `rangeA` has a node which is an ancestor of `rangeB`. In other words, `rangeB` is inside `rangeA`\n // but not on the same tree level. In such case ranges have common part but we have to treat it\n // differently, because in such case those ranges are not really conflicting and should be treated like\n // two separate ranges. Also we have to discard two difference parts.\n const aCompB = compareArrays(a.sourcePosition.getParentPath(), b.sourcePosition.getParentPath());\n if (aCompB == 'prefix' || aCompB == 'extension') {\n // Transform `rangeA` by `b` operation and make operation out of it, and that's all.\n // Note that this is a simplified version of default case, but here we treat the common part (whole `rangeA`)\n // like a one difference part.\n rangeA.start = rangeA.start._getTransformedByMove(b.sourcePosition, b.targetPosition, b.howMany);\n rangeA.end = rangeA.end._getTransformedByMove(b.sourcePosition, b.targetPosition, b.howMany);\n return _makeMoveOperationsFromRanges([rangeA], newTargetPosition);\n }\n //\n // End of special case #3.\n //\n //\n // Default case - ranges are on the same level or are not connected with each other.\n //\n // Modifier for default case.\n // Modifies `aIsStrong` flag in certain conditions.\n //\n // If only one of operations is a remove operation, we force remove operation to be the \"stronger\" one\n // to provide more expected results.\n if (a.type == 'remove' && b.type != 'remove' && !context.aWasUndone && !context.forceWeakRemove) {\n aIsStrong = true;\n }\n else if (a.type != 'remove' && b.type == 'remove' && !context.bWasUndone && !context.forceWeakRemove) {\n aIsStrong = false;\n }\n // Handle operation's source ranges - check how `rangeA` is affected by `b` operation.\n // This will aggregate transformed ranges.\n const ranges = [];\n // Get the \"difference part\" of `a` operation source range.\n // This is an array with one or two ranges. Two ranges if `rangeB` is inside `rangeA`.\n const difference = rangeA.getDifference(rangeB);\n for (const range of difference) {\n // Transform those ranges by `b` operation. For example if `b` moved range from before those ranges, fix those ranges.\n range.start = range.start._getTransformedByDeletion(b.sourcePosition, b.howMany);\n range.end = range.end._getTransformedByDeletion(b.sourcePosition, b.howMany);\n // If `b` operation targets into `rangeA` on the same level, spread `rangeA` into two ranges.\n const shouldSpread = compareArrays(range.start.getParentPath(), b.getMovedRangeStart().getParentPath()) == 'same';\n const newRanges = range._getTransformedByInsertion(b.getMovedRangeStart(), b.howMany, shouldSpread);\n ranges.push(...newRanges);\n }\n // Then, we have to manage the \"common part\" of both move ranges.\n const common = rangeA.getIntersection(rangeB);\n if (common !== null && aIsStrong) {\n // Calculate the new position of that part of original range.\n common.start = common.start._getCombined(b.sourcePosition, b.getMovedRangeStart());\n common.end = common.end._getCombined(b.sourcePosition, b.getMovedRangeStart());\n // Take care of proper range order.\n //\n // Put `common` at appropriate place. Keep in mind that we are interested in original order.\n // Basically there are only three cases: there is zero, one or two difference ranges.\n //\n // If there is zero difference ranges, just push `common` in the array.\n if (ranges.length === 0) {\n ranges.push(common);\n }\n // If there is one difference range, we need to check whether common part was before it or after it.\n else if (ranges.length == 1) {\n if (rangeB.start.isBefore(rangeA.start) || rangeB.start.isEqual(rangeA.start)) {\n ranges.unshift(common);\n }\n else {\n ranges.push(common);\n }\n }\n // If there are more ranges (which means two), put common part between them. This is the only scenario\n // where there could be two difference ranges so we don't have to make any comparisons.\n else {\n ranges.splice(1, 0, common);\n }\n }\n if (ranges.length === 0) {\n // If there are no \"source ranges\", nothing should be changed.\n // Note that this can happen only if `aIsStrong == false` and `rangeA.isEqual( rangeB )`.\n return [new NoOperation(a.baseVersion)];\n }\n return _makeMoveOperationsFromRanges(ranges, newTargetPosition);\n});\nsetTransformation(MoveOperation, SplitOperation, (a, b, context) => {\n let newTargetPosition = a.targetPosition.clone();\n // Do not transform if target position is same as split insertion position and this split comes from undo.\n // This should be done on relations but it is too much work for now as it would require relations working in collaboration.\n // We need to make a decision how we will resolve such conflict and this is less harmful way.\n if (!a.targetPosition.isEqual(b.insertionPosition) || !b.graveyardPosition || context.abRelation == 'moveTargetAfter') {\n newTargetPosition = a.targetPosition._getTransformedBySplitOperation(b);\n }\n // Case 1:\n //\n // Last element in the moved range got split.\n //\n // In this case the default range transformation will not work correctly as the element created by\n // split operation would be outside the range. The range to move needs to be fixed manually.\n //\n const moveRange = Range._createFromPositionAndShift(a.sourcePosition, a.howMany);\n if (moveRange.end.isEqual(b.insertionPosition)) {\n // Do it only if this is a \"natural\" split, not a one that comes from undo.\n // If this is undo split, only `targetPosition` needs to be changed (if the move is a remove).\n if (!b.graveyardPosition) {\n a.howMany++;\n }\n a.targetPosition = newTargetPosition;\n return [a];\n }\n // Case 2:\n //\n // Split happened between the moved nodes. In this case two ranges to move need to be generated.\n //\n // Characters `ozba` are moved to the end of paragraph `Xyz` but split happened.\n // <p>F[oz|ba]r</p><p>Xyz</p>\n //\n // After split:\n // <p>F[oz</p><p>ba]r</p><p>Xyz</p>\n //\n // Correct ranges:\n // <p>F[oz]</p><p>[ba]r</p><p>Xyz</p>\n //\n // After move:\n // <p>F</p><p>r</p><p>Xyzozba</p>\n //\n if (moveRange.start.hasSameParentAs(b.splitPosition) && moveRange.containsPosition(b.splitPosition)) {\n let rightRange = new Range(b.splitPosition, moveRange.end);\n rightRange = rightRange._getTransformedBySplitOperation(b);\n const ranges = [\n new Range(moveRange.start, b.splitPosition),\n rightRange\n ];\n return _makeMoveOperationsFromRanges(ranges, newTargetPosition);\n }\n // Case 3:\n //\n // Move operation targets at the split position. We need to decide if the nodes should be inserted\n // at the end of the split element or at the beginning of the new element.\n //\n if (a.targetPosition.isEqual(b.splitPosition) && context.abRelation == 'insertAtSource') {\n newTargetPosition = b.moveTargetPosition;\n }\n // Case 4:\n //\n // Move operation targets just after the split element. We need to decide if the nodes should be inserted\n // between two parts of split element, or after the new element.\n //\n // Split at `|`, while move operation moves `<p>Xyz</p>` and targets at `^`:\n // <p>Foo|bar</p>^<p>baz</p>\n // <p>Foo</p>^<p>bar</p><p>baz</p> or <p>Foo</p><p>bar</p>^<p>baz</p>?\n //\n // If there is no contextual information between operations (for example, they come from collaborative\n // editing), we don't want to put some unrelated content (move) between parts of related content (split parts).\n // However, if the split is from undo, in the past, the moved content might be targeting between the\n // split parts, meaning that was exactly user's intention:\n //\n // <p>Foo</p>^<p>bar</p>\t\t<--- original situation, in \"past\".\n // <p>Foobar</p>^\t\t\t\t<--- after merge target position is transformed.\n // <p>Foo|bar</p>^\t\t\t\t<--- then the merge is undone, and split happens, which leads us to current situation.\n //\n // In this case it is pretty clear that the intention was to put new paragraph between those nodes,\n // so we need to transform accordingly. We can detect this scenario thanks to relations.\n //\n if (a.targetPosition.isEqual(b.insertionPosition) && context.abRelation == 'insertBetween') {\n newTargetPosition = a.targetPosition;\n }\n // The default case.\n //\n const transformed = moveRange._getTransformedBySplitOperation(b);\n const ranges = [transformed];\n // Case 5:\n //\n // Moved range contains graveyard element used by split operation. Add extra move operation to the result.\n //\n if (b.graveyardPosition) {\n const movesGraveyardElement = moveRange.start.isEqual(b.graveyardPosition) || moveRange.containsPosition(b.graveyardPosition);\n if (a.howMany > 1 && movesGraveyardElement && !context.aWasUndone) {\n ranges.push(Range._createFromPositionAndShift(b.insertionPosition, 1));\n }\n }\n return _makeMoveOperationsFromRanges(ranges, newTargetPosition);\n});\nsetTransformation(MoveOperation, MergeOperation, (a, b, context) => {\n const movedRange = Range._createFromPositionAndShift(a.sourcePosition, a.howMany);\n if (b.deletionPosition.hasSameParentAs(a.sourcePosition) && movedRange.containsPosition(b.sourcePosition)) {\n if (a.type == 'remove' && !context.forceWeakRemove) {\n // Case 1:\n //\n // The element to remove got merged.\n //\n // Merge operation does support merging elements which are not siblings. So it would not be a problem\n // from technical point of view. However, if the element was removed, the intention of the user\n // deleting it was to have it all deleted. From user experience point of view, moving back the\n // removed nodes might be unexpected. This means that in this scenario we will reverse merging and remove the element.\n //\n if (!context.aWasUndone) {\n const results = [];\n let gyMoveSource = b.graveyardPosition.clone();\n let splitNodesMoveSource = b.targetPosition._getTransformedByMergeOperation(b);\n if (a.howMany > 1) {\n results.push(new MoveOperation(a.sourcePosition, a.howMany - 1, a.targetPosition, 0));\n gyMoveSource = gyMoveSource._getTransformedByMove(a.sourcePosition, a.targetPosition, a.howMany - 1);\n splitNodesMoveSource = splitNodesMoveSource._getTransformedByMove(a.sourcePosition, a.targetPosition, a.howMany - 1);\n }\n const gyMoveTarget = b.deletionPosition._getCombined(a.sourcePosition, a.targetPosition);\n const gyMove = new MoveOperation(gyMoveSource, 1, gyMoveTarget, 0);\n const splitNodesMoveTargetPath = gyMove.getMovedRangeStart().path.slice();\n splitNodesMoveTargetPath.push(0);\n const splitNodesMoveTarget = new Position(gyMove.targetPosition.root, splitNodesMoveTargetPath);\n splitNodesMoveSource = splitNodesMoveSource._getTransformedByMove(gyMoveSource, gyMoveTarget, 1);\n const splitNodesMove = new MoveOperation(splitNodesMoveSource, b.howMany, splitNodesMoveTarget, 0);\n results.push(gyMove);\n results.push(splitNodesMove);\n return results;\n }\n }\n else {\n // Case 2:\n //\n // The element to move got merged and it was the only element to move.\n // In this case just don't do anything, leave the node in the graveyard. Without special case\n // it would be a move operation that moves 0 nodes, so maybe it is better just to return no-op.\n //\n if (a.howMany == 1) {\n if (!context.bWasUndone) {\n return [new NoOperation(0)];\n }\n else {\n a.sourcePosition = b.graveyardPosition.clone();\n a.targetPosition = a.targetPosition._getTransformedByMergeOperation(b);\n return [a];\n }\n }\n }\n }\n // The default case.\n //\n const moveRange = Range._createFromPositionAndShift(a.sourcePosition, a.howMany);\n const transformed = moveRange._getTransformedByMergeOperation(b);\n a.sourcePosition = transformed.start;\n a.howMany = transformed.end.offset - transformed.start.offset;\n a.targetPosition = a.targetPosition._getTransformedByMergeOperation(b);\n return [a];\n});\n// -----------------------\nsetTransformation(RenameOperation, InsertOperation, (a, b) => {\n a.position = a.position._getTransformedByInsertOperation(b);\n return [a];\n});\nsetTransformation(RenameOperation, MergeOperation, (a, b) => {\n // Case 1:\n //\n // Element to rename got merged, so it was moved to `b.graveyardPosition`.\n //\n if (a.position.isEqual(b.deletionPosition)) {\n a.position = b.graveyardPosition.clone();\n a.position.stickiness = 'toNext';\n return [a];\n }\n a.position = a.position._getTransformedByMergeOperation(b);\n return [a];\n});\nsetTransformation(RenameOperation, MoveOperation, (a, b) => {\n a.position = a.position._getTransformedByMoveOperation(b);\n return [a];\n});\nsetTransformation(RenameOperation, RenameOperation, (a, b, context) => {\n if (a.position.isEqual(b.position)) {\n if (context.aIsStrong) {\n a.oldName = b.newName;\n }\n else {\n return [new NoOperation(0)];\n }\n }\n return [a];\n});\nsetTransformation(RenameOperation, SplitOperation, (a, b) => {\n // Case 1:\n //\n // The element to rename has been split. In this case, the new element should be also renamed.\n //\n // User decides to change the paragraph to a list item:\n // <paragraph>Foobar</paragraph>\n //\n // However, in meantime, split happens:\n // <paragraph>Foo</paragraph><paragraph>bar</paragraph>\n //\n // As a result, rename both elements:\n // <listItem>Foo</listItem><listItem>bar</listItem>\n //\n const renamePath = a.position.path;\n const splitPath = b.splitPosition.getParentPath();\n if (compareArrays(renamePath, splitPath) == 'same' && !b.graveyardPosition) {\n const extraRename = new RenameOperation(a.position.getShiftedBy(1), a.oldName, a.newName, 0);\n return [a, extraRename];\n }\n // The default case.\n //\n a.position = a.position._getTransformedBySplitOperation(b);\n return [a];\n});\n// -----------------------\nsetTransformation(RootAttributeOperation, RootAttributeOperation, (a, b, context) => {\n if (a.root === b.root && a.key === b.key) {\n if (!context.aIsStrong || a.newValue === b.newValue) {\n return [new NoOperation(0)];\n }\n else {\n a.oldValue = b.newValue;\n }\n }\n return [a];\n});\n// -----------------------\nsetTransformation(RootOperation, RootOperation, (a, b, context) => {\n if (a.rootName === b.rootName && a.isAdd === b.isAdd && !context.bWasUndone) {\n return [new NoOperation(0)];\n }\n return [a];\n});\n// -----------------------\nsetTransformation(SplitOperation, InsertOperation, (a, b) => {\n // The default case.\n //\n if (a.splitPosition.hasSameParentAs(b.position) && a.splitPosition.offset < b.position.offset) {\n a.howMany += b.howMany;\n }\n a.splitPosition = a.splitPosition._getTransformedByInsertOperation(b);\n a.insertionPosition = a.insertionPosition._getTransformedByInsertOperation(b);\n return [a];\n});\nsetTransformation(SplitOperation, MergeOperation, (a, b, context) => {\n // Case 1:\n //\n // Split element got merged. If two different elements were merged, clients will have different content.\n //\n // Example. Merge at `{}`, split at `[]`:\n // <heading>Foo</heading>{}<paragraph>B[]ar</paragraph>\n //\n // On merge side it will look like this:\n // <heading>FooB[]ar</heading>\n // <heading>FooB</heading><heading>ar</heading>\n //\n // On split side it will look like this:\n // <heading>Foo</heading>{}<paragraph>B</paragraph><paragraph>ar</paragraph>\n // <heading>FooB</heading><paragraph>ar</paragraph>\n //\n // Clearly, the second element is different for both clients.\n //\n // We could use the removed merge element from graveyard as a split element but then clients would have a different\n // model state (in graveyard), because the split side client would still have an element in graveyard (removed by merge).\n //\n // To overcome this, in `SplitOperation` x `MergeOperation` transformation we will add additional `SplitOperation`\n // in the graveyard, which will actually clone the merged-and-deleted element. Then, that cloned element will be\n // used for splitting. Example below.\n //\n // Original state:\n // <heading>Foo</heading>{}<paragraph>B[]ar</paragraph>\n //\n // Merge side client:\n //\n // After merge:\n // <heading>FooB[]ar</heading> graveyard: <paragraph></paragraph>\n //\n // Extra split:\n // <heading>FooB[]ar</heading> graveyard: <paragraph></paragraph><paragraph></paragraph>\n //\n // Use the \"cloned\" element from graveyard:\n // <heading>FooB</heading><paragraph>ar</paragraph> graveyard: <paragraph></paragraph>\n //\n // Split side client:\n //\n // After split:\n // <heading>Foo</heading>{}<paragraph>B</paragraph><paragraph>ar</paragraph>\n //\n // After merge:\n // <heading>FooB</heading><paragraph>ar</paragraph> graveyard: <paragraph></paragraph>\n //\n // This special case scenario only applies if the original split operation clones the split element.\n // If the original split operation has `graveyardPosition` set, it all doesn't have sense because split operation\n // knows exactly which element it should use. So there would be no original problem with different contents.\n //\n // Additionally, the special case applies only if the merge wasn't already undone.\n //\n if (!a.graveyardPosition && !context.bWasUndone && a.splitPosition.hasSameParentAs(b.sourcePosition)) {\n const splitPath = b.graveyardPosition.path.slice();\n splitPath.push(0);\n const splitPosition = new Position(b.graveyardPosition.root, splitPath);\n const insertionPosition = SplitOperation.getInsertionPosition(new Position(b.graveyardPosition.root, splitPath));\n const additionalSplit = new SplitOperation(splitPosition, 0, insertionPosition, null, 0);\n a.splitPosition = a.splitPosition._getTransformedByMergeOperation(b);\n a.insertionPosition = SplitOperation.getInsertionPosition(a.splitPosition);\n a.graveyardPosition = additionalSplit.insertionPosition.clone();\n a.graveyardPosition.stickiness = 'toNext';\n return [additionalSplit, a];\n }\n // The default case.\n //\n if (a.splitPosition.hasSameParentAs(b.deletionPosition) && !a.splitPosition.isAfter(b.deletionPosition)) {\n a.howMany--;\n }\n if (a.splitPosition.hasSameParentAs(b.targetPosition)) {\n a.howMany += b.howMany;\n }\n a.splitPosition = a.splitPosition._getTransformedByMergeOperation(b);\n a.insertionPosition = SplitOperation.getInsertionPosition(a.splitPosition);\n if (a.graveyardPosition) {\n a.graveyardPosition = a.graveyardPosition._getTransformedByMergeOperation(b);\n }\n return [a];\n});\nsetTransformation(SplitOperation, MoveOperation, (a, b, context) => {\n const rangeToMove = Range._createFromPositionAndShift(b.sourcePosition, b.howMany);\n if (a.graveyardPosition) {\n // Case 1:\n //\n // Split operation graveyard node was moved. In this case move operation is stronger. Since graveyard element\n // is already moved to the correct position, we need to only move the nodes after the split position.\n // This will be done by `MoveOperation` instead of `SplitOperation`.\n //\n const gyElementMoved = rangeToMove.start.isEqual(a.graveyardPosition) || rangeToMove.containsPosition(a.graveyardPosition);\n if (!context.bWasUndone && gyElementMoved) {\n const sourcePosition = a.splitPosition._getTransformedByMoveOperation(b);\n const newParentPosition = a.graveyardPosition._getTransformedByMoveOperation(b);\n const newTargetPath = newParentPosition.path.slice();\n newTargetPath.push(0);\n const newTargetPosition = new Position(newParentPosition.root, newTargetPath);\n const moveOp = new MoveOperation(sourcePosition, a.howMany, newTargetPosition, 0);\n return [moveOp];\n }\n a.graveyardPosition = a.graveyardPosition._getTransformedByMoveOperation(b);\n }\n // Case 2:\n //\n // Split is at a position where nodes were moved.\n //\n // This is a scenario described in `MoveOperation` x `SplitOperation` transformation but from the\n // \"split operation point of view\".\n //\n const splitAtTarget = a.splitPosition.isEqual(b.targetPosition);\n if (splitAtTarget && (context.baRelation == 'insertAtSource' || context.abRelation == 'splitBefore')) {\n a.howMany += b.howMany;\n a.splitPosition = a.splitPosition._getTransformedByDeletion(b.sourcePosition, b.howMany);\n a.insertionPosition = SplitOperation.getInsertionPosition(a.splitPosition);\n return [a];\n }\n if (splitAtTarget && context.abRelation && context.abRelation.howMany) {\n const { howMany, offset } = context.abRelation;\n a.howMany += howMany;\n a.splitPosition = a.splitPosition.getShiftedBy(offset);\n return [a];\n }\n // Case 3:\n //\n // If the split position is inside the moved range, we need to shift the split position to a proper place.\n // The position cannot be moved together with moved range because that would result in splitting of an incorrect element.\n //\n // Characters `bc` should be moved to the second paragraph while split position is between them:\n // <paragraph>A[b|c]d</paragraph><paragraph>Xyz</paragraph>\n //\n // After move, new split position is incorrect:\n // <paragraph>Ad</paragraph><paragraph>Xb|cyz</paragraph>\n //\n // Correct split position:\n // <paragraph>A|d</paragraph><paragraph>Xbcyz</paragraph>\n //\n // After split:\n // <paragraph>A</paragraph><paragraph>d</paragraph><paragraph>Xbcyz</paragraph>\n //\n if (a.splitPosition.hasSameParentAs(b.sourcePosition) && rangeToMove.containsPosition(a.splitPosition)) {\n const howManyRemoved = b.howMany - (a.splitPosition.offset - b.sourcePosition.offset);\n a.howMany -= howManyRemoved;\n if (a.splitPosition.hasSameParentAs(b.targetPosition) && a.splitPosition.offset < b.targetPosition.offset) {\n a.howMany += b.howMany;\n }\n a.splitPosition = b.sourcePosition.clone();\n a.insertionPosition = SplitOperation.getInsertionPosition(a.splitPosition);\n return [a];\n }\n // The default case.\n // Don't change `howMany` if move operation does not really move anything.\n //\n if (!b.sourcePosition.isEqual(b.targetPosition)) {\n if (a.splitPosition.hasSameParentAs(b.sourcePosition) && a.splitPosition.offset <= b.sourcePosition.offset) {\n a.howMany -= b.howMany;\n }\n if (a.splitPosition.hasSameParentAs(b.targetPosition) && a.splitPosition.offset < b.targetPosition.offset) {\n a.howMany += b.howMany;\n }\n }\n // Change position stickiness to force a correct transformation.\n a.splitPosition.stickiness = 'toNone';\n a.splitPosition = a.splitPosition._getTransformedByMoveOperation(b);\n a.splitPosition.stickiness = 'toNext';\n if (a.graveyardPosition) {\n a.insertionPosition = a.insertionPosition._getTransformedByMoveOperation(b);\n }\n else {\n a.insertionPosition = SplitOperation.getInsertionPosition(a.splitPosition);\n }\n return [a];\n});\nsetTransformation(SplitOperation, SplitOperation, (a, b, context) => {\n // Case 1:\n //\n // Split at the same position.\n //\n // If there already was a split at the same position as in `a` operation, it means that the intention\n // conveyed by `a` operation has already been fulfilled and `a` should not do anything (to avoid double split).\n //\n // However, there is a difference if these are new splits or splits created by undo. These have different\n // intentions. Also splits moving back different elements from graveyard have different intentions. They\n // are just different operations.\n //\n // So we cancel split operation only if it was really identical.\n //\n // Also, there is additional case, where split operations aren't identical and should not be cancelled, however the\n // default transformation is incorrect too.\n //\n if (a.splitPosition.isEqual(b.splitPosition)) {\n if (!a.graveyardPosition && !b.graveyardPosition) {\n return [new NoOperation(0)];\n }\n if (a.graveyardPosition && b.graveyardPosition && a.graveyardPosition.isEqual(b.graveyardPosition)) {\n return [new NoOperation(0)];\n }\n // Use context to know that the `a.splitPosition` should stay where it is.\n // This happens during undo when first a merge operation moved nodes to `a.splitPosition` and now `b` operation undoes that merge.\n if (context.abRelation == 'splitBefore') {\n // Since split is at the same position, there are no nodes left to split.\n a.howMany = 0;\n // Note: there was `if ( a.graveyardPosition )` here but it was uncovered in tests and I couldn't find any scenarios for now.\n // That would have to be a `SplitOperation` that didn't come from undo but is transformed by operations that were undone.\n // It could happen if `context` is enabled in collaboration.\n a.graveyardPosition = a.graveyardPosition._getTransformedBySplitOperation(b);\n return [a];\n }\n }\n // Case 2:\n //\n // Same node is using to split different elements. This happens in undo when previously same element was merged to\n // two different elements. This is described in `MergeOperation` x `MergeOperation` transformation.\n //\n // In this case we will follow the same logic. We will assume that `insertionPosition` is same for both\n // split operations. This might not always be true but in the real cases that were experienced it was. After all,\n // if these splits are reverses of merge operations that were merging the same element, then the `insertionPosition`\n // should be same for both of those splits.\n //\n // Again, we will decide which operation is stronger by checking if split happens in graveyard or in non-graveyard root.\n //\n if (a.graveyardPosition && b.graveyardPosition && a.graveyardPosition.isEqual(b.graveyardPosition)) {\n const aInGraveyard = a.splitPosition.root.rootName == '$graveyard';\n const bInGraveyard = b.splitPosition.root.rootName == '$graveyard';\n // If `aIsWeak` it means that `a` points to graveyard while `b` doesn't. Don't move nodes then.\n const aIsWeak = aInGraveyard && !bInGraveyard;\n // If `bIsWeak` it means that `b` points to graveyard while `a` doesn't. Force moving nodes then.\n const bIsWeak = bInGraveyard && !aInGraveyard;\n // Force move if `b` is weak or neither operation is weak but `a` is stronger through `context.aIsStrong`.\n const forceMove = bIsWeak || (!aIsWeak && context.aIsStrong);\n if (forceMove) {\n const result = [];\n // First we need to move any nodes split by `b` back to where they were.\n // Do it only if `b` actually moved something.\n if (b.howMany) {\n result.push(new MoveOperation(b.moveTargetPosition, b.howMany, b.splitPosition, 0));\n }\n // Then we need to move nodes from `a` split position to their new element.\n // Do it only if `a` actually should move something.\n if (a.howMany) {\n result.push(new MoveOperation(a.splitPosition, a.howMany, a.moveTargetPosition, 0));\n }\n return result;\n }\n else {\n return [new NoOperation(0)];\n }\n }\n if (a.graveyardPosition) {\n a.graveyardPosition = a.graveyardPosition._getTransformedBySplitOperation(b);\n }\n // Case 3:\n //\n // Position where operation `b` inserted a new node after split is the same as the operation `a` split position.\n // As in similar cases, there is ambiguity if the split should be before the new node (created by `b`) or after.\n //\n if (a.splitPosition.isEqual(b.insertionPosition) && context.abRelation == 'splitBefore') {\n a.howMany++;\n return [a];\n }\n // Case 4:\n //\n // This is a mirror to the case 2. above.\n //\n if (b.splitPosition.isEqual(a.insertionPosition) && context.baRelation == 'splitBefore') {\n const newPositionPath = b.insertionPosition.path.slice();\n newPositionPath.push(0);\n const newPosition = new Position(b.insertionPosition.root, newPositionPath);\n const moveOp = new MoveOperation(a.insertionPosition, 1, newPosition, 0);\n return [a, moveOp];\n }\n // The default case.\n //\n if (a.splitPosition.hasSameParentAs(b.splitPosition) && a.splitPosition.offset < b.splitPosition.offset) {\n a.howMany -= b.howMany;\n }\n a.splitPosition = a.splitPosition._getTransformedBySplitOperation(b);\n a.insertionPosition = SplitOperation.getInsertionPosition(a.splitPosition);\n return [a];\n});\n/**\n * Checks whether `MoveOperation` `targetPosition` is inside a node from the moved range of the other `MoveOperation`.\n */\nfunction _moveTargetIntoMovedRange(a, b) {\n return a.targetPosition._getTransformedByDeletion(b.sourcePosition, b.howMany) === null;\n}\n/**\n * Helper function for `MoveOperation` x `MoveOperation` transformation. Converts given ranges and target position to\n * move operations and returns them.\n *\n * Ranges and target position will be transformed on-the-fly when generating operations.\n *\n * Given `ranges` should be in the order of how they were in the original transformed operation.\n *\n * Given `targetPosition` is the target position of the first range from `ranges`.\n */\nfunction _makeMoveOperationsFromRanges(ranges, targetPosition) {\n // At this moment we have some ranges and a target position, to which those ranges should be moved.\n // Order in `ranges` array is the go-to order of after transformation.\n //\n // We are almost done. We have `ranges` and `targetPosition` to make operations from.\n // Unfortunately, those operations may affect each other. Precisely, first operation after move\n // may affect source range and target position of second and third operation. Same with second\n // operation affecting third.\n //\n // We need to fix those source ranges and target positions once again, before converting `ranges` to operations.\n const operations = [];\n // Keep in mind that nothing will be transformed if there is just one range in `ranges`.\n for (let i = 0; i < ranges.length; i++) {\n // Create new operation out of a range and target position.\n const range = ranges[i];\n const op = new MoveOperation(range.start, range.end.offset - range.start.offset, targetPosition, 0);\n operations.push(op);\n // Transform other ranges by the generated operation.\n for (let j = i + 1; j < ranges.length; j++) {\n // All ranges in `ranges` array should be:\n //\n // * non-intersecting (these are part of original operation source range), and\n // * `targetPosition` does not target into them (opposite would mean that transformed operation targets \"inside itself\").\n //\n // This means that the transformation will be \"clean\" and always return one result.\n ranges[j] = ranges[j]._getTransformedByMove(op.sourcePosition, op.targetPosition, op.howMany)[0];\n }\n targetPosition = targetPosition._getTransformedByMove(op.sourcePosition, op.targetPosition, op.howMany);\n }\n return operations;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/liveposition\n */\nimport Position from './position';\nimport { CKEditorError, EmitterMixin } from '@ckeditor/ckeditor5-utils';\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 */\nexport default class LivePosition extends EmitterMixin(Position) {\n /**\n * Creates a live position.\n *\n * @see module:engine/model/position~Position\n */\n constructor(root, path, stickiness = 'toNone') {\n super(root, path, stickiness);\n if (!this.root.is('rootElement')) {\n /**\n * LivePosition's root has to be an instance of RootElement.\n *\n * @error model-liveposition-root-not-rootelement\n */\n throw new CKEditorError('model-liveposition-root-not-rootelement', root);\n }\n bindWithDocument.call(this);\n }\n /**\n * Unbinds all events previously bound by `LivePosition`. Use it whenever you don't need `LivePosition` instance\n * anymore (i.e. when leaving scope in which it was declared or before re-assigning variable that was\n * referring to it).\n */\n detach() {\n this.stopListening();\n }\n /**\n * Creates a {@link module:engine/model/position~Position position instance}, which is equal to this live position.\n */\n toPosition() {\n return new Position(this.root, this.path.slice(), this.stickiness);\n }\n /**\n * Creates a `LivePosition` instance that is equal to position.\n */\n static fromPosition(position, stickiness) {\n return new this(position.root, position.path.slice(), stickiness ? stickiness : position.stickiness);\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nLivePosition.prototype.is = function (type) {\n return type === 'livePosition' || type === 'model:livePosition' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type == 'position' || type === 'model:position';\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 */\nfunction bindWithDocument() {\n this.listenTo(this.root.document.model, 'applyOperation', (event, args) => {\n const operation = args[0];\n if (!operation.isDocumentOperation) {\n return;\n }\n transform.call(this, operation);\n }, { priority: 'low' });\n}\n/**\n * Updates this position accordingly to the updates applied to the model. Bases on change events.\n */\nfunction transform(operation) {\n const result = this.getTransformedByOperation(operation);\n if (!this.isEqual(result)) {\n const oldPosition = this.toPosition();\n this.path = result.path;\n this.root = result.root;\n this.fire('change', oldPosition);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/batch\n */\nimport { logWarning } from '@ckeditor/ckeditor5-utils';\n/**\n * A batch instance groups model changes ({@link module:engine/model/operation/operation~Operation operations}). All operations\n * grouped in a single batch can be reverted together, so you can also think about a batch as of a single undo step. If you want\n * to extend a given undo step, you can add more changes to the batch using {@link module:engine/model/model~Model#enqueueChange}:\n *\n * ```ts\n * model.enqueueChange( batch, writer => {\n * \twriter.insertText( 'foo', paragraph, 'end' );\n * } );\n * ```\n *\n * @see module:engine/model/model~Model#enqueueChange\n * @see module:engine/model/model~Model#change\n */\nexport default class Batch {\n /**\n * Creates a batch instance.\n *\n * @see module:engine/model/model~Model#enqueueChange\n * @see module:engine/model/model~Model#change\n * @param type A set of flags that specify the type of the batch. Batch type can alter how some of the features work\n * when encountering a given `Batch` instance (for example, when a feature listens to applied operations).\n */\n constructor(type = {}) {\n if (typeof type === 'string') {\n type = type === 'transparent' ? { isUndoable: false } : {};\n /**\n * The string value for a `type` property of the `Batch` constructor has been deprecated and will be removed in the near future.\n * Please refer to the {@link module:engine/model/batch~Batch#constructor `Batch` constructor API documentation} for more\n * information.\n *\n * @error batch-constructor-deprecated-string-type\n */\n logWarning('batch-constructor-deprecated-string-type');\n }\n const { isUndoable = true, isLocal = true, isUndo = false, isTyping = false } = type;\n this.operations = [];\n this.isUndoable = isUndoable;\n this.isLocal = isLocal;\n this.isUndo = isUndo;\n this.isTyping = isTyping;\n }\n /**\n * The type of the batch.\n *\n * **This property has been deprecated and is always set to the `'default'` value.**\n *\n * It can be one of the following values:\n * * `'default'` &ndash; All \"normal\" batches. This is the most commonly used type.\n * * `'transparent'` &ndash; A batch that should be ignored by other features, i.e. an initial batch or collaborative editing\n * changes.\n *\n * @deprecated\n */\n get type() {\n /**\n * The {@link module:engine/model/batch~Batch#type `Batch#type` } property has been deprecated and will be removed in the near\n * future. Use `Batch#isLocal`, `Batch#isUndoable`, `Batch#isUndo` and `Batch#isTyping` instead.\n *\n * @error batch-type-deprecated\n */\n logWarning('batch-type-deprecated');\n return 'default';\n }\n /**\n * Returns the base version of this batch, which is equal to the base version of the first operation in the batch.\n * If there are no operations in the batch or neither operation has the base version set, it returns `null`.\n */\n get baseVersion() {\n for (const op of this.operations) {\n if (op.baseVersion !== null) {\n return op.baseVersion;\n }\n }\n return null;\n }\n /**\n * Adds an operation to the batch instance.\n *\n * @param operation An operation to add.\n * @returns The added operation.\n */\n addOperation(operation) {\n operation.batch = this;\n this.operations.push(operation);\n return operation;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/differ\n */\nimport Position from './position';\nimport Range from './range';\n/**\n * Calculates the difference between two model states.\n *\n * Receives operations that are to be applied on the model document. Marks parts of the model document tree which\n * are changed and saves the state of these elements before the change. Then, it compares saved elements with the\n * changed elements, after all changes are applied on the model document. Calculates the diff between saved\n * elements and new ones and returns a change set.\n */\nexport default class Differ {\n /**\n * Creates a `Differ` instance.\n *\n * @param markerCollection Model's marker collection.\n */\n constructor(markerCollection) {\n /**\n * A map that stores changes that happened in a given element.\n *\n * The keys of the map are references to the model elements.\n * The values of the map are arrays with changes that were done on this element.\n */\n this._changesInElement = new Map();\n /**\n * A map that stores \"element's children snapshots\". A snapshot is representing children of a given element before\n * the first change was applied on that element. Snapshot items are objects with two properties: `name`,\n * containing the element name (or `'$text'` for a text node) and `attributes` which is a map of the node's attributes.\n */\n this._elementSnapshots = new Map();\n /**\n * A map that stores all changed markers.\n *\n * The keys of the map are marker names.\n * The values of the map are objects with the following properties:\n * - `oldMarkerData`,\n * - `newMarkerData`.\n */\n this._changedMarkers = new Map();\n /**\n * A map that stores all roots that have been changed.\n *\n * The keys are the names of the roots while value represents the changes.\n */\n this._changedRoots = new Map();\n /**\n * Stores the number of changes that were processed. Used to order the changes chronologically. It is important\n * when changes are sorted.\n */\n this._changeCount = 0;\n /**\n * For efficiency purposes, `Differ` stores the change set returned by the differ after {@link #getChanges} call.\n * Cache is reset each time a new operation is buffered. If the cache has not been reset, {@link #getChanges} will\n * return the cached value instead of calculating it again.\n *\n * This property stores those changes that did not take place in graveyard root.\n */\n this._cachedChanges = null;\n /**\n * For efficiency purposes, `Differ` stores the change set returned by the differ after the {@link #getChanges} call.\n * The cache is reset each time a new operation is buffered. If the cache has not been reset, {@link #getChanges} will\n * return the cached value instead of calculating it again.\n *\n * This property stores all changes evaluated by `Differ`, including those that took place in the graveyard.\n */\n this._cachedChangesWithGraveyard = null;\n /**\n * Set of model items that were marked to get refreshed in {@link #_refreshItem}.\n */\n this._refreshedItems = new Set();\n this._markerCollection = markerCollection;\n }\n /**\n * Informs whether there are any changes buffered in `Differ`.\n */\n get isEmpty() {\n return this._changesInElement.size == 0 && this._changedMarkers.size == 0 && this._changedRoots.size == 0;\n }\n /**\n * Buffers the given operation. An operation has to be buffered before it is executed.\n *\n * @param operationToBuffer An operation to buffer.\n */\n bufferOperation(operationToBuffer) {\n // Below we take an operation, check its type, then use its parameters in marking (private) methods.\n // The general rule is to not mark elements inside inserted element. All inserted elements are re-rendered.\n // Marking changes in them would cause a \"double\" changing then.\n //\n const operation = operationToBuffer;\n switch (operation.type) {\n case 'insert': {\n if (this._isInInsertedElement(operation.position.parent)) {\n return;\n }\n this._markInsert(operation.position.parent, operation.position.offset, operation.nodes.maxOffset);\n break;\n }\n case 'addAttribute':\n case 'removeAttribute':\n case 'changeAttribute': {\n for (const item of operation.range.getItems({ shallow: true })) {\n if (this._isInInsertedElement(item.parent)) {\n continue;\n }\n this._markAttribute(item);\n }\n break;\n }\n case 'remove':\n case 'move':\n case 'reinsert': {\n // When range is moved to the same position then not mark it as a change.\n // See: https://github.com/ckeditor/ckeditor5-engine/issues/1664.\n if (operation.sourcePosition.isEqual(operation.targetPosition) ||\n operation.sourcePosition.getShiftedBy(operation.howMany).isEqual(operation.targetPosition)) {\n return;\n }\n const sourceParentInserted = this._isInInsertedElement(operation.sourcePosition.parent);\n const targetParentInserted = this._isInInsertedElement(operation.targetPosition.parent);\n if (!sourceParentInserted) {\n this._markRemove(operation.sourcePosition.parent, operation.sourcePosition.offset, operation.howMany);\n }\n if (!targetParentInserted) {\n this._markInsert(operation.targetPosition.parent, operation.getMovedRangeStart().offset, operation.howMany);\n }\n break;\n }\n case 'rename': {\n if (this._isInInsertedElement(operation.position.parent)) {\n return;\n }\n this._markRemove(operation.position.parent, operation.position.offset, 1);\n this._markInsert(operation.position.parent, operation.position.offset, 1);\n const range = Range._createFromPositionAndShift(operation.position, 1);\n for (const marker of this._markerCollection.getMarkersIntersectingRange(range)) {\n const markerData = marker.getData();\n this.bufferMarkerChange(marker.name, markerData, markerData);\n }\n break;\n }\n case 'split': {\n const splitElement = operation.splitPosition.parent;\n // Mark that children of the split element were removed.\n if (!this._isInInsertedElement(splitElement)) {\n this._markRemove(splitElement, operation.splitPosition.offset, operation.howMany);\n }\n // Mark that the new element (split copy) was inserted.\n if (!this._isInInsertedElement(operation.insertionPosition.parent)) {\n this._markInsert(operation.insertionPosition.parent, operation.insertionPosition.offset, 1);\n }\n // If the split took the element from the graveyard, mark that the element from the graveyard was removed.\n if (operation.graveyardPosition) {\n this._markRemove(operation.graveyardPosition.parent, operation.graveyardPosition.offset, 1);\n }\n break;\n }\n case 'merge': {\n // Mark that the merged element was removed.\n const mergedElement = operation.sourcePosition.parent;\n if (!this._isInInsertedElement(mergedElement.parent)) {\n this._markRemove(mergedElement.parent, mergedElement.startOffset, 1);\n }\n // Mark that the merged element was inserted into graveyard.\n const graveyardParent = operation.graveyardPosition.parent;\n this._markInsert(graveyardParent, operation.graveyardPosition.offset, 1);\n // Mark that children of merged element were inserted at new parent.\n const mergedIntoElement = operation.targetPosition.parent;\n if (!this._isInInsertedElement(mergedIntoElement)) {\n this._markInsert(mergedIntoElement, operation.targetPosition.offset, mergedElement.maxOffset);\n }\n break;\n }\n case 'detachRoot':\n case 'addRoot': {\n this._bufferRootStateChange(operation.rootName, operation.isAdd);\n break;\n }\n case 'addRootAttribute':\n case 'removeRootAttribute':\n case 'changeRootAttribute': {\n const rootName = operation.root.rootName;\n this._bufferRootAttributeChange(rootName, operation.key, operation.oldValue, operation.newValue);\n break;\n }\n }\n // Clear cache after each buffered operation as it is no longer valid.\n this._cachedChanges = null;\n }\n /**\n * Buffers a marker change.\n *\n * @param markerName The name of the marker that changed.\n * @param oldMarkerData Marker data before the change.\n * @param newMarkerData Marker data after the change.\n */\n bufferMarkerChange(markerName, oldMarkerData, newMarkerData) {\n const buffered = this._changedMarkers.get(markerName);\n if (!buffered) {\n this._changedMarkers.set(markerName, {\n newMarkerData,\n oldMarkerData\n });\n }\n else {\n buffered.newMarkerData = newMarkerData;\n if (buffered.oldMarkerData.range == null && newMarkerData.range == null) {\n // The marker is going to be removed (`newMarkerData.range == null`) but it did not exist before the first buffered change\n // (`buffered.oldMarkerData.range == null`). In this case, do not keep the marker in buffer at all.\n this._changedMarkers.delete(markerName);\n }\n }\n }\n /**\n * Returns all markers that should be removed as a result of buffered changes.\n *\n * @returns Markers to remove. Each array item is an object containing the `name` and `range` properties.\n */\n getMarkersToRemove() {\n const result = [];\n for (const [name, change] of this._changedMarkers) {\n if (change.oldMarkerData.range != null) {\n result.push({ name, range: change.oldMarkerData.range });\n }\n }\n return result;\n }\n /**\n * Returns all markers which should be added as a result of buffered changes.\n *\n * @returns Markers to add. Each array item is an object containing the `name` and `range` properties.\n */\n getMarkersToAdd() {\n const result = [];\n for (const [name, change] of this._changedMarkers) {\n if (change.newMarkerData.range != null) {\n result.push({ name, range: change.newMarkerData.range });\n }\n }\n return result;\n }\n /**\n * Returns all markers which changed.\n */\n getChangedMarkers() {\n return Array.from(this._changedMarkers).map(([name, change]) => ({\n name,\n data: {\n oldRange: change.oldMarkerData.range,\n newRange: change.newMarkerData.range\n }\n }));\n }\n /**\n * Checks whether some of the buffered changes affect the editor data.\n *\n * Types of changes which affect the editor data:\n *\n * * model structure changes,\n * * attribute changes,\n * * a root is added or detached,\n * * changes of markers which were defined as `affectsData`,\n * * changes of markers' `affectsData` property.\n */\n hasDataChanges() {\n if (this._changesInElement.size > 0) {\n return true;\n }\n if (this._changedRoots.size > 0) {\n return true;\n }\n for (const { newMarkerData, oldMarkerData } of this._changedMarkers.values()) {\n if (newMarkerData.affectsData !== oldMarkerData.affectsData) {\n return true;\n }\n if (newMarkerData.affectsData) {\n const markerAdded = newMarkerData.range && !oldMarkerData.range;\n const markerRemoved = !newMarkerData.range && oldMarkerData.range;\n const markerChanged = newMarkerData.range && oldMarkerData.range && !newMarkerData.range.isEqual(oldMarkerData.range);\n if (markerAdded || markerRemoved || markerChanged) {\n return true;\n }\n }\n }\n return false;\n }\n /**\n * Calculates the diff between the old model tree state (the state before the first buffered operations since the last {@link #reset}\n * call) and the new model tree state (actual one). It should be called after all buffered operations are executed.\n *\n * The diff set is returned as an array of {@link module:engine/model/differ~DiffItem diff items}, each describing a change done\n * on the model. The items are sorted by the position on which the change happened. If a position\n * {@link module:engine/model/position~Position#isBefore is before} another one, it will be on an earlier index in the diff set.\n *\n * **Note**: Elements inside inserted element will not have a separate diff item, only the top most element change will be reported.\n *\n * Because calculating the diff is a costly operation, the result is cached. If no new operation was buffered since the\n * previous {@link #getChanges} call, the next call will return the cached value.\n *\n * @param options Additional options.\n * @param options.includeChangesInGraveyard If set to `true`, also changes that happened\n * in the graveyard root will be returned. By default, changes in the graveyard root are not returned.\n * @returns Diff between the old and the new model tree state.\n */\n getChanges(options = {}) {\n // If there are cached changes, just return them instead of calculating changes again.\n if (this._cachedChanges) {\n if (options.includeChangesInGraveyard) {\n return this._cachedChangesWithGraveyard.slice();\n }\n else {\n return this._cachedChanges.slice();\n }\n }\n // Will contain returned results.\n let diffSet = [];\n // Check all changed elements.\n for (const element of this._changesInElement.keys()) {\n // Get changes for this element and sort them.\n const changes = this._changesInElement.get(element).sort((a, b) => {\n if (a.offset === b.offset) {\n if (a.type != b.type) {\n // If there are multiple changes at the same position, \"remove\" change should be first.\n // If the order is different, for example, we would first add some nodes and then removed them\n // (instead of the nodes that we should remove).\n return a.type == 'remove' ? -1 : 1;\n }\n return 0;\n }\n return a.offset < b.offset ? -1 : 1;\n });\n // Get children of this element before any change was applied on it.\n const snapshotChildren = this._elementSnapshots.get(element);\n // Get snapshot of current element's children.\n const elementChildren = _getChildrenSnapshot(element.getChildren());\n // Generate actions basing on changes done on element.\n const actions = _generateActionsFromChanges(snapshotChildren.length, changes);\n let i = 0; // Iterator in `elementChildren` array -- iterates through current children of element.\n let j = 0; // Iterator in `snapshotChildren` array -- iterates through old children of element.\n // Process every action.\n for (const action of actions) {\n if (action === 'i') {\n // Generate diff item for this element and insert it into the diff set.\n diffSet.push(this._getInsertDiff(element, i, elementChildren[i]));\n i++;\n }\n else if (action === 'r') {\n // Generate diff item for this element and insert it into the diff set.\n diffSet.push(this._getRemoveDiff(element, i, snapshotChildren[j]));\n j++;\n }\n else if (action === 'a') {\n // Take attributes from saved and current children.\n const elementAttributes = elementChildren[i].attributes;\n const snapshotAttributes = snapshotChildren[j].attributes;\n let range;\n if (elementChildren[i].name == '$text') {\n range = new Range(Position._createAt(element, i), Position._createAt(element, i + 1));\n }\n else {\n const index = element.offsetToIndex(i);\n range = new Range(Position._createAt(element, i), Position._createAt(element.getChild(index), 0));\n }\n // Generate diff items for this change (there might be multiple attributes changed and\n // there is a single diff for each of them) and insert them into the diff set.\n diffSet.push(...this._getAttributesDiff(range, snapshotAttributes, elementAttributes));\n i++;\n j++;\n }\n else {\n // `action` is 'equal'. Child not changed.\n i++;\n j++;\n }\n }\n }\n // Then, sort the changes by the position (change at position before other changes is first).\n diffSet.sort((a, b) => {\n // If the change is in different root, we don't care much, but we'd like to have all changes in given\n // root \"together\" in the array. So let's just sort them by the root name. It does not matter which root\n // will be processed first.\n if (a.position.root != b.position.root) {\n return a.position.root.rootName < b.position.root.rootName ? -1 : 1;\n }\n // If change happens at the same position...\n if (a.position.isEqual(b.position)) {\n // Keep chronological order of operations.\n return a.changeCount - b.changeCount;\n }\n // If positions differ, position \"on the left\" should be earlier in the result.\n return a.position.isBefore(b.position) ? -1 : 1;\n });\n // Glue together multiple changes (mostly on text nodes).\n for (let i = 1, prevIndex = 0; i < diffSet.length; i++) {\n const prevDiff = diffSet[prevIndex];\n const thisDiff = diffSet[i];\n // Glue remove changes if they happen on text on same position.\n const isConsecutiveTextRemove = prevDiff.type == 'remove' && thisDiff.type == 'remove' &&\n prevDiff.name == '$text' && thisDiff.name == '$text' &&\n prevDiff.position.isEqual(thisDiff.position);\n // Glue insert changes if they happen on text on consecutive fragments.\n const isConsecutiveTextAdd = prevDiff.type == 'insert' && thisDiff.type == 'insert' &&\n prevDiff.name == '$text' && thisDiff.name == '$text' &&\n prevDiff.position.parent == thisDiff.position.parent &&\n prevDiff.position.offset + prevDiff.length == thisDiff.position.offset;\n // Glue attribute changes if they happen on consecutive fragments and have same key, old value and new value.\n const isConsecutiveAttributeChange = prevDiff.type == 'attribute' && thisDiff.type == 'attribute' &&\n prevDiff.position.parent == thisDiff.position.parent &&\n prevDiff.range.isFlat && thisDiff.range.isFlat &&\n (prevDiff.position.offset + prevDiff.length) == thisDiff.position.offset &&\n prevDiff.attributeKey == thisDiff.attributeKey &&\n prevDiff.attributeOldValue == thisDiff.attributeOldValue &&\n prevDiff.attributeNewValue == thisDiff.attributeNewValue;\n if (isConsecutiveTextRemove || isConsecutiveTextAdd || isConsecutiveAttributeChange) {\n prevDiff.length++;\n if (isConsecutiveAttributeChange) {\n prevDiff.range.end = prevDiff.range.end.getShiftedBy(1);\n }\n diffSet[i] = null;\n }\n else {\n prevIndex = i;\n }\n }\n diffSet = diffSet.filter(v => v);\n // Remove `changeCount` property from diff items. It is used only for sorting and is internal thing.\n for (const item of diffSet) {\n delete item.changeCount;\n if (item.type == 'attribute') {\n delete item.position;\n delete item.length;\n }\n }\n this._changeCount = 0;\n // Cache changes.\n this._cachedChangesWithGraveyard = diffSet;\n this._cachedChanges = diffSet.filter(_changesInGraveyardFilter);\n if (options.includeChangesInGraveyard) {\n return this._cachedChangesWithGraveyard.slice();\n }\n else {\n return this._cachedChanges.slice();\n }\n }\n /**\n * Returns all roots that have changed (either were attached, or detached, or their attributes changed).\n *\n * @returns Diff between the old and the new roots state.\n */\n getChangedRoots() {\n return Array.from(this._changedRoots.values()).map(diffItem => {\n const entry = { ...diffItem };\n if (entry.state !== undefined) {\n // The root was attached or detached -- do not return its attributes changes.\n // If the root was attached, it should be handled as a whole, together with its attributes, the same way as model nodes.\n // If the root was detached, its attributes should be discarded anyway.\n //\n // Keep in mind that filtering must happen on this stage (when retrieving changes). If filtering happens on-the-fly as\n // the attributes change, it may lead to incorrect situation, e.g.: detach root, change attribute, re-attach root.\n // In this case, attribute change cannot be filtered. After the root is re-attached, the attribute change must be kept.\n delete entry.attributes;\n }\n return entry;\n });\n }\n /**\n * Returns a set of model items that were marked to get refreshed.\n */\n getRefreshedItems() {\n return new Set(this._refreshedItems);\n }\n /**\n * Resets `Differ`. Removes all buffered changes.\n */\n reset() {\n this._changesInElement.clear();\n this._elementSnapshots.clear();\n this._changedMarkers.clear();\n this._changedRoots.clear();\n this._refreshedItems = new Set();\n this._cachedChanges = null;\n }\n /**\n * Buffers the root state change after the root was attached or detached\n */\n _bufferRootStateChange(rootName, isAttached) {\n if (!this._changedRoots.has(rootName)) {\n this._changedRoots.set(rootName, { name: rootName, state: isAttached ? 'attached' : 'detached' });\n return;\n }\n const diffItem = this._changedRoots.get(rootName);\n if (diffItem.state !== undefined) {\n // Root `state` can only toggle between of the values ('attached' or 'detached') and no value. It cannot be any other way,\n // because if the root was originally attached it can only become detached. Then, if it is re-attached in the same batch of\n // changes, it gets back to \"no change\" (which means no value). Same if the root was originally detached.\n delete diffItem.state;\n if (diffItem.attributes === undefined) {\n // If there is no `state` change and no `attributes` change, remove the entry.\n this._changedRoots.delete(rootName);\n }\n }\n else {\n diffItem.state = isAttached ? 'attached' : 'detached';\n }\n }\n /**\n * Buffers a root attribute change.\n */\n _bufferRootAttributeChange(rootName, key, oldValue, newValue) {\n const diffItem = this._changedRoots.get(rootName) || { name: rootName };\n const attrs = diffItem.attributes || {};\n if (attrs[key]) {\n // If this attribute or metadata was already changed earlier and is changed again, check to what value it is changed.\n const attrEntry = attrs[key];\n if (newValue === attrEntry.oldValue) {\n // If it was changed back to the old value, remove the entry.\n delete attrs[key];\n }\n else {\n // If it was changed to a different value, update the entry.\n attrEntry.newValue = newValue;\n }\n }\n else {\n // If this attribute or metadata was not set earlier, add an entry.\n attrs[key] = { oldValue, newValue };\n }\n if (Object.entries(attrs).length === 0) {\n // If attributes or metadata changes set became empty, remove it from the diff item.\n delete diffItem.attributes;\n if (diffItem.state === undefined) {\n // If there is no `state` change and no `attributes` change, remove the entry.\n this._changedRoots.delete(rootName);\n }\n }\n else {\n // Make sure that, if a new object in the structure was created, it gets set.\n diffItem.attributes = attrs;\n this._changedRoots.set(rootName, diffItem);\n }\n }\n /**\n * Marks the given `item` in differ to be \"refreshed\". It means that the item will be marked as removed and inserted\n * in the differ changes set, so it will be effectively re-converted when the differ changes are handled by a dispatcher.\n *\n * @internal\n * @param item Item to refresh.\n */\n _refreshItem(item) {\n if (this._isInInsertedElement(item.parent)) {\n return;\n }\n this._markRemove(item.parent, item.startOffset, item.offsetSize);\n this._markInsert(item.parent, item.startOffset, item.offsetSize);\n this._refreshedItems.add(item);\n const range = Range._createOn(item);\n for (const marker of this._markerCollection.getMarkersIntersectingRange(range)) {\n const markerData = marker.getData();\n this.bufferMarkerChange(marker.name, markerData, markerData);\n }\n // Clear cache after each buffered operation as it is no longer valid.\n this._cachedChanges = null;\n }\n /**\n * Saves and handles an insert change.\n */\n _markInsert(parent, offset, howMany) {\n const changeItem = { type: 'insert', offset, howMany, count: this._changeCount++ };\n this._markChange(parent, changeItem);\n }\n /**\n * Saves and handles a remove change.\n */\n _markRemove(parent, offset, howMany) {\n const changeItem = { type: 'remove', offset, howMany, count: this._changeCount++ };\n this._markChange(parent, changeItem);\n this._removeAllNestedChanges(parent, offset, howMany);\n }\n /**\n * Saves and handles an attribute change.\n */\n _markAttribute(item) {\n const changeItem = { type: 'attribute', offset: item.startOffset, howMany: item.offsetSize, count: this._changeCount++ };\n this._markChange(item.parent, changeItem);\n }\n /**\n * Saves and handles a model change.\n */\n _markChange(parent, changeItem) {\n // First, make a snapshot of this parent's children (it will be made only if it was not made before).\n this._makeSnapshot(parent);\n // Then, get all changes that already were done on the element (empty array if this is the first change).\n const changes = this._getChangesForElement(parent);\n // Then, look through all the changes, and transform them or the new change.\n this._handleChange(changeItem, changes);\n // Add the new change.\n changes.push(changeItem);\n // Remove incorrect changes. During transformation some change might be, for example, included in another.\n // In that case, the change will have `howMany` property set to `0` or less. We need to remove those changes.\n for (let i = 0; i < changes.length; i++) {\n if (changes[i].howMany < 1) {\n changes.splice(i, 1);\n i--;\n }\n }\n }\n /**\n * Gets an array of changes that have already been saved for a given element.\n */\n _getChangesForElement(element) {\n let changes;\n if (this._changesInElement.has(element)) {\n changes = this._changesInElement.get(element);\n }\n else {\n changes = [];\n this._changesInElement.set(element, changes);\n }\n return changes;\n }\n /**\n * Saves a children snapshot for a given element.\n */\n _makeSnapshot(element) {\n if (!this._elementSnapshots.has(element)) {\n this._elementSnapshots.set(element, _getChildrenSnapshot(element.getChildren()));\n }\n }\n /**\n * For a given newly saved change, compares it with a change already done on the element and modifies the incoming\n * change and/or the old change.\n *\n * @param inc Incoming (new) change.\n * @param changes An array containing all the changes done on that element.\n */\n _handleChange(inc, changes) {\n // We need a helper variable that will store how many nodes are to be still handled for this change item.\n // `nodesToHandle` (how many nodes still need to be handled) and `howMany` (how many nodes were affected)\n // needs to be differentiated.\n //\n // This comes up when there are multiple changes that are affected by `inc` change item.\n //\n // For example: assume two insert changes: `{ offset: 2, howMany: 1 }` and `{ offset: 5, howMany: 1 }`.\n // Assume that `inc` change is remove `{ offset: 2, howMany: 2, nodesToHandle: 2 }`.\n //\n // Then, we:\n // - \"forget\" about first insert change (it is \"eaten\" by remove),\n // - because of that, at the end we will want to remove only one node (`nodesToHandle = 1`),\n // - but still we have to change offset of the second insert change from `5` to `3`!\n //\n // So, `howMany` does not change throughout items transformation and keeps information about how many nodes were affected,\n // while `nodesToHandle` means how many nodes need to be handled after the change item is transformed by other changes.\n inc.nodesToHandle = inc.howMany;\n for (const old of changes) {\n const incEnd = inc.offset + inc.howMany;\n const oldEnd = old.offset + old.howMany;\n if (inc.type == 'insert') {\n if (old.type == 'insert') {\n if (inc.offset <= old.offset) {\n old.offset += inc.howMany;\n }\n else if (inc.offset < oldEnd) {\n old.howMany += inc.nodesToHandle;\n inc.nodesToHandle = 0;\n }\n }\n if (old.type == 'remove') {\n if (inc.offset < old.offset) {\n old.offset += inc.howMany;\n }\n }\n if (old.type == 'attribute') {\n if (inc.offset <= old.offset) {\n old.offset += inc.howMany;\n }\n else if (inc.offset < oldEnd) {\n // This case is more complicated, because attribute change has to be split into two.\n // Example (assume that uppercase and lowercase letters mean different attributes):\n //\n // initial state:\t\tabcxyz\n // attribute change:\taBCXYz\n // incoming insert:\t\taBCfooXYz\n //\n // Change ranges cannot intersect because each item has to be described exactly (it was either\n // not changed, inserted, removed, or its attribute was changed). That's why old attribute\n // change has to be split and both parts has to be handled separately from now on.\n const howMany = old.howMany;\n old.howMany = inc.offset - old.offset;\n // Add the second part of attribute change to the beginning of processed array so it won't\n // be processed again in this loop.\n changes.unshift({\n type: 'attribute',\n offset: incEnd,\n howMany: howMany - old.howMany,\n count: this._changeCount++\n });\n }\n }\n }\n if (inc.type == 'remove') {\n if (old.type == 'insert') {\n if (incEnd <= old.offset) {\n old.offset -= inc.howMany;\n }\n else if (incEnd <= oldEnd) {\n if (inc.offset < old.offset) {\n const intersectionLength = incEnd - old.offset;\n old.offset = inc.offset;\n old.howMany -= intersectionLength;\n inc.nodesToHandle -= intersectionLength;\n }\n else {\n old.howMany -= inc.nodesToHandle;\n inc.nodesToHandle = 0;\n }\n }\n else {\n if (inc.offset <= old.offset) {\n inc.nodesToHandle -= old.howMany;\n old.howMany = 0;\n }\n else if (inc.offset < oldEnd) {\n const intersectionLength = oldEnd - inc.offset;\n old.howMany -= intersectionLength;\n inc.nodesToHandle -= intersectionLength;\n }\n }\n }\n if (old.type == 'remove') {\n if (incEnd <= old.offset) {\n old.offset -= inc.howMany;\n }\n else if (inc.offset < old.offset) {\n inc.nodesToHandle += old.howMany;\n old.howMany = 0;\n }\n }\n if (old.type == 'attribute') {\n if (incEnd <= old.offset) {\n old.offset -= inc.howMany;\n }\n else if (inc.offset < old.offset) {\n const intersectionLength = incEnd - old.offset;\n old.offset = inc.offset;\n old.howMany -= intersectionLength;\n }\n else if (inc.offset < oldEnd) {\n if (incEnd <= oldEnd) {\n // On first sight in this case we don't need to split attribute operation into two.\n // However the changes set is later converted to actions (see `_generateActionsFromChanges`).\n // For that reason, no two changes may intersect.\n // So we cannot have an attribute change that \"contains\" remove change.\n // Attribute change needs to be split.\n const howMany = old.howMany;\n old.howMany = inc.offset - old.offset;\n const howManyAfter = howMany - old.howMany - inc.nodesToHandle;\n // Add the second part of attribute change to the beginning of processed array so it won't\n // be processed again in this loop.\n changes.unshift({\n type: 'attribute',\n offset: inc.offset,\n howMany: howManyAfter,\n count: this._changeCount++\n });\n }\n else {\n old.howMany -= oldEnd - inc.offset;\n }\n }\n }\n }\n if (inc.type == 'attribute') {\n // In case of attribute change, `howMany` should be kept same as `nodesToHandle`. It's not an error.\n if (old.type == 'insert') {\n if (inc.offset < old.offset && incEnd > old.offset) {\n if (incEnd > oldEnd) {\n // This case is similar to a case described when incoming change was insert and old change was attribute.\n // See comment above.\n //\n // This time incoming change is attribute. We need to split incoming change in this case too.\n // However this time, the second part of the attribute change needs to be processed further\n // because there might be other changes that it collides with.\n const attributePart = {\n type: 'attribute',\n offset: oldEnd,\n howMany: incEnd - oldEnd,\n count: this._changeCount++\n };\n this._handleChange(attributePart, changes);\n changes.push(attributePart);\n }\n inc.nodesToHandle = old.offset - inc.offset;\n inc.howMany = inc.nodesToHandle;\n }\n else if (inc.offset >= old.offset && inc.offset < oldEnd) {\n if (incEnd > oldEnd) {\n inc.nodesToHandle = incEnd - oldEnd;\n inc.offset = oldEnd;\n }\n else {\n inc.nodesToHandle = 0;\n }\n }\n }\n if (old.type == 'remove') {\n // This is a case when attribute change \"contains\" remove change.\n // The attribute change needs to be split into two because changes cannot intersect.\n if (inc.offset < old.offset && incEnd > old.offset) {\n const attributePart = {\n type: 'attribute',\n offset: old.offset,\n howMany: incEnd - old.offset,\n count: this._changeCount++\n };\n this._handleChange(attributePart, changes);\n changes.push(attributePart);\n inc.nodesToHandle = old.offset - inc.offset;\n inc.howMany = inc.nodesToHandle;\n }\n }\n if (old.type == 'attribute') {\n // There are only two conflicting scenarios possible here:\n if (inc.offset >= old.offset && incEnd <= oldEnd) {\n // `old` change includes `inc` change, or they are the same.\n inc.nodesToHandle = 0;\n inc.howMany = 0;\n inc.offset = 0;\n }\n else if (inc.offset <= old.offset && incEnd >= oldEnd) {\n // `inc` change includes `old` change.\n old.howMany = 0;\n }\n }\n }\n }\n inc.howMany = inc.nodesToHandle;\n delete inc.nodesToHandle;\n }\n /**\n * Returns an object with a single insert change description.\n *\n * @param parent The element in which the change happened.\n * @param offset The offset at which change happened.\n * @param elementSnapshot The snapshot of the removed element a character.\n * @returns The diff item.\n */\n _getInsertDiff(parent, offset, elementSnapshot) {\n return {\n type: 'insert',\n position: Position._createAt(parent, offset),\n name: elementSnapshot.name,\n attributes: new Map(elementSnapshot.attributes),\n length: 1,\n changeCount: this._changeCount++\n };\n }\n /**\n * Returns an object with a single remove change description.\n *\n * @param parent The element in which change happened.\n * @param offset The offset at which change happened.\n * @param elementSnapshot The snapshot of the removed element a character.\n * @returns The diff item.\n */\n _getRemoveDiff(parent, offset, elementSnapshot) {\n return {\n type: 'remove',\n position: Position._createAt(parent, offset),\n name: elementSnapshot.name,\n attributes: new Map(elementSnapshot.attributes),\n length: 1,\n changeCount: this._changeCount++\n };\n }\n /**\n * Returns an array of objects where each one is a single attribute change description.\n *\n * @param range The range where the change happened.\n * @param oldAttributes A map, map iterator or compatible object that contains attributes before the change.\n * @param newAttributes A map, map iterator or compatible object that contains attributes after the change.\n * @returns An array containing one or more diff items.\n */\n _getAttributesDiff(range, oldAttributes, newAttributes) {\n // Results holder.\n const diffs = [];\n // Clone new attributes as we will be performing changes on this object.\n newAttributes = new Map(newAttributes);\n // Look through old attributes.\n for (const [key, oldValue] of oldAttributes) {\n // Check what is the new value of the attribute (or if it was removed).\n const newValue = newAttributes.has(key) ? newAttributes.get(key) : null;\n // If values are different (or attribute was removed)...\n if (newValue !== oldValue) {\n // Add diff item.\n diffs.push({\n type: 'attribute',\n position: range.start,\n range: range.clone(),\n length: 1,\n attributeKey: key,\n attributeOldValue: oldValue,\n attributeNewValue: newValue,\n changeCount: this._changeCount++\n });\n }\n // Prevent returning two diff items for the same change.\n newAttributes.delete(key);\n }\n // Look through new attributes that weren't handled above.\n for (const [key, newValue] of newAttributes) {\n // Each of them is a new attribute. Add diff item.\n diffs.push({\n type: 'attribute',\n position: range.start,\n range: range.clone(),\n length: 1,\n attributeKey: key,\n attributeOldValue: null,\n attributeNewValue: newValue,\n changeCount: this._changeCount++\n });\n }\n return diffs;\n }\n /**\n * Checks whether given element or any of its parents is an element that is buffered as an inserted element.\n */\n _isInInsertedElement(element) {\n const parent = element.parent;\n if (!parent) {\n return false;\n }\n const changes = this._changesInElement.get(parent);\n const offset = element.startOffset;\n if (changes) {\n for (const change of changes) {\n if (change.type == 'insert' && offset >= change.offset && offset < change.offset + change.howMany) {\n return true;\n }\n }\n }\n return this._isInInsertedElement(parent);\n }\n /**\n * Removes deeply all buffered changes that are registered in elements from range specified by `parent`, `offset`\n * and `howMany`.\n */\n _removeAllNestedChanges(parent, offset, howMany) {\n const range = new Range(Position._createAt(parent, offset), Position._createAt(parent, offset + howMany));\n for (const item of range.getItems({ shallow: true })) {\n if (item.is('element')) {\n this._elementSnapshots.delete(item);\n this._changesInElement.delete(item);\n this._removeAllNestedChanges(item, 0, item.maxOffset);\n }\n }\n }\n}\n/**\n * Returns an array that is a copy of passed child list with the exception that text nodes are split to one or more\n * objects, each representing one character and attributes set on that character.\n */\nfunction _getChildrenSnapshot(children) {\n const snapshot = [];\n for (const child of children) {\n if (child.is('$text')) {\n for (let i = 0; i < child.data.length; i++) {\n snapshot.push({\n name: '$text',\n attributes: new Map(child.getAttributes())\n });\n }\n }\n else {\n snapshot.push({\n name: child.name,\n attributes: new Map(child.getAttributes())\n });\n }\n }\n return snapshot;\n}\n/**\n * Generates array of actions for given changes set.\n * It simulates what `diff` function does.\n * Generated actions are:\n * - 'e' for 'equal' - when item at that position did not change,\n * - 'i' for 'insert' - when item at that position was inserted,\n * - 'r' for 'remove' - when item at that position was removed,\n * - 'a' for 'attribute' - when item at that position has it attributes changed.\n *\n * Example (assume that uppercase letters have bold attribute, compare with function code):\n *\n * children before:\tfooBAR\n * children after:\tfoxybAR\n *\n * changes: type: remove, offset: 1, howMany: 1\n *\t\t\ttype: insert, offset: 2, howMany: 2\n *\t\t\ttype: attribute, offset: 4, howMany: 1\n *\n * expected actions: equal (f), remove (o), equal (o), insert (x), insert (y), attribute (b), equal (A), equal (R)\n *\n * steps taken by th script:\n *\n * 1. change = \"type: remove, offset: 1, howMany: 1\"; offset = 0; oldChildrenHandled = 0\n * 1.1 between this change and the beginning is one not-changed node, fill with one equal action, one old child has been handled\n * 1.2 this change removes one node, add one remove action\n * 1.3 change last visited `offset` to 1\n * 1.4 since an old child has been removed, one more old child has been handled\n * 1.5 actions at this point are: equal, remove\n *\n * 2. change = \"type: insert, offset: 2, howMany: 2\"; offset = 1; oldChildrenHandled = 2\n * 2.1 between this change and previous change is one not-changed node, add equal action, another one old children has been handled\n * 2.2 this change inserts two nodes, add two insert actions\n * 2.3 change last visited offset to the end of the inserted range, that is 4\n * 2.4 actions at this point are: equal, remove, equal, insert, insert\n *\n * 3. change = \"type: attribute, offset: 4, howMany: 1\"; offset = 4, oldChildrenHandled = 3\n * 3.1 between this change and previous change are no not-changed nodes\n * 3.2 this change changes one node, add one attribute action\n * 3.3 change last visited `offset` to the end of change range, that is 5\n * 3.4 since an old child has been changed, one more old child has been handled\n * 3.5 actions at this point are: equal, remove, equal, insert, insert, attribute\n *\n * 4. after loop oldChildrenHandled = 4, oldChildrenLength = 6 (fooBAR is 6 characters)\n * 4.1 fill up with two equal actions\n *\n * The result actions are: equal, remove, equal, insert, insert, attribute, equal, equal.\n */\nfunction _generateActionsFromChanges(oldChildrenLength, changes) {\n const actions = [];\n let offset = 0;\n let oldChildrenHandled = 0;\n // Go through all buffered changes.\n for (const change of changes) {\n // First, fill \"holes\" between changes with \"equal\" actions.\n if (change.offset > offset) {\n for (let i = 0; i < change.offset - offset; i++) {\n actions.push('e');\n }\n oldChildrenHandled += change.offset - offset;\n }\n // Then, fill up actions accordingly to change type.\n if (change.type == 'insert') {\n for (let i = 0; i < change.howMany; i++) {\n actions.push('i');\n }\n // The last handled offset is after inserted range.\n offset = change.offset + change.howMany;\n }\n else if (change.type == 'remove') {\n for (let i = 0; i < change.howMany; i++) {\n actions.push('r');\n }\n // The last handled offset is at the position where the nodes were removed.\n offset = change.offset;\n // We removed `howMany` old nodes, update `oldChildrenHandled`.\n oldChildrenHandled += change.howMany;\n }\n else {\n actions.push(...'a'.repeat(change.howMany).split(''));\n // The last handled offset is at the position after the changed range.\n offset = change.offset + change.howMany;\n // We changed `howMany` old nodes, update `oldChildrenHandled`.\n oldChildrenHandled += change.howMany;\n }\n }\n // Fill \"equal\" actions at the end of actions set. Use `oldChildrenHandled` to see how many children\n // has not been changed / removed at the end of their parent.\n if (oldChildrenHandled < oldChildrenLength) {\n for (let i = 0; i < oldChildrenLength - oldChildrenHandled - offset; i++) {\n actions.push('e');\n }\n }\n return actions;\n}\n/**\n * Filter callback for Array.filter that filters out change entries that are in graveyard.\n */\nfunction _changesInGraveyardFilter(entry) {\n const posInGy = 'position' in entry && entry.position.root.rootName == '$graveyard';\n const rangeInGy = 'range' in entry && entry.range.root.rootName == '$graveyard';\n return !posInGy && !rangeInGy;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * @module engine/model/history\n */\n/**\n * `History` keeps the track of all the operations applied to the {@link module:engine/model/document~Document document}.\n */\nexport default class History {\n constructor() {\n /**\n * Operations added to the history.\n */\n this._operations = [];\n /**\n * Holds an information which {@link module:engine/model/operation/operation~Operation operation} undoes which\n * {@link module:engine/model/operation/operation~Operation operation}.\n *\n * Keys of the map are \"undoing operations\", that is operations that undone some other operations. For each key, the\n * value is an operation that has been undone by the \"undoing operation\".\n */\n this._undoPairs = new Map();\n /**\n * Holds all undone operations.\n */\n this._undoneOperations = new Set();\n /**\n * A map that allows retrieving the operations fast based on the given base version.\n */\n this._baseVersionToOperationIndex = new Map();\n /**\n * The history version.\n */\n this._version = 0;\n /**\n * The gap pairs kept in the <from,to> format.\n *\n * Anytime the `history.version` is set to a version larger than `history.version + 1`,\n * a new <lastHistoryVersion, newHistoryVersion> entry is added to the map.\n */\n this._gaps = new Map();\n }\n /**\n * The version of the last operation in the history.\n *\n * The history version is incremented automatically when a new operation is added to the history.\n * Setting the version manually should be done only in rare circumstances when a gap is planned\n * between history versions. When doing so, a gap will be created and the history will accept adding\n * an operation with base version equal to the new history version.\n */\n get version() {\n return this._version;\n }\n set version(version) {\n // Store a gap if there are some operations already in the history and the\n // new version does not increment the latest one.\n if (this._operations.length && version > this._version + 1) {\n this._gaps.set(this._version, version);\n }\n this._version = version;\n }\n /**\n * The last history operation.\n */\n get lastOperation() {\n return this._operations[this._operations.length - 1];\n }\n /**\n * Adds an operation to the history and increments the history version.\n *\n * The operation's base version should be equal to the history version. Otherwise an error is thrown.\n */\n addOperation(operation) {\n if (operation.baseVersion !== this.version) {\n /**\n * Only operations with matching versions can be added to the history.\n *\n * @error model-document-history-addoperation-incorrect-version\n * @param errorData The operation and the current document history version.\n */\n throw new CKEditorError('model-document-history-addoperation-incorrect-version', this, {\n operation,\n historyVersion: this.version\n });\n }\n this._operations.push(operation);\n this._version++;\n this._baseVersionToOperationIndex.set(operation.baseVersion, this._operations.length - 1);\n }\n /**\n * Returns operations from the given range of operation base versions that were added to the history.\n *\n * Note that there may be gaps in operations base versions.\n *\n * @param fromBaseVersion Base version from which operations should be returned (inclusive).\n * @param toBaseVersion Base version up to which operations should be returned (exclusive).\n * @returns History operations for the given range, in chronological order.\n */\n getOperations(fromBaseVersion, toBaseVersion = this.version) {\n // When there is no operation in the history, return an empty array.\n // After that we can be sure that `firstOperation`, `lastOperation` are not nullish.\n if (!this._operations.length) {\n return [];\n }\n const firstOperation = this._operations[0];\n if (fromBaseVersion === undefined) {\n fromBaseVersion = firstOperation.baseVersion;\n }\n // Change exclusive `toBaseVersion` to inclusive, so it will refer to the actual index.\n // Thanks to that mapping from base versions to operation indexes are possible.\n let inclusiveTo = toBaseVersion - 1;\n // Check if \"from\" or \"to\" point to a gap between versions.\n // If yes, then change the incorrect position to the proper side of the gap.\n // Thanks to it, it will be possible to get index of the operation.\n for (const [gapFrom, gapTo] of this._gaps) {\n if (fromBaseVersion > gapFrom && fromBaseVersion < gapTo) {\n fromBaseVersion = gapTo;\n }\n if (inclusiveTo > gapFrom && inclusiveTo < gapTo) {\n inclusiveTo = gapFrom - 1;\n }\n }\n // If the whole range is outside of the operation versions, then return an empty array.\n if (inclusiveTo < firstOperation.baseVersion || fromBaseVersion > this.lastOperation.baseVersion) {\n return [];\n }\n let fromIndex = this._baseVersionToOperationIndex.get(fromBaseVersion);\n // If the range starts before the first operation, then use the first operation as the range's start.\n if (fromIndex === undefined) {\n fromIndex = 0;\n }\n let toIndex = this._baseVersionToOperationIndex.get(inclusiveTo);\n // If the range ends after the last operation, then use the last operation as the range's end.\n if (toIndex === undefined) {\n toIndex = this._operations.length - 1;\n }\n // Return the part of the history operations based on the calculated start index and end index.\n return this._operations.slice(fromIndex, \n // The `toIndex` should be included in the returned operations, so add `1`.\n toIndex + 1);\n }\n /**\n * Returns operation from the history that bases on given `baseVersion`.\n *\n * @param baseVersion Base version of the operation to get.\n * @returns Operation with given base version or `undefined` if there is no such operation in history.\n */\n getOperation(baseVersion) {\n const operationIndex = this._baseVersionToOperationIndex.get(baseVersion);\n if (operationIndex === undefined) {\n return;\n }\n return this._operations[operationIndex];\n }\n /**\n * Marks in history that one operation is an operation that is undoing the other operation. By marking operation this way,\n * history is keeping more context information about operations, which helps in operational transformation.\n *\n * @param undoneOperation Operation which is undone by `undoingOperation`.\n * @param undoingOperation Operation which undoes `undoneOperation`.\n */\n setOperationAsUndone(undoneOperation, undoingOperation) {\n this._undoPairs.set(undoingOperation, undoneOperation);\n this._undoneOperations.add(undoneOperation);\n }\n /**\n * Checks whether given `operation` is undoing any other operation.\n *\n * @param operation Operation to check.\n * @returns `true` if given `operation` is undoing any other operation, `false` otherwise.\n */\n isUndoingOperation(operation) {\n return this._undoPairs.has(operation);\n }\n /**\n * Checks whether given `operation` has been undone by any other operation.\n *\n * @param operation Operation to check.\n * @returns `true` if given `operation` has been undone any other operation, `false` otherwise.\n */\n isUndoneOperation(operation) {\n return this._undoneOperations.has(operation);\n }\n /**\n * For given `undoingOperation`, returns the operation which has been undone by it.\n *\n * @returns Operation that has been undone by given `undoingOperation` or `undefined`\n * if given `undoingOperation` is not undoing any other operation.\n */\n getUndoneOperation(undoingOperation) {\n return this._undoPairs.get(undoingOperation);\n }\n /**\n * Resets the history of operations.\n */\n reset() {\n this._version = 0;\n this._undoPairs = new Map();\n this._operations = [];\n this._undoneOperations = new Set();\n this._gaps = new Map();\n this._baseVersionToOperationIndex = new Map();\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/rootelement\n */\nimport Element from './element';\n/**\n * Type of {@link module:engine/model/element~Element} that is a root of a model tree.\n */\nexport default class RootElement extends Element {\n /**\n * Creates root element.\n *\n * @param document Document that is an owner of this root.\n * @param name Node name.\n * @param rootName Unique root name used to identify this root element by {@link module:engine/model/document~Document}.\n */\n constructor(document, name, rootName = 'main') {\n super(name);\n /**\n * @internal\n */\n this._isAttached = true;\n this._document = document;\n this.rootName = rootName;\n }\n /**\n * {@link module:engine/model/document~Document Document} that owns this root element.\n */\n get document() {\n return this._document;\n }\n /**\n * Informs if the root element is currently attached to the document, or not.\n *\n * A detached root is equivalent to being removed and cannot contain any children or markers.\n *\n * By default, a newly added root is attached. It can be detached using\n * {@link module:engine/model/writer~Writer#detachRoot `Writer#detachRoot`}. A detached root can be re-attached again using\n * {@link module:engine/model/writer~Writer#addRoot `Writer#addRoot`}.\n */\n isAttached() {\n return this._isAttached;\n }\n /**\n * Converts `RootElement` instance to `string` containing its name.\n *\n * @returns `RootElement` instance converted to `string`.\n */\n toJSON() {\n return this.rootName;\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nRootElement.prototype.is = function (type, name) {\n if (!name) {\n return type === 'rootElement' || type === 'model:rootElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'element' || type === 'model:element' ||\n type === 'node' || type === 'model:node';\n }\n return name === this.name && (type === 'rootElement' || type === 'model:rootElement' ||\n // From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.\n type === 'element' || type === 'model:element');\n};\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/document\n */\nimport Differ from './differ';\nimport DocumentSelection from './documentselection';\nimport History from './history';\nimport RootElement from './rootelement';\nimport { CKEditorError, Collection, EmitterMixin, isInsideSurrogatePair, isInsideCombinedSymbol } from '@ckeditor/ckeditor5-utils';\nimport { clone } from 'lodash-es';\n// @if CK_DEBUG_ENGINE // const { logDocument } = require( '../dev-utils/utils' );\nconst graveyardName = '$graveyard';\n/**\n * Data model's document. It contains the model's structure, its selection and the history of changes.\n *\n * Read more about working with the model in\n * {@glink framework/architecture/editing-engine#model introduction to the the editing engine's architecture}.\n *\n * Usually, the document contains just one {@link module:engine/model/document~Document#roots root element}, so\n * you can retrieve it by just calling {@link module:engine/model/document~Document#getRoot} without specifying its name:\n *\n * ```ts\n * model.document.getRoot(); // -> returns the main root\n * ```\n *\n * However, the document may contain multiple roots e.g. when the editor has multiple editable areas\n * (e.g. a title and a body of a message).\n */\nexport default class Document extends EmitterMixin() {\n /**\n * Creates an empty document instance with no {@link #roots} (other than\n * the {@link #graveyard graveyard root}).\n */\n constructor(model) {\n super();\n this.model = model;\n this.history = new History();\n this.selection = new DocumentSelection(this);\n this.roots = new Collection({ idProperty: 'rootName' });\n this.differ = new Differ(model.markers);\n this.isReadOnly = false;\n this._postFixers = new Set();\n this._hasSelectionChangedFromTheLastChangeBlock = false;\n // Graveyard tree root. Document always have a graveyard root, which stores removed nodes.\n this.createRoot('$root', graveyardName);\n // Then, still before an operation is applied on model, buffer the change in differ.\n this.listenTo(model, 'applyOperation', (evt, args) => {\n const operation = args[0];\n if (operation.isDocumentOperation) {\n this.differ.bufferOperation(operation);\n }\n }, { priority: 'high' });\n // After the operation is applied, bump document's version and add the operation to the history.\n this.listenTo(model, 'applyOperation', (evt, args) => {\n const operation = args[0];\n if (operation.isDocumentOperation) {\n this.history.addOperation(operation);\n }\n }, { priority: 'low' });\n // Listen to selection changes. If selection changed, mark it.\n this.listenTo(this.selection, 'change', () => {\n this._hasSelectionChangedFromTheLastChangeBlock = true;\n });\n // Buffer marker changes.\n // This is not covered in buffering operations because markers may change outside of them (when they\n // are modified using `model.markers` collection, not through `MarkerOperation`).\n this.listenTo(model.markers, 'update', (evt, marker, oldRange, newRange, oldMarkerData) => {\n // Copy the `newRange` to the new marker data as during the marker removal the range is not updated.\n const newMarkerData = { ...marker.getData(), range: newRange };\n // Whenever marker is updated, buffer that change.\n this.differ.bufferMarkerChange(marker.name, oldMarkerData, newMarkerData);\n if (oldRange === null) {\n // If this is a new marker, add a listener that will buffer change whenever marker changes.\n marker.on('change', (evt, oldRange) => {\n const markerData = marker.getData();\n this.differ.bufferMarkerChange(marker.name, { ...markerData, range: oldRange }, markerData);\n });\n }\n });\n // This is a solution for a problem that may occur during real-time editing. If one client detached a root and another added\n // something there at the same moment, the OT does not solve this problem currently. In such situation, the added elements would\n // stay in the detached root.\n //\n // This is incorrect, a detached root should be empty and all elements from it should be removed. To solve this, the post-fixer will\n // remove any element that is left in a detached root.\n //\n // Similarly, markers that are created at the beginning or at the end of the detached root will not be removed as well.\n //\n // The drawback of this solution over the OT solution is that the elements removed by the post-fixer will never be brought back.\n // If the root detachment gets undone (and the root is brought back), the removed elements will not be there.\n this.registerPostFixer(writer => {\n let result = false;\n for (const root of this.roots) {\n if (!root.isAttached() && !root.isEmpty) {\n writer.remove(writer.createRangeIn(root));\n result = true;\n }\n }\n for (const marker of this.model.markers) {\n if (!marker.getRange().root.isAttached()) {\n writer.removeMarker(marker);\n result = true;\n }\n }\n return result;\n });\n }\n /**\n * The document version. Every applied operation increases the version number. It is used to\n * ensure that operations are applied on a proper document version.\n *\n * This property is equal to {@link module:engine/model/history~History#version `model.Document#history#version`}.\n *\n * If the {@link module:engine/model/operation/operation~Operation#baseVersion base version} does not match the document version,\n * a {@link module:utils/ckeditorerror~CKEditorError model-document-applyoperation-wrong-version} error is thrown.\n */\n get version() {\n return this.history.version;\n }\n set version(version) {\n this.history.version = version;\n }\n /**\n * The graveyard tree root. A document always has a graveyard root that stores removed nodes.\n */\n get graveyard() {\n return this.getRoot(graveyardName);\n }\n /**\n * Creates a new root.\n *\n * **Note:** do not use this method after the editor has been initialized! If you want to dynamically add a root, use\n * {@link module:engine/model/writer~Writer#addRoot `model.Writer#addRoot`} instead.\n *\n * @param elementName The element name. Defaults to `'$root'` which also has some basic schema defined\n * (e.g. `$block` elements are allowed inside the `$root`). Make sure to define a proper schema if you use a different name.\n * @param rootName A unique root name.\n * @returns The created root.\n */\n createRoot(elementName = '$root', rootName = 'main') {\n if (this.roots.get(rootName)) {\n /**\n * A root with the specified name already exists.\n *\n * @error model-document-createroot-name-exists\n */\n throw new CKEditorError('model-document-createroot-name-exists', this, { name: rootName });\n }\n const root = new RootElement(this, elementName, rootName);\n this.roots.add(root);\n return root;\n }\n /**\n * Removes all event listeners set by the document instance.\n */\n destroy() {\n this.selection.destroy();\n this.stopListening();\n }\n /**\n * Returns a root by its name.\n *\n * Detached roots are returned by this method. This is to be able to operate on the detached root (for example, to be able to create\n * a position inside such a root for undo feature purposes).\n *\n * @param name The root name of the root to return.\n * @returns The root registered under a given name or `null` when there is no root with the given name.\n */\n getRoot(name = 'main') {\n return this.roots.get(name);\n }\n /**\n * Returns an array with names of all roots added to the document (except the {@link #graveyard graveyard root}).\n *\n * Detached roots **are not** returned by this method by default. This is to make sure that all features or algorithms that operate\n * on the document data know which roots are still a part of the document and should be processed.\n *\n * @param includeDetached Specified whether detached roots should be returned as well.\n * @returns Roots names.\n */\n getRootNames(includeDetached = false) {\n return Array.from(this.roots)\n .filter(root => root.rootName != graveyardName && (includeDetached || root.isAttached()))\n .map(root => root.rootName);\n }\n /**\n * Used to register a post-fixer callback. A post-fixer mechanism guarantees that the features\n * will operate on a correct model state.\n *\n * An execution of a feature may lead to an incorrect document tree state. The callbacks are used to fix the document tree after\n * it has changed. Post-fixers are fired just after all changes from the outermost change block were applied but\n * before the {@link module:engine/model/document~Document#event:change change event} is fired. If a post-fixer callback made\n * a change, it should return `true`. When this happens, all post-fixers are fired again to check if something else should\n * not be fixed in the new document tree state.\n *\n * As a parameter, a post-fixer callback receives a {@link module:engine/model/writer~Writer writer} instance connected with the\n * executed changes block. Thanks to that, all changes done by the callback will be added to the same\n * {@link module:engine/model/batch~Batch batch} (and undo step) as the original changes. This makes post-fixer changes transparent\n * for the user.\n *\n * An example of a post-fixer is a callback that checks if all the data were removed from the editor. If so, the\n * callback should add an empty paragraph so that the editor is never empty:\n *\n * ```ts\n * document.registerPostFixer( writer => {\n * \tconst changes = document.differ.getChanges();\n *\n * \t// Check if the changes lead to an empty root in the editor.\n * \tfor ( const entry of changes ) {\n * \t\tif ( entry.type == 'remove' && entry.position.root.isEmpty ) {\n * \t\t\twriter.insertElement( 'paragraph', entry.position.root, 0 );\n *\n * \t\t\t// It is fine to return early, even if multiple roots would need to be fixed.\n * \t\t\t// All post-fixers will be fired again, so if there are more empty roots, those will be fixed, too.\n * \t\t\treturn true;\n * \t\t}\n * \t}\n *\n * \treturn false;\n * } );\n * ```\n */\n registerPostFixer(postFixer) {\n this._postFixers.add(postFixer);\n }\n /**\n * A custom `toJSON()` method to solve child-parent circular dependencies.\n *\n * @returns A clone of this object with the document property changed to a string.\n */\n toJSON() {\n const json = clone(this);\n // Due to circular references we need to remove parent reference.\n json.selection = '[engine.model.DocumentSelection]';\n json.model = '[engine.model.Model]';\n return json;\n }\n /**\n * Check if there were any changes done on document, and if so, call post-fixers,\n * fire `change` event for features and conversion and then reset the differ.\n * Fire `change:data` event when at least one operation or buffered marker changes the data.\n *\n * @internal\n * @fires change\n * @fires change:data\n * @param writer The writer on which post-fixers will be called.\n */\n _handleChangeBlock(writer) {\n if (this._hasDocumentChangedFromTheLastChangeBlock()) {\n this._callPostFixers(writer);\n // Refresh selection attributes according to the final position in the model after the change.\n this.selection.refresh();\n if (this.differ.hasDataChanges()) {\n this.fire('change:data', writer.batch);\n }\n else {\n this.fire('change', writer.batch);\n }\n // Theoretically, it is not necessary to refresh selection after change event because\n // post-fixers are the last who should change the model, but just in case...\n this.selection.refresh();\n this.differ.reset();\n }\n this._hasSelectionChangedFromTheLastChangeBlock = false;\n }\n /**\n * Returns whether there is a buffered change or if the selection has changed from the last\n * {@link module:engine/model/model~Model#enqueueChange `enqueueChange()` block}\n * or {@link module:engine/model/model~Model#change `change()` block}.\n *\n * @returns Returns `true` if document has changed from the last `change()` or `enqueueChange()` block.\n */\n _hasDocumentChangedFromTheLastChangeBlock() {\n return !this.differ.isEmpty || this._hasSelectionChangedFromTheLastChangeBlock;\n }\n /**\n * Returns the default root for this document which is either the first root that was added to the document using\n * {@link #createRoot} or the {@link #graveyard graveyard root} if no other roots were created.\n *\n * @returns The default root for this document.\n */\n _getDefaultRoot() {\n for (const root of this.roots) {\n if (root !== this.graveyard) {\n return root;\n }\n }\n return this.graveyard;\n }\n /**\n * Returns the default range for this selection. The default range is a collapsed range that starts and ends\n * at the beginning of this selection's document {@link #_getDefaultRoot default root}.\n *\n * @internal\n */\n _getDefaultRange() {\n const defaultRoot = this._getDefaultRoot();\n const model = this.model;\n const schema = model.schema;\n // Find the first position where the selection can be put.\n const position = model.createPositionFromPath(defaultRoot, [0]);\n const nearestRange = schema.getNearestSelectionRange(position);\n // If valid selection range is not found - return range collapsed at the beginning of the root.\n return nearestRange || model.createRange(position);\n }\n /**\n * Checks whether a given {@link module:engine/model/range~Range range} is a valid range for\n * the {@link #selection document's selection}.\n *\n * @internal\n * @param range A range to check.\n * @returns `true` if `range` is valid, `false` otherwise.\n */\n _validateSelectionRange(range) {\n return validateTextNodePosition(range.start) && validateTextNodePosition(range.end);\n }\n /**\n * Performs post-fixer loops. Executes post-fixer callbacks as long as none of them has done any changes to the model.\n *\n * @param writer The writer on which post-fixer callbacks will be called.\n */\n _callPostFixers(writer) {\n let wasFixed = false;\n do {\n for (const callback of this._postFixers) {\n // Ensure selection attributes are up to date before each post-fixer.\n // https://github.com/ckeditor/ckeditor5-engine/issues/1673.\n //\n // It might be good to refresh the selection after each operation but at the moment it leads\n // to losing attributes for composition or and spell checking\n // https://github.com/ckeditor/ckeditor5-typing/issues/188\n this.selection.refresh();\n wasFixed = callback(writer);\n if (wasFixed) {\n break;\n }\n }\n } while (wasFixed);\n }\n}\n/**\n * Checks whether given range boundary position is valid for document selection, meaning that is not between\n * unicode surrogate pairs or base character and combining marks.\n */\nfunction validateTextNodePosition(rangeBoundary) {\n const textNode = rangeBoundary.textNode;\n if (textNode) {\n const data = textNode.data;\n const offset = rangeBoundary.offset - textNode.startOffset;\n return !isInsideSurrogatePair(data, offset) && !isInsideCombinedSymbol(data, offset);\n }\n return true;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/markercollection\n */\nimport TypeCheckable from './typecheckable';\nimport LiveRange from './liverange';\nimport { CKEditorError, EmitterMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * The collection of all {@link module:engine/model/markercollection~Marker markers} attached to the document.\n * It lets you {@link module:engine/model/markercollection~MarkerCollection#get get} markers or track them using\n * {@link module:engine/model/markercollection~MarkerCollection#event:update} event.\n *\n * To create, change or remove makers use {@link module:engine/model/writer~Writer model writers'} methods:\n * {@link module:engine/model/writer~Writer#addMarker} or {@link module:engine/model/writer~Writer#removeMarker}. Since\n * the writer is the only proper way to change the data model it is not possible to change markers directly using this\n * collection. All markers created by the writer will be automatically added to this collection.\n *\n * By default there is one marker collection available as {@link module:engine/model/model~Model#markers model property}.\n *\n * @see module:engine/model/markercollection~Marker\n */\nexport default class MarkerCollection extends EmitterMixin() {\n constructor() {\n super(...arguments);\n /**\n * Stores {@link ~Marker markers} added to the collection.\n */\n this._markers = new Map();\n }\n /**\n * Iterable interface.\n *\n * Iterates over all {@link ~Marker markers} added to the collection.\n */\n [Symbol.iterator]() {\n return this._markers.values();\n }\n /**\n * Checks if given {@link ~Marker marker} or marker name is in the collection.\n *\n * @param markerOrName Name of marker or marker instance to check.\n * @returns `true` if marker is in the collection, `false` otherwise.\n */\n has(markerOrName) {\n const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;\n return this._markers.has(markerName);\n }\n /**\n * Returns {@link ~Marker marker} with given `markerName`.\n *\n * @param markerName Name of marker to get.\n * @returns Marker with given name or `null` if such marker was\n * not added to the collection.\n */\n get(markerName) {\n return this._markers.get(markerName) || null;\n }\n /**\n * Creates and adds a {@link ~Marker marker} to the `MarkerCollection` with given name on given\n * {@link module:engine/model/range~Range range}.\n *\n * If `MarkerCollection` already had a marker with given name (or {@link ~Marker marker} was passed), the marker in\n * collection is updated and {@link module:engine/model/markercollection~MarkerCollection#event:update} event is fired\n * but only if there was a change (marker range or {@link module:engine/model/markercollection~Marker#managedUsingOperations}\n * flag has changed.\n *\n * @internal\n * @fires update\n * @param markerOrName Name of marker to set or marker instance to update.\n * @param range Marker range.\n * @param managedUsingOperations Specifies whether the marker is managed using operations.\n * @param affectsData Specifies whether the marker affects the data produced by the data pipeline\n * (is persisted in the editor's data).\n * @returns `Marker` instance which was added or updated.\n */\n _set(markerOrName, range, managedUsingOperations = false, affectsData = false) {\n const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;\n if (markerName.includes(',')) {\n /**\n * Marker name cannot contain the \",\" character.\n *\n * @error markercollection-incorrect-marker-name\n */\n throw new CKEditorError('markercollection-incorrect-marker-name', this);\n }\n const oldMarker = this._markers.get(markerName);\n if (oldMarker) {\n const oldMarkerData = oldMarker.getData();\n const oldRange = oldMarker.getRange();\n let hasChanged = false;\n if (!oldRange.isEqual(range)) {\n oldMarker._attachLiveRange(LiveRange.fromRange(range));\n hasChanged = true;\n }\n if (managedUsingOperations != oldMarker.managedUsingOperations) {\n oldMarker._managedUsingOperations = managedUsingOperations;\n hasChanged = true;\n }\n if (typeof affectsData === 'boolean' && affectsData != oldMarker.affectsData) {\n oldMarker._affectsData = affectsData;\n hasChanged = true;\n }\n if (hasChanged) {\n this.fire(`update:${markerName}`, oldMarker, oldRange, range, oldMarkerData);\n }\n return oldMarker;\n }\n const liveRange = LiveRange.fromRange(range);\n const marker = new Marker(markerName, liveRange, managedUsingOperations, affectsData);\n this._markers.set(markerName, marker);\n this.fire(`update:${markerName}`, marker, null, range, { ...marker.getData(), range: null });\n return marker;\n }\n /**\n * Removes given {@link ~Marker marker} or a marker with given name from the `MarkerCollection`.\n *\n * @internal\n * @fires update\n * @param markerOrName Marker or name of a marker to remove.\n * @returns `true` if marker was found and removed, `false` otherwise.\n */\n _remove(markerOrName) {\n const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;\n const oldMarker = this._markers.get(markerName);\n if (oldMarker) {\n this._markers.delete(markerName);\n this.fire(`update:${markerName}`, oldMarker, oldMarker.getRange(), null, oldMarker.getData());\n this._destroyMarker(oldMarker);\n return true;\n }\n return false;\n }\n /**\n * Fires an {@link module:engine/model/markercollection~MarkerCollection#event:update} event for the given {@link ~Marker marker}\n * but does not change the marker. Useful to force {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher downcast\n * conversion} for the marker.\n *\n * @internal\n * @fires update\n * @param markerOrName Marker or name of a marker to refresh.\n */\n _refresh(markerOrName) {\n const markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;\n const marker = this._markers.get(markerName);\n if (!marker) {\n /**\n * Marker with provided name does not exists.\n *\n * @error markercollection-refresh-marker-not-exists\n */\n throw new CKEditorError('markercollection-refresh-marker-not-exists', this);\n }\n const range = marker.getRange();\n this.fire(`update:${markerName}`, marker, range, range, marker.getData());\n }\n /**\n * Returns iterator that iterates over all markers, which ranges contain given {@link module:engine/model/position~Position position}.\n */\n *getMarkersAtPosition(position) {\n for (const marker of this) {\n if (marker.getRange().containsPosition(position)) {\n yield marker;\n }\n }\n }\n /**\n * Returns iterator that iterates over all markers, which intersects with given {@link module:engine/model/range~Range range}.\n */\n *getMarkersIntersectingRange(range) {\n for (const marker of this) {\n if (marker.getRange().getIntersection(range) !== null) {\n yield marker;\n }\n }\n }\n /**\n * Destroys marker collection and all markers inside it.\n */\n destroy() {\n for (const marker of this._markers.values()) {\n this._destroyMarker(marker);\n }\n this._markers = null;\n this.stopListening();\n }\n /**\n * Iterates over all markers that starts with given `prefix`.\n *\n * ```ts\n * const markerFooA = markersCollection.set( 'foo:a', rangeFooA );\n * const markerFooB = markersCollection.set( 'foo:b', rangeFooB );\n * const markerBarA = markersCollection.set( 'bar:a', rangeBarA );\n * const markerFooBarA = markersCollection.set( 'foobar:a', rangeFooBarA );\n * Array.from( markersCollection.getMarkersGroup( 'foo' ) ); // [ markerFooA, markerFooB ]\n * Array.from( markersCollection.getMarkersGroup( 'a' ) ); // []\n * ```\n */\n *getMarkersGroup(prefix) {\n for (const marker of this._markers.values()) {\n if (marker.name.startsWith(prefix + ':')) {\n yield marker;\n }\n }\n }\n /**\n * Destroys the marker.\n */\n _destroyMarker(marker) {\n marker.stopListening();\n marker._detachLiveRange();\n }\n}\n/**\n * `Marker` is a continuous part of the model (like a range), is named and represents some kind of information about the\n * marked part of the model document. In contrary to {@link module:engine/model/node~Node nodes}, which are building blocks of\n * the model document tree, markers are not stored directly in the document tree but in the\n * {@link module:engine/model/model~Model#markers model markers' collection}. Still, they are document data, by giving\n * additional meaning to the part of a model document between marker start and marker end.\n *\n * In this sense, markers are similar to adding and converting attributes on nodes. The difference is that attribute is\n * connected with a given node (e.g. a character is bold no matter if it gets moved or content around it changes).\n * Markers on the other hand are continuous ranges and are characterized by their start and end position. This means that\n * any character in the marker is marked by the marker. For example, if a character is moved outside of marker it stops being\n * \"special\" and the marker is shrunk. Similarly, when a character is moved into the marker from other place in document\n * model, it starts being \"special\" and the marker is enlarged.\n *\n * Another upside of markers is that finding marked part of document is fast and easy. Using attributes to mark some nodes\n * and then trying to find that part of document would require traversing whole document tree. Marker gives instant access\n * to the range which it is marking at the moment.\n *\n * Markers are built from a name and a range.\n *\n * Range of the marker is updated automatically when document changes, using\n * {@link module:engine/model/liverange~LiveRange live range} mechanism.\n *\n * Name is used to group and identify markers. Names have to be unique, but markers can be grouped by\n * using common prefixes, separated with `:`, for example: `user:john` or `search:3`. That's useful in term of creating\n * namespaces for custom elements (e.g. comments, highlights). You can use this prefixes in\n * {@link module:engine/model/markercollection~MarkerCollection#event:update} listeners to listen on changes in a group of markers.\n * For instance: `model.markers.on( 'update:user', callback );` will be called whenever any `user:*` markers changes.\n *\n * There are two types of markers.\n *\n * 1. Markers managed directly, without using operations. They are added directly by {@link module:engine/model/writer~Writer}\n * to the {@link module:engine/model/markercollection~MarkerCollection} without any additional mechanism. They can be used\n * as bookmarks or visual markers. They are great for showing results of the find, or select link when the focus is in the input.\n *\n * 1. Markers managed using operations. These markers are also stored in {@link module:engine/model/markercollection~MarkerCollection}\n * but changes in these markers is managed the same way all other changes in the model structure - using operations.\n * Therefore, they are handled in the undo stack and synchronized between clients if the collaboration plugin is enabled.\n * This type of markers is useful for solutions like spell checking or comments.\n *\n * Both type of them should be added / updated by {@link module:engine/model/writer~Writer#addMarker}\n * and removed by {@link module:engine/model/writer~Writer#removeMarker} methods.\n *\n * ```ts\n * model.change( ( writer ) => {\n * \tconst marker = writer.addMarker( name, { range, usingOperation: true } );\n *\n * \t// ...\n *\n * \twriter.removeMarker( marker );\n * } );\n * ```\n *\n * See {@link module:engine/model/writer~Writer} to find more examples.\n *\n * Since markers need to track change in the document, for efficiency reasons, it is best to create and keep as little\n * markers as possible and remove them as soon as they are not needed anymore.\n *\n * Markers can be downcasted and upcasted.\n *\n * Markers downcast happens on {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker} and\n * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:removeMarker} events.\n * Use {@link module:engine/conversion/downcasthelpers downcast converters} or attach a custom converter to mentioned events.\n * For {@link module:engine/controller/datacontroller~DataController data pipeline}, marker should be downcasted to an element.\n * Then, it can be upcasted back to a marker. Again, use {@link module:engine/conversion/upcasthelpers upcast converters} or\n * attach a custom converter to {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element}.\n *\n * `Marker` instances are created and destroyed only by {@link ~MarkerCollection MarkerCollection}.\n */\nclass Marker extends EmitterMixin(TypeCheckable) {\n /**\n * Creates a marker instance.\n *\n * @param name Marker name.\n * @param liveRange Range marked by the marker.\n * @param managedUsingOperations Specifies whether the marker is managed using operations.\n * @param affectsData Specifies whether the marker affects the data produced by the data pipeline (is persisted in the editor's data).\n */\n constructor(name, liveRange, managedUsingOperations, affectsData) {\n super();\n this.name = name;\n this._liveRange = this._attachLiveRange(liveRange);\n this._managedUsingOperations = managedUsingOperations;\n this._affectsData = affectsData;\n }\n /**\n * A value indicating if the marker is managed using operations.\n * See {@link ~Marker marker class description} to learn more about marker types.\n * See {@link module:engine/model/writer~Writer#addMarker}.\n */\n get managedUsingOperations() {\n if (!this._liveRange) {\n throw new CKEditorError('marker-destroyed', this);\n }\n return this._managedUsingOperations;\n }\n /**\n * A value indicating if the marker changes the data.\n */\n get affectsData() {\n if (!this._liveRange) {\n throw new CKEditorError('marker-destroyed', this);\n }\n return this._affectsData;\n }\n /**\n * Returns the marker data (properties defining the marker).\n */\n getData() {\n return {\n range: this.getRange(),\n affectsData: this.affectsData,\n managedUsingOperations: this.managedUsingOperations\n };\n }\n /**\n * Returns current marker start position.\n */\n getStart() {\n if (!this._liveRange) {\n throw new CKEditorError('marker-destroyed', this);\n }\n return this._liveRange.start.clone();\n }\n /**\n * Returns current marker end position.\n */\n getEnd() {\n if (!this._liveRange) {\n throw new CKEditorError('marker-destroyed', this);\n }\n return this._liveRange.end.clone();\n }\n /**\n * Returns a range that represents the current state of the marker.\n *\n * Keep in mind that returned value is a {@link module:engine/model/range~Range Range}, not a\n * {@link module:engine/model/liverange~LiveRange LiveRange}. This means that it is up-to-date and relevant only\n * until next model document change. Do not store values returned by this method. Instead, store {@link ~Marker#name}\n * and get `Marker` instance from {@link module:engine/model/markercollection~MarkerCollection MarkerCollection} every\n * time there is a need to read marker properties. This will guarantee that the marker has not been removed and\n * that it's data is up-to-date.\n */\n getRange() {\n if (!this._liveRange) {\n throw new CKEditorError('marker-destroyed', this);\n }\n return this._liveRange.toRange();\n }\n /**\n * Binds new live range to the marker and detach the old one if is attached.\n *\n * @internal\n * @param liveRange Live range to attach\n * @returns Attached live range.\n */\n _attachLiveRange(liveRange) {\n if (this._liveRange) {\n this._detachLiveRange();\n }\n // Delegating does not work with namespaces. Alternatively, we could delegate all events (using `*`).\n liveRange.delegate('change:range').to(this);\n liveRange.delegate('change:content').to(this);\n this._liveRange = liveRange;\n return liveRange;\n }\n /**\n * Unbinds and destroys currently attached live range.\n *\n * @internal\n */\n _detachLiveRange() {\n this._liveRange.stopDelegating('change:range', this);\n this._liveRange.stopDelegating('change:content', this);\n this._liveRange.detach();\n this._liveRange = null;\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nMarker.prototype.is = function (type) {\n return type === 'marker' || type === 'model:marker';\n};\n/**\n * Cannot use a {@link module:engine/model/markercollection~MarkerCollection#destroy destroyed marker} instance.\n *\n * @error marker-destroyed\n */\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/operation/detachoperation\n */\nimport Operation from './operation';\nimport Range from '../range';\nimport { _remove } from './utils';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n// @if CK_DEBUG_ENGINE // const ModelRange = require( '../range' ).default;\n/**\n * Operation to permanently remove node from detached root.\n * Note this operation is only a local operation and won't be send to the other clients.\n */\nexport default class DetachOperation extends Operation {\n /**\n * Creates an insert operation.\n *\n * @param sourcePosition Position before the first {@link module:engine/model/item~Item model item} to move.\n * @param howMany Offset size of moved range. Moved range will start from `sourcePosition` and end at\n * `sourcePosition` with offset shifted by `howMany`.\n */\n constructor(sourcePosition, howMany) {\n super(null);\n this.sourcePosition = sourcePosition.clone();\n this.howMany = howMany;\n }\n /**\n * @inheritDoc\n */\n get type() {\n return 'detach';\n }\n /**\n * @inheritDoc\n */\n get affectedSelectable() {\n return null;\n }\n /**\n * @inheritDoc\n */\n toJSON() {\n const json = super.toJSON();\n json.sourcePosition = this.sourcePosition.toJSON();\n return json;\n }\n /**\n * @inheritDoc\n * @internal\n */\n _validate() {\n if (this.sourcePosition.root.document) {\n /**\n * Cannot detach document node.\n *\n * @error detach-operation-on-document-node\n */\n throw new CKEditorError('detach-operation-on-document-node', this);\n }\n }\n /**\n * @inheritDoc\n * @internal\n */\n _execute() {\n _remove(Range._createFromPositionAndShift(this.sourcePosition, this.howMany));\n }\n /**\n * @inheritDoc\n */\n static get className() {\n return 'DetachOperation';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/documentfragment\n */\nimport TypeCheckable from './typecheckable';\nimport Element from './element';\nimport NodeList from './nodelist';\nimport Text from './text';\nimport TextProxy from './textproxy';\nimport { isIterable } from '@ckeditor/ckeditor5-utils';\n// @if CK_DEBUG_ENGINE // const { stringifyMap } = require( '../dev-utils/utils' );\n/**\n * DocumentFragment represents a part of model which does not have a common root but its 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/model~Model#markers model markers} by a\n * {@link module:engine/model/writer~Writer#insert} function.\n */\nexport default class DocumentFragment extends TypeCheckable {\n /**\n * Creates an empty `DocumentFragment`.\n *\n * **Note:** Constructor of this class shouldn't be used directly in the code.\n * Use the {@link module:engine/model/writer~Writer#createDocumentFragment} method instead.\n *\n * @internal\n * @param children Nodes to be contained inside the `DocumentFragment`.\n */\n constructor(children) {\n super();\n /**\n * DocumentFragment static markers map. This is a list of names and {@link module:engine/model/range~Range ranges}\n * which will be set as Markers to {@link module:engine/model/model~Model#markers model markers collection}\n * when DocumentFragment will be inserted to the document.\n */\n this.markers = new Map();\n /**\n * List of nodes contained inside the document fragment.\n */\n this._children = new NodeList();\n if (children) {\n this._insertChild(0, children);\n }\n }\n /**\n * Returns an iterator that iterates over all nodes contained inside this document fragment.\n */\n [Symbol.iterator]() {\n return this.getChildren();\n }\n /**\n * Number of this document fragment's children.\n */\n get childCount() {\n return this._children.length;\n }\n /**\n * Sum of {@link module:engine/model/node~Node#offsetSize offset sizes} of all of this document fragment's children.\n */\n get maxOffset() {\n return this._children.maxOffset;\n }\n /**\n * Is `true` if there are no nodes inside this document fragment, `false` otherwise.\n */\n get isEmpty() {\n return this.childCount === 0;\n }\n /**\n * Artificial next sibling. Returns `null`. Added for compatibility reasons.\n */\n get nextSibling() {\n return null;\n }\n /**\n * Artificial previous sibling. Returns `null`. Added for compatibility reasons.\n */\n get previousSibling() {\n return null;\n }\n /**\n * Artificial root of `DocumentFragment`. Returns itself. Added for compatibility reasons.\n */\n get root() {\n return this;\n }\n /**\n * Artificial parent of `DocumentFragment`. Returns `null`. Added for compatibility reasons.\n */\n get parent() {\n return null;\n }\n /**\n * Artificial owner of `DocumentFragment`. Returns `null`. Added for compatibility reasons.\n */\n get document() {\n return null;\n }\n /**\n * Returns `false` as `DocumentFragment` by definition is not attached to a document. Added for compatibility reasons.\n */\n isAttached() {\n return false;\n }\n /**\n * Returns empty array. Added for compatibility reasons.\n */\n getAncestors() {\n return [];\n }\n /**\n * Gets the child at the given index. Returns `null` if incorrect index was passed.\n *\n * @param index Index of child.\n * @returns Child node.\n */\n getChild(index) {\n return this._children.getNode(index);\n }\n /**\n * Returns an iterator that iterates over all of this document fragment's children.\n */\n getChildren() {\n return this._children[Symbol.iterator]();\n }\n /**\n * Returns an index of the given child node. Returns `null` if given node is not a child of this document fragment.\n *\n * @param node Child node to look for.\n * @returns Child node's index.\n */\n getChildIndex(node) {\n return this._children.getNodeIndex(node);\n }\n /**\n * Returns the starting offset of given child. Starting offset is equal to the sum of\n * {@link module:engine/model/node~Node#offsetSize offset sizes} of all node's siblings that are before it. Returns `null` if\n * given node is not a child of this document fragment.\n *\n * @param node Child node to look for.\n * @returns Child node's starting offset.\n */\n getChildStartOffset(node) {\n return this._children.getNodeStartOffset(node);\n }\n /**\n * Returns path to a `DocumentFragment`, which is an empty array. Added for compatibility reasons.\n */\n getPath() {\n return [];\n }\n /**\n * Returns a descendant node by its path relative to this element.\n *\n * ```ts\n * // <this>a<b>c</b></this>\n * this.getNodeByPath( [ 0 ] ); // -> \"a\"\n * this.getNodeByPath( [ 1 ] ); // -> <b>\n * this.getNodeByPath( [ 1, 0 ] ); // -> \"c\"\n * ```\n *\n * @param relativePath Path of the node to find, relative to this element.\n */\n getNodeByPath(relativePath) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias, consistent-this\n let node = this;\n for (const index of relativePath) {\n node = node.getChild(node.offsetToIndex(index));\n }\n return node;\n }\n /**\n * Converts offset \"position\" to index \"position\".\n *\n * Returns index of a node that occupies given offset. If given offset is too low, returns `0`. If given offset is\n * too high, returns index after last child.\n *\n * ```ts\n * const textNode = new Text( 'foo' );\n * const pElement = new Element( 'p' );\n * const docFrag = new DocumentFragment( [ textNode, pElement ] );\n * docFrag.offsetToIndex( -1 ); // Returns 0, because offset is too low.\n * docFrag.offsetToIndex( 0 ); // Returns 0, because offset 0 is taken by `textNode` which is at index 0.\n * docFrag.offsetToIndex( 1 ); // Returns 0, because `textNode` has `offsetSize` equal to 3, so it occupies offset 1 too.\n * docFrag.offsetToIndex( 2 ); // Returns 0.\n * docFrag.offsetToIndex( 3 ); // Returns 1.\n * docFrag.offsetToIndex( 4 ); // Returns 2. There are no nodes at offset 4, so last available index is returned.\n * ```\n *\n * @param offset Offset to look for.\n * @returns Index of a node that occupies given offset.\n */\n offsetToIndex(offset) {\n return this._children.offsetToIndex(offset);\n }\n /**\n * Converts `DocumentFragment` instance to plain object and returns it.\n * Takes care of converting all of this document fragment's children.\n *\n * @returns `DocumentFragment` instance converted to plain object.\n */\n toJSON() {\n const json = [];\n for (const node of this._children) {\n json.push(node.toJSON());\n }\n return json;\n }\n /**\n * Creates a `DocumentFragment` instance from given plain object (i.e. parsed JSON string).\n * Converts `DocumentFragment` children to proper nodes.\n *\n * @param json Plain object to be converted to `DocumentFragment`.\n * @returns `DocumentFragment` instance created using given plain object.\n */\n static fromJSON(json) {\n const children = [];\n for (const child of json) {\n if (child.name) {\n // If child has name property, it is an Element.\n children.push(Element.fromJSON(child));\n }\n else {\n // Otherwise, it is a Text node.\n children.push(Text.fromJSON(child));\n }\n }\n return new DocumentFragment(children);\n }\n /**\n * {@link #_insertChild Inserts} one or more nodes at the end of this document fragment.\n *\n * @internal\n * @param items Items to be inserted.\n */\n _appendChild(items) {\n this._insertChild(this.childCount, items);\n }\n /**\n * Inserts one or more nodes at the given index and sets {@link module:engine/model/node~Node#parent parent} of these nodes\n * to this document fragment.\n *\n * @internal\n * @param index Index at which nodes should be inserted.\n * @param items Items to be inserted.\n */\n _insertChild(index, items) {\n const nodes = normalize(items);\n for (const node of nodes) {\n // If node that is being added to this element is already inside another element, first remove it from the old parent.\n if (node.parent !== null) {\n node._remove();\n }\n node.parent = this;\n }\n this._children._insertNodes(index, nodes);\n }\n /**\n * Removes one or more nodes starting at the given index\n * and sets {@link module:engine/model/node~Node#parent parent} of these nodes to `null`.\n *\n * @internal\n * @param index Index of the first node to remove.\n * @param howMany Number of nodes to remove.\n * @returns Array containing removed nodes.\n */\n _removeChildren(index, howMany = 1) {\n const nodes = this._children._removeNodes(index, howMany);\n for (const node of nodes) {\n node.parent = null;\n }\n return nodes;\n }\n}\n// The magic of type inference using `is` method is centralized in `TypeCheckable` class.\n// Proper overload would interfere with that.\nDocumentFragment.prototype.is = function (type) {\n return type === 'documentFragment' || type === 'model:documentFragment';\n};\n/**\n * Converts strings to Text and non-iterables to arrays.\n */\nfunction normalize(nodes) {\n // Separate condition because string is iterable.\n if (typeof nodes == 'string') {\n return [new Text(nodes)];\n }\n if (!isIterable(nodes)) {\n nodes = [nodes];\n }\n // Array.from to enable .map() on non-arrays.\n return Array.from(nodes)\n .map(node => {\n if (typeof node == 'string') {\n return new Text(node);\n }\n if (node instanceof TextProxy) {\n return new Text(node.data, node.getAttributes());\n }\n return node;\n });\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/writer\n */\nimport AttributeOperation from './operation/attributeoperation';\nimport DetachOperation from './operation/detachoperation';\nimport InsertOperation from './operation/insertoperation';\nimport MarkerOperation from './operation/markeroperation';\nimport MergeOperation from './operation/mergeoperation';\nimport MoveOperation from './operation/moveoperation';\nimport RenameOperation from './operation/renameoperation';\nimport RootAttributeOperation from './operation/rootattributeoperation';\nimport RootOperation from './operation/rootoperation';\nimport SplitOperation from './operation/splitoperation';\nimport DocumentFragment from './documentfragment';\nimport DocumentSelection from './documentselection';\nimport Element from './element';\nimport Position from './position';\nimport Range from './range';\nimport RootElement from './rootelement';\nimport Text from './text';\nimport { CKEditorError, logWarning, toMap } from '@ckeditor/ckeditor5-utils';\n/**\n * The model can only be modified by using the writer. It should be used whenever you want to create a node, modify\n * child nodes, attributes or text, set the selection's position and its attributes.\n *\n * The instance of the writer is only available in the {@link module:engine/model/model~Model#change `change()`} or\n * {@link module:engine/model/model~Model#enqueueChange `enqueueChange()`}.\n *\n * ```ts\n * model.change( writer => {\n * \twriter.insertText( 'foo', paragraph, 'end' );\n * } );\n * ```\n *\n * Note that the writer should never be stored and used outside of the `change()` and\n * `enqueueChange()` blocks.\n *\n * Note that writer's methods do not check the {@link module:engine/model/schema~Schema}. It is possible\n * to create incorrect model structures by using the writer. Read more about in\n * {@glink framework/deep-dive/schema#who-checks-the-schema \"Who checks the schema?\"}.\n *\n * @see module:engine/model/model~Model#change\n * @see module:engine/model/model~Model#enqueueChange\n */\nexport default class Writer {\n /**\n * Creates a writer instance.\n *\n * **Note:** It is not recommended to use it directly. Use {@link module:engine/model/model~Model#change `Model#change()`} or\n * {@link module:engine/model/model~Model#enqueueChange `Model#enqueueChange()`} instead.\n *\n * @internal\n */\n constructor(model, batch) {\n this.model = model;\n this.batch = batch;\n }\n /**\n * Creates a new {@link module:engine/model/text~Text text node}.\n *\n * ```ts\n * writer.createText( 'foo' );\n * writer.createText( 'foo', { bold: true } );\n * ```\n *\n * @param data Text data.\n * @param attributes Text attributes.\n * @returns {module:engine/model/text~Text} Created text node.\n */\n createText(data, attributes) {\n return new Text(data, attributes);\n }\n /**\n * Creates a new {@link module:engine/model/element~Element element}.\n *\n * ```ts\n * writer.createElement( 'paragraph' );\n * writer.createElement( 'paragraph', { alignment: 'center' } );\n * ```\n *\n * @param name Name of the element.\n * @param attributes Elements attributes.\n * @returns Created element.\n */\n createElement(name, attributes) {\n return new Element(name, attributes);\n }\n /**\n * Creates a new {@link module:engine/model/documentfragment~DocumentFragment document fragment}.\n *\n * @returns Created document fragment.\n */\n createDocumentFragment() {\n return new DocumentFragment();\n }\n /**\n * Creates a copy of the element and returns it. Created element has the same name and attributes as the original element.\n * If clone is deep, the original element's children are also cloned. If not, then empty element is returned.\n *\n * @param element The element to clone.\n * @param deep If set to `true` clones element and all its children recursively. When set to `false`,\n * element will be cloned without any child.\n */\n cloneElement(element, deep = true) {\n return element._clone(deep);\n }\n /**\n * Inserts item on given position.\n *\n * ```ts\n * const paragraph = writer.createElement( 'paragraph' );\n * writer.insert( paragraph, position );\n * ```\n *\n * Instead of using position you can use parent and offset:\n *\n * ```ts\n * const text = writer.createText( 'foo' );\n * writer.insert( text, paragraph, 5 );\n * ```\n *\n * You can also use `end` instead of the offset to insert at the end:\n *\n * ```ts\n * const text = writer.createText( 'foo' );\n * writer.insert( text, paragraph, 'end' );\n * ```\n *\n * Or insert before or after another element:\n *\n * ```ts\n * const paragraph = writer.createElement( 'paragraph' );\n * writer.insert( paragraph, anotherParagraph, 'after' );\n * ```\n *\n * These parameters works the same way as {@link #createPositionAt `writer.createPositionAt()`}.\n *\n * Note that if the item already has parent it will be removed from the previous parent.\n *\n * Note that you cannot re-insert a node from a document to a different document or a document fragment. In this case,\n * `model-writer-insert-forbidden-move` is thrown.\n *\n * If you want to move {@link module:engine/model/range~Range range} instead of an\n * {@link module:engine/model/item~Item item} use {@link module:engine/model/writer~Writer#move `Writer#move()`}.\n *\n * **Note:** For a paste-like content insertion mechanism see\n * {@link module:engine/model/model~Model#insertContent `model.insertContent()`}.\n *\n * @param item Item or document fragment to insert.\n * @param offset Offset or one of the flags. Used only when second parameter is a {@link module:engine/model/item~Item model item}.\n */\n insert(item, itemOrPosition, offset = 0) {\n this._assertWriterUsedCorrectly();\n if (item instanceof Text && item.data == '') {\n return;\n }\n const position = Position._createAt(itemOrPosition, offset);\n // If item has a parent already.\n if (item.parent) {\n // We need to check if item is going to be inserted within the same document.\n if (isSameTree(item.root, position.root)) {\n // If it's we just need to move it.\n this.move(Range._createOn(item), position);\n return;\n }\n // If it isn't the same root.\n else {\n if (item.root.document) {\n /**\n * Cannot move a node from a document to a different tree.\n * It is forbidden to move a node that was already in a document outside of it.\n *\n * @error model-writer-insert-forbidden-move\n */\n throw new CKEditorError('model-writer-insert-forbidden-move', this);\n }\n else {\n // Move between two different document fragments or from document fragment to a document is possible.\n // In that case, remove the item from it's original parent.\n this.remove(item);\n }\n }\n }\n const version = position.root.document ? position.root.document.version : null;\n const insert = new InsertOperation(position, item, version);\n if (item instanceof Text) {\n insert.shouldReceiveAttributes = true;\n }\n this.batch.addOperation(insert);\n this.model.applyOperation(insert);\n // When element is a DocumentFragment we need to move its markers to Document#markers.\n if (item instanceof DocumentFragment) {\n for (const [markerName, markerRange] of item.markers) {\n // We need to migrate marker range from DocumentFragment to Document.\n const rangeRootPosition = Position._createAt(markerRange.root, 0);\n const range = new Range(markerRange.start._getCombined(rangeRootPosition, position), markerRange.end._getCombined(rangeRootPosition, position));\n const options = { range, usingOperation: true, affectsData: true };\n if (this.model.markers.has(markerName)) {\n this.updateMarker(markerName, options);\n }\n else {\n this.addMarker(markerName, options);\n }\n }\n }\n }\n insertText(text, attributes, // Too complicated when not using `any`.\n itemOrPosition, // Too complicated when not using `any`.\n offset // Too complicated when not using `any`.\n ) {\n if (attributes instanceof DocumentFragment || attributes instanceof Element || attributes instanceof Position) {\n this.insert(this.createText(text), attributes, itemOrPosition);\n }\n else {\n this.insert(this.createText(text, attributes), itemOrPosition, offset);\n }\n }\n insertElement(name, attributes, // Too complicated when not using `any`.\n itemOrPositionOrOffset, // Too complicated when not using `any`.\n offset // Too complicated when not using `any`.\n ) {\n if (attributes instanceof DocumentFragment || attributes instanceof Element || attributes instanceof Position) {\n this.insert(this.createElement(name), attributes, itemOrPositionOrOffset);\n }\n else {\n this.insert(this.createElement(name, attributes), itemOrPositionOrOffset, offset);\n }\n }\n /**\n * Inserts item at the end of the given parent.\n *\n * ```ts\n * const paragraph = writer.createElement( 'paragraph' );\n * writer.append( paragraph, root );\n * ```\n *\n * Note that if the item already has parent it will be removed from the previous parent.\n *\n * If you want to move {@link module:engine/model/range~Range range} instead of an\n * {@link module:engine/model/item~Item item} use {@link module:engine/model/writer~Writer#move `Writer#move()`}.\n *\n * @param item Item or document fragment to insert.\n */\n append(item, parent) {\n this.insert(item, parent, 'end');\n }\n appendText(text, attributes, parent) {\n if (attributes instanceof DocumentFragment || attributes instanceof Element) {\n this.insert(this.createText(text), attributes, 'end');\n }\n else {\n this.insert(this.createText(text, attributes), parent, 'end');\n }\n }\n appendElement(name, attributes, parent) {\n if (attributes instanceof DocumentFragment || attributes instanceof Element) {\n this.insert(this.createElement(name), attributes, 'end');\n }\n else {\n this.insert(this.createElement(name, attributes), parent, 'end');\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 * @param key Attribute key.\n * @param value Attribute new value.\n * @param itemOrRange Model item or range on which the attribute will be set.\n */\n setAttribute(key, value, itemOrRange) {\n this._assertWriterUsedCorrectly();\n if (itemOrRange instanceof Range) {\n const ranges = itemOrRange.getMinimalFlatRanges();\n for (const range of ranges) {\n setAttributeOnRange(this, key, value, range);\n }\n }\n else {\n setAttributeOnItem(this, key, value, itemOrRange);\n }\n }\n /**\n * Sets values of attributes on a {@link module:engine/model/item~Item model item}\n * or on a {@link module:engine/model/range~Range range}.\n *\n * ```ts\n * writer.setAttributes( {\n * \tbold: true,\n * \titalic: true\n * }, range );\n * ```\n *\n * @param attributes Attributes keys and values.\n * @param itemOrRange Model item or range on which the attributes will be set.\n */\n setAttributes(attributes, itemOrRange) {\n for (const [key, val] of toMap(attributes)) {\n this.setAttribute(key, val, itemOrRange);\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 * @param key Attribute key.\n * @param itemOrRange Model item or range from which the attribute will be removed.\n */\n removeAttribute(key, itemOrRange) {\n this._assertWriterUsedCorrectly();\n if (itemOrRange instanceof Range) {\n const ranges = itemOrRange.getMinimalFlatRanges();\n for (const range of ranges) {\n setAttributeOnRange(this, key, null, range);\n }\n }\n else {\n setAttributeOnItem(this, key, null, itemOrRange);\n }\n }\n /**\n * Removes all attributes from all elements in the range or from the given item.\n *\n * @param itemOrRange Model item or range from which all attributes will be removed.\n */\n clearAttributes(itemOrRange) {\n this._assertWriterUsedCorrectly();\n const removeAttributesFromItem = (item) => {\n for (const attribute of item.getAttributeKeys()) {\n this.removeAttribute(attribute, item);\n }\n };\n if (!(itemOrRange instanceof Range)) {\n removeAttributesFromItem(itemOrRange);\n }\n else {\n for (const item of itemOrRange.getItems()) {\n removeAttributesFromItem(item);\n }\n }\n }\n /**\n * Moves all items in the source range to the target position.\n *\n * ```ts\n * writer.move( sourceRange, targetPosition );\n * ```\n *\n * Instead of the target position you can use parent and offset or define that range should be moved to the end\n * or before or after chosen item:\n *\n * ```ts\n * // Moves all items in the range to the paragraph at offset 5:\n * writer.move( sourceRange, paragraph, 5 );\n * // Moves all items in the range to the end of a blockquote:\n * writer.move( sourceRange, blockquote, 'end' );\n * // Moves all items in the range to a position after an image:\n * writer.move( sourceRange, image, 'after' );\n * ```\n *\n * These parameters work the same way as {@link #createPositionAt `writer.createPositionAt()`}.\n *\n * Note that items can be moved only within the same tree. It means that you can move items within the same root\n * (element or document fragment) or between {@link module:engine/model/document~Document#roots documents roots},\n * but you can not move items from document fragment to the document or from one detached element to another. Use\n * {@link module:engine/model/writer~Writer#insert} in such cases.\n *\n * @param range Source range.\n * @param offset Offset or one of the flags. Used only when second parameter is a {@link module:engine/model/item~Item model item}.\n */\n move(range, itemOrPosition, offset) {\n this._assertWriterUsedCorrectly();\n if (!(range instanceof Range)) {\n /**\n * Invalid range to move.\n *\n * @error writer-move-invalid-range\n */\n throw new CKEditorError('writer-move-invalid-range', this);\n }\n if (!range.isFlat) {\n /**\n * Range to move is not flat.\n *\n * @error writer-move-range-not-flat\n */\n throw new CKEditorError('writer-move-range-not-flat', this);\n }\n const position = Position._createAt(itemOrPosition, offset);\n // Do not move anything if the move target is same as moved range start.\n if (position.isEqual(range.start)) {\n return;\n }\n // If part of the marker is removed, create additional marker operation for undo purposes.\n this._addOperationForAffectedMarkers('move', range);\n if (!isSameTree(range.root, position.root)) {\n /**\n * Range is going to be moved within not the same document. Please use\n * {@link module:engine/model/writer~Writer#insert insert} instead.\n *\n * @error writer-move-different-document\n */\n throw new CKEditorError('writer-move-different-document', this);\n }\n const version = range.root.document ? range.root.document.version : null;\n const operation = new MoveOperation(range.start, range.end.offset - range.start.offset, position, version);\n this.batch.addOperation(operation);\n this.model.applyOperation(operation);\n }\n /**\n * Removes given model {@link module:engine/model/item~Item item} or {@link module:engine/model/range~Range range}.\n *\n * @param itemOrRange Model item or range to remove.\n */\n remove(itemOrRange) {\n this._assertWriterUsedCorrectly();\n const rangeToRemove = itemOrRange instanceof Range ? itemOrRange : Range._createOn(itemOrRange);\n const ranges = rangeToRemove.getMinimalFlatRanges().reverse();\n for (const flat of ranges) {\n // If part of the marker is removed, create additional marker operation for undo purposes.\n this._addOperationForAffectedMarkers('move', flat);\n applyRemoveOperation(flat.start, flat.end.offset - flat.start.offset, this.batch, this.model);\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 `writer-merge-no-element-before` or\n * `writer-merge-no-element-after` error will be thrown.\n *\n * @param position Position between merged elements.\n */\n merge(position) {\n this._assertWriterUsedCorrectly();\n const nodeBefore = position.nodeBefore;\n const nodeAfter = position.nodeAfter;\n // If part of the marker is removed, create additional marker operation for undo purposes.\n this._addOperationForAffectedMarkers('merge', position);\n if (!(nodeBefore instanceof Element)) {\n /**\n * Node before merge position must be an element.\n *\n * @error writer-merge-no-element-before\n */\n throw new CKEditorError('writer-merge-no-element-before', this);\n }\n if (!(nodeAfter instanceof Element)) {\n /**\n * Node after merge position must be an element.\n *\n * @error writer-merge-no-element-after\n */\n throw new CKEditorError('writer-merge-no-element-after', this);\n }\n if (!position.root.document) {\n this._mergeDetached(position);\n }\n else {\n this._merge(position);\n }\n }\n /**\n * Shortcut for {@link module:engine/model/model~Model#createPositionFromPath `Model#createPositionFromPath()`}.\n *\n * @param root Root of the position.\n * @param path Position path. See {@link module:engine/model/position~Position#path}.\n * @param stickiness Position stickiness. See {@link module:engine/model/position~PositionStickiness}.\n */\n createPositionFromPath(root, path, stickiness) {\n return this.model.createPositionFromPath(root, path, stickiness);\n }\n /**\n * Shortcut for {@link module:engine/model/model~Model#createPositionAt `Model#createPositionAt()`}.\n *\n * @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/model/item~Item model item}.\n */\n createPositionAt(itemOrPosition, offset) {\n return this.model.createPositionAt(itemOrPosition, offset);\n }\n /**\n * Shortcut for {@link module:engine/model/model~Model#createPositionAfter `Model#createPositionAfter()`}.\n *\n * @param item Item after which the position should be placed.\n */\n createPositionAfter(item) {\n return this.model.createPositionAfter(item);\n }\n /**\n * Shortcut for {@link module:engine/model/model~Model#createPositionBefore `Model#createPositionBefore()`}.\n *\n * @param item Item after which the position should be placed.\n */\n createPositionBefore(item) {\n return this.model.createPositionBefore(item);\n }\n /**\n * Shortcut for {@link module:engine/model/model~Model#createRange `Model#createRange()`}.\n *\n * @param start Start position.\n * @param end End position. If not set, range will be collapsed at `start` position.\n */\n createRange(start, end) {\n return this.model.createRange(start, end);\n }\n /**\n * Shortcut for {@link module:engine/model/model~Model#createRangeIn `Model#createRangeIn()`}.\n *\n * @param element Element which is a parent for the range.\n */\n createRangeIn(element) {\n return this.model.createRangeIn(element);\n }\n /**\n * Shortcut for {@link module:engine/model/model~Model#createRangeOn `Model#createRangeOn()`}.\n *\n * @param element Element which is a parent for the range.\n */\n createRangeOn(element) {\n return this.model.createRangeOn(element);\n }\n createSelection(...args) {\n return this.model.createSelection(...args);\n }\n /**\n * Performs merge action in a detached tree.\n *\n * @param position Position between merged elements.\n */\n _mergeDetached(position) {\n const nodeBefore = position.nodeBefore;\n const nodeAfter = position.nodeAfter;\n this.move(Range._createIn(nodeAfter), Position._createAt(nodeBefore, 'end'));\n this.remove(nodeAfter);\n }\n /**\n * Performs merge action in a non-detached tree.\n *\n * @param position Position between merged elements.\n */\n _merge(position) {\n const targetPosition = Position._createAt(position.nodeBefore, 'end');\n const sourcePosition = Position._createAt(position.nodeAfter, 0);\n const graveyard = position.root.document.graveyard;\n const graveyardPosition = new Position(graveyard, [0]);\n const version = position.root.document.version;\n const merge = new MergeOperation(sourcePosition, position.nodeAfter.maxOffset, targetPosition, graveyardPosition, version);\n this.batch.addOperation(merge);\n this.model.applyOperation(merge);\n }\n /**\n * Renames the given element.\n *\n * @param element The element to rename.\n * @param newName New element name.\n */\n rename(element, newName) {\n this._assertWriterUsedCorrectly();\n if (!(element instanceof Element)) {\n /**\n * Trying to rename an object which is not an instance of Element.\n *\n * @error writer-rename-not-element-instance\n */\n throw new CKEditorError('writer-rename-not-element-instance', this);\n }\n const version = element.root.document ? element.root.document.version : null;\n const renameOperation = new RenameOperation(Position._createBefore(element), element.name, newName, version);\n this.batch.addOperation(renameOperation);\n this.model.applyOperation(renameOperation);\n }\n /**\n * Splits elements starting from the given position and going to the top of the model tree as long as given\n * `limitElement` is reached. When `limitElement` is not defined then only the parent of the given position will be split.\n *\n * The element needs to have a parent. It cannot be a root element nor a document fragment.\n * The `writer-split-element-no-parent` error will be thrown if you try to split an element with no parent.\n *\n * @param position Position of split.\n * @param limitElement Stop splitting when this element will be reached.\n * @returns Split result with properties:\n * * `position` - Position between split elements.\n * * `range` - Range that stars from the end of the first split element and ends at the beginning of the first copy element.\n */\n split(position, limitElement) {\n this._assertWriterUsedCorrectly();\n let splitElement = position.parent;\n if (!splitElement.parent) {\n /**\n * Element with no parent can not be split.\n *\n * @error writer-split-element-no-parent\n */\n throw new CKEditorError('writer-split-element-no-parent', this);\n }\n // When limit element is not defined lets set splitElement parent as limit.\n if (!limitElement) {\n limitElement = splitElement.parent;\n }\n if (!position.parent.getAncestors({ includeSelf: true }).includes(limitElement)) {\n /**\n * Limit element is not a position ancestor.\n *\n * @error writer-split-invalid-limit-element\n */\n throw new CKEditorError('writer-split-invalid-limit-element', this);\n }\n // We need to cache elements that will be created as a result of the first split because\n // we need to create a range from the end of the first split element to the beginning of the\n // first copy element. This should be handled by LiveRange but it doesn't work on detached nodes.\n let firstSplitElement;\n let firstCopyElement;\n do {\n const version = splitElement.root.document ? splitElement.root.document.version : null;\n const howMany = splitElement.maxOffset - position.offset;\n const insertionPosition = SplitOperation.getInsertionPosition(position);\n const split = new SplitOperation(position, howMany, insertionPosition, null, version);\n this.batch.addOperation(split);\n this.model.applyOperation(split);\n // Cache result of the first split.\n if (!firstSplitElement && !firstCopyElement) {\n firstSplitElement = splitElement;\n firstCopyElement = position.parent.nextSibling;\n }\n position = this.createPositionAfter(position.parent);\n splitElement = position.parent;\n } while (splitElement !== limitElement);\n return {\n position,\n range: new Range(Position._createAt(firstSplitElement, 'end'), Position._createAt(firstCopyElement, 0))\n };\n }\n /**\n * Wraps the given range with the given element or with a new element (if a string was passed).\n *\n * **Note:** range to wrap should be a \"flat range\" (see {@link module:engine/model/range~Range#isFlat `Range#isFlat`}).\n * If not, an error will be thrown.\n *\n * @param range Range to wrap.\n * @param elementOrString Element or name of element to wrap the range with.\n */\n wrap(range, elementOrString) {\n this._assertWriterUsedCorrectly();\n if (!range.isFlat) {\n /**\n * Range to wrap is not flat.\n *\n * @error writer-wrap-range-not-flat\n */\n throw new CKEditorError('writer-wrap-range-not-flat', this);\n }\n const element = elementOrString instanceof Element ? elementOrString : new Element(elementOrString);\n if (element.childCount > 0) {\n /**\n * Element to wrap with is not empty.\n *\n * @error writer-wrap-element-not-empty\n */\n throw new CKEditorError('writer-wrap-element-not-empty', this);\n }\n if (element.parent !== null) {\n /**\n * Element to wrap with is already attached to a tree model.\n *\n * @error writer-wrap-element-attached\n */\n throw new CKEditorError('writer-wrap-element-attached', this);\n }\n this.insert(element, range.start);\n // Shift the range-to-wrap because we just inserted an element before that range.\n const shiftedRange = new Range(range.start.getShiftedBy(1), range.end.getShiftedBy(1));\n this.move(shiftedRange, Position._createAt(element, 0));\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 * @param element Element to unwrap.\n */\n unwrap(element) {\n this._assertWriterUsedCorrectly();\n if (element.parent === null) {\n /**\n * Trying to unwrap an element which has no parent.\n *\n * @error writer-unwrap-element-no-parent\n */\n throw new CKEditorError('writer-unwrap-element-no-parent', this);\n }\n this.move(Range._createIn(element), this.createPositionAfter(element));\n this.remove(element);\n }\n /**\n * Adds a {@link module:engine/model/markercollection~Marker marker}. Marker is a named range, which tracks\n * changes in the document and updates its range automatically, when model tree changes.\n *\n * As the first parameter you can set marker name.\n *\n * The required `options.usingOperation` parameter lets you decide if the marker should be managed by operations or not. See\n * {@link module:engine/model/markercollection~Marker marker class description} to learn about the difference between\n * markers managed by operations and not-managed by operations.\n *\n * The `options.affectsData` parameter, which defaults to `false`, allows you to define if a marker affects the data. It should be\n * `true` when the marker change changes the data returned by the\n * {@link module:core/editor/utils/dataapimixin~DataApi#getData `editor.getData()`} method.\n * When set to `true` it fires the {@link module:engine/model/document~Document#event:change:data `change:data`} event.\n * When set to `false` it fires the {@link module:engine/model/document~Document#event:change `change`} event.\n *\n * Create marker directly base on marker's name:\n *\n * ```ts\n * addMarker( markerName, { range, usingOperation: false } );\n * ```\n *\n * Create marker using operation:\n *\n * ```ts\n * addMarker( markerName, { range, usingOperation: true } );\n * ```\n *\n * Create marker that affects the editor data:\n *\n * ```ts\n * addMarker( markerName, { range, usingOperation: false, affectsData: true } );\n * ```\n *\n * Note: For efficiency reasons, it's best to create and keep as little markers as possible.\n *\n * @see module:engine/model/markercollection~Marker\n * @param name Name of a marker to create - must be unique.\n * @param options.usingOperation Flag indicating that the marker should be added by MarkerOperation.\n * See {@link module:engine/model/markercollection~Marker#managedUsingOperations}.\n * @param options.range Marker range.\n * @param options.affectsData Flag indicating that the marker changes the editor data.\n * @returns Marker that was set.\n */\n addMarker(name, options) {\n this._assertWriterUsedCorrectly();\n if (!options || typeof options.usingOperation != 'boolean') {\n /**\n * The `options.usingOperation` parameter is required when adding a new marker.\n *\n * @error writer-addmarker-no-usingoperation\n */\n throw new CKEditorError('writer-addmarker-no-usingoperation', this);\n }\n const usingOperation = options.usingOperation;\n const range = options.range;\n const affectsData = options.affectsData === undefined ? false : options.affectsData;\n if (this.model.markers.has(name)) {\n /**\n * Marker with provided name already exists.\n *\n * @error writer-addmarker-marker-exists\n */\n throw new CKEditorError('writer-addmarker-marker-exists', this);\n }\n if (!range) {\n /**\n * Range parameter is required when adding a new marker.\n *\n * @error writer-addmarker-no-range\n */\n throw new CKEditorError('writer-addmarker-no-range', this);\n }\n if (!usingOperation) {\n return this.model.markers._set(name, range, usingOperation, affectsData);\n }\n applyMarkerOperation(this, name, null, range, affectsData);\n return this.model.markers.get(name);\n }\n /**\n * Adds, updates or refreshes a {@link module:engine/model/markercollection~Marker marker}. Marker is a named range, which tracks\n * changes in the document and updates its range automatically, when model tree changes. Still, it is possible to change the\n * marker's range directly using this method.\n *\n * As the first parameter you can set marker name or instance. If none of them is provided, new marker, with a unique\n * name is created and returned.\n *\n * **Note**: If you want to change the {@link module:engine/view/element~Element view element} of the marker while its data in the model\n * remains the same, use the dedicated {@link module:engine/controller/editingcontroller~EditingController#reconvertMarker} method.\n *\n * The `options.usingOperation` parameter lets you change if the marker should be managed by operations or not. See\n * {@link module:engine/model/markercollection~Marker marker class description} to learn about the difference between\n * markers managed by operations and not-managed by operations. It is possible to change this option for an existing marker.\n *\n * The `options.affectsData` parameter, which defaults to `false`, allows you to define if a marker affects the data. It should be\n * `true` when the marker change changes the data returned by\n * the {@link module:core/editor/utils/dataapimixin~DataApi#getData `editor.getData()`} method.\n * When set to `true` it fires the {@link module:engine/model/document~Document#event:change:data `change:data`} event.\n * When set to `false` it fires the {@link module:engine/model/document~Document#event:change `change`} event.\n *\n * Update marker directly base on marker's name:\n *\n * ```ts\n * updateMarker( markerName, { range } );\n * ```\n *\n * Update marker using operation:\n *\n * ```ts\n * updateMarker( marker, { range, usingOperation: true } );\n * updateMarker( markerName, { range, usingOperation: true } );\n * ```\n *\n * Change marker's option (start using operations to manage it):\n *\n * ```ts\n * updateMarker( marker, { usingOperation: true } );\n * ```\n *\n * Change marker's option (inform the engine, that the marker does not affect the data anymore):\n *\n * ```ts\n * updateMarker( markerName, { affectsData: false } );\n * ```\n *\n * @see module:engine/model/markercollection~Marker\n * @param markerOrName Name of a marker to update, or a marker instance.\n * @param options If options object is not defined then marker will be refreshed by triggering\n * downcast conversion for this marker with the same data.\n * @param options.range Marker range to update.\n * @param options.usingOperation Flag indicated whether the marker should be added by MarkerOperation.\n * See {@link module:engine/model/markercollection~Marker#managedUsingOperations}.\n * @param options.affectsData Flag indicating that the marker changes the editor data.\n */\n updateMarker(markerOrName, options) {\n this._assertWriterUsedCorrectly();\n const markerName = typeof markerOrName == 'string' ? markerOrName : markerOrName.name;\n const currentMarker = this.model.markers.get(markerName);\n if (!currentMarker) {\n /**\n * Marker with provided name does not exist and will not be updated.\n *\n * @error writer-updatemarker-marker-not-exists\n */\n throw new CKEditorError('writer-updatemarker-marker-not-exists', this);\n }\n if (!options) {\n /**\n * The usage of `writer.updateMarker()` only to reconvert (refresh) a\n * {@link module:engine/model/markercollection~Marker model marker} was deprecated and may not work in the future.\n * Please update your code to use\n * {@link module:engine/controller/editingcontroller~EditingController#reconvertMarker `editor.editing.reconvertMarker()`}\n * instead.\n *\n * @error writer-updatemarker-reconvert-using-editingcontroller\n * @param markerName The name of the updated marker.\n */\n logWarning('writer-updatemarker-reconvert-using-editingcontroller', { markerName });\n this.model.markers._refresh(currentMarker);\n return;\n }\n const hasUsingOperationDefined = typeof options.usingOperation == 'boolean';\n const affectsDataDefined = typeof options.affectsData == 'boolean';\n // Use previously defined marker's affectsData if the property is not provided.\n const affectsData = affectsDataDefined ? options.affectsData : currentMarker.affectsData;\n if (!hasUsingOperationDefined && !options.range && !affectsDataDefined) {\n /**\n * One of the options is required - provide range, usingOperations or affectsData.\n *\n * @error writer-updatemarker-wrong-options\n */\n throw new CKEditorError('writer-updatemarker-wrong-options', this);\n }\n const currentRange = currentMarker.getRange();\n const updatedRange = options.range ? options.range : currentRange;\n if (hasUsingOperationDefined && options.usingOperation !== currentMarker.managedUsingOperations) {\n // The marker type is changed so it's necessary to create proper operations.\n if (options.usingOperation) {\n // If marker changes to a managed one treat this as synchronizing existing marker.\n // Create `MarkerOperation` with `oldRange` set to `null`, so reverse operation will remove the marker.\n applyMarkerOperation(this, markerName, null, updatedRange, affectsData);\n }\n else {\n // If marker changes to a marker that do not use operations then we need to create additional operation\n // that removes that marker first.\n applyMarkerOperation(this, markerName, currentRange, null, affectsData);\n // Although not managed the marker itself should stay in model and its range should be preserver or changed to passed range.\n this.model.markers._set(markerName, updatedRange, undefined, affectsData);\n }\n return;\n }\n // Marker's type doesn't change so update it accordingly.\n if (currentMarker.managedUsingOperations) {\n applyMarkerOperation(this, markerName, currentRange, updatedRange, affectsData);\n }\n else {\n this.model.markers._set(markerName, updatedRange, undefined, affectsData);\n }\n }\n /**\n * Removes given {@link module:engine/model/markercollection~Marker marker} or marker with given name.\n * The marker is removed accordingly to how it has been created, so if the marker was created using operation,\n * it will be destroyed using operation.\n *\n * @param markerOrName Marker or marker name to remove.\n */\n removeMarker(markerOrName) {\n this._assertWriterUsedCorrectly();\n const name = typeof markerOrName == 'string' ? markerOrName : markerOrName.name;\n if (!this.model.markers.has(name)) {\n /**\n * Trying to remove marker which does not exist.\n *\n * @error writer-removemarker-no-marker\n */\n throw new CKEditorError('writer-removemarker-no-marker', this);\n }\n const marker = this.model.markers.get(name);\n if (!marker.managedUsingOperations) {\n this.model.markers._remove(name);\n return;\n }\n const oldRange = marker.getRange();\n applyMarkerOperation(this, name, oldRange, null, marker.affectsData);\n }\n /**\n * Adds a new root to the document (or re-attaches a {@link #detachRoot detached root}).\n *\n * Throws an error, if trying to add a root that is already added and attached.\n *\n * @param rootName Name of the added root.\n * @param elementName The element name. Defaults to `'$root'` which also has some basic schema defined\n * (e.g. `$block` elements are allowed inside the `$root`). Make sure to define a proper schema if you use a different name.\n * @returns The added root element.\n */\n addRoot(rootName, elementName = '$root') {\n this._assertWriterUsedCorrectly();\n const root = this.model.document.getRoot(rootName);\n if (root && root.isAttached()) {\n /**\n * Root with provided name already exists and is attached.\n *\n * @error writer-addroot-root-exists\n */\n throw new CKEditorError('writer-addroot-root-exists', this);\n }\n const document = this.model.document;\n const operation = new RootOperation(rootName, elementName, true, document, document.version);\n this.batch.addOperation(operation);\n this.model.applyOperation(operation);\n return this.model.document.getRoot(rootName);\n }\n /**\n * Detaches the root from the document.\n *\n * All content and markers are removed from the root upon detaching. New content and new markers cannot be added to the root, as long\n * as it is detached.\n *\n * A root cannot be fully removed from the document, it can be only detached. A root is permanently removed only after you\n * re-initialize the editor and do not specify the root in the initial data.\n *\n * A detached root can be re-attached using {@link #addRoot}.\n *\n * Throws an error if the root does not exist or the root is already detached.\n *\n * @param rootOrName Name of the detached root.\n */\n detachRoot(rootOrName) {\n this._assertWriterUsedCorrectly();\n const root = typeof rootOrName == 'string' ? this.model.document.getRoot(rootOrName) : rootOrName;\n if (!root || !root.isAttached()) {\n /**\n * Root with provided name does not exist or is already detached.\n *\n * @error writer-detachroot-no-root\n */\n throw new CKEditorError('writer-detachroot-no-root', this);\n }\n // First, remove all markers from the root. It is better to do it before removing stuff for undo purposes.\n // However, looking through all the markers may not be the best performance wise. But there's no better solution for now.\n for (const marker of this.model.markers) {\n if (marker.getRange().root === root) {\n this.removeMarker(marker);\n }\n }\n // Remove all attributes from the root.\n for (const key of root.getAttributeKeys()) {\n this.removeAttribute(key, root);\n }\n // Remove all contents of the root.\n this.remove(this.createRangeIn(root));\n // Finally, detach the root.\n const document = this.model.document;\n const operation = new RootOperation(root.rootName, root.name, false, document, document.version);\n this.batch.addOperation(operation);\n this.model.applyOperation(operation);\n }\n setSelection(...args) {\n this._assertWriterUsedCorrectly();\n this.model.document.selection._setTo(...args);\n }\n /**\n * Moves {@link module:engine/model/documentselection~DocumentSelection#focus} to the specified location.\n *\n * The location can be specified in the same form as\n * {@link #createPositionAt `writer.createPositionAt()`} parameters.\n *\n * @param itemOrPosition\n * @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/model/item~Item model item}.\n */\n setSelectionFocus(itemOrPosition, offset) {\n this._assertWriterUsedCorrectly();\n this.model.document.selection._setFocus(itemOrPosition, offset);\n }\n setSelectionAttribute(keyOrObjectOrIterable, value) {\n this._assertWriterUsedCorrectly();\n if (typeof keyOrObjectOrIterable === 'string') {\n this._setSelectionAttribute(keyOrObjectOrIterable, value);\n }\n else {\n for (const [key, value] of toMap(keyOrObjectOrIterable)) {\n this._setSelectionAttribute(key, value);\n }\n }\n }\n /**\n * Removes attribute(s) with given key(s) from the selection.\n *\n * Remove one attribute:\n *\n * ```ts\n * writer.removeSelectionAttribute( 'italic' );\n * ```\n *\n * Remove multiple attributes:\n *\n * ```ts\n * writer.removeSelectionAttribute( [ 'italic', 'bold' ] );\n * ```\n *\n * @param keyOrIterableOfKeys Key of the attribute to remove or an iterable of attribute keys to remove.\n */\n removeSelectionAttribute(keyOrIterableOfKeys) {\n this._assertWriterUsedCorrectly();\n if (typeof keyOrIterableOfKeys === 'string') {\n this._removeSelectionAttribute(keyOrIterableOfKeys);\n }\n else {\n for (const key of keyOrIterableOfKeys) {\n this._removeSelectionAttribute(key);\n }\n }\n }\n /**\n * Temporarily changes the {@link module:engine/model/documentselection~DocumentSelection#isGravityOverridden gravity}\n * of the selection from left to right.\n *\n * The gravity defines from which direction the selection inherits its attributes. If it's the default left gravity,\n * then the selection (after being moved by the user) inherits attributes from its left-hand side.\n * This method allows to temporarily override this behavior by forcing the gravity to the right.\n *\n * For the following model fragment:\n *\n * ```xml\n * <$text bold=\"true\" linkHref=\"url\">bar[]</$text><$text bold=\"true\">biz</$text>\n * ```\n *\n * * Default gravity: selection will have the `bold` and `linkHref` attributes.\n * * Overridden gravity: selection will have `bold` attribute.\n *\n * **Note**: It returns an unique identifier which is required to restore the gravity. It guarantees the symmetry\n * of the process.\n *\n * @returns The unique id which allows restoring the gravity.\n */\n overrideSelectionGravity() {\n return this.model.document.selection._overrideGravity();\n }\n /**\n * Restores {@link ~Writer#overrideSelectionGravity} gravity to default.\n *\n * Restoring the gravity is only possible using the unique identifier returned by\n * {@link ~Writer#overrideSelectionGravity}. Note that the gravity remains overridden as long as won't be restored\n * the same number of times it was overridden.\n *\n * @param uid The unique id returned by {@link ~Writer#overrideSelectionGravity}.\n */\n restoreSelectionGravity(uid) {\n this.model.document.selection._restoreGravity(uid);\n }\n /**\n * @param key Key of the attribute to remove.\n * @param value Attribute value.\n */\n _setSelectionAttribute(key, value) {\n const selection = this.model.document.selection;\n // Store attribute in parent element if the selection is collapsed in an empty node.\n if (selection.isCollapsed && selection.anchor.parent.isEmpty) {\n const storeKey = DocumentSelection._getStoreAttributeKey(key);\n this.setAttribute(storeKey, value, selection.anchor.parent);\n }\n selection._setAttribute(key, value);\n }\n /**\n * @param key Key of the attribute to remove.\n */\n _removeSelectionAttribute(key) {\n const selection = this.model.document.selection;\n // Remove stored attribute from parent element if the selection is collapsed in an empty node.\n if (selection.isCollapsed && selection.anchor.parent.isEmpty) {\n const storeKey = DocumentSelection._getStoreAttributeKey(key);\n this.removeAttribute(storeKey, selection.anchor.parent);\n }\n selection._removeAttribute(key);\n }\n /**\n * Throws `writer-detached-writer-tries-to-modify-model` error when the writer is used outside of the `change()` block.\n */\n _assertWriterUsedCorrectly() {\n /**\n * Trying to use a writer outside a {@link module:engine/model/model~Model#change `change()`} or\n * {@link module:engine/model/model~Model#enqueueChange `enqueueChange()`} blocks.\n *\n * The writer can only be used inside these blocks which ensures that the model\n * can only be changed during such \"sessions\".\n *\n * @error writer-incorrect-use\n */\n if (this.model._currentWriter !== this) {\n throw new CKEditorError('writer-incorrect-use', this);\n }\n }\n /**\n * For given action `type` and `positionOrRange` where the action happens, this function finds all affected markers\n * and applies a marker operation with the new marker range equal to the current range. Thanks to this, the marker range\n * can be later correctly processed during undo.\n *\n * @param type Writer action type.\n * @param positionOrRange Position or range where the writer action happens.\n */\n _addOperationForAffectedMarkers(type, positionOrRange) {\n for (const marker of this.model.markers) {\n if (!marker.managedUsingOperations) {\n continue;\n }\n const markerRange = marker.getRange();\n let isAffected = false;\n if (type === 'move') {\n const range = positionOrRange;\n isAffected =\n range.containsPosition(markerRange.start) ||\n range.start.isEqual(markerRange.start) ||\n range.containsPosition(markerRange.end) ||\n range.end.isEqual(markerRange.end);\n }\n else {\n // if type === 'merge'.\n const position = positionOrRange;\n const elementBefore = position.nodeBefore;\n const elementAfter = position.nodeAfter;\n // Start: <p>Foo[</p><p>Bar]</p>\n // After merge: <p>Foo[Bar]</p>\n // After undoing split: <p>Foo</p><p>[Bar]</p> <-- incorrect, needs remembering for undo.\n //\n const affectedInLeftElement = markerRange.start.parent == elementBefore && markerRange.start.isAtEnd;\n // Start: <p>[Foo</p><p>]Bar</p>\n // After merge: <p>[Foo]Bar</p>\n // After undoing split: <p>[Foo]</p><p>Bar</p> <-- incorrect, needs remembering for undo.\n //\n const affectedInRightElement = markerRange.end.parent == elementAfter && markerRange.end.offset == 0;\n // Start: <p>[Foo</p>]<p>Bar</p>\n // After merge: <p>[Foo]Bar</p>\n // After undoing split: <p>[Foo]</p><p>Bar</p> <-- incorrect, needs remembering for undo.\n //\n const affectedAfterLeftElement = markerRange.end.nodeAfter == elementAfter;\n // Start: <p>Foo</p>[<p>Bar]</p>\n // After merge: <p>Foo[Bar]</p>\n // After undoing split: <p>Foo</p><p>[Bar]</p> <-- incorrect, needs remembering for undo.\n //\n const affectedBeforeRightElement = markerRange.start.nodeAfter == elementAfter;\n isAffected = affectedInLeftElement || affectedInRightElement || affectedAfterLeftElement || affectedBeforeRightElement;\n }\n if (isAffected) {\n this.updateMarker(marker.name, { range: markerRange });\n }\n }\n }\n}\n/**\n * Sets given attribute to each node in given range. When attribute value is null then attribute will be removed.\n *\n * Because attribute operation needs to have the same attribute value on the whole range, this function splits\n * the range into smaller parts.\n *\n * Given `range` must be flat.\n */\nfunction setAttributeOnRange(writer, key, value, range) {\n const model = writer.model;\n const doc = model.document;\n // Position of the last split, the beginning of the new range.\n let lastSplitPosition = range.start;\n // Currently position in the scanning range. Because we need value after the position, it is not a current\n // position of the iterator but the previous one (we need to iterate one more time to get the value after).\n let position;\n // Value before the currently position.\n let valueBefore;\n // Value after the currently position.\n let valueAfter;\n for (const val of range.getWalker({ shallow: true })) {\n valueAfter = val.item.getAttribute(key);\n // At the first run of the iterator the position in undefined. We also do not have a valueBefore, but\n // because valueAfter may be null, valueBefore may be equal valueAfter ( undefined == null ).\n if (position && valueBefore != valueAfter) {\n // if valueBefore == value there is nothing to change, so we add operation only if these values are different.\n if (valueBefore != value) {\n addOperation();\n }\n lastSplitPosition = position;\n }\n position = val.nextPosition;\n valueBefore = valueAfter;\n }\n // Because position in the loop is not the iterator position (see let position comment), the last position in\n // the while loop will be last but one position in the range. We need to check the last position manually.\n if (position instanceof Position && position != lastSplitPosition && valueBefore != value) {\n addOperation();\n }\n function addOperation() {\n const range = new Range(lastSplitPosition, position);\n const version = range.root.document ? doc.version : null;\n const operation = new AttributeOperation(range, key, valueBefore, value, version);\n writer.batch.addOperation(operation);\n model.applyOperation(operation);\n }\n}\n/**\n * Sets given attribute to the given node. When attribute value is null then attribute will be removed.\n */\nfunction setAttributeOnItem(writer, key, value, item) {\n const model = writer.model;\n const doc = model.document;\n const previousValue = item.getAttribute(key);\n let range, operation;\n if (previousValue != value) {\n const isRootChanged = item.root === item;\n if (isRootChanged) {\n // If we change attributes of root element, we have to use `RootAttributeOperation`.\n const version = item.document ? doc.version : null;\n operation = new RootAttributeOperation(item, key, previousValue, value, version);\n }\n else {\n range = new Range(Position._createBefore(item), writer.createPositionAfter(item));\n const version = range.root.document ? doc.version : null;\n operation = new AttributeOperation(range, key, previousValue, value, version);\n }\n writer.batch.addOperation(operation);\n model.applyOperation(operation);\n }\n}\n/**\n * Creates and applies marker operation to {@link module:engine/model/operation/operation~Operation operation}.\n */\nfunction applyMarkerOperation(writer, name, oldRange, newRange, affectsData) {\n const model = writer.model;\n const doc = model.document;\n const operation = new MarkerOperation(name, oldRange, newRange, model.markers, !!affectsData, doc.version);\n writer.batch.addOperation(operation);\n model.applyOperation(operation);\n}\n/**\n * Creates `MoveOperation` or `DetachOperation` that removes `howMany` nodes starting from `position`.\n * The operation will be applied on given model instance and added to given operation instance.\n *\n * @param position Position from which nodes are removed.\n * @param howMany Number of nodes to remove.\n * @param batch Batch to which the operation will be added.\n * @param model Model instance on which operation will be applied.\n */\nfunction applyRemoveOperation(position, howMany, batch, model) {\n let operation;\n if (position.root.document) {\n const doc = model.document;\n const graveyardPosition = new Position(doc.graveyard, [0]);\n operation = new MoveOperation(position, howMany, graveyardPosition, doc.version);\n }\n else {\n operation = new DetachOperation(position, howMany);\n }\n batch.addOperation(operation);\n model.applyOperation(operation);\n}\n/**\n * Returns `true` if both root elements are the same element or both are documents root elements.\n *\n * Elements in the same tree can be moved (for instance you can move element form one documents root to another, or\n * within the same document fragment), but when element supposed to be moved from document fragment to the document, or\n * to another document it should be removed and inserted to avoid problems with OT. This is because features like undo or\n * collaboration may track changes on the document but ignore changes on detached fragments and should not get\n * unexpected `move` operation.\n */\nfunction isSameTree(rootA, rootB) {\n // If it is the same root this is the same tree.\n if (rootA === rootB) {\n return true;\n }\n // If both roots are documents root it is operation within the document what we still treat as the same tree.\n if (rootA instanceof RootElement && rootB instanceof RootElement) {\n return true;\n }\n return false;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/utils/deletecontent\n */\nimport DocumentSelection from '../documentselection';\nimport LivePosition from '../liveposition';\nimport Range from '../range';\n/**\n * Deletes content of the selection and merge siblings. The resulting selection is always collapsed.\n *\n * **Note:** Use {@link module:engine/model/model~Model#deleteContent} instead of this function.\n * This function is only exposed to be reusable in algorithms\n * which change the {@link module:engine/model/model~Model#deleteContent}\n * method's behavior.\n *\n * @param model The model in context of which the insertion should be performed.\n * @param selection Selection of which the content should be deleted.\n * @param options.leaveUnmerged Whether to merge elements after removing the content of the selection.\n *\n * For example `<heading>x[x</heading><paragraph>y]y</paragraph>` will become:\n *\n * * `<heading>x^y</heading>` with the option disabled (`leaveUnmerged == false`)\n * * `<heading>x^</heading><paragraph>y</paragraph>` with enabled (`leaveUnmerged == true`).\n *\n * Note: {@link module:engine/model/schema~Schema#isObject object} and {@link module:engine/model/schema~Schema#isLimit limit}\n * elements will not be merged.\n *\n * @param options.doNotResetEntireContent Whether to skip replacing the entire content with a\n * paragraph when the entire content was selected.\n *\n * For example `<heading>[x</heading><paragraph>y]</paragraph>` will become:\n *\n * * `<paragraph>^</paragraph>` with the option disabled (`doNotResetEntireContent == false`)\n * * `<heading>^</heading>` with enabled (`doNotResetEntireContent == true`).\n *\n * @param options.doNotAutoparagraph Whether to create a paragraph if after content deletion selection is moved\n * to a place where text cannot be inserted.\n *\n * For example `<paragraph>x</paragraph>[<imageBlock src=\"foo.jpg\"></imageBlock>]` will become:\n *\n * * `<paragraph>x</paragraph><paragraph>[]</paragraph>` with the option disabled (`doNotAutoparagraph == false`)\n * * `<paragraph>x</paragraph>[]` with the option enabled (`doNotAutoparagraph == true`).\n *\n * If you use this option you need to make sure to handle invalid selections yourself or leave\n * them to the selection post-fixer (may not always work).\n *\n * **Note:** If there is no valid position for the selection, the paragraph will always be created:\n *\n * `[<imageBlock src=\"foo.jpg\"></imageBlock>]` -> `<paragraph>[]</paragraph>`.\n */\nexport default function deleteContent(model, selection, options = {}) {\n if (selection.isCollapsed) {\n return;\n }\n const selRange = selection.getFirstRange();\n // If the selection is already removed, don't do anything.\n if (selRange.root.rootName == '$graveyard') {\n return;\n }\n const schema = model.schema;\n model.change(writer => {\n // 1. Replace the entire content with paragraph.\n // See: https://github.com/ckeditor/ckeditor5-engine/issues/1012#issuecomment-315017594.\n if (!options.doNotResetEntireContent && shouldEntireContentBeReplacedWithParagraph(schema, selection)) {\n replaceEntireContentWithParagraph(writer, selection);\n return;\n }\n // Collect attributes to copy in case of autoparagraphing.\n const attributesForAutoparagraph = {};\n if (!options.doNotAutoparagraph) {\n const selectedElement = selection.getSelectedElement();\n if (selectedElement) {\n Object.assign(attributesForAutoparagraph, schema.getAttributesWithProperty(selectedElement, 'copyOnReplace', true));\n }\n }\n // Get the live positions for the range adjusted to span only blocks selected from the user perspective.\n const [startPosition, endPosition] = getLivePositionsForSelectedBlocks(selRange);\n // 2. Remove the content if there is any.\n if (!startPosition.isTouching(endPosition)) {\n writer.remove(writer.createRange(startPosition, endPosition));\n }\n // 3. Merge elements in the right branch to the elements in the left branch.\n // The only reasonable (in terms of data and selection correctness) case in which we need to do that is:\n //\n // <heading type=1>Fo[</heading><paragraph>]ar</paragraph> => <heading type=1>Fo^ar</heading>\n //\n // However, the algorithm supports also merging deeper structures (up to the depth of the shallower branch),\n // as it's hard to imagine what should actually be the default behavior. Usually, specific features will\n // want to override that behavior anyway.\n if (!options.leaveUnmerged) {\n mergeBranches(writer, startPosition, endPosition);\n // TMP this will be replaced with a postfixer.\n // We need to check and strip disallowed attributes in all nested nodes because after merge\n // some attributes could end up in a path where are disallowed.\n //\n // e.g. bold is disallowed for <H1>\n // <h1>Fo{o</h1><p>b}a<b>r</b><p> -> <h1>Fo{}a<b>r</b><h1> -> <h1>Fo{}ar<h1>.\n schema.removeDisallowedAttributes(startPosition.parent.getChildren(), writer);\n }\n collapseSelectionAt(writer, selection, startPosition);\n // 4. Add a paragraph to set selection in it.\n // Check if a text is allowed in the new container. If not, try to create a new paragraph (if it's allowed here).\n // If autoparagraphing is off, we assume that you know what you do so we leave the selection wherever it was.\n if (!options.doNotAutoparagraph && shouldAutoparagraph(schema, startPosition)) {\n insertParagraph(writer, startPosition, selection, attributesForAutoparagraph);\n }\n startPosition.detach();\n endPosition.detach();\n });\n}\n/**\n * Returns the live positions for the range adjusted to span only blocks selected from the user perspective. Example:\n *\n * ```\n * <heading1>[foo</heading1>\n * <paragraph>bar</paragraph>\n * <heading1>]abc</heading1> <-- this block is not considered as selected\n * ```\n *\n * This is the same behavior as in Selection#getSelectedBlocks() \"special case\".\n */\nfunction getLivePositionsForSelectedBlocks(range) {\n const model = range.root.document.model;\n const startPosition = range.start;\n let endPosition = range.end;\n // If the end of selection is at the start position of last block in the selection, then\n // shrink it to not include that trailing block. Note that this should happen only for not empty selection.\n if (model.hasContent(range, { ignoreMarkers: true })) {\n const endBlock = getParentBlock(endPosition);\n if (endBlock && endPosition.isTouching(model.createPositionAt(endBlock, 0))) {\n // Create forward selection as a probe to find a valid position after excluding last block from the range.\n const selection = model.createSelection(range);\n // Modify the forward selection in backward direction to shrink it and remove first position of following block from it.\n // This is how modifySelection works and here we are making use of it.\n model.modifySelection(selection, { direction: 'backward' });\n const newEndPosition = selection.getLastPosition();\n // For such a model and selection:\n // <paragraph>A[</paragraph><imageBlock></imageBlock><paragraph>]B</paragraph>\n //\n // After modifySelection(), we would end up with this:\n // <paragraph>A[</paragraph>]<imageBlock></imageBlock><paragraph>B</paragraph>\n //\n // So we need to check if there is no content in the skipped range (because we want to include the <imageBlock>).\n const skippedRange = model.createRange(newEndPosition, endPosition);\n if (!model.hasContent(skippedRange, { ignoreMarkers: true })) {\n endPosition = newEndPosition;\n }\n }\n }\n return [\n LivePosition.fromPosition(startPosition, 'toPrevious'),\n LivePosition.fromPosition(endPosition, 'toNext')\n ];\n}\n/**\n * Finds the lowest element in position's ancestors which is a block.\n * Returns null if a limit element is encountered before reaching a block element.\n */\nfunction getParentBlock(position) {\n const element = position.parent;\n const schema = element.root.document.model.schema;\n const ancestors = element.getAncestors({ parentFirst: true, includeSelf: true });\n for (const element of ancestors) {\n if (schema.isLimit(element)) {\n return null;\n }\n if (schema.isBlock(element)) {\n return element;\n }\n }\n}\n/**\n * This function is a result of reaching the Ballmer's peak for just the right amount of time.\n * Even I had troubles documenting it after a while and after reading it again I couldn't believe that it really works.\n */\nfunction mergeBranches(writer, startPosition, endPosition) {\n const model = writer.model;\n // Verify if there is a need and possibility to merge.\n if (!checkShouldMerge(writer.model.schema, startPosition, endPosition)) {\n return;\n }\n // If the start element on the common ancestor level is empty, and the end element on the same level is not empty\n // then merge those to the right element so that it's properties are preserved (name, attributes).\n // Because of OT merging is used instead of removing elements.\n //\n // Merge left:\n // <heading1>foo[</heading1> -> <heading1>foo[]bar</heading1>\n // <paragraph>]bar</paragraph> -> --^\n //\n // Merge right:\n // <heading1>[</heading1> ->\n // <paragraph>]bar</paragraph> -> <paragraph>[]bar</paragraph>\n //\n // Merge left:\n // <blockQuote> -> <blockQuote>\n // <heading1>foo[</heading1> -> <heading1>foo[]bar</heading1>\n // <paragraph>]bar</paragraph> -> --^\n // </blockQuote> -> </blockQuote>\n //\n // Merge right:\n // <blockQuote> -> <blockQuote>\n // <heading1>[</heading1> ->\n // <paragraph>]bar</paragraph> -> <paragraph>[]bar</paragraph>\n // </blockQuote> -> </blockQuote>\n // Merging should not go deeper than common ancestor.\n const [startAncestor, endAncestor] = getAncestorsJustBelowCommonAncestor(startPosition, endPosition);\n // Branches can't be merged if one of the positions is directly inside a common ancestor.\n //\n // Example:\n // <blockQuote>\n // <paragraph>[foo</paragraph>]\n // <table> ... </table>\n // <blockQuote>\n //\n if (!startAncestor || !endAncestor) {\n return;\n }\n if (!model.hasContent(startAncestor, { ignoreMarkers: true }) && model.hasContent(endAncestor, { ignoreMarkers: true })) {\n mergeBranchesRight(writer, startPosition, endPosition, startAncestor.parent);\n }\n else {\n mergeBranchesLeft(writer, startPosition, endPosition, startAncestor.parent);\n }\n}\n/**\n * Merging blocks to the left (properties of the left block are preserved).\n * Simple example:\n *\n * ```\n * <heading1>foo[</heading1> -> <heading1>foo[bar</heading1>]\n * <paragraph>]bar</paragraph> -> --^\n * ```\n *\n * Nested example:\n *\n * ```\n * <blockQuote> -> <blockQuote>\n * <heading1>foo[</heading1> -> <heading1>foo[bar</heading1>\n * </blockQuote> -> </blockQuote>] ^\n * <blockBlock> -> |\n * <paragraph>]bar</paragraph> -> ---\n * </blockBlock> ->\n * ```\n */\nfunction mergeBranchesLeft(writer, startPosition, endPosition, commonAncestor) {\n const startElement = startPosition.parent;\n const endElement = endPosition.parent;\n // Merging reached the common ancestor element, stop here.\n if (startElement == commonAncestor || endElement == commonAncestor) {\n return;\n }\n // Remember next positions to merge in next recursive step (also used as modification points pointers).\n startPosition = writer.createPositionAfter(startElement);\n endPosition = writer.createPositionBefore(endElement);\n // Move endElement just after startElement if they aren't siblings.\n if (!endPosition.isEqual(startPosition)) {\n //\n // <blockQuote> -> <blockQuote>\n // <heading1>foo[</heading1> -> <heading1>foo</heading1>[<paragraph>bar</paragraph>\n // </blockQuote> -> </blockQuote> ^\n // <blockBlock> -> <blockBlock> |\n // <paragraph>]bar</paragraph> -> ] ---\n // </blockBlock> -> </blockBlock>\n //\n writer.insert(endElement, startPosition);\n }\n // Merge two siblings (nodes on sides of startPosition):\n //\n // <blockQuote> -> <blockQuote>\n // <heading1>foo</heading1>[<paragraph>bar</paragraph> -> <heading1>foo[bar</heading1>\n // </blockQuote> -> </blockQuote>\n // <blockBlock> -> <blockBlock>\n // ] -> ]\n // </blockBlock> -> </blockBlock>\n //\n // Or in simple case (without moving elements in above if):\n // <heading1>foo</heading1>[<paragraph>bar</paragraph>] -> <heading1>foo[bar</heading1>]\n //\n writer.merge(startPosition);\n // Remove empty end ancestors:\n //\n // <blockQuote> -> <blockQuote>\n // <heading1>foo[bar</heading1> -> <heading1>foo[bar</heading1>\n // </blockQuote> -> </blockQuote>\n // <blockBlock> ->\n // ] -> ]\n // </blockBlock> ->\n //\n while (endPosition.parent.isEmpty) {\n const parentToRemove = endPosition.parent;\n endPosition = writer.createPositionBefore(parentToRemove);\n writer.remove(parentToRemove);\n }\n // Verify if there is a need and possibility to merge next level.\n if (!checkShouldMerge(writer.model.schema, startPosition, endPosition)) {\n return;\n }\n // Continue merging next level (blockQuote with blockBlock in the examples above if it would not be empty and got removed).\n mergeBranchesLeft(writer, startPosition, endPosition, commonAncestor);\n}\n/**\n * Merging blocks to the right (properties of the right block are preserved).\n * Simple example:\n *\n * ```\n * <heading1>foo[</heading1> -> --v\n * <paragraph>]bar</paragraph> -> [<paragraph>foo]bar</paragraph>\n * ```\n *\n * Nested example:\n *\n * ```\n * <blockQuote> ->\n * <heading1>foo[</heading1> -> ---\n * </blockQuote> -> |\n * <blockBlock> -> [<blockBlock> v\n * <paragraph>]bar</paragraph> -> <paragraph>foo]bar</paragraph>\n * </blockBlock> -> </blockBlock>\n * ```\n */\nfunction mergeBranchesRight(writer, startPosition, endPosition, commonAncestor) {\n const startElement = startPosition.parent;\n const endElement = endPosition.parent;\n // Merging reached the common ancestor element, stop here.\n if (startElement == commonAncestor || endElement == commonAncestor) {\n return;\n }\n // Remember next positions to merge in next recursive step (also used as modification points pointers).\n startPosition = writer.createPositionAfter(startElement);\n endPosition = writer.createPositionBefore(endElement);\n // Move startElement just before endElement if they aren't siblings.\n if (!endPosition.isEqual(startPosition)) {\n //\n // <blockQuote> -> <blockQuote>\n // <heading1>foo[</heading1> -> [ ---\n // </blockQuote> -> </blockQuote> |\n // <blockBlock> -> <blockBlock> v\n // <paragraph>]bar</paragraph> -> <heading1>foo</heading1>]<paragraph>bar</paragraph>\n // </blockBlock> -> </blockBlock>\n //\n writer.insert(startElement, endPosition);\n }\n // Remove empty end ancestors:\n //\n // <blockQuote> ->\n // [ -> [\n // </blockQuote> ->\n // <blockBlock> -> <blockBlock>\n // <heading1>foo</heading1>]<paragraph>bar</paragraph> -> <heading1>foo</heading1>]<paragraph>bar</paragraph>\n // </blockBlock> -> </blockBlock>\n //\n while (startPosition.parent.isEmpty) {\n const parentToRemove = startPosition.parent;\n startPosition = writer.createPositionBefore(parentToRemove);\n writer.remove(parentToRemove);\n }\n // Update endPosition after inserting and removing elements.\n endPosition = writer.createPositionBefore(endElement);\n // Merge right two siblings (nodes on sides of endPosition):\n // ->\n // [ -> [\n // ->\n // <blockBlock> -> <blockBlock>\n // <heading1>foo</heading1>]<paragraph>bar</paragraph> -> <paragraph>foo]bar</paragraph>\n // </blockBlock> -> </blockBlock>\n //\n // Or in simple case (without moving elements in above if):\n // [<heading1>foo</heading1>]<paragraph>bar</paragraph> -> [<heading1>foo]bar</heading1>\n //\n mergeRight(writer, endPosition);\n // Verify if there is a need and possibility to merge next level.\n if (!checkShouldMerge(writer.model.schema, startPosition, endPosition)) {\n return;\n }\n // Continue merging next level (blockQuote with blockBlock in the examples above if it would not be empty and got removed).\n mergeBranchesRight(writer, startPosition, endPosition, commonAncestor);\n}\n/**\n * There is no right merge operation so we need to simulate it.\n */\nfunction mergeRight(writer, position) {\n const startElement = position.nodeBefore;\n const endElement = position.nodeAfter;\n if (startElement.name != endElement.name) {\n writer.rename(startElement, endElement.name);\n }\n writer.clearAttributes(startElement);\n writer.setAttributes(Object.fromEntries(endElement.getAttributes()), startElement);\n writer.merge(position);\n}\n/**\n * Verifies if merging is needed and possible. It's not needed if both positions are in the same element\n * and it's not possible if some element is a limit or the range crosses a limit element.\n */\nfunction checkShouldMerge(schema, startPosition, endPosition) {\n const startElement = startPosition.parent;\n const endElement = endPosition.parent;\n // If both positions ended up in the same parent, then there's nothing more to merge:\n // <$root><p>x[</p><p>]y</p></$root> => <$root><p>xy</p>[]</$root>\n if (startElement == endElement) {\n return false;\n }\n // If one of the positions is a limit element, then there's nothing to merge because we don't want to cross the limit boundaries.\n if (schema.isLimit(startElement) || schema.isLimit(endElement)) {\n return false;\n }\n // Check if operations we'll need to do won't need to cross object or limit boundaries.\n // E.g., we can't merge endElement into startElement in this case:\n // <limit><startElement>x[</startElement></limit><endElement>]</endElement>\n return isCrossingLimitElement(startPosition, endPosition, schema);\n}\n/**\n * Returns the elements that are the ancestors of the provided positions that are direct children of the common ancestor.\n */\nfunction getAncestorsJustBelowCommonAncestor(positionA, positionB) {\n const ancestorsA = positionA.getAncestors();\n const ancestorsB = positionB.getAncestors();\n let i = 0;\n while (ancestorsA[i] && ancestorsA[i] == ancestorsB[i]) {\n i++;\n }\n return [ancestorsA[i], ancestorsB[i]];\n}\nfunction shouldAutoparagraph(schema, position) {\n const isTextAllowed = schema.checkChild(position, '$text');\n const isParagraphAllowed = schema.checkChild(position, 'paragraph');\n return !isTextAllowed && isParagraphAllowed;\n}\n/**\n * Check if parents of two positions can be merged by checking if there are no limit/object\n * boundaries between those two positions.\n *\n * E.g. in <bQ><p>x[]</p></bQ><widget><caption>{}</caption></widget>\n * we'll check <p>, <bQ>, <widget> and <caption>.\n * Usually, widget and caption are marked as objects/limits in the schema, so in this case merging will be blocked.\n */\nfunction isCrossingLimitElement(leftPos, rightPos, schema) {\n const rangeToCheck = new Range(leftPos, rightPos);\n for (const value of rangeToCheck.getWalker()) {\n if (schema.isLimit(value.item)) {\n return false;\n }\n }\n return true;\n}\nfunction insertParagraph(writer, position, selection, attributes = {}) {\n const paragraph = writer.createElement('paragraph');\n writer.model.schema.setAllowedAttributes(paragraph, attributes, writer);\n writer.insert(paragraph, position);\n collapseSelectionAt(writer, selection, writer.createPositionAt(paragraph, 0));\n}\nfunction replaceEntireContentWithParagraph(writer, selection) {\n const limitElement = writer.model.schema.getLimitElement(selection);\n writer.remove(writer.createRangeIn(limitElement));\n insertParagraph(writer, writer.createPositionAt(limitElement, 0), selection);\n}\n/**\n * We want to replace the entire content with a paragraph when:\n * * the entire content is selected,\n * * selection contains at least two elements,\n * * whether the paragraph is allowed in schema in the common ancestor.\n */\nfunction shouldEntireContentBeReplacedWithParagraph(schema, selection) {\n const limitElement = schema.getLimitElement(selection);\n if (!selection.containsEntireContent(limitElement)) {\n return false;\n }\n const range = selection.getFirstRange();\n if (range.start.parent == range.end.parent) {\n return false;\n }\n return schema.checkChild(limitElement, 'paragraph');\n}\n/**\n * Helper function that sets the selection. Depending whether given `selection` is a document selection or not,\n * uses a different method to set it.\n */\nfunction collapseSelectionAt(writer, selection, positionOrRange) {\n if (selection instanceof DocumentSelection) {\n writer.setSelection(positionOrRange);\n }\n else {\n selection.setTo(positionOrRange);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/utils/getselectedcontent\n */\n/**\n * Gets a clone of the selected content.\n *\n * For example, for the following selection:\n *\n * ```html\n * <p>x</p><quote><p>y</p><h>fir[st</h></quote><p>se]cond</p><p>z</p>\n * ```\n *\n * It will return a document fragment with such a content:\n *\n * ```html\n * <quote><h>st</h></quote><p>se</p>\n * ```\n *\n * @param model The model in context of which the selection modification should be performed.\n * @param selection The selection of which content will be returned.\n */\nexport default function getSelectedContent(model, selection) {\n return model.change(writer => {\n const frag = writer.createDocumentFragment();\n const range = selection.getFirstRange();\n if (!range || range.isCollapsed) {\n return frag;\n }\n const root = range.start.root;\n const commonPath = range.start.getCommonPath(range.end);\n const commonParent = root.getNodeByPath(commonPath);\n // ## 1st step\n //\n // First, we'll clone a fragment represented by a minimal flat range\n // containing the original range to be cloned.\n // E.g. let's consider such a range:\n //\n // <p>x</p><quote><p>y</p><h>fir[st</h></quote><p>se]cond</p><p>z</p>\n //\n // A minimal flat range containing this one is:\n //\n // <p>x</p>[<quote><p>y</p><h>first</h></quote><p>second</p>]<p>z</p>\n //\n // We can easily clone this structure, preserving e.g. the <quote> element.\n let flatSubtreeRange;\n if (range.start.parent == range.end.parent) {\n // The original range is flat, so take it.\n flatSubtreeRange = range;\n }\n else {\n flatSubtreeRange = writer.createRange(writer.createPositionAt(commonParent, range.start.path[commonPath.length]), writer.createPositionAt(commonParent, range.end.path[commonPath.length] + 1));\n }\n const howMany = flatSubtreeRange.end.offset - flatSubtreeRange.start.offset;\n // Clone the whole contents.\n for (const item of flatSubtreeRange.getItems({ shallow: true })) {\n if (item.is('$textProxy')) {\n writer.appendText(item.data, item.getAttributes(), frag);\n }\n else {\n writer.append(writer.cloneElement(item, true), frag);\n }\n }\n // ## 2nd step\n //\n // If the original range wasn't flat, then we need to remove the excess nodes from the both ends of the cloned fragment.\n //\n // For example, for the range shown in the 1st step comment, we need to remove these pieces:\n //\n // <quote>[<p>y</p>]<h>[fir]st</h></quote><p>se[cond]</p>\n //\n // So this will be the final copied content:\n //\n // <quote><h>st</h></quote><p>se</p>\n //\n // In order to do that, we remove content from these two ranges:\n //\n // [<quote><p>y</p><h>fir]st</h></quote><p>se[cond</p>]\n if (flatSubtreeRange != range) {\n // Find the position of the original range in the cloned fragment.\n const newRange = range._getTransformedByMove(flatSubtreeRange.start, writer.createPositionAt(frag, 0), howMany)[0];\n const leftExcessRange = writer.createRange(writer.createPositionAt(frag, 0), newRange.start);\n const rightExcessRange = writer.createRange(newRange.end, writer.createPositionAt(frag, 'end'));\n removeRangeContent(rightExcessRange, writer);\n removeRangeContent(leftExcessRange, writer);\n }\n return frag;\n });\n}\n// After https://github.com/ckeditor/ckeditor5-engine/issues/690 is fixed,\n// this function will, most likely, be able to rewritten using getMinimalFlatRanges().\nfunction removeRangeContent(range, writer) {\n const parentsToCheck = [];\n Array.from(range.getItems({ direction: 'backward' }))\n // We should better store ranges because text proxies will lose integrity\n // with the text nodes when we'll start removing content.\n .map(item => writer.createRangeOn(item))\n // Filter only these items which are fully contained in the passed range.\n //\n // E.g. for the following range: [<quote><p>y</p><h>fir]st</h>\n // the walker will return the entire <h> element, when only the \"fir\" item inside it is fully contained.\n .filter(itemRange => {\n // We should be able to use Range.containsRange, but https://github.com/ckeditor/ckeditor5-engine/issues/691.\n const contained = (itemRange.start.isAfter(range.start) || itemRange.start.isEqual(range.start)) &&\n (itemRange.end.isBefore(range.end) || itemRange.end.isEqual(range.end));\n return contained;\n })\n .forEach(itemRange => {\n parentsToCheck.push(itemRange.start.parent);\n writer.remove(itemRange);\n });\n // Remove ancestors of the removed items if they turned to be empty now\n // (their whole content was contained in the range).\n parentsToCheck.forEach(parentToCheck => {\n let parent = parentToCheck;\n while (parent.parent && parent.isEmpty) {\n const removeRange = writer.createRangeOn(parent);\n parent = parent.parent;\n writer.remove(removeRange);\n }\n });\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/utils/insertcontent\n */\nimport DocumentSelection from '../documentselection';\nimport Element from '../element';\nimport LivePosition from '../liveposition';\nimport LiveRange from '../liverange';\nimport Position from '../position';\nimport Range from '../range';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Inserts content into the editor (specified selection) as one would expect the paste functionality to work.\n *\n * It takes care of removing the selected content, splitting elements (if needed), inserting elements and merging elements appropriately.\n *\n * Some examples:\n *\n * ```html\n * <p>x^</p> + <p>y</p> => <p>x</p><p>y</p> => <p>xy[]</p>\n * <p>x^y</p> + <p>z</p> => <p>x</p>^<p>y</p> + <p>z</p> => <p>x</p><p>z</p><p>y</p> => <p>xz[]y</p>\n * <p>x^y</p> + <img /> => <p>x</p>^<p>y</p> + <img /> => <p>x</p><img /><p>y</p>\n * <p>x</p><p>^</p><p>z</p> + <p>y</p> => <p>x</p><p>y[]</p><p>z</p> (no merging)\n * <p>x</p>[<img />]<p>z</p> + <p>y</p> => <p>x</p>^<p>z</p> + <p>y</p> => <p>x</p><p>y[]</p><p>z</p>\n * ```\n *\n * If an instance of {@link module:engine/model/selection~Selection} is passed as `selectable` it will be modified\n * to the insertion selection (equal to a range to be selected after insertion).\n *\n * If `selectable` is not passed, the content will be inserted using the current selection of the model document.\n *\n * **Note:** Use {@link module:engine/model/model~Model#insertContent} instead of this function.\n * This function is only exposed to be reusable in algorithms which change the {@link module:engine/model/model~Model#insertContent}\n * method's behavior.\n *\n * @param model The model in context of which the insertion should be performed.\n * @param content The content to insert.\n * @param selectable Selection into which the content should be inserted.\n * @param placeOrOffset Sets place or offset of the selection.\n * @returns Range which contains all the performed changes. This is a range that, if removed,\n * would return the model to the state before the insertion. If no changes were preformed by `insertContent`, returns a range collapsed\n * at the insertion position.\n */\nexport default function insertContent(model, content, selectable) {\n return model.change(writer => {\n const selection = selectable ? selectable : model.document.selection;\n if (!selection.isCollapsed) {\n model.deleteContent(selection, { doNotAutoparagraph: true });\n }\n const insertion = new Insertion(model, writer, selection.anchor);\n const fakeMarkerElements = [];\n let nodesToInsert;\n if (content.is('documentFragment')) {\n // If document fragment has any markers, these markers should be inserted into the model as well.\n if (content.markers.size) {\n const markersPosition = [];\n for (const [name, range] of content.markers) {\n const { start, end } = range;\n const isCollapsed = start.isEqual(end);\n markersPosition.push({ position: start, name, isCollapsed }, { position: end, name, isCollapsed });\n }\n // Markers position is sorted backwards to ensure that the insertion of fake markers will not change\n // the position of the next markers.\n markersPosition.sort(({ position: posA }, { position: posB }) => posA.isBefore(posB) ? 1 : -1);\n for (const { position, name, isCollapsed } of markersPosition) {\n let fakeElement = null;\n let collapsed = null;\n const isAtBeginning = position.parent === content && position.isAtStart;\n const isAtEnd = position.parent === content && position.isAtEnd;\n // We have two ways of handling markers. In general, we want to add temporary <$marker> model elements to\n // represent marker boundaries. These elements will be inserted into content together with the rest\n // of the document fragment. After insertion is done, positions for these elements will be read\n // and proper, actual markers will be created in the model and fake elements will be removed.\n //\n // However, if the <$marker> element is at the beginning or at the end of the document fragment,\n // it may affect how the inserted content is merged with current model, impacting the insertion\n // result. To avoid that, we don't add <$marker> elements at these positions. Instead, we will use\n // `Insertion#getAffectedRange()` to figure out new positions for these marker boundaries.\n if (!isAtBeginning && !isAtEnd) {\n fakeElement = writer.createElement('$marker');\n writer.insert(fakeElement, position);\n }\n else if (isCollapsed) {\n // Save whether the collapsed marker was at the beginning or at the end of document fragment\n // to know where to create it after the insertion is done.\n collapsed = isAtBeginning ? 'start' : 'end';\n }\n fakeMarkerElements.push({\n name,\n element: fakeElement,\n collapsed\n });\n }\n }\n nodesToInsert = content.getChildren();\n }\n else {\n nodesToInsert = [content];\n }\n insertion.handleNodes(nodesToInsert);\n let newRange = insertion.getSelectionRange();\n if (content.is('documentFragment') && fakeMarkerElements.length) {\n // After insertion was done, the selection was set but the model contains fake <$marker> elements.\n // These <$marker> elements will be now removed. Because of that, we will need to fix the selection.\n // We will create a live range that will automatically be update as <$marker> elements are removed.\n const selectionLiveRange = newRange ? LiveRange.fromRange(newRange) : null;\n // Marker name -> [ start position, end position ].\n const markersData = {};\n // Note: `fakeMarkerElements` are sorted backwards. However, now, we want to handle the markers\n // from the beginning, so that existing <$marker> elements do not affect markers positions.\n // This is why we iterate from the end to the start.\n for (let i = fakeMarkerElements.length - 1; i >= 0; i--) {\n const { name, element, collapsed } = fakeMarkerElements[i];\n const isStartBoundary = !markersData[name];\n if (isStartBoundary) {\n markersData[name] = [];\n }\n if (element) {\n // Read fake marker element position to learn where the marker should be created.\n const elementPosition = writer.createPositionAt(element, 'before');\n markersData[name].push(elementPosition);\n writer.remove(element);\n }\n else {\n // If the fake marker element does not exist, it means that the marker boundary was at the beginning or at the end.\n const rangeOnInsertion = insertion.getAffectedRange();\n if (!rangeOnInsertion) {\n // If affected range is `null` it means that nothing was in the document fragment or all content was filtered out.\n // Some markers that were in the filtered content may be removed (partially or totally).\n // Let's handle only those markers that were at the beginning or at the end of the document fragment.\n if (collapsed) {\n markersData[name].push(insertion.position);\n }\n continue;\n }\n if (collapsed) {\n // If the marker was collapsed at the beginning or at the end of the document fragment,\n // put both boundaries at the beginning or at the end of inserted range (to keep the marker collapsed).\n markersData[name].push(rangeOnInsertion[collapsed]);\n }\n else {\n markersData[name].push(isStartBoundary ? rangeOnInsertion.start : rangeOnInsertion.end);\n }\n }\n }\n for (const [name, [start, end]] of Object.entries(markersData)) {\n // For now, we ignore markers if they are included in the filtered-out content.\n // In the future implementation we will improve that case to create markers that are not filtered out completely.\n if (start && end && start.root === end.root) {\n writer.addMarker(name, {\n usingOperation: true,\n affectsData: true,\n range: new Range(start, end)\n });\n }\n }\n if (selectionLiveRange) {\n newRange = selectionLiveRange.toRange();\n selectionLiveRange.detach();\n }\n }\n /* istanbul ignore else -- @preserve */\n if (newRange) {\n if (selection instanceof DocumentSelection) {\n writer.setSelection(newRange);\n }\n else {\n selection.setTo(newRange);\n }\n }\n else {\n // We are not testing else because it's a safe check for unpredictable edge cases:\n // an insertion without proper range to select.\n //\n // @if CK_DEBUG // console.warn( 'Cannot determine a proper selection range after insertion.' );\n }\n const affectedRange = insertion.getAffectedRange() || model.createRange(selection.anchor);\n insertion.destroy();\n return affectedRange;\n });\n}\n/**\n * Utility class for performing content insertion.\n */\nclass Insertion {\n constructor(model, writer, position) {\n /**\n * The reference to the first inserted node.\n */\n this._firstNode = null;\n /**\n * The reference to the last inserted node.\n */\n this._lastNode = null;\n /**\n * The reference to the last auto paragraph node.\n */\n this._lastAutoParagraph = null;\n /**\n * The array of nodes that should be cleaned of not allowed attributes.\n */\n this._filterAttributesOf = [];\n /**\n * Beginning of the affected range. See {@link module:engine/model/utils/insertcontent~Insertion#getAffectedRange}.\n */\n this._affectedStart = null;\n /**\n * End of the affected range. See {@link module:engine/model/utils/insertcontent~Insertion#getAffectedRange}.\n */\n this._affectedEnd = null;\n this._nodeToSelect = null;\n this.model = model;\n this.writer = writer;\n this.position = position;\n this.canMergeWith = new Set([this.position.parent]);\n this.schema = model.schema;\n this._documentFragment = writer.createDocumentFragment();\n this._documentFragmentPosition = writer.createPositionAt(this._documentFragment, 0);\n }\n /**\n * Handles insertion of a set of nodes.\n *\n * @param nodes Nodes to insert.\n */\n handleNodes(nodes) {\n for (const node of Array.from(nodes)) {\n this._handleNode(node);\n }\n // Insert nodes collected in temporary DocumentFragment.\n this._insertPartialFragment();\n // If there was an auto paragraph then we might need to adjust the end of insertion.\n if (this._lastAutoParagraph) {\n this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph);\n }\n // After the content was inserted we may try to merge it with its next sibling if the selection was in it initially.\n // Merging with the previous sibling was performed just after inserting the first node to the document.\n this._mergeOnRight();\n // TMP this will become a post-fixer.\n this.schema.removeDisallowedAttributes(this._filterAttributesOf, this.writer);\n this._filterAttributesOf = [];\n }\n /**\n * Updates the last node after the auto paragraphing.\n *\n * @param node The last auto paragraphing node.\n */\n _updateLastNodeFromAutoParagraph(node) {\n const positionAfterLastNode = this.writer.createPositionAfter(this._lastNode);\n const positionAfterNode = this.writer.createPositionAfter(node);\n // If the real end was after the last auto paragraph then update relevant properties.\n if (positionAfterNode.isAfter(positionAfterLastNode)) {\n this._lastNode = node;\n /* istanbul ignore if -- @preserve */\n if (this.position.parent != node || !this.position.isAtEnd) {\n // Algorithm's correctness check. We should never end up here but it's good to know that we did.\n // At this point the insertion position should be at the end of the last auto paragraph.\n // Note: This error is documented in other place in this file.\n throw new CKEditorError('insertcontent-invalid-insertion-position', this);\n }\n this.position = positionAfterNode;\n this._setAffectedBoundaries(this.position);\n }\n }\n /**\n * Returns range to be selected after insertion.\n * Returns `null` if there is no valid range to select after insertion.\n */\n getSelectionRange() {\n if (this._nodeToSelect) {\n return Range._createOn(this._nodeToSelect);\n }\n return this.model.schema.getNearestSelectionRange(this.position);\n }\n /**\n * Returns a range which contains all the performed changes. This is a range that, if removed, would return the model to the state\n * before the insertion. Returns `null` if no changes were done.\n */\n getAffectedRange() {\n if (!this._affectedStart) {\n return null;\n }\n return new Range(this._affectedStart, this._affectedEnd);\n }\n /**\n * Destroys `Insertion` instance.\n */\n destroy() {\n if (this._affectedStart) {\n this._affectedStart.detach();\n }\n if (this._affectedEnd) {\n this._affectedEnd.detach();\n }\n }\n /**\n * Handles insertion of a single node.\n */\n _handleNode(node) {\n // Let's handle object in a special way.\n // * They should never be merged with other elements.\n // * If they are not allowed in any of the selection ancestors, they could be either autoparagraphed or totally removed.\n if (this.schema.isObject(node)) {\n this._handleObject(node);\n return;\n }\n // Try to find a place for the given node.\n // Check if a node can be inserted in the given position or it would be accepted if a paragraph would be inserted.\n // Inserts the auto paragraph if it would allow for insertion.\n let isAllowed = this._checkAndAutoParagraphToAllowedPosition(node);\n if (!isAllowed) {\n // Split the position.parent's branch up to a point where the node can be inserted.\n // If it isn't allowed in the whole branch, then of course don't split anything.\n isAllowed = this._checkAndSplitToAllowedPosition(node);\n if (!isAllowed) {\n this._handleDisallowedNode(node);\n return;\n }\n }\n // Add node to the current temporary DocumentFragment.\n this._appendToFragment(node);\n // Store the first and last nodes for easy access for merging with sibling nodes.\n if (!this._firstNode) {\n this._firstNode = node;\n }\n this._lastNode = node;\n }\n /**\n * Inserts the temporary DocumentFragment into the model.\n */\n _insertPartialFragment() {\n if (this._documentFragment.isEmpty) {\n return;\n }\n const livePosition = LivePosition.fromPosition(this.position, 'toNext');\n this._setAffectedBoundaries(this.position);\n // If the very first node of the whole insertion process is inserted, insert it separately for OT reasons (undo).\n // Note: there can be multiple calls to `_insertPartialFragment()` during one insertion process.\n // Note: only the very first node can be merged so we have to do separate operation only for it.\n if (this._documentFragment.getChild(0) == this._firstNode) {\n this.writer.insert(this._firstNode, this.position);\n // We must merge the first node just after inserting it to avoid problems with OT.\n // (See: https://github.com/ckeditor/ckeditor5/pull/8773#issuecomment-760945652).\n this._mergeOnLeft();\n this.position = livePosition.toPosition();\n }\n // Insert the remaining nodes from document fragment.\n if (!this._documentFragment.isEmpty) {\n this.writer.insert(this._documentFragment, this.position);\n }\n this._documentFragmentPosition = this.writer.createPositionAt(this._documentFragment, 0);\n this.position = livePosition.toPosition();\n livePosition.detach();\n }\n /**\n * @param node The object element.\n */\n _handleObject(node) {\n // Try finding it a place in the tree.\n if (this._checkAndSplitToAllowedPosition(node)) {\n this._appendToFragment(node);\n }\n // Try autoparagraphing.\n else {\n this._tryAutoparagraphing(node);\n }\n }\n /**\n * @param node The disallowed node which needs to be handled.\n */\n _handleDisallowedNode(node) {\n // If the node is an element, try inserting its children (strip the parent).\n if (node.is('element')) {\n this.handleNodes(node.getChildren());\n }\n // If text is not allowed, try autoparagraphing it.\n else {\n this._tryAutoparagraphing(node);\n }\n }\n /**\n * Append a node to the temporary DocumentFragment.\n *\n * @param node The node to insert.\n */\n _appendToFragment(node) {\n /* istanbul ignore if -- @preserve */\n if (!this.schema.checkChild(this.position, node)) {\n // Algorithm's correctness check. We should never end up here but it's good to know that we did.\n // Note that it would often be a silent issue if we insert node in a place where it's not allowed.\n /**\n * Given node cannot be inserted on the given position.\n *\n * @error insertcontent-wrong-position\n * @param node Node to insert.\n * @param position Position to insert the node at.\n */\n throw new CKEditorError('insertcontent-wrong-position', this, { node, position: this.position });\n }\n this.writer.insert(node, this._documentFragmentPosition);\n this._documentFragmentPosition = this._documentFragmentPosition.getShiftedBy(node.offsetSize);\n // The last inserted object should be selected because we can't put a collapsed selection after it.\n if (this.schema.isObject(node) && !this.schema.checkChild(this.position, '$text')) {\n this._nodeToSelect = node;\n }\n else {\n this._nodeToSelect = null;\n }\n this._filterAttributesOf.push(node);\n }\n /**\n * Sets `_affectedStart` and `_affectedEnd` to the given `position`. Should be used before a change is done during insertion process to\n * mark the affected range.\n *\n * This method is used before inserting a node or splitting a parent node. `_affectedStart` and `_affectedEnd` are also changed\n * during merging, but the logic there is more complicated so it is left out of this function.\n */\n _setAffectedBoundaries(position) {\n // Set affected boundaries stickiness so that those position will \"expand\" when something is inserted in between them:\n // <paragraph>Foo][bar</paragraph> -> <paragraph>Foo]xx[bar</paragraph>\n // This is why it cannot be a range but two separate positions.\n if (!this._affectedStart) {\n this._affectedStart = LivePosition.fromPosition(position, 'toPrevious');\n }\n // If `_affectedEnd` is before the new boundary position, expand `_affectedEnd`. This can happen if first inserted node was\n // inserted into the parent but the next node is moved-out of that parent:\n // (1) <paragraph>Foo][</paragraph> -> <paragraph>Foo]xx[</paragraph>\n // (2) <paragraph>Foo]xx[</paragraph> -> <paragraph>Foo]xx</paragraph><widget></widget>[\n if (!this._affectedEnd || this._affectedEnd.isBefore(position)) {\n if (this._affectedEnd) {\n this._affectedEnd.detach();\n }\n this._affectedEnd = LivePosition.fromPosition(position, 'toNext');\n }\n }\n /**\n * Merges the previous sibling of the first node if it should be merged.\n *\n * After the content was inserted we may try to merge it with its siblings.\n * This should happen only if the selection was in those elements initially.\n */\n _mergeOnLeft() {\n const node = this._firstNode;\n if (!(node instanceof Element)) {\n return;\n }\n if (!this._canMergeLeft(node)) {\n return;\n }\n const mergePosLeft = LivePosition._createBefore(node);\n mergePosLeft.stickiness = 'toNext';\n const livePosition = LivePosition.fromPosition(this.position, 'toNext');\n // If `_affectedStart` is sames as merge position, it means that the element \"marked\" by `_affectedStart` is going to be\n // removed and its contents will be moved. This won't transform `LivePosition` so `_affectedStart` needs to be moved\n // by hand to properly reflect affected range. (Due to `_affectedStart` and `_affectedEnd` stickiness, the \"range\" is\n // shown as `][`).\n //\n // Example - insert `<paragraph>Abc</paragraph><paragraph>Xyz</paragraph>` at the end of `<paragraph>Foo^</paragraph>`:\n //\n // <paragraph>Foo</paragraph><paragraph>Bar</paragraph> -->\n // <paragraph>Foo</paragraph>]<paragraph>Abc</paragraph><paragraph>Xyz</paragraph>[<paragraph>Bar</paragraph> -->\n // <paragraph>Foo]Abc</paragraph><paragraph>Xyz</paragraph>[<paragraph>Bar</paragraph>\n //\n // Note, that if we are here then something must have been inserted, so `_affectedStart` and `_affectedEnd` have to be set.\n if (this._affectedStart.isEqual(mergePosLeft)) {\n this._affectedStart.detach();\n this._affectedStart = LivePosition._createAt(mergePosLeft.nodeBefore, 'end', 'toPrevious');\n }\n // We need to update the references to the first and last nodes if they will be merged into the previous sibling node\n // because the reference would point to the removed node.\n //\n // <p>A^A</p> + <p>X</p>\n //\n // <p>A</p>^<p>A</p>\n // <p>A</p><p>X</p><p>A</p>\n // <p>AX</p><p>A</p>\n // <p>AXA</p>\n if (this._firstNode === this._lastNode) {\n this._firstNode = mergePosLeft.nodeBefore;\n this._lastNode = mergePosLeft.nodeBefore;\n }\n this.writer.merge(mergePosLeft);\n // If only one element (the merged one) is in the \"affected range\", also move the affected range end appropriately.\n //\n // Example - insert `<paragraph>Abc</paragraph>` at the of `<paragraph>Foo^</paragraph>`:\n //\n // <paragraph>Foo</paragraph><paragraph>Bar</paragraph> -->\n // <paragraph>Foo</paragraph>]<paragraph>Abc</paragraph>[<paragraph>Bar</paragraph> -->\n // <paragraph>Foo]Abc</paragraph>[<paragraph>Bar</paragraph> -->\n // <paragraph>Foo]Abc[</paragraph><paragraph>Bar</paragraph>\n if (mergePosLeft.isEqual(this._affectedEnd) && this._firstNode === this._lastNode) {\n this._affectedEnd.detach();\n this._affectedEnd = LivePosition._createAt(mergePosLeft.nodeBefore, 'end', 'toNext');\n }\n this.position = livePosition.toPosition();\n livePosition.detach();\n // After merge elements that were marked by _insert() to be filtered might be gone so\n // we need to mark the new container.\n this._filterAttributesOf.push(this.position.parent);\n mergePosLeft.detach();\n }\n /**\n * Merges the next sibling of the last node if it should be merged.\n *\n * After the content was inserted we may try to merge it with its siblings.\n * This should happen only if the selection was in those elements initially.\n */\n _mergeOnRight() {\n const node = this._lastNode;\n if (!(node instanceof Element)) {\n return;\n }\n if (!this._canMergeRight(node)) {\n return;\n }\n const mergePosRight = LivePosition._createAfter(node);\n mergePosRight.stickiness = 'toNext';\n /* istanbul ignore if -- @preserve */\n if (!this.position.isEqual(mergePosRight)) {\n // Algorithm's correctness check. We should never end up here but it's good to know that we did.\n // At this point the insertion position should be after the node we'll merge. If it isn't,\n // it should need to be secured as in the left merge case.\n /**\n * An internal error occurred when merging inserted content with its siblings.\n * The insertion position should equal the merge position.\n *\n * If you encountered this error, report it back to the CKEditor 5 team\n * with as many details as possible regarding the content being inserted and the insertion position.\n *\n * @error insertcontent-invalid-insertion-position\n */\n throw new CKEditorError('insertcontent-invalid-insertion-position', this);\n }\n // Move the position to the previous node, so it isn't moved to the graveyard on merge.\n // <p>x</p>[]<p>y</p> => <p>x[]</p><p>y</p>\n this.position = Position._createAt(mergePosRight.nodeBefore, 'end');\n // Explanation of setting position stickiness to `'toPrevious'`:\n // OK: <p>xx[]</p> + <p>yy</p> => <p>xx[]yy</p> (when sticks to previous)\n // NOK: <p>xx[]</p> + <p>yy</p> => <p>xxyy[]</p> (when sticks to next)\n const livePosition = LivePosition.fromPosition(this.position, 'toPrevious');\n // See comment in `_mergeOnLeft()` on moving `_affectedStart`.\n if (this._affectedEnd.isEqual(mergePosRight)) {\n this._affectedEnd.detach();\n this._affectedEnd = LivePosition._createAt(mergePosRight.nodeBefore, 'end', 'toNext');\n }\n // We need to update the references to the first and last nodes if they will be merged into the previous sibling node\n // because the reference would point to the removed node.\n //\n // <p>A^A</p> + <p>X</p>\n //\n // <p>A</p>^<p>A</p>\n // <p>A</p><p>X</p><p>A</p>\n // <p>AX</p><p>A</p>\n // <p>AXA</p>\n if (this._firstNode === this._lastNode) {\n this._firstNode = mergePosRight.nodeBefore;\n this._lastNode = mergePosRight.nodeBefore;\n }\n this.writer.merge(mergePosRight);\n // See comment in `_mergeOnLeft()` on moving `_affectedStart`.\n if (mergePosRight.getShiftedBy(-1).isEqual(this._affectedStart) && this._firstNode === this._lastNode) {\n this._affectedStart.detach();\n this._affectedStart = LivePosition._createAt(mergePosRight.nodeBefore, 0, 'toPrevious');\n }\n this.position = livePosition.toPosition();\n livePosition.detach();\n // After merge elements that were marked by _insert() to be filtered might be gone so\n // we need to mark the new container.\n this._filterAttributesOf.push(this.position.parent);\n mergePosRight.detach();\n }\n /**\n * Checks whether specified node can be merged with previous sibling element.\n *\n * @param node The node which could potentially be merged.\n */\n _canMergeLeft(node) {\n const previousSibling = node.previousSibling;\n return (previousSibling instanceof Element) &&\n this.canMergeWith.has(previousSibling) &&\n this.model.schema.checkMerge(previousSibling, node);\n }\n /**\n * Checks whether specified node can be merged with next sibling element.\n *\n * @param node The node which could potentially be merged.\n */\n _canMergeRight(node) {\n const nextSibling = node.nextSibling;\n return (nextSibling instanceof Element) &&\n this.canMergeWith.has(nextSibling) &&\n this.model.schema.checkMerge(node, nextSibling);\n }\n /**\n * Tries wrapping the node in a new paragraph and inserting it this way.\n *\n * @param node The node which needs to be autoparagraphed.\n */\n _tryAutoparagraphing(node) {\n const paragraph = this.writer.createElement('paragraph');\n // Do not autoparagraph if the paragraph won't be allowed there,\n // cause that would lead to an infinite loop. The paragraph would be rejected in\n // the next _handleNode() call and we'd be here again.\n if (this._getAllowedIn(this.position.parent, paragraph) && this.schema.checkChild(paragraph, node)) {\n paragraph._appendChild(node);\n this._handleNode(paragraph);\n }\n }\n /**\n * Checks if a node can be inserted in the given position or it would be accepted if a paragraph would be inserted.\n * It also handles inserting the paragraph.\n *\n * @returns Whether an allowed position was found.\n * `false` is returned if the node isn't allowed at the current position or in auto paragraph, `true` if was.\n */\n _checkAndAutoParagraphToAllowedPosition(node) {\n if (this.schema.checkChild(this.position.parent, node)) {\n return true;\n }\n // Do not auto paragraph if the paragraph won't be allowed there,\n // cause that would lead to an infinite loop. The paragraph would be rejected in\n // the next _handleNode() call and we'd be here again.\n if (!this.schema.checkChild(this.position.parent, 'paragraph') || !this.schema.checkChild('paragraph', node)) {\n return false;\n }\n // Insert nodes collected in temporary DocumentFragment if the position parent needs change to process further nodes.\n this._insertPartialFragment();\n // Insert a paragraph and move insertion position to it.\n const paragraph = this.writer.createElement('paragraph');\n this.writer.insert(paragraph, this.position);\n this._setAffectedBoundaries(this.position);\n this._lastAutoParagraph = paragraph;\n this.position = this.writer.createPositionAt(paragraph, 0);\n return true;\n }\n /**\n * @returns Whether an allowed position was found.\n * `false` is returned if the node isn't allowed at any position up in the tree, `true` if was.\n */\n _checkAndSplitToAllowedPosition(node) {\n const allowedIn = this._getAllowedIn(this.position.parent, node);\n if (!allowedIn) {\n return false;\n }\n // Insert nodes collected in temporary DocumentFragment if the position parent needs change to process further nodes.\n if (allowedIn != this.position.parent) {\n this._insertPartialFragment();\n }\n while (allowedIn != this.position.parent) {\n if (this.position.isAtStart) {\n // If insertion position is at the beginning of the parent, move it out instead of splitting.\n // <p>^Foo</p> -> ^<p>Foo</p>\n const parent = this.position.parent;\n this.position = this.writer.createPositionBefore(parent);\n // Special case parent is empty (<p>^</p>).\n //\n // 1. parent.isEmpty\n // We can remove the element after moving insertion position out of it.\n //\n // 2. parent.parent === allowedIn\n // However parent should remain in place when allowed element is above limit element in document tree.\n // For example there shouldn't be allowed to remove empty paragraph from tableCell, when is pasted\n // content allowed in $root.\n if (parent.isEmpty && parent.parent === allowedIn) {\n this.writer.remove(parent);\n }\n }\n else if (this.position.isAtEnd) {\n // If insertion position is at the end of the parent, move it out instead of splitting.\n // <p>Foo^</p> -> <p>Foo</p>^\n this.position = this.writer.createPositionAfter(this.position.parent);\n }\n else {\n const tempPos = this.writer.createPositionAfter(this.position.parent);\n this._setAffectedBoundaries(this.position);\n this.writer.split(this.position);\n this.position = tempPos;\n this.canMergeWith.add(this.position.nodeAfter);\n }\n }\n return true;\n }\n /**\n * Gets the element in which the given node is allowed. It checks the passed element and all its ancestors.\n *\n * @param contextElement The element in which context the node should be checked.\n * @param childNode The node to check.\n */\n _getAllowedIn(contextElement, childNode) {\n if (this.schema.checkChild(contextElement, childNode)) {\n return contextElement;\n }\n // If the child wasn't allowed in the context element and the element is a limit there's no point in\n // checking any further towards the root. This is it: the limit is unsplittable and there's nothing\n // we can do about it. Without this check, the algorithm will analyze parent of the limit and may create\n // an illusion of the child being allowed. There's no way to insert it down there, though. It results in\n // infinite loops.\n if (this.schema.isLimit(contextElement)) {\n return null;\n }\n return this._getAllowedIn(contextElement.parent, childNode);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/utils/findoptimalinsertionrange\n */\nimport { first } from '@ckeditor/ckeditor5-utils';\n/**\n * Returns a model range which is optimal (in terms of UX) for inserting a widget block.\n *\n * For instance, if a selection is in the middle of a paragraph, the collapsed range before this paragraph\n * will be returned so that it is not split. If the selection is at the end of a paragraph,\n * the collapsed range after this paragraph will be returned.\n *\n * Note: If the selection is placed in an empty block, the range in that block will be returned. If that range\n * is then passed to {@link module:engine/model/model~Model#insertContent}, the block will be fully replaced\n * by the inserted widget block.\n *\n * **Note:** Use {@link module:widget/utils#findOptimalInsertionRange} instead of this function outside engine.\n * This function is only exposed to be used by {@link module:widget/utils#findOptimalInsertionRange findOptimalInsertionRange()}\n * in the `widget` package and inside the `engine` package.\n *\n * @param selection The selection based on which the insertion position should be calculated.\n * @param model Model instance.\n * @param place The place where to look for optimal insertion range.\n * The default `auto` value will determine itself the best position for insertion.\n * The `before` value will try to find a position before selection.\n * The `after` value will try to find a position after selection.\n * @returns The optimal range.\n */\nexport function findOptimalInsertionRange(selection, model, place = 'auto') {\n const selectedElement = selection.getSelectedElement();\n if (selectedElement && model.schema.isObject(selectedElement) && !model.schema.isInline(selectedElement)) {\n if (place == 'before' || place == 'after') {\n return model.createRange(model.createPositionAt(selectedElement, place));\n }\n return model.createRangeOn(selectedElement);\n }\n const firstBlock = first(selection.getSelectedBlocks());\n // There are no block elements within ancestors (in the current limit element).\n if (!firstBlock) {\n return model.createRange(selection.focus);\n }\n // If inserting into an empty block return position in that block. It will get\n // replaced with the image by insertContent(). #42.\n if (firstBlock.isEmpty) {\n return model.createRange(model.createPositionAt(firstBlock, 0));\n }\n const positionAfter = model.createPositionAfter(firstBlock);\n // If selection is at the end of the block - return position after the block.\n if (selection.focus.isTouching(positionAfter)) {\n return model.createRange(positionAfter);\n }\n // Otherwise, return position before the block.\n return model.createRange(model.createPositionBefore(firstBlock));\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/utils/insertobject\n */\nimport { findOptimalInsertionRange } from './findoptimalinsertionrange';\nimport { CKEditorError, first } from '@ckeditor/ckeditor5-utils';\n/**\n * Inserts an {@glink framework/deep-dive/schema#object-elements object element} at a specific position in the editor content.\n *\n * **Note:** Use {@link module:engine/model/model~Model#insertObject} instead of this function.\n * This function is only exposed to be reusable in algorithms which change the {@link module:engine/model/model~Model#insertObject}\n * method's behavior.\n *\n * **Note**: For more documentation and examples, see {@link module:engine/model/model~Model#insertObject}.\n *\n * @param model The model in context of which the insertion should be performed.\n * @param object An object to be inserted into the model document.\n * @param selectable A selectable where the content should be inserted. If not specified, the current\n * {@link module:engine/model/document~Document#selection document selection} will be used instead.\n * @param placeOrOffset Specifies the exact place or offset for the insertion to take place, relative to `selectable`.\n * @param options Additional options.\n * @param options.findOptimalPosition An option that, when set, adjusts the insertion position (relative to\n * `selectable` and `placeOrOffset`) so that the content of `selectable` is not split upon insertion (a.k.a. non-destructive insertion).\n * * When `'auto'`, the algorithm will decide whether to insert the object before or after `selectable` to avoid content splitting.\n * * When `'before'`, the closest position before `selectable` will be used that will not result in content splitting.\n * * When `'after'`, the closest position after `selectable` will be used that will not result in content splitting.\n *\n * Note that this option works only for block objects. Inline objects are inserted into text and do not split blocks.\n * @param options.setSelection An option that, when set, moves the\n * {@link module:engine/model/document~Document#selection document selection} after inserting the object.\n * * When `'on'`, the document selection will be set on the inserted object.\n * * When `'after'`, the document selection will move to the closest text node after the inserted object. If there is no\n * such text node, a paragraph will be created and the document selection will be moved inside it.\n * @returns A range which contains all the performed changes. This is a range that, if removed,\n * would return the model to the state before the insertion. If no changes were preformed by `insertObject()`, returns a range collapsed\n * at the insertion position.\n */\nexport default function insertObject(model, object, selectable, options = {}) {\n if (!model.schema.isObject(object)) {\n /**\n * Tried to insert an element with {@link module:engine/model/utils/insertobject insertObject()} function\n * that is not defined as an object in schema.\n * See {@link module:engine/model/schema~SchemaItemDefinition#isObject `SchemaItemDefinition`}.\n * If you want to insert content that is not an object you might want to use\n * {@link module:engine/model/utils/insertcontent insertContent()} function.\n * @error insertobject-element-not-an-object\n */\n throw new CKEditorError('insertobject-element-not-an-object', model, { object });\n }\n // Normalize selectable to a selection instance.\n const originalSelection = selectable ? selectable : model.document.selection;\n // Adjust the insertion selection.\n let insertionSelection = originalSelection;\n if (options.findOptimalPosition && model.schema.isBlock(object)) {\n insertionSelection = model.createSelection(findOptimalInsertionRange(originalSelection, model, options.findOptimalPosition));\n }\n // Collect attributes to be copied on the inserted object.\n const firstSelectedBlock = first(originalSelection.getSelectedBlocks());\n const attributesToCopy = {};\n if (firstSelectedBlock) {\n Object.assign(attributesToCopy, model.schema.getAttributesWithProperty(firstSelectedBlock, 'copyOnReplace', true));\n }\n return model.change(writer => {\n // Remove the selected content to find out what the parent of the inserted object would be.\n // It would be removed inside model.insertContent() anyway.\n if (!insertionSelection.isCollapsed) {\n model.deleteContent(insertionSelection, { doNotAutoparagraph: true });\n }\n let elementToInsert = object;\n const insertionPositionParent = insertionSelection.anchor.parent;\n // Autoparagraphing of an inline objects.\n if (!model.schema.checkChild(insertionPositionParent, object) &&\n model.schema.checkChild(insertionPositionParent, 'paragraph') &&\n model.schema.checkChild('paragraph', object)) {\n elementToInsert = writer.createElement('paragraph');\n writer.insert(object, elementToInsert);\n }\n // Apply attributes that are allowed on the inserted object (or paragraph if autoparagraphed).\n model.schema.setAllowedAttributes(elementToInsert, attributesToCopy, writer);\n // Insert the prepared content at the optionally adjusted selection.\n const affectedRange = model.insertContent(elementToInsert, insertionSelection);\n // Nothing got inserted.\n if (affectedRange.isCollapsed) {\n return affectedRange;\n }\n if (options.setSelection) {\n updateSelection(writer, object, options.setSelection, attributesToCopy);\n }\n return affectedRange;\n });\n}\n/**\n * Updates document selection based on given `place` parameter in relation to `contextElement` element.\n *\n * @param writer An instance of the model writer.\n * @param contextElement An element to set the attributes on.\n * @param place The place where selection should be set in relation to the `contextElement` element.\n * Value `on` will set selection on the passed `contextElement`. Value `after` will set selection after `contextElement`.\n * @param attributes Attributes keys and values to set on a paragraph that this function can create when\n * `place` parameter is equal to `after` but there is no element with `$text` node to set selection in.\n */\nfunction updateSelection(writer, contextElement, place, paragraphAttributes) {\n const model = writer.model;\n if (place == 'on') {\n writer.setSelection(contextElement, 'on');\n return;\n }\n if (place != 'after') {\n /**\n * The unsupported `options.setSelection` parameter was passed\n * to the {@link module:engine/model/utils/insertobject insertObject()} function.\n * Check the {@link module:engine/model/utils/insertobject insertObject()} API documentation for allowed\n * `options.setSelection` parameter values.\n *\n * @error insertobject-invalid-place-parameter-value\n */\n throw new CKEditorError('insertobject-invalid-place-parameter-value', model);\n }\n let nextElement = contextElement.nextSibling;\n if (model.schema.isInline(contextElement)) {\n writer.setSelection(contextElement, 'after');\n return;\n }\n // Check whether an element next to the inserted element is defined and can contain a text.\n const canSetSelection = nextElement && model.schema.checkChild(nextElement, '$text');\n // If the element is missing, but a paragraph could be inserted next to the element, let's add it.\n if (!canSetSelection && model.schema.checkChild(contextElement.parent, 'paragraph')) {\n nextElement = writer.createElement('paragraph');\n model.schema.setAllowedAttributes(nextElement, paragraphAttributes, writer);\n model.insertContent(nextElement, writer.createPositionAfter(contextElement));\n }\n // Put the selection inside the element, at the beginning.\n if (nextElement) {\n writer.setSelection(nextElement, 0);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/utils/modifyselection\n */\nimport DocumentSelection from '../documentselection';\nimport Position from '../position';\nimport Range from '../range';\nimport TreeWalker from '../treewalker';\nimport { isInsideSurrogatePair, isInsideCombinedSymbol, isInsideEmojiSequence } from '@ckeditor/ckeditor5-utils';\nconst wordBoundaryCharacters = ' ,.?!:;\"-()';\n/**\n * Modifies the selection. Currently, the supported modifications are:\n *\n * * Extending. The selection focus is moved in the specified `options.direction` with a step specified in `options.unit`.\n * Possible values for `unit` are:\n * * `'character'` (default) - moves selection by one user-perceived character. In most cases this means moving by one\n * character in `String` sense. However, unicode also defines \"combing marks\". These are special symbols, that combines\n * with a symbol before it (\"base character\") to create one user-perceived character. For example, `q̣̇` is a normal\n * letter `q` with two \"combining marks\": upper dot (`Ux0307`) and lower dot (`Ux0323`). For most actions, i.e. extending\n * selection by one position, it is correct to include both \"base character\" and all of it's \"combining marks\". That is\n * why `'character'` value is most natural and common method of modifying selection.\n * * `'codePoint'` - moves selection by one unicode code point. In contrary to, `'character'` unit, this will insert\n * selection between \"base character\" and \"combining mark\", because \"combining marks\" have their own unicode code points.\n * However, for technical reasons, unicode code points with values above `UxFFFF` are represented in native `String` by\n * two characters, called \"surrogate pairs\". Halves of \"surrogate pairs\" have a meaning only when placed next to each other.\n * For example `𨭎` is represented in `String` by `\\uD862\\uDF4E`. Both `\\uD862` and `\\uDF4E` do not have any meaning\n * outside the pair (are rendered as ? when alone). Position between them would be incorrect. In this case, selection\n * extension will include whole \"surrogate pair\".\n * * `'word'` - moves selection by a whole word.\n *\n * **Note:** if you extend a forward selection in a backward direction you will in fact shrink it.\n *\n * **Note:** Use {@link module:engine/model/model~Model#modifySelection} instead of this function.\n * This function is only exposed to be reusable in algorithms\n * which change the {@link module:engine/model/model~Model#modifySelection}\n * method's behavior.\n *\n * @param model The model in context of which the selection modification should be performed.\n * @param selection The selection to modify.\n * @param options.direction The direction in which the selection should be modified. Default 'forward'.\n * @param options.unit The unit by which selection should be modified. Default 'character'.\n * @param options.treatEmojiAsSingleUnit Whether multi-characer emoji sequences should be handled as single unit.\n */\nexport default function modifySelection(model, selection, options = {}) {\n const schema = model.schema;\n const isForward = options.direction != 'backward';\n const unit = options.unit ? options.unit : 'character';\n const treatEmojiAsSingleUnit = !!options.treatEmojiAsSingleUnit;\n const focus = selection.focus;\n const walker = new TreeWalker({\n boundaries: getSearchRange(focus, isForward),\n singleCharacters: true,\n direction: isForward ? 'forward' : 'backward'\n });\n const data = { walker, schema, isForward, unit, treatEmojiAsSingleUnit };\n let next;\n while ((next = walker.next())) {\n if (next.done) {\n return;\n }\n const position = tryExtendingTo(data, next.value);\n if (position) {\n if (selection instanceof DocumentSelection) {\n model.change(writer => {\n writer.setSelectionFocus(position);\n });\n }\n else {\n selection.setFocus(position);\n }\n return;\n }\n }\n}\n/**\n * Checks whether the selection can be extended to the the walker's next value (next position).\n */\nfunction tryExtendingTo(data, value) {\n const { isForward, walker, unit, schema, treatEmojiAsSingleUnit } = data;\n const { type, item, nextPosition } = value;\n // If found text, we can certainly put the focus in it. Let's just find a correct position\n // based on the unit.\n if (type == 'text') {\n if (data.unit === 'word') {\n return getCorrectWordBreakPosition(walker, isForward);\n }\n return getCorrectPosition(walker, unit, treatEmojiAsSingleUnit);\n }\n // Entering an element.\n if (type == (isForward ? 'elementStart' : 'elementEnd')) {\n // If it's a selectable, we can select it now.\n if (schema.isSelectable(item)) {\n return Position._createAt(item, isForward ? 'after' : 'before');\n }\n // If text allowed on this position, extend to this place.\n if (schema.checkChild(nextPosition, '$text')) {\n return nextPosition;\n }\n }\n // Leaving an element.\n else {\n // If leaving a limit element, stop.\n if (schema.isLimit(item)) {\n // NOTE: Fast-forward the walker until the end.\n walker.skip(() => true);\n return;\n }\n // If text allowed on this position, extend to this place.\n if (schema.checkChild(nextPosition, '$text')) {\n return nextPosition;\n }\n }\n}\n/**\n * Finds a correct position by walking in a text node and checking whether selection can be extended to given position\n * or should be extended further.\n */\nfunction getCorrectPosition(walker, unit, treatEmojiAsSingleUnit) {\n const textNode = walker.position.textNode;\n if (textNode) {\n const data = textNode.data;\n let offset = walker.position.offset - textNode.startOffset;\n while (isInsideSurrogatePair(data, offset) ||\n (unit == 'character' && isInsideCombinedSymbol(data, offset)) ||\n (treatEmojiAsSingleUnit && isInsideEmojiSequence(data, offset))) {\n walker.next();\n offset = walker.position.offset - textNode.startOffset;\n }\n }\n return walker.position;\n}\n/**\n * Finds a correct position of a word break by walking in a text node and checking whether selection can be extended to given position\n * or should be extended further.\n */\nfunction getCorrectWordBreakPosition(walker, isForward) {\n let textNode = walker.position.textNode;\n if (!textNode) {\n textNode = isForward ? walker.position.nodeAfter : walker.position.nodeBefore;\n }\n while (textNode && textNode.is('$text')) {\n const offset = walker.position.offset - textNode.startOffset;\n // Check of adjacent text nodes with different attributes (like BOLD).\n // Example : 'foofoo []bar<$text bold=\"true\">bar</$text> bazbaz'\n // should expand to : 'foofoo [bar<$text bold=\"true\">bar</$text>] bazbaz'.\n if (isAtNodeBoundary(textNode, offset, isForward)) {\n textNode = isForward ? walker.position.nodeAfter : walker.position.nodeBefore;\n }\n // Check if this is a word boundary.\n else if (isAtWordBoundary(textNode.data, offset, isForward)) {\n break;\n }\n // Maybe one more character.\n else {\n walker.next();\n }\n }\n return walker.position;\n}\nfunction getSearchRange(start, isForward) {\n const root = start.root;\n const searchEnd = Position._createAt(root, isForward ? 'end' : 0);\n if (isForward) {\n return new Range(start, searchEnd);\n }\n else {\n return new Range(searchEnd, start);\n }\n}\n/**\n * Checks if selection is on word boundary.\n */\nfunction isAtWordBoundary(data, offset, isForward) {\n // The offset to check depends on direction.\n const offsetToCheck = offset + (isForward ? 0 : -1);\n return wordBoundaryCharacters.includes(data.charAt(offsetToCheck));\n}\n/**\n * Checks if selection is on node boundary.\n */\nfunction isAtNodeBoundary(textNode, offset, isForward) {\n return offset === (isForward ? textNode.offsetSize : 0);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/model/model\n */\nimport Batch from './batch';\nimport Document from './document';\nimport MarkerCollection from './markercollection';\nimport ModelPosition from './position';\nimport ModelRange from './range';\nimport ModelSelection from './selection';\nimport OperationFactory from './operation/operationfactory';\nimport DocumentSelection from './documentselection';\nimport Schema from './schema';\nimport Writer from './writer';\nimport Node from './node';\nimport { autoParagraphEmptyRoots } from './utils/autoparagraphing';\nimport { injectSelectionPostFixer } from './utils/selection-post-fixer';\nimport deleteContent from './utils/deletecontent';\nimport getSelectedContent from './utils/getselectedcontent';\nimport insertContent from './utils/insertcontent';\nimport insertObject from './utils/insertobject';\nimport modifySelection from './utils/modifyselection';\nimport { CKEditorError, ObservableMixin } from '@ckeditor/ckeditor5-utils';\n// @if CK_DEBUG_ENGINE // const { dumpTrees, initDocumentDumping } = require( '../dev-utils/utils' );\n// @if CK_DEBUG_ENGINE // const { OperationReplayer } = require( '../dev-utils/operationreplayer' ).default;\n/**\n * Editor's data model. Read about the model in the\n * {@glink framework/architecture/editing-engine engine architecture} guide.\n */\nexport default class Model extends ObservableMixin() {\n // @if CK_DEBUG_ENGINE // private _operationLogs: Array<string>;\n // @if CK_DEBUG_ENGINE // private _appliedOperations: Array<Operation>;\n constructor() {\n super();\n this.markers = new MarkerCollection();\n this.document = new Document(this);\n this.schema = new Schema();\n this._pendingChanges = [];\n this._currentWriter = null;\n ['deleteContent', 'modifySelection', 'getSelectedContent', 'applyOperation']\n .forEach(methodName => this.decorate(methodName));\n // Adding operation validation with `highest` priority, so it is called before any other feature would like\n // to do anything with the operation. If the operation has incorrect parameters it should throw on the earliest occasion.\n this.on('applyOperation', (evt, args) => {\n const operation = args[0];\n operation._validate();\n }, { priority: 'highest' });\n // Register some default abstract entities.\n this.schema.register('$root', {\n isLimit: true\n });\n this.schema.register('$container', {\n allowIn: ['$root', '$container']\n });\n this.schema.register('$block', {\n allowIn: ['$root', '$container'],\n isBlock: true\n });\n this.schema.register('$blockObject', {\n allowWhere: '$block',\n isBlock: true,\n isObject: true\n });\n this.schema.register('$inlineObject', {\n allowWhere: '$text',\n allowAttributesOf: '$text',\n isInline: true,\n isObject: true\n });\n this.schema.register('$text', {\n allowIn: '$block',\n isInline: true,\n isContent: true\n });\n this.schema.register('$clipboardHolder', {\n allowContentOf: '$root',\n allowChildren: '$text',\n isLimit: true\n });\n this.schema.register('$documentFragment', {\n allowContentOf: '$root',\n allowChildren: '$text',\n isLimit: true\n });\n // An element needed by the `upcastElementToMarker` converter.\n // This element temporarily represents a marker boundary during the conversion process and is removed\n // at the end of the conversion. `UpcastDispatcher` or at least `Conversion` class looks like a\n // better place for this registration but both know nothing about `Schema`.\n this.schema.register('$marker');\n this.schema.addChildCheck((context, childDefinition) => {\n if (childDefinition.name === '$marker') {\n return true;\n }\n });\n injectSelectionPostFixer(this);\n // Post-fixer which takes care of adding empty paragraph elements to the empty roots.\n this.document.registerPostFixer(autoParagraphEmptyRoots);\n // The base implementation for \"decorated\" method with remapped arguments.\n this.on('insertContent', (evt, [content, selectable]) => {\n evt.return = insertContent(this, content, selectable);\n });\n // The base implementation for \"decorated\" method with remapped arguments.\n this.on('insertObject', (evt, [element, selection, options]) => {\n evt.return = insertObject(this, element, selection, options);\n });\n // The base implementation for \"decorated\" method with remapped arguments.\n this.on('canEditAt', evt => {\n const canEditAt = !this.document.isReadOnly;\n evt.return = canEditAt;\n if (!canEditAt) {\n // Prevent further processing if the selection is at non-editable place.\n evt.stop();\n }\n });\n // @if CK_DEBUG_ENGINE // initDocumentDumping( this.document );\n // @if CK_DEBUG_ENGINE // this.on( 'applyOperation', () => {\n // @if CK_DEBUG_ENGINE // \tdumpTrees( this.document, this.document.version );\n // @if CK_DEBUG_ENGINE // }, { priority: 'lowest' } );\n // @if CK_DEBUG_ENGINE // this._operationLogs = [];\n // @if CK_DEBUG_ENGINE // this._appliedOperations = [];\n }\n /**\n * The `change()` method is the primary way of changing the model. You should use it to modify all document nodes\n * (including detached nodes i.e. nodes not added to the {@link module:engine/model/model~Model#document model document}),\n * the {@link module:engine/model/document~Document#selection document's selection}, and\n * {@link module:engine/model/model~Model#markers model markers}.\n *\n * ```ts\n * model.change( writer => {\n * \twriter.insertText( 'foo', paragraph, 'end' );\n * } );\n * ```\n *\n * All changes inside the change block use the same {@link module:engine/model/batch~Batch} so they are combined\n * into a single undo step.\n *\n * ```ts\n * model.change( writer => {\n * \twriter.insertText( 'foo', paragraph, 'end' ); // foo.\n *\n * \tmodel.change( writer => {\n * \t\twriter.insertText( 'bar', paragraph, 'end' ); // foobar.\n * \t} );\n *\n * \twriter.insertText( 'bom', paragraph, 'end' ); // foobarbom.\n * } );\n * ```\n *\n * The callback of the `change()` block is executed synchronously.\n *\n * You can also return a value from the change block.\n *\n * ```ts\n * const img = model.change( writer => {\n * \treturn writer.createElement( 'img' );\n * } );\n * ```\n *\n * @see #enqueueChange\n * @typeParam TReturn The return type of the provided callback.\n * @param callback Callback function which may modify the model.\n */\n change(callback) {\n try {\n if (this._pendingChanges.length === 0) {\n // If this is the outermost block, create a new batch and start `_runPendingChanges` execution flow.\n this._pendingChanges.push({ batch: new Batch(), callback });\n return this._runPendingChanges()[0];\n }\n else {\n // If this is not the outermost block, just execute the callback.\n return callback(this._currentWriter);\n }\n }\n catch (err) {\n // @if CK_DEBUG // throw err;\n /* istanbul ignore next -- @preserve */\n CKEditorError.rethrowUnexpectedError(err, this);\n }\n }\n enqueueChange(batchOrType, callback) {\n try {\n if (!batchOrType) {\n batchOrType = new Batch();\n }\n else if (typeof batchOrType === 'function') {\n callback = batchOrType;\n batchOrType = new Batch();\n }\n else if (!(batchOrType instanceof Batch)) {\n batchOrType = new Batch(batchOrType);\n }\n this._pendingChanges.push({ batch: batchOrType, callback });\n if (this._pendingChanges.length == 1) {\n this._runPendingChanges();\n }\n }\n catch (err) {\n // @if CK_DEBUG // throw err;\n /* istanbul ignore next -- @preserve */\n CKEditorError.rethrowUnexpectedError(err, this);\n }\n }\n /**\n * {@link module:utils/observablemixin~Observable#decorate Decorated} function for applying\n * {@link module:engine/model/operation/operation~Operation operations} to the model.\n *\n * This is a low-level way of changing the model. It is exposed for very specific use cases (like the undo feature).\n * Normally, to modify the model, you will want to use {@link module:engine/model/writer~Writer `Writer`}.\n * See also {@glink framework/architecture/editing-engine#changing-the-model Changing the model} section\n * of the {@glink framework/architecture/editing-engine Editing architecture} guide.\n *\n * @param operation The operation to apply.\n */\n applyOperation(operation) {\n // @if CK_DEBUG_ENGINE // console.log( 'Applying ' + operation );\n // @if CK_DEBUG_ENGINE // this._operationLogs.push( JSON.stringify( operation ) );\n // @if CK_DEBUG_ENGINE // this._appliedOperations.push( operation );\n operation._execute();\n }\n // @if CK_DEBUG_ENGINE // public getAppliedOperation(): string {\n // @if CK_DEBUG_ENGINE // \tif ( !this._appliedOperations ) {\n // @if CK_DEBUG_ENGINE // \t\treturn '';\n // @if CK_DEBUG_ENGINE // \t}\n // @if CK_DEBUG_ENGINE // \treturn this._appliedOperations.map( operation => JSON.stringify( operation ) ).join( '-------' );\n // @if CK_DEBUG_ENGINE // }\n // @if CK_DEBUG_ENGINE // public createReplayer( stringifiedOperations: string ): typeof OperationReplayer {\n // @if CK_DEBUG_ENGINE // \treturn new OperationReplayer( this, '-------', stringifiedOperations );\n // @if CK_DEBUG_ENGINE // }\n /**\n * Inserts content at the position in the editor specified by the selection, as one would expect the paste\n * functionality to work.\n *\n * **Note**: If you want to insert an {@glink framework/deep-dive/schema#object-elements object element}\n * (e.g. a {@link module:widget/utils~toWidget widget}), see {@link #insertObject} instead.\n *\n * This is a high-level method. It takes the {@link #schema schema} into consideration when inserting\n * the content, clears the given selection's content before inserting nodes and moves the selection\n * to its target position at the end of the process.\n * It can split elements, merge them, wrap bare text nodes with paragraphs, etc. &mdash; just like the\n * pasting feature should do.\n *\n * For lower-level methods see {@link module:engine/model/writer~Writer `Writer`}.\n *\n * This method, unlike {@link module:engine/model/writer~Writer `Writer`}'s methods, does not have to be used\n * inside a {@link #change `change()` block}.\n *\n * # Conversion and schema\n *\n * Inserting elements and text nodes into the model is not enough to make CKEditor 5 render that content\n * to the user. CKEditor 5 implements a model-view-controller architecture and what `model.insertContent()` does\n * is only adding nodes to the model. Additionally, you need to define\n * {@glink framework/architecture/editing-engine#conversion converters} between the model and view\n * and define those nodes in the {@glink framework/architecture/editing-engine#schema schema}.\n *\n * So, while this method may seem similar to CKEditor 4 `editor.insertHtml()` (in fact, both methods\n * are used for paste-like content insertion), the CKEditor 5 method cannot be use to insert arbitrary HTML\n * unless converters are defined for all elements and attributes in that HTML.\n *\n * # Examples\n *\n * Using `insertContent()` with a manually created model structure:\n *\n * ```ts\n * // Let's create a document fragment containing such content as:\n * //\n * // <paragraph>foo</paragraph>\n * // <blockQuote>\n * // <paragraph>bar</paragraph>\n * // </blockQuote>\n * const docFrag = editor.model.change( writer => {\n * \tconst p1 = writer.createElement( 'paragraph' );\n * \tconst p2 = writer.createElement( 'paragraph' );\n * \tconst blockQuote = writer.createElement( 'blockQuote' );\n * \tconst docFrag = writer.createDocumentFragment();\n *\n * \twriter.append( p1, docFrag );\n * \twriter.append( blockQuote, docFrag );\n * \twriter.append( p2, blockQuote );\n * \twriter.insertText( 'foo', p1 );\n * \twriter.insertText( 'bar', p2 );\n *\n * \treturn docFrag;\n * } );\n *\n * // insertContent() does not have to be used in a change() block. It can, though,\n * // so this code could be moved to the callback defined above.\n * editor.model.insertContent( docFrag );\n * ```\n *\n * Using `insertContent()` with an HTML string converted to a model document fragment (similar to the pasting mechanism):\n *\n * ```ts\n * // You can create your own HtmlDataProcessor instance or use editor.data.processor\n * // if you have not overridden the default one (which is the HtmlDataProcessor instance).\n * const htmlDP = new HtmlDataProcessor( viewDocument );\n *\n * // Convert an HTML string to a view document fragment:\n * const viewFragment = htmlDP.toView( htmlString );\n *\n * // Convert the view document fragment to a model document fragment\n * // in the context of $root. This conversion takes the schema into\n * // account so if, for example, the view document fragment contained a bare text node,\n * // this text node cannot be a child of $root, so it will be automatically\n * // wrapped with a <paragraph>. You can define the context yourself (in the second parameter),\n * // and e.g. convert the content like it would happen in a <paragraph>.\n * // Note: The clipboard feature uses a custom context called $clipboardHolder\n * // which has a loosened schema.\n * const modelFragment = editor.data.toModel( viewFragment );\n *\n * editor.model.insertContent( modelFragment );\n * ```\n *\n * By default this method will use the document selection but it can also be used with a position, range or selection instance.\n *\n * ```ts\n * // Insert text at the current document selection position.\n * editor.model.change( writer => {\n * \teditor.model.insertContent( writer.createText( 'x' ) );\n * } );\n *\n * // Insert text at a given position - the document selection will not be modified.\n * editor.model.change( writer => {\n * \teditor.model.insertContent( writer.createText( 'x' ), doc.getRoot(), 2 );\n *\n * \t// Which is a shorthand for:\n * \teditor.model.insertContent( writer.createText( 'x' ), writer.createPositionAt( doc.getRoot(), 2 ) );\n * } );\n * ```\n *\n * If you want the document selection to be moved to the inserted content, use the\n * {@link module:engine/model/writer~Writer#setSelection `setSelection()`} method of the writer after inserting\n * the content:\n *\n * ```ts\n * editor.model.change( writer => {\n * \tconst paragraph = writer.createElement( 'paragraph' );\n *\n * \t// Insert an empty paragraph at the beginning of the root.\n * \teditor.model.insertContent( paragraph, writer.createPositionAt( editor.model.document.getRoot(), 0 ) );\n *\n * \t// Move the document selection to the inserted paragraph.\n * \twriter.setSelection( paragraph, 'in' );\n * } );\n * ```\n *\n * If an instance of the {@link module:engine/model/selection~Selection model selection} is passed as `selectable`,\n * the new content will be inserted at the passed selection (instead of document selection):\n *\n * ```ts\n * editor.model.change( writer => {\n * \t// Create a selection in a paragraph that will be used as a place of insertion.\n * \tconst selection = writer.createSelection( paragraph, 'in' );\n *\n * \t// Insert the new text at the created selection.\n * \teditor.model.insertContent( writer.createText( 'x' ), selection );\n *\n * \t// insertContent() modifies the passed selection instance so it can be used to set the document selection.\n * \t// Note: This is not necessary when you passed the document selection to insertContent().\n * \twriter.setSelection( selection );\n * } );\n * ```\n *\n * @fires insertContent\n * @param content The content to insert.\n * @param selectable The selection into which the content should be inserted.\n * If not provided the current model document selection will be used.\n * @param placeOrOffset To be used when a model item was passed as `selectable`.\n * This param defines a position in relation to that item.\n * at the insertion position.\n */\n insertContent(content, selectable, placeOrOffset, ...rest) {\n const selection = normalizeSelectable(selectable, placeOrOffset);\n // Passing all call arguments so it acts like decorated method.\n return this.fire('insertContent', [content, selection, placeOrOffset, ...rest]);\n }\n /**\n * Inserts an {@glink framework/deep-dive/schema#object-elements object element} at a specific position in the editor content.\n *\n * This is a high-level API:\n * * It takes the {@link #schema schema} into consideration,\n * * It clears the content of passed `selectable` before inserting,\n * * It can move the selection at the end of the process,\n * * It will copy the selected block's attributes to preserve them upon insertion,\n * * It can split elements or wrap inline objects with paragraphs if they are not allowed in target position,\n * * etc.\n *\n * # Notes\n *\n * * If you want to insert a non-object content, see {@link #insertContent} instead.\n * * For lower-level API, see {@link module:engine/model/writer~Writer `Writer`}.\n * * Unlike {@link module:engine/model/writer~Writer `Writer`}, this method does not have to be used inside\n * a {@link #change `change()` block}.\n * * Inserting object into the model is not enough to make CKEditor 5 render that content to the user.\n * CKEditor 5 implements a model-view-controller architecture and what `model.insertObject()` does\n * is only adding nodes to the model. Additionally, you need to define\n * {@glink framework/architecture/editing-engine#conversion converters} between the model and view\n * and define those nodes in the {@glink framework/architecture/editing-engine#schema schema}.\n *\n * # Examples\n *\n * Use the following code to insert an object at the current selection and keep the selection on the inserted element:\n *\n * ```ts\n * const rawHtmlEmbedElement = writer.createElement( 'rawHtml' );\n *\n * model.insertObject( rawHtmlEmbedElement, null, null, {\n * \tsetSelection: 'on'\n * } );\n * ```\n *\n * Use the following code to insert an object at the current selection and nudge the selection after the inserted object:\n *\n * ```ts\n * const pageBreakElement = writer.createElement( 'pageBreak' );\n *\n * model.insertObject( pageBreakElement, null, null, {\n * \tsetSelection: 'after'\n * } );\n * ```\n *\n * Use the following code to insert an object at the current selection and avoid splitting the content (non-destructive insertion):\n *\n * ```ts\n * const tableElement = writer.createElement( 'table' );\n *\n * model.insertObject( tableElement, null, null, {\n * \tfindOptimalPosition: 'auto'\n * } );\n * ```\n *\n * Use the following code to insert an object at the specific range (also: replace the content of the range):\n *\n * ```ts\n * const tableElement = writer.createElement( 'table' );\n * const range = model.createRangeOn( model.document.getRoot().getChild( 1 ) );\n *\n * model.insertObject( tableElement, range );\n * ```\n *\n * @param element An object to be inserted into the model document.\n * @param selectable A selectable where the content should be inserted. If not specified, the current\n * {@link module:engine/model/document~Document#selection document selection} will be used instead.\n * @param placeOrOffset Specifies the exact place or offset for the insertion to take place, relative to `selectable`.\n * @param options Additional options.\n * @param options.findOptimalPosition An option that, when set, adjusts the insertion position (relative to\n * `selectable` and `placeOrOffset`) so that the content of `selectable` is not split upon insertion (a.k.a. non-destructive insertion).\n * * When `'auto'`, the algorithm will decide whether to insert the object before or after `selectable` to avoid content splitting.\n * * When `'before'`, the closest position before `selectable` will be used that will not result in content splitting.\n * * When `'after'`, the closest position after `selectable` will be used that will not result in content splitting.\n *\n * Note that this option only works for block objects. Inline objects are inserted into text and do not split blocks.\n * @param options.setSelection An option that, when set, moves the\n * {@link module:engine/model/document~Document#selection document selection} after inserting the object.\n * * When `'on'`, the document selection will be set on the inserted object.\n * * When `'after'`, the document selection will move to the closest text node after the inserted object. If there is no\n * such text node, a paragraph will be created and the document selection will be moved inside it.\n * at the insertion position.\n */\n insertObject(element, selectable, placeOrOffset, options, ...rest) {\n const selection = normalizeSelectable(selectable, placeOrOffset);\n // Note that options are fired as 2 arguments for backward compatibility with the decorated method.\n // Passing all call arguments so it acts like decorated method.\n return this.fire('insertObject', [element, selection, options, options, ...rest]);\n }\n /**\n * Deletes content of the selection and merge siblings. The resulting selection is always collapsed.\n *\n * **Note:** For the sake of predictability, the resulting selection should always be collapsed.\n * In cases where a feature wants to modify deleting behavior so selection isn't collapsed\n * (e.g. a table feature may want to keep row selection after pressing <kbd>Backspace</kbd>),\n * then that behavior should be implemented in the view's listener. At the same time, the table feature\n * will need to modify this method's behavior too, e.g. to \"delete contents and then collapse\n * the selection inside the last selected cell\" or \"delete the row and collapse selection somewhere near\".\n * That needs to be done in order to ensure that other features which use `deleteContent()` will work well with tables.\n *\n * @fires deleteContent\n * @param selection Selection of which the content should be deleted.\n * @param options.leaveUnmerged Whether to merge elements after removing the content of the selection.\n *\n * For example `<heading1>x[x</heading1><paragraph>y]y</paragraph>` will become:\n *\n * * `<heading1>x^y</heading1>` with the option disabled (`leaveUnmerged == false`)\n * * `<heading1>x^</heading1><paragraph>y</paragraph>` with enabled (`leaveUnmerged == true`).\n *\n * Note: {@link module:engine/model/schema~Schema#isObject object} and {@link module:engine/model/schema~Schema#isLimit limit}\n * elements will not be merged.\n *\n * @param options.doNotResetEntireContent Whether to skip replacing the entire content with a\n * paragraph when the entire content was selected.\n *\n * For example `<heading1>[x</heading1><paragraph>y]</paragraph>` will become:\n *\n * * `<paragraph>^</paragraph>` with the option disabled (`doNotResetEntireContent == false`)\n * * `<heading1>^</heading1>` with enabled (`doNotResetEntireContent == true`)\n *\n * @param options.doNotAutoparagraph Whether to create a paragraph if after content deletion selection is moved\n * to a place where text cannot be inserted.\n *\n * For example `<paragraph>x</paragraph>[<imageBlock src=\"foo.jpg\"></imageBlock>]` will become:\n *\n * * `<paragraph>x</paragraph><paragraph>[]</paragraph>` with the option disabled (`doNotAutoparagraph == false`)\n * * `<paragraph>x[]</paragraph>` with the option enabled (`doNotAutoparagraph == true`).\n *\n * **Note:** if there is no valid position for the selection, the paragraph will always be created:\n *\n * `[<imageBlock src=\"foo.jpg\"></imageBlock>]` -> `<paragraph>[]</paragraph>`.\n *\n * @param options.direction The direction in which the content is being consumed.\n * Deleting backward corresponds to using the <kbd>Backspace</kbd> key, while deleting content forward corresponds to\n * the <kbd>Shift</kbd>+<kbd>Backspace</kbd> keystroke.\n */\n deleteContent(selection, options) {\n deleteContent(this, selection, options);\n }\n /**\n * Modifies the selection. Currently, the supported modifications are:\n *\n * * Extending. The selection focus is moved in the specified `options.direction` with a step specified in `options.unit`.\n * Possible values for `unit` are:\n * * `'character'` (default) - moves selection by one user-perceived character. In most cases this means moving by one\n * character in `String` sense. However, unicode also defines \"combing marks\". These are special symbols, that combines\n * with a symbol before it (\"base character\") to create one user-perceived character. For example, `q̣̇` is a normal\n * letter `q` with two \"combining marks\": upper dot (`Ux0307`) and lower dot (`Ux0323`). For most actions, i.e. extending\n * selection by one position, it is correct to include both \"base character\" and all of it's \"combining marks\". That is\n * why `'character'` value is most natural and common method of modifying selection.\n * * `'codePoint'` - moves selection by one unicode code point. In contrary to, `'character'` unit, this will insert\n * selection between \"base character\" and \"combining mark\", because \"combining marks\" have their own unicode code points.\n * However, for technical reasons, unicode code points with values above `UxFFFF` are represented in native `String` by\n * two characters, called \"surrogate pairs\". Halves of \"surrogate pairs\" have a meaning only when placed next to each other.\n * For example `𨭎` is represented in `String` by `\\uD862\\uDF4E`. Both `\\uD862` and `\\uDF4E` do not have any meaning\n * outside the pair (are rendered as ? when alone). Position between them would be incorrect. In this case, selection\n * extension will include whole \"surrogate pair\".\n * * `'word'` - moves selection by a whole word.\n *\n * **Note:** if you extend a forward selection in a backward direction you will in fact shrink it.\n *\n * @fires modifySelection\n * @param selection The selection to modify.\n * @param options.direction The direction in which the selection should be modified.\n * @param options.unit The unit by which selection should be modified.\n * @param options.treatEmojiAsSingleUnit Whether multi-characer emoji sequences should be handled as single unit.\n */\n modifySelection(selection, options) {\n modifySelection(this, selection, options);\n }\n /**\n * Gets a clone of the selected content.\n *\n * For example, for the following selection:\n *\n * ```html\n * <paragraph>x</paragraph>\n * <blockQuote>\n * \t<paragraph>y</paragraph>\n * \t<heading1>fir[st</heading1>\n * </blockQuote>\n * <paragraph>se]cond</paragraph>\n * <paragraph>z</paragraph>\n * ```\n *\n * It will return a document fragment with such a content:\n *\n * ```html\n * <blockQuote>\n * \t<heading1>st</heading1>\n * </blockQuote>\n * <paragraph>se</paragraph>\n * ```\n *\n * @fires getSelectedContent\n * @param selection The selection of which content will be returned.\n */\n getSelectedContent(selection) {\n return getSelectedContent(this, selection);\n }\n /**\n * Checks whether the given {@link module:engine/model/range~Range range} or\n * {@link module:engine/model/element~Element element} has any meaningful content.\n *\n * Meaningful content is:\n *\n * * any text node (`options.ignoreWhitespaces` allows controlling whether this text node must also contain\n * any non-whitespace characters),\n * * or any {@link module:engine/model/schema~Schema#isContent content element},\n * * or any {@link module:engine/model/markercollection~Marker marker} which\n * {@link module:engine/model/markercollection~Marker#_affectsData affects data}.\n *\n * This means that a range containing an empty `<paragraph></paragraph>` is not considered to have a meaningful content.\n * However, a range containing an `<imageBlock></imageBlock>` (which would normally be marked in the schema as an object element)\n * is considered non-empty.\n *\n * @param rangeOrElement Range or element to check.\n * @param options.ignoreWhitespaces Whether text node with whitespaces only should be considered empty.\n * @param options.ignoreMarkers Whether markers should be ignored.\n */\n hasContent(rangeOrElement, options = {}) {\n const range = rangeOrElement instanceof ModelRange ? rangeOrElement : ModelRange._createIn(rangeOrElement);\n if (range.isCollapsed) {\n return false;\n }\n const { ignoreWhitespaces = false, ignoreMarkers = false } = options;\n // Check if there are any markers which affects data in this given range.\n if (!ignoreMarkers) {\n for (const intersectingMarker of this.markers.getMarkersIntersectingRange(range)) {\n if (intersectingMarker.affectsData) {\n return true;\n }\n }\n }\n for (const item of range.getItems()) {\n if (this.schema.isContent(item)) {\n if (item.is('$textProxy')) {\n if (!ignoreWhitespaces) {\n return true;\n }\n else if (item.data.search(/\\S/) !== -1) {\n return true;\n }\n }\n else {\n return true;\n }\n }\n }\n return false;\n }\n /**\n * Check whether given selectable is at a place in the model where it can be edited (returns `true`) or not (returns `false`).\n *\n * Should be used instead of {@link module:core/editor/editor~Editor#isReadOnly} to check whether a user action can happen at\n * given selectable. It may be decorated and used differently in different environment (e.g. multi-root editor can disable\n * a particular root).\n *\n * This method is decorated. Although this method accepts any parameter of `Selectable` type, the\n * {@link ~Model#event:canEditAt `canEditAt` event} is fired with `selectable` normalized to an instance of\n * {@link module:engine/model/selection~Selection} or {@link module:engine/model/documentselection~DocumentSelection}\n *\n * @fires canEditAt\n */\n canEditAt(selectable) {\n const selection = normalizeSelectable(selectable);\n return this.fire('canEditAt', [selection]);\n }\n /**\n * Creates a position from the given root and path in that root.\n *\n * Note: This method is also available as\n * {@link module:engine/model/writer~Writer#createPositionFromPath `Writer#createPositionFromPath()`}.\n *\n * @param root Root of the position.\n * @param path Position path. See {@link module:engine/model/position~Position#path}.\n * @param stickiness Position stickiness. See {@link module:engine/model/position~PositionStickiness}.\n */\n createPositionFromPath(root, path, stickiness) {\n return new ModelPosition(root, path, stickiness);\n }\n /**\n * Creates position at the given location. The location can be specified as:\n *\n * * a {@link module:engine/model/position~Position position},\n * * a parent element and offset in that element,\n * * a parent element and `'end'` (the position will be set at the end of that element),\n * * a {@link module:engine/model/item~Item model item} and `'before'` or `'after'`\n * (the position will be set before or after the given model item).\n *\n * This method is a shortcut to other factory methods such as:\n *\n * * {@link module:engine/model/model~Model#createPositionBefore `createPositionBefore()`},\n * * {@link module:engine/model/model~Model#createPositionAfter `createPositionAfter()`}.\n *\n * Note: This method is also available as\n * {@link module:engine/model/writer~Writer#createPositionAt `Writer#createPositionAt()`},\n *\n * @param itemOrPosition\n * @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/model/item~Item model item}.\n */\n createPositionAt(itemOrPosition, offset) {\n return ModelPosition._createAt(itemOrPosition, offset);\n }\n /**\n * Creates a new position after the given {@link module:engine/model/item~Item model item}.\n *\n * Note: This method is also available as\n * {@link module:engine/model/writer~Writer#createPositionAfter `Writer#createPositionAfter()`}.\n *\n * @param item Item after which the position should be placed.\n */\n createPositionAfter(item) {\n return ModelPosition._createAfter(item);\n }\n /**\n * Creates a new position before the given {@link module:engine/model/item~Item model item}.\n *\n * Note: This method is also available as\n * {@link module:engine/model/writer~Writer#createPositionBefore `Writer#createPositionBefore()`}.\n *\n * @param item Item before which the position should be placed.\n */\n createPositionBefore(item) {\n return ModelPosition._createBefore(item);\n }\n /**\n * Creates a range spanning from the `start` position to the `end` position.\n *\n * Note: This method is also available as\n * {@link module:engine/model/writer~Writer#createRange `Writer#createRange()`}:\n *\n * ```ts\n * model.change( writer => {\n * \tconst range = writer.createRange( start, end );\n * } );\n * ```\n *\n * @param start Start position.\n * @param end End position. If not set, the range will be collapsed to the `start` position.\n */\n createRange(start, end) {\n return new ModelRange(start, end);\n }\n /**\n * Creates a range inside the given element which starts before the first child of\n * that element and ends after the last child of that element.\n *\n * Note: This method is also available as\n * {@link module:engine/model/writer~Writer#createRangeIn `Writer#createRangeIn()`}:\n *\n * ```ts\n * model.change( writer => {\n * \tconst range = writer.createRangeIn( paragraph );\n * } );\n * ```\n *\n * @param element Element which is a parent for the range.\n */\n createRangeIn(element) {\n return ModelRange._createIn(element);\n }\n /**\n * Creates a range that starts before the given {@link module:engine/model/item~Item model item} and ends after it.\n *\n * Note: This method is also available on `writer` instance as\n * {@link module:engine/model/writer~Writer#createRangeOn `Writer.createRangeOn()`}:\n *\n * ```ts\n * model.change( writer => {\n * \tconst range = writer.createRangeOn( paragraph );\n * } );\n * ```\n *\n * @param item\n */\n createRangeOn(item) {\n return ModelRange._createOn(item);\n }\n createSelection(...args) {\n return new ModelSelection(...args);\n }\n /**\n * Creates a {@link module:engine/model/batch~Batch} instance.\n *\n * **Note:** In most cases creating a batch instance is not necessary as they are created when using:\n *\n * * {@link #change `change()`},\n * * {@link #enqueueChange `enqueueChange()`}.\n *\n * @param type {@link module:engine/model/batch~Batch#constructor The type} of the batch.\n */\n createBatch(type) {\n return new Batch(type);\n }\n /**\n * Creates an operation instance from a JSON object (parsed JSON string).\n *\n * This is an alias for {@link module:engine/model/operation/operationfactory~OperationFactory.fromJSON `OperationFactory.fromJSON()`}.\n *\n * @param json Deserialized JSON object.\n */\n createOperationFromJSON(json) {\n return OperationFactory.fromJSON(json, this.document);\n }\n /**\n * Removes all events listeners set by model instance and destroys {@link module:engine/model/document~Document}.\n */\n destroy() {\n this.document.destroy();\n this.stopListening();\n }\n /**\n * Common part of {@link module:engine/model/model~Model#change} and {@link module:engine/model/model~Model#enqueueChange}\n * which calls callbacks and returns array of values returned by these callbacks.\n *\n */\n _runPendingChanges() {\n const ret = [];\n this.fire('_beforeChanges');\n try {\n while (this._pendingChanges.length) {\n // Create a new writer using batch instance created for this chain of changes.\n const currentBatch = this._pendingChanges[0].batch;\n this._currentWriter = new Writer(this, currentBatch);\n // Execute changes callback and gather the returned value.\n const callbackReturnValue = this._pendingChanges[0].callback(this._currentWriter);\n ret.push(callbackReturnValue);\n this.document._handleChangeBlock(this._currentWriter);\n this._pendingChanges.shift();\n this._currentWriter = null;\n }\n }\n finally {\n this._pendingChanges.length = 0;\n this._currentWriter = null;\n this.fire('_afterChanges');\n }\n return ret;\n }\n}\n/**\n * Normalizes a selectable to a Selection or DocumentSelection.\n */\nfunction normalizeSelectable(selectable, placeOrOffset) {\n if (!selectable) {\n return;\n }\n if (selectable instanceof ModelSelection || selectable instanceof DocumentSelection) {\n return selectable;\n }\n if (selectable instanceof Node) {\n if (placeOrOffset || placeOrOffset === 0) {\n return new ModelSelection(selectable, placeOrOffset);\n }\n else if (selectable.is('rootElement')) {\n return new ModelSelection(selectable, 'in');\n }\n else {\n return new ModelSelection(selectable, 'on');\n }\n }\n return new ModelSelection(selectable);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/clickobserver\n */\nimport DomEventObserver from './domeventobserver';\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} by a {@link module:engine/view/view~View#addObserver} method.\n */\nexport default class ClickObserver extends DomEventObserver {\n constructor() {\n super(...arguments);\n /**\n * @inheritDoc\n */\n this.domEventType = 'click';\n }\n /**\n * @inheritDoc\n */\n onDomEvent(domEvent) {\n this.fire(domEvent.type, domEvent);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/observer/mouseobserver\n */\nimport DomEventObserver from './domeventobserver';\n/**\n * Mouse events 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} by {@link module:engine/view/view~View#addObserver} method.\n */\nexport default class MouseObserver extends DomEventObserver {\n constructor() {\n super(...arguments);\n /**\n * @inheritDoc\n */\n this.domEventType = ['mousedown', 'mouseup', 'mouseover', 'mouseout'];\n }\n /**\n * @inheritDoc\n */\n onDomEvent(domEvent) {\n this.fire(domEvent.type, domEvent);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module engine/view/upcastwriter\n */\nimport DocumentFragment from './documentfragment';\nimport Element from './element';\nimport Text from './text';\nimport { isPlainObject } from 'lodash-es';\nimport Position from './position';\nimport Range from './range';\nimport Selection from './selection';\n/**\n * View upcast writer. It provides a set of methods used to manipulate non-semantic view trees.\n *\n * It should be used only while working on a non-semantic view\n * (e.g. a view created from HTML string on paste).\n * To manipulate a view which was or is being downcasted from the the model use the\n * {@link module:engine/view/downcastwriter~DowncastWriter downcast writer}.\n *\n * Read more about changing the view in the {@glink framework/architecture/editing-engine#changing-the-view Changing the view}\n * section of the {@glink framework/architecture/editing-engine Editing engine architecture} guide.\n *\n * Unlike `DowncastWriter`, which is available in the {@link module:engine/view/view~View#change `View#change()`} block,\n * `UpcastWriter` can be created wherever you need it:\n *\n * ```ts\n * const writer = new UpcastWriter( viewDocument );\n * const text = writer.createText( 'foo!' );\n *\n * writer.appendChild( text, someViewElement );\n * ```\n */\nexport default class UpcastWriter {\n /**\n * @param document The view document instance in which this upcast writer operates.\n */\n constructor(document) {\n this.document = document;\n }\n /**\n * Creates a new {@link module:engine/view/documentfragment~DocumentFragment} instance.\n *\n * @param children A list of nodes to be inserted into the created document fragment.\n * @returns The created document fragment.\n */\n createDocumentFragment(children) {\n return new DocumentFragment(this.document, children);\n }\n /**\n * Creates a new {@link module:engine/view/element~Element} instance.\n *\n * Attributes can be passed in various formats:\n *\n * ```ts\n * upcastWriter.createElement( 'div', { class: 'editor', contentEditable: 'true' } ); // object\n * upcastWriter.createElement( 'div', [ [ 'class', 'editor' ], [ 'contentEditable', 'true' ] ] ); // map-like iterator\n * upcastWriter.createElement( 'div', mapOfAttributes ); // map\n * ```\n *\n * @param name Node name.\n * @param attrs Collection of attributes.\n * @param children A list of nodes to be inserted into created element.\n * @returns Created element.\n */\n createElement(name, attrs, children) {\n return new Element(this.document, name, attrs, children);\n }\n /**\n * Creates a new {@link module:engine/view/text~Text} instance.\n *\n * @param data The text's data.\n * @returns The created text node.\n */\n createText(data) {\n return new Text(this.document, data);\n }\n /**\n * Clones the provided element.\n *\n * @see module:engine/view/element~Element#_clone\n * @param element Element to be cloned.\n * @param deep If set to `true` clones element and all its children recursively. When set to `false`,\n * element will be cloned without any children.\n * @returns Clone of this element.\n */\n clone(element, deep = false) {\n return element._clone(deep);\n }\n /**\n * Appends a child node or a list of child nodes at the end of this node\n * and sets the parent of these nodes to this element.\n *\n * @see module:engine/view/element~Element#_appendChild\n * @param items Items to be inserted.\n * @param element Element to which items will be appended.\n * @returns Number of appended nodes.\n */\n appendChild(items, element) {\n return element._appendChild(items);\n }\n /**\n * Inserts a child node or a list of child nodes on the given index and sets the parent of these nodes to\n * this element.\n *\n * @see module:engine/view/element~Element#_insertChild\n * @param index Offset at which nodes should be inserted.\n * @param items Items to be inserted.\n * @param element Element to which items will be inserted.\n * @returns Number of inserted nodes.\n */\n insertChild(index, items, element) {\n return element._insertChild(index, items);\n }\n /**\n * Removes the given number of child nodes starting at the given index and set the parent of these nodes to `null`.\n *\n * @see module:engine/view/element~Element#_removeChildren\n * @param index Offset from which nodes will be removed.\n * @param howMany Number of nodes to remove.\n * @param element Element which children will be removed.\n * @returns The array containing removed nodes.\n */\n removeChildren(index, howMany, element) {\n return element._removeChildren(index, howMany);\n }\n /**\n * Removes given element from the view structure. Will not have effect on detached elements.\n *\n * @param element Element which will be removed.\n * @returns The array containing removed nodes.\n */\n remove(element) {\n const parent = element.parent;\n if (parent) {\n return this.removeChildren(parent.getChildIndex(element), 1, parent);\n }\n return [];\n }\n /**\n * Replaces given element with the new one in the view structure. Will not have effect on detached elements.\n *\n * @param oldElement Element which will be replaced.\n * @param newElement Element which will be inserted in the place of the old element.\n * @returns Whether old element was successfully replaced.\n */\n replace(oldElement, newElement) {\n const parent = oldElement.parent;\n if (parent) {\n const index = parent.getChildIndex(oldElement);\n this.removeChildren(index, 1, parent);\n this.insertChild(index, newElement, parent);\n return true;\n }\n return false;\n }\n /**\n * Removes given element from view structure and places its children in its position.\n * It does nothing if element has no parent.\n *\n * @param element Element to unwrap.\n */\n unwrapElement(element) {\n const parent = element.parent;\n if (parent) {\n const index = parent.getChildIndex(element);\n this.remove(element);\n this.insertChild(index, element.getChildren(), parent);\n }\n }\n /**\n * Renames element by creating a copy of a given element but with its name changed and then moving contents of the\n * old element to the new one.\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 newName New element name.\n * @param element Element to be renamed.\n * @returns New element or null if the old element was not replaced (happens for detached elements).\n */\n rename(newName, element) {\n const newElement = new Element(this.document, newName, element.getAttributes(), element.getChildren());\n return this.replace(element, newElement) ? newElement : null;\n }\n /**\n * Adds or overwrites element's attribute with a specified key and value.\n *\n * ```ts\n * writer.setAttribute( 'href', 'http://ckeditor.com', linkElement );\n * ```\n *\n * @see module:engine/view/element~Element#_setAttribute\n * @param key Attribute key.\n * @param value Attribute value.\n * @param element Element for which attribute will be set.\n */\n setAttribute(key, value, element) {\n element._setAttribute(key, value);\n }\n /**\n * Removes attribute from the element.\n *\n * ```ts\n * writer.removeAttribute( 'href', linkElement );\n * ```\n *\n * @see module:engine/view/element~Element#_removeAttribute\n * @param key Attribute key.\n * @param element Element from which attribute will be removed.\n */\n removeAttribute(key, element) {\n element._removeAttribute(key);\n }\n /**\n * Adds specified class to the element.\n *\n * ```ts\n * writer.addClass( 'foo', linkElement );\n * writer.addClass( [ 'foo', 'bar' ], linkElement );\n * ```\n *\n * @see module:engine/view/element~Element#_addClass\n * @param className Single class name or array of class names which will be added.\n * @param element Element for which class will be added.\n */\n addClass(className, element) {\n element._addClass(className);\n }\n /**\n * Removes specified class from the element.\n *\n * ```ts\n * writer.removeClass( 'foo', linkElement );\n * writer.removeClass( [ 'foo', 'bar' ], linkElement );\n * ```\n *\n * @see module:engine/view/element~Element#_removeClass\n * @param className Single class name or array of class names which will be removed.\n * @param element Element from which class will be removed.\n */\n removeClass(className, element) {\n element._removeClass(className);\n }\n setStyle(property, valueOrElement, element) {\n if (isPlainObject(property) && element === undefined) {\n valueOrElement._setStyle(property);\n }\n else {\n element._setStyle(property, valueOrElement);\n }\n }\n /**\n * Removes specified style from the element.\n *\n * ```ts\n * writer.removeStyle( 'color', element ); // Removes 'color' style.\n * writer.removeStyle( [ 'color', 'border-top' ], element ); // Removes both 'color' and 'border-top' styles.\n * ```\n *\n * **Note**: This method can work with normalized style names if\n * {@link module:engine/controller/datacontroller~DataController#addStyleProcessorRules a particular style processor rule is enabled}.\n * See {@link module:engine/view/stylesmap~StylesMap#remove `StylesMap#remove()`} for details.\n *\n * @see module:engine/view/element~Element#_removeStyle\n * @param property Style property name or names to be removed.\n * @param element Element from which style will be removed.\n */\n removeStyle(property, element) {\n element._removeStyle(property);\n }\n /**\n * Sets a custom property on element. Unlike attributes, custom properties are not rendered to the DOM,\n * so they can be used to add special data to elements.\n *\n * @see module:engine/view/element~Element#_setCustomProperty\n * @param key Custom property name/key.\n * @param value Custom property value to be stored.\n * @param element Element for which custom property will be set.\n */\n setCustomProperty(key, value, element) {\n element._setCustomProperty(key, value);\n }\n /**\n * Removes a custom property stored under the given key.\n *\n * @see module:engine/view/element~Element#_removeCustomProperty\n * @param key Name/key of the custom property to be removed.\n * @param element Element from which the custom property will be removed.\n * @returns Returns true if property was removed.\n */\n removeCustomProperty(key, element) {\n return element._removeCustomProperty(key);\n }\n /**\n * Creates position at the given location. The location can be specified as:\n *\n * * a {@link module:engine/view/position~Position position},\n * * parent element and offset (offset defaults to `0`),\n * * parent element and `'end'` (sets position at the end of that element),\n * * {@link module:engine/view/item~Item view item} and `'before'` or `'after'` (sets position before or after given view item).\n *\n * This method is a shortcut to other constructors such as:\n *\n * * {@link #createPositionBefore},\n * * {@link #createPositionAfter},\n *\n * @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/view/item~Item view item}.\n */\n createPositionAt(itemOrPosition, offset) {\n return Position._createAt(itemOrPosition, offset);\n }\n /**\n * Creates a new position after given view item.\n *\n * @param item View item after which the position should be located.\n */\n createPositionAfter(item) {\n return Position._createAfter(item);\n }\n /**\n * Creates a new position before given view item.\n *\n * @param item View item before which the position should be located.\n */\n createPositionBefore(item) {\n return Position._createBefore(item);\n }\n /**\n * Creates a range spanning from `start` position to `end` position.\n *\n * **Note:** This factory method creates it's own {@link module:engine/view/position~Position} instances basing on passed values.\n *\n * @param start Start position.\n * @param end End position. If not set, range will be collapsed at `start` position.\n */\n createRange(start, end) {\n return new Range(start, end);\n }\n /**\n * Creates a range that starts before given {@link module:engine/view/item~Item view item} and ends after it.\n */\n createRangeOn(item) {\n return Range._createOn(item);\n }\n /**\n * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of\n * that element and ends after the last child of that element.\n *\n * @param element Element which is a parent for the range.\n */\n createRangeIn(element) {\n return Range._createIn(element);\n }\n createSelection(...args) {\n return new Selection(...args);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nconst HEX_COLOR_REGEXP = /^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i;\nconst RGB_COLOR_REGEXP = /^rgb\\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\\)$/i;\nconst RGBA_COLOR_REGEXP = /^rgba\\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\\.?[0-9]+)\\)$/i;\nconst HSL_COLOR_REGEXP = /^hsl\\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\\.?[0-9]+)?\\)$/i;\nconst HSLA_COLOR_REGEXP = /^hsla\\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\\.?[0-9]+)\\)$/i;\nconst COLOR_NAMES = new Set([\n // CSS Level 1\n 'black', 'silver', 'gray', 'white', 'maroon', 'red', 'purple', 'fuchsia',\n 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua',\n // CSS Level 2 (Revision 1)\n 'orange',\n // CSS Color Module Level 3\n 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'blanchedalmond', 'blueviolet', 'brown',\n 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan',\n 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta',\n 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue',\n 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey',\n 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod',\n 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush',\n 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray',\n 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray',\n 'lightslategrey', 'lightsteelblue', 'lightyellow', 'limegreen', 'linen', 'magenta', 'mediumaquamarine',\n 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen',\n 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite',\n 'oldlace', 'olivedrab', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred',\n 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon',\n 'sandybrown', 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow',\n 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'whitesmoke', 'yellowgreen',\n // CSS Color Module Level 3 (System Colors)\n 'activeborder', 'activecaption', 'appworkspace', 'background', 'buttonface', 'buttonhighlight', 'buttonshadow',\n 'buttontext', 'captiontext', 'graytext', 'highlight', 'highlighttext', 'inactiveborder', 'inactivecaption',\n 'inactivecaptiontext', 'infobackground', 'infotext', 'menu', 'menutext', 'scrollbar', 'threeddarkshadow',\n 'threedface', 'threedhighlight', 'threedlightshadow', 'threedshadow', 'window', 'windowframe', 'windowtext',\n // CSS Color Module Level 4\n 'rebeccapurple',\n // Keywords\n 'currentcolor', 'transparent'\n]);\n/**\n * Checks if string contains [color](https://developer.mozilla.org/en-US/docs/Web/CSS/color) CSS value.\n *\n * ```ts\n * isColor( '#f00' );\t\t\t\t\t\t// true\n * isColor( '#AA00BB33' );\t\t\t\t\t// true\n * isColor( 'rgb(0, 0, 250)' );\t\t\t\t// true\n * isColor( 'hsla(240, 100%, 50%, .7)' );\t// true\n * isColor( 'deepskyblue' );\t\t\t\t// true\n * ```\n *\n * **Note**: It does not support CSS Level 4 whitespace syntax, system colors and radius values for HSL colors.\n */\nexport function isColor(string) {\n // As far as I was able to test checking some pre-conditions is faster than joining each test with ||.\n if (string.startsWith('#')) {\n return HEX_COLOR_REGEXP.test(string);\n }\n if (string.startsWith('rgb')) {\n return RGB_COLOR_REGEXP.test(string) || RGBA_COLOR_REGEXP.test(string);\n }\n if (string.startsWith('hsl')) {\n return HSL_COLOR_REGEXP.test(string) || HSLA_COLOR_REGEXP.test(string);\n }\n // Array check > RegExp test.\n return COLOR_NAMES.has(string.toLowerCase());\n}\nconst lineStyleValues = ['none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset'];\n/**\n * Checks if string contains [line style](https://developer.mozilla.org/en-US/docs/Web/CSS/border-style) CSS value.\n */\nexport function isLineStyle(string) {\n return lineStyleValues.includes(string);\n}\nconst lengthRegExp = /^([+-]?[0-9]*([.][0-9]+)?(px|cm|mm|in|pc|pt|ch|em|ex|rem|vh|vw|vmin|vmax)|0)$/;\n/**\n * Checks if string contains [length](https://developer.mozilla.org/en-US/docs/Web/CSS/length) CSS value.\n */\nexport function isLength(string) {\n return lengthRegExp.test(string);\n}\nconst PERCENTAGE_VALUE_REGEXP = /^[+-]?[0-9]*([.][0-9]+)?%$/;\n/**\n * Checks if string contains [percentage](https://developer.mozilla.org/en-US/docs/Web/CSS/percentage) CSS value.\n */\nexport function isPercentage(string) {\n return PERCENTAGE_VALUE_REGEXP.test(string);\n}\nconst repeatValues = ['repeat-x', 'repeat-y', 'repeat', 'space', 'round', 'no-repeat'];\n/**\n * Checks if string contains [background repeat](https://developer.mozilla.org/en-US/docs/Web/CSS/background-repeat) CSS value.\n */\nexport function isRepeat(string) {\n return repeatValues.includes(string);\n}\nconst positionValues = ['center', 'top', 'bottom', 'left', 'right'];\n/**\n * Checks if string contains [background position](https://developer.mozilla.org/en-US/docs/Web/CSS/background-position) CSS value.\n */\nexport function isPosition(string) {\n return positionValues.includes(string);\n}\nconst attachmentValues = ['fixed', 'scroll', 'local'];\n/**\n * Checks if string contains [background attachment](https://developer.mozilla.org/en-US/docs/Web/CSS/background-attachment) CSS value.\n */\nexport function isAttachment(string) {\n return attachmentValues.includes(string);\n}\nconst urlRegExp = /^url\\(/;\n/**\n * Checks if string contains [URL](https://developer.mozilla.org/en-US/docs/Web/CSS/url) CSS value.\n */\nexport function isURL(string) {\n return urlRegExp.test(string);\n}\n/**\n * Parses box sides as individual values.\n */\nexport function getBoxSidesValues(value = '') {\n if (value === '') {\n return { top: undefined, right: undefined, bottom: undefined, left: undefined };\n }\n const values = getShorthandValues(value);\n const top = values[0];\n const bottom = values[2] || top;\n const right = values[1] || top;\n const left = values[3] || right;\n return { top, bottom, right, left };\n}\n/**\n * Default reducer for CSS properties that concerns edges of a box\n * [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) notations:\n *\n * ```ts\n * stylesProcessor.setReducer( 'padding', getBoxSidesValueReducer( 'padding' ) );\n * ```\n */\nexport function getBoxSidesValueReducer(styleShorthand) {\n return (value) => {\n const { top, right, bottom, left } = value;\n const reduced = [];\n if (![top, right, left, bottom].every(value => !!value)) {\n if (top) {\n reduced.push([styleShorthand + '-top', top]);\n }\n if (right) {\n reduced.push([styleShorthand + '-right', right]);\n }\n if (bottom) {\n reduced.push([styleShorthand + '-bottom', bottom]);\n }\n if (left) {\n reduced.push([styleShorthand + '-left', left]);\n }\n }\n else {\n reduced.push([styleShorthand, getBoxSidesShorthandValue(value)]);\n }\n return reduced;\n };\n}\n/**\n * Returns a [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) notation\n * of a CSS property value.\n *\n * ```ts\n * getBoxSidesShorthandValue( { top: '1px', right: '1px', bottom: '2px', left: '1px' } );\n * // will return '1px 1px 2px'\n * ```\n */\nexport function getBoxSidesShorthandValue({ top, right, bottom, left }) {\n const out = [];\n if (left !== right) {\n out.push(top, right, bottom, left);\n }\n else if (bottom !== top) {\n out.push(top, right, bottom);\n }\n else if (right !== top) {\n out.push(top, right);\n }\n else {\n out.push(top);\n }\n return out.join(' ');\n}\n/**\n * Creates a normalizer for a [shorthand](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties) 1-to-4 value.\n *\n * ```ts\n * stylesProcessor.setNormalizer( 'margin', getPositionShorthandNormalizer( 'margin' ) );\n * ```\n */\nexport function getPositionShorthandNormalizer(shorthand) {\n return (value) => {\n return {\n path: shorthand,\n value: getBoxSidesValues(value)\n };\n };\n}\n/**\n * Parses parts of a 1-to-4 value notation - handles some CSS values with spaces (like RGB()).\n *\n * ```ts\n * getShorthandValues( 'red blue RGB(0, 0, 0)');\n * // will return [ 'red', 'blue', 'RGB(0, 0, 0)' ]\n * ```\n */\nexport function getShorthandValues(string) {\n return string\n .replace(/, /g, ',') // Exclude comma from spaces evaluation as values are separated by spaces.\n .split(' ')\n .map(string => string.replace(/,/g, ', ')); // Restore original notation.\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { getShorthandValues, isAttachment, isColor, isPosition, isRepeat, isURL } from './utils';\n/**\n * Adds a background CSS styles processing rules.\n *\n * ```ts\n * editor.data.addStyleProcessorRules( addBackgroundRules );\n * ```\n *\n * The normalized value is stored as:\n *\n * ```ts\n * const styles = {\n * \tbackground: {\n * \t\tcolor,\n * \t\trepeat,\n * \t\tposition,\n * \t\tattachment,\n * \t\timage\n * \t}\n * };\n * ````\n *\n * **Note**: Currently only `'background-color'` longhand value is parsed besides `'background'` shorthand. The reducer also supports only\n * `'background-color'` value.\n */\nexport function addBackgroundRules(stylesProcessor) {\n stylesProcessor.setNormalizer('background', getBackgroundNormalizer());\n stylesProcessor.setNormalizer('background-color', getBackgroundColorNormalizer());\n stylesProcessor.setReducer('background', getBackgroundReducer());\n stylesProcessor.setStyleRelation('background', ['background-color']);\n}\nfunction getBackgroundNormalizer() {\n return value => {\n const background = {};\n const parts = getShorthandValues(value);\n for (const part of parts) {\n if (isRepeat(part)) {\n background.repeat = background.repeat || [];\n background.repeat.push(part);\n }\n else if (isPosition(part)) {\n background.position = background.position || [];\n background.position.push(part);\n }\n else if (isAttachment(part)) {\n background.attachment = part;\n }\n else if (isColor(part)) {\n background.color = part;\n }\n else if (isURL(part)) {\n background.image = part;\n }\n }\n return {\n path: 'background',\n value: background\n };\n };\n}\nfunction getBackgroundColorNormalizer() {\n return value => ({ path: 'background.color', value });\n}\nfunction getBackgroundReducer() {\n return value => {\n const ret = [];\n ret.push(['background-color', value.color]);\n return ret;\n };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { getShorthandValues, getBoxSidesValueReducer, getBoxSidesValues, isLength, isLineStyle } from './utils';\n/**\n * Adds a border CSS styles processing rules.\n *\n * ```ts\n * editor.data.addStyleProcessorRules( addBorderRules );\n * ```\n *\n * This rules merges all [border](https://developer.mozilla.org/en-US/docs/Web/CSS/border) styles notation shorthands:\n *\n * - border\n * - border-top\n * - border-right\n * - border-bottom\n * - border-left\n * - border-color\n * - border-style\n * - border-width\n *\n * and all corresponding longhand forms (like `border-top-color`, `border-top-style`, etc).\n *\n * It does not handle other shorthands (like `border-radius` or `border-image`).\n *\n * The normalized model stores border values as:\n *\n * ```ts\n * const styles = {\n * \tborder: {\n * \t\tcolor: { top, right, bottom, left },\n * \t\tstyle: { top, right, bottom, left },\n * \t\twidth: { top, right, bottom, left },\n * \t}\n * };\n * ```\n */\nexport function addBorderRules(stylesProcessor) {\n stylesProcessor.setNormalizer('border', getBorderNormalizer());\n // Border-position shorthands.\n stylesProcessor.setNormalizer('border-top', getBorderPositionNormalizer('top'));\n stylesProcessor.setNormalizer('border-right', getBorderPositionNormalizer('right'));\n stylesProcessor.setNormalizer('border-bottom', getBorderPositionNormalizer('bottom'));\n stylesProcessor.setNormalizer('border-left', getBorderPositionNormalizer('left'));\n // Border-property shorthands.\n stylesProcessor.setNormalizer('border-color', getBorderPropertyNormalizer('color'));\n stylesProcessor.setNormalizer('border-width', getBorderPropertyNormalizer('width'));\n stylesProcessor.setNormalizer('border-style', getBorderPropertyNormalizer('style'));\n // Border longhands.\n stylesProcessor.setNormalizer('border-top-color', getBorderPropertyPositionNormalizer('color', 'top'));\n stylesProcessor.setNormalizer('border-top-style', getBorderPropertyPositionNormalizer('style', 'top'));\n stylesProcessor.setNormalizer('border-top-width', getBorderPropertyPositionNormalizer('width', 'top'));\n stylesProcessor.setNormalizer('border-right-color', getBorderPropertyPositionNormalizer('color', 'right'));\n stylesProcessor.setNormalizer('border-right-style', getBorderPropertyPositionNormalizer('style', 'right'));\n stylesProcessor.setNormalizer('border-right-width', getBorderPropertyPositionNormalizer('width', 'right'));\n stylesProcessor.setNormalizer('border-bottom-color', getBorderPropertyPositionNormalizer('color', 'bottom'));\n stylesProcessor.setNormalizer('border-bottom-style', getBorderPropertyPositionNormalizer('style', 'bottom'));\n stylesProcessor.setNormalizer('border-bottom-width', getBorderPropertyPositionNormalizer('width', 'bottom'));\n stylesProcessor.setNormalizer('border-left-color', getBorderPropertyPositionNormalizer('color', 'left'));\n stylesProcessor.setNormalizer('border-left-style', getBorderPropertyPositionNormalizer('style', 'left'));\n stylesProcessor.setNormalizer('border-left-width', getBorderPropertyPositionNormalizer('width', 'left'));\n stylesProcessor.setExtractor('border-top', getBorderPositionExtractor('top'));\n stylesProcessor.setExtractor('border-right', getBorderPositionExtractor('right'));\n stylesProcessor.setExtractor('border-bottom', getBorderPositionExtractor('bottom'));\n stylesProcessor.setExtractor('border-left', getBorderPositionExtractor('left'));\n stylesProcessor.setExtractor('border-top-color', 'border.color.top');\n stylesProcessor.setExtractor('border-right-color', 'border.color.right');\n stylesProcessor.setExtractor('border-bottom-color', 'border.color.bottom');\n stylesProcessor.setExtractor('border-left-color', 'border.color.left');\n stylesProcessor.setExtractor('border-top-width', 'border.width.top');\n stylesProcessor.setExtractor('border-right-width', 'border.width.right');\n stylesProcessor.setExtractor('border-bottom-width', 'border.width.bottom');\n stylesProcessor.setExtractor('border-left-width', 'border.width.left');\n stylesProcessor.setExtractor('border-top-style', 'border.style.top');\n stylesProcessor.setExtractor('border-right-style', 'border.style.right');\n stylesProcessor.setExtractor('border-bottom-style', 'border.style.bottom');\n stylesProcessor.setExtractor('border-left-style', 'border.style.left');\n stylesProcessor.setReducer('border-color', getBoxSidesValueReducer('border-color'));\n stylesProcessor.setReducer('border-style', getBoxSidesValueReducer('border-style'));\n stylesProcessor.setReducer('border-width', getBoxSidesValueReducer('border-width'));\n stylesProcessor.setReducer('border-top', getBorderPositionReducer('top'));\n stylesProcessor.setReducer('border-right', getBorderPositionReducer('right'));\n stylesProcessor.setReducer('border-bottom', getBorderPositionReducer('bottom'));\n stylesProcessor.setReducer('border-left', getBorderPositionReducer('left'));\n stylesProcessor.setReducer('border', getBorderReducer());\n stylesProcessor.setStyleRelation('border', [\n 'border-color', 'border-style', 'border-width',\n 'border-top', 'border-right', 'border-bottom', 'border-left',\n 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color',\n 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style',\n 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width'\n ]);\n stylesProcessor.setStyleRelation('border-color', [\n 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color'\n ]);\n stylesProcessor.setStyleRelation('border-style', [\n 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style'\n ]);\n stylesProcessor.setStyleRelation('border-width', [\n 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width'\n ]);\n stylesProcessor.setStyleRelation('border-top', ['border-top-color', 'border-top-style', 'border-top-width']);\n stylesProcessor.setStyleRelation('border-right', ['border-right-color', 'border-right-style', 'border-right-width']);\n stylesProcessor.setStyleRelation('border-bottom', ['border-bottom-color', 'border-bottom-style', 'border-bottom-width']);\n stylesProcessor.setStyleRelation('border-left', ['border-left-color', 'border-left-style', 'border-left-width']);\n}\nfunction getBorderNormalizer() {\n return value => {\n const { color, style, width } = normalizeBorderShorthand(value);\n return {\n path: 'border',\n value: {\n color: getBoxSidesValues(color),\n style: getBoxSidesValues(style),\n width: getBoxSidesValues(width)\n }\n };\n };\n}\nfunction getBorderPositionNormalizer(side) {\n return value => {\n const { color, style, width } = normalizeBorderShorthand(value);\n const border = {};\n if (color !== undefined) {\n border.color = { [side]: color };\n }\n if (style !== undefined) {\n border.style = { [side]: style };\n }\n if (width !== undefined) {\n border.width = { [side]: width };\n }\n return {\n path: 'border',\n value: border\n };\n };\n}\nfunction getBorderPropertyNormalizer(propertyName) {\n return value => {\n return {\n path: 'border',\n value: toBorderPropertyShorthand(value, propertyName)\n };\n };\n}\nfunction toBorderPropertyShorthand(value, property) {\n return {\n [property]: getBoxSidesValues(value)\n };\n}\nfunction getBorderPropertyPositionNormalizer(property, side) {\n return value => {\n return {\n path: 'border',\n value: {\n [property]: {\n [side]: value\n }\n }\n };\n };\n}\nfunction getBorderPositionExtractor(which) {\n return (name, styles) => {\n if (styles.border) {\n return extractBorderPosition(styles.border, which);\n }\n };\n}\nfunction extractBorderPosition(border, which) {\n const value = {};\n if (border.width && border.width[which]) {\n value.width = border.width[which];\n }\n if (border.style && border.style[which]) {\n value.style = border.style[which];\n }\n if (border.color && border.color[which]) {\n value.color = border.color[which];\n }\n return value;\n}\nfunction normalizeBorderShorthand(string) {\n const result = {};\n const parts = getShorthandValues(string);\n for (const part of parts) {\n if (isLength(part) || /thin|medium|thick/.test(part)) {\n result.width = part;\n }\n else if (isLineStyle(part)) {\n result.style = part;\n }\n else {\n result.color = part;\n }\n }\n return result;\n}\n/**\n * The border reducer factory.\n *\n * It tries to produce the most optimal output for the specified styles.\n *\n * For a border style:\n *\n * ```css\n * style: {top: \"solid\", bottom: \"solid\", right: \"solid\", left: \"solid\"}\n * ```\n *\n * It will produce: `border-style: solid`.\n * For a border style and color:\n *\n * ```css\n * color: {top: \"#ff0\", bottom: \"#ff0\", right: \"#ff0\", left: \"#ff0\"}\n * style: {top: \"solid\", bottom: \"solid\", right: \"solid\", left: \"solid\"}\n * ```\n *\n * It will produce: `border-color: #ff0; border-style: solid`.\n * If all border parameters are specified:\n *\n * ```css\n * color: {top: \"#ff0\", bottom: \"#ff0\", right: \"#ff0\", left: \"#ff0\"}\n * style: {top: \"solid\", bottom: \"solid\", right: \"solid\", left: \"solid\"}\n * width: {top: \"2px\", bottom: \"2px\", right: \"2px\", left: \"2px\"}\n * ```\n *\n * It will combine everything into a single property: `border: 2px solid #ff0`.\n *\n * The definitions are merged only if all border selectors have the same values.\n */\nfunction getBorderReducer() {\n return value => {\n const topStyles = extractBorderPosition(value, 'top');\n const rightStyles = extractBorderPosition(value, 'right');\n const bottomStyles = extractBorderPosition(value, 'bottom');\n const leftStyles = extractBorderPosition(value, 'left');\n const borderStyles = [topStyles, rightStyles, bottomStyles, leftStyles];\n const borderStylesByType = {\n width: getReducedStyleValueForType(borderStyles, 'width'),\n style: getReducedStyleValueForType(borderStyles, 'style'),\n color: getReducedStyleValueForType(borderStyles, 'color')\n };\n // Try reducing to a single `border:` property.\n const reducedBorderStyle = reduceBorderPosition(borderStylesByType, 'all');\n if (reducedBorderStyle.length) {\n return reducedBorderStyle;\n }\n // Try reducing to `border-style:`, `border-width:`, `border-color:` properties.\n const reducedStyleTypes = Object.entries(borderStylesByType).reduce((reducedStyleTypes, [type, value]) => {\n if (value) {\n reducedStyleTypes.push([`border-${type}`, value]);\n // Remove it from the full set to not include it in the most specific properties later.\n borderStyles.forEach(style => delete style[type]);\n }\n return reducedStyleTypes;\n }, []);\n // The reduced properties (by type) and all that remains that could not be reduced.\n return [\n ...reducedStyleTypes,\n ...reduceBorderPosition(topStyles, 'top'),\n ...reduceBorderPosition(rightStyles, 'right'),\n ...reduceBorderPosition(bottomStyles, 'bottom'),\n ...reduceBorderPosition(leftStyles, 'left')\n ];\n };\n /**\n * @param styles The array of objects with `style`, `color`, `width` properties.\n */\n function getReducedStyleValueForType(styles, type) {\n return styles\n .map(style => style[type])\n .reduce((result, style) => result == style ? result : null);\n }\n}\nfunction getBorderPositionReducer(which) {\n return value => reduceBorderPosition(value, which);\n}\n/**\n * Returns an array with reduced border styles depending on the specified values.\n *\n * If all border properties (width, style, color) are specified, the returned selector will be\n * merged into a group: `border-*: [width] [style] [color]`.\n *\n * Otherwise, the specific definitions will be returned: `border-(width|style|color)-*: [value]`.\n *\n * @param value Styles if defined.\n * @param which The border position.\n */\nfunction reduceBorderPosition(value, which) {\n const borderTypes = [];\n if (value && (value.width)) {\n borderTypes.push('width');\n }\n if (value && (value.style)) {\n borderTypes.push('style');\n }\n if (value && (value.color)) {\n borderTypes.push('color');\n }\n if (borderTypes.length == 3) {\n const borderValue = borderTypes.map(item => value[item]).join(' ');\n return [\n which == 'all' ? ['border', borderValue] : [`border-${which}`, borderValue]\n ];\n }\n // We are unable to reduce to a single `border:` property.\n if (which == 'all') {\n return [];\n }\n return borderTypes.map(type => {\n return [`border-${which}-${type}`, value[type]];\n });\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { getPositionShorthandNormalizer, getBoxSidesValueReducer } from './utils';\n/**\n * Adds a margin CSS styles processing rules.\n *\n * ```ts\n * editor.data.addStyleProcessorRules( addMarginRules );\n * ```\n *\n * The normalized value is stored as:\n *\n * ```ts\n * const styles = {\n * \tmargin: {\n * \t\ttop,\n * \t\tright,\n * \t\tbottom,\n * \t\tleft\n * \t}\n * };\n * ```\n */\nexport function addMarginRules(stylesProcessor) {\n stylesProcessor.setNormalizer('margin', getPositionShorthandNormalizer('margin'));\n stylesProcessor.setNormalizer('margin-top', value => ({ path: 'margin.top', value }));\n stylesProcessor.setNormalizer('margin-right', value => ({ path: 'margin.right', value }));\n stylesProcessor.setNormalizer('margin-bottom', value => ({ path: 'margin.bottom', value }));\n stylesProcessor.setNormalizer('margin-left', value => ({ path: 'margin.left', value }));\n stylesProcessor.setReducer('margin', getBoxSidesValueReducer('margin'));\n stylesProcessor.setStyleRelation('margin', ['margin-top', 'margin-right', 'margin-bottom', 'margin-left']);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { getPositionShorthandNormalizer, getBoxSidesValueReducer } from './utils';\n/**\n * Adds a margin CSS styles processing rules.\n *\n * ```ts\n * editor.data.addStyleProcessorRules( addPaddingRules );\n * ```\n *\n * The normalized value is stored as:\n *\n * ```ts\n * const styles = {\n * \tpadding: {\n * \t\ttop,\n * \t\tright,\n * \t\tbottom,\n * \t\tleft\n * \t}\n * };\n * ```\n */\nexport function addPaddingRules(stylesProcessor) {\n stylesProcessor.setNormalizer('padding', getPositionShorthandNormalizer('padding'));\n stylesProcessor.setNormalizer('padding-top', value => ({ path: 'padding.top', value }));\n stylesProcessor.setNormalizer('padding-right', value => ({ path: 'padding.right', value }));\n stylesProcessor.setNormalizer('padding-bottom', value => ({ path: 'padding.bottom', value }));\n stylesProcessor.setNormalizer('padding-left', value => ({ path: 'padding.left', value }));\n stylesProcessor.setReducer('padding', getBoxSidesValueReducer('padding'));\n stylesProcessor.setStyleRelation('padding', ['padding-top', 'padding-right', 'padding-bottom', 'padding-left']);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/commandcollection\n */\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Collection of commands. Its instance is available in {@link module:core/editor/editor~Editor#commands `editor.commands`}.\n */\nexport default class CommandCollection {\n /**\n * Creates collection instance.\n */\n constructor() {\n this._commands = new Map();\n }\n /**\n * Registers a new command.\n *\n * @param commandName The name of the command.\n */\n add(commandName, command) {\n this._commands.set(commandName, command);\n }\n /**\n * Retrieves a command from the collection.\n *\n * @param commandName The name of the command.\n */\n get(commandName) {\n return this._commands.get(commandName);\n }\n /**\n * Executes a command.\n *\n * @param commandName The name of the command.\n * @param commandParams Command parameters.\n * @returns The value returned by the {@link module:core/command~Command#execute `command.execute()`}.\n */\n execute(commandName, ...commandParams) {\n const command = this.get(commandName);\n if (!command) {\n /**\n * Command does not exist.\n *\n * @error commandcollection-command-not-found\n * @param commandName Name of the command.\n */\n throw new CKEditorError('commandcollection-command-not-found', this, { commandName });\n }\n return command.execute(...commandParams);\n }\n /**\n * Returns iterator of command names.\n */\n *names() {\n yield* this._commands.keys();\n }\n /**\n * Returns iterator of command instances.\n */\n *commands() {\n yield* this._commands.values();\n }\n /**\n * Iterable interface.\n *\n * Returns `[ commandName, commandInstance ]` pairs.\n */\n [Symbol.iterator]() {\n return this._commands[Symbol.iterator]();\n }\n /**\n * Destroys all collection commands.\n */\n destroy() {\n for (const command of this.commands()) {\n command.destroy();\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/editingkeystrokehandler\n */\nimport { KeystrokeHandler } from '@ckeditor/ckeditor5-utils';\n/**\n * A keystroke handler for editor editing. Its instance is available\n * in {@link module:core/editor/editor~Editor#keystrokes} so plugins\n * can register their keystrokes.\n *\n * E.g. an undo plugin would do this:\n *\n * ```ts\n * editor.keystrokes.set( 'Ctrl+Z', 'undo' );\n * editor.keystrokes.set( 'Ctrl+Shift+Z', 'redo' );\n * editor.keystrokes.set( 'Ctrl+Y', 'redo' );\n * ```\n */\nexport default class EditingKeystrokeHandler extends KeystrokeHandler {\n /**\n * Creates an instance of the keystroke handler.\n */\n constructor(editor) {\n super();\n this.editor = editor;\n }\n /**\n * Registers a handler for the specified keystroke.\n *\n * The handler can be specified as a command name or a callback.\n *\n * @param keystroke Keystroke defined in a format accepted by\n * the {@link module:utils/keyboard~parseKeystroke} function.\n * @param callback If a string is passed, then the keystroke will\n * {@link module:core/editor/editor~Editor#execute execute a command}.\n * If a function, then it will be called with the\n * {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and\n * a `cancel()` helper to both `preventDefault()` and `stopPropagation()` of the event.\n * @param options Additional options.\n * @param options.priority The priority of the keystroke callback. The higher the priority value\n * the sooner the callback will be executed. Keystrokes having the same priority\n * are called in the order they were added.\n */\n set(keystroke, callback, options = {}) {\n if (typeof callback == 'string') {\n const commandName = callback;\n callback = (evtData, cancel) => {\n this.editor.execute(commandName);\n cancel();\n };\n }\n super.set(keystroke, callback, options);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/editor/editor\n */\nimport { Config, CKEditorError, ObservableMixin } from '@ckeditor/ckeditor5-utils';\nimport { Conversion, DataController, EditingController, Model, StylesProcessor } from '@ckeditor/ckeditor5-engine';\nimport Context from '../context';\nimport PluginCollection from '../plugincollection';\nimport CommandCollection from '../commandcollection';\nimport EditingKeystrokeHandler from '../editingkeystrokehandler';\n/**\n * The class representing a basic, generic editor.\n *\n * Check out the list of its subclasses to learn about specific editor implementations.\n *\n * All editor implementations (like {@link module:editor-classic/classiceditor~ClassicEditor} or\n * {@link module:editor-inline/inlineeditor~InlineEditor}) should extend this class. They can add their\n * own methods and properties.\n *\n * When you are implementing a plugin, this editor represents the API\n * which your plugin can expect to get when using its {@link module:core/plugin~Plugin#editor} property.\n *\n * This API should be sufficient in order to implement the \"editing\" part of your feature\n * (schema definition, conversion, commands, keystrokes, etc.).\n * It does not define the editor UI, which is available only if\n * the specific editor implements also the {@link ~Editor#ui} property\n * (as most editor implementations do).\n */\nexport default class Editor extends ObservableMixin() {\n /**\n * Creates a new instance of the editor class.\n *\n * Usually, not to be used directly. See the static {@link module:core/editor/editor~Editor.create `create()`} method.\n *\n * @param config The editor configuration.\n */\n constructor(config = {}) {\n super();\n const constructor = this.constructor;\n // Prefer the language passed as the argument to the constructor instead of the constructor's `defaultConfig`, if both are set.\n const language = config.language || (constructor.defaultConfig && constructor.defaultConfig.language);\n this._context = config.context || new Context({ language });\n this._context._addEditor(this, !config.context);\n // Clone the plugins to make sure that the plugin array will not be shared\n // between editors and make the watchdog feature work correctly.\n const availablePlugins = Array.from(constructor.builtinPlugins || []);\n this.config = new Config(config, constructor.defaultConfig);\n this.config.define('plugins', availablePlugins);\n this.config.define(this._context._getEditorConfig());\n this.plugins = new PluginCollection(this, availablePlugins, this._context.plugins);\n this.locale = this._context.locale;\n this.t = this.locale.t;\n this._readOnlyLocks = new Set();\n this.commands = new CommandCollection();\n this.set('state', 'initializing');\n this.once('ready', () => (this.state = 'ready'), { priority: 'high' });\n this.once('destroy', () => (this.state = 'destroyed'), { priority: 'high' });\n this.model = new Model();\n this.on('change:isReadOnly', () => {\n this.model.document.isReadOnly = this.isReadOnly;\n });\n const stylesProcessor = new StylesProcessor();\n this.data = new DataController(this.model, stylesProcessor);\n this.editing = new EditingController(this.model, stylesProcessor);\n this.editing.view.document.bind('isReadOnly').to(this);\n this.conversion = new Conversion([this.editing.downcastDispatcher, this.data.downcastDispatcher], this.data.upcastDispatcher);\n this.conversion.addAlias('dataDowncast', this.data.downcastDispatcher);\n this.conversion.addAlias('editingDowncast', this.editing.downcastDispatcher);\n this.keystrokes = new EditingKeystrokeHandler(this);\n this.keystrokes.listenTo(this.editing.view.document);\n }\n /**\n * Defines whether the editor is in the read-only mode.\n *\n * In read-only mode the editor {@link #commands commands} are disabled so it is not possible\n * to modify the document by using them. Also, the editable element(s) become non-editable.\n *\n * In order to make the editor read-only, you need to call the {@link #enableReadOnlyMode} method:\n *\n * ```ts\n * editor.enableReadOnlyMode( 'feature-id' );\n * ```\n *\n * Later, to turn off the read-only mode, call {@link #disableReadOnlyMode}:\n *\n * ```ts\n * editor.disableReadOnlyMode( 'feature-id' );\n * ```\n *\n * @readonly\n * @observable\n */\n get isReadOnly() {\n return this._readOnlyLocks.size > 0;\n }\n set isReadOnly(value) {\n /**\n * The {@link module:core/editor/editor~Editor#isReadOnly Editor#isReadOnly} property is read-only since version `34.0.0`\n * and can be set only using {@link module:core/editor/editor~Editor#enableReadOnlyMode `Editor#enableReadOnlyMode( lockId )`} and\n * {@link module:core/editor/editor~Editor#disableReadOnlyMode `Editor#disableReadOnlyMode( lockId )`}.\n *\n * Usage before version `34.0.0`:\n *\n * ```ts\n * editor.isReadOnly = true;\n * editor.isReadOnly = false;\n * ```\n *\n * Usage since version `34.0.0`:\n *\n * ```ts\n * editor.enableReadOnlyMode( 'my-feature-id' );\n * editor.disableReadOnlyMode( 'my-feature-id' );\n * ```\n *\n * @error editor-isreadonly-has-no-setter\n */\n throw new CKEditorError('editor-isreadonly-has-no-setter');\n }\n /**\n * Turns on the read-only mode in the editor.\n *\n * Editor can be switched to or out of the read-only mode by many features, under various circumstances. The editor supports locking\n * mechanism for the read-only mode. It enables easy control over the read-only mode when many features wants to turn it on or off at\n * the same time, without conflicting with each other. It guarantees that you will not make the editor editable accidentally (which\n * could lead to errors).\n *\n * Each read-only mode request is identified by a unique id (also called \"lock\"). If multiple plugins requested to turn on the\n * read-only mode, then, the editor will become editable only after all these plugins turn the read-only mode off (using the same ids).\n *\n * Note, that you cannot force the editor to disable the read-only mode if other plugins set it.\n *\n * After the first `enableReadOnlyMode()` call, the {@link #isReadOnly `isReadOnly` property} will be set to `true`:\n *\n * ```ts\n * editor.isReadOnly; // `false`.\n * editor.enableReadOnlyMode( 'my-feature-id' );\n * editor.isReadOnly; // `true`.\n * ```\n *\n * You can turn off the read-only mode (\"clear the lock\") using the {@link #disableReadOnlyMode `disableReadOnlyMode()`} method:\n *\n * ```ts\n * editor.enableReadOnlyMode( 'my-feature-id' );\n * // ...\n * editor.disableReadOnlyMode( 'my-feature-id' );\n * editor.isReadOnly; // `false`.\n * ```\n *\n * All \"locks\" need to be removed to enable editing:\n *\n * ```ts\n * editor.enableReadOnlyMode( 'my-feature-id' );\n * editor.enableReadOnlyMode( 'my-other-feature-id' );\n * // ...\n * editor.disableReadOnlyMode( 'my-feature-id' );\n * editor.isReadOnly; // `true`.\n * editor.disableReadOnlyMode( 'my-other-feature-id' );\n * editor.isReadOnly; // `false`.\n * ```\n *\n * @param lockId A unique ID for setting the editor to the read-only state.\n */\n enableReadOnlyMode(lockId) {\n if (typeof lockId !== 'string' && typeof lockId !== 'symbol') {\n /**\n * The lock ID is missing or it is not a string or symbol.\n *\n * @error editor-read-only-lock-id-invalid\n */\n throw new CKEditorError('editor-read-only-lock-id-invalid', null, { lockId });\n }\n if (this._readOnlyLocks.has(lockId)) {\n return;\n }\n this._readOnlyLocks.add(lockId);\n if (this._readOnlyLocks.size === 1) {\n // Manually fire the `change:isReadOnly` event as only getter is provided.\n this.fire('change:isReadOnly', 'isReadOnly', true, false);\n }\n }\n /**\n * Removes the read-only lock from the editor with given lock ID.\n *\n * When no lock is present on the editor anymore, then the {@link #isReadOnly `isReadOnly` property} will be set to `false`.\n *\n * @param lockId The lock ID for setting the editor to the read-only state.\n */\n disableReadOnlyMode(lockId) {\n if (typeof lockId !== 'string' && typeof lockId !== 'symbol') {\n throw new CKEditorError('editor-read-only-lock-id-invalid', null, { lockId });\n }\n if (!this._readOnlyLocks.has(lockId)) {\n return;\n }\n this._readOnlyLocks.delete(lockId);\n if (this._readOnlyLocks.size === 0) {\n // Manually fire the `change:isReadOnly` event as only getter is provided.\n this.fire('change:isReadOnly', 'isReadOnly', false, true);\n }\n }\n /**\n * Loads and initializes plugins specified in the configuration.\n *\n * @returns A promise which resolves once the initialization is completed, providing an array of loaded plugins.\n */\n initPlugins() {\n const config = this.config;\n const plugins = config.get('plugins');\n const removePlugins = config.get('removePlugins') || [];\n const extraPlugins = config.get('extraPlugins') || [];\n const substitutePlugins = config.get('substitutePlugins') || [];\n return this.plugins.init(plugins.concat(extraPlugins), removePlugins, substitutePlugins);\n }\n /**\n * Destroys the editor instance, releasing all resources used by it.\n *\n * **Note** The editor cannot be destroyed during the initialization phase so if it is called\n * while the editor {@link #state is being initialized}, it will wait for the editor initialization before destroying it.\n *\n * @fires destroy\n * @returns A promise that resolves once the editor instance is fully destroyed.\n */\n destroy() {\n let readyPromise = Promise.resolve();\n if (this.state == 'initializing') {\n readyPromise = new Promise(resolve => this.once('ready', resolve));\n }\n return readyPromise\n .then(() => {\n this.fire('destroy');\n this.stopListening();\n this.commands.destroy();\n })\n .then(() => this.plugins.destroy())\n .then(() => {\n this.model.destroy();\n this.data.destroy();\n this.editing.destroy();\n this.keystrokes.destroy();\n })\n // Remove the editor from the context.\n // When the context was created by this editor, the context will be destroyed.\n .then(() => this._context._removeEditor(this));\n }\n /**\n * Executes the specified command with given parameters.\n *\n * Shorthand for:\n *\n * ```ts\n * editor.commands.get( commandName ).execute( ... );\n * ```\n *\n * @param commandName The name of the command to execute.\n * @param commandParams Command parameters.\n * @returns The value returned by the {@link module:core/commandcollection~CommandCollection#execute `commands.execute()`}.\n */\n execute(commandName, ...commandParams) {\n try {\n return this.commands.execute(commandName, ...commandParams);\n }\n catch (err) {\n // @if CK_DEBUG // throw err;\n /* istanbul ignore next -- @preserve */\n CKEditorError.rethrowUnexpectedError(err, this);\n }\n }\n /**\n * Focuses the editor.\n *\n * **Note** To explicitly focus the editing area of the editor, use the\n * {@link module:engine/view/view~View#focus `editor.editing.view.focus()`} method of the editing view.\n *\n * Check out the {@glink framework/deep-dive/ui/focus-tracking#focus-in-the-editor-ui Focus in the editor UI} section\n * of the {@glink framework/deep-dive/ui/focus-tracking Deep dive into focus tracking} guide to learn more.\n */\n focus() {\n this.editing.view.focus();\n }\n /* istanbul ignore next -- @preserve */\n /**\n * Creates and initializes a new editor instance.\n *\n * This is an abstract method. Every editor type needs to implement its own initialization logic.\n *\n * See the `create()` methods of the existing editor types to learn how to use them:\n *\n * * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}\n * * {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`}\n * * {@link module:editor-decoupled/decouplededitor~DecoupledEditor.create `DecoupledEditor.create()`}\n * * {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`}\n */\n static create(...args) {\n throw new Error('This is an abstract method.');\n }\n}\n/**\n * This error is thrown when trying to pass a `<textarea>` element to a `create()` function of an editor class.\n *\n * The only editor type which can be initialized on `<textarea>` elements is\n * the {@glink installation/getting-started/predefined-builds#classic-editor classic editor}.\n * This editor hides the passed element and inserts its own UI next to it. Other types of editors reuse the passed element as their root\n * editable element and therefore `<textarea>` is not appropriate for them. Use a `<div>` or another text container instead:\n *\n * ```html\n * <div id=\"editor\">\n * \t<p>Initial content.</p>\n * </div>\n * ```\n *\n * @error editor-wrong-element\n */\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Implementation of the {@link module:core/editor/utils/dataapimixin~DataApi}.\n */\nexport default function DataApiMixin(base) {\n class Mixin extends base {\n setData(data) {\n this.data.set(data);\n }\n getData(options) {\n return this.data.get(options);\n }\n }\n return Mixin;\n}\n// Backward compatibility with `mix`.\n{\n const mixin = DataApiMixin(Object);\n DataApiMixin.setData = mixin.prototype.setData;\n DataApiMixin.getData = mixin.prototype.getData;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/editor/utils/elementapimixin\n */\nimport { CKEditorError, setDataInElement } from '@ckeditor/ckeditor5-utils';\n/**\n * Implementation of the {@link module:core/editor/utils/elementapimixin~ElementApi}.\n */\nexport default function ElementApiMixin(base) {\n class Mixin extends base {\n updateSourceElement(data = this.data.get()) {\n if (!this.sourceElement) {\n /**\n * Cannot update the source element of a detached editor.\n *\n * The {@link module:core/editor/utils/elementapimixin~ElementApi#updateSourceElement `updateSourceElement()`}\n * method cannot be called if you did not pass an element to `Editor.create()`.\n *\n * @error editor-missing-sourceelement\n */\n throw new CKEditorError('editor-missing-sourceelement', this);\n }\n const shouldUpdateSourceElement = this.config.get('updateSourceElementOnDestroy');\n const isSourceElementTextArea = this.sourceElement instanceof HTMLTextAreaElement;\n // The data returned by the editor might be unsafe, so we want to prevent rendering\n // unsafe content inside the source element different than <textarea>, which is considered\n // secure. This behaviour could be changed by setting the `updateSourceElementOnDestroy`\n // configuration option to `true`.\n if (!shouldUpdateSourceElement && !isSourceElementTextArea) {\n setDataInElement(this.sourceElement, '');\n return;\n }\n setDataInElement(this.sourceElement, data);\n }\n }\n return Mixin;\n}\n// Backward compatibility with `mix`.\nElementApiMixin.updateSourceElement = ElementApiMixin(Object).prototype.updateSourceElement;\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/pendingactions\n */\nimport ContextPlugin from './contextplugin';\nimport { CKEditorError, Collection, ObservableMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * The list of pending editor actions.\n *\n * This plugin should be used to synchronise plugins that execute long-lasting actions\n * (e.g. file upload) with the editor integration. It gives the developer who integrates the editor\n * an easy way to check if there are any actions pending whenever such information is needed.\n * All plugins that register a pending action also provide a message about the action that is ongoing\n * which can be displayed to the user. This lets them decide if they want to interrupt the action or wait.\n *\n * Adding and updating a pending action:\n *\n * ```ts\n * const pendingActions = editor.plugins.get( 'PendingActions' );\n * const action = pendingActions.add( 'Upload in progress: 0%.' );\n *\n * // You can update the message:\n * action.message = 'Upload in progress: 10%.';\n * ```\n *\n * Removing a pending action:\n *\n * ```ts\n * const pendingActions = editor.plugins.get( 'PendingActions' );\n * const action = pendingActions.add( 'Unsaved changes.' );\n *\n * pendingActions.remove( action );\n * ```\n *\n * Getting pending actions:\n *\n * ```ts\n * const pendingActions = editor.plugins.get( 'PendingActions' );\n *\n * const action1 = pendingActions.add( 'Action 1' );\n * const action2 = pendingActions.add( 'Action 2' );\n *\n * pendingActions.first; // Returns action1\n * Array.from( pendingActions ); // Returns [ action1, action2 ]\n * ```\n *\n * This plugin is used by features like {@link module:upload/filerepository~FileRepository} to register their ongoing actions\n * and by features like {@link module:autosave/autosave~Autosave} to detect whether there are any ongoing actions.\n * Read more about saving the data in the {@glink installation/getting-started/getting-and-setting-data Saving and getting data} guide.\n */\nexport default class PendingActions extends ContextPlugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'PendingActions';\n }\n /**\n * @inheritDoc\n */\n init() {\n this.set('hasAny', false);\n this._actions = new Collection({ idProperty: '_id' });\n this._actions.delegate('add', 'remove').to(this);\n }\n /**\n * Adds an action to the list of pending actions.\n *\n * This method returns an action object with an observable message property.\n * The action object can be later used in the {@link #remove} method. It also allows you to change the message.\n *\n * @param message The action message.\n * @returns An observable object that represents a pending action.\n */\n add(message) {\n if (typeof message !== 'string') {\n /**\n * The message must be a string.\n *\n * @error pendingactions-add-invalid-message\n */\n throw new CKEditorError('pendingactions-add-invalid-message', this);\n }\n const action = new (ObservableMixin())();\n action.set('message', message);\n this._actions.add(action);\n this.hasAny = true;\n return action;\n }\n /**\n * Removes an action from the list of pending actions.\n *\n * @param action An action object.\n */\n remove(action) {\n this._actions.remove(action);\n this.hasAny = !!this._actions.length;\n }\n /**\n * Returns the first action from the list or null if the list is empty\n *\n * @returns The pending action object.\n */\n get first() {\n return this._actions.get(0);\n }\n /**\n * Iterable interface.\n */\n [Symbol.iterator]() {\n return this._actions[Symbol.iterator]();\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m11.591 10.177 4.243 4.242a1 1 0 0 1-1.415 1.415l-4.242-4.243-4.243 4.243a1 1 0 0 1-1.414-1.415l4.243-4.242L4.52 5.934A1 1 0 0 1 5.934 4.52l4.243 4.243 4.242-4.243a1 1 0 1 1 1.415 1.414l-4.243 4.243z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core\n */\nexport { default as Plugin } from './plugin';\nexport { default as Command } from './command';\nexport { default as MultiCommand } from './multicommand';\nexport { default as Context } from './context';\nexport { default as ContextPlugin } from './contextplugin';\nexport { default as Editor } from './editor/editor';\nexport { default as attachToForm } from './editor/utils/attachtoform';\nexport { default as DataApiMixin } from './editor/utils/dataapimixin';\nexport { default as ElementApiMixin } from './editor/utils/elementapimixin';\nexport { default as secureSourceElement } from './editor/utils/securesourceelement';\nexport { default as PendingActions } from './pendingactions';\nimport cancel from './../theme/icons/cancel.svg';\nimport caption from './../theme/icons/caption.svg';\nimport check from './../theme/icons/check.svg';\nimport cog from './../theme/icons/cog.svg';\nimport eraser from './../theme/icons/eraser.svg';\nimport lowVision from './../theme/icons/low-vision.svg';\nimport image from './../theme/icons/image.svg';\nimport alignBottom from './../theme/icons/align-bottom.svg';\nimport alignMiddle from './../theme/icons/align-middle.svg';\nimport alignTop from './../theme/icons/align-top.svg';\nimport alignLeft from './../theme/icons/align-left.svg';\nimport alignCenter from './../theme/icons/align-center.svg';\nimport alignRight from './../theme/icons/align-right.svg';\nimport alignJustify from './../theme/icons/align-justify.svg';\nimport objectBlockLeft from './../theme/icons/object-left.svg';\nimport objectCenter from './../theme/icons/object-center.svg';\nimport objectBlockRight from './../theme/icons/object-right.svg';\nimport objectFullWidth from './../theme/icons/object-full-width.svg';\nimport objectInline from './../theme/icons/object-inline.svg';\nimport objectLeft from './../theme/icons/object-inline-left.svg';\nimport objectRight from './../theme/icons/object-inline-right.svg';\nimport objectSizeFull from './../theme/icons/object-size-full.svg';\nimport objectSizeLarge from './../theme/icons/object-size-large.svg';\nimport objectSizeSmall from './../theme/icons/object-size-small.svg';\nimport objectSizeMedium from './../theme/icons/object-size-medium.svg';\nimport pencil from './../theme/icons/pencil.svg';\nimport pilcrow from './../theme/icons/pilcrow.svg';\nimport quote from './../theme/icons/quote.svg';\nimport threeVerticalDots from './../theme/icons/three-vertical-dots.svg';\nimport bold from './../theme/icons/bold.svg';\nimport paragraph from './../theme/icons/paragraph.svg';\nimport plus from './../theme/icons/plus.svg';\nimport text from './../theme/icons/text.svg';\nimport importExport from './../theme/icons/importexport.svg';\nexport const icons = {\n bold,\n cancel,\n caption,\n check,\n cog,\n eraser,\n image,\n lowVision,\n importExport,\n paragraph,\n plus,\n text,\n alignBottom,\n alignMiddle,\n alignTop,\n alignLeft,\n alignCenter,\n alignRight,\n alignJustify,\n objectLeft,\n objectCenter,\n objectRight,\n objectFullWidth,\n objectInline,\n objectBlockLeft,\n objectBlockRight,\n objectSizeFull,\n objectSizeLarge,\n objectSizeSmall,\n objectSizeMedium,\n pencil,\n pilcrow,\n quote,\n threeVerticalDots\n};\nimport './augmentation';\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M10.187 17H5.773c-.637 0-1.092-.138-1.364-.415-.273-.277-.409-.718-.409-1.323V4.738c0-.617.14-1.062.419-1.332.279-.27.73-.406 1.354-.406h4.68c.69 0 1.288.041 1.793.124.506.083.96.242 1.36.478.341.197.644.447.906.75a3.262 3.262 0 0 1 .808 2.162c0 1.401-.722 2.426-2.167 3.075C15.05 10.175 16 11.315 16 13.01a3.756 3.756 0 0 1-2.296 3.504 6.1 6.1 0 0 1-1.517.377c-.571.073-1.238.11-2 .11zm-.217-6.217H7v4.087h3.069c1.977 0 2.965-.69 2.965-2.072 0-.707-.256-1.22-.768-1.537-.512-.319-1.277-.478-2.296-.478zM7 5.13v3.619h2.606c.729 0 1.292-.067 1.69-.2a1.6 1.6 0 0 0 .91-.765c.165-.267.247-.566.247-.897 0-.707-.26-1.176-.778-1.409-.519-.232-1.31-.348-2.375-.348H7z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M2 16h9a1 1 0 0 1 0 2H2a1 1 0 0 1 0-2z\\\"/><path d=\\\"M17 1a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h14zm0 1.5H3a.5.5 0 0 0-.492.41L2.5 3v9a.5.5 0 0 0 .41.492L3 12.5h14a.5.5 0 0 0 .492-.41L17.5 12V3a.5.5 0 0 0-.41-.492L17 2.5z\\\" fill-opacity=\\\".6\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M6.972 16.615a.997.997 0 0 1-.744-.292l-4.596-4.596a1 1 0 1 1 1.414-1.414l3.926 3.926 9.937-9.937a1 1 0 0 1 1.414 1.415L7.717 16.323a.997.997 0 0 1-.745.292z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m11.333 2 .19 2.263a5.899 5.899 0 0 1 1.458.604L14.714 3.4 16.6 5.286l-1.467 1.733c.263.452.468.942.605 1.46L18 8.666v2.666l-2.263.19a5.899 5.899 0 0 1-.604 1.458l1.467 1.733-1.886 1.886-1.733-1.467a5.899 5.899 0 0 1-1.46.605L11.334 18H8.667l-.19-2.263a5.899 5.899 0 0 1-1.458-.604L5.286 16.6 3.4 14.714l1.467-1.733a5.899 5.899 0 0 1-.604-1.458L2 11.333V8.667l2.262-.189a5.899 5.899 0 0 1 .605-1.459L3.4 5.286 5.286 3.4l1.733 1.467a5.899 5.899 0 0 1 1.46-.605L8.666 2h2.666zM10 6.267a3.733 3.733 0 1 0 0 7.466 3.733 3.733 0 0 0 0-7.466z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m8.636 9.531-2.758 3.94a.5.5 0 0 0 .122.696l3.224 2.284h1.314l2.636-3.736L8.636 9.53zm.288 8.451L5.14 15.396a2 2 0 0 1-.491-2.786l6.673-9.53a2 2 0 0 1 2.785-.49l3.742 2.62a2 2 0 0 1 .491 2.785l-7.269 10.053-2.147-.066z\\\"/><path d=\\\"M4 18h5.523v-1H4zm-2 0h1v-1H2z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M6.91 10.54c.26-.23.64-.21.88.03l3.36 3.14 2.23-2.06a.64.64 0 0 1 .87 0l2.52 2.97V4.5H3.2v10.12l3.71-4.08zm10.27-7.51c.6 0 1.09.47 1.09 1.05v11.84c0 .59-.49 1.06-1.09 1.06H2.79c-.6 0-1.09-.47-1.09-1.06V4.08c0-.58.49-1.05 1.1-1.05h14.38zm-5.22 5.56a1.96 1.96 0 1 1 3.4-1.96 1.96 1.96 0 0 1-3.4 1.96z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M5.085 6.22 2.943 4.078a.75.75 0 1 1 1.06-1.06l2.592 2.59A11.094 11.094 0 0 1 10 5.068c4.738 0 8.578 3.101 8.578 5.083 0 1.197-1.401 2.803-3.555 3.887l1.714 1.713a.75.75 0 0 1-.09 1.138.488.488 0 0 1-.15.084.75.75 0 0 1-.821-.16L6.17 7.304c-.258.11-.51.233-.757.365l6.239 6.24-.006.005.78.78c-.388.094-.78.166-1.174.215l-1.11-1.11h.011L4.55 8.197a7.2 7.2 0 0 0-.665.514l-.112.098 4.897 4.897-.005.006 1.276 1.276a10.164 10.164 0 0 1-1.477-.117l-.479-.479-.009.009-4.863-4.863-.022.031a2.563 2.563 0 0 0-.124.2c-.043.077-.08.158-.108.241a.534.534 0 0 0-.028.133.29.29 0 0 0 .008.072.927.927 0 0 0 .082.226c.067.133.145.26.234.379l3.242 3.365.025.01.59.623c-3.265-.918-5.59-3.155-5.59-4.668 0-1.194 1.448-2.838 3.663-3.93zm7.07.531a4.632 4.632 0 0 1 1.108 5.992l.345.344.046-.018a9.313 9.313 0 0 0 2-1.112c.256-.187.5-.392.727-.613.137-.134.27-.277.392-.431.072-.091.141-.185.203-.286.057-.093.107-.19.148-.292a.72.72 0 0 0 .036-.12.29.29 0 0 0 .008-.072.492.492 0 0 0-.028-.133.999.999 0 0 0-.036-.096 2.165 2.165 0 0 0-.071-.145 2.917 2.917 0 0 0-.125-.2 3.592 3.592 0 0 0-.263-.335 5.444 5.444 0 0 0-.53-.523 7.955 7.955 0 0 0-1.054-.768 9.766 9.766 0 0 0-1.879-.891c-.337-.118-.68-.219-1.027-.301zm-2.85.21-.069.002a.508.508 0 0 0-.254.097.496.496 0 0 0-.104.679.498.498 0 0 0 .326.199l.045.005c.091.003.181.003.272.012a2.45 2.45 0 0 1 2.017 1.513c.024.061.043.125.069.185a.494.494 0 0 0 .45.287h.008a.496.496 0 0 0 .35-.158.482.482 0 0 0 .13-.335.638.638 0 0 0-.048-.219 3.379 3.379 0 0 0-.36-.723 3.438 3.438 0 0 0-2.791-1.543l-.028-.001h-.013z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><g clip-path=\\\"url(#a)\\\"><path clip-rule=\\\"evenodd\\\" d=\\\"M19 4.5 14 0H3v12.673l.868-1.041c.185-.222.4-.402.632-.54V1.5h8v5h5v7.626a2.24 2.24 0 0 1 1.5.822V4.5ZM14 5V2l3.3 3H14Zm-3.692 12.5c.062.105.133.206.213.303L11.52 19H8v-.876a2.243 2.243 0 0 0 1.82-.624h.488Zm7.518-.657a.75.75 0 0 0-1.152-.96L15.5 17.29V12H14v5.29l-1.174-1.408a.75.75 0 0 0-1.152.96l2.346 2.816a.95.95 0 0 0 1.46 0l2.346-2.815Zm-15.056-.38a.75.75 0 0 1-.096-1.056l2.346-2.815a.95.95 0 0 1 1.46 0l2.346 2.815a.75.75 0 1 1-1.152.96L6.5 14.96V20H5v-5.04l-1.174 1.408a.75.75 0 0 1-1.056.096Z\\\"/></g><defs><clipPath id=\\\"a\\\"><path d=\\\"M0 0h20v20H0z\\\"/></clipPath></defs></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M10.5 5.5H7v5h3.5a2.5 2.5 0 1 0 0-5zM5 3h6.5v.025a5 5 0 0 1 0 9.95V13H7v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M10 2a1 1 0 0 0-1 1v6H3a1 1 0 1 0 0 2h6v6a1 1 0 1 0 2 0v-6h6a1 1 0 1 0 0-2h-6V3a1 1 0 0 0-1-1Z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><g clip-path=\\\"url(#a)\\\"><path d=\\\"M9.816 11.5 7.038 4.785 4.261 11.5h5.555Zm.62 1.5H3.641l-1.666 4.028H.312l5.789-14h1.875l5.789 14h-1.663L10.436 13Z\\\"/><path clip-rule=\\\"evenodd\\\" d=\\\"m12.09 17-.534-1.292.848-1.971.545 1.319L12.113 17h-.023Zm1.142-5.187.545 1.319L15.5 9.13l1.858 4.316h-3.45l.398.965h3.467L18.887 17H20l-3.873-9h-1.254l-1.641 3.813Z\\\"/></g><defs><clipPath id=\\\"a\\\"><path d=\\\"M0 0h20v20H0z\\\"/></clipPath></defs></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m9.239 13.938-2.88-1.663a.75.75 0 0 1 .75-1.3L9 12.067V4.75a.75.75 0 1 1 1.5 0v7.318l1.89-1.093a.75.75 0 0 1 .75 1.3l-2.879 1.663a.752.752 0 0 1-.511.187.752.752 0 0 1-.511-.187zM4.25 17a.75.75 0 1 1 0-1.5h10.5a.75.75 0 0 1 0 1.5H4.25z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M9.75 11.875a.752.752 0 0 1 .508.184l2.883 1.666a.75.75 0 0 1-.659 1.344l-.091-.044-1.892-1.093.001 4.318a.75.75 0 1 1-1.5 0v-4.317l-1.89 1.092a.75.75 0 0 1-.75-1.3l2.879-1.663a.752.752 0 0 1 .51-.187zM15.25 9a.75.75 0 1 1 0 1.5H4.75a.75.75 0 1 1 0-1.5h10.5zM9.75.375a.75.75 0 0 1 .75.75v4.318l1.89-1.093.092-.045a.75.75 0 0 1 .659 1.344l-2.883 1.667a.752.752 0 0 1-.508.184.752.752 0 0 1-.511-.187L6.359 5.65a.75.75 0 0 1 .75-1.299L9 5.442V1.125a.75.75 0 0 1 .75-.75z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m10.261 7.062 2.88 1.663a.75.75 0 0 1-.75 1.3L10.5 8.933v7.317a.75.75 0 1 1-1.5 0V8.932l-1.89 1.093a.75.75 0 0 1-.75-1.3l2.879-1.663a.752.752 0 0 1 .511-.187.752.752 0 0 1 .511.187zM15.25 4a.75.75 0 1 1 0 1.5H4.75a.75.75 0 0 1 0-1.5h10.5z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm2.286 4c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h9.928a.75.75 0 1 0 0-1.5H5.036a.75.75 0 0 0-.75.75z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M18 3.75a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 8a.75.75 0 0 1-.75.75H2.75a.75.75 0 1 1 0-1.5h14.5a.75.75 0 0 1 .75.75zm0 4a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75zm0-8a.75.75 0 0 1-.75.75H7.321a.75.75 0 1 1 0-1.5h9.929a.75.75 0 0 1 .75.75z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0 4c0 .414.336.75.75.75h9.929a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm0-8c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path opacity=\\\".5\\\" d=\\\"M2 3h16v1.5H2zm11.5 9H18v1.5h-4.5zm0-3H18v1.5h-4.5zm0-3H18v1.5h-4.5zM2 15h16v1.5H2z\\\"/><path d=\\\"M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path opacity=\\\".5\\\" d=\\\"M2 3h16v1.5H2zm0 12h16v1.5H2z\\\"/><path d=\\\"M15.003 7v5.5a1 1 0 0 1-1 1H5.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H6.5V12h6.997V7.5z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path opacity=\\\".5\\\" d=\\\"M2 3h16v1.5H2zm0 12h16v1.5H2zm0-9h5v1.5H2zm0 3h5v1.5H2zm0 3h5v1.5H2z\\\"/><path d=\\\"M18.003 7v5.5a1 1 0 0 1-1 1H8.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H9.5V12h6.997V7.5z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path opacity=\\\".5\\\" d=\\\"M2 3h16v1.5H2zm0 12h16v1.5H2z\\\"/><path d=\\\"M18 7v5.5a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1zm-1.505.5H3.504V12h12.991V7.5z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path opacity=\\\".5\\\" d=\\\"M2 3h16v1.5H2zm11.5 9H18v1.5h-4.5zM2 15h16v1.5H2z\\\"/><path d=\\\"M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path opacity=\\\".5\\\" d=\\\"M2 3h16v1.5H2zm0 12h16v1.5H2z\\\"/><path d=\\\"M12.003 7v5.5a1 1 0 0 1-1 1H2.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H3.5V12h6.997V7.5z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path opacity=\\\".5\\\" d=\\\"M2 3h16v1.5H2zm0 12h16v1.5H2z\\\"/><path d=\\\"M18.003 7v5.5a1 1 0 0 1-1 1H8.996a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h8.007a1 1 0 0 1 1 1zm-1.506.5H9.5V12h6.997V7.5z\\\"/></svg>\";","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 20 20\\\"><path d=\\\"M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z\\\"/><path d=\\\"M18.095 2H1.905C.853 2 0 2.895 0 4v12c0 1.105.853 2 1.905 2h16.19C19.147 18 20 17.105 20 16V4c0-1.105-.853-2-1.905-2zm0 1.5c.263 0 .476.224.476.5v12c0 .276-.213.5-.476.5H1.905a.489.489 0 0 1-.476-.5V4c0-.276.213-.5.476-.5h16.19z\\\"/></svg>\";","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 20 20\\\"><path d=\\\"M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm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1V2h1z\\\"/><path d=\\\"M7 10H2a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5h5z\\\"/></svg>\";","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 20 20\\\"><path d=\\\"M2.5 17v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zm2 0v1h-1v-1h1zM1 15.5v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm-19-2v1H0v-1h1zm19 0v1h-1v-1h1zm0-2v1h-1v-1h1zm-19 0v1H0v-1h1zM14.5 2v1h-1V2h1zm2 0v1h-1V2h1zm2 0v1h-1V2h1zm-8 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm-2 0v1h-1V2h1zm8 0v1h-1V2h1zm-10 0v1h-1V2h1z\\\"/><path d=\\\"M10 8H2a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2zm0 1.5a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-.5.5H2a.5.5 0 0 1-.5-.5v-6a.5.5 0 0 1 .5-.5h8z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m7.3 17.37-.061.088a1.518 1.518 0 0 1-.934.535l-4.178.663-.806-4.153a1.495 1.495 0 0 1 .187-1.058l.056-.086L8.77 2.639c.958-1.351 2.803-1.076 4.296-.03 1.497 1.047 2.387 2.693 1.433 4.055L7.3 17.37zM9.14 4.728l-5.545 8.346 3.277 2.294 5.544-8.346L9.14 4.728zM6.07 16.512l-3.276-2.295.53 2.73 2.746-.435zM9.994 3.506 13.271 5.8c.316-.452-.16-1.333-1.065-1.966-.905-.634-1.895-.78-2.212-.328zM8 18.5 9.375 17H19v1.5H8z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M6.999 2H15a1 1 0 0 1 0 2h-1.004v13a1 1 0 1 1-2 0V4H8.999v13a1 1 0 1 1-2 0v-7A4 4 0 0 1 3 6a4 4 0 0 1 3.999-4z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M3 10.423a6.5 6.5 0 0 1 6.056-6.408l.038.67C6.448 5.423 5.354 7.663 5.22 10H9c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574zm8 0a6.5 6.5 0 0 1 6.056-6.408l.038.67c-2.646.739-3.74 2.979-3.873 5.315H17c.552 0 .5.432.5.986v4.511c0 .554-.448.503-1 .503h-5c-.552 0-.5-.449-.5-1.003v-4.574z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><circle cx=\\\"9.5\\\" cy=\\\"4.5\\\" r=\\\"1.5\\\"/><circle cx=\\\"9.5\\\" cy=\\\"10.5\\\" r=\\\"1.5\\\"/><circle cx=\\\"9.5\\\" cy=\\\"16.5\\\" r=\\\"1.5\\\"/></svg>\";","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./toolbar.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/toolbar/toolbarview\n */\nimport View from '../view';\nimport FocusCycler from '../focuscycler';\nimport ToolbarSeparatorView from './toolbarseparatorview';\nimport ToolbarLineBreakView from './toolbarlinebreakview';\nimport preventDefault from '../bindings/preventdefault';\nimport { createDropdown, addToolbarToDropdown } from '../dropdown/utils';\nimport normalizeToolbarConfig from './normalizetoolbarconfig';\nimport { FocusTracker, KeystrokeHandler, Rect, ResizeObserver, global, isVisible, logWarning } from '@ckeditor/ckeditor5-utils';\nimport { icons } from '@ckeditor/ckeditor5-core';\nimport { isObject } from 'lodash-es';\nimport '../../theme/components/toolbar/toolbar.css';\nconst { threeVerticalDots } = icons;\nconst NESTED_TOOLBAR_ICONS = {\n alignLeft: icons.alignLeft,\n bold: icons.bold,\n importExport: icons.importExport,\n paragraph: icons.paragraph,\n plus: icons.plus,\n text: icons.text,\n threeVerticalDots: icons.threeVerticalDots\n};\n/**\n * The toolbar view class.\n */\nexport default class ToolbarView extends View {\n /**\n * Creates an instance of the {@link module:ui/toolbar/toolbarview~ToolbarView} class.\n *\n * Also see {@link #render}.\n *\n * @param locale The localization services instance.\n * @param options Configuration options of the toolbar.\n */\n constructor(locale, options) {\n super(locale);\n const bind = this.bindTemplate;\n const t = this.t;\n this.options = options || {};\n this.set('ariaLabel', t('Editor toolbar'));\n this.set('maxWidth', 'auto');\n this.items = this.createCollection();\n this.focusTracker = new FocusTracker();\n this.keystrokes = new KeystrokeHandler();\n this.set('class', undefined);\n this.set('isCompact', false);\n this.itemsView = new ItemsView(locale);\n this.children = this.createCollection();\n this.children.add(this.itemsView);\n this.focusables = this.createCollection();\n const isRtl = locale.uiLanguageDirection === 'rtl';\n this._focusCycler = new FocusCycler({\n focusables: this.focusables,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate toolbar items backwards using the arrow[left,up] keys.\n focusPrevious: [isRtl ? 'arrowright' : 'arrowleft', 'arrowup'],\n // Navigate toolbar items forwards using the arrow[right,down] keys.\n focusNext: [isRtl ? 'arrowleft' : 'arrowright', 'arrowdown']\n }\n });\n const classes = [\n 'ck',\n 'ck-toolbar',\n bind.to('class'),\n bind.if('isCompact', 'ck-toolbar_compact')\n ];\n if (this.options.shouldGroupWhenFull && this.options.isFloating) {\n classes.push('ck-toolbar_floating');\n }\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: classes,\n role: 'toolbar',\n 'aria-label': bind.to('ariaLabel'),\n style: {\n maxWidth: bind.to('maxWidth')\n },\n tabindex: -1\n },\n children: this.children,\n on: {\n // https://github.com/ckeditor/ckeditor5-ui/issues/206\n mousedown: preventDefault(this)\n }\n });\n this._behavior = this.options.shouldGroupWhenFull ? new DynamicGrouping(this) : new StaticLayout(this);\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.focusTracker.add(this.element);\n // Children added before rendering should be known to the #focusTracker.\n for (const item of this.items) {\n this.focusTracker.add(item.element);\n }\n this.items.on('add', (evt, item) => {\n this.focusTracker.add(item.element);\n });\n this.items.on('remove', (evt, item) => {\n this.focusTracker.remove(item.element);\n });\n // Start listening for the keystrokes coming from #element.\n this.keystrokes.listenTo(this.element);\n this._behavior.render(this);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n this._behavior.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n return super.destroy();\n }\n /**\n * Focuses the first focusable in {@link #focusables}.\n */\n focus() {\n this._focusCycler.focusFirst();\n }\n /**\n * Focuses the last focusable in {@link #focusables}.\n */\n focusLast() {\n this._focusCycler.focusLast();\n }\n /**\n * A utility that expands the plain toolbar configuration into\n * {@link module:ui/toolbar/toolbarview~ToolbarView#items} using a given component factory.\n *\n * @param itemsOrConfig The toolbar items or the entire toolbar configuration object.\n * @param factory A factory producing toolbar items.\n * @param removeItems An array of items names to be removed from the configuration. When present, applies\n * to this toolbar and all nested ones as well.\n */\n fillFromConfig(itemsOrConfig, factory, removeItems) {\n this.items.addMany(this._buildItemsFromConfig(itemsOrConfig, factory, removeItems));\n }\n /**\n * A utility that expands the plain toolbar configuration into a list of view items using a given component factory.\n *\n * @param itemsOrConfig The toolbar items or the entire toolbar configuration object.\n * @param factory A factory producing toolbar items.\n * @param removeItems An array of items names to be removed from the configuration. When present, applies\n * to this toolbar and all nested ones as well.\n */\n _buildItemsFromConfig(itemsOrConfig, factory, removeItems) {\n const config = normalizeToolbarConfig(itemsOrConfig);\n const normalizedRemoveItems = removeItems || config.removeItems;\n const itemsToAdd = this._cleanItemsConfiguration(config.items, factory, normalizedRemoveItems)\n .map(item => {\n if (isObject(item)) {\n return this._createNestedToolbarDropdown(item, factory, normalizedRemoveItems);\n }\n else if (item === '|') {\n return new ToolbarSeparatorView();\n }\n else if (item === '-') {\n return new ToolbarLineBreakView();\n }\n return factory.create(item);\n })\n .filter((item) => !!item);\n return itemsToAdd;\n }\n /**\n * Cleans up the {@link module:ui/toolbar/toolbarview~ToolbarView#items} of the toolbar by removing unwanted items and\n * duplicated (obsolete) separators or line breaks.\n *\n * @param items The toolbar items configuration.\n * @param factory A factory producing toolbar items.\n * @param removeItems An array of items names to be removed from the configuration.\n * @returns Items after the clean-up.\n */\n _cleanItemsConfiguration(items, factory, removeItems) {\n const filteredItems = items\n .filter((item, idx, items) => {\n if (item === '|') {\n return true;\n }\n // Items listed in `config.removeItems` should not be added to the toolbar.\n if (removeItems.indexOf(item) !== -1) {\n return false;\n }\n if (item === '-') {\n // The toolbar line breaks must not be rendered when toolbar grouping is enabled.\n // (https://github.com/ckeditor/ckeditor5/issues/8582)\n if (this.options.shouldGroupWhenFull) {\n /**\n * The toolbar multiline breaks (`-` items) only work when the automatic button grouping\n * is disabled in the toolbar configuration.\n * To do this, set the `shouldNotGroupWhenFull` option to `true` in the editor configuration:\n *\n * ```ts\n * const config = {\n * \ttoolbar: {\n * \t\titems: [ ... ],\n * \t\tshouldNotGroupWhenFull: true\n * \t}\n * }\n * ```\n *\n * Learn more about {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar configuration}.\n *\n * @error toolbarview-line-break-ignored-when-grouping-items\n */\n logWarning('toolbarview-line-break-ignored-when-grouping-items', items);\n return false;\n }\n return true;\n }\n // For the items that cannot be instantiated we are sending warning message. We also filter them out.\n if (!isObject(item) && !factory.has(item)) {\n /**\n * There was a problem processing the configuration of the toolbar. The item with the given\n * name does not exist so it was omitted when rendering the toolbar.\n *\n * This warning usually shows up when the {@link module:core/plugin~Plugin} which is supposed\n * to provide a toolbar item has not been loaded or there is a typo in the configuration.\n *\n * Make sure the plugin responsible for this toolbar item is loaded and the toolbar configuration\n * is correct, e.g. {@link module:basic-styles/bold~Bold} is loaded for the `'bold'` toolbar item.\n *\n * You can use the following snippet to retrieve all available toolbar items:\n *\n * ```ts\n * Array.from( editor.ui.componentFactory.names() );\n * ```\n *\n * @error toolbarview-item-unavailable\n * @param item The name of the component or nested toolbar definition.\n */\n logWarning('toolbarview-item-unavailable', { item });\n return false;\n }\n return true;\n });\n return this._cleanSeparatorsAndLineBreaks(filteredItems);\n }\n /**\n * Remove leading, trailing, and duplicated separators (`-` and `|`).\n *\n * @returns Toolbar items after the separator and line break clean-up.\n */\n _cleanSeparatorsAndLineBreaks(items) {\n const nonSeparatorPredicate = (item) => (item !== '-' && item !== '|');\n const count = items.length;\n // Find an index of the first item that is not a separator.\n const firstCommandItemIndex = items.findIndex(nonSeparatorPredicate);\n // Items include separators only. There is no point in displaying them.\n if (firstCommandItemIndex === -1) {\n return [];\n }\n // Search from the end of the list, then convert found index back to the original direction.\n const lastCommandItemIndex = count - items\n .slice()\n .reverse()\n .findIndex(nonSeparatorPredicate);\n return items\n // Return items without the leading and trailing separators.\n .slice(firstCommandItemIndex, lastCommandItemIndex)\n // Remove duplicated separators.\n .filter((name, idx, items) => {\n // Filter only separators.\n if (nonSeparatorPredicate(name)) {\n return true;\n }\n const isDuplicated = idx > 0 && items[idx - 1] === name;\n return !isDuplicated;\n });\n }\n /**\n * Creates a user-defined dropdown containing a toolbar with items.\n *\n * @param definition A definition of the nested toolbar dropdown.\n * @param definition.label A label of the dropdown.\n * @param definition.icon An icon of the drop-down. One of 'bold', 'plus', 'text', 'importExport', 'alignLeft',\n * 'paragraph' or an SVG string. When `false` is passed, no icon will be used.\n * @param definition.withText When set `true`, the label of the dropdown will be visible. See\n * {@link module:ui/button/buttonview~ButtonView#withText} to learn more.\n * @param definition.tooltip A tooltip of the dropdown button. See\n * {@link module:ui/button/buttonview~ButtonView#tooltip} to learn more. Defaults to `true`.\n * @param componentFactory Component factory used to create items\n * of the nested toolbar.\n */\n _createNestedToolbarDropdown(definition, componentFactory, removeItems) {\n let { label, icon, items, tooltip = true, withText = false } = definition;\n items = this._cleanItemsConfiguration(items, componentFactory, removeItems);\n // There is no point in rendering a dropdown without items.\n if (!items.length) {\n return null;\n }\n const locale = this.locale;\n const dropdownView = createDropdown(locale);\n if (!label) {\n /**\n * A dropdown definition in the toolbar configuration is missing a text label.\n *\n * Without a label, the dropdown becomes inaccessible to users relying on assistive technologies.\n * Make sure the `label` property is set in your drop-down configuration:\n *\n * ```json\n * {\n * \tlabel: 'A human-readable label',\n * \ticon: '...',\n * \titems: [ ... ]\n * },\n * ```\n *\n * Learn more about {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar configuration}.\n *\n * @error toolbarview-nested-toolbar-dropdown-missing-label\n */\n logWarning('toolbarview-nested-toolbar-dropdown-missing-label', definition);\n }\n dropdownView.class = 'ck-toolbar__nested-toolbar-dropdown';\n dropdownView.buttonView.set({\n label,\n tooltip,\n withText: !!withText\n });\n // Allow disabling icon by passing false.\n if (icon !== false) {\n // A pre-defined icon picked by name, SVG string, a fallback (default) icon.\n dropdownView.buttonView.icon = NESTED_TOOLBAR_ICONS[icon] || icon || threeVerticalDots;\n }\n // If the icon is disabled, display the label automatically.\n else {\n dropdownView.buttonView.withText = true;\n }\n addToolbarToDropdown(dropdownView, () => (dropdownView.toolbarView._buildItemsFromConfig(items, componentFactory, removeItems)));\n return dropdownView;\n }\n}\n/**\n * An inner block of the {@link module:ui/toolbar/toolbarview~ToolbarView} hosting its\n * {@link module:ui/toolbar/toolbarview~ToolbarView#items}.\n */\nclass ItemsView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.children = this.createCollection();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-toolbar__items'\n ]\n },\n children: this.children\n });\n }\n}\n/**\n * A toolbar behavior that makes it static and unresponsive to the changes of the environment.\n * At the same time, it also makes it possible to display a toolbar with a vertical layout\n * using the {@link module:ui/toolbar/toolbarview~ToolbarView#isVertical} property.\n */\nclass StaticLayout {\n /**\n * Creates an instance of the {@link module:ui/toolbar/toolbarview~StaticLayout} toolbar\n * behavior.\n *\n * @param view An instance of the toolbar that this behavior is added to.\n */\n constructor(view) {\n const bind = view.bindTemplate;\n // Static toolbar can be vertical when needed.\n view.set('isVertical', false);\n // 1:1 passthrough binding, all ToolbarView#items are visible.\n view.itemsView.children.bindTo(view.items).using(item => item);\n // 1:1 passthrough binding, all ToolbarView#items are focusable.\n view.focusables.bindTo(view.items).using(item => item);\n view.extendTemplate({\n attributes: {\n class: [\n // When vertical, the toolbar has an additional CSS class.\n bind.if('isVertical', 'ck-toolbar_vertical')\n ]\n }\n });\n }\n /**\n * @inheritDoc\n */\n render() { }\n /**\n * @inheritDoc\n */\n destroy() { }\n}\n/**\n * A toolbar behavior that makes the items respond to changes in the geometry.\n *\n * In a nutshell, it groups {@link module:ui/toolbar/toolbarview~ToolbarView#items}\n * that do not fit visually into a single row of the toolbar (due to limited space).\n * Items that do not fit are aggregated in a dropdown displayed at the end of the toolbar.\n *\n * ```\n *\t┌──────────────────────────────────────── ToolbarView ──────────────────────────────────────────┐\n *\t| ┌─────────────────────────────────────── #children ─────────────────────────────────────────┐ |\n *\t| | ┌─────── #itemsView ────────┐ ┌──────────────────────┐ ┌── #groupedItemsDropdown ───┐ | |\n *\t| | | #ungroupedItems | | ToolbarSeparatorView | | #groupedItems | | |\n *\t| | └──────────────────────────-┘ └──────────────────────┘ └────────────────────────────┘ | |\n *\t| | \\---------- only when toolbar items overflow -------/ | |\n *\t| └───────────────────────────────────────────────────────────────────────────────────────────┘ |\n *\t└───────────────────────────────────────────────────────────────────────────────────────────────┘\n * ```\n */\nclass DynamicGrouping {\n /**\n * Creates an instance of the {@link module:ui/toolbar/toolbarview~DynamicGrouping} toolbar\n * behavior.\n *\n * @param view An instance of the toolbar that this behavior is added to.\n */\n constructor(view) {\n /**\n * An instance of the resize observer that helps dynamically determine the geometry of the toolbar\n * and manage items that do not fit into a single row.\n *\n * **Note:** Created in {@link #_enableGroupingOnResize}.\n *\n * @readonly\n */\n this.resizeObserver = null;\n /**\n * A cached value of the horizontal padding style used by {@link #_updateGrouping}\n * to manage the {@link module:ui/toolbar/toolbarview~ToolbarView#items} that do not fit into\n * a single toolbar line. This value can be reused between updates because it is unlikely that\n * the padding will change and reusing `Window.getComputedStyle()` is expensive.\n *\n * @readonly\n */\n this.cachedPadding = null;\n /**\n * A flag indicating that an items grouping update has been queued (e.g. due to the toolbar being visible)\n * and should be executed immediately the next time the toolbar shows up.\n *\n * @readonly\n */\n this.shouldUpdateGroupingOnNextResize = false;\n this.view = view;\n this.viewChildren = view.children;\n this.viewFocusables = view.focusables;\n this.viewItemsView = view.itemsView;\n this.viewFocusTracker = view.focusTracker;\n this.viewLocale = view.locale;\n this.ungroupedItems = view.createCollection();\n this.groupedItems = view.createCollection();\n this.groupedItemsDropdown = this._createGroupedItemsDropdown();\n // Only those items that were not grouped are visible to the user.\n view.itemsView.children.bindTo(this.ungroupedItems).using(item => item);\n // Make sure all #items visible in the main space of the toolbar are \"focuscycleable\".\n this.ungroupedItems.on('change', this._updateFocusCycleableItems.bind(this));\n // Make sure the #groupedItemsDropdown is also included in cycling when it appears.\n view.children.on('change', this._updateFocusCycleableItems.bind(this));\n // ToolbarView#items is dynamic. When an item is added or removed, it should be automatically\n // represented in either grouped or ungrouped items at the right index.\n // In other words #items == concat( #ungroupedItems, #groupedItems )\n // (in length and order).\n view.items.on('change', (evt, changeData) => {\n const index = changeData.index;\n const added = Array.from(changeData.added);\n // Removing.\n for (const removedItem of changeData.removed) {\n if (index >= this.ungroupedItems.length) {\n this.groupedItems.remove(removedItem);\n }\n else {\n this.ungroupedItems.remove(removedItem);\n }\n }\n // Adding.\n for (let currentIndex = index; currentIndex < index + added.length; currentIndex++) {\n const addedItem = added[currentIndex - index];\n if (currentIndex > this.ungroupedItems.length) {\n this.groupedItems.add(addedItem, currentIndex - this.ungroupedItems.length);\n }\n else {\n this.ungroupedItems.add(addedItem, currentIndex);\n }\n }\n // When new ungrouped items join in and land in #ungroupedItems, there's a chance it causes\n // the toolbar to overflow.\n // Consequently if removed from grouped or ungrouped items, there is a chance\n // some new space is available and we could do some ungrouping.\n this._updateGrouping();\n });\n view.extendTemplate({\n attributes: {\n class: [\n // To group items dynamically, the toolbar needs a dedicated CSS class.\n 'ck-toolbar_grouping'\n ]\n }\n });\n }\n /**\n * Enables dynamic items grouping based on the dimensions of the toolbar.\n *\n * @param view An instance of the toolbar that this behavior is added to.\n */\n render(view) {\n this.viewElement = view.element;\n this._enableGroupingOnResize();\n this._enableGroupingOnMaxWidthChange(view);\n }\n /**\n * Cleans up the internals used by this behavior.\n */\n destroy() {\n // The dropdown may not be in ToolbarView#children at the moment of toolbar destruction\n // so let's make sure it's actually destroyed along with the toolbar.\n this.groupedItemsDropdown.destroy();\n this.resizeObserver.destroy();\n }\n /**\n * When called, it will check if any of the {@link #ungroupedItems} do not fit into a single row of the toolbar,\n * and it will move them to the {@link #groupedItems} when it happens.\n *\n * At the same time, it will also check if there is enough space in the toolbar for the first of the\n * {@link #groupedItems} to be returned back to {@link #ungroupedItems} and still fit into a single row\n * without the toolbar wrapping.\n */\n _updateGrouping() {\n // Do no groupingrelated geometry analysis when the toolbar is detached from visible DOM,\n // for instance before #render(), or after render but without a parent or a parent detached\n // from DOM. DOMRects won't work anyway and there will be tons of warning in the console and\n // nothing else. This happens, for instance, when the toolbar is detached from DOM and\n // some logic adds or removes its #items.\n if (!this.viewElement.ownerDocument.body.contains(this.viewElement)) {\n return;\n }\n // Do not update grouping when the element is invisible. Such toolbar has DOMRect filled with zeros\n // and that would cause all items to be grouped. Instead, queue the grouping so it runs next time\n // the toolbar is visible (the next ResizeObserver callback execution). This is handy because\n // the grouping could be caused by increasing the #maxWidth when the toolbar was invisible and the next\n // time it shows up, some items could actually be ungrouped (https://github.com/ckeditor/ckeditor5/issues/6575).\n if (!isVisible(this.viewElement)) {\n this.shouldUpdateGroupingOnNextResize = true;\n return;\n }\n // Remember how many items were initially grouped so at the it is possible to figure out if the number\n // of grouped items has changed. If the number has changed, geometry of the toolbar has also changed.\n const initialGroupedItemsCount = this.groupedItems.length;\n let wereItemsGrouped;\n // Group #items as long as some wrap to the next row. This will happen, for instance,\n // when the toolbar is getting narrow and there is not enough space to display all items in\n // a single row.\n while (this._areItemsOverflowing) {\n this._groupLastItem();\n wereItemsGrouped = true;\n }\n // If none were grouped now but there were some items already grouped before,\n // then, what the hell, maybe let's see if some of them can be ungrouped. This happens when,\n // for instance, the toolbar is stretching and there's more space in it than before.\n if (!wereItemsGrouped && this.groupedItems.length) {\n // Ungroup items as long as none are overflowing or there are none to ungroup left.\n while (this.groupedItems.length && !this._areItemsOverflowing) {\n this._ungroupFirstItem();\n }\n // If the ungrouping ended up with some item wrapping to the next row,\n // put it back to the group toolbar (\"undo the last ungroup\"). We don't know whether\n // an item will wrap or not until we ungroup it (that's a DOM/CSS thing) so this\n // cleanup is vital for the algorithm.\n if (this._areItemsOverflowing) {\n this._groupLastItem();\n }\n }\n if (this.groupedItems.length !== initialGroupedItemsCount) {\n this.view.fire('groupedItemsUpdate');\n }\n }\n /**\n * Returns `true` when {@link module:ui/toolbar/toolbarview~ToolbarView#element} children visually overflow,\n * for instance if the toolbar is narrower than its members. Returns `false` otherwise.\n */\n get _areItemsOverflowing() {\n // An empty toolbar cannot overflow.\n if (!this.ungroupedItems.length) {\n return false;\n }\n const element = this.viewElement;\n const uiLanguageDirection = this.viewLocale.uiLanguageDirection;\n const lastChildRect = new Rect(element.lastChild);\n const toolbarRect = new Rect(element);\n if (!this.cachedPadding) {\n const computedStyle = global.window.getComputedStyle(element);\n const paddingProperty = uiLanguageDirection === 'ltr' ? 'paddingRight' : 'paddingLeft';\n // parseInt() is essential because of quirky floating point numbers logic and DOM.\n // If the padding turned out too big because of that, the grouped items dropdown would\n // always look (from the Rect perspective) like it overflows (while it's not).\n this.cachedPadding = Number.parseInt(computedStyle[paddingProperty]);\n }\n if (uiLanguageDirection === 'ltr') {\n return lastChildRect.right > toolbarRect.right - this.cachedPadding;\n }\n else {\n return lastChildRect.left < toolbarRect.left + this.cachedPadding;\n }\n }\n /**\n * Enables the functionality that prevents {@link #ungroupedItems} from overflowing (wrapping to the next row)\n * upon resize when there is little space available. Instead, the toolbar items are moved to the\n * {@link #groupedItems} collection and displayed in a dropdown at the end of the row (which has its own nested toolbar).\n *\n * When called, the toolbar will automatically analyze the location of its {@link #ungroupedItems} and \"group\"\n * them in the dropdown if necessary. It will also observe the browser window for size changes in\n * the future and respond to them by grouping more items or reverting already grouped back, depending\n * on the visual space available.\n */\n _enableGroupingOnResize() {\n let previousWidth;\n // TODO: Consider debounce.\n this.resizeObserver = new ResizeObserver(this.viewElement, entry => {\n if (!previousWidth || previousWidth !== entry.contentRect.width || this.shouldUpdateGroupingOnNextResize) {\n this.shouldUpdateGroupingOnNextResize = false;\n this._updateGrouping();\n previousWidth = entry.contentRect.width;\n }\n });\n this._updateGrouping();\n }\n /**\n * Enables the grouping functionality, just like {@link #_enableGroupingOnResize} but the difference is that\n * it listens to the changes of {@link module:ui/toolbar/toolbarview~ToolbarView#maxWidth} instead.\n */\n _enableGroupingOnMaxWidthChange(view) {\n view.on('change:maxWidth', () => {\n this._updateGrouping();\n });\n }\n /**\n * When called, it will remove the last item from {@link #ungroupedItems} and move it back\n * to the {@link #groupedItems} collection.\n *\n * The opposite of {@link #_ungroupFirstItem}.\n */\n _groupLastItem() {\n if (!this.groupedItems.length) {\n this.viewChildren.add(new ToolbarSeparatorView());\n this.viewChildren.add(this.groupedItemsDropdown);\n this.viewFocusTracker.add(this.groupedItemsDropdown.element);\n }\n this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last), 0);\n }\n /**\n * Moves the very first item belonging to {@link #groupedItems} back\n * to the {@link #ungroupedItems} collection.\n *\n * The opposite of {@link #_groupLastItem}.\n */\n _ungroupFirstItem() {\n this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first));\n if (!this.groupedItems.length) {\n this.viewChildren.remove(this.groupedItemsDropdown);\n this.viewChildren.remove(this.viewChildren.last);\n this.viewFocusTracker.remove(this.groupedItemsDropdown.element);\n }\n }\n /**\n * Creates the {@link #groupedItemsDropdown} that hosts the members of the {@link #groupedItems}\n * collection when there is not enough space in the toolbar to display all items in a single row.\n */\n _createGroupedItemsDropdown() {\n const locale = this.viewLocale;\n const t = locale.t;\n const dropdown = createDropdown(locale);\n dropdown.class = 'ck-toolbar__grouped-dropdown';\n // Make sure the dropdown never sticks out to the left/right. It should be under the main toolbar.\n // (https://github.com/ckeditor/ckeditor5/issues/5608)\n dropdown.panelPosition = locale.uiLanguageDirection === 'ltr' ? 'sw' : 'se';\n addToolbarToDropdown(dropdown, this.groupedItems);\n dropdown.buttonView.set({\n label: t('Show more items'),\n tooltip: true,\n tooltipPosition: locale.uiLanguageDirection === 'rtl' ? 'se' : 'sw',\n icon: threeVerticalDots\n });\n return dropdown;\n }\n /**\n * Updates the {@link module:ui/toolbar/toolbarview~ToolbarView#focusables focuscycleable items}\n * collection so it represents the uptodate state of the UI from the perspective of the user.\n *\n * For instance, the {@link #groupedItemsDropdown} can show up and hide but when it is visible,\n * it must be subject to focus cycling in the toolbar.\n *\n * See the {@link module:ui/toolbar/toolbarview~ToolbarView#focusables collection} documentation\n * to learn more about the purpose of this method.\n */\n _updateFocusCycleableItems() {\n this.viewFocusables.clear();\n this.ungroupedItems.map(item => {\n this.viewFocusables.add(item);\n });\n if (this.groupedItems.length) {\n this.viewFocusables.add(this.groupedItemsDropdown);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * A helper which executes a native `Event.preventDefault()` if the target of an event equals the\n * {@link module:ui/view~View#element element of the view}. It shortens the definition of a\n * {@link module:ui/view~View#template template}.\n *\n * ```ts\n * // In a class extending View.\n * import preventDefault from '@ckeditor/ckeditor5-ui/src/bindings/preventdefault';\n *\n * // ...\n *\n * this.setTemplate( {\n * \ttag: 'div',\n *\n * \ton: {\n * \t\t// Prevent the default mousedown action on this view.\n * \t\tmousedown: preventDefault( this )\n * \t}\n * } );\n * ```\n *\n * @param view View instance that defines the template.\n */\nexport default function preventDefault(view) {\n return view.bindTemplate.to(evt => {\n if (evt.target === view.element) {\n evt.preventDefault();\n }\n });\n}\n","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./list.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/list/listview\n */\nimport View from '../view';\nimport FocusCycler from '../focuscycler';\nimport { FocusTracker, KeystrokeHandler } from '@ckeditor/ckeditor5-utils';\nimport '../../theme/components/list/list.css';\n/**\n * The list view class.\n */\nexport default class ListView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n const bind = this.bindTemplate;\n this.items = this.createCollection();\n this.focusTracker = new FocusTracker();\n this.keystrokes = new KeystrokeHandler();\n this._focusCycler = new FocusCycler({\n focusables: this.items,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate list items backwards using the arrowup key.\n focusPrevious: 'arrowup',\n // Navigate toolbar items forwards using the arrowdown key.\n focusNext: 'arrowdown'\n }\n });\n this.set('ariaLabel', undefined);\n this.set('role', undefined);\n this.setTemplate({\n tag: 'ul',\n attributes: {\n class: [\n 'ck',\n 'ck-reset',\n 'ck-list'\n ],\n role: bind.to('role'),\n 'aria-label': bind.to('ariaLabel')\n },\n children: this.items\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n // Items added before rendering should be known to the #focusTracker.\n for (const item of this.items) {\n this.focusTracker.add(item.element);\n }\n this.items.on('add', (evt, item) => {\n this.focusTracker.add(item.element);\n });\n this.items.on('remove', (evt, item) => {\n this.focusTracker.remove(item.element);\n });\n // Start listening for the keystrokes coming from #element.\n this.keystrokes.listenTo(this.element);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Focuses the first focusable in {@link #items}.\n */\n focus() {\n this._focusCycler.focusFirst();\n }\n /**\n * Focuses the last focusable in {@link #items}.\n */\n focusLast() {\n this._focusCycler.focusLast();\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/list/listitemview\n */\nimport View from '../view';\n/**\n * The list item view class.\n */\nexport default class ListItemView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('isVisible', true);\n this.children = this.createCollection();\n this.setTemplate({\n tag: 'li',\n attributes: {\n class: [\n 'ck',\n 'ck-list__item',\n bind.if('isVisible', 'ck-hidden', value => !value)\n ],\n role: 'presentation'\n },\n children: this.children\n });\n }\n /**\n * Focuses the list item.\n */\n focus() {\n this.children.first.focus();\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/list/listseparatorview\n */\nimport View from '../view';\n/**\n * The list separator view class.\n */\nexport default class ListSeparatorView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.setTemplate({\n tag: 'li',\n attributes: {\n class: [\n 'ck',\n 'ck-list__separator'\n ]\n }\n });\n }\n}\n","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./splitbutton.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/dropdown/button/splitbuttonview\n */\nimport View from '../../view';\nimport ButtonView from '../../button/buttonview';\nimport { KeystrokeHandler, FocusTracker } from '@ckeditor/ckeditor5-utils';\nimport dropdownArrowIcon from '../../../theme/icons/dropdown-arrow.svg';\nimport '../../../theme/components/dropdown/splitbutton.css';\n/**\n * The split button view class.\n *\n * ```ts\n * const view = new SplitButtonView();\n *\n * view.set( {\n * \tlabel: 'A button',\n * \tkeystroke: 'Ctrl+B',\n * \ttooltip: true\n * } );\n *\n * view.render();\n *\n * document.body.append( view.element );\n * ```\n *\n * Also see the {@link module:ui/dropdown/utils~createDropdown `createDropdown()` util}.\n */\nexport default class SplitButtonView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n const bind = this.bindTemplate;\n // Implement the Button interface.\n this.set('class', undefined);\n this.set('labelStyle', undefined);\n this.set('icon', undefined);\n this.set('isEnabled', true);\n this.set('isOn', false);\n this.set('isToggleable', false);\n this.set('isVisible', true);\n this.set('keystroke', undefined);\n this.set('withKeystroke', false);\n this.set('label', undefined);\n this.set('tabindex', -1);\n this.set('tooltip', false);\n this.set('tooltipPosition', 's');\n this.set('type', 'button');\n this.set('withText', false);\n this.children = this.createCollection();\n this.actionView = this._createActionView();\n this.arrowView = this._createArrowView();\n this.keystrokes = new KeystrokeHandler();\n this.focusTracker = new FocusTracker();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-splitbutton',\n bind.to('class'),\n bind.if('isVisible', 'ck-hidden', value => !value),\n this.arrowView.bindTemplate.if('isOn', 'ck-splitbutton_open')\n ]\n },\n children: this.children\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.children.add(this.actionView);\n this.children.add(this.arrowView);\n this.focusTracker.add(this.actionView.element);\n this.focusTracker.add(this.arrowView.element);\n this.keystrokes.listenTo(this.element);\n // Overrides toolbar focus cycling behavior.\n this.keystrokes.set('arrowright', (evt, cancel) => {\n if (this.focusTracker.focusedElement === this.actionView.element) {\n this.arrowView.focus();\n cancel();\n }\n });\n // Overrides toolbar focus cycling behavior.\n this.keystrokes.set('arrowleft', (evt, cancel) => {\n if (this.focusTracker.focusedElement === this.arrowView.element) {\n this.actionView.focus();\n cancel();\n }\n });\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Focuses the {@link module:ui/button/buttonview~ButtonView#element} of the action part of split button.\n */\n focus() {\n this.actionView.focus();\n }\n /**\n * Creates a {@link module:ui/button/buttonview~ButtonView} instance as {@link #actionView} and binds it with main split button\n * attributes.\n */\n _createActionView() {\n const actionView = new ButtonView();\n actionView.bind('icon', 'isEnabled', 'isOn', 'isToggleable', 'keystroke', 'label', 'tabindex', 'tooltip', 'tooltipPosition', 'type', 'withText').to(this);\n actionView.extendTemplate({\n attributes: {\n class: 'ck-splitbutton__action'\n }\n });\n actionView.delegate('execute').to(this);\n return actionView;\n }\n /**\n * Creates a {@link module:ui/button/buttonview~ButtonView} instance as {@link #arrowView} and binds it with main split button\n * attributes.\n */\n _createArrowView() {\n const arrowView = new ButtonView();\n const bind = arrowView.bindTemplate;\n arrowView.icon = dropdownArrowIcon;\n arrowView.extendTemplate({\n attributes: {\n class: [\n 'ck-splitbutton__arrow'\n ],\n 'data-cke-tooltip-disabled': bind.to('isOn'),\n 'aria-haspopup': true,\n 'aria-expanded': bind.to('isOn', value => String(value))\n }\n });\n arrowView.bind('isEnabled').to(this);\n arrowView.bind('label').to(this);\n arrowView.bind('tooltip').to(this);\n arrowView.delegate('execute').to(this, 'open');\n return arrowView;\n }\n}\n","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./toolbardropdown.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./listdropdown.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/dropdown/utils\n */\nimport DropdownPanelView from './dropdownpanelview';\nimport DropdownView from './dropdownview';\nimport DropdownButtonView from './button/dropdownbuttonview';\nimport ToolbarView from '../toolbar/toolbarview';\nimport ListView from '../list/listview';\nimport ListItemView from '../list/listitemview';\nimport ListSeparatorView from '../list/listseparatorview';\nimport ButtonView from '../button/buttonview';\nimport SplitButtonView from './button/splitbuttonview';\nimport SwitchButtonView from '../button/switchbuttonview';\nimport ViewCollection from '../viewcollection';\nimport clickOutsideHandler from '../bindings/clickoutsidehandler';\nimport { global, priorities, logWarning } from '@ckeditor/ckeditor5-utils';\nimport '../../theme/components/dropdown/toolbardropdown.css';\nimport '../../theme/components/dropdown/listdropdown.css';\n/**\n * A helper for creating dropdowns. It creates an instance of a {@link module:ui/dropdown/dropdownview~DropdownView dropdown},\n * with a {@link module:ui/dropdown/button/dropdownbutton~DropdownButton button},\n * {@link module:ui/dropdown/dropdownpanelview~DropdownPanelView panel} and all standard dropdown's behaviors.\n *\n * # Creating dropdowns\n *\n * By default, the default {@link module:ui/dropdown/button/dropdownbuttonview~DropdownButtonView} class is used as\n * definition of the button:\n *\n * ```ts\n * const dropdown = createDropdown( model );\n *\n * // Configure dropdown's button properties:\n * dropdown.buttonView.set( {\n * \tlabel: 'A dropdown',\n * \twithText: true\n * } );\n *\n * dropdown.render();\n *\n * // Will render a dropdown labeled \"A dropdown\" with an empty panel.\n * document.body.appendChild( dropdown.element );\n * ```\n *\n * You can also provide other button views (they need to implement the\n * {@link module:ui/dropdown/button/dropdownbutton~DropdownButton} interface). For instance, you can use\n * {@link module:ui/dropdown/button/splitbuttonview~SplitButtonView} to create a dropdown with a split button.\n *\n * ```ts\n * const dropdown = createDropdown( locale, SplitButtonView );\n *\n * // Configure dropdown's button properties:\n * dropdown.buttonView.set( {\n * \tlabel: 'A dropdown',\n * \twithText: true\n * } );\n *\n * dropdown.buttonView.on( 'execute', () => {\n * \t// Add the behavior of the \"action part\" of the split button.\n * \t// Split button consists of the \"action part\" and \"arrow part\".\n * \t// The arrow opens the dropdown while the action part can have some other behavior.\n * } );\n *\n * dropdown.render();\n *\n * // Will render a dropdown labeled \"A dropdown\" with an empty panel.\n * document.body.appendChild( dropdown.element );\n * ```\n *\n * # Adding content to the dropdown's panel\n *\n * The content of the panel can be inserted directly into the `dropdown.panelView.element`:\n *\n * ```ts\n * dropdown.panelView.element.textContent = 'Content of the panel';\n * ```\n *\n * However, most of the time you will want to add there either a {@link module:ui/list/listview~ListView list of options}\n * or a list of buttons (i.e. a {@link module:ui/toolbar/toolbarview~ToolbarView toolbar}).\n * To simplify the task, you can use, respectively, {@link module:ui/dropdown/utils~addListToDropdown} or\n * {@link module:ui/dropdown/utils~addToolbarToDropdown} utils.\n *\n * @param locale The locale instance.\n * @param ButtonClass The dropdown button view class. Needs to implement the\n * {@link module:ui/dropdown/button/dropdownbutton~DropdownButton} interface.\n * @returns The dropdown view instance.\n */\nexport function createDropdown(locale, ButtonClass = DropdownButtonView) {\n const buttonView = new ButtonClass(locale);\n const panelView = new DropdownPanelView(locale);\n const dropdownView = new DropdownView(locale, buttonView, panelView);\n buttonView.bind('isEnabled').to(dropdownView);\n if (buttonView instanceof SplitButtonView) {\n buttonView.arrowView.bind('isOn').to(dropdownView, 'isOpen');\n }\n else {\n buttonView.bind('isOn').to(dropdownView, 'isOpen');\n }\n addDefaultBehavior(dropdownView);\n return dropdownView;\n}\n/**\n * Adds an instance of {@link module:ui/toolbar/toolbarview~ToolbarView} to a dropdown.\n *\n * ```ts\n * const buttonsCreator = () => {\n * \tconst buttons = [];\n *\n * \t// Either create a new ButtonView instance or create existing.\n * \tbuttons.push( new ButtonView() );\n * \tbuttons.push( editor.ui.componentFactory.create( 'someButton' ) );\n * };\n *\n * const dropdown = createDropdown( locale );\n *\n * addToolbarToDropdown( dropdown, buttonsCreator, { isVertical: true } );\n *\n * // Will render a vertical button dropdown labeled \"A button dropdown\"\n * // with a button group in the panel containing two buttons.\n * // Buttons inside the dropdown will be created on first dropdown panel open.\n * dropdown.render()\n * document.body.appendChild( dropdown.element );\n * ```\n *\n * **Note:** To improve the accessibility, you can tell the dropdown to focus the first active button of the toolbar when the dropdown\n * {@link module:ui/dropdown/dropdownview~DropdownView#isOpen gets open}. See the documentation of `options` to learn more.\n *\n * **Note:** Toolbar view will be created on first open of the dropdown.\n *\n * See {@link module:ui/dropdown/utils~createDropdown} and {@link module:ui/toolbar/toolbarview~ToolbarView}.\n *\n * @param dropdownView A dropdown instance to which `ToolbarView` will be added.\n * @param options.enableActiveItemFocusOnDropdownOpen When set `true`, the focus will automatically move to the first\n * active {@link module:ui/toolbar/toolbarview~ToolbarView#items item} of the toolbar upon\n * {@link module:ui/dropdown/dropdownview~DropdownView#isOpen opening} the dropdown. Active items are those with the `isOn` property set\n * `true` (for instance {@link module:ui/button/buttonview~ButtonView buttons}). If no active items is found, the toolbar will be focused\n * as a whole resulting in the focus moving to its first focusable item (default behavior of\n * {@link module:ui/dropdown/dropdownview~DropdownView}).\n * @param options.ariaLabel Label used by assistive technologies to describe toolbar element.\n * @param options.maxWidth The maximum width of the toolbar element.\n * Details: {@link module:ui/toolbar/toolbarview~ToolbarView#maxWidth}.\n * @param options.class An additional CSS class added to the toolbar element.\n * @param options.isCompact When set true, makes the toolbar look compact with toolbar element.\n * @param options.isVertical Controls the orientation of toolbar items.\n */\nexport function addToolbarToDropdown(dropdownView, buttonsOrCallback, options = {}) {\n dropdownView.extendTemplate({\n attributes: {\n class: ['ck-toolbar-dropdown']\n }\n });\n if (dropdownView.isOpen) {\n addToolbarToOpenDropdown(dropdownView, buttonsOrCallback, options);\n }\n else {\n dropdownView.once('change:isOpen', () => addToolbarToOpenDropdown(dropdownView, buttonsOrCallback, options), { priority: 'highest' });\n }\n if (options.enableActiveItemFocusOnDropdownOpen) {\n // Accessibility: Focus the first active button in the toolbar when the dropdown gets open.\n focusChildOnDropdownOpen(dropdownView, () => dropdownView.toolbarView.items.find((item) => item.isOn));\n }\n}\n/**\n * Adds an instance of {@link module:ui/toolbar/toolbarview~ToolbarView} to a dropdown.\n */\nfunction addToolbarToOpenDropdown(dropdownView, buttonsOrCallback, options) {\n const locale = dropdownView.locale;\n const t = locale.t;\n const toolbarView = dropdownView.toolbarView = new ToolbarView(locale);\n const buttons = typeof buttonsOrCallback == 'function' ? buttonsOrCallback() : buttonsOrCallback;\n toolbarView.ariaLabel = options.ariaLabel || t('Dropdown toolbar');\n if (options.maxWidth) {\n toolbarView.maxWidth = options.maxWidth;\n }\n if (options.class) {\n toolbarView.class = options.class;\n }\n if (options.isCompact) {\n toolbarView.isCompact = options.isCompact;\n }\n if (options.isVertical) {\n toolbarView.isVertical = true;\n }\n if (buttons instanceof ViewCollection) {\n toolbarView.items.bindTo(buttons).using(item => item);\n }\n else {\n toolbarView.items.addMany(buttons);\n }\n dropdownView.panelView.children.add(toolbarView);\n toolbarView.items.delegate('execute').to(dropdownView);\n}\n/**\n * Adds an instance of {@link module:ui/list/listview~ListView} to a dropdown.\n *\n * ```ts\n * const items = new Collection();\n *\n * items.add( {\n * \ttype: 'button',\n * \tmodel: new Model( {\n * \t\twithText: true,\n * \t\tlabel: 'First item',\n * \t\tlabelStyle: 'color: red'\n * \t} )\n * } );\n *\n * items.add( {\n * \t type: 'button',\n * \t model: new Model( {\n * \t\twithText: true,\n * \t\tlabel: 'Second item',\n * \t\tlabelStyle: 'color: green',\n * \t\tclass: 'foo'\n * \t} )\n * } );\n *\n * const dropdown = createDropdown( locale );\n *\n * addListToDropdown( dropdown, items );\n *\n * // Will render a dropdown with a list in the panel containing two items.\n * dropdown.render()\n * document.body.appendChild( dropdown.element );\n * ```\n *\n * The `items` collection passed to this methods controls the presence and attributes of respective\n * {@link module:ui/list/listitemview~ListItemView list items}.\n *\n * **Note:** To improve the accessibility, when a list is added to the dropdown using this helper the dropdown will automatically attempt\n * to focus the first active item (a host to a {@link module:ui/button/buttonview~ButtonView} with\n * {@link module:ui/button/buttonview~ButtonView#isOn} set `true`) or the very first item when none are active.\n *\n * **Note:** List view will be created on first open of the dropdown.\n *\n * See {@link module:ui/dropdown/utils~createDropdown} and {@link module:list/list~List}.\n *\n * @param dropdownView A dropdown instance to which `ListVIew` will be added.\n * @param itemsOrCallback A collection of the list item definitions or a callback returning a list item definitions to populate the list.\n * @param options.ariaLabel Label used by assistive technologies to describe list element.\n * @param options.role Will be reflected by the `role` DOM attribute in `ListVIew` and used by assistive technologies.\n */\nexport function addListToDropdown(dropdownView, itemsOrCallback, options = {}) {\n if (dropdownView.isOpen) {\n addListToOpenDropdown(dropdownView, itemsOrCallback, options);\n }\n else {\n dropdownView.once('change:isOpen', () => addListToOpenDropdown(dropdownView, itemsOrCallback, options), { priority: 'highest' });\n }\n // Accessibility: Focus the first active button in the list when the dropdown gets open.\n focusChildOnDropdownOpen(dropdownView, () => dropdownView.listView.items.find(item => {\n if (item instanceof ListItemView) {\n return item.children.first.isOn;\n }\n return false;\n }));\n}\n/**\n * Adds an instance of {@link module:ui/list/listview~ListView} to a dropdown.\n */\nfunction addListToOpenDropdown(dropdownView, itemsOrCallback, options) {\n const locale = dropdownView.locale;\n const listView = dropdownView.listView = new ListView(locale);\n const items = typeof itemsOrCallback == 'function' ? itemsOrCallback() : itemsOrCallback;\n listView.ariaLabel = options.ariaLabel;\n listView.role = options.role;\n listView.items.bindTo(items).using(def => {\n if (def.type === 'separator') {\n return new ListSeparatorView(locale);\n }\n else if (def.type === 'button' || def.type === 'switchbutton') {\n const listItemView = new ListItemView(locale);\n let buttonView;\n if (def.type === 'button') {\n buttonView = new ButtonView(locale);\n }\n else {\n buttonView = new SwitchButtonView(locale);\n }\n // Bind all model properties to the button view.\n buttonView.bind(...Object.keys(def.model)).to(def.model);\n buttonView.delegate('execute').to(listItemView);\n listItemView.children.add(buttonView);\n return listItemView;\n }\n return null;\n });\n dropdownView.panelView.children.add(listView);\n listView.items.delegate('execute').to(dropdownView);\n}\n/**\n * A helper to be used on an existing {@link module:ui/dropdown/dropdownview~DropdownView} that focuses\n * a specific child in DOM when the dropdown {@link module:ui/dropdown/dropdownview~DropdownView#isOpen gets open}.\n *\n * @param dropdownView A dropdown instance to which the focus behavior will be added.\n * @param childSelectorCallback A callback executed when the dropdown gets open. It should return a {@link module:ui/view~View}\n * instance (child of {@link module:ui/dropdown/dropdownview~DropdownView#panelView}) that will get focused or a falsy value.\n * If falsy value is returned, a default behavior of the dropdown will engage focusing the first focusable child in\n * the {@link module:ui/dropdown/dropdownview~DropdownView#panelView}.\n */\nexport function focusChildOnDropdownOpen(dropdownView, childSelectorCallback) {\n dropdownView.on('change:isOpen', () => {\n if (!dropdownView.isOpen) {\n return;\n }\n const childToFocus = childSelectorCallback();\n if (!childToFocus) {\n return;\n }\n if (typeof childToFocus.focus === 'function') {\n childToFocus.focus();\n }\n else {\n /**\n * The child view of a {@link module:ui/dropdown/dropdownview~DropdownView dropdown} is missing the `focus()` method\n * and could not be focused when the dropdown got {@link module:ui/dropdown/dropdownview~DropdownView#isOpen open}.\n *\n * Making the content of a dropdown focusable in this case greatly improves the accessibility. Please make the view instance\n * implements the {@link module:ui/dropdown/dropdownpanelfocusable~DropdownPanelFocusable focusable interface} for the best user\n * experience.\n *\n * @error ui-dropdown-focus-child-on-open-child-missing-focus\n * @param {module:ui/view~View} view\n */\n logWarning('ui-dropdown-focus-child-on-open-child-missing-focus', { view: childToFocus });\n }\n // * Let the panel show up first (do not focus an invisible element).\n // * Execute after focusDropdownPanelOnOpen(). See focusDropdownPanelOnOpen() to learn more.\n }, { priority: priorities.low - 10 });\n}\n/**\n * Add a set of default behaviors to dropdown view.\n */\nfunction addDefaultBehavior(dropdownView) {\n closeDropdownOnClickOutside(dropdownView);\n closeDropdownOnExecute(dropdownView);\n closeDropdownOnBlur(dropdownView);\n focusDropdownContentsOnArrows(dropdownView);\n focusDropdownButtonOnClose(dropdownView);\n focusDropdownPanelOnOpen(dropdownView);\n}\n/**\n * Adds a behavior to a dropdownView that closes opened dropdown when user clicks outside the dropdown.\n */\nfunction closeDropdownOnClickOutside(dropdownView) {\n dropdownView.on('render', () => {\n clickOutsideHandler({\n emitter: dropdownView,\n activator: () => dropdownView.isOpen,\n callback: () => {\n dropdownView.isOpen = false;\n },\n contextElements: [dropdownView.element]\n });\n });\n}\n/**\n * Adds a behavior to a dropdownView that closes the dropdown view on \"execute\" event.\n */\nfunction closeDropdownOnExecute(dropdownView) {\n // Close the dropdown when one of the list items has been executed.\n dropdownView.on('execute', evt => {\n // Toggling a switch button view should not close the dropdown.\n if (evt.source instanceof SwitchButtonView) {\n return;\n }\n dropdownView.isOpen = false;\n });\n}\n/**\n * Adds a behavior to a dropdown view that closes opened dropdown when it loses focus.\n */\nfunction closeDropdownOnBlur(dropdownView) {\n dropdownView.focusTracker.on('change:isFocused', (evt, name, isFocused) => {\n if (dropdownView.isOpen && !isFocused) {\n dropdownView.isOpen = false;\n }\n });\n}\n/**\n * Adds a behavior to a dropdownView that focuses the dropdown's panel view contents on keystrokes.\n */\nfunction focusDropdownContentsOnArrows(dropdownView) {\n // If the dropdown panel is already open, the arrow down key should focus the first child of the #panelView.\n dropdownView.keystrokes.set('arrowdown', (data, cancel) => {\n if (dropdownView.isOpen) {\n dropdownView.panelView.focus();\n cancel();\n }\n });\n // If the dropdown panel is already open, the arrow up key should focus the last child of the #panelView.\n dropdownView.keystrokes.set('arrowup', (data, cancel) => {\n if (dropdownView.isOpen) {\n dropdownView.panelView.focusLast();\n cancel();\n }\n });\n}\n/**\n * Adds a behavior that focuses the #buttonView when the dropdown was closed but focus was within the #panelView element.\n * This makes sure the focus is never lost.\n */\nfunction focusDropdownButtonOnClose(dropdownView) {\n dropdownView.on('change:isOpen', (evt, name, isOpen) => {\n if (isOpen) {\n return;\n }\n const element = dropdownView.panelView.element;\n // If the dropdown was closed, move the focus back to the button (#12125).\n // Don't touch the focus, if it moved somewhere else (e.g. moved to the editing root on #execute) (#12178).\n // Note: Don't use the state of the DropdownView#focusTracker here. It fires #blur with the timeout.\n if (element && element.contains(global.document.activeElement)) {\n dropdownView.buttonView.focus();\n }\n });\n}\n/**\n * Adds a behavior that focuses the #panelView when dropdown gets open (accessibility).\n */\nfunction focusDropdownPanelOnOpen(dropdownView) {\n dropdownView.on('change:isOpen', (evt, name, isOpen) => {\n if (!isOpen) {\n return;\n }\n // Focus the first item in the dropdown when the dropdown opened.\n dropdownView.panelView.focus();\n // * Let the panel show up first (do not focus an invisible element).\n // * Also, execute before focusChildOnDropdownOpen() to make sure this helper does not break the\n // focus of a specific child by kicking in too late and resetting the focus in the panel.\n }, { priority: 'low' });\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/labeledfield/utils\n */\nimport InputTextView from '../inputtext/inputtextview';\nimport InputNumberView from '../inputnumber/inputnumberview';\nimport { createDropdown } from '../dropdown/utils';\n/**\n * A helper for creating labeled inputs.\n *\n * It creates an instance of a {@link module:ui/inputtext/inputtextview~InputTextView input text} that is\n * logically related to a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled view} in DOM.\n *\n * The helper does the following:\n *\n * * It sets input's `id` and `ariaDescribedById` attributes.\n * * It binds input's `isReadOnly` to the labeled view.\n * * It binds input's `hasError` to the labeled view.\n * * It enables a logic that cleans up the error when user starts typing in the input.\n *\n * Usage:\n *\n * ```ts\n * const labeledInputView = new LabeledFieldView( locale, createLabeledInputText );\n * console.log( labeledInputView.fieldView ); // A text input instance.\n * ```\n *\n * @param labeledFieldView The instance of the labeled field view.\n * @param viewUid An UID string that allows DOM logical connection between the\n * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#labelView labeled view's label} and the input.\n * @param statusUid An UID string that allows DOM logical connection between the\n * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#statusView labeled view's status} and the input.\n * @returns The input text view instance.\n */\nexport function createLabeledInputText(labeledFieldView, viewUid, statusUid) {\n const inputView = new InputTextView(labeledFieldView.locale);\n inputView.set({\n id: viewUid,\n ariaDescribedById: statusUid\n });\n inputView.bind('isReadOnly').to(labeledFieldView, 'isEnabled', value => !value);\n inputView.bind('hasError').to(labeledFieldView, 'errorText', value => !!value);\n inputView.on('input', () => {\n // UX: Make the error text disappear and disable the error indicator as the user\n // starts fixing the errors.\n labeledFieldView.errorText = null;\n });\n labeledFieldView.bind('isEmpty', 'isFocused', 'placeholder').to(inputView);\n return inputView;\n}\n/**\n * A helper for creating labeled number inputs.\n *\n * It creates an instance of a {@link module:ui/inputnumber/inputnumberview~InputNumberView input number} that is\n * logically related to a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled view} in DOM.\n *\n * The helper does the following:\n *\n * * It sets input's `id` and `ariaDescribedById` attributes.\n * * It binds input's `isReadOnly` to the labeled view.\n * * It binds input's `hasError` to the labeled view.\n * * It enables a logic that cleans up the error when user starts typing in the input.\n *\n * Usage:\n *\n * ```ts\n * const labeledInputView = new LabeledFieldView( locale, createLabeledInputNumber );\n * console.log( labeledInputView.fieldView ); // A number input instance.\n * ```\n *\n * @param labeledFieldView The instance of the labeled field view.\n * @param viewUid An UID string that allows DOM logical connection between the\n * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#labelView labeled view's label} and the input.\n * @param statusUid An UID string that allows DOM logical connection between the\n * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#statusView labeled view's status} and the input.\n * @returns The input number view instance.\n */\nexport function createLabeledInputNumber(labeledFieldView, viewUid, statusUid) {\n const inputView = new InputNumberView(labeledFieldView.locale);\n inputView.set({\n id: viewUid,\n ariaDescribedById: statusUid,\n inputMode: 'numeric'\n });\n inputView.bind('isReadOnly').to(labeledFieldView, 'isEnabled', value => !value);\n inputView.bind('hasError').to(labeledFieldView, 'errorText', value => !!value);\n inputView.on('input', () => {\n // UX: Make the error text disappear and disable the error indicator as the user\n // starts fixing the errors.\n labeledFieldView.errorText = null;\n });\n labeledFieldView.bind('isEmpty', 'isFocused', 'placeholder').to(inputView);\n return inputView;\n}\n/**\n * A helper for creating labeled dropdowns.\n *\n * It creates an instance of a {@link module:ui/dropdown/dropdownview~DropdownView dropdown} that is\n * logically related to a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled field view}.\n *\n * The helper does the following:\n *\n * * It sets dropdown's `id` and `ariaDescribedById` attributes.\n * * It binds input's `isEnabled` to the labeled view.\n *\n * Usage:\n *\n * ```ts\n * const labeledInputView = new LabeledFieldView( locale, createLabeledDropdown );\n * console.log( labeledInputView.fieldView ); // A dropdown instance.\n * ```\n *\n * @param labeledFieldView The instance of the labeled field view.\n * @param viewUid An UID string that allows DOM logical connection between the\n * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#labelView labeled view label} and the dropdown.\n * @param statusUid An UID string that allows DOM logical connection between the\n * {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView#statusView labeled view status} and the dropdown.\n * @returns The dropdown view instance.\n */\nexport function createLabeledDropdown(labeledFieldView, viewUid, statusUid) {\n const dropdownView = createDropdown(labeledFieldView.locale);\n dropdownView.set({\n id: viewUid,\n ariaDescribedById: statusUid\n });\n dropdownView.bind('isEnabled').to(labeledFieldView);\n return dropdownView;\n}\n","// Clamps a value between an upper and lower bound.\n// We use ternary operators because it makes the minified code\n// 2 times shorter then `Math.min(Math.max(a,b),c)`\nexport const clamp = (number, min = 0, max = 1) => {\n return number > max ? max : number < min ? min : number;\n};\nexport const round = (number, digits = 0, base = Math.pow(10, digits)) => {\n return Math.round(base * number) / base;\n};\n//# sourceMappingURL=math.js.map","import { round } from './math.js';\n/**\n * Valid CSS <angle> units.\n * https://developer.mozilla.org/en-US/docs/Web/CSS/angle\n */\nconst angleUnits = {\n grad: 360 / 400,\n turn: 360,\n rad: 360 / (Math.PI * 2)\n};\nexport const hexToHsva = (hex) => rgbaToHsva(hexToRgba(hex));\nexport const hexToRgba = (hex) => {\n if (hex[0] === '#')\n hex = hex.substring(1);\n if (hex.length < 6) {\n return {\n r: parseInt(hex[0] + hex[0], 16),\n g: parseInt(hex[1] + hex[1], 16),\n b: parseInt(hex[2] + hex[2], 16),\n a: hex.length === 4 ? round(parseInt(hex[3] + hex[3], 16) / 255, 2) : 1\n };\n }\n return {\n r: parseInt(hex.substring(0, 2), 16),\n g: parseInt(hex.substring(2, 4), 16),\n b: parseInt(hex.substring(4, 6), 16),\n a: hex.length === 8 ? round(parseInt(hex.substring(6, 8), 16) / 255, 2) : 1\n };\n};\nexport const parseHue = (value, unit = 'deg') => {\n return Number(value) * (angleUnits[unit] || 1);\n};\nexport const hslaStringToHsva = (hslString) => {\n const matcher = /hsla?\\(?\\s*(-?\\d*\\.?\\d+)(deg|rad|grad|turn)?[,\\s]+(-?\\d*\\.?\\d+)%?[,\\s]+(-?\\d*\\.?\\d+)%?,?\\s*[/\\s]*(-?\\d*\\.?\\d+)?(%)?\\s*\\)?/i;\n const match = matcher.exec(hslString);\n if (!match)\n return { h: 0, s: 0, v: 0, a: 1 };\n return hslaToHsva({\n h: parseHue(match[1], match[2]),\n s: Number(match[3]),\n l: Number(match[4]),\n a: match[5] === undefined ? 1 : Number(match[5]) / (match[6] ? 100 : 1)\n });\n};\nexport const hslStringToHsva = hslaStringToHsva;\nexport const hslaToHsva = ({ h, s, l, a }) => {\n s *= (l < 50 ? l : 100 - l) / 100;\n return {\n h: h,\n s: s > 0 ? ((2 * s) / (l + s)) * 100 : 0,\n v: l + s,\n a\n };\n};\nexport const hsvaToHex = (hsva) => rgbaToHex(hsvaToRgba(hsva));\nexport const hsvaToHsla = ({ h, s, v, a }) => {\n const hh = ((200 - s) * v) / 100;\n return {\n h: round(h),\n s: round(hh > 0 && hh < 200 ? ((s * v) / 100 / (hh <= 100 ? hh : 200 - hh)) * 100 : 0),\n l: round(hh / 2),\n a: round(a, 2)\n };\n};\nexport const hsvaToHsvString = (hsva) => {\n const { h, s, v } = roundHsva(hsva);\n return `hsv(${h}, ${s}%, ${v}%)`;\n};\nexport const hsvaToHsvaString = (hsva) => {\n const { h, s, v, a } = roundHsva(hsva);\n return `hsva(${h}, ${s}%, ${v}%, ${a})`;\n};\nexport const hsvaToHslString = (hsva) => {\n const { h, s, l } = hsvaToHsla(hsva);\n return `hsl(${h}, ${s}%, ${l}%)`;\n};\nexport const hsvaToHslaString = (hsva) => {\n const { h, s, l, a } = hsvaToHsla(hsva);\n return `hsla(${h}, ${s}%, ${l}%, ${a})`;\n};\nexport const hsvaToRgba = ({ h, s, v, a }) => {\n h = (h / 360) * 6;\n s = s / 100;\n v = v / 100;\n const hh = Math.floor(h), b = v * (1 - s), c = v * (1 - (h - hh) * s), d = v * (1 - (1 - h + hh) * s), module = hh % 6;\n return {\n r: round([v, c, b, b, d, v][module] * 255),\n g: round([d, v, v, c, b, b][module] * 255),\n b: round([b, b, d, v, v, c][module] * 255),\n a: round(a, 2)\n };\n};\nexport const hsvaToRgbString = (hsva) => {\n const { r, g, b } = hsvaToRgba(hsva);\n return `rgb(${r}, ${g}, ${b})`;\n};\nexport const hsvaToRgbaString = (hsva) => {\n const { r, g, b, a } = hsvaToRgba(hsva);\n return `rgba(${r}, ${g}, ${b}, ${a})`;\n};\nexport const hsvaStringToHsva = (hsvString) => {\n const matcher = /hsva?\\(?\\s*(-?\\d*\\.?\\d+)(deg|rad|grad|turn)?[,\\s]+(-?\\d*\\.?\\d+)%?[,\\s]+(-?\\d*\\.?\\d+)%?,?\\s*[/\\s]*(-?\\d*\\.?\\d+)?(%)?\\s*\\)?/i;\n const match = matcher.exec(hsvString);\n if (!match)\n return { h: 0, s: 0, v: 0, a: 1 };\n return roundHsva({\n h: parseHue(match[1], match[2]),\n s: Number(match[3]),\n v: Number(match[4]),\n a: match[5] === undefined ? 1 : Number(match[5]) / (match[6] ? 100 : 1)\n });\n};\nexport const hsvStringToHsva = hsvaStringToHsva;\nexport const rgbaStringToHsva = (rgbaString) => {\n const matcher = /rgba?\\(?\\s*(-?\\d*\\.?\\d+)(%)?[,\\s]+(-?\\d*\\.?\\d+)(%)?[,\\s]+(-?\\d*\\.?\\d+)(%)?,?\\s*[/\\s]*(-?\\d*\\.?\\d+)?(%)?\\s*\\)?/i;\n const match = matcher.exec(rgbaString);\n if (!match)\n return { h: 0, s: 0, v: 0, a: 1 };\n return rgbaToHsva({\n r: Number(match[1]) / (match[2] ? 100 / 255 : 1),\n g: Number(match[3]) / (match[4] ? 100 / 255 : 1),\n b: Number(match[5]) / (match[6] ? 100 / 255 : 1),\n a: match[7] === undefined ? 1 : Number(match[7]) / (match[8] ? 100 : 1)\n });\n};\nexport const rgbStringToHsva = rgbaStringToHsva;\nconst format = (number) => {\n const hex = number.toString(16);\n return hex.length < 2 ? '0' + hex : hex;\n};\nexport const rgbaToHex = ({ r, g, b, a }) => {\n const alphaHex = a < 1 ? format(round(a * 255)) : '';\n return '#' + format(r) + format(g) + format(b) + alphaHex;\n};\nexport const rgbaToHsva = ({ r, g, b, a }) => {\n const max = Math.max(r, g, b);\n const delta = max - Math.min(r, g, b);\n // prettier-ignore\n const hh = delta\n ? max === r\n ? (g - b) / delta\n : max === g\n ? 2 + (b - r) / delta\n : 4 + (r - g) / delta\n : 0;\n return {\n h: round(60 * (hh < 0 ? hh + 6 : hh)),\n s: round(max ? (delta / max) * 100 : 0),\n v: round((max / 255) * 100),\n a\n };\n};\nexport const roundHsva = (hsva) => ({\n h: round(hsva.h),\n s: round(hsva.s),\n v: round(hsva.v),\n a: round(hsva.a, 2)\n});\nexport const rgbaToRgb = ({ r, g, b }) => ({ r, g, b });\nexport const hslaToHsl = ({ h, s, l }) => ({ h, s, l });\nexport const hsvaToHsv = (hsva) => {\n const { h, s, v } = roundHsva(hsva);\n return { h, s, v };\n};\n//# sourceMappingURL=convert.js.map","import { hexToRgba } from './convert.js';\nexport const equalColorObjects = (first, second) => {\n if (first === second)\n return true;\n for (const prop in first) {\n // The following allows for a type-safe calling of this function (first & second have to be HSL, HSV, or RGB)\n // with type-unsafe iterating over object keys. TS does not allow this without an index (`[key: string]: number`)\n // on an object to define how iteration is normally done. To ensure extra keys are not allowed on our types,\n // we must cast our object to unknown (as RGB demands `r` be a key, while `Record<string, x>` does not care if\n // there is or not), and then as a type TS can iterate over.\n if (first[prop] !==\n second[prop])\n return false;\n }\n return true;\n};\nexport const equalColorString = (first, second) => {\n return first.replace(/\\s/g, '') === second.replace(/\\s/g, '');\n};\nexport const equalHex = (first, second) => {\n if (first.toLowerCase() === second.toLowerCase())\n return true;\n // To compare colors like `#FFF` and `ffffff` we convert them into RGB objects\n return equalColorObjects(hexToRgba(first), hexToRgba(second));\n};\n//# sourceMappingURL=compare.js.map","const cache = {};\nexport const tpl = (html) => {\n let template = cache[html];\n if (!template) {\n template = document.createElement('template');\n template.innerHTML = html;\n cache[html] = template;\n }\n return template;\n};\nexport const fire = (target, type, detail) => {\n target.dispatchEvent(new CustomEvent(type, {\n bubbles: true,\n detail\n }));\n};\n//# sourceMappingURL=dom.js.map","import { fire, tpl } from '../utils/dom.js';\nimport { clamp } from '../utils/math.js';\nlet hasTouched = false;\n// Check if an event was triggered by touch\nconst isTouch = (e) => 'touches' in e;\n// Prevent mobile browsers from handling mouse events (conflicting with touch ones).\n// If we detected a touch interaction before, we prefer reacting to touch events only.\nconst isValid = (event) => {\n if (hasTouched && !isTouch(event))\n return false;\n if (!hasTouched)\n hasTouched = isTouch(event);\n return true;\n};\nconst pointerMove = (target, event) => {\n const pointer = isTouch(event) ? event.touches[0] : event;\n const rect = target.el.getBoundingClientRect();\n fire(target.el, 'move', target.getMove({\n x: clamp((pointer.pageX - (rect.left + window.pageXOffset)) / rect.width),\n y: clamp((pointer.pageY - (rect.top + window.pageYOffset)) / rect.height)\n }));\n};\nconst keyMove = (target, event) => {\n // We use `keyCode` instead of `key` to reduce the size of the library.\n const keyCode = event.keyCode;\n // Ignore all keys except arrow ones, Page Up, Page Down, Home and End.\n if (keyCode > 40 || (target.xy && keyCode < 37) || keyCode < 33)\n return;\n // Do not scroll page by keys when color picker element has focus.\n event.preventDefault();\n // Send relative offset to the parent component.\n fire(target.el, 'move', target.getMove({\n x: keyCode === 39 // Arrow Right\n ? 0.01\n : keyCode === 37 // Arrow Left\n ? -0.01\n : keyCode === 34 // Page Down\n ? 0.05\n : keyCode === 33 // Page Up\n ? -0.05\n : keyCode === 35 // End\n ? 1\n : keyCode === 36 // Home\n ? -1\n : 0,\n y: keyCode === 40 // Arrow down\n ? 0.01\n : keyCode === 38 // Arrow Up\n ? -0.01\n : 0\n }, true));\n};\nexport class Slider {\n constructor(root, part, aria, xy) {\n const template = tpl(`<div role=\"slider\" tabindex=\"0\" part=\"${part}\" ${aria}><div part=\"${part}-pointer\"></div></div>`);\n root.appendChild(template.content.cloneNode(true));\n const el = root.querySelector(`[part=${part}]`);\n el.addEventListener('mousedown', this);\n el.addEventListener('touchstart', this);\n el.addEventListener('keydown', this);\n this.el = el;\n this.xy = xy;\n this.nodes = [el.firstChild, el];\n }\n set dragging(state) {\n const toggleEvent = state ? document.addEventListener : document.removeEventListener;\n toggleEvent(hasTouched ? 'touchmove' : 'mousemove', this);\n toggleEvent(hasTouched ? 'touchend' : 'mouseup', this);\n }\n handleEvent(event) {\n switch (event.type) {\n case 'mousedown':\n case 'touchstart':\n event.preventDefault();\n // event.button is 0 in mousedown for left button activation\n if (!isValid(event) || (!hasTouched && event.button != 0))\n return;\n this.el.focus();\n pointerMove(this, event);\n this.dragging = true;\n break;\n case 'mousemove':\n case 'touchmove':\n event.preventDefault();\n pointerMove(this, event);\n break;\n case 'mouseup':\n case 'touchend':\n this.dragging = false;\n break;\n case 'keydown':\n keyMove(this, event);\n break;\n }\n }\n style(styles) {\n styles.forEach((style, i) => {\n for (const p in style) {\n this.nodes[i].style.setProperty(p, style[p]);\n }\n });\n }\n}\n//# sourceMappingURL=slider.js.map","import { Slider } from './slider.js';\nimport { hsvaToHslString } from '../utils/convert.js';\nimport { clamp, round } from '../utils/math.js';\nexport class Hue extends Slider {\n constructor(root) {\n super(root, 'hue', 'aria-label=\"Hue\" aria-valuemin=\"0\" aria-valuemax=\"360\"', false);\n }\n update({ h }) {\n this.h = h;\n this.style([\n {\n left: `${(h / 360) * 100}%`,\n color: hsvaToHslString({ h, s: 100, v: 100, a: 1 })\n }\n ]);\n this.el.setAttribute('aria-valuenow', `${round(h)}`);\n }\n getMove(offset, key) {\n // Hue measured in degrees of the color circle ranging from 0 to 360\n return { h: key ? clamp(this.h + offset.x * 360, 0, 360) : 360 * offset.x };\n }\n}\n//# sourceMappingURL=hue.js.map","import { Slider } from './slider.js';\nimport { hsvaToHslString } from '../utils/convert.js';\nimport { clamp, round } from '../utils/math.js';\nexport class Saturation extends Slider {\n constructor(root) {\n super(root, 'saturation', 'aria-label=\"Color\"', true);\n }\n update(hsva) {\n this.hsva = hsva;\n this.style([\n {\n top: `${100 - hsva.v}%`,\n left: `${hsva.s}%`,\n color: hsvaToHslString(hsva)\n },\n {\n 'background-color': hsvaToHslString({ h: hsva.h, s: 100, v: 100, a: 1 })\n }\n ]);\n this.el.setAttribute('aria-valuetext', `Saturation ${round(hsva.s)}%, Brightness ${round(hsva.v)}%`);\n }\n getMove(offset, key) {\n // Saturation and brightness always fit into [0, 100] range\n return {\n s: key ? clamp(this.hsva.s + offset.x * 100, 0, 100) : offset.x * 100,\n v: key ? clamp(this.hsva.v - offset.y * 100, 0, 100) : Math.round(100 - offset.y * 100)\n };\n }\n}\n//# sourceMappingURL=saturation.js.map","export default `:host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:\"\";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}`;\n//# sourceMappingURL=color-picker.js.map","import { equalColorObjects } from '../utils/compare.js';\nimport { fire, tpl } from '../utils/dom.js';\nimport { Hue } from './hue.js';\nimport { Saturation } from './saturation.js';\nimport css from '../styles/color-picker.js';\nimport hueCss from '../styles/hue.js';\nimport saturationCss from '../styles/saturation.js';\nconst $isSame = Symbol('same');\nconst $color = Symbol('color');\nconst $hsva = Symbol('hsva');\nconst $update = Symbol('update');\nconst $parts = Symbol('parts');\nexport const $css = Symbol('css');\nexport const $sliders = Symbol('sliders');\nexport class ColorPicker extends HTMLElement {\n static get observedAttributes() {\n return ['color'];\n }\n get [$css]() {\n return [css, hueCss, saturationCss];\n }\n get [$sliders]() {\n return [Saturation, Hue];\n }\n get color() {\n return this[$color];\n }\n set color(newColor) {\n if (!this[$isSame](newColor)) {\n const newHsva = this.colorModel.toHsva(newColor);\n this[$update](newHsva);\n this[$color] = newColor;\n }\n }\n constructor() {\n super();\n const template = tpl(`<style>${this[$css].join('')}</style>`);\n const root = this.attachShadow({ mode: 'open' });\n root.appendChild(template.content.cloneNode(true));\n root.addEventListener('move', this);\n this[$parts] = this[$sliders].map((slider) => new slider(root));\n }\n connectedCallback() {\n // A user may set a property on an _instance_ of an element,\n // before its prototype has been connected to this class.\n // If so, we need to run it through the proper class setter.\n if (this.hasOwnProperty('color')) {\n const value = this.color;\n delete this['color'];\n this.color = value;\n }\n else if (!this.color) {\n this.color = this.colorModel.defaultColor;\n }\n }\n attributeChangedCallback(_attr, _oldVal, newVal) {\n const color = this.colorModel.fromAttr(newVal);\n if (!this[$isSame](color)) {\n this.color = color;\n }\n }\n handleEvent(event) {\n // Merge the current HSV color object with updated params.\n const oldHsva = this[$hsva];\n const newHsva = { ...oldHsva, ...event.detail };\n this[$update](newHsva);\n let newColor;\n if (!equalColorObjects(newHsva, oldHsva) &&\n !this[$isSame]((newColor = this.colorModel.fromHsva(newHsva)))) {\n this[$color] = newColor;\n fire(this, 'color-changed', { value: newColor });\n }\n }\n [$isSame](color) {\n return this.color && this.colorModel.equal(color, this.color);\n }\n [$update](hsva) {\n this[$hsva] = hsva;\n this[$parts].forEach((part) => part.update(hsva));\n }\n}\n//# sourceMappingURL=color-picker.js.map","export default `[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}`;\n//# sourceMappingURL=hue.js.map","export default `[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}`;\n//# sourceMappingURL=saturation.js.map","import { ColorPicker } from '../components/color-picker.js';\nimport { hexToHsva, hsvaToHex } from '../utils/convert.js';\nimport { equalHex } from '../utils/compare.js';\nconst colorModel = {\n defaultColor: '#000',\n toHsva: hexToHsva,\n fromHsva: ({ h, s, v }) => hsvaToHex({ h, s, v, a: 1 }),\n equal: equalHex,\n fromAttr: (color) => color\n};\nexport class HexBase extends ColorPicker {\n get colorModel() {\n return colorModel;\n }\n}\n//# sourceMappingURL=hex.js.map","import { HexBase } from './lib/entrypoints/hex.js';\n/**\n * A color picker custom element that uses HEX format.\n *\n * @element hex-color-picker\n *\n * @prop {string} color - Selected color in HEX format.\n * @attr {string} color - Selected color in HEX format.\n *\n * @fires color-changed - Event fired when color property changes.\n *\n * @csspart hue - A hue selector container.\n * @csspart saturation - A saturation selector container\n * @csspart hue-pointer - A hue pointer element.\n * @csspart saturation-pointer - A saturation pointer element.\n */\nexport class HexColorPicker extends HexBase {\n}\ncustomElements.define('hex-color-picker', HexColorPicker);\n//# sourceMappingURL=hex-color-picker.js.map","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./colorpicker.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/colorpicker/colorpickerview\n */\nimport { convertColor, convertToHex } from './utils';\nimport { global, env } from '@ckeditor/ckeditor5-utils';\nimport { debounce } from 'lodash-es';\nimport View from '../view';\nimport LabeledFieldView from '../labeledfield/labeledfieldview';\nimport { createLabeledInputText } from '../labeledfield/utils';\nimport 'vanilla-colorful/hex-color-picker.js';\nimport '../../theme/components/colorpicker/colorpicker.css';\nconst waitingTime = 150;\nexport default class ColorPickerView extends View {\n /**\n * Creates a view of color picker.\n *\n * @param locale\n * @param config\n */\n constructor(locale, config) {\n super(locale);\n this.set('color', '');\n this.set('_hexColor', '');\n this._format = config.format || 'hsl';\n this.hexInputRow = this._createInputRow();\n const children = this.createCollection();\n children.add(this.hexInputRow);\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: ['ck', 'ck-color-picker'],\n tabindex: -1\n },\n children\n });\n this._debounceColorPickerEvent = debounce((color) => {\n this.set('color', color);\n }, waitingTime, {\n leading: true\n });\n // Sets color in the picker if color was updated.\n this.on('set:color', (evt, propertyName, newValue) => {\n // The color needs always to be kept in the output format.\n evt.return = convertColor(newValue, this._format);\n });\n this.on('change:color', () => {\n this._hexColor = convertColorToCommonHexFormat(this.color);\n });\n this.on('change:_hexColor', () => {\n this.picker.setAttribute('color', this._hexColor);\n // There has to be two way binding between properties.\n // Extra precaution has to be taken to trigger change back only when the color really changes.\n if (convertColorToCommonHexFormat(this.color) != convertColorToCommonHexFormat(this._hexColor)) {\n this.color = this._hexColor;\n }\n });\n }\n /**\n * Renders color picker in the view.\n */\n render() {\n super.render();\n this.picker = global.document.createElement('hex-color-picker');\n this.picker.setAttribute('class', 'hex-color-picker');\n this.picker.setAttribute('tabindex', '-1');\n this._createSlidersView();\n if (this.element) {\n this.element.insertBefore(this.picker, this.hexInputRow.element);\n // Create custom stylesheet with a look of focused pointer in color picker and append it into the color picker shadowDom\n const styleSheetForFocusedColorPicker = document.createElement('style');\n styleSheetForFocusedColorPicker.textContent = '[role=\"slider\"]:focus [part$=\"pointer\"] {' +\n 'border: 1px solid #fff;' +\n 'outline: 1px solid var(--ck-color-focus-border);' +\n 'box-shadow: 0 0 0 2px #fff;' +\n '}';\n this.picker.shadowRoot.appendChild(styleSheetForFocusedColorPicker);\n }\n this.picker.addEventListener('color-changed', event => {\n const customEvent = event;\n const color = customEvent.detail.value;\n this._debounceColorPickerEvent(color);\n });\n }\n /**\n * Focuses the first pointer in color picker.\n *\n */\n focus() {\n // In some browsers we need to move the focus to the input first.\n // Otherwise, the color picker doesn't behave as expected.\n // In FF, after selecting the color via slider, it instantly moves back to the previous color.\n // In all iOS browsers and desktop Safari, once the saturation slider is moved for the first time,\n // editor collapses the selection and doesn't apply the color change.\n // See: https://github.com/cksource/ckeditor5-internal/issues/3245, https://github.com/ckeditor/ckeditor5/issues/14119,\n // https://github.com/cksource/ckeditor5-internal/issues/3268.\n /* istanbul ignore next -- @preserve */\n if (env.isGecko || env.isiOS || env.isSafari) {\n const input = this.hexInputRow.children.get(1);\n input.focus();\n }\n const firstSlider = this.slidersView.first;\n firstSlider.focus();\n }\n /**\n * Creates collection of sliders in color picker.\n *\n * @private\n */\n _createSlidersView() {\n const colorPickersChildren = [...this.picker.shadowRoot.children];\n const sliders = colorPickersChildren.filter(item => item.getAttribute('role') === 'slider');\n const slidersView = sliders.map(slider => {\n const view = new SliderView(slider);\n return view;\n });\n this.slidersView = this.createCollection();\n slidersView.forEach(item => {\n this.slidersView.add(item);\n });\n }\n /**\n * Creates input row for defining custom colors in color picker.\n *\n * @private\n */\n _createInputRow() {\n const hashView = new HashView();\n const colorInput = this._createColorInput();\n return new ColorPickerInputRowView(this.locale, [hashView, colorInput]);\n }\n /**\n * Creates the input where user can type or paste the color in hex format.\n *\n * @private\n */\n _createColorInput() {\n const labeledInput = new LabeledFieldView(this.locale, createLabeledInputText);\n const { t } = this.locale;\n labeledInput.set({\n label: t('HEX'),\n class: 'color-picker-hex-input'\n });\n labeledInput.fieldView.bind('value').to(this, '_hexColor', pickerColor => {\n if (labeledInput.isFocused) {\n // Text field shouldn't be updated with color change if the text field is focused.\n // Imagine user typing hex code and getting the value of field changed.\n return labeledInput.fieldView.value;\n }\n else {\n return pickerColor.startsWith('#') ? pickerColor.substring(1) : pickerColor;\n }\n });\n // Only accept valid hex colors as input.\n labeledInput.fieldView.on('input', () => {\n const inputValue = labeledInput.fieldView.element.value;\n if (inputValue) {\n // Trim the whitespace.\n const trimmedValue = inputValue.trim();\n // Drop the `#` from the beginning if present.\n const hashlessInput = trimmedValue.startsWith('#') ? trimmedValue.substring(1) : trimmedValue;\n // Check if it's a hex color (3,4,6 or 8 chars long and with proper characters).\n const isValidHexColor = [3, 4, 6, 8].includes(hashlessInput.length) &&\n /(([0-9a-fA-F]{2}){3,4}|([0-9a-fA-F]){3,4})/.test(hashlessInput);\n if (isValidHexColor) {\n // If so, set the color.\n // Otherwise, do nothing.\n this._debounceColorPickerEvent('#' + hashlessInput);\n }\n }\n });\n return labeledInput;\n }\n}\n// Converts any color format to a unified hex format.\n//\n// @param inputColor\n// @returns An unified hex string.\nfunction convertColorToCommonHexFormat(inputColor) {\n let ret = convertToHex(inputColor);\n if (!ret) {\n ret = '#000';\n }\n if (ret.length === 4) {\n // Unfold shortcut format.\n ret = '#' + [ret[1], ret[1], ret[2], ret[2], ret[3], ret[3]].join('');\n }\n return ret.toLowerCase();\n}\n// View abstraction over pointer in color picker.\nclass SliderView extends View {\n /**\n * @param element HTML elemnt of slider in color picker.\n */\n constructor(element) {\n super();\n this.element = element;\n }\n /**\n * Focuses element.\n */\n focus() {\n this.element.focus();\n }\n}\n// View abstaction over the `#` character before color input.\nclass HashView extends View {\n constructor(locale) {\n super(locale);\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-color-picker__hash-view'\n ]\n },\n children: '#'\n });\n }\n}\n// The class representing a row containing hex color input field.\n// **Note**: For now this class is private. When more use cases appear (beyond `ckeditor5-table` and `ckeditor5-image`),\n// it will become a component in `ckeditor5-ui`.\n//\n// @private\nclass ColorPickerInputRowView extends View {\n /**\n * Creates an instance of the form row class.\n *\n * @param locale The locale instance.\n */\n constructor(locale, children) {\n super(locale);\n this.children = this.createCollection(children);\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-color-picker__row'\n ]\n },\n children: this.children\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/componentfactory\n */\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * A helper class implementing the UI component ({@link module:ui/view~View view}) factory.\n *\n * It allows functions producing specific UI components to be registered under their unique names\n * in the factory. A registered component can be then instantiated by providing its name.\n * Note that the names are case insensitive.\n *\n * ```ts\n * // The editor provides localization tools for the factory.\n * const factory = new ComponentFactory( editor );\n *\n * factory.add( 'foo', locale => new FooView( locale ) );\n * factory.add( 'bar', locale => new BarView( locale ) );\n *\n * // An instance of FooView.\n * const fooInstance = factory.create( 'foo' );\n *\n * // Names are case insensitive so this is also allowed:\n * const barInstance = factory.create( 'Bar' );\n * ```\n *\n * The {@link module:core/editor/editor~Editor#locale editor locale} is passed to the factory\n * function when {@link module:ui/componentfactory~ComponentFactory#create} is called.\n */\nexport default class ComponentFactory {\n /**\n * Creates an instance of the factory.\n *\n * @param editor The editor instance.\n */\n constructor(editor) {\n /**\n * Registered component factories.\n */\n this._components = new Map();\n this.editor = editor;\n }\n /**\n * Returns an iterator of registered component names. Names are returned in lower case.\n */\n *names() {\n for (const value of this._components.values()) {\n yield value.originalName;\n }\n }\n /**\n * Registers a component factory function that will be used by the\n * {@link #create create} method and called with the\n * {@link module:core/editor/editor~Editor#locale editor locale} as an argument,\n * allowing localization of the {@link module:ui/view~View view}.\n *\n * @param name The name of the component.\n * @param callback The callback that returns the component.\n */\n add(name, callback) {\n this._components.set(getNormalized(name), { callback, originalName: name });\n }\n /**\n * Creates an instance of a component registered in the factory under a specific name.\n *\n * When called, the {@link module:core/editor/editor~Editor#locale editor locale} is passed to\n * the previously {@link #add added} factory function, allowing localization of the\n * {@link module:ui/view~View view}.\n *\n * @param name The name of the component.\n * @returns The instantiated component view.\n */\n create(name) {\n if (!this.has(name)) {\n /**\n * The required component is not registered in the component factory. Please make sure\n * the provided name is correct and the component has been correctly\n * {@link module:ui/componentfactory~ComponentFactory#add added} to the factory.\n *\n * @error componentfactory-item-missing\n * @param name The name of the missing component.\n */\n throw new CKEditorError('componentfactory-item-missing', this, { name });\n }\n return this._components.get(getNormalized(name)).callback(this.editor.locale);\n }\n /**\n * Checks if a component of a given name is registered in the factory.\n *\n * @param name The name of the component.\n */\n has(name) {\n return this._components.has(getNormalized(name));\n }\n}\n/**\n * Ensures that the component name used as the key in the internal map is in lower case.\n */\nfunction getNormalized(name) {\n return String(name).toLowerCase();\n}\n","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./balloonpanel.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/panel/balloon/balloonpanelview\n */\nimport View from '../../view';\nimport { getOptimalPosition, global, isRange, toUnit } from '@ckeditor/ckeditor5-utils';\nimport { isElement } from 'lodash-es';\nimport '../../../theme/components/panel/balloonpanel.css';\nconst toPx = toUnit('px');\nconst defaultLimiterElement = global.document.body;\n/**\n * The balloon panel view class.\n *\n * A floating container which can\n * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#pin pin} to any\n * {@link module:utils/dom/position~Options#target target} in the DOM and remain in that position\n * e.g. when the web page is scrolled.\n *\n * The balloon panel can be used to display contextual, non-blocking UI like forms, toolbars and\n * the like in its {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#content} view\n * collection.\n *\n * There is a number of {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}\n * that the balloon can use, automatically switching from one to another when the viewport space becomes\n * scarce to keep the balloon visible to the user as long as it is possible. The balloon will also\n * accept any custom position set provided by the user compatible with the\n * {@link module:utils/dom/position~Options options}.\n *\n * ```ts\n * const panel = new BalloonPanelView( locale );\n * const childView = new ChildView();\n * const positions = BalloonPanelView.defaultPositions;\n *\n * panel.render();\n *\n * // Add a child view to the panel's content collection.\n * panel.content.add( childView );\n *\n * // Start pinning the panel to an element with the \"target\" id DOM.\n * // The balloon will remain pinned until unpin() is called.\n * panel.pin( {\n * \ttarget: document.querySelector( '#target' ),\n * \tpositions: [\n * \t\tpositions.northArrowSouth,\n * \t\tpositions.southArrowNorth\n * \t]\n * } );\n * ```\n */\nexport default class BalloonPanelView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('top', 0);\n this.set('left', 0);\n this.set('position', 'arrow_nw');\n this.set('isVisible', false);\n this.set('withArrow', true);\n this.set('class', undefined);\n this._pinWhenIsVisibleCallback = null;\n this.content = this.createCollection();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-balloon-panel',\n bind.to('position', value => `ck-balloon-panel_${value}`),\n bind.if('isVisible', 'ck-balloon-panel_visible'),\n bind.if('withArrow', 'ck-balloon-panel_with-arrow'),\n bind.to('class')\n ],\n style: {\n top: bind.to('top', toPx),\n left: bind.to('left', toPx)\n }\n },\n children: this.content\n });\n }\n /**\n * Shows the panel.\n *\n * See {@link #isVisible}.\n */\n show() {\n this.isVisible = true;\n }\n /**\n * Hides the panel.\n *\n * See {@link #isVisible}.\n */\n hide() {\n this.isVisible = false;\n }\n /**\n * Attaches the panel to a specified {@link module:utils/dom/position~Options#target} with a\n * smart positioning heuristics that chooses from available positions to make sure the panel\n * is visible to the user i.e. within the limits of the viewport.\n *\n * This method accepts configuration {@link module:utils/dom/position~Options options}\n * to set the `target`, optional `limiter` and `positions` the balloon should choose from.\n *\n * ```ts\n * const panel = new BalloonPanelView( locale );\n * const positions = BalloonPanelView.defaultPositions;\n *\n * panel.render();\n *\n * // Attach the panel to an element with the \"target\" id DOM.\n * panel.attachTo( {\n * \ttarget: document.querySelector( '#target' ),\n * \tpositions: [\n * \t\tpositions.northArrowSouth,\n * \t\tpositions.southArrowNorth\n * \t]\n * } );\n * ```\n *\n * **Note**: Attaching the panel will also automatically {@link #show} it.\n *\n * **Note**: An attached panel will not follow its target when the window is scrolled or resized.\n * See the {@link #pin} method for a more permanent positioning strategy.\n *\n * @param options Positioning options compatible with {@link module:utils/dom/position~getOptimalPosition}.\n * Default `positions` array is {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.\n */\n attachTo(options) {\n this.show();\n const defaultPositions = BalloonPanelView.defaultPositions;\n const positionOptions = Object.assign({}, {\n element: this.element,\n positions: [\n defaultPositions.southArrowNorth,\n defaultPositions.southArrowNorthMiddleWest,\n defaultPositions.southArrowNorthMiddleEast,\n defaultPositions.southArrowNorthWest,\n defaultPositions.southArrowNorthEast,\n defaultPositions.northArrowSouth,\n defaultPositions.northArrowSouthMiddleWest,\n defaultPositions.northArrowSouthMiddleEast,\n defaultPositions.northArrowSouthWest,\n defaultPositions.northArrowSouthEast,\n defaultPositions.viewportStickyNorth\n ],\n limiter: defaultLimiterElement,\n fitInViewport: true\n }, options);\n const optimalPosition = BalloonPanelView._getOptimalPosition(positionOptions);\n // Usually browsers make some problems with super accurate values like 104.345px\n // so it is better to use int values.\n const left = parseInt(optimalPosition.left);\n const top = parseInt(optimalPosition.top);\n const position = optimalPosition.name;\n const config = optimalPosition.config || {};\n const { withArrow = true } = config;\n this.top = top;\n this.left = left;\n this.position = position;\n this.withArrow = withArrow;\n }\n /**\n * Works the same way as the {@link #attachTo} method except that the position of the panel is\n * continuously updated when:\n *\n * * any ancestor of the {@link module:utils/dom/position~Options#target}\n * or {@link module:utils/dom/position~Options#limiter} is scrolled,\n * * the browser window gets resized or scrolled.\n *\n * Thanks to that, the panel always sticks to the {@link module:utils/dom/position~Options#target}\n * and is immune to the changing environment.\n *\n * ```ts\n * const panel = new BalloonPanelView( locale );\n * const positions = BalloonPanelView.defaultPositions;\n *\n * panel.render();\n *\n * // Pin the panel to an element with the \"target\" id DOM.\n * panel.pin( {\n * \ttarget: document.querySelector( '#target' ),\n * \tpositions: [\n * \t\tpositions.northArrowSouth,\n * \t\tpositions.southArrowNorth\n * \t]\n * } );\n * ```\n *\n * To leave the pinned state, use the {@link #unpin} method.\n *\n * **Note**: Pinning the panel will also automatically {@link #show} it.\n *\n * @param options Positioning options compatible with {@link module:utils/dom/position~getOptimalPosition}.\n * Default `positions` array is {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.\n */\n pin(options) {\n this.unpin();\n this._pinWhenIsVisibleCallback = () => {\n if (this.isVisible) {\n this._startPinning(options);\n }\n else {\n this._stopPinning();\n }\n };\n this._startPinning(options);\n // Control the state of the listeners depending on whether the panel is visible\n // or not.\n // TODO: Use on() (https://github.com/ckeditor/ckeditor5-utils/issues/144).\n this.listenTo(this, 'change:isVisible', this._pinWhenIsVisibleCallback);\n }\n /**\n * Stops pinning the panel, as set up by {@link #pin}.\n */\n unpin() {\n if (this._pinWhenIsVisibleCallback) {\n // Deactivate listeners attached by pin().\n this._stopPinning();\n // Deactivate the panel pin() control logic.\n // TODO: Use off() (https://github.com/ckeditor/ckeditor5-utils/issues/144).\n this.stopListening(this, 'change:isVisible', this._pinWhenIsVisibleCallback);\n this._pinWhenIsVisibleCallback = null;\n this.hide();\n }\n }\n /**\n * Starts managing the pinned state of the panel. See {@link #pin}.\n *\n * @param options Positioning options compatible with {@link module:utils/dom/position~getOptimalPosition}.\n */\n _startPinning(options) {\n this.attachTo(options);\n const targetElement = getDomElement(options.target);\n const limiterElement = options.limiter ? getDomElement(options.limiter) : defaultLimiterElement;\n // Then we need to listen on scroll event of eny element in the document.\n this.listenTo(global.document, 'scroll', (evt, domEvt) => {\n const scrollTarget = domEvt.target;\n // The position needs to be updated if the positioning target is within the scrolled element.\n const isWithinScrollTarget = targetElement && scrollTarget.contains(targetElement);\n // The position needs to be updated if the positioning limiter is within the scrolled element.\n const isLimiterWithinScrollTarget = limiterElement && scrollTarget.contains(limiterElement);\n // The positioning target and/or limiter can be a Rect, object etc..\n // There's no way to optimize the listener then.\n if (isWithinScrollTarget || isLimiterWithinScrollTarget || !targetElement || !limiterElement) {\n this.attachTo(options);\n }\n }, { useCapture: true });\n // We need to listen on window resize event and update position.\n this.listenTo(global.window, 'resize', () => {\n this.attachTo(options);\n });\n }\n /**\n * Stops managing the pinned state of the panel. See {@link #pin}.\n */\n _stopPinning() {\n this.stopListening(global.document, 'scroll');\n this.stopListening(global.window, 'resize');\n }\n}\n/**\n * A side offset of the arrow tip from the edge of the balloon. Controlled by CSS.\n *\n * ```\n *\t\t ┌───────────────────────┐\n *\t\t │ │\n *\t\t │ Balloon │\n *\t\t │ Content │\n *\t\t │ │\n *\t\t └──+ +───────────────┘\n *\t\t | \\ /\n *\t\t | \\/\n *\t\t>┼─────┼< ─────────────────────── side offset\n *\n * ```\n *\n * @default 25\n */\nBalloonPanelView.arrowSideOffset = 25;\n/**\n * A height offset of the arrow from the edge of the balloon. Controlled by CSS.\n *\n * ```\n *\t\t ┌───────────────────────┐\n *\t\t │ │\n *\t\t │ Balloon │\n *\t\t │ Content │ -- arrow height offset\n *\t\t │ │ V\n *\t\t └──+ +───────────────┘ --- ─┼───────\n *\t\t \\ / │\n *\t\t \\/ │\n *\t\t────────────────────────────────┼───────\n *\t\t ^\n *\n *\n *\t\t>┼────┼< arrow height offset\n *\t\t │ │\n *\t\t │ ┌────────────────────────┐\n *\t\t │ │ │\n *\t\t │ │\n *\t\t │ Balloon │\n *\t\t │ ╲ Content │\n *\t\t │ ╲ │\n *\t\t │ │ │\n *\t\t │ └────────────────────────┘\n * ```\n *\n * @default 10\n*/\nBalloonPanelView.arrowHeightOffset = 10;\n/**\n * A vertical offset of the balloon panel from the edge of the viewport if sticky.\n * It helps in accessing toolbar buttons underneath the balloon panel.\n *\n * ```\n *\t\t ┌───────────────────────────────────────────────────┐\n *\t\t │ Target │\n *\t\t │ │\n *\t\t │ /── vertical offset │\n *\t\t┌─────────────────────────────V─────────────────────────┐\n *\t\t│ Toolbar ┌─────────────┐ │\n *\t\t├────────────────────│ Balloon │────────────────────┤\n *\t\t│ │ └─────────────┘ │ │\n *\t\t│ │ │ │\n *\t\t│ │ │ │\n *\t\t│ │ │ │\n *\t\t│ └───────────────────────────────────────────────────┘ │\n *\t\t│ Viewport │\n *\t\t└───────────────────────────────────────────────────────┘\n * ```\n *\n * @default 20\n */\nBalloonPanelView.stickyVerticalOffset = 20;\n/**\n * Function used to calculate the optimal position for the balloon.\n */\nBalloonPanelView._getOptimalPosition = getOptimalPosition;\n/**\n * A default set of positioning functions used by the balloon panel view\n * when attaching using the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#attachTo} method.\n *\n * The available positioning functions are as follows:\n *\n * **North west**\n *\n * * `northWestArrowSouthWest`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * * `northWestArrowSouthMiddleWest`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * * `northWestArrowSouth`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * * `northWestArrowSouthMiddleEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * * `northWestArrowSouthEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * **North**\n *\n * * `northArrowSouthWest`\n *\n * ```\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n *\t\t V\n *\t\t[ Target ]\n * ```\n *\n * * `northArrowSouthMiddleWest`\n *\n * ```\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n *\t\t V\n *\t\t[ Target ]\n * ```\n * * `northArrowSouth`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * * `northArrowSouthMiddleEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * * `northArrowSouthEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * **North east**\n *\n * * `northEastArrowSouthWest`\n *\n * ```\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n *\t\t V\n *\t\t[ Target ]\n * ```\n *\n * * `northEastArrowSouthMiddleWest`\n *\n * ```\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n *\t\t V\n *\t\t[ Target ]\n * ```\n *\n * * `northEastArrowSouth`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t[ Target ]\n * ```\n *\n * * `northEastArrowSouthMiddleEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * * `northEastArrowSouthEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n *\t\t V\n *\t\t [ Target ]\n * ```\n *\n * **South**\n *\n * * `southArrowNorthWest`\n *\n * ```\n *\t\t[ Target ]\n *\t\t ^\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n * ```\n *\n * * `southArrowNorthMiddleWest`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n * ```\n *\n * * `southArrowNorth`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * * `southArrowNorthMiddleEast`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n * ```\n *\n * * `southArrowNorthEast`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * **South west**\n *\n * * `southWestArrowNorthWest`\n *\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * * `southWestArrowNorthMiddleWest`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n * ```\n *\n * * `southWestArrowNorth`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * * `southWestArrowNorthMiddleEast`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * * `southWestArrowNorthEast`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * **South east**\n *\n * * `southEastArrowNorthWest`\n *\n * ```\n *\t\t[ Target ]\n *\t\t ^\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n * ```\n *\n * * `southEastArrowNorthMiddleWest`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t +-----------------+\n *\t\t | Balloon |\n *\t\t +-----------------+\n * ```\n *\n * * `southEastArrowNorth`\n *\n * ```\n *\t\t[ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * * `southEastArrowNorthMiddleEast`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * * `southEastArrowNorthEast`\n *\n * ```\n *\t\t [ Target ]\n *\t\t ^\n *\t\t+-----------------+\n *\t\t| Balloon |\n *\t\t+-----------------+\n * ```\n *\n * **West**\n *\n * * `westArrowEast`\n *\n * ```\n *\t\t+-----------------+\n *\t\t| Balloon |>[ Target ]\n *\t\t+-----------------+\n * ```\n *\n * **East**\n *\n * * `eastArrowWest`\n *\n * ```\n *\t\t +-----------------+\n *\t\t[ Target ]<| Balloon |\n *\t\t +-----------------+\n * ```\n *\n * **Sticky**\n *\n * * `viewportStickyNorth`\n *\n * ```\n *\t\t +---------------------------+\n *\t\t | [ Target ] |\n *\t\t | |\n *\t\t+-----------------------------------+\n *\t\t| | +-----------------+ | |\n *\t\t| | | Balloon | | |\n *\t\t| | +-----------------+ | |\n *\t\t| | | |\n *\t\t| | | |\n *\t\t| | | |\n *\t\t| | | |\n *\t\t| +---------------------------+ |\n *\t\t| Viewport |\n *\t\t+-----------------------------------+\n * ```\n *\n * See {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#attachTo}.\n *\n * Positioning functions must be compatible with {@link module:utils/dom/position~Position}.\n *\n * Default positioning functions with customized offsets can be generated using\n * {@link module:ui/panel/balloon/balloonpanelview~generatePositions}.\n *\n * The name that the position function returns will be reflected in the balloon panel's class that\n * controls the placement of the \"arrow\". See {@link #position} to learn more.\n */\nBalloonPanelView.defaultPositions = generatePositions();\n/**\n * Returns the DOM element for given object or null, if there is none,\n * e.g. when the passed object is a Rect instance or so.\n */\nfunction getDomElement(object) {\n if (isElement(object)) {\n return object;\n }\n if (isRange(object)) {\n return object.commonAncestorContainer;\n }\n if (typeof object == 'function') {\n return getDomElement(object());\n }\n return null;\n}\n/**\n * Returns available {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView}\n * {@link module:utils/dom/position~PositioningFunction positioning functions} adjusted by the specific offsets.\n *\n * @internal\n * @param options Options to generate positions. If not specified, this helper will simply return\n * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.defaultPositions}.\n * @param options.sideOffset A custom side offset (in pixels) of each position. If\n * not specified, {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowSideOffset the default value}\n * will be used.\n * @param options.heightOffset A custom height offset (in pixels) of each position. If\n * not specified, {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.arrowHeightOffset the default value}\n * will be used.\n * @param options.stickyVerticalOffset A custom offset (in pixels) of the `viewportStickyNorth` positioning function.\n * If not specified, {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView.stickyVerticalOffset the default value}\n * will be used.\n * @param options.config Additional configuration of the balloon balloon panel view.\n * Currently only {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView#withArrow} is supported. Learn more\n * about {@link module:utils/dom/position~PositioningFunction positioning functions}.\n */\nexport function generatePositions(options = {}) {\n const { sideOffset = BalloonPanelView.arrowSideOffset, heightOffset = BalloonPanelView.arrowHeightOffset, stickyVerticalOffset = BalloonPanelView.stickyVerticalOffset, config } = options;\n return {\n // ------- North west\n northWestArrowSouthWest: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left - sideOffset,\n name: 'arrow_sw',\n ...(config && { config })\n }),\n northWestArrowSouthMiddleWest: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left - (balloonRect.width * .25) - sideOffset,\n name: 'arrow_smw',\n ...(config && { config })\n }),\n northWestArrowSouth: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left - balloonRect.width / 2,\n name: 'arrow_s',\n ...(config && { config })\n }),\n northWestArrowSouthMiddleEast: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left - (balloonRect.width * .75) + sideOffset,\n name: 'arrow_sme',\n ...(config && { config })\n }),\n northWestArrowSouthEast: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left - balloonRect.width + sideOffset,\n name: 'arrow_se',\n ...(config && { config })\n }),\n // ------- North\n northArrowSouthWest: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left + targetRect.width / 2 - sideOffset,\n name: 'arrow_sw',\n ...(config && { config })\n }),\n northArrowSouthMiddleWest: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left + targetRect.width / 2 - (balloonRect.width * .25) - sideOffset,\n name: 'arrow_smw',\n ...(config && { config })\n }),\n northArrowSouth: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,\n name: 'arrow_s',\n ...(config && { config })\n }),\n northArrowSouthMiddleEast: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left + targetRect.width / 2 - (balloonRect.width * .75) + sideOffset,\n name: 'arrow_sme',\n ...(config && { config })\n }),\n northArrowSouthEast: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.left + targetRect.width / 2 - balloonRect.width + sideOffset,\n name: 'arrow_se',\n ...(config && { config })\n }),\n // ------- North east\n northEastArrowSouthWest: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.right - sideOffset,\n name: 'arrow_sw',\n ...(config && { config })\n }),\n northEastArrowSouthMiddleWest: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.right - (balloonRect.width * .25) - sideOffset,\n name: 'arrow_smw',\n ...(config && { config })\n }),\n northEastArrowSouth: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.right - balloonRect.width / 2,\n name: 'arrow_s',\n ...(config && { config })\n }),\n northEastArrowSouthMiddleEast: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.right - (balloonRect.width * .75) + sideOffset,\n name: 'arrow_sme',\n ...(config && { config })\n }),\n northEastArrowSouthEast: (targetRect, balloonRect) => ({\n top: getNorthTop(targetRect, balloonRect),\n left: targetRect.right - balloonRect.width + sideOffset,\n name: 'arrow_se',\n ...(config && { config })\n }),\n // ------- South west\n southWestArrowNorthWest: targetRect => ({\n top: getSouthTop(targetRect),\n left: targetRect.left - sideOffset,\n name: 'arrow_nw',\n ...(config && { config })\n }),\n southWestArrowNorthMiddleWest: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left - (balloonRect.width * .25) - sideOffset,\n name: 'arrow_nmw',\n ...(config && { config })\n }),\n southWestArrowNorth: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left - balloonRect.width / 2,\n name: 'arrow_n',\n ...(config && { config })\n }),\n southWestArrowNorthMiddleEast: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left - (balloonRect.width * .75) + sideOffset,\n name: 'arrow_nme',\n ...(config && { config })\n }),\n southWestArrowNorthEast: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left - balloonRect.width + sideOffset,\n name: 'arrow_ne',\n ...(config && { config })\n }),\n // ------- South\n southArrowNorthWest: targetRect => ({\n top: getSouthTop(targetRect),\n left: targetRect.left + targetRect.width / 2 - sideOffset,\n name: 'arrow_nw',\n ...(config && { config })\n }),\n southArrowNorthMiddleWest: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left + targetRect.width / 2 - (balloonRect.width * 0.25) - sideOffset,\n name: 'arrow_nmw',\n ...(config && { config })\n }),\n southArrowNorth: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,\n name: 'arrow_n',\n ...(config && { config })\n }),\n southArrowNorthMiddleEast: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left + targetRect.width / 2 - (balloonRect.width * 0.75) + sideOffset,\n name: 'arrow_nme',\n ...(config && { config })\n }),\n southArrowNorthEast: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.left + targetRect.width / 2 - balloonRect.width + sideOffset,\n name: 'arrow_ne',\n ...(config && { config })\n }),\n // ------- South east\n southEastArrowNorthWest: targetRect => ({\n top: getSouthTop(targetRect),\n left: targetRect.right - sideOffset,\n name: 'arrow_nw',\n ...(config && { config })\n }),\n southEastArrowNorthMiddleWest: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.right - (balloonRect.width * .25) - sideOffset,\n name: 'arrow_nmw',\n ...(config && { config })\n }),\n southEastArrowNorth: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.right - balloonRect.width / 2,\n name: 'arrow_n',\n ...(config && { config })\n }),\n southEastArrowNorthMiddleEast: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.right - (balloonRect.width * .75) + sideOffset,\n name: 'arrow_nme',\n ...(config && { config })\n }),\n southEastArrowNorthEast: (targetRect, balloonRect) => ({\n top: getSouthTop(targetRect),\n left: targetRect.right - balloonRect.width + sideOffset,\n name: 'arrow_ne',\n ...(config && { config })\n }),\n // ------- West\n westArrowEast: (targetRect, balloonRect) => ({\n top: targetRect.top + targetRect.height / 2 - balloonRect.height / 2,\n left: targetRect.left - balloonRect.width - heightOffset,\n name: 'arrow_e',\n ...(config && { config })\n }),\n // ------- East\n eastArrowWest: (targetRect, balloonRect) => ({\n top: targetRect.top + targetRect.height / 2 - balloonRect.height / 2,\n left: targetRect.right + heightOffset,\n name: 'arrow_w',\n ...(config && { config })\n }),\n // ------- Sticky\n viewportStickyNorth: (targetRect, balloonRect, viewportRect) => {\n if (!targetRect.getIntersection(viewportRect)) {\n return null;\n }\n return {\n top: viewportRect.top + stickyVerticalOffset,\n left: targetRect.left + targetRect.width / 2 - balloonRect.width / 2,\n name: 'arrowless',\n config: {\n withArrow: false,\n ...config\n }\n };\n }\n };\n /**\n * Returns the top coordinate for positions starting with `north*`.\n *\n * @param targetRect A rect of the target.\n * @param balloonRect A rect of the balloon.\n */\n function getNorthTop(targetRect, balloonRect) {\n return targetRect.top - balloonRect.height - heightOffset;\n }\n /**\n * Returns the top coordinate for positions starting with `south*`.\n *\n * @param targetRect A rect of the target.\n */\n function getSouthTop(targetRect) {\n return targetRect.bottom + heightOffset;\n }\n}\n","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tooltip.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/tooltipmanager\n */\nimport View from './view';\nimport BalloonPanelView, { generatePositions } from './panel/balloon/balloonpanelview';\nimport { DomEmitterMixin, ResizeObserver, first, global, isVisible } from '@ckeditor/ckeditor5-utils';\nimport { isElement, debounce } from 'lodash-es';\nimport '../theme/components/tooltip/tooltip.css';\nconst BALLOON_CLASS = 'ck-tooltip';\n/**\n * A tooltip manager class for the UI of the editor.\n *\n * **Note**: Most likely you do not have to use the `TooltipManager` API listed below in order to display tooltips. Popular\n * {@glink framework/architecture/ui-library UI components} support tooltips out-of-the-box via observable properties\n * (see {@link module:ui/button/buttonview~ButtonView#tooltip} and {@link module:ui/button/buttonview~ButtonView#tooltipPosition}).\n *\n * # Displaying tooltips\n *\n * To display a tooltip, set `data-cke-tooltip-text` attribute on any DOM element:\n *\n * ```ts\n * domElement.dataset.ckeTooltipText = 'My tooltip';\n * ```\n *\n * The tooltip will show up whenever the user moves the mouse over the element or the element gets focus in DOM.\n *\n * # Positioning tooltips\n *\n * To change the position of the tooltip, use the `data-cke-tooltip-position` attribute (`s`, `se`, `sw`, `n`, `e`, or `w`):\n *\n * ```ts\n * domElement.dataset.ckeTooltipText = 'Tooltip to the north';\n * domElement.dataset.ckeTooltipPosition = 'n';\n * ```\n *\n * # Disabling tooltips\n *\n * In order to disable the tooltip temporarily, use the `data-cke-tooltip-disabled` attribute:\n *\n * ```ts\n * domElement.dataset.ckeTooltipText = 'Disabled. For now.';\n * domElement.dataset.ckeTooltipDisabled = 'true';\n * ```\n *\n * # Styling tooltips\n *\n * By default, the tooltip has `.ck-tooltip` class and its text inner `.ck-tooltip__text`.\n *\n * If your tooltip requires custom styling, using `data-cke-tooltip-class` attribute will add additional class to the balloon\n * displaying the tooltip:\n *\n * ```ts\n * domElement.dataset.ckeTooltipText = 'Tooltip with a red text';\n * domElement.dataset.ckeTooltipClass = 'my-class';\n * ```\n *\n * ```css\n * .ck.ck-tooltip.my-class { color: red }\n * ```\n *\n * **Note**: This class is a singleton. All editor instances re-use the same instance loaded by\n * {@link module:ui/editorui/editorui~EditorUI} of the first editor.\n */\nexport default class TooltipManager extends DomEmitterMixin() {\n /**\n * Creates an instance of the tooltip manager.\n */\n constructor(editor) {\n super();\n /**\n * Stores the reference to the DOM element the tooltip is attached to. `null` when there's no tooltip\n * in the UI.\n */\n this._currentElementWithTooltip = null;\n /**\n * Stores the current tooltip position. `null` when there's no tooltip in the UI.\n */\n this._currentTooltipPosition = null;\n /**\n * An instance of the resize observer that keeps track on target element visibility,\n * when it hides the tooltip should also disappear.\n *\n * {@link module:core/editor/editorconfig~EditorConfig#balloonToolbar configuration}.\n */\n this._resizeObserver = null;\n TooltipManager._editors.add(editor);\n // TooltipManager must be a singleton. Multiple instances would mean multiple tooltips attached\n // to the same DOM element with data-cke-tooltip-* attributes.\n if (TooltipManager._instance) {\n return TooltipManager._instance;\n }\n TooltipManager._instance = this;\n this.tooltipTextView = new View(editor.locale);\n this.tooltipTextView.set('text', '');\n this.tooltipTextView.setTemplate({\n tag: 'span',\n attributes: {\n class: [\n 'ck',\n 'ck-tooltip__text'\n ]\n },\n children: [\n {\n text: this.tooltipTextView.bindTemplate.to('text')\n }\n ]\n });\n this.balloonPanelView = new BalloonPanelView(editor.locale);\n this.balloonPanelView.class = BALLOON_CLASS;\n this.balloonPanelView.content.add(this.tooltipTextView);\n this._pinTooltipDebounced = debounce(this._pinTooltip, 600);\n this.listenTo(global.document, 'mouseenter', this._onEnterOrFocus.bind(this), { useCapture: true });\n this.listenTo(global.document, 'mouseleave', this._onLeaveOrBlur.bind(this), { useCapture: true });\n this.listenTo(global.document, 'focus', this._onEnterOrFocus.bind(this), { useCapture: true });\n this.listenTo(global.document, 'blur', this._onLeaveOrBlur.bind(this), { useCapture: true });\n this.listenTo(global.document, 'scroll', this._onScroll.bind(this), { useCapture: true });\n // Because this class is a singleton, its only instance is shared across all editors and connects them through the reference.\n // This causes issues with the ContextWatchdog. When an error is thrown in one editor, the watchdog traverses the references\n // and (because of shared tooltip manager) figures that the error affects all editors and restarts them all.\n // This flag, excludes tooltip manager instance from the traversal and brings ContextWatchdog back to normal.\n // More in https://github.com/ckeditor/ckeditor5/issues/12292.\n this._watchdogExcluded = true;\n }\n /**\n * Destroys the tooltip manager.\n *\n * **Note**: The manager singleton cannot be destroyed until all editors that use it are destroyed.\n *\n * @param editor The editor the manager was created for.\n */\n destroy(editor) {\n const editorBodyViewCollection = editor.ui.view && editor.ui.view.body;\n TooltipManager._editors.delete(editor);\n this.stopListening(editor.ui);\n // Prevent the balloon panel from being destroyed in the EditorUI#destroy() cascade. It should be destroyed along\n // with the last editor only (https://github.com/ckeditor/ckeditor5/issues/12602).\n if (editorBodyViewCollection && editorBodyViewCollection.has(this.balloonPanelView)) {\n editorBodyViewCollection.remove(this.balloonPanelView);\n }\n if (!TooltipManager._editors.size) {\n this._unpinTooltip();\n this.balloonPanelView.destroy();\n this.stopListening();\n TooltipManager._instance = null;\n }\n }\n /**\n * Returns {@link #balloonPanelView} {@link module:utils/dom/position~PositioningFunction positioning functions} for a given position\n * name.\n *\n * @param position Name of the position (`s`, `se`, `sw`, `n`, `e`, or `w`).\n * @returns Positioning functions to be used by the {@link #balloonPanelView}.\n */\n static getPositioningFunctions(position) {\n const defaultPositions = TooltipManager.defaultBalloonPositions;\n return {\n // South is most popular. We can use positioning heuristics to avoid clipping by the viewport with the sane fallback.\n s: [\n defaultPositions.southArrowNorth,\n defaultPositions.southArrowNorthEast,\n defaultPositions.southArrowNorthWest\n ],\n n: [defaultPositions.northArrowSouth],\n e: [defaultPositions.eastArrowWest],\n w: [defaultPositions.westArrowEast],\n sw: [defaultPositions.southArrowNorthEast],\n se: [defaultPositions.southArrowNorthWest]\n }[position];\n }\n /**\n * Handles displaying tooltips on `mouseenter` and `focus` in DOM.\n *\n * @param evt An object containing information about the fired event.\n * @param domEvent The DOM event.\n */\n _onEnterOrFocus(evt, { target }) {\n const elementWithTooltipAttribute = getDescendantWithTooltip(target);\n // Abort when there's no descendant needing tooltip.\n if (!elementWithTooltipAttribute) {\n return;\n }\n // Abort to avoid flashing when, for instance:\n // * a tooltip is displayed for a focused element, then the same element gets mouseentered,\n // * a tooltip is displayed for an element via mouseenter, then the focus moves to the same element.\n if (elementWithTooltipAttribute === this._currentElementWithTooltip) {\n return;\n }\n this._unpinTooltip();\n this._pinTooltipDebounced(elementWithTooltipAttribute, getTooltipData(elementWithTooltipAttribute));\n }\n /**\n * Handles hiding tooltips on `mouseleave` and `blur` in DOM.\n *\n * @param evt An object containing information about the fired event.\n * @param domEvent The DOM event.\n */\n _onLeaveOrBlur(evt, { target, relatedTarget }) {\n if (evt.name === 'mouseleave') {\n // Don't act when the event does not concern a DOM element (e.g. a mouseleave out of an entire document),\n if (!isElement(target)) {\n return;\n }\n // If a tooltip is currently visible, don't act for a targets other than the one it is attached to.\n // For instance, a random mouseleave far away in the page should not unpin the tooltip that was pinned because\n // of a previous focus. Only leaving the same element should hide the tooltip.\n if (this._currentElementWithTooltip && target !== this._currentElementWithTooltip) {\n return;\n }\n const descendantWithTooltip = getDescendantWithTooltip(target);\n const relatedDescendantWithTooltip = getDescendantWithTooltip(relatedTarget);\n // Unpin when the mouse was leaving element with a tooltip to a place which does not have or has a different tooltip.\n // Note that this should happen whether the tooltip is already visible or not, for instance, it could be invisible but queued\n // (debounced): it should get canceled.\n if (descendantWithTooltip && descendantWithTooltip !== relatedDescendantWithTooltip) {\n this._unpinTooltip();\n }\n }\n else {\n // If a tooltip is currently visible, don't act for a targets other than the one it is attached to.\n // For instance, a random blur in the web page should not unpin the tooltip that was pinned because of a previous mouseenter.\n if (this._currentElementWithTooltip && target !== this._currentElementWithTooltip) {\n return;\n }\n // Note that unpinning should happen whether the tooltip is already visible or not, for instance, it could be invisible but\n // queued (debounced): it should get canceled (e.g. quick focus then quick blur using the keyboard).\n this._unpinTooltip();\n }\n }\n /**\n * Handles hiding tooltips on `scroll` in DOM.\n *\n * @param evt An object containing information about the fired event.\n * @param domEvent The DOM event.\n */\n _onScroll(evt, { target }) {\n // No tooltip, no reason to react on scroll.\n if (!this._currentElementWithTooltip) {\n return;\n }\n // When scrolling a container that has both the balloon and the current element (common ancestor), the balloon can remain\n // visible (e.g. scrolling ≤body>). Otherwise, to avoid glitches (clipping, lagging) better just hide the tooltip.\n // Also, don't do anything when scrolling an unrelated DOM element that has nothing to do with the current element and the balloon.\n if (target.contains(this.balloonPanelView.element) && target.contains(this._currentElementWithTooltip)) {\n return;\n }\n this._unpinTooltip();\n }\n /**\n * Pins the tooltip to a specific DOM element.\n *\n * @param options.text Text of the tooltip to display.\n * @param options.position The position of the tooltip.\n * @param options.cssClass Additional CSS class of the balloon with the tooltip.\n */\n _pinTooltip(targetDomElement, { text, position, cssClass }) {\n // Use the body collection of the first editor.\n const bodyViewCollection = first(TooltipManager._editors.values()).ui.view.body;\n if (!bodyViewCollection.has(this.balloonPanelView)) {\n bodyViewCollection.add(this.balloonPanelView);\n }\n this.tooltipTextView.text = text;\n this.balloonPanelView.pin({\n target: targetDomElement,\n positions: TooltipManager.getPositioningFunctions(position)\n });\n this._resizeObserver = new ResizeObserver(targetDomElement, () => {\n // The ResizeObserver will call its callback when the target element hides and the tooltip\n // should also disappear (https://github.com/ckeditor/ckeditor5/issues/12492).\n if (!isVisible(targetDomElement)) {\n this._unpinTooltip();\n }\n });\n this.balloonPanelView.class = [BALLOON_CLASS, cssClass]\n .filter(className => className)\n .join(' ');\n // Start responding to changes in editor UI or content layout. For instance, when collaborators change content\n // and a contextual toolbar attached to a content starts to move (and so should move the tooltip).\n // Note: Using low priority to let other listeners that position contextual toolbars etc. to react first.\n for (const editor of TooltipManager._editors) {\n this.listenTo(editor.ui, 'update', this._updateTooltipPosition.bind(this), { priority: 'low' });\n }\n this._currentElementWithTooltip = targetDomElement;\n this._currentTooltipPosition = position;\n }\n /**\n * Unpins the tooltip and cancels all queued pinning.\n */\n _unpinTooltip() {\n this._pinTooltipDebounced.cancel();\n this.balloonPanelView.unpin();\n for (const editor of TooltipManager._editors) {\n this.stopListening(editor.ui, 'update');\n }\n this._currentElementWithTooltip = null;\n this._currentTooltipPosition = null;\n if (this._resizeObserver) {\n this._resizeObserver.destroy();\n }\n }\n /**\n * Updates the position of the tooltip so it stays in sync with the element it is pinned to.\n *\n * Hides the tooltip when the element is no longer visible in DOM.\n */\n _updateTooltipPosition() {\n // This could happen if the tooltip was attached somewhere in a contextual content toolbar and the toolbar\n // disappeared (e.g. removed an image).\n if (!isVisible(this._currentElementWithTooltip)) {\n this._unpinTooltip();\n return;\n }\n this.balloonPanelView.pin({\n target: this._currentElementWithTooltip,\n positions: TooltipManager.getPositioningFunctions(this._currentTooltipPosition)\n });\n }\n}\n/**\n * A set of default {@link module:utils/dom/position~PositioningFunction positioning functions} used by the `TooltipManager`\n * to pin tooltips in different positions.\n */\nTooltipManager.defaultBalloonPositions = generatePositions({\n heightOffset: 5,\n sideOffset: 13\n});\n/**\n * A set of editors the single tooltip manager instance must listen to.\n * This is mostly to handle `EditorUI#update` listeners from individual editors.\n */\nTooltipManager._editors = new Set();\n/**\n * A reference to the `TooltipManager` instance. The class is a singleton and as such,\n * successive attempts at creating instances should return this instance.\n */\nTooltipManager._instance = null;\nfunction getDescendantWithTooltip(element) {\n if (!isElement(element)) {\n return null;\n }\n return element.closest('[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])');\n}\nfunction getTooltipData(element) {\n return {\n text: element.dataset.ckeTooltipText,\n position: (element.dataset.ckeTooltipPosition || 's'),\n cssClass: element.dataset.ckeTooltipClass || ''\n };\n}\n","import debounce from './debounce.js';\nimport isObject from './isObject.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\nexport default throttle;\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Rect, DomEmitterMixin, findClosestScrollableAncestor, verifyLicense } from '@ckeditor/ckeditor5-utils';\nimport BalloonPanelView from '../panel/balloon/balloonpanelview';\nimport IconView from '../icon/iconview';\nimport View from '../view';\nimport { throttle } from 'lodash-es';\nimport poweredByIcon from '../../theme/icons/project-logo.svg';\nconst ICON_WIDTH = 53;\nconst ICON_HEIGHT = 10;\nconst NARROW_ROOT_HEIGHT_THRESHOLD = 50;\nconst NARROW_ROOT_WIDTH_THRESHOLD = 350;\nconst DEFAULT_LABEL = 'Powered by';\nconst OFF_THE_SCREEN_POSITION = {\n top: -99999,\n left: -99999,\n name: 'invalid',\n config: {\n withArrow: false\n }\n};\n/**\n * A helper that enables the \"powered by\" feature in the editor and renders a link to the project's\n * webpage next to the bottom of the editable element (editor root, source editing area, etc.) when the editor is focused.\n *\n * @private\n */\nexport default class PoweredBy extends DomEmitterMixin() {\n /**\n * Creates a \"powered by\" helper for a given editor. The feature is initialized on Editor#ready\n * event.\n *\n * @param editor\n */\n constructor(editor) {\n super();\n this.editor = editor;\n this._balloonView = null;\n this._lastFocusedEditableElement = null;\n this._showBalloonThrottled = throttle(this._showBalloon.bind(this), 50, { leading: true });\n editor.on('ready', this._handleEditorReady.bind(this));\n }\n /**\n * Destroys the \"powered by\" helper along with its view.\n */\n destroy() {\n const balloon = this._balloonView;\n if (balloon) {\n // Balloon gets destroyed by the body collection.\n // The powered by view gets destroyed by the balloon.\n balloon.unpin();\n this._balloonView = null;\n }\n this._showBalloonThrottled.cancel();\n this.stopListening();\n }\n /**\n * Enables \"powered by\" label once the editor (ui) is ready.\n */\n _handleEditorReady() {\n const editor = this.editor;\n /* istanbul ignore next -- @preserve */\n if (verifyLicense(editor.config.get('licenseKey')) === 'VALID') {\n return;\n }\n // No view means no body collection to append the powered by balloon to.\n if (!editor.ui.view) {\n return;\n }\n editor.ui.focusTracker.on('change:isFocused', (evt, data, isFocused) => {\n this._updateLastFocusedEditableElement();\n if (isFocused) {\n this._showBalloon();\n }\n else {\n this._hideBalloon();\n }\n });\n editor.ui.focusTracker.on('change:focusedElement', (evt, data, focusedElement) => {\n this._updateLastFocusedEditableElement();\n if (focusedElement) {\n this._showBalloon();\n }\n });\n editor.ui.on('update', () => {\n this._showBalloonThrottled();\n });\n }\n /**\n * Creates an instance of the {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView balloon panel}\n * with the \"powered by\" view inside ready for positioning.\n */\n _createBalloonView() {\n const editor = this.editor;\n const balloon = this._balloonView = new BalloonPanelView();\n const poweredByConfig = getNormalizedConfig(editor);\n const view = new PoweredByView(editor.locale, poweredByConfig.label);\n balloon.content.add(view);\n balloon.set({\n class: 'ck-powered-by-balloon'\n });\n editor.ui.view.body.add(balloon);\n editor.ui.focusTracker.add(balloon.element);\n this._balloonView = balloon;\n }\n /**\n * Attempts to display the balloon with the \"powered by\" view.\n */\n _showBalloon() {\n if (!this._lastFocusedEditableElement) {\n return;\n }\n const attachOptions = getBalloonAttachOptions(this.editor, this._lastFocusedEditableElement);\n if (attachOptions) {\n if (!this._balloonView) {\n this._createBalloonView();\n }\n this._balloonView.pin(attachOptions);\n }\n }\n /**\n * Hides the \"powered by\" balloon if already visible.\n */\n _hideBalloon() {\n if (this._balloonView) {\n this._balloonView.unpin();\n }\n }\n /**\n * Updates the {@link #_lastFocusedEditableElement} based on the state of the global focus tracker.\n */\n _updateLastFocusedEditableElement() {\n const editor = this.editor;\n const isFocused = editor.ui.focusTracker.isFocused;\n const focusedElement = editor.ui.focusTracker.focusedElement;\n if (!isFocused || !focusedElement) {\n this._lastFocusedEditableElement = null;\n return;\n }\n const editableEditorElements = Array.from(editor.ui.getEditableElementsNames()).map(name => {\n return editor.ui.getEditableElement(name);\n });\n if (editableEditorElements.includes(focusedElement)) {\n this._lastFocusedEditableElement = focusedElement;\n }\n else {\n // If it's none of the editable element, then the focus is somewhere in the UI. Let's display powered by\n // over the first element then.\n this._lastFocusedEditableElement = editableEditorElements[0];\n }\n }\n}\n/**\n * A view displaying a \"powered by\" label and project logo wrapped in a link.\n */\nclass PoweredByView extends View {\n /**\n * Created an instance of the \"powered by\" view.\n *\n * @param locale The localization services instance.\n * @param label The label text.\n */\n constructor(locale, label) {\n super(locale);\n const iconView = new IconView();\n const bind = this.bindTemplate;\n iconView.set({\n content: poweredByIcon,\n isColorInherited: false\n });\n iconView.extendTemplate({\n attributes: {\n style: {\n width: ICON_WIDTH + 'px',\n height: ICON_HEIGHT + 'px'\n }\n }\n });\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: ['ck', 'ck-powered-by'],\n 'aria-hidden': true\n },\n children: [\n {\n tag: 'a',\n attributes: {\n href: 'https://ckeditor.com/?utm_source=ckeditor&' +\n 'utm_medium=referral&utm_campaign=701Dn000000hVgmIAE_powered_by_ckeditor_logo',\n target: '_blank',\n tabindex: '-1'\n },\n children: [\n ...label ? [\n {\n tag: 'span',\n attributes: {\n class: ['ck', 'ck-powered-by__label']\n },\n children: [label]\n }\n ] : [],\n iconView\n ],\n on: {\n dragstart: bind.to(evt => evt.preventDefault())\n }\n }\n ]\n });\n }\n}\nfunction getBalloonAttachOptions(editor, focusedEditableElement) {\n const poweredByConfig = getNormalizedConfig(editor);\n const positioningFunction = poweredByConfig.side === 'right' ?\n getLowerRightCornerPosition(focusedEditableElement, poweredByConfig) :\n getLowerLeftCornerPosition(focusedEditableElement, poweredByConfig);\n return {\n target: focusedEditableElement,\n positions: [positioningFunction]\n };\n}\nfunction getLowerRightCornerPosition(focusedEditableElement, config) {\n return getLowerCornerPosition(focusedEditableElement, config, (rootRect, balloonRect) => {\n return rootRect.left + rootRect.width - balloonRect.width - config.horizontalOffset;\n });\n}\nfunction getLowerLeftCornerPosition(focusedEditableElement, config) {\n return getLowerCornerPosition(focusedEditableElement, config, rootRect => rootRect.left + config.horizontalOffset);\n}\nfunction getLowerCornerPosition(focusedEditableElement, config, getBalloonLeft) {\n return (editableElementRect, balloonRect) => {\n const visibleEditableElementRect = editableElementRect.getVisible();\n // Root cropped by ancestors.\n if (!visibleEditableElementRect) {\n return OFF_THE_SCREEN_POSITION;\n }\n if (editableElementRect.width < NARROW_ROOT_WIDTH_THRESHOLD || editableElementRect.height < NARROW_ROOT_HEIGHT_THRESHOLD) {\n return OFF_THE_SCREEN_POSITION;\n }\n let balloonTop;\n if (config.position === 'inside') {\n balloonTop = editableElementRect.bottom - balloonRect.height;\n }\n else {\n balloonTop = editableElementRect.bottom - balloonRect.height / 2;\n }\n balloonTop -= config.verticalOffset;\n const balloonLeft = getBalloonLeft(editableElementRect, balloonRect);\n if (config.position === 'inside') {\n const newBalloonRect = balloonRect.clone().moveTo(balloonLeft, balloonTop);\n // The watermark cannot be positioned in this corner because the corner is not quite visible.\n if (newBalloonRect.getIntersectionArea(visibleEditableElementRect) < newBalloonRect.getArea()) {\n return OFF_THE_SCREEN_POSITION;\n }\n }\n else {\n const firstScrollableEditableElementAncestor = findClosestScrollableAncestor(focusedEditableElement);\n if (firstScrollableEditableElementAncestor) {\n const firstScrollableEditableElementAncestorRect = new Rect(firstScrollableEditableElementAncestor);\n // The watermark cannot be positioned in this corner because the corner is \"not visible enough\".\n if (visibleEditableElementRect.bottom + balloonRect.height / 2 > firstScrollableEditableElementAncestorRect.bottom) {\n return OFF_THE_SCREEN_POSITION;\n }\n }\n }\n return {\n top: balloonTop,\n left: balloonLeft,\n name: `position_${config.position}-side_${config.side}`,\n config: {\n withArrow: false\n }\n };\n };\n}\nfunction getNormalizedConfig(editor) {\n const userConfig = editor.config.get('ui.poweredBy');\n const position = userConfig && userConfig.position || 'border';\n return {\n position,\n label: DEFAULT_LABEL,\n verticalOffset: position === 'inside' ? 5 : 0,\n horizontalOffset: 5,\n side: editor.locale.contentLanguageDirection === 'ltr' ? 'right' : 'left',\n ...userConfig\n };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/verifylicense\n */\nimport { releaseDate } from './version';\n/**\n * Checks whether the given string contains information that allows you to verify the license status.\n *\n * @param token The string to check.\n * @returns String that represents the state of given `token` parameter.\n */\nexport default function verifyLicense(token) {\n // This function implements naive and partial license key check mechanism,\n // used only to decide whether to show or hide the \"Powered by CKEditor\" logo.\n //\n // You can read the reasoning behind showing the logo to unlicensed (GPL) users\n // in this thread: https://github.com/ckeditor/ckeditor5/issues/14082.\n //\n // We firmly believe in the values behind creating open-source software, even when that\n // means keeping the license verification logic open for everyone to see.\n //\n // Please keep this code intact. Thank you for your understanding.\n function oldTokenCheck(token) {\n if (token.match(/^[a-zA-Z0-9+/=$]+$/g) && (token.length >= 40 && token.length <= 255)) {\n return 'VALID';\n }\n else {\n return 'INVALID';\n }\n }\n // TODO: issue ci#3175\n let decryptedData = '';\n let decryptedSecondElement = '';\n if (!token) {\n return 'INVALID';\n }\n try {\n decryptedData = atob(token);\n }\n catch (e) {\n return 'INVALID';\n }\n const splittedDecryptedData = decryptedData.split('-');\n const firstElement = splittedDecryptedData[0];\n const secondElement = splittedDecryptedData[1];\n if (!secondElement) {\n return oldTokenCheck(token);\n }\n try {\n atob(secondElement);\n }\n catch (e) {\n try {\n atob(firstElement);\n if (!atob(firstElement).length) {\n return oldTokenCheck(token);\n }\n }\n catch (e) {\n return oldTokenCheck(token);\n }\n }\n if (firstElement.length < 40 || firstElement.length > 255) {\n return 'INVALID';\n }\n try {\n // Must be a valid format.\n atob(firstElement);\n }\n catch (e) {\n return 'INVALID';\n }\n try {\n decryptedSecondElement = atob(secondElement);\n }\n catch (e) {\n return 'INVALID';\n }\n if (decryptedSecondElement.length !== 8) {\n return 'INVALID';\n }\n const year = Number(decryptedSecondElement.substring(0, 4));\n const monthIndex = Number(decryptedSecondElement.substring(4, 6)) - 1;\n const day = Number(decryptedSecondElement.substring(6, 8));\n const date = new Date(year, monthIndex, day);\n if (date < releaseDate || isNaN(Number(date))) {\n return 'INVALID';\n }\n return 'VALID';\n}\n","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"53\\\" height=\\\"10\\\" viewBox=\\\"0 0 53 10\\\"><g clip-path=\\\"url(#a)\\\"><path fill=\\\"#1C2331\\\" d=\\\"M31.724 1.492a15.139 15.139 0 0 0 .045 1.16 2.434 2.434 0 0 0-.687-.34 3.68 3.68 0 0 0-1.103-.166 2.332 2.332 0 0 0-1.14.255 1.549 1.549 0 0 0-.686.87c-.15.41-.225.98-.225 1.712 0 .939.148 1.659.444 2.161.297.503.792.754 1.487.754.452.015.9-.094 1.294-.316.296-.174.557-.4.771-.669l.14.852h1.282V.007h-1.623v1.485ZM31 6.496a1.77 1.77 0 0 1-.494.061.964.964 0 0 1-.521-.127.758.758 0 0 1-.296-.466 3.984 3.984 0 0 1-.093-.992 4.208 4.208 0 0 1 .098-1.052.753.753 0 0 1 .307-.477 1.08 1.08 0 0 1 .55-.122c.233-.004.466.026.69.089l.483.144v2.553c-.11.076-.213.143-.307.2a1.73 1.73 0 0 1-.417.189ZM35.68 0l-.702.004c-.322.002-.482.168-.48.497l.004.581c.002.33.164.493.486.49l.702-.004c.322-.002.481-.167.48-.496L36.165.49c-.002-.33-.164-.493-.486-.491ZM36.145 2.313l-1.612.01.034 5.482 1.613-.01-.035-5.482ZM39.623.79 37.989.8 38 2.306l-.946.056.006 1.009.949-.006.024 2.983c.003.476.143.844.419 1.106.275.26.658.39 1.148.387.132 0 .293-.01.483-.03.19-.02.38-.046.57-.08.163-.028.324-.068.482-.119l-.183-1.095-.702.004a.664.664 0 0 1-.456-.123.553.553 0 0 1-.14-.422l-.016-2.621 1.513-.01-.006-1.064-1.514.01-.01-1.503ZM46.226 2.388c-.41-.184-.956-.274-1.636-.27-.673.004-1.215.101-1.627.29-.402.179-.72.505-.888.91-.18.419-.268.979-.264 1.68.004.688.1 1.24.285 1.655.172.404.495.724.9.894.414.18.957.268 1.63.264.68-.004 1.224-.099 1.632-.284.4-.176.714-.501.878-.905.176-.418.263-.971.258-1.658-.004-.702-.097-1.261-.28-1.677a1.696 1.696 0 0 0-.888-.9Zm-.613 3.607a.77.77 0 0 1-.337.501 1.649 1.649 0 0 1-1.317.009.776.776 0 0 1-.343-.497 4.066 4.066 0 0 1-.105-1.02 4.136 4.136 0 0 1 .092-1.03.786.786 0 0 1 .337-.507 1.59 1.59 0 0 1 1.316-.008.79.79 0 0 1 .344.502c.078.337.113.683.105 1.03.012.343-.019.685-.092 1.02ZM52.114 2.07a2.67 2.67 0 0 0-1.128.278c-.39.191-.752.437-1.072.73l-.157-.846-1.273.008.036 5.572 1.623-.01-.024-3.78c.35-.124.646-.22.887-.286.26-.075.53-.114.8-.118l.45-.003.144-1.546-.286.001ZM22.083 7.426l-1.576-2.532a2.137 2.137 0 0 0-.172-.253 1.95 1.95 0 0 0-.304-.29.138.138 0 0 1 .042-.04 1.7 1.7 0 0 0 .328-.374l1.75-2.71c.01-.015.025-.028.024-.048-.01-.01-.021-.007-.031-.007L20.49 1.17a.078.078 0 0 0-.075.045l-.868 1.384c-.23.366-.46.732-.688 1.099a.108.108 0 0 1-.112.06c-.098-.005-.196-.001-.294-.002-.018 0-.038.006-.055-.007.002-.02.002-.039.005-.058a4.6 4.6 0 0 0 .046-.701V1.203c0-.02-.009-.032-.03-.03h-.033L16.93 1.17c-.084 0-.073-.01-.073.076v6.491c-.001.018.006.028.025.027h1.494c.083 0 .072.007.072-.071v-2.19c0-.055-.003-.11-.004-.166a3.366 3.366 0 0 0-.05-.417h.06c.104 0 .209.002.313-.002a.082.082 0 0 1 .084.05c.535.913 1.07 1.824 1.607 2.736a.104.104 0 0 0 .103.062c.554-.003 1.107-.002 1.66-.002l.069-.003-.019-.032-.188-.304ZM27.112 6.555c-.005-.08-.004-.08-.082-.08h-2.414c-.053 0-.106-.003-.159-.011a.279.279 0 0 1-.246-.209.558.558 0 0 1-.022-.15c0-.382 0-.762-.002-1.143 0-.032.007-.049.042-.044h2.504c.029.003.037-.012.034-.038V3.814c0-.089.013-.078-.076-.078h-2.44c-.07 0-.062.003-.062-.06v-.837c0-.047.004-.093.013-.14a.283.283 0 0 1 .241-.246.717.717 0 0 1 .146-.011h2.484c.024.002.035-.009.036-.033l.003-.038.03-.496c.01-.183.024-.365.034-.548.005-.085.003-.087-.082-.094-.218-.018-.437-.038-.655-.05a17.845 17.845 0 0 0-.657-.026 72.994 72.994 0 0 0-1.756-.016 1.7 1.7 0 0 0-.471.064 1.286 1.286 0 0 0-.817.655c-.099.196-.149.413-.145.633v3.875c0 .072.003.144.011.216a1.27 1.27 0 0 0 .711 1.029c.228.113.48.167.734.158.757-.005 1.515.002 2.272-.042.274-.016.548-.034.82-.053.03-.002.043-.008.04-.041-.008-.104-.012-.208-.019-.312a69.964 69.964 0 0 1-.05-.768ZM16.14 7.415l-.127-1.075c-.004-.03-.014-.04-.044-.037a13.125 13.125 0 0 1-.998.073c-.336.01-.672.02-1.008.016-.116-.001-.233-.014-.347-.039a.746.746 0 0 1-.45-.262c-.075-.1-.132-.211-.167-.33a3.324 3.324 0 0 1-.126-.773 9.113 9.113 0 0 1-.015-.749c0-.285.022-.57.065-.852.023-.158.066-.312.127-.46a.728.728 0 0 1 .518-.443 1.64 1.64 0 0 1 .397-.048c.628-.001 1.255.003 1.882.05.022.001.033-.006.036-.026l.003-.031.06-.55c.019-.177.036-.355.057-.532.004-.034-.005-.046-.04-.056a5.595 5.595 0 0 0-1.213-.21 10.783 10.783 0 0 0-.708-.02c-.24-.003-.48.01-.719.041a3.477 3.477 0 0 0-.625.14 1.912 1.912 0 0 0-.807.497c-.185.2-.33.433-.424.688a4.311 4.311 0 0 0-.24 1.096c-.031.286-.045.572-.042.86-.006.43.024.86.091 1.286.04.25.104.497.193.734.098.279.26.53.473.734.214.205.473.358.756.446.344.11.702.17 1.063.177a8.505 8.505 0 0 0 1.578-.083 6.11 6.11 0 0 0 .766-.18c.03-.008.047-.023.037-.057a.157.157 0 0 1-.003-.025Z\\\"/><path fill=\\\"#AFE229\\\" d=\\\"M6.016 6.69a1.592 1.592 0 0 0-.614.21c-.23.132-.422.32-.56.546-.044.072-.287.539-.287.539l-.836 1.528.009.006c.038.025.08.046.123.063.127.046.26.07.395.073.505.023 1.011-.007 1.517-.003.29.009.58.002.869-.022a.886.886 0 0 0 .395-.116.962.962 0 0 0 .312-.286c.056-.083.114-.163.164-.249.24-.408.48-.816.718-1.226.075-.128.148-.257.222-.386l.112-.192a1.07 1.07 0 0 0 .153-.518l-1.304.023s-1.258-.005-1.388.01Z\\\"/><path fill=\\\"#771BFF\\\" d=\\\"m2.848 9.044.76-1.39.184-.352c-.124-.067-.245-.14-.367-.21-.346-.204-.706-.384-1.045-.6a.984.984 0 0 1-.244-.207c-.108-.134-.136-.294-.144-.46-.021-.409-.002-.818-.009-1.227-.003-.195 0-.39.003-.585.004-.322.153-.553.427-.713l.833-.488c.22-.13.44-.257.662-.385.05-.029.105-.052.158-.077.272-.128.519-.047.76.085l.044.028c.123.06.242.125.358.196.318.178.635.357.952.537.095.056.187.117.275.184.194.144.254.35.266.578.016.284.007.569.006.853-.001.28.004.558 0 .838.592-.003 1.259 0 1.259 0l.723-.013c-.003-.292-.007-.584-.007-.876 0-.524.015-1.048-.016-1.571-.024-.42-.135-.8-.492-1.067a5.02 5.02 0 0 0-.506-.339A400.52 400.52 0 0 0 5.94.787C5.722.664 5.513.524 5.282.423 5.255.406 5.228.388 5.2.373 4.758.126 4.305-.026 3.807.21c-.097.046-.197.087-.29.14A699.896 699.896 0 0 0 .783 1.948c-.501.294-.773.717-.778 1.31-.004.36-.009.718-.001 1.077.016.754-.017 1.508.024 2.261.016.304.07.6.269.848.127.15.279.28.448.382.622.4 1.283.734 1.92 1.11l.183.109Z\\\"/></g><defs><clipPath id=\\\"a\\\"><path fill=\\\"#fff\\\" d=\\\"M0 0h52.4v10H0z\\\"/></clipPath></defs></svg>\\n\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module utils/dom/findclosestscrollableancestor\n */\nimport global from './global';\n/**\n * Returns the closest scrollable ancestor of a DOM element.\n *\n * @param domElement DOM element.\n * @returns First ancestor of `domElement` that is scrollable or null if such ancestor doesn't exist.\n */\nexport default function findClosestScrollableAncestor(domElement) {\n let element = domElement.parentElement;\n if (!element) {\n return null;\n }\n while (element.tagName != 'BODY') {\n const overflow = element.style.overflowY || global.window.getComputedStyle(element).overflowY;\n if (overflow === 'auto' || overflow === 'scroll') {\n break;\n }\n element = element.parentElement;\n if (!element) {\n return null;\n }\n }\n return element;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/editorui/editorui\n */\n/* globals console */\nimport ComponentFactory from '../componentfactory';\nimport TooltipManager from '../tooltipmanager';\nimport PoweredBy from './poweredby';\nimport { ObservableMixin, isVisible, FocusTracker } from '@ckeditor/ckeditor5-utils';\n/**\n * A class providing the minimal interface that is required to successfully bootstrap any editor UI.\n */\nexport default class EditorUI extends ObservableMixin() {\n /**\n * Creates an instance of the editor UI class.\n *\n * @param editor The editor instance.\n */\n constructor(editor) {\n super();\n /**\n * Indicates the UI is ready. Set `true` after {@link #event:ready} event is fired.\n *\n * @readonly\n * @default false\n */\n this.isReady = false;\n /**\n * Stores all editable elements used by the editor instance.\n */\n this._editableElementsMap = new Map();\n /**\n * All available & focusable toolbars.\n */\n this._focusableToolbarDefinitions = [];\n this.editor = editor;\n this.componentFactory = new ComponentFactory(editor);\n this.focusTracker = new FocusTracker();\n this.tooltipManager = new TooltipManager(editor);\n this.poweredBy = new PoweredBy(editor);\n this.set('viewportOffset', this._readViewportOffsetFromConfig());\n this.once('ready', () => {\n this.isReady = true;\n });\n // Informs UI components that should be refreshed after layout change.\n this.listenTo(editor.editing.view.document, 'layoutChanged', () => this.update());\n this._initFocusTracking();\n }\n /**\n * The main (outermost) DOM element of the editor UI.\n *\n * For example, in {@link module:editor-classic/classiceditor~ClassicEditor} it is a `<div>` which\n * wraps the editable element and the toolbar. In {@link module:editor-inline/inlineeditor~InlineEditor}\n * it is the editable element itself (as there is no other wrapper). However, in\n * {@link module:editor-decoupled/decouplededitor~DecoupledEditor} it is set to `null` because this editor does not\n * come with a single \"main\" HTML element (its editable element and toolbar are separate).\n *\n * This property can be understood as a shorthand for retrieving the element that a specific editor integration\n * considers to be its main DOM element.\n */\n get element() {\n return null;\n }\n /**\n * Fires the {@link module:ui/editorui/editorui~EditorUI#event:update `update`} event.\n *\n * This method should be called when the editor UI (e.g. positions of its balloons) needs to be updated due to\n * some environmental change which CKEditor 5 is not aware of (e.g. resize of a container in which it is used).\n */\n update() {\n this.fire('update');\n }\n /**\n * Destroys the UI.\n */\n destroy() {\n this.stopListening();\n this.focusTracker.destroy();\n this.tooltipManager.destroy(this.editor);\n this.poweredBy.destroy();\n // Cleanup the references to the CKEditor instance stored in the native editable DOM elements.\n for (const domElement of this._editableElementsMap.values()) {\n domElement.ckeditorInstance = null;\n this.editor.keystrokes.stopListening(domElement);\n }\n this._editableElementsMap = new Map();\n this._focusableToolbarDefinitions = [];\n }\n /**\n * Stores the native DOM editable element used by the editor under a unique name.\n *\n * Also, registers the element in the editor to maintain the accessibility of the UI. When the user is editing text in a focusable\n * editable area, they can use the <kbd>Alt</kbd> + <kbd>F10</kbd> keystroke to navigate over editor toolbars. See {@link #addToolbar}.\n *\n * @param rootName The unique name of the editable element.\n * @param domElement The native DOM editable element.\n */\n setEditableElement(rootName, domElement) {\n this._editableElementsMap.set(rootName, domElement);\n // Put a reference to the CKEditor instance in the editable native DOM element.\n // It helps 3rdparty software (browser extensions, other libraries) access and recognize\n // CKEditor 5 instances (editing roots) and use their API (there is no global editor\n // instance registry).\n if (!domElement.ckeditorInstance) {\n domElement.ckeditorInstance = this.editor;\n }\n // Register the element, so it becomes available for Alt+F10 and Esc navigation.\n this.focusTracker.add(domElement);\n const setUpKeystrokeHandler = () => {\n // The editing view of the editor is already listening to keystrokes from DOM roots (see: KeyObserver).\n // Do not duplicate listeners.\n if (this.editor.editing.view.getDomRoot(rootName)) {\n return;\n }\n this.editor.keystrokes.listenTo(domElement);\n };\n // For editable elements set by features after EditorUI is ready (e.g. source editing).\n if (this.isReady) {\n setUpKeystrokeHandler();\n }\n // For editable elements set while the editor is being created (e.g. DOM roots).\n else {\n this.once('ready', setUpKeystrokeHandler);\n }\n }\n /**\n * Removes the editable from the editor UI. Removes all handlers added by {@link #setEditableElement}.\n *\n * @param rootName The name of the editable element to remove.\n */\n removeEditableElement(rootName) {\n const domElement = this._editableElementsMap.get(rootName);\n if (!domElement) {\n return;\n }\n this._editableElementsMap.delete(rootName);\n this.editor.keystrokes.stopListening(domElement);\n this.focusTracker.remove(domElement);\n domElement.ckeditorInstance = null;\n }\n /**\n * Returns the editable editor element with the given name or null if editable does not exist.\n *\n * @param rootName The editable name.\n */\n getEditableElement(rootName = 'main') {\n return this._editableElementsMap.get(rootName);\n }\n /**\n * Returns array of names of all editor editable elements.\n */\n getEditableElementsNames() {\n return this._editableElementsMap.keys();\n }\n /**\n * Adds a toolbar to the editor UI. Used primarily to maintain the accessibility of the UI.\n *\n * Focusable toolbars can be accessed (focused) by users by pressing the <kbd>Alt</kbd> + <kbd>F10</kbd> keystroke.\n * Successive keystroke presses navigate over available toolbars.\n *\n * @param toolbarView A instance of the toolbar to be registered.\n */\n addToolbar(toolbarView, options = {}) {\n if (toolbarView.isRendered) {\n this.focusTracker.add(toolbarView.element);\n this.editor.keystrokes.listenTo(toolbarView.element);\n }\n else {\n toolbarView.once('render', () => {\n this.focusTracker.add(toolbarView.element);\n this.editor.keystrokes.listenTo(toolbarView.element);\n });\n }\n this._focusableToolbarDefinitions.push({ toolbarView, options });\n }\n /**\n * Stores all editable elements used by the editor instance.\n *\n * @deprecated\n */\n get _editableElements() {\n /**\n * The {@link module:ui/editorui/editorui~EditorUI#_editableElements `EditorUI#_editableElements`} property has been\n * deprecated and will be removed in the near future. Please use\n * {@link module:ui/editorui/editorui~EditorUI#setEditableElement `setEditableElement()`} and\n * {@link module:ui/editorui/editorui~EditorUI#getEditableElement `getEditableElement()`} methods instead.\n *\n * @error editor-ui-deprecated-editable-elements\n * @param editorUI Editor UI instance the deprecated property belongs to.\n */\n console.warn('editor-ui-deprecated-editable-elements: ' +\n 'The EditorUI#_editableElements property has been deprecated and will be removed in the near future.', { editorUI: this });\n return this._editableElementsMap;\n }\n /**\n * Returns viewport offsets object:\n *\n * ```js\n * {\n * \ttop: Number,\n * \tright: Number,\n * \tbottom: Number,\n * \tleft: Number\n * }\n * ```\n *\n * Only top property is currently supported.\n */\n _readViewportOffsetFromConfig() {\n const editor = this.editor;\n const viewportOffsetConfig = editor.config.get('ui.viewportOffset');\n if (viewportOffsetConfig) {\n return viewportOffsetConfig;\n }\n // Not present in EditorConfig type, because it's legacy. Hence the `as` expression.\n const legacyOffsetConfig = editor.config.get('toolbar.viewportTopOffset');\n // Fall back to deprecated toolbar config.\n if (legacyOffsetConfig) {\n /**\n * The {@link module:core/editor/editorconfig~EditorConfig#toolbar `EditorConfig#toolbar.viewportTopOffset`}\n * property has been deprecated and will be removed in the near future. Please use\n * {@link module:core/editor/editorconfig~EditorConfig#ui `EditorConfig#ui.viewportOffset`} instead.\n *\n * @error editor-ui-deprecated-viewport-offset-config\n */\n console.warn('editor-ui-deprecated-viewport-offset-config: ' +\n 'The `toolbar.vieportTopOffset` configuration option is deprecated. ' +\n 'It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead.');\n return { top: legacyOffsetConfig };\n }\n // More keys to come in the future.\n return { top: 0 };\n }\n /**\n * Starts listening for <kbd>Alt</kbd> + <kbd>F10</kbd> and <kbd>Esc</kbd> keystrokes in the context of focusable\n * {@link #setEditableElement editable elements} and {@link #addToolbar toolbars}\n * to allow users navigate across the UI.\n */\n _initFocusTracking() {\n const editor = this.editor;\n const editingView = editor.editing.view;\n let lastFocusedForeignElement;\n let candidateDefinitions;\n // Focus the next focusable toolbar on <kbd>Alt</kbd> + <kbd>F10</kbd>.\n editor.keystrokes.set('Alt+F10', (data, cancel) => {\n const focusedElement = this.focusTracker.focusedElement;\n // Focus moved out of a DOM element that\n // * is not a toolbar,\n // * does not belong to the editing view (e.g. source editing).\n if (Array.from(this._editableElementsMap.values()).includes(focusedElement) &&\n !Array.from(editingView.domRoots.values()).includes(focusedElement)) {\n lastFocusedForeignElement = focusedElement;\n }\n const currentFocusedToolbarDefinition = this._getCurrentFocusedToolbarDefinition();\n // * When focusing a toolbar for the first time, set the array of definitions for successive presses of Alt+F10.\n // This ensures, the navigation works always the same and no pair of toolbars takes over\n // (e.g. image and table toolbars when a selected image is inside a cell).\n // * It could be that the focus went to the toolbar by clicking a toolbar item (e.g. a dropdown). In this case,\n // there were no candidates so they must be obtained (#12339).\n if (!currentFocusedToolbarDefinition || !candidateDefinitions) {\n candidateDefinitions = this._getFocusableCandidateToolbarDefinitions();\n }\n // In a single Alt+F10 press, check all candidates but if none were focused, don't go any further.\n // This prevents an infinite loop.\n for (let i = 0; i < candidateDefinitions.length; i++) {\n const candidateDefinition = candidateDefinitions.shift();\n // Put the first definition to the back of the array. This allows circular navigation over all toolbars\n // on successive presses of Alt+F10.\n candidateDefinitions.push(candidateDefinition);\n // Don't focus the same toolbar again. If you did, this would move focus from the nth focused toolbar item back to the\n // first item as per ToolbarView#focus() if the user navigated inside the toolbar.\n if (candidateDefinition !== currentFocusedToolbarDefinition &&\n this._focusFocusableCandidateToolbar(candidateDefinition)) {\n // Clean up after a current visible toolbar when switching to the next one.\n if (currentFocusedToolbarDefinition && currentFocusedToolbarDefinition.options.afterBlur) {\n currentFocusedToolbarDefinition.options.afterBlur();\n }\n break;\n }\n }\n cancel();\n });\n // Blur the focused toolbar on <kbd>Esc</kbd> and bring the focus back to its origin.\n editor.keystrokes.set('Esc', (data, cancel) => {\n const focusedToolbarDef = this._getCurrentFocusedToolbarDefinition();\n if (!focusedToolbarDef) {\n return;\n }\n // Bring focus back to where it came from before focusing the toolbar:\n // 1. If it came from outside the engine view (e.g. source editing), move it there.\n if (lastFocusedForeignElement) {\n lastFocusedForeignElement.focus();\n lastFocusedForeignElement = null;\n }\n // 2. There are two possibilities left:\n // 2.1. It could be that the focus went from an editable element in the view (root or nested).\n // 2.2. It could be the focus went straight to the toolbar before even focusing the editing area.\n // In either case, just focus the view editing. The focus will land where it belongs.\n else {\n editor.editing.view.focus();\n }\n // Clean up after the toolbar if there is anything to do there.\n if (focusedToolbarDef.options.afterBlur) {\n focusedToolbarDef.options.afterBlur();\n }\n cancel();\n });\n }\n /**\n * Returns definitions of toolbars that could potentially be focused, sorted by their importance for the user.\n *\n * Focusable toolbars candidates are either:\n * * already visible,\n * * have `beforeFocus()` set in their {@link module:ui/editorui/editorui~FocusableToolbarDefinition definition} that suggests that\n * they might show up when called. Keep in mind that determining whether a toolbar will show up (and become focusable) is impossible\n * at this stage because it depends on its implementation, that in turn depends on the editing context (selection).\n *\n * **Note**: Contextual toolbars take precedence over regular toolbars.\n */\n _getFocusableCandidateToolbarDefinitions() {\n const definitions = [];\n for (const toolbarDef of this._focusableToolbarDefinitions) {\n const { toolbarView, options } = toolbarDef;\n if (isVisible(toolbarView.element) || options.beforeFocus) {\n definitions.push(toolbarDef);\n }\n }\n // Contextual and already visible toolbars have higher priority. If both are true, the toolbar will always focus first.\n // For instance, a selected widget toolbar vs inline editor toolbar: both are visible but the widget toolbar is contextual.\n definitions.sort((defA, defB) => getToolbarDefinitionWeight(defA) - getToolbarDefinitionWeight(defB));\n return definitions;\n }\n /**\n * Returns a definition of the toolbar that is currently visible and focused (one of its children has focus).\n *\n * `null` is returned when no toolbar is currently focused.\n */\n _getCurrentFocusedToolbarDefinition() {\n for (const definition of this._focusableToolbarDefinitions) {\n if (definition.toolbarView.element && definition.toolbarView.element.contains(this.focusTracker.focusedElement)) {\n return definition;\n }\n }\n return null;\n }\n /**\n * Focuses a focusable toolbar candidate using its definition.\n *\n * @param candidateToolbarDefinition A definition of the toolbar to focus.\n * @returns `true` when the toolbar candidate was focused. `false` otherwise.\n */\n _focusFocusableCandidateToolbar(candidateToolbarDefinition) {\n const { toolbarView, options: { beforeFocus } } = candidateToolbarDefinition;\n if (beforeFocus) {\n beforeFocus();\n }\n // If it didn't show up after beforeFocus(), it's not focusable at all.\n if (!isVisible(toolbarView.element)) {\n return false;\n }\n toolbarView.focus();\n return true;\n }\n}\n/**\n * Returns a number (weight) for a toolbar definition. Visible toolbars have a higher priority and so do\n * contextual toolbars (displayed in the context of a content, for instance, an image toolbar).\n *\n * A standard invisible toolbar is the heaviest. A visible contextual toolbar is the lightest.\n *\n * @param toolbarDef A toolbar definition to be weighted.\n */\nfunction getToolbarDefinitionWeight(toolbarDef) {\n const { toolbarView, options } = toolbarDef;\n let weight = 10;\n // Prioritize already visible toolbars. They should get focused first.\n if (isVisible(toolbarView.element)) {\n weight--;\n }\n // Prioritize contextual toolbars. They are displayed at the selection.\n if (options.isContextual) {\n weight--;\n }\n return weight;\n}\n","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./editorui.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/editorui/editoruiview\n */\nimport View from '../view';\nimport BodyCollection from './bodycollection';\nimport '../../theme/components/editorui/editorui.css';\n/**\n * The editor UI view class. Base class for the editor main views.\n */\nexport default class EditorUIView extends View {\n /**\n * Creates an instance of the editor UI view class.\n *\n * @param locale The locale instance.\n */\n constructor(locale) {\n super(locale);\n this.body = new BodyCollection(locale);\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.body.attachToDom();\n }\n /**\n * @inheritDoc\n */\n destroy() {\n this.body.detachFromDom();\n return super.destroy();\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/editorui/boxed/boxededitoruiview\n */\nimport EditorUIView from '../editoruiview';\nimport LabelView from '../../label/labelview';\n/**\n * The boxed editor UI view class. This class represents an editor interface\n * consisting of a toolbar and an editable area, enclosed within a box.\n */\nexport default class BoxedEditorUIView extends EditorUIView {\n /**\n * Creates an instance of the boxed editor UI view class.\n *\n * @param locale The locale instance..\n */\n constructor(locale) {\n super(locale);\n this.top = this.createCollection();\n this.main = this.createCollection();\n this._voiceLabelView = this._createVoiceLabel();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-reset',\n 'ck-editor',\n 'ck-rounded-corners'\n ],\n role: 'application',\n dir: locale.uiLanguageDirection,\n lang: locale.uiLanguage,\n 'aria-labelledby': this._voiceLabelView.id\n },\n children: [\n this._voiceLabelView,\n {\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-editor__top',\n 'ck-reset_all'\n ],\n role: 'presentation'\n },\n children: this.top\n },\n {\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-editor__main'\n ],\n role: 'presentation'\n },\n children: this.main\n }\n ]\n });\n }\n /**\n * Creates a voice label view instance.\n */\n _createVoiceLabel() {\n const t = this.t;\n const voiceLabel = new LabelView();\n voiceLabel.text = t('Rich Text Editor');\n voiceLabel.extendTemplate({\n attributes: {\n class: 'ck-voice-label'\n }\n });\n return voiceLabel;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/editableui/editableuiview\n */\nimport View from '../view';\n/**\n * The editable UI view class.\n */\nexport default class EditableUIView extends View {\n /**\n * Creates an instance of EditableUIView class.\n *\n * @param locale The locale instance.\n * @param editingView The editing view instance the editable is related to.\n * @param editableElement The editable element. If not specified, this view\n * should create it. Otherwise, the existing element should be used.\n */\n constructor(locale, editingView, editableElement) {\n super(locale);\n /**\n * The name of the editable UI view.\n */\n this.name = null;\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-content',\n 'ck-editor__editable',\n 'ck-rounded-corners'\n ],\n lang: locale.contentLanguage,\n dir: locale.contentLanguageDirection\n }\n });\n this.set('isFocused', false);\n this._editableElement = editableElement;\n this._hasExternalElement = !!this._editableElement;\n this._editingView = editingView;\n }\n /**\n * Renders the view by either applying the {@link #template} to the existing\n * {@link module:ui/editableui/editableuiview~EditableUIView#_editableElement} or assigning {@link #element}\n * as {@link module:ui/editableui/editableuiview~EditableUIView#_editableElement}.\n */\n render() {\n super.render();\n if (this._hasExternalElement) {\n this.template.apply(this.element = this._editableElement);\n }\n else {\n this._editableElement = this.element;\n }\n this.on('change:isFocused', () => this._updateIsFocusedClasses());\n this._updateIsFocusedClasses();\n }\n /**\n * @inheritDoc\n */\n destroy() {\n if (this._hasExternalElement) {\n this.template.revert(this._editableElement);\n }\n super.destroy();\n }\n /**\n * Whether an external {@link #_editableElement} was passed into the constructor, which also means\n * the view will not render its {@link #template}.\n */\n get hasExternalElement() {\n return this._hasExternalElement;\n }\n /**\n * Updates the `ck-focused` and `ck-blurred` CSS classes on the {@link #element} according to\n * the {@link #isFocused} property value using the {@link #_editingView editing view} API.\n */\n _updateIsFocusedClasses() {\n const editingView = this._editingView;\n if (editingView.isRenderingInProgress) {\n updateAfterRender(this);\n }\n else {\n update(this);\n }\n function update(view) {\n editingView.change(writer => {\n const viewRoot = editingView.document.getRoot(view.name);\n writer.addClass(view.isFocused ? 'ck-focused' : 'ck-blurred', viewRoot);\n writer.removeClass(view.isFocused ? 'ck-blurred' : 'ck-focused', viewRoot);\n });\n }\n // In a case of a multi-root editor, a callback will be attached more than once (one callback for each root).\n // While executing one callback the `isRenderingInProgress` observable is changing what causes executing another\n // callback and render is called inside the already pending render.\n // We need to be sure that callback is executed only when the value has changed from `true` to `false`.\n // See https://github.com/ckeditor/ckeditor5/issues/1676.\n function updateAfterRender(view) {\n editingView.once('change:isRenderingInProgress', (evt, name, value) => {\n if (!value) {\n update(view);\n }\n else {\n updateAfterRender(view);\n }\n });\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/editableui/inline/inlineeditableuiview\n */\nimport EditableUIView from '../editableuiview';\n/**\n * The inline editable UI class implementing an inline {@link module:ui/editableui/editableuiview~EditableUIView}.\n */\nexport default class InlineEditableUIView extends EditableUIView {\n /**\n * Creates an instance of the InlineEditableUIView class.\n *\n * @param locale The locale instance.\n * @param editingView The editing view instance the editable is related to.\n * @param editableElement The editable element. If not specified, the\n * {@link module:ui/editableui/editableuiview~EditableUIView}\n * will create it. Otherwise, the existing element will be used.\n * @param options Additional configuration of the view.\n * @param options.label A function that gets called with the instance of this view as an argument\n * and should return a string that represents the label of the editable for assistive technologies. If not provided,\n * a default label generator is used.\n */\n constructor(locale, editingView, editableElement, options = {}) {\n super(locale, editingView, editableElement);\n const t = locale.t;\n this.extendTemplate({\n attributes: {\n role: 'textbox',\n class: 'ck-editor__editable_inline'\n }\n });\n this._generateLabel = options.label || (() => t('Editor editing area: %0', this.name));\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n const editingView = this._editingView;\n editingView.change(writer => {\n const viewRoot = editingView.document.getRoot(this.name);\n writer.setAttribute('aria-label', this._generateLabel(this), viewRoot);\n });\n }\n}\n","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./formheader.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/formheader/formheaderview\n */\nimport View from '../view';\nimport '../../theme/components/formheader/formheader.css';\n/**\n * The class component representing a form header view. It should be used in more advanced forms to\n * describe the main purpose of the form.\n *\n * By default the component contains a bolded label view that has to be set. The label is usually a short (at most 3-word) string.\n * The component can also be extended by any other elements, like: icons, dropdowns, etc.\n *\n * It is used i.a.\n * by {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView}\n * and {@link module:special-characters/ui/specialcharactersnavigationview~SpecialCharactersNavigationView}.\n *\n * The latter is an example, where the component has been extended by {@link module:ui/dropdown/dropdownview~DropdownView} view.\n */\nexport default class FormHeaderView extends View {\n /**\n * Creates an instance of the form header class.\n *\n * @param locale The locale instance.\n * @param options.label A label.\n * @param options.class An additional class.\n */\n constructor(locale, options = {}) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('label', options.label || '');\n this.set('class', options.class || null);\n this.children = this.createCollection();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-form__header',\n bind.to('class')\n ]\n },\n children: this.children\n });\n const label = new View(locale);\n label.setTemplate({\n tag: 'h2',\n attributes: {\n class: [\n 'ck',\n 'ck-form__header__label'\n ]\n },\n children: [\n { text: bind.to('label') }\n ]\n });\n this.children.add(label);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/notification/notification\n */\n/* globals window */\nimport { ContextPlugin } from '@ckeditor/ckeditor5-core';\n/**\n * The Notification plugin.\n *\n * This plugin sends a few types of notifications: `success`, `info` and `warning`. The notifications need to be\n * handled and displayed by a plugin responsible for showing the UI of the notifications. Using this plugin for dispatching\n * notifications makes it possible to switch the notifications UI.\n *\n * Note that every unhandled and not stopped `warning` notification will be displayed as a system alert.\n * See {@link module:ui/notification/notification~Notification#showWarning}.\n */\nexport default class Notification extends ContextPlugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Notification';\n }\n /**\n * @inheritDoc\n */\n init() {\n // Each unhandled and not stopped `show:warning` event is displayed as a system alert.\n this.on('show:warning', (evt, data) => {\n window.alert(data.message); // eslint-disable-line no-alert\n }, { priority: 'lowest' });\n }\n /**\n * Shows a success notification.\n *\n * By default, it fires the {@link #event:show:success `show:success` event} with the given `data`. The event namespace can be extended\n * using the `data.namespace` option. For example:\n *\n * ```ts\n * showSuccess( 'Image is uploaded.', {\n * \tnamespace: 'upload:image'\n * } );\n * ```\n *\n * will fire the `show:success:upload:image` event.\n *\n * You can provide the title of the notification:\n *\n * ```ts\n * showSuccess( 'Image is uploaded.', {\n * \ttitle: 'Image upload success'\n * } );\n * ```\n *\n * @param message The content of the notification.\n * @param data Additional data.\n * @param data.namespace Additional event namespace.\n * @param data.title The title of the notification.\n */\n showSuccess(message, data = {}) {\n this._showNotification({\n message,\n type: 'success',\n namespace: data.namespace,\n title: data.title\n });\n }\n /**\n * Shows an information notification.\n *\n * By default, it fires the {@link #event:show:info `show:info` event} with the given `data`. The event namespace can be extended\n * using the `data.namespace` option. For example:\n *\n * ```ts\n * showInfo( 'Editor is offline.', {\n * \tnamespace: 'editor:status'\n * } );\n * ```\n *\n * will fire the `show:info:editor:status` event.\n *\n * You can provide the title of the notification:\n *\n * ```ts\n * showInfo( 'Editor is offline.', {\n * \ttitle: 'Network information'\n * } );\n * ```\n *\n * @param message The content of the notification.\n * @param data Additional data.\n * @param data.namespace Additional event namespace.\n * @param data.title The title of the notification.\n */\n showInfo(message, data = {}) {\n this._showNotification({\n message,\n type: 'info',\n namespace: data.namespace,\n title: data.title\n });\n }\n /**\n * Shows a warning notification.\n *\n * By default, it fires the {@link #event:show:warning `show:warning` event}\n * with the given `data`. The event namespace can be extended using the `data.namespace` option. For example:\n *\n * ```ts\n * showWarning( 'Image upload error.', {\n * \tnamespace: 'upload:image'\n * } );\n * ```\n *\n * will fire the `show:warning:upload:image` event.\n *\n * You can provide the title of the notification:\n *\n * ```ts\n * showWarning( 'Image upload error.', {\n * \ttitle: 'Upload failed'\n * } );\n * ```\n *\n * Note that each unhandled and not stopped `warning` notification will be displayed as a system alert.\n * The plugin responsible for displaying warnings should `stop()` the event to prevent displaying it as an alert:\n *\n * ```ts\n * notifications.on( 'show:warning', ( evt, data ) => {\n * \t// Do something with the data.\n *\n * \t// Stop this event to prevent displaying it as an alert.\n * \tevt.stop();\n * } );\n * ```\n *\n * You can attach many listeners to the same event and `stop()` this event in a listener with a low priority:\n *\n * ```ts\n * notifications.on( 'show:warning', ( evt, data ) => {\n * \t// Show the warning in the UI, but do not stop it.\n * } );\n *\n * notifications.on( 'show:warning', ( evt, data ) => {\n * \t// Log the warning to some error tracker.\n *\n * \t// Stop this event to prevent displaying it as an alert.\n * \tevt.stop();\n * }, { priority: 'low' } );\n * ```\n *\n * @param message The content of the notification.\n * @param data Additional data.\n * @param data.namespace Additional event namespace.\n * @param data.title The title of the notification.\n */\n showWarning(message, data = {}) {\n this._showNotification({\n message,\n type: 'warning',\n namespace: data.namespace,\n title: data.title\n });\n }\n /**\n * Fires the `show` event with the specified type, namespace and message.\n *\n * @param data The message data.\n * @param data.message The content of the notification.\n * @param data.type The type of the message.\n * @param data.namespace Additional event namespace.\n * @param data.title The title of the notification.\n */\n _showNotification(data) {\n const event = data.namespace ?\n `show:${data.type}:${data.namespace}` :\n `show:${data.type}`;\n this.fire(event, {\n message: data.message,\n type: data.type,\n title: data.title || ''\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/model\n */\nimport { ObservableMixin } from '@ckeditor/ckeditor5-utils';\nimport { extend } from 'lodash-es';\n/**\n * The base MVC model class.\n */\nexport default class Model extends ObservableMixin() {\n /**\n * Creates a new Model instance.\n *\n * @param attributes The model state attributes to be defined during the instance creation.\n * @param properties The (out of state) properties to be appended to the instance during creation.\n */\n constructor(attributes, properties) {\n super();\n // Extend this instance with the additional (out of state) properties.\n if (properties) {\n extend(this, properties);\n }\n // Initialize the attributes.\n if (attributes) {\n this.set(attributes);\n }\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M11.463 5.187a.888.888 0 1 1 1.254 1.255L9.16 10l3.557 3.557a.888.888 0 1 1-1.254 1.255L7.26 10.61a.888.888 0 0 1 .16-1.382l4.043-4.042z\\\"/></svg>\";","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./balloonrotator.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./fakepanel.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/panel/balloon/contextualballoon\n */\nimport BalloonPanelView from './balloonpanelview';\nimport View from '../../view';\nimport ButtonView from '../../button/buttonview';\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { CKEditorError, FocusTracker, Rect, toUnit } from '@ckeditor/ckeditor5-utils';\nimport prevIcon from '../../../theme/icons/previous-arrow.svg';\nimport nextIcon from '../../../theme/icons/next-arrow.svg';\nimport '../../../theme/components/panel/balloonrotator.css';\nimport '../../../theme/components/panel/fakepanel.css';\nconst toPx = toUnit('px');\n/**\n * Provides the common contextual balloon for the editor.\n *\n * The role of this plugin is to unify the contextual balloons logic, simplify views management and help\n * avoid the unnecessary complexity of handling multiple {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView}\n * instances in the editor.\n *\n * This plugin allows for creating single or multiple panel stacks.\n *\n * Each stack may have multiple views, with the one on the top being visible. When the visible view is removed from the stack,\n * the previous view becomes visible.\n *\n * It might be useful to implement nested navigation in a balloon. For instance, a toolbar view may contain a link button.\n * When you click it, a link view (which lets you set the URL) is created and put on top of the toolbar view, so the link panel\n * is displayed. When you finish editing the link and close (remove) the link view, the toolbar view is visible again.\n *\n * However, there are cases when there are multiple independent balloons to be displayed, for instance, if the selection\n * is inside two inline comments at the same time. For such cases, you can create two independent panel stacks.\n * The contextual balloon plugin will create a navigation bar to let the users switch between these panel stacks using the \"Next\"\n * and \"Previous\" buttons.\n *\n * If there are no views in the current stack, the balloon panel will try to switch to the next stack. If there are no\n * panels in any stack, the balloon panel will be hidden.\n *\n * **Note**: To force the balloon panel to show only one view, even if there are other stacks, use the `singleViewMode=true` option\n * when {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon#add adding} a view to a panel.\n *\n * From the implementation point of view, the contextual ballon plugin is reusing a single\n * {@link module:ui/panel/balloon/balloonpanelview~BalloonPanelView} instance to display multiple contextual balloon\n * panels in the editor. It also creates a special {@link module:ui/panel/balloon/contextualballoon~RotatorView rotator view},\n * used to manage multiple panel stacks. Rotator view is a child of the balloon panel view and the parent of the specific\n * view you want to display. If there is more than one panel stack to be displayed, the rotator view will add a\n * navigation bar. If there is only one stack, the rotator view is transparent (it does not add any UI elements).\n */\nexport default class ContextualBalloon extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ContextualBalloon';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n /**\n * The map of views and their stacks.\n */\n this._viewToStack = new Map();\n /**\n * The map of IDs and stacks.\n */\n this._idToStack = new Map();\n /**\n * The common balloon panel view.\n */\n this._view = null;\n /**\n * Rotator view embedded in the contextual balloon.\n * Displays the currently visible view in the balloon and provides navigation for switching stacks.\n */\n this._rotatorView = null;\n /**\n * Displays fake panels under the balloon panel view when multiple stacks are added to the balloon.\n */\n this._fakePanelsView = null;\n this.positionLimiter = () => {\n const view = this.editor.editing.view;\n const viewDocument = view.document;\n const editableElement = viewDocument.selection.editableElement;\n if (editableElement) {\n return view.domConverter.mapViewToDom(editableElement.root);\n }\n return null;\n };\n this.set('visibleView', null);\n this.set('_numberOfStacks', 0);\n this.set('_singleViewMode', false);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n if (this._view) {\n this._view.destroy();\n }\n if (this._rotatorView) {\n this._rotatorView.destroy();\n }\n if (this._fakePanelsView) {\n this._fakePanelsView.destroy();\n }\n }\n /**\n * The common balloon panel view.\n */\n get view() {\n if (!this._view) {\n this._createPanelView();\n }\n return this._view;\n }\n /**\n * Returns `true` when the given view is in one of the stacks. Otherwise returns `false`.\n */\n hasView(view) {\n return Array.from(this._viewToStack.keys()).includes(view);\n }\n /**\n * Adds a new view to the stack and makes it visible if the current stack is visible\n * or it is the first view in the balloon.\n *\n * @param data The configuration of the view.\n * @param data.stackId The ID of the stack that the view is added to. Defaults to `'main'`.\n * @param data.view The content of the balloon.\n * @param data.position Positioning options.\n * @param data.balloonClassName An additional CSS class added to the {@link #view balloon} when visible.\n * @param data.withArrow Whether the {@link #view balloon} should be rendered with an arrow. Defaults to `true`.\n * @param data.singleViewMode Whether the view should be the only visible view even if other stacks were added. Defaults to `false`.\n */\n add(data) {\n if (!this._view) {\n this._createPanelView();\n }\n if (this.hasView(data.view)) {\n /**\n * Trying to add configuration of the same view more than once.\n *\n * @error contextualballoon-add-view-exist\n */\n throw new CKEditorError('contextualballoon-add-view-exist', [this, data]);\n }\n const stackId = data.stackId || 'main';\n // If new stack is added, creates it and show view from this stack.\n if (!this._idToStack.has(stackId)) {\n this._idToStack.set(stackId, new Map([[data.view, data]]));\n this._viewToStack.set(data.view, this._idToStack.get(stackId));\n this._numberOfStacks = this._idToStack.size;\n if (!this._visibleStack || data.singleViewMode) {\n this.showStack(stackId);\n }\n return;\n }\n const stack = this._idToStack.get(stackId);\n if (data.singleViewMode) {\n this.showStack(stackId);\n }\n // Add new view to the stack.\n stack.set(data.view, data);\n this._viewToStack.set(data.view, stack);\n // And display it if is added to the currently visible stack.\n if (stack === this._visibleStack) {\n this._showView(data);\n }\n }\n /**\n * Removes the given view from the stack. If the removed view was visible,\n * the view preceding it in the stack will become visible instead.\n * When there is no view in the stack, the next stack will be displayed.\n * When there are no more stacks, the balloon will hide.\n *\n * @param view A view to be removed from the balloon.\n */\n remove(view) {\n if (!this.hasView(view)) {\n /**\n * Trying to remove the configuration of the view not defined in the stack.\n *\n * @error contextualballoon-remove-view-not-exist\n */\n throw new CKEditorError('contextualballoon-remove-view-not-exist', [this, view]);\n }\n const stack = this._viewToStack.get(view);\n if (this._singleViewMode && this.visibleView === view) {\n this._singleViewMode = false;\n }\n // When visible view will be removed we need to show a preceding view or next stack\n // if a view is the only view in the stack.\n if (this.visibleView === view) {\n if (stack.size === 1) {\n if (this._idToStack.size > 1) {\n this._showNextStack();\n }\n else {\n this.view.hide();\n this.visibleView = null;\n this._rotatorView.hideView();\n }\n }\n else {\n this._showView(Array.from(stack.values())[stack.size - 2]);\n }\n }\n if (stack.size === 1) {\n this._idToStack.delete(this._getStackId(stack));\n this._numberOfStacks = this._idToStack.size;\n }\n else {\n stack.delete(view);\n }\n this._viewToStack.delete(view);\n }\n /**\n * Updates the position of the balloon using the position data of the first visible view in the stack.\n * When new position data is given, the position data of the currently visible view will be updated.\n *\n * @param position Position options.\n */\n updatePosition(position) {\n if (position) {\n this._visibleStack.get(this.visibleView).position = position;\n }\n this.view.pin(this._getBalloonPosition());\n this._fakePanelsView.updatePosition();\n }\n /**\n * Shows the last view from the stack of a given ID.\n */\n showStack(id) {\n this.visibleStack = id;\n const stack = this._idToStack.get(id);\n if (!stack) {\n /**\n * Trying to show a stack that does not exist.\n *\n * @error contextualballoon-showstack-stack-not-exist\n */\n throw new CKEditorError('contextualballoon-showstack-stack-not-exist', this);\n }\n if (this._visibleStack === stack) {\n return;\n }\n this._showView(Array.from(stack.values()).pop());\n }\n /**\n * Initializes view instances.\n */\n _createPanelView() {\n this._view = new BalloonPanelView(this.editor.locale);\n this.editor.ui.view.body.add(this._view);\n this.editor.ui.focusTracker.add(this._view.element);\n this._rotatorView = this._createRotatorView();\n this._fakePanelsView = this._createFakePanelsView();\n }\n /**\n * Returns the stack of the currently visible view.\n */\n get _visibleStack() {\n return this._viewToStack.get(this.visibleView);\n }\n /**\n * Returns the ID of the given stack.\n */\n _getStackId(stack) {\n const entry = Array.from(this._idToStack.entries()).find(entry => entry[1] === stack);\n return entry[0];\n }\n /**\n * Shows the last view from the next stack.\n */\n _showNextStack() {\n const stacks = Array.from(this._idToStack.values());\n let nextIndex = stacks.indexOf(this._visibleStack) + 1;\n if (!stacks[nextIndex]) {\n nextIndex = 0;\n }\n this.showStack(this._getStackId(stacks[nextIndex]));\n }\n /**\n * Shows the last view from the previous stack.\n */\n _showPrevStack() {\n const stacks = Array.from(this._idToStack.values());\n let nextIndex = stacks.indexOf(this._visibleStack) - 1;\n if (!stacks[nextIndex]) {\n nextIndex = stacks.length - 1;\n }\n this.showStack(this._getStackId(stacks[nextIndex]));\n }\n /**\n * Creates a rotator view.\n */\n _createRotatorView() {\n const view = new RotatorView(this.editor.locale);\n const t = this.editor.locale.t;\n this.view.content.add(view);\n // Hide navigation when there is only a one stack & not in single view mode.\n view.bind('isNavigationVisible').to(this, '_numberOfStacks', this, '_singleViewMode', (value, isSingleViewMode) => {\n return !isSingleViewMode && value > 1;\n });\n // Update balloon position after toggling navigation.\n view.on('change:isNavigationVisible', () => (this.updatePosition()), { priority: 'low' });\n // Update stacks counter value.\n view.bind('counter').to(this, 'visibleView', this, '_numberOfStacks', (visibleView, numberOfStacks) => {\n if (numberOfStacks < 2) {\n return '';\n }\n const current = Array.from(this._idToStack.values()).indexOf(this._visibleStack) + 1;\n return t('%0 of %1', [current, numberOfStacks]);\n });\n view.buttonNextView.on('execute', () => {\n // When current view has a focus then move focus to the editable before removing it,\n // otherwise editor will lost focus.\n if (view.focusTracker.isFocused) {\n this.editor.editing.view.focus();\n }\n this._showNextStack();\n });\n view.buttonPrevView.on('execute', () => {\n // When current view has a focus then move focus to the editable before removing it,\n // otherwise editor will lost focus.\n if (view.focusTracker.isFocused) {\n this.editor.editing.view.focus();\n }\n this._showPrevStack();\n });\n return view;\n }\n /**\n * Creates a fake panels view.\n */\n _createFakePanelsView() {\n const view = new FakePanelsView(this.editor.locale, this.view);\n view.bind('numberOfPanels').to(this, '_numberOfStacks', this, '_singleViewMode', (number, isSingleViewMode) => {\n const showPanels = !isSingleViewMode && number >= 2;\n return showPanels ? Math.min(number - 1, 2) : 0;\n });\n view.listenTo(this.view, 'change:top', () => view.updatePosition());\n view.listenTo(this.view, 'change:left', () => view.updatePosition());\n this.editor.ui.view.body.add(view);\n return view;\n }\n /**\n * Sets the view as the content of the balloon and attaches the balloon using position\n * options of the first view.\n *\n * @param data Configuration.\n * @param data.view The view to show in the balloon.\n * @param data.balloonClassName Additional class name which will be added to the {@link #view balloon}.\n * @param data.withArrow Whether the {@link #view balloon} should be rendered with an arrow.\n */\n _showView({ view, balloonClassName = '', withArrow = true, singleViewMode = false }) {\n this.view.class = balloonClassName;\n this.view.withArrow = withArrow;\n this._rotatorView.showView(view);\n this.visibleView = view;\n this.view.pin(this._getBalloonPosition());\n this._fakePanelsView.updatePosition();\n if (singleViewMode) {\n this._singleViewMode = true;\n }\n }\n /**\n * Returns position options of the last view in the stack.\n * This keeps the balloon in the same position when the view is changed.\n */\n _getBalloonPosition() {\n let position = Array.from(this._visibleStack.values()).pop().position;\n if (position) {\n // Use the default limiter if none has been specified.\n if (!position.limiter) {\n // Don't modify the original options object.\n position = Object.assign({}, position, {\n limiter: this.positionLimiter\n });\n }\n // Don't modify the original options object.\n position = Object.assign({}, position, {\n viewportOffsetConfig: this.editor.ui.viewportOffset\n });\n }\n return position;\n }\n}\n/**\n * Rotator view is a helper class for the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon ContextualBalloon}.\n * It is used for displaying the last view from the current stack and providing navigation buttons for switching stacks.\n * See the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon ContextualBalloon} documentation to learn more.\n */\nexport class RotatorView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n const t = locale.t;\n const bind = this.bindTemplate;\n this.set('isNavigationVisible', true);\n this.focusTracker = new FocusTracker();\n this.buttonPrevView = this._createButtonView(t('Previous'), prevIcon);\n this.buttonNextView = this._createButtonView(t('Next'), nextIcon);\n this.content = this.createCollection();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-balloon-rotator'\n ],\n 'z-index': '-1'\n },\n children: [\n {\n tag: 'div',\n attributes: {\n class: [\n 'ck-balloon-rotator__navigation',\n bind.to('isNavigationVisible', value => value ? '' : 'ck-hidden')\n ]\n },\n children: [\n this.buttonPrevView,\n {\n tag: 'span',\n attributes: {\n class: [\n 'ck-balloon-rotator__counter'\n ]\n },\n children: [\n {\n text: bind.to('counter')\n }\n ]\n },\n this.buttonNextView\n ]\n },\n {\n tag: 'div',\n attributes: {\n class: 'ck-balloon-rotator__content'\n },\n children: this.content\n }\n ]\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.focusTracker.add(this.element);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n }\n /**\n * Shows a given view.\n *\n * @param view The view to show.\n */\n showView(view) {\n this.hideView();\n this.content.add(view);\n }\n /**\n * Hides the currently displayed view.\n */\n hideView() {\n this.content.clear();\n }\n /**\n * Creates a navigation button view.\n *\n * @param label The button label.\n * @param icon The button icon.\n */\n _createButtonView(label, icon) {\n const view = new ButtonView(this.locale);\n view.set({\n label,\n icon,\n tooltip: true\n });\n return view;\n }\n}\n/**\n * Displays additional layers under the balloon when multiple stacks are added to the balloon.\n */\nclass FakePanelsView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale, balloonPanelView) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('top', 0);\n this.set('left', 0);\n this.set('height', 0);\n this.set('width', 0);\n this.set('numberOfPanels', 0);\n this.content = this.createCollection();\n this._balloonPanelView = balloonPanelView;\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck-fake-panel',\n bind.to('numberOfPanels', number => number ? '' : 'ck-hidden')\n ],\n style: {\n top: bind.to('top', toPx),\n left: bind.to('left', toPx),\n width: bind.to('width', toPx),\n height: bind.to('height', toPx)\n }\n },\n children: this.content\n });\n this.on('change:numberOfPanels', (evt, name, next, prev) => {\n if (next > prev) {\n this._addPanels(next - prev);\n }\n else {\n this._removePanels(prev - next);\n }\n this.updatePosition();\n });\n }\n _addPanels(number) {\n while (number--) {\n const view = new View();\n view.setTemplate({ tag: 'div' });\n this.content.add(view);\n this.registerChild(view);\n }\n }\n _removePanels(number) {\n while (number--) {\n const view = this.content.last;\n this.content.remove(view);\n this.deregisterChild(view);\n view.destroy();\n }\n }\n /**\n * Updates coordinates of fake panels.\n */\n updatePosition() {\n if (this.numberOfPanels) {\n const { top, left } = this._balloonPanelView;\n const { width, height } = new Rect(this._balloonPanelView.element);\n Object.assign(this, { top, left, width, height });\n }\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M8.537 14.813a.888.888 0 1 1-1.254-1.255L10.84 10 7.283 6.442a.888.888 0 1 1 1.254-1.255L12.74 9.39a.888.888 0 0 1-.16 1.382l-4.043 4.042z\\\"/></svg>\";","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./stickypanel.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/panel/sticky/stickypanelview\n */\nimport View from '../../view';\nimport Template from '../../template';\nimport { global, toUnit } from '@ckeditor/ckeditor5-utils';\nimport '../../../theme/components/panel/stickypanel.css';\nconst toPx = toUnit('px');\n/**\n * The sticky panel view class.\n */\nexport default class StickyPanelView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('isActive', false);\n this.set('isSticky', false);\n this.set('limiterElement', null);\n this.set('limiterBottomOffset', 50);\n this.set('viewportTopOffset', 0);\n this.set('_marginLeft', null);\n this.set('_isStickyToTheLimiter', false);\n this.set('_hasViewportTopOffset', false);\n this.content = this.createCollection();\n this._contentPanelPlaceholder = new Template({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-sticky-panel__placeholder'\n ],\n style: {\n display: bind.to('isSticky', isSticky => isSticky ? 'block' : 'none'),\n height: bind.to('isSticky', isSticky => {\n return isSticky ? toPx(this._panelRect.height) : null;\n })\n }\n }\n }).render();\n this._contentPanel = new Template({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-sticky-panel__content',\n // Toggle class of the panel when \"sticky\" state changes in the view.\n bind.if('isSticky', 'ck-sticky-panel__content_sticky'),\n bind.if('_isStickyToTheLimiter', 'ck-sticky-panel__content_sticky_bottom-limit')\n ],\n style: {\n width: bind.to('isSticky', isSticky => {\n return isSticky ? toPx(this._contentPanelPlaceholder.getBoundingClientRect().width) : null;\n }),\n top: bind.to('_hasViewportTopOffset', _hasViewportTopOffset => {\n return _hasViewportTopOffset ? toPx(this.viewportTopOffset) : null;\n }),\n bottom: bind.to('_isStickyToTheLimiter', _isStickyToTheLimiter => {\n return _isStickyToTheLimiter ? toPx(this.limiterBottomOffset) : null;\n }),\n marginLeft: bind.to('_marginLeft')\n }\n },\n children: this.content\n }).render();\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-sticky-panel'\n ]\n },\n children: [\n this._contentPanelPlaceholder,\n this._contentPanel\n ]\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n // Check if the panel should go into the sticky state immediately.\n this._checkIfShouldBeSticky();\n // Update sticky state of the panel as the window is being scrolled.\n this.listenTo(global.window, 'scroll', () => {\n this._checkIfShouldBeSticky();\n });\n // Synchronize with `model.isActive` because sticking an inactive panel is pointless.\n this.listenTo(this, 'change:isActive', () => {\n this._checkIfShouldBeSticky();\n });\n }\n /**\n * Analyzes the environment to decide whether the panel should\n * be sticky or not.\n */\n _checkIfShouldBeSticky() {\n const panelRect = this._panelRect = this._contentPanel.getBoundingClientRect();\n let limiterRect;\n if (!this.limiterElement) {\n this.isSticky = false;\n }\n else {\n limiterRect = this._limiterRect = this.limiterElement.getBoundingClientRect();\n // The panel must be active to become sticky.\n this.isSticky = this.isActive &&\n // The limiter's top edge must be beyond the upper edge of the visible viewport (+the viewportTopOffset).\n limiterRect.top < this.viewportTopOffset &&\n // The model#limiterElement's height mustn't be smaller than the panel's height and model#limiterBottomOffset.\n // There's no point in entering the sticky mode if the model#limiterElement is very, very small, because\n // it would immediately set model#_isStickyToTheLimiter true and, given model#limiterBottomOffset, the panel\n // would be positioned before the model#limiterElement.\n this._panelRect.height + this.limiterBottomOffset < limiterRect.height;\n }\n // Stick the panel to the top edge of the viewport simulating CSS position:sticky.\n // TODO: Possibly replaced by CSS in the future http://caniuse.com/#feat=css-sticky\n if (this.isSticky) {\n this._isStickyToTheLimiter =\n limiterRect.bottom < panelRect.height + this.limiterBottomOffset + this.viewportTopOffset;\n this._hasViewportTopOffset = !this._isStickyToTheLimiter && !!this.viewportTopOffset;\n this._marginLeft = this._isStickyToTheLimiter ? null : toPx(-global.window.scrollX);\n }\n // Detach the panel from the top edge of the viewport.\n else {\n this._isStickyToTheLimiter = false;\n this._hasViewportTopOffset = false;\n this._marginLeft = null;\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/toolbar/balloon/balloontoolbar\n */\nimport ContextualBalloon from '../../panel/balloon/contextualballoon';\nimport ToolbarView from '../toolbarview';\nimport BalloonPanelView, { generatePositions } from '../../panel/balloon/balloonpanelview';\nimport normalizeToolbarConfig from '../normalizetoolbarconfig';\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { FocusTracker, Rect, ResizeObserver, env, global, toUnit } from '@ckeditor/ckeditor5-utils';\nimport { debounce } from 'lodash-es';\nconst toPx = toUnit('px');\n/**\n * The contextual toolbar.\n *\n * It uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon plugin}.\n */\nexport default class BalloonToolbar extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'BalloonToolbar';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ContextualBalloon];\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n /**\n * An instance of the resize observer that allows to respond to changes in editable's geometry\n * so the toolbar can stay within its boundaries (and group toolbar items that do not fit).\n *\n * **Note**: Used only when `shouldNotGroupWhenFull` was **not** set in the\n * {@link module:core/editor/editorconfig~EditorConfig#balloonToolbar configuration}.\n *\n * **Note:** Created in {@link #init}.\n */\n this._resizeObserver = null;\n this._balloonConfig = normalizeToolbarConfig(editor.config.get('balloonToolbar'));\n this.toolbarView = this._createToolbarView();\n this.focusTracker = new FocusTracker();\n // Wait for the EditorUI#init. EditableElement is not available before.\n editor.ui.once('ready', () => {\n this.focusTracker.add(editor.ui.getEditableElement());\n this.focusTracker.add(this.toolbarView.element);\n });\n // Register the toolbar so it becomes available for Alt+F10 and Esc navigation.\n editor.ui.addToolbar(this.toolbarView, {\n beforeFocus: () => this.show(true),\n afterBlur: () => this.hide(),\n isContextual: true\n });\n this._balloon = editor.plugins.get(ContextualBalloon);\n this._fireSelectionChangeDebounced = debounce(() => this.fire('_selectionChangeDebounced'), 200);\n // The appearance of the BalloonToolbar method is eventdriven.\n // It is possible to stop the #show event and this prevent the toolbar from showing up.\n this.decorate('show');\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const selection = editor.model.document.selection;\n // Show/hide the toolbar on editable focus/blur.\n this.listenTo(this.focusTracker, 'change:isFocused', (evt, name, isFocused) => {\n const isToolbarVisible = this._balloon.visibleView === this.toolbarView;\n if (!isFocused && isToolbarVisible) {\n this.hide();\n }\n else if (isFocused) {\n this.show();\n }\n });\n // Hide the toolbar when the selection is changed by a direct change or has changed to collapsed.\n this.listenTo(selection, 'change:range', (evt, data) => {\n if (data.directChange || selection.isCollapsed) {\n this.hide();\n }\n // Fire internal `_selectionChangeDebounced` event to use it for showing\n // the toolbar after the selection stops changing.\n this._fireSelectionChangeDebounced();\n });\n // Show the toolbar when the selection stops changing.\n this.listenTo(this, '_selectionChangeDebounced', () => {\n if (this.editor.editing.view.document.isFocused) {\n this.show();\n }\n });\n if (!this._balloonConfig.shouldNotGroupWhenFull) {\n this.listenTo(editor, 'ready', () => {\n const editableElement = editor.ui.view.editable.element;\n // Set #toolbarView's max-width on the initialization and update it on the editable resize.\n this._resizeObserver = new ResizeObserver(editableElement, entry => {\n // The max-width equals 90% of the editable's width for the best user experience.\n // The value keeps the balloon very close to the boundaries of the editable and limits the cases\n // when the balloon juts out from the editable element it belongs to.\n this.toolbarView.maxWidth = toPx(entry.contentRect.width * .9);\n });\n });\n }\n // Listen to the toolbar view and whenever it changes its geometry due to some items being\n // grouped or ungrouped, update the position of the balloon because a shorter/longer toolbar\n // means the balloon could be pointing at the wrong place. Once updated, the balloon will point\n // at the right selection in the content again.\n // https://github.com/ckeditor/ckeditor5/issues/6444\n this.listenTo(this.toolbarView, 'groupedItemsUpdate', () => {\n this._updatePosition();\n });\n }\n /**\n * Creates toolbar components based on given configuration.\n * This needs to be done when all plugins are ready.\n */\n afterInit() {\n const factory = this.editor.ui.componentFactory;\n this.toolbarView.fillFromConfig(this._balloonConfig, factory);\n }\n /**\n * Creates the toolbar view instance.\n */\n _createToolbarView() {\n const t = this.editor.locale.t;\n const shouldGroupWhenFull = !this._balloonConfig.shouldNotGroupWhenFull;\n const toolbarView = new ToolbarView(this.editor.locale, {\n shouldGroupWhenFull,\n isFloating: true\n });\n toolbarView.ariaLabel = t('Editor contextual toolbar');\n toolbarView.render();\n return toolbarView;\n }\n /**\n * Shows the toolbar and attaches it to the selection.\n *\n * Fires {@link #event:show} event which can be stopped to prevent the toolbar from showing up.\n *\n * @param showForCollapsedSelection When set `true`, the toolbar will show despite collapsed selection in the\n * editing view.\n */\n show(showForCollapsedSelection = false) {\n const editor = this.editor;\n const selection = editor.model.document.selection;\n const schema = editor.model.schema;\n // Do not add the toolbar to the balloon stack twice.\n if (this._balloon.hasView(this.toolbarView)) {\n return;\n }\n // Do not show the toolbar when the selection is collapsed.\n if (selection.isCollapsed && !showForCollapsedSelection) {\n return;\n }\n // Do not show the toolbar when there is more than one range in the selection and they fully contain selectable elements.\n // See https://github.com/ckeditor/ckeditor5/issues/6443.\n if (selectionContainsOnlyMultipleSelectables(selection, schema)) {\n return;\n }\n // Don not show the toolbar when all components inside are disabled\n // see https://github.com/ckeditor/ckeditor5-ui/issues/269.\n if (Array.from(this.toolbarView.items).every((item) => item.isEnabled !== undefined && !item.isEnabled)) {\n return;\n }\n // Update the toolbar position when the editor ui should be refreshed.\n this.listenTo(this.editor.ui, 'update', () => {\n this._updatePosition();\n });\n // Add the toolbar to the common editor contextual balloon.\n this._balloon.add({\n view: this.toolbarView,\n position: this._getBalloonPositionData(),\n balloonClassName: 'ck-toolbar-container'\n });\n }\n /**\n * Hides the toolbar.\n */\n hide() {\n if (this._balloon.hasView(this.toolbarView)) {\n this.stopListening(this.editor.ui, 'update');\n this._balloon.remove(this.toolbarView);\n }\n }\n /**\n * Returns positioning options for the {@link #_balloon}. They control the way balloon is attached\n * to the selection.\n */\n _getBalloonPositionData() {\n const editor = this.editor;\n const view = editor.editing.view;\n const viewDocument = view.document;\n const viewSelection = viewDocument.selection;\n // Get direction of the selection.\n const isBackward = viewDocument.selection.isBackward;\n return {\n // Because the target for BalloonPanelView is a Rect (not DOMRange), it's geometry will stay fixed\n // as the window scrolls. To let the BalloonPanelView follow such Rect, is must be continuously\n // computed and hence, the target is defined as a function instead of a static value.\n // https://github.com/ckeditor/ckeditor5-ui/issues/195\n target: () => {\n const range = isBackward ? viewSelection.getFirstRange() : viewSelection.getLastRange();\n const rangeRects = Rect.getDomRangeRects(view.domConverter.viewRangeToDom(range));\n // Select the proper range rect depending on the direction of the selection.\n if (isBackward) {\n return rangeRects[0];\n }\n else {\n // Ditch the zero-width \"orphan\" rect in the next line for the forward selection if there's\n // another one preceding it. It is not rendered as a selection by the web browser anyway.\n // https://github.com/ckeditor/ckeditor5-ui/issues/308\n if (rangeRects.length > 1 && rangeRects[rangeRects.length - 1].width === 0) {\n rangeRects.pop();\n }\n return rangeRects[rangeRects.length - 1];\n }\n },\n positions: this._getBalloonPositions(isBackward)\n };\n }\n /**\n * Updates the position of the {@link #_balloon} to make up for changes:\n *\n * * in the geometry of the selection it is attached to (e.g. the selection moved in the viewport or expanded or shrunk),\n * * or the geometry of the balloon toolbar itself (e.g. the toolbar has grouped or ungrouped some items and it is shorter or longer).\n */\n _updatePosition() {\n this._balloon.updatePosition(this._getBalloonPositionData());\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.stopListening();\n this._fireSelectionChangeDebounced.cancel();\n this.toolbarView.destroy();\n this.focusTracker.destroy();\n if (this._resizeObserver) {\n this._resizeObserver.destroy();\n }\n }\n /**\n * Returns toolbar positions for the given direction of the selection.\n */\n _getBalloonPositions(isBackward) {\n const isSafariIniOS = env.isSafari && env.isiOS;\n // https://github.com/ckeditor/ckeditor5/issues/7707\n const positions = isSafariIniOS ? generatePositions({\n // 20px when zoomed out. Less then 20px when zoomed in; the \"radius\" of the native selection handle gets\n // smaller as the user zooms in. No less than the default v-offset, though.\n heightOffset: Math.max(BalloonPanelView.arrowHeightOffset, Math.round(20 / global.window.visualViewport.scale))\n }) : BalloonPanelView.defaultPositions;\n return isBackward ? [\n positions.northWestArrowSouth,\n positions.northWestArrowSouthWest,\n positions.northWestArrowSouthEast,\n positions.northWestArrowSouthMiddleEast,\n positions.northWestArrowSouthMiddleWest,\n positions.southWestArrowNorth,\n positions.southWestArrowNorthWest,\n positions.southWestArrowNorthEast,\n positions.southWestArrowNorthMiddleWest,\n positions.southWestArrowNorthMiddleEast\n ] : [\n positions.southEastArrowNorth,\n positions.southEastArrowNorthEast,\n positions.southEastArrowNorthWest,\n positions.southEastArrowNorthMiddleEast,\n positions.southEastArrowNorthMiddleWest,\n positions.northEastArrowSouth,\n positions.northEastArrowSouthEast,\n positions.northEastArrowSouthWest,\n positions.northEastArrowSouthMiddleEast,\n positions.northEastArrowSouthMiddleWest\n ];\n }\n}\n/**\n * Returns \"true\" when the selection has multiple ranges and each range contains a selectable element\n * and nothing else.\n */\nfunction selectionContainsOnlyMultipleSelectables(selection, schema) {\n // It doesn't contain multiple objects if there is only one range.\n if (selection.rangeCount === 1) {\n return false;\n }\n return [...selection.getRanges()].every(range => {\n const element = range.getContainedElement();\n return element && schema.isSelectable(element);\n });\n}\n","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./blocktoolbar.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/toolbar/block/blockbuttonview\n */\nimport ButtonView from '../../button/buttonview';\nimport { toUnit } from '@ckeditor/ckeditor5-utils';\nimport '../../../theme/components/toolbar/blocktoolbar.css';\nconst toPx = toUnit('px');\n/**\n * The block button view class.\n *\n * This view represents a button attached next to block element where the selection is anchored.\n *\n * See {@link module:ui/toolbar/block/blocktoolbar~BlockToolbar}.\n */\nexport default class BlockButtonView extends ButtonView {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n const bind = this.bindTemplate;\n // Hide button on init.\n this.isVisible = false;\n this.isToggleable = true;\n this.set('top', 0);\n this.set('left', 0);\n this.extendTemplate({\n attributes: {\n class: 'ck-block-toolbar-button',\n style: {\n top: bind.to('top', val => toPx(val)),\n left: bind.to('left', val => toPx(val))\n }\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui/toolbar/block/blocktoolbar\n */\n/* global window */\nimport { Plugin, icons } from '@ckeditor/ckeditor5-core';\nimport { Rect, ResizeObserver, getOptimalPosition, toUnit } from '@ckeditor/ckeditor5-utils';\nimport BlockButtonView from './blockbuttonview';\nimport BalloonPanelView from '../../panel/balloon/balloonpanelview';\nimport ToolbarView from '../toolbarview';\nimport clickOutsideHandler from '../../bindings/clickoutsidehandler';\nimport normalizeToolbarConfig from '../normalizetoolbarconfig';\nconst toPx = toUnit('px');\nconst { pilcrow } = icons;\n/**\n * The block toolbar plugin.\n *\n * This plugin provides a button positioned next to the block of content where the selection is anchored.\n * Upon clicking the button, a dropdown providing access to editor features shows up, as configured in\n * {@link module:core/editor/editorconfig~EditorConfig#blockToolbar}.\n *\n * By default, the button is displayed next to all elements marked in {@link module:engine/model/schema~Schema}\n * as `$block` for which the toolbar provides at least one option.\n *\n * By default, the button is attached so its right boundary is touching the\n * {@link module:engine/view/editableelement~EditableElement}:\n *\n * ```\n * __ |\n * | || This is a block of content that the\n * ¯¯ | button is attached to. This is a\n * | block of content that the button is\n * | attached to.\n * ```\n *\n * The position of the button can be adjusted using the CSS `transform` property:\n *\n * ```css\n * .ck-block-toolbar-button {\n * \ttransform: translateX( -10px );\n * }\n * ```\n *\n * ```\n * __ |\n * | | | This is a block of content that the\n * ¯¯ | button is attached to. This is a\n * | block of content that the button is\n * | attached to.\n * ```\n *\n * **Note**: If you plan to run the editor in a righttoleft (RTL) language, keep in mind the button\n * will be attached to the **right** boundary of the editable area. In that case, make sure the\n * CSS position adjustment works properly by adding the following styles:\n *\n * ```css\n * .ck[dir=\"rtl\"] .ck-block-toolbar-button {\n * \ttransform: translateX( 10px );\n * }\n * ```\n */\nexport default class BlockToolbar extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'BlockToolbar';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n /**\n * An instance of the resize observer that allows to respond to changes in editable's geometry\n * so the toolbar can stay within its boundaries (and group toolbar items that do not fit).\n *\n * **Note**: Used only when `shouldNotGroupWhenFull` was **not** set in the\n * {@link module:core/editor/editorconfig~EditorConfig#blockToolbar configuration}.\n *\n * **Note:** Created in {@link #afterInit}.\n */\n this._resizeObserver = null;\n this._blockToolbarConfig = normalizeToolbarConfig(this.editor.config.get('blockToolbar'));\n this.toolbarView = this._createToolbarView();\n this.panelView = this._createPanelView();\n this.buttonView = this._createButtonView();\n // Close the #panelView upon clicking outside of the plugin UI.\n clickOutsideHandler({\n emitter: this.panelView,\n contextElements: [this.panelView.element, this.buttonView.element],\n activator: () => this.panelView.isVisible,\n callback: () => this._hidePanel()\n });\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Hides panel on a direct selection change.\n this.listenTo(editor.model.document.selection, 'change:range', (evt, data) => {\n if (data.directChange) {\n this._hidePanel();\n }\n });\n this.listenTo(editor.ui, 'update', () => this._updateButton());\n // `low` priority is used because of https://github.com/ckeditor/ckeditor5-core/issues/133.\n this.listenTo(editor, 'change:isReadOnly', () => this._updateButton(), { priority: 'low' });\n this.listenTo(editor.ui.focusTracker, 'change:isFocused', () => this._updateButton());\n // Reposition button on resize.\n this.listenTo(this.buttonView, 'change:isVisible', (evt, name, isVisible) => {\n if (isVisible) {\n // Keep correct position of button and panel on window#resize.\n this.buttonView.listenTo(window, 'resize', () => this._updateButton());\n }\n else {\n // Stop repositioning button when is hidden.\n this.buttonView.stopListening(window, 'resize');\n // Hide the panel when the button disappears.\n this._hidePanel();\n }\n });\n // Register the toolbar so it becomes available for Alt+F10 and Esc navigation.\n editor.ui.addToolbar(this.toolbarView, {\n beforeFocus: () => this._showPanel(),\n afterBlur: () => this._hidePanel()\n });\n }\n /**\n * Fills the toolbar with its items based on the configuration.\n *\n * **Note:** This needs to be done after all plugins are ready.\n */\n afterInit() {\n const factory = this.editor.ui.componentFactory;\n const config = this._blockToolbarConfig;\n this.toolbarView.fillFromConfig(config, factory);\n // Hide panel before executing each button in the panel.\n for (const item of this.toolbarView.items) {\n item.on('execute', () => this._hidePanel(true), { priority: 'high' });\n }\n if (!config.shouldNotGroupWhenFull) {\n this.listenTo(this.editor, 'ready', () => {\n const editableElement = this.editor.ui.view.editable.element;\n // Set #toolbarView's max-width just after the initialization and update it on the editable resize.\n this._resizeObserver = new ResizeObserver(editableElement, () => {\n this.toolbarView.maxWidth = this._getToolbarMaxWidth();\n });\n });\n }\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n // Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).\n this.panelView.destroy();\n this.buttonView.destroy();\n this.toolbarView.destroy();\n if (this._resizeObserver) {\n this._resizeObserver.destroy();\n }\n }\n /**\n * Creates the {@link #toolbarView}.\n */\n _createToolbarView() {\n const t = this.editor.locale.t;\n const shouldGroupWhenFull = !this._blockToolbarConfig.shouldNotGroupWhenFull;\n const toolbarView = new ToolbarView(this.editor.locale, {\n shouldGroupWhenFull,\n isFloating: true\n });\n toolbarView.ariaLabel = t('Editor block content toolbar');\n return toolbarView;\n }\n /**\n * Creates the {@link #panelView}.\n */\n _createPanelView() {\n const editor = this.editor;\n const panelView = new BalloonPanelView(editor.locale);\n panelView.content.add(this.toolbarView);\n panelView.class = 'ck-toolbar-container';\n editor.ui.view.body.add(panelView);\n editor.ui.focusTracker.add(panelView.element);\n // Close #panelView on `Esc` press.\n this.toolbarView.keystrokes.set('Esc', (evt, cancel) => {\n this._hidePanel(true);\n cancel();\n });\n return panelView;\n }\n /**\n * Creates the {@link #buttonView}.\n */\n _createButtonView() {\n const editor = this.editor;\n const t = editor.t;\n const buttonView = new BlockButtonView(editor.locale);\n buttonView.set({\n label: t('Edit block'),\n icon: pilcrow,\n withText: false\n });\n // Bind the panelView observable properties to the buttonView.\n buttonView.bind('isOn').to(this.panelView, 'isVisible');\n buttonView.bind('tooltip').to(this.panelView, 'isVisible', isVisible => !isVisible);\n // Toggle the panelView upon buttonView#execute.\n this.listenTo(buttonView, 'execute', () => {\n if (!this.panelView.isVisible) {\n this._showPanel();\n }\n else {\n this._hidePanel(true);\n }\n });\n editor.ui.view.body.add(buttonView);\n editor.ui.focusTracker.add(buttonView.element);\n return buttonView;\n }\n /**\n * Shows or hides the button.\n * When all the conditions for displaying the button are matched, it shows the button. Hides otherwise.\n */\n _updateButton() {\n const editor = this.editor;\n const model = editor.model;\n const view = editor.editing.view;\n // Hides the button when the editor is not focused.\n if (!editor.ui.focusTracker.isFocused) {\n this._hideButton();\n return;\n }\n // Hides the button when the selection is in non-editable place.\n if (!editor.model.canEditAt(editor.model.document.selection)) {\n this._hideButton();\n return;\n }\n // Get the first selected block, button will be attached to this element.\n const modelTarget = Array.from(model.document.selection.getSelectedBlocks())[0];\n // Hides the button when there is no enabled item in toolbar for the current block element.\n if (!modelTarget || Array.from(this.toolbarView.items).every((item) => !item.isEnabled)) {\n this._hideButton();\n return;\n }\n // Get DOM target element.\n const domTarget = view.domConverter.mapViewToDom(editor.editing.mapper.toViewElement(modelTarget));\n // Show block button.\n this.buttonView.isVisible = true;\n // Attach block button to target DOM element.\n this._attachButtonToElement(domTarget);\n // When panel is opened then refresh it position to be properly aligned with block button.\n if (this.panelView.isVisible) {\n this._showPanel();\n }\n }\n /**\n * Hides the button.\n */\n _hideButton() {\n this.buttonView.isVisible = false;\n }\n /**\n * Shows the {@link #toolbarView} attached to the {@link #buttonView}.\n * If the toolbar is already visible, then it simply repositions it.\n */\n _showPanel() {\n // Usually, the only way to show the toolbar is by pressing the block button. It makes it impossible for\n // the toolbar to show up when the button is invisible (feature does not make sense for the selection then).\n // The toolbar navigation using Alt+F10 does not access the button but shows the panel directly using this method.\n // So we need to check whether this is possible first.\n if (!this.buttonView.isVisible) {\n return;\n }\n const wasVisible = this.panelView.isVisible;\n // So here's the thing: If there was no initial panelView#show() or these two were in different order, the toolbar\n // positioning will break in RTL editors. Weird, right? What you show know is that the toolbar\n // grouping works thanks to:\n //\n // * the ResizeObserver, which kicks in as soon as the toolbar shows up in DOM (becomes visible again).\n // * the observable ToolbarView#maxWidth, which triggers re-grouping when changed.\n //\n // Here are the possible scenarios:\n //\n // 1. (WRONG ❌) If the #maxWidth is set when the toolbar is invisible, it won't affect item grouping (no DOMRects, no grouping).\n // Then, when panelView.pin() is called, the position of the toolbar will be calculated for the old\n // items grouping state, and when finally ResizeObserver kicks in (hey, the toolbar is visible now, right?)\n // it will group/ungroup some items and the length of the toolbar will change. But since in RTL the toolbar\n // is attached on the right side and the positioning uses CSS \"left\", it will result in the toolbar shifting\n // to the left and being displayed in the wrong place.\n // 2. (WRONG ❌) If the panelView.pin() is called first and #maxWidth set next, then basically the story repeats. The balloon\n // calculates the position for the old toolbar grouping state, then the toolbar re-groups items and because\n // it is positioned using CSS \"left\" it will move.\n // 3. (RIGHT ✅) We show the panel first (the toolbar does re-grouping but it does not matter), then the #maxWidth\n // is set allowing the toolbar to re-group again and finally panelView.pin() does the positioning when the\n // items grouping state is stable and final.\n //\n // https://github.com/ckeditor/ckeditor5/issues/6449, https://github.com/ckeditor/ckeditor5/issues/6575\n this.panelView.show();\n this.toolbarView.maxWidth = this._getToolbarMaxWidth();\n this.panelView.pin({\n target: this.buttonView.element,\n limiter: this.editor.ui.getEditableElement()\n });\n if (!wasVisible) {\n this.toolbarView.items.get(0).focus();\n }\n }\n /**\n * Hides the {@link #toolbarView}.\n *\n * @param focusEditable When `true`, the editable will be focused after hiding the panel.\n */\n _hidePanel(focusEditable) {\n this.panelView.isVisible = false;\n if (focusEditable) {\n this.editor.editing.view.focus();\n }\n }\n /**\n * Attaches the {@link #buttonView} to the target block of content.\n *\n * @param targetElement Target element.\n */\n _attachButtonToElement(targetElement) {\n const contentStyles = window.getComputedStyle(targetElement);\n const editableRect = new Rect(this.editor.ui.getEditableElement());\n const contentPaddingTop = parseInt(contentStyles.paddingTop, 10);\n // When line height is not an integer then thread it as \"normal\".\n // MDN says that 'normal' == ~1.2 on desktop browsers.\n const contentLineHeight = parseInt(contentStyles.lineHeight, 10) || parseInt(contentStyles.fontSize, 10) * 1.2;\n const position = getOptimalPosition({\n element: this.buttonView.element,\n target: targetElement,\n positions: [\n (contentRect, buttonRect) => {\n let left;\n if (this.editor.locale.uiLanguageDirection === 'ltr') {\n left = editableRect.left - buttonRect.width;\n }\n else {\n left = editableRect.right;\n }\n return {\n top: contentRect.top + contentPaddingTop + (contentLineHeight - buttonRect.height) / 2,\n left\n };\n }\n ]\n });\n this.buttonView.top = position.top;\n this.buttonView.left = position.left;\n }\n /**\n * Gets the {@link #toolbarView} max-width, based on\n * editable width plus distance between farthest edge of the {@link #buttonView} and the editable.\n *\n * @returns A maximum width that toolbar can have, in pixels.\n */\n _getToolbarMaxWidth() {\n const editableElement = this.editor.ui.view.editable.element;\n const editableRect = new Rect(editableElement);\n const buttonRect = new Rect(this.buttonView.element);\n const isRTL = this.editor.locale.uiLanguageDirection === 'rtl';\n const offset = isRTL ? (buttonRect.left - editableRect.right) + buttonRect.width : editableRect.left - buttonRect.left;\n return toPx(editableRect.width + offset);\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M10.209 18.717A8.5 8.5 0 1 1 18.686 9.6h-.008l.002.12a3 3 0 0 1-2.866 2.997h-.268l-.046-.002v.002h-4.791a2 2 0 1 0 0 4 1 1 0 1 1-.128 1.992 8.665 8.665 0 0 1-.372.008Zm-3.918-7.01a1.25 1.25 0 1 0-2.415-.648 1.25 1.25 0 0 0 2.415.647ZM5.723 8.18a1.25 1.25 0 1 0 .647-2.414 1.25 1.25 0 0 0-.647 2.414ZM9.76 6.155a1.25 1.25 0 1 0 .647-2.415 1.25 1.25 0 0 0-.647 2.415Zm4.028 1.759a1.25 1.25 0 1 0 .647-2.415 1.25 1.25 0 0 0-.647 2.415Z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module ui\n */\nexport { default as clickOutsideHandler } from './bindings/clickoutsidehandler';\nexport { default as injectCssTransitionDisabler } from './bindings/injectcsstransitiondisabler';\nexport { default as CssTransitionDisablerMixin } from './bindings/csstransitiondisablermixin';\nexport { default as submitHandler } from './bindings/submithandler';\nexport { default as addKeyboardHandlingForGrid } from './bindings/addkeyboardhandlingforgrid';\nexport { default as BodyCollection } from './editorui/bodycollection';\nexport { default as ButtonView } from './button/buttonview';\nexport { default as SwitchButtonView } from './button/switchbuttonview';\nexport * from './colorgrid/utils';\nexport { default as ColorGridView } from './colorgrid/colorgridview';\nexport { default as ColorTileView } from './colorgrid/colortileview';\nexport { default as ColorPickerView } from './colorpicker/colorpickerview';\nexport { default as ComponentFactory } from './componentfactory';\nexport { default as DropdownView } from './dropdown/dropdownview';\nexport { default as DropdownPanelView } from './dropdown/dropdownpanelview';\nexport { default as DropdownButtonView } from './dropdown/button/dropdownbuttonview';\nexport { default as SplitButtonView } from './dropdown/button/splitbuttonview';\nexport * from './dropdown/utils';\nexport { default as EditorUI } from './editorui/editorui';\nexport { default as EditorUIView } from './editorui/editoruiview';\nexport { default as BoxedEditorUIView } from './editorui/boxed/boxededitoruiview';\nexport { default as InlineEditableUIView } from './editableui/inline/inlineeditableuiview';\nexport { default as FormHeaderView } from './formheader/formheaderview';\nexport { default as FocusCycler } from './focuscycler';\nexport { default as IconView } from './icon/iconview';\nexport { default as InputView } from './input/inputview';\nexport { default as InputTextView } from './inputtext/inputtextview';\nexport { default as InputNumberView } from './inputnumber/inputnumberview';\nexport { default as IframeView } from './iframe/iframeview';\nexport { default as LabelView } from './label/labelview';\nexport { default as LabeledFieldView } from './labeledfield/labeledfieldview';\nexport * from './labeledfield/utils';\nexport { default as ListItemView } from './list/listitemview';\nexport { default as ListView } from './list/listview';\nexport { default as Notification } from './notification/notification';\nexport { default as Model } from './model';\nexport { default as BalloonPanelView } from './panel/balloon/balloonpanelview';\nexport { default as ContextualBalloon } from './panel/balloon/contextualballoon';\nexport { default as StickyPanelView } from './panel/sticky/stickypanelview';\nexport { default as TooltipManager } from './tooltipmanager';\nexport { default as Template } from './template';\nexport { default as ToolbarView } from './toolbar/toolbarview';\nexport { default as ToolbarSeparatorView } from './toolbar/toolbarseparatorview';\nexport { default as normalizeToolbarConfig } from './toolbar/normalizetoolbarconfig';\nexport { default as BalloonToolbar } from './toolbar/balloon/balloontoolbar';\nexport { default as BlockToolbar } from './toolbar/block/blocktoolbar';\nexport { default as View } from './view';\nexport { default as ViewCollection } from './viewcollection';\nimport { default as colorPaletteIcon } from '../theme/icons/color-palette.svg';\nexport const icons = {\n colorPaletteIcon\n};\nimport './augmentation';\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { EditorUI, normalizeToolbarConfig } from 'ckeditor5/src/ui';\nimport { enablePlaceholder } from 'ckeditor5/src/engine';\nimport { ElementReplacer } from 'ckeditor5/src/utils';\n/**\n * The classic editor UI class.\n */\nexport default class ClassicEditorUI extends EditorUI {\n /**\n * Creates an instance of the classic editor UI class.\n *\n * @param editor The editor instance.\n * @param view The view of the UI.\n */\n constructor(editor, view) {\n super(editor);\n this.view = view;\n this._toolbarConfig = normalizeToolbarConfig(editor.config.get('toolbar'));\n this._elementReplacer = new ElementReplacer();\n }\n /**\n * @inheritDoc\n */\n get element() {\n return this.view.element;\n }\n /**\n * Initializes the UI.\n *\n * @param replacementElement The DOM element that will be the source for the created editor.\n */\n init(replacementElement) {\n const editor = this.editor;\n const view = this.view;\n const editingView = editor.editing.view;\n const editable = view.editable;\n const editingRoot = editingView.document.getRoot();\n // The editable UI and editing root should share the same name. Then name is used\n // to recognize the particular editable, for instance in ARIA attributes.\n editable.name = editingRoot.rootName;\n view.render();\n // The editable UI element in DOM is available for sure only after the editor UI view has been rendered.\n // But it can be available earlier if a DOM element has been passed to BalloonEditor.create().\n const editableElement = editable.element;\n // Register the editable UI view in the editor. A single editor instance can aggregate multiple\n // editable areas (roots) but the classic editor has only one.\n this.setEditableElement(editable.name, editableElement);\n // Let the editable UI element respond to the changes in the global editor focus\n // tracker. It has been added to the same tracker a few lines above but, in reality, there are\n // many focusable areas in the editor, like balloons, toolbars or dropdowns and as long\n // as they have focus, the editable should act like it is focused too (although technically\n // it isn't), e.g. by setting the proper CSS class, visually announcing focus to the user.\n // Doing otherwise will result in editable focus styles disappearing, once e.g. the\n // toolbar gets focused.\n view.editable.bind('isFocused').to(this.focusTracker);\n // Bind the editable UI element to the editing view, making it an end and entrypoint\n // of the editor's engine. This is where the engine meets the UI.\n editingView.attachDomRoot(editableElement);\n // If an element containing the initial data of the editor was provided, replace it with\n // an editor instance's UI in DOM until the editor is destroyed. For instance, a <textarea>\n // can be such element.\n if (replacementElement) {\n this._elementReplacer.replace(replacementElement, this.element);\n }\n this._initPlaceholder();\n this._initToolbar();\n this.fire('ready');\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n const view = this.view;\n const editingView = this.editor.editing.view;\n this._elementReplacer.restore();\n editingView.detachDomRoot(view.editable.name);\n view.destroy();\n }\n /**\n * Initializes the editor toolbar.\n */\n _initToolbar() {\n const view = this.view;\n // Setup the sticky panel with toolbar.\n view.stickyPanel.bind('isActive').to(this.focusTracker, 'isFocused');\n view.stickyPanel.limiterElement = view.element;\n view.stickyPanel.bind('viewportTopOffset').to(this, 'viewportOffset', ({ top }) => top || 0);\n view.toolbar.fillFromConfig(this._toolbarConfig, this.componentFactory);\n // Register the toolbar so it becomes available for Alt+F10 and Esc navigation.\n this.addToolbar(view.toolbar);\n }\n /**\n * Enable the placeholder text on the editing root, if any was configured.\n */\n _initPlaceholder() {\n const editor = this.editor;\n const editingView = editor.editing.view;\n const editingRoot = editingView.document.getRoot();\n const sourceElement = editor.sourceElement;\n let placeholderText;\n const placeholder = editor.config.get('placeholder');\n if (placeholder) {\n placeholderText = typeof placeholder === 'string' ? placeholder : placeholder[this.view.editable.name];\n }\n if (!placeholderText && sourceElement && sourceElement.tagName.toLowerCase() === 'textarea') {\n placeholderText = sourceElement.getAttribute('placeholder');\n }\n if (placeholderText) {\n enablePlaceholder({\n view: editingView,\n element: editingRoot,\n text: placeholderText,\n isDirectHost: false,\n keepOnFocus: true\n });\n }\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./classiceditor.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module editor-classic/classiceditoruiview\n */\nimport { BoxedEditorUIView, InlineEditableUIView, StickyPanelView, ToolbarView } from 'ckeditor5/src/ui';\nimport '../theme/classiceditor.css';\n/**\n * Classic editor UI view. Uses an inline editable and a sticky toolbar, all\n * enclosed in a boxed UI view.\n */\nexport default class ClassicEditorUIView extends BoxedEditorUIView {\n /**\n * Creates an instance of the classic editor UI view.\n *\n * @param locale The {@link module:core/editor/editor~Editor#locale} instance.\n * @param editingView The editing view instance this view is related to.\n * @param options Configuration options for the view instance.\n * @param options.shouldToolbarGroupWhenFull When set `true` enables automatic items grouping\n * in the main {@link module:editor-classic/classiceditoruiview~ClassicEditorUIView#toolbar toolbar}.\n * See {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull} to learn more.\n */\n constructor(locale, editingView, options = {}) {\n super(locale);\n this.stickyPanel = new StickyPanelView(locale);\n this.toolbar = new ToolbarView(locale, {\n shouldGroupWhenFull: options.shouldToolbarGroupWhenFull\n });\n this.editable = new InlineEditableUIView(locale, editingView);\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n // Set toolbar as a child of a stickyPanel and makes toolbar sticky.\n this.stickyPanel.content.add(this.toolbar);\n this.top.add(this.stickyPanel);\n this.main.add(this.editable);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * An abstract watchdog class that handles most of the error handling process and the state of the underlying component.\n *\n * See the {@glink features/watchdog Watchdog feature guide} to learn the rationale behind it and how to use it.\n *\n * @internal\n */\nexport default class Watchdog {\n /**\n * @param {module:watchdog/watchdog~WatchdogConfig} config The watchdog plugin configuration.\n */\n constructor(config) {\n /**\n * An array of crashes saved as an object with the following properties:\n *\n * * `message`: `String`,\n * * `stack`: `String`,\n * * `date`: `Number`,\n * * `filename`: `String | undefined`,\n * * `lineno`: `Number | undefined`,\n * * `colno`: `Number | undefined`,\n */\n this.crashes = [];\n /**\n * Specifies the state of the item watched by the watchdog. The state can be one of the following values:\n *\n * * `initializing` &ndash; Before the first initialization, and after crashes, before the item is ready.\n * * `ready` &ndash; A state when the user can interact with the item.\n * * `crashed` &ndash; A state when an error occurs. It quickly changes to `initializing` or `crashedPermanently`\n * depending on how many and how frequent errors have been caught recently.\n * * `crashedPermanently` &ndash; A state when the watchdog stops reacting to errors and keeps the item it is watching crashed,\n * * `destroyed` &ndash; A state when the item is manually destroyed by the user after calling `watchdog.destroy()`.\n */\n this.state = 'initializing';\n /**\n * Returns the result of the `Date.now()` call. It can be overridden in tests to mock time as some popular\n * approaches like `sinon.useFakeTimers()` do not work well with error handling.\n */\n this._now = Date.now;\n this.crashes = [];\n this._crashNumberLimit = typeof config.crashNumberLimit === 'number' ? config.crashNumberLimit : 3;\n this._minimumNonErrorTimePeriod = typeof config.minimumNonErrorTimePeriod === 'number' ? config.minimumNonErrorTimePeriod : 5000;\n this._boundErrorHandler = evt => {\n // `evt.error` is exposed by EventError while `evt.reason` is available in PromiseRejectionEvent.\n const error = 'error' in evt ? evt.error : evt.reason;\n // Note that `evt.reason` might be everything that is in the promise rejection.\n // Similarly everything that is thrown lands in `evt.error`.\n if (error instanceof Error) {\n this._handleError(error, evt);\n }\n };\n this._listeners = {};\n if (!this._restart) {\n throw new Error('The Watchdog class was split into the abstract `Watchdog` class and the `EditorWatchdog` class. ' +\n 'Please, use `EditorWatchdog` if you have used the `Watchdog` class previously.');\n }\n }\n /**\n * Destroys the watchdog and releases the resources.\n */\n destroy() {\n this._stopErrorHandling();\n this._listeners = {};\n }\n /**\n * Starts listening to a specific event name by registering a callback that will be executed\n * whenever an event with a given name fires.\n *\n * Note that this method differs from the CKEditor 5's default `EventEmitterMixin` implementation.\n *\n * @param eventName The event name.\n * @param callback A callback which will be added to event listeners.\n */\n on(eventName, callback) {\n if (!this._listeners[eventName]) {\n this._listeners[eventName] = [];\n }\n this._listeners[eventName].push(callback);\n }\n /**\n * Stops listening to the specified event name by removing the callback from event listeners.\n *\n * Note that this method differs from the CKEditor 5's default `EventEmitterMixin` implementation.\n *\n * @param eventName The event name.\n * @param callback A callback which will be removed from event listeners.\n */\n off(eventName, callback) {\n this._listeners[eventName] = this._listeners[eventName]\n .filter(cb => cb !== callback);\n }\n /**\n * Fires an event with a given event name and arguments.\n *\n * Note that this method differs from the CKEditor 5's default `EventEmitterMixin` implementation.\n */\n _fire(eventName, ...args) {\n const callbacks = this._listeners[eventName] || [];\n for (const callback of callbacks) {\n callback.apply(this, [null, ...args]);\n }\n }\n /**\n * Starts error handling by attaching global error handlers.\n */\n _startErrorHandling() {\n window.addEventListener('error', this._boundErrorHandler);\n window.addEventListener('unhandledrejection', this._boundErrorHandler);\n }\n /**\n * Stops error handling by detaching global error handlers.\n */\n _stopErrorHandling() {\n window.removeEventListener('error', this._boundErrorHandler);\n window.removeEventListener('unhandledrejection', this._boundErrorHandler);\n }\n /**\n * Checks if an error comes from the watched item and restarts it.\n * It reacts to {@link module:utils/ckeditorerror~CKEditorError `CKEditorError` errors} only.\n *\n * @fires error\n * @param error Error.\n * @param evt An error event.\n */\n _handleError(error, evt) {\n // @if CK_DEBUG // const err = error as CKEditorError;\n // @if CK_DEBUG // if ( err.is && err.is( 'CKEditorError' ) && err.context === undefined ) {\n // @if CK_DEBUG // console.warn( 'The error is missing its context and Watchdog cannot restart the proper item.' );\n // @if CK_DEBUG // }\n if (this._shouldReactToError(error)) {\n this.crashes.push({\n message: error.message,\n stack: error.stack,\n // `evt.filename`, `evt.lineno` and `evt.colno` are available only in ErrorEvent events\n filename: evt instanceof ErrorEvent ? evt.filename : undefined,\n lineno: evt instanceof ErrorEvent ? evt.lineno : undefined,\n colno: evt instanceof ErrorEvent ? evt.colno : undefined,\n date: this._now()\n });\n const causesRestart = this._shouldRestart();\n this.state = 'crashed';\n this._fire('stateChange');\n this._fire('error', { error, causesRestart });\n if (causesRestart) {\n this._restart();\n }\n else {\n this.state = 'crashedPermanently';\n this._fire('stateChange');\n }\n }\n }\n /**\n * Checks whether an error should be handled by the watchdog.\n *\n * @param error An error that was caught by the error handling process.\n */\n _shouldReactToError(error) {\n return (error.is &&\n error.is('CKEditorError') &&\n error.context !== undefined &&\n // In some cases the watched item should not be restarted - e.g. during the item initialization.\n // That's why the `null` was introduced as a correct error context which does cause restarting.\n error.context !== null &&\n // Do not react to errors if the watchdog is in states other than `ready`.\n this.state === 'ready' &&\n this._isErrorComingFromThisItem(error));\n }\n /**\n * Checks if the watchdog should restart the underlying item.\n */\n _shouldRestart() {\n if (this.crashes.length <= this._crashNumberLimit) {\n return true;\n }\n const lastErrorTime = this.crashes[this.crashes.length - 1].date;\n const firstMeaningfulErrorTime = this.crashes[this.crashes.length - 1 - this._crashNumberLimit].date;\n const averageNonErrorTimePeriod = (lastErrorTime - firstMeaningfulErrorTime) / this._crashNumberLimit;\n return averageNonErrorTimePeriod > this._minimumNonErrorTimePeriod;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module watchdog/utils/getsubnodes\n */\n/* globals EventTarget, Event */\nexport default function getSubNodes(head, excludedProperties = new Set()) {\n const nodes = [head];\n // @if CK_DEBUG_WATCHDOG // const prevNodeMap = new Map();\n // Nodes are stored to prevent infinite looping.\n const subNodes = new Set();\n let nodeIndex = 0;\n while (nodes.length > nodeIndex) {\n // Incrementing the iterator is much faster than changing size of the array with Array.prototype.shift().\n const node = nodes[nodeIndex++];\n if (subNodes.has(node) || !shouldNodeBeIncluded(node) || excludedProperties.has(node)) {\n continue;\n }\n subNodes.add(node);\n // Handle arrays, maps, sets, custom collections that implements `[ Symbol.iterator ]()`, etc.\n if (Symbol.iterator in node) {\n // The custom editor iterators might cause some problems if the editor is crashed.\n try {\n for (const n of node) {\n nodes.push(n);\n // @if CK_DEBUG_WATCHDOG // if ( !prevNodeMap.has( n ) ) {\n // @if CK_DEBUG_WATCHDOG // \tprevNodeMap.set( n, node );\n // @if CK_DEBUG_WATCHDOG // }\n }\n }\n catch (err) {\n // Do not log errors for broken structures\n // since we are in the error handling process already.\n // eslint-disable-line no-empty\n }\n }\n else {\n for (const key in node) {\n // We share a reference via the protobuf library within the editors,\n // hence the shared value should be skipped. Although, it's not a perfect\n // solution since new places like that might occur in the future.\n if (key === 'defaultValue') {\n continue;\n }\n nodes.push(node[key]);\n // @if CK_DEBUG_WATCHDOG // if ( !prevNodeMap.has( node[ key ] ) ) {\n // @if CK_DEBUG_WATCHDOG // \tprevNodeMap.set( node[ key ], node );\n // @if CK_DEBUG_WATCHDOG // }\n }\n }\n }\n // @if CK_DEBUG_WATCHDOG // return { subNodes, prevNodeMap } as any;\n return subNodes;\n}\nfunction shouldNodeBeIncluded(node) {\n const type = Object.prototype.toString.call(node);\n const typeOfNode = typeof node;\n return !(typeOfNode === 'number' ||\n typeOfNode === 'boolean' ||\n typeOfNode === 'string' ||\n typeOfNode === 'symbol' ||\n typeOfNode === 'function' ||\n type === '[object Date]' ||\n type === '[object RegExp]' ||\n type === '[object Module]' ||\n node === undefined ||\n node === null ||\n // This flag is meant to exclude singletons shared across editor instances. So when an error is thrown in one editor,\n // the other editors connected through the reference to the same singleton are not restarted. This is a temporary workaround\n // until a better solution is found.\n // More in https://github.com/ckeditor/ckeditor5/issues/12292.\n node._watchdogExcluded ||\n // Skip native DOM objects, e.g. Window, nodes, events, etc.\n node instanceof EventTarget ||\n node instanceof Event);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module watchdog/utils/areconnectedthroughproperties\n */\n/* globals console */\nimport getSubNodes from './getsubnodes';\n/**\n * Traverses both structures to find out whether there is a reference that is shared between both structures.\n */\nexport default function areConnectedThroughProperties(target1, target2, excludedNodes = new Set()) {\n if (target1 === target2 && isObject(target1)) {\n return true;\n }\n // @if CK_DEBUG_WATCHDOG // return checkConnectionBetweenProps( target1, target2, excludedNodes );\n const subNodes1 = getSubNodes(target1, excludedNodes);\n const subNodes2 = getSubNodes(target2, excludedNodes);\n for (const node of subNodes1) {\n if (subNodes2.has(node)) {\n return true;\n }\n }\n return false;\n}\n/* istanbul ignore next -- @preserve */\n// eslint-disable-next-line\nfunction checkConnectionBetweenProps(target1, target2, excludedNodes) {\n const { subNodes: subNodes1, prevNodeMap: prevNodeMap1 } = getSubNodes(target1, excludedNodes.subNodes);\n const { subNodes: subNodes2, prevNodeMap: prevNodeMap2 } = getSubNodes(target2, excludedNodes.subNodes);\n for (const sharedNode of subNodes1) {\n if (subNodes2.has(sharedNode)) {\n const connection = [];\n connection.push(sharedNode);\n let node = prevNodeMap1.get(sharedNode);\n while (node && node !== target1) {\n connection.push(node);\n node = prevNodeMap1.get(node);\n }\n node = prevNodeMap2.get(sharedNode);\n while (node && node !== target2) {\n connection.unshift(node);\n node = prevNodeMap2.get(node);\n }\n console.log('--------');\n console.log({ target1 });\n console.log({ sharedNode });\n console.log({ target2 });\n console.log({ connection });\n return true;\n }\n }\n return false;\n}\nfunction isObject(structure) {\n return typeof structure === 'object' && structure !== null;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport areConnectedThroughProperties from './utils/areconnectedthroughproperties';\nimport Watchdog from './watchdog';\nimport { throttle, cloneDeepWith, isElement } from 'lodash-es';\n/**\n * A watchdog for CKEditor 5 editors.\n *\n * See the {@glink features/watchdog Watchdog feature guide} to learn the rationale behind it and\n * how to use it.\n */\nexport default class EditorWatchdog extends Watchdog {\n /**\n * @param Editor The editor class.\n * @param watchdogConfig The watchdog plugin configuration.\n */\n constructor(Editor, watchdogConfig = {}) {\n super(watchdogConfig);\n /**\n * The current editor instance.\n */\n this._editor = null;\n // this._editorClass = Editor;\n this._throttledSave = throttle(this._save.bind(this), typeof watchdogConfig.saveInterval === 'number' ? watchdogConfig.saveInterval : 5000);\n // Set default creator and destructor functions:\n if (Editor) {\n this._creator = ((elementOrData, config) => Editor.create(elementOrData, config));\n }\n this._destructor = editor => editor.destroy();\n }\n /**\n * The current editor instance.\n */\n get editor() {\n return this._editor;\n }\n /**\n * @internal\n */\n get _item() {\n return this._editor;\n }\n /**\n * Sets the function that is responsible for the editor creation.\n * It expects a function that should return a promise.\n *\n * ```ts\n * watchdog.setCreator( ( element, config ) => ClassicEditor.create( element, config ) );\n * ```\n */\n setCreator(creator) {\n this._creator = creator;\n }\n /**\n * Sets the function that is responsible for the editor destruction.\n * Overrides the default destruction function, which destroys only the editor instance.\n * It expects a function that should return a promise or `undefined`.\n *\n * ```ts\n * watchdog.setDestructor( editor => {\n * \t// Do something before the editor is destroyed.\n *\n * \treturn editor\n * \t\t.destroy()\n * \t\t.then( () => {\n * \t\t\t// Do something after the editor is destroyed.\n * \t\t} );\n * } );\n * ```\n */\n setDestructor(destructor) {\n this._destructor = destructor;\n }\n /**\n * Restarts the editor instance. This method is called whenever an editor error occurs. It fires the `restart` event and changes\n * the state to `initializing`.\n *\n * @fires restart\n */\n _restart() {\n return Promise.resolve()\n .then(() => {\n this.state = 'initializing';\n this._fire('stateChange');\n return this._destroy();\n })\n .catch(err => {\n console.error('An error happened during the editor destroying.', err);\n })\n .then(() => {\n if (typeof this._elementOrData === 'string') {\n return this.create(this._data, this._config, this._config.context);\n }\n else {\n const updatedConfig = Object.assign({}, this._config, {\n initialData: this._data\n });\n return this.create(this._elementOrData, updatedConfig, updatedConfig.context);\n }\n })\n .then(() => {\n this._fire('restart');\n });\n }\n /**\n * Creates the editor instance and keeps it running, using the defined creator and destructor.\n *\n * @param elementOrData The editor source element or the editor data.\n * @param config The editor configuration.\n * @param context A context for the editor.\n */\n create(elementOrData = this._elementOrData, config = this._config, context) {\n return Promise.resolve()\n .then(() => {\n super._startErrorHandling();\n this._elementOrData = elementOrData;\n // Clone configuration because it might be shared within multiple watchdog instances. Otherwise,\n // when an error occurs in one of these editors, the watchdog will restart all of them.\n this._config = this._cloneEditorConfiguration(config) || {};\n this._config.context = context;\n return this._creator(elementOrData, this._config);\n })\n .then(editor => {\n this._editor = editor;\n editor.model.document.on('change:data', this._throttledSave);\n this._lastDocumentVersion = editor.model.document.version;\n this._data = this._getData();\n this.state = 'ready';\n this._fire('stateChange');\n });\n }\n /**\n * Destroys the watchdog and the current editor instance. It fires the callback\n * registered in {@link #setDestructor `setDestructor()`} and uses it to destroy the editor instance.\n * It also sets the state to `destroyed`.\n */\n destroy() {\n return Promise.resolve()\n .then(() => {\n this.state = 'destroyed';\n this._fire('stateChange');\n super.destroy();\n return this._destroy();\n });\n }\n _destroy() {\n return Promise.resolve()\n .then(() => {\n this._stopErrorHandling();\n // Save data if there is a remaining editor data change.\n this._throttledSave.flush();\n const editor = this._editor;\n this._editor = null;\n // Remove the `change:data` listener before destroying the editor.\n // Incorrectly written plugins may trigger firing `change:data` events during the editor destruction phase\n // causing the watchdog to call `editor.getData()` when some parts of editor are already destroyed.\n editor.model.document.off('change:data', this._throttledSave);\n return this._destructor(editor);\n });\n }\n /**\n * Saves the editor data, so it can be restored after the crash even if the data cannot be fetched at\n * the moment of the crash.\n */\n _save() {\n const version = this._editor.model.document.version;\n try {\n this._data = this._getData();\n this._lastDocumentVersion = version;\n }\n catch (err) {\n console.error(err, 'An error happened during restoring editor data. ' +\n 'Editor will be restored from the previously saved data.');\n }\n }\n /**\n * @internal\n */\n _setExcludedProperties(props) {\n this._excludedProps = props;\n }\n /**\n * Returns the editor data.\n */\n _getData() {\n const data = {};\n for (const rootName of this._editor.model.document.getRootNames()) {\n data[rootName] = this._editor.data.get({ rootName });\n }\n return data;\n }\n /**\n * Traverses the error context and the current editor to find out whether these structures are connected\n * to each other via properties.\n *\n * @internal\n */\n _isErrorComingFromThisItem(error) {\n return areConnectedThroughProperties(this._editor, error.context, this._excludedProps);\n }\n /**\n * Clones the editor configuration.\n */\n _cloneEditorConfiguration(config) {\n return cloneDeepWith(config, (value, key) => {\n // Leave DOM references.\n if (isElement(value)) {\n return value;\n }\n if (key === 'context') {\n return value;\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport Watchdog from './watchdog';\nimport EditorWatchdog from './editorwatchdog';\nimport areConnectedThroughProperties from './utils/areconnectedthroughproperties';\nimport getSubNodes from './utils/getsubnodes';\nconst mainQueueId = Symbol('MainQueueId');\n/**\n * A watchdog for the {@link module:core/context~Context} class.\n *\n * See the {@glink features/watchdog Watchdog feature guide} to learn the rationale behind it and\n * how to use it.\n */\nexport default class ContextWatchdog extends Watchdog {\n /**\n * The context watchdog class constructor.\n *\n * ```ts\n * const watchdog = new ContextWatchdog( Context );\n *\n * await watchdog.create( contextConfiguration );\n *\n * await watchdog.add( item );\n * ```\n *\n * See the {@glink features/watchdog Watchdog feature guide} to learn more how to use this feature.\n *\n * @param Context The {@link module:core/context~Context} class.\n * @param watchdogConfig The watchdog configuration.\n */\n constructor(Context, watchdogConfig = {}) {\n super(watchdogConfig);\n /**\n * A map of internal watchdogs for added items.\n */\n this._watchdogs = new Map();\n /**\n * The current context instance.\n */\n this._context = null;\n /**\n * Context properties (nodes/references) that are gathered during the initial context creation\n * and are used to distinguish the origin of an error.\n */\n this._contextProps = new Set();\n /**\n * An action queue, which is used to handle async functions queuing.\n */\n this._actionQueues = new ActionQueues();\n this._watchdogConfig = watchdogConfig;\n // Default creator and destructor.\n this._creator = contextConfig => Context.create(contextConfig);\n this._destructor = context => context.destroy();\n this._actionQueues.onEmpty(() => {\n if (this.state === 'initializing') {\n this.state = 'ready';\n this._fire('stateChange');\n }\n });\n }\n /**\n * Sets the function that is responsible for the context creation.\n * It expects a function that should return a promise (or `undefined`).\n *\n * ```ts\n * watchdog.setCreator( config => Context.create( config ) );\n * ```\n */\n setCreator(creator) {\n this._creator = creator;\n }\n /**\n * Sets the function that is responsible for the context destruction.\n * Overrides the default destruction function, which destroys only the context instance.\n * It expects a function that should return a promise (or `undefined`).\n *\n * ```ts\n * watchdog.setDestructor( context => {\n * \t// Do something before the context is destroyed.\n *\n * \treturn context\n * \t\t.destroy()\n * \t\t.then( () => {\n * \t\t\t// Do something after the context is destroyed.\n * \t\t} );\n * } );\n * ```\n */\n setDestructor(destructor) {\n this._destructor = destructor;\n }\n /**\n * The context instance. Keep in mind that this property might be changed when the context watchdog restarts,\n * so do not keep this instance internally. Always operate on the `ContextWatchdog#context` property.\n */\n get context() {\n return this._context;\n }\n /**\n * Initializes the context watchdog. Once it is created, the watchdog takes care about\n * recreating the context and the provided items, and starts the error handling mechanism.\n *\n * ```ts\n * await watchdog.create( {\n * \tplugins: []\n * } );\n * ```\n *\n * @param contextConfig The context configuration. See {@link module:core/context~Context}.\n */\n create(contextConfig = {}) {\n return this._actionQueues.enqueue(mainQueueId, () => {\n this._contextConfig = contextConfig;\n return this._create();\n });\n }\n /**\n * Returns an item instance with the given `itemId`.\n *\n * ```ts\n * const editor1 = watchdog.getItem( 'editor1' );\n * ```\n *\n * @param itemId The item ID.\n * @returns The item instance or `undefined` if an item with a given ID has not been found.\n */\n getItem(itemId) {\n const watchdog = this._getWatchdog(itemId);\n return watchdog._item;\n }\n /**\n * Gets the state of the given item. See {@link #state} for a list of available states.\n *\n * ```ts\n * const editor1State = watchdog.getItemState( 'editor1' );\n * ```\n *\n * @param itemId Item ID.\n * @returns The state of the item.\n */\n getItemState(itemId) {\n const watchdog = this._getWatchdog(itemId);\n return watchdog.state;\n }\n /**\n * Adds items to the watchdog. Once created, instances of these items will be available using the {@link #getItem} method.\n *\n * Items can be passed together as an array of objects:\n *\n * ```ts\n * await watchdog.add( [ {\n * \tid: 'editor1',\n * \ttype: 'editor',\n * \tsourceElementOrData: document.querySelector( '#editor' ),\n * \tconfig: {\n * \t\tplugins: [ Essentials, Paragraph, Bold, Italic ],\n * \t\ttoolbar: [ 'bold', 'italic', 'alignment' ]\n * \t},\n * \tcreator: ( element, config ) => ClassicEditor.create( element, config )\n * } ] );\n * ```\n *\n * Or one by one as objects:\n *\n * ```ts\n * await watchdog.add( {\n * \tid: 'editor1',\n * \ttype: 'editor',\n * \tsourceElementOrData: document.querySelector( '#editor' ),\n * \tconfig: {\n * \t\tplugins: [ Essentials, Paragraph, Bold, Italic ],\n * \t\ttoolbar: [ 'bold', 'italic', 'alignment' ]\n * \t},\n * \tcreator: ( element, config ) => ClassicEditor.create( element, config )\n * ] );\n * ```\n *\n * Then an instance can be retrieved using the {@link #getItem} method:\n *\n * ```ts\n * const editor1 = watchdog.getItem( 'editor1' );\n * ```\n *\n * Note that this method can be called multiple times, but for performance reasons it is better\n * to pass all items together.\n *\n * @param itemConfigurationOrItemConfigurations An item configuration object or an array of item configurations.\n */\n add(itemConfigurationOrItemConfigurations) {\n const itemConfigurations = toArray(itemConfigurationOrItemConfigurations);\n return Promise.all(itemConfigurations.map(item => {\n return this._actionQueues.enqueue(item.id, () => {\n if (this.state === 'destroyed') {\n throw new Error('Cannot add items to destroyed watchdog.');\n }\n if (!this._context) {\n throw new Error('Context was not created yet. You should call the `ContextWatchdog#create()` method first.');\n }\n let watchdog;\n if (this._watchdogs.has(item.id)) {\n throw new Error(`Item with the given id is already added: '${item.id}'.`);\n }\n if (item.type === 'editor') {\n watchdog = new EditorWatchdog(null, this._watchdogConfig);\n watchdog.setCreator(item.creator);\n watchdog._setExcludedProperties(this._contextProps);\n if (item.destructor) {\n watchdog.setDestructor(item.destructor);\n }\n this._watchdogs.set(item.id, watchdog);\n // Enqueue the internal watchdog errors within the main queue.\n // And propagate the internal `error` events as `itemError` event.\n watchdog.on('error', (evt, { error, causesRestart }) => {\n this._fire('itemError', { itemId: item.id, error });\n // Do not enqueue the item restart action if the item will not restart.\n if (!causesRestart) {\n return;\n }\n this._actionQueues.enqueue(item.id, () => new Promise(res => {\n const rethrowRestartEventOnce = () => {\n watchdog.off('restart', rethrowRestartEventOnce);\n this._fire('itemRestart', { itemId: item.id });\n res();\n };\n watchdog.on('restart', rethrowRestartEventOnce);\n }));\n });\n return watchdog.create(item.sourceElementOrData, item.config, this._context);\n }\n else {\n throw new Error(`Not supported item type: '${item.type}'.`);\n }\n });\n }));\n }\n /**\n * Removes and destroys item(s) with given ID(s).\n *\n * ```ts\n * await watchdog.remove( 'editor1' );\n * ```\n *\n * Or\n *\n * ```ts\n * await watchdog.remove( [ 'editor1', 'editor2' ] );\n * ```\n *\n * @param itemIdOrItemIds Item ID or an array of item IDs.\n */\n remove(itemIdOrItemIds) {\n const itemIds = toArray(itemIdOrItemIds);\n return Promise.all(itemIds.map(itemId => {\n return this._actionQueues.enqueue(itemId, () => {\n const watchdog = this._getWatchdog(itemId);\n this._watchdogs.delete(itemId);\n return watchdog.destroy();\n });\n }));\n }\n /**\n * Destroys the context watchdog and all added items.\n * Once the context watchdog is destroyed, new items cannot be added.\n *\n * ```ts\n * await watchdog.destroy();\n * ```\n */\n destroy() {\n return this._actionQueues.enqueue(mainQueueId, () => {\n this.state = 'destroyed';\n this._fire('stateChange');\n super.destroy();\n return this._destroy();\n });\n }\n /**\n * Restarts the context watchdog.\n */\n _restart() {\n return this._actionQueues.enqueue(mainQueueId, () => {\n this.state = 'initializing';\n this._fire('stateChange');\n return this._destroy()\n .catch(err => {\n console.error('An error happened during destroying the context or items.', err);\n })\n .then(() => this._create())\n .then(() => this._fire('restart'));\n });\n }\n /**\n * Initializes the context watchdog.\n */\n _create() {\n return Promise.resolve()\n .then(() => {\n this._startErrorHandling();\n return this._creator(this._contextConfig);\n })\n .then(context => {\n this._context = context;\n this._contextProps = getSubNodes(this._context);\n return Promise.all(Array.from(this._watchdogs.values())\n .map(watchdog => {\n watchdog._setExcludedProperties(this._contextProps);\n return watchdog.create(undefined, undefined, this._context);\n }));\n });\n }\n /**\n * Destroys the context instance and all added items.\n */\n _destroy() {\n return Promise.resolve()\n .then(() => {\n this._stopErrorHandling();\n const context = this._context;\n this._context = null;\n this._contextProps = new Set();\n return Promise.all(Array.from(this._watchdogs.values())\n .map(watchdog => watchdog.destroy()))\n // Context destructor destroys each editor.\n .then(() => this._destructor(context));\n });\n }\n /**\n * Returns the watchdog for a given item ID.\n *\n * @param itemId Item ID.\n */\n _getWatchdog(itemId) {\n const watchdog = this._watchdogs.get(itemId);\n if (!watchdog) {\n throw new Error(`Item with the given id was not registered: ${itemId}.`);\n }\n return watchdog;\n }\n /**\n * Checks whether an error comes from the context instance and not from the item instances.\n *\n * @internal\n */\n _isErrorComingFromThisItem(error) {\n for (const watchdog of this._watchdogs.values()) {\n if (watchdog._isErrorComingFromThisItem(error)) {\n return false;\n }\n }\n return areConnectedThroughProperties(this._context, error.context);\n }\n}\n/**\n * Manager of action queues that allows queuing async functions.\n */\nclass ActionQueues {\n constructor() {\n this._onEmptyCallbacks = [];\n this._queues = new Map();\n this._activeActions = 0;\n }\n /**\n * Used to register callbacks that will be run when the queue becomes empty.\n *\n * @param onEmptyCallback A callback that will be run whenever the queue becomes empty.\n */\n onEmpty(onEmptyCallback) {\n this._onEmptyCallbacks.push(onEmptyCallback);\n }\n /**\n * It adds asynchronous actions (functions) to the proper queue and runs them one by one.\n *\n * @param queueId The action queue ID.\n * @param action A function that should be enqueued.\n */\n enqueue(queueId, action) {\n const isMainAction = queueId === mainQueueId;\n this._activeActions++;\n if (!this._queues.get(queueId)) {\n this._queues.set(queueId, Promise.resolve());\n }\n // List all sources of actions that the current action needs to await for.\n // For the main action wait for all other actions.\n // For the item action wait only for the item queue and the main queue.\n const awaitedActions = isMainAction ?\n Promise.all(this._queues.values()) :\n Promise.all([this._queues.get(mainQueueId), this._queues.get(queueId)]);\n const queueWithAction = awaitedActions.then(action);\n // Catch all errors in the main queue to stack promises even if an error occurred in the past.\n const nonErrorQueue = queueWithAction.catch(() => { });\n this._queues.set(queueId, nonErrorQueue);\n return queueWithAction.finally(() => {\n this._activeActions--;\n if (this._queues.get(queueId) === nonErrorQueue && this._activeActions === 0) {\n this._onEmptyCallbacks.forEach(cb => cb());\n }\n });\n }\n}\n/**\n * Transforms any value to an array. If the provided value is already an array, it is returned unchanged.\n *\n * @param elementOrArray The value to transform to an array.\n * @returns An array created from data.\n */\nfunction toArray(elementOrArray) {\n return Array.isArray(elementOrArray) ? elementOrArray : [elementOrArray];\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module editor-classic/classiceditor\n */\nimport ClassicEditorUI from './classiceditorui';\nimport ClassicEditorUIView from './classiceditoruiview';\nimport { Editor, Context, DataApiMixin, ElementApiMixin, attachToForm } from 'ckeditor5/src/core';\nimport { getDataFromElement, CKEditorError } from 'ckeditor5/src/utils';\nimport { ContextWatchdog, EditorWatchdog } from 'ckeditor5/src/watchdog';\nimport { isElement as _isElement } from 'lodash-es';\n/**\n * The {@glink installation/getting-started/predefined-builds#classic-editor classic editor} implementation.\n * It uses an inline editable and a sticky toolbar, all enclosed in a boxed UI.\n * See the {@glink examples/builds/classic-editor demo}.\n *\n * In order to create a classic editor instance, use the static\n * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`} method.\n *\n * # Classic editor and classic build\n *\n * The classic editor can be used directly from source (if you installed the\n * [`@ckeditor/ckeditor5-editor-classic`](https://www.npmjs.com/package/@ckeditor/ckeditor5-editor-classic) package)\n * but it is also available in the {@glink installation/getting-started/predefined-builds#classic-editor classic build}.\n *\n * {@glink installation/getting-started/predefined-builds Builds}\n * are ready-to-use editors with plugins bundled in. When using the editor from\n * source you need to take care of loading all plugins by yourself\n * (through the {@link module:core/editor/editorconfig~EditorConfig#plugins `config.plugins`} option).\n * Using the editor from source gives much better flexibility and allows easier customization.\n *\n * Read more about initializing the editor from source or as a build in\n * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}.\n */\nexport default class ClassicEditor extends DataApiMixin(ElementApiMixin(Editor)) {\n /**\n * Creates an instance of the classic editor.\n *\n * **Note:** do not use the constructor to create editor instances. Use the static\n * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`} method instead.\n *\n * @param sourceElementOrData The DOM element that will be the source for the created editor\n * or the editor's initial data. For more information see\n * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}.\n * @param config The editor configuration.\n */\n constructor(sourceElementOrData, config = {}) {\n // If both `config.initialData` is set and initial data is passed as the constructor parameter, then throw.\n if (!isElement(sourceElementOrData) && config.initialData !== undefined) {\n // Documented in core/editor/editorconfig.jsdoc.\n // eslint-disable-next-line ckeditor5-rules/ckeditor-error-message\n throw new CKEditorError('editor-create-initial-data', null);\n }\n super(config);\n if (this.config.get('initialData') === undefined) {\n this.config.set('initialData', getInitialData(sourceElementOrData));\n }\n if (isElement(sourceElementOrData)) {\n this.sourceElement = sourceElementOrData;\n }\n this.model.document.createRoot();\n const shouldToolbarGroupWhenFull = !this.config.get('toolbar.shouldNotGroupWhenFull');\n const view = new ClassicEditorUIView(this.locale, this.editing.view, {\n shouldToolbarGroupWhenFull\n });\n this.ui = new ClassicEditorUI(this, view);\n attachToForm(this);\n }\n /**\n * Destroys the editor instance, releasing all resources used by it.\n *\n * Updates the original editor element with the data if the\n * {@link module:core/editor/editorconfig~EditorConfig#updateSourceElementOnDestroy `updateSourceElementOnDestroy`}\n * configuration option is set to `true`.\n */\n destroy() {\n if (this.sourceElement) {\n this.updateSourceElement();\n }\n this.ui.destroy();\n return super.destroy();\n }\n /**\n * Creates a new classic editor instance.\n *\n * There are three ways how the editor can be initialized.\n *\n * # Replacing a DOM element (and loading data from it)\n *\n * You can initialize the editor using an existing DOM element:\n *\n * ```ts\n * ClassicEditor\n * \t.create( document.querySelector( '#editor' ) )\n * \t.then( editor => {\n * \t\tconsole.log( 'Editor was initialized', editor );\n * \t} )\n * \t.catch( err => {\n * \t\tconsole.error( err.stack );\n * \t} );\n * ```\n *\n * The element's content will be used as the editor data and the element will be replaced by the editor UI.\n *\n * # Creating a detached editor\n *\n * Alternatively, you can initialize the editor by passing the initial data directly as a string.\n * In this case, the editor will render an element that must be inserted into the DOM:\n *\n * ```ts\n * ClassicEditor\n * \t.create( '<p>Hello world!</p>' )\n * \t.then( editor => {\n * \t\tconsole.log( 'Editor was initialized', editor );\n *\n * \t\t// Initial data was provided so the editor UI element needs to be added manually to the DOM.\n * \t\tdocument.body.appendChild( editor.ui.element );\n * \t} )\n * \t.catch( err => {\n * \t\tconsole.error( err.stack );\n * \t} );\n * ```\n *\n * This lets you dynamically append the editor to your web page whenever it is convenient for you. You may use this method if your\n * web page content is generated on the client side and the DOM structure is not ready at the moment when you initialize the editor.\n *\n * # Replacing a DOM element (and data provided in `config.initialData`)\n *\n * You can also mix these two ways by providing a DOM element to be used and passing the initial data through the configuration:\n *\n * ```ts\n * ClassicEditor\n * \t.create( document.querySelector( '#editor' ), {\n * \t\tinitialData: '<h2>Initial data</h2><p>Foo bar.</p>'\n * \t} )\n * \t.then( editor => {\n * \t\tconsole.log( 'Editor was initialized', editor );\n * \t} )\n * \t.catch( err => {\n * \t\tconsole.error( err.stack );\n * \t} );\n * ```\n *\n * This method can be used to initialize the editor on an existing element with the specified content in case if your integration\n * makes it difficult to set the content of the source element.\n *\n * Note that an error will be thrown if you pass the initial data both as the first parameter and also in the configuration.\n *\n * # Configuring the editor\n *\n * See the {@link module:core/editor/editorconfig~EditorConfig editor configuration documentation} to learn more about\n * customizing plugins, toolbar and more.\n *\n * # Using the editor from source\n *\n * The code samples listed in the previous sections of this documentation assume that you are using an\n * {@glink installation/getting-started/predefined-builds editor build} (for example `@ckeditor/ckeditor5-build-classic`).\n *\n * If you want to use the classic editor from source (`@ckeditor/ckeditor5-editor-classic/src/classiceditor`),\n * you need to define the list of\n * {@link module:core/editor/editorconfig~EditorConfig#plugins plugins to be initialized} and\n * {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar items}. Read more about using the editor from\n * source in the {@glink installation/advanced/alternative-setups/integrating-from-source-webpack dedicated guide}.\n *\n * @param sourceElementOrData The DOM element that will be the source for the created editor\n * or the editor's initial data.\n *\n * If a DOM element is passed, its content will be automatically loaded to the editor upon initialization\n * and the {@link module:editor-classic/classiceditorui~ClassicEditorUI#element editor element} will replace the passed element\n * in the DOM (the original one will be hidden and the editor will be injected next to it).\n *\n * If the {@link module:core/editor/editorconfig~EditorConfig#updateSourceElementOnDestroy updateSourceElementOnDestroy}\n * option is set to `true`, the editor data will be set back to the original element once the editor is destroyed and when a form,\n * in which this element is contained, is submitted (if the original element is a `<textarea>`). This ensures seamless integration\n * with native web forms.\n *\n * If the initial data is passed, a detached editor will be created. In this case you need to insert it into the DOM manually.\n * It is available under the {@link module:editor-classic/classiceditorui~ClassicEditorUI#element `editor.ui.element`} property.\n *\n * @param config The editor configuration.\n * @returns A promise resolved once the editor is ready. The promise resolves with the created editor instance.\n */\n static create(sourceElementOrData, config = {}) {\n return new Promise(resolve => {\n const editor = new this(sourceElementOrData, config);\n resolve(editor.initPlugins()\n .then(() => editor.ui.init(isElement(sourceElementOrData) ? sourceElementOrData : null))\n .then(() => editor.data.init(editor.config.get('initialData')))\n .then(() => editor.fire('ready'))\n .then(() => editor));\n });\n }\n}\n/**\n * The {@link module:core/context~Context} class.\n *\n * Exposed as static editor field for easier access in editor builds.\n */\nClassicEditor.Context = Context;\n/**\n * The {@link module:watchdog/editorwatchdog~EditorWatchdog} class.\n *\n * Exposed as static editor field for easier access in editor builds.\n */\nClassicEditor.EditorWatchdog = EditorWatchdog;\n/**\n * The {@link module:watchdog/contextwatchdog~ContextWatchdog} class.\n *\n * Exposed as static editor field for easier access in editor builds.\n */\nClassicEditor.ContextWatchdog = ContextWatchdog;\nfunction getInitialData(sourceElementOrData) {\n return isElement(sourceElementOrData) ? getDataFromElement(sourceElementOrData) : sourceElementOrData;\n}\nfunction isElement(value) {\n return _isElement(value);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* globals HTMLTextAreaElement */\n/**\n * @module utils/dom/getdatafromelement\n */\n/**\n * Gets data from a given source element.\n *\n * @param el The element from which the data will be retrieved.\n * @returns The data string.\n */\nexport default function getDataFromElement(el) {\n if (el instanceof HTMLTextAreaElement) {\n return el.value;\n }\n return el.innerHTML;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/editor/utils/attachtoform\n */\nimport { isFunction } from 'lodash-es';\nimport { CKEditorError } from '@ckeditor/ckeditor5-utils';\n/**\n * Checks if the editor is initialized on a `<textarea>` element that belongs to a form. If yes, it updates the editor's element\n * content before submitting the form.\n *\n * This helper requires the {@link module:core/editor/utils/elementapimixin~ElementApi ElementApi interface}.\n *\n * @param editor Editor instance.\n */\nexport default function attachToForm(editor) {\n if (!isFunction(editor.updateSourceElement)) {\n /**\n * The editor passed to `attachToForm()` must implement the\n * {@link module:core/editor/utils/elementapimixin~ElementApi} interface.\n *\n * @error attachtoform-missing-elementapi-interface\n */\n throw new CKEditorError('attachtoform-missing-elementapi-interface', editor);\n }\n const sourceElement = editor.sourceElement;\n // Only when replacing a textarea which is inside of a form element.\n if (isTextArea(sourceElement) && sourceElement.form) {\n let originalSubmit;\n const form = sourceElement.form;\n const onSubmit = () => editor.updateSourceElement();\n // Replace the original form#submit() to call a custom submit function first.\n // Check if #submit is a function because the form might have an input named \"submit\".\n if (isFunction(form.submit)) {\n originalSubmit = form.submit;\n form.submit = () => {\n onSubmit();\n originalSubmit.apply(form);\n };\n }\n // Update the replaced textarea with data before each form#submit event.\n form.addEventListener('submit', onSubmit);\n // Remove the submit listener and revert the original submit method on\n // editor#destroy.\n editor.on('destroy', () => {\n form.removeEventListener('submit', onSubmit);\n if (originalSubmit) {\n form.submit = originalSubmit;\n }\n });\n }\n}\nfunction isTextArea(sourceElement) {\n return !!sourceElement && sourceElement.tagName.toLowerCase() === 'textarea';\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { CKEditorError, logWarning } from 'ckeditor5/src/utils';\n/**\n * @module alignment/utils\n */\n/**\n * The list of supported alignment options:\n *\n * * `'left'`,\n * * `'right'`,\n * * `'center'`,\n * * `'justify'`\n */\nexport const supportedOptions = ['left', 'right', 'center', 'justify'];\n/**\n * Checks whether the passed option is supported by {@link module:alignment/alignmentediting~AlignmentEditing}.\n *\n * @param option The option value to check.\n */\nexport function isSupported(option) {\n return supportedOptions.includes(option);\n}\n/**\n * Checks whether alignment is the default one considering the direction\n * of the editor content.\n *\n * @param alignment The name of the alignment to check.\n * @param locale The {@link module:core/editor/editor~Editor#locale} instance.\n */\nexport function isDefault(alignment, locale) {\n // Right now only LTR is supported so the 'left' value is always the default one.\n if (locale.contentLanguageDirection == 'rtl') {\n return alignment === 'right';\n }\n else {\n return alignment === 'left';\n }\n}\n/**\n * Brings the configuration to the common form, an array of objects.\n *\n * @param configuredOptions Alignment plugin configuration.\n * @returns Normalized object holding the configuration.\n */\nexport function normalizeAlignmentOptions(configuredOptions) {\n const normalizedOptions = configuredOptions\n .map(option => {\n let result;\n if (typeof option == 'string') {\n result = { name: option };\n }\n else {\n result = option;\n }\n return result;\n })\n // Remove all unknown options.\n .filter(option => {\n const isNameValid = supportedOptions.includes(option.name);\n if (!isNameValid) {\n /**\n * The `name` in one of the `alignment.options` is not recognized.\n * The available options are: `'left'`, `'right'`, `'center'` and `'justify'`.\n *\n * @error alignment-config-name-not-recognized\n * @param option Options with unknown value of the `name` property.\n */\n logWarning('alignment-config-name-not-recognized', { option });\n }\n return isNameValid;\n });\n const classNameCount = normalizedOptions.filter(option => Boolean(option.className)).length;\n // We either use classes for all styling options or for none.\n if (classNameCount && classNameCount < normalizedOptions.length) {\n /**\n * The `className` property has to be defined for all options once at least one option declares `className`.\n *\n * @error alignment-config-classnames-are-missing\n * @param configuredOptions Contents of `alignment.options`.\n */\n throw new CKEditorError('alignment-config-classnames-are-missing', { configuredOptions });\n }\n // Validate resulting config.\n normalizedOptions.forEach((option, index, allOptions) => {\n const succeedingOptions = allOptions.slice(index + 1);\n const nameAlreadyExists = succeedingOptions.some(item => item.name == option.name);\n if (nameAlreadyExists) {\n /**\n * The same `name` in one of the `alignment.options` was already declared.\n * Each `name` representing one alignment option can be set exactly once.\n *\n * @error alignment-config-name-already-defined\n * @param option First option that declares given `name`.\n * @param configuredOptions Contents of `alignment.options`.\n */\n throw new CKEditorError('alignment-config-name-already-defined', { option, configuredOptions });\n }\n // The `className` property is present. Check for duplicates then.\n if (option.className) {\n const classNameAlreadyExists = succeedingOptions.some(item => item.className == option.className);\n if (classNameAlreadyExists) {\n /**\n * The same `className` in one of the `alignment.options` was already declared.\n *\n * @error alignment-config-classname-already-defined\n * @param option First option that declares given `className`.\n * @param configuredOptions\n * Contents of `alignment.options`.\n */\n throw new CKEditorError('alignment-config-classname-already-defined', { option, configuredOptions });\n }\n }\n });\n return normalizedOptions;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module alignment/alignmentcommand\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { first } from 'ckeditor5/src/utils';\nimport { isDefault } from './utils';\nconst ALIGNMENT = 'alignment';\n/**\n * The alignment command plugin.\n */\nexport default class AlignmentCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const editor = this.editor;\n const locale = editor.locale;\n const firstBlock = first(this.editor.model.document.selection.getSelectedBlocks());\n // As first check whether to enable or disable the command as the value will always be false if the command cannot be enabled.\n this.isEnabled = Boolean(firstBlock) && this._canBeAligned(firstBlock);\n if (this.isEnabled && firstBlock.hasAttribute('alignment')) {\n this.value = firstBlock.getAttribute('alignment');\n }\n else {\n this.value = locale.contentLanguageDirection === 'rtl' ? 'right' : 'left';\n }\n }\n /**\n * Executes the command. Applies the alignment `value` to the selected blocks.\n * If no `value` is passed, the `value` is the default one or it is equal to the currently selected block's alignment attribute,\n * the command will remove the attribute from the selected blocks.\n *\n * @param options Options for the executed command.\n * @param options.value The value to apply.\n * @fires execute\n */\n execute(options = {}) {\n const editor = this.editor;\n const locale = editor.locale;\n const model = editor.model;\n const doc = model.document;\n const value = options.value;\n model.change(writer => {\n // Get only those blocks from selected that can have alignment set\n const blocks = Array.from(doc.selection.getSelectedBlocks()).filter(block => this._canBeAligned(block));\n const currentAlignment = blocks[0].getAttribute('alignment');\n // Remove alignment attribute if current alignment is:\n // - default (should not be stored in model as it will bloat model data)\n // - equal to currently set\n // - or no value is passed - denotes default alignment.\n const removeAlignment = isDefault(value, locale) || currentAlignment === value || !value;\n if (removeAlignment) {\n removeAlignmentFromSelection(blocks, writer);\n }\n else {\n setAlignmentOnSelection(blocks, writer, value);\n }\n });\n }\n /**\n * Checks whether a block can have alignment set.\n *\n * @param block The block to be checked.\n */\n _canBeAligned(block) {\n return this.editor.model.schema.checkAttribute(block, ALIGNMENT);\n }\n}\n/**\n * Removes the alignment attribute from blocks.\n */\nfunction removeAlignmentFromSelection(blocks, writer) {\n for (const block of blocks) {\n writer.removeAttribute(ALIGNMENT, block);\n }\n}\n/**\n * Sets the alignment attribute on blocks.\n */\nfunction setAlignmentOnSelection(blocks, writer, alignment) {\n for (const block of blocks) {\n writer.setAttribute(ALIGNMENT, alignment, block);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module alignment/alignmentediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport AlignmentCommand from './alignmentcommand';\nimport { isDefault, isSupported, normalizeAlignmentOptions, supportedOptions } from './utils';\n/**\n * The alignment editing feature. It introduces the {@link module:alignment/alignmentcommand~AlignmentCommand command} and adds\n * the `alignment` attribute for block elements in the {@link module:engine/model/model~Model model}.\n */\nexport default class AlignmentEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'AlignmentEditing';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n editor.config.define('alignment', {\n options: supportedOptions.map(option => ({ name: option }))\n });\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const locale = editor.locale;\n const schema = editor.model.schema;\n const options = normalizeAlignmentOptions(editor.config.get('alignment.options'));\n // Filter out unsupported options and those that are redundant, e.g. `left` in LTR / `right` in RTL mode.\n const optionsToConvert = options.filter(option => isSupported(option.name) && !isDefault(option.name, locale));\n // Once there is at least one `className` defined, we switch to alignment with classes.\n const shouldUseClasses = optionsToConvert.some(option => !!option.className);\n // Allow alignment attribute on all blocks.\n schema.extend('$block', { allowAttributes: 'alignment' });\n editor.model.schema.setAttributeProperties('alignment', { isFormatting: true });\n if (shouldUseClasses) {\n editor.conversion.attributeToAttribute(buildClassDefinition(optionsToConvert));\n }\n else {\n // Downcast inline styles.\n editor.conversion.for('downcast').attributeToAttribute(buildDowncastInlineDefinition(optionsToConvert));\n }\n const upcastInlineDefinitions = buildUpcastInlineDefinitions(optionsToConvert);\n // Always upcast from inline styles.\n for (const definition of upcastInlineDefinitions) {\n editor.conversion.for('upcast').attributeToAttribute(definition);\n }\n const upcastCompatibilityDefinitions = buildUpcastCompatibilityDefinitions(optionsToConvert);\n // Always upcast from deprecated `align` attribute.\n for (const definition of upcastCompatibilityDefinitions) {\n editor.conversion.for('upcast').attributeToAttribute(definition);\n }\n editor.commands.add('alignment', new AlignmentCommand(editor));\n }\n}\n/**\n * Prepare downcast conversion definition for inline alignment styling.\n */\nfunction buildDowncastInlineDefinition(options) {\n const view = {};\n for (const { name } of options) {\n view[name] = {\n key: 'style',\n value: {\n 'text-align': name\n }\n };\n }\n const definition = {\n model: {\n key: 'alignment',\n values: options.map(option => option.name)\n },\n view\n };\n return definition;\n}\n/**\n * Prepare upcast definitions for inline alignment styles.\n */\nfunction buildUpcastInlineDefinitions(options) {\n const definitions = [];\n for (const { name } of options) {\n definitions.push({\n view: {\n key: 'style',\n value: {\n 'text-align': name\n }\n },\n model: {\n key: 'alignment',\n value: name\n }\n });\n }\n return definitions;\n}\n/**\n * Prepare upcast definitions for deprecated `align` attribute.\n */\nfunction buildUpcastCompatibilityDefinitions(options) {\n const definitions = [];\n for (const { name } of options) {\n definitions.push({\n view: {\n key: 'align',\n value: name\n },\n model: {\n key: 'alignment',\n value: name\n }\n });\n }\n return definitions;\n}\n/**\n * Prepare conversion definitions for upcast and downcast alignment with classes.\n */\nfunction buildClassDefinition(options) {\n const view = {};\n for (const option of options) {\n view[option.name] = {\n key: 'class',\n value: option.className\n };\n }\n const definition = {\n model: {\n key: 'alignment',\n values: options.map(option => option.name)\n },\n view\n };\n return definition;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module alignment/alignmentui\n */\nimport { Plugin, icons } from 'ckeditor5/src/core';\nimport { ButtonView, createDropdown, addToolbarToDropdown } from 'ckeditor5/src/ui';\nimport { isSupported, normalizeAlignmentOptions } from './utils';\nconst iconsMap = new Map([\n ['left', icons.alignLeft],\n ['right', icons.alignRight],\n ['center', icons.alignCenter],\n ['justify', icons.alignJustify]\n]);\n/**\n * The default alignment UI plugin.\n *\n * It introduces the `'alignment:left'`, `'alignment:right'`, `'alignment:center'` and `'alignment:justify'` buttons\n * and the `'alignment'` dropdown.\n */\nexport default class AlignmentUI extends Plugin {\n /**\n * Returns the localized option titles provided by the plugin.\n *\n * The following localized titles corresponding with\n * {@link module:alignment/alignmentconfig~AlignmentConfig#options} are available:\n *\n * * `'left'`,\n * * `'right'`,\n * * `'center'`,\n * * `'justify'`.\n *\n * @readonly\n */\n get localizedOptionTitles() {\n const t = this.editor.t;\n return {\n 'left': t('Align left'),\n 'right': t('Align right'),\n 'center': t('Align center'),\n 'justify': t('Justify')\n };\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'AlignmentUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const componentFactory = editor.ui.componentFactory;\n const t = editor.t;\n const options = normalizeAlignmentOptions(editor.config.get('alignment.options'));\n options\n .map(option => option.name)\n .filter(isSupported)\n .forEach(option => this._addButton(option));\n componentFactory.add('alignment', locale => {\n const dropdownView = createDropdown(locale);\n // Add existing alignment buttons to dropdown's toolbar.\n addToolbarToDropdown(dropdownView, () => options.map(option => componentFactory.create(`alignment:${option.name}`)), {\n enableActiveItemFocusOnDropdownOpen: true,\n isVertical: true,\n ariaLabel: t('Text alignment toolbar')\n });\n // Configure dropdown properties an behavior.\n dropdownView.buttonView.set({\n label: t('Text alignment'),\n tooltip: true\n });\n dropdownView.extendTemplate({\n attributes: {\n class: 'ck-alignment-dropdown'\n }\n });\n // The default icon depends on the direction of the content.\n const defaultIcon = locale.contentLanguageDirection === 'rtl' ? iconsMap.get('right') : iconsMap.get('left');\n const command = editor.commands.get('alignment');\n // Change icon to reflect current selection's alignment.\n dropdownView.buttonView.bind('icon').to(command, 'value', value => iconsMap.get(value) || defaultIcon);\n // Enable button if any of the buttons is enabled.\n dropdownView.bind('isEnabled').to(command, 'isEnabled');\n // Focus the editable after executing the command.\n // Overrides a default behaviour where the focus is moved to the dropdown button (#12125).\n this.listenTo(dropdownView, 'execute', () => {\n editor.editing.view.focus();\n });\n return dropdownView;\n });\n }\n /**\n * Helper method for initializing the button and linking it with an appropriate command.\n *\n * @param option The name of the alignment option for which the button is added.\n */\n _addButton(option) {\n const editor = this.editor;\n editor.ui.componentFactory.add(`alignment:${option}`, locale => {\n const command = editor.commands.get('alignment');\n const buttonView = new ButtonView(locale);\n buttonView.set({\n label: this.localizedOptionTitles[option],\n icon: iconsMap.get(option),\n tooltip: true,\n isToggleable: true\n });\n // Bind button model to command.\n buttonView.bind('isEnabled').to(command);\n buttonView.bind('isOn').to(command, 'value', value => value === option);\n // Execute command.\n this.listenTo(buttonView, 'execute', () => {\n editor.execute('alignment', { value: option });\n editor.editing.view.focus();\n });\n return buttonView;\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/clipboardobserver\n */\nimport { EventInfo } from '@ckeditor/ckeditor5-utils';\nimport { DataTransfer, DomEventObserver } from '@ckeditor/ckeditor5-engine';\n/**\n * Clipboard events observer.\n *\n * Fires the following events:\n *\n * * {@link module:engine/view/document~Document#event:clipboardInput},\n * * {@link module:engine/view/document~Document#event:paste},\n * * {@link module:engine/view/document~Document#event:copy},\n * * {@link module:engine/view/document~Document#event:cut},\n * * {@link module:engine/view/document~Document#event:drop},\n * * {@link module:engine/view/document~Document#event:dragover},\n * * {@link module:engine/view/document~Document#event:dragging},\n * * {@link module:engine/view/document~Document#event:dragstart},\n * * {@link module:engine/view/document~Document#event:dragend},\n * * {@link module:engine/view/document~Document#event:dragenter},\n * * {@link module:engine/view/document~Document#event:dragleave}.\n *\n * **Note**: This observer is not available by default (ckeditor5-engine does not add it on its own).\n * To make it available, it needs to be added to {@link module:engine/view/document~Document} by using\n * the {@link module:engine/view/view~View#addObserver `View#addObserver()`} method. Alternatively, you can load the\n * {@link module:clipboard/clipboard~Clipboard} plugin which adds this observer automatically (because it uses it).\n */\nexport default class ClipboardObserver extends DomEventObserver {\n constructor(view) {\n super(view);\n this.domEventType = [\n 'paste', 'copy', 'cut', 'drop', 'dragover', 'dragstart', 'dragend', 'dragenter', 'dragleave'\n ];\n const viewDocument = this.document;\n this.listenTo(viewDocument, 'paste', handleInput('clipboardInput'), { priority: 'low' });\n this.listenTo(viewDocument, 'drop', handleInput('clipboardInput'), { priority: 'low' });\n this.listenTo(viewDocument, 'dragover', handleInput('dragging'), { priority: 'low' });\n function handleInput(type) {\n return (evt, data) => {\n data.preventDefault();\n const targetRanges = data.dropRange ? [data.dropRange] : null;\n const eventInfo = new EventInfo(viewDocument, type);\n viewDocument.fire(eventInfo, {\n dataTransfer: data.dataTransfer,\n method: evt.name,\n targetRanges,\n target: data.target,\n domEvent: data.domEvent\n });\n // If CKEditor handled the input, do not bubble the original event any further.\n // This helps external integrations recognize that fact and act accordingly.\n // https://github.com/ckeditor/ckeditor5-upload/issues/92\n if (eventInfo.stop.called) {\n data.stopPropagation();\n }\n };\n }\n }\n onDomEvent(domEvent) {\n const nativeDataTransfer = 'clipboardData' in domEvent ? domEvent.clipboardData : domEvent.dataTransfer;\n const cacheFiles = domEvent.type == 'drop' || domEvent.type == 'paste';\n const evtData = {\n dataTransfer: new DataTransfer(nativeDataTransfer, { cacheFiles })\n };\n if (domEvent.type == 'drop' || domEvent.type == 'dragover') {\n evtData.dropRange = getDropViewRange(this.view, domEvent);\n }\n this.fire(domEvent.type, domEvent, evtData);\n }\n}\nfunction getDropViewRange(view, domEvent) {\n const domDoc = domEvent.target.ownerDocument;\n const x = domEvent.clientX;\n const y = domEvent.clientY;\n let domRange;\n // Webkit & Blink.\n if (domDoc.caretRangeFromPoint && domDoc.caretRangeFromPoint(x, y)) {\n domRange = domDoc.caretRangeFromPoint(x, y);\n }\n // FF.\n else if (domEvent.rangeParent) {\n domRange = domDoc.createRange();\n domRange.setStart(domEvent.rangeParent, domEvent.rangeOffset);\n domRange.collapse(true);\n }\n if (domRange) {\n return view.domConverter.domRangeToView(domRange);\n }\n return null;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n// Elements which should not have empty-line padding.\n// Most `view.ContainerElement` want to be separate by new-line, but some are creating one structure\n// together (like `<li>`) so it is better to separate them by only one \"\\n\".\nconst smallPaddingElements = ['figcaption', 'li'];\n/**\n * Converts {@link module:engine/view/item~Item view item} and all of its children to plain text.\n *\n * @param viewItem View item to convert.\n * @returns Plain text representation of `viewItem`.\n */\nexport default function viewToPlainText(viewItem) {\n let text = '';\n if (viewItem.is('$text') || viewItem.is('$textProxy')) {\n // If item is `Text` or `TextProxy` simple take its text data.\n text = viewItem.data;\n }\n else if (viewItem.is('element', 'img') && viewItem.hasAttribute('alt')) {\n // Special case for images - use alt attribute if it is provided.\n text = viewItem.getAttribute('alt');\n }\n else if (viewItem.is('element', 'br')) {\n // A soft break should be converted into a single line break (#8045).\n text = '\\n';\n }\n else {\n // Other elements are document fragments, attribute elements or container elements.\n // They don't have their own text value, so convert their children.\n let prev = null;\n for (const child of viewItem.getChildren()) {\n const childText = viewToPlainText(child);\n // Separate container element children with one or more new-line characters.\n if (prev && (prev.is('containerElement') || child.is('containerElement'))) {\n if (smallPaddingElements.includes(prev.name) ||\n smallPaddingElements.includes(child.name)) {\n text += '\\n';\n }\n else {\n text += '\\n\\n';\n }\n }\n text += childText;\n prev = child;\n }\n }\n return text;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/clipboardpipeline\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { EventInfo } from '@ckeditor/ckeditor5-utils';\nimport ClipboardObserver from './clipboardobserver';\nimport plainTextToHtml from './utils/plaintexttohtml';\nimport normalizeClipboardHtml from './utils/normalizeclipboarddata';\nimport viewToPlainText from './utils/viewtoplaintext';\n// Input pipeline events overview:\n//\n// ┌──────────────────────┐ ┌──────────────────────┐\n// │ view.Document │ │ view.Document │\n// │ paste │ │ drop │\n// └───────────┬──────────┘ └───────────┬──────────┘\n// │ │\n// └────────────────┌────────────────┘\n// │\n// ┌─────────V────────┐\n// │ view.Document │ Retrieves text/html or text/plain from data.dataTransfer\n// │ clipboardInput │ and processes it to view.DocumentFragment.\n// └─────────┬────────┘\n// │\n// ┌───────────V───────────┐\n// │ ClipboardPipeline │ Converts view.DocumentFragment to model.DocumentFragment.\n// │ inputTransformation │\n// └───────────┬───────────┘\n// │\n// ┌──────────V──────────┐\n// │ ClipboardPipeline │ Calls model.insertContent().\n// │ contentInsertion │\n// └─────────────────────┘\n//\n//\n// Output pipeline events overview:\n//\n// ┌──────────────────────┐ ┌──────────────────────┐\n// │ view.Document │ │ view.Document │ Retrieves the selected model.DocumentFragment\n// │ copy │ │ cut │ and converts it to view.DocumentFragment.\n// └───────────┬──────────┘ └───────────┬──────────┘\n// │ │\n// └────────────────┌────────────────┘\n// │\n// ┌─────────V────────┐\n// │ view.Document │ Processes view.DocumentFragment to text/html and text/plain\n// │ clipboardOutput │ and stores the results in data.dataTransfer.\n// └──────────────────┘\n//\n/**\n * The clipboard pipeline feature. It is responsible for intercepting the `paste` and `drop` events and\n * passing the pasted content through a series of events in order to insert it into the editor's content.\n * It also handles the `cut` and `copy` events to fill the native clipboard with the serialized editor's data.\n *\n * # Input pipeline\n *\n * The behavior of the default handlers (all at a `low` priority):\n *\n * ## Event: `paste` or `drop`\n *\n * 1. Translates the event data.\n * 2. Fires the {@link module:engine/view/document~Document#event:clipboardInput `view.Document#clipboardInput`} event.\n *\n * ## Event: `view.Document#clipboardInput`\n *\n * 1. If the `data.content` event field is already set (by some listener on a higher priority), it takes this content and fires the event\n * from the last point.\n * 2. Otherwise, it retrieves `text/html` or `text/plain` from `data.dataTransfer`.\n * 3. Normalizes the raw data by applying simple filters on string data.\n * 4. Processes the raw data to {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`} with the\n * {@link module:engine/controller/datacontroller~DataController#htmlProcessor `DataController#htmlProcessor`}.\n * 5. Fires the {@link module:clipboard/clipboardpipeline~ClipboardPipeline#event:inputTransformation\n * `ClipboardPipeline#inputTransformation`} event with the view document fragment in the `data.content` event field.\n *\n * ## Event: `ClipboardPipeline#inputTransformation`\n *\n * 1. Converts {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`} from the `data.content` field to\n * {@link module:engine/model/documentfragment~DocumentFragment `model.DocumentFragment`}.\n * 2. Fires the {@link module:clipboard/clipboardpipeline~ClipboardPipeline#event:contentInsertion `ClipboardPipeline#contentInsertion`}\n * event with the model document fragment in the `data.content` event field.\n * **Note**: The `ClipboardPipeline#contentInsertion` event is fired within a model change block to allow other handlers\n * to run in the same block without post-fixers called in between (i.e., the selection post-fixer).\n *\n * ## Event: `ClipboardPipeline#contentInsertion`\n *\n * 1. Calls {@link module:engine/model/model~Model#insertContent `model.insertContent()`} to insert `data.content`\n * at the current selection position.\n *\n * # Output pipeline\n *\n * The behavior of the default handlers (all at a `low` priority):\n *\n * ## Event: `copy`, `cut` or `dragstart`\n *\n * 1. Retrieves the selected {@link module:engine/model/documentfragment~DocumentFragment `model.DocumentFragment`} by calling\n * {@link module:engine/model/model~Model#getSelectedContent `model#getSelectedContent()`}.\n * 2. Converts the model document fragment to {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`}.\n * 3. Fires the {@link module:engine/view/document~Document#event:clipboardOutput `view.Document#clipboardOutput`} event\n * with the view document fragment in the `data.content` event field.\n *\n * ## Event: `view.Document#clipboardOutput`\n *\n * 1. Processes `data.content` to HTML and plain text with the\n * {@link module:engine/controller/datacontroller~DataController#htmlProcessor `DataController#htmlProcessor`}.\n * 2. Updates the `data.dataTransfer` data for `text/html` and `text/plain` with the processed data.\n * 3. For the `cut` method, calls {@link module:engine/model/model~Model#deleteContent `model.deleteContent()`}\n * on the current selection.\n *\n * Read more about the clipboard integration in the {@glink framework/deep-dive/clipboard clipboard deep-dive} guide.\n */\nexport default class ClipboardPipeline extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ClipboardPipeline';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const view = editor.editing.view;\n view.addObserver(ClipboardObserver);\n this._setupPasteDrop();\n this._setupCopyCut();\n }\n /**\n * The clipboard paste pipeline.\n */\n _setupPasteDrop() {\n const editor = this.editor;\n const model = editor.model;\n const view = editor.editing.view;\n const viewDocument = view.document;\n // Pasting is disabled when selection is in non-editable place.\n // Dropping is disabled in drag and drop handler.\n this.listenTo(viewDocument, 'clipboardInput', (evt, data) => {\n if (data.method == 'paste' && !editor.model.canEditAt(editor.model.document.selection)) {\n evt.stop();\n }\n }, { priority: 'highest' });\n this.listenTo(viewDocument, 'clipboardInput', (evt, data) => {\n const dataTransfer = data.dataTransfer;\n let content;\n // Some feature could already inject content in the higher priority event handler (i.e., codeBlock).\n if (data.content) {\n content = data.content;\n }\n else {\n let contentData = '';\n if (dataTransfer.getData('text/html')) {\n contentData = normalizeClipboardHtml(dataTransfer.getData('text/html'));\n }\n else if (dataTransfer.getData('text/plain')) {\n contentData = plainTextToHtml(dataTransfer.getData('text/plain'));\n }\n content = this.editor.data.htmlProcessor.toView(contentData);\n }\n const eventInfo = new EventInfo(this, 'inputTransformation');\n this.fire(eventInfo, {\n content,\n dataTransfer,\n targetRanges: data.targetRanges,\n method: data.method\n });\n // If CKEditor handled the input, do not bubble the original event any further.\n // This helps external integrations recognize this fact and act accordingly.\n // https://github.com/ckeditor/ckeditor5-upload/issues/92\n if (eventInfo.stop.called) {\n evt.stop();\n }\n view.scrollToTheSelection();\n }, { priority: 'low' });\n this.listenTo(this, 'inputTransformation', (evt, data) => {\n if (data.content.isEmpty) {\n return;\n }\n const dataController = this.editor.data;\n // Convert the pasted content into a model document fragment.\n // The conversion is contextual, but in this case an \"all allowed\" context is needed\n // and for that we use the $clipboardHolder item.\n const modelFragment = dataController.toModel(data.content, '$clipboardHolder');\n if (modelFragment.childCount == 0) {\n return;\n }\n evt.stop();\n // Fire content insertion event in a single change block to allow other handlers to run in the same block\n // without post-fixers called in between (i.e., the selection post-fixer).\n model.change(() => {\n this.fire('contentInsertion', {\n content: modelFragment,\n method: data.method,\n dataTransfer: data.dataTransfer,\n targetRanges: data.targetRanges\n });\n });\n }, { priority: 'low' });\n this.listenTo(this, 'contentInsertion', (evt, data) => {\n data.resultRange = model.insertContent(data.content);\n }, { priority: 'low' });\n }\n /**\n * The clipboard copy/cut pipeline.\n */\n _setupCopyCut() {\n const editor = this.editor;\n const modelDocument = editor.model.document;\n const view = editor.editing.view;\n const viewDocument = view.document;\n const onCopyCut = (evt, data) => {\n const dataTransfer = data.dataTransfer;\n data.preventDefault();\n const content = editor.data.toView(editor.model.getSelectedContent(modelDocument.selection));\n viewDocument.fire('clipboardOutput', {\n dataTransfer,\n content,\n method: evt.name\n });\n };\n this.listenTo(viewDocument, 'copy', onCopyCut, { priority: 'low' });\n this.listenTo(viewDocument, 'cut', (evt, data) => {\n // Cutting is disabled when selection is in non-editable place.\n // See: https://github.com/ckeditor/ckeditor5-clipboard/issues/26.\n if (!editor.model.canEditAt(editor.model.document.selection)) {\n data.preventDefault();\n }\n else {\n onCopyCut(evt, data);\n }\n }, { priority: 'low' });\n this.listenTo(viewDocument, 'clipboardOutput', (evt, data) => {\n if (!data.content.isEmpty) {\n data.dataTransfer.setData('text/html', this.editor.data.htmlProcessor.toData(data.content));\n data.dataTransfer.setData('text/plain', viewToPlainText(data.content));\n }\n if (data.method == 'cut') {\n editor.model.deleteContent(modelDocument.selection);\n }\n }, { priority: 'low' });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/utils/normalizeclipboarddata\n */\n/**\n * Removes some popular browser quirks out of the clipboard data (HTML).\n * Removes all HTML comments. These are considered an internal thing and it makes little sense if they leak into the editor data.\n *\n * @param data The HTML data to normalize.\n * @returns Normalized HTML.\n */\nexport default function normalizeClipboardData(data) {\n return data\n .replace(/<span(?: class=\"Apple-converted-space\"|)>(\\s+)<\\/span>/g, (fullMatch, spaces) => {\n // Handle the most popular and problematic case when even a single space becomes an nbsp;.\n // Decode those to normal spaces. Read more in https://github.com/ckeditor/ckeditor5-clipboard/issues/2.\n if (spaces.length == 1) {\n return ' ';\n }\n return spaces;\n })\n // Remove all HTML comments.\n .replace(/<!--[\\s\\S]*?-->/g, '');\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/utils/plaintexttohtml\n */\n/**\n * Converts plain text to its HTML-ized version.\n *\n * @param text The plain text to convert.\n * @returns HTML generated from the plain text.\n */\nexport default function plainTextToHtml(text) {\n text = text\n // Encode <>.\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n // Creates a paragraph for each double line break.\n .replace(/\\r?\\n\\r?\\n/g, '</p><p>')\n // Creates a line break for each single line break.\n .replace(/\\r?\\n/g, '<br>')\n // Replace tabs with four spaces.\n .replace(/\\t/g, '&nbsp;&nbsp;&nbsp;&nbsp;')\n // Preserve trailing spaces (only the first and last one the rest is handled below).\n .replace(/^\\s/, '&nbsp;')\n .replace(/\\s$/, '&nbsp;')\n // Preserve other subsequent spaces now.\n .replace(/\\s\\s/g, ' &nbsp;');\n if (text.includes('</p><p>') || text.includes('<br>')) {\n // If we created paragraphs above, add the trailing ones.\n text = `<p>${text}</p>`;\n }\n // TODO:\n // * What about '\\nfoo' vs ' foo'?\n return text;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\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 * ```ts\n * const buffer = new ChangeBuffer( model, LIMIT );\n *\n * // Later on in your feature:\n * buffer.batch.insert( pos, insertedCharacters );\n * buffer.input( insertedCharacters.length );\n * ```\n */\nexport default class ChangeBuffer {\n /**\n * Creates a new instance of the change buffer.\n *\n * @param limit The maximum number of atomic changes which can be contained in one batch.\n */\n constructor(model, limit = 20) {\n /**\n * The current batch instance.\n */\n this._batch = null;\n this.model = model;\n this._size = 0;\n this.limit = limit;\n this._isLocked = false;\n // The function to be called in order to notify the buffer about batches which appeared in the document.\n // The callback will check whether it is a new batch and in that case the buffer will be flushed.\n //\n // The reason why the buffer needs to be flushed whenever a new batch appears is that the changes added afterwards\n // should be added to a new batch. For instance, when the user types, then inserts an image, and then types again,\n // the characters typed after inserting the image should be added to a different batch than the characters typed before.\n this._changeCallback = (evt, batch) => {\n if (batch.isLocal && batch.isUndoable && batch !== this._batch) {\n this._reset(true);\n }\n };\n this._selectionChangeCallback = () => {\n this._reset();\n };\n this.model.document.on('change', this._changeCallback);\n this.model.document.selection.on('change:range', this._selectionChangeCallback);\n this.model.document.selection.on('change:attribute', this._selectionChangeCallback);\n }\n /**\n * The current batch to which a feature should add its operations. Once the {@link #size}\n * is reached or exceeds the {@link #limit}, the batch is set to a new instance and the size is reset.\n */\n get batch() {\n if (!this._batch) {\n this._batch = this.model.createBatch({ isTyping: true });\n }\n return this._batch;\n }\n /**\n * The number of atomic changes in the buffer. Once it exceeds the {@link #limit},\n * the {@link #batch batch} is set to a new one.\n */\n get size() {\n return this._size;\n }\n /**\n * The input number of changes into the buffer. Once the {@link #size} is\n * reached or exceeds the {@link #limit}, the batch is set to a new instance and the size is reset.\n *\n * @param changeCount The number of atomic changes to input.\n */\n input(changeCount) {\n this._size += changeCount;\n if (this._size >= this.limit) {\n this._reset(true);\n }\n }\n /**\n * Whether the buffer is locked. A locked buffer cannot be reset unless it gets unlocked.\n */\n get isLocked() {\n return this._isLocked;\n }\n /**\n * Locks the buffer.\n */\n lock() {\n this._isLocked = true;\n }\n /**\n * Unlocks the buffer.\n */\n unlock() {\n this._isLocked = false;\n }\n /**\n * Destroys the buffer.\n */\n destroy() {\n this.model.document.off('change', this._changeCallback);\n this.model.document.selection.off('change:range', this._selectionChangeCallback);\n this.model.document.selection.off('change:attribute', this._selectionChangeCallback);\n }\n /**\n * Resets the change buffer.\n *\n * @param ignoreLock Whether internal lock {@link #isLocked} should be ignored.\n */\n _reset(ignoreLock = false) {\n if (!this.isLocked || ignoreLock) {\n this._batch = null;\n this._size = 0;\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module typing/inserttextcommand\n */\nimport { Command } from '@ckeditor/ckeditor5-core';\nimport ChangeBuffer from './utils/changebuffer';\n/**\n * The insert text command. Used by the {@link module:typing/input~Input input feature} to handle typing.\n */\nexport default class InsertTextCommand extends Command {\n /**\n * Creates an instance of the command.\n *\n * @param undoStepSize The maximum number of atomic changes\n * which can be contained in one batch in the command buffer.\n */\n constructor(editor, undoStepSize) {\n super(editor);\n this._buffer = new ChangeBuffer(editor.model, undoStepSize);\n // Since this command may execute on different selectable than selection, it should be checked directly in execute block.\n this._isEnabledBasedOnSelection = false;\n }\n /**\n * The current change buffer.\n */\n get buffer() {\n return this._buffer;\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this._buffer.destroy();\n }\n /**\n * Executes the input command. It replaces the content within the given range with the given text.\n * Replacing is a two step process, first the content within the range is removed and then the new text is inserted\n * at the beginning of the range (which after the removal is a collapsed range).\n *\n * @fires execute\n * @param options The command options.\n */\n execute(options = {}) {\n const model = this.editor.model;\n const doc = model.document;\n const text = options.text || '';\n const textInsertions = text.length;\n let selection = doc.selection;\n if (options.selection) {\n selection = options.selection;\n }\n else if (options.range) {\n selection = model.createSelection(options.range);\n }\n // Stop executing if selectable is in non-editable place.\n if (!model.canEditAt(selection)) {\n return;\n }\n const resultRange = options.resultRange;\n model.enqueueChange(this._buffer.batch, writer => {\n this._buffer.lock();\n model.deleteContent(selection);\n if (text) {\n model.insertContent(writer.createText(text, doc.selection.getAttributes()), selection);\n }\n if (resultRange) {\n writer.setSelection(resultRange);\n }\n else if (!selection.is('documentSelection')) {\n writer.setSelection(selection);\n }\n this._buffer.unlock();\n this._buffer.input(textInsertions);\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module typing/inserttextobserver\n */\nimport { env, EventInfo } from '@ckeditor/ckeditor5-utils';\nimport { DomEventData, Observer } from '@ckeditor/ckeditor5-engine';\nconst TYPING_INPUT_TYPES = [\n // For collapsed range:\n //\t- This one is a regular typing (all browsers, all systems).\n //\t- This one is used by Chrome when typing accented letter 2nd step when the user selects the accent (Mac).\n // For non-collapsed range:\n //\t- This one is used by Chrome when typing accented letter when the selection box first appears (Mac).\n //\t- This one is used by Safari when accepting spell check suggestions from the context menu (Mac).\n 'insertText',\n // This one is used by Safari when typing accented letter (Mac).\n // This one is used by Safari when accepting spell check suggestions from the autocorrection pop-up (Mac).\n 'insertReplacementText'\n];\n/**\n * Text insertion observer introduces the {@link module:engine/view/document~Document#event:insertText} event.\n */\nexport default class InsertTextObserver extends Observer {\n /**\n * @inheritDoc\n */\n constructor(view) {\n super(view);\n // On Android composition events should immediately be applied to the model. Rendering is not disabled.\n // On non-Android the model is updated only on composition end.\n // On Android we can't rely on composition start/end to update model.\n if (env.isAndroid) {\n TYPING_INPUT_TYPES.push('insertCompositionText');\n }\n const viewDocument = view.document;\n viewDocument.on('beforeinput', (evt, data) => {\n if (!this.isEnabled) {\n return;\n }\n const { data: text, targetRanges, inputType, domEvent } = data;\n if (!TYPING_INPUT_TYPES.includes(inputType)) {\n return;\n }\n const eventInfo = new EventInfo(viewDocument, 'insertText');\n viewDocument.fire(eventInfo, new DomEventData(view, domEvent, {\n text,\n selection: view.createSelection(targetRanges)\n }));\n // Stop the beforeinput event if `delete` event was stopped.\n // https://github.com/ckeditor/ckeditor5/issues/753\n if (eventInfo.stop.called) {\n evt.stop();\n }\n });\n // Note: The priority must be lower than the CompositionObserver handler to call it after the renderer is unblocked.\n viewDocument.on('compositionend', (evt, { data, domEvent }) => {\n // On Android composition events are immediately applied to the model.\n // On non-Android the model is updated only on composition end.\n // On Android we can't rely on composition start/end to update model.\n if (!this.isEnabled || env.isAndroid) {\n return;\n }\n // In case of aborted composition.\n if (!data) {\n return;\n }\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.log( `%c[InsertTextObserver]%c Fire insertText event, text: ${ JSON.stringify( data ) }`,\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green;', ''\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n // How do we know where to insert the composed text?\n // The selection observer is blocked and the view is not updated with the composition changes.\n // There were three options:\n // - Store the selection on `compositionstart` and use it now. This wouldn't work in RTC\n // where the view would change and the stored selection might get incorrect.\n // We'd need to fallback to the current view selection anyway.\n // - Use the current view selection. This is a bit weird and non-intuitive because\n // this isn't necessarily the selection on which the user started composing.\n // We cannot even know whether it's still collapsed (there might be some weird\n // editor feature that changed it in unpredictable ways for us). But it's by far\n // the simplest solution and should be stable (the selection is definitely correct)\n // and probably mostly predictable (features usually don't modify the selection\n // unless called explicitly by the user).\n // - Try to follow it from the `beforeinput` events. This would be really complex as each\n // `beforeinput` would come with just the range it's changing and we'd need to calculate that.\n // We decided to go with the 2nd option for its simplicity and stability.\n viewDocument.fire('insertText', new DomEventData(view, domEvent, {\n text: data,\n selection: viewDocument.selection\n }));\n }, { priority: 'lowest' });\n }\n /**\n * @inheritDoc\n */\n observe() { }\n /**\n * @inheritDoc\n */\n stopObserving() { }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module typing/input\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { env } from '@ckeditor/ckeditor5-utils';\nimport InsertTextCommand from './inserttextcommand';\nimport InsertTextObserver from './inserttextobserver';\n/**\n * Handles text input coming from the keyboard or other input methods.\n */\nexport default class Input extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Input';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const model = editor.model;\n const view = editor.editing.view;\n const modelSelection = model.document.selection;\n view.addObserver(InsertTextObserver);\n // TODO The above default configuration value should be defined using editor.config.define() once it's fixed.\n const insertTextCommand = new InsertTextCommand(editor, editor.config.get('typing.undoStep') || 20);\n // Register `insertText` command and add `input` command as an alias for backward compatibility.\n editor.commands.add('insertText', insertTextCommand);\n editor.commands.add('input', insertTextCommand);\n this.listenTo(view.document, 'insertText', (evt, data) => {\n // Rendering is disabled while composing so prevent events that will be rendered by the engine\n // and should not be applied by the browser.\n if (!view.document.isComposing) {\n data.preventDefault();\n }\n const { text, selection: viewSelection, resultRange: viewResultRange } = data;\n // If view selection was specified, translate it to model selection.\n const modelRanges = Array.from(viewSelection.getRanges()).map(viewRange => {\n return editor.editing.mapper.toModelRange(viewRange);\n });\n let insertText = text;\n // Typing in English on Android is firing composition events for the whole typed word.\n // We need to check the target range text to only apply the difference.\n if (env.isAndroid) {\n const selectedText = Array.from(modelRanges[0].getItems()).reduce((rangeText, node) => {\n return rangeText + (node.is('$textProxy') ? node.data : '');\n }, '');\n if (selectedText) {\n if (selectedText.length <= insertText.length) {\n if (insertText.startsWith(selectedText)) {\n insertText = insertText.substring(selectedText.length);\n modelRanges[0].start = modelRanges[0].start.getShiftedBy(selectedText.length);\n }\n }\n else {\n if (selectedText.startsWith(insertText)) {\n // TODO this should be mapped as delete?\n modelRanges[0].start = modelRanges[0].start.getShiftedBy(insertText.length);\n insertText = '';\n }\n }\n }\n }\n const insertTextCommandData = {\n text: insertText,\n selection: model.createSelection(modelRanges)\n };\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.log( '%c[Input]%c Execute insertText:',\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green;', '',\n // @if CK_DEBUG_TYPING // \t\tinsertText,\n // @if CK_DEBUG_TYPING // \t\t`[${ modelRanges[ 0 ].start.path }]-[${ modelRanges[ 0 ].end.path }]`\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n if (viewResultRange) {\n insertTextCommandData.resultRange = editor.editing.mapper.toModelRange(viewResultRange);\n }\n editor.execute('insertText', insertTextCommandData);\n });\n if (env.isAndroid) {\n // On Android with English keyboard, the composition starts just by putting caret\n // at the word end or by selecting a table column. This is not a real composition started.\n // Trigger delete content on first composition key pressed.\n this.listenTo(view.document, 'keydown', (evt, data) => {\n if (modelSelection.isCollapsed || data.keyCode != 229 || !view.document.isComposing) {\n return;\n }\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconst firstPositionPath = modelSelection.getFirstPosition()!.path;\n // @if CK_DEBUG_TYPING // \tconst lastPositionPath = modelSelection.getLastPosition()!.path;\n // @if CK_DEBUG_TYPING // \tconsole.log( '%c[Input]%c KeyDown 229 -> model.deleteContent()',\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green;', '',\n // @if CK_DEBUG_TYPING // \t\t`[${ firstPositionPath }]-[${ lastPositionPath }]`\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n deleteSelectionContent(model, insertTextCommand);\n });\n }\n else {\n // Note: The priority must precede the CompositionObserver handler to call it before\n // the renderer is blocked, because we want to render this change.\n this.listenTo(view.document, 'compositionstart', () => {\n if (modelSelection.isCollapsed) {\n return;\n }\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconst firstPositionPath = modelSelection.getFirstPosition()!.path;\n // @if CK_DEBUG_TYPING // \tconst lastPositionPath = modelSelection.getLastPosition()!.path;\n // @if CK_DEBUG_TYPING // \tconsole.log( '%c[Input]%c Composition start -> model.deleteContent()',\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green;', '',\n // @if CK_DEBUG_TYPING // \t\t`[${ firstPositionPath }]-[${ lastPositionPath }]`\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n deleteSelectionContent(model, insertTextCommand);\n });\n }\n }\n}\nfunction deleteSelectionContent(model, insertTextCommand) {\n // By relying on the state of the input command we allow disabling the entire input easily\n // by just disabling the input command. We couldve used here the delete command but that\n // would mean requiring the delete feature which would block loading one without the other.\n // We could also check the editor.isReadOnly property, but that wouldn't allow to block\n // the input without blocking other features.\n if (!insertTextCommand.isEnabled) {\n return;\n }\n const buffer = insertTextCommand.buffer;\n buffer.lock();\n model.enqueueChange(buffer.batch, () => {\n model.deleteContent(model.document.selection);\n });\n buffer.unlock();\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module typing/deletecommand\n */\nimport { Command } from '@ckeditor/ckeditor5-core';\nimport { count } from '@ckeditor/ckeditor5-utils';\nimport ChangeBuffer from './utils/changebuffer';\n/**\n * The delete command. Used by the {@link module:typing/delete~Delete delete feature} to handle the <kbd>Delete</kbd> and\n * <kbd>Backspace</kbd> keys.\n */\nexport default class DeleteCommand extends Command {\n /**\n * Creates an instance of the command.\n *\n * @param direction The directionality of the delete describing in what direction it\n * should consume the content when the selection is collapsed.\n */\n constructor(editor, direction) {\n super(editor);\n this.direction = direction;\n this._buffer = new ChangeBuffer(editor.model, editor.config.get('typing.undoStep'));\n // Since this command may execute on different selectable than selection, it should be checked directly in execute block.\n this._isEnabledBasedOnSelection = false;\n }\n /**\n * The current change buffer.\n */\n get buffer() {\n return this._buffer;\n }\n /**\n * Executes the delete command. Depending on whether the selection is collapsed or not, deletes its content\n * or a piece of content in the {@link #direction defined direction}.\n *\n * @fires execute\n * @param options The command options.\n * @param options.unit See {@link module:engine/model/utils/modifyselection~modifySelection}'s options.\n * @param options.sequence A number describing which subsequent delete event it is without the key being released.\n * See the {@link module:engine/view/document~Document#event:delete} event data.\n * @param options.selection Selection to remove. If not set, current model selection will be used.\n */\n execute(options = {}) {\n const model = this.editor.model;\n const doc = model.document;\n model.enqueueChange(this._buffer.batch, writer => {\n this._buffer.lock();\n const selection = writer.createSelection(options.selection || doc.selection);\n // Don't execute command when selection is in non-editable place.\n if (!model.canEditAt(selection)) {\n return;\n }\n const sequence = options.sequence || 1;\n // Do not replace the whole selected content if selection was collapsed.\n // This prevents such situation:\n //\n // <h1></h1><p>[]</p>\t--> <h1>[</h1><p>]</p> \t\t--> <p></p>\n // starting content\t\t--> after `modifySelection`\t--> after `deleteContent`.\n const doNotResetEntireContent = selection.isCollapsed;\n // Try to extend the selection in the specified direction.\n if (selection.isCollapsed) {\n model.modifySelection(selection, {\n direction: this.direction,\n unit: options.unit,\n treatEmojiAsSingleUnit: true\n });\n }\n // Check if deleting in an empty editor. See #61.\n if (this._shouldEntireContentBeReplacedWithParagraph(sequence)) {\n this._replaceEntireContentWithParagraph(writer);\n return;\n }\n // Check if deleting in the first empty block.\n // See https://github.com/ckeditor/ckeditor5/issues/8137.\n if (this._shouldReplaceFirstBlockWithParagraph(selection, sequence)) {\n this.editor.execute('paragraph', { selection });\n return;\n }\n // If selection is still collapsed, then there's nothing to delete.\n if (selection.isCollapsed) {\n return;\n }\n let changeCount = 0;\n selection.getFirstRange().getMinimalFlatRanges().forEach(range => {\n changeCount += count(range.getWalker({ singleCharacters: true, ignoreElementEnd: true, shallow: true }));\n });\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.log( '%c[DeleteCommand]%c Delete content',\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green;', '',\n // @if CK_DEBUG_TYPING // \t\t`[${ selection.getFirstPosition()!.path }]-[${ selection.getLastPosition()!.path }]`, options\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n model.deleteContent(selection, {\n doNotResetEntireContent,\n direction: this.direction\n });\n this._buffer.input(changeCount);\n writer.setSelection(selection);\n this._buffer.unlock();\n });\n }\n /**\n * If the user keeps <kbd>Backspace</kbd> or <kbd>Delete</kbd> key pressed, the content of the current\n * editable will be cleared. However, this will not yet lead to resetting the remaining block to a paragraph\n * (which happens e.g. when the user does <kbd>Ctrl</kbd> + <kbd>A</kbd>, <kbd>Backspace</kbd>).\n *\n * But, if the user pressed the key in an empty editable for the first time,\n * we want to replace the entire content with a paragraph if:\n *\n * * the current limit element is empty,\n * * the paragraph is allowed in the limit element,\n * * the limit doesn't already have a paragraph inside.\n *\n * See https://github.com/ckeditor/ckeditor5-typing/issues/61.\n *\n * @param sequence A number describing which subsequent delete event it is without the key being released.\n */\n _shouldEntireContentBeReplacedWithParagraph(sequence) {\n // Does nothing if user pressed and held the \"Backspace\" or \"Delete\" key.\n if (sequence > 1) {\n return false;\n }\n const model = this.editor.model;\n const doc = model.document;\n const selection = doc.selection;\n const limitElement = model.schema.getLimitElement(selection);\n // If a collapsed selection contains the whole content it means that the content is empty\n // (from the user perspective).\n const limitElementIsEmpty = selection.isCollapsed && selection.containsEntireContent(limitElement);\n if (!limitElementIsEmpty) {\n return false;\n }\n if (!model.schema.checkChild(limitElement, 'paragraph')) {\n return false;\n }\n const limitElementFirstChild = limitElement.getChild(0);\n // Does nothing if the limit element already contains only a paragraph.\n // We ignore the case when paragraph might have some inline elements (<p><inlineWidget>[]</inlineWidget></p>)\n // because we don't support such cases yet and it's unclear whether inlineWidget shouldn't be a limit itself.\n if (limitElementFirstChild && limitElementFirstChild.is('element', 'paragraph')) {\n return false;\n }\n return true;\n }\n /**\n * The entire content is replaced with the paragraph. Selection is moved inside the paragraph.\n *\n * @param writer The model writer.\n */\n _replaceEntireContentWithParagraph(writer) {\n const model = this.editor.model;\n const doc = model.document;\n const selection = doc.selection;\n const limitElement = model.schema.getLimitElement(selection);\n const paragraph = writer.createElement('paragraph');\n writer.remove(writer.createRangeIn(limitElement));\n writer.insert(paragraph, limitElement);\n writer.setSelection(paragraph, 0);\n }\n /**\n * Checks if the selection is inside an empty element that is the first child of the limit element\n * and should be replaced with a paragraph.\n *\n * @param selection The selection.\n * @param sequence A number describing which subsequent delete event it is without the key being released.\n */\n _shouldReplaceFirstBlockWithParagraph(selection, sequence) {\n const model = this.editor.model;\n // Does nothing if user pressed and held the \"Backspace\" key or it was a \"Delete\" button.\n if (sequence > 1 || this.direction != 'backward') {\n return false;\n }\n if (!selection.isCollapsed) {\n return false;\n }\n const position = selection.getFirstPosition();\n const limitElement = model.schema.getLimitElement(position);\n const limitElementFirstChild = limitElement.getChild(0);\n // Only elements that are direct children of the limit element can be replaced.\n // Unwrapping from a block quote should be handled in a dedicated feature.\n if (position.parent != limitElementFirstChild) {\n return false;\n }\n // A block should be replaced only if it was empty.\n if (!selection.containsEntireContent(limitElementFirstChild)) {\n return false;\n }\n // Replace with a paragraph only if it's allowed there.\n if (!model.schema.checkChild(limitElement, 'paragraph')) {\n return false;\n }\n // Does nothing if the limit element already contains only a paragraph.\n if (limitElementFirstChild.name == 'paragraph') {\n return false;\n }\n return true;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module typing/deleteobserver\n */\nimport { env, keyCodes, isInsideCombinedSymbol, isInsideEmojiSequence, isInsideSurrogatePair } from '@ckeditor/ckeditor5-utils';\nimport { BubblingEventInfo, DomEventData, Observer } from '@ckeditor/ckeditor5-engine';\nconst DELETE_CHARACTER = 'character';\nconst DELETE_WORD = 'word';\nconst DELETE_CODE_POINT = 'codePoint';\nconst DELETE_SELECTION = 'selection';\nconst DELETE_BACKWARD = 'backward';\nconst DELETE_FORWARD = 'forward';\nconst DELETE_EVENT_TYPES = {\n // --------------------------------------- Backward delete types -----------------------------------------------------\n // This happens in Safari on Mac when some content is selected and Ctrl + K is pressed.\n deleteContent: {\n unit: DELETE_SELECTION,\n // According to the Input Events Level 2 spec, this delete type has no direction\n // but to keep things simple, let's default to backward.\n direction: DELETE_BACKWARD\n },\n // Chrome and Safari on Mac: Backspace or Ctrl + H\n deleteContentBackward: {\n // This kind of deletions must be done on the code point-level instead of target range provided by the DOM beforeinput event.\n // Take for instance \"👨‍👩‍👧‍👧\", it equals:\n //\n //\t* [ \"👨\", \"ZERO WIDTH JOINER\", \"👩\", \"ZERO WIDTH JOINER\", \"👧\", \"ZERO WIDTH JOINER\", \"👧\" ]\n //\t* or simply \"\\u{1F468}\\u200D\\u{1F469}\\u200D\\u{1F467}\\u200D\\u{1F467}\"\n //\n // The range provided by the browser would cause the entire multi-byte grapheme to disappear while the user\n // intention when deleting backwards (\"👨‍👩‍👧‍👧[]\", then backspace) is gradual \"decomposition\" (first to \"👨‍👩‍👧‍[]\",\n // then to \"👨‍👩‍[]\", etc.).\n //\n //\t* \"👨‍👩‍👧‍👧[]\" + backward delete (by code point) -> results in \"👨‍👩‍👧[]\", removed the last \"👧\" 👍\n //\t* \"👨‍👩‍👧‍👧[]\" + backward delete (by character) -> results in \"[]\", removed the whole grapheme 👎\n //\n // Deleting by code-point is simply a better UX. See \"deleteContentForward\" to learn more.\n unit: DELETE_CODE_POINT,\n direction: DELETE_BACKWARD\n },\n // On Mac: Option + Backspace.\n // On iOS: Hold the backspace for a while and the whole words will start to disappear.\n deleteWordBackward: {\n unit: DELETE_WORD,\n direction: DELETE_BACKWARD\n },\n // Safari on Mac: Cmd + Backspace\n deleteHardLineBackward: {\n unit: DELETE_SELECTION,\n direction: DELETE_BACKWARD\n },\n // Chrome on Mac: Cmd + Backspace.\n deleteSoftLineBackward: {\n unit: DELETE_SELECTION,\n direction: DELETE_BACKWARD\n },\n // --------------------------------------- Forward delete types -----------------------------------------------------\n // Chrome on Mac: Fn + Backspace or Ctrl + D\n // Safari on Mac: Ctrl + K or Ctrl + D\n deleteContentForward: {\n // Unlike backward delete, this delete must be performed by character instead of by code point, which\n // provides the best UX for working with accented letters.\n // Take, for example \"b̂\" (\"\\u0062\\u0302\", or [ \"LATIN SMALL LETTER B\", \"COMBINING CIRCUMFLEX ACCENT\" ]):\n //\n //\t* \"b̂[]\" + backward delete (by code point) -> results in \"b[]\", removed the combining mark 👍\n //\t* \"[]b̂\" + forward delete (by code point) -> results in \"[]^\", a bare combining mark does that not make sense when alone 👎\n //\t* \"[]b̂\" + forward delete (by character) -> results in \"[]\", removed both \"b\" and the combining mark 👍\n //\n // See: \"deleteContentBackward\" to learn more.\n unit: DELETE_CHARACTER,\n direction: DELETE_FORWARD\n },\n // On Mac: Fn + Option + Backspace.\n deleteWordForward: {\n unit: DELETE_WORD,\n direction: DELETE_FORWARD\n },\n // Chrome on Mac: Ctrl + K (you have to disable the Link plugin first, though, because it uses the same keystroke)\n // This is weird that it does not work in Safari on Mac despite being listed in the official shortcuts listing\n // on Apple's webpage.\n deleteHardLineForward: {\n unit: DELETE_SELECTION,\n direction: DELETE_FORWARD\n },\n // At this moment there is no known way to trigger this event type but let's keep it for the symmetry with\n // deleteSoftLineBackward.\n deleteSoftLineForward: {\n unit: DELETE_SELECTION,\n direction: DELETE_FORWARD\n }\n};\n/**\n * Delete observer introduces the {@link module:engine/view/document~Document#event:delete} event.\n */\nexport default class DeleteObserver extends Observer {\n /**\n * @inheritDoc\n */\n constructor(view) {\n super(view);\n const document = view.document;\n // It matters how many subsequent deletions were made, e.g. when the backspace key was pressed and held\n // by the user for some time. For instance, if such scenario ocurred and the heading the selection was\n // anchored to was the only content of the editor, it will not be converted into a paragraph (the user\n // wanted to clean it up, not remove it, it's about UX). Check out the DeleteCommand implementation to learn more.\n //\n // Fun fact: Safari on Mac won't fire beforeinput for backspace in an empty heading (only content).\n let sequence = 0;\n document.on('keydown', () => {\n sequence++;\n });\n document.on('keyup', () => {\n sequence = 0;\n });\n document.on('beforeinput', (evt, data) => {\n if (!this.isEnabled) {\n return;\n }\n const { targetRanges, domEvent, inputType } = data;\n const deleteEventSpec = DELETE_EVENT_TYPES[inputType];\n if (!deleteEventSpec) {\n return;\n }\n const deleteData = {\n direction: deleteEventSpec.direction,\n unit: deleteEventSpec.unit,\n sequence\n };\n if (deleteData.unit == DELETE_SELECTION) {\n deleteData.selectionToRemove = view.createSelection(targetRanges[0]);\n }\n // The default deletion unit for deleteContentBackward is a single code point\n // but if the browser provides a wider target range then we should use it.\n if (inputType === 'deleteContentBackward') {\n // On Android, deleteContentBackward has sequence 1 by default.\n if (env.isAndroid) {\n deleteData.sequence = 1;\n }\n // The beforeInput event wants more than a single character to be removed.\n if (shouldUseTargetRanges(targetRanges)) {\n deleteData.unit = DELETE_SELECTION;\n deleteData.selectionToRemove = view.createSelection(targetRanges);\n }\n }\n const eventInfo = new BubblingEventInfo(document, 'delete', targetRanges[0]);\n document.fire(eventInfo, new DomEventData(view, domEvent, deleteData));\n // Stop the beforeinput event if `delete` event was stopped.\n // https://github.com/ckeditor/ckeditor5/issues/753\n if (eventInfo.stop.called) {\n evt.stop();\n }\n });\n // TODO: to be removed when https://bugs.chromium.org/p/chromium/issues/detail?id=1365311 is solved.\n if (env.isBlink) {\n enableChromeWorkaround(this);\n }\n }\n /**\n * @inheritDoc\n */\n observe() { }\n /**\n * @inheritDoc\n */\n stopObserving() { }\n}\n/**\n * Enables workaround for the issue https://github.com/ckeditor/ckeditor5/issues/11904.\n */\nfunction enableChromeWorkaround(observer) {\n const view = observer.view;\n const document = view.document;\n let pressedKeyCode = null;\n let beforeInputReceived = false;\n document.on('keydown', (evt, { keyCode }) => {\n pressedKeyCode = keyCode;\n beforeInputReceived = false;\n });\n document.on('keyup', (evt, { keyCode, domEvent }) => {\n const selection = document.selection;\n const shouldFireDeleteEvent = observer.isEnabled &&\n keyCode == pressedKeyCode &&\n isDeleteKeyCode(keyCode) &&\n !selection.isCollapsed &&\n !beforeInputReceived;\n pressedKeyCode = null;\n if (shouldFireDeleteEvent) {\n const targetRange = selection.getFirstRange();\n const eventInfo = new BubblingEventInfo(document, 'delete', targetRange);\n const deleteData = {\n unit: DELETE_SELECTION,\n direction: getDeleteDirection(keyCode),\n selectionToRemove: selection\n };\n document.fire(eventInfo, new DomEventData(view, domEvent, deleteData));\n }\n });\n document.on('beforeinput', (evt, { inputType }) => {\n const deleteEventSpec = DELETE_EVENT_TYPES[inputType];\n const isMatchingBeforeInput = isDeleteKeyCode(pressedKeyCode) &&\n deleteEventSpec &&\n deleteEventSpec.direction == getDeleteDirection(pressedKeyCode);\n if (isMatchingBeforeInput) {\n beforeInputReceived = true;\n }\n }, { priority: 'high' });\n document.on('beforeinput', (evt, { inputType, data }) => {\n const shouldIgnoreBeforeInput = pressedKeyCode == keyCodes.delete &&\n inputType == 'insertText' &&\n data == '\\x7f'; // Delete character :P\n if (shouldIgnoreBeforeInput) {\n evt.stop();\n }\n }, { priority: 'high' });\n function isDeleteKeyCode(keyCode) {\n return keyCode == keyCodes.backspace || keyCode == keyCodes.delete;\n }\n function getDeleteDirection(keyCode) {\n return keyCode == keyCodes.backspace ? DELETE_BACKWARD : DELETE_FORWARD;\n }\n}\n/**\n * Verifies whether the given target ranges cover more than a single character and should be used instead of a single code-point deletion.\n */\nfunction shouldUseTargetRanges(targetRanges) {\n // The collapsed target range could happen for example while deleting inside an inline filler\n // (it's mapped to collapsed position before an inline filler).\n if (targetRanges.length != 1 || targetRanges[0].isCollapsed) {\n return false;\n }\n const walker = targetRanges[0].getWalker({\n direction: 'backward',\n singleCharacters: true,\n ignoreElementEnd: true\n });\n let count = 0;\n for (const { nextPosition } of walker) {\n // There is some element in the range so count it as a single character.\n if (!nextPosition.parent.is('$text')) {\n count++;\n }\n else {\n const data = nextPosition.parent.data;\n const offset = nextPosition.offset;\n // Count combined symbols and emoji sequences as a single character.\n if (isInsideSurrogatePair(data, offset) ||\n isInsideCombinedSymbol(data, offset) ||\n isInsideEmojiSequence(data, offset)) {\n continue;\n }\n count++;\n }\n if (count > 1) {\n return true;\n }\n }\n return false;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module typing/delete\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport DeleteCommand from './deletecommand';\nimport DeleteObserver from './deleteobserver';\n/**\n * The delete and backspace feature. Handles keys such as <kbd>Delete</kbd> and <kbd>Backspace</kbd>, other\n * keystrokes and user actions that result in deleting content in the editor.\n */\nexport default class Delete extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Delete';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const view = editor.editing.view;\n const viewDocument = view.document;\n const modelDocument = editor.model.document;\n view.addObserver(DeleteObserver);\n this._undoOnBackspace = false;\n const deleteForwardCommand = new DeleteCommand(editor, 'forward');\n // Register `deleteForward` command and add `forwardDelete` command as an alias for backward compatibility.\n editor.commands.add('deleteForward', deleteForwardCommand);\n editor.commands.add('forwardDelete', deleteForwardCommand);\n editor.commands.add('delete', new DeleteCommand(editor, 'backward'));\n this.listenTo(viewDocument, 'delete', (evt, data) => {\n // When not in composition, we handle the action, so prevent the default one.\n // When in composition, it's the browser who modify the DOM (renderer is disabled).\n if (!viewDocument.isComposing) {\n data.preventDefault();\n }\n const { direction, sequence, selectionToRemove, unit } = data;\n const commandName = direction === 'forward' ? 'deleteForward' : 'delete';\n const commandData = { sequence };\n if (unit == 'selection') {\n const modelRanges = Array.from(selectionToRemove.getRanges()).map(viewRange => {\n return editor.editing.mapper.toModelRange(viewRange);\n });\n commandData.selection = editor.model.createSelection(modelRanges);\n }\n else {\n commandData.unit = unit;\n }\n editor.execute(commandName, commandData);\n view.scrollToTheSelection();\n }, { priority: 'low' });\n if (this.editor.plugins.has('UndoEditing')) {\n this.listenTo(viewDocument, 'delete', (evt, data) => {\n if (this._undoOnBackspace && data.direction == 'backward' && data.sequence == 1 && data.unit == 'codePoint') {\n this._undoOnBackspace = false;\n editor.execute('undo');\n data.preventDefault();\n evt.stop();\n }\n }, { context: '$capture' });\n this.listenTo(modelDocument, 'change', () => {\n this._undoOnBackspace = false;\n });\n }\n }\n /**\n * If the next user action after calling this method is pressing backspace, it would undo the last change.\n *\n * Requires {@link module:undo/undoediting~UndoEditing} plugin. If not loaded, does nothing.\n */\n requestUndoOnBackspace() {\n if (this.editor.plugins.has('UndoEditing')) {\n this._undoOnBackspace = true;\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module typing/typing\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport Input from './input';\nimport Delete from './delete';\n/**\n * The typing feature. It handles typing.\n *\n * This is a \"glue\" plugin which loads the {@link module:typing/input~Input} and {@link module:typing/delete~Delete}\n * plugins.\n */\nexport default class Typing extends Plugin {\n static get requires() {\n return [Input, Delete];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Typing';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Returns the last text line from the given range.\n *\n * \"The last text line\" is understood as text (from one or more text nodes) which is limited either by a parent block\n * or by inline elements (e.g. `<softBreak>`).\n *\n * ```ts\n * const rangeToCheck = model.createRange(\n * \tmodel.createPositionAt( paragraph, 0 ),\n * \tmodel.createPositionAt( paragraph, 'end' )\n * );\n *\n * const { text, range } = getLastTextLine( rangeToCheck, model );\n * ```\n *\n * For model below, the returned `text` will be \"Foo bar baz\" and `range` will be set on whole `<paragraph>` content:\n *\n * ```xml\n * <paragraph>Foo bar baz<paragraph>\n * ```\n *\n * However, in below case, `text` will be set to \"baz\" and `range` will be set only on \"baz\".\n *\n * ```xml\n * <paragraph>Foo<softBreak></softBreak>bar<softBreak></softBreak>baz<paragraph>\n * ```\n */\nexport default function getLastTextLine(range, model) {\n let start = range.start;\n const text = Array.from(range.getItems()).reduce((rangeText, node) => {\n // Trim text to a last occurrence of an inline element and update range start.\n if (!(node.is('$text') || node.is('$textProxy'))) {\n start = model.createPositionAfter(node);\n return '';\n }\n return rangeText + node.data;\n }, '');\n return { text, range: model.createRange(start, range.end) };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module typing/textwatcher\n */\nimport { ObservableMixin } from '@ckeditor/ckeditor5-utils';\nimport getLastTextLine from './utils/getlasttextline';\n/**\n * The text watcher feature.\n *\n * Fires the {@link module:typing/textwatcher~TextWatcher#event:matched:data `matched:data`},\n * {@link module:typing/textwatcher~TextWatcher#event:matched:selection `matched:selection`} and\n * {@link module:typing/textwatcher~TextWatcher#event:unmatched `unmatched`} events on typing or selection changes.\n */\nexport default class TextWatcher extends ObservableMixin() {\n /**\n * Creates a text watcher instance.\n *\n * @param testCallback See {@link module:typing/textwatcher~TextWatcher#testCallback}.\n */\n constructor(model, testCallback) {\n super();\n this.model = model;\n this.testCallback = testCallback;\n this._hasMatch = false;\n this.set('isEnabled', true);\n // Toggle text watching on isEnabled state change.\n this.on('change:isEnabled', () => {\n if (this.isEnabled) {\n this._startListening();\n }\n else {\n this.stopListening(model.document.selection);\n this.stopListening(model.document);\n }\n });\n this._startListening();\n }\n /**\n * Flag indicating whether there is a match currently.\n */\n get hasMatch() {\n return this._hasMatch;\n }\n /**\n * Starts listening to the editor for typing and selection events.\n */\n _startListening() {\n const model = this.model;\n const document = model.document;\n this.listenTo(document.selection, 'change:range', (evt, { directChange }) => {\n // Indirect changes (i.e. when the user types or external changes are applied) are handled in the document's change event.\n if (!directChange) {\n return;\n }\n // Act only on collapsed selection.\n if (!document.selection.isCollapsed) {\n if (this.hasMatch) {\n this.fire('unmatched');\n this._hasMatch = false;\n }\n return;\n }\n this._evaluateTextBeforeSelection('selection');\n });\n this.listenTo(document, 'change:data', (evt, batch) => {\n if (batch.isUndo || !batch.isLocal) {\n return;\n }\n this._evaluateTextBeforeSelection('data', { batch });\n });\n }\n /**\n * Checks the editor content for matched text.\n *\n * @fires matched:data\n * @fires matched:selection\n * @fires unmatched\n *\n * @param suffix A suffix used for generating the event name.\n * @param data Data object for event.\n */\n _evaluateTextBeforeSelection(suffix, data = {}) {\n const model = this.model;\n const document = model.document;\n const selection = document.selection;\n const rangeBeforeSelection = model.createRange(model.createPositionAt(selection.focus.parent, 0), selection.focus);\n const { text, range } = getLastTextLine(rangeBeforeSelection, model);\n const testResult = this.testCallback(text);\n if (!testResult && this.hasMatch) {\n this.fire('unmatched');\n }\n this._hasMatch = !!testResult;\n if (testResult) {\n const eventData = Object.assign(data, { text, range });\n // If the test callback returns an object with additional data, assign the data as well.\n if (typeof testResult == 'object') {\n Object.assign(eventData, testResult);\n }\n this.fire(`matched:${suffix}`, eventData);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module typing/twostepcaretmovement\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { keyCodes } from '@ckeditor/ckeditor5-utils';\n/**\n * This plugin enables the two-step caret (phantom) movement behavior for\n * {@link module:typing/twostepcaretmovement~TwoStepCaretMovement#registerAttribute registered attributes}\n * on arrow right (<kbd>→</kbd>) and left (<kbd>←</kbd>) key press.\n *\n * Thanks to this (phantom) caret movement the user is able to type before/after as well as at the\n * beginning/end of an attribute.\n *\n * **Note:** This plugin support righttoleft (Arabic, Hebrew, etc.) content by mirroring its behavior\n * but for the sake of simplicity examples showcase only lefttoright usecases.\n *\n * # Forward movement\n *\n * ## \"Entering\" an attribute:\n *\n * When this plugin is enabled and registered for the `a` attribute and the selection is right before it\n * (at the attribute boundary), pressing the right arrow key will not move the selection but update its\n * attributes accordingly:\n *\n * * When enabled:\n *\n * ```xml\n * foo{}<$text a=\"true\">bar</$text>\n * ```\n *\n * \t<kbd>→</kbd>\n *\n * ```xml\n * foo<$text a=\"true\">{}bar</$text>\n * ```\n *\n * * When disabled:\n *\n * ```xml\n * foo{}<$text a=\"true\">bar</$text>\n * ```\n *\n * \t<kbd>→</kbd>\n *\n * ```xml\n * foo<$text a=\"true\">b{}ar</$text>\n * ```\n *\n *\n * ## \"Leaving\" an attribute:\n *\n * * When enabled:\n *\n * ```xml\n * <$text a=\"true\">bar{}</$text>baz\n * ```\n *\n * \t<kbd>→</kbd>\n *\n * ```xml\n * <$text a=\"true\">bar</$text>{}baz\n * ```\n *\n * * When disabled:\n *\n * ```xml\n * <$text a=\"true\">bar{}</$text>baz\n * ```\n *\n * \t<kbd>→</kbd>\n *\n * ```xml\n * <$text a=\"true\">bar</$text>b{}az\n * ```\n *\n * # Backward movement\n *\n * * When enabled:\n *\n * ```xml\n * <$text a=\"true\">bar</$text>{}baz\n * ```\n *\n * \t<kbd>←</kbd>\n *\n * ```xml\n * <$text a=\"true\">bar{}</$text>baz\n * ```\n *\n * * When disabled:\n *\n * ```xml\n * <$text a=\"true\">bar</$text>{}baz\n * ```\n *\n * \t<kbd>←</kbd>\n *\n * ```xml\n * <$text a=\"true\">ba{}r</$text>b{}az\n * ```\n *\n * # Multiple attributes\n *\n * * When enabled and many attributes starts or ends at the same position:\n *\n * ```xml\n * <$text a=\"true\" b=\"true\">bar</$text>{}baz\n * ```\n *\n * \t<kbd>←</kbd>\n *\n * ```xml\n * <$text a=\"true\" b=\"true\">bar{}</$text>baz\n * ```\n *\n * * When enabled and one procedes another:\n *\n * ```xml\n * <$text a=\"true\">bar</$text><$text b=\"true\">{}bar</$text>\n * ```\n *\n * \t<kbd>←</kbd>\n *\n * ```xml\n * <$text a=\"true\">bar{}</$text><$text b=\"true\">bar</$text>\n * ```\n *\n */\nexport default class TwoStepCaretMovement extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TwoStepCaretMovement';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n this.attributes = new Set();\n this._overrideUid = null;\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const model = editor.model;\n const view = editor.editing.view;\n const locale = editor.locale;\n const modelSelection = model.document.selection;\n // Listen to keyboard events and handle the caret movement according to the 2-step caret logic.\n this.listenTo(view.document, 'arrowKey', (evt, data) => {\n // This implementation works only for collapsed selection.\n if (!modelSelection.isCollapsed) {\n return;\n }\n // When user tries to expand the selection or jump over the whole word or to the beginning/end then\n // two-steps movement is not necessary.\n if (data.shiftKey || data.altKey || data.ctrlKey) {\n return;\n }\n const arrowRightPressed = data.keyCode == keyCodes.arrowright;\n const arrowLeftPressed = data.keyCode == keyCodes.arrowleft;\n // When neither left or right arrow has been pressed then do noting.\n if (!arrowRightPressed && !arrowLeftPressed) {\n return;\n }\n const contentDirection = locale.contentLanguageDirection;\n let isMovementHandled = false;\n if ((contentDirection === 'ltr' && arrowRightPressed) || (contentDirection === 'rtl' && arrowLeftPressed)) {\n isMovementHandled = this._handleForwardMovement(data);\n }\n else {\n isMovementHandled = this._handleBackwardMovement(data);\n }\n // Stop the keydown event if the two-step caret movement handled it. Avoid collisions\n // with other features which may also take over the caret movement (e.g. Widget).\n if (isMovementHandled === true) {\n evt.stop();\n }\n }, { context: '$text', priority: 'highest' });\n this._isNextGravityRestorationSkipped = false;\n // The automatic gravity restoration logic.\n this.listenTo(modelSelection, 'change:range', (evt, data) => {\n // Skipping the automatic restoration is needed if the selection should change\n // but the gravity must remain overridden afterwards. See the #handleBackwardMovement\n // to learn more.\n if (this._isNextGravityRestorationSkipped) {\n this._isNextGravityRestorationSkipped = false;\n return;\n }\n // Skip automatic restore when the gravity is not overridden — simply, there's nothing to restore\n // at this moment.\n if (!this._isGravityOverridden) {\n return;\n }\n // Skip automatic restore when the change is indirect AND the selection is at the attribute boundary.\n // It means that e.g. if the change was external (collaboration) and the user had their\n // selection around the link, its gravity should remain intact in this change:range event.\n if (!data.directChange && isBetweenDifferentAttributes(modelSelection.getFirstPosition(), this.attributes)) {\n return;\n }\n this._restoreGravity();\n });\n }\n /**\n * Registers a given attribute for the two-step caret movement.\n *\n * @param attribute Name of the attribute to handle.\n */\n registerAttribute(attribute) {\n this.attributes.add(attribute);\n }\n /**\n * Updates the document selection and the view according to the twostep caret movement state\n * when moving **forwards**. Executed upon `keypress` in the {@link module:engine/view/view~View}.\n *\n * @param data Data of the key press.\n * @returns `true` when the handler prevented caret movement.\n */\n _handleForwardMovement(data) {\n const attributes = this.attributes;\n const model = this.editor.model;\n const selection = model.document.selection;\n const position = selection.getFirstPosition();\n // DON'T ENGAGE 2-SCM if gravity is already overridden. It means that we just entered\n //\n // \t\t<paragraph>foo<$text attribute>{}bar</$text>baz</paragraph>\n //\n // or left the attribute\n //\n // \t\t<paragraph>foo<$text attribute>bar</$text>{}baz</paragraph>\n //\n // and the gravity will be restored automatically.\n if (this._isGravityOverridden) {\n return false;\n }\n // DON'T ENGAGE 2-SCM when the selection is at the beginning of the block AND already has the\n // attribute:\n // * when the selection was initially set there using the mouse,\n // * when the editor has just started\n //\n //\t\t<paragraph><$text attribute>{}bar</$text>baz</paragraph>\n //\n if (position.isAtStart && hasAnyAttribute(selection, attributes)) {\n return false;\n }\n // ENGAGE 2-SCM When at least one of the observed attributes changes its value (incl. starts, ends).\n //\n //\t\t<paragraph>foo<$text attribute>bar{}</$text>baz</paragraph>\n //\t\t<paragraph>foo<$text attribute>bar{}</$text><$text otherAttribute>baz</$text></paragraph>\n //\t\t<paragraph>foo<$text attribute=1>bar{}</$text><$text attribute=2>baz</$text></paragraph>\n //\t\t<paragraph>foo{}<$text attribute>bar</$text>baz</paragraph>\n //\n if (isBetweenDifferentAttributes(position, attributes)) {\n preventCaretMovement(data);\n this._overrideGravity();\n return true;\n }\n return false;\n }\n /**\n * Updates the document selection and the view according to the twostep caret movement state\n * when moving **backwards**. Executed upon `keypress` in the {@link module:engine/view/view~View}.\n *\n * @param data Data of the key press.\n * @returns `true` when the handler prevented caret movement\n */\n _handleBackwardMovement(data) {\n const attributes = this.attributes;\n const model = this.editor.model;\n const selection = model.document.selection;\n const position = selection.getFirstPosition();\n // When the gravity is already overridden (by this plugin), it means we are on the two-step position.\n // Prevent the movement, restore the gravity and update selection attributes.\n //\n //\t\t<paragraph>foo<$text attribute=1>bar</$text><$text attribute=2>{}baz</$text></paragraph>\n //\t\t<paragraph>foo<$text attribute>bar</$text><$text otherAttribute>{}baz</$text></paragraph>\n //\t\t<paragraph>foo<$text attribute>{}bar</$text>baz</paragraph>\n //\t\t<paragraph>foo<$text attribute>bar</$text>{}baz</paragraph>\n //\n if (this._isGravityOverridden) {\n preventCaretMovement(data);\n this._restoreGravity();\n setSelectionAttributesFromTheNodeBefore(model, attributes, position);\n return true;\n }\n else {\n // REMOVE SELECTION ATTRIBUTE when restoring gravity towards a non-existent content at the\n // beginning of the block.\n //\n // \t\t<paragraph>{}<$text attribute>bar</$text></paragraph>\n //\n if (position.isAtStart) {\n if (hasAnyAttribute(selection, attributes)) {\n preventCaretMovement(data);\n setSelectionAttributesFromTheNodeBefore(model, attributes, position);\n return true;\n }\n return false;\n }\n // When we are moving from natural gravity, to the position of the 2SCM, we need to override the gravity,\n // and make sure it won't be restored. Unless it's at the end of the block and an observed attribute.\n // We need to check if the caret is a one position before the attribute boundary:\n //\n //\t\t<paragraph>foo<$text attribute=1>bar</$text><$text attribute=2>b{}az</$text></paragraph>\n //\t\t<paragraph>foo<$text attribute>bar</$text><$text otherAttribute>b{}az</$text></paragraph>\n //\t\t<paragraph>foo<$text attribute>b{}ar</$text>baz</paragraph>\n //\t\t<paragraph>foo<$text attribute>bar</$text>b{}az</paragraph>\n //\n if (isStepAfterAnyAttributeBoundary(position, attributes)) {\n // ENGAGE 2-SCM if the selection has no attribute. This may happen when the user\n // left the attribute using a FORWARD 2-SCM.\n //\n // \t\t<paragraph><$text attribute>bar</$text>{}</paragraph>\n //\n if (position.isAtEnd &&\n !hasAnyAttribute(selection, attributes) &&\n isBetweenDifferentAttributes(position, attributes)) {\n preventCaretMovement(data);\n setSelectionAttributesFromTheNodeBefore(model, attributes, position);\n return true;\n }\n // Skip the automatic gravity restore upon the next selection#change:range event.\n // If not skipped, it would automatically restore the gravity, which should remain\n // overridden.\n this._isNextGravityRestorationSkipped = true;\n this._overrideGravity();\n // Don't return \"true\" here because we didn't call _preventCaretMovement.\n // Returning here will destabilize the filler logic, which also listens to\n // keydown (and the event would be stopped).\n return false;\n }\n }\n return false;\n }\n /**\n * `true` when the gravity is overridden for the plugin.\n */\n get _isGravityOverridden() {\n return !!this._overrideUid;\n }\n /**\n * Overrides the gravity using the {@link module:engine/model/writer~Writer model writer}\n * and stores the information about this fact in the {@link #_overrideUid}.\n *\n * A shorthand for {@link module:engine/model/writer~Writer#overrideSelectionGravity}.\n */\n _overrideGravity() {\n this._overrideUid = this.editor.model.change(writer => {\n return writer.overrideSelectionGravity();\n });\n }\n /**\n * Restores the gravity using the {@link module:engine/model/writer~Writer model writer}.\n *\n * A shorthand for {@link module:engine/model/writer~Writer#restoreSelectionGravity}.\n */\n _restoreGravity() {\n this.editor.model.change(writer => {\n writer.restoreSelectionGravity(this._overrideUid);\n this._overrideUid = null;\n });\n }\n}\n/**\n * Checks whether the selection has any of given attributes.\n */\nfunction hasAnyAttribute(selection, attributes) {\n for (const observedAttribute of attributes) {\n if (selection.hasAttribute(observedAttribute)) {\n return true;\n }\n }\n return false;\n}\n/**\n * Applies the given attributes to the current selection using using the\n * values from the node before the current position. Uses\n * the {@link module:engine/model/writer~Writer model writer}.\n */\nfunction setSelectionAttributesFromTheNodeBefore(model, attributes, position) {\n const nodeBefore = position.nodeBefore;\n model.change(writer => {\n if (nodeBefore) {\n writer.setSelectionAttribute(nodeBefore.getAttributes());\n }\n else {\n writer.removeSelectionAttribute(attributes);\n }\n });\n}\n/**\n * Prevents the caret movement in the view by calling `preventDefault` on the event data.\n *\n * @alias data.preventDefault\n */\nfunction preventCaretMovement(data) {\n data.preventDefault();\n}\n/**\n * Checks whether the step before `isBetweenDifferentAttributes()`.\n */\nfunction isStepAfterAnyAttributeBoundary(position, attributes) {\n const positionBefore = position.getShiftedBy(-1);\n return isBetweenDifferentAttributes(positionBefore, attributes);\n}\n/**\n * Checks whether the given position is between different values of given attributes.\n */\nfunction isBetweenDifferentAttributes(position, attributes) {\n const { nodeBefore, nodeAfter } = position;\n for (const observedAttribute of attributes) {\n const attrBefore = nodeBefore ? nodeBefore.getAttribute(observedAttribute) : undefined;\n const attrAfter = nodeAfter ? nodeAfter.getAttribute(observedAttribute) : undefined;\n if (attrAfter !== attrBefore) {\n return true;\n }\n }\n return false;\n}\n","import toString from './toString.js';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n/**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\nfunction escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n}\n\nexport default escapeRegExp;\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module typing/texttransformation\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport TextWatcher from './textwatcher';\nimport { escapeRegExp } from 'lodash-es';\n// All named transformations.\nconst TRANSFORMATIONS = {\n // Common symbols:\n copyright: { from: '(c)', to: '©' },\n registeredTrademark: { from: '(r)', to: '®' },\n trademark: { from: '(tm)', to: '™' },\n // Mathematical:\n oneHalf: { from: /(^|[^/a-z0-9])(1\\/2)([^/a-z0-9])$/i, to: [null, '½', null] },\n oneThird: { from: /(^|[^/a-z0-9])(1\\/3)([^/a-z0-9])$/i, to: [null, '⅓', null] },\n twoThirds: { from: /(^|[^/a-z0-9])(2\\/3)([^/a-z0-9])$/i, to: [null, '⅔', null] },\n oneForth: { from: /(^|[^/a-z0-9])(1\\/4)([^/a-z0-9])$/i, to: [null, '¼', null] },\n threeQuarters: { from: /(^|[^/a-z0-9])(3\\/4)([^/a-z0-9])$/i, to: [null, '¾', null] },\n lessThanOrEqual: { from: '<=', to: '≤' },\n greaterThanOrEqual: { from: '>=', to: '≥' },\n notEqual: { from: '!=', to: '≠' },\n arrowLeft: { from: '<-', to: '←' },\n arrowRight: { from: '->', to: '→' },\n // Typography:\n horizontalEllipsis: { from: '...', to: '…' },\n enDash: { from: /(^| )(--)( )$/, to: [null, '', null] },\n emDash: { from: /(^| )(---)( )$/, to: [null, '—', null] },\n // Quotations:\n // English, US\n quotesPrimary: { from: buildQuotesRegExp('\"'), to: [null, '“', null, '”'] },\n quotesSecondary: { from: buildQuotesRegExp('\\''), to: [null, '', null, ''] },\n // English, UK\n quotesPrimaryEnGb: { from: buildQuotesRegExp('\\''), to: [null, '', null, ''] },\n quotesSecondaryEnGb: { from: buildQuotesRegExp('\"'), to: [null, '“', null, '”'] },\n // Polish\n quotesPrimaryPl: { from: buildQuotesRegExp('\"'), to: [null, '„', null, '”'] },\n quotesSecondaryPl: { from: buildQuotesRegExp('\\''), to: [null, '', null, ''] }\n};\n// Transformation groups.\nconst TRANSFORMATION_GROUPS = {\n symbols: ['copyright', 'registeredTrademark', 'trademark'],\n mathematical: [\n 'oneHalf', 'oneThird', 'twoThirds', 'oneForth', 'threeQuarters',\n 'lessThanOrEqual', 'greaterThanOrEqual', 'notEqual',\n 'arrowLeft', 'arrowRight'\n ],\n typography: ['horizontalEllipsis', 'enDash', 'emDash'],\n quotes: ['quotesPrimary', 'quotesSecondary']\n};\n// A set of default transformations provided by the feature.\nconst DEFAULT_TRANSFORMATIONS = [\n 'symbols',\n 'mathematical',\n 'typography',\n 'quotes'\n];\n/**\n * The text transformation plugin.\n */\nexport default class TextTransformation extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return ['Delete', 'Input'];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TextTransformation';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n editor.config.define('typing', {\n transformations: {\n include: DEFAULT_TRANSFORMATIONS\n }\n });\n }\n /**\n * @inheritDoc\n */\n init() {\n const model = this.editor.model;\n const modelSelection = model.document.selection;\n modelSelection.on('change:range', () => {\n // Disable plugin when selection is inside a code block.\n this.isEnabled = !modelSelection.anchor.parent.is('element', 'codeBlock');\n });\n this._enableTransformationWatchers();\n }\n /**\n * Create new TextWatcher listening to the editor for typing and selection events.\n */\n _enableTransformationWatchers() {\n const editor = this.editor;\n const model = editor.model;\n const deletePlugin = editor.plugins.get('Delete');\n const normalizedTransformations = normalizeTransformations(editor.config.get('typing.transformations'));\n const testCallback = (text) => {\n for (const normalizedTransformation of normalizedTransformations) {\n const from = normalizedTransformation.from;\n const match = from.test(text);\n if (match) {\n return { normalizedTransformation };\n }\n }\n };\n const watcher = new TextWatcher(editor.model, testCallback);\n watcher.on('matched:data', (evt, data) => {\n if (!data.batch.isTyping) {\n return;\n }\n const { from, to } = data.normalizedTransformation;\n const matches = from.exec(data.text);\n const replaces = to(matches.slice(1));\n const matchedRange = data.range;\n let changeIndex = matches.index;\n model.enqueueChange(writer => {\n for (let i = 1; i < matches.length; i++) {\n const match = matches[i];\n const replaceWith = replaces[i - 1];\n if (replaceWith == null) {\n changeIndex += match.length;\n continue;\n }\n const replacePosition = matchedRange.start.getShiftedBy(changeIndex);\n const replaceRange = model.createRange(replacePosition, replacePosition.getShiftedBy(match.length));\n const attributes = getTextAttributesAfterPosition(replacePosition);\n model.insertContent(writer.createText(replaceWith, attributes), replaceRange);\n changeIndex += replaceWith.length;\n }\n model.enqueueChange(() => {\n deletePlugin.requestUndoOnBackspace();\n });\n });\n });\n watcher.bind('isEnabled').to(this);\n }\n}\n/**\n * Normalizes the configuration `from` parameter value.\n * The normalized value for the `from` parameter is a RegExp instance. If the passed `from` is already a RegExp instance,\n * it is returned unchanged.\n */\nfunction normalizeFrom(from) {\n if (typeof from == 'string') {\n return new RegExp(`(${escapeRegExp(from)})$`);\n }\n // `from` is already a regular expression.\n return from;\n}\n/**\n * Normalizes the configuration `to` parameter value.\n * The normalized value for the `to` parameter is a function that takes an array and returns an array. See more in the\n * configuration description. If the passed `to` is already a function, it is returned unchanged.\n */\nfunction normalizeTo(to) {\n if (typeof to == 'string') {\n return () => [to];\n }\n else if (to instanceof Array) {\n return () => to;\n }\n // `to` is already a function.\n return to;\n}\n/**\n * For given `position` returns attributes for the text that is after that position.\n * The text can be in the same text node as the position (`foo[]bar`) or in the next text node (`foo[]<$text bold=\"true\">bar</$text>`).\n */\nfunction getTextAttributesAfterPosition(position) {\n const textNode = position.textNode ? position.textNode : position.nodeAfter;\n return textNode.getAttributes();\n}\n/**\n * Returns a RegExp pattern string that detects a sentence inside a quote.\n *\n * @param quoteCharacter The character to create a pattern for.\n */\nfunction buildQuotesRegExp(quoteCharacter) {\n return new RegExp(`(^|\\\\s)(${quoteCharacter})([^${quoteCharacter}]*)(${quoteCharacter})$`);\n}\n/**\n * Reads text transformation config and returns normalized array of transformations objects.\n */\nfunction normalizeTransformations(config) {\n const extra = config.extra || [];\n const remove = config.remove || [];\n const isNotRemoved = (transformation) => !remove.includes(transformation);\n const configured = config.include.concat(extra).filter(isNotRemoved);\n return expandGroupsAndRemoveDuplicates(configured)\n .filter(isNotRemoved) // Filter out 'remove' transformations as they might be set in group.\n .map(transformation => (typeof transformation == 'string' && TRANSFORMATIONS[transformation] ? TRANSFORMATIONS[transformation] : transformation))\n // Filter out transformations set as string that has not been found.\n .filter((transformation) => typeof transformation === 'object')\n .map(transformation => ({\n from: normalizeFrom(transformation.from),\n to: normalizeTo(transformation.to)\n }));\n}\n/**\n * Reads definitions and expands named groups if needed to transformation names.\n * This method also removes duplicated named transformations if any.\n */\nfunction expandGroupsAndRemoveDuplicates(definitions) {\n // Set is using to make sure that transformation names are not duplicated.\n const definedTransformations = new Set();\n for (const transformationOrGroup of definitions) {\n if (typeof transformationOrGroup == 'string' && TRANSFORMATION_GROUPS[transformationOrGroup]) {\n for (const transformation of TRANSFORMATION_GROUPS[transformationOrGroup]) {\n definedTransformations.add(transformation);\n }\n }\n else {\n definedTransformations.add(transformationOrGroup);\n }\n }\n return Array.from(definedTransformations);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Returns a model range that covers all consecutive nodes with the same `attributeName` and its `value`\n * that intersect the given `position`.\n *\n * It can be used e.g. to get the entire range on which the `linkHref` attribute needs to be changed when having a\n * selection inside a link.\n *\n * @param position The start position.\n * @param attributeName The attribute name.\n * @param value The attribute value.\n * @param model The model instance.\n * @returns The link range.\n */\nexport default function findAttributeRange(position, attributeName, value, model) {\n return model.createRange(findAttributeRangeBound(position, attributeName, value, true, model), findAttributeRangeBound(position, attributeName, value, false, model));\n}\n/**\n * Walks forward or backward (depends on the `lookBack` flag), node by node, as long as they have the same attribute value\n * and returns a position just before or after (depends on the `lookBack` flag) the last matched node.\n *\n * @param position The start position.\n * @param attributeName The attribute name.\n * @param value The attribute value.\n * @param lookBack Whether the walk direction is forward (`false`) or backward (`true`).\n * @returns The position just before the last matched node.\n */\nexport function findAttributeRangeBound(position, attributeName, value, lookBack, model) {\n // Get node before or after position (depends on `lookBack` flag).\n // When position is inside text node then start searching from text node.\n let node = position.textNode || (lookBack ? position.nodeBefore : position.nodeAfter);\n let lastNode = null;\n while (node && node.getAttribute(attributeName) == value) {\n lastNode = node;\n node = lookBack ? node.previousSibling : node.nextSibling;\n }\n return lastNode ? model.createPositionAt(lastNode, lookBack ? 'before' : 'after') : position;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module typing/utils/inlinehighlight\n */\nimport findAttributeRange from './findattributerange';\n/**\n * Adds a visual highlight style to an attribute element in which the selection is anchored.\n * Together with two-step caret movement, they indicate that the user is typing inside the element.\n *\n * Highlight is turned on by adding the given class to the attribute element in the view:\n *\n * * The class is removed before the conversion has started, as callbacks added with the `'highest'` priority\n * to {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} events.\n * * The class is added in the view post fixer, after other changes in the model tree were converted to the view.\n *\n * This way, adding and removing the highlight does not interfere with conversion.\n *\n * Usage:\n *\n * ```ts\n * import inlineHighlight from '@ckeditor/ckeditor5-typing/src/utils/inlinehighlight';\n *\n * // Make `ck-link_selected` class be applied on an `a` element\n * // whenever the corresponding `linkHref` attribute element is selected.\n * inlineHighlight( editor, 'linkHref', 'a', 'ck-link_selected' );\n * ```\n *\n * @param editor The editor instance.\n * @param attributeName The attribute name to check.\n * @param tagName The tagName of a view item.\n * @param className The class name to apply in the view.\n */\nexport default function inlineHighlight(editor, attributeName, tagName, className) {\n const view = editor.editing.view;\n const highlightedElements = new Set();\n // Adding the class.\n view.document.registerPostFixer(writer => {\n const selection = editor.model.document.selection;\n let changed = false;\n if (selection.hasAttribute(attributeName)) {\n const modelRange = findAttributeRange(selection.getFirstPosition(), attributeName, selection.getAttribute(attributeName), editor.model);\n const viewRange = editor.editing.mapper.toViewRange(modelRange);\n // There might be multiple view elements in the `viewRange`, for example, when the `a` element is\n // broken by a UIElement.\n for (const item of viewRange.getItems()) {\n if (item.is('element', tagName) && !item.hasClass(className)) {\n writer.addClass(className, item);\n highlightedElements.add(item);\n changed = true;\n }\n }\n }\n return changed;\n });\n // Removing the class.\n editor.conversion.for('editingDowncast').add(dispatcher => {\n // Make sure the highlight is removed on every possible event, before conversion is started.\n dispatcher.on('insert', removeHighlight, { priority: 'highest' });\n dispatcher.on('remove', removeHighlight, { priority: 'highest' });\n dispatcher.on('attribute', removeHighlight, { priority: 'highest' });\n dispatcher.on('selection', removeHighlight, { priority: 'highest' });\n function removeHighlight() {\n view.change(writer => {\n for (const item of highlightedElements.values()) {\n writer.removeClass(className, item);\n highlightedElements.delete(item);\n }\n });\n }\n });\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Returns attributes that should be preserved on the enter keystroke.\n *\n * Filtering is realized based on `copyOnEnter` attribute property. Read more about attribute properties\n * {@link module:engine/model/schema~Schema#setAttributeProperties here}.\n *\n * @param schema Model's schema.\n * @param allAttributes Attributes to filter.\n */\nexport function* getCopyOnEnterAttributes(schema, allAttributes) {\n for (const attribute of allAttributes) {\n if (attribute && schema.getAttributeProperties(attribute[0]).copyOnEnter) {\n yield attribute;\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module enter/entercommand\n */\nimport { Command } from '@ckeditor/ckeditor5-core';\nimport { getCopyOnEnterAttributes } from './utils';\n/**\n * Enter command used by the {@link module:enter/enter~Enter Enter feature} to handle the <kbd>Enter</kbd> keystroke.\n */\nexport default class EnterCommand extends Command {\n /**\n * @inheritDoc\n */\n execute() {\n this.editor.model.change(writer => {\n this.enterBlock(writer);\n this.fire('afterExecute', { writer });\n });\n }\n /**\n * Splits a block where the document selection is placed, in the way how the <kbd>Enter</kbd> key is expected to work:\n *\n * ```\n * <p>Foo[]bar</p> -> <p>Foo</p><p>[]bar</p>\n * <p>Foobar[]</p> -> <p>Foobar</p><p>[]</p>\n * <p>Fo[ob]ar</p> -> <p>Fo</p><p>[]ar</p>\n * ```\n *\n * In some cases, the split will not happen:\n *\n * ```\n * // The selection parent is a limit element:\n * <figcaption>A[bc]d</figcaption> -> <figcaption>A[]d</figcaption>\n *\n * // The selection spans over multiple elements:\n * <h>x[x</h><p>y]y<p> -> <h>x</h><p>[]y</p>\n * ```\n *\n * @param writer Writer to use when performing the enter action.\n * @returns Boolean indicating if the block was split.\n */\n enterBlock(writer) {\n const model = this.editor.model;\n const selection = model.document.selection;\n const schema = model.schema;\n const isSelectionEmpty = selection.isCollapsed;\n const range = selection.getFirstRange();\n const startElement = range.start.parent;\n const endElement = range.end.parent;\n // Don't touch the roots and other limit elements.\n if (schema.isLimit(startElement) || schema.isLimit(endElement)) {\n // Delete the selected content but only if inside a single limit element.\n // Abort, when crossing limit elements boundary (e.g. <limit1>x[x</limit1>donttouchme<limit2>y]y</limit2>).\n // This is an edge case and it's hard to tell what should actually happen because such a selection\n // is not entirely valid.\n if (!isSelectionEmpty && startElement == endElement) {\n model.deleteContent(selection);\n }\n return false;\n }\n if (isSelectionEmpty) {\n const attributesToCopy = getCopyOnEnterAttributes(writer.model.schema, selection.getAttributes());\n splitBlock(writer, range.start);\n writer.setSelectionAttribute(attributesToCopy);\n return true;\n }\n else {\n const leaveUnmerged = !(range.start.isAtStart && range.end.isAtEnd);\n const isContainedWithinOneElement = (startElement == endElement);\n model.deleteContent(selection, { leaveUnmerged });\n if (leaveUnmerged) {\n // Partially selected elements.\n //\n // <h>x[xx]x</h>\t\t-> <h>x^x</h>\t\t\t-> <h>x</h><h>^x</h>\n if (isContainedWithinOneElement) {\n splitBlock(writer, selection.focus);\n return true;\n }\n // Selection over multiple elements.\n //\n // <h>x[x</h><p>y]y<p>\t-> <h>x^</h><p>y</p>\t-> <h>x</h><p>^y</p>\n else {\n writer.setSelection(endElement, 0);\n }\n }\n }\n return false;\n }\n}\nfunction splitBlock(writer, splitPos) {\n writer.split(splitPos);\n writer.setSelection(splitPos.parent.nextSibling, 0);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module enter/enterobserver\n */\nimport { Observer, DomEventData, BubblingEventInfo } from '@ckeditor/ckeditor5-engine';\nimport { env } from '@ckeditor/ckeditor5-utils';\nconst ENTER_EVENT_TYPES = {\n insertParagraph: { isSoft: false },\n insertLineBreak: { isSoft: true }\n};\n/**\n * Enter observer introduces the {@link module:engine/view/document~Document#event:enter `Document#enter`} event.\n */\nexport default class EnterObserver extends Observer {\n /**\n * @inheritDoc\n */\n constructor(view) {\n super(view);\n const doc = this.document;\n let shiftPressed = false;\n doc.on('keydown', (evt, data) => {\n shiftPressed = data.shiftKey;\n });\n doc.on('beforeinput', (evt, data) => {\n if (!this.isEnabled) {\n return;\n }\n let inputType = data.inputType;\n // See https://github.com/ckeditor/ckeditor5/issues/13321.\n if (env.isSafari && shiftPressed && inputType == 'insertParagraph') {\n inputType = 'insertLineBreak';\n }\n const domEvent = data.domEvent;\n const enterEventSpec = ENTER_EVENT_TYPES[inputType];\n if (!enterEventSpec) {\n return;\n }\n const event = new BubblingEventInfo(doc, 'enter', data.targetRanges[0]);\n doc.fire(event, new DomEventData(view, domEvent, {\n isSoft: enterEventSpec.isSoft\n }));\n // Stop `beforeinput` event if `enter` event was stopped.\n // https://github.com/ckeditor/ckeditor5/issues/753\n if (event.stop.called) {\n evt.stop();\n }\n });\n }\n /**\n * @inheritDoc\n */\n observe() { }\n /**\n * @inheritDoc\n */\n stopObserving() { }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module enter/enter\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport EnterCommand from './entercommand';\nimport EnterObserver from './enterobserver';\n/**\n * This plugin handles the <kbd>Enter</kbd> keystroke (hard line break) in the editor.\n *\n * See also the {@link module:enter/shiftenter~ShiftEnter} plugin.\n *\n * For more information about this feature see the {@glink api/enter package page}.\n */\nexport default class Enter extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Enter';\n }\n init() {\n const editor = this.editor;\n const view = editor.editing.view;\n const viewDocument = view.document;\n view.addObserver(EnterObserver);\n editor.commands.add('enter', new EnterCommand(editor));\n this.listenTo(viewDocument, 'enter', (evt, data) => {\n // When not in composition, we handle the action, so prevent the default one.\n // When in composition, it's the browser who modify the DOM (renderer is disabled).\n if (!viewDocument.isComposing) {\n data.preventDefault();\n }\n // The soft enter key is handled by the ShiftEnter plugin.\n if (data.isSoft) {\n return;\n }\n editor.execute('enter');\n view.scrollToTheSelection();\n }, { priority: 'low' });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module enter/shiftentercommand\n */\nimport { Command } from '@ckeditor/ckeditor5-core';\nimport { getCopyOnEnterAttributes } from './utils';\n/**\n * ShiftEnter command. It is used by the {@link module:enter/shiftenter~ShiftEnter ShiftEnter feature} to handle\n * the <kbd>Shift</kbd>+<kbd>Enter</kbd> keystroke.\n */\nexport default class ShiftEnterCommand extends Command {\n /**\n * @inheritDoc\n */\n execute() {\n const model = this.editor.model;\n const doc = model.document;\n model.change(writer => {\n softBreakAction(model, writer, doc.selection);\n this.fire('afterExecute', { writer });\n });\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const model = this.editor.model;\n const doc = model.document;\n this.isEnabled = isEnabled(model.schema, doc.selection);\n }\n}\n/**\n * Checks whether the ShiftEnter command should be enabled in the specified selection.\n */\nfunction isEnabled(schema, selection) {\n // At this moment it is okay to support single range selections only.\n // But in the future we may need to change that.\n if (selection.rangeCount > 1) {\n return false;\n }\n const anchorPos = selection.anchor;\n // Check whether the break element can be inserted in the current selection anchor.\n if (!anchorPos || !schema.checkChild(anchorPos, 'softBreak')) {\n return false;\n }\n const range = selection.getFirstRange();\n const startElement = range.start.parent;\n const endElement = range.end.parent;\n // Do not modify the content if selection is cross-limit elements.\n if ((isInsideLimitElement(startElement, schema) || isInsideLimitElement(endElement, schema)) && startElement !== endElement) {\n return false;\n }\n return true;\n}\n/**\n * Creates a break in the way that the <kbd>Shift</kbd>+<kbd>Enter</kbd> keystroke is expected to work.\n */\nfunction softBreakAction(model, writer, selection) {\n const isSelectionEmpty = selection.isCollapsed;\n const range = selection.getFirstRange();\n const startElement = range.start.parent;\n const endElement = range.end.parent;\n const isContainedWithinOneElement = (startElement == endElement);\n if (isSelectionEmpty) {\n const attributesToCopy = getCopyOnEnterAttributes(model.schema, selection.getAttributes());\n insertBreak(model, writer, range.end);\n writer.removeSelectionAttribute(selection.getAttributeKeys());\n writer.setSelectionAttribute(attributesToCopy);\n }\n else {\n const leaveUnmerged = !(range.start.isAtStart && range.end.isAtEnd);\n model.deleteContent(selection, { leaveUnmerged });\n // Selection within one element:\n //\n // <h>x[xx]x</h>\t\t-> <h>x^x</h>\t\t\t-> <h>x<br>^x</h>\n if (isContainedWithinOneElement) {\n insertBreak(model, writer, selection.focus);\n }\n // Selection over multiple elements.\n //\n // <h>x[x</h><p>y]y<p>\t-> <h>x^</h><p>y</p>\t-> <h>x</h><p>^y</p>\n //\n // We chose not to insert a line break in this case because:\n //\n // * it's not a very common scenario,\n // * it actually surprised me when I saw the \"expected behavior\" in real life.\n //\n // It's ok if the user will need to be more specific where they want the <br> to be inserted.\n else {\n // Move the selection to the 2nd element (last step of the example above).\n if (leaveUnmerged) {\n writer.setSelection(endElement, 0);\n }\n }\n }\n}\nfunction insertBreak(model, writer, position) {\n const breakLineElement = writer.createElement('softBreak');\n model.insertContent(breakLineElement, position);\n writer.setSelection(breakLineElement, 'after');\n}\n/**\n * Checks whether the specified `element` is a child of the limit element.\n *\n * Checking whether the `<p>` element is inside a limit element:\n * - `<$root><p>Text.</p></$root> => false`\n * - `<$root><limitElement><p>Text</p></limitElement></$root> => true`\n */\nfunction isInsideLimitElement(element, schema) {\n // `$root` is a limit element but in this case is an invalid element.\n if (element.is('rootElement')) {\n return false;\n }\n return schema.isLimit(element) || isInsideLimitElement(element.parent, schema);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module enter/shiftenter\n */\nimport ShiftEnterCommand from './shiftentercommand';\nimport EnterObserver from './enterobserver';\nimport { Plugin } from '@ckeditor/ckeditor5-core';\n/**\n * This plugin handles the <kbd>Shift</kbd>+<kbd>Enter</kbd> keystroke (soft line break) in the editor.\n *\n * See also the {@link module:enter/enter~Enter} plugin.\n *\n * For more information about this feature see the {@glink api/enter package page}.\n */\nexport default class ShiftEnter extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ShiftEnter';\n }\n init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n const conversion = editor.conversion;\n const view = editor.editing.view;\n const viewDocument = view.document;\n // Configure the schema.\n schema.register('softBreak', {\n allowWhere: '$text',\n isInline: true\n });\n // Configure converters.\n conversion.for('upcast')\n .elementToElement({\n model: 'softBreak',\n view: 'br'\n });\n conversion.for('downcast')\n .elementToElement({\n model: 'softBreak',\n view: (modelElement, { writer }) => writer.createEmptyElement('br')\n });\n view.addObserver(EnterObserver);\n editor.commands.add('shiftEnter', new ShiftEnterCommand(editor));\n this.listenTo(viewDocument, 'enter', (evt, data) => {\n // When not in composition, we handle the action, so prevent the default one.\n // When in composition, it's the browser who modify the DOM (renderer is disabled).\n if (!viewDocument.isComposing) {\n data.preventDefault();\n }\n // The hard enter key is handled by the Enter plugin.\n if (!data.isSoft) {\n return;\n }\n editor.execute('shiftEnter');\n view.scrollToTheSelection();\n }, { priority: 'low' });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module widget/highlightstack\n */\nimport { EmitterMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * Class used to handle the correct order of highlights on elements.\n *\n * When different highlights are applied to same element the correct order should be preserved:\n *\n * * highlight with highest priority should be applied,\n * * if two highlights have same priority - sort by CSS class provided in\n * {@link module:engine/conversion/downcasthelpers~HighlightDescriptor}.\n *\n * This way, highlight will be applied with the same rules it is applied on texts.\n */\nexport default class HighlightStack extends EmitterMixin() {\n constructor() {\n super(...arguments);\n this._stack = [];\n }\n /**\n * Adds highlight descriptor to the stack.\n *\n * @fires change:top\n */\n add(descriptor, writer) {\n const stack = this._stack;\n // Save top descriptor and insert new one. If top is changed - fire event.\n const oldTop = stack[0];\n this._insertDescriptor(descriptor);\n const newTop = stack[0];\n // When new object is at the top and stores different information.\n if (oldTop !== newTop && !compareDescriptors(oldTop, newTop)) {\n this.fire('change:top', {\n oldDescriptor: oldTop,\n newDescriptor: newTop,\n writer\n });\n }\n }\n /**\n * Removes highlight descriptor from the stack.\n *\n * @fires change:top\n * @param id Id of the descriptor to remove.\n */\n remove(id, writer) {\n const stack = this._stack;\n const oldTop = stack[0];\n this._removeDescriptor(id);\n const newTop = stack[0];\n // When new object is at the top and stores different information.\n if (oldTop !== newTop && !compareDescriptors(oldTop, newTop)) {\n this.fire('change:top', {\n oldDescriptor: oldTop,\n newDescriptor: newTop,\n writer\n });\n }\n }\n /**\n * Inserts a given descriptor in correct place in the stack. It also takes care about updating information\n * when descriptor with same id is already present.\n */\n _insertDescriptor(descriptor) {\n const stack = this._stack;\n const index = stack.findIndex(item => item.id === descriptor.id);\n // Inserting exact same descriptor - do nothing.\n if (compareDescriptors(descriptor, stack[index])) {\n return;\n }\n // If descriptor with same id but with different information is on the stack - remove it.\n if (index > -1) {\n stack.splice(index, 1);\n }\n // Find correct place to insert descriptor in the stack.\n // It has different information (for example priority) so it must be re-inserted in correct place.\n let i = 0;\n while (stack[i] && shouldABeBeforeB(stack[i], descriptor)) {\n i++;\n }\n stack.splice(i, 0, descriptor);\n }\n /**\n * Removes descriptor with given id from the stack.\n *\n * @param id Descriptor's id.\n */\n _removeDescriptor(id) {\n const stack = this._stack;\n const index = stack.findIndex(item => item.id === id);\n // If descriptor with same id is on the list - remove it.\n if (index > -1) {\n stack.splice(index, 1);\n }\n }\n}\n/**\n * Compares two descriptors by checking their priority and class list.\n *\n * @returns Returns true if both descriptors are defined and have same priority and classes.\n */\nfunction compareDescriptors(a, b) {\n return a && b && a.priority == b.priority && classesToString(a.classes) == classesToString(b.classes);\n}\n/**\n * Checks whenever first descriptor should be placed in the stack before second one.\n */\nfunction shouldABeBeforeB(a, b) {\n if (a.priority > b.priority) {\n return true;\n }\n else if (a.priority < b.priority) {\n return false;\n }\n // When priorities are equal and names are different - use classes to compare.\n return classesToString(a.classes) > classesToString(b.classes);\n}\n/**\n * Converts CSS classes passed with {@link module:engine/conversion/downcasthelpers~HighlightDescriptor} to\n * sorted string.\n */\nfunction classesToString(classes) {\n return Array.isArray(classes) ? classes.sort().join(',') : classes;\n}\n","export default \"<svg viewBox=\\\"0 0 16 16\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M4 0v1H1v3H0V.5A.5.5 0 0 1 .5 0H4zm8 0h3.5a.5.5 0 0 1 .5.5V4h-1V1h-3V0zM4 16H.5a.5.5 0 0 1-.5-.5V12h1v3h3v1zm8 0v-1h3v-3h1v3.5a.5.5 0 0 1-.5.5H12z\\\"/><path fill-opacity=\\\".256\\\" d=\\\"M1 1h14v14H1z\\\"/><g class=\\\"ck-icon__selected-indicator\\\"><path d=\\\"M7 0h2v1H7V0zM0 7h1v2H0V7zm15 0h1v2h-1V7zm-8 8h2v1H7v-1z\\\"/><path fill-opacity=\\\".254\\\" d=\\\"M1 1h14v14H1z\\\"/></g></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module widget/utils\n */\nimport { CKEditorError, toArray } from '@ckeditor/ckeditor5-utils';\nimport { findOptimalInsertionRange as engineFindOptimalInsertionRange } from '@ckeditor/ckeditor5-engine';\nimport { IconView } from '@ckeditor/ckeditor5-ui';\nimport HighlightStack from './highlightstack';\nimport { getTypeAroundFakeCaretPosition } from './widgettypearound/utils';\nimport dragHandleIcon from '../theme/icons/drag-handle.svg';\n/**\n * CSS class added to each widget element.\n */\nexport const WIDGET_CLASS_NAME = 'ck-widget';\n/**\n * CSS class added to currently selected widget element.\n */\nexport const WIDGET_SELECTED_CLASS_NAME = 'ck-widget_selected';\n/**\n * Returns `true` if given {@link module:engine/view/node~Node} is an {@link module:engine/view/element~Element} and a widget.\n */\nexport function isWidget(node) {\n if (!node.is('element')) {\n return false;\n }\n return !!node.getCustomProperty('widget');\n}\n/**\n * Converts the given {@link module:engine/view/element~Element} to a widget in the following way:\n *\n * * sets the `contenteditable` attribute to `\"false\"`,\n * * adds the `ck-widget` CSS class,\n * * adds a custom {@link module:engine/view/element~Element#getFillerOffset `getFillerOffset()`} method returning `null`,\n * * adds a custom property allowing to recognize widget elements by using {@link ~isWidget `isWidget()`},\n * * implements the {@link ~setHighlightHandling view highlight on widgets}.\n *\n * This function needs to be used in conjunction with\n * {@link module:engine/conversion/downcasthelpers~DowncastHelpers downcast conversion helpers}\n * like {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`}.\n * Moreover, typically you will want to use `toWidget()` only for `editingDowncast`, while keeping the `dataDowncast` clean.\n *\n * For example, in order to convert a `<widget>` model element to `<div class=\"widget\">` in the view, you can define\n * such converters:\n *\n * ```ts\n * editor.conversion.for( 'editingDowncast' )\n * \t.elementToElement( {\n * \t\tmodel: 'widget',\n * \t\tview: ( modelItem, { writer } ) => {\n * \t\t\tconst div = writer.createContainerElement( 'div', { class: 'widget' } );\n *\n * \t\t\treturn toWidget( div, writer, { label: 'some widget' } );\n * \t\t}\n * \t} );\n *\n * editor.conversion.for( 'dataDowncast' )\n * \t.elementToElement( {\n * \t\tmodel: 'widget',\n * \t\tview: ( modelItem, { writer } ) => {\n * \t\t\treturn writer.createContainerElement( 'div', { class: 'widget' } );\n * \t\t}\n * \t} );\n * ```\n *\n * See the full source code of the widget (with a nested editable) schema definition and converters in\n * [this sample](https://github.com/ckeditor/ckeditor5-widget/blob/master/tests/manual/widget-with-nestededitable.js).\n *\n * @param options Additional options.\n * @param options.label Element's label provided to the {@link ~setLabel} function. It can be passed as\n * a plain string or a function returning a string. It represents the widget for assistive technologies (like screen readers).\n * @param options.hasSelectionHandle If `true`, the widget will have a selection handle added.\n * @returns Returns the same element.\n */\nexport function toWidget(element, writer, options = {}) {\n if (!element.is('containerElement')) {\n /**\n * The element passed to `toWidget()` must be a {@link module:engine/view/containerelement~ContainerElement}\n * instance.\n *\n * @error widget-to-widget-wrong-element-type\n * @param element The view element passed to `toWidget()`.\n */\n throw new CKEditorError('widget-to-widget-wrong-element-type', null, { element });\n }\n writer.setAttribute('contenteditable', 'false', element);\n writer.addClass(WIDGET_CLASS_NAME, element);\n writer.setCustomProperty('widget', true, element);\n element.getFillerOffset = getFillerOffset;\n writer.setCustomProperty('widgetLabel', [], element);\n if (options.label) {\n setLabel(element, options.label);\n }\n if (options.hasSelectionHandle) {\n addSelectionHandle(element, writer);\n }\n setHighlightHandling(element, writer);\n return element;\n}\n/**\n * Default handler for adding a highlight on a widget.\n * It adds CSS class and attributes basing on the given highlight descriptor.\n */\nfunction addHighlight(element, descriptor, writer) {\n if (descriptor.classes) {\n writer.addClass(toArray(descriptor.classes), element);\n }\n if (descriptor.attributes) {\n for (const key in descriptor.attributes) {\n writer.setAttribute(key, descriptor.attributes[key], element);\n }\n }\n}\n/**\n * Default handler for removing a highlight from a widget.\n * It removes CSS class and attributes basing on the given highlight descriptor.\n */\nfunction removeHighlight(element, descriptor, writer) {\n if (descriptor.classes) {\n writer.removeClass(toArray(descriptor.classes), element);\n }\n if (descriptor.attributes) {\n for (const key in descriptor.attributes) {\n writer.removeAttribute(key, element);\n }\n }\n}\n/**\n * Sets highlight handling methods. Uses {@link module:widget/highlightstack~HighlightStack} to\n * properly determine which highlight descriptor should be used at given time.\n */\nexport function setHighlightHandling(element, writer, add = addHighlight, remove = removeHighlight) {\n const stack = new HighlightStack();\n stack.on('change:top', (evt, data) => {\n if (data.oldDescriptor) {\n remove(element, data.oldDescriptor, data.writer);\n }\n if (data.newDescriptor) {\n add(element, data.newDescriptor, data.writer);\n }\n });\n const addHighlightCallback = (element, descriptor, writer) => stack.add(descriptor, writer);\n const removeHighlightCallback = (element, id, writer) => stack.remove(id, writer);\n writer.setCustomProperty('addHighlight', addHighlightCallback, element);\n writer.setCustomProperty('removeHighlight', removeHighlightCallback, element);\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 `getLabel()`}.\n */\nexport function setLabel(element, labelOrCreator) {\n const widgetLabel = element.getCustomProperty('widgetLabel');\n widgetLabel.push(labelOrCreator);\n}\n/**\n * Returns the label of the provided element.\n */\nexport function getLabel(element) {\n const widgetLabel = element.getCustomProperty('widgetLabel');\n return widgetLabel.reduce((prev, current) => {\n if (typeof current === 'function') {\n return prev ? prev + '. ' + current() : current();\n }\n else {\n return prev ? prev + '. ' + current : current;\n }\n }, '');\n}\n/**\n * Adds functionality to the provided {@link module:engine/view/editableelement~EditableElement} to act as a widget's editable:\n *\n * * sets the `contenteditable` attribute to `true` when {@link module:engine/view/editableelement~EditableElement#isReadOnly} is `false`,\n * otherwise sets it to `false`,\n * * adds the `ck-editor__editable` and `ck-editor__nested-editable` CSS classes,\n * * adds the `ck-editor__nested-editable_focused` CSS class when the editable is focused and removes it when it is blurred.\n * * implements the {@link ~setHighlightHandling view highlight on widget's editable}.\n *\n * Similarly to {@link ~toWidget `toWidget()`} this function should be used in `editingDowncast` only and it is usually\n * used together with {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`}.\n *\n * For example, in order to convert a `<nested>` model element to `<div class=\"nested\">` in the view, you can define\n * such converters:\n *\n * ```ts\n * editor.conversion.for( 'editingDowncast' )\n * \t.elementToElement( {\n * \t\tmodel: 'nested',\n * \t\tview: ( modelItem, { writer } ) => {\n * \t\t\tconst div = writer.createEditableElement( 'div', { class: 'nested' } );\n *\n * \t\t\treturn toWidgetEditable( nested, writer, { label: 'label for editable' } );\n * \t\t}\n * \t} );\n *\n * editor.conversion.for( 'dataDowncast' )\n * \t.elementToElement( {\n * \t\tmodel: 'nested',\n * \t\tview: ( modelItem, { writer } ) => {\n * \t\t\treturn writer.createContainerElement( 'div', { class: 'nested' } );\n * \t\t}\n * \t} );\n * ```\n *\n * See the full source code of the widget (with nested editable) schema definition and converters in\n * [this sample](https://github.com/ckeditor/ckeditor5-widget/blob/master/tests/manual/widget-with-nestededitable.js).\n *\n * @param options Additional options.\n * @param options.label Editable's label used by assistive technologies (e.g. screen readers).\n * @returns Returns the same element that was provided in the `editable` parameter\n */\nexport function toWidgetEditable(editable, writer, options = {}) {\n writer.addClass(['ck-editor__editable', 'ck-editor__nested-editable'], editable);\n writer.setAttribute('role', 'textbox', editable);\n if (options.label) {\n writer.setAttribute('aria-label', options.label, editable);\n }\n // Set initial contenteditable value.\n writer.setAttribute('contenteditable', editable.isReadOnly ? 'false' : 'true', editable);\n // Bind the contenteditable property to element#isReadOnly.\n editable.on('change:isReadOnly', (evt, property, is) => {\n writer.setAttribute('contenteditable', is ? 'false' : 'true', editable);\n });\n editable.on('change:isFocused', (evt, property, is) => {\n if (is) {\n writer.addClass('ck-editor__nested-editable_focused', editable);\n }\n else {\n writer.removeClass('ck-editor__nested-editable_focused', editable);\n }\n });\n setHighlightHandling(editable, writer);\n return editable;\n}\n/**\n * Returns a model range which is optimal (in terms of UX) for inserting a widget block.\n *\n * For instance, if a selection is in the middle of a paragraph, the collapsed range before this paragraph\n * will be returned so that it is not split. If the selection is at the end of a paragraph,\n * the collapsed range after this paragraph will be returned.\n *\n * Note: If the selection is placed in an empty block, the range in that block will be returned. If that range\n * is then passed to {@link module:engine/model/model~Model#insertContent}, the block will be fully replaced\n * by the inserted widget block.\n *\n * @param selection The selection based on which the insertion position should be calculated.\n * @param model Model instance.\n * @returns The optimal range.\n */\nexport function findOptimalInsertionRange(selection, model) {\n const selectedElement = selection.getSelectedElement();\n if (selectedElement) {\n const typeAroundFakeCaretPosition = getTypeAroundFakeCaretPosition(selection);\n // If the WidgetTypeAround \"fake caret\" is displayed, use its position for the insertion\n // to provide the most predictable UX (https://github.com/ckeditor/ckeditor5/issues/7438).\n if (typeAroundFakeCaretPosition) {\n return model.createRange(model.createPositionAt(selectedElement, typeAroundFakeCaretPosition));\n }\n }\n return engineFindOptimalInsertionRange(selection, model);\n}\n/**\n * A util to be used in order to map view positions to correct model positions when implementing a widget\n * which renders non-empty view element for an empty model element.\n *\n * For example:\n *\n * ```\n * // Model:\n * <placeholder type=\"name\"></placeholder>\n *\n * // View:\n * <span class=\"placeholder\">name</span>\n * ```\n *\n * In such case, view positions inside `<span>` cannot be correctly mapped to the model (because the model element is empty).\n * To handle mapping positions inside `<span class=\"placeholder\">` to the model use this util as follows:\n *\n * ```ts\n * editor.editing.mapper.on(\n * \t'viewToModelPosition',\n * \tviewToModelPositionOutsideModelElement( model, viewElement => viewElement.hasClass( 'placeholder' ) )\n * );\n * ```\n *\n * The callback will try to map the view offset of selection to an expected model position.\n *\n * 1. When the position is at the end (or in the middle) of the inline widget:\n *\n * ```\n * // View:\n * <p>foo <span class=\"placeholder\">name|</span> bar</p>\n *\n * // Model:\n * <paragraph>foo <placeholder type=\"name\"></placeholder>| bar</paragraph>\n * ```\n *\n * 2. When the position is at the beginning of the inline widget:\n *\n * ```\n * // View:\n * <p>foo <span class=\"placeholder\">|name</span> bar</p>\n *\n * // Model:\n * <paragraph>foo |<placeholder type=\"name\"></placeholder> bar</paragraph>\n * ```\n *\n * @param model Model instance on which the callback operates.\n * @param viewElementMatcher Function that is passed a view element and should return `true` if the custom mapping\n * should be applied to the given view element.\n */\nexport function viewToModelPositionOutsideModelElement(model, viewElementMatcher) {\n return (evt, data) => {\n const { mapper, viewPosition } = data;\n const viewParent = mapper.findMappedViewAncestor(viewPosition);\n if (!viewElementMatcher(viewParent)) {\n return;\n }\n const modelParent = mapper.toModelElement(viewParent);\n data.modelPosition = model.createPositionAt(modelParent, viewPosition.isAtStart ? 'before' : 'after');\n };\n}\n/**\n * Default filler offset function applied to all widget elements.\n */\nfunction getFillerOffset() {\n return null;\n}\n/**\n * Adds a drag handle to the widget.\n */\nfunction addSelectionHandle(widgetElement, writer) {\n const selectionHandle = writer.createUIElement('div', { class: 'ck ck-widget__selection-handle' }, function (domDocument) {\n const domElement = this.toDomElement(domDocument);\n // Use the IconView from the ui library.\n const icon = new IconView();\n icon.set('content', dragHandleIcon);\n // Render the icon view right away to append its #element to the selectionHandle DOM element.\n icon.render();\n domElement.appendChild(icon.element);\n return domElement;\n });\n // Append the selection handle into the widget wrapper.\n writer.insert(writer.createPositionAt(widgetElement, 0), selectionHandle);\n writer.addClass(['ck-widget_with-selection-handle'], widgetElement);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module widget/widgettypearound/utils\n */\nimport { isWidget } from '../utils';\n/**\n * The name of the type around model selection attribute responsible for\n * displaying a fake caret next to a selected widget.\n */\nexport const TYPE_AROUND_SELECTION_ATTRIBUTE = 'widget-type-around';\n/**\n * Checks if an element is a widget that qualifies to get the widget type around UI.\n */\nexport function isTypeAroundWidget(viewElement, modelElement, schema) {\n return !!viewElement && isWidget(viewElement) && !schema.isInline(modelElement);\n}\n/**\n * For the passed HTML element, this helper finds the closest widget type around button ancestor.\n */\nexport function getClosestTypeAroundDomButton(domElement) {\n return domElement.closest('.ck-widget__type-around__button');\n}\n/**\n * For the passed widget type around button element, this helper determines at which position\n * the paragraph would be inserted into the content if, for instance, the button was\n * clicked by the user.\n *\n * @returns The position of the button.\n */\nexport function getTypeAroundButtonPosition(domElement) {\n return domElement.classList.contains('ck-widget__type-around__button_before') ? 'before' : 'after';\n}\n/**\n * For the passed HTML element, this helper returns the closest view widget ancestor.\n */\nexport function getClosestWidgetViewElement(domElement, domConverter) {\n const widgetDomElement = domElement.closest('.ck-widget');\n return domConverter.mapDomToView(widgetDomElement);\n}\n/**\n * For the passed selection instance, it returns the position of the fake caret displayed next to a widget.\n *\n * **Note**: If the fake caret is not currently displayed, `null` is returned.\n *\n * @returns The position of the fake caret or `null` when none is present.\n */\nexport function getTypeAroundFakeCaretPosition(selection) {\n return selection.getAttribute(TYPE_AROUND_SELECTION_ATTRIBUTE);\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./widgettypearound.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* global DOMParser */\n/**\n * @module widget/widgettypearound/widgettypearound\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { Template } from '@ckeditor/ckeditor5-ui';\nimport { Enter } from '@ckeditor/ckeditor5-enter';\nimport { Delete } from '@ckeditor/ckeditor5-typing';\nimport { env, isForwardArrowKeyCode } from '@ckeditor/ckeditor5-utils';\nimport { isTypeAroundWidget, getClosestTypeAroundDomButton, getTypeAroundButtonPosition, getClosestWidgetViewElement, getTypeAroundFakeCaretPosition, TYPE_AROUND_SELECTION_ATTRIBUTE } from './utils';\nimport { isWidget } from '../utils';\nimport returnIcon from '../../theme/icons/return-arrow.svg';\nimport '../../theme/widgettypearound.css';\nconst POSSIBLE_INSERTION_POSITIONS = ['before', 'after'];\n// Do the SVG parsing once and then clone the result <svg> DOM element for each new button.\nconst RETURN_ARROW_ICON_ELEMENT = new DOMParser().parseFromString(returnIcon, 'image/svg+xml').firstChild;\nconst PLUGIN_DISABLED_EDITING_ROOT_CLASS = 'ck-widget__type-around_disabled';\n/**\n * A plugin that allows users to type around widgets where normally it is impossible to place the caret due\n * to limitations of web browsers. These \"tight spots\" occur, for instance, before (or after) a widget being\n * the first (or last) child of its parent or between two block widgets.\n *\n * This plugin extends the {@link module:widget/widget~Widget `Widget`} plugin and injects the user interface\n * with two buttons into each widget instance in the editor. Each of the buttons can be clicked by the\n * user if the widget is next to the \"tight spot\". Once clicked, a paragraph is created with the selection anchored\n * in it so that users can type (or insert content, paste, etc.) straight away.\n */\nexport default class WidgetTypeAround extends Plugin {\n constructor() {\n super(...arguments);\n /**\n * A reference to the model widget element that has the fake caret active\n * on either side of it. It is later used to remove CSS classes associated with the fake caret\n * when the widget no longer needs it.\n */\n this._currentFakeCaretModelElement = null;\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'WidgetTypeAround';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [Enter, Delete];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const editingView = editor.editing.view;\n // Set a CSS class on the view editing root when the plugin is disabled so all the buttons\n // and lines visually disappear. All the interactions are disabled in individual plugin methods.\n this.on('change:isEnabled', (evt, data, isEnabled) => {\n editingView.change(writer => {\n for (const root of editingView.document.roots) {\n if (isEnabled) {\n writer.removeClass(PLUGIN_DISABLED_EDITING_ROOT_CLASS, root);\n }\n else {\n writer.addClass(PLUGIN_DISABLED_EDITING_ROOT_CLASS, root);\n }\n }\n });\n if (!isEnabled) {\n editor.model.change(writer => {\n writer.removeSelectionAttribute(TYPE_AROUND_SELECTION_ATTRIBUTE);\n });\n }\n });\n this._enableTypeAroundUIInjection();\n this._enableInsertingParagraphsOnButtonClick();\n this._enableInsertingParagraphsOnEnterKeypress();\n this._enableInsertingParagraphsOnTypingKeystroke();\n this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows();\n this._enableDeleteIntegration();\n this._enableInsertContentIntegration();\n this._enableInsertObjectIntegration();\n this._enableDeleteContentIntegration();\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this._currentFakeCaretModelElement = null;\n }\n /**\n * Inserts a new paragraph next to a widget element with the selection anchored in it.\n *\n * **Note**: This method is heavily user-oriented and will both focus the editing view and scroll\n * the viewport to the selection in the inserted paragraph.\n *\n * @param widgetModelElement The model widget element next to which a paragraph is inserted.\n * @param position The position where the paragraph is inserted. Either `'before'` or `'after'` the widget.\n */\n _insertParagraph(widgetModelElement, position) {\n const editor = this.editor;\n const editingView = editor.editing.view;\n const attributesToCopy = editor.model.schema.getAttributesWithProperty(widgetModelElement, 'copyOnReplace', true);\n editor.execute('insertParagraph', {\n position: editor.model.createPositionAt(widgetModelElement, position),\n attributes: attributesToCopy\n });\n editingView.focus();\n editingView.scrollToTheSelection();\n }\n /**\n * A wrapper for the {@link module:utils/emittermixin~Emitter#listenTo} method that executes the callbacks only\n * when the plugin {@link #isEnabled is enabled}.\n *\n * @param emitter The object that fires the event.\n * @param event The name of the event.\n * @param callback The function to be called on event.\n * @param options Additional options.\n * @param options.priority The priority of this event callback. The higher the priority value the sooner\n * the callback will be fired. Events having the same priority are called in the order they were added.\n */\n _listenToIfEnabled(emitter, event, callback, options) {\n this.listenTo(emitter, event, (...args) => {\n // Do not respond if the plugin is disabled.\n if (this.isEnabled) {\n callback(...args);\n }\n }, options);\n }\n /**\n * Similar to {@link #_insertParagraph}, this method inserts a paragraph except that it\n * does not expect a position. Instead, it performs the insertion next to a selected widget\n * according to the `widget-type-around` model selection attribute value (fake caret position).\n *\n * Because this method requires the `widget-type-around` attribute to be set,\n * the insertion can only happen when the widget's fake caret is active (e.g. activated\n * using the keyboard).\n *\n * @returns Returns `true` when the paragraph was inserted (the attribute was present) and `false` otherwise.\n */\n _insertParagraphAccordingToFakeCaretPosition() {\n const editor = this.editor;\n const model = editor.model;\n const modelSelection = model.document.selection;\n const typeAroundFakeCaretPosition = getTypeAroundFakeCaretPosition(modelSelection);\n if (!typeAroundFakeCaretPosition) {\n return false;\n }\n // @if CK_DEBUG_TYPING // if ( ( window as any ).logCKETyping ) {\n // @if CK_DEBUG_TYPING // \tconsole.info( '%c[WidgetTypeAround]%c Fake caret -> insert paragraph',\n // @if CK_DEBUG_TYPING // \t\t'font-weight: bold; color: green', ''\n // @if CK_DEBUG_TYPING // \t);\n // @if CK_DEBUG_TYPING // }\n const selectedModelElement = modelSelection.getSelectedElement();\n this._insertParagraph(selectedModelElement, typeAroundFakeCaretPosition);\n return true;\n }\n /**\n * Creates a listener in the editing conversion pipeline that injects the widget type around\n * UI into every single widget instance created in the editor.\n *\n * The UI is delivered as a {@link module:engine/view/uielement~UIElement}\n * wrapper which renders DOM buttons that users can use to insert paragraphs.\n */\n _enableTypeAroundUIInjection() {\n const editor = this.editor;\n const schema = editor.model.schema;\n const t = editor.locale.t;\n const buttonTitles = {\n before: t('Insert paragraph before block'),\n after: t('Insert paragraph after block')\n };\n editor.editing.downcastDispatcher.on('insert', (evt, data, conversionApi) => {\n const viewElement = conversionApi.mapper.toViewElement(data.item);\n if (!viewElement) {\n return;\n }\n // Filter out non-widgets and inline widgets.\n if (isTypeAroundWidget(viewElement, data.item, schema)) {\n injectUIIntoWidget(conversionApi.writer, buttonTitles, viewElement);\n const widgetLabel = viewElement.getCustomProperty('widgetLabel');\n widgetLabel.push(() => {\n return this.isEnabled ? t('Press Enter to type after or press Shift + Enter to type before the widget') : '';\n });\n }\n }, { priority: 'low' });\n }\n /**\n * Brings support for the fake caret that appears when either:\n *\n * * the selection moves to a widget from a position next to it using arrow keys,\n * * the arrow key is pressed when the widget is already selected.\n *\n * The fake caret lets the user know that they can start typing or just press\n * <kbd>Enter</kbd> to insert a paragraph at the position next to a widget as suggested by the fake caret.\n *\n * The fake caret disappears when the user changes the selection or the editor\n * gets blurred.\n *\n * The whole idea is as follows:\n *\n * 1. A user does one of the 2 scenarios described at the beginning.\n * 2. The \"keydown\" listener is executed and the decision is made whether to show or hide the fake caret.\n * 3. If it should show up, the `widget-type-around` model selection attribute is set indicating\n * on which side of the widget it should appear.\n * 4. The selection dispatcher reacts to the selection attribute and sets CSS classes responsible for the\n * fake caret on the view widget.\n * 5. If the fake caret should disappear, the selection attribute is removed and the dispatcher\n * does the CSS class clean-up in the view.\n * 6. Additionally, `change:range` and `FocusTracker#isFocused` listeners also remove the selection\n * attribute (the former also removes widget CSS classes).\n */\n _enableTypeAroundFakeCaretActivationUsingKeyboardArrows() {\n const editor = this.editor;\n const model = editor.model;\n const modelSelection = model.document.selection;\n const schema = model.schema;\n const editingView = editor.editing.view;\n // This is the main listener responsible for the fake caret.\n // Note: The priority must precede the default Widget class keydown handler (\"high\").\n this._listenToIfEnabled(editingView.document, 'arrowKey', (evt, domEventData) => {\n this._handleArrowKeyPress(evt, domEventData);\n }, { context: [isWidget, '$text'], priority: 'high' });\n // This listener makes sure the widget type around selection attribute will be gone from the model\n // selection as soon as the model range changes. This attribute only makes sense when a widget is selected\n // (and the \"fake horizontal caret\" is visible) so whenever the range changes (e.g. selection moved somewhere else),\n // let's get rid of the attribute so that the selection downcast dispatcher isn't even bothered.\n this._listenToIfEnabled(modelSelection, 'change:range', (evt, data) => {\n // Do not reset the selection attribute when the change was indirect.\n if (!data.directChange) {\n return;\n }\n // Get rid of the widget type around attribute of the selection on every change:range.\n // If the range changes, it means for sure, the user is no longer in the active (\"fake horizontal caret\") mode.\n editor.model.change(writer => {\n writer.removeSelectionAttribute(TYPE_AROUND_SELECTION_ATTRIBUTE);\n });\n });\n // Get rid of the widget type around attribute of the selection on every document change\n // that makes widget not selected any more (i.e. widget was removed).\n this._listenToIfEnabled(model.document, 'change:data', () => {\n const selectedModelElement = modelSelection.getSelectedElement();\n if (selectedModelElement) {\n const selectedViewElement = editor.editing.mapper.toViewElement(selectedModelElement);\n if (isTypeAroundWidget(selectedViewElement, selectedModelElement, schema)) {\n return;\n }\n }\n editor.model.change(writer => {\n writer.removeSelectionAttribute(TYPE_AROUND_SELECTION_ATTRIBUTE);\n });\n });\n // React to changes of the model selection attribute made by the arrow keys listener.\n // If the block widget is selected and the attribute changes, downcast the attribute to special\n // CSS classes associated with the active (\"fake horizontal caret\") mode of the widget.\n this._listenToIfEnabled(editor.editing.downcastDispatcher, 'selection', (evt, data, conversionApi) => {\n const writer = conversionApi.writer;\n if (this._currentFakeCaretModelElement) {\n const selectedViewElement = conversionApi.mapper.toViewElement(this._currentFakeCaretModelElement);\n if (selectedViewElement) {\n // Get rid of CSS classes associated with the active (\"fake horizontal caret\") mode from the view widget.\n writer.removeClass(POSSIBLE_INSERTION_POSITIONS.map(positionToWidgetCssClass), selectedViewElement);\n this._currentFakeCaretModelElement = null;\n }\n }\n const selectedModelElement = data.selection.getSelectedElement();\n if (!selectedModelElement) {\n return;\n }\n const selectedViewElement = conversionApi.mapper.toViewElement(selectedModelElement);\n if (!isTypeAroundWidget(selectedViewElement, selectedModelElement, schema)) {\n return;\n }\n const typeAroundFakeCaretPosition = getTypeAroundFakeCaretPosition(data.selection);\n if (!typeAroundFakeCaretPosition) {\n return;\n }\n writer.addClass(positionToWidgetCssClass(typeAroundFakeCaretPosition), selectedViewElement);\n // Remember the view widget that got the \"fake-caret\" CSS class. This class should be removed ASAP when the\n // selection changes\n this._currentFakeCaretModelElement = selectedModelElement;\n });\n this._listenToIfEnabled(editor.ui.focusTracker, 'change:isFocused', (evt, name, isFocused) => {\n if (!isFocused) {\n editor.model.change(writer => {\n writer.removeSelectionAttribute(TYPE_AROUND_SELECTION_ATTRIBUTE);\n });\n }\n });\n function positionToWidgetCssClass(position) {\n return `ck-widget_type-around_show-fake-caret_${position}`;\n }\n }\n /**\n * A listener executed on each \"keydown\" in the view document, a part of\n * {@link #_enableTypeAroundFakeCaretActivationUsingKeyboardArrows}.\n *\n * It decides whether the arrow keypress should activate the fake caret or not (also whether it should\n * be deactivated).\n *\n * The fake caret activation is done by setting the `widget-type-around` model selection attribute\n * in this listener, and stopping and preventing the event that would normally be handled by the widget\n * plugin that is responsible for the regular keyboard navigation near/across all widgets (that\n * includes inline widgets, which are ignored by the widget type around plugin).\n */\n _handleArrowKeyPress(evt, domEventData) {\n const editor = this.editor;\n const model = editor.model;\n const modelSelection = model.document.selection;\n const schema = model.schema;\n const editingView = editor.editing.view;\n const keyCode = domEventData.keyCode;\n const isForward = isForwardArrowKeyCode(keyCode, editor.locale.contentLanguageDirection);\n const selectedViewElement = editingView.document.selection.getSelectedElement();\n const selectedModelElement = editor.editing.mapper.toModelElement(selectedViewElement);\n let shouldStopAndPreventDefault;\n // Handle keyboard navigation when a type-around-compatible widget is currently selected.\n if (isTypeAroundWidget(selectedViewElement, selectedModelElement, schema)) {\n shouldStopAndPreventDefault = this._handleArrowKeyPressOnSelectedWidget(isForward);\n }\n // Handle keyboard arrow navigation when the selection is next to a type-around-compatible widget\n // and the widget is about to be selected.\n else if (modelSelection.isCollapsed) {\n shouldStopAndPreventDefault = this._handleArrowKeyPressWhenSelectionNextToAWidget(isForward);\n }\n // Handle collapsing a non-collapsed selection that is wider than on a single widget.\n else if (!domEventData.shiftKey) {\n shouldStopAndPreventDefault = this._handleArrowKeyPressWhenNonCollapsedSelection(isForward);\n }\n if (shouldStopAndPreventDefault) {\n domEventData.preventDefault();\n evt.stop();\n }\n }\n /**\n * Handles the keyboard navigation on \"keydown\" when a widget is currently selected and activates or deactivates\n * the fake caret for that widget, depending on the current value of the `widget-type-around` model\n * selection attribute and the direction of the pressed arrow key.\n *\n * @param isForward `true` when the pressed arrow key was responsible for the forward model selection movement\n * as in {@link module:utils/keyboard~isForwardArrowKeyCode}.\n * @returns Returns `true` when the keypress was handled and no other keydown listener of the editor should\n * process the event any further. Returns `false` otherwise.\n */\n _handleArrowKeyPressOnSelectedWidget(isForward) {\n const editor = this.editor;\n const model = editor.model;\n const modelSelection = model.document.selection;\n const typeAroundFakeCaretPosition = getTypeAroundFakeCaretPosition(modelSelection);\n return model.change(writer => {\n // If the fake caret is displayed...\n if (typeAroundFakeCaretPosition) {\n const isLeavingWidget = typeAroundFakeCaretPosition === (isForward ? 'after' : 'before');\n // If the keyboard arrow works against the value of the selection attribute...\n // then remove the selection attribute but prevent default DOM actions\n // and do not let the Widget plugin listener move the selection. This brings\n // the widget back to the state, for instance, like if was selected using the mouse.\n //\n // **Note**: If leaving the widget when the fake caret is active, then the default\n // Widget handler will change the selection and, in turn, this will automatically discard\n // the selection attribute.\n if (!isLeavingWidget) {\n writer.removeSelectionAttribute(TYPE_AROUND_SELECTION_ATTRIBUTE);\n return true;\n }\n }\n // If the fake caret wasn't displayed, let's set it now according to the direction of the arrow\n // key press. This also means we cannot let the Widget plugin listener move the selection.\n else {\n writer.setSelectionAttribute(TYPE_AROUND_SELECTION_ATTRIBUTE, isForward ? 'after' : 'before');\n return true;\n }\n return false;\n });\n }\n /**\n * Handles the keyboard navigation on \"keydown\" when **no** widget is selected but the selection is **directly** next\n * to one and upon the fake caret should become active for this widget upon arrow keypress\n * (AKA entering/selecting the widget).\n *\n * **Note**: This code mirrors the implementation from the widget plugin but also adds the selection attribute.\n * Unfortunately, there is no safe way to let the widget plugin do the selection part first and then just set the\n * selection attribute here in the widget type around plugin. This is why this code must duplicate some from the widget plugin.\n *\n * @param isForward `true` when the pressed arrow key was responsible for the forward model selection movement\n * as in {@link module:utils/keyboard~isForwardArrowKeyCode}.\n * @returns Returns `true` when the keypress was handled and no other keydown listener of the editor should\n * process the event any further. Returns `false` otherwise.\n */\n _handleArrowKeyPressWhenSelectionNextToAWidget(isForward) {\n const editor = this.editor;\n const model = editor.model;\n const schema = model.schema;\n const widgetPlugin = editor.plugins.get('Widget');\n // This is the widget the selection is about to be set on.\n const modelElementNextToSelection = widgetPlugin._getObjectElementNextToSelection(isForward);\n const viewElementNextToSelection = editor.editing.mapper.toViewElement(modelElementNextToSelection);\n if (isTypeAroundWidget(viewElementNextToSelection, modelElementNextToSelection, schema)) {\n model.change(writer => {\n widgetPlugin._setSelectionOverElement(modelElementNextToSelection);\n writer.setSelectionAttribute(TYPE_AROUND_SELECTION_ATTRIBUTE, isForward ? 'before' : 'after');\n });\n // The change() block above does the same job as the Widget plugin. The event can\n // be safely canceled.\n return true;\n }\n return false;\n }\n /**\n * Handles the keyboard navigation on \"keydown\" when a widget is currently selected (together with some other content)\n * and the widget is the first or last element in the selection. It activates or deactivates the fake caret for that widget.\n *\n * @param isForward `true` when the pressed arrow key was responsible for the forward model selection movement\n * as in {@link module:utils/keyboard~isForwardArrowKeyCode}.\n * @returns Returns `true` when the keypress was handled and no other keydown listener of the editor should\n * process the event any further. Returns `false` otherwise.\n */\n _handleArrowKeyPressWhenNonCollapsedSelection(isForward) {\n const editor = this.editor;\n const model = editor.model;\n const schema = model.schema;\n const mapper = editor.editing.mapper;\n const modelSelection = model.document.selection;\n const selectedModelNode = isForward ?\n modelSelection.getLastPosition().nodeBefore :\n modelSelection.getFirstPosition().nodeAfter;\n const selectedViewNode = mapper.toViewElement(selectedModelNode);\n // There is a widget at the collapse position so collapse the selection to the fake caret on it.\n if (isTypeAroundWidget(selectedViewNode, selectedModelNode, schema)) {\n model.change(writer => {\n writer.setSelection(selectedModelNode, 'on');\n writer.setSelectionAttribute(TYPE_AROUND_SELECTION_ATTRIBUTE, isForward ? 'after' : 'before');\n });\n return true;\n }\n return false;\n }\n /**\n * Registers a `mousedown` listener for the view document which intercepts events\n * coming from the widget type around UI, which happens when a user clicks one of the buttons\n * that insert a paragraph next to a widget.\n */\n _enableInsertingParagraphsOnButtonClick() {\n const editor = this.editor;\n const editingView = editor.editing.view;\n this._listenToIfEnabled(editingView.document, 'mousedown', (evt, domEventData) => {\n const button = getClosestTypeAroundDomButton(domEventData.domTarget);\n if (!button) {\n return;\n }\n const buttonPosition = getTypeAroundButtonPosition(button);\n const widgetViewElement = getClosestWidgetViewElement(button, editingView.domConverter);\n const widgetModelElement = editor.editing.mapper.toModelElement(widgetViewElement);\n this._insertParagraph(widgetModelElement, buttonPosition);\n domEventData.preventDefault();\n evt.stop();\n });\n }\n /**\n * Creates the <kbd>Enter</kbd> key listener on the view document that allows the user to insert a paragraph\n * near the widget when either:\n *\n * * The fake caret was first activated using the arrow keys,\n * * The entire widget is selected in the model.\n *\n * In the first case, the new paragraph is inserted according to the `widget-type-around` selection\n * attribute (see {@link #_handleArrowKeyPress}).\n *\n * In the second case, the new paragraph is inserted based on whether a soft (<kbd>Shift</kbd>+<kbd>Enter</kbd>) keystroke\n * was pressed or not.\n */\n _enableInsertingParagraphsOnEnterKeypress() {\n const editor = this.editor;\n const selection = editor.model.document.selection;\n const editingView = editor.editing.view;\n this._listenToIfEnabled(editingView.document, 'enter', (evt, domEventData) => {\n // This event could be triggered from inside the widget but we are interested\n // only when the widget is selected itself.\n if (evt.eventPhase != 'atTarget') {\n return;\n }\n const selectedModelElement = selection.getSelectedElement();\n const selectedViewElement = editor.editing.mapper.toViewElement(selectedModelElement);\n const schema = editor.model.schema;\n let wasHandled;\n // First check if the widget is selected and there's a type around selection attribute associated\n // with the fake caret that would tell where to insert a new paragraph.\n if (this._insertParagraphAccordingToFakeCaretPosition()) {\n wasHandled = true;\n }\n // Then, if there is no selection attribute associated with the fake caret, check if the widget\n // simply is selected and create a new paragraph according to the keystroke (Shift+)Enter.\n else if (isTypeAroundWidget(selectedViewElement, selectedModelElement, schema)) {\n this._insertParagraph(selectedModelElement, domEventData.isSoft ? 'before' : 'after');\n wasHandled = true;\n }\n if (wasHandled) {\n domEventData.preventDefault();\n evt.stop();\n }\n }, { context: isWidget });\n }\n /**\n * Similar to the {@link #_enableInsertingParagraphsOnEnterKeypress}, it allows the user\n * to insert a paragraph next to a widget when the fake caret was activated using arrow\n * keys but it responds to typing instead of <kbd>Enter</kbd>.\n *\n * Listener enabled by this method will insert a new paragraph according to the `widget-type-around`\n * model selection attribute as the user simply starts typing, which creates the impression that the fake caret\n * behaves like a real one rendered by the browser (AKA your text appears where the caret was).\n *\n * **Note**: At the moment this listener creates 2 undo steps: one for the `insertParagraph` command\n * and another one for actual typing. It is not a disaster but this may need to be fixed\n * sooner or later.\n */\n _enableInsertingParagraphsOnTypingKeystroke() {\n const editor = this.editor;\n const viewDocument = editor.editing.view.document;\n // Note: The priority must precede the default Input plugin insertText handler.\n this._listenToIfEnabled(viewDocument, 'insertText', (evt, data) => {\n if (this._insertParagraphAccordingToFakeCaretPosition()) {\n // The view selection in the event data contains the widget. If the new paragraph\n // was inserted, modify the view selection passed along with the insertText event\n // so the default event handler in the Input plugin starts typing inside the paragraph.\n // Otherwise, the typing would be over the widget.\n data.selection = viewDocument.selection;\n }\n }, { priority: 'high' });\n if (env.isAndroid) {\n // On Android with English keyboard, the composition starts just by putting caret\n // at the word end or by selecting a table column. This is not a real composition started.\n // Trigger delete content on first composition key pressed.\n this._listenToIfEnabled(viewDocument, 'keydown', (evt, data) => {\n if (data.keyCode == 229) {\n this._insertParagraphAccordingToFakeCaretPosition();\n }\n });\n }\n else {\n // Note: The priority must precede the default Input plugin compositionstart handler (to call it before delete content).\n this._listenToIfEnabled(viewDocument, 'compositionstart', () => {\n this._insertParagraphAccordingToFakeCaretPosition();\n }, { priority: 'high' });\n }\n }\n /**\n * It creates a \"delete\" event listener on the view document to handle cases when the <kbd>Delete</kbd> or <kbd>Backspace</kbd>\n * is pressed and the fake caret is currently active.\n *\n * The fake caret should create an illusion of a real browser caret so that when it appears before or after\n * a widget, pressing <kbd>Delete</kbd> or <kbd>Backspace</kbd> should remove a widget or delete the content\n * before or after a widget (depending on the content surrounding the widget).\n */\n _enableDeleteIntegration() {\n const editor = this.editor;\n const editingView = editor.editing.view;\n const model = editor.model;\n const schema = model.schema;\n this._listenToIfEnabled(editingView.document, 'delete', (evt, domEventData) => {\n // This event could be triggered from inside the widget but we are interested\n // only when the widget is selected itself.\n if (evt.eventPhase != 'atTarget') {\n return;\n }\n const typeAroundFakeCaretPosition = getTypeAroundFakeCaretPosition(model.document.selection);\n // This listener handles only these cases when the fake caret is active.\n if (!typeAroundFakeCaretPosition) {\n return;\n }\n const direction = domEventData.direction;\n const selectedModelWidget = model.document.selection.getSelectedElement();\n const isFakeCaretBefore = typeAroundFakeCaretPosition === 'before';\n const isDeleteForward = direction == 'forward';\n const shouldDeleteEntireWidget = isFakeCaretBefore === isDeleteForward;\n if (shouldDeleteEntireWidget) {\n editor.execute('delete', {\n selection: model.createSelection(selectedModelWidget, 'on')\n });\n }\n else {\n const range = schema.getNearestSelectionRange(model.createPositionAt(selectedModelWidget, typeAroundFakeCaretPosition), direction);\n // If there is somewhere to move selection to, then there will be something to delete.\n if (range) {\n // If the range is NOT collapsed, then we know that the range contains an object (see getNearestSelectionRange() docs).\n if (!range.isCollapsed) {\n model.change(writer => {\n writer.setSelection(range);\n editor.execute(isDeleteForward ? 'deleteForward' : 'delete');\n });\n }\n else {\n const probe = model.createSelection(range.start);\n model.modifySelection(probe, { direction });\n // If the range is collapsed, let's see if a non-collapsed range exists that can could be deleted.\n // If such range exists, use the editor command because it it safe for collaboration (it merges where it can).\n if (!probe.focus.isEqual(range.start)) {\n model.change(writer => {\n writer.setSelection(range);\n editor.execute(isDeleteForward ? 'deleteForward' : 'delete');\n });\n }\n // If there is no non-collapsed range to be deleted then we are sure that there is an empty element\n // next to a widget that should be removed. \"delete\" and \"deleteForward\" commands cannot get rid of it\n // so calling Model#deleteContent here manually.\n else {\n const deepestEmptyRangeAncestor = getDeepestEmptyElementAncestor(schema, range.start.parent);\n model.deleteContent(model.createSelection(deepestEmptyRangeAncestor, 'on'), {\n doNotAutoparagraph: true\n });\n }\n }\n }\n }\n // If some content was deleted, don't let the handler from the Widget plugin kick in.\n // If nothing was deleted, then the default handler will have nothing to do anyway.\n domEventData.preventDefault();\n evt.stop();\n }, { context: isWidget });\n }\n /**\n * Attaches the {@link module:engine/model/model~Model#event:insertContent} event listener that, for instance, allows the user to paste\n * content near a widget when the fake caret is first activated using the arrow keys.\n *\n * The content is inserted according to the `widget-type-around` selection attribute (see {@link #_handleArrowKeyPress}).\n */\n _enableInsertContentIntegration() {\n const editor = this.editor;\n const model = this.editor.model;\n const documentSelection = model.document.selection;\n this._listenToIfEnabled(editor.model, 'insertContent', (evt, [content, selectable]) => {\n if (selectable && !selectable.is('documentSelection')) {\n return;\n }\n const typeAroundFakeCaretPosition = getTypeAroundFakeCaretPosition(documentSelection);\n if (!typeAroundFakeCaretPosition) {\n return;\n }\n evt.stop();\n return model.change(writer => {\n const selectedElement = documentSelection.getSelectedElement();\n const position = model.createPositionAt(selectedElement, typeAroundFakeCaretPosition);\n const selection = writer.createSelection(position);\n const result = model.insertContent(content, selection);\n writer.setSelection(selection);\n return result;\n });\n }, { priority: 'high' });\n }\n /**\n * Attaches the {@link module:engine/model/model~Model#event:insertObject} event listener that modifies the\n * `options.findOptimalPosition`parameter to position of fake caret in relation to selected element\n * to reflect user's intent of desired insertion position.\n *\n * The object is inserted according to the `widget-type-around` selection attribute (see {@link #_handleArrowKeyPress}).\n */\n _enableInsertObjectIntegration() {\n const editor = this.editor;\n const model = this.editor.model;\n const documentSelection = model.document.selection;\n this._listenToIfEnabled(editor.model, 'insertObject', (evt, args) => {\n const [, selectable, options = {}] = args;\n if (selectable && !selectable.is('documentSelection')) {\n return;\n }\n const typeAroundFakeCaretPosition = getTypeAroundFakeCaretPosition(documentSelection);\n if (!typeAroundFakeCaretPosition) {\n return;\n }\n options.findOptimalPosition = typeAroundFakeCaretPosition;\n args[3] = options;\n }, { priority: 'high' });\n }\n /**\n * Attaches the {@link module:engine/model/model~Model#event:deleteContent} event listener to block the event when the fake\n * caret is active.\n *\n * This is required for cases that trigger {@link module:engine/model/model~Model#deleteContent `model.deleteContent()`}\n * before calling {@link module:engine/model/model~Model#insertContent `model.insertContent()`} like, for instance,\n * plain text pasting.\n */\n _enableDeleteContentIntegration() {\n const editor = this.editor;\n const model = this.editor.model;\n const documentSelection = model.document.selection;\n this._listenToIfEnabled(editor.model, 'deleteContent', (evt, [selection]) => {\n if (selection && !selection.is('documentSelection')) {\n return;\n }\n const typeAroundFakeCaretPosition = getTypeAroundFakeCaretPosition(documentSelection);\n // Disable removing the selection content while pasting plain text.\n if (typeAroundFakeCaretPosition) {\n evt.stop();\n }\n }, { priority: 'high' });\n }\n}\n/**\n * Injects the type around UI into a view widget instance.\n */\nfunction injectUIIntoWidget(viewWriter, buttonTitles, widgetViewElement) {\n const typeAroundWrapper = viewWriter.createUIElement('div', {\n class: 'ck ck-reset_all ck-widget__type-around'\n }, function (domDocument) {\n const wrapperDomElement = this.toDomElement(domDocument);\n injectButtons(wrapperDomElement, buttonTitles);\n injectFakeCaret(wrapperDomElement);\n return wrapperDomElement;\n });\n // Inject the type around wrapper into the widget's wrapper.\n viewWriter.insert(viewWriter.createPositionAt(widgetViewElement, 'end'), typeAroundWrapper);\n}\n/**\n * FYI: Not using the IconView class because each instance would need to be destroyed to avoid memory leaks\n * and it's pretty hard to figure out when a view (widget) is gone for good so it's cheaper to use raw\n * <svg> here.\n */\nfunction injectButtons(wrapperDomElement, buttonTitles) {\n for (const position of POSSIBLE_INSERTION_POSITIONS) {\n const buttonTemplate = new Template({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-widget__type-around__button',\n `ck-widget__type-around__button_${position}`\n ],\n title: buttonTitles[position],\n 'aria-hidden': 'true'\n },\n children: [\n wrapperDomElement.ownerDocument.importNode(RETURN_ARROW_ICON_ELEMENT, true)\n ]\n });\n wrapperDomElement.appendChild(buttonTemplate.render());\n }\n}\nfunction injectFakeCaret(wrapperDomElement) {\n const caretTemplate = new Template({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-widget__type-around__fake-caret'\n ]\n }\n });\n wrapperDomElement.appendChild(caretTemplate.render());\n}\n/**\n * Returns the ancestor of an element closest to the root which is empty. For instance,\n * for `<baz>`:\n *\n * ```\n * <foo>abc<bar><baz></baz></bar></foo>\n * ```\n *\n * it returns `<bar>`.\n */\nfunction getDeepestEmptyElementAncestor(schema, element) {\n let deepestEmptyAncestor = element;\n for (const ancestor of element.getAncestors({ parentFirst: true })) {\n if (ancestor.childCount > 1 || schema.isLimit(ancestor)) {\n break;\n }\n deepestEmptyAncestor = ancestor;\n }\n return deepestEmptyAncestor;\n}\n","export default \"<svg viewBox=\\\"0 0 10 8\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M9.055.263v3.972h-6.77M1 4.216l2-2.038m-2 2 2 2.038\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module widget/verticalnavigation\n */\nimport { keyCodes, Rect } from '@ckeditor/ckeditor5-utils';\n/**\n * Returns 'keydown' handler for up/down arrow keys that modifies the caret movement if it's in a text line next to an object.\n *\n * @param editing The editing controller.\n */\nexport default function verticalNavigationHandler(editing) {\n const model = editing.model;\n return (evt, data) => {\n const arrowUpPressed = data.keyCode == keyCodes.arrowup;\n const arrowDownPressed = data.keyCode == keyCodes.arrowdown;\n const expandSelection = data.shiftKey;\n const selection = model.document.selection;\n if (!arrowUpPressed && !arrowDownPressed) {\n return;\n }\n const isForward = arrowDownPressed;\n // Navigation is in the opposite direction than the selection direction so this is shrinking of the selection.\n // Selection for sure will not approach any object.\n if (expandSelection && selectionWillShrink(selection, isForward)) {\n return;\n }\n // Find a range between selection and closest limit element.\n const range = findTextRangeFromSelection(editing, selection, isForward);\n // There is no selection position inside the limit element.\n if (!range) {\n return;\n }\n // If already at the edge of a limit element.\n if (range.isCollapsed) {\n // A collapsed selection at limit edge - nothing more to do.\n if (selection.isCollapsed) {\n return;\n }\n // A non collapsed selection is at the limit edge while expanding the selection - let others do their stuff.\n else if (expandSelection) {\n return;\n }\n }\n // If the range is a single line (there is no word wrapping) then move the selection to the position closest to the limit element.\n //\n // We can't move the selection directly to the isObject element (eg. table cell) because of dual position at the end/beginning\n // of wrapped line (it's at the same time at the end of one line and at the start of the next line).\n if (range.isCollapsed || isSingleLineRange(editing, range, isForward)) {\n model.change(writer => {\n const newPosition = isForward ? range.end : range.start;\n if (expandSelection) {\n const newSelection = model.createSelection(selection.anchor);\n newSelection.setFocus(newPosition);\n writer.setSelection(newSelection);\n }\n else {\n writer.setSelection(newPosition);\n }\n });\n evt.stop();\n data.preventDefault();\n data.stopPropagation();\n }\n };\n}\n/**\n * Finds the range between selection and closest limit element (in the direction of navigation).\n * The position next to limit element is adjusted to the closest allowed `$text` position.\n *\n * Returns `null` if, according to the schema, the resulting range cannot contain a `$text` element.\n *\n * @param editing The editing controller.\n * @param selection The current selection.\n * @param isForward The expected navigation direction.\n */\nfunction findTextRangeFromSelection(editing, selection, isForward) {\n const model = editing.model;\n if (isForward) {\n const startPosition = selection.isCollapsed ? selection.focus : selection.getLastPosition();\n const endPosition = getNearestNonInlineLimit(model, startPosition, 'forward');\n // There is no limit element, browser should handle this.\n if (!endPosition) {\n return null;\n }\n const range = model.createRange(startPosition, endPosition);\n const lastRangePosition = getNearestTextPosition(model.schema, range, 'backward');\n if (lastRangePosition) {\n return model.createRange(startPosition, lastRangePosition);\n }\n return null;\n }\n else {\n const endPosition = selection.isCollapsed ? selection.focus : selection.getFirstPosition();\n const startPosition = getNearestNonInlineLimit(model, endPosition, 'backward');\n // There is no limit element, browser should handle this.\n if (!startPosition) {\n return null;\n }\n const range = model.createRange(startPosition, endPosition);\n const firstRangePosition = getNearestTextPosition(model.schema, range, 'forward');\n if (firstRangePosition) {\n return model.createRange(firstRangePosition, endPosition);\n }\n return null;\n }\n}\n/**\n * Finds the limit element position that is closest to startPosition.\n *\n * @param direction Search direction.\n */\nfunction getNearestNonInlineLimit(model, startPosition, direction) {\n const schema = model.schema;\n const range = model.createRangeIn(startPosition.root);\n const walkerValueType = direction == 'forward' ? 'elementStart' : 'elementEnd';\n for (const { previousPosition, item, type } of range.getWalker({ startPosition, direction })) {\n if (schema.isLimit(item) && !schema.isInline(item)) {\n return previousPosition;\n }\n // Stop looking for isLimit element if the next element is a block element (it is for sure not single line).\n if (type == walkerValueType && schema.isBlock(item)) {\n return null;\n }\n }\n return null;\n}\n/**\n * Basing on the provided range, finds the first or last (depending on `direction`) position inside the range\n * that can contain `$text` (according to schema).\n *\n * @param schema The schema.\n * @param range The range to find the position in.\n * @param direction Search direction.\n * @returns The nearest selection position.\n *\n */\nfunction getNearestTextPosition(schema, range, direction) {\n const position = direction == 'backward' ? range.end : range.start;\n if (schema.checkChild(position, '$text')) {\n return position;\n }\n for (const { nextPosition } of range.getWalker({ direction })) {\n if (schema.checkChild(nextPosition, '$text')) {\n return nextPosition;\n }\n }\n return null;\n}\n/**\n * Checks if the DOM range corresponding to the provided model range renders as a single line by analyzing DOMRects\n * (verifying if they visually wrap content to the next line).\n *\n * @param editing The editing controller.\n * @param modelRange The current table cell content range.\n * @param isForward The expected navigation direction.\n */\nfunction isSingleLineRange(editing, modelRange, isForward) {\n const model = editing.model;\n const domConverter = editing.view.domConverter;\n // Wrapped lines contain exactly the same position at the end of current line\n // and at the beginning of next line. That position's client rect is at the end\n // of current line. In case of caret at first position of the last line that 'dual'\n // position would be detected as it's not the last line.\n if (isForward) {\n const probe = model.createSelection(modelRange.start);\n model.modifySelection(probe);\n // If the new position is at the end of the container then we can't use this position\n // because it would provide incorrect result for eg caption of image and selection\n // just before end of it. Also in this case there is no \"dual\" position.\n if (!probe.focus.isAtEnd && !modelRange.start.isEqual(probe.focus)) {\n modelRange = model.createRange(probe.focus, modelRange.end);\n }\n }\n const viewRange = editing.mapper.toViewRange(modelRange);\n const domRange = domConverter.viewRangeToDom(viewRange);\n const rects = Rect.getDomRangeRects(domRange);\n let boundaryVerticalPosition;\n for (const rect of rects) {\n if (boundaryVerticalPosition === undefined) {\n boundaryVerticalPosition = Math.round(rect.bottom);\n continue;\n }\n // Let's check if this rect is in new line.\n if (Math.round(rect.top) >= boundaryVerticalPosition) {\n return false;\n }\n boundaryVerticalPosition = Math.max(boundaryVerticalPosition, Math.round(rect.bottom));\n }\n return true;\n}\nfunction selectionWillShrink(selection, isForward) {\n return !selection.isCollapsed && selection.isBackward == isForward;\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./widget.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module widget/widget\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { MouseObserver } from '@ckeditor/ckeditor5-engine';\nimport { Delete } from '@ckeditor/ckeditor5-typing';\nimport { env, getLocalizedArrowKeyCodeDirection } from '@ckeditor/ckeditor5-utils';\nimport WidgetTypeAround from './widgettypearound/widgettypearound';\nimport verticalNavigationHandler from './verticalnavigation';\nimport { getLabel, isWidget, WIDGET_SELECTED_CLASS_NAME } from './utils';\nimport '../theme/widget.css';\n/**\n * The widget plugin. It enables base support for widgets.\n *\n * See {@glink api/widget package page} for more details and documentation.\n *\n * This plugin enables multiple behaviors required by widgets:\n *\n * * The model to view selection converter for the editing pipeline (it handles widget custom selection rendering).\n * If a converted selection wraps around a widget element, that selection is marked as\n * {@link module:engine/view/selection~Selection#isFake fake}. Additionally, the `ck-widget_selected` CSS class\n * is added to indicate that widget has been selected.\n * * The mouse and keyboard events handling on and around widget elements.\n */\nexport default class Widget extends Plugin {\n constructor() {\n super(...arguments);\n /**\n * Holds previously selected widgets.\n */\n this._previouslySelected = new Set();\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Widget';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [WidgetTypeAround, Delete];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const view = editor.editing.view;\n const viewDocument = view.document;\n // Model to view selection converter.\n // Converts selection placed over widget element to fake selection.\n //\n // By default, the selection is downcasted by the engine to surround the attribute element, even though its only\n // child is an inline widget. A similar thing also happens when a collapsed marker is rendered as a UI element\n // next to an inline widget: the view selection contains both the widget and the marker.\n //\n // This prevents creating a correct fake selection when this inline widget is selected. Normalize the selection\n // in these cases based on the model:\n //\n //\t\t[<attributeElement><inlineWidget /></attributeElement>] -> <attributeElement>[<inlineWidget />]</attributeElement>\n //\t\t[<uiElement></uiElement><inlineWidget />] -> <uiElement></uiElement>[<inlineWidget />]\n //\n // Thanks to this:\n //\n // * fake selection can be set correctly,\n // * any logic depending on (View)Selection#getSelectedElement() also works OK.\n //\n // See https://github.com/ckeditor/ckeditor5/issues/9524.\n this.editor.editing.downcastDispatcher.on('selection', (evt, data, conversionApi) => {\n const viewWriter = conversionApi.writer;\n const modelSelection = data.selection;\n // The collapsed selection can't contain any widget.\n if (modelSelection.isCollapsed) {\n return;\n }\n const selectedModelElement = modelSelection.getSelectedElement();\n if (!selectedModelElement) {\n return;\n }\n const selectedViewElement = editor.editing.mapper.toViewElement(selectedModelElement);\n if (!isWidget(selectedViewElement)) {\n return;\n }\n if (!conversionApi.consumable.consume(modelSelection, 'selection')) {\n return;\n }\n viewWriter.setSelection(viewWriter.createRangeOn(selectedViewElement), {\n fake: true,\n label: getLabel(selectedViewElement)\n });\n });\n // Mark all widgets inside the selection with the css class.\n // This handler is registered at the 'low' priority so it's triggered after the real selection conversion.\n this.editor.editing.downcastDispatcher.on('selection', (evt, data, conversionApi) => {\n // Remove selected class from previously selected widgets.\n this._clearPreviouslySelectedWidgets(conversionApi.writer);\n const viewWriter = conversionApi.writer;\n const viewSelection = viewWriter.document.selection;\n let lastMarked = null;\n for (const range of viewSelection.getRanges()) {\n // Note: There could be multiple selected widgets in a range but no fake selection.\n // All of them must be marked as selected, for instance [<widget></widget><widget></widget>]\n for (const value of range) {\n const node = value.item;\n // Do not mark nested widgets in selected one. See: #4594\n if (isWidget(node) && !isChild(node, lastMarked)) {\n viewWriter.addClass(WIDGET_SELECTED_CLASS_NAME, node);\n this._previouslySelected.add(node);\n lastMarked = node;\n }\n }\n }\n }, { priority: 'low' });\n // If mouse down is pressed on widget - create selection over whole widget.\n view.addObserver(MouseObserver);\n this.listenTo(viewDocument, 'mousedown', (...args) => this._onMousedown(...args));\n // There are two keydown listeners working on different priorities. This allows other\n // features such as WidgetTypeAround or TableKeyboard to attach their listeners in between\n // and customize the behavior even further in different content/selection scenarios.\n //\n // * The first listener handles changing the selection on arrow key press\n // if the widget is selected or if the selection is next to a widget and the widget\n // should become selected upon the arrow key press.\n //\n // * The second (late) listener makes sure the default browser action on arrow key press is\n // prevented when a widget is selected. This prevents the selection from being moved\n // from a fake selection container.\n this.listenTo(viewDocument, 'arrowKey', (...args) => {\n this._handleSelectionChangeOnArrowKeyPress(...args);\n }, { context: [isWidget, '$text'] });\n this.listenTo(viewDocument, 'arrowKey', (...args) => {\n this._preventDefaultOnArrowKeyPress(...args);\n }, { context: '$root' });\n this.listenTo(viewDocument, 'arrowKey', verticalNavigationHandler(this.editor.editing), { context: '$text' });\n // Handle custom delete behaviour.\n this.listenTo(viewDocument, 'delete', (evt, data) => {\n if (this._handleDelete(data.direction == 'forward')) {\n data.preventDefault();\n evt.stop();\n }\n }, { context: '$root' });\n }\n /**\n * Handles {@link module:engine/view/document~Document#event:mousedown mousedown} events on widget elements.\n */\n _onMousedown(eventInfo, domEventData) {\n const editor = this.editor;\n const view = editor.editing.view;\n const viewDocument = view.document;\n let element = domEventData.target;\n // Do nothing for single or double click inside nested editable.\n if (isInsideNestedEditable(element)) {\n // But at least triple click inside nested editable causes broken selection in Safari.\n // For such event, we select the entire nested editable element.\n // See: https://github.com/ckeditor/ckeditor5/issues/1463.\n if ((env.isSafari || env.isGecko) && domEventData.domEvent.detail >= 3) {\n const mapper = editor.editing.mapper;\n const viewElement = element.is('attributeElement') ?\n element.findAncestor(element => !element.is('attributeElement')) : element;\n const modelElement = mapper.toModelElement(viewElement);\n domEventData.preventDefault();\n this.editor.model.change(writer => {\n writer.setSelection(modelElement, 'in');\n });\n }\n return;\n }\n // If target is not a widget element - check if one of the ancestors is.\n if (!isWidget(element)) {\n element = element.findAncestor(isWidget);\n if (!element) {\n return;\n }\n }\n // On Android selection would jump to the first table cell, on other devices\n // we can't block it (and don't need to) because of drag and drop support.\n if (env.isAndroid) {\n domEventData.preventDefault();\n }\n // Focus editor if is not focused already.\n if (!viewDocument.isFocused) {\n view.focus();\n }\n // Create model selection over widget.\n const modelElement = editor.editing.mapper.toModelElement(element);\n this._setSelectionOverElement(modelElement);\n }\n /**\n * Handles {@link module:engine/view/document~Document#event:keydown keydown} events and changes\n * the model selection when:\n *\n * * arrow key is pressed when the widget is selected,\n * * the selection is next to a widget and the widget should become selected upon the arrow key press.\n *\n * See {@link #_preventDefaultOnArrowKeyPress}.\n */\n _handleSelectionChangeOnArrowKeyPress(eventInfo, domEventData) {\n const keyCode = domEventData.keyCode;\n const model = this.editor.model;\n const schema = model.schema;\n const modelSelection = model.document.selection;\n const objectElement = modelSelection.getSelectedElement();\n const direction = getLocalizedArrowKeyCodeDirection(keyCode, this.editor.locale.contentLanguageDirection);\n const isForward = direction == 'down' || direction == 'right';\n const isVerticalNavigation = direction == 'up' || direction == 'down';\n // If object element is selected.\n if (objectElement && schema.isObject(objectElement)) {\n const position = isForward ? modelSelection.getLastPosition() : modelSelection.getFirstPosition();\n const newRange = schema.getNearestSelectionRange(position, isForward ? 'forward' : 'backward');\n if (newRange) {\n model.change(writer => {\n writer.setSelection(newRange);\n });\n domEventData.preventDefault();\n eventInfo.stop();\n }\n return;\n }\n // Handle collapsing of the selection when there is any widget on the edge of selection.\n // This is needed because browsers have problems with collapsing such selection.\n if (!modelSelection.isCollapsed && !domEventData.shiftKey) {\n const firstPosition = modelSelection.getFirstPosition();\n const lastPosition = modelSelection.getLastPosition();\n const firstSelectedNode = firstPosition.nodeAfter;\n const lastSelectedNode = lastPosition.nodeBefore;\n if (firstSelectedNode && schema.isObject(firstSelectedNode) || lastSelectedNode && schema.isObject(lastSelectedNode)) {\n model.change(writer => {\n writer.setSelection(isForward ? lastPosition : firstPosition);\n });\n domEventData.preventDefault();\n eventInfo.stop();\n }\n return;\n }\n // Return if not collapsed.\n if (!modelSelection.isCollapsed) {\n return;\n }\n // If selection is next to object element.\n const objectElementNextToSelection = this._getObjectElementNextToSelection(isForward);\n if (objectElementNextToSelection && schema.isObject(objectElementNextToSelection)) {\n // Do not select an inline widget while handling up/down arrow.\n if (schema.isInline(objectElementNextToSelection) && isVerticalNavigation) {\n return;\n }\n this._setSelectionOverElement(objectElementNextToSelection);\n domEventData.preventDefault();\n eventInfo.stop();\n }\n }\n /**\n * Handles {@link module:engine/view/document~Document#event:keydown keydown} events and prevents\n * the default browser behavior to make sure the fake selection is not being moved from a fake selection\n * container.\n *\n * See {@link #_handleSelectionChangeOnArrowKeyPress}.\n */\n _preventDefaultOnArrowKeyPress(eventInfo, domEventData) {\n const model = this.editor.model;\n const schema = model.schema;\n const objectElement = model.document.selection.getSelectedElement();\n // If object element is selected.\n if (objectElement && schema.isObject(objectElement)) {\n domEventData.preventDefault();\n eventInfo.stop();\n }\n }\n /**\n * Handles delete keys: backspace and delete.\n *\n * @param isForward Set to true if delete was performed in forward direction.\n * @returns Returns `true` if keys were handled correctly.\n */\n _handleDelete(isForward) {\n const modelDocument = this.editor.model.document;\n const modelSelection = modelDocument.selection;\n // Do nothing when the read only mode is enabled.\n if (!this.editor.model.canEditAt(modelSelection)) {\n return;\n }\n // Do nothing on non-collapsed selection.\n if (!modelSelection.isCollapsed) {\n return;\n }\n const objectElement = this._getObjectElementNextToSelection(isForward);\n if (objectElement) {\n this.editor.model.change(writer => {\n let previousNode = modelSelection.anchor.parent;\n // Remove previous element if empty.\n while (previousNode.isEmpty) {\n const nodeToRemove = previousNode;\n previousNode = nodeToRemove.parent;\n writer.remove(nodeToRemove);\n }\n this._setSelectionOverElement(objectElement);\n });\n return true;\n }\n }\n /**\n * Sets {@link module:engine/model/selection~Selection document's selection} over given element.\n *\n * @internal\n */\n _setSelectionOverElement(element) {\n this.editor.model.change(writer => {\n writer.setSelection(writer.createRangeOn(element));\n });\n }\n /**\n * Checks if {@link module:engine/model/element~Element element} placed next to the current\n * {@link module:engine/model/selection~Selection model selection} exists and is marked in\n * {@link module:engine/model/schema~Schema schema} as `object`.\n *\n * @internal\n * @param forward Direction of checking.\n */\n _getObjectElementNextToSelection(forward) {\n const model = this.editor.model;\n const schema = model.schema;\n const modelSelection = model.document.selection;\n // Clone current selection to use it as a probe. We must leave default selection as it is so it can return\n // to its current state after undo.\n const probe = model.createSelection(modelSelection);\n model.modifySelection(probe, { direction: forward ? 'forward' : 'backward' });\n // The selection didn't change so there is nothing there.\n if (probe.isEqual(modelSelection)) {\n return null;\n }\n const objectElement = forward ? probe.focus.nodeBefore : probe.focus.nodeAfter;\n if (!!objectElement && schema.isObject(objectElement)) {\n return objectElement;\n }\n return null;\n }\n /**\n * Removes CSS class from previously selected widgets.\n */\n _clearPreviouslySelectedWidgets(writer) {\n for (const widget of this._previouslySelected) {\n writer.removeClass(WIDGET_SELECTED_CLASS_NAME, widget);\n }\n this._previouslySelected.clear();\n }\n}\n/**\n * Returns `true` when element is a nested editable or is placed inside one.\n */\nfunction isInsideNestedEditable(element) {\n let currentElement = element;\n while (currentElement) {\n if (currentElement.is('editableElement') && !currentElement.is('rootElement')) {\n return true;\n }\n // Click on nested widget should select it.\n if (isWidget(currentElement)) {\n return false;\n }\n currentElement = currentElement.parent;\n }\n return false;\n}\n/**\n * Checks whether the specified `element` is a child of the `parent` element.\n *\n * @param element An element to check.\n * @param parent A parent for the element.\n */\nfunction isChild(element, parent) {\n if (!parent) {\n return false;\n }\n return Array.from(element.getAncestors()).includes(parent);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module widget/widgettoolbarrepository\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { BalloonPanelView, ContextualBalloon, ToolbarView } from '@ckeditor/ckeditor5-ui';\nimport { CKEditorError, logWarning } from '@ckeditor/ckeditor5-utils';\nimport { isWidget } from './utils';\n/**\n * Widget toolbar repository plugin. A central point for registering widget toolbars. This plugin handles the whole\n * toolbar rendering process and exposes a concise API.\n *\n * To add a toolbar for your widget use the {@link ~WidgetToolbarRepository#register `WidgetToolbarRepository#register()`} method.\n *\n * The following example comes from the {@link module:image/imagetoolbar~ImageToolbar} plugin:\n *\n * ```ts\n * class ImageToolbar extends Plugin {\n * \tstatic get requires() {\n * \t\treturn [ WidgetToolbarRepository ];\n * \t}\n *\n * \tafterInit() {\n * \t\tconst editor = this.editor;\n * \t\tconst widgetToolbarRepository = editor.plugins.get( WidgetToolbarRepository );\n *\n * \t\twidgetToolbarRepository.register( 'image', {\n * \t\t\titems: editor.config.get( 'image.toolbar' ),\n * \t\t\tgetRelatedElement: getClosestSelectedImageWidget\n * \t\t} );\n * \t}\n * }\n * ```\n */\nexport default class WidgetToolbarRepository extends Plugin {\n constructor() {\n super(...arguments);\n /**\n * A map of toolbar definitions.\n */\n this._toolbarDefinitions = new Map();\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ContextualBalloon];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'WidgetToolbarRepository';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Disables the default balloon toolbar for all widgets.\n if (editor.plugins.has('BalloonToolbar')) {\n const balloonToolbar = editor.plugins.get('BalloonToolbar');\n this.listenTo(balloonToolbar, 'show', evt => {\n if (isWidgetSelected(editor.editing.view.document.selection)) {\n evt.stop();\n }\n }, { priority: 'high' });\n }\n this._balloon = this.editor.plugins.get('ContextualBalloon');\n this.on('change:isEnabled', () => {\n this._updateToolbarsVisibility();\n });\n this.listenTo(editor.ui, 'update', () => {\n this._updateToolbarsVisibility();\n });\n // UI#update is not fired after focus is back in editor, we need to check if balloon panel should be visible.\n this.listenTo(editor.ui.focusTracker, 'change:isFocused', () => {\n this._updateToolbarsVisibility();\n }, { priority: 'low' });\n }\n destroy() {\n super.destroy();\n for (const toolbarConfig of this._toolbarDefinitions.values()) {\n toolbarConfig.view.destroy();\n }\n }\n /**\n * Registers toolbar in the WidgetToolbarRepository. It renders it in the `ContextualBalloon` based on the value of the invoked\n * `getRelatedElement` function. Toolbar items are gathered from `items` array.\n * The balloon's CSS class is by default `ck-toolbar-container` and may be override with the `balloonClassName` option.\n *\n * Note: This method should be called in the {@link module:core/plugin~PluginInterface#afterInit `Plugin#afterInit()`}\n * callback (or later) to make sure that the given toolbar items were already registered by other plugins.\n *\n * @param toolbarId An id for the toolbar. Used to\n * @param options.ariaLabel Label used by assistive technologies to describe this toolbar element.\n * @param options.items Array of toolbar items.\n * @param options.getRelatedElement Callback which returns an element the toolbar should be attached to.\n * @param options.balloonClassName CSS class for the widget balloon.\n */\n register(toolbarId, { ariaLabel, items, getRelatedElement, balloonClassName = 'ck-toolbar-container' }) {\n // Trying to register a toolbar without any item.\n if (!items.length) {\n /**\n * When {@link module:widget/widgettoolbarrepository~WidgetToolbarRepository#register registering} a new widget toolbar, you\n * need to provide a non-empty array with the items that will be inserted into the toolbar.\n *\n * If you see this error when integrating the editor, you likely forgot to configure one of the widget toolbars.\n *\n * See for instance:\n *\n * * {@link module:table/tableconfig~TableConfig#contentToolbar `config.table.contentToolbar`}\n * * {@link module:image/imageconfig~ImageConfig#toolbar `config.image.toolbar`}\n *\n * @error widget-toolbar-no-items\n * @param toolbarId The id of the toolbar that has not been configured correctly.\n */\n logWarning('widget-toolbar-no-items', { toolbarId });\n return;\n }\n const editor = this.editor;\n const t = editor.t;\n const toolbarView = new ToolbarView(editor.locale);\n toolbarView.ariaLabel = ariaLabel || t('Widget toolbar');\n if (this._toolbarDefinitions.has(toolbarId)) {\n /**\n * Toolbar with the given id was already added.\n *\n * @error widget-toolbar-duplicated\n * @param toolbarId Toolbar id.\n */\n throw new CKEditorError('widget-toolbar-duplicated', this, { toolbarId });\n }\n const toolbarDefinition = {\n view: toolbarView,\n getRelatedElement,\n balloonClassName,\n itemsConfig: items,\n initialized: false\n };\n // Register the toolbar so it becomes available for Alt+F10 and Esc navigation.\n editor.ui.addToolbar(toolbarView, {\n isContextual: true,\n beforeFocus: () => {\n const relatedElement = getRelatedElement(editor.editing.view.document.selection);\n if (relatedElement) {\n this._showToolbar(toolbarDefinition, relatedElement);\n }\n },\n afterBlur: () => {\n this._hideToolbar(toolbarDefinition);\n }\n });\n this._toolbarDefinitions.set(toolbarId, toolbarDefinition);\n }\n /**\n * Iterates over stored toolbars and makes them visible or hidden.\n */\n _updateToolbarsVisibility() {\n let maxRelatedElementDepth = 0;\n let deepestRelatedElement = null;\n let deepestToolbarDefinition = null;\n for (const definition of this._toolbarDefinitions.values()) {\n const relatedElement = definition.getRelatedElement(this.editor.editing.view.document.selection);\n if (!this.isEnabled || !relatedElement) {\n if (this._isToolbarInBalloon(definition)) {\n this._hideToolbar(definition);\n }\n }\n else if (!this.editor.ui.focusTracker.isFocused) {\n if (this._isToolbarVisible(definition)) {\n this._hideToolbar(definition);\n }\n }\n else {\n const relatedElementDepth = relatedElement.getAncestors().length;\n // Many toolbars can express willingness to be displayed but they do not know about\n // each other. Figure out which toolbar is deepest in the view tree to decide which\n // should be displayed. For instance, if a selected image is inside a table cell, display\n // the ImageToolbar rather than the TableToolbar (#60).\n if (relatedElementDepth > maxRelatedElementDepth) {\n maxRelatedElementDepth = relatedElementDepth;\n deepestRelatedElement = relatedElement;\n deepestToolbarDefinition = definition;\n }\n }\n }\n if (deepestToolbarDefinition) {\n this._showToolbar(deepestToolbarDefinition, deepestRelatedElement);\n }\n }\n /**\n * Hides the given toolbar.\n */\n _hideToolbar(toolbarDefinition) {\n this._balloon.remove(toolbarDefinition.view);\n this.stopListening(this._balloon, 'change:visibleView');\n }\n /**\n * Shows up the toolbar if the toolbar is not visible.\n * Otherwise, repositions the toolbar's balloon when toolbar's view is the most top view in balloon stack.\n *\n * It might happen here that the toolbar's view is under another view. Then do nothing as the other toolbar view\n * should be still visible after the {@link module:ui/editorui/editorui~EditorUI#event:update}.\n */\n _showToolbar(toolbarDefinition, relatedElement) {\n if (this._isToolbarVisible(toolbarDefinition)) {\n repositionContextualBalloon(this.editor, relatedElement);\n }\n else if (!this._isToolbarInBalloon(toolbarDefinition)) {\n if (!toolbarDefinition.initialized) {\n toolbarDefinition.initialized = true;\n toolbarDefinition.view.fillFromConfig(toolbarDefinition.itemsConfig, this.editor.ui.componentFactory);\n }\n this._balloon.add({\n view: toolbarDefinition.view,\n position: getBalloonPositionData(this.editor, relatedElement),\n balloonClassName: toolbarDefinition.balloonClassName\n });\n // Update toolbar position each time stack with toolbar view is switched to visible.\n // This is in a case target element has changed when toolbar was in invisible stack\n // e.g. target image was wrapped by a block quote.\n // See https://github.com/ckeditor/ckeditor5-widget/issues/92.\n this.listenTo(this._balloon, 'change:visibleView', () => {\n for (const definition of this._toolbarDefinitions.values()) {\n if (this._isToolbarVisible(definition)) {\n const relatedElement = definition.getRelatedElement(this.editor.editing.view.document.selection);\n repositionContextualBalloon(this.editor, relatedElement);\n }\n }\n });\n }\n }\n _isToolbarVisible(toolbar) {\n return this._balloon.visibleView === toolbar.view;\n }\n _isToolbarInBalloon(toolbar) {\n return this._balloon.hasView(toolbar.view);\n }\n}\nfunction repositionContextualBalloon(editor, relatedElement) {\n const balloon = editor.plugins.get('ContextualBalloon');\n const position = getBalloonPositionData(editor, relatedElement);\n balloon.updatePosition(position);\n}\nfunction getBalloonPositionData(editor, relatedElement) {\n const editingView = editor.editing.view;\n const defaultPositions = BalloonPanelView.defaultPositions;\n return {\n target: editingView.domConverter.mapViewToDom(relatedElement),\n positions: [\n defaultPositions.northArrowSouth,\n defaultPositions.northArrowSouthWest,\n defaultPositions.northArrowSouthEast,\n defaultPositions.southArrowNorth,\n defaultPositions.southArrowNorthWest,\n defaultPositions.southArrowNorthEast,\n defaultPositions.viewportStickyNorth\n ]\n };\n}\nfunction isWidgetSelected(selection) {\n const viewElement = selection.getSelectedElement();\n return !!(viewElement && isWidget(viewElement));\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module widget/widgetresize/resizerstate\n */\nimport { ObservableMixin, Rect } from '@ckeditor/ckeditor5-utils';\n/**\n * Stores the internal state of a single resizable object.\n */\nexport default class ResizeState extends ObservableMixin() {\n /**\n * @param options Resizer options.\n */\n constructor(options) {\n super();\n this.set('activeHandlePosition', null);\n this.set('proposedWidthPercents', null);\n this.set('proposedWidth', null);\n this.set('proposedHeight', null);\n this.set('proposedHandleHostWidth', null);\n this.set('proposedHandleHostHeight', null);\n this._options = options;\n this._referenceCoordinates = null;\n }\n /**\n * The original width (pixels) of the resized object when the resize process was started.\n */\n get originalWidth() {\n return this._originalWidth;\n }\n /**\n * The original height (pixels) of the resized object when the resize process was started.\n */\n get originalHeight() {\n return this._originalHeight;\n }\n /**\n * The original width (percents) of the resized object when the resize process was started.\n */\n get originalWidthPercents() {\n return this._originalWidthPercents;\n }\n /**\n * A width to height ratio of the resized image.\n */\n get aspectRatio() {\n return this._aspectRatio;\n }\n /**\n *\n * @param domResizeHandle The handle used to calculate the reference point.\n */\n begin(domResizeHandle, domHandleHost, domResizeHost) {\n const clientRect = new Rect(domHandleHost);\n this.activeHandlePosition = getHandlePosition(domResizeHandle);\n this._referenceCoordinates = getAbsoluteBoundaryPoint(domHandleHost, getOppositePosition(this.activeHandlePosition));\n this._originalWidth = clientRect.width;\n this._originalHeight = clientRect.height;\n this._aspectRatio = clientRect.width / clientRect.height;\n const widthStyle = domResizeHost.style.width;\n if (widthStyle && widthStyle.match(/^\\d+(\\.\\d*)?%$/)) {\n this._originalWidthPercents = parseFloat(widthStyle);\n }\n else {\n this._originalWidthPercents = calculateHostPercentageWidth(domResizeHost, clientRect);\n }\n }\n update(newSize) {\n this.proposedWidth = newSize.width;\n this.proposedHeight = newSize.height;\n this.proposedWidthPercents = newSize.widthPercents;\n this.proposedHandleHostWidth = newSize.handleHostWidth;\n this.proposedHandleHostHeight = newSize.handleHostHeight;\n }\n}\n/**\n * Calculates a relative width of a `domResizeHost` compared to its ancestor in percents.\n */\nfunction calculateHostPercentageWidth(domResizeHost, resizeHostRect) {\n const domResizeHostParent = domResizeHost.parentElement;\n // Need to use computed style as it properly excludes parent's paddings from the returned value.\n let parentWidth = parseFloat(domResizeHostParent.ownerDocument.defaultView.getComputedStyle(domResizeHostParent).width);\n // Sometimes parent width cannot be accessed. If that happens we should go up in the elements tree\n // and try to get width from next ancestor.\n // https://github.com/ckeditor/ckeditor5/issues/10776\n const ancestorLevelLimit = 5;\n let currentLevel = 0;\n let checkedElement = domResizeHostParent;\n while (isNaN(parentWidth)) {\n checkedElement = checkedElement.parentElement;\n if (++currentLevel > ancestorLevelLimit) {\n return 0;\n }\n parentWidth = parseFloat(domResizeHostParent.ownerDocument.defaultView.getComputedStyle(checkedElement).width);\n }\n return resizeHostRect.width / parentWidth * 100;\n}\n/**\n * Returns coordinates of the top-left corner of an element, relative to the document's top-left corner.\n *\n * @param resizerPosition The position of the resize handle, e.g. `\"top-left\"`, `\"bottom-right\"`.\n */\nfunction getAbsoluteBoundaryPoint(element, resizerPosition) {\n const elementRect = new Rect(element);\n const positionParts = resizerPosition.split('-');\n const ret = {\n x: positionParts[1] == 'right' ? elementRect.right : elementRect.left,\n y: positionParts[0] == 'bottom' ? elementRect.bottom : elementRect.top\n };\n ret.x += element.ownerDocument.defaultView.scrollX;\n ret.y += element.ownerDocument.defaultView.scrollY;\n return ret;\n}\n/**\n * @param resizerPosition The expected resizer position, like `\"top-left\"`, `\"bottom-right\"`.\n * @returns A prefixed HTML class name for the resizer element.\n */\nfunction getResizerHandleClass(resizerPosition) {\n return `ck-widget__resizer__handle-${resizerPosition}`;\n}\n/**\n * Determines the position of a given resize handle.\n *\n * @param domHandle Handle used to calculate the reference point.\n * @returns Returns a string like `\"top-left\"` or `undefined` if not matched.\n */\nfunction getHandlePosition(domHandle) {\n const resizerPositions = ['top-left', 'top-right', 'bottom-right', 'bottom-left'];\n for (const position of resizerPositions) {\n if (domHandle.classList.contains(getResizerHandleClass(position))) {\n return position;\n }\n }\n}\n/**\n * @param position Like `\"top-left\"`.\n * @returns Inverted `position`, e.g. it returns `\"bottom-right\"` if `\"top-left\"` was given as `position`.\n */\nfunction getOppositePosition(position) {\n const parts = position.split('-');\n const replacements = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left'\n };\n return `${replacements[parts[0]]}-${replacements[parts[1]]}`;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module widget/widgetresize/sizeview\n */\nimport { View } from '@ckeditor/ckeditor5-ui';\n/**\n * A view displaying the proposed new element size during the resizing.\n */\nexport default class SizeView extends View {\n constructor() {\n super();\n const bind = this.bindTemplate;\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-size-view',\n bind.to('_viewPosition', value => value ? `ck-orientation-${value}` : '')\n ],\n style: {\n display: bind.if('_isVisible', 'none', visible => !visible)\n }\n },\n children: [{\n text: bind.to('_label')\n }]\n });\n }\n /**\n * A method used for binding the `SizeView` instance properties to the `ResizeState` instance observable properties.\n *\n * @internal\n * @param options An object defining the resizer options, used for setting the proper size label.\n * @param resizeState The `ResizeState` class instance, used for keeping the `SizeView` state up to date.\n */\n _bindToState(options, resizeState) {\n this.bind('_isVisible').to(resizeState, 'proposedWidth', resizeState, 'proposedHeight', (width, height) => width !== null && height !== null);\n this.bind('_label').to(resizeState, 'proposedHandleHostWidth', resizeState, 'proposedHandleHostHeight', resizeState, 'proposedWidthPercents', (width, height, widthPercents) => {\n if (options.unit === 'px') {\n return `${width}×${height}`;\n }\n else {\n return `${widthPercents}%`;\n }\n });\n this.bind('_viewPosition').to(resizeState, 'activeHandlePosition', resizeState, 'proposedHandleHostWidth', resizeState, 'proposedHandleHostHeight', \n // If the widget is too small to contain the size label, display the label above.\n (position, width, height) => width < 50 || height < 50 ? 'above-center' : position);\n }\n /**\n * A method used for cleaning up. It removes the bindings and hides the view.\n *\n * @internal\n */\n _dismiss() {\n this.unbind();\n this._isVisible = false;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module widget/widgetresize/resizer\n */\nimport { Template } from '@ckeditor/ckeditor5-ui';\nimport { Rect, ObservableMixin, compareArrays } from '@ckeditor/ckeditor5-utils';\nimport ResizeState from './resizerstate';\nimport SizeView from './sizeview';\n/**\n * Represents a resizer for a single resizable object.\n */\nexport default class Resizer extends ObservableMixin() {\n /**\n * @param options Resizer options.\n */\n constructor(options) {\n super();\n /**\n * A wrapper that is controlled by the resizer. This is usually a widget element.\n */\n this._viewResizerWrapper = null;\n this._options = options;\n this.set('isEnabled', true);\n this.set('isSelected', false);\n this.bind('isVisible').to(this, 'isEnabled', this, 'isSelected', (isEnabled, isSelected) => isEnabled && isSelected);\n this.decorate('begin');\n this.decorate('cancel');\n this.decorate('commit');\n this.decorate('updateSize');\n this.on('commit', event => {\n // State might not be initialized yet. In this case, prevent further handling and make sure that the resizer is\n // cleaned up (#5195).\n if (!this.state.proposedWidth && !this.state.proposedWidthPercents) {\n this._cleanup();\n event.stop();\n }\n }, { priority: 'high' });\n }\n /**\n * Stores the state of the resizable host geometry, such as the original width, the currently proposed height, etc.\n *\n * Note that a new state is created for each resize transaction.\n */\n get state() {\n return this._state;\n }\n /**\n * Makes resizer visible in the UI.\n */\n show() {\n const editingView = this._options.editor.editing.view;\n editingView.change(writer => {\n writer.removeClass('ck-hidden', this._viewResizerWrapper);\n });\n }\n /**\n * Hides resizer in the UI.\n */\n hide() {\n const editingView = this._options.editor.editing.view;\n editingView.change(writer => {\n writer.addClass('ck-hidden', this._viewResizerWrapper);\n });\n }\n /**\n * Attaches the resizer to the DOM.\n */\n attach() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const that = this;\n const widgetElement = this._options.viewElement;\n const editingView = this._options.editor.editing.view;\n editingView.change(writer => {\n const viewResizerWrapper = writer.createUIElement('div', {\n class: 'ck ck-reset_all ck-widget__resizer'\n }, function (domDocument) {\n const domElement = this.toDomElement(domDocument);\n that._appendHandles(domElement);\n that._appendSizeUI(domElement);\n return domElement;\n });\n // Append the resizer wrapper to the widget's wrapper.\n writer.insert(writer.createPositionAt(widgetElement, 'end'), viewResizerWrapper);\n writer.addClass('ck-widget_with-resizer', widgetElement);\n this._viewResizerWrapper = viewResizerWrapper;\n if (!this.isVisible) {\n this.hide();\n }\n });\n this.on('change:isVisible', () => {\n if (this.isVisible) {\n this.show();\n this.redraw();\n }\n else {\n this.hide();\n }\n });\n }\n /**\n * Starts the resizing process.\n *\n * Creates a new {@link #state} for the current process.\n *\n * @fires begin\n * @param domResizeHandle Clicked handle.\n */\n begin(domResizeHandle) {\n this._state = new ResizeState(this._options);\n this._sizeView._bindToState(this._options, this.state);\n this._initialViewWidth = this._options.viewElement.getStyle('width');\n this.state.begin(domResizeHandle, this._getHandleHost(), this._getResizeHost());\n }\n /**\n * Updates the proposed size based on `domEventData`.\n *\n * @fires updateSize\n */\n updateSize(domEventData) {\n const newSize = this._proposeNewSize(domEventData);\n const editingView = this._options.editor.editing.view;\n editingView.change(writer => {\n const unit = this._options.unit || '%';\n const newWidth = (unit === '%' ? newSize.widthPercents : newSize.width) + unit;\n writer.setStyle('width', newWidth, this._options.viewElement);\n });\n // Get an actual image width, and:\n // * reflect this size to the resize wrapper\n // * apply this **real** size to the state\n const domHandleHost = this._getHandleHost();\n const domHandleHostRect = new Rect(domHandleHost);\n const handleHostWidth = Math.round(domHandleHostRect.width);\n const handleHostHeight = Math.round(domHandleHostRect.height);\n // Handle max-width limitation.\n const domResizeHostRect = new Rect(domHandleHost);\n newSize.width = Math.round(domResizeHostRect.width);\n newSize.height = Math.round(domResizeHostRect.height);\n this.redraw(domHandleHostRect);\n this.state.update({\n ...newSize,\n handleHostWidth,\n handleHostHeight\n });\n }\n /**\n * Applies the geometry proposed with the resizer.\n *\n * @fires commit\n */\n commit() {\n const unit = this._options.unit || '%';\n const newValue = (unit === '%' ? this.state.proposedWidthPercents : this.state.proposedWidth) + unit;\n // Both cleanup and onCommit callback are very likely to make view changes. Ensure that it is made in a single step.\n this._options.editor.editing.view.change(() => {\n this._cleanup();\n this._options.onCommit(newValue);\n });\n }\n /**\n * Cancels and rejects the proposed resize dimensions, hiding the UI.\n *\n * @fires cancel\n */\n cancel() {\n this._cleanup();\n }\n /**\n * Destroys the resizer.\n */\n destroy() {\n this.cancel();\n }\n /**\n * Redraws the resizer.\n *\n * @param handleHostRect Handle host rectangle might be given to improve performance.\n */\n redraw(handleHostRect) {\n const domWrapper = this._domResizerWrapper;\n // Refresh only if resizer exists in the DOM.\n if (!existsInDom(domWrapper)) {\n return;\n }\n const widgetWrapper = domWrapper.parentElement;\n const handleHost = this._getHandleHost();\n const resizerWrapper = this._viewResizerWrapper;\n const currentDimensions = [\n resizerWrapper.getStyle('width'),\n resizerWrapper.getStyle('height'),\n resizerWrapper.getStyle('left'),\n resizerWrapper.getStyle('top')\n ];\n let newDimensions;\n if (widgetWrapper.isSameNode(handleHost)) {\n const clientRect = handleHostRect || new Rect(handleHost);\n newDimensions = [\n clientRect.width + 'px',\n clientRect.height + 'px',\n undefined,\n undefined\n ];\n }\n // In case a resizing host is not a widget wrapper, we need to compensate\n // for any additional offsets the resize host might have. E.g. wrapper padding\n // or simply another editable. By doing that the border and resizers are shown\n // only around the resize host.\n else {\n newDimensions = [\n handleHost.offsetWidth + 'px',\n handleHost.offsetHeight + 'px',\n handleHost.offsetLeft + 'px',\n handleHost.offsetTop + 'px'\n ];\n }\n // Make changes to the view only if the resizer should actually get new dimensions.\n // Otherwise, if View#change() was always called, this would cause EditorUI#update\n // loops because the WidgetResize plugin listens to EditorUI#update and updates\n // the resizer.\n // https://github.com/ckeditor/ckeditor5/issues/7633\n if (compareArrays(currentDimensions, newDimensions) !== 'same') {\n this._options.editor.editing.view.change(writer => {\n writer.setStyle({\n width: newDimensions[0],\n height: newDimensions[1],\n left: newDimensions[2],\n top: newDimensions[3]\n }, resizerWrapper);\n });\n }\n }\n containsHandle(domElement) {\n return this._domResizerWrapper.contains(domElement);\n }\n static isResizeHandle(domElement) {\n return domElement.classList.contains('ck-widget__resizer__handle');\n }\n /**\n * Cleans up the context state.\n */\n _cleanup() {\n this._sizeView._dismiss();\n const editingView = this._options.editor.editing.view;\n editingView.change(writer => {\n writer.setStyle('width', this._initialViewWidth, this._options.viewElement);\n });\n }\n /**\n * Calculates the proposed size as the resize handles are dragged.\n *\n * @param domEventData Event data that caused the size update request. It should be used to calculate the proposed size.\n */\n _proposeNewSize(domEventData) {\n const state = this.state;\n const currentCoordinates = extractCoordinates(domEventData);\n const isCentered = this._options.isCentered ? this._options.isCentered(this) : true;\n // Enlargement defines how much the resize host has changed in a given axis. Naturally it could be a negative number\n // meaning that it has been shrunk.\n //\n // +----------------+--+\n // | | |\n // | img | |\n // | /handle host | |\n // +----------------+ | ^\n // | | | - enlarge y\n // +-------------------+ v\n // \t\t\t\t\t<-->\n // \t\t\t\t\t enlarge x\n const enlargement = {\n x: state._referenceCoordinates.x - (currentCoordinates.x + state.originalWidth),\n y: (currentCoordinates.y - state.originalHeight) - state._referenceCoordinates.y\n };\n if (isCentered && state.activeHandlePosition.endsWith('-right')) {\n enlargement.x = currentCoordinates.x - (state._referenceCoordinates.x + state.originalWidth);\n }\n // Objects needs to be resized twice as much in horizontal axis if centered, since enlargement is counted from\n // one resized corner to your cursor. It needs to be duplicated to compensate for the other side too.\n if (isCentered) {\n enlargement.x *= 2;\n }\n // const resizeHost = this._getResizeHost();\n // The size proposed by the user. It does not consider the aspect ratio.\n let width = Math.abs(state.originalWidth + enlargement.x);\n let height = Math.abs(state.originalHeight + enlargement.y);\n // Dominant determination must take the ratio into account.\n const dominant = width / state.aspectRatio > height ? 'width' : 'height';\n if (dominant == 'width') {\n height = width / state.aspectRatio;\n }\n else {\n width = height * state.aspectRatio;\n }\n return {\n width: Math.round(width),\n height: Math.round(height),\n widthPercents: Math.min(Math.round(state.originalWidthPercents / state.originalWidth * width * 100) / 100, 100)\n };\n }\n /**\n * Obtains the resize host.\n *\n * Resize host is an object that receives dimensions which are the result of resizing.\n */\n _getResizeHost() {\n const widgetWrapper = this._domResizerWrapper.parentElement;\n return this._options.getResizeHost(widgetWrapper);\n }\n /**\n * Obtains the handle host.\n *\n * Handle host is an object that the handles are aligned to.\n *\n * Handle host will not always be an entire widget itself. Take an image as an example. The image widget\n * contains an image and a caption. Only the image should be surrounded with handles.\n */\n _getHandleHost() {\n const widgetWrapper = this._domResizerWrapper.parentElement;\n return this._options.getHandleHost(widgetWrapper);\n }\n /**\n * DOM container of the entire resize UI.\n *\n * Note that this property will have a value only after the element bound with the resizer is rendered\n * (otherwise `null`).\n */\n get _domResizerWrapper() {\n return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper);\n }\n /**\n * Renders the resize handles in the DOM.\n *\n * @param domElement The resizer wrapper.\n */\n _appendHandles(domElement) {\n const resizerPositions = ['top-left', 'top-right', 'bottom-right', 'bottom-left'];\n for (const currentPosition of resizerPositions) {\n domElement.appendChild((new Template({\n tag: 'div',\n attributes: {\n class: `ck-widget__resizer__handle ${getResizerClass(currentPosition)}`\n }\n }).render()));\n }\n }\n /**\n * Sets up the {@link #_sizeView} property and adds it to the passed `domElement`.\n */\n _appendSizeUI(domElement) {\n this._sizeView = new SizeView();\n // Make sure icon#element is rendered before passing to appendChild().\n this._sizeView.render();\n domElement.appendChild(this._sizeView.element);\n }\n}\n/**\n * @param resizerPosition Expected resizer position like `\"top-left\"`, `\"bottom-right\"`.\n * @returns A prefixed HTML class name for the resizer element\n */\nfunction getResizerClass(resizerPosition) {\n return `ck-widget__resizer__handle-${resizerPosition}`;\n}\nfunction extractCoordinates(event) {\n return {\n x: event.pageX,\n y: event.pageY\n };\n}\nfunction existsInDom(element) {\n return element && element.ownerDocument && element.ownerDocument.contains(element);\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./widgetresize.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module widget/widgetresize\n */\nimport Resizer from './widgetresize/resizer';\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { MouseObserver } from '@ckeditor/ckeditor5-engine';\nimport { DomEmitterMixin, global } from '@ckeditor/ckeditor5-utils';\nimport { throttle } from 'lodash-es';\nimport '../theme/widgetresize.css';\n/**\n * The widget resize feature plugin.\n *\n * Use the {@link module:widget/widgetresize~WidgetResize#attachTo} method to create a resizer for the specified widget.\n */\nexport default class WidgetResize extends Plugin {\n constructor() {\n super(...arguments);\n /**\n * A map of resizers created using this plugin instance.\n */\n this._resizers = new Map();\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'WidgetResize';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editing = this.editor.editing;\n const domDocument = global.window.document;\n this.set('selectedResizer', null);\n this.set('_activeResizer', null);\n editing.view.addObserver(MouseObserver);\n this._observer = new (DomEmitterMixin())();\n this.listenTo(editing.view.document, 'mousedown', this._mouseDownListener.bind(this), { priority: 'high' });\n this._observer.listenTo(domDocument, 'mousemove', this._mouseMoveListener.bind(this));\n this._observer.listenTo(domDocument, 'mouseup', this._mouseUpListener.bind(this));\n this._redrawSelectedResizerThrottled = throttle(() => this.redrawSelectedResizer(), 200);\n // Redrawing on any change of the UI of the editor (including content changes).\n this.editor.ui.on('update', this._redrawSelectedResizerThrottled);\n // Remove view widget-resizer mappings for widgets that have been removed from the document.\n // https://github.com/ckeditor/ckeditor5/issues/10156\n // https://github.com/ckeditor/ckeditor5/issues/10266\n this.editor.model.document.on('change', () => {\n for (const [viewElement, resizer] of this._resizers) {\n if (!viewElement.isAttached()) {\n this._resizers.delete(viewElement);\n resizer.destroy();\n }\n }\n }, { priority: 'lowest' });\n // Resizers need to be redrawn upon window resize, because new window might shrink resize host.\n this._observer.listenTo(global.window, 'resize', this._redrawSelectedResizerThrottled);\n const viewSelection = this.editor.editing.view.document.selection;\n viewSelection.on('change', () => {\n const selectedElement = viewSelection.getSelectedElement();\n const resizer = this.getResizerByViewElement(selectedElement) || null;\n if (resizer) {\n this.select(resizer);\n }\n else {\n this.deselect();\n }\n });\n }\n /**\n * Redraws the selected resizer if there is any selected resizer and if it is visible.\n */\n redrawSelectedResizer() {\n if (this.selectedResizer && this.selectedResizer.isVisible) {\n this.selectedResizer.redraw();\n }\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this._observer.stopListening();\n for (const resizer of this._resizers.values()) {\n resizer.destroy();\n }\n this._redrawSelectedResizerThrottled.cancel();\n }\n /**\n * Marks resizer as selected.\n */\n select(resizer) {\n this.deselect();\n this.selectedResizer = resizer;\n this.selectedResizer.isSelected = true;\n }\n /**\n * Deselects currently set resizer.\n */\n deselect() {\n if (this.selectedResizer) {\n this.selectedResizer.isSelected = false;\n }\n this.selectedResizer = null;\n }\n /**\n * @param options Resizer options.\n */\n attachTo(options) {\n const resizer = new Resizer(options);\n const plugins = this.editor.plugins;\n resizer.attach();\n if (plugins.has('WidgetToolbarRepository')) {\n // Hiding widget toolbar to improve the performance\n // (https://github.com/ckeditor/ckeditor5-widget/pull/112#issuecomment-564528765).\n const widgetToolbarRepository = plugins.get('WidgetToolbarRepository');\n resizer.on('begin', () => {\n widgetToolbarRepository.forceDisabled('resize');\n }, { priority: 'lowest' });\n resizer.on('cancel', () => {\n widgetToolbarRepository.clearForceDisabled('resize');\n }, { priority: 'highest' });\n resizer.on('commit', () => {\n widgetToolbarRepository.clearForceDisabled('resize');\n }, { priority: 'highest' });\n }\n this._resizers.set(options.viewElement, resizer);\n const viewSelection = this.editor.editing.view.document.selection;\n const selectedElement = viewSelection.getSelectedElement();\n // If the element the resizer is created for is currently focused, it should become visible.\n if (this.getResizerByViewElement(selectedElement) == resizer) {\n this.select(resizer);\n }\n return resizer;\n }\n /**\n * Returns a resizer created for a given view element (widget element).\n *\n * @param viewElement View element associated with the resizer.\n */\n getResizerByViewElement(viewElement) {\n return this._resizers.get(viewElement);\n }\n /**\n * Returns a resizer that contains a given resize handle.\n */\n _getResizerByHandle(domResizeHandle) {\n for (const resizer of this._resizers.values()) {\n if (resizer.containsHandle(domResizeHandle)) {\n return resizer;\n }\n }\n }\n /**\n * @param domEventData Native DOM event.\n */\n _mouseDownListener(event, domEventData) {\n const resizeHandle = domEventData.domTarget;\n if (!Resizer.isResizeHandle(resizeHandle)) {\n return;\n }\n this._activeResizer = this._getResizerByHandle(resizeHandle) || null;\n if (this._activeResizer) {\n this._activeResizer.begin(resizeHandle);\n // Do not call other events when resizing. See: #6755.\n event.stop();\n domEventData.preventDefault();\n }\n }\n /**\n * @param domEventData Native DOM event.\n */\n _mouseMoveListener(event, domEventData) {\n if (this._activeResizer) {\n this._activeResizer.updateSize(domEventData);\n }\n }\n _mouseUpListener() {\n if (this._activeResizer) {\n this._activeResizer.commit();\n this._activeResizer = null;\n }\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./clipboard.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/dragdrop\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { LiveRange, MouseObserver } from '@ckeditor/ckeditor5-engine';\nimport { Widget, isWidget } from '@ckeditor/ckeditor5-widget';\nimport { env, uid, delay } from '@ckeditor/ckeditor5-utils';\nimport ClipboardPipeline from './clipboardpipeline';\nimport ClipboardObserver from './clipboardobserver';\nimport { throttle } from 'lodash-es';\nimport '../theme/clipboard.css';\n// Drag and drop events overview:\n//\n// ┌──────────────────┐\n// │ mousedown │ Sets the draggable attribute.\n// └─────────┬────────┘\n// │\n// └─────────────────────┐\n// │ │\n// │ ┌─────────V────────┐\n// │ │ mouseup │ Dragging did not start, removes the draggable attribute.\n// │ └──────────────────┘\n// │\n// ┌─────────V────────┐ Retrieves the selected model.DocumentFragment\n// │ dragstart │ and converts it to view.DocumentFragment.\n// └─────────┬────────┘\n// │\n// ┌─────────V────────┐ Processes view.DocumentFragment to text/html and text/plain\n// │ clipboardOutput │ and stores the results in data.dataTransfer.\n// └─────────┬────────┘\n// │\n// │ DOM dragover\n// ┌────────────┐\n// │ │\n// ┌─────────V────────┐ │\n// │ dragging │ │ Updates the drop target marker.\n// └─────────┬────────┘ │\n// │ │\n// ┌─────────────└────────────┘\n// │ │ │\n// │ ┌─────────V────────┐ │\n// │ │ dragleave │ │ Removes the drop target marker.\n// │ └─────────┬────────┘ │\n// │ │ │\n// ┌───│─────────────┘ │\n// │ │ │ │\n// │ │ ┌─────────V────────┐ │\n// │ │ │ dragenter │ │ Focuses the editor view.\n// │ │ └─────────┬────────┘ │\n// │ │ │ │\n// │ │ └────────────┘\n// │ │\n// │ └─────────────┐\n// │ │ │\n// │ │ ┌─────────V────────┐\n// └───┐ │ drop │ (The default handler of the clipboard pipeline).\n// │ └─────────┬────────┘\n// │ │\n// │ ┌─────────V────────┐ Resolves the final data.targetRanges.\n// │ │ clipboardInput │ Aborts if dropping on dragged content.\n// │ └─────────┬────────┘\n// │ │\n// │ ┌─────────V────────┐\n// │ │ clipboardInput │ (The default handler of the clipboard pipeline).\n// │ └─────────┬────────┘\n// │ │\n// │ ┌───────────V───────────┐\n// │ │ inputTransformation │ (The default handler of the clipboard pipeline).\n// │ └───────────┬───────────┘\n// │ │\n// │ ┌──────────V──────────┐\n// │ │ contentInsertion │ Updates the document selection to drop range.\n// │ └──────────┬──────────┘\n// │ │\n// │ ┌──────────V──────────┐\n// │ │ contentInsertion │ (The default handler of the clipboard pipeline).\n// │ └──────────┬──────────┘\n// │ │\n// │ ┌──────────V──────────┐\n// │ │ contentInsertion │ Removes the content from the original range if the insertion was successful.\n// │ └──────────┬──────────┘\n// │ │\n// └─────────────┐\n// │\n// ┌─────────V────────┐\n// │ dragend │ Removes the drop marker and cleans the state.\n// └──────────────────┘\n//\n/**\n * The drag and drop feature. It works on top of the {@link module:clipboard/clipboardpipeline~ClipboardPipeline}.\n *\n * Read more about the clipboard integration in the {@glink framework/deep-dive/clipboard clipboard deep-dive} guide.\n */\nexport default class DragDrop extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'DragDrop';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ClipboardPipeline, Widget];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const view = editor.editing.view;\n this._draggedRange = null;\n this._draggingUid = '';\n this._draggableElement = null;\n this._updateDropMarkerThrottled = throttle(targetRange => this._updateDropMarker(targetRange), 40);\n this._removeDropMarkerDelayed = delay(() => this._removeDropMarker(), 40);\n this._clearDraggableAttributesDelayed = delay(() => this._clearDraggableAttributes(), 40);\n if (editor.plugins.has('DragDropExperimental')) {\n this.forceDisabled('DragDropExperimental');\n return;\n }\n view.addObserver(ClipboardObserver);\n view.addObserver(MouseObserver);\n this._setupDragging();\n this._setupContentInsertionIntegration();\n this._setupClipboardInputIntegration();\n this._setupDropMarker();\n this._setupDraggableAttributeHandling();\n this.listenTo(editor, 'change:isReadOnly', (evt, name, isReadOnly) => {\n if (isReadOnly) {\n this.forceDisabled('readOnlyMode');\n }\n else {\n this.clearForceDisabled('readOnlyMode');\n }\n });\n this.on('change:isEnabled', (evt, name, isEnabled) => {\n if (!isEnabled) {\n this._finalizeDragging(false);\n }\n });\n if (env.isAndroid) {\n this.forceDisabled('noAndroidSupport');\n }\n }\n /**\n * @inheritDoc\n */\n destroy() {\n if (this._draggedRange) {\n this._draggedRange.detach();\n this._draggedRange = null;\n }\n this._updateDropMarkerThrottled.cancel();\n this._removeDropMarkerDelayed.cancel();\n this._clearDraggableAttributesDelayed.cancel();\n return super.destroy();\n }\n /**\n * Drag and drop events handling.\n */\n _setupDragging() {\n const editor = this.editor;\n const model = editor.model;\n const modelDocument = model.document;\n const view = editor.editing.view;\n const viewDocument = view.document;\n // The handler for the drag start; it is responsible for setting data transfer object.\n this.listenTo(viewDocument, 'dragstart', (evt, data) => {\n const selection = modelDocument.selection;\n // Don't drag the editable element itself.\n if (data.target && data.target.is('editableElement')) {\n data.preventDefault();\n return;\n }\n // TODO we could clone this node somewhere and style it to match editing view but without handles,\n // selection outline, WTA buttons, etc.\n // data.dataTransfer._native.setDragImage( data.domTarget, 0, 0 );\n // Check if this is dragstart over the widget (but not a nested editable).\n const draggableWidget = data.target ? findDraggableWidget(data.target) : null;\n if (draggableWidget) {\n const modelElement = editor.editing.mapper.toModelElement(draggableWidget);\n this._draggedRange = LiveRange.fromRange(model.createRangeOn(modelElement));\n // Disable toolbars so they won't obscure the drop area.\n if (editor.plugins.has('WidgetToolbarRepository')) {\n const widgetToolbarRepository = editor.plugins.get('WidgetToolbarRepository');\n widgetToolbarRepository.forceDisabled('dragDrop');\n }\n }\n // If this was not a widget we should check if we need to drag some text content.\n else if (!viewDocument.selection.isCollapsed) {\n const selectedElement = viewDocument.selection.getSelectedElement();\n if (!selectedElement || !isWidget(selectedElement)) {\n this._draggedRange = LiveRange.fromRange(selection.getFirstRange());\n }\n }\n if (!this._draggedRange) {\n data.preventDefault();\n return;\n }\n this._draggingUid = uid();\n const canEditAtDraggedRange = this.isEnabled && editor.model.canEditAt(this._draggedRange);\n data.dataTransfer.effectAllowed = canEditAtDraggedRange ? 'copyMove' : 'copy';\n data.dataTransfer.setData('application/ckeditor5-dragging-uid', this._draggingUid);\n const draggedSelection = model.createSelection(this._draggedRange.toRange());\n const content = editor.data.toView(model.getSelectedContent(draggedSelection));\n viewDocument.fire('clipboardOutput', {\n dataTransfer: data.dataTransfer,\n content,\n method: 'dragstart'\n });\n if (!canEditAtDraggedRange) {\n this._draggedRange.detach();\n this._draggedRange = null;\n this._draggingUid = '';\n }\n }, { priority: 'low' });\n // The handler for finalizing drag and drop. It should always be triggered after dragging completes\n // even if it was completed in a different application.\n // Note: This is not fired if source text node got removed while downcasting a marker.\n this.listenTo(viewDocument, 'dragend', (evt, data) => {\n this._finalizeDragging(!data.dataTransfer.isCanceled && data.dataTransfer.dropEffect == 'move');\n }, { priority: 'low' });\n // Dragging over the editable.\n this.listenTo(viewDocument, 'dragenter', () => {\n if (!this.isEnabled) {\n return;\n }\n view.focus();\n });\n // Dragging out of the editable.\n this.listenTo(viewDocument, 'dragleave', () => {\n // We do not know if the mouse left the editor or just some element in it, so let us wait a few milliseconds\n // to check if 'dragover' is not fired.\n this._removeDropMarkerDelayed();\n });\n // Handler for moving dragged content over the target area.\n this.listenTo(viewDocument, 'dragging', (evt, data) => {\n if (!this.isEnabled) {\n data.dataTransfer.dropEffect = 'none';\n return;\n }\n this._removeDropMarkerDelayed.cancel();\n const targetRange = findDropTargetRange(editor, data.targetRanges, data.target);\n // Do not drop if target place is not editable.\n if (!editor.model.canEditAt(targetRange)) {\n data.dataTransfer.dropEffect = 'none';\n return;\n }\n // If this is content being dragged from another editor, moving out of current editor instance\n // is not possible until 'dragend' event case will be fixed.\n if (!this._draggedRange) {\n data.dataTransfer.dropEffect = 'copy';\n }\n // In Firefox it is already set and effect allowed remains the same as originally set.\n if (!env.isGecko) {\n if (data.dataTransfer.effectAllowed == 'copy') {\n data.dataTransfer.dropEffect = 'copy';\n }\n else if (['all', 'copyMove'].includes(data.dataTransfer.effectAllowed)) {\n data.dataTransfer.dropEffect = 'move';\n }\n }\n /* istanbul ignore else -- @preserve */\n if (targetRange) {\n this._updateDropMarkerThrottled(targetRange);\n }\n }, { priority: 'low' });\n }\n /**\n * Integration with the `clipboardInput` event.\n */\n _setupClipboardInputIntegration() {\n const editor = this.editor;\n const view = editor.editing.view;\n const viewDocument = view.document;\n // Update the event target ranges and abort dropping if dropping over itself.\n this.listenTo(viewDocument, 'clipboardInput', (evt, data) => {\n if (data.method != 'drop') {\n return;\n }\n const targetRange = findDropTargetRange(editor, data.targetRanges, data.target);\n // The dragging markers must be removed after searching for the target range because sometimes\n // the target lands on the marker itself.\n this._removeDropMarker();\n /* istanbul ignore if -- @preserve */\n if (!targetRange || !editor.model.canEditAt(targetRange)) {\n this._finalizeDragging(false);\n evt.stop();\n return;\n }\n // Since we cannot rely on the drag end event, we must check if the local drag range is from the current drag and drop\n // or it is from some previous not cleared one.\n if (this._draggedRange && this._draggingUid != data.dataTransfer.getData('application/ckeditor5-dragging-uid')) {\n this._draggedRange.detach();\n this._draggedRange = null;\n this._draggingUid = '';\n }\n // Do not do anything if some content was dragged within the same document to the same position.\n const isMove = getFinalDropEffect(data.dataTransfer) == 'move';\n if (isMove && this._draggedRange && this._draggedRange.containsRange(targetRange, true)) {\n this._finalizeDragging(false);\n evt.stop();\n return;\n }\n // Override the target ranges with the one adjusted to the best one for a drop.\n data.targetRanges = [editor.editing.mapper.toViewRange(targetRange)];\n }, { priority: 'high' });\n }\n /**\n * Integration with the `contentInsertion` event of the clipboard pipeline.\n */\n _setupContentInsertionIntegration() {\n const clipboardPipeline = this.editor.plugins.get(ClipboardPipeline);\n clipboardPipeline.on('contentInsertion', (evt, data) => {\n if (!this.isEnabled || data.method !== 'drop') {\n return;\n }\n // Update the selection to the target range in the same change block to avoid selection post-fixing\n // and to be able to clone text attributes for plain text dropping.\n const ranges = data.targetRanges.map(viewRange => this.editor.editing.mapper.toModelRange(viewRange));\n this.editor.model.change(writer => writer.setSelection(ranges));\n }, { priority: 'high' });\n clipboardPipeline.on('contentInsertion', (evt, data) => {\n if (!this.isEnabled || data.method !== 'drop') {\n return;\n }\n // Remove dragged range content, remove markers, clean after dragging.\n const isMove = getFinalDropEffect(data.dataTransfer) == 'move';\n // Whether any content was inserted (insertion might fail if the schema is disallowing some elements\n // (for example an image caption allows only the content of a block but not blocks themselves.\n // Some integrations might not return valid range (i.e., table pasting).\n const isSuccess = !data.resultRange || !data.resultRange.isCollapsed;\n this._finalizeDragging(isSuccess && isMove);\n }, { priority: 'lowest' });\n }\n /**\n * Adds listeners that add the `draggable` attribute to the elements while the mouse button is down so the dragging could start.\n */\n _setupDraggableAttributeHandling() {\n const editor = this.editor;\n const view = editor.editing.view;\n const viewDocument = view.document;\n // Add the 'draggable' attribute to the widget while pressing the selection handle.\n // This is required for widgets to be draggable. In Chrome it will enable dragging text nodes.\n this.listenTo(viewDocument, 'mousedown', (evt, data) => {\n // The lack of data can be caused by editor tests firing fake mouse events. This should not occur\n // in real-life scenarios but this greatly simplifies editor tests that would otherwise fail a lot.\n if (env.isAndroid || !data) {\n return;\n }\n this._clearDraggableAttributesDelayed.cancel();\n // Check if this is a mousedown over the widget (but not a nested editable).\n let draggableElement = findDraggableWidget(data.target);\n // Note: There is a limitation that if more than a widget is selected (a widget and some text)\n // and dragging starts on the widget, then only the widget is dragged.\n // If this was not a widget then we should check if we need to drag some text content.\n // In Chrome set a 'draggable' attribute on closest editable to allow immediate dragging of the selected text range.\n // In Firefox this is not needed. In Safari it makes the whole editable draggable (not just textual content).\n // Disabled in read-only mode because draggable=\"true\" + contenteditable=\"false\" results\n // in not firing selectionchange event ever, which makes the selection stuck in read-only mode.\n if (env.isBlink && !draggableElement && !viewDocument.selection.isCollapsed) {\n const selectedElement = viewDocument.selection.getSelectedElement();\n if (!selectedElement || !isWidget(selectedElement)) {\n const editableElement = viewDocument.selection.editableElement;\n if (editableElement && !editableElement.isReadOnly) {\n draggableElement = editableElement;\n }\n }\n }\n if (draggableElement) {\n view.change(writer => {\n writer.setAttribute('draggable', 'true', draggableElement);\n });\n // Keep the reference to the model element in case the view element gets removed while dragging.\n this._draggableElement = editor.editing.mapper.toModelElement(draggableElement);\n }\n });\n // Remove the draggable attribute in case no dragging started (only mousedown + mouseup).\n this.listenTo(viewDocument, 'mouseup', () => {\n if (!env.isAndroid) {\n this._clearDraggableAttributesDelayed();\n }\n });\n }\n /**\n * Removes the `draggable` attribute from the element that was used for dragging.\n */\n _clearDraggableAttributes() {\n const editing = this.editor.editing;\n editing.view.change(writer => {\n // Remove 'draggable' attribute.\n if (this._draggableElement && this._draggableElement.root.rootName != '$graveyard') {\n writer.removeAttribute('draggable', editing.mapper.toViewElement(this._draggableElement));\n }\n this._draggableElement = null;\n });\n }\n /**\n * Creates downcast conversion for the drop target marker.\n */\n _setupDropMarker() {\n const editor = this.editor;\n // Drop marker conversion for hovering over widgets.\n editor.conversion.for('editingDowncast').markerToHighlight({\n model: 'drop-target',\n view: {\n classes: ['ck-clipboard-drop-target-range']\n }\n });\n // Drop marker conversion for in text drop target.\n editor.conversion.for('editingDowncast').markerToElement({\n model: 'drop-target',\n view: (data, { writer }) => {\n const inText = editor.model.schema.checkChild(data.markerRange.start, '$text');\n if (!inText) {\n return;\n }\n return writer.createUIElement('span', { class: 'ck ck-clipboard-drop-target-position' }, function (domDocument) {\n const domElement = this.toDomElement(domDocument);\n // Using word joiner to make this marker as high as text and also making text not break on marker.\n domElement.append('\\u2060', domDocument.createElement('span'), '\\u2060');\n return domElement;\n });\n }\n });\n }\n /**\n * Updates the drop target marker to the provided range.\n *\n * @param targetRange The range to set the marker to.\n */\n _updateDropMarker(targetRange) {\n const editor = this.editor;\n const markers = editor.model.markers;\n editor.model.change(writer => {\n if (markers.has('drop-target')) {\n if (!markers.get('drop-target').getRange().isEqual(targetRange)) {\n writer.updateMarker('drop-target', { range: targetRange });\n }\n }\n else {\n writer.addMarker('drop-target', {\n range: targetRange,\n usingOperation: false,\n affectsData: false\n });\n }\n });\n }\n /**\n * Removes the drop target marker.\n */\n _removeDropMarker() {\n const model = this.editor.model;\n this._removeDropMarkerDelayed.cancel();\n this._updateDropMarkerThrottled.cancel();\n if (model.markers.has('drop-target')) {\n model.change(writer => {\n writer.removeMarker('drop-target');\n });\n }\n }\n /**\n * Deletes the dragged content from its original range and clears the dragging state.\n *\n * @param moved Whether the move succeeded.\n */\n _finalizeDragging(moved) {\n const editor = this.editor;\n const model = editor.model;\n this._removeDropMarker();\n this._clearDraggableAttributes();\n if (editor.plugins.has('WidgetToolbarRepository')) {\n const widgetToolbarRepository = editor.plugins.get('WidgetToolbarRepository');\n widgetToolbarRepository.clearForceDisabled('dragDrop');\n }\n this._draggingUid = '';\n if (!this._draggedRange) {\n return;\n }\n // Delete moved content.\n if (moved && this.isEnabled) {\n model.deleteContent(model.createSelection(this._draggedRange), { doNotAutoparagraph: true });\n }\n this._draggedRange.detach();\n this._draggedRange = null;\n }\n}\n/**\n * Returns fixed selection range for given position and target element.\n */\nfunction findDropTargetRange(editor, targetViewRanges, targetViewElement) {\n const model = editor.model;\n const mapper = editor.editing.mapper;\n let range = null;\n const targetViewPosition = targetViewRanges ? targetViewRanges[0].start : null;\n // A UIElement is not a valid drop element, use parent (this could be a drop marker or any other UIElement).\n if (targetViewElement.is('uiElement')) {\n targetViewElement = targetViewElement.parent;\n }\n // Quick win if the target is a widget (but not a nested editable).\n range = findDropTargetRangeOnWidget(editor, targetViewElement);\n if (range) {\n return range;\n }\n // The easiest part is over, now we need to move to the model space.\n // Find target model element and position.\n const targetModelElement = getClosestMappedModelElement(editor, targetViewElement);\n const targetModelPosition = targetViewPosition ? mapper.toModelPosition(targetViewPosition) : null;\n // There is no target position while hovering over an empty table cell.\n // In Safari, target position can be empty while hovering over a widget (e.g., a page-break).\n // Find the drop position inside the element.\n if (!targetModelPosition) {\n return findDropTargetRangeInElement(editor, targetModelElement);\n }\n // Check if target position is between blocks and adjust drop position to the next object.\n // This is because while hovering over a root element next to a widget the target position can jump in crazy places.\n range = findDropTargetRangeBetweenBlocks(editor, targetModelPosition, targetModelElement);\n if (range) {\n return range;\n }\n // Try fixing selection position.\n // In Firefox, the target position lands before widgets but in other browsers it tends to land after a widget.\n range = model.schema.getNearestSelectionRange(targetModelPosition, env.isGecko ? 'forward' : 'backward');\n if (range) {\n return range;\n }\n // There is no valid selection position inside the current limit element so find a closest object ancestor.\n // This happens if the model position lands directly in the <table> element itself (view target element was a `<td>`\n // so a nested editable, but view target position was directly in the `<figure>` element).\n return findDropTargetRangeOnAncestorObject(editor, targetModelPosition.parent);\n}\n/**\n * Returns fixed selection range for a given position and a target element if it is over the widget but not over its nested editable.\n */\nfunction findDropTargetRangeOnWidget(editor, targetViewElement) {\n const model = editor.model;\n const mapper = editor.editing.mapper;\n // Quick win if the target is a widget.\n if (isWidget(targetViewElement)) {\n return model.createRangeOn(mapper.toModelElement(targetViewElement));\n }\n // Check if we are deeper over a widget (but not over a nested editable).\n if (!targetViewElement.is('editableElement')) {\n // Find a closest ancestor that is either a widget or an editable element...\n const ancestor = targetViewElement.findAncestor(node => isWidget(node) || node.is('editableElement'));\n // ...and if the widget was closer then it is a drop target.\n if (isWidget(ancestor)) {\n return model.createRangeOn(mapper.toModelElement(ancestor));\n }\n }\n return null;\n}\n/**\n * Returns fixed selection range inside a model element.\n */\nfunction findDropTargetRangeInElement(editor, targetModelElement) {\n const model = editor.model;\n const schema = model.schema;\n const positionAtElementStart = model.createPositionAt(targetModelElement, 0);\n return schema.getNearestSelectionRange(positionAtElementStart, 'forward');\n}\n/**\n * Returns fixed selection range for a given position and a target element if the drop is between blocks.\n */\nfunction findDropTargetRangeBetweenBlocks(editor, targetModelPosition, targetModelElement) {\n const model = editor.model;\n // Check if target is between blocks.\n if (!model.schema.checkChild(targetModelElement, '$block')) {\n return null;\n }\n // Find position between blocks.\n const positionAtElementStart = model.createPositionAt(targetModelElement, 0);\n // Get the common part of the path (inside the target element and the target position).\n const commonPath = targetModelPosition.path.slice(0, positionAtElementStart.path.length);\n // Position between the blocks.\n const betweenBlocksPosition = model.createPositionFromPath(targetModelPosition.root, commonPath);\n const nodeAfter = betweenBlocksPosition.nodeAfter;\n // Adjust drop position to the next object.\n // This is because while hovering over a root element next to a widget the target position can jump in crazy places.\n if (nodeAfter && model.schema.isObject(nodeAfter)) {\n return model.createRangeOn(nodeAfter);\n }\n return null;\n}\n/**\n * Returns a selection range on the ancestor object.\n */\nfunction findDropTargetRangeOnAncestorObject(editor, element) {\n const model = editor.model;\n let currentElement = element;\n while (currentElement) {\n if (model.schema.isObject(currentElement)) {\n return model.createRangeOn(currentElement);\n }\n currentElement = currentElement.parent;\n }\n /* istanbul ignore next -- @preserve */\n return null;\n}\n/**\n * Returns the closest model element for the specified view element.\n */\nfunction getClosestMappedModelElement(editor, element) {\n const mapper = editor.editing.mapper;\n const view = editor.editing.view;\n const targetModelElement = mapper.toModelElement(element);\n if (targetModelElement) {\n return targetModelElement;\n }\n // Find mapped ancestor if the target is inside not mapped element (for example inline code element).\n const viewPosition = view.createPositionBefore(element);\n const viewElement = mapper.findMappedViewAncestor(viewPosition);\n return mapper.toModelElement(viewElement);\n}\n/**\n * Returns the drop effect that should be a result of dragging the content.\n * This function is handling a quirk when checking the effect in the 'drop' DOM event.\n */\nfunction getFinalDropEffect(dataTransfer) {\n if (env.isGecko) {\n return dataTransfer.dropEffect;\n }\n return ['all', 'copyMove'].includes(dataTransfer.effectAllowed) ? 'move' : 'copy';\n}\n/**\n * Returns a widget element that should be dragged.\n */\nfunction findDraggableWidget(target) {\n // This is directly an editable so not a widget for sure.\n if (target.is('editableElement')) {\n return null;\n }\n // TODO: Let's have a isWidgetSelectionHandleDomElement() helper in ckeditor5-widget utils.\n if (target.hasClass('ck-widget__selection-handle')) {\n return target.findAncestor(isWidget);\n }\n // Direct hit on a widget.\n if (isWidget(target)) {\n return target;\n }\n // Find closest ancestor that is either a widget or an editable element...\n const ancestor = target.findAncestor(node => isWidget(node) || node.is('editableElement'));\n // ...and if closer was the widget then enable dragging it.\n if (isWidget(ancestor)) {\n return ancestor;\n }\n return null;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/pasteplaintext\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport ClipboardObserver from './clipboardobserver';\nimport ClipboardPipeline from './clipboardpipeline';\n/**\n * The plugin detects the user's intention to paste plain text.\n *\n * For example, it detects the <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>V</kbd> keystroke.\n */\nexport default class PastePlainText extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'PastePlainText';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ClipboardPipeline];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const model = editor.model;\n const view = editor.editing.view;\n const viewDocument = view.document;\n const selection = model.document.selection;\n let shiftPressed = false;\n view.addObserver(ClipboardObserver);\n this.listenTo(viewDocument, 'keydown', (evt, data) => {\n shiftPressed = data.shiftKey;\n });\n editor.plugins.get(ClipboardPipeline).on('contentInsertion', (evt, data) => {\n // Plain text can be determined based on the event flag (#7799) or auto-detection (#1006). If detected,\n // preserve selection attributes on pasted items.\n if (!shiftPressed && !isPlainTextFragment(data.content, model.schema)) {\n return;\n }\n model.change(writer => {\n // Formatting attributes should be preserved.\n const textAttributes = Array.from(selection.getAttributes())\n .filter(([key]) => model.schema.getAttributeProperties(key).isFormatting);\n if (!selection.isCollapsed) {\n model.deleteContent(selection, { doNotAutoparagraph: true });\n }\n // Also preserve other attributes if they survived the content deletion (because they were not fully selected).\n // For example linkHref is not a formatting attribute but it should be preserved if pasted text was in the middle\n // of a link.\n textAttributes.push(...selection.getAttributes());\n const range = writer.createRangeIn(data.content);\n for (const item of range.getItems()) {\n if (item.is('$textProxy')) {\n writer.setAttributes(textAttributes, item);\n }\n }\n });\n });\n }\n}\n/**\n * Returns true if specified `documentFragment` represents a plain text.\n */\nfunction isPlainTextFragment(documentFragment, schema) {\n if (documentFragment.childCount > 1) {\n return false;\n }\n const child = documentFragment.getChild(0);\n if (schema.isObject(child)) {\n return false;\n }\n return Array.from(child.getAttributeKeys()).length == 0;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/clipboard\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport ClipboardPipeline from './clipboardpipeline';\nimport DragDrop from './dragdrop';\nimport PastePlainText from './pasteplaintext';\n/**\n * The clipboard feature.\n *\n * Read more about the clipboard integration in the {@glink framework/deep-dive/clipboard clipboard deep-dive} guide.\n *\n * This is a \"glue\" plugin which loads the following plugins:\n * * {@link module:clipboard/clipboardpipeline~ClipboardPipeline}\n * * {@link module:clipboard/dragdrop~DragDrop}\n * * {@link module:clipboard/pasteplaintext~PastePlainText}\n */\nexport default class Clipboard extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Clipboard';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ClipboardPipeline, DragDrop, PastePlainText];\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/lineview\n */\n/* istanbul ignore file -- @preserve */\nimport { View } from '@ckeditor/ckeditor5-ui';\nimport { toUnit } from '@ckeditor/ckeditor5-utils';\nconst toPx = toUnit('px');\n/**\n * The horizontal drop target line view.\n */\nexport default class LineView extends View {\n /**\n * @inheritDoc\n */\n constructor() {\n super();\n const bind = this.bindTemplate;\n this.set({\n isVisible: false,\n left: null,\n top: null,\n width: null\n });\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-clipboard-drop-target-line',\n bind.if('isVisible', 'ck-hidden', value => !value)\n ],\n style: {\n left: bind.to('left', left => toPx(left)),\n top: bind.to('top', top => toPx(top)),\n width: bind.to('width', width => toPx(width))\n }\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module undo/basecommand\n */\nimport { Command } from '@ckeditor/ckeditor5-core';\nimport { transformSets, NoOperation } from '@ckeditor/ckeditor5-engine';\n/**\n * Base class for the undo feature commands: {@link module:undo/undocommand~UndoCommand} and {@link module:undo/redocommand~RedoCommand}.\n */\nexport default class BaseCommand extends Command {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n /**\n * Stack of items stored by the command. These are pairs of:\n *\n * * {@link module:engine/model/batch~Batch batch} saved by the command,\n * * {@link module:engine/model/selection~Selection selection} state at the moment of saving the batch.\n */\n this._stack = [];\n /**\n * Stores all batches that were created by this command.\n *\n * @internal\n */\n this._createdBatches = new WeakSet();\n // Refresh state, so the command is inactive right after initialization.\n this.refresh();\n // This command should not depend on selection change.\n this._isEnabledBasedOnSelection = false;\n // Set the transparent batch for the `editor.data.set()` call if the\n // batch type is not set already.\n this.listenTo(editor.data, 'set', (evt, data) => {\n // Create a shallow copy of the options to not change the original args.\n // And make sure that an object is assigned to data[ 1 ].\n data[1] = { ...data[1] };\n const options = data[1];\n // If batch type is not set, default to non-undoable batch.\n if (!options.batchType) {\n options.batchType = { isUndoable: false };\n }\n }, { priority: 'high' });\n // Clear the stack for the `transparent` batches.\n this.listenTo(editor.data, 'set', (evt, data) => {\n // We can assume that the object exists and it has a `batchType` property.\n // It was ensured with a higher priority listener before.\n const options = data[1];\n if (!options.batchType.isUndoable) {\n this.clearStack();\n }\n });\n }\n /**\n * @inheritDoc\n */\n refresh() {\n this.isEnabled = this._stack.length > 0;\n }\n /**\n * Returns all batches created by this command.\n */\n get createdBatches() {\n return this._createdBatches;\n }\n /**\n * Stores a batch in the command, together with the selection state of the {@link module:engine/model/document~Document document}\n * created by the editor which this command is registered to.\n *\n * @param batch The batch to add.\n */\n addBatch(batch) {\n const docSelection = this.editor.model.document.selection;\n const selection = {\n ranges: docSelection.hasOwnRange ? Array.from(docSelection.getRanges()) : [],\n isBackward: docSelection.isBackward\n };\n this._stack.push({ batch, selection });\n this.refresh();\n }\n /**\n * Removes all items from the stack.\n */\n clearStack() {\n this._stack = [];\n this.refresh();\n }\n /**\n * Restores the {@link module:engine/model/document~Document#selection document selection} state after a batch was undone.\n *\n * @param ranges Ranges to be restored.\n * @param isBackward A flag describing whether the restored range was selected forward or backward.\n * @param operations Operations which has been applied since selection has been stored.\n */\n _restoreSelection(ranges, isBackward, operations) {\n const model = this.editor.model;\n const document = model.document;\n // This will keep the transformed selection ranges.\n const selectionRanges = [];\n // Transform all ranges from the restored selection.\n const transformedRangeGroups = ranges.map(range => range.getTransformedByOperations(operations));\n const allRanges = transformedRangeGroups.flat();\n for (const rangeGroup of transformedRangeGroups) {\n // While transforming there could appear ranges that are contained by other ranges, we shall ignore them.\n const transformed = rangeGroup\n .filter(range => range.root != document.graveyard)\n .filter(range => !isRangeContainedByAnyOtherRange(range, allRanges));\n // All the transformed ranges ended up in graveyard.\n if (!transformed.length) {\n continue;\n }\n // After the range got transformed, we have an array of ranges. Some of those\n // ranges may be \"touching\" -- they can be next to each other and could be merged.\n normalizeRanges(transformed);\n // For each `range` from `ranges`, we take only one transformed range.\n // This is because we want to prevent situation where single-range selection\n // got transformed to multi-range selection.\n selectionRanges.push(transformed[0]);\n }\n // @if CK_DEBUG_ENGINE // console.log( `Restored selection by undo: ${ selectionRanges.join( ', ' ) }` );\n // `selectionRanges` may be empty if all ranges ended up in graveyard. If that is the case, do not restore selection.\n if (selectionRanges.length) {\n model.change(writer => {\n writer.setSelection(selectionRanges, { backward: isBackward });\n });\n }\n }\n /**\n * Undoes a batch by reversing that batch, transforming reversed batch and finally applying it.\n * This is a helper method for {@link #execute}.\n *\n * @param batchToUndo The batch to be undone.\n * @param undoingBatch The batch that will contain undoing changes.\n */\n _undo(batchToUndo, undoingBatch) {\n const model = this.editor.model;\n const document = model.document;\n // All changes done by the command execution will be saved as one batch.\n this._createdBatches.add(undoingBatch);\n const operationsToUndo = batchToUndo.operations.slice().filter(operation => operation.isDocumentOperation);\n operationsToUndo.reverse();\n // We will process each operation from `batchToUndo`, in reverse order. If there were operations A, B and C in undone batch,\n // we need to revert them in reverse order, so first C' (reversed C), then B', then A'.\n for (const operationToUndo of operationsToUndo) {\n const nextBaseVersion = operationToUndo.baseVersion + 1;\n const historyOperations = Array.from(document.history.getOperations(nextBaseVersion));\n const transformedSets = transformSets([operationToUndo.getReversed()], historyOperations, {\n useRelations: true,\n document: this.editor.model.document,\n padWithNoOps: false,\n forceWeakRemove: true\n });\n const reversedOperations = transformedSets.operationsA;\n // After reversed operation has been transformed by all history operations, apply it.\n for (let operation of reversedOperations) {\n // Do not apply any operation on non-editable space.\n const affectedSelectable = operation.affectedSelectable;\n if (affectedSelectable && !model.canEditAt(affectedSelectable)) {\n operation = new NoOperation(operation.baseVersion);\n }\n // Before applying, add the operation to the `undoingBatch`.\n undoingBatch.addOperation(operation);\n model.applyOperation(operation);\n document.history.setOperationAsUndone(operationToUndo, operation);\n }\n }\n }\n}\n/**\n * Normalizes list of ranges by joining intersecting or \"touching\" ranges.\n *\n * @param ranges Ranges to be normalized.\n */\nfunction normalizeRanges(ranges) {\n ranges.sort((a, b) => a.start.isBefore(b.start) ? -1 : 1);\n for (let i = 1; i < ranges.length; i++) {\n const previousRange = ranges[i - 1];\n const joinedRange = previousRange.getJoined(ranges[i], true);\n if (joinedRange) {\n // Replace the ranges on the list with the new joined range.\n i--;\n ranges.splice(i, 2, joinedRange);\n }\n }\n}\nfunction isRangeContainedByAnyOtherRange(range, ranges) {\n return ranges.some(otherRange => otherRange !== range && otherRange.containsRange(range, true));\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module undo/undocommand\n */\nimport BaseCommand from './basecommand';\n/**\n * The undo command stores {@link module:engine/model/batch~Batch batches} applied to the\n * {@link module:engine/model/document~Document document} and is able to undo a batch by reversing it and transforming by\n * batches from {@link module:engine/model/document~Document#history history} that happened after the reversed batch.\n *\n * The undo command also takes care of restoring the {@link module:engine/model/document~Document#selection document selection}.\n */\nexport default class UndoCommand extends BaseCommand {\n /**\n * Executes the command. This method reverts a {@link module:engine/model/batch~Batch batch} added to the command's stack, transforms\n * and applies the reverted version on the {@link module:engine/model/document~Document document} and removes the batch from the stack.\n * Then, it restores the {@link module:engine/model/document~Document#selection document selection}.\n *\n * @fires execute\n * @fires revert\n * @param batch A batch that should be undone. If not set, the last added batch will be undone.\n */\n execute(batch = null) {\n // If batch is not given, set `batchIndex` to the last index in command stack.\n const batchIndex = batch ? this._stack.findIndex(a => a.batch == batch) : this._stack.length - 1;\n const item = this._stack.splice(batchIndex, 1)[0];\n const undoingBatch = this.editor.model.createBatch({ isUndo: true });\n // All changes have to be done in one `enqueueChange` callback so other listeners will not\n // step between consecutive operations, or won't do changes to the document before selection is properly restored.\n this.editor.model.enqueueChange(undoingBatch, () => {\n this._undo(item.batch, undoingBatch);\n const operations = this.editor.model.document.history.getOperations(item.batch.baseVersion);\n this._restoreSelection(item.selection.ranges, item.selection.isBackward, operations);\n this.fire('revert', item.batch, undoingBatch);\n });\n this.refresh();\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module undo/redocommand\n */\nimport BaseCommand from './basecommand';\n/**\n * The redo command stores {@link module:engine/model/batch~Batch batches} that were used to undo a batch by\n * {@link module:undo/undocommand~UndoCommand}. It is able to redo a previously undone batch by reversing the undoing\n * batches created by `UndoCommand`. The reversed batch is transformed by all the batches from\n * {@link module:engine/model/document~Document#history history} that happened after the reversed undo batch.\n *\n * The redo command also takes care of restoring the {@link module:engine/model/document~Document#selection document selection}.\n */\nexport default class RedoCommand extends BaseCommand {\n /**\n * Executes the command. This method reverts the last {@link module:engine/model/batch~Batch batch} added to\n * the command's stack, applies the reverted and transformed version on the\n * {@link module:engine/model/document~Document document} and removes the batch from the stack.\n * Then, it restores the {@link module:engine/model/document~Document#selection document selection}.\n *\n * @fires execute\n */\n execute() {\n const item = this._stack.pop();\n const redoingBatch = this.editor.model.createBatch({ isUndo: true });\n // All changes have to be done in one `enqueueChange` callback so other listeners will not step between consecutive\n // operations, or won't do changes to the document before selection is properly restored.\n this.editor.model.enqueueChange(redoingBatch, () => {\n const lastOperation = item.batch.operations[item.batch.operations.length - 1];\n const nextBaseVersion = lastOperation.baseVersion + 1;\n const operations = this.editor.model.document.history.getOperations(nextBaseVersion);\n this._restoreSelection(item.selection.ranges, item.selection.isBackward, operations);\n this._undo(item.batch, redoingBatch);\n });\n this.refresh();\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module undo/undoediting\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport UndoCommand from './undocommand';\nimport RedoCommand from './redocommand';\n/**\n * The undo engine feature.\n *\n * It introduces the `'undo'` and `'redo'` commands to the editor.\n */\nexport default class UndoEditing extends Plugin {\n constructor() {\n super(...arguments);\n /**\n * Keeps track of which batches were registered in undo.\n */\n this._batchRegistry = new WeakSet();\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'UndoEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Create commands.\n this._undoCommand = new UndoCommand(editor);\n this._redoCommand = new RedoCommand(editor);\n // Register command to the editor.\n editor.commands.add('undo', this._undoCommand);\n editor.commands.add('redo', this._redoCommand);\n this.listenTo(editor.model, 'applyOperation', (evt, args) => {\n const operation = args[0];\n // Do not register batch if the operation is not a document operation.\n // This prevents from creating empty undo steps, where all operations where non-document operations.\n // Non-document operations creates and alters content in detached tree fragments (for example, document fragments).\n // Most of time this is preparing data before it is inserted into actual tree (for example during copy & paste).\n // Such operations should not be reversed.\n if (!operation.isDocumentOperation) {\n return;\n }\n const batch = operation.batch;\n const isRedoBatch = this._redoCommand.createdBatches.has(batch);\n const isUndoBatch = this._undoCommand.createdBatches.has(batch);\n const wasProcessed = this._batchRegistry.has(batch);\n // Skip the batch if it was already processed.\n if (wasProcessed) {\n return;\n }\n // Add the batch to the registry so it will not be processed again.\n this._batchRegistry.add(batch);\n if (!batch.isUndoable) {\n return;\n }\n if (isRedoBatch) {\n // If this batch comes from `redoCommand`, add it to the `undoCommand` stack.\n this._undoCommand.addBatch(batch);\n }\n else if (!isUndoBatch) {\n // If the batch comes neither from `redoCommand` nor from `undoCommand` then it is a new, regular batch.\n // Add the batch to the `undoCommand` stack and clear the `redoCommand` stack.\n this._undoCommand.addBatch(batch);\n this._redoCommand.clearStack();\n }\n }, { priority: 'highest' });\n this.listenTo(this._undoCommand, 'revert', (evt, undoneBatch, undoingBatch) => {\n this._redoCommand.addBatch(undoingBatch);\n });\n editor.keystrokes.set('CTRL+Z', 'undo');\n editor.keystrokes.set('CTRL+Y', 'redo');\n editor.keystrokes.set('CTRL+SHIFT+Z', 'redo');\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m5.042 9.367 2.189 1.837a.75.75 0 0 1-.965 1.149l-3.788-3.18a.747.747 0 0 1-.21-.284.75.75 0 0 1 .17-.945L6.23 4.762a.75.75 0 1 1 .964 1.15L4.863 7.866h8.917A.75.75 0 0 1 14 7.9a4 4 0 1 1-1.477 7.718l.344-1.489a2.5 2.5 0 1 0 1.094-4.73l.008-.032H5.042z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m14.958 9.367-2.189 1.837a.75.75 0 0 0 .965 1.149l3.788-3.18a.747.747 0 0 0 .21-.284.75.75 0 0 0-.17-.945L13.77 4.762a.75.75 0 1 0-.964 1.15l2.331 1.955H6.22A.75.75 0 0 0 6 7.9a4 4 0 1 0 1.477 7.718l-.344-1.489A2.5 2.5 0 1 1 6.039 9.4l-.008-.032h8.927z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module undo/undoui\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { ButtonView } from '@ckeditor/ckeditor5-ui';\nimport undoIcon from '../theme/icons/undo.svg';\nimport redoIcon from '../theme/icons/redo.svg';\n/**\n * The undo UI feature. It introduces the `'undo'` and `'redo'` buttons to the editor.\n */\nexport default class UndoUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'UndoUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const locale = editor.locale;\n const t = editor.t;\n const localizedUndoIcon = locale.uiLanguageDirection == 'ltr' ? undoIcon : redoIcon;\n const localizedRedoIcon = locale.uiLanguageDirection == 'ltr' ? redoIcon : undoIcon;\n this._addButton('undo', t('Undo'), 'CTRL+Z', localizedUndoIcon);\n this._addButton('redo', t('Redo'), 'CTRL+Y', localizedRedoIcon);\n }\n /**\n * Creates a button for the specified command.\n *\n * @param name Command name.\n * @param label Button label.\n * @param keystroke Command keystroke.\n * @param Icon Source of the icon.\n */\n _addButton(name, label, keystroke, Icon) {\n const editor = this.editor;\n editor.ui.componentFactory.add(name, locale => {\n const command = editor.commands.get(name);\n const view = new ButtonView(locale);\n view.set({\n label,\n icon: Icon,\n keystroke,\n tooltip: true\n });\n view.bind('isEnabled').to(command, 'isEnabled');\n this.listenTo(view, 'execute', () => {\n editor.execute(name);\n editor.editing.view.focus();\n });\n return view;\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module undo/undo\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport UndoEditing from './undoediting';\nimport UndoUI from './undoui';\n/**\n * The undo feature.\n *\n * This is a \"glue\" plugin which loads the {@link module:undo/undoediting~UndoEditing undo editing feature}\n * and the {@link module:undo/undoui~UndoUI undo UI feature}.\n *\n * Below is an explanation of the undo mechanism working together with {@link module:engine/model/history~History History}:\n *\n * Whenever an {@link module:engine/model/operation/operation~Operation operation} is applied to the\n * {@link module:engine/model/document~Document document}, it is saved to `History` as is.\n * The {@link module:engine/model/batch~Batch batch} that owns that operation is also saved, in\n * {@link module:undo/undocommand~UndoCommand}, together with the selection that was present in the document before the\n * operation was applied. A batch is saved instead of the operation because changes are undone batch-by-batch, not operation-by-operation\n * and a batch is seen as one undo step.\n *\n * After changes happen to the document, the `History` and `UndoCommand` stack can be represented as follows:\n *\n * ```\n * History Undo stack\n * ============== ==================================\n * [operation A1] [ batch A ]\n * [operation B1] [ batch B ]\n * [operation B2] [ batch C ]\n * [operation C1]\n * [operation C2]\n * [operation B3]\n * [operation C3]\n * ```\n *\n * Where operations starting with the same letter are from same batch.\n *\n * Undoing a batch means that a set of operations which will reverse the effects of that batch needs to be generated.\n * For example, if a batch added several letters, undoing the batch should remove them. It is important to apply undoing\n * operations in the reversed order, so if a batch has operation `X`, `Y`, `Z`, reversed operations `Zr`, `Yr` and `Xr`\n * need to be applied. Otherwise reversed operation `Xr` would operate on a wrong document state, because operation `X`\n * does not know that operations `Y` and `Z` happened.\n *\n * After operations from an undone batch got {@link module:engine/model/operation/operation~Operation#getReversed reversed},\n * one needs to make sure if they are ready to be applied. In the scenario above, operation `C3` is the last operation and `C3r`\n * bases on up-to-date document state, so it can be applied to the document.\n *\n * ```\n * History Undo stack\n * ================= ==================================\n * [ operation A1 ] [ batch A ]\n * [ operation B1 ] [ batch B ]\n * [ operation B2 ] [ processing undoing batch C ]\n * [ operation C1 ]\n * [ operation C2 ]\n * [ operation B3 ]\n * [ operation C3 ]\n * [ operation C3r ]\n * ```\n *\n * Next is operation `C2`, reversed to `C2r`. `C2r` bases on `C2`, so it bases on the wrong document state. It needs to be\n * transformed by operations from history that happened after it, so it \"knows\" about them. Let us assume that `C2' = C2r * B3 * C3 * C3r`,\n * where `*` means \"transformed by\". Rest of operations from that batch are processed in the same fashion.\n *\n * ```\n * History Undo stack Redo stack\n * ================= ================================== ==================================\n * [ operation A1 ] [ batch A ] [ batch Cr ]\n * [ operation B1 ] [ batch B ]\n * [ operation B2 ]\n * [ operation C1 ]\n * [ operation C2 ]\n * [ operation B3 ]\n * [ operation C3 ]\n * [ operation C3r ]\n * [ operation C2' ]\n * [ operation C1' ]\n * ```\n *\n * Selective undo works on the same basis, however, instead of undoing the last batch in the undo stack, any batch can be undone.\n * The same algorithm applies: operations from a batch (i.e. `A1`) are reversed and then transformed by operations stored in history.\n *\n * Redo also is very similar to undo. It has its own stack that is filled with undoing (reversed batches). Operations from\n * the batch that is re-done are reversed-back, transformed in proper order and applied to the document.\n *\n * ```\n * History Undo stack Redo stack\n * ================= ================================== ==================================\n * [ operation A1 ] [ batch A ]\n * [ operation B1 ] [ batch B ]\n * [ operation B2 ] [ batch Crr ]\n * [ operation C1 ]\n * [ operation C2 ]\n * [ operation B3 ]\n * [ operation C3 ]\n * [ operation C3r ]\n * [ operation C2' ]\n * [ operation C1' ]\n * [ operation C1'r]\n * [ operation C2'r]\n * [ operation C3rr]\n * ```\n */\nexport default class Undo extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [UndoEditing, UndoUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Undo';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { first } from 'ckeditor5/src/utils';\n/**\n * Creates a view element representing the inline image.\n *\n * ```html\n * <span class=\"image-inline\"><img></img></span>\n * ```\n *\n * Note that `alt` and `src` attributes are converted separately, so they are not included.\n *\n * @internal\n */\nexport function createInlineImageViewElement(writer) {\n return writer.createContainerElement('span', { class: 'image-inline' }, writer.createEmptyElement('img'));\n}\n/**\n * Creates a view element representing the block image.\n *\n * ```html\n * <figure class=\"image\"><img></img></figure>\n * ```\n *\n * Note that `alt` and `src` attributes are converted separately, so they are not included.\n *\n * @internal\n */\nexport function createBlockImageViewElement(writer) {\n return writer.createContainerElement('figure', { class: 'image' }, [\n writer.createEmptyElement('img'),\n writer.createSlot('children')\n ]);\n}\n/**\n * A function returning a `MatcherPattern` for a particular type of View images.\n *\n * @internal\n * @param matchImageType The type of created image.\n */\nexport function getImgViewElementMatcher(editor, matchImageType) {\n const imageUtils = editor.plugins.get('ImageUtils');\n const areBothImagePluginsLoaded = editor.plugins.has('ImageInlineEditing') && editor.plugins.has('ImageBlockEditing');\n return element => {\n // Check if the matched view element is an <img>.\n if (!imageUtils.isInlineImageView(element)) {\n return null;\n }\n // If just one of the plugins is loaded (block or inline), it will match all kinds of images.\n if (!areBothImagePluginsLoaded) {\n return getPositiveMatchPattern(element);\n }\n // The <img> can be standalone, wrapped in <figure>...</figure> (ImageBlock plugin) or\n // wrapped in <figure><a>...</a></figure> (LinkImage plugin).\n const imageType = element.getStyle('display') == 'block' || element.findAncestor(imageUtils.isBlockImageView) ?\n 'imageBlock' :\n 'imageInline';\n if (imageType !== matchImageType) {\n return null;\n }\n return getPositiveMatchPattern(element);\n };\n function getPositiveMatchPattern(element) {\n const pattern = {\n name: true\n };\n // This will trigger src consumption (See https://github.com/ckeditor/ckeditor5/issues/11530).\n if (element.hasAttribute('src')) {\n pattern.attributes = ['src'];\n }\n return pattern;\n }\n}\n/**\n * Considering the current model selection, it returns the name of the model image element\n * (`'imageBlock'` or `'imageInline'`) that will make most sense from the UX perspective if a new\n * image was inserted (also: uploaded, dropped, pasted) at that selection.\n *\n * The assumption is that inserting images into empty blocks or on other block widgets should\n * produce block images. Inline images should be inserted in other cases, e.g. in paragraphs\n * that already contain some text.\n *\n * @internal\n */\nexport function determineImageTypeForInsertionAtSelection(schema, selection) {\n const firstBlock = first(selection.getSelectedBlocks());\n // Insert a block image if the selection is not in/on block elements or it's on a block widget.\n if (!firstBlock || schema.isObject(firstBlock)) {\n return 'imageBlock';\n }\n // A block image should also be inserted into an empty block element\n // (that is not an empty list item so the list won't get split).\n if (firstBlock.isEmpty && firstBlock.name != 'listItem') {\n return 'imageBlock';\n }\n // Otherwise insert an inline image.\n return 'imageInline';\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { findOptimalInsertionRange, isWidget, toWidget } from 'ckeditor5/src/widget';\nimport { determineImageTypeForInsertionAtSelection } from './image/utils';\n/**\n * A set of helpers related to images.\n */\nexport default class ImageUtils extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageUtils';\n }\n /**\n * Checks if the provided model element is an `image` or `imageInline`.\n */\n isImage(modelElement) {\n return this.isInlineImage(modelElement) || this.isBlockImage(modelElement);\n }\n /**\n * Checks if the provided view element represents an inline image.\n *\n * Also, see {@link module:image/imageutils~ImageUtils#isImageWidget}.\n */\n isInlineImageView(element) {\n return !!element && element.is('element', 'img');\n }\n /**\n * Checks if the provided view element represents a block image.\n *\n * Also, see {@link module:image/imageutils~ImageUtils#isImageWidget}.\n */\n isBlockImageView(element) {\n return !!element && element.is('element', 'figure') && element.hasClass('image');\n }\n /**\n * Handles inserting single file. This method unifies image insertion using {@link module:widget/utils~findOptimalInsertionRange}\n * method.\n *\n * ```ts\n * const imageUtils = editor.plugins.get( 'ImageUtils' );\n *\n * imageUtils.insertImage( { src: 'path/to/image.jpg' } );\n * ```\n *\n * @param attributes Attributes of the inserted image.\n * This method filters out the attributes which are disallowed by the {@link module:engine/model/schema~Schema}.\n * @param selectable Place to insert the image. If not specified,\n * the {@link module:widget/utils~findOptimalInsertionRange} logic will be applied for the block images\n * and `model.document.selection` for the inline images.\n *\n * **Note**: If `selectable` is passed, this helper will not be able to set selection attributes (such as `linkHref`)\n * and apply them to the new image. In this case, make sure all selection attributes are passed in `attributes`.\n *\n * @param imageType Image type of inserted image. If not specified,\n * it will be determined automatically depending of editor config or place of the insertion.\n * @return The inserted model image element.\n */\n insertImage(attributes = {}, selectable = null, imageType = null) {\n const editor = this.editor;\n const model = editor.model;\n const selection = model.document.selection;\n imageType = determineImageTypeForInsertion(editor, selectable || selection, imageType);\n // Mix declarative attributes with selection attributes because the new image should \"inherit\"\n // the latter for best UX. For instance, inline images inserted into existing links\n // should not split them. To do that, they need to have \"linkHref\" inherited from the selection.\n attributes = {\n ...Object.fromEntries(selection.getAttributes()),\n ...attributes\n };\n for (const attributeName in attributes) {\n if (!model.schema.checkAttribute(imageType, attributeName)) {\n delete attributes[attributeName];\n }\n }\n return model.change(writer => {\n const imageElement = writer.createElement(imageType, attributes);\n model.insertObject(imageElement, selectable, null, {\n setSelection: 'on',\n // If we want to insert a block image (for whatever reason) then we don't want to split text blocks.\n // This applies only when we don't have the selectable specified (i.e., we insert multiple block images at once).\n findOptimalPosition: !selectable && imageType != 'imageInline' ? 'auto' : undefined\n });\n // Inserting an image might've failed due to schema regulations.\n if (imageElement.parent) {\n return imageElement;\n }\n return null;\n });\n }\n /**\n * Returns an image widget editing view element if one is selected or is among the selection's ancestors.\n */\n getClosestSelectedImageWidget(selection) {\n const selectionPosition = selection.getFirstPosition();\n if (!selectionPosition) {\n return null;\n }\n const viewElement = selection.getSelectedElement();\n if (viewElement && this.isImageWidget(viewElement)) {\n return viewElement;\n }\n let parent = selectionPosition.parent;\n while (parent) {\n if (parent.is('element') && this.isImageWidget(parent)) {\n return parent;\n }\n parent = parent.parent;\n }\n return null;\n }\n /**\n * Returns a image model element if one is selected or is among the selection's ancestors.\n */\n getClosestSelectedImageElement(selection) {\n const selectedElement = selection.getSelectedElement();\n return this.isImage(selectedElement) ? selectedElement : selection.getFirstPosition().findAncestor('imageBlock');\n }\n /**\n * Checks if image can be inserted at current model selection.\n *\n * @internal\n */\n isImageAllowed() {\n const model = this.editor.model;\n const selection = model.document.selection;\n return isImageAllowedInParent(this.editor, selection) && isNotInsideImage(selection);\n }\n /**\n * Converts a given {@link module:engine/view/element~Element} to an image widget:\n * * Adds a {@link module:engine/view/element~Element#_setCustomProperty custom property} allowing to recognize the image widget\n * element.\n * * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.\n *\n * @param writer An instance of the view writer.\n * @param label The element's label. It will be concatenated with the image `alt` attribute if one is present.\n */\n toImageWidget(viewElement, writer, label) {\n writer.setCustomProperty('image', true, viewElement);\n const labelCreator = () => {\n const imgElement = this.findViewImgElement(viewElement);\n const altText = imgElement.getAttribute('alt');\n return altText ? `${altText} ${label}` : label;\n };\n return toWidget(viewElement, writer, { label: labelCreator });\n }\n /**\n * Checks if a given view element is an image widget.\n */\n isImageWidget(viewElement) {\n return !!viewElement.getCustomProperty('image') && isWidget(viewElement);\n }\n /**\n * Checks if the provided model element is an `image`.\n */\n isBlockImage(modelElement) {\n return !!modelElement && modelElement.is('element', 'imageBlock');\n }\n /**\n * Checks if the provided model element is an `imageInline`.\n */\n isInlineImage(modelElement) {\n return !!modelElement && modelElement.is('element', 'imageInline');\n }\n /**\n * Get the view `<img>` from another view element, e.g. a widget (`<figure class=\"image\">`), a link (`<a>`).\n *\n * The `<img>` can be located deep in other elements, so this helper performs a deep tree search.\n */\n findViewImgElement(figureView) {\n if (this.isInlineImageView(figureView)) {\n return figureView;\n }\n const editingView = this.editor.editing.view;\n for (const { item } of editingView.createRangeIn(figureView)) {\n if (this.isInlineImageView(item)) {\n return item;\n }\n }\n }\n}\n/**\n * Checks if image is allowed by schema in optimal insertion parent.\n */\nfunction isImageAllowedInParent(editor, selection) {\n const imageType = determineImageTypeForInsertion(editor, selection, null);\n if (imageType == 'imageBlock') {\n const parent = getInsertImageParent(selection, editor.model);\n if (editor.model.schema.checkChild(parent, 'imageBlock')) {\n return true;\n }\n }\n else if (editor.model.schema.checkChild(selection.focus, 'imageInline')) {\n return true;\n }\n return false;\n}\n/**\n * Checks if selection is not placed inside an image (e.g. its caption).\n */\nfunction isNotInsideImage(selection) {\n return [...selection.focus.getAncestors()].every(ancestor => !ancestor.is('element', 'imageBlock'));\n}\n/**\n * Returns a node that will be used to insert image with `model.insertContent`.\n */\nfunction getInsertImageParent(selection, model) {\n const insertionRange = findOptimalInsertionRange(selection, model);\n const parent = insertionRange.start.parent;\n if (parent.isEmpty && !parent.is('element', '$root')) {\n return parent.parent;\n }\n return parent;\n}\n/**\n * Determine image element type name depending on editor config or place of insertion.\n *\n * @param imageType Image element type name. Used to force return of provided element name,\n * but only if there is proper plugin enabled.\n */\nfunction determineImageTypeForInsertion(editor, selectable, imageType) {\n const schema = editor.model.schema;\n const configImageInsertType = editor.config.get('image.insert.type');\n if (!editor.plugins.has('ImageBlockEditing')) {\n return 'imageInline';\n }\n if (!editor.plugins.has('ImageInlineEditing')) {\n return 'imageBlock';\n }\n if (imageType) {\n return imageType;\n }\n if (configImageInsertType === 'inline') {\n return 'imageInline';\n }\n if (configImageInsertType === 'block') {\n return 'imageBlock';\n }\n // Try to replace the selected widget (e.g. another image).\n if (selectable.is('selection')) {\n return determineImageTypeForInsertionAtSelection(schema, selectable);\n }\n return schema.checkChild(selectable, 'imageInline') ? 'imageInline' : 'imageBlock';\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/autoimage\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Clipboard } from 'ckeditor5/src/clipboard';\nimport { LivePosition, LiveRange } from 'ckeditor5/src/engine';\nimport { Undo } from 'ckeditor5/src/undo';\nimport { Delete } from 'ckeditor5/src/typing';\nimport { global } from 'ckeditor5/src/utils';\nimport ImageUtils from './imageutils';\n// Implements the pattern: http(s)://(www.)example.com/path/to/resource.ext?query=params&maybe=too.\nconst IMAGE_URL_REGEXP = new RegExp(String(/^(http(s)?:\\/\\/)?[\\w-]+\\.[\\w.~:/[\\]@!$&'()*+,;=%-]+/.source +\n /\\.(jpg|jpeg|png|gif|ico|webp|JPG|JPEG|PNG|GIF|ICO|WEBP)/.source +\n /(\\?[\\w.~:/[\\]@!$&'()*+,;=%-]*)?/.source +\n /(#[\\w.~:/[\\]@!$&'()*+,;=%-]*)?$/.source));\n/**\n * The auto-image plugin. It recognizes image links in the pasted content and embeds\n * them shortly after they are injected into the document.\n */\nexport default class AutoImage extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [Clipboard, ImageUtils, Undo, Delete];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'AutoImage';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n this._timeoutId = null;\n this._positionToInsert = null;\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const modelDocument = editor.model.document;\n const clipboardPipeline = editor.plugins.get('ClipboardPipeline');\n // We need to listen on `Clipboard#inputTransformation` because we need to save positions of selection.\n // After pasting, the content between those positions will be checked for a URL that could be transformed\n // into an image.\n this.listenTo(clipboardPipeline, 'inputTransformation', () => {\n const firstRange = modelDocument.selection.getFirstRange();\n const leftLivePosition = LivePosition.fromPosition(firstRange.start);\n leftLivePosition.stickiness = 'toPrevious';\n const rightLivePosition = LivePosition.fromPosition(firstRange.end);\n rightLivePosition.stickiness = 'toNext';\n modelDocument.once('change:data', () => {\n this._embedImageBetweenPositions(leftLivePosition, rightLivePosition);\n leftLivePosition.detach();\n rightLivePosition.detach();\n }, { priority: 'high' });\n });\n editor.commands.get('undo').on('execute', () => {\n if (this._timeoutId) {\n global.window.clearTimeout(this._timeoutId);\n this._positionToInsert.detach();\n this._timeoutId = null;\n this._positionToInsert = null;\n }\n }, { priority: 'high' });\n }\n /**\n * Analyzes the part of the document between provided positions in search for a URL representing an image.\n * When the URL is found, it is automatically converted into an image.\n *\n * @param leftPosition Left position of the selection.\n * @param rightPosition Right position of the selection.\n */\n _embedImageBetweenPositions(leftPosition, rightPosition) {\n const editor = this.editor;\n // TODO: Use a marker instead of LiveRange & LivePositions.\n const urlRange = new LiveRange(leftPosition, rightPosition);\n const walker = urlRange.getWalker({ ignoreElementEnd: true });\n const selectionAttributes = Object.fromEntries(editor.model.document.selection.getAttributes());\n const imageUtils = this.editor.plugins.get('ImageUtils');\n let src = '';\n for (const node of walker) {\n if (node.item.is('$textProxy')) {\n src += node.item.data;\n }\n }\n src = src.trim();\n // If the URL does not match the image URL regexp, let's skip that.\n if (!src.match(IMAGE_URL_REGEXP)) {\n urlRange.detach();\n return;\n }\n // Position will not be available in the `setTimeout` function so let's clone it.\n this._positionToInsert = LivePosition.fromPosition(leftPosition);\n // This action mustn't be executed if undo was called between pasting and auto-embedding.\n this._timeoutId = setTimeout(() => {\n // Do nothing if image element cannot be inserted at the current position.\n // See https://github.com/ckeditor/ckeditor5/issues/2763.\n // Condition must be checked after timeout - pasting may take place on an element, replacing it. The final position matters.\n const imageCommand = editor.commands.get('insertImage');\n if (!imageCommand.isEnabled) {\n urlRange.detach();\n return;\n }\n editor.model.change(writer => {\n this._timeoutId = null;\n writer.remove(urlRange);\n urlRange.detach();\n let insertionPosition;\n // Check if the position where the element should be inserted is still valid.\n // Otherwise leave it as undefined to use the logic of insertImage().\n if (this._positionToInsert.root.rootName !== '$graveyard') {\n insertionPosition = this._positionToInsert.toPosition();\n }\n imageUtils.insertImage({ ...selectionAttributes, src }, insertionPosition);\n this._positionToInsert.detach();\n this._positionToInsert = null;\n });\n const deletePlugin = editor.plugins.get('Delete');\n deletePlugin.requestUndoOnBackspace();\n }, 100);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { LiveRange } from 'ckeditor5/src/engine';\nimport { first } from 'ckeditor5/src/utils';\n/**\n * The block autoformatting engine. It allows to format various block patterns. For example,\n * it can be configured to turn a paragraph starting with `*` and followed by a space into a list item.\n *\n * The autoformatting operation is integrated with the undo manager,\n * so the autoformatting step can be undone if the user's intention was not to format the text.\n *\n * See the {@link module:autoformat/blockautoformatediting~blockAutoformatEditing `blockAutoformatEditing`} documentation\n * to learn how to create custom block autoformatters. You can also use\n * the {@link module:autoformat/autoformat~Autoformat} feature which enables a set of default autoformatters\n * (lists, headings, bold and italic).\n *\n * @module autoformat/blockautoformatediting\n */\n/**\n * Creates a listener triggered on {@link module:engine/model/document~Document#event:change:data `change:data`} event in the document.\n * Calls the callback when inserted text matches the regular expression or the command name\n * if provided instead of the callback.\n *\n * Examples of usage:\n *\n * To convert a paragraph into heading 1 when `- ` is typed, using just the command name:\n *\n * ```ts\n * blockAutoformatEditing( editor, plugin, /^\\- $/, 'heading1' );\n * ```\n *\n * To convert a paragraph into heading 1 when `- ` is typed, using just the callback:\n *\n * ```ts\n * blockAutoformatEditing( editor, plugin, /^\\- $/, ( context ) => {\n * \tconst { match } = context;\n * \tconst headingLevel = match[ 1 ].length;\n *\n * \teditor.execute( 'heading', {\n * \t\tformatId: `heading${ headingLevel }`\n * \t} );\n * } );\n * ```\n *\n * @param editor The editor instance.\n * @param plugin The autoformat plugin instance.\n * @param pattern The regular expression to execute on just inserted text. The regular expression is tested against the text\n * from the beginning until the caret position.\n * @param callbackOrCommand The callback to execute or the command to run when the text is matched.\n * In case of providing the callback, it receives the following parameter:\n * * match RegExp.exec() result of matching the pattern to inserted text.\n */\nexport default function blockAutoformatEditing(editor, plugin, pattern, callbackOrCommand) {\n let callback;\n let command = null;\n if (typeof callbackOrCommand == 'function') {\n callback = callbackOrCommand;\n }\n else {\n // We assume that the actual command name was provided.\n command = editor.commands.get(callbackOrCommand);\n callback = () => {\n editor.execute(callbackOrCommand);\n };\n }\n editor.model.document.on('change:data', (evt, batch) => {\n if (command && !command.isEnabled || !plugin.isEnabled) {\n return;\n }\n const range = first(editor.model.document.selection.getRanges());\n if (!range.isCollapsed) {\n return;\n }\n if (batch.isUndo || !batch.isLocal) {\n return;\n }\n const changes = Array.from(editor.model.document.differ.getChanges());\n const entry = changes[0];\n // Typing is represented by only a single change.\n if (changes.length != 1 || entry.type !== 'insert' || entry.name != '$text' || entry.length != 1) {\n return;\n }\n const blockToFormat = entry.position.parent;\n // Block formatting should be disabled in codeBlocks (#5800).\n if (blockToFormat.is('element', 'codeBlock')) {\n return;\n }\n // Only list commands and custom callbacks can be applied inside a list.\n if (blockToFormat.is('element', 'listItem') &&\n typeof callbackOrCommand !== 'function' &&\n !['numberedList', 'bulletedList', 'todoList'].includes(callbackOrCommand)) {\n return;\n }\n // In case a command is bound, do not re-execute it over an existing block style which would result in a style removal.\n // Instead, just drop processing so that autoformat trigger text is not lost. E.g. writing \"# \" in a level 1 heading.\n if (command && command.value === true) {\n return;\n }\n const firstNode = blockToFormat.getChild(0);\n const firstNodeRange = editor.model.createRangeOn(firstNode);\n // Range is only expected to be within or at the very end of the first text node.\n if (!firstNodeRange.containsRange(range) && !range.end.isEqual(firstNodeRange.end)) {\n return;\n }\n const match = pattern.exec(firstNode.data.substr(0, range.end.offset));\n // ...and this text node's data match the pattern.\n if (!match) {\n return;\n }\n // Use enqueueChange to create new batch to separate typing batch from the auto-format changes.\n editor.model.enqueueChange(writer => {\n // Matched range.\n const start = writer.createPositionAt(blockToFormat, 0);\n const end = writer.createPositionAt(blockToFormat, match[0].length);\n const range = new LiveRange(start, end);\n const wasChanged = callback({ match });\n // Remove matched text.\n if (wasChanged !== false) {\n writer.remove(range);\n const selectionRange = editor.model.document.selection.getFirstRange();\n const blockRange = writer.createRangeIn(blockToFormat);\n // If the block is empty and the document selection has been moved when\n // applying formatting (e.g. is now in newly created block).\n if (blockToFormat.isEmpty && !blockRange.isEqual(selectionRange) && !blockRange.containsRange(selectionRange, true)) {\n writer.remove(blockToFormat);\n }\n }\n range.detach();\n editor.model.enqueueChange(() => {\n const deletePlugin = editor.plugins.get('Delete');\n deletePlugin.requestUndoOnBackspace();\n });\n });\n });\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Enables autoformatting mechanism for a given {@link module:core/editor/editor~Editor}.\n *\n * It formats the matched text by applying the given model attribute or by running the provided formatting callback.\n * On every {@link module:engine/model/document~Document#event:change:data data change} in the model document\n * the autoformatting engine checks the text on the left of the selection\n * and executes the provided action if the text matches given criteria (regular expression or callback).\n *\n * @param editor The editor instance.\n * @param plugin The autoformat plugin instance.\n * @param testRegexpOrCallback The regular expression or callback to execute on text.\n * Provided regular expression *must* have three capture groups. The first and the third capture group\n * should match opening and closing delimiters. The second capture group should match the text to format.\n *\n * ```ts\n * // Matches the `**bold text**` pattern.\n * // There are three capturing groups:\n * // - The first to match the starting `**` delimiter.\n * // - The second to match the text to format.\n * // - The third to match the ending `**` delimiter.\n * inlineAutoformatEditing( editor, plugin, /(\\*\\*)([^\\*]+?)(\\*\\*)$/g, formatCallback );\n * ```\n *\n * When a function is provided instead of the regular expression, it will be executed with the text to match as a parameter.\n * The function should return proper \"ranges\" to delete and format.\n *\n * ```ts\n * {\n * \tremove: [\n * \t\t[ 0, 1 ],\t// Remove the first letter from the given text.\n * \t\t[ 5, 6 ]\t// Remove the 6th letter from the given text.\n * \t],\n * \tformat: [\n * \t\t[ 1, 5 ]\t// Format all letters from 2nd to 5th.\n * \t]\n * }\n * ```\n *\n * @param formatCallback A callback to apply actual formatting.\n * It should return `false` if changes should not be applied (e.g. if a command is disabled).\n *\n * ```ts\n * inlineAutoformatEditing( editor, plugin, /(\\*\\*)([^\\*]+?)(\\*\\*)$/g, ( writer, rangesToFormat ) => {\n * \tconst command = editor.commands.get( 'bold' );\n *\n * \tif ( !command.isEnabled ) {\n * \t\treturn false;\n * \t}\n *\n * \tconst validRanges = editor.model.schema.getValidRanges( rangesToFormat, 'bold' );\n *\n * \tfor ( let range of validRanges ) {\n * \t\twriter.setAttribute( 'bold', true, range );\n * \t}\n * } );\n * ```\n */\nexport default function inlineAutoformatEditing(editor, plugin, testRegexpOrCallback, formatCallback) {\n let regExp;\n let testCallback;\n if (testRegexpOrCallback instanceof RegExp) {\n regExp = testRegexpOrCallback;\n }\n else {\n testCallback = testRegexpOrCallback;\n }\n // A test callback run on changed text.\n testCallback = testCallback || (text => {\n let result;\n const remove = [];\n const format = [];\n while ((result = regExp.exec(text)) !== null) {\n // There should be full match and 3 capture groups.\n if (result && result.length < 4) {\n break;\n }\n let { index, '1': leftDel, '2': content, '3': rightDel } = result;\n // Real matched string - there might be some non-capturing groups so we need to recalculate starting index.\n const found = leftDel + content + rightDel;\n index += result[0].length - found.length;\n // Start and End offsets of delimiters to remove.\n const delStart = [\n index,\n index + leftDel.length\n ];\n const delEnd = [\n index + leftDel.length + content.length,\n index + leftDel.length + content.length + rightDel.length\n ];\n remove.push(delStart);\n remove.push(delEnd);\n format.push([index + leftDel.length, index + leftDel.length + content.length]);\n }\n return {\n remove,\n format\n };\n });\n editor.model.document.on('change:data', (evt, batch) => {\n if (batch.isUndo || !batch.isLocal || !plugin.isEnabled) {\n return;\n }\n const model = editor.model;\n const selection = model.document.selection;\n // Do nothing if selection is not collapsed.\n if (!selection.isCollapsed) {\n return;\n }\n const changes = Array.from(model.document.differ.getChanges());\n const entry = changes[0];\n // Typing is represented by only a single change.\n if (changes.length != 1 || entry.type !== 'insert' || entry.name != '$text' || entry.length != 1) {\n return;\n }\n const focus = selection.focus;\n const block = focus.parent;\n const { text, range } = getTextAfterCode(model.createRange(model.createPositionAt(block, 0), focus), model);\n const testOutput = testCallback(text);\n const rangesToFormat = testOutputToRanges(range.start, testOutput.format, model);\n const rangesToRemove = testOutputToRanges(range.start, testOutput.remove, model);\n if (!(rangesToFormat.length && rangesToRemove.length)) {\n return;\n }\n // Use enqueueChange to create new batch to separate typing batch from the auto-format changes.\n model.enqueueChange(writer => {\n // Apply format.\n const hasChanged = formatCallback(writer, rangesToFormat);\n // Strict check on `false` to have backward compatibility (when callbacks were returning `undefined`).\n if (hasChanged === false) {\n return;\n }\n // Remove delimiters - use reversed order to not mix the offsets while removing.\n for (const range of rangesToRemove.reverse()) {\n writer.remove(range);\n }\n model.enqueueChange(() => {\n const deletePlugin = editor.plugins.get('Delete');\n deletePlugin.requestUndoOnBackspace();\n });\n });\n });\n}\n/**\n * Converts output of the test function provided to the inlineAutoformatEditing and converts it to the model ranges\n * inside provided block.\n */\nfunction testOutputToRanges(start, arrays, model) {\n return arrays\n .filter(array => (array[0] !== undefined && array[1] !== undefined))\n .map(array => {\n return model.createRange(start.getShiftedBy(array[0]), start.getShiftedBy(array[1]));\n });\n}\n/**\n * Returns the last text line after the last code element from the given range.\n * It is similar to {@link module:typing/utils/getlasttextline.getLastTextLine `getLastTextLine()`},\n * but it ignores any text before the last `code`.\n */\nfunction getTextAfterCode(range, model) {\n let start = range.start;\n const text = Array.from(range.getItems()).reduce((rangeText, node) => {\n // Trim text to a last occurrence of an inline element and update range start.\n if (!(node.is('$text') || node.is('$textProxy')) || node.getAttribute('code')) {\n start = model.createPositionAfter(node);\n return '';\n }\n return rangeText + node.data;\n }, '');\n return { text, range: model.createRange(start, range.end) };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Delete } from 'ckeditor5/src/typing';\nimport blockAutoformatEditing from './blockautoformatediting';\nimport inlineAutoformatEditing from './inlineautoformatediting';\n/**\n * Enables a set of predefined autoformatting actions.\n *\n * For a detailed overview, check the {@glink features/autoformat Autoformatting} feature guide\n * and the {@glink api/autoformat package page}.\n */\nexport default class Autoformat extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [Delete];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Autoformat';\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n this._addListAutoformats();\n this._addBasicStylesAutoformats();\n this._addHeadingAutoformats();\n this._addBlockQuoteAutoformats();\n this._addCodeBlockAutoformats();\n this._addHorizontalLineAutoformats();\n }\n /**\n * Adds autoformatting related to the {@link module:list/list~List}.\n *\n * When typed:\n * - `* ` or `- ` &ndash; A paragraph will be changed into a bulleted list.\n * - `1. ` or `1) ` &ndash; A paragraph will be changed into a numbered list (\"1\" can be any digit or a list of digits).\n * - `[] ` or `[ ] ` &ndash; A paragraph will be changed into a to-do list.\n * - `[x] ` or `[ x ] ` &ndash; A paragraph will be changed into a checked to-do list.\n */\n _addListAutoformats() {\n const commands = this.editor.commands;\n if (commands.get('bulletedList')) {\n blockAutoformatEditing(this.editor, this, /^[*-]\\s$/, 'bulletedList');\n }\n if (commands.get('numberedList')) {\n blockAutoformatEditing(this.editor, this, /^1[.|)]\\s$/, 'numberedList');\n }\n if (commands.get('todoList')) {\n blockAutoformatEditing(this.editor, this, /^\\[\\s?\\]\\s$/, 'todoList');\n }\n if (commands.get('checkTodoList')) {\n blockAutoformatEditing(this.editor, this, /^\\[\\s?x\\s?\\]\\s$/, () => {\n this.editor.execute('todoList');\n this.editor.execute('checkTodoList');\n });\n }\n }\n /**\n * Adds autoformatting related to the {@link module:basic-styles/bold~Bold},\n * {@link module:basic-styles/italic~Italic}, {@link module:basic-styles/code~Code}\n * and {@link module:basic-styles/strikethrough~Strikethrough}\n *\n * When typed:\n * - `**foobar**` &ndash; `**` characters are removed and `foobar` is set to bold,\n * - `__foobar__` &ndash; `__` characters are removed and `foobar` is set to bold,\n * - `*foobar*` &ndash; `*` characters are removed and `foobar` is set to italic,\n * - `_foobar_` &ndash; `_` characters are removed and `foobar` is set to italic,\n * - ``` `foobar` &ndash; ``` ` ``` characters are removed and `foobar` is set to code,\n * - `~~foobar~~` &ndash; `~~` characters are removed and `foobar` is set to strikethrough.\n */\n _addBasicStylesAutoformats() {\n const commands = this.editor.commands;\n if (commands.get('bold')) {\n const boldCallback = getCallbackFunctionForInlineAutoformat(this.editor, 'bold');\n inlineAutoformatEditing(this.editor, this, /(?:^|\\s)(\\*\\*)([^*]+)(\\*\\*)$/g, boldCallback);\n inlineAutoformatEditing(this.editor, this, /(?:^|\\s)(__)([^_]+)(__)$/g, boldCallback);\n }\n if (commands.get('italic')) {\n const italicCallback = getCallbackFunctionForInlineAutoformat(this.editor, 'italic');\n // The italic autoformatter cannot be triggered by the bold markers, so we need to check the\n // text before the pattern (e.g. `(?:^|[^\\*])`).\n inlineAutoformatEditing(this.editor, this, /(?:^|\\s)(\\*)([^*_]+)(\\*)$/g, italicCallback);\n inlineAutoformatEditing(this.editor, this, /(?:^|\\s)(_)([^_]+)(_)$/g, italicCallback);\n }\n if (commands.get('code')) {\n const codeCallback = getCallbackFunctionForInlineAutoformat(this.editor, 'code');\n inlineAutoformatEditing(this.editor, this, /(`)([^`]+)(`)$/g, codeCallback);\n }\n if (commands.get('strikethrough')) {\n const strikethroughCallback = getCallbackFunctionForInlineAutoformat(this.editor, 'strikethrough');\n inlineAutoformatEditing(this.editor, this, /(~~)([^~]+)(~~)$/g, strikethroughCallback);\n }\n }\n /**\n * Adds autoformatting related to {@link module:heading/heading~Heading}.\n *\n * It is using a number at the end of the command name to associate it with the proper trigger:\n *\n * * `heading` with a `heading1` value will be executed when typing `#`,\n * * `heading` with a `heading2` value will be executed when typing `##`,\n * * ... up to `heading6` for `######`.\n */\n _addHeadingAutoformats() {\n const command = this.editor.commands.get('heading');\n if (command) {\n command.modelElements\n .filter(name => name.match(/^heading[1-6]$/))\n .forEach(modelName => {\n const level = modelName[7];\n const pattern = new RegExp(`^(#{${level}})\\\\s$`);\n blockAutoformatEditing(this.editor, this, pattern, () => {\n // Should only be active if command is enabled and heading style associated with pattern is inactive.\n if (!command.isEnabled || command.value === modelName) {\n return false;\n }\n this.editor.execute('heading', { value: modelName });\n });\n });\n }\n }\n /**\n * Adds autoformatting related to {@link module:block-quote/blockquote~BlockQuote}.\n *\n * When typed:\n * * `> ` &ndash; A paragraph will be changed to a block quote.\n */\n _addBlockQuoteAutoformats() {\n if (this.editor.commands.get('blockQuote')) {\n blockAutoformatEditing(this.editor, this, /^>\\s$/, 'blockQuote');\n }\n }\n /**\n * Adds autoformatting related to {@link module:code-block/codeblock~CodeBlock}.\n *\n * When typed:\n * - `` ``` `` &ndash; A paragraph will be changed to a code block.\n */\n _addCodeBlockAutoformats() {\n const editor = this.editor;\n const selection = editor.model.document.selection;\n if (editor.commands.get('codeBlock')) {\n blockAutoformatEditing(editor, this, /^```$/, () => {\n if (selection.getFirstPosition().parent.is('element', 'listItem')) {\n return false;\n }\n this.editor.execute('codeBlock', {\n usePreviousLanguageChoice: true\n });\n });\n }\n }\n /**\n * Adds autoformatting related to {@link module:horizontal-line/horizontalline~HorizontalLine}.\n *\n * When typed:\n * - `` --- `` &ndash; Will be replaced with a horizontal line.\n */\n _addHorizontalLineAutoformats() {\n if (this.editor.commands.get('horizontalLine')) {\n blockAutoformatEditing(this.editor, this, /^---$/, 'horizontalLine');\n }\n }\n}\n/**\n * Helper function for getting `inlineAutoformatEditing` callbacks that checks if command is enabled.\n */\nfunction getCallbackFunctionForInlineAutoformat(editor, attributeKey) {\n return (writer, rangesToFormat) => {\n const command = editor.commands.get(attributeKey);\n if (!command.isEnabled) {\n return false;\n }\n const validRanges = editor.model.schema.getValidRanges(rangesToFormat, attributeKey);\n for (const range of validRanges) {\n writer.setAttribute(attributeKey, true, range);\n }\n // After applying attribute to the text, remove given attribute from the selection.\n // This way user is able to type a text without attribute used by auto formatter.\n writer.removeSelectionAttribute(attributeKey);\n };\n}\n","import baseSlice from './_baseSlice.js';\n\n/**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\nfunction castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n}\n\nexport default castSlice;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsZWJ = '\\\\u200d';\n\n/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\nvar reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n/**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\nfunction hasUnicode(string) {\n return reHasUnicode.test(string);\n}\n\nexport default hasUnicode;\n","/**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction asciiToArray(string) {\n return string.split('');\n}\n\nexport default asciiToArray;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsAstral = '[' + rsAstralRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction unicodeToArray(string) {\n return string.match(reUnicode) || [];\n}\n\nexport default unicodeToArray;\n","import asciiToArray from './_asciiToArray.js';\nimport hasUnicode from './_hasUnicode.js';\nimport unicodeToArray from './_unicodeToArray.js';\n\n/**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n}\n\nexport default stringToArray;\n","import createCaseFirst from './_createCaseFirst.js';\n\n/**\n * Converts the first character of `string` to upper case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.upperFirst('fred');\n * // => 'Fred'\n *\n * _.upperFirst('FRED');\n * // => 'FRED'\n */\nvar upperFirst = createCaseFirst('toUpperCase');\n\nexport default upperFirst;\n","import castSlice from './_castSlice.js';\nimport hasUnicode from './_hasUnicode.js';\nimport stringToArray from './_stringToArray.js';\nimport toString from './toString.js';\n\n/**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\nfunction createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n}\n\nexport default createCaseFirst;\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { upperFirst } from 'lodash-es';\nconst ATTRIBUTE_WHITESPACES = /[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205f\\u3000]/g; // eslint-disable-line no-control-regex\nconst SAFE_URL = /^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;\n// Simplified email test - should be run over previously found URL.\nconst EMAIL_REG_EXP = /^[\\S]+@((?![-_])(?:[-\\w\\u00a1-\\uffff]{0,63}[^-_]\\.))+(?:[a-z\\u00a1-\\uffff]{2,})$/i;\n// The regex checks for the protocol syntax ('xxxx://' or 'xxxx:')\n// or non-word characters at the beginning of the link ('/', '#' etc.).\nconst PROTOCOL_REG_EXP = /^((\\w+:(\\/{2,})?)|(\\W))/i;\n/**\n * A keystroke used by the {@link module:link/linkui~LinkUI link UI feature}.\n */\nexport const LINK_KEYSTROKE = 'Ctrl+K';\n/**\n * Returns `true` if a given view node is the link element.\n */\nexport function isLinkElement(node) {\n return node.is('attributeElement') && !!node.getCustomProperty('link');\n}\n/**\n * Creates a link {@link module:engine/view/attributeelement~AttributeElement} with the provided `href` attribute.\n */\nexport function createLinkElement(href, { writer }) {\n // Priority 5 - https://github.com/ckeditor/ckeditor5-link/issues/121.\n const linkElement = writer.createAttributeElement('a', { href }, { priority: 5 });\n writer.setCustomProperty('link', true, linkElement);\n return linkElement;\n}\n/**\n * Returns a safe URL based on a given value.\n *\n * A URL is considered safe if it is safe for the user (does not contain any malicious code).\n *\n * If a URL is considered unsafe, a simple `\"#\"` is returned.\n *\n * @internal\n */\nexport function ensureSafeUrl(url) {\n const urlString = String(url);\n return isSafeUrl(urlString) ? urlString : '#';\n}\n/**\n * Checks whether the given URL is safe for the user (does not contain any malicious code).\n */\nfunction isSafeUrl(url) {\n const normalizedUrl = url.replace(ATTRIBUTE_WHITESPACES, '');\n return !!normalizedUrl.match(SAFE_URL);\n}\n/**\n * Returns the {@link module:link/linkconfig~LinkConfig#decorators `config.link.decorators`} configuration processed\n * to respect the locale of the editor, i.e. to display the {@link module:link/linkconfig~LinkDecoratorManualDefinition label}\n * in the correct language.\n *\n * **Note**: Only the few most commonly used labels are translated automatically. Other labels should be manually\n * translated in the {@link module:link/linkconfig~LinkConfig#decorators `config.link.decorators`} configuration.\n *\n * @param t Shorthand for {@link module:utils/locale~Locale#t Locale#t}.\n * @param decorators The decorator reference where the label values should be localized.\n */\nexport function getLocalizedDecorators(t, decorators) {\n const localizedDecoratorsLabels = {\n 'Open in a new tab': t('Open in a new tab'),\n 'Downloadable': t('Downloadable')\n };\n decorators.forEach(decorator => {\n if ('label' in decorator && localizedDecoratorsLabels[decorator.label]) {\n decorator.label = localizedDecoratorsLabels[decorator.label];\n }\n return decorator;\n });\n return decorators;\n}\n/**\n * Converts an object with defined decorators to a normalized array of decorators. The `id` key is added for each decorator and\n * is used as the attribute's name in the model.\n */\nexport function normalizeDecorators(decorators) {\n const retArray = [];\n if (decorators) {\n for (const [key, value] of Object.entries(decorators)) {\n const decorator = Object.assign({}, value, { id: `link${upperFirst(key)}` });\n retArray.push(decorator);\n }\n }\n return retArray;\n}\n/**\n * Returns `true` if the specified `element` can be linked (the element allows the `linkHref` attribute).\n */\nexport function isLinkableElement(element, schema) {\n if (!element) {\n return false;\n }\n return schema.checkAttribute(element.name, 'linkHref');\n}\n/**\n * Returns `true` if the specified `value` is an email.\n */\nexport function isEmail(value) {\n return EMAIL_REG_EXP.test(value);\n}\n/**\n * Adds the protocol prefix to the specified `link` when:\n *\n * * it does not contain it already, and there is a {@link module:link/linkconfig~LinkConfig#defaultProtocol `defaultProtocol` }\n * configuration value provided,\n * * or the link is an email address.\n */\nexport function addLinkProtocolIfApplicable(link, defaultProtocol) {\n const protocol = isEmail(link) ? 'mailto:' : defaultProtocol;\n const isProtocolNeeded = !!protocol && !linkHasProtocol(link);\n return link && isProtocolNeeded ? protocol + link : link;\n}\n/**\n * Checks if protocol is already included in the link.\n */\nexport function linkHasProtocol(link) {\n return PROTOCOL_REG_EXP.test(link);\n}\n/**\n * Opens the link in a new browser tab.\n */\nexport function openLink(link) {\n window.open(link, '_blank', 'noopener');\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module link/autolink\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Delete, TextWatcher, getLastTextLine } from 'ckeditor5/src/typing';\nimport { addLinkProtocolIfApplicable, linkHasProtocol } from './utils';\nconst MIN_LINK_LENGTH_WITH_SPACE_AT_END = 4; // Ie: \"t.co \" (length 5).\n// This was a tweak from https://gist.github.com/dperini/729294.\nconst URL_REG_EXP = new RegExp(\n// Group 1: Line start or after a space.\n'(^|\\\\s)' +\n // Group 2: Detected URL (or e-mail).\n '(' +\n // Protocol identifier or short syntax \"//\"\n // a. Full form http://user@foo.bar.baz:8080/foo/bar.html#baz?foo=bar\n '(' +\n '(?:(?:(?:https?|ftp):)?\\\\/\\\\/)' +\n // BasicAuth using user:pass (optional)\n '(?:\\\\S+(?::\\\\S*)?@)?' +\n '(?:' +\n // IP address dotted notation octets\n // excludes loopback network 0.0.0.0\n // excludes reserved space >= 224.0.0.0\n // excludes network & broadcast addresses\n // (first & last IP address of each class)\n '(?:[1-9]\\\\d?|1\\\\d\\\\d|2[01]\\\\d|22[0-3])' +\n '(?:\\\\.(?:1?\\\\d{1,2}|2[0-4]\\\\d|25[0-5])){2}' +\n '(?:\\\\.(?:[1-9]\\\\d?|1\\\\d\\\\d|2[0-4]\\\\d|25[0-4]))' +\n '|' +\n '(' +\n // Do not allow `www.foo` - see https://github.com/ckeditor/ckeditor5/issues/8050.\n '((?!www\\\\.)|(www\\\\.))' +\n // Host & domain names.\n '(?![-_])(?:[-_a-z0-9\\\\u00a1-\\\\uffff]{1,63}\\\\.)+' +\n // TLD identifier name.\n '(?:[a-z\\\\u00a1-\\\\uffff]{2,63})' +\n ')' +\n ')' +\n // port number (optional)\n '(?::\\\\d{2,5})?' +\n // resource path (optional)\n '(?:[/?#]\\\\S*)?' +\n ')' +\n '|' +\n // b. Short form (either www.example.com or example@example.com)\n '(' +\n '(www.|(\\\\S+@))' +\n // Host & domain names.\n '((?![-_])(?:[-_a-z0-9\\\\u00a1-\\\\uffff]{1,63}\\\\.))+' +\n // TLD identifier name.\n '(?:[a-z\\\\u00a1-\\\\uffff]{2,63})' +\n ')' +\n ')$', 'i');\nconst URL_GROUP_IN_MATCH = 2;\n/**\n * The autolink plugin.\n */\nexport default class AutoLink extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [Delete];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'AutoLink';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const selection = editor.model.document.selection;\n selection.on('change:range', () => {\n // Disable plugin when selection is inside a code block.\n this.isEnabled = !selection.anchor.parent.is('element', 'codeBlock');\n });\n this._enableTypingHandling();\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n this._enableEnterHandling();\n this._enableShiftEnterHandling();\n }\n /**\n * Enables autolinking on typing.\n */\n _enableTypingHandling() {\n const editor = this.editor;\n const watcher = new TextWatcher(editor.model, text => {\n // 1. Detect <kbd>Space</kbd> after a text with a potential link.\n if (!isSingleSpaceAtTheEnd(text)) {\n return;\n }\n // 2. Check text before last typed <kbd>Space</kbd>.\n const url = getUrlAtTextEnd(text.substr(0, text.length - 1));\n if (url) {\n return { url };\n }\n });\n watcher.on('matched:data', (evt, data) => {\n const { batch, range, url } = data;\n if (!batch.isTyping) {\n return;\n }\n const linkEnd = range.end.getShiftedBy(-1); // Executed after a space character.\n const linkStart = linkEnd.getShiftedBy(-url.length);\n const linkRange = editor.model.createRange(linkStart, linkEnd);\n this._applyAutoLink(url, linkRange);\n });\n watcher.bind('isEnabled').to(this);\n }\n /**\n * Enables autolinking on the <kbd>Enter</kbd> key.\n */\n _enableEnterHandling() {\n const editor = this.editor;\n const model = editor.model;\n const enterCommand = editor.commands.get('enter');\n if (!enterCommand) {\n return;\n }\n enterCommand.on('execute', () => {\n const position = model.document.selection.getFirstPosition();\n if (!position.parent.previousSibling) {\n return;\n }\n const rangeToCheck = model.createRangeIn(position.parent.previousSibling);\n this._checkAndApplyAutoLinkOnRange(rangeToCheck);\n });\n }\n /**\n * Enables autolinking on the <kbd>Shift</kbd>+<kbd>Enter</kbd> keyboard shortcut.\n */\n _enableShiftEnterHandling() {\n const editor = this.editor;\n const model = editor.model;\n const shiftEnterCommand = editor.commands.get('shiftEnter');\n if (!shiftEnterCommand) {\n return;\n }\n shiftEnterCommand.on('execute', () => {\n const position = model.document.selection.getFirstPosition();\n const rangeToCheck = model.createRange(model.createPositionAt(position.parent, 0), position.getShiftedBy(-1));\n this._checkAndApplyAutoLinkOnRange(rangeToCheck);\n });\n }\n /**\n * Checks if the passed range contains a linkable text.\n */\n _checkAndApplyAutoLinkOnRange(rangeToCheck) {\n const model = this.editor.model;\n const { text, range } = getLastTextLine(rangeToCheck, model);\n const url = getUrlAtTextEnd(text);\n if (url) {\n const linkRange = model.createRange(range.end.getShiftedBy(-url.length), range.end);\n this._applyAutoLink(url, linkRange);\n }\n }\n /**\n * Applies a link on a given range if the link should be applied.\n *\n * @param url The URL to link.\n * @param range The text range to apply the link attribute to.\n */\n _applyAutoLink(url, range) {\n const model = this.editor.model;\n const defaultProtocol = this.editor.config.get('link.defaultProtocol');\n const fullUrl = addLinkProtocolIfApplicable(url, defaultProtocol);\n if (!this.isEnabled || !isLinkAllowedOnRange(range, model) || !linkHasProtocol(fullUrl) || linkIsAlreadySet(range)) {\n return;\n }\n this._persistAutoLink(fullUrl, range);\n }\n /**\n * Enqueues autolink changes in the model.\n *\n * @param url The URL to link.\n * @param range The text range to apply the link attribute to.\n */\n _persistAutoLink(url, range) {\n const model = this.editor.model;\n const deletePlugin = this.editor.plugins.get('Delete');\n // Enqueue change to make undo step.\n model.enqueueChange(writer => {\n writer.setAttribute('linkHref', url, range);\n model.enqueueChange(() => {\n deletePlugin.requestUndoOnBackspace();\n });\n });\n }\n}\n// Check if text should be evaluated by the plugin in order to reduce number of RegExp checks on whole text.\nfunction isSingleSpaceAtTheEnd(text) {\n return text.length > MIN_LINK_LENGTH_WITH_SPACE_AT_END && text[text.length - 1] === ' ' && text[text.length - 2] !== ' ';\n}\nfunction getUrlAtTextEnd(text) {\n const match = URL_REG_EXP.exec(text);\n return match ? match[URL_GROUP_IN_MATCH] : null;\n}\nfunction isLinkAllowedOnRange(range, model) {\n return model.schema.checkAttributeInSelection(model.createSelection(range), 'linkHref');\n}\nfunction linkIsAlreadySet(range) {\n const item = range.start.nodeAfter;\n return !!item && item.hasAttribute('linkHref');\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module block-quote/blockquotecommand\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { first } from 'ckeditor5/src/utils';\n/**\n * The block quote command plugin.\n *\n * @extends module:core/command~Command\n */\nexport default class BlockQuoteCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n this.value = this._getValue();\n this.isEnabled = this._checkEnabled();\n }\n /**\n * Executes the command. When the command {@link #value is on}, all top-most block quotes within\n * the selection will be removed. If it is off, all selected blocks will be wrapped with\n * a block quote.\n *\n * @fires execute\n * @param options Command options.\n * @param options.forceValue If set, it will force the command behavior. If `true`, the command will apply a block quote,\n * otherwise the command will remove the block quote. If not set, the command will act basing on its current value.\n */\n execute(options = {}) {\n const model = this.editor.model;\n const schema = model.schema;\n const selection = model.document.selection;\n const blocks = Array.from(selection.getSelectedBlocks());\n const value = (options.forceValue === undefined) ? !this.value : options.forceValue;\n model.change(writer => {\n if (!value) {\n this._removeQuote(writer, blocks.filter(findQuote));\n }\n else {\n const blocksToQuote = blocks.filter(block => {\n // Already quoted blocks needs to be considered while quoting too\n // in order to reuse their <bQ> elements.\n return findQuote(block) || checkCanBeQuoted(schema, block);\n });\n this._applyQuote(writer, blocksToQuote);\n }\n });\n }\n /**\n * Checks the command's {@link #value}.\n */\n _getValue() {\n const selection = this.editor.model.document.selection;\n const firstBlock = first(selection.getSelectedBlocks());\n // In the current implementation, the block quote must be an immediate parent of a block element.\n return !!(firstBlock && findQuote(firstBlock));\n }\n /**\n * Checks whether the command can be enabled in the current context.\n *\n * @returns Whether the command should be enabled.\n */\n _checkEnabled() {\n if (this.value) {\n return true;\n }\n const selection = this.editor.model.document.selection;\n const schema = this.editor.model.schema;\n const firstBlock = first(selection.getSelectedBlocks());\n if (!firstBlock) {\n return false;\n }\n return checkCanBeQuoted(schema, firstBlock);\n }\n /**\n * Removes the quote from given blocks.\n *\n * If blocks which are supposed to be \"unquoted\" are in the middle of a quote,\n * start it or end it, then the quote will be split (if needed) and the blocks\n * will be moved out of it, so other quoted blocks remained quoted.\n */\n _removeQuote(writer, blocks) {\n // Unquote all groups of block. Iterate in the reverse order to not break following ranges.\n getRangesOfBlockGroups(writer, blocks).reverse().forEach(groupRange => {\n if (groupRange.start.isAtStart && groupRange.end.isAtEnd) {\n writer.unwrap(groupRange.start.parent);\n return;\n }\n // The group of blocks are at the beginning of an <bQ> so let's move them left (out of the <bQ>).\n if (groupRange.start.isAtStart) {\n const positionBefore = writer.createPositionBefore(groupRange.start.parent);\n writer.move(groupRange, positionBefore);\n return;\n }\n // The blocks are in the middle of an <bQ> so we need to split the <bQ> after the last block\n // so we move the items there.\n if (!groupRange.end.isAtEnd) {\n writer.split(groupRange.end);\n }\n // Now we are sure that groupRange.end.isAtEnd is true, so let's move the blocks right.\n const positionAfter = writer.createPositionAfter(groupRange.end.parent);\n writer.move(groupRange, positionAfter);\n });\n }\n /**\n * Applies the quote to given blocks.\n */\n _applyQuote(writer, blocks) {\n const quotesToMerge = [];\n // Quote all groups of block. Iterate in the reverse order to not break following ranges.\n getRangesOfBlockGroups(writer, blocks).reverse().forEach(groupRange => {\n let quote = findQuote(groupRange.start);\n if (!quote) {\n quote = writer.createElement('blockQuote');\n writer.wrap(groupRange, quote);\n }\n quotesToMerge.push(quote);\n });\n // Merge subsequent <bQ> elements. Reverse the order again because this time we want to go through\n // the <bQ> elements in the source order (due to how merge works it moves the right element's content\n // to the first element and removes the right one. Since we may need to merge a couple of subsequent `<bQ>` elements\n // we want to keep the reference to the first (furthest left) one.\n quotesToMerge.reverse().reduce((currentQuote, nextQuote) => {\n if (currentQuote.nextSibling == nextQuote) {\n writer.merge(writer.createPositionAfter(currentQuote));\n return currentQuote;\n }\n return nextQuote;\n });\n }\n}\nfunction findQuote(elementOrPosition) {\n return elementOrPosition.parent.name == 'blockQuote' ? elementOrPosition.parent : null;\n}\n/**\n * Returns a minimal array of ranges containing groups of subsequent blocks.\n *\n * content: abcdefgh\n * blocks: [ a, b, d, f, g, h ]\n * output ranges: [ab]c[d]e[fgh]\n */\nfunction getRangesOfBlockGroups(writer, blocks) {\n let startPosition;\n let i = 0;\n const ranges = [];\n while (i < blocks.length) {\n const block = blocks[i];\n const nextBlock = blocks[i + 1];\n if (!startPosition) {\n startPosition = writer.createPositionBefore(block);\n }\n if (!nextBlock || block.nextSibling != nextBlock) {\n ranges.push(writer.createRange(startPosition, writer.createPositionAfter(block)));\n startPosition = null;\n }\n i++;\n }\n return ranges;\n}\n/**\n * Checks whether <bQ> can wrap the block.\n */\nfunction checkCanBeQuoted(schema, block) {\n // TMP will be replaced with schema.checkWrap().\n const isBQAllowed = schema.checkChild(block.parent, 'blockQuote');\n const isBlockAllowedInBQ = schema.checkChild(['$root', 'blockQuote'], block);\n return isBQAllowed && isBlockAllowedInBQ;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module block-quote/blockquoteediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Enter } from 'ckeditor5/src/enter';\nimport { Delete } from 'ckeditor5/src/typing';\nimport BlockQuoteCommand from './blockquotecommand';\n/**\n * The block quote editing.\n *\n * Introduces the `'blockQuote'` command and the `'blockQuote'` model element.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class BlockQuoteEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'BlockQuoteEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [Enter, Delete];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n editor.commands.add('blockQuote', new BlockQuoteCommand(editor));\n schema.register('blockQuote', {\n inheritAllFrom: '$container'\n });\n editor.conversion.elementToElement({ model: 'blockQuote', view: 'blockquote' });\n // Postfixer which cleans incorrect model states connected with block quotes.\n editor.model.document.registerPostFixer(writer => {\n const changes = editor.model.document.differ.getChanges();\n for (const entry of changes) {\n if (entry.type == 'insert') {\n const element = entry.position.nodeAfter;\n if (!element) {\n // We are inside a text node.\n continue;\n }\n if (element.is('element', 'blockQuote') && element.isEmpty) {\n // Added an empty blockQuote - remove it.\n writer.remove(element);\n return true;\n }\n else if (element.is('element', 'blockQuote') && !schema.checkChild(entry.position, element)) {\n // Added a blockQuote in incorrect place. Unwrap it so the content inside is not lost.\n writer.unwrap(element);\n return true;\n }\n else if (element.is('element')) {\n // Just added an element. Check that all children meet the scheme rules.\n const range = writer.createRangeIn(element);\n for (const child of range.getItems()) {\n if (child.is('element', 'blockQuote') &&\n !schema.checkChild(writer.createPositionBefore(child), child)) {\n writer.unwrap(child);\n return true;\n }\n }\n }\n }\n else if (entry.type == 'remove') {\n const parent = entry.position.parent;\n if (parent.is('element', 'blockQuote') && parent.isEmpty) {\n // Something got removed and now blockQuote is empty. Remove the blockQuote as well.\n writer.remove(parent);\n return true;\n }\n }\n }\n return false;\n });\n const viewDocument = this.editor.editing.view.document;\n const selection = editor.model.document.selection;\n const blockQuoteCommand = editor.commands.get('blockQuote');\n // Overwrite default Enter key behavior.\n // If Enter key is pressed with selection collapsed in empty block inside a quote, break the quote.\n this.listenTo(viewDocument, 'enter', (evt, data) => {\n if (!selection.isCollapsed || !blockQuoteCommand.value) {\n return;\n }\n const positionParent = selection.getLastPosition().parent;\n if (positionParent.isEmpty) {\n editor.execute('blockQuote');\n editor.editing.view.scrollToTheSelection();\n data.preventDefault();\n evt.stop();\n }\n }, { context: 'blockquote' });\n // Overwrite default Backspace key behavior.\n // If Backspace key is pressed with selection collapsed in first empty block inside a quote, break the quote.\n this.listenTo(viewDocument, 'delete', (evt, data) => {\n if (data.direction != 'backward' || !selection.isCollapsed || !blockQuoteCommand.value) {\n return;\n }\n const positionParent = selection.getLastPosition().parent;\n if (positionParent.isEmpty && !positionParent.previousSibling) {\n editor.execute('blockQuote');\n editor.editing.view.scrollToTheSelection();\n data.preventDefault();\n evt.stop();\n }\n }, { context: 'blockquote' });\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./blockquote.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module block-quote/blockquoteui\n */\nimport { Plugin, icons } from 'ckeditor5/src/core';\nimport { ButtonView } from 'ckeditor5/src/ui';\nimport '../theme/blockquote.css';\n/**\n * The block quote UI plugin.\n *\n * It introduces the `'blockQuote'` button.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class BlockQuoteUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'BlockQuoteUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n editor.ui.componentFactory.add('blockQuote', locale => {\n const command = editor.commands.get('blockQuote');\n const buttonView = new ButtonView(locale);\n buttonView.set({\n label: t('Block quote'),\n icon: icons.quote,\n tooltip: true,\n isToggleable: true\n });\n // Bind button model to command.\n buttonView.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n // Execute command.\n this.listenTo(buttonView, 'execute', () => {\n editor.execute('blockQuote');\n editor.editing.view.focus();\n });\n return buttonView;\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/attributecommand\n */\nimport { Command } from 'ckeditor5/src/core';\n/**\n * An extension of the base {@link module:core/command~Command} class, which provides utilities for a command\n * that toggles a single attribute on a text or an element.\n *\n * `AttributeCommand` uses {@link module:engine/model/document~Document#selection}\n * to decide which nodes (if any) should be changed, and applies or removes the attribute from them.\n *\n * The command checks the {@link module:engine/model/model~Model#schema} to decide if it can be enabled\n * for the current selection and to which nodes the attribute can be applied.\n */\nexport default class AttributeCommand extends Command {\n /**\n * @param attributeKey Attribute that will be set by the command.\n */\n constructor(editor, attributeKey) {\n super(editor);\n this.attributeKey = attributeKey;\n }\n /**\n * Updates the command's {@link #value} and {@link #isEnabled} based on the current selection.\n */\n refresh() {\n const model = this.editor.model;\n const doc = model.document;\n this.value = this._getValueFromFirstAllowedNode();\n this.isEnabled = model.schema.checkAttributeInSelection(doc.selection, this.attributeKey);\n }\n /**\n * Executes the command &mdash; applies the attribute to the selection or removes it from the selection.\n *\n * If the command is active (`value == true`), it will remove attributes. Otherwise, it will set attributes.\n *\n * The execution result differs, depending on the {@link module:engine/model/document~Document#selection}:\n *\n * * If the selection is on a range, the command applies the attribute to all nodes in that range\n * (if they are allowed to have this attribute by the {@link module:engine/model/schema~Schema schema}).\n * * If the selection is collapsed in a non-empty node, the command applies the attribute to the\n * {@link module:engine/model/document~Document#selection} itself (note that typed characters copy attributes from the selection).\n * * If the selection is collapsed in an empty node, the command applies the attribute to the parent node of the selection (note\n * that the selection inherits all attributes from a node if it is in an empty node).\n *\n * @fires execute\n * @param options Command options.\n * @param options.forceValue If set, it will force the command behavior. If `true`,\n * the command will apply the attribute, otherwise the command will remove the attribute.\n * If not set, the command will look for its current value to decide what it should do.\n */\n execute(options = {}) {\n const model = this.editor.model;\n const doc = model.document;\n const selection = doc.selection;\n const value = (options.forceValue === undefined) ? !this.value : options.forceValue;\n model.change(writer => {\n if (selection.isCollapsed) {\n if (value) {\n writer.setSelectionAttribute(this.attributeKey, true);\n }\n else {\n writer.removeSelectionAttribute(this.attributeKey);\n }\n }\n else {\n const ranges = model.schema.getValidRanges(selection.getRanges(), this.attributeKey);\n for (const range of ranges) {\n if (value) {\n writer.setAttribute(this.attributeKey, value, range);\n }\n else {\n writer.removeAttribute(this.attributeKey, range);\n }\n }\n }\n });\n }\n /**\n * Checks the attribute value of the first node in the selection that allows the attribute.\n * For the collapsed selection returns the selection attribute.\n *\n * @returns The attribute value.\n */\n _getValueFromFirstAllowedNode() {\n const model = this.editor.model;\n const schema = model.schema;\n const selection = model.document.selection;\n if (selection.isCollapsed) {\n return selection.hasAttribute(this.attributeKey);\n }\n for (const range of selection.getRanges()) {\n for (const item of range.getItems()) {\n if (schema.checkAttribute(item, this.attributeKey)) {\n return item.hasAttribute(this.attributeKey);\n }\n }\n }\n return false;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/bold/boldediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport AttributeCommand from '../attributecommand';\nconst BOLD = 'bold';\n/**\n * The bold editing feature.\n *\n * It registers the `'bold'` command and introduces the `bold` attribute in the model which renders to the view\n * as a `<strong>` element.\n */\nexport default class BoldEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'BoldEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Allow bold attribute on text nodes.\n editor.model.schema.extend('$text', { allowAttributes: BOLD });\n editor.model.schema.setAttributeProperties(BOLD, {\n isFormatting: true,\n copyOnEnter: true\n });\n // Build converter from model to view for data and editing pipelines.\n editor.conversion.attributeToElement({\n model: BOLD,\n view: 'strong',\n upcastAlso: [\n 'b',\n viewElement => {\n const fontWeight = viewElement.getStyle('font-weight');\n if (!fontWeight) {\n return null;\n }\n // Value of the `font-weight` attribute can be defined as a string or a number.\n if (fontWeight == 'bold' || Number(fontWeight) >= 600) {\n return {\n name: true,\n styles: ['font-weight']\n };\n }\n return null;\n }\n ]\n });\n // Create bold command.\n editor.commands.add(BOLD, new AttributeCommand(editor, BOLD));\n // Set the Ctrl+B keystroke.\n editor.keystrokes.set('CTRL+B', BOLD);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/bold/boldui\n */\nimport { Plugin, icons } from 'ckeditor5/src/core';\nimport { ButtonView } from 'ckeditor5/src/ui';\nconst BOLD = 'bold';\n/**\n * The bold UI feature. It introduces the Bold button.\n */\nexport default class BoldUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'BoldUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n // Add bold button to feature components.\n editor.ui.componentFactory.add(BOLD, locale => {\n const command = editor.commands.get(BOLD);\n const view = new ButtonView(locale);\n view.set({\n label: t('Bold'),\n icon: icons.bold,\n keystroke: 'CTRL+B',\n tooltip: true,\n isToggleable: true\n });\n view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n // Execute command.\n this.listenTo(view, 'execute', () => {\n editor.execute(BOLD);\n editor.editing.view.focus();\n });\n return view;\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/code/codeediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { TwoStepCaretMovement, inlineHighlight } from 'ckeditor5/src/typing';\nimport AttributeCommand from '../attributecommand';\nconst CODE = 'code';\nconst HIGHLIGHT_CLASS = 'ck-code_selected';\n/**\n * The code editing feature.\n *\n * It registers the `'code'` command and introduces the `code` attribute in the model which renders to the view\n * as a `<code>` element.\n */\nexport default class CodeEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'CodeEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TwoStepCaretMovement];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Allow code attribute on text nodes.\n editor.model.schema.extend('$text', { allowAttributes: CODE });\n editor.model.schema.setAttributeProperties(CODE, {\n isFormatting: true,\n copyOnEnter: false\n });\n editor.conversion.attributeToElement({\n model: CODE,\n view: 'code',\n upcastAlso: {\n styles: {\n 'word-wrap': 'break-word'\n }\n }\n });\n // Create code command.\n editor.commands.add(CODE, new AttributeCommand(editor, CODE));\n // Enable two-step caret movement for `code` attribute.\n editor.plugins.get(TwoStepCaretMovement).registerAttribute(CODE);\n // Setup highlight over selected element.\n inlineHighlight(editor, CODE, 'code', HIGHLIGHT_CLASS);\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./code.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/code/codeui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ButtonView } from 'ckeditor5/src/ui';\nimport codeIcon from '../../theme/icons/code.svg';\nimport '../../theme/code.css';\nconst CODE = 'code';\n/**\n * The code UI feature. It introduces the Code button.\n */\nexport default class CodeUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'CodeUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n // Add code button to feature components.\n editor.ui.componentFactory.add(CODE, locale => {\n const command = editor.commands.get(CODE);\n const view = new ButtonView(locale);\n view.set({\n label: t('Code'),\n icon: codeIcon,\n tooltip: true,\n isToggleable: true\n });\n view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n // Execute command.\n this.listenTo(view, 'execute', () => {\n editor.execute(CODE);\n editor.editing.view.focus();\n });\n return view;\n });\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m12.5 5.7 5.2 3.9v1.3l-5.6 4c-.1.2-.3.2-.5.2-.3-.1-.6-.7-.6-1l.3-.4 4.7-3.5L11.5 7l-.2-.2c-.1-.3-.1-.6 0-.8.2-.2.5-.4.8-.4a.8.8 0 0 1 .4.1zm-5.2 0L2 9.6v1.3l5.6 4c.1.2.3.2.5.2.3-.1.7-.7.6-1 0-.1 0-.3-.2-.4l-5-3.5L8.2 7l.2-.2c.1-.3.1-.6 0-.8-.2-.2-.5-.4-.8-.4a.8.8 0 0 0-.3.1z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { first } from 'ckeditor5/src/utils';\n/**\n * Returns code block languages as defined in `config.codeBlock.languages` but processed:\n *\n * * To consider the editor localization, i.e. to display {@link module:code-block/codeblockconfig~CodeBlockLanguageDefinition}\n * in the correct language. There is no way to use {@link module:utils/locale~Locale#t} when the user\n * configuration is defined because the editor does not exist yet.\n * * To make sure each definition has a CSS class associated with it even if not specified\n * in the original configuration.\n */\nexport function getNormalizedAndLocalizedLanguageDefinitions(editor) {\n const t = editor.t;\n const languageDefs = editor.config.get('codeBlock.languages');\n for (const def of languageDefs) {\n if (def.label === 'Plain text') {\n def.label = t('Plain text');\n }\n if (def.class === undefined) {\n def.class = `language-${def.language}`;\n }\n }\n return languageDefs;\n}\n/**\n * Returns an object associating certain language definition properties with others. For instance:\n *\n * For:\n *\n * ```ts\n * const definitions = {\n * \t{ language: 'php', class: 'language-php', label: 'PHP' },\n * \t{ language: 'javascript', class: 'js', label: 'JavaScript' },\n * };\n *\n * getPropertyAssociation( definitions, 'class', 'language' );\n * ```\n *\n * returns:\n *\n * ```ts\n * {\n * \t'language-php': 'php',\n * \t'js': 'javascript'\n * }\n * ```\n *\n * and\n *\n * ```ts\n * getPropertyAssociation( definitions, 'language', 'label' );\n * ```\n *\n * returns:\n *\n * ```ts\n * {\n * \t'php': 'PHP',\n * \t'javascript': 'JavaScript'\n * }\n * ```\n */\nexport function getPropertyAssociation(languageDefs, key, value) {\n const association = {};\n for (const def of languageDefs) {\n if (key === 'class') {\n // Only the first class is considered.\n const newKey = (def[key]).split(' ').shift();\n association[newKey] = def[value];\n }\n else {\n association[def[key]] = def[value];\n }\n }\n return association;\n}\n/**\n * For a given model text node, it returns white spaces that precede other characters in that node.\n * This corresponds to the indentation part of the code block line.\n */\nexport function getLeadingWhiteSpaces(textNode) {\n return textNode.data.match(/^(\\s*)/)[0];\n}\n/**\n * For plain text containing the code (a snippet), it returns a document fragment containing\n * view text nodes separated by `<br>` elements (in place of new line characters \"\\n\"), for instance:\n *\n * Input:\n *\n * ```ts\n * \"foo()\\n\n * bar()\"\n * ```\n *\n * Output:\n *\n * ```html\n * <DocumentFragment>\n * \t\"foo()\"\n * \t<br/>\n * \t\"bar()\"\n * </DocumentFragment>\n * ```\n *\n * @param text The raw code text to be converted.\n */\nexport function rawSnippetTextToViewDocumentFragment(writer, text) {\n const fragment = writer.createDocumentFragment();\n const textLines = text.split('\\n');\n const items = textLines.reduce((nodes, line, lineIndex) => {\n nodes.push(line);\n if (lineIndex < textLines.length - 1) {\n nodes.push(writer.createElement('br'));\n }\n return nodes;\n }, []);\n writer.appendChild(items, fragment);\n return fragment;\n}\n/**\n * Returns an array of all model positions within the selection that represent code block lines.\n *\n * If the selection is collapsed, it returns the exact selection anchor position:\n *\n * ```html\n * <codeBlock>[]foo</codeBlock> -> <codeBlock>^foo</codeBlock>\n * <codeBlock>foo[]bar</codeBlock> -> <codeBlock>foo^bar</codeBlock>\n * ```\n *\n * Otherwise, it returns positions **before** each text node belonging to all code blocks contained by the selection:\n *\n * ```html\n * <codeBlock> <codeBlock>\n * foo[bar ^foobar\n * <softBreak></softBreak> -> <softBreak></softBreak>\n * baz]qux ^bazqux\n * </codeBlock> </codeBlock>\n * ```\n *\n * It also works across other noncode blocks:\n *\n * ```html\n * <codeBlock> <codeBlock>\n * foo[bar ^foobar\n * </codeBlock> </codeBlock>\n * <paragraph>text</paragraph> -> <paragraph>text</paragraph>\n * <codeBlock> <codeBlock>\n * baz]qux ^bazqux\n * </codeBlock> </codeBlock>\n * ```\n *\n * **Note:** The positions are in reverse order so they do not get outdated when iterating over them and\n * the writer inserts or removes elements at the same time.\n *\n * **Note:** The position is located after the leading white spaces in the text node.\n */\nexport function getIndentOutdentPositions(model) {\n const selection = model.document.selection;\n const positions = [];\n // When the selection is collapsed, there's only one position we can indent or outdent.\n if (selection.isCollapsed) {\n return [selection.anchor];\n }\n // When the selection is NOT collapsed, collect all positions starting before text nodes\n // (code lines) in any <codeBlock> within the selection.\n // Walk backward so positions we are about to collect here do not get outdated when\n // inserting or deleting using the writer.\n const walker = selection.getFirstRange().getWalker({\n ignoreElementEnd: true,\n direction: 'backward'\n });\n for (const { item } of walker) {\n if (!item.is('$textProxy')) {\n continue;\n }\n const { parent, startOffset } = item.textNode;\n if (!parent.is('element', 'codeBlock')) {\n continue;\n }\n const leadingWhiteSpaces = getLeadingWhiteSpaces(item.textNode);\n // Make sure the position is after all leading whitespaces in the text node.\n const position = model.createPositionAt(parent, startOffset + leadingWhiteSpaces.length);\n positions.push(position);\n }\n return positions;\n}\n/**\n * Checks if any of the blocks within the model selection is a code block.\n */\nexport function isModelSelectionInCodeBlock(selection) {\n const firstBlock = first(selection.getSelectedBlocks());\n return !!firstBlock && firstBlock.is('element', 'codeBlock');\n}\n/**\n * Checks if an {@link module:engine/model/element~Element Element} can become a code block.\n *\n * @param schema Model's schema.\n * @param element The element to be checked.\n * @returns Check result.\n */\nexport function canBeCodeBlock(schema, element) {\n if (element.is('rootElement') || schema.isLimit(element)) {\n return false;\n }\n return schema.checkChild(element.parent, 'codeBlock');\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { first } from 'ckeditor5/src/utils';\nimport { getNormalizedAndLocalizedLanguageDefinitions, canBeCodeBlock } from './utils';\n/**\n * The code block command plugin.\n */\nexport default class CodeBlockCommand extends Command {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n this._lastLanguage = null;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n this.value = this._getValue();\n this.isEnabled = this._checkEnabled();\n }\n /**\n * Executes the command. When the command {@link #value is on}, all topmost code blocks within\n * the selection will be removed. If it is off, all selected blocks will be flattened and\n * wrapped by a code block.\n *\n * @fires execute\n * @param options Command options.\n * @param options.language The code block language.\n * @param options.forceValue If set, it will force the command behavior. If `true`, the command will apply a code block,\n * otherwise the command will remove the code block. If not set, the command will act basing on its current value.\n * @param options.usePreviousLanguageChoice If set on `true` and the `options.language` is not specified, the command\n * will apply the previous language (if the command was already executed) when inserting the `codeBlock` element.\n */\n execute(options = {}) {\n const editor = this.editor;\n const model = editor.model;\n const selection = model.document.selection;\n const normalizedLanguagesDefs = getNormalizedAndLocalizedLanguageDefinitions(editor);\n const firstLanguageInConfig = normalizedLanguagesDefs[0];\n const blocks = Array.from(selection.getSelectedBlocks());\n const value = options.forceValue == undefined ? !this.value : options.forceValue;\n const language = getLanguage(options, this._lastLanguage, firstLanguageInConfig.language);\n model.change(writer => {\n if (value) {\n this._applyCodeBlock(writer, blocks, language);\n }\n else {\n this._removeCodeBlock(writer, blocks);\n }\n });\n }\n /**\n * Checks the command's {@link #value}.\n *\n * @returns The current value.\n */\n _getValue() {\n const selection = this.editor.model.document.selection;\n const firstBlock = first(selection.getSelectedBlocks());\n const isCodeBlock = !!(firstBlock && firstBlock.is('element', 'codeBlock'));\n return isCodeBlock ? firstBlock.getAttribute('language') : false;\n }\n /**\n * Checks whether the command can be enabled in the current context.\n *\n * @returns Whether the command should be enabled.\n */\n _checkEnabled() {\n if (this.value) {\n return true;\n }\n const selection = this.editor.model.document.selection;\n const schema = this.editor.model.schema;\n const firstBlock = first(selection.getSelectedBlocks());\n if (!firstBlock) {\n return false;\n }\n return canBeCodeBlock(schema, firstBlock);\n }\n _applyCodeBlock(writer, blocks, language) {\n this._lastLanguage = language;\n const schema = this.editor.model.schema;\n const allowedBlocks = blocks.filter(block => canBeCodeBlock(schema, block));\n for (const block of allowedBlocks) {\n writer.rename(block, 'codeBlock');\n writer.setAttribute('language', language, block);\n schema.removeDisallowedAttributes([block], writer);\n // Remove children of the `codeBlock` element that are not allowed. See #9567.\n Array.from(block.getChildren())\n .filter(child => !schema.checkChild(block, child))\n .forEach(child => writer.remove(child));\n }\n allowedBlocks.reverse().forEach((currentBlock, i) => {\n const nextBlock = allowedBlocks[i + 1];\n if (currentBlock.previousSibling === nextBlock) {\n writer.appendElement('softBreak', nextBlock);\n writer.merge(writer.createPositionBefore(currentBlock));\n }\n });\n }\n _removeCodeBlock(writer, blocks) {\n const codeBlocks = blocks.filter(block => block.is('element', 'codeBlock'));\n for (const block of codeBlocks) {\n const range = writer.createRangeOn(block);\n for (const item of Array.from(range.getItems()).reverse()) {\n if (item.is('element', 'softBreak') && item.parent.is('element', 'codeBlock')) {\n const { position } = writer.split(writer.createPositionBefore(item));\n const elementAfter = position.nodeAfter;\n writer.rename(elementAfter, 'paragraph');\n writer.removeAttribute('language', elementAfter);\n writer.remove(item);\n }\n }\n writer.rename(block, 'paragraph');\n writer.removeAttribute('language', block);\n }\n }\n}\n/**\n * Picks the language for the new code block. If any language is passed as an option,\n * it will be returned. Else, if option usePreviousLanguageChoice is true and some\n * code block was already created (lastLanguage is not null) then previously used\n * language will be returned. If not, it will return default language.\n */\nfunction getLanguage(options, lastLanguage, defaultLanguage) {\n if (options.language) {\n return options.language;\n }\n if (options.usePreviousLanguageChoice && lastLanguage) {\n return lastLanguage;\n }\n return defaultLanguage;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module code-block/indentcodeblockcommand\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { getIndentOutdentPositions, isModelSelectionInCodeBlock } from './utils';\n/**\n * The code block indentation increase command plugin.\n */\nexport default class IndentCodeBlockCommand extends Command {\n constructor(editor) {\n super(editor);\n this._indentSequence = editor.config.get('codeBlock.indentSequence');\n }\n /**\n * @inheritDoc\n */\n refresh() {\n this.isEnabled = this._checkEnabled();\n }\n /**\n * Executes the command. When the command {@link #isEnabled is enabled}, the indentation of the\n * code lines in the selection will be increased.\n *\n * @fires execute\n */\n execute() {\n const editor = this.editor;\n const model = editor.model;\n model.change(writer => {\n const positions = getIndentOutdentPositions(model);\n // Indent all positions, for instance assuming the indent sequence is 4x space (\" \"):\n //\n //\t\t<codeBlock>^foo</codeBlock> -> <codeBlock> foo</codeBlock>\n //\n //\t\t<codeBlock>foo^bar</codeBlock> -> <codeBlock>foo bar</codeBlock>\n //\n // Also, when there is more than one position:\n //\n //\t\t<codeBlock>\n //\t\t\t^foobar\n //\t\t\t<softBreak></softBreak>\n //\t\t\t^bazqux\n //\t\t</codeBlock>\n //\n //\t\t->\n //\n //\t\t<codeBlock>\n //\t\t\t foobar\n //\t\t\t<softBreak></softBreak>\n //\t\t\t bazqux\n //\t\t</codeBlock>\n //\n for (const position of positions) {\n const indentSequenceTextElement = writer.createText(this._indentSequence);\n // Previously insertion was done by writer.insertText(). It was changed to insertContent() to enable\n // integration of code block with track changes. It's the easiest way of integration because insertContent()\n // is already integrated with track changes, but if it ever cause any troubles it can be reverted, however\n // some additional work will be required in track changes integration of code block.\n model.insertContent(indentSequenceTextElement, position);\n }\n });\n }\n /**\n * Checks whether the command can be enabled in the current context.\n */\n _checkEnabled() {\n if (!this._indentSequence) {\n return false;\n }\n // Indent (forward) command is always enabled when there's any code block in the selection\n // because you can always indent code lines.\n return isModelSelectionInCodeBlock(this.editor.model.document.selection);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { getLeadingWhiteSpaces, getIndentOutdentPositions, isModelSelectionInCodeBlock } from './utils';\n/**\n * The code block indentation decrease command plugin.\n */\nexport default class OutdentCodeBlockCommand extends Command {\n constructor(editor) {\n super(editor);\n this._indentSequence = editor.config.get('codeBlock.indentSequence');\n }\n /**\n * @inheritDoc\n */\n refresh() {\n this.isEnabled = this._checkEnabled();\n }\n /**\n * Executes the command. When the command {@link #isEnabled is enabled}, the indentation of the\n * code lines in the selection will be decreased.\n *\n * @fires execute\n */\n execute() {\n const editor = this.editor;\n const model = editor.model;\n model.change(() => {\n const positions = getIndentOutdentPositions(model);\n // Outdent all positions, for instance assuming the indent sequence is 4x space (\" \"):\n //\n //\t\t<codeBlock>^foo</codeBlock> -> <codeBlock>foo</codeBlock>\n //\n //\t\t<codeBlock> ^bar</codeBlock> -> <codeBlock>bar</codeBlock>\n //\n // Also, when there is more than one position:\n //\n //\t\t<codeBlock>\n //\t\t\t ^foobar\n //\t\t\t<softBreak></softBreak>\n //\t\t\t ^bazqux\n //\t\t</codeBlock>\n //\n //\t\t->\n //\n //\t\t<codeBlock>\n //\t\t\tfoobar\n //\t\t\t<softBreak></softBreak>\n //\t\t\tbazqux\n //\t\t</codeBlock>\n for (const position of positions) {\n const range = getLastOutdentableSequenceRange(model, position, this._indentSequence);\n if (range) {\n // Previously deletion was done by writer.remove(). It was changed to deleteContent() to enable\n // integration of code block with track changes. It's the easiest way of integration because deleteContent()\n // is already integrated with track changes, but if it ever cause any troubles it can be reverted, however\n // some additional work will be required in track changes integration of code block.\n model.deleteContent(model.createSelection(range));\n }\n }\n });\n }\n /**\n * Checks whether the command can be enabled in the current context.\n *\n * @private\n * @returns {Boolean} Whether the command should be enabled.\n */\n _checkEnabled() {\n if (!this._indentSequence) {\n return false;\n }\n const model = this.editor.model;\n if (!isModelSelectionInCodeBlock(model.document.selection)) {\n return false;\n }\n // Outdent command can execute only when there is an indent character sequence\n // in some of the lines.\n return getIndentOutdentPositions(model).some(position => {\n return getLastOutdentableSequenceRange(model, position, this._indentSequence);\n });\n }\n}\n// For a position coming from `getIndentOutdentPositions()`, it returns the range representing\n// the last occurrence of the indent sequence among the leading whitespaces of the code line the\n// position represents.\n//\n// For instance, assuming the indent sequence is 4x space (\" \"):\n//\n//\t\t<codeBlock>foo^</codeBlock> -> null\n//\t\t<codeBlock>foo^<softBreak></softBreak>bar</codeBlock> -> null\n//\t\t<codeBlock> ^foo</codeBlock> -> null\n//\t\t<codeBlock> ^foo</codeBlock> -> <codeBlock> [ ]foo</codeBlock>\n//\t\t<codeBlock> ^foo bar</codeBlock> -> <codeBlock>[ ]foo bar</codeBlock>\n//\n// @param {<module:engine/model/model~Model>} model\n// @param {<module:engine/model/position~Position>} position\n// @param {String} sequence\n// @returns {<module:engine/model/range~Range>|null}\nfunction getLastOutdentableSequenceRange(model, position, sequence) {\n // Positions start before each text node (code line). Get the node corresponding to the position.\n const nodeAtPosition = getCodeLineTextNodeAtPosition(position);\n if (!nodeAtPosition) {\n return null;\n }\n const leadingWhiteSpaces = getLeadingWhiteSpaces(nodeAtPosition);\n const lastIndexOfSequence = leadingWhiteSpaces.lastIndexOf(sequence);\n // For instance, assuming the indent sequence is 4x space (\" \"):\n //\n //\t\t<codeBlock> \t^foo</codeBlock> -> null\n //\n if (lastIndexOfSequence + sequence.length !== leadingWhiteSpaces.length) {\n return null;\n }\n // For instance, assuming the indent sequence is 4x space (\" \"):\n //\n //\t\t<codeBlock> ^foo</codeBlock> -> null\n //\n if (lastIndexOfSequence === -1) {\n return null;\n }\n const { parent, startOffset } = nodeAtPosition;\n // Create a range that contains the **last** indent sequence among the leading whitespaces\n // of the line.\n //\n // For instance, assuming the indent sequence is 4x space (\" \"):\n //\n //\t\t<codeBlock> ^foo</codeBlock> -> <codeBlock> [ ]foo</codeBlock>\n //\n return model.createRange(model.createPositionAt(parent, startOffset + lastIndexOfSequence), model.createPositionAt(parent, startOffset + lastIndexOfSequence + sequence.length));\n}\nfunction getCodeLineTextNodeAtPosition(position) {\n // Positions start before each text node (code line). Get the node corresponding to the position.\n let nodeAtPosition = position.parent.getChild(position.index);\n // <codeBlock>foo^</codeBlock>\n // <codeBlock>foo^<softBreak></softBreak>bar</codeBlock>\n if (!nodeAtPosition || nodeAtPosition.is('element', 'softBreak')) {\n nodeAtPosition = position.nodeBefore;\n }\n // <codeBlock>^</codeBlock>\n // <codeBlock>foo^<softBreak></softBreak>bar</codeBlock>\n if (!nodeAtPosition || nodeAtPosition.is('element', 'softBreak')) {\n return null;\n }\n return nodeAtPosition;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { getPropertyAssociation } from './utils';\n/**\n * A model-to-view (both editing and data) converter for the `codeBlock` element.\n *\n * Sample input:\n *\n * ```html\n * <codeBlock language=\"javascript\">foo();<softBreak></softBreak>bar();</codeBlock>\n * ```\n *\n * Sample output (editing):\n *\n * ```html\n * <pre data-language=\"JavaScript\"><code class=\"language-javascript\">foo();<br />bar();</code></pre>\n * ```\n *\n * Sample output (data, see {@link module:code-block/converters~modelToDataViewSoftBreakInsertion}):\n *\n * ```html\n * <pre><code class=\"language-javascript\">foo();\\nbar();</code></pre>\n * ```\n *\n * @param languageDefs The normalized language configuration passed to the feature.\n * @param useLabels When `true`, the `<pre>` element will get a `data-language` attribute with a\n * humanreadable label of the language. Used only in the editing.\n * @returns Returns a conversion callback.\n */\nexport function modelToViewCodeBlockInsertion(model, languageDefs, useLabels = false) {\n // Language CSS classes:\n //\n //\t\t{\n //\t\t\tphp: 'language-php',\n //\t\t\tpython: 'language-python',\n //\t\t\tjavascript: 'js',\n //\t\t\t...\n //\t\t}\n const languagesToClasses = getPropertyAssociation(languageDefs, 'language', 'class');\n // Language labels:\n //\n //\t\t{\n //\t\t\tphp: 'PHP',\n //\t\t\tpython: 'Python',\n //\t\t\tjavascript: 'JavaScript',\n //\t\t\t...\n //\t\t}\n const languagesToLabels = getPropertyAssociation(languageDefs, 'language', 'label');\n return (evt, data, conversionApi) => {\n const { writer, mapper, consumable } = conversionApi;\n if (!consumable.consume(data.item, 'insert')) {\n return;\n }\n const codeBlockLanguage = data.item.getAttribute('language');\n const targetViewPosition = mapper.toViewPosition(model.createPositionBefore(data.item));\n const preAttributes = {};\n // Attributes added only in the editing view.\n if (useLabels) {\n preAttributes['data-language'] = languagesToLabels[codeBlockLanguage];\n preAttributes.spellcheck = 'false';\n }\n const codeAttributes = languagesToClasses[codeBlockLanguage] ? {\n class: languagesToClasses[codeBlockLanguage]\n } : undefined;\n const code = writer.createContainerElement('code', codeAttributes);\n const pre = writer.createContainerElement('pre', preAttributes, code);\n writer.insert(targetViewPosition, pre);\n mapper.bindElements(data.item, code);\n };\n}\n/**\n * A model-to-data view converter for the new line (`softBreak`) separator.\n *\n * Sample input:\n *\n * ```html\n * <codeBlock ...>foo();<softBreak></softBreak>bar();</codeBlock>\n * ```\n *\n * Sample output:\n *\n * ```html\n * <pre><code ...>foo();\\nbar();</code></pre>\n * ```\n *\n * @returns Returns a conversion callback.\n */\nexport function modelToDataViewSoftBreakInsertion(model) {\n return (evt, data, conversionApi) => {\n if (data.item.parent.name !== 'codeBlock') {\n return;\n }\n const { writer, mapper, consumable } = conversionApi;\n if (!consumable.consume(data.item, 'insert')) {\n return;\n }\n const position = mapper.toViewPosition(model.createPositionBefore(data.item));\n writer.insert(position, writer.createText('\\n'));\n };\n}\n/**\n * A view-to-model converter for `<pre>` with the `<code>` HTML.\n *\n * Sample input:\n *\n * ```html\n * <pre><code class=\"language-javascript\">foo();bar();</code></pre>\n * ```\n *\n * Sample output:\n *\n * ```html\n * <codeBlock language=\"javascript\">foo();bar();</codeBlock>\n * ```\n *\n * @param languageDefs The normalized language configuration passed to the feature.\n * @returns Returns a conversion callback.\n */\nexport function dataViewToModelCodeBlockInsertion(editingView, languageDefs) {\n // Language names associated with CSS classes:\n //\n //\t\t{\n //\t\t\t'language-php': 'php',\n //\t\t\t'language-python': 'python',\n //\t\t\tjs: 'javascript',\n //\t\t\t...\n //\t\t}\n const classesToLanguages = getPropertyAssociation(languageDefs, 'class', 'language');\n const defaultLanguageName = languageDefs[0].language;\n return (evt, data, conversionApi) => {\n const viewCodeElement = data.viewItem;\n const viewPreElement = viewCodeElement.parent;\n if (!viewPreElement || !viewPreElement.is('element', 'pre')) {\n return;\n }\n // In case of nested code blocks we don't want to convert to another code block.\n if (data.modelCursor.findAncestor('codeBlock')) {\n return;\n }\n const { consumable, writer } = conversionApi;\n if (!consumable.test(viewCodeElement, { name: true })) {\n return;\n }\n const codeBlock = writer.createElement('codeBlock');\n const viewChildClasses = [...viewCodeElement.getClassNames()];\n // As we're to associate each class with a model language, a lack of class (empty class) can be\n // also associated with a language if the language definition was configured so. Pushing an empty\n // string to make sure the association will work.\n if (!viewChildClasses.length) {\n viewChildClasses.push('');\n }\n // Figure out if any of the <code> element's class names is a valid programming\n // language class. If so, use it on the model element (becomes the language of the entire block).\n for (const className of viewChildClasses) {\n const language = classesToLanguages[className];\n if (language) {\n writer.setAttribute('language', language, codeBlock);\n break;\n }\n }\n // If no language value was set, use the default language from the config.\n if (!codeBlock.hasAttribute('language')) {\n writer.setAttribute('language', defaultLanguageName, codeBlock);\n }\n conversionApi.convertChildren(viewCodeElement, codeBlock);\n // Let's try to insert code block.\n if (!conversionApi.safeInsert(codeBlock, data.modelCursor)) {\n return;\n }\n consumable.consume(viewCodeElement, { name: true });\n conversionApi.updateConversionResult(codeBlock, data);\n };\n}\n/**\n * A view-to-model converter for new line characters in `<pre>`.\n *\n * Sample input:\n *\n * ```html\n * <pre><code class=\"language-javascript\">foo();\\nbar();</code></pre>\n * ```\n *\n * Sample output:\n *\n * ```html\n * <codeBlock language=\"javascript\">foo();<softBreak></softBreak>bar();</codeBlock>\n * ```\n *\n * @returns {Function} Returns a conversion callback.\n */\nexport function dataViewToModelTextNewlinesInsertion() {\n return (evt, data, { consumable, writer }) => {\n let position = data.modelCursor;\n // When node is already converted then do nothing.\n if (!consumable.test(data.viewItem)) {\n return;\n }\n // When not inside `codeBlock` then do nothing.\n if (!position.findAncestor('codeBlock')) {\n return;\n }\n consumable.consume(data.viewItem);\n const text = data.viewItem.data;\n const textLines = text.split('\\n').map(data => writer.createText(data));\n const lastLine = textLines[textLines.length - 1];\n for (const node of textLines) {\n writer.insert(node, position);\n position = position.getShiftedBy(node.offsetSize);\n if (node !== lastLine) {\n const softBreak = writer.createElement('softBreak');\n writer.insert(softBreak, position);\n position = writer.createPositionAfter(softBreak);\n }\n }\n data.modelRange = writer.createRange(data.modelCursor, position);\n data.modelCursor = position;\n };\n}\n/**\n * A view-to-model converter that handles orphan text nodes (white spaces, new lines, etc.)\n * that surround `<code>` inside `<pre>`.\n *\n * Sample input:\n *\n * ```html\n * // White spaces\n * <pre> <code>foo()</code> </pre>\n *\n * // White spaces\n * <pre> <code>foo()</code> </pre>\n *\n * // White spaces\n * <pre>\t\t\t<code>foo()</code>\t\t\t</pre>\n *\n * // New lines\n * <pre>\n * \t<code>foo()</code>\n * </pre>\n *\n * // Redundant text\n * <pre>ABC<code>foo()</code>DEF</pre>\n * ```\n *\n * Unified output for each case:\n *\n * ```html\n * <codeBlock language=\"plaintext\">foo()</codeBlock>\n * ```\n *\n * @returns Returns a conversion callback.\n */\nexport function dataViewToModelOrphanNodeConsumer() {\n return (evt, data, { consumable }) => {\n const preElement = data.viewItem;\n // Don't clean up nested pre elements. Their content should stay as it is, they are not upcasted\n // to code blocks.\n if (preElement.findAncestor('pre')) {\n return;\n }\n const preChildren = Array.from(preElement.getChildren());\n const childCodeElement = preChildren.find(node => node.is('element', 'code'));\n // <code>-less <pre>. It will not upcast to code block in the model, skipping.\n if (!childCodeElement) {\n return;\n }\n for (const child of preChildren) {\n if (child === childCodeElement || !child.is('$text')) {\n continue;\n }\n // Consuming the orphan to remove it from the input data.\n // Second argument in `consumable.consume` is discarded for text nodes.\n consumable.consume(child, { name: true });\n }\n };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module code-block/codeblockediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ShiftEnter } from 'ckeditor5/src/enter';\nimport { UpcastWriter } from 'ckeditor5/src/engine';\nimport CodeBlockCommand from './codeblockcommand';\nimport IndentCodeBlockCommand from './indentcodeblockcommand';\nimport OutdentCodeBlockCommand from './outdentcodeblockcommand';\nimport { getNormalizedAndLocalizedLanguageDefinitions, getLeadingWhiteSpaces, rawSnippetTextToViewDocumentFragment } from './utils';\nimport { modelToViewCodeBlockInsertion, modelToDataViewSoftBreakInsertion, dataViewToModelCodeBlockInsertion, dataViewToModelTextNewlinesInsertion, dataViewToModelOrphanNodeConsumer } from './converters';\nconst DEFAULT_ELEMENT = 'paragraph';\n/**\n * The editing part of the code block feature.\n *\n * Introduces the `'codeBlock'` command and the `'codeBlock'` model element.\n */\nexport default class CodeBlockEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'CodeBlockEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ShiftEnter];\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n editor.config.define('codeBlock', {\n languages: [\n { language: 'plaintext', label: 'Plain text' },\n { language: 'c', label: 'C' },\n { language: 'cs', label: 'C#' },\n { language: 'cpp', label: 'C++' },\n { language: 'css', label: 'CSS' },\n { language: 'diff', label: 'Diff' },\n { language: 'html', label: 'HTML' },\n { language: 'java', label: 'Java' },\n { language: 'javascript', label: 'JavaScript' },\n { language: 'php', label: 'PHP' },\n { language: 'python', label: 'Python' },\n { language: 'ruby', label: 'Ruby' },\n { language: 'typescript', label: 'TypeScript' },\n { language: 'xml', label: 'XML' }\n ],\n // A single tab.\n indentSequence: '\\t'\n });\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n const model = editor.model;\n const view = editor.editing.view;\n const isDocumentListEditingLoaded = editor.plugins.has('DocumentListEditing');\n const normalizedLanguagesDefs = getNormalizedAndLocalizedLanguageDefinitions(editor);\n // The main command.\n editor.commands.add('codeBlock', new CodeBlockCommand(editor));\n // Commands that change the indentation.\n editor.commands.add('indentCodeBlock', new IndentCodeBlockCommand(editor));\n editor.commands.add('outdentCodeBlock', new OutdentCodeBlockCommand(editor));\n this.listenTo(view.document, 'tab', (evt, data) => {\n const commandName = data.shiftKey ? 'outdentCodeBlock' : 'indentCodeBlock';\n const command = editor.commands.get(commandName);\n if (!command.isEnabled) {\n return;\n }\n editor.execute(commandName);\n data.stopPropagation();\n data.preventDefault();\n evt.stop();\n }, { context: 'pre' });\n schema.register('codeBlock', {\n allowWhere: '$block',\n allowChildren: '$text',\n isBlock: true,\n allowAttributes: ['language']\n });\n // Allow all list* attributes on `codeBlock` (integration with DocumentList).\n // Disallow all attributes on $text inside `codeBlock`.\n schema.addAttributeCheck((context, attributeName) => {\n const isDocumentListAttributeOnCodeBlock = context.endsWith('codeBlock') &&\n attributeName.startsWith('list') &&\n attributeName !== 'list';\n if (isDocumentListEditingLoaded && isDocumentListAttributeOnCodeBlock) {\n return true;\n }\n if (context.endsWith('codeBlock $text')) {\n return false;\n }\n });\n // Disallow object elements inside `codeBlock`. See #9567.\n editor.model.schema.addChildCheck((context, childDefinition) => {\n if (context.endsWith('codeBlock') && childDefinition.isObject) {\n return false;\n }\n });\n // Conversion.\n editor.editing.downcastDispatcher.on('insert:codeBlock', modelToViewCodeBlockInsertion(model, normalizedLanguagesDefs, true));\n editor.data.downcastDispatcher.on('insert:codeBlock', modelToViewCodeBlockInsertion(model, normalizedLanguagesDefs));\n editor.data.downcastDispatcher.on('insert:softBreak', modelToDataViewSoftBreakInsertion(model), { priority: 'high' });\n editor.data.upcastDispatcher.on('element:code', dataViewToModelCodeBlockInsertion(view, normalizedLanguagesDefs));\n editor.data.upcastDispatcher.on('text', dataViewToModelTextNewlinesInsertion());\n editor.data.upcastDispatcher.on('element:pre', dataViewToModelOrphanNodeConsumer(), { priority: 'high' });\n // Intercept the clipboard input (paste) when the selection is anchored in the code block and force the clipboard\n // data to be pasted as a single plain text. Otherwise, the code lines will split the code block and\n // \"spill out\" as separate paragraphs.\n this.listenTo(editor.editing.view.document, 'clipboardInput', (evt, data) => {\n let insertionRange = model.createRange(model.document.selection.anchor);\n // Use target ranges in case this is a drop.\n if (data.targetRanges) {\n insertionRange = editor.editing.mapper.toModelRange(data.targetRanges[0]);\n }\n if (!insertionRange.start.parent.is('element', 'codeBlock')) {\n return;\n }\n const text = data.dataTransfer.getData('text/plain');\n const writer = new UpcastWriter(editor.editing.view.document);\n // Pass the view fragment to the default clipboardInput handler.\n data.content = rawSnippetTextToViewDocumentFragment(writer, text);\n });\n // Make sure multiline selection is always wrapped in a code block when `getSelectedContent()`\n // is used (e.g. clipboard copy). Otherwise, only the raw text will be copied to the clipboard and,\n // upon next paste, this bare text will not be inserted as a code block, which is not the best UX.\n // Similarly, when the selection in a single line, the selected content should be an inline code\n // so it can be pasted later on and retain it's preformatted nature.\n this.listenTo(model, 'getSelectedContent', (evt, [selection]) => {\n const anchor = selection.anchor;\n if (selection.isCollapsed || !anchor.parent.is('element', 'codeBlock') || !anchor.hasSameParentAs(selection.focus)) {\n return;\n }\n model.change(writer => {\n const docFragment = evt.return;\n // fo[o<softBreak></softBreak>b]ar -> <codeBlock language=\"...\">[o<softBreak></softBreak>b]<codeBlock>\n if (anchor.parent.is('element') &&\n (docFragment.childCount > 1 || selection.containsEntireContent(anchor.parent))) {\n const codeBlock = writer.createElement('codeBlock', anchor.parent.getAttributes());\n writer.append(docFragment, codeBlock);\n const newDocumentFragment = writer.createDocumentFragment();\n writer.append(codeBlock, newDocumentFragment);\n evt.return = newDocumentFragment;\n return;\n }\n // \"f[oo]\" -> <$text code=\"true\">oo</text>\n const textNode = docFragment.getChild(0);\n if (schema.checkAttribute(textNode, 'code')) {\n writer.setAttribute('code', true, textNode);\n }\n });\n });\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n const editor = this.editor;\n const commands = editor.commands;\n const indent = commands.get('indent');\n const outdent = commands.get('outdent');\n if (indent) {\n // Priority is highest due to integration with `IndentList` command of `List` plugin.\n // If selection is in a code block we give priority to it. This way list item cannot be indented\n // but if we would give priority to indenting list item then user would have to indent list item\n // as much as possible and only then he could indent code block.\n indent.registerChildCommand(commands.get('indentCodeBlock'), { priority: 'highest' });\n }\n if (outdent) {\n outdent.registerChildCommand(commands.get('outdentCodeBlock'));\n }\n // Customize the response to the <kbd>Enter</kbd> and <kbd>Shift</kbd>+<kbd>Enter</kbd>\n // key press when the selection is in the code block. Upon enter key press we can either\n // leave the block if it's \"two or three enters\" in a row or create a new code block line, preserving\n // previous line's indentation.\n this.listenTo(editor.editing.view.document, 'enter', (evt, data) => {\n const positionParent = editor.model.document.selection.getLastPosition().parent;\n if (!positionParent.is('element', 'codeBlock')) {\n return;\n }\n if (!leaveBlockStartOnEnter(editor, data.isSoft) && !leaveBlockEndOnEnter(editor, data.isSoft)) {\n breakLineOnEnter(editor);\n }\n data.preventDefault();\n evt.stop();\n }, { context: 'pre' });\n }\n}\n/**\n * Normally, when the Enter (or Shift+Enter) key is pressed, a soft line break is to be added to the\n * code block. Let's try to follow the indentation of the previous line when possible, for instance:\n *\n * ```html\n * // Before pressing enter (or shift enter)\n * <codeBlock>\n * \" foo()\"[] // Indent of 4 spaces.\n * </codeBlock>\n *\n * // After pressing:\n * <codeBlock>\n * \" foo()\" // Indent of 4 spaces.\n * <softBreak></softBreak> // A new soft break created by pressing enter.\n * \" \"[] // Retain the indent of 4 spaces.\n * </codeBlock>\n * ```\n */\nfunction breakLineOnEnter(editor) {\n const model = editor.model;\n const modelDoc = model.document;\n const lastSelectionPosition = modelDoc.selection.getLastPosition();\n const node = lastSelectionPosition.nodeBefore || lastSelectionPosition.textNode;\n let leadingWhiteSpaces;\n // Figure out the indentation (white space chars) at the beginning of the line.\n if (node && node.is('$text')) {\n leadingWhiteSpaces = getLeadingWhiteSpaces(node);\n }\n // Keeping everything in a change block for a single undo step.\n editor.model.change(writer => {\n editor.execute('shiftEnter');\n // If the line before being broken in two had some indentation, let's retain it\n // in the new line.\n if (leadingWhiteSpaces) {\n writer.insertText(leadingWhiteSpaces, modelDoc.selection.anchor);\n }\n });\n}\n/**\n * Leave the code block when Enter (but NOT Shift+Enter) has been pressed twice at the beginning\n * of the code block:\n *\n * ```html\n * // Before:\n * <codeBlock>[]<softBreak></softBreak>foo</codeBlock>\n *\n * // After pressing:\n * <paragraph>[]</paragraph><codeBlock>foo</codeBlock>\n * ```\n *\n * @param isSoftEnter When `true`, enter was pressed along with <kbd>Shift</kbd>.\n * @returns `true` when selection left the block. `false` if stayed.\n */\nfunction leaveBlockStartOnEnter(editor, isSoftEnter) {\n const model = editor.model;\n const modelDoc = model.document;\n const view = editor.editing.view;\n const lastSelectionPosition = modelDoc.selection.getLastPosition();\n const nodeAfter = lastSelectionPosition.nodeAfter;\n if (isSoftEnter || !modelDoc.selection.isCollapsed || !lastSelectionPosition.isAtStart) {\n return false;\n }\n if (!isSoftBreakNode(nodeAfter)) {\n return false;\n }\n // We're doing everything in a single change block to have a single undo step.\n editor.model.change(writer => {\n // \"Clone\" the <codeBlock> in the standard way.\n editor.execute('enter');\n // The cloned block exists now before the original code block.\n const newBlock = modelDoc.selection.anchor.parent.previousSibling;\n // Make the cloned <codeBlock> a regular <paragraph> (with clean attributes, so no language).\n writer.rename(newBlock, DEFAULT_ELEMENT);\n writer.setSelection(newBlock, 'in');\n editor.model.schema.removeDisallowedAttributes([newBlock], writer);\n // Remove the <softBreak> that originally followed the selection position.\n writer.remove(nodeAfter);\n });\n // Eye candy.\n view.scrollToTheSelection();\n return true;\n}\n/**\n * Leave the code block when Enter (but NOT Shift+Enter) has been pressed twice at the end\n * of the code block:\n *\n * ```html\n * // Before:\n * <codeBlock>foo[]</codeBlock>\n *\n * // After first press:\n * <codeBlock>foo<softBreak></softBreak>[]</codeBlock>\n *\n * // After second press:\n * <codeBlock>foo</codeBlock><paragraph>[]</paragraph>\n * ```\n *\n * @param isSoftEnter When `true`, enter was pressed along with <kbd>Shift</kbd>.\n * @returns `true` when selection left the block. `false` if stayed.\n */\nfunction leaveBlockEndOnEnter(editor, isSoftEnter) {\n const model = editor.model;\n const modelDoc = model.document;\n const view = editor.editing.view;\n const lastSelectionPosition = modelDoc.selection.getLastPosition();\n const nodeBefore = lastSelectionPosition.nodeBefore;\n let emptyLineRangeToRemoveOnEnter;\n if (isSoftEnter || !modelDoc.selection.isCollapsed || !lastSelectionPosition.isAtEnd || !nodeBefore || !nodeBefore.previousSibling) {\n return false;\n }\n // When the position is directly preceded by two soft breaks\n //\n //\t\t<codeBlock>foo<softBreak></softBreak><softBreak></softBreak>[]</codeBlock>\n //\n // it creates the following range that will be cleaned up before leaving:\n //\n //\t\t<codeBlock>foo[<softBreak></softBreak><softBreak></softBreak>]</codeBlock>\n //\n if (isSoftBreakNode(nodeBefore) && isSoftBreakNode(nodeBefore.previousSibling)) {\n emptyLineRangeToRemoveOnEnter = model.createRange(model.createPositionBefore(nodeBefore.previousSibling), model.createPositionAfter(nodeBefore));\n }\n // When there's some text before the position that is\n // preceded by two soft breaks and made purely of whitespace characters\n //\n //\t\t<codeBlock>foo<softBreak></softBreak><softBreak></softBreak> []</codeBlock>\n //\n // it creates the following range to clean up before leaving:\n //\n //\t\t<codeBlock>foo[<softBreak></softBreak><softBreak></softBreak> ]</codeBlock>\n //\n else if (isEmptyishTextNode(nodeBefore) &&\n isSoftBreakNode(nodeBefore.previousSibling) &&\n isSoftBreakNode(nodeBefore.previousSibling.previousSibling)) {\n emptyLineRangeToRemoveOnEnter = model.createRange(model.createPositionBefore(nodeBefore.previousSibling.previousSibling), model.createPositionAfter(nodeBefore));\n }\n // When there's some text before the position that is made purely of whitespace characters\n // and is preceded by some other text made purely of whitespace characters\n //\n //\t\t<codeBlock>foo<softBreak></softBreak> <softBreak></softBreak> []</codeBlock>\n //\n // it creates the following range to clean up before leaving:\n //\n //\t\t<codeBlock>foo[<softBreak></softBreak> <softBreak></softBreak> ]</codeBlock>\n //\n else if (isEmptyishTextNode(nodeBefore) &&\n isSoftBreakNode(nodeBefore.previousSibling) &&\n isEmptyishTextNode(nodeBefore.previousSibling.previousSibling) &&\n nodeBefore.previousSibling.previousSibling &&\n isSoftBreakNode(nodeBefore.previousSibling.previousSibling.previousSibling)) {\n emptyLineRangeToRemoveOnEnter = model.createRange(model.createPositionBefore(nodeBefore.previousSibling.previousSibling.previousSibling), model.createPositionAfter(nodeBefore));\n }\n // Not leaving the block in the following cases:\n //\n //\t\t<codeBlock> []</codeBlock>\n //\t\t<codeBlock> a []</codeBlock>\n //\t\t<codeBlock>foo<softBreak></softBreak>[]</codeBlock>\n //\t\t<codeBlock>foo<softBreak></softBreak><softBreak></softBreak>bar[]</codeBlock>\n //\t\t<codeBlock>foo<softBreak></softBreak><softBreak></softBreak> a []</codeBlock>\n //\n else {\n return false;\n }\n // We're doing everything in a single change block to have a single undo step.\n editor.model.change(writer => {\n // Remove the last <softBreak>s and all white space characters that followed them.\n writer.remove(emptyLineRangeToRemoveOnEnter);\n // \"Clone\" the <codeBlock> in the standard way.\n editor.execute('enter');\n const newBlock = modelDoc.selection.anchor.parent;\n // Make the cloned <codeBlock> a regular <paragraph> (with clean attributes, so no language).\n writer.rename(newBlock, DEFAULT_ELEMENT);\n editor.model.schema.removeDisallowedAttributes([newBlock], writer);\n });\n // Eye candy.\n view.scrollToTheSelection();\n return true;\n}\nfunction isEmptyishTextNode(node) {\n return node && node.is('$text') && !node.data.match(/\\S/);\n}\nfunction isSoftBreakNode(node) {\n return node && node.is('element', 'softBreak');\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./codeblock.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module code-block/codeblockui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Collection } from 'ckeditor5/src/utils';\nimport { Model, SplitButtonView, createDropdown, addListToDropdown } from 'ckeditor5/src/ui';\nimport { getNormalizedAndLocalizedLanguageDefinitions } from './utils';\nimport codeBlockIcon from '../theme/icons/codeblock.svg';\nimport '../theme/codeblock.css';\n/**\n * The code block UI plugin.\n *\n * Introduces the `'codeBlock'` dropdown.\n */\nexport default class CodeBlockUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'CodeBlockUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n const componentFactory = editor.ui.componentFactory;\n const normalizedLanguageDefs = getNormalizedAndLocalizedLanguageDefinitions(editor);\n componentFactory.add('codeBlock', locale => {\n const command = editor.commands.get('codeBlock');\n const dropdownView = createDropdown(locale, SplitButtonView);\n const splitButtonView = dropdownView.buttonView;\n const accessibleLabel = t('Insert code block');\n splitButtonView.set({\n label: accessibleLabel,\n tooltip: true,\n icon: codeBlockIcon,\n isToggleable: true\n });\n splitButtonView.bind('isOn').to(command, 'value', value => !!value);\n splitButtonView.on('execute', () => {\n editor.execute('codeBlock', {\n usePreviousLanguageChoice: true\n });\n editor.editing.view.focus();\n });\n dropdownView.on('execute', evt => {\n editor.execute('codeBlock', {\n language: evt.source._codeBlockLanguage,\n forceValue: true\n });\n editor.editing.view.focus();\n });\n dropdownView.class = 'ck-code-block-dropdown';\n dropdownView.bind('isEnabled').to(command);\n addListToDropdown(dropdownView, () => this._getLanguageListItemDefinitions(normalizedLanguageDefs), {\n role: 'menu',\n ariaLabel: accessibleLabel\n });\n return dropdownView;\n });\n }\n /**\n * A helper returning a collection of the `codeBlock` dropdown items representing languages\n * available for the user to choose from.\n */\n _getLanguageListItemDefinitions(normalizedLanguageDefs) {\n const editor = this.editor;\n const command = editor.commands.get('codeBlock');\n const itemDefinitions = new Collection();\n for (const languageDef of normalizedLanguageDefs) {\n const definition = {\n type: 'button',\n model: new Model({\n _codeBlockLanguage: languageDef.language,\n label: languageDef.label,\n role: 'menuitemradio',\n withText: true\n })\n };\n definition.model.bind('isOn').to(command, 'value', value => {\n return value === definition.model._codeBlockLanguage;\n });\n itemDefinitions.add(definition);\n }\n return itemDefinitions;\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M12.87 12.61a.75.75 0 0 1-.089.976l-.085.07-3.154 2.254 3.412 2.414a.75.75 0 0 1 .237.95l-.057.095a.75.75 0 0 1-.95.237l-.096-.058-4.272-3.022-.003-1.223 4.01-2.867a.75.75 0 0 1 1.047.174zm2.795-.231.095.057 4.011 2.867-.003 1.223-4.272 3.022-.095.058a.75.75 0 0 1-.88-.151l-.07-.086-.058-.095a.75.75 0 0 1 .15-.88l.087-.07 3.412-2.414-3.154-2.253-.085-.071a.75.75 0 0 1 .862-1.207zM16 0a2 2 0 0 1 2 2v9.354l-.663-.492-.837-.001V2a.5.5 0 0 0-.5-.5H2a.5.5 0 0 0-.5.5v15a.5.5 0 0 0 .5.5h3.118L7.156 19H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h14zM5.009 15l.003 1H3v-1h2.009zm2.188-2-1.471 1H5v-1h2.197zM10 11v.095L8.668 12H7v-1h3zm4-2v1H7V9h7zm0-2v1H7V7h7zm-4-2v1H5V5h5zM6 3v1H3V3h3z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { cloneDeep } from 'lodash-es';\n/**\n* Helper function for the downcast converter. Updates attributes on the given view element.\n*\n* @param writer The view writer.\n* @param oldViewAttributes The previous GHS attribute value.\n* @param newViewAttributes The current GHS attribute value.\n* @param viewElement The view element to update.\n*/\nexport function updateViewAttributes(writer, oldViewAttributes, newViewAttributes, viewElement) {\n if (oldViewAttributes) {\n removeViewAttributes(writer, oldViewAttributes, viewElement);\n }\n if (newViewAttributes) {\n setViewAttributes(writer, newViewAttributes, viewElement);\n }\n}\n/**\n * Helper function for the downcast converter. Sets attributes on the given view element.\n *\n * @param writer The view writer.\n * @param viewAttributes The GHS attribute value.\n * @param viewElement The view element to update.\n */\nexport function setViewAttributes(writer, viewAttributes, viewElement) {\n if (viewAttributes.attributes) {\n for (const [key, value] of Object.entries(viewAttributes.attributes)) {\n writer.setAttribute(key, value, viewElement);\n }\n }\n if (viewAttributes.styles) {\n writer.setStyle(viewAttributes.styles, viewElement);\n }\n if (viewAttributes.classes) {\n writer.addClass(viewAttributes.classes, viewElement);\n }\n}\n/**\n * Helper function for the downcast converter. Removes attributes on the given view element.\n *\n * @param writer The view writer.\n * @param viewAttributes The GHS attribute value.\n * @param viewElement The view element to update.\n */\nexport function removeViewAttributes(writer, viewAttributes, viewElement) {\n if (viewAttributes.attributes) {\n for (const [key] of Object.entries(viewAttributes.attributes)) {\n writer.removeAttribute(key, viewElement);\n }\n }\n if (viewAttributes.styles) {\n for (const style of Object.keys(viewAttributes.styles)) {\n writer.removeStyle(style, viewElement);\n }\n }\n if (viewAttributes.classes) {\n writer.removeClass(viewAttributes.classes, viewElement);\n }\n}\n/**\n* Merges view element attribute objects.\n*/\nexport function mergeViewElementAttributes(target, source) {\n const result = cloneDeep(target);\n let key = 'attributes';\n for (key in source) {\n // Merge classes.\n if (key == 'classes') {\n result[key] = Array.from(new Set([...(target[key] || []), ...source[key]]));\n }\n // Merge attributes or styles.\n else {\n result[key] = { ...target[key], ...source[key] };\n }\n }\n return result;\n}\nexport function modifyGhsAttribute(writer, item, ghsAttributeName, subject, callback) {\n const oldValue = item.getAttribute(ghsAttributeName);\n const newValue = {};\n for (const kind of ['attributes', 'styles', 'classes']) {\n // Properties other than `subject` should be assigned from `oldValue`.\n if (kind != subject) {\n if (oldValue && oldValue[kind]) {\n newValue[kind] = oldValue[kind];\n }\n continue;\n }\n // `callback` should be applied on property [`subject`].\n if (subject == 'classes') {\n const values = new Set(oldValue && oldValue.classes || []);\n callback(values);\n if (values.size) {\n newValue[kind] = Array.from(values);\n }\n continue;\n }\n const values = new Map(Object.entries(oldValue && oldValue[kind] || {}));\n callback(values);\n if (values.size) {\n newValue[kind] = Object.fromEntries(values);\n }\n }\n if (Object.keys(newValue).length) {\n if (item.is('documentSelection')) {\n writer.setSelectionAttribute(ghsAttributeName, newValue);\n }\n else {\n writer.setAttribute(ghsAttributeName, newValue, item);\n }\n }\n else if (oldValue) {\n if (item.is('documentSelection')) {\n writer.removeSelectionAttribute(ghsAttributeName);\n }\n else {\n writer.removeAttribute(ghsAttributeName, item);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { toWidget } from 'ckeditor5/src/widget';\nimport { setViewAttributes, mergeViewElementAttributes, updateViewAttributes } from './utils';\n/**\n * View-to-model conversion helper for object elements.\n *\n * Preserves object element content in `htmlContent` attribute.\n *\n * @returns Returns a conversion callback.\n*/\nexport function viewToModelObjectConverter({ model: modelName }) {\n return (viewElement, conversionApi) => {\n // Let's keep element HTML and its attributes, so we can rebuild element in downcast conversions.\n return conversionApi.writer.createElement(modelName, {\n htmlContent: viewElement.getCustomProperty('$rawContent')\n });\n };\n}\n/**\n * Conversion helper converting an object element to an HTML object widget.\n *\n * @returns Returns a conversion callback.\n*/\nexport function toObjectWidgetConverter(editor, { view: viewName, isInline }) {\n const t = editor.t;\n return (modelElement, { writer }) => {\n const widgetLabel = t('HTML object');\n const viewElement = createObjectView(viewName, modelElement, writer);\n const viewAttributes = modelElement.getAttribute('htmlAttributes');\n writer.addClass('html-object-embed__content', viewElement);\n if (viewAttributes) {\n setViewAttributes(writer, viewAttributes, viewElement);\n }\n // Widget cannot be a raw element because the widget system would not be able\n // to add its UI to it. Thus, we need separate view container.\n const viewContainer = writer.createContainerElement(isInline ? 'span' : 'div', {\n class: 'html-object-embed',\n 'data-html-object-embed-label': widgetLabel\n }, viewElement);\n return toWidget(viewContainer, writer, { label: widgetLabel });\n };\n}\n/**\n* Creates object view element from the given model element.\n*/\nexport function createObjectView(viewName, modelElement, writer) {\n return writer.createRawElement(viewName, null, (domElement, domConverter) => {\n domConverter.setContentOf(domElement, modelElement.getAttribute('htmlContent'));\n });\n}\n/**\n * View-to-attribute conversion helper preserving inline element attributes on `$text`.\n *\n * @returns Returns a conversion callback.\n*/\nexport function viewToAttributeInlineConverter({ view: viewName, model: attributeKey }, dataFilter) {\n return (dispatcher) => {\n dispatcher.on(`element:${viewName}`, (evt, data, conversionApi) => {\n let viewAttributes = dataFilter.processViewAttributes(data.viewItem, conversionApi);\n // Do not apply the attribute if the element itself is already consumed and there are no view attributes to store.\n if (!viewAttributes && !conversionApi.consumable.test(data.viewItem, { name: true })) {\n return;\n }\n // Otherwise, we might need to convert it to an empty object just to preserve element itself,\n // for example `<cite>` => <$text htmlCite=\"{}\">.\n viewAttributes = viewAttributes || {};\n // Consume the element itself if it wasn't consumed by any other converter.\n conversionApi.consumable.consume(data.viewItem, { name: true });\n // Since we are converting to attribute we need a range on which we will set the attribute.\n // If the range is not created yet, we will create it.\n if (!data.modelRange) {\n data = Object.assign(data, conversionApi.convertChildren(data.viewItem, data.modelCursor));\n }\n // Set attribute on each item in range according to the schema.\n for (const node of data.modelRange.getItems()) {\n if (conversionApi.schema.checkAttribute(node, attributeKey)) {\n // Node's children are converted recursively, so node can already include model attribute.\n // We want to extend it, not replace.\n const nodeAttributes = node.getAttribute(attributeKey);\n const attributesToAdd = mergeViewElementAttributes(viewAttributes, nodeAttributes || {});\n conversionApi.writer.setAttribute(attributeKey, attributesToAdd, node);\n }\n }\n }, { priority: 'low' });\n };\n}\n/**\n * Attribute-to-view conversion helper applying attributes to view element preserved on `$text`.\n *\n * @returns Returns a conversion callback.\n*/\nexport function attributeToViewInlineConverter({ priority, view: viewName }) {\n return (attributeValue, conversionApi) => {\n if (!attributeValue) {\n return;\n }\n const { writer } = conversionApi;\n const viewElement = writer.createAttributeElement(viewName, null, { priority });\n setViewAttributes(writer, attributeValue, viewElement);\n return viewElement;\n };\n}\n/**\n * View-to-model conversion helper preserving allowed attributes on block element.\n *\n * All matched attributes will be preserved on `htmlAttributes` attribute.\n *\n * @returns Returns a conversion callback.\n*/\nexport function viewToModelBlockAttributeConverter({ view: viewName }, dataFilter) {\n return (dispatcher) => {\n dispatcher.on(`element:${viewName}`, (evt, data, conversionApi) => {\n // Converting an attribute of an element that has not been converted to anything does not make sense\n // because there will be nowhere to set that attribute on. At this stage, the element should've already\n // been converted. A collapsed range can show up in to-do lists (<input>) or complex widgets (e.g. table).\n // (https://github.com/ckeditor/ckeditor5/issues/11000).\n if (!data.modelRange || data.modelRange.isCollapsed) {\n return;\n }\n const viewAttributes = dataFilter.processViewAttributes(data.viewItem, conversionApi);\n if (viewAttributes) {\n conversionApi.writer.setAttribute('htmlAttributes', viewAttributes, data.modelRange);\n }\n }, { priority: 'low' });\n };\n}\n/**\n * Model-to-view conversion helper applying attributes preserved in `htmlAttributes` attribute\n * for block elements.\n *\n * @returns Returns a conversion callback.\n*/\nexport function modelToViewBlockAttributeConverter({ model: modelName }) {\n return (dispatcher) => {\n dispatcher.on(`attribute:htmlAttributes:${modelName}`, (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const { attributeOldValue, attributeNewValue } = data;\n const viewWriter = conversionApi.writer;\n const viewElement = conversionApi.mapper.toViewElement(data.item);\n updateViewAttributes(viewWriter, attributeOldValue, attributeNewValue, viewElement);\n });\n };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module html-support/schemadefinitions\n */\n// Skipped elements due to HTML deprecation:\n// * noframes (not sure if we should provide support for this element. CKE4 is not supporting frameset and frame,\n// but it will unpack <frameset><noframes>foobar</noframes></frameset> to <noframes>foobar</noframes>, so there\n// may be some content loss. Although using noframes as a standalone element seems invalid)\n// * keygen (this one is also empty)\n// * applet (support is limited mostly to old IE)\n// * basefont (this one is also empty)\n// * isindex (basically no support for modern browsers at all)\n//\n// Skipped elements due to lack empty element support:\n// * hr\n// * area\n// * br\n// * command\n// * map\n// * wbr\n// * colgroup -> col\n//\n// Skipped elements due to complexity:\n// * datalist with option elements used as a data source for input[list] element\n//\n// Skipped elements as they are handled as an object content:\n// * track\n// * source\n// * option\n// * param\n// * optgroup\n//\n// Skipped full page HTML elements:\n// * body\n// * html\n// * title\n// * head\n// * meta\n// * link\n// * etc...\n//\n// Skipped hidden elements:\n// noscript\nexport default {\n block: [\n // Existing features.\n {\n model: 'codeBlock',\n view: 'pre'\n },\n {\n model: 'paragraph',\n view: 'p'\n },\n {\n model: 'blockQuote',\n view: 'blockquote'\n },\n {\n model: 'listItem',\n view: 'li'\n },\n {\n model: 'pageBreak',\n view: 'div'\n },\n {\n model: 'rawHtml',\n view: 'div'\n },\n {\n model: 'table',\n view: 'table'\n },\n {\n model: 'tableRow',\n view: 'tr'\n },\n {\n model: 'tableCell',\n view: 'td'\n },\n {\n model: 'tableCell',\n view: 'th'\n },\n {\n model: 'tableColumnGroup',\n view: 'colgroup'\n },\n {\n model: 'tableColumn',\n view: 'col'\n },\n {\n model: 'caption',\n view: 'caption'\n },\n {\n model: 'caption',\n view: 'figcaption'\n },\n {\n model: 'imageBlock',\n view: 'img'\n },\n {\n model: 'imageInline',\n view: 'img'\n },\n // Compatibility features.\n {\n model: 'htmlP',\n view: 'p',\n modelSchema: {\n inheritAllFrom: '$block'\n }\n },\n {\n model: 'htmlBlockquote',\n view: 'blockquote',\n modelSchema: {\n inheritAllFrom: '$container'\n }\n },\n {\n model: 'htmlTable',\n view: 'table',\n modelSchema: {\n allowWhere: '$block',\n isBlock: true\n }\n },\n {\n model: 'htmlTbody',\n view: 'tbody',\n modelSchema: {\n allowIn: 'htmlTable',\n isBlock: false\n }\n },\n {\n model: 'htmlThead',\n view: 'thead',\n modelSchema: {\n allowIn: 'htmlTable',\n isBlock: false\n }\n },\n {\n model: 'htmlTfoot',\n view: 'tfoot',\n modelSchema: {\n allowIn: 'htmlTable',\n isBlock: false\n }\n },\n {\n model: 'htmlCaption',\n view: 'caption',\n modelSchema: {\n allowIn: 'htmlTable',\n allowChildren: '$text',\n isBlock: false\n }\n },\n {\n model: 'htmlColgroup',\n view: 'colgroup',\n modelSchema: {\n allowIn: 'htmlTable',\n allowChildren: 'col',\n isBlock: false\n }\n },\n {\n model: 'htmlCol',\n view: 'col',\n modelSchema: {\n allowIn: 'htmlColgroup',\n isBlock: false\n }\n },\n {\n model: 'htmlTr',\n view: 'tr',\n modelSchema: {\n allowIn: ['htmlTable', 'htmlThead', 'htmlTbody'],\n isLimit: true\n }\n },\n // TODO can also include text.\n {\n model: 'htmlTd',\n view: 'td',\n modelSchema: {\n allowIn: 'htmlTr',\n allowContentOf: '$container',\n isLimit: true,\n isBlock: false\n }\n },\n // TODO can also include text.\n {\n model: 'htmlTh',\n view: 'th',\n modelSchema: {\n allowIn: 'htmlTr',\n allowContentOf: '$container',\n isLimit: true,\n isBlock: false\n }\n },\n // TODO can also include text.\n {\n model: 'htmlFigure',\n view: 'figure',\n modelSchema: {\n inheritAllFrom: '$container',\n isBlock: false\n }\n },\n // TODO can also include other block elements.\n {\n model: 'htmlFigcaption',\n view: 'figcaption',\n modelSchema: {\n allowIn: 'htmlFigure',\n allowChildren: '$text',\n isBlock: false\n }\n },\n // TODO can also include text.\n {\n model: 'htmlAddress',\n view: 'address',\n modelSchema: {\n inheritAllFrom: '$container',\n isBlock: false\n }\n },\n // TODO can also include text.\n {\n model: 'htmlAside',\n view: 'aside',\n modelSchema: {\n inheritAllFrom: '$container',\n isBlock: false\n }\n },\n // TODO can also include text.\n {\n model: 'htmlMain',\n view: 'main',\n modelSchema: {\n inheritAllFrom: '$container',\n isBlock: false\n }\n },\n // TODO can also include text.\n {\n model: 'htmlDetails',\n view: 'details',\n modelSchema: {\n inheritAllFrom: '$container',\n isBlock: false\n }\n },\n {\n model: 'htmlSummary',\n view: 'summary',\n modelSchema: {\n allowChildren: '$text',\n allowIn: 'htmlDetails',\n isBlock: false\n }\n },\n {\n model: 'htmlDiv',\n view: 'div',\n paragraphLikeModel: 'htmlDivParagraph',\n modelSchema: {\n inheritAllFrom: '$container'\n }\n },\n // TODO can also include text.\n {\n model: 'htmlFieldset',\n view: 'fieldset',\n modelSchema: {\n inheritAllFrom: '$container',\n isBlock: false\n }\n },\n // TODO can also include h1-h6.\n {\n model: 'htmlLegend',\n view: 'legend',\n modelSchema: {\n allowIn: 'htmlFieldset',\n allowChildren: '$text'\n }\n },\n // TODO can also include text.\n {\n model: 'htmlHeader',\n view: 'header',\n modelSchema: {\n inheritAllFrom: '$container',\n isBlock: false\n }\n },\n // TODO can also include text.\n {\n model: 'htmlFooter',\n view: 'footer',\n modelSchema: {\n inheritAllFrom: '$container',\n isBlock: false\n }\n },\n // TODO can also include text.\n {\n model: 'htmlForm',\n view: 'form',\n modelSchema: {\n inheritAllFrom: '$container',\n isBlock: true\n }\n },\n {\n model: 'htmlHgroup',\n view: 'hgroup',\n modelSchema: {\n allowChildren: [\n 'htmlH1',\n 'htmlH2',\n 'htmlH3',\n 'htmlH4',\n 'htmlH5',\n 'htmlH6'\n ],\n isBlock: false\n }\n },\n {\n model: 'htmlH1',\n view: 'h1',\n modelSchema: {\n inheritAllFrom: '$block'\n }\n },\n {\n model: 'htmlH2',\n view: 'h2',\n modelSchema: {\n inheritAllFrom: '$block'\n }\n },\n {\n model: 'htmlH3',\n view: 'h3',\n modelSchema: {\n inheritAllFrom: '$block'\n }\n },\n {\n model: 'htmlH4',\n view: 'h4',\n modelSchema: {\n inheritAllFrom: '$block'\n }\n },\n {\n model: 'htmlH5',\n view: 'h5',\n modelSchema: {\n inheritAllFrom: '$block'\n }\n },\n {\n model: 'htmlH6',\n view: 'h6',\n modelSchema: {\n inheritAllFrom: '$block'\n }\n },\n {\n model: '$htmlList',\n modelSchema: {\n allowWhere: '$container',\n allowChildren: ['$htmlList', 'htmlLi'],\n isBlock: false\n }\n },\n {\n model: 'htmlDir',\n view: 'dir',\n modelSchema: {\n inheritAllFrom: '$htmlList'\n }\n },\n {\n model: 'htmlMenu',\n view: 'menu',\n modelSchema: {\n inheritAllFrom: '$htmlList'\n }\n },\n {\n model: 'htmlUl',\n view: 'ul',\n modelSchema: {\n inheritAllFrom: '$htmlList'\n }\n },\n {\n model: 'htmlOl',\n view: 'ol',\n modelSchema: {\n inheritAllFrom: '$htmlList'\n }\n },\n // TODO can also include other block elements.\n {\n model: 'htmlLi',\n view: 'li',\n modelSchema: {\n allowIn: '$htmlList',\n allowChildren: '$text',\n isBlock: false\n }\n },\n {\n model: 'htmlPre',\n view: 'pre',\n modelSchema: {\n inheritAllFrom: '$block'\n }\n },\n {\n model: 'htmlArticle',\n view: 'article',\n modelSchema: {\n inheritAllFrom: '$container',\n isBlock: false\n }\n },\n {\n model: 'htmlSection',\n view: 'section',\n modelSchema: {\n inheritAllFrom: '$container',\n isBlock: false\n }\n },\n // TODO can also include text.\n {\n model: 'htmlNav',\n view: 'nav',\n modelSchema: {\n inheritAllFrom: '$container',\n isBlock: false\n }\n },\n {\n model: 'htmlDivDl',\n view: 'div',\n modelSchema: {\n allowChildren: ['htmlDt', 'htmlDd'],\n allowIn: 'htmlDl'\n }\n },\n {\n model: 'htmlDl',\n view: 'dl',\n modelSchema: {\n allowWhere: '$container',\n allowChildren: ['htmlDt', 'htmlDd', 'htmlDivDl'],\n isBlock: false\n }\n },\n {\n model: 'htmlDt',\n view: 'dt',\n modelSchema: {\n allowChildren: '$block',\n isBlock: false\n }\n },\n {\n model: 'htmlDd',\n view: 'dd',\n modelSchema: {\n allowChildren: '$block',\n isBlock: false\n }\n },\n {\n model: 'htmlCenter',\n view: 'center',\n modelSchema: {\n inheritAllFrom: '$container',\n isBlock: false\n }\n }\n ],\n inline: [\n // Existing features (attribute set on an existing model element).\n {\n model: 'htmlLiAttributes',\n view: 'li',\n appliesToBlock: true\n },\n {\n model: 'htmlListAttributes',\n view: 'ol',\n appliesToBlock: true\n },\n {\n model: 'htmlListAttributes',\n view: 'ul',\n appliesToBlock: true\n },\n {\n model: 'htmlFigureAttributes',\n view: 'figure',\n appliesToBlock: 'table'\n },\n {\n model: 'htmlTheadAttributes',\n view: 'thead',\n appliesToBlock: 'table'\n },\n {\n model: 'htmlTbodyAttributes',\n view: 'tbody',\n appliesToBlock: 'table'\n },\n {\n model: 'htmlFigureAttributes',\n view: 'figure',\n appliesToBlock: 'imageBlock'\n },\n // Compatibility features.\n {\n model: 'htmlAcronym',\n view: 'acronym',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlTt',\n view: 'tt',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlFont',\n view: 'font',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlTime',\n view: 'time',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlVar',\n view: 'var',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlBig',\n view: 'big',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlSmall',\n view: 'small',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlSamp',\n view: 'samp',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlQ',\n view: 'q',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlOutput',\n view: 'output',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlKbd',\n view: 'kbd',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlBdi',\n view: 'bdi',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlBdo',\n view: 'bdo',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlAbbr',\n view: 'abbr',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlA',\n view: 'a',\n priority: 5,\n coupledAttribute: 'linkHref',\n attributeProperties: {\n copyOnEnter: true\n }\n },\n {\n model: 'htmlStrong',\n view: 'strong',\n coupledAttribute: 'bold',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlB',\n view: 'b',\n coupledAttribute: 'bold',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlI',\n view: 'i',\n coupledAttribute: 'italic',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlEm',\n view: 'em',\n coupledAttribute: 'italic',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlS',\n view: 's',\n coupledAttribute: 'strikethrough',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n // TODO According to HTML-spec can behave as div-like element, although CKE4 only handles it as an inline element.\n {\n model: 'htmlDel',\n view: 'del',\n coupledAttribute: 'strikethrough',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n // TODO According to HTML-spec can behave as div-like element, although CKE4 only handles it as an inline element.\n {\n model: 'htmlIns',\n view: 'ins',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlU',\n view: 'u',\n coupledAttribute: 'underline',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlSub',\n view: 'sub',\n coupledAttribute: 'subscript',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlSup',\n view: 'sup',\n coupledAttribute: 'superscript',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlCode',\n view: 'code',\n coupledAttribute: 'code',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlMark',\n view: 'mark',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlSpan',\n view: 'span',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlCite',\n view: 'cite',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlLabel',\n view: 'label',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n {\n model: 'htmlDfn',\n view: 'dfn',\n attributeProperties: {\n copyOnEnter: true,\n isFormatting: true\n }\n },\n // Objects.\n {\n model: 'htmlObject',\n view: 'object',\n isObject: true,\n modelSchema: {\n inheritAllFrom: '$inlineObject'\n }\n },\n {\n model: 'htmlIframe',\n view: 'iframe',\n isObject: true,\n modelSchema: {\n inheritAllFrom: '$inlineObject'\n }\n },\n {\n model: 'htmlInput',\n view: 'input',\n isObject: true,\n modelSchema: {\n inheritAllFrom: '$inlineObject'\n }\n },\n {\n model: 'htmlButton',\n view: 'button',\n isObject: true,\n modelSchema: {\n inheritAllFrom: '$inlineObject'\n }\n },\n {\n model: 'htmlTextarea',\n view: 'textarea',\n isObject: true,\n modelSchema: {\n inheritAllFrom: '$inlineObject'\n }\n },\n {\n model: 'htmlSelect',\n view: 'select',\n isObject: true,\n modelSchema: {\n inheritAllFrom: '$inlineObject'\n }\n },\n {\n model: 'htmlVideo',\n view: 'video',\n isObject: true,\n modelSchema: {\n inheritAllFrom: '$inlineObject'\n }\n },\n {\n model: 'htmlEmbed',\n view: 'embed',\n isObject: true,\n modelSchema: {\n inheritAllFrom: '$inlineObject'\n }\n },\n {\n model: 'htmlOembed',\n view: 'oembed',\n isObject: true,\n modelSchema: {\n inheritAllFrom: '$inlineObject'\n }\n },\n {\n model: 'htmlAudio',\n view: 'audio',\n isObject: true,\n modelSchema: {\n inheritAllFrom: '$inlineObject'\n }\n },\n {\n model: 'htmlImg',\n view: 'img',\n isObject: true,\n modelSchema: {\n inheritAllFrom: '$inlineObject'\n }\n },\n {\n model: 'htmlCanvas',\n view: 'canvas',\n isObject: true,\n modelSchema: {\n inheritAllFrom: '$inlineObject'\n }\n },\n // TODO it could be probably represented as non-object element, although it has graphical representation,\n // so probably makes more sense to keep it as an object.\n {\n model: 'htmlMeter',\n view: 'meter',\n isObject: true,\n modelSchema: {\n inheritAllFrom: '$inlineObject'\n }\n },\n // TODO it could be probably represented as non-object element, although it has graphical representation,\n // so probably makes more sense to keep it as an object.\n {\n model: 'htmlProgress',\n view: 'progress',\n isObject: true,\n modelSchema: {\n inheritAllFrom: '$inlineObject'\n }\n },\n {\n model: 'htmlScript',\n view: 'script',\n modelSchema: {\n allowWhere: ['$text', '$block'],\n isInline: true\n }\n },\n {\n model: 'htmlStyle',\n view: 'style',\n modelSchema: {\n allowWhere: ['$text', '$block'],\n isInline: true\n }\n },\n {\n model: 'htmlCustomElement',\n view: '$customElement',\n modelSchema: {\n allowWhere: ['$text', '$block'],\n isInline: true\n }\n }\n ]\n};\n","import baseMerge from './_baseMerge.js';\nimport createAssigner from './_createAssigner.js';\n\n/**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\nvar mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n});\n\nexport default mergeWith;\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module html-support/dataschema\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { toArray } from 'ckeditor5/src/utils';\nimport defaultConfig from './schemadefinitions';\nimport { mergeWith } from 'lodash-es';\n/**\n * Holds representation of the extended HTML document type definitions to be used by the\n * editor in HTML support.\n *\n * Data schema is represented by data schema definitions.\n *\n * To add new definition for block element,\n * use {@link module:html-support/dataschema~DataSchema#registerBlockElement} method:\n *\n * ```ts\n * dataSchema.registerBlockElement( {\n * \tview: 'section',\n * \tmodel: 'my-section',\n * \tmodelSchema: {\n * \t\tinheritAllFrom: '$block'\n * \t}\n * } );\n * ```\n *\n * To add new definition for inline element,\n * use {@link module:html-support/dataschema~DataSchema#registerInlineElement} method:\n *\n * ```\n * dataSchema.registerInlineElement( {\n * \tview: 'span',\n * \tmodel: 'my-span',\n * \tattributeProperties: {\n * \t\tcopyOnEnter: true\n * \t}\n * } );\n * ```\n */\nexport default class DataSchema extends Plugin {\n constructor() {\n super(...arguments);\n /**\n * A map of registered data schema definitions.\n */\n this._definitions = [];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'DataSchema';\n }\n /**\n * @inheritDoc\n */\n init() {\n for (const definition of defaultConfig.block) {\n this.registerBlockElement(definition);\n }\n for (const definition of defaultConfig.inline) {\n this.registerInlineElement(definition);\n }\n }\n /**\n * Add new data schema definition describing block element.\n */\n registerBlockElement(definition) {\n this._definitions.push({ ...definition, isBlock: true });\n }\n /**\n * Add new data schema definition describing inline element.\n */\n registerInlineElement(definition) {\n this._definitions.push({ ...definition, isInline: true });\n }\n /**\n * Updates schema definition describing block element with new properties.\n *\n * Creates new scheme if it doesn't exist.\n * Array properties are concatenated with original values.\n *\n * @param definition Definition update.\n */\n extendBlockElement(definition) {\n this._extendDefinition({ ...definition, isBlock: true });\n }\n /**\n * Updates schema definition describing inline element with new properties.\n *\n * Creates new scheme if it doesn't exist.\n * Array properties are concatenated with original values.\n *\n * @param definition Definition update.\n */\n extendInlineElement(definition) {\n this._extendDefinition({ ...definition, isInline: true });\n }\n /**\n * Returns all definitions matching the given view name.\n *\n * @param includeReferences Indicates if this method should also include definitions of referenced models.\n */\n getDefinitionsForView(viewName, includeReferences = false) {\n const definitions = new Set();\n for (const definition of this._getMatchingViewDefinitions(viewName)) {\n if (includeReferences) {\n for (const reference of this._getReferences(definition.model)) {\n definitions.add(reference);\n }\n }\n definitions.add(definition);\n }\n return definitions;\n }\n /**\n * Returns definitions matching the given model name.\n */\n getDefinitionsForModel(modelName) {\n return this._definitions.filter(definition => definition.model == modelName);\n }\n /**\n * Returns definitions matching the given view name.\n */\n _getMatchingViewDefinitions(viewName) {\n return this._definitions.filter(def => def.view && testViewName(viewName, def.view));\n }\n /**\n * Resolves all definition references registered for the given data schema definition.\n *\n * @param modelName Data schema model name.\n */\n *_getReferences(modelName) {\n const inheritProperties = [\n 'inheritAllFrom',\n 'inheritTypesFrom',\n 'allowWhere',\n 'allowContentOf',\n 'allowAttributesOf'\n ];\n const definitions = this._definitions.filter(definition => definition.model == modelName);\n for (const { modelSchema } of definitions) {\n if (!modelSchema) {\n continue;\n }\n for (const property of inheritProperties) {\n for (const referenceName of toArray(modelSchema[property] || [])) {\n const definitions = this._definitions.filter(definition => definition.model == referenceName);\n for (const definition of definitions) {\n if (referenceName !== modelName) {\n yield* this._getReferences(definition.model);\n yield definition;\n }\n }\n }\n }\n }\n }\n /**\n * Updates schema definition with new properties.\n *\n * Creates new scheme if it doesn't exist.\n * Array properties are concatenated with original values.\n *\n * @param definition Definition update.\n */\n _extendDefinition(definition) {\n const currentDefinitions = Array.from(this._definitions.entries())\n .filter(([, currentDefinition]) => currentDefinition.model == definition.model);\n if (currentDefinitions.length == 0) {\n this._definitions.push(definition);\n return;\n }\n for (const [idx, currentDefinition] of currentDefinitions) {\n this._definitions[idx] = mergeWith({}, currentDefinition, definition, (target, source) => {\n return Array.isArray(target) ? target.concat(source) : undefined;\n });\n }\n }\n}\n/**\n * Test view name against the given pattern.\n */\nfunction testViewName(pattern, viewName) {\n if (typeof pattern === 'string') {\n return pattern === viewName;\n }\n if (pattern instanceof RegExp) {\n return pattern.test(viewName);\n }\n return false;\n}\n","/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nexport default baseFindIndex;\n","/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nexport default baseIsNaN;\n","/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\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 strictIndexOf(array, value, fromIndex) {\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 strictIndexOf;\n","import baseFindIndex from './_baseFindIndex.js';\nimport baseIsNaN from './_baseIsNaN.js';\nimport strictIndexOf from './_strictIndexOf.js';\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\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 return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nexport default baseIndexOf;\n","/**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n}\n\nexport default baseIndexOfWith;\n","import arrayMap from './_arrayMap.js';\nimport baseIndexOf from './_baseIndexOf.js';\nimport baseIndexOfWith from './_baseIndexOfWith.js';\nimport baseUnary from './_baseUnary.js';\nimport copyArray from './_copyArray.js';\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 (array === values) {\n values = copyArray(values);\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","import baseRest from './_baseRest.js';\nimport pullAll from './pullAll.js';\n\n/**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\nvar pull = baseRest(pullAll);\n\nexport default pull;\n","import basePullAll from './_basePullAll.js';\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 = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\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","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./datafilter.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module html-support/datafilter\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Matcher } from 'ckeditor5/src/engine';\nimport { CKEditorError, priorities, isValidAttributeName } from 'ckeditor5/src/utils';\nimport { Widget } from 'ckeditor5/src/widget';\nimport { viewToModelObjectConverter, toObjectWidgetConverter, createObjectView, viewToAttributeInlineConverter, attributeToViewInlineConverter, viewToModelBlockAttributeConverter, modelToViewBlockAttributeConverter } from './converters';\nimport { default as DataSchema } from './dataschema';\nimport { isPlainObject, pull as removeItemFromArray } from 'lodash-es';\nimport '../theme/datafilter.css';\n/**\n * Allows to validate elements and element attributes registered by {@link module:html-support/dataschema~DataSchema}.\n *\n * To enable registered element in the editor, use {@link module:html-support/datafilter~DataFilter#allowElement} method:\n *\n * ```ts\n * dataFilter.allowElement( 'section' );\n * ```\n *\n * You can also allow or disallow specific element attributes:\n *\n * ```ts\n * // Allow `data-foo` attribute on `section` element.\n * dataFilter.allowAttributes( {\n * \tname: 'section',\n * \tattributes: {\n * \t\t'data-foo': true\n * \t}\n * } );\n *\n * // Disallow `color` style attribute on 'section' element.\n * dataFilter.disallowAttributes( {\n * \tname: 'section',\n * \tstyles: {\n * \t\tcolor: /[\\s\\S]+/\n * \t}\n * } );\n * ```\n *\n * To apply the information about allowed and disallowed attributes in custom integration plugin,\n * use the {@link module:html-support/datafilter~DataFilter#processViewAttributes `processViewAttributes()`} method.\n */\nexport default class DataFilter extends Plugin {\n constructor(editor) {\n super(editor);\n this._dataSchema = editor.plugins.get('DataSchema');\n this._allowedAttributes = new Matcher();\n this._disallowedAttributes = new Matcher();\n this._allowedElements = new Set();\n this._disallowedElements = new Set();\n this._dataInitialized = false;\n this._coupledAttributes = null;\n this._registerElementsAfterInit();\n this._registerElementHandlers();\n this._registerModelPostFixer();\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'DataFilter';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [DataSchema, Widget];\n }\n /**\n * Load a configuration of one or many elements, where their attributes should be allowed.\n *\n * **Note**: Rules will be applied just before next data pipeline data init or set.\n *\n * @param config Configuration of elements that should have their attributes accepted in the editor.\n */\n loadAllowedConfig(config) {\n for (const pattern of config) {\n // MatcherPattern allows omitting `name` to widen the search of elements.\n // Let's keep it consistent and match every element if a `name` has not been provided.\n const elementName = pattern.name || /[\\s\\S]+/;\n const rules = splitRules(pattern);\n this.allowElement(elementName);\n rules.forEach(pattern => this.allowAttributes(pattern));\n }\n }\n /**\n * Load a configuration of one or many elements, where their attributes should be disallowed.\n *\n * **Note**: Rules will be applied just before next data pipeline data init or set.\n *\n * @param config Configuration of elements that should have their attributes rejected from the editor.\n */\n loadDisallowedConfig(config) {\n for (const pattern of config) {\n // MatcherPattern allows omitting `name` to widen the search of elements.\n // Let's keep it consistent and match every element if a `name` has not been provided.\n const elementName = pattern.name || /[\\s\\S]+/;\n const rules = splitRules(pattern);\n // Disallow element itself if there is no other rules.\n if (rules.length == 0) {\n this.disallowElement(elementName);\n }\n else {\n rules.forEach(pattern => this.disallowAttributes(pattern));\n }\n }\n }\n /**\n * Allow the given element in the editor context.\n *\n * This method will only allow elements described by the {@link module:html-support/dataschema~DataSchema} used\n * to create data filter.\n *\n * **Note**: Rules will be applied just before next data pipeline data init or set.\n *\n * @param viewName String or regular expression matching view name.\n */\n allowElement(viewName) {\n for (const definition of this._dataSchema.getDefinitionsForView(viewName, true)) {\n this._addAllowedElement(definition);\n // Reset cached map to recalculate it on the next usage.\n this._coupledAttributes = null;\n }\n }\n /**\n * Disallow the given element in the editor context.\n *\n * This method will only disallow elements described by the {@link module:html-support/dataschema~DataSchema} used\n * to create data filter.\n *\n * @param viewName String or regular expression matching view name.\n */\n disallowElement(viewName) {\n for (const definition of this._dataSchema.getDefinitionsForView(viewName, false)) {\n this._disallowedElements.add(definition.view);\n }\n }\n /**\n * Allow the given attributes for view element allowed by {@link #allowElement} method.\n *\n * @param config Pattern matching all attributes which should be allowed.\n */\n allowAttributes(config) {\n this._allowedAttributes.add(config);\n }\n /**\n * Disallow the given attributes for view element allowed by {@link #allowElement} method.\n *\n * @param config Pattern matching all attributes which should be disallowed.\n */\n disallowAttributes(config) {\n this._disallowedAttributes.add(config);\n }\n /**\n * Processes all allowed and disallowed attributes on the view element by consuming them and returning the allowed ones.\n *\n * This method applies the configuration set up by {@link #allowAttributes `allowAttributes()`}\n * and {@link #disallowAttributes `disallowAttributes()`} over the given view element by consuming relevant attributes.\n * It returns the allowed attributes that were found on the given view element for further processing by integration code.\n *\n * ```ts\n * dispatcher.on( 'element:myElement', ( evt, data, conversionApi ) => {\n * \t// Get rid of disallowed and extract all allowed attributes from a viewElement.\n * \tconst viewAttributes = dataFilter.processViewAttributes( data.viewItem, conversionApi );\n * \t// Do something with them, i.e. store inside a model as a dictionary.\n * \tif ( viewAttributes ) {\n * \t\tconversionApi.writer.setAttribute( 'htmlAttributesOfMyElement', viewAttributes, data.modelRange );\n * \t}\n * } );\n * ```\n *\n * @see module:engine/conversion/viewconsumable~ViewConsumable#consume\n *\n * @returns Object with following properties:\n * - attributes Set with matched attribute names.\n * - styles Set with matched style names.\n * - classes Set with matched class names.\n */\n processViewAttributes(viewElement, conversionApi) {\n // Make sure that the disabled attributes are handled before the allowed attributes are called.\n // For example, for block images the <figure> converter triggers conversion for <img> first and then for other elements, i.e. <a>.\n consumeAttributes(viewElement, conversionApi, this._disallowedAttributes);\n return consumeAttributes(viewElement, conversionApi, this._allowedAttributes);\n }\n /**\n * Adds allowed element definition and fires registration event.\n */\n _addAllowedElement(definition) {\n if (this._allowedElements.has(definition)) {\n return;\n }\n this._allowedElements.add(definition);\n // For attribute based integrations (table figure, document lists, etc.) register related element definitions.\n if ('appliesToBlock' in definition && typeof definition.appliesToBlock == 'string') {\n for (const relatedDefinition of this._dataSchema.getDefinitionsForModel(definition.appliesToBlock)) {\n if (relatedDefinition.isBlock) {\n this._addAllowedElement(relatedDefinition);\n }\n }\n }\n // We need to wait for all features to be initialized before we can register\n // element, so we can access existing features model schemas.\n // If the data has not been initialized yet, _registerElementsAfterInit() method will take care of\n // registering elements.\n if (this._dataInitialized) {\n // Defer registration to the next data pipeline data set so any disallow rules could be applied\n // even if added after allow rule (disallowElement).\n this.editor.data.once('set', () => {\n this._fireRegisterEvent(definition);\n }, {\n // With the highest priority listener we are able to register elements right before\n // running data conversion.\n priority: priorities.get('highest') + 1\n });\n }\n }\n /**\n * Registers elements allowed by {@link module:html-support/datafilter~DataFilter#allowElement} method\n * once {@link module:engine/controller/datacontroller~DataController editor's data controller} is initialized.\n */\n _registerElementsAfterInit() {\n this.editor.data.on('init', () => {\n this._dataInitialized = true;\n for (const definition of this._allowedElements) {\n this._fireRegisterEvent(definition);\n }\n }, {\n // With highest priority listener we are able to register elements right before\n // running data conversion. Also:\n // * Make sure that priority is higher than the one used by `RealTimeCollaborationClient`,\n // as RTC is stopping event propagation.\n // * Make sure no other features hook into this event before GHS because otherwise the\n // downcast conversion (for these features) could run before GHS registered its converters\n // (https://github.com/ckeditor/ckeditor5/issues/11356).\n priority: priorities.get('highest') + 1\n });\n }\n /**\n * Registers default element handlers.\n */\n _registerElementHandlers() {\n this.on('register', (evt, definition) => {\n const schema = this.editor.model.schema;\n // Object element should be only registered for new features.\n // If the model schema is already registered, it should be handled by\n // #_registerBlockElement() or #_registerObjectElement() attribute handlers.\n if (definition.isObject && !schema.isRegistered(definition.model)) {\n this._registerObjectElement(definition);\n }\n else if (definition.isBlock) {\n this._registerBlockElement(definition);\n }\n else if (definition.isInline) {\n this._registerInlineElement(definition);\n }\n else {\n /**\n * The definition cannot be handled by the data filter.\n *\n * Make sure that the registered definition is correct.\n *\n * @error data-filter-invalid-definition\n */\n throw new CKEditorError('data-filter-invalid-definition', null, definition);\n }\n evt.stop();\n }, { priority: 'lowest' });\n }\n /**\n * Registers a model post-fixer that is removing coupled GHS attributes of inline elements. Those attributes\n * are removed if a coupled feature attribute is removed.\n *\n * For example, consider following HTML:\n *\n * ```html\n * <a href=\"foo.html\" id=\"myId\">bar</a>\n * ```\n *\n * Which would be upcasted to following text node in the model:\n *\n * ```html\n * <$text linkHref=\"foo.html\" htmlA=\"{ attributes: { id: 'myId' } }\">bar</$text>\n * ```\n *\n * When the user removes the link from that text (using UI), only `linkHref` attribute would be removed:\n *\n * ```html\n * <$text htmlA=\"{ attributes: { id: 'myId' } }\">bar</$text>\n * ```\n *\n * The `htmlA` attribute would stay in the model and would cause GHS to generate an `<a>` element.\n * This is incorrect from UX point of view, as the user wanted to remove the whole link (not only `href`).\n */\n _registerModelPostFixer() {\n const model = this.editor.model;\n model.document.registerPostFixer(writer => {\n const changes = model.document.differ.getChanges();\n let changed = false;\n const coupledAttributes = this._getCoupledAttributesMap();\n for (const change of changes) {\n // Handle only attribute removals.\n if (change.type != 'attribute' || change.attributeNewValue !== null) {\n continue;\n }\n // Find a list of coupled GHS attributes.\n const attributeKeys = coupledAttributes.get(change.attributeKey);\n if (!attributeKeys) {\n continue;\n }\n // Remove the coupled GHS attributes on the same range as the feature attribute was removed.\n for (const { item } of change.range.getWalker({ shallow: true })) {\n for (const attributeKey of attributeKeys) {\n if (item.hasAttribute(attributeKey)) {\n writer.removeAttribute(attributeKey, item);\n changed = true;\n }\n }\n }\n }\n return changed;\n });\n }\n /**\n * Collects the map of coupled attributes. The returned map is keyed by the feature attribute name\n * and coupled GHS attribute names are stored in the value array.\n */\n _getCoupledAttributesMap() {\n if (this._coupledAttributes) {\n return this._coupledAttributes;\n }\n this._coupledAttributes = new Map();\n for (const definition of this._allowedElements) {\n if (definition.coupledAttribute && definition.model) {\n const attributeNames = this._coupledAttributes.get(definition.coupledAttribute);\n if (attributeNames) {\n attributeNames.push(definition.model);\n }\n else {\n this._coupledAttributes.set(definition.coupledAttribute, [definition.model]);\n }\n }\n }\n return this._coupledAttributes;\n }\n /**\n * Fires `register` event for the given element definition.\n */\n _fireRegisterEvent(definition) {\n if (definition.view && this._disallowedElements.has(definition.view)) {\n return;\n }\n this.fire(definition.view ? `register:${definition.view}` : 'register', definition);\n }\n /**\n * Registers object element and attribute converters for the given data schema definition.\n */\n _registerObjectElement(definition) {\n const editor = this.editor;\n const schema = editor.model.schema;\n const conversion = editor.conversion;\n const { view: viewName, model: modelName } = definition;\n schema.register(modelName, definition.modelSchema);\n /* istanbul ignore next: paranoid check -- @preserve */\n if (!viewName) {\n return;\n }\n schema.extend(definition.model, {\n allowAttributes: ['htmlAttributes', 'htmlContent']\n });\n // Store element content in special `$rawContent` custom property to\n // avoid editor's data filtering mechanism.\n editor.data.registerRawContentMatcher({\n name: viewName\n });\n conversion.for('upcast').elementToElement({\n view: viewName,\n model: viewToModelObjectConverter(definition),\n // With a `low` priority, `paragraph` plugin auto-paragraphing mechanism is executed. Make sure\n // this listener is called before it. If not, some elements will be transformed into a paragraph.\n converterPriority: priorities.get('low') + 1\n });\n conversion.for('upcast').add(viewToModelBlockAttributeConverter(definition, this));\n conversion.for('editingDowncast').elementToStructure({\n model: {\n name: modelName,\n attributes: [\n 'htmlAttributes'\n ]\n },\n view: toObjectWidgetConverter(editor, definition)\n });\n conversion.for('dataDowncast').elementToElement({\n model: modelName,\n view: (modelElement, { writer }) => {\n return createObjectView(viewName, modelElement, writer);\n }\n });\n conversion.for('dataDowncast').add(modelToViewBlockAttributeConverter(definition));\n }\n /**\n * Registers block element and attribute converters for the given data schema definition.\n */\n _registerBlockElement(definition) {\n const editor = this.editor;\n const schema = editor.model.schema;\n const conversion = editor.conversion;\n const { view: viewName, model: modelName } = definition;\n if (!schema.isRegistered(definition.model)) {\n schema.register(definition.model, definition.modelSchema);\n if (!viewName) {\n return;\n }\n conversion.for('upcast').elementToElement({\n model: modelName,\n view: viewName,\n // With a `low` priority, `paragraph` plugin auto-paragraphing mechanism is executed. Make sure\n // this listener is called before it. If not, some elements will be transformed into a paragraph.\n converterPriority: priorities.get('low') + 1\n });\n conversion.for('downcast').elementToElement({\n model: modelName,\n view: viewName\n });\n }\n if (!viewName) {\n return;\n }\n schema.extend(definition.model, {\n allowAttributes: 'htmlAttributes'\n });\n conversion.for('upcast').add(viewToModelBlockAttributeConverter(definition, this));\n conversion.for('downcast').add(modelToViewBlockAttributeConverter(definition));\n }\n /**\n * Registers inline element and attribute converters for the given data schema definition.\n *\n * Extends `$text` model schema to allow the given definition model attribute and its properties.\n */\n _registerInlineElement(definition) {\n const editor = this.editor;\n const schema = editor.model.schema;\n const conversion = editor.conversion;\n const attributeKey = definition.model;\n // This element is stored in the model as an attribute on a block element, for example DocumentLists.\n if (definition.appliesToBlock) {\n return;\n }\n schema.extend('$text', {\n allowAttributes: attributeKey\n });\n if (definition.attributeProperties) {\n schema.setAttributeProperties(attributeKey, definition.attributeProperties);\n }\n conversion.for('upcast').add(viewToAttributeInlineConverter(definition, this));\n conversion.for('downcast').attributeToElement({\n model: attributeKey,\n view: attributeToViewInlineConverter(definition)\n });\n }\n}\n/**\n * Matches and consumes the given view attributes.\n */\nfunction consumeAttributes(viewElement, conversionApi, matcher) {\n const matches = consumeAttributeMatches(viewElement, conversionApi, matcher);\n const { attributes, styles, classes } = mergeMatchResults(matches);\n const viewAttributes = {};\n // Remove invalid DOM element attributes.\n if (attributes.size) {\n for (const key of attributes) {\n if (!isValidAttributeName(key)) {\n attributes.delete(key);\n }\n }\n }\n if (attributes.size) {\n viewAttributes.attributes = iterableToObject(attributes, key => viewElement.getAttribute(key));\n }\n if (styles.size) {\n viewAttributes.styles = iterableToObject(styles, key => viewElement.getStyle(key));\n }\n if (classes.size) {\n viewAttributes.classes = Array.from(classes);\n }\n if (!Object.keys(viewAttributes).length) {\n return null;\n }\n return viewAttributes;\n}\n/**\n * Consumes matched attributes.\n *\n * @returns Array with match information about found attributes.\n */\nfunction consumeAttributeMatches(viewElement, { consumable }, matcher) {\n const matches = matcher.matchAll(viewElement) || [];\n const consumedMatches = [];\n for (const match of matches) {\n removeConsumedAttributes(consumable, viewElement, match);\n // We only want to consume attributes, so element can be still processed by other converters.\n delete match.match.name;\n consumable.consume(viewElement, match.match);\n consumedMatches.push(match);\n }\n return consumedMatches;\n}\n/**\n * Removes attributes from the given match that were already consumed by other converters.\n */\nfunction removeConsumedAttributes(consumable, viewElement, match) {\n for (const key of ['attributes', 'classes', 'styles']) {\n const attributes = match.match[key];\n if (!attributes) {\n continue;\n }\n // Iterating over a copy of an array so removing items doesn't influence iteration.\n for (const value of Array.from(attributes)) {\n if (!consumable.test(viewElement, ({ [key]: [value] }))) {\n removeItemFromArray(attributes, value);\n }\n }\n }\n}\n/**\n * Merges the result of {@link module:engine/view/matcher~Matcher#matchAll} method.\n *\n * @param matches\n * @returns Object with following properties:\n * - attributes Set with matched attribute names.\n * - styles Set with matched style names.\n * - classes Set with matched class names.\n */\nfunction mergeMatchResults(matches) {\n const matchResult = {\n attributes: new Set(),\n classes: new Set(),\n styles: new Set()\n };\n for (const match of matches) {\n for (const key in matchResult) {\n const values = match.match[key] || [];\n values.forEach(value => (matchResult[key]).add(value));\n }\n }\n return matchResult;\n}\n/**\n * Converts the given iterable object into an object.\n */\nfunction iterableToObject(iterable, getValue) {\n const attributesObject = {};\n for (const prop of iterable) {\n const value = getValue(prop);\n if (value !== undefined) {\n attributesObject[prop] = getValue(prop);\n }\n }\n return attributesObject;\n}\n/**\n * Matcher by default has to match **all** patterns to count it as an actual match. Splitting the pattern\n * into separate patterns means that any matched pattern will be count as a match.\n *\n * @param pattern Pattern to split.\n * @param attributeName Name of the attribute to split (e.g. 'attributes', 'classes', 'styles').\n */\nfunction splitPattern(pattern, attributeName) {\n const { name } = pattern;\n const attributeValue = pattern[attributeName];\n if (isPlainObject(attributeValue)) {\n return Object.entries(attributeValue).map(([key, value]) => ({\n name,\n [attributeName]: {\n [key]: value\n }\n }));\n }\n if (Array.isArray(attributeValue)) {\n return attributeValue.map(value => ({\n name,\n [attributeName]: [value]\n }));\n }\n return [pattern];\n}\n/**\n * Rules are matched in conjunction (AND operation), but we want to have a match if *any* of the rules is matched (OR operation).\n * By splitting the rules we force the latter effect.\n */\nfunction splitRules(rules) {\n const { name, attributes, classes, styles } = rules;\n const splittedRules = [];\n if (attributes) {\n splittedRules.push(...splitPattern({ name, attributes }, 'attributes'));\n }\n if (classes) {\n splittedRules.push(...splitPattern({ name, classes }, 'classes'));\n }\n if (styles) {\n splittedRules.push(...splitPattern({ name, styles }, 'styles'));\n }\n return splittedRules;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module select-all/selectallcommand\n */\nimport { Command } from '@ckeditor/ckeditor5-core';\n/**\n * The select all command.\n *\n * It is used by the {@link module:select-all/selectallediting~SelectAllEditing select all editing feature} to handle\n * the <kbd>Ctrl/⌘</kbd>+<kbd>A</kbd> keystroke.\n *\n * Executing this command changes the {@glink framework/architecture/editing-engine#model model}\n * selection so it contains the entire content of the editable root of the editor the selection is\n * {@link module:engine/model/selection~Selection#anchor anchored} in.\n *\n * If the selection was anchored in a {@glink framework/tutorials/implementing-a-block-widget nested editable}\n * (e.g. a caption of an image), the new selection will contain its entire content. Successive executions of this command\n * will expand the selection to encompass more and more content up to the entire editable root of the editor.\n */\nexport default class SelectAllCommand extends Command {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n // It does not affect data so should be enabled in read-only mode.\n this.affectsData = false;\n }\n /**\n * @inheritDoc\n */\n execute() {\n const model = this.editor.model;\n const selection = model.document.selection;\n let scopeElement = model.schema.getLimitElement(selection);\n // If an entire scope is selected, or the selection's ancestor is not a scope yet,\n // browse through ancestors to find the enclosing parent scope.\n if (selection.containsEntireContent(scopeElement) || !isSelectAllScope(model.schema, scopeElement)) {\n do {\n scopeElement = scopeElement.parent;\n // Do nothing, if the entire `root` is already selected.\n if (!scopeElement) {\n return;\n }\n } while (!isSelectAllScope(model.schema, scopeElement));\n }\n model.change(writer => {\n writer.setSelection(scopeElement, 'in');\n });\n }\n}\n/**\n * Checks whether the element is a valid select-all scope. Returns true, if the element is a\n * {@link module:engine/model/schema~Schema#isLimit limit}, and can contain any text or paragraph.\n *\n * @param schema Schema to check against.\n * @param element Model element.\n */\nfunction isSelectAllScope(schema, element) {\n return schema.isLimit(element) && (schema.checkChild(element, '$text') || schema.checkChild(element, 'paragraph'));\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module select-all/selectallediting\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { getCode, parseKeystroke } from '@ckeditor/ckeditor5-utils';\nimport SelectAllCommand from './selectallcommand';\nconst SELECT_ALL_KEYSTROKE = parseKeystroke('Ctrl+A');\n/**\n * The select all editing feature.\n *\n * It registers the `'selectAll'` {@link module:select-all/selectallcommand~SelectAllCommand command}\n * and the <kbd>Ctrl/⌘</kbd>+<kbd>A</kbd> keystroke listener which executes it.\n */\nexport default class SelectAllEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'SelectAllEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const view = editor.editing.view;\n const viewDocument = view.document;\n editor.commands.add('selectAll', new SelectAllCommand(editor));\n this.listenTo(viewDocument, 'keydown', (eventInfo, domEventData) => {\n if (getCode(domEventData) === SELECT_ALL_KEYSTROKE) {\n editor.execute('selectAll');\n domEventData.preventDefault();\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module select-all/selectallui\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport { ButtonView } from '@ckeditor/ckeditor5-ui';\nimport selectAllIcon from '../theme/icons/select-all.svg';\n/**\n * The select all UI feature.\n *\n * It registers the `'selectAll'` UI button in the editor's\n * {@link module:ui/componentfactory~ComponentFactory component factory}. When clicked, the button\n * executes the {@link module:select-all/selectallcommand~SelectAllCommand select all command}.\n */\nexport default class SelectAllUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'SelectAllUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n editor.ui.componentFactory.add('selectAll', locale => {\n const command = editor.commands.get('selectAll');\n const view = new ButtonView(locale);\n const t = locale.t;\n view.set({\n label: t('Select all'),\n icon: selectAllIcon,\n keystroke: 'Ctrl+A',\n tooltip: true\n });\n view.bind('isEnabled').to(command, 'isEnabled');\n // Execute the command.\n this.listenTo(view, 'execute', () => {\n editor.execute('selectAll');\n editor.editing.view.focus();\n });\n return view;\n });\n }\n}\n","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 20 20\\\"><path d=\\\"M.75 15.5a.75.75 0 0 1 .75.75V18l.008.09A.5.5 0 0 0 2 18.5h1.75a.75.75 0 1 1 0 1.5H1.5l-.144-.007a1.5 1.5 0 0 1-1.35-1.349L0 18.5v-2.25a.75.75 0 0 1 .75-.75zm18.5 0a.75.75 0 0 1 .75.75v2.25l-.007.144a1.5 1.5 0 0 1-1.349 1.35L18.5 20h-2.25a.75.75 0 1 1 0-1.5H18a.5.5 0 0 0 .492-.41L18.5 18v-1.75a.75.75 0 0 1 .75-.75zm-10.45 3c.11 0 .2.09.2.2v1.1a.2.2 0 0 1-.2.2H7.2a.2.2 0 0 1-.2-.2v-1.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.09-.2.2-.2h1.6z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module select-all/selectall\n */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport SelectAllEditing from './selectallediting';\nimport SelectAllUI from './selectallui';\n/**\n * The select all feature.\n *\n * This is a \"glue\" plugin which loads the {@link module:select-all/selectallediting~SelectAllEditing select all editing feature}\n * and the {@link module:select-all/selectallui~SelectAllUI select all UI feature}.\n *\n * Please refer to the documentation of individual features to learn more.\n */\nexport default class SelectAll extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [SelectAllEditing, SelectAllUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'SelectAll';\n }\n}\n","import api from \"!../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../../../css-loader/dist/cjs.js!../../../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./responsiveform.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./findandreplaceform.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module find-and-replace/ui/findandreplaceformview\n */\nimport { View, ButtonView, FormHeaderView, LabeledFieldView, Model, FocusCycler, createLabeledInputText, submitHandler, ViewCollection, createDropdown, addListToDropdown } from 'ckeditor5/src/ui';\nimport { FocusTracker, KeystrokeHandler, Collection, Rect, isVisible } from 'ckeditor5/src/utils';\n// See: #8833.\n// eslint-disable-next-line ckeditor5-rules/ckeditor-imports\nimport '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';\nimport '../../theme/findandreplaceform.css';\n// eslint-disable-next-line ckeditor5-rules/ckeditor-imports\nimport previousArrow from '@ckeditor/ckeditor5-ui/theme/icons/previous-arrow.svg';\nimport { icons } from 'ckeditor5/src/core';\n/**\n * The find and replace form view class.\n *\n * See {@link module:find-and-replace/ui/findandreplaceformview~FindAndReplaceFormView}.\n */\nexport default class FindAndReplaceFormView extends View {\n /**\n * Creates a view of find and replace form.\n *\n * @param locale The localization services instance.\n */\n constructor(locale) {\n super(locale);\n const t = locale.t;\n this.set('matchCount', 0);\n this.set('highlightOffset', 0);\n this.set('isDirty', false);\n this.set('_areCommandsEnabled', {});\n this.set('_resultsCounterText', '');\n this.set('_matchCase', false);\n this.set('_wholeWordsOnly', false);\n this.bind('_searchResultsFound').to(this, 'matchCount', this, 'isDirty', (matchCount, isDirty) => {\n return matchCount > 0 && !isDirty;\n });\n this._findInputView = this._createInputField(t('Find in text…'));\n this._replaceInputView = this._createInputField(t('Replace with…'));\n this._findButtonView = this._createButton({\n label: t('Find'),\n class: 'ck-button-find ck-button-action',\n withText: true\n });\n this._findPrevButtonView = this._createButton({\n label: t('Previous result'),\n class: 'ck-button-prev',\n icon: previousArrow,\n keystroke: 'Shift+F3',\n tooltip: true\n });\n this._findNextButtonView = this._createButton({\n label: t('Next result'),\n class: 'ck-button-next',\n icon: previousArrow,\n keystroke: 'F3',\n tooltip: true\n });\n this._optionsDropdown = this._createOptionsDropdown();\n this._replaceButtonView = this._createButton({\n label: t('Replace'),\n class: 'ck-button-replace',\n withText: true\n });\n this._replaceAllButtonView = this._createButton({\n label: t('Replace all'),\n class: 'ck-button-replaceall',\n withText: true\n });\n this._findFieldsetView = this._createFindFieldset();\n this._replaceFieldsetView = this._createReplaceFieldset();\n this._focusTracker = new FocusTracker();\n this._keystrokes = new KeystrokeHandler();\n this._focusables = new ViewCollection();\n this._focusCycler = new FocusCycler({\n focusables: this._focusables,\n focusTracker: this._focusTracker,\n keystrokeHandler: this._keystrokes,\n actions: {\n // Navigate form fields backwards using the <kbd>Shift</kbd> + <kbd>Tab</kbd> keystroke.\n focusPrevious: 'shift + tab',\n // Navigate form fields forwards using the <kbd>Tab</kbd> key.\n focusNext: 'tab'\n }\n });\n this.setTemplate({\n tag: 'form',\n attributes: {\n class: [\n 'ck',\n 'ck-find-and-replace-form'\n ],\n tabindex: '-1'\n },\n children: [\n new FormHeaderView(locale, {\n label: t('Find and replace')\n }),\n this._findFieldsetView,\n this._replaceFieldsetView\n ]\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n submitHandler({ view: this });\n this._initFocusCycling();\n this._initKeystrokeHandling();\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this._focusTracker.destroy();\n this._keystrokes.destroy();\n }\n /**\n * Focuses the fist {@link #_focusables} in the form.\n */\n focus() {\n this._focusCycler.focusFirst();\n }\n /**\n * Resets the form before re-appearing.\n *\n * It clears error messages, hides the match counter and disables the replace feature\n * until the next hit of the \"Find\" button.\n *\n * **Note**: It does not reset inputs and options, though. This way the form works better in editors with\n * disappearing toolbar (e.g. BalloonEditor): hiding the toolbar by accident (together with the find and replace UI)\n * does not require filling the entire form again.\n */\n reset() {\n this._findInputView.errorText = null;\n this.isDirty = true;\n }\n /**\n * Returns the value of the find input.\n */\n get _textToFind() {\n return this._findInputView.fieldView.element.value;\n }\n /**\n * Returns the value of the replace input.\n */\n get _textToReplace() {\n return this._replaceInputView.fieldView.element.value;\n }\n /**\n * Configures and returns the `<fieldset>` aggregating all find controls.\n */\n _createFindFieldset() {\n const locale = this.locale;\n const fieldsetView = new View(locale);\n // Typing in the find field invalidates all previous results (the form is \"dirty\").\n this._findInputView.fieldView.on('input', () => {\n this.isDirty = true;\n });\n this._findButtonView.on('execute', this._onFindButtonExecute.bind(this));\n // Pressing prev/next buttons fires related event on the form.\n this._findPrevButtonView.delegate('execute').to(this, 'findPrevious');\n this._findNextButtonView.delegate('execute').to(this, 'findNext');\n // Prev/next buttons will be disabled when related editor command gets disabled.\n this._findPrevButtonView.bind('isEnabled').to(this, '_areCommandsEnabled', ({ findPrevious }) => findPrevious);\n this._findNextButtonView.bind('isEnabled').to(this, '_areCommandsEnabled', ({ findNext }) => findNext);\n this._injectFindResultsCounter();\n fieldsetView.setTemplate({\n tag: 'fieldset',\n attributes: {\n class: ['ck', 'ck-find-and-replace-form__find']\n },\n children: [\n this._findInputView,\n this._findButtonView,\n this._findPrevButtonView,\n this._findNextButtonView\n ]\n });\n return fieldsetView;\n }\n /**\n * The action performed when the {@link #_findButtonView} is pressed.\n */\n _onFindButtonExecute() {\n // When hitting \"Find\" in an empty input, an error should be displayed.\n // Also, if the form was \"dirty\", it should remain so.\n if (!this._textToFind) {\n const t = this.t;\n this._findInputView.errorText = t('Text to find must not be empty.');\n return;\n }\n // Hitting \"Find\" automatically clears the dirty state.\n this.isDirty = false;\n this.fire('findNext', {\n searchText: this._textToFind,\n matchCase: this._matchCase,\n wholeWords: this._wholeWordsOnly\n });\n }\n /**\n * Configures an injects the find results counter displaying a \"N of M\" label of the {@link #_findInputView}.\n */\n _injectFindResultsCounter() {\n const locale = this.locale;\n const t = locale.t;\n const bind = this.bindTemplate;\n const resultsCounterView = new View(this.locale);\n this.bind('_resultsCounterText').to(this, 'highlightOffset', this, 'matchCount', (highlightOffset, matchCount) => t('%0 of %1', [highlightOffset, matchCount]));\n resultsCounterView.setTemplate({\n tag: 'span',\n attributes: {\n class: [\n 'ck',\n 'ck-results-counter',\n // The counter only makes sense when the field text corresponds to search results in the editing.\n bind.if('isDirty', 'ck-hidden')\n ]\n },\n children: [\n {\n text: bind.to('_resultsCounterText')\n }\n ]\n });\n // The whole idea is that when the text of the counter changes, its width also increases/decreases and\n // it consumes more or less space over the input. The input, on the other hand, should adjust it's right\n // padding so its *entire* text always remains visible and available to the user.\n const updateFindInputPadding = () => {\n const inputElement = this._findInputView.fieldView.element;\n // Don't adjust the padding if the input (also: counter) were not rendered or not inserted into DOM yet.\n if (!inputElement || !isVisible(inputElement)) {\n return;\n }\n const counterWidth = new Rect(resultsCounterView.element).width;\n const paddingPropertyName = locale.uiLanguageDirection === 'ltr' ? 'paddingRight' : 'paddingLeft';\n if (!counterWidth) {\n inputElement.style[paddingPropertyName] = '';\n }\n else {\n inputElement.style[paddingPropertyName] = `calc( 2 * var(--ck-spacing-standard) + ${counterWidth}px )`;\n }\n };\n // Adjust the input padding when the text of the counter changes, for instance \"1 of 200\" is narrower than \"123 of 200\".\n // Using \"low\" priority to let the text be set by the template binding first.\n this.on('change:_resultsCounterText', updateFindInputPadding, { priority: 'low' });\n // Adjust the input padding when the counter shows or hides. When hidden, there should be no padding. When it shows, the\n // padding should be set according to the text of the counter.\n // Using \"low\" priority to let the text be set by the template binding first.\n this.on('change:isDirty', updateFindInputPadding, { priority: 'low' });\n // Put the counter element next to the <input> in the find field.\n this._findInputView.template.children[0].children.push(resultsCounterView);\n }\n /**\n * Configures and returns the `<fieldset>` aggregating all replace controls.\n */\n _createReplaceFieldset() {\n const locale = this.locale;\n const t = locale.t;\n const fieldsetView = new View(this.locale);\n this._replaceButtonView.bind('isEnabled').to(this, '_areCommandsEnabled', this, '_searchResultsFound', ({ replace }, resultsFound) => replace && resultsFound);\n this._replaceAllButtonView.bind('isEnabled').to(this, '_areCommandsEnabled', this, '_searchResultsFound', ({ replaceAll }, resultsFound) => replaceAll && resultsFound);\n this._replaceInputView.bind('isEnabled').to(this, '_areCommandsEnabled', this, '_searchResultsFound', ({ replace }, resultsFound) => replace && resultsFound);\n this._replaceInputView.bind('infoText').to(this._replaceInputView, 'isEnabled', this._replaceInputView, 'isFocused', (isEnabled, isFocused) => {\n if (isEnabled || !isFocused) {\n return '';\n }\n return t('Tip: Find some text first in order to replace it.');\n });\n this._replaceButtonView.on('execute', () => {\n this.fire('replace', {\n searchText: this._textToFind,\n replaceText: this._textToReplace\n });\n });\n this._replaceAllButtonView.on('execute', () => {\n this.fire('replaceAll', {\n searchText: this._textToFind,\n replaceText: this._textToReplace\n });\n this.focus();\n });\n fieldsetView.setTemplate({\n tag: 'fieldset',\n attributes: {\n class: ['ck', 'ck-find-and-replace-form__replace']\n },\n children: [\n this._replaceInputView,\n this._optionsDropdown,\n this._replaceButtonView,\n this._replaceAllButtonView\n ]\n });\n return fieldsetView;\n }\n /**\n * Creates, configures and returns and instance of a dropdown allowing users to narrow\n * the search criteria down. The dropdown has a list with switch buttons for each option.\n */\n _createOptionsDropdown() {\n const locale = this.locale;\n const t = locale.t;\n const dropdownView = createDropdown(this.locale);\n dropdownView.class = 'ck-options-dropdown';\n dropdownView.buttonView.set({\n withText: false,\n label: t('Show options'),\n icon: icons.cog,\n tooltip: true\n });\n const matchCaseModel = new Model({\n withText: true,\n label: t('Match case'),\n // A dummy read-only prop to make it easy to tell which switch was toggled.\n _isMatchCaseSwitch: true\n });\n const wholeWordsOnlyModel = new Model({\n withText: true,\n label: t('Whole words only')\n });\n // Let the switches be controlled by form's observable properties.\n matchCaseModel.bind('isOn').to(this, '_matchCase');\n wholeWordsOnlyModel.bind('isOn').to(this, '_wholeWordsOnly');\n // Update the state of the form when a switch is toggled.\n dropdownView.on('execute', evt => {\n if (evt.source._isMatchCaseSwitch) {\n this._matchCase = !this._matchCase;\n }\n else {\n this._wholeWordsOnly = !this._wholeWordsOnly;\n }\n // Toggling a switch makes the form dirty because this changes search criteria\n // just like typing text of the find input.\n this.isDirty = true;\n });\n addListToDropdown(dropdownView, new Collection([\n { type: 'switchbutton', model: matchCaseModel },\n { type: 'switchbutton', model: wholeWordsOnlyModel }\n ]));\n return dropdownView;\n }\n /**\n * Initializes the {@link #_focusables} and {@link #_focusTracker} to allow navigation\n * using <kbd>Tab</kbd> and <kbd>Shift</kbd>+<kbd>Tab</kbd> keystrokes in the right order.\n */\n _initFocusCycling() {\n const childViews = [\n this._findInputView,\n this._findButtonView,\n this._findPrevButtonView,\n this._findNextButtonView,\n this._replaceInputView,\n this._optionsDropdown,\n this._replaceButtonView,\n this._replaceAllButtonView\n ];\n childViews.forEach(v => {\n // Register the view as focusable.\n this._focusables.add(v);\n // Register the view in the focus tracker.\n this._focusTracker.add(v.element);\n });\n }\n /**\n * Initializes the keystroke handling in the form.\n */\n _initKeystrokeHandling() {\n const stopPropagation = (data) => data.stopPropagation();\n const stopPropagationAndPreventDefault = (data) => {\n data.stopPropagation();\n data.preventDefault();\n };\n // Start listening for the keystrokes coming from #element.\n this._keystrokes.listenTo(this.element);\n // Find the next result upon F3.\n this._keystrokes.set('f3', event => {\n stopPropagationAndPreventDefault(event);\n this._findNextButtonView.fire('execute');\n });\n // Find the previous result upon F3.\n this._keystrokes.set('shift+f3', event => {\n stopPropagationAndPreventDefault(event);\n this._findPrevButtonView.fire('execute');\n });\n // Find or replace upon pressing Enter in the find and replace fields.\n this._keystrokes.set('enter', event => {\n const target = event.target;\n if (target === this._findInputView.fieldView.element) {\n if (this._areCommandsEnabled.findNext) {\n this._findNextButtonView.fire('execute');\n }\n else {\n this._findButtonView.fire('execute');\n }\n stopPropagationAndPreventDefault(event);\n }\n else if (target === this._replaceInputView.fieldView.element && !this.isDirty) {\n this._replaceButtonView.fire('execute');\n stopPropagationAndPreventDefault(event);\n }\n });\n // Find previous upon pressing Shift+Enter in the find field.\n this._keystrokes.set('shift+enter', event => {\n const target = event.target;\n if (target !== this._findInputView.fieldView.element) {\n return;\n }\n if (this._areCommandsEnabled.findPrevious) {\n this._findPrevButtonView.fire('execute');\n }\n else {\n this._findButtonView.fire('execute');\n }\n stopPropagationAndPreventDefault(event);\n });\n // Since the form is in the dropdown panel which is a child of the toolbar, the toolbar's\n // keystroke handler would take over the key management in the URL input.\n // We need to prevent this ASAP. Otherwise, the basic caret movement using the arrow keys will be impossible.\n this._keystrokes.set('arrowright', stopPropagation);\n this._keystrokes.set('arrowleft', stopPropagation);\n this._keystrokes.set('arrowup', stopPropagation);\n this._keystrokes.set('arrowdown', stopPropagation);\n }\n /**\n * Creates a button view.\n *\n * @param options The properties of the `ButtonView`.\n * @returns The button view instance.\n */\n _createButton(options) {\n const button = new ButtonView(this.locale);\n button.set(options);\n return button;\n }\n /**\n * Creates a labeled input view.\n *\n * @param label The input label.\n * @returns The labeled input view instance.\n */\n _createInputField(label) {\n const labeledInput = new LabeledFieldView(this.locale, createLabeledInputText);\n labeledInput.label = label;\n return labeledInput;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module find-and-replace/findandreplaceui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { createDropdown, CssTransitionDisablerMixin } from 'ckeditor5/src/ui';\nimport FindAndReplaceFormView from './ui/findandreplaceformview';\nimport loupeIcon from '../theme/icons/find-replace.svg';\n/**\n * The default find and replace UI.\n *\n * It registers the `'findAndReplace'` UI button in the editor's {@link module:ui/componentfactory~ComponentFactory component factory}.\n * that uses the {@link module:find-and-replace/findandreplace~FindAndReplace FindAndReplace} plugin API.\n */\nexport default class FindAndReplaceUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'FindAndReplaceUI';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n this.formView = null;\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Register the toolbar dropdown component.\n editor.ui.componentFactory.add('findAndReplace', locale => {\n const dropdown = createDropdown(locale);\n // Dropdown should be disabled when in source editing mode. See #10001.\n const findCommand = editor.commands.get('find');\n dropdown.bind('isEnabled').to(findCommand);\n dropdown.once('change:isOpen', () => {\n this.formView = new (CssTransitionDisablerMixin(FindAndReplaceFormView))(editor.locale);\n dropdown.panelView.children.add(this.formView);\n this._setupFormView(this.formView);\n });\n // Every time a dropdown is opened, the search text field should get focused and selected for better UX.\n // Note: Using the low priority here to make sure the following listener starts working after\n // the default action of the drop-down is executed (i.e. the panel showed up). Otherwise,\n // the invisible form/input cannot be focused/selected.\n //\n // Each time a dropdown is closed, move the focus back to the find and replace toolbar button\n // and let the find and replace editing feature know that all search results can be invalidated\n // and no longer should be marked in the content.\n dropdown.on('change:isOpen', (event, name, isOpen) => {\n if (isOpen) {\n this.formView.disableCssTransitions();\n this.formView.reset();\n this.formView._findInputView.fieldView.select();\n this.formView.enableCssTransitions();\n }\n else {\n this.fire('searchReseted');\n }\n }, { priority: 'low' });\n this._setupDropdownButton(dropdown);\n return dropdown;\n });\n }\n /**\n * Sets up the find and replace button.\n */\n _setupDropdownButton(dropdown) {\n const editor = this.editor;\n const t = editor.locale.t;\n dropdown.buttonView.set({\n icon: loupeIcon,\n label: t('Find and replace'),\n keystroke: 'CTRL+F',\n tooltip: true\n });\n editor.keystrokes.set('Ctrl+F', (data, cancelEvent) => {\n if (dropdown.isEnabled) {\n dropdown.isOpen = true;\n cancelEvent();\n }\n });\n }\n /**\n * Sets up the form view for the find and replace.\n *\n * @param formView A related form view.\n */\n _setupFormView(formView) {\n const editor = this.editor;\n const commands = editor.commands;\n const findAndReplaceEditing = this.editor.plugins.get('FindAndReplaceEditing');\n const editingState = findAndReplaceEditing.state;\n const sortMapping = { before: -1, same: 0, after: 1, different: 1 };\n // Let the form know which result is being highlighted.\n formView.bind('highlightOffset').to(editingState, 'highlightedResult', highlightedResult => {\n if (!highlightedResult) {\n return 0;\n }\n return Array.from(editingState.results)\n .sort((a, b) => sortMapping[a.marker.getStart().compareWith(b.marker.getStart())])\n .indexOf(highlightedResult) + 1;\n });\n // Let the form know how many results were found in total.\n formView.listenTo(editingState.results, 'change', () => {\n formView.matchCount = editingState.results.length;\n });\n // Command states are used to enable/disable individual form controls.\n // To keep things simple, instead of binding 4 individual observables, there's only one that combines every\n // commands' isEnabled state. Yes, it will change more often but this simplifies the structure of the form.\n const findNextCommand = commands.get('findNext');\n const findPreviousCommand = commands.get('findPrevious');\n const replaceCommand = commands.get('replace');\n const replaceAllCommand = commands.get('replaceAll');\n formView.bind('_areCommandsEnabled').to(findNextCommand, 'isEnabled', findPreviousCommand, 'isEnabled', replaceCommand, 'isEnabled', replaceAllCommand, 'isEnabled', (findNext, findPrevious, replace, replaceAll) => ({ findNext, findPrevious, replace, replaceAll }));\n // The UI plugin works as an interface between the form and the editing part of the feature.\n formView.delegate('findNext', 'findPrevious', 'replace', 'replaceAll').to(this);\n // Let the feature know that search results are no longer relevant because the user changed the searched phrase\n // (or options) but didn't hit the \"Find\" button yet (e.g. still typing).\n formView.on('change:isDirty', (evt, data, isDirty) => {\n if (isDirty) {\n this.fire('searchReseted');\n }\n });\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m12.87 13.786 1.532-1.286 3.857 4.596a1 1 0 1 1-1.532 1.286l-3.857-4.596z\\\"/><path d=\\\"M16.004 8.5a6.5 6.5 0 0 1-9.216 5.905c-1.154-.53-.863-1.415-.663-1.615.194-.194.564-.592 1.635-.141a4.5 4.5 0 0 0 5.89-5.904l-.104-.227 1.332-1.331c.045-.046.196-.041.224.007a6.47 6.47 0 0 1 .902 3.306zm-3.4-5.715c.562.305.742 1.106.354 1.494-.388.388-.995.414-1.476.178a4.5 4.5 0 0 0-6.086 5.882l.114.236-1.348 1.349c-.038.037-.17.022-.198-.023a6.5 6.5 0 0 1 5.54-9.9 6.469 6.469 0 0 1 3.1.784z\\\"/><path d=\\\"M4.001 11.93.948 8.877a.2.2 0 0 1 .141-.341h6.106a.2.2 0 0 1 .141.341L4.283 11.93a.2.2 0 0 1-.282 0zm11.083-6.789 3.053 3.053a.2.2 0 0 1-.14.342H11.89a.2.2 0 0 1-.14-.342l3.052-3.053a.2.2 0 0 1 .282 0z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core';\n/**\n * The find command. It is used by the {@link module:find-and-replace/findandreplace~FindAndReplace find and replace feature}.\n */\nexport default class FindCommand extends Command {\n /**\n * Creates a new `FindCommand` instance.\n *\n * @param editor The editor on which this command will be used.\n * @param state An object to hold plugin state.\n */\n constructor(editor, state) {\n super(editor);\n // The find command is always enabled.\n this.isEnabled = true;\n // It does not affect data so should be enabled in read-only mode.\n this.affectsData = false;\n this._state = state;\n }\n /**\n * Executes the command.\n *\n * @param callbackOrText\n * @param options Options object.\n * @param options.matchCase If set to `true`, the letter case will be matched.\n * @param options.wholeWords If set to `true`, only whole words that match `callbackOrText` will be matched.\n *\n * @fires execute\n */\n execute(callbackOrText, { matchCase, wholeWords } = {}) {\n const { editor } = this;\n const { model } = editor;\n const findAndReplaceUtils = editor.plugins.get('FindAndReplaceUtils');\n let findCallback;\n // Allow to execute `find()` on a plugin with a keyword only.\n if (typeof callbackOrText === 'string') {\n findCallback = findAndReplaceUtils.findByTextCallback(callbackOrText, { matchCase, wholeWords });\n this._state.searchText = callbackOrText;\n }\n else {\n findCallback = callbackOrText;\n }\n // Initial search is done on all nodes in all roots inside the content.\n const results = model.document.getRootNames()\n .reduce(((currentResults, rootName) => findAndReplaceUtils.updateFindResultFromRange(model.createRangeIn(model.document.getRoot(rootName)), model, findCallback, currentResults)), null);\n this._state.clear(model);\n this._state.results.addMany(results);\n this._state.highlightedResult = results.get(0);\n if (typeof callbackOrText === 'string') {\n this._state.searchText = callbackOrText;\n }\n this._state.matchCase = !!matchCase;\n this._state.matchWholeWords = !!wholeWords;\n return {\n results,\n findCallback\n };\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module find-and-replace/replacecommandbase\n*/\nimport { Command } from 'ckeditor5/src/core';\nexport class ReplaceCommandBase extends Command {\n /**\n * Creates a new `ReplaceCommand` instance.\n *\n * @param editor Editor on which this command will be used.\n * @param state An object to hold plugin state.\n */\n constructor(editor, state) {\n super(editor);\n // The replace command is always enabled.\n this.isEnabled = true;\n this._state = state;\n // Since this command executes on particular result independent of selection, it should be checked directly in execute block.\n this._isEnabledBasedOnSelection = false;\n }\n /**\n * Common logic for both `replace` commands.\n * Replace a given find result by a string or a callback.\n *\n * @param result A single result from the find command.\n */\n _replace(replacementText, result) {\n const { model } = this.editor;\n const range = result.marker.getRange();\n // Don't replace a result that is in non-editable place.\n if (!model.canEditAt(range)) {\n return;\n }\n model.change(writer => {\n // Don't replace a result (marker) that found its way into the $graveyard (e.g. removed by collaborators).\n if (range.root.rootName === '$graveyard') {\n this._state.results.remove(result);\n return;\n }\n let textAttributes = {};\n for (const item of range.getItems()) {\n if (item.is('$text') || item.is('$textProxy')) {\n textAttributes = item.getAttributes();\n break;\n }\n }\n model.insertContent(writer.createText(replacementText, textAttributes), range);\n if (this._state.results.has(result)) {\n this._state.results.remove(result);\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { ReplaceCommandBase } from './replacecommandbase';\n/**\n * The replace command. It is used by the {@link module:find-and-replace/findandreplace~FindAndReplace find and replace feature}.\n */\nexport default class ReplaceCommand extends ReplaceCommandBase {\n /**\n * Replace a given find result by a string or a callback.\n *\n * @param result A single result from the find command.\n *\n * @fires execute\n */\n execute(replacementText, result) {\n this._replace(replacementText, result);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module find-and-replace/replaceallcommand\n */\nimport { Collection } from 'ckeditor5/src/utils';\nimport { ReplaceCommandBase } from './replacecommandbase';\n/**\n * The replace all command. It is used by the {@link module:find-and-replace/findandreplace~FindAndReplace find and replace feature}.\n */\nexport default class ReplaceAllCommand extends ReplaceCommandBase {\n /**\n * Replaces all the occurrences of `textToReplace` with a given `newText` string.\n *\n * ```ts\n *\treplaceAllCommand.execute( 'replaceAll', 'new text replacement', 'text to replace' );\n * ```\n *\n * Alternatively you can call it from editor instance:\n *\n * ```ts\n *\teditor.execute( 'replaceAll', 'new text', 'old text' );\n * ```\n *\n * @param newText Text that will be inserted to the editor for each match.\n * @param textToReplace Text to be replaced or a collection of matches\n * as returned by the find command.\n *\n * @fires module:core/command~Command#event:execute\n */\n execute(newText, textToReplace) {\n const { editor } = this;\n const { model } = editor;\n const findAndReplaceUtils = editor.plugins.get('FindAndReplaceUtils');\n const results = textToReplace instanceof Collection ?\n textToReplace : model.document.getRootNames()\n .reduce(((currentResults, rootName) => findAndReplaceUtils.updateFindResultFromRange(model.createRangeIn(model.document.getRoot(rootName)), model, findAndReplaceUtils.findByTextCallback(textToReplace, this._state), currentResults)), null);\n if (results.length) {\n [...results].forEach(searchResult => {\n // Just reuse logic from the replace command to replace a single match.\n this._replace(newText, searchResult);\n });\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module find-and-replace/findnextcommand\n*/\nimport { Command } from 'ckeditor5/src/core';\n/**\n * The find next command. Moves the highlight to the next search result.\n *\n * It is used by the {@link module:find-and-replace/findandreplace~FindAndReplace find and replace feature}.\n */\nexport default class FindNextCommand extends Command {\n /**\n * Creates a new `FindNextCommand` instance.\n *\n * @param editor The editor on which this command will be used.\n * @param state An object to hold plugin state.\n */\n constructor(editor, state) {\n super(editor);\n // It does not affect data so should be enabled in read-only mode.\n this.affectsData = false;\n this._state = state;\n this.isEnabled = false;\n this.listenTo(this._state.results, 'change', () => {\n this.isEnabled = this._state.results.length > 1;\n });\n }\n /**\n * @inheritDoc\n */\n refresh() {\n this.isEnabled = this._state.results.length > 1;\n }\n /**\n * @inheritDoc\n */\n execute() {\n const results = this._state.results;\n const currentIndex = results.getIndex(this._state.highlightedResult);\n const nextIndex = currentIndex + 1 >= results.length ?\n 0 : currentIndex + 1;\n this._state.highlightedResult = this._state.results.get(nextIndex);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module find-and-replace/findpreviouscommand\n*/\nimport FindNextCommand from './findnextcommand';\n/**\n * The find previous command. Moves the highlight to the previous search result.\n *\n * It is used by the {@link module:find-and-replace/findandreplace~FindAndReplace find and replace feature}.\n */\nexport default class FindPreviousCommand extends FindNextCommand {\n /**\n * @inheritDoc\n */\n execute() {\n const results = this._state.results;\n const currentIndex = results.getIndex(this._state.highlightedResult);\n const previousIndex = currentIndex - 1 < 0 ?\n this._state.results.length - 1 : currentIndex - 1;\n this._state.highlightedResult = this._state.results.get(previousIndex);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { ObservableMixin, Collection } from 'ckeditor5/src/utils';\n/**\n * The object storing find and replace plugin state for a given editor instance.\n */\nexport default class FindAndReplaceState extends ObservableMixin() {\n /**\n * Creates an instance of the state.\n */\n constructor(model) {\n super();\n this.set('results', new Collection());\n this.set('highlightedResult', null);\n this.set('searchText', '');\n this.set('replaceText', '');\n this.set('matchCase', false);\n this.set('matchWholeWords', false);\n this.results.on('change', (eventInfo, { removed, index }) => {\n if (Array.from(removed).length) {\n let highlightedResultRemoved = false;\n model.change(writer => {\n for (const removedResult of removed) {\n if (this.highlightedResult === removedResult) {\n highlightedResultRemoved = true;\n }\n if (model.markers.has(removedResult.marker.name)) {\n writer.removeMarker(removedResult.marker);\n }\n }\n });\n if (highlightedResultRemoved) {\n const nextHighlightedIndex = index >= this.results.length ? 0 : index;\n this.highlightedResult = this.results.get(nextHighlightedIndex);\n }\n }\n });\n }\n /**\n * Cleans the state up and removes markers from the model.\n */\n clear(model) {\n this.searchText = '';\n model.change(writer => {\n if (this.highlightedResult) {\n const oldMatchId = this.highlightedResult.marker.name.split(':')[1];\n const oldMarker = model.markers.get(`findResultHighlighted:${oldMatchId}`);\n if (oldMarker) {\n writer.removeMarker(oldMarker);\n }\n }\n [...this.results].forEach(({ marker }) => {\n writer.removeMarker(marker);\n });\n });\n this.results.clear();\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Collection, uid } from 'ckeditor5/src/utils';\nimport { escapeRegExp } from 'lodash-es';\n/**\n * A set of helpers related to find and replace.\n */\nexport default class FindAndReplaceUtils extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'FindAndReplaceUtils';\n }\n /**\n * Executes findCallback and updates search results list.\n *\n * @param range The model range to scan for matches.\n * @param model The model.\n * @param findCallback The callback that should return `true` if provided text matches the search term.\n * @param startResults An optional collection of find matches that the function should\n * start with. This would be a collection returned by a previous `updateFindResultFromRange()` call.\n * @returns A collection of objects describing find match.\n *\n * An example structure:\n *\n * ```js\n * {\n *\tid: resultId,\n *\tlabel: foundItem.label,\n *\tmarker\n *\t}\n * ```\n */\n updateFindResultFromRange(range, model, findCallback, startResults) {\n const results = startResults || new Collection();\n model.change(writer => {\n [...range].forEach(({ type, item }) => {\n if (type === 'elementStart') {\n if (model.schema.checkChild(item, '$text')) {\n const foundItems = findCallback({\n item,\n text: this.rangeToText(model.createRangeIn(item))\n });\n if (!foundItems) {\n return;\n }\n foundItems.forEach(foundItem => {\n const resultId = `findResult:${uid()}`;\n const marker = writer.addMarker(resultId, {\n usingOperation: false,\n affectsData: false,\n range: writer.createRange(writer.createPositionAt(item, foundItem.start), writer.createPositionAt(item, foundItem.end))\n });\n const index = findInsertIndex(results, marker);\n results.add({\n id: resultId,\n label: foundItem.label,\n marker\n }, index);\n });\n }\n }\n });\n });\n return results;\n }\n /**\n * Returns text representation of a range. The returned text length should be the same as range length.\n * In order to achieve this, this function will replace inline elements (text-line) as new line character (\"\\n\").\n *\n * @param range The model range.\n * @returns The text content of the provided range.\n */\n rangeToText(range) {\n return Array.from(range.getItems()).reduce((rangeText, node) => {\n // Trim text to a last occurrence of an inline element and update range start.\n if (!(node.is('$text') || node.is('$textProxy'))) {\n // Editor has only one inline element defined in schema: `<softBreak>` which is treated as new line character in blocks.\n // Special handling might be needed for other inline elements (inline widgets).\n return `${rangeText}\\n`;\n }\n return rangeText + node.data;\n }, '');\n }\n /**\n * Creates a text matching callback for a specified search term and matching options.\n *\n * @param searchTerm The search term.\n * @param options Matching options.\n * \t- options.matchCase=false If set to `true` letter casing will be ignored.\n * \t- options.wholeWords=false If set to `true` only whole words that match `callbackOrText` will be matched.\n */\n findByTextCallback(searchTerm, options) {\n let flags = 'gu';\n if (!options.matchCase) {\n flags += 'i';\n }\n let regExpQuery = `(${escapeRegExp(searchTerm)})`;\n if (options.wholeWords) {\n const nonLetterGroup = '[^a-zA-Z\\u00C0-\\u024F\\u1E00-\\u1EFF]';\n if (!new RegExp('^' + nonLetterGroup).test(searchTerm)) {\n regExpQuery = `(^|${nonLetterGroup}|_)${regExpQuery}`;\n }\n if (!new RegExp(nonLetterGroup + '$').test(searchTerm)) {\n regExpQuery = `${regExpQuery}(?=_|${nonLetterGroup}|$)`;\n }\n }\n const regExp = new RegExp(regExpQuery, flags);\n function findCallback({ text }) {\n const matches = [...text.matchAll(regExp)];\n return matches.map(regexpMatchToFindResult);\n }\n return findCallback;\n }\n}\n// Finds the appropriate index in the resultsList Collection.\nfunction findInsertIndex(resultsList, markerToInsert) {\n const result = resultsList.find(({ marker }) => {\n return markerToInsert.getStart().isBefore(marker.getStart());\n });\n return result ? resultsList.getIndex(result) : resultsList.length;\n}\n/**\n * Maps RegExp match result to find result.\n */\nfunction regexpMatchToFindResult(matchResult) {\n const lastGroupIndex = matchResult.length - 1;\n let startOffset = matchResult.index;\n // Searches with match all flag have an extra matching group with empty string or white space matched before the word.\n // If the search term starts with the space already, there is no extra group even with match all flag on.\n if (matchResult.length === 3) {\n startOffset += matchResult[1].length;\n }\n return {\n label: matchResult[lastGroupIndex],\n start: startOffset,\n end: startOffset + matchResult[lastGroupIndex].length\n };\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./findandreplace.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module find-and-replace/findandreplaceediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\n// eslint-disable-next-line ckeditor5-rules/ckeditor-imports\nimport { scrollViewportToShowTarget } from '@ckeditor/ckeditor5-utils/src/dom/scroll';\nimport FindCommand from './findcommand';\nimport ReplaceCommand from './replacecommand';\nimport ReplaceAllCommand from './replaceallcommand';\nimport FindNextCommand from './findnextcommand';\nimport FindPreviousCommand from './findpreviouscommand';\nimport FindAndReplaceState from './findandreplacestate';\nimport FindAndReplaceUtils from './findandreplaceutils';\nimport { debounce } from 'lodash-es';\nimport '../theme/findandreplace.css';\nconst HIGHLIGHT_CLASS = 'ck-find-result_selected';\n/**\n * Reacts to document changes in order to update search list.\n */\nfunction onDocumentChange(results, editor, searchCallback) {\n const changedNodes = new Set();\n const removedMarkers = new Set();\n const model = editor.model;\n const changes = model.document.differ.getChanges();\n // Get nodes in which changes happened to re-run a search callback on them.\n changes.forEach(change => {\n if (change.name === '$text' || model.schema.isInline(change.position.nodeAfter)) {\n changedNodes.add(change.position.parent);\n [...model.markers.getMarkersAtPosition(change.position)].forEach(markerAtChange => {\n removedMarkers.add(markerAtChange.name);\n });\n }\n else if (change.type === 'insert') {\n changedNodes.add(change.position.nodeAfter);\n }\n });\n // Get markers from removed nodes also.\n model.document.differ.getChangedMarkers().forEach(({ name, data: { newRange } }) => {\n if (newRange && newRange.start.root.rootName === '$graveyard') {\n removedMarkers.add(name);\n }\n });\n // Get markers from the updated nodes and remove all (search will be re-run on these nodes).\n changedNodes.forEach(node => {\n const markersInNode = [...model.markers.getMarkersIntersectingRange(model.createRangeIn(node))];\n markersInNode.forEach(marker => removedMarkers.add(marker.name));\n });\n // Remove results & markers from the changed part of content.\n model.change(writer => {\n removedMarkers.forEach(markerName => {\n // Remove the result first - in order to prevent rendering a removed marker.\n if (results.has(markerName)) {\n results.remove(markerName);\n }\n writer.removeMarker(markerName);\n });\n });\n // Run search callback again on updated nodes.\n changedNodes.forEach(nodeToCheck => {\n const findAndReplaceUtils = editor.plugins.get('FindAndReplaceUtils');\n findAndReplaceUtils.updateFindResultFromRange(model.createRangeOn(nodeToCheck), model, searchCallback, results);\n });\n}\n/**\n * Implements the editing part for find and replace plugin. For example conversion, commands etc.\n */\nexport default class FindAndReplaceEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [FindAndReplaceUtils];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'FindAndReplaceEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n this._activeResults = null;\n this.state = new FindAndReplaceState(this.editor.model);\n this._defineConverters();\n this._defineCommands();\n this.listenTo(this.state, 'change:highlightedResult', (eventInfo, name, newValue, oldValue) => {\n const { model } = this.editor;\n model.change(writer => {\n if (oldValue) {\n const oldMatchId = oldValue.marker.name.split(':')[1];\n const oldMarker = model.markers.get(`findResultHighlighted:${oldMatchId}`);\n if (oldMarker) {\n writer.removeMarker(oldMarker);\n }\n }\n if (newValue) {\n const newMatchId = newValue.marker.name.split(':')[1];\n writer.addMarker(`findResultHighlighted:${newMatchId}`, {\n usingOperation: false,\n affectsData: false,\n range: newValue.marker.getRange()\n });\n }\n });\n });\n /* istanbul ignore next -- @preserve */\n const scrollToHighlightedResult = (eventInfo, name, newValue) => {\n if (newValue) {\n const domConverter = this.editor.editing.view.domConverter;\n const viewRange = this.editor.editing.mapper.toViewRange(newValue.marker.getRange());\n scrollViewportToShowTarget({\n target: domConverter.viewRangeToDom(viewRange),\n viewportOffset: 40\n });\n }\n };\n const debouncedScrollListener = debounce(scrollToHighlightedResult.bind(this), 32);\n // Debounce scroll as highlight might be changed very frequently, e.g. when there's a replace all command.\n this.listenTo(this.state, 'change:highlightedResult', debouncedScrollListener, { priority: 'low' });\n // It's possible that the editor will get destroyed before debounced call kicks in.\n // This would result with accessing a view three that is no longer in DOM.\n this.listenTo(this.editor, 'destroy', debouncedScrollListener.cancel);\n }\n /**\n * Initiate a search.\n */\n find(callbackOrText) {\n const { editor } = this;\n const { model } = editor;\n const { findCallback, results } = editor.execute('find', callbackOrText);\n this._activeResults = results;\n // @todo: handle this listener, another copy is in findcommand.js file.\n this.listenTo(model.document, 'change:data', () => onDocumentChange(this._activeResults, editor, findCallback));\n return this._activeResults;\n }\n /**\n * Stops active results from updating, and clears out the results.\n */\n stop() {\n if (!this._activeResults) {\n return;\n }\n this.stopListening(this.editor.model.document);\n this.state.clear(this.editor.model);\n this._activeResults = null;\n }\n /**\n * Sets up the commands.\n */\n _defineCommands() {\n this.editor.commands.add('find', new FindCommand(this.editor, this.state));\n this.editor.commands.add('findNext', new FindNextCommand(this.editor, this.state));\n this.editor.commands.add('findPrevious', new FindPreviousCommand(this.editor, this.state));\n this.editor.commands.add('replace', new ReplaceCommand(this.editor, this.state));\n this.editor.commands.add('replaceAll', new ReplaceAllCommand(this.editor, this.state));\n }\n /**\n * Sets up the marker downcast converters for search results highlighting.\n */\n _defineConverters() {\n const { editor } = this;\n // Setup the marker highlighting conversion.\n editor.conversion.for('editingDowncast').markerToHighlight({\n model: 'findResult',\n view: ({ markerName }) => {\n const [, id] = markerName.split(':');\n // Marker removal from the view has a bug: https://github.com/ckeditor/ckeditor5/issues/7499\n // A minimal option is to return a new object for each converted marker...\n return {\n name: 'span',\n classes: ['ck-find-result'],\n attributes: {\n // ...however, adding a unique attribute should be future-proof..\n 'data-find-result': id\n }\n };\n }\n });\n editor.conversion.for('editingDowncast').markerToHighlight({\n model: 'findResultHighlighted',\n view: ({ markerName }) => {\n const [, id] = markerName.split(':');\n // Marker removal from the view has a bug: https://github.com/ckeditor/ckeditor5/issues/7499\n // A minimal option is to return a new object for each converted marker...\n return {\n name: 'span',\n classes: [HIGHLIGHT_CLASS],\n attributes: {\n // ...however, adding a unique attribute should be future-proof..\n 'data-find-result': id\n }\n };\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module font/fontcommand\n */\nimport { Command } from 'ckeditor5/src/core';\n/**\n * The base font command.\n */\nexport default class FontCommand extends Command {\n /**\n * Creates an instance of the command.\n *\n * @param editor Editor instance.\n * @param attributeKey The name of a model attribute on which this command operates.\n */\n constructor(editor, attributeKey) {\n super(editor);\n this.attributeKey = attributeKey;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const model = this.editor.model;\n const doc = model.document;\n this.value = doc.selection.getAttribute(this.attributeKey);\n this.isEnabled = model.schema.checkAttributeInSelection(doc.selection, this.attributeKey);\n }\n /**\n * Executes the command. Applies the `value` of the {@link #attributeKey} to the selection.\n * If no `value` is passed, it removes the attribute from the selection.\n *\n * @param options Options for the executed command.\n * @param options.value The value to apply.\n * @fires execute\n */\n execute(options = {}) {\n const model = this.editor.model;\n const document = model.document;\n const selection = document.selection;\n const value = options.value;\n const batch = options.batch;\n const updateAttribute = (writer) => {\n if (selection.isCollapsed) {\n if (value) {\n writer.setSelectionAttribute(this.attributeKey, value);\n }\n else {\n writer.removeSelectionAttribute(this.attributeKey);\n }\n }\n else {\n const ranges = model.schema.getValidRanges(selection.getRanges(), this.attributeKey);\n for (const range of ranges) {\n if (value) {\n writer.setAttribute(this.attributeKey, value, range);\n }\n else {\n writer.removeAttribute(this.attributeKey, range);\n }\n }\n }\n };\n // In some scenarios, you may want to use a single undo step for multiple changes (e.g. in color picker).\n if (batch) {\n model.enqueueChange(batch, writer => {\n updateAttribute(writer);\n });\n }\n else {\n model.change(writer => {\n updateAttribute(writer);\n });\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Collection, ObservableMixin } from 'ckeditor5/src/utils';\n/**\n * A collection to store document colors. It enforces colors to be unique.\n */\nexport default class DocumentColorCollection extends ObservableMixin((Collection)) {\n constructor(options) {\n super(options);\n this.set('isEmpty', true);\n this.on('change', () => {\n this.set('isEmpty', this.length === 0);\n });\n }\n /**\n * Adds a color to the document color collection.\n *\n * This method ensures that no color duplicates are inserted (compared using\n * the color value of the {@link module:ui/colorgrid/colorgridview~ColorDefinition}).\n *\n * If the item does not have an ID, it will be automatically generated and set on the item.\n *\n * @param index The position of the item in the collection. The item is pushed to the collection when `index` is not specified.\n * @fires add\n * @fires change\n */\n add(item, index) {\n if (this.find(element => element.color === item.color)) {\n // No duplicates are allowed.\n return this;\n }\n return super.add(item, index);\n }\n /**\n * Checks if an object with given colors is present in the document color collection.\n */\n hasColor(color) {\n return !!this.find(item => item.color === color);\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./fontcolor.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module font/ui/colortableview\n */\nimport { icons } from 'ckeditor5/src/core';\nimport { ButtonView, ColorGridView, ColorTileView, FocusCycler, LabelView, Template, View, ViewCollection, ColorPickerView, icons as uiIcons } from 'ckeditor5/src/ui';\nimport { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils';\nimport DocumentColorCollection from '../documentcolorcollection';\nimport '../../theme/fontcolor.css';\n/**\n * A class which represents a view with the following subcomponents:\n *\n * * A {@link module:font/ui/colortableview~ColorTableView#colorGridsPageView color grids component},\n * * A {@link module:font/ui/colortableview~ColorTableView#colorPickerPageView color picker component}.\n */\nexport default class ColorTableView extends View {\n /**\n * Creates a view to be inserted as a child of {@link module:ui/dropdown/dropdownview~DropdownView}.\n *\n * @param locale The localization services instance.\n * @param colors An array with definitions of colors to be displayed in the table.\n * @param columns The number of columns in the color grid.\n * @param removeButtonLabel The label of the button responsible for removing the color.\n * @param colorPickerLabel The label of the button responsible for color picker appearing.\n * @param documentColorsLabel The label for the section with the document colors.\n * @param documentColorsCount The number of colors in the document colors section inside the color dropdown.\n * @param colorPickerConfig The configuration of color picker feature.\n */\n constructor(locale, { colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount, colorPickerLabel, colorPickerConfig }) {\n super(locale);\n this.items = this.createCollection();\n this.focusTracker = new FocusTracker();\n this.keystrokes = new KeystrokeHandler();\n this._focusables = new ViewCollection();\n this._colorPickerConfig = colorPickerConfig;\n this._focusCycler = new FocusCycler({\n focusables: this._focusables,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate list items backwards using the <kbd>Shift</kbd> + <kbd>Tab</kbd> keystroke.\n focusPrevious: 'shift + tab',\n // Navigate list items forwards using the <kbd>Tab</kbd> key.\n focusNext: 'tab'\n }\n });\n this.colorGridsPageView = new ColorGridsPageView(locale, {\n colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount, colorPickerLabel,\n focusTracker: this.focusTracker,\n focusables: this._focusables\n });\n this.colorPickerPageView = new ColorPickerPageView(locale, {\n focusables: this._focusables,\n focusTracker: this.focusTracker,\n keystrokes: this.keystrokes,\n colorPickerConfig\n });\n this.set('_isColorGridsPageVisible', true);\n this.set('_isColorPickerPageVisible', false);\n this.set('selectedColor', undefined);\n this.colorGridsPageView.bind('isVisible').to(this, '_isColorGridsPageVisible');\n this.colorPickerPageView.bind('isVisible').to(this, '_isColorPickerPageVisible');\n /**\n * This is kind of bindings. Unfortunately we could not use this.bind() method because the same property\n * can not be binded twice. So this is work around how to bind 'selectedColor' property between components.\n */\n this.on('change:selectedColor', (evt, evtName, data) => {\n this.colorGridsPageView.set('selectedColor', data);\n this.colorPickerPageView.set('selectedColor', data);\n });\n this.colorGridsPageView.on('change:selectedColor', (evt, evtName, data) => {\n this.set('selectedColor', data);\n });\n this.colorPickerPageView.on('change:selectedColor', (evt, evtName, data) => {\n this.set('selectedColor', data);\n });\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-color-table'\n ]\n },\n children: this.items\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n // Start listening for the keystrokes coming from #element.\n this.keystrokes.listenTo(this.element);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Appends static and document color grid views.\n */\n appendGrids() {\n if (this.items.length) {\n return;\n }\n this.items.add(this.colorGridsPageView);\n this.colorGridsPageView.delegate('execute').to(this);\n this.colorGridsPageView.delegate('showColorPicker').to(this);\n }\n /**\n * Renders UI in dropdown. Which sub-components are rendered\n * depends on the component configuration.\n */\n appendUI() {\n this.appendGrids();\n if (this._colorPickerConfig) {\n this._appendColorPicker();\n }\n }\n /**\n * Show \"Color picker\" and hide \"Color grids\".\n */\n showColorPicker() {\n if (!this.colorPickerPageView.colorPickerView) {\n return;\n }\n this.set('_isColorPickerPageVisible', true);\n this.colorPickerPageView.focus();\n this.set('_isColorGridsPageVisible', false);\n }\n /**\n * Show \"Color grids\" and hide \"Color picker\".\n */\n showColorGrids() {\n this.set('_isColorGridsPageVisible', true);\n this.set('_isColorPickerPageVisible', false);\n }\n /**\n * Focuses the first focusable element in {@link #items}.\n */\n focus() {\n this._focusCycler.focusFirst();\n }\n /**\n * Focuses the last focusable element in {@link #items}.\n */\n focusLast() {\n this._focusCycler.focusLast();\n }\n /**\n * Scans through the editor model and searches for text node attributes with the given attribute name.\n * Found entries are set as document colors.\n *\n * All the previously stored document colors will be lost in the process.\n *\n * @param model The model used as a source to obtain the document colors.\n * @param attributeName Determines the name of the related model's attribute for a given dropdown.\n */\n updateDocumentColors(model, attributeName) {\n this.colorGridsPageView.updateDocumentColors(model, attributeName);\n }\n /**\n * Refreshes the state of the selected color in one or both {@link module:ui/colorgrid/colorgridview~ColorGridView}s\n * available in the {@link module:font/ui/colortableview~ColorTableView}. It guarantees that the selection will occur only in one\n * of them.\n */\n updateSelectedColors() {\n this.colorGridsPageView.updateSelectedColors();\n }\n /**\n * Appends the color picker view.\n */\n _appendColorPicker() {\n if (this.items.length === 2) {\n return;\n }\n this.items.add(this.colorPickerPageView);\n if (this.colorGridsPageView.colorPickerButtonView) {\n this.colorGridsPageView.colorPickerButtonView.on('execute', () => {\n this.showColorPicker();\n });\n }\n this.colorGridsPageView.addColorPickerButton();\n this.colorPickerPageView.delegate('execute').to(this);\n this.colorPickerPageView.delegate('cancel').to(this);\n }\n}\n/**\n * A class which represents a view with the following subcomponents:\n *\n * * A remove color button,\n * * A static {@link module:ui/colorgrid/colorgridview~ColorGridView} of colors defined in the configuration,\n * * A dynamic {@link module:ui/colorgrid/colorgridview~ColorGridView} of colors used in the document.\n * * If color picker is configured, the \"Color Picker\" button is visible too.\n */\nclass ColorGridsPageView extends View {\n /**\n * Creates a view to be inserted as a child of {@link module:ui/dropdown/dropdownview~DropdownView}.\n *\n * @param locale The localization services instance.\n * @param colors An array with definitions of colors to be displayed in the table.\n * @param columns The number of columns in the color grid.\n * @param removeButtonLabel The label of the button responsible for removing the color.\n * @param colorPickerLabel The label of the button responsible for color picker appearing.\n * @param documentColorsLabel The label for the section with the document colors.\n * @param documentColorsCount The number of colors in the document colors section inside the color dropdown.\n * @param focusTracker Tracks information about the DOM focus in the list.\n * @param focusables A collection of views that can be focused in the view.\n */\n constructor(locale, { colors, columns, removeButtonLabel, documentColorsLabel, documentColorsCount, colorPickerLabel, focusTracker, focusables }) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('isVisible', true);\n this.focusTracker = focusTracker;\n this.items = this.createCollection();\n this.colorDefinitions = colors;\n this.columns = columns;\n this.documentColors = new DocumentColorCollection();\n this.documentColorsCount = documentColorsCount;\n this._focusables = focusables;\n this._removeButtonLabel = removeButtonLabel;\n this._colorPickerLabel = colorPickerLabel;\n this._documentColorsLabel = documentColorsLabel;\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck-color-grids-page-view',\n bind.if('isVisible', 'ck-hidden', value => !value)\n ]\n },\n children: this.items\n });\n this.removeColorButtonView = this._createRemoveColorButton();\n this.items.add(this.removeColorButtonView);\n }\n /**\n * Scans through the editor model and searches for text node attributes with the given attribute name.\n * Found entries are set as document colors.\n *\n * All the previously stored document colors will be lost in the process.\n *\n * @param model The model used as a source to obtain the document colors.\n * @param attributeName Determines the name of the related model's attribute for a given dropdown.\n */\n updateDocumentColors(model, attributeName) {\n const document = model.document;\n const maxCount = this.documentColorsCount;\n this.documentColors.clear();\n for (const rootName of document.getRootNames()) {\n const root = document.getRoot(rootName);\n const range = model.createRangeIn(root);\n for (const node of range.getItems()) {\n if (node.is('$textProxy') && node.hasAttribute(attributeName)) {\n this._addColorToDocumentColors(node.getAttribute(attributeName));\n if (this.documentColors.length >= maxCount) {\n return;\n }\n }\n }\n }\n }\n /**\n * Refreshes the state of the selected color in one or both {@link module:ui/colorgrid/colorgridview~ColorGridView}s\n * available in the {@link module:font/ui/colortableview~ColorTableView}. It guarantees that the selection will occur only in one\n * of them.\n */\n updateSelectedColors() {\n const documentColorsGrid = this.documentColorsGrid;\n const staticColorsGrid = this.staticColorsGrid;\n const selectedColor = this.selectedColor;\n staticColorsGrid.selectedColor = selectedColor;\n if (documentColorsGrid) {\n documentColorsGrid.selectedColor = selectedColor;\n }\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.staticColorsGrid = this._createStaticColorsGrid();\n this.items.add(this.staticColorsGrid);\n if (this.documentColorsCount) {\n // Create a label for document colors.\n const bind = Template.bind(this.documentColors, this.documentColors);\n const label = new LabelView(this.locale);\n label.text = this._documentColorsLabel;\n label.extendTemplate({\n attributes: {\n class: [\n 'ck',\n 'ck-color-grid__label',\n bind.if('isEmpty', 'ck-hidden')\n ]\n }\n });\n this.items.add(label);\n this.documentColorsGrid = this._createDocumentColorsGrid();\n this.items.add(this.documentColorsGrid);\n }\n this._createColorPickerButton();\n this._addColorTablesElementsToFocusTracker();\n this.focus();\n }\n /**\n * Focuses the component.\n */\n focus() {\n this.removeColorButtonView.focus();\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n }\n /**\n * Handles displaying the color picker button (if it was previously created) and making it focusable.\n */\n addColorPickerButton() {\n if (this.colorPickerButtonView) {\n this.items.add(this.colorPickerButtonView);\n this.focusTracker.add(this.colorPickerButtonView.element);\n this._focusables.add(this.colorPickerButtonView);\n }\n }\n /**\n * Adds color table elements to focus tracker.\n */\n _addColorTablesElementsToFocusTracker() {\n this.focusTracker.add(this.removeColorButtonView.element);\n this._focusables.add(this.removeColorButtonView);\n if (this.staticColorsGrid) {\n this.focusTracker.add(this.staticColorsGrid.element);\n this._focusables.add(this.staticColorsGrid);\n }\n if (this.documentColorsGrid) {\n this.focusTracker.add(this.documentColorsGrid.element);\n this._focusables.add(this.documentColorsGrid);\n }\n }\n /**\n * Creates the button responsible for displaying the color picker component.\n */\n _createColorPickerButton() {\n this.colorPickerButtonView = new ButtonView();\n this.colorPickerButtonView.set({\n label: this._colorPickerLabel,\n withText: true,\n icon: uiIcons.colorPaletteIcon,\n class: 'ck-color-table__color-picker'\n });\n this.colorPickerButtonView.on('execute', () => {\n this.fire('showColorPicker');\n });\n }\n /**\n * Adds the remove color button as a child of the current view.\n */\n _createRemoveColorButton() {\n const buttonView = new ButtonView();\n buttonView.set({\n withText: true,\n icon: icons.eraser,\n label: this._removeButtonLabel\n });\n buttonView.class = 'ck-color-table__remove-color';\n buttonView.on('execute', () => {\n this.fire('execute', {\n value: null,\n source: 'removeColorButton'\n });\n });\n buttonView.render();\n return buttonView;\n }\n /**\n * Creates a static color table grid based on the editor configuration.\n */\n _createStaticColorsGrid() {\n const colorGrid = new ColorGridView(this.locale, {\n colorDefinitions: this.colorDefinitions,\n columns: this.columns\n });\n colorGrid.on('execute', (evt, data) => {\n this.fire('execute', {\n value: data.value,\n source: 'staticColorsGrid'\n });\n });\n return colorGrid;\n }\n /**\n * Creates the document colors section view and binds it to {@link #documentColors}.\n */\n _createDocumentColorsGrid() {\n const bind = Template.bind(this.documentColors, this.documentColors);\n const documentColorsGrid = new ColorGridView(this.locale, {\n columns: this.columns\n });\n documentColorsGrid.extendTemplate({\n attributes: {\n class: bind.if('isEmpty', 'ck-hidden')\n }\n });\n documentColorsGrid.items.bindTo(this.documentColors).using(colorObj => {\n const colorTile = new ColorTileView();\n colorTile.set({\n color: colorObj.color,\n hasBorder: colorObj.options && colorObj.options.hasBorder\n });\n if (colorObj.label) {\n colorTile.set({\n label: colorObj.label,\n tooltip: true\n });\n }\n colorTile.on('execute', () => {\n this.fire('execute', {\n value: colorObj.color,\n source: 'documentColorsGrid'\n });\n });\n return colorTile;\n });\n // Selected color should be cleared when document colors became empty.\n this.documentColors.on('change:isEmpty', (evt, name, val) => {\n if (val) {\n documentColorsGrid.selectedColor = null;\n }\n });\n return documentColorsGrid;\n }\n /**\n * Adds a given color to the document colors list. If possible, the method will attempt to use\n * data from the {@link #colorDefinitions} (label, color options).\n *\n * @param color A string that stores the value of the recently applied color.\n */\n _addColorToDocumentColors(color) {\n const predefinedColor = this.colorDefinitions\n .find(definition => definition.color === color);\n if (!predefinedColor) {\n this.documentColors.add({\n color,\n label: color,\n options: {\n hasBorder: false\n }\n });\n }\n else {\n this.documentColors.add(Object.assign({}, predefinedColor));\n }\n }\n}\n/**\n * A class which represents a color picker component view with the following subcomponents:\n *\n * * Color picker saturation and hue sliders,\n * * Input accepting colors in HEX format,\n * * \"Save\" and \"Cancel\" action buttons.\n */\nclass ColorPickerPageView extends View {\n /**\n * @param locale The localization services instance.\n * @param focusTracker Tracks information about the DOM focus in the list.\n * @param focusables A collection of views that can be focused in the view..\n * @param keystrokes An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.\n * @param colorPickerConfig The configuration of color picker feature.\n */\n constructor(locale, { focusTracker, focusables, keystrokes, colorPickerConfig }) {\n super(locale);\n this.items = this.createCollection();\n this.focusTracker = focusTracker;\n this.keystrokes = keystrokes;\n this.set('isVisible', false);\n this.set('selectedColor', undefined);\n this._focusables = focusables;\n this._pickerConfig = colorPickerConfig;\n const bind = this.bindTemplate;\n const { saveButtonView, cancelButtonView } = this._createActionButtons();\n this.saveButtonView = saveButtonView;\n this.cancelButtonView = cancelButtonView;\n this.actionBarView = this._createActionBarView({ saveButtonView, cancelButtonView });\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck-color-picker-page-view',\n bind.if('isVisible', 'ck-hidden', value => !value)\n ]\n },\n children: this.items\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n const colorPickerView = new ColorPickerView(this.locale, this._pickerConfig);\n this.colorPickerView = colorPickerView;\n this.colorPickerView.render();\n if (this.selectedColor) {\n colorPickerView.color = this.selectedColor;\n }\n this.listenTo(this, 'change:selectedColor', (evt, name, value) => {\n colorPickerView.color = value;\n });\n this.items.add(this.colorPickerView);\n this.items.add(this.actionBarView);\n this._addColorPickersElementsToFocusTracker();\n this._stopPropagationOnArrowsKeys();\n this._executeOnEnterPress();\n this._executeUponColorChange();\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n }\n /**\n * Focuses the color picker.\n */\n focus() {\n this.colorPickerView.focus();\n }\n /**\n * When color picker is focused and \"enter\" is pressed it executes command.\n */\n _executeOnEnterPress() {\n this.keystrokes.set('enter', evt => {\n if (this.isVisible && this.focusTracker.focusedElement !== this.cancelButtonView.element) {\n this.fire('execute', {\n value: this.selectedColor\n });\n evt.stopPropagation();\n evt.preventDefault();\n }\n });\n }\n /**\n * Removes default behavior of arrow keys in dropdown.\n */\n _stopPropagationOnArrowsKeys() {\n const stopPropagation = (data) => data.stopPropagation();\n this.keystrokes.set('arrowright', stopPropagation);\n this.keystrokes.set('arrowleft', stopPropagation);\n this.keystrokes.set('arrowup', stopPropagation);\n this.keystrokes.set('arrowdown', stopPropagation);\n }\n /**\n * Adds color picker elements to focus tracker.\n */\n _addColorPickersElementsToFocusTracker() {\n for (const slider of this.colorPickerView.slidersView) {\n this.focusTracker.add(slider.element);\n this._focusables.add(slider);\n }\n this.focusTracker.add(this.colorPickerView.hexInputRow.children.get(1).element);\n this._focusables.add(this.colorPickerView.hexInputRow.children.get(1));\n this.focusTracker.add(this.saveButtonView.element);\n this._focusables.add(this.saveButtonView);\n this.focusTracker.add(this.cancelButtonView.element);\n this._focusables.add(this.cancelButtonView);\n }\n /**\n * Creates bar containing \"Save\" and \"Cancel\" buttons.\n */\n _createActionBarView({ saveButtonView, cancelButtonView }) {\n const actionBarRow = new View();\n const children = this.createCollection();\n children.add(saveButtonView);\n children.add(cancelButtonView);\n actionBarRow.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-color-table_action-bar'\n ]\n },\n children\n });\n return actionBarRow;\n }\n /**\n * Creates \"Save\" and \"Cancel\" buttons.\n */\n _createActionButtons() {\n const locale = this.locale;\n const t = locale.t;\n const saveButtonView = new ButtonView(locale);\n const cancelButtonView = new ButtonView(locale);\n saveButtonView.set({\n icon: icons.check,\n class: 'ck-button-save',\n withText: false,\n label: t('Accept'),\n type: 'submit'\n });\n cancelButtonView.set({\n icon: icons.cancel,\n class: 'ck-button-cancel',\n withText: false,\n label: t('Cancel')\n });\n saveButtonView.on('execute', () => {\n this.fire('execute', {\n source: 'saveButton',\n value: this.selectedColor\n });\n });\n cancelButtonView.on('execute', () => {\n this.fire('cancel');\n });\n return {\n saveButtonView, cancelButtonView\n };\n }\n /**\n * Fires the `execute` event if color in color picker changed.\n *\n * @fires execute\n */\n _executeUponColorChange() {\n this.colorPickerView.on('change:color', (evt, evtName, newValue) => {\n this.fire('execute', {\n value: newValue,\n source: 'colorPicker'\n });\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module font/utils\n */\nimport ColorTableView from './ui/colortableview';\n/**\n * The name of the font size plugin.\n */\nexport const FONT_SIZE = 'fontSize';\n/**\n * The name of the font family plugin.\n */\nexport const FONT_FAMILY = 'fontFamily';\n/**\n * The name of the font color plugin.\n */\nexport const FONT_COLOR = 'fontColor';\n/**\n * The name of the font background color plugin.\n */\nexport const FONT_BACKGROUND_COLOR = 'fontBackgroundColor';\n/**\n * Builds a proper converter definition out of input data.\n */\nexport function buildDefinition(modelAttributeKey, options) {\n const definition = {\n model: {\n key: modelAttributeKey,\n values: []\n },\n view: {},\n upcastAlso: {}\n };\n for (const option of options) {\n definition.model.values.push(option.model);\n definition.view[option.model] = option.view;\n if (option.upcastAlso) {\n definition.upcastAlso[option.model] = option.upcastAlso;\n }\n }\n return definition;\n}\n/**\n * A {@link module:font/fontcolor~FontColor font color} and\n * {@link module:font/fontbackgroundcolor~FontBackgroundColor font background color} helper\n * responsible for upcasting data to the model.\n *\n * **Note**: The `styleAttr` parameter should be either `'color'` or `'background-color'`.\n */\nexport function renderUpcastAttribute(styleAttr) {\n return (viewElement) => normalizeColorCode(viewElement.getStyle(styleAttr));\n}\n/**\n * A {@link module:font/fontcolor~FontColor font color} and\n * {@link module:font/fontbackgroundcolor~FontBackgroundColor font background color} helper\n * responsible for downcasting a color attribute to a `<span>` element.\n *\n * **Note**: The `styleAttr` parameter should be either `'color'` or `'background-color'`.\n */\nexport function renderDowncastElement(styleAttr) {\n return (modelAttributeValue, { writer }) => writer.createAttributeElement('span', {\n style: `${styleAttr}:${modelAttributeValue}`\n }, { priority: 7 });\n}\n/**\n * A helper that adds {@link module:font/ui/colortableview~ColorTableView} to the color dropdown with proper initial values.\n *\n * @param config.dropdownView The dropdown view to which a {@link module:font/ui/colortableview~ColorTableView} will be added.\n * @param config.colors An array with definitions representing colors to be displayed in the color table.\n * @param config.removeButtonLabel The label for the button responsible for removing the color.\n * @param config.documentColorsLabel The label for the section with document colors.\n * @param config.documentColorsCount The number of document colors inside the dropdown.\n * @returns The new color table view.\n */\nexport function addColorTableToDropdown({ dropdownView, colors, columns, removeButtonLabel, colorPickerLabel, documentColorsLabel, documentColorsCount, colorPickerConfig }) {\n const locale = dropdownView.locale;\n const colorTableView = new ColorTableView(locale, {\n colors,\n columns,\n removeButtonLabel,\n colorPickerLabel,\n documentColorsLabel,\n documentColorsCount,\n colorPickerConfig\n });\n dropdownView.colorTableView = colorTableView;\n dropdownView.panelView.children.add(colorTableView);\n return colorTableView;\n}\n/**\n * Fixes the color value string.\n */\nfunction normalizeColorCode(value) {\n return value.replace(/\\s/g, '');\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport FontCommand from '../fontcommand';\nimport { FONT_BACKGROUND_COLOR } from '../utils';\n/**\n * The font background color command. It is used by\n * {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing}\n * to apply the font background color.\n *\n * ```ts\n * editor.execute( 'fontBackgroundColor', { value: 'rgb(250, 20, 20)' } );\n * ```\n *\n * **Note**: Executing the command with the `null` value removes the attribute from the model.\n */\nexport default class FontBackgroundColorCommand extends FontCommand {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor, FONT_BACKGROUND_COLOR);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module font/fontbackgroundcolor/fontbackgroundcolorediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { addBackgroundRules } from 'ckeditor5/src/engine';\nimport FontBackgroundColorCommand from './fontbackgroundcolorcommand';\nimport { FONT_BACKGROUND_COLOR, renderDowncastElement, renderUpcastAttribute } from '../utils';\n/**\n * The font background color editing feature.\n *\n * It introduces the {@link module:font/fontbackgroundcolor/fontbackgroundcolorcommand~FontBackgroundColorCommand command} and\n * the `fontBackgroundColor` attribute in the {@link module:engine/model/model~Model model} which renders\n * in the {@link module:engine/view/view view} as a `<span>` element (`<span style=\"background-color: ...\">`),\n * depending on the {@link module:font/fontconfig~FontColorConfig configuration}.\n */\nexport default class FontBackgroundColorEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'FontBackgroundColorEditing';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n editor.config.define(FONT_BACKGROUND_COLOR, {\n colors: [\n {\n color: 'hsl(0, 0%, 0%)',\n label: 'Black'\n },\n {\n color: 'hsl(0, 0%, 30%)',\n label: 'Dim grey'\n },\n {\n color: 'hsl(0, 0%, 60%)',\n label: 'Grey'\n },\n {\n color: 'hsl(0, 0%, 90%)',\n label: 'Light grey'\n },\n {\n color: 'hsl(0, 0%, 100%)',\n label: 'White',\n hasBorder: true\n },\n {\n color: 'hsl(0, 75%, 60%)',\n label: 'Red'\n },\n {\n color: 'hsl(30, 75%, 60%)',\n label: 'Orange'\n },\n {\n color: 'hsl(60, 75%, 60%)',\n label: 'Yellow'\n },\n {\n color: 'hsl(90, 75%, 60%)',\n label: 'Light green'\n },\n {\n color: 'hsl(120, 75%, 60%)',\n label: 'Green'\n },\n {\n color: 'hsl(150, 75%, 60%)',\n label: 'Aquamarine'\n },\n {\n color: 'hsl(180, 75%, 60%)',\n label: 'Turquoise'\n },\n {\n color: 'hsl(210, 75%, 60%)',\n label: 'Light blue'\n },\n {\n color: 'hsl(240, 75%, 60%)',\n label: 'Blue'\n },\n {\n color: 'hsl(270, 75%, 60%)',\n label: 'Purple'\n }\n ],\n columns: 5\n });\n editor.data.addStyleProcessorRules(addBackgroundRules);\n editor.conversion.for('upcast').elementToAttribute({\n view: {\n name: 'span',\n styles: {\n 'background-color': /[\\s\\S]+/\n }\n },\n model: {\n key: FONT_BACKGROUND_COLOR,\n value: renderUpcastAttribute('background-color')\n }\n });\n editor.conversion.for('downcast').attributeToElement({\n model: FONT_BACKGROUND_COLOR,\n view: renderDowncastElement('background-color')\n });\n editor.commands.add(FONT_BACKGROUND_COLOR, new FontBackgroundColorCommand(editor));\n // Allow the font backgroundColor attribute on text nodes.\n editor.model.schema.extend('$text', { allowAttributes: FONT_BACKGROUND_COLOR });\n editor.model.schema.setAttributeProperties(FONT_BACKGROUND_COLOR, {\n isFormatting: true,\n copyOnEnter: true\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module font/ui/colorui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { createDropdown, normalizeColorOptions, getLocalizedColorOptions, focusChildOnDropdownOpen } from 'ckeditor5/src/ui';\nimport { addColorTableToDropdown } from '../utils';\n/**\n * The color UI plugin which isolates the common logic responsible for displaying dropdowns with color grids.\n *\n * It is used to create the `'fontBackgroundColor'` and `'fontColor'` dropdowns, each hosting\n * a {@link module:font/ui/colortableview~ColorTableView}.\n */\nexport default class ColorUI extends Plugin {\n /**\n * Creates a plugin which introduces a dropdown with a preconfigured {@link module:font/ui/colortableview~ColorTableView}.\n *\n * @param config The configuration object.\n * @param config.commandName The name of the command which will be executed when a color tile is clicked.\n * @param config.componentName The name of the dropdown in the {@link module:ui/componentfactory~ComponentFactory}\n * and the configuration scope name in `editor.config`.\n * @param config.icon The SVG icon used by the dropdown.\n * @param config.dropdownLabel The label used by the dropdown.\n */\n constructor(editor, { commandName, componentName, icon, dropdownLabel }) {\n super(editor);\n this.commandName = commandName;\n this.componentName = componentName;\n this.icon = icon;\n this.dropdownLabel = dropdownLabel;\n this.columns = editor.config.get(`${this.componentName}.columns`);\n this.colorTableView = undefined;\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const locale = editor.locale;\n const t = locale.t;\n const command = editor.commands.get(this.commandName);\n const componentConfig = editor.config.get(this.componentName);\n const colorsConfig = normalizeColorOptions(componentConfig.colors);\n const localizedColors = getLocalizedColorOptions(locale, colorsConfig);\n const documentColorsCount = componentConfig.documentColors;\n const hasColorPicker = componentConfig.colorPicker !== false;\n // Register the UI component.\n editor.ui.componentFactory.add(this.componentName, locale => {\n const dropdownView = createDropdown(locale);\n // Font color dropdown rendering is deferred once it gets open to improve performance (#6192).\n let dropdownContentRendered = false;\n this.colorTableView = addColorTableToDropdown({\n dropdownView,\n colors: localizedColors.map(option => ({\n label: option.label,\n color: option.model,\n options: {\n hasBorder: option.hasBorder\n }\n })),\n columns: this.columns,\n removeButtonLabel: t('Remove color'),\n colorPickerLabel: t('Color picker'),\n documentColorsLabel: documentColorsCount !== 0 ? t('Document colors') : '',\n documentColorsCount: documentColorsCount === undefined ? this.columns : documentColorsCount,\n colorPickerConfig: hasColorPicker ? (componentConfig.colorPicker || {}) : false\n });\n this.colorTableView.bind('selectedColor').to(command, 'value');\n dropdownView.buttonView.set({\n label: this.dropdownLabel,\n icon: this.icon,\n tooltip: true\n });\n dropdownView.extendTemplate({\n attributes: {\n class: 'ck-color-ui-dropdown'\n }\n });\n dropdownView.bind('isEnabled').to(command);\n this.colorTableView.on('execute', (evt, data) => {\n if (dropdownView.isOpen) {\n editor.execute(this.commandName, {\n value: data.value,\n batch: this._undoStepBatch\n });\n }\n if (data.source !== 'colorPicker') {\n editor.editing.view.focus();\n }\n });\n this.colorTableView.on('showColorPicker', () => {\n this._undoStepBatch = editor.model.createBatch();\n });\n this.colorTableView.on('cancel', () => {\n if (this._undoStepBatch.operations.length) {\n // We need to close the dropdown before the undo batch.\n // Otherwise, ColorUI treats undo as a selected color change,\n // propagating the update to the whole selection.\n // That's an issue if spans with various colors were selected.\n dropdownView.isOpen = false;\n editor.execute('undo', this._undoStepBatch);\n }\n editor.editing.view.focus();\n });\n dropdownView.on('change:isOpen', (evt, name, isVisible) => {\n if (!dropdownContentRendered) {\n dropdownContentRendered = true;\n dropdownView.colorTableView.appendUI();\n }\n if (isVisible) {\n if (documentColorsCount !== 0) {\n this.colorTableView.updateDocumentColors(editor.model, this.componentName);\n }\n this.colorTableView.updateSelectedColors();\n }\n else {\n this.colorTableView.showColorGrids();\n }\n });\n // Accessibility: focus the first active color when opening the dropdown.\n focusChildOnDropdownOpen(dropdownView, () => dropdownView.colorTableView.colorGridsPageView.staticColorsGrid.items.find((item) => item.isOn));\n return dropdownView;\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module font/fontbackgroundcolor/fontbackgroundcolorui\n */\nimport ColorUI from '../ui/colorui';\nimport { FONT_BACKGROUND_COLOR } from '../utils';\nimport fontBackgroundColorIcon from '../../theme/icons/font-background.svg';\n/**\n * The font background color UI plugin. It introduces the `'fontBackgroundColor'` dropdown.\n */\nexport default class FontBackgroundColorUI extends ColorUI {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n const t = editor.locale.t;\n super(editor, {\n commandName: FONT_BACKGROUND_COLOR,\n componentName: FONT_BACKGROUND_COLOR,\n icon: fontBackgroundColorIcon,\n dropdownLabel: t('Font Background Color')\n });\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'FontBackgroundColorUI';\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M4 2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm8.38 9.262H7.62L10 5.506l2.38 5.756zm.532 1.285L14.34 16h1.426L10.804 4H9.196L4.234 16H5.66l1.428-3.453h5.824z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport FontCommand from '../fontcommand';\nimport { FONT_COLOR } from '../utils';\n/**\n * The font color command. It is used by {@link module:font/fontcolor/fontcolorediting~FontColorEditing}\n * to apply the font color.\n *\n * ```ts\n * editor.execute( 'fontColor', { value: 'rgb(250, 20, 20)' } );\n * ```\n *\n * **Note**: Executing the command with the `null` value removes the attribute from the model.\n */\nexport default class FontColorCommand extends FontCommand {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor, FONT_COLOR);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module font/fontcolor/fontcolorediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport FontColorCommand from './fontcolorcommand';\nimport { FONT_COLOR, renderDowncastElement, renderUpcastAttribute } from '../utils';\n/**\n * The font color editing feature.\n *\n * It introduces the {@link module:font/fontcolor/fontcolorcommand~FontColorCommand command} and\n * the `fontColor` attribute in the {@link module:engine/model/model~Model model} which renders\n * in the {@link module:engine/view/view view} as a `<span>` element (`<span style=\"color: ...\">`),\n * depending on the {@link module:font/fontconfig~FontColorConfig configuration}.\n */\nexport default class FontColorEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'FontColorEditing';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n editor.config.define(FONT_COLOR, {\n colors: [\n {\n color: 'hsl(0, 0%, 0%)',\n label: 'Black'\n },\n {\n color: 'hsl(0, 0%, 30%)',\n label: 'Dim grey'\n },\n {\n color: 'hsl(0, 0%, 60%)',\n label: 'Grey'\n },\n {\n color: 'hsl(0, 0%, 90%)',\n label: 'Light grey'\n },\n {\n color: 'hsl(0, 0%, 100%)',\n label: 'White',\n hasBorder: true\n },\n {\n color: 'hsl(0, 75%, 60%)',\n label: 'Red'\n },\n {\n color: 'hsl(30, 75%, 60%)',\n label: 'Orange'\n },\n {\n color: 'hsl(60, 75%, 60%)',\n label: 'Yellow'\n },\n {\n color: 'hsl(90, 75%, 60%)',\n label: 'Light green'\n },\n {\n color: 'hsl(120, 75%, 60%)',\n label: 'Green'\n },\n {\n color: 'hsl(150, 75%, 60%)',\n label: 'Aquamarine'\n },\n {\n color: 'hsl(180, 75%, 60%)',\n label: 'Turquoise'\n },\n {\n color: 'hsl(210, 75%, 60%)',\n label: 'Light blue'\n },\n {\n color: 'hsl(240, 75%, 60%)',\n label: 'Blue'\n },\n {\n color: 'hsl(270, 75%, 60%)',\n label: 'Purple'\n }\n ],\n columns: 5\n });\n editor.conversion.for('upcast').elementToAttribute({\n view: {\n name: 'span',\n styles: {\n 'color': /[\\s\\S]+/\n }\n },\n model: {\n key: FONT_COLOR,\n value: renderUpcastAttribute('color')\n }\n });\n // Support legacy `<font color=\"..\">` formatting.\n editor.conversion.for('upcast').elementToAttribute({\n view: {\n name: 'font',\n attributes: {\n 'color': /^#?\\w+$/\n }\n },\n model: {\n key: FONT_COLOR,\n value: (viewElement) => viewElement.getAttribute('color')\n }\n });\n editor.conversion.for('downcast').attributeToElement({\n model: FONT_COLOR,\n view: renderDowncastElement('color')\n });\n editor.commands.add(FONT_COLOR, new FontColorCommand(editor));\n // Allow the font color attribute on text nodes.\n editor.model.schema.extend('$text', { allowAttributes: FONT_COLOR });\n editor.model.schema.setAttributeProperties(FONT_COLOR, {\n isFormatting: true,\n copyOnEnter: true\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module font/fontcolor/fontcolorui\n */\nimport ColorUI from '../ui/colorui';\nimport { FONT_COLOR } from '../utils';\nimport fontColorIcon from '../../theme/icons/font-color.svg';\n/**\n * The font color UI plugin. It introduces the `'fontColor'` dropdown.\n */\nexport default class FontColorUI extends ColorUI {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n const t = editor.locale.t;\n super(editor, {\n commandName: FONT_COLOR,\n componentName: FONT_COLOR,\n icon: fontColorIcon,\n dropdownLabel: t('Font Color')\n });\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'FontColorUI';\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M12.4 10.3 10 4.5l-2.4 5.8h4.8zm.5 1.2H7.1L5.7 15H4.2l5-12h1.6l5 12h-1.5L13 11.5zm3.1 7H4a1 1 0 0 1 0-2h12a1 1 0 0 1 0 2z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport FontCommand from '../fontcommand';\nimport { FONT_FAMILY } from '../utils';\n/**\n * The font family command. It is used by {@link module:font/fontfamily/fontfamilyediting~FontFamilyEditing}\n * to apply the font family.\n *\n * ```ts\n * editor.execute( 'fontFamily', { value: 'Arial' } );\n * ```\n *\n * **Note**: Executing the command without the value removes the attribute from the model.\n */\nexport default class FontFamilyCommand extends FontCommand {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor, FONT_FAMILY);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module font/fontfamily/utils\n */\n/**\n * Normalizes the {@link module:font/fontconfig~FontFamilyConfig#options configuration options}\n * to the {@link module:font/fontconfig~FontFamilyOption} format.\n *\n * @param configuredOptions An array of options taken from the configuration.\n */\nexport function normalizeOptions(configuredOptions) {\n // Convert options to objects.\n return configuredOptions\n .map(getOptionDefinition)\n // Filter out undefined values that `getOptionDefinition` might return.\n .filter(option => option !== undefined);\n}\n/**\n * Returns an option definition either created from string shortcut.\n * If object is passed then this method will return it without alternating it. Returns undefined for item than cannot be parsed.\n *\n */\nfunction getOptionDefinition(option) {\n // Treat any object as full item definition provided by user in configuration.\n if (typeof option === 'object') {\n return option;\n }\n // Handle 'default' string as a special case. It will be used to remove the fontFamily attribute.\n if (option === 'default') {\n return {\n title: 'Default',\n model: undefined\n };\n }\n // Ignore values that we cannot parse to a definition.\n if (typeof option !== 'string') {\n return undefined;\n }\n // Return font family definition from font string.\n return generateFontPreset(option);\n}\n/**\n * Creates a predefined preset for pixel size. It deconstructs font-family like string into full configuration option.\n * A font definition is passed as coma delimited set of font family names. Font names might be quoted.\n *\n * @param fontDefinition A font definition form configuration.\n */\nfunction generateFontPreset(fontDefinition) {\n // Remove quotes from font names. They will be normalized later.\n const fontNames = fontDefinition.replace(/\"|'/g, '').split(',');\n // The first matched font name will be used as dropdown list item title and as model value.\n const firstFontName = fontNames[0];\n // CSS-compatible font names.\n const cssFontNames = fontNames.map(normalizeFontNameForCSS).join(', ');\n return {\n title: firstFontName,\n model: cssFontNames,\n view: {\n name: 'span',\n styles: {\n 'font-family': cssFontNames\n },\n priority: 7\n }\n };\n}\n/**\n * Normalizes font name for the style attribute. It adds braces (') if font name contains spaces.\n */\nfunction normalizeFontNameForCSS(fontName) {\n fontName = fontName.trim();\n // Compound font names should be quoted.\n if (fontName.indexOf(' ') > 0) {\n fontName = `'${fontName}'`;\n }\n return fontName;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module font/fontfamily/fontfamilyediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport FontFamilyCommand from './fontfamilycommand';\nimport { normalizeOptions } from './utils';\nimport { buildDefinition, FONT_FAMILY } from '../utils';\n/**\n * The font family editing feature.\n *\n * It introduces the {@link module:font/fontfamily/fontfamilycommand~FontFamilyCommand command} and\n * the `fontFamily` attribute in the {@link module:engine/model/model~Model model} which renders\n * in the {@link module:engine/view/view view} as an inline `<span>` element (`<span style=\"font-family: Arial\">`),\n * depending on the {@link module:font/fontconfig~FontFamilyConfig configuration}.\n */\nexport default class FontFamilyEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'FontFamilyEditing';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n // Define default configuration using font families shortcuts.\n editor.config.define(FONT_FAMILY, {\n options: [\n 'default',\n 'Arial, Helvetica, sans-serif',\n 'Courier New, Courier, monospace',\n 'Georgia, serif',\n 'Lucida Sans Unicode, Lucida Grande, sans-serif',\n 'Tahoma, Geneva, sans-serif',\n 'Times New Roman, Times, serif',\n 'Trebuchet MS, Helvetica, sans-serif',\n 'Verdana, Geneva, sans-serif'\n ],\n supportAllValues: false\n });\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Allow fontFamily attribute on text nodes.\n editor.model.schema.extend('$text', { allowAttributes: FONT_FAMILY });\n editor.model.schema.setAttributeProperties(FONT_FAMILY, {\n isFormatting: true,\n copyOnEnter: true\n });\n // Get configured font family options without \"default\" option.\n const options = normalizeOptions(editor.config.get('fontFamily.options')).filter(item => item.model);\n const definition = buildDefinition(FONT_FAMILY, options);\n // Set-up the two-way conversion.\n if (editor.config.get('fontFamily.supportAllValues')) {\n this._prepareAnyValueConverters();\n this._prepareCompatibilityConverter();\n }\n else {\n editor.conversion.attributeToElement(definition);\n }\n editor.commands.add(FONT_FAMILY, new FontFamilyCommand(editor));\n }\n /**\n * These converters enable keeping any value found as `style=\"font-family: *\"` as a value of an attribute on a text even\n * if it is not defined in the plugin configuration.\n */\n _prepareAnyValueConverters() {\n const editor = this.editor;\n editor.conversion.for('downcast').attributeToElement({\n model: FONT_FAMILY,\n view: (attributeValue, { writer }) => {\n return writer.createAttributeElement('span', { style: 'font-family:' + attributeValue }, { priority: 7 });\n }\n });\n editor.conversion.for('upcast').elementToAttribute({\n model: {\n key: FONT_FAMILY,\n value: (viewElement) => viewElement.getStyle('font-family')\n },\n view: {\n name: 'span',\n styles: {\n 'font-family': /.*/\n }\n }\n });\n }\n /**\n * Adds support for legacy `<font face=\"..\">` formatting.\n */\n _prepareCompatibilityConverter() {\n const editor = this.editor;\n editor.conversion.for('upcast').elementToAttribute({\n view: {\n name: 'font',\n attributes: {\n 'face': /.*/\n }\n },\n model: {\n key: FONT_FAMILY,\n value: (viewElement) => viewElement.getAttribute('face')\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module font/fontfamily/fontfamilyui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Collection } from 'ckeditor5/src/utils';\nimport { Model, createDropdown, addListToDropdown } from 'ckeditor5/src/ui';\nimport { normalizeOptions } from './utils';\nimport { FONT_FAMILY } from '../utils';\nimport fontFamilyIcon from '../../theme/icons/font-family.svg';\n/**\n * The font family UI plugin. It introduces the `'fontFamily'` dropdown.\n */\nexport default class FontFamilyUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'FontFamilyUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n const options = this._getLocalizedOptions();\n const command = editor.commands.get(FONT_FAMILY);\n const accessibleLabel = t('Font Family');\n // Register UI component.\n editor.ui.componentFactory.add(FONT_FAMILY, locale => {\n const dropdownView = createDropdown(locale);\n addListToDropdown(dropdownView, () => _prepareListOptions(options, command), {\n role: 'menu',\n ariaLabel: accessibleLabel\n });\n dropdownView.buttonView.set({\n label: accessibleLabel,\n icon: fontFamilyIcon,\n tooltip: true\n });\n dropdownView.extendTemplate({\n attributes: {\n class: 'ck-font-family-dropdown'\n }\n });\n dropdownView.bind('isEnabled').to(command);\n // Execute command when an item from the dropdown is selected.\n this.listenTo(dropdownView, 'execute', evt => {\n editor.execute(evt.source.commandName, { value: evt.source.commandParam });\n editor.editing.view.focus();\n });\n return dropdownView;\n });\n }\n /**\n * Returns options as defined in `config.fontFamily.options` but processed to account for\n * editor localization, i.e. to display {@link module:font/fontconfig~FontFamilyOption}\n * in the correct language.\n *\n * Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}\n * when the user configuration is defined because the editor does not exist yet.\n */\n _getLocalizedOptions() {\n const editor = this.editor;\n const t = editor.t;\n const options = normalizeOptions((editor.config.get(FONT_FAMILY)).options);\n return options.map(option => {\n // The only title to localize is \"Default\" others are font names.\n if (option.title === 'Default') {\n option.title = t('Default');\n }\n return option;\n });\n }\n}\n/**\n * Prepares FontFamily dropdown items.\n */\nfunction _prepareListOptions(options, command) {\n const itemDefinitions = new Collection();\n // Create dropdown items.\n for (const option of options) {\n const def = {\n type: 'button',\n model: new Model({\n commandName: FONT_FAMILY,\n commandParam: option.model,\n label: option.title,\n role: 'menuitemradio',\n withText: true\n })\n };\n def.model.bind('isOn').to(command, 'value', value => {\n // \"Default\" or check in strict font-family converters mode.\n if (value === option.model) {\n return true;\n }\n if (!value || !option.model) {\n return false;\n }\n return value.split(',')[0].replace(/'/g, '').toLowerCase() === option.model.toLowerCase();\n });\n // Try to set a dropdown list item style.\n if (option.view && typeof option.view !== 'string' && option.view.styles) {\n def.model.set('labelStyle', `font-family: ${option.view.styles['font-family']}`);\n }\n itemDefinitions.add(def);\n }\n return itemDefinitions;\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M11.03 3h6.149a.75.75 0 1 1 0 1.5h-5.514L11.03 3zm1.27 3h4.879a.75.75 0 1 1 0 1.5h-4.244L12.3 6zm1.27 3h3.609a.75.75 0 1 1 0 1.5h-2.973L13.57 9zm-2.754 2.5L8.038 4.785 5.261 11.5h5.555zm.62 1.5H4.641l-1.666 4.028H1.312l5.789-14h1.875l5.789 14h-1.663L11.436 13z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport FontCommand from '../fontcommand';\nimport { FONT_SIZE } from '../utils';\n/**\n * The font size command. It is used by {@link module:font/fontsize/fontsizeediting~FontSizeEditing}\n * to apply the font size.\n *\n * ```ts\n * editor.execute( 'fontSize', { value: 'small' } );\n * ```\n *\n * **Note**: Executing the command without the value removes the attribute from the model.\n */\nexport default class FontSizeCommand extends FontCommand {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor, FONT_SIZE);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module font/fontsize/utils\n */\nimport { CKEditorError } from 'ckeditor5/src/utils';\n/**\n * Normalizes and translates the {@link module:font/fontconfig~FontSizeConfig#options configuration options}\n * to the {@link module:font/fontconfig~FontSizeOption} format.\n *\n * @param configuredOptions An array of options taken from the configuration.\n */\nexport function normalizeOptions(configuredOptions) {\n // Convert options to objects.\n return configuredOptions\n .map(item => getOptionDefinition(item))\n // Filter out undefined values that `getOptionDefinition` might return.\n .filter((option) => option !== undefined);\n}\n// Default named presets map. Always create a new instance of the preset object in order to avoid modifying references.\nconst namedPresets = {\n get tiny() {\n return {\n title: 'Tiny',\n model: 'tiny',\n view: {\n name: 'span',\n classes: 'text-tiny',\n priority: 7\n }\n };\n },\n get small() {\n return {\n title: 'Small',\n model: 'small',\n view: {\n name: 'span',\n classes: 'text-small',\n priority: 7\n }\n };\n },\n get big() {\n return {\n title: 'Big',\n model: 'big',\n view: {\n name: 'span',\n classes: 'text-big',\n priority: 7\n }\n };\n },\n get huge() {\n return {\n title: 'Huge',\n model: 'huge',\n view: {\n name: 'span',\n classes: 'text-huge',\n priority: 7\n }\n };\n }\n};\n/**\n * Returns an option definition either from preset or creates one from number shortcut.\n * If object is passed then this method will return it without alternating it. Returns undefined for item than cannot be parsed.\n */\nfunction getOptionDefinition(option) {\n if (typeof option === 'number') {\n option = String(option);\n }\n // Check whether passed option is a full item definition provided by user in configuration.\n if (typeof option === 'object' && isFullItemDefinition(option)) {\n return attachPriority(option);\n }\n const preset = findPreset(option);\n // Item is a named preset.\n if (preset) {\n return attachPriority(preset);\n }\n // 'Default' font size. It will be used to remove the fontSize attribute.\n if (option === 'default') {\n return {\n model: undefined,\n title: 'Default'\n };\n }\n // At this stage we probably have numerical value to generate a preset so parse it's value.\n // Discard any faulty values.\n if (isNumericalDefinition(option)) {\n return undefined;\n }\n // Return font size definition from size value.\n return generatePixelPreset(option);\n}\n/**\n * Creates a predefined preset for pixel size.\n * @param definition Font size in pixels.\n * @returns\n */\nfunction generatePixelPreset(definition) {\n // Extend a short (numeric value) definition.\n if (typeof definition === 'string') {\n definition = {\n title: definition,\n model: `${parseFloat(definition)}px`\n };\n }\n definition.view = {\n name: 'span',\n styles: {\n 'font-size': definition.model\n }\n };\n return attachPriority(definition);\n}\n/**\n * Adds the priority to the view element definition if missing. It's required due to ckeditor/ckeditor5#2291\n */\nfunction attachPriority(definition) {\n if (definition.view && typeof definition.view !== 'string' && !definition.view.priority) {\n definition.view.priority = 7;\n }\n return definition;\n}\n/**\n * Returns a prepared preset definition. If passed an object, a name of preset should be defined as `model` value.\n *\n * @param definition.model A preset name.\n */\nfunction findPreset(definition) {\n return typeof definition === 'string' ? namedPresets[definition] : namedPresets[definition.model];\n}\n/**\n * We treat `definition` as completed if it is an object that contains `title`, `model` and `view` values.\n */\nfunction isFullItemDefinition(definition) {\n return definition.title && definition.model && definition.view;\n}\nfunction isNumericalDefinition(definition) {\n let numberValue;\n if (typeof definition === 'object') {\n if (!definition.model) {\n /**\n * Provided value as an option for {@link module:font/fontsize~FontSize} seems to invalid.\n *\n * See valid examples described in the {@link module:font/fontconfig~FontSizeConfig#options plugin configuration}.\n *\n * @error font-size-invalid-definition\n */\n throw new CKEditorError('font-size-invalid-definition', null, definition);\n }\n else {\n numberValue = parseFloat(definition.model);\n }\n }\n else {\n numberValue = parseFloat(definition);\n }\n return isNaN(numberValue);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module font/fontsize/fontsizeediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { CKEditorError } from 'ckeditor5/src/utils';\nimport { isLength, isPercentage } from 'ckeditor5/src/engine';\nimport FontSizeCommand from './fontsizecommand';\nimport { normalizeOptions } from './utils';\nimport { buildDefinition, FONT_SIZE } from '../utils';\n// Mapping of `<font size=\"..\">` styling to CSS's `font-size` values.\nconst styleFontSize = [\n 'x-small',\n 'x-small',\n 'small',\n 'medium',\n 'large',\n 'x-large',\n 'xx-large',\n 'xxx-large'\n];\n/**\n * The font size editing feature.\n *\n * It introduces the {@link module:font/fontsize/fontsizecommand~FontSizeCommand command} and the `fontSize`\n * attribute in the {@link module:engine/model/model~Model model} which renders in the {@link module:engine/view/view view}\n * as a `<span>` element with either:\n * * a style attribute (`<span style=\"font-size:12px\">...</span>`),\n * * or a class attribute (`<span class=\"text-small\">...</span>`)\n *\n * depending on the {@link module:font/fontconfig~FontSizeConfig configuration}.\n */\nexport default class FontSizeEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'FontSizeEditing';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n // Define default configuration using named presets.\n editor.config.define(FONT_SIZE, {\n options: [\n 'tiny',\n 'small',\n 'default',\n 'big',\n 'huge'\n ],\n supportAllValues: false\n });\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Allow fontSize attribute on text nodes.\n editor.model.schema.extend('$text', { allowAttributes: FONT_SIZE });\n editor.model.schema.setAttributeProperties(FONT_SIZE, {\n isFormatting: true,\n copyOnEnter: true\n });\n const supportAllValues = editor.config.get('fontSize.supportAllValues');\n // Define view to model conversion.\n const options = normalizeOptions(this.editor.config.get('fontSize.options'))\n .filter(item => item.model);\n const definition = buildDefinition(FONT_SIZE, options);\n // Set-up the two-way conversion.\n if (supportAllValues) {\n this._prepareAnyValueConverters(definition);\n this._prepareCompatibilityConverter();\n }\n else {\n editor.conversion.attributeToElement(definition);\n }\n // Add FontSize command.\n editor.commands.add(FONT_SIZE, new FontSizeCommand(editor));\n }\n /**\n * These converters enable keeping any value found as `style=\"font-size: *\"` as a value of an attribute on a text even\n * if it is not defined in the plugin configuration.\n *\n * @param definition Converter definition out of input data.\n */\n _prepareAnyValueConverters(definition) {\n const editor = this.editor;\n // If `fontSize.supportAllValues=true`, we do not allow to use named presets in the plugin's configuration.\n const presets = definition.model.values.filter((value) => {\n return !isLength(String(value)) && !isPercentage(String(value));\n });\n if (presets.length) {\n /**\n * If {@link module:font/fontconfig~FontSizeConfig#supportAllValues `config.fontSize.supportAllValues`} is `true`,\n * you need to use numerical values as font size options.\n *\n * See valid examples described in the {@link module:font/fontconfig~FontSizeConfig#options plugin configuration}.\n *\n * @error font-size-invalid-use-of-named-presets\n * @param {Array.<String>} presets Invalid values.\n */\n throw new CKEditorError('font-size-invalid-use-of-named-presets', null, { presets });\n }\n editor.conversion.for('downcast').attributeToElement({\n model: FONT_SIZE,\n view: (attributeValue, { writer }) => {\n if (!attributeValue) {\n return;\n }\n return writer.createAttributeElement('span', { style: 'font-size:' + attributeValue }, { priority: 7 });\n }\n });\n editor.conversion.for('upcast').elementToAttribute({\n model: {\n key: FONT_SIZE,\n value: (viewElement) => viewElement.getStyle('font-size')\n },\n view: {\n name: 'span',\n styles: {\n 'font-size': /.*/\n }\n }\n });\n }\n /**\n * Adds support for legacy `<font size=\"..\">` formatting.\n */\n _prepareCompatibilityConverter() {\n const editor = this.editor;\n editor.conversion.for('upcast').elementToAttribute({\n view: {\n name: 'font',\n attributes: {\n // Documentation mentions sizes from 1 to 7. To handle old content we support all values\n // up to 999 but clamp it to the valid range. Why 999? It should cover accidental values\n // similar to percentage, e.g. 100%, 200% which could be the usual mistake for font size.\n 'size': /^[+-]?\\d{1,3}$/\n }\n },\n model: {\n key: FONT_SIZE,\n value: (viewElement) => {\n const value = viewElement.getAttribute('size');\n const isRelative = value[0] === '-' || value[0] === '+';\n let size = parseInt(value, 10);\n if (isRelative) {\n // Add relative size (which can be negative) to the default size = 3.\n size = 3 + size;\n }\n const maxSize = styleFontSize.length - 1;\n const clampedSize = Math.min(Math.max(size, 0), maxSize);\n return styleFontSize[clampedSize];\n }\n }\n });\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./fontsize.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module font/fontsize/fontsizeui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Model, createDropdown, addListToDropdown } from 'ckeditor5/src/ui';\nimport { Collection } from 'ckeditor5/src/utils';\nimport { normalizeOptions } from './utils';\nimport { FONT_SIZE } from '../utils';\nimport '../../theme/fontsize.css';\nimport fontSizeIcon from '../../theme/icons/font-size.svg';\n/**\n * The font size UI plugin. It introduces the `'fontSize'` dropdown.\n */\nexport default class FontSizeUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'FontSizeUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n const options = this._getLocalizedOptions();\n const command = editor.commands.get(FONT_SIZE);\n const accessibleLabel = t('Font Size');\n // Register UI component.\n editor.ui.componentFactory.add(FONT_SIZE, locale => {\n const dropdownView = createDropdown(locale);\n addListToDropdown(dropdownView, () => _prepareListOptions(options, command), {\n role: 'menu',\n ariaLabel: accessibleLabel\n });\n // Create dropdown model.\n dropdownView.buttonView.set({\n label: accessibleLabel,\n icon: fontSizeIcon,\n tooltip: true\n });\n dropdownView.extendTemplate({\n attributes: {\n class: [\n 'ck-font-size-dropdown'\n ]\n }\n });\n dropdownView.bind('isEnabled').to(command);\n // Execute command when an item from the dropdown is selected.\n this.listenTo(dropdownView, 'execute', evt => {\n editor.execute(evt.source.commandName, { value: evt.source.commandParam });\n editor.editing.view.focus();\n });\n return dropdownView;\n });\n }\n /**\n * Returns options as defined in `config.fontSize.options` but processed to account for\n * editor localization, i.e. to display {@link module:font/fontconfig~FontSizeOption}\n * in the correct language.\n *\n * Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}\n * when the user configuration is defined because the editor does not exist yet.\n */\n _getLocalizedOptions() {\n const editor = this.editor;\n const t = editor.t;\n const localizedTitles = {\n Default: t('Default'),\n Tiny: t('Tiny'),\n Small: t('Small'),\n Big: t('Big'),\n Huge: t('Huge')\n };\n const options = normalizeOptions((editor.config.get(FONT_SIZE)).options);\n return options.map(option => {\n const title = localizedTitles[option.title];\n if (title && title != option.title) {\n // Clone the option to avoid altering the original `namedPresets` from `./utils.js`.\n option = Object.assign({}, option, { title });\n }\n return option;\n });\n }\n}\n/**\n * Prepares FontSize dropdown items.\n */\nfunction _prepareListOptions(options, command) {\n const itemDefinitions = new Collection();\n for (const option of options) {\n const def = {\n type: 'button',\n model: new Model({\n commandName: FONT_SIZE,\n commandParam: option.model,\n label: option.title,\n class: 'ck-fontsize-option',\n role: 'menuitemradio',\n withText: true\n })\n };\n if (option.view && typeof option.view !== 'string') {\n if (option.view.styles) {\n def.model.set('labelStyle', `font-size:${option.view.styles['font-size']}`);\n }\n if (option.view.classes) {\n def.model.set('class', `${def.model.class} ${option.view.classes}`);\n }\n }\n def.model.bind('isOn').to(command, 'value', value => value === option.model);\n // Add the option to the collection.\n itemDefinitions.add(def);\n }\n return itemDefinitions;\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M9.816 11.5 7.038 4.785 4.261 11.5h5.555zm.62 1.5H3.641l-1.666 4.028H.312l5.789-14h1.875l5.789 14h-1.663L10.436 13zm7.55 2.279.779-.779.707.707-2.265 2.265-2.193-2.265.707-.707.765.765V4.825c0-.042 0-.083.002-.123l-.77.77-.707-.707L17.207 2.5l2.265 2.265-.707.707-.782-.782c.002.043.003.089.003.135v10.454z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { updateViewAttributes } from '../utils';\nimport DataFilter from '../datafilter';\n/**\n * Provides the General HTML Support integration with {@link module:code-block/codeblock~CodeBlock Code Block} feature.\n */\nexport default class CodeBlockElementSupport extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [DataFilter];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'CodeBlockElementSupport';\n }\n /**\n * @inheritDoc\n */\n init() {\n if (!this.editor.plugins.has('CodeBlockEditing')) {\n return;\n }\n const dataFilter = this.editor.plugins.get(DataFilter);\n dataFilter.on('register:pre', (evt, definition) => {\n if (definition.model !== 'codeBlock') {\n return;\n }\n const editor = this.editor;\n const schema = editor.model.schema;\n const conversion = editor.conversion;\n // Extend codeBlock to allow attributes required by attribute filtration.\n schema.extend('codeBlock', {\n allowAttributes: ['htmlAttributes', 'htmlContentAttributes']\n });\n conversion.for('upcast').add(viewToModelCodeBlockAttributeConverter(dataFilter));\n conversion.for('downcast').add(modelToViewCodeBlockAttributeConverter());\n evt.stop();\n });\n }\n}\n/**\n * View-to-model conversion helper preserving allowed attributes on {@link module:code-block/codeblock~CodeBlock Code Block}\n * feature model element.\n *\n * Attributes are preserved as a value of `htmlAttributes` model attribute.\n * @param dataFilter\n * @returns Returns a conversion callback.\n */\nfunction viewToModelCodeBlockAttributeConverter(dataFilter) {\n return (dispatcher) => {\n dispatcher.on('element:code', (evt, data, conversionApi) => {\n const viewCodeElement = data.viewItem;\n const viewPreElement = viewCodeElement.parent;\n if (!viewPreElement || !viewPreElement.is('element', 'pre')) {\n return;\n }\n preserveElementAttributes(viewPreElement, 'htmlAttributes');\n preserveElementAttributes(viewCodeElement, 'htmlContentAttributes');\n function preserveElementAttributes(viewElement, attributeName) {\n const viewAttributes = dataFilter.processViewAttributes(viewElement, conversionApi);\n if (viewAttributes) {\n conversionApi.writer.setAttribute(attributeName, viewAttributes, data.modelRange);\n }\n }\n }, { priority: 'low' });\n };\n}\n/**\n * Model-to-view conversion helper applying attributes from {@link module:code-block/codeblock~CodeBlock Code Block}\n * feature model element.\n * @returns Returns a conversion callback.\n */\nfunction modelToViewCodeBlockAttributeConverter() {\n return (dispatcher) => {\n dispatcher.on('attribute:htmlAttributes:codeBlock', (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const { attributeOldValue, attributeNewValue } = data;\n const viewCodeElement = conversionApi.mapper.toViewElement(data.item);\n const viewPreElement = viewCodeElement.parent;\n updateViewAttributes(conversionApi.writer, attributeOldValue, attributeNewValue, viewPreElement);\n });\n dispatcher.on('attribute:htmlContentAttributes:codeBlock', (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const { attributeOldValue, attributeNewValue } = data;\n const viewCodeElement = conversionApi.mapper.toViewElement(data.item);\n updateViewAttributes(conversionApi.writer, attributeOldValue, attributeNewValue, viewCodeElement);\n });\n };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { priorities } from 'ckeditor5/src/utils';\nimport { modelToViewBlockAttributeConverter, viewToModelBlockAttributeConverter } from '../converters';\nimport DataFilter from '../datafilter';\n/**\n * Provides the General HTML Support integration for elements which can behave like sectioning element (e.g. article) or\n * element accepting only inline content (e.g. paragraph).\n *\n * The distinction between this two content models is important for choosing correct schema model and proper content conversion.\n * As an example, it ensures that:\n *\n * * children elements paragraphing is enabled for sectioning elements only,\n * * element and its content can be correctly handled by editing view (splitting and merging elements),\n * * model element HTML is semantically correct and easier to work with.\n *\n * If element contains any block element, it will be treated as a sectioning element and registered using\n * {@link module:html-support/dataschema~DataSchemaDefinition#model} and\n * {@link module:html-support/dataschema~DataSchemaDefinition#modelSchema} in editor schema.\n * Otherwise, it will be registered under {@link module:html-support/dataschema~DataSchemaBlockElementDefinition#paragraphLikeModel} model\n * name with model schema accepting only inline content (inheriting from `$block`).\n */\nexport default class DualContentModelElementSupport extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [DataFilter];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'DualContentModelElementSupport';\n }\n /**\n * @inheritDoc\n */\n init() {\n const dataFilter = this.editor.plugins.get(DataFilter);\n dataFilter.on('register', (evt, definition) => {\n const blockDefinition = definition;\n const editor = this.editor;\n const schema = editor.model.schema;\n const conversion = editor.conversion;\n if (!blockDefinition.paragraphLikeModel) {\n return;\n }\n // Can only apply to newly registered features.\n if (schema.isRegistered(blockDefinition.model) || schema.isRegistered(blockDefinition.paragraphLikeModel)) {\n return;\n }\n const paragraphLikeModelDefinition = {\n model: blockDefinition.paragraphLikeModel,\n view: blockDefinition.view\n };\n schema.register(blockDefinition.model, blockDefinition.modelSchema);\n schema.register(paragraphLikeModelDefinition.model, {\n inheritAllFrom: '$block'\n });\n conversion.for('upcast').elementToElement({\n view: blockDefinition.view,\n model: (viewElement, { writer }) => {\n if (this._hasBlockContent(viewElement)) {\n return writer.createElement(blockDefinition.model);\n }\n return writer.createElement(paragraphLikeModelDefinition.model);\n },\n // With a `low` priority, `paragraph` plugin auto-paragraphing mechanism is executed. Make sure\n // this listener is called before it. If not, some elements will be transformed into a paragraph.\n converterPriority: priorities.get('low') + 0.5\n });\n conversion.for('downcast').elementToElement({\n view: blockDefinition.view,\n model: blockDefinition.model\n });\n this._addAttributeConversion(blockDefinition);\n conversion.for('downcast').elementToElement({\n view: paragraphLikeModelDefinition.view,\n model: paragraphLikeModelDefinition.model\n });\n this._addAttributeConversion(paragraphLikeModelDefinition);\n evt.stop();\n });\n }\n /**\n * Checks whether the given view element includes any other block element.\n */\n _hasBlockContent(viewElement) {\n const view = this.editor.editing.view;\n const blockElements = view.domConverter.blockElements;\n // Traversing the viewElement subtree looking for block elements.\n // Especially for the cases like <div><a href=\"#\"><p>foo</p></a></div>.\n // https://github.com/ckeditor/ckeditor5/issues/11513\n for (const viewItem of view.createRangeIn(viewElement).getItems()) {\n if (viewItem.is('element') && blockElements.includes(viewItem.name)) {\n return true;\n }\n }\n return false;\n }\n /**\n * Adds attribute filtering conversion for the given data schema.\n */\n _addAttributeConversion(definition) {\n const editor = this.editor;\n const conversion = editor.conversion;\n const dataFilter = editor.plugins.get(DataFilter);\n editor.model.schema.extend(definition.model, {\n allowAttributes: 'htmlAttributes'\n });\n conversion.for('upcast').add(viewToModelBlockAttributeConverter(definition, dataFilter));\n conversion.for('downcast').add(modelToViewBlockAttributeConverter(definition));\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module html-support/integrations/heading\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Enter } from 'ckeditor5/src/enter';\nimport DataSchema from '../dataschema';\nimport { modifyGhsAttribute } from '../utils';\n/**\n * Provides the General HTML Support integration with {@link module:heading/heading~Heading Heading} feature.\n */\nexport default class HeadingElementSupport extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [DataSchema, Enter];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'HeadingElementSupport';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n if (!editor.plugins.has('HeadingEditing')) {\n return;\n }\n const options = editor.config.get('heading.options');\n this.registerHeadingElements(editor, options);\n this.removeClassesOnEnter(editor, options);\n }\n /**\n * Registers all elements supported by HeadingEditing to enable custom attributes for those elements.\n */\n registerHeadingElements(editor, options) {\n const dataSchema = editor.plugins.get(DataSchema);\n const headerModels = [];\n for (const option of options) {\n if ('model' in option && 'view' in option) {\n dataSchema.registerBlockElement({\n view: option.view,\n model: option.model\n });\n headerModels.push(option.model);\n }\n }\n dataSchema.extendBlockElement({\n model: 'htmlHgroup',\n modelSchema: {\n allowChildren: headerModels\n }\n });\n }\n /**\n * Removes css classes from \"htmlAttributes\" of new paragraph created when hitting \"enter\" in heading.\n */\n removeClassesOnEnter(editor, options) {\n const enterCommand = editor.commands.get('enter');\n this.listenTo(enterCommand, 'afterExecute', (evt, data) => {\n const positionParent = editor.model.document.selection.getFirstPosition().parent;\n const isHeading = options.some(option => positionParent.is('element', option.model));\n if (isHeading && positionParent.childCount === 0) {\n modifyGhsAttribute(data.writer, positionParent, 'htmlAttributes', 'classes', classes => classes.clear());\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module html-support/integrations/integrationutils\n */\n/**\n * Returns the first view element descendant matching the given view name.\n * Includes view element itself.\n *\n * @internal\n */\nexport function getDescendantElement(writer, containerElement, elementName) {\n const range = writer.createRangeOn(containerElement);\n for (const { item } of range.getWalker()) {\n if (item.is('element', elementName)) {\n return item;\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module html-support/integrations/image\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport DataFilter from '../datafilter';\nimport { setViewAttributes, updateViewAttributes } from '../utils';\nimport { getDescendantElement } from './integrationutils';\n/**\n * Provides the General HTML Support integration with the {@link module:image/image~Image Image} feature.\n */\nexport default class ImageElementSupport extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [DataFilter];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageElementSupport';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // At least one image plugin should be loaded for the integration to work properly.\n if (!editor.plugins.has('ImageInlineEditing') && !editor.plugins.has('ImageBlockEditing')) {\n return;\n }\n const schema = editor.model.schema;\n const conversion = editor.conversion;\n const dataFilter = editor.plugins.get(DataFilter);\n dataFilter.on('register:figure', () => {\n conversion.for('upcast').add(viewToModelFigureAttributeConverter(dataFilter));\n });\n dataFilter.on('register:img', (evt, definition) => {\n if (definition.model !== 'imageBlock' && definition.model !== 'imageInline') {\n return;\n }\n if (schema.isRegistered('imageBlock')) {\n schema.extend('imageBlock', {\n allowAttributes: [\n 'htmlAttributes',\n // Figure and Link don't have model counterpart.\n // We will preserve attributes on image model element using these attribute keys.\n 'htmlFigureAttributes',\n 'htmlLinkAttributes'\n ]\n });\n }\n if (schema.isRegistered('imageInline')) {\n schema.extend('imageInline', {\n allowAttributes: [\n // `htmlA` is needed for standard GHS link integration.\n 'htmlA',\n 'htmlAttributes'\n ]\n });\n }\n conversion.for('upcast').add(viewToModelImageAttributeConverter(dataFilter));\n conversion.for('downcast').add(modelToViewImageAttributeConverter());\n evt.stop();\n });\n }\n}\n/**\n * View-to-model conversion helper preserving allowed attributes on the {@link module:image/image~Image Image}\n * feature model element.\n *\n * @returns Returns a conversion callback.\n */\nfunction viewToModelImageAttributeConverter(dataFilter) {\n return (dispatcher) => {\n dispatcher.on('element:img', (evt, data, conversionApi) => {\n if (!data.modelRange) {\n return;\n }\n const viewImageElement = data.viewItem;\n const viewContainerElement = viewImageElement.parent;\n preserveElementAttributes(viewImageElement, 'htmlAttributes');\n if (viewContainerElement.is('element', 'a')) {\n preserveLinkAttributes(viewContainerElement);\n }\n function preserveElementAttributes(viewElement, attributeName) {\n const viewAttributes = dataFilter.processViewAttributes(viewElement, conversionApi);\n if (viewAttributes) {\n conversionApi.writer.setAttribute(attributeName, viewAttributes, data.modelRange);\n }\n }\n function preserveLinkAttributes(viewContainerElement) {\n if (data.modelRange && data.modelRange.getContainedElement().is('element', 'imageBlock')) {\n preserveElementAttributes(viewContainerElement, 'htmlLinkAttributes');\n }\n }\n }, { priority: 'low' });\n };\n}\n/**\n * View-to-model conversion helper preserving allowed attributes on {@link module:image/image~Image Image}\n * feature model element from figure view element.\n *\n * @returns Returns a conversion callback.\n */\nfunction viewToModelFigureAttributeConverter(dataFilter) {\n return (dispatcher) => {\n dispatcher.on('element:figure', (evt, data, conversionApi) => {\n const viewFigureElement = data.viewItem;\n if (!data.modelRange || !viewFigureElement.hasClass('image')) {\n return;\n }\n const viewAttributes = dataFilter.processViewAttributes(viewFigureElement, conversionApi);\n if (viewAttributes) {\n conversionApi.writer.setAttribute('htmlFigureAttributes', viewAttributes, data.modelRange);\n }\n }, { priority: 'low' });\n };\n}\n/**\n * A model-to-view conversion helper applying attributes from the {@link module:image/image~Image Image}\n * feature.\n * @returns Returns a conversion callback.\n */\nfunction modelToViewImageAttributeConverter() {\n return (dispatcher) => {\n addInlineAttributeConversion('htmlAttributes');\n addBlockAttributeConversion('img', 'htmlAttributes');\n addBlockAttributeConversion('figure', 'htmlFigureAttributes');\n addBlockAttributeConversion('a', 'htmlLinkAttributes');\n function addInlineAttributeConversion(attributeName) {\n dispatcher.on(`attribute:${attributeName}:imageInline`, (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const { attributeOldValue, attributeNewValue } = data;\n const viewElement = conversionApi.mapper.toViewElement(data.item);\n updateViewAttributes(conversionApi.writer, attributeOldValue, attributeNewValue, viewElement);\n }, { priority: 'low' });\n }\n function addBlockAttributeConversion(elementName, attributeName) {\n dispatcher.on(`attribute:${attributeName}:imageBlock`, (evt, data, conversionApi) => {\n if (!conversionApi.consumable.test(data.item, evt.name)) {\n return;\n }\n const { attributeOldValue, attributeNewValue } = data;\n const containerElement = conversionApi.mapper.toViewElement(data.item);\n const viewElement = getDescendantElement(conversionApi.writer, containerElement, elementName);\n if (viewElement) {\n updateViewAttributes(conversionApi.writer, attributeOldValue, attributeNewValue, viewElement);\n conversionApi.consumable.consume(data.item, evt.name);\n }\n }, { priority: 'low' });\n if (elementName === 'a') {\n // To have a link element in the view, we need to attach a converter to the `linkHref` attribute as well.\n dispatcher.on('attribute:linkHref:imageBlock', (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, 'attribute:htmlLinkAttributes:imageBlock')) {\n return;\n }\n const containerElement = conversionApi.mapper.toViewElement(data.item);\n const viewElement = getDescendantElement(conversionApi.writer, containerElement, 'a');\n setViewAttributes(conversionApi.writer, data.item.getAttribute('htmlLinkAttributes'), viewElement);\n }, { priority: 'low' });\n }\n }\n };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module html-support/integrations/mediaembed\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport DataFilter from '../datafilter';\nimport DataSchema from '../dataschema';\nimport { updateViewAttributes } from '../utils';\nimport { getDescendantElement } from './integrationutils';\n/**\n * Provides the General HTML Support integration with {@link module:media-embed/mediaembed~MediaEmbed Media Embed} feature.\n */\nexport default class MediaEmbedElementSupport extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [DataFilter];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'MediaEmbedElementSupport';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Stop here if MediaEmbed plugin is not provided or the integrator wants to output markup with previews as\n // we do not support filtering previews.\n if (!editor.plugins.has('MediaEmbed') || editor.config.get('mediaEmbed.previewsInData')) {\n return;\n }\n const schema = editor.model.schema;\n const conversion = editor.conversion;\n const dataFilter = this.editor.plugins.get(DataFilter);\n const dataSchema = this.editor.plugins.get(DataSchema);\n const mediaElementName = editor.config.get('mediaEmbed.elementName');\n // Overwrite GHS schema definition for a given elementName.\n dataSchema.registerBlockElement({\n model: 'media',\n view: mediaElementName\n });\n dataFilter.on('register:figure', () => {\n conversion.for('upcast').add(viewToModelFigureAttributesConverter(dataFilter));\n });\n dataFilter.on(`register:${mediaElementName}`, (evt, definition) => {\n if (definition.model !== 'media') {\n return;\n }\n schema.extend('media', {\n allowAttributes: [\n 'htmlAttributes',\n 'htmlFigureAttributes'\n ]\n });\n conversion.for('upcast').add(viewToModelMediaAttributesConverter(dataFilter, mediaElementName));\n conversion.for('dataDowncast').add(modelToViewMediaAttributeConverter(mediaElementName));\n evt.stop();\n });\n }\n}\nfunction viewToModelMediaAttributesConverter(dataFilter, mediaElementName) {\n const upcastMedia = (evt, data, conversionApi) => {\n const viewMediaElement = data.viewItem;\n preserveElementAttributes(viewMediaElement, 'htmlAttributes');\n function preserveElementAttributes(viewElement, attributeName) {\n const viewAttributes = dataFilter.processViewAttributes(viewElement, conversionApi);\n if (viewAttributes) {\n conversionApi.writer.setAttribute(attributeName, viewAttributes, data.modelRange);\n }\n }\n };\n return (dispatcher) => {\n dispatcher.on(`element:${mediaElementName}`, upcastMedia, { priority: 'low' });\n };\n}\n/**\n * View-to-model conversion helper preserving allowed attributes on {@link module:media-embed/mediaembed~MediaEmbed MediaEmbed}\n * feature model element from figure view element.\n *\n * @returns Returns a conversion callback.\n */\nfunction viewToModelFigureAttributesConverter(dataFilter) {\n return (dispatcher) => {\n dispatcher.on('element:figure', (evt, data, conversionApi) => {\n const viewFigureElement = data.viewItem;\n if (!data.modelRange || !viewFigureElement.hasClass('media')) {\n return;\n }\n const viewAttributes = dataFilter.processViewAttributes(viewFigureElement, conversionApi);\n if (viewAttributes) {\n conversionApi.writer.setAttribute('htmlFigureAttributes', viewAttributes, data.modelRange);\n }\n }, { priority: 'low' });\n };\n}\nfunction modelToViewMediaAttributeConverter(mediaElementName) {\n return (dispatcher) => {\n addAttributeConversionDispatcherHandler(mediaElementName, 'htmlAttributes');\n addAttributeConversionDispatcherHandler('figure', 'htmlFigureAttributes');\n function addAttributeConversionDispatcherHandler(elementName, attributeName) {\n dispatcher.on(`attribute:${attributeName}:media`, (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const { attributeOldValue, attributeNewValue } = data;\n const containerElement = conversionApi.mapper.toViewElement(data.item);\n const viewElement = getDescendantElement(conversionApi.writer, containerElement, elementName);\n updateViewAttributes(conversionApi.writer, attributeOldValue, attributeNewValue, viewElement);\n });\n }\n };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module html-support/integrations/script\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { createObjectView, modelToViewBlockAttributeConverter, viewToModelBlockAttributeConverter, viewToModelObjectConverter } from '../converters';\nimport DataFilter from '../datafilter';\n/**\n * Provides the General HTML Support for `script` elements.\n */\nexport default class ScriptElementSupport extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [DataFilter];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ScriptElementSupport';\n }\n /**\n * @inheritDoc\n */\n init() {\n const dataFilter = this.editor.plugins.get(DataFilter);\n dataFilter.on('register:script', (evt, definition) => {\n const editor = this.editor;\n const schema = editor.model.schema;\n const conversion = editor.conversion;\n schema.register('htmlScript', definition.modelSchema);\n schema.extend('htmlScript', {\n allowAttributes: ['htmlAttributes', 'htmlContent'],\n isContent: true\n });\n editor.data.registerRawContentMatcher({\n name: 'script'\n });\n conversion.for('upcast').elementToElement({\n view: 'script',\n model: viewToModelObjectConverter(definition)\n });\n conversion.for('upcast').add(viewToModelBlockAttributeConverter(definition, dataFilter));\n conversion.for('downcast').elementToElement({\n model: 'htmlScript',\n view: (modelElement, { writer }) => {\n return createObjectView('script', modelElement, writer);\n }\n });\n conversion.for('downcast').add(modelToViewBlockAttributeConverter(definition));\n evt.stop();\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { updateViewAttributes } from '../utils';\nimport DataFilter from '../datafilter';\nimport { getDescendantElement } from './integrationutils';\n/**\n * Provides the General HTML Support integration with {@link module:table/table~Table Table} feature.\n */\nexport default class TableElementSupport extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [DataFilter];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableElementSupport';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n if (!editor.plugins.has('TableEditing')) {\n return;\n }\n const schema = editor.model.schema;\n const conversion = editor.conversion;\n const dataFilter = editor.plugins.get(DataFilter);\n const tableUtils = editor.plugins.get('TableUtils');\n dataFilter.on('register:figure', () => {\n conversion.for('upcast').add(viewToModelFigureAttributeConverter(dataFilter));\n });\n dataFilter.on('register:table', (evt, definition) => {\n if (definition.model !== 'table') {\n return;\n }\n schema.extend('table', {\n allowAttributes: [\n 'htmlAttributes',\n // Figure, thead and tbody elements don't have model counterparts.\n // We will be preserving attributes on table element using these attribute keys.\n 'htmlFigureAttributes', 'htmlTheadAttributes', 'htmlTbodyAttributes'\n ]\n });\n conversion.for('upcast').add(viewToModelTableAttributeConverter(dataFilter));\n conversion.for('downcast').add(modelToViewTableAttributeConverter());\n editor.model.document.registerPostFixer(createHeadingRowsPostFixer(editor.model, tableUtils));\n evt.stop();\n });\n }\n}\n/**\n * Creates a model post-fixer for thead and tbody GHS related attributes.\n */\nfunction createHeadingRowsPostFixer(model, tableUtils) {\n return writer => {\n const changes = model.document.differ.getChanges();\n let wasFixed = false;\n for (const change of changes) {\n if (change.type != 'attribute' || change.attributeKey != 'headingRows') {\n continue;\n }\n const table = change.range.start.nodeAfter;\n const hasTHeadAttributes = table.getAttribute('htmlTheadAttributes');\n const hasTBodyAttributes = table.getAttribute('htmlTbodyAttributes');\n if (hasTHeadAttributes && !change.attributeNewValue) {\n writer.removeAttribute('htmlTheadAttributes', table);\n wasFixed = true;\n }\n else if (hasTBodyAttributes && change.attributeNewValue == tableUtils.getRows(table)) {\n writer.removeAttribute('htmlTbodyAttributes', table);\n wasFixed = true;\n }\n }\n return wasFixed;\n };\n}\n/**\n * View-to-model conversion helper preserving allowed attributes on {@link module:table/table~Table Table}\n * feature model element.\n *\n * @returns Returns a conversion callback.\n */\nfunction viewToModelTableAttributeConverter(dataFilter) {\n return (dispatcher) => {\n dispatcher.on('element:table', (evt, data, conversionApi) => {\n if (!data.modelRange) {\n return;\n }\n const viewTableElement = data.viewItem;\n preserveElementAttributes(viewTableElement, 'htmlAttributes');\n for (const childNode of viewTableElement.getChildren()) {\n if (childNode.is('element', 'thead')) {\n preserveElementAttributes(childNode, 'htmlTheadAttributes');\n }\n if (childNode.is('element', 'tbody')) {\n preserveElementAttributes(childNode, 'htmlTbodyAttributes');\n }\n }\n function preserveElementAttributes(viewElement, attributeName) {\n const viewAttributes = dataFilter.processViewAttributes(viewElement, conversionApi);\n if (viewAttributes) {\n conversionApi.writer.setAttribute(attributeName, viewAttributes, data.modelRange);\n }\n }\n }, { priority: 'low' });\n };\n}\n/**\n * View-to-model conversion helper preserving allowed attributes on {@link module:table/table~Table Table}\n * feature model element from figure view element.\n *\n * @returns Returns a conversion callback.\n */\nfunction viewToModelFigureAttributeConverter(dataFilter) {\n return (dispatcher) => {\n dispatcher.on('element:figure', (evt, data, conversionApi) => {\n const viewFigureElement = data.viewItem;\n if (!data.modelRange || !viewFigureElement.hasClass('table')) {\n return;\n }\n const viewAttributes = dataFilter.processViewAttributes(viewFigureElement, conversionApi);\n if (viewAttributes) {\n conversionApi.writer.setAttribute('htmlFigureAttributes', viewAttributes, data.modelRange);\n }\n }, { priority: 'low' });\n };\n}\n/**\n * Model-to-view conversion helper applying attributes from {@link module:table/table~Table Table}\n * feature.\n *\n * @returns Returns a conversion callback.\n */\nfunction modelToViewTableAttributeConverter() {\n return (dispatcher) => {\n addAttributeConversionDispatcherHandler('table', 'htmlAttributes');\n addAttributeConversionDispatcherHandler('figure', 'htmlFigureAttributes');\n addAttributeConversionDispatcherHandler('thead', 'htmlTheadAttributes');\n addAttributeConversionDispatcherHandler('tbody', 'htmlTbodyAttributes');\n function addAttributeConversionDispatcherHandler(elementName, attributeName) {\n dispatcher.on(`attribute:${attributeName}:table`, (evt, data, conversionApi) => {\n if (!conversionApi.consumable.test(data.item, evt.name)) {\n return;\n }\n const containerElement = conversionApi.mapper.toViewElement(data.item);\n const viewElement = getDescendantElement(conversionApi.writer, containerElement, elementName);\n if (!viewElement) {\n return;\n }\n conversionApi.consumable.consume(data.item, evt.name);\n updateViewAttributes(conversionApi.writer, data.attributeOldValue, data.attributeNewValue, viewElement);\n });\n }\n };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module html-support/integrations/style\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { createObjectView, modelToViewBlockAttributeConverter, viewToModelBlockAttributeConverter, viewToModelObjectConverter } from '../converters';\nimport DataFilter from '../datafilter';\n/**\n * Provides the General HTML Support for `style` elements.\n */\nexport default class StyleElementSupport extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [DataFilter];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'StyleElementSupport';\n }\n /**\n * @inheritDoc\n */\n init() {\n const dataFilter = this.editor.plugins.get(DataFilter);\n dataFilter.on('register:style', (evt, definition) => {\n const editor = this.editor;\n const schema = editor.model.schema;\n const conversion = editor.conversion;\n schema.register('htmlStyle', definition.modelSchema);\n schema.extend('htmlStyle', {\n allowAttributes: ['htmlAttributes', 'htmlContent'],\n isContent: true\n });\n editor.data.registerRawContentMatcher({\n name: 'style'\n });\n conversion.for('upcast').elementToElement({\n view: 'style',\n model: viewToModelObjectConverter(definition)\n });\n conversion.for('upcast').add(viewToModelBlockAttributeConverter(definition, dataFilter));\n conversion.for('downcast').elementToElement({\n model: 'htmlStyle',\n view: (modelElement, { writer }) => {\n return createObjectView('style', modelElement, writer);\n }\n });\n conversion.for('downcast').add(modelToViewBlockAttributeConverter(definition));\n evt.stop();\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module html-support/integrations/documentlist\n */\nimport { isEqual } from 'lodash-es';\nimport { Plugin } from 'ckeditor5/src/core';\nimport { setViewAttributes } from '../utils';\nimport DataFilter from '../datafilter';\n/**\n * Provides the General HTML Support integration with the {@link module:list/documentlist~DocumentList Document List} feature.\n */\nexport default class DocumentListElementSupport extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [DataFilter];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'DocumentListElementSupport';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n if (!editor.plugins.has('DocumentListEditing')) {\n return;\n }\n const schema = editor.model.schema;\n const conversion = editor.conversion;\n const dataFilter = editor.plugins.get(DataFilter);\n const documentListEditing = editor.plugins.get('DocumentListEditing');\n // Register downcast strategy.\n // Note that this must be done before document list editing registers conversion in afterInit.\n documentListEditing.registerDowncastStrategy({\n scope: 'item',\n attributeName: 'htmlLiAttributes',\n setAttributeOnDowncast(writer, attributeValue, viewElement) {\n setViewAttributes(writer, attributeValue, viewElement);\n }\n });\n documentListEditing.registerDowncastStrategy({\n scope: 'list',\n attributeName: 'htmlListAttributes',\n setAttributeOnDowncast(writer, viewAttributes, viewElement) {\n setViewAttributes(writer, viewAttributes, viewElement);\n }\n });\n dataFilter.on('register', (evt, definition) => {\n if (!['ul', 'ol', 'li'].includes(definition.view)) {\n return;\n }\n evt.stop();\n // Do not register same converters twice.\n if (schema.checkAttribute('$block', 'htmlListAttributes')) {\n return;\n }\n schema.extend('$block', { allowAttributes: ['htmlListAttributes', 'htmlLiAttributes'] });\n schema.extend('$blockObject', { allowAttributes: ['htmlListAttributes', 'htmlLiAttributes'] });\n schema.extend('$container', { allowAttributes: ['htmlListAttributes', 'htmlLiAttributes'] });\n conversion.for('upcast').add(dispatcher => {\n dispatcher.on('element:ul', viewToModelListAttributeConverter('htmlListAttributes', dataFilter), { priority: 'low' });\n dispatcher.on('element:ol', viewToModelListAttributeConverter('htmlListAttributes', dataFilter), { priority: 'low' });\n dispatcher.on('element:li', viewToModelListAttributeConverter('htmlLiAttributes', dataFilter), { priority: 'low' });\n });\n });\n // Make sure that all items in a single list (items at the same level & listType) have the same properties.\n // Note: This is almost an exact copy from DocumentListPropertiesEditing.\n documentListEditing.on('postFixer', (evt, { listNodes, writer }) => {\n const previousNodesByIndent = []; // Last seen nodes of lower indented lists.\n for (const { node, previous } of listNodes) {\n // For the first list block there is nothing to compare with.\n if (!previous) {\n continue;\n }\n const nodeIndent = node.getAttribute('listIndent');\n const previousNodeIndent = previous.getAttribute('listIndent');\n let previousNodeInList = null; // It's like `previous` but has the same indent as current node.\n // Let's find previous node for the same indent.\n // We're going to need that when we get back to previous indent.\n if (nodeIndent > previousNodeIndent) {\n previousNodesByIndent[previousNodeIndent] = previous;\n }\n // Restore the one for given indent.\n else if (nodeIndent < previousNodeIndent) {\n previousNodeInList = previousNodesByIndent[nodeIndent];\n previousNodesByIndent.length = nodeIndent;\n }\n // Same indent.\n else {\n previousNodeInList = previous;\n }\n // This is a first item of a nested list.\n if (!previousNodeInList) {\n continue;\n }\n if (previousNodeInList.getAttribute('listType') == node.getAttribute('listType')) {\n const value = previousNodeInList.getAttribute('htmlListAttributes');\n if (!isEqual(node.getAttribute('htmlListAttributes'), value)) {\n writer.setAttribute('htmlListAttributes', value, node);\n evt.return = true;\n }\n }\n if (previousNodeInList.getAttribute('listItemId') == node.getAttribute('listItemId')) {\n const value = previousNodeInList.getAttribute('htmlLiAttributes');\n if (!isEqual(node.getAttribute('htmlLiAttributes'), value)) {\n writer.setAttribute('htmlLiAttributes', value, node);\n evt.return = true;\n }\n }\n }\n });\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n const editor = this.editor;\n if (!editor.commands.get('indentList')) {\n return;\n }\n // Reset list attributes after indenting list items.\n const indentList = editor.commands.get('indentList');\n this.listenTo(indentList, 'afterExecute', (evt, changedBlocks) => {\n editor.model.change(writer => {\n for (const node of changedBlocks) {\n // Just reset the attribute.\n // If there is a previous indented list that this node should be merged into,\n // the postfixer will unify all the attributes of both sub-lists.\n writer.setAttribute('htmlListAttributes', {}, node);\n }\n });\n });\n }\n}\n/**\n * View-to-model conversion helper preserving allowed attributes on {@link TODO}\n * feature model element.\n *\n * @returns Returns a conversion callback.\n */\nfunction viewToModelListAttributeConverter(attributeName, dataFilter) {\n const callback = (evt, data, conversionApi) => {\n const viewElement = data.viewItem;\n if (!data.modelRange) {\n Object.assign(data, conversionApi.convertChildren(data.viewItem, data.modelCursor));\n }\n const viewAttributes = dataFilter.processViewAttributes(viewElement, conversionApi);\n for (const item of data.modelRange.getItems({ shallow: true })) {\n // Apply only to list item blocks.\n if (!item.hasAttribute('listItemId')) {\n continue;\n }\n // Set list attributes only on same level items, those nested deeper are already handled\n // by the recursive conversion.\n if (item.hasAttribute(attributeName)) {\n continue;\n }\n conversionApi.writer.setAttribute(attributeName, viewAttributes || {}, item);\n }\n };\n return callback;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module html-support/integrations/customelement\n */\n/* globals document */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { UpcastWriter } from 'ckeditor5/src/engine';\nimport DataSchema from '../dataschema';\nimport DataFilter from '../datafilter';\nimport { setViewAttributes } from '../utils';\n/**\n * Provides the General HTML Support for custom elements (not registered in the {@link module:html-support/dataschema~DataSchema}).\n */\nexport default class CustomElementSupport extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [DataFilter, DataSchema];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'CustomElementSupport';\n }\n /**\n * @inheritDoc\n */\n init() {\n const dataFilter = this.editor.plugins.get(DataFilter);\n const dataSchema = this.editor.plugins.get(DataSchema);\n dataFilter.on('register:$customElement', (evt, definition) => {\n evt.stop();\n const editor = this.editor;\n const schema = editor.model.schema;\n const conversion = editor.conversion;\n const unsafeElements = editor.editing.view.domConverter.unsafeElements;\n const preLikeElements = editor.data.htmlProcessor.domConverter.preElements;\n schema.register(definition.model, definition.modelSchema);\n schema.extend(definition.model, {\n allowAttributes: ['htmlElementName', 'htmlAttributes', 'htmlContent'],\n isContent: true\n });\n // Being executed on the low priority, it will catch all elements that were not caught by other converters.\n conversion.for('upcast').elementToElement({\n view: /.*/,\n model: (viewElement, conversionApi) => {\n // Do not try to convert $comment fake element.\n if (viewElement.name == '$comment') {\n return null;\n }\n if (!isValidElementName(viewElement.name)) {\n return null;\n }\n // Allow for fallback only if this element is not defined in data schema to make sure\n // that this will handle only custom elements not registered in the data schema.\n if (dataSchema.getDefinitionsForView(viewElement.name).size) {\n return null;\n }\n // Make sure that this element will not render in the editing view.\n if (!unsafeElements.includes(viewElement.name)) {\n unsafeElements.push(viewElement.name);\n }\n // Make sure that whitespaces will not be trimmed or replaced by nbsps while stringify content.\n if (!preLikeElements.includes(viewElement.name)) {\n preLikeElements.push(viewElement.name);\n }\n const modelElement = conversionApi.writer.createElement(definition.model, {\n htmlElementName: viewElement.name\n });\n const htmlAttributes = dataFilter.processViewAttributes(viewElement, conversionApi);\n if (htmlAttributes) {\n conversionApi.writer.setAttribute('htmlAttributes', htmlAttributes, modelElement);\n }\n // Store the whole element in the attribute so that DomConverter will be able to use the pre like element context.\n const viewWriter = new UpcastWriter(viewElement.document);\n const documentFragment = viewWriter.createDocumentFragment(viewElement);\n const htmlContent = editor.data.processor.toData(documentFragment);\n conversionApi.writer.setAttribute('htmlContent', htmlContent, modelElement);\n // Consume the content of the element.\n for (const { item } of editor.editing.view.createRangeIn(viewElement)) {\n conversionApi.consumable.consume(item, { name: true });\n }\n return modelElement;\n },\n converterPriority: 'low'\n });\n // Because this element is unsafe (DomConverter#unsafeElements), it will render as a transparent <span> but it must\n // be rendered anyway for the mapping between the model and the view to exist.\n conversion.for('editingDowncast').elementToElement({\n model: {\n name: definition.model,\n attributes: ['htmlElementName', 'htmlAttributes', 'htmlContent']\n },\n view: (modelElement, { writer }) => {\n const viewName = modelElement.getAttribute('htmlElementName');\n const viewElement = writer.createRawElement(viewName);\n if (modelElement.hasAttribute('htmlAttributes')) {\n setViewAttributes(writer, modelElement.getAttribute('htmlAttributes'), viewElement);\n }\n return viewElement;\n }\n });\n conversion.for('dataDowncast').elementToElement({\n model: {\n name: definition.model,\n attributes: ['htmlElementName', 'htmlAttributes', 'htmlContent']\n },\n view: (modelElement, { writer }) => {\n const viewName = modelElement.getAttribute('htmlElementName');\n const htmlContent = modelElement.getAttribute('htmlContent');\n const viewElement = writer.createRawElement(viewName, null, (domElement, domConverter) => {\n domConverter.setContentOf(domElement, htmlContent);\n // Unwrap the custom element content (it was stored in the attribute as the whole custom element).\n // See the upcast conversion for the \"htmlContent\" attribute to learn more.\n const customElement = domElement.firstChild;\n customElement.remove();\n while (customElement.firstChild) {\n domElement.appendChild(customElement.firstChild);\n }\n });\n if (modelElement.hasAttribute('htmlAttributes')) {\n setViewAttributes(writer, modelElement.getAttribute('htmlAttributes'), viewElement);\n }\n return viewElement;\n }\n });\n });\n }\n}\n/**\n * Returns true if name is valid for a DOM element name.\n */\nfunction isValidElementName(name) {\n try {\n document.createElement(name);\n }\n catch (error) {\n return false;\n }\n return true;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module html-support/generalhtmlsupport\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { toArray } from 'ckeditor5/src/utils';\nimport DataFilter from './datafilter';\nimport CodeBlockElementSupport from './integrations/codeblock';\nimport DualContentModelElementSupport from './integrations/dualcontent';\nimport HeadingElementSupport from './integrations/heading';\nimport ImageElementSupport from './integrations/image';\nimport MediaEmbedElementSupport from './integrations/mediaembed';\nimport ScriptElementSupport from './integrations/script';\nimport TableElementSupport from './integrations/table';\nimport StyleElementSupport from './integrations/style';\nimport DocumentListElementSupport from './integrations/documentlist';\nimport CustomElementSupport from './integrations/customelement';\nimport { modifyGhsAttribute } from './utils';\n/**\n * The General HTML Support feature.\n *\n * This is a \"glue\" plugin which initializes the {@link module:html-support/datafilter~DataFilter data filter} configuration\n * and features integration with the General HTML Support.\n */\nexport default class GeneralHtmlSupport extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'GeneralHtmlSupport';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [\n DataFilter,\n CodeBlockElementSupport,\n DualContentModelElementSupport,\n HeadingElementSupport,\n ImageElementSupport,\n MediaEmbedElementSupport,\n ScriptElementSupport,\n TableElementSupport,\n StyleElementSupport,\n DocumentListElementSupport,\n CustomElementSupport\n ];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const dataFilter = editor.plugins.get(DataFilter);\n // Load the filtering configuration.\n dataFilter.loadAllowedConfig(editor.config.get('htmlSupport.allow') || []);\n dataFilter.loadDisallowedConfig(editor.config.get('htmlSupport.disallow') || []);\n }\n /**\n * Returns a GHS model attribute name related to a given view element name.\n *\n * @internal\n * @param viewElementName A view element name.\n */\n getGhsAttributeNameForElement(viewElementName) {\n const dataSchema = this.editor.plugins.get('DataSchema');\n const definitions = Array.from(dataSchema.getDefinitionsForView(viewElementName, false));\n const inlineDefinition = definitions.find(definition => (definition.isInline && !definitions[0].isObject));\n if (inlineDefinition) {\n return inlineDefinition.model;\n }\n return 'htmlAttributes';\n }\n /**\n * Updates GHS model attribute for a specified view element name, so it includes the given class name.\n *\n * @internal\n * @param viewElementName A view element name.\n * @param className The css class to add.\n * @param selectable The selection or element to update.\n */\n addModelHtmlClass(viewElementName, className, selectable) {\n const model = this.editor.model;\n const ghsAttributeName = this.getGhsAttributeNameForElement(viewElementName);\n model.change(writer => {\n for (const item of getItemsToUpdateGhsAttribute(model, selectable, ghsAttributeName)) {\n modifyGhsAttribute(writer, item, ghsAttributeName, 'classes', classes => {\n for (const value of toArray(className)) {\n classes.add(value);\n }\n });\n }\n });\n }\n /**\n * Updates GHS model attribute for a specified view element name, so it does not include the given class name.\n *\n * @internal\n * @param viewElementName A view element name.\n * @param className The css class to remove.\n * @param selectable The selection or element to update.\n */\n removeModelHtmlClass(viewElementName, className, selectable) {\n const model = this.editor.model;\n const ghsAttributeName = this.getGhsAttributeNameForElement(viewElementName);\n model.change(writer => {\n for (const item of getItemsToUpdateGhsAttribute(model, selectable, ghsAttributeName)) {\n modifyGhsAttribute(writer, item, ghsAttributeName, 'classes', classes => {\n for (const value of toArray(className)) {\n classes.delete(value);\n }\n });\n }\n });\n }\n /**\n * Updates GHS model attribute for a specified view element name, so it includes the given attribute.\n *\n * @param viewElementName A view element name.\n * @param attributes The object with attributes to set.\n * @param selectable The selection or element to update.\n */\n setModelHtmlAttributes(viewElementName, attributes, selectable) {\n const model = this.editor.model;\n const ghsAttributeName = this.getGhsAttributeNameForElement(viewElementName);\n model.change(writer => {\n for (const item of getItemsToUpdateGhsAttribute(model, selectable, ghsAttributeName)) {\n modifyGhsAttribute(writer, item, ghsAttributeName, 'attributes', attributesMap => {\n for (const [key, value] of Object.entries(attributes)) {\n attributesMap.set(key, value);\n }\n });\n }\n });\n }\n /**\n * Updates GHS model attribute for a specified view element name, so it does not include the given attribute.\n *\n * @param viewElementName A view element name.\n * @param attributeName The attribute name (or names) to remove.\n * @param selectable The selection or element to update.\n */\n removeModelHtmlAttributes(viewElementName, attributeName, selectable) {\n const model = this.editor.model;\n const ghsAttributeName = this.getGhsAttributeNameForElement(viewElementName);\n model.change(writer => {\n for (const item of getItemsToUpdateGhsAttribute(model, selectable, ghsAttributeName)) {\n modifyGhsAttribute(writer, item, ghsAttributeName, 'attributes', attributesMap => {\n for (const key of toArray(attributeName)) {\n attributesMap.delete(key);\n }\n });\n }\n });\n }\n /**\n * Updates GHS model attribute for a specified view element name, so it includes a given style.\n *\n * @param viewElementName A view element name.\n * @param styles The object with styles to set.\n * @param selectable The selection or element to update.\n */\n setModelHtmlStyles(viewElementName, styles, selectable) {\n const model = this.editor.model;\n const ghsAttributeName = this.getGhsAttributeNameForElement(viewElementName);\n model.change(writer => {\n for (const item of getItemsToUpdateGhsAttribute(model, selectable, ghsAttributeName)) {\n modifyGhsAttribute(writer, item, ghsAttributeName, 'styles', stylesMap => {\n for (const [key, value] of Object.entries(styles)) {\n stylesMap.set(key, value);\n }\n });\n }\n });\n }\n /**\n * Updates GHS model attribute for a specified view element name, so it does not include a given style.\n *\n * @param viewElementName A view element name.\n * @param properties The style (or styles list) to remove.\n * @param selectable The selection or element to update.\n */\n removeModelHtmlStyles(viewElementName, properties, selectable) {\n const model = this.editor.model;\n const ghsAttributeName = this.getGhsAttributeNameForElement(viewElementName);\n model.change(writer => {\n for (const item of getItemsToUpdateGhsAttribute(model, selectable, ghsAttributeName)) {\n modifyGhsAttribute(writer, item, ghsAttributeName, 'styles', stylesMap => {\n for (const key of toArray(properties)) {\n stylesMap.delete(key);\n }\n });\n }\n });\n }\n}\n/**\n * Returns an iterator over an items in the selectable that accept given GHS attribute.\n */\nfunction* getItemsToUpdateGhsAttribute(model, selectable, ghsAttributeName) {\n if (!selectable) {\n return;\n }\n if (!(Symbol.iterator in selectable) && selectable.is('documentSelection') && selectable.isCollapsed) {\n if (model.schema.checkAttributeInSelection(selectable, ghsAttributeName)) {\n yield selectable;\n }\n }\n else {\n for (const range of getValidRangesForSelectable(model, selectable, ghsAttributeName)) {\n yield* range.getItems({ shallow: true });\n }\n }\n}\n/**\n * Translates a given selectable to an iterable of ranges.\n */\nfunction getValidRangesForSelectable(model, selectable, ghsAttributeName) {\n if (!(Symbol.iterator in selectable) &&\n (selectable.is('node') ||\n selectable.is('$text') ||\n selectable.is('$textProxy'))) {\n if (model.schema.checkAttribute(selectable, ghsAttributeName)) {\n return [model.createRangeOn(selectable)];\n }\n else {\n return [];\n }\n }\n else {\n return model.schema.getValidRanges(model.createSelection(selectable).getRanges(), ghsAttributeName);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paragraph/paragraphcommand\n */\nimport { Command } from '@ckeditor/ckeditor5-core';\nimport { first } from '@ckeditor/ckeditor5-utils';\n/**\n * The paragraph command.\n */\nexport default class ParagraphCommand extends Command {\n constructor(editor) {\n super(editor);\n // Since this command may pass selection in execution block, it should be checked directly.\n this._isEnabledBasedOnSelection = false;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const model = this.editor.model;\n const document = model.document;\n const block = first(document.selection.getSelectedBlocks());\n this.value = !!block && block.is('element', 'paragraph');\n this.isEnabled = !!block && checkCanBecomeParagraph(block, model.schema);\n }\n /**\n * Executes the command. All the blocks (see {@link module:engine/model/schema~Schema}) in the selection\n * will be turned to paragraphs.\n *\n * @fires execute\n * @param options Options for the executed command.\n * @param options.selection The selection that the command should be applied to. By default,\n * if not provided, the command is applied to the {@link module:engine/model/document~Document#selection}.\n */\n execute(options = {}) {\n const model = this.editor.model;\n const document = model.document;\n const selection = options.selection || document.selection;\n // Don't execute command if selection is in non-editable place.\n if (!model.canEditAt(selection)) {\n return;\n }\n model.change(writer => {\n const blocks = selection.getSelectedBlocks();\n for (const block of blocks) {\n if (!block.is('element', 'paragraph') && checkCanBecomeParagraph(block, model.schema)) {\n writer.rename(block, 'paragraph');\n }\n }\n });\n }\n}\n/**\n * Checks whether the given block can be replaced by a paragraph.\n *\n * @param block A block to be tested.\n * @param schema The schema of the document.\n */\nfunction checkCanBecomeParagraph(block, schema) {\n return schema.checkChild(block.parent, 'paragraph') && !schema.isObject(block);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paragraph/insertparagraphcommand\n */\nimport { Command } from '@ckeditor/ckeditor5-core';\n/**\n * The insert paragraph command. It inserts a new paragraph at a specific\n * {@link module:engine/model/position~Position document position}.\n *\n * ```ts\n * // Insert a new paragraph before an element in the document.\n * editor.execute( 'insertParagraph', {\n * position: editor.model.createPositionBefore( element )\n * } );\n * ```\n *\n * If a paragraph is disallowed in the context of the specific position, the command\n * will attempt to split position ancestors to find a place where it is possible\n * to insert a paragraph.\n *\n * **Note**: This command moves the selection to the inserted paragraph.\n */\nexport default class InsertParagraphCommand extends Command {\n constructor(editor) {\n super(editor);\n // Since this command passes position in execution block instead of selection, it should be checked directly.\n this._isEnabledBasedOnSelection = false;\n }\n /**\n * Executes the command.\n *\n * @param options Options for the executed command.\n * @param options.position The model position at which the new paragraph will be inserted.\n * @param options.attributes Attributes keys and values to set on a inserted paragraph.\n * @fires execute\n */\n execute(options) {\n const model = this.editor.model;\n const attributes = options.attributes;\n let position = options.position;\n // Don't execute command if position is in non-editable place.\n if (!model.canEditAt(position)) {\n return;\n }\n model.change(writer => {\n const paragraph = writer.createElement('paragraph');\n if (attributes) {\n model.schema.setAllowedAttributes(paragraph, attributes, writer);\n }\n if (!model.schema.checkChild(position.parent, paragraph)) {\n const allowedParent = model.schema.findAllowedParent(position, paragraph);\n // It could be there's no ancestor limit that would allow paragraph.\n // In theory, \"paragraph\" could be disallowed even in the \"$root\".\n if (!allowedParent) {\n return;\n }\n position = writer.split(position, allowedParent).position;\n }\n model.insertContent(paragraph, position);\n writer.setSelection(paragraph, 'in');\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paragraph/paragraph\n */\nimport ParagraphCommand from './paragraphcommand';\nimport InsertParagraphCommand from './insertparagraphcommand';\nimport { Plugin } from '@ckeditor/ckeditor5-core';\n/**\n * The paragraph feature for the editor.\n *\n * It introduces the `<paragraph>` element in the model which renders as a `<p>` element in the DOM and data.\n *\n * It also brings two editors commands:\n *\n * * The {@link module:paragraph/paragraphcommand~ParagraphCommand `'paragraph'`} command that converts all\n * blocks in the model selection into paragraphs.\n * * The {@link module:paragraph/insertparagraphcommand~InsertParagraphCommand `'insertParagraph'`} command\n * that inserts a new paragraph at a specified location in the model.\n */\nexport default class Paragraph extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Paragraph';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const model = editor.model;\n editor.commands.add('paragraph', new ParagraphCommand(editor));\n editor.commands.add('insertParagraph', new InsertParagraphCommand(editor));\n // Schema.\n model.schema.register('paragraph', { inheritAllFrom: '$block' });\n editor.conversion.elementToElement({ model: 'paragraph', view: 'p' });\n // Conversion for paragraph-like elements which has not been converted by any plugin.\n editor.conversion.for('upcast').elementToElement({\n model: (viewElement, { writer }) => {\n if (!Paragraph.paragraphLikeElements.has(viewElement.name)) {\n return null;\n }\n // Do not auto-paragraph empty elements.\n if (viewElement.isEmpty) {\n return null;\n }\n return writer.createElement('paragraph');\n },\n view: /.+/,\n converterPriority: 'low'\n });\n }\n}\n/**\n * A 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 * ```html\n * <h1>Foo</h1>\n * <table>\n * <tr>\n * <td>X</td>\n * <td>\n * <ul>\n * <li>Y</li>\n * <li>Z</li>\n * </ul>\n * </td>\n * </tr>\n * </table>\n * ```\n *\n * contains five paragraph-like elements: `<h1>`, two `<td>`s and two `<li>`s.\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 * ```html\n * <p>Foo</p>\n * <p>X</p>\n * <p>Y</p>\n * <p>Z</p>\n * ```\n *\n * Note: The `<td>` containing two `<li>` elements was ignored as the innermost paragraph-like elements\n * have a priority upon conversion.\n */\nParagraph.paragraphLikeElements = new Set([\n 'blockquote',\n 'dd',\n 'div',\n 'dt',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'li',\n 'p',\n 'td',\n 'th'\n]);\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module heading/headingcommand\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { first } from 'ckeditor5/src/utils';\n/**\n * The heading command. It is used by the {@link module:heading/heading~Heading heading feature} to apply headings.\n */\nexport default class HeadingCommand extends Command {\n /**\n * Creates an instance of the command.\n *\n * @param editor Editor instance.\n * @param modelElements Names of the element which this command can apply in the model.\n */\n constructor(editor, modelElements) {\n super(editor);\n this.modelElements = modelElements;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const block = first(this.editor.model.document.selection.getSelectedBlocks());\n this.value = !!block && this.modelElements.includes(block.name) && block.name;\n this.isEnabled = !!block && this.modelElements.some(heading => checkCanBecomeHeading(block, heading, this.editor.model.schema));\n }\n /**\n * Executes the command. Applies the heading to the selected blocks or, if the first selected\n * block is a heading already, turns selected headings (of this level only) to paragraphs.\n *\n * @param options.value Name of the element which this command will apply in the model.\n * @fires execute\n */\n execute(options) {\n const model = this.editor.model;\n const document = model.document;\n const modelElement = options.value;\n model.change(writer => {\n const blocks = Array.from(document.selection.getSelectedBlocks())\n .filter(block => {\n return checkCanBecomeHeading(block, modelElement, model.schema);\n });\n for (const block of blocks) {\n if (!block.is('element', modelElement)) {\n writer.rename(block, modelElement);\n }\n }\n });\n }\n}\n/**\n * Checks whether the given block can be replaced by a specific heading.\n *\n * @param block A block to be tested.\n * @param heading Command element name in the model.\n * @param schema The schema of the document.\n */\nfunction checkCanBecomeHeading(block, heading, schema) {\n return schema.checkChild(block.parent, heading) && !schema.isObject(block);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module heading/headingediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Paragraph } from 'ckeditor5/src/paragraph';\nimport { priorities } from 'ckeditor5/src/utils';\nimport HeadingCommand from './headingcommand';\nconst defaultModelElement = 'paragraph';\n/**\n * The headings engine feature. It handles switching between block formats &ndash; headings and paragraph.\n * This class represents the engine part of the heading feature. See also {@link module:heading/heading~Heading}.\n * It introduces `heading1`-`headingN` commands which allow to convert paragraphs into headings.\n */\nexport default class HeadingEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'HeadingEditing';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n editor.config.define('heading', {\n options: [\n { model: 'paragraph', title: 'Paragraph', class: 'ck-heading_paragraph' },\n { model: 'heading1', view: 'h2', title: 'Heading 1', class: 'ck-heading_heading1' },\n { model: 'heading2', view: 'h3', title: 'Heading 2', class: 'ck-heading_heading2' },\n { model: 'heading3', view: 'h4', title: 'Heading 3', class: 'ck-heading_heading3' }\n ]\n });\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [Paragraph];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const options = editor.config.get('heading.options');\n const modelElements = [];\n for (const option of options) {\n // Skip paragraph - it is defined in required Paragraph feature.\n if (option.model === 'paragraph') {\n continue;\n }\n // Schema.\n editor.model.schema.register(option.model, {\n inheritAllFrom: '$block'\n });\n editor.conversion.elementToElement(option);\n modelElements.push(option.model);\n }\n this._addDefaultH1Conversion(editor);\n // Register the heading command for this option.\n editor.commands.add('heading', new HeadingCommand(editor, modelElements));\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n // If the enter command is added to the editor, alter its behavior.\n // Enter at the end of a heading element should create a paragraph.\n const editor = this.editor;\n const enterCommand = editor.commands.get('enter');\n const options = editor.config.get('heading.options');\n if (enterCommand) {\n this.listenTo(enterCommand, 'afterExecute', (evt, data) => {\n const positionParent = editor.model.document.selection.getFirstPosition().parent;\n const isHeading = options.some(option => positionParent.is('element', option.model));\n if (isHeading && !positionParent.is('element', defaultModelElement) && positionParent.childCount === 0) {\n data.writer.rename(positionParent, defaultModelElement);\n }\n });\n }\n }\n /**\n * Adds default conversion for `h1` -> `heading1` with a low priority.\n *\n * @param editor Editor instance on which to add the `h1` conversion.\n */\n _addDefaultH1Conversion(editor) {\n editor.conversion.for('upcast').elementToElement({\n model: 'heading1',\n view: 'h1',\n // With a `low` priority, `paragraph` plugin autoparagraphing mechanism is executed. Make sure\n // this listener is called before it. If not, `h1` will be transformed into a paragraph.\n converterPriority: priorities.get('low') + 1\n });\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./heading.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module heading/headingui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Model, createDropdown, addListToDropdown } from 'ckeditor5/src/ui';\nimport { Collection } from 'ckeditor5/src/utils';\nimport { getLocalizedOptions } from './utils';\nimport '../theme/heading.css';\n/**\n * The headings UI feature. It introduces the `headings` dropdown.\n */\nexport default class HeadingUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'HeadingUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n const options = getLocalizedOptions(editor);\n const defaultTitle = t('Choose heading');\n const accessibleLabel = t('Heading');\n // Register UI component.\n editor.ui.componentFactory.add('heading', locale => {\n const titles = {};\n const itemDefinitions = new Collection();\n const headingCommand = editor.commands.get('heading');\n const paragraphCommand = editor.commands.get('paragraph');\n const commands = [headingCommand];\n for (const option of options) {\n const def = {\n type: 'button',\n model: new Model({\n label: option.title,\n class: option.class,\n role: 'menuitemradio',\n withText: true\n })\n };\n if (option.model === 'paragraph') {\n def.model.bind('isOn').to(paragraphCommand, 'value');\n def.model.set('commandName', 'paragraph');\n commands.push(paragraphCommand);\n }\n else {\n def.model.bind('isOn').to(headingCommand, 'value', value => value === option.model);\n def.model.set({\n commandName: 'heading',\n commandValue: option.model\n });\n }\n // Add the option to the collection.\n itemDefinitions.add(def);\n titles[option.model] = option.title;\n }\n const dropdownView = createDropdown(locale);\n addListToDropdown(dropdownView, itemDefinitions, {\n ariaLabel: accessibleLabel,\n role: 'menu'\n });\n dropdownView.buttonView.set({\n ariaLabel: accessibleLabel,\n ariaLabelledBy: undefined,\n isOn: false,\n withText: true,\n tooltip: accessibleLabel\n });\n dropdownView.extendTemplate({\n attributes: {\n class: [\n 'ck-heading-dropdown'\n ]\n }\n });\n dropdownView.bind('isEnabled').toMany(commands, 'isEnabled', (...areEnabled) => {\n return areEnabled.some(isEnabled => isEnabled);\n });\n dropdownView.buttonView.bind('label').to(headingCommand, 'value', paragraphCommand, 'value', (value, para) => {\n const whichModel = value || para && 'paragraph';\n if (typeof whichModel === 'boolean') {\n return defaultTitle;\n }\n // If none of the commands is active, display default title.\n if (!titles[whichModel]) {\n return defaultTitle;\n }\n return titles[whichModel];\n });\n // Execute command when an item from the dropdown is selected.\n this.listenTo(dropdownView, 'execute', evt => {\n const { commandName, commandValue } = evt.source;\n editor.execute(commandName, commandValue ? { value: commandValue } : undefined);\n editor.editing.view.focus();\n });\n return dropdownView;\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Returns heading options as defined in `config.heading.options` but processed to consider\n * the editor localization, i.e. to display {@link module:heading/headingconfig~HeadingOption}\n * in the correct language.\n *\n * Note: The reason behind this method is that there is no way to use {@link module:utils/locale~Locale#t}\n * when the user configuration is defined because the editor does not exist yet.\n */\nexport function getLocalizedOptions(editor) {\n const t = editor.t;\n const localizedTitles = {\n 'Paragraph': t('Paragraph'),\n 'Heading 1': t('Heading 1'),\n 'Heading 2': t('Heading 2'),\n 'Heading 3': t('Heading 3'),\n 'Heading 4': t('Heading 4'),\n 'Heading 5': t('Heading 5'),\n 'Heading 6': t('Heading 6')\n };\n return editor.config.get('heading.options').map(option => {\n const title = localizedTitles[option.title];\n if (title && title != option.title) {\n option.title = title;\n }\n return option;\n });\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module highlight/highlightcommand\n */\nimport { Command } from 'ckeditor5/src/core';\n/**\n * The highlight command. It is used by the {@link module:highlight/highlightediting~HighlightEditing highlight feature}\n * to apply the text highlighting.\n *\n * ```ts\n * editor.execute( 'highlight', { value: 'greenMarker' } );\n * ```\n *\n * **Note**: Executing the command without a value removes the attribute from the model. If the selection is collapsed\n * inside a text with the highlight attribute, the command will remove the attribute from the entire range\n * of that text.\n */\nexport default class HighlightCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const model = this.editor.model;\n const doc = model.document;\n this.value = doc.selection.getAttribute('highlight');\n this.isEnabled = model.schema.checkAttributeInSelection(doc.selection, 'highlight');\n }\n /**\n * Executes the command.\n *\n * @param options Options for the executed command.\n * @param options.value The value to apply.\n *\n * @fires execute\n */\n execute(options = {}) {\n const model = this.editor.model;\n const document = model.document;\n const selection = document.selection;\n const highlighter = options.value;\n model.change(writer => {\n if (selection.isCollapsed) {\n const position = selection.getFirstPosition();\n // When selection is inside text with `highlight` attribute.\n if (selection.hasAttribute('highlight')) {\n // Find the full highlighted range.\n const isSameHighlight = (value) => {\n return value.item.hasAttribute('highlight') && value.item.getAttribute('highlight') === this.value;\n };\n const highlightStart = position.getLastMatchingPosition(isSameHighlight, { direction: 'backward' });\n const highlightEnd = position.getLastMatchingPosition(isSameHighlight);\n const highlightRange = writer.createRange(highlightStart, highlightEnd);\n // Then depending on current value...\n if (!highlighter || this.value === highlighter) {\n // ...remove attribute when passing highlighter different then current or executing \"eraser\".\n // If we're at the end of the highlighted range, we don't want to remove highlight of the range.\n if (!position.isEqual(highlightEnd)) {\n writer.removeAttribute('highlight', highlightRange);\n }\n writer.removeSelectionAttribute('highlight');\n }\n else {\n // ...update `highlight` value.\n // If we're at the end of the highlighted range, we don't want to change the highlight of the range.\n if (!position.isEqual(highlightEnd)) {\n writer.setAttribute('highlight', highlighter, highlightRange);\n }\n writer.setSelectionAttribute('highlight', highlighter);\n }\n }\n else if (highlighter) {\n writer.setSelectionAttribute('highlight', highlighter);\n }\n }\n else {\n const ranges = model.schema.getValidRanges(selection.getRanges(), 'highlight');\n for (const range of ranges) {\n if (highlighter) {\n writer.setAttribute('highlight', highlighter, range);\n }\n else {\n writer.removeAttribute('highlight', range);\n }\n }\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module highlight/highlightediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport HighlightCommand from './highlightcommand';\n/**\n * The highlight editing feature. It introduces the {@link module:highlight/highlightcommand~HighlightCommand command} and the `highlight`\n * attribute in the {@link module:engine/model/model~Model model} which renders in the {@link module:engine/view/view view}\n * as a `<mark>` element with a `class` attribute (`<mark class=\"marker-green\">...</mark>`) depending\n * on the {@link module:highlight/highlightconfig~HighlightConfig configuration}.\n */\nexport default class HighlightEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'HighlightEditing';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n editor.config.define('highlight', {\n options: [\n {\n model: 'yellowMarker',\n class: 'marker-yellow',\n title: 'Yellow marker',\n color: 'var(--ck-highlight-marker-yellow)',\n type: 'marker'\n },\n {\n model: 'greenMarker',\n class: 'marker-green',\n title: 'Green marker',\n color: 'var(--ck-highlight-marker-green)',\n type: 'marker'\n },\n {\n model: 'pinkMarker',\n class: 'marker-pink',\n title: 'Pink marker',\n color: 'var(--ck-highlight-marker-pink)',\n type: 'marker'\n },\n {\n model: 'blueMarker',\n class: 'marker-blue',\n title: 'Blue marker',\n color: 'var(--ck-highlight-marker-blue)',\n type: 'marker'\n },\n {\n model: 'redPen',\n class: 'pen-red',\n title: 'Red pen',\n color: 'var(--ck-highlight-pen-red)',\n type: 'pen'\n },\n {\n model: 'greenPen',\n class: 'pen-green',\n title: 'Green pen',\n color: 'var(--ck-highlight-pen-green)',\n type: 'pen'\n }\n ]\n });\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Allow highlight attribute on text nodes.\n editor.model.schema.extend('$text', { allowAttributes: 'highlight' });\n const options = editor.config.get('highlight.options');\n // Set-up the two-way conversion.\n editor.conversion.attributeToElement(_buildDefinition(options));\n editor.commands.add('highlight', new HighlightCommand(editor));\n }\n}\n/**\n * Converts the options array to a converter definition.\n *\n * @param options An array with configured options.\n */\nfunction _buildDefinition(options) {\n const definition = {\n model: {\n key: 'highlight',\n values: []\n },\n view: {}\n };\n for (const option of options) {\n definition.model.values.push(option.model);\n definition.view[option.model] = {\n name: 'mark',\n classes: option.class\n };\n }\n return definition;\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./highlight.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module highlight/highlightui\n */\nimport { Plugin, icons } from 'ckeditor5/src/core';\nimport { ButtonView, SplitButtonView, ToolbarSeparatorView, createDropdown, addToolbarToDropdown } from 'ckeditor5/src/ui';\nimport markerIcon from './../theme/icons/marker.svg';\nimport penIcon from './../theme/icons/pen.svg';\nimport './../theme/highlight.css';\n/**\n * The default highlight UI plugin. It introduces:\n *\n * * The `'highlight'` dropdown,\n * * The `'removeHighlight'` and `'highlight:*'` buttons.\n *\n * The default configuration includes the following buttons:\n *\n * * `'highlight:yellowMarker'`\n * * `'highlight:greenMarker'`\n * * `'highlight:pinkMarker'`\n * * `'highlight:blueMarker'`\n * * `'highlight:redPen'`\n * * `'highlight:greenPen'`\n *\n * See the {@link module:highlight/highlightconfig~HighlightConfig#options configuration} to learn more\n * about the defaults.\n */\nexport default class HighlightUI extends Plugin {\n /**\n * Returns the localized option titles provided by the plugin.\n *\n * The following localized titles corresponding with default\n * {@link module:highlight/highlightconfig~HighlightConfig#options} are available:\n *\n * * `'Yellow marker'`,\n * * `'Green marker'`,\n * * `'Pink marker'`,\n * * `'Blue marker'`,\n * * `'Red pen'`,\n * * `'Green pen'`.\n */\n get localizedOptionTitles() {\n const t = this.editor.t;\n return {\n 'Yellow marker': t('Yellow marker'),\n 'Green marker': t('Green marker'),\n 'Pink marker': t('Pink marker'),\n 'Blue marker': t('Blue marker'),\n 'Red pen': t('Red pen'),\n 'Green pen': t('Green pen')\n };\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'HighlightUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const options = this.editor.config.get('highlight.options');\n for (const option of options) {\n this._addHighlighterButton(option);\n }\n this._addRemoveHighlightButton();\n this._addDropdown(options);\n }\n /**\n * Creates the \"Remove highlight\" button.\n */\n _addRemoveHighlightButton() {\n const t = this.editor.t;\n const command = this.editor.commands.get('highlight');\n this._addButton('removeHighlight', t('Remove highlight'), icons.eraser, null, button => {\n button.bind('isEnabled').to(command, 'isEnabled');\n });\n }\n /**\n * Creates a toolbar button from the provided highlight option.\n */\n _addHighlighterButton(option) {\n const command = this.editor.commands.get('highlight');\n // TODO: change naming\n this._addButton('highlight:' + option.model, option.title, getIconForType(option.type), option.model, decorateHighlightButton);\n function decorateHighlightButton(button) {\n button.bind('isEnabled').to(command, 'isEnabled');\n button.bind('isOn').to(command, 'value', value => value === option.model);\n button.iconView.fillColor = option.color;\n button.isToggleable = true;\n }\n }\n /**\n * Internal method for creating highlight buttons.\n *\n * @param name The name of the button.\n * @param label The label for the button.\n * @param icon The button icon.\n * @param value The `value` property passed to the executed command.\n * @param decorateButton A callback getting ButtonView instance so that it can be further customized.\n */\n _addButton(name, label, icon, value, decorateButton) {\n const editor = this.editor;\n editor.ui.componentFactory.add(name, locale => {\n const buttonView = new ButtonView(locale);\n const localized = this.localizedOptionTitles[label] ? this.localizedOptionTitles[label] : label;\n buttonView.set({\n label: localized,\n icon,\n tooltip: true\n });\n buttonView.on('execute', () => {\n editor.execute('highlight', { value });\n editor.editing.view.focus();\n });\n // Add additional behavior for buttonView.\n decorateButton(buttonView);\n return buttonView;\n });\n }\n /**\n * Creates the split button dropdown UI from the provided highlight options.\n */\n _addDropdown(options) {\n const editor = this.editor;\n const t = editor.t;\n const componentFactory = editor.ui.componentFactory;\n const startingHighlighter = options[0];\n const optionsMap = options.reduce((retVal, option) => {\n retVal[option.model] = option;\n return retVal;\n }, {});\n componentFactory.add('highlight', locale => {\n const command = editor.commands.get('highlight');\n const dropdownView = createDropdown(locale, SplitButtonView);\n const splitButtonView = dropdownView.buttonView;\n splitButtonView.set({\n label: t('Highlight'),\n tooltip: true,\n // Holds last executed highlighter.\n lastExecuted: startingHighlighter.model,\n // Holds current highlighter to execute (might be different then last used).\n commandValue: startingHighlighter.model,\n isToggleable: true\n });\n // Dropdown button changes to selection (command.value):\n // - If selection is in highlight it get active highlight appearance (icon, color) and is activated.\n // - Otherwise it gets appearance (icon, color) of last executed highlight.\n splitButtonView.bind('icon').to(command, 'value', value => getIconForType(getActiveOption(value, 'type')));\n splitButtonView.bind('color').to(command, 'value', value => getActiveOption(value, 'color'));\n splitButtonView.bind('commandValue').to(command, 'value', value => getActiveOption(value, 'model'));\n splitButtonView.bind('isOn').to(command, 'value', value => !!value);\n splitButtonView.delegate('execute').to(dropdownView);\n // Create buttons array.\n const buttonsCreator = () => {\n const buttons = options.map(option => {\n // Get existing highlighter button.\n const buttonView = componentFactory.create('highlight:' + option.model);\n // Update lastExecutedHighlight on execute.\n this.listenTo(buttonView, 'execute', () => {\n dropdownView.buttonView.set({ lastExecuted: option.model });\n });\n return buttonView;\n });\n // Add separator and eraser buttons to dropdown.\n buttons.push(new ToolbarSeparatorView());\n buttons.push(componentFactory.create('removeHighlight'));\n return buttons;\n };\n // Make toolbar button enabled when any button in dropdown is enabled before adding separator and eraser.\n dropdownView.bind('isEnabled').to(command, 'isEnabled');\n addToolbarToDropdown(dropdownView, buttonsCreator, {\n enableActiveItemFocusOnDropdownOpen: true,\n ariaLabel: t('Text highlight toolbar')\n });\n bindToolbarIconStyleToActiveColor(dropdownView);\n // Execute current action from dropdown's split button action button.\n splitButtonView.on('execute', () => {\n editor.execute('highlight', { value: splitButtonView.commandValue });\n });\n // Focus the editable after executing the command.\n // It overrides a default behaviour where the focus is moved to the dropdown button (#12125).\n this.listenTo(dropdownView, 'execute', () => {\n editor.editing.view.focus();\n });\n /**\n * Returns active highlighter option depending on current command value.\n * If current is not set or it is the same as last execute this method will return the option key (like icon or color)\n * of last executed highlighter. Otherwise it will return option key for current one.\n */\n function getActiveOption(current, key) {\n const whichHighlighter = !current ||\n current === splitButtonView.lastExecuted ? splitButtonView.lastExecuted : current;\n return optionsMap[whichHighlighter][key];\n }\n return dropdownView;\n });\n }\n}\n/**\n * Extends split button icon style to reflect last used button style.\n */\nfunction bindToolbarIconStyleToActiveColor(dropdownView) {\n const actionView = dropdownView.buttonView.actionView;\n actionView.iconView.bind('fillColor').to(dropdownView.buttonView, 'color');\n}\n/**\n * Returns icon for given highlighter type.\n */\nfunction getIconForType(type) {\n return type === 'marker' ? markerIcon : penIcon;\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path class=\\\"ck-icon__fill\\\" d=\\\"M10.798 1.59 3.002 12.875l1.895 1.852 2.521 1.402 6.997-12.194z\\\"/><path d=\\\"m2.556 16.727.234-.348c-.297-.151-.462-.293-.498-.426-.036-.137.002-.416.115-.837.094-.25.15-.449.169-.595a4.495 4.495 0 0 0 0-.725c-.209-.621-.303-1.041-.284-1.26.02-.218.178-.506.475-.862l6.77-9.414c.539-.91 1.605-.85 3.199.18 1.594 1.032 2.188 1.928 1.784 2.686l-5.877 10.36c-.158.412-.333.673-.526.782-.193.108-.604.179-1.232.21-.362.131-.608.237-.738.318-.13.081-.305.238-.526.47-.293.265-.504.397-.632.397-.096 0-.27-.075-.524-.226l-.31.41-1.6-1.12zm-.279.415 1.575 1.103-.392.515H1.19l1.087-1.618zm8.1-13.656-4.953 6.9L8.75 12.57l4.247-7.574c.175-.25-.188-.647-1.092-1.192-.903-.546-1.412-.652-1.528-.32zM8.244 18.5 9.59 17h9.406v1.5H8.245z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path class=\\\"ck-icon__fill\\\" d=\\\"M10.126 2.268 2.002 13.874l1.895 1.852 2.521 1.402L14.47 5.481l-1.543-2.568-2.801-.645z\\\"/><path d=\\\"m4.5 18.088-2.645-1.852-.04-2.95-.006-.005.006-.008v-.025l.011.008L8.73 2.97c.165-.233.356-.417.567-.557l-1.212.308L4.604 7.9l-.83-.558 3.694-5.495 2.708-.69 1.65 1.145.046.018.85-1.216 2.16 1.512-.856 1.222c.828.967 1.144 2.141.432 3.158L7.55 17.286l.006.005-3.055.797H4.5zm-.634.166-1.976.516-.026-1.918 2.002 1.402zM9.968 3.817l-.006-.004-6.123 9.184 3.277 2.294 6.108-9.162.005.003c.317-.452-.16-1.332-1.064-1.966-.891-.624-1.865-.776-2.197-.349zM8.245 18.5 9.59 17h9.406v1.5H8.245z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { findOptimalInsertionRange } from 'ckeditor5/src/widget';\n/**\n * The horizontal line command.\n *\n * The command is registered by {@link module:horizontal-line/horizontallineediting~HorizontalLineEditing} as `'horizontalLine'`.\n *\n * To insert a horizontal line at the current selection, execute the command:\n *\n * ```ts\n * editor.execute( 'horizontalLine' );\n * ```\n */\nexport default class HorizontalLineCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const model = this.editor.model;\n const schema = model.schema;\n const selection = model.document.selection;\n this.isEnabled = isHorizontalLineAllowedInParent(selection, schema, model);\n }\n /**\n * Executes the command.\n *\n * @fires execute\n */\n execute() {\n const model = this.editor.model;\n model.change(writer => {\n const horizontalElement = writer.createElement('horizontalLine');\n model.insertObject(horizontalElement, null, null, { setSelection: 'after' });\n });\n }\n}\n/**\n * Checks if a horizontal line is allowed by the schema in the optimal insertion parent.\n *\n * @param model Model instance.\n */\nfunction isHorizontalLineAllowedInParent(selection, schema, model) {\n const parent = getInsertHorizontalLineParent(selection, model);\n return schema.checkChild(parent, 'horizontalLine');\n}\n/**\n * Returns a node that will be used to insert a horizontal line with `model.insertContent` to check if the horizontal line can be\n * placed there.\n *\n * @param model Model instance.\n */\nfunction getInsertHorizontalLineParent(selection, model) {\n const insertionRange = findOptimalInsertionRange(selection, model);\n const parent = insertionRange.start.parent;\n if (parent.isEmpty && !parent.is('element', '$root')) {\n return parent.parent;\n }\n return parent;\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./horizontalline.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module horizontal-line/horizontallineediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { toWidget } from 'ckeditor5/src/widget';\nimport HorizontalLineCommand from './horizontallinecommand';\nimport '../theme/horizontalline.css';\n/**\n * The horizontal line editing feature.\n */\nexport default class HorizontalLineEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'HorizontalLineEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n const t = editor.t;\n const conversion = editor.conversion;\n schema.register('horizontalLine', {\n inheritAllFrom: '$blockObject'\n });\n conversion.for('dataDowncast').elementToElement({\n model: 'horizontalLine',\n view: (modelElement, { writer }) => {\n return writer.createEmptyElement('hr');\n }\n });\n conversion.for('editingDowncast').elementToStructure({\n model: 'horizontalLine',\n view: (modelElement, { writer }) => {\n const label = t('Horizontal line');\n const viewWrapper = writer.createContainerElement('div', null, writer.createEmptyElement('hr'));\n writer.addClass('ck-horizontal-line', viewWrapper);\n writer.setCustomProperty('hr', true, viewWrapper);\n return toHorizontalLineWidget(viewWrapper, writer, label);\n }\n });\n conversion.for('upcast').elementToElement({ view: 'hr', model: 'horizontalLine' });\n editor.commands.add('horizontalLine', new HorizontalLineCommand(editor));\n }\n}\n/**\n * Converts a given {@link module:engine/view/element~Element} to a horizontal line widget:\n * * Adds a {@link module:engine/view/element~Element#_setCustomProperty custom property} allowing to\n * recognize the horizontal line widget element.\n * * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.\n *\n * @param writer An instance of the view writer.\n */\nfunction toHorizontalLineWidget(viewElement, writer, label) {\n writer.setCustomProperty('horizontalLine', true, viewElement);\n return toWidget(viewElement, writer, { label });\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module horizontal-line/horizontallineui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ButtonView } from 'ckeditor5/src/ui';\nimport horizontalLineIcon from '../theme/icons/horizontalline.svg';\n/**\n * The horizontal line UI plugin.\n */\nexport default class HorizontalLineUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'HorizontalLineUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n // Add the `horizontalLine` button to feature components.\n editor.ui.componentFactory.add('horizontalLine', locale => {\n const command = editor.commands.get('horizontalLine');\n const view = new ButtonView(locale);\n view.set({\n label: t('Horizontal line'),\n icon: horizontalLineIcon,\n tooltip: true\n });\n view.bind('isEnabled').to(command, 'isEnabled');\n // Execute the command.\n this.listenTo(view, 'execute', () => {\n editor.execute('horizontalLine');\n editor.editing.view.focus();\n });\n return view;\n });\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M2 9h16v2H2z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { findOptimalInsertionRange } from 'ckeditor5/src/widget';\n/**\n * The insert HTML embed element command.\n *\n * The command is registered by {@link module:html-embed/htmlembedediting~HtmlEmbedEditing} as `'htmlEmbed'`.\n *\n * To insert an empty HTML embed element at the current selection, execute the command:\n *\n * ```ts\n * editor.execute( 'htmlEmbed' );\n * ```\n *\n * You can specify the initial content of a new HTML embed in the argument:\n *\n * ```ts\n * editor.execute( 'htmlEmbed', '<b>Initial content.</b>' );\n * ```\n *\n * To update the content of the HTML embed, select it in the model and pass the content in the argument:\n *\n * ```ts\n * editor.execute( 'htmlEmbed', '<b>New content of an existing embed.</b>' );\n * ```\n */\nexport default class HtmlEmbedCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const model = this.editor.model;\n const schema = model.schema;\n const selection = model.document.selection;\n const selectedRawHtmlElement = getSelectedRawHtmlModelWidget(selection);\n this.isEnabled = isHtmlEmbedAllowedInParent(selection, schema, model);\n this.value = selectedRawHtmlElement ? selectedRawHtmlElement.getAttribute('value') || '' : null;\n }\n /**\n * Executes the command, which either:\n *\n * * creates and inserts a new HTML embed element if none was selected,\n * * updates the content of the HTML embed if one was selected.\n *\n * @fires execute\n * @param value When passed, the value (content) will be set on a new embed or a selected one.\n */\n execute(value) {\n const model = this.editor.model;\n const selection = model.document.selection;\n model.change(writer => {\n let htmlEmbedElement;\n // If the command has a non-null value, there must be some HTML embed selected in the model.\n if (this.value !== null) {\n htmlEmbedElement = getSelectedRawHtmlModelWidget(selection);\n }\n else {\n htmlEmbedElement = writer.createElement('rawHtml');\n model.insertObject(htmlEmbedElement, null, null, { setSelection: 'on' });\n }\n writer.setAttribute('value', value, htmlEmbedElement);\n });\n }\n}\n/**\n * Checks if an HTML embed is allowed by the schema in the optimal insertion parent.\n */\nfunction isHtmlEmbedAllowedInParent(selection, schema, model) {\n const parent = getInsertHtmlEmbedParent(selection, model);\n return schema.checkChild(parent, 'rawHtml');\n}\n/**\n * Returns a node that will be used to insert a html embed with `model.insertContent` to check if a html embed element can be placed there.\n */\nfunction getInsertHtmlEmbedParent(selection, model) {\n const insertionRange = findOptimalInsertionRange(selection, model);\n const parent = insertionRange.start.parent;\n if (parent.isEmpty && !parent.is('rootElement')) {\n return parent.parent;\n }\n return parent;\n}\n/**\n * Returns the selected HTML embed element in the model, if any.\n */\nfunction getSelectedRawHtmlModelWidget(selection) {\n const selectedElement = selection.getSelectedElement();\n if (selectedElement && selectedElement.is('element', 'rawHtml')) {\n return selectedElement;\n }\n return null;\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./htmlembed.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module html-embed/htmlembedediting\n */\nimport { Plugin, icons } from 'ckeditor5/src/core';\nimport { ButtonView } from 'ckeditor5/src/ui';\nimport { toWidget } from 'ckeditor5/src/widget';\nimport { logWarning, createElement } from 'ckeditor5/src/utils';\nimport HtmlEmbedCommand from './htmlembedcommand';\nimport '../theme/htmlembed.css';\n/**\n * The HTML embed editing feature.\n */\nexport default class HtmlEmbedEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'HtmlEmbedEditing';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n /**\n * Keeps references to {@link module:ui/button/buttonview~ButtonView edit, save, and cancel} button instances created for\n * each widget so they can be destroyed if they are no longer in DOM after the editing view was re-rendered.\n */\n this._widgetButtonViewReferences = new Set();\n editor.config.define('htmlEmbed', {\n showPreviews: false,\n sanitizeHtml: rawHtml => {\n /**\n * When using the HTML embed feature with the `htmlEmbed.showPreviews=true` option, it is strongly recommended to\n * define a sanitize function that will clean up the input HTML in order to avoid XSS vulnerability.\n *\n * For a detailed overview, check the {@glink features/html/html-embed HTML embed feature} documentation.\n *\n * @error html-embed-provide-sanitize-function\n */\n logWarning('html-embed-provide-sanitize-function');\n return {\n html: rawHtml,\n hasChanged: false\n };\n }\n });\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n schema.register('rawHtml', {\n inheritAllFrom: '$blockObject',\n allowAttributes: ['value']\n });\n editor.commands.add('htmlEmbed', new HtmlEmbedCommand(editor));\n this._setupConversion();\n }\n /**\n * Prepares converters for the feature.\n */\n _setupConversion() {\n const editor = this.editor;\n const t = editor.t;\n const view = editor.editing.view;\n const widgetButtonViewReferences = this._widgetButtonViewReferences;\n const htmlEmbedConfig = editor.config.get('htmlEmbed');\n // Destroy UI buttons created for widgets that have been removed from the view document (e.g. in the previous conversion).\n // This prevents unexpected memory leaks from UI views.\n this.editor.editing.view.on('render', () => {\n for (const buttonView of widgetButtonViewReferences) {\n if (buttonView.element && buttonView.element.isConnected) {\n return;\n }\n buttonView.destroy();\n widgetButtonViewReferences.delete(buttonView);\n }\n }, { priority: 'lowest' });\n // Register div.raw-html-embed as a raw content element so all of it's content will be provided\n // as a view element's custom property while data upcasting.\n editor.data.registerRawContentMatcher({\n name: 'div',\n classes: 'raw-html-embed'\n });\n editor.conversion.for('upcast').elementToElement({\n view: {\n name: 'div',\n classes: 'raw-html-embed'\n },\n model: (viewElement, { writer }) => {\n // The div.raw-html-embed is registered as a raw content element,\n // so all it's content is available in a custom property.\n return writer.createElement('rawHtml', {\n value: viewElement.getCustomProperty('$rawContent')\n });\n }\n });\n editor.conversion.for('dataDowncast').elementToElement({\n model: 'rawHtml',\n view: (modelElement, { writer }) => {\n return writer.createRawElement('div', { class: 'raw-html-embed' }, function (domElement) {\n domElement.innerHTML = modelElement.getAttribute('value') || '';\n });\n }\n });\n editor.conversion.for('editingDowncast').elementToStructure({\n model: { name: 'rawHtml', attributes: ['value'] },\n view: (modelElement, { writer }) => {\n let domContentWrapper;\n let state;\n let props;\n const viewContentWrapper = writer.createRawElement('div', {\n class: 'raw-html-embed__content-wrapper'\n }, function (domElement) {\n domContentWrapper = domElement;\n renderContent({ editor, domElement, state, props });\n // Since there is a `data-cke-ignore-events` attribute set on the wrapper element in the editable mode,\n // the explicit `mousedown` handler on the `capture` phase is needed to move the selection onto the whole\n // HTML embed widget.\n domContentWrapper.addEventListener('mousedown', () => {\n if (state.isEditable) {\n const model = editor.model;\n const selectedElement = model.document.selection.getSelectedElement();\n // Move the selection onto the whole HTML embed widget if it's currently not selected.\n if (selectedElement !== modelElement) {\n model.change(writer => writer.setSelection(modelElement, 'on'));\n }\n }\n }, true);\n });\n // API exposed on each raw HTML embed widget so other features can control a particular widget.\n const rawHtmlApi = {\n makeEditable() {\n state = Object.assign({}, state, {\n isEditable: true\n });\n renderContent({ domElement: domContentWrapper, editor, state, props });\n view.change(writer => {\n writer.setAttribute('data-cke-ignore-events', 'true', viewContentWrapper);\n });\n // This could be potentially pulled to a separate method called focusTextarea().\n domContentWrapper.querySelector('textarea').focus();\n },\n save(newValue) {\n // If the value didn't change, we just cancel. If it changed,\n // it's enough to update the model the entire widget will be reconverted.\n if (newValue !== state.getRawHtmlValue()) {\n editor.execute('htmlEmbed', newValue);\n editor.editing.view.focus();\n }\n else {\n this.cancel();\n }\n },\n cancel() {\n state = Object.assign({}, state, {\n isEditable: false\n });\n renderContent({ domElement: domContentWrapper, editor, state, props });\n editor.editing.view.focus();\n view.change(writer => {\n writer.removeAttribute('data-cke-ignore-events', viewContentWrapper);\n });\n }\n };\n state = {\n showPreviews: htmlEmbedConfig.showPreviews,\n isEditable: false,\n getRawHtmlValue: () => modelElement.getAttribute('value') || ''\n };\n props = {\n sanitizeHtml: htmlEmbedConfig.sanitizeHtml,\n textareaPlaceholder: t('Paste raw HTML here...'),\n onEditClick() {\n rawHtmlApi.makeEditable();\n },\n onSaveClick(newValue) {\n rawHtmlApi.save(newValue);\n },\n onCancelClick() {\n rawHtmlApi.cancel();\n }\n };\n const viewContainer = writer.createContainerElement('div', {\n class: 'raw-html-embed',\n 'data-html-embed-label': t('HTML snippet'),\n dir: editor.locale.uiLanguageDirection\n }, viewContentWrapper);\n writer.setCustomProperty('rawHtmlApi', rawHtmlApi, viewContainer);\n writer.setCustomProperty('rawHtml', true, viewContainer);\n return toWidget(viewContainer, writer, {\n label: t('HTML snippet'),\n hasSelectionHandle: true\n });\n }\n });\n function renderContent({ editor, domElement, state, props }) {\n // Remove all children;\n domElement.textContent = '';\n const domDocument = domElement.ownerDocument;\n let domTextarea;\n if (state.isEditable) {\n const textareaProps = {\n isDisabled: false,\n placeholder: props.textareaPlaceholder\n };\n domTextarea = createDomTextarea({ domDocument, state, props: textareaProps });\n domElement.append(domTextarea);\n }\n else if (state.showPreviews) {\n const previewContainerProps = {\n sanitizeHtml: props.sanitizeHtml\n };\n domElement.append(createPreviewContainer({ domDocument, state, props: previewContainerProps, editor }));\n }\n else {\n const textareaProps = {\n isDisabled: true,\n placeholder: props.textareaPlaceholder\n };\n domElement.append(createDomTextarea({ domDocument, state, props: textareaProps }));\n }\n const buttonsWrapperProps = {\n onEditClick: props.onEditClick,\n onSaveClick: () => {\n props.onSaveClick(domTextarea.value);\n },\n onCancelClick: props.onCancelClick\n };\n domElement.prepend(createDomButtonsWrapper({ editor, domDocument, state, props: buttonsWrapperProps }));\n }\n function createDomButtonsWrapper({ editor, domDocument, state, props }) {\n const domButtonsWrapper = createElement(domDocument, 'div', {\n class: 'raw-html-embed__buttons-wrapper'\n });\n if (state.isEditable) {\n const saveButtonView = createUIButton(editor, 'save', props.onSaveClick);\n const cancelButtonView = createUIButton(editor, 'cancel', props.onCancelClick);\n domButtonsWrapper.append(saveButtonView.element, cancelButtonView.element);\n widgetButtonViewReferences.add(saveButtonView).add(cancelButtonView);\n }\n else {\n const editButtonView = createUIButton(editor, 'edit', props.onEditClick);\n domButtonsWrapper.append(editButtonView.element);\n widgetButtonViewReferences.add(editButtonView);\n }\n return domButtonsWrapper;\n }\n function createDomTextarea({ domDocument, state, props }) {\n const domTextarea = createElement(domDocument, 'textarea', {\n placeholder: props.placeholder,\n class: 'ck ck-reset ck-input ck-input-text raw-html-embed__source'\n });\n domTextarea.disabled = props.isDisabled;\n domTextarea.value = state.getRawHtmlValue();\n return domTextarea;\n }\n function createPreviewContainer({ editor, domDocument, state, props }) {\n const sanitizedOutput = props.sanitizeHtml(state.getRawHtmlValue());\n const placeholderText = state.getRawHtmlValue().length > 0 ?\n t('No preview available') :\n t('Empty snippet content');\n const domPreviewPlaceholder = createElement(domDocument, 'div', {\n class: 'ck ck-reset_all raw-html-embed__preview-placeholder'\n }, placeholderText);\n const domPreviewContent = createElement(domDocument, 'div', {\n class: 'raw-html-embed__preview-content',\n dir: editor.locale.contentLanguageDirection\n });\n // Creating a contextual document fragment allows executing scripts when inserting into the preview element.\n // See: #8326.\n const domRange = domDocument.createRange();\n const domDocumentFragment = domRange.createContextualFragment(sanitizedOutput.html);\n domPreviewContent.appendChild(domDocumentFragment);\n const domPreviewContainer = createElement(domDocument, 'div', {\n class: 'raw-html-embed__preview'\n }, [\n domPreviewPlaceholder, domPreviewContent\n ]);\n return domPreviewContainer;\n }\n }\n}\n/**\n * Returns a UI button view that can be used in conversion.\n */\nfunction createUIButton(editor, type, onClick) {\n const { t } = editor.locale;\n const buttonView = new ButtonView(editor.locale);\n const command = editor.commands.get('htmlEmbed');\n buttonView.set({\n class: `raw-html-embed__${type}-button`,\n icon: icons.pencil,\n tooltip: true,\n tooltipPosition: editor.locale.uiLanguageDirection === 'rtl' ? 'e' : 'w'\n });\n buttonView.render();\n if (type === 'edit') {\n buttonView.set({\n icon: icons.pencil,\n label: t('Edit source')\n });\n buttonView.bind('isEnabled').to(command);\n }\n else if (type === 'save') {\n buttonView.set({\n icon: icons.check,\n label: t('Save changes')\n });\n buttonView.bind('isEnabled').to(command);\n }\n else {\n buttonView.set({\n icon: icons.cancel,\n label: t('Cancel')\n });\n }\n buttonView.on('execute', onClick);\n return buttonView;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module html-embed/htmlembedui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ButtonView } from 'ckeditor5/src/ui';\nimport htmlEmbedIcon from '../theme/icons/html.svg';\n/**\n * The HTML embed UI plugin.\n */\nexport default class HtmlEmbedUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'HtmlEmbedUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n // Add the `htmlEmbed` button to feature components.\n editor.ui.componentFactory.add('htmlEmbed', locale => {\n const command = editor.commands.get('htmlEmbed');\n const view = new ButtonView(locale);\n view.set({\n label: t('Insert HTML'),\n icon: htmlEmbedIcon,\n tooltip: true\n });\n view.bind('isEnabled').to(command, 'isEnabled');\n // Execute the command.\n this.listenTo(view, 'execute', () => {\n editor.execute('htmlEmbed');\n editor.editing.view.focus();\n const rawHtmlApi = editor.editing.view.document.selection\n .getSelectedElement()\n .getCustomProperty('rawHtmlApi');\n rawHtmlApi.makeEditable();\n });\n return view;\n });\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M17 0a2 2 0 0 1 2 2v7a1 1 0 0 1 1 1v5a1 1 0 0 1-.883.993l-.118.006L19 17a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2l-.001-1.001-.116-.006A1 1 0 0 1 0 15v-5a1 1 0 0 1 .999-1L1 2a2 2 0 0 1 2-2h14zm.499 15.999h-15L2.5 17a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5l-.001-1.001zm-3.478-6.013-.014.014H14v.007l-1.525 1.525-1.46-1.46-.015.013V10h-1v5h1v-3.53l1.428 1.43.048.043.131-.129L14 11.421V15h1v-5h-.965l-.014-.014zM2 10H1v5h1v-2h2v2h1v-5H4v2H2v-2zm7 0H6v1h1v4h1v-4h1v-1zm8 0h-1v5h3v-1h-2v-4zm0-8.5H3a.5.5 0 0 0-.5.5l-.001 6.999h15L17.5 2a.5.5 0 0 0-.5-.5zM10 7v1H4V7h6zm3-2v1H4V5h9zm-3-2v1H4V3h6z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagetextalternative/imagetextalternativecommand\n */\nimport { Command } from 'ckeditor5/src/core';\n/**\n * The image text alternative command. It is used to change the `alt` attribute of `<imageBlock>` and `<imageInline>` model elements.\n */\nexport default class ImageTextAlternativeCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const editor = this.editor;\n const imageUtils = editor.plugins.get('ImageUtils');\n const element = imageUtils.getClosestSelectedImageElement(this.editor.model.document.selection);\n this.isEnabled = !!element;\n if (this.isEnabled && element.hasAttribute('alt')) {\n this.value = element.getAttribute('alt');\n }\n else {\n this.value = false;\n }\n }\n /**\n * Executes the command.\n *\n * @fires execute\n * @param options\n * @param options.newValue The new value of the `alt` attribute to set.\n */\n execute(options) {\n const editor = this.editor;\n const imageUtils = editor.plugins.get('ImageUtils');\n const model = editor.model;\n const imageElement = imageUtils.getClosestSelectedImageElement(model.document.selection);\n model.change(writer => {\n writer.setAttribute('alt', options.newValue, imageElement);\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagetextalternative/imagetextalternativeediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport ImageTextAlternativeCommand from './imagetextalternativecommand';\nimport ImageUtils from '../imageutils';\n/**\n * The image text alternative editing plugin.\n *\n * Registers the `'imageTextAlternative'` command.\n */\nexport default class ImageTextAlternativeEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageUtils];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageTextAlternativeEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n this.editor.commands.add('imageTextAlternative', new ImageTextAlternativeCommand(this.editor));\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./textalternativeform.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagetextalternative/ui/textalternativeformview\n */\nimport { ButtonView, FocusCycler, LabeledFieldView, View, ViewCollection, createLabeledInputText, submitHandler } from 'ckeditor5/src/ui';\nimport { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils';\nimport { icons } from 'ckeditor5/src/core';\nimport '../../../theme/textalternativeform.css';\n// See: #8833.\n// eslint-disable-next-line ckeditor5-rules/ckeditor-imports\nimport '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';\n/**\n * The TextAlternativeFormView class.\n */\nexport default class TextAlternativeFormView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n const t = this.locale.t;\n this.focusTracker = new FocusTracker();\n this.keystrokes = new KeystrokeHandler();\n this.labeledInput = this._createLabeledInputView();\n this.saveButtonView = this._createButton(t('Save'), icons.check, 'ck-button-save');\n this.saveButtonView.type = 'submit';\n this.cancelButtonView = this._createButton(t('Cancel'), icons.cancel, 'ck-button-cancel', 'cancel');\n this._focusables = new ViewCollection();\n this._focusCycler = new FocusCycler({\n focusables: this._focusables,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate form fields backwards using the Shift + Tab keystroke.\n focusPrevious: 'shift + tab',\n // Navigate form fields forwards using the Tab key.\n focusNext: 'tab'\n }\n });\n this.setTemplate({\n tag: 'form',\n attributes: {\n class: [\n 'ck',\n 'ck-text-alternative-form',\n 'ck-responsive-form'\n ],\n // https://github.com/ckeditor/ckeditor5-image/issues/40\n tabindex: '-1'\n },\n children: [\n this.labeledInput,\n this.saveButtonView,\n this.cancelButtonView\n ]\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.keystrokes.listenTo(this.element);\n submitHandler({ view: this });\n [this.labeledInput, this.saveButtonView, this.cancelButtonView]\n .forEach(v => {\n // Register the view as focusable.\n this._focusables.add(v);\n // Register the view in the focus tracker.\n this.focusTracker.add(v.element);\n });\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Creates the button view.\n *\n * @param label The button label\n * @param icon The button's icon.\n * @param className The additional button CSS class name.\n * @param eventName The event name that the ButtonView#execute event will be delegated to.\n * @returns The button view instance.\n */\n _createButton(label, icon, className, eventName) {\n const button = new ButtonView(this.locale);\n button.set({\n label,\n icon,\n tooltip: true\n });\n button.extendTemplate({\n attributes: {\n class: className\n }\n });\n if (eventName) {\n button.delegate('execute').to(this, eventName);\n }\n return button;\n }\n /**\n * Creates an input with a label.\n *\n * @returns Labeled field view instance.\n */\n _createLabeledInputView() {\n const t = this.locale.t;\n const labeledInput = new LabeledFieldView(this.locale, createLabeledInputText);\n labeledInput.label = t('Text alternative');\n return labeledInput;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { BalloonPanelView } from 'ckeditor5/src/ui';\n/**\n * A helper utility that positions the\n * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} instance\n * with respect to the image in the editor content, if one is selected.\n *\n * @param editor The editor instance.\n */\nexport function repositionContextualBalloon(editor) {\n const balloon = editor.plugins.get('ContextualBalloon');\n const imageUtils = editor.plugins.get('ImageUtils');\n if (imageUtils.getClosestSelectedImageWidget(editor.editing.view.document.selection)) {\n const position = getBalloonPositionData(editor);\n balloon.updatePosition(position);\n }\n}\n/**\n * Returns the positioning options that control the geometry of the\n * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} with respect\n * to the selected element in the editor content.\n *\n * @param editor The editor instance.\n */\nexport function getBalloonPositionData(editor) {\n const editingView = editor.editing.view;\n const defaultPositions = BalloonPanelView.defaultPositions;\n const imageUtils = editor.plugins.get('ImageUtils');\n return {\n target: editingView.domConverter.mapViewToDom(imageUtils.getClosestSelectedImageWidget(editingView.document.selection)),\n positions: [\n defaultPositions.northArrowSouth,\n defaultPositions.northArrowSouthWest,\n defaultPositions.northArrowSouthEast,\n defaultPositions.southArrowNorth,\n defaultPositions.southArrowNorthWest,\n defaultPositions.southArrowNorthEast,\n defaultPositions.viewportStickyNorth\n ]\n };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagetextalternative/imagetextalternativeui\n */\nimport { Plugin, icons } from 'ckeditor5/src/core';\nimport { ButtonView, ContextualBalloon, clickOutsideHandler, CssTransitionDisablerMixin } from 'ckeditor5/src/ui';\nimport TextAlternativeFormView from './ui/textalternativeformview';\nimport { repositionContextualBalloon, getBalloonPositionData } from '../image/ui/utils';\n/**\n * The image text alternative UI plugin.\n *\n * The plugin uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.\n */\nexport default class ImageTextAlternativeUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ContextualBalloon];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageTextAlternativeUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n this._createButton();\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n // Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).\n if (this._form) {\n this._form.destroy();\n }\n }\n /**\n * Creates a button showing the balloon panel for changing the image text alternative and\n * registers it in the editor {@link module:ui/componentfactory~ComponentFactory ComponentFactory}.\n */\n _createButton() {\n const editor = this.editor;\n const t = editor.t;\n editor.ui.componentFactory.add('imageTextAlternative', locale => {\n const command = editor.commands.get('imageTextAlternative');\n const view = new ButtonView(locale);\n view.set({\n label: t('Change image text alternative'),\n icon: icons.lowVision,\n tooltip: true\n });\n view.bind('isEnabled').to(command, 'isEnabled');\n view.bind('isOn').to(command, 'value', value => !!value);\n this.listenTo(view, 'execute', () => {\n this._showForm();\n });\n return view;\n });\n }\n /**\n * Creates the {@link module:image/imagetextalternative/ui/textalternativeformview~TextAlternativeFormView}\n * form.\n */\n _createForm() {\n const editor = this.editor;\n const view = editor.editing.view;\n const viewDocument = view.document;\n const imageUtils = editor.plugins.get('ImageUtils');\n this._balloon = this.editor.plugins.get('ContextualBalloon');\n this._form = new (CssTransitionDisablerMixin(TextAlternativeFormView))(editor.locale);\n // Render the form so its #element is available for clickOutsideHandler.\n this._form.render();\n this.listenTo(this._form, 'submit', () => {\n editor.execute('imageTextAlternative', {\n newValue: this._form.labeledInput.fieldView.element.value\n });\n this._hideForm(true);\n });\n this.listenTo(this._form, 'cancel', () => {\n this._hideForm(true);\n });\n // Close the form on Esc key press.\n this._form.keystrokes.set('Esc', (data, cancel) => {\n this._hideForm(true);\n cancel();\n });\n // Reposition the balloon or hide the form if an image widget is no longer selected.\n this.listenTo(editor.ui, 'update', () => {\n if (!imageUtils.getClosestSelectedImageWidget(viewDocument.selection)) {\n this._hideForm(true);\n }\n else if (this._isVisible) {\n repositionContextualBalloon(editor);\n }\n });\n // Close on click outside of balloon panel element.\n clickOutsideHandler({\n emitter: this._form,\n activator: () => this._isVisible,\n contextElements: () => [this._balloon.view.element],\n callback: () => this._hideForm()\n });\n }\n /**\n * Shows the {@link #_form} in the {@link #_balloon}.\n */\n _showForm() {\n if (this._isVisible) {\n return;\n }\n if (!this._form) {\n this._createForm();\n }\n const editor = this.editor;\n const command = editor.commands.get('imageTextAlternative');\n const labeledInput = this._form.labeledInput;\n this._form.disableCssTransitions();\n if (!this._isInBalloon) {\n this._balloon.add({\n view: this._form,\n position: getBalloonPositionData(editor)\n });\n }\n // Make sure that each time the panel shows up, the field remains in sync with the value of\n // the command. If the user typed in the input, then canceled the balloon (`labeledInput#value`\n // stays unaltered) and re-opened it without changing the value of the command, they would see the\n // old value instead of the actual value of the command.\n // https://github.com/ckeditor/ckeditor5-image/issues/114\n labeledInput.fieldView.value = labeledInput.fieldView.element.value = command.value || '';\n this._form.labeledInput.fieldView.select();\n this._form.enableCssTransitions();\n }\n /**\n * Removes the {@link #_form} from the {@link #_balloon}.\n *\n * @param focusEditable Controls whether the editing view is focused afterwards.\n */\n _hideForm(focusEditable = false) {\n if (!this._isInBalloon) {\n return;\n }\n // Blur the input element before removing it from DOM to prevent issues in some browsers.\n // See https://github.com/ckeditor/ckeditor5/issues/1501.\n if (this._form.focusTracker.isFocused) {\n this._form.saveButtonView.focus();\n }\n this._balloon.remove(this._form);\n if (focusEditable) {\n this.editor.editing.view.focus();\n }\n }\n /**\n * Returns `true` when the {@link #_form} is the visible view in the {@link #_balloon}.\n */\n get _isVisible() {\n return !!this._balloon && this._balloon.visibleView === this._form;\n }\n /**\n * Returns `true` when the {@link #_form} is in the {@link #_balloon}.\n */\n get _isInBalloon() {\n return !!this._balloon && this._balloon.hasView(this._form);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagetextalternative\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport ImageTextAlternativeEditing from './imagetextalternative/imagetextalternativeediting';\nimport ImageTextAlternativeUI from './imagetextalternative/imagetextalternativeui';\n/**\n * The image text alternative plugin.\n *\n * For a detailed overview, check the {@glink features/images/images-styles image styles} documentation.\n *\n * This is a \"glue\" plugin which loads the\n * {@link module:image/imagetextalternative/imagetextalternativeediting~ImageTextAlternativeEditing}\n * and {@link module:image/imagetextalternative/imagetextalternativeui~ImageTextAlternativeUI} plugins.\n */\nexport default class ImageTextAlternative extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageTextAlternativeEditing, ImageTextAlternativeUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageTextAlternative';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { first } from 'ckeditor5/src/utils';\n/**\n * Returns a function that converts the image view representation:\n *\n * ```html\n * <figure class=\"image\"><img src=\"...\" alt=\"...\"></img></figure>\n * ```\n *\n * to the model representation:\n *\n * ```html\n * <imageBlock src=\"...\" alt=\"...\"></imageBlock>\n * ```\n *\n * The entire content of the `<figure>` element except the first `<img>` is being converted as children\n * of the `<imageBlock>` model element.\n *\n * @internal\n */\nexport function upcastImageFigure(imageUtils) {\n const converter = (evt, data, conversionApi) => {\n // Do not convert if this is not an \"image figure\".\n if (!conversionApi.consumable.test(data.viewItem, { name: true, classes: 'image' })) {\n return;\n }\n // Find an image element inside the figure element.\n const viewImage = imageUtils.findViewImgElement(data.viewItem);\n // Do not convert if image element is absent or was already converted.\n if (!viewImage || !conversionApi.consumable.test(viewImage, { name: true })) {\n return;\n }\n // Consume the figure to prevent other converters from processing it again.\n conversionApi.consumable.consume(data.viewItem, { name: true, classes: 'image' });\n // Convert view image to model image.\n const conversionResult = conversionApi.convertItem(viewImage, data.modelCursor);\n // Get image element from conversion result.\n const modelImage = first(conversionResult.modelRange.getItems());\n // When image wasn't successfully converted then finish conversion.\n if (!modelImage) {\n // Revert consumed figure so other features can convert it.\n conversionApi.consumable.revert(data.viewItem, { name: true, classes: 'image' });\n return;\n }\n // Convert rest of the figure element's children as an image children.\n conversionApi.convertChildren(data.viewItem, modelImage);\n conversionApi.updateConversionResult(modelImage, data);\n };\n return dispatcher => {\n dispatcher.on('element:figure', converter);\n };\n}\n/**\n * Returns a function that converts the image view representation:\n *\n * ```html\n * <picture><source ... /><source ... />...<img ... /></picture>\n * ```\n *\n * to the model representation as the `sources` attribute:\n *\n * ```html\n * <image[Block|Inline] ... sources=\"...\"></image[Block|Inline]>\n * ```\n *\n * @internal\n */\nexport function upcastPicture(imageUtils) {\n const sourceAttributeNames = ['srcset', 'media', 'type', 'sizes'];\n const converter = (evt, data, conversionApi) => {\n const pictureViewElement = data.viewItem;\n // Do not convert <picture> if already consumed.\n if (!conversionApi.consumable.test(pictureViewElement, { name: true })) {\n return;\n }\n const sources = new Map();\n // Collect all <source /> elements attribute values.\n for (const childSourceElement of pictureViewElement.getChildren()) {\n if (childSourceElement.is('element', 'source')) {\n const attributes = {};\n for (const name of sourceAttributeNames) {\n if (childSourceElement.hasAttribute(name)) {\n // Don't collect <source /> attribute if already consumed somewhere else.\n if (conversionApi.consumable.test(childSourceElement, { attributes: name })) {\n attributes[name] = childSourceElement.getAttribute(name);\n }\n }\n }\n if (Object.keys(attributes).length) {\n sources.set(childSourceElement, attributes);\n }\n }\n }\n const imgViewElement = imageUtils.findViewImgElement(pictureViewElement);\n // Don't convert when a picture has no <img/> inside (it is broken).\n if (!imgViewElement) {\n return;\n }\n let modelImage = data.modelCursor.parent;\n // - In case of an inline image (cursor parent in a <paragraph>), the <img/> must be converted right away\n // because no converter handled it yet and otherwise there would be no model element to set the sources attribute on.\n // - In case of a block image, the <figure class=\"image\"> converter (in ImageBlockEditing) converts the\n // <img/> right away on its own and the modelCursor is already inside an imageBlock and there's nothing special\n // to do here.\n if (!modelImage.is('element', 'imageBlock')) {\n const conversionResult = conversionApi.convertItem(imgViewElement, data.modelCursor);\n // Set image range as conversion result.\n data.modelRange = conversionResult.modelRange;\n // Continue conversion where image conversion ends.\n data.modelCursor = conversionResult.modelCursor;\n modelImage = first(conversionResult.modelRange.getItems());\n }\n conversionApi.consumable.consume(pictureViewElement, { name: true });\n // Consume only these <source/> attributes that were actually collected and will be passed on\n // to the image model element.\n for (const [sourceElement, attributes] of sources) {\n conversionApi.consumable.consume(sourceElement, { attributes: Object.keys(attributes) });\n }\n if (sources.size) {\n conversionApi.writer.setAttribute('sources', Array.from(sources.values()), modelImage);\n }\n // Convert rest of the <picture> children as an image children. Other converters may want to consume them.\n conversionApi.convertChildren(pictureViewElement, modelImage);\n };\n return dispatcher => {\n dispatcher.on('element:picture', converter);\n };\n}\n/**\n * Converter used to convert the `srcset` model image attribute to the `srcset`, `sizes` and `width` attributes in the view.\n *\n * @internal\n * @param imageType The type of the image.\n */\nexport function downcastSrcsetAttribute(imageUtils, imageType) {\n const converter = (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const writer = conversionApi.writer;\n const element = conversionApi.mapper.toViewElement(data.item);\n const img = imageUtils.findViewImgElement(element);\n if (data.attributeNewValue === null) {\n const srcset = data.attributeOldValue;\n if (srcset && srcset.data) {\n writer.removeAttribute('srcset', img);\n writer.removeAttribute('sizes', img);\n if (srcset.width) {\n writer.removeAttribute('width', img);\n }\n }\n }\n else {\n const srcset = data.attributeNewValue;\n if (srcset && srcset.data) {\n writer.setAttribute('srcset', srcset.data, img);\n // Always outputting `100vw`. See https://github.com/ckeditor/ckeditor5-image/issues/2.\n writer.setAttribute('sizes', '100vw', img);\n if (srcset.width) {\n writer.setAttribute('width', srcset.width, img);\n }\n }\n }\n };\n return dispatcher => {\n dispatcher.on(`attribute:srcset:${imageType}`, converter);\n };\n}\n/**\n * Converts the `source` model attribute to the `<picture><source /><source />...<img /></picture>`\n * view structure.\n *\n * @internal\n */\nexport function downcastSourcesAttribute(imageUtils) {\n const converter = (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const viewWriter = conversionApi.writer;\n const element = conversionApi.mapper.toViewElement(data.item);\n const imgElement = imageUtils.findViewImgElement(element);\n const attributeNewValue = data.attributeNewValue;\n if (attributeNewValue && attributeNewValue.length) {\n // Make sure <picture> does not break attribute elements, for instance <a> in linked images.\n const pictureElement = viewWriter.createContainerElement('picture', null, attributeNewValue.map(sourceAttributes => {\n return viewWriter.createEmptyElement('source', sourceAttributes);\n }));\n // Collect all wrapping attribute elements.\n const attributeElements = [];\n let viewElement = imgElement.parent;\n while (viewElement && viewElement.is('attributeElement')) {\n const parentElement = viewElement.parent;\n viewWriter.unwrap(viewWriter.createRangeOn(imgElement), viewElement);\n attributeElements.unshift(viewElement);\n viewElement = parentElement;\n }\n // Insert the picture and move img into it.\n viewWriter.insert(viewWriter.createPositionBefore(imgElement), pictureElement);\n viewWriter.move(viewWriter.createRangeOn(imgElement), viewWriter.createPositionAt(pictureElement, 'end'));\n // Apply collected attribute elements over the new picture element.\n for (const attributeElement of attributeElements) {\n viewWriter.wrap(viewWriter.createRangeOn(pictureElement), attributeElement);\n }\n }\n // Both setting \"sources\" to an empty array and removing the attribute should unwrap the <img />.\n // Unwrap once if the latter followed the former, though.\n else if (imgElement.parent.is('element', 'picture')) {\n const pictureElement = imgElement.parent;\n viewWriter.move(viewWriter.createRangeOn(imgElement), viewWriter.createPositionBefore(pictureElement));\n viewWriter.remove(pictureElement);\n }\n };\n return dispatcher => {\n dispatcher.on('attribute:sources:imageBlock', converter);\n dispatcher.on('attribute:sources:imageInline', converter);\n };\n}\n/**\n * Converter used to convert a given image attribute from the model to the view.\n *\n * @internal\n * @param imageType The type of the image.\n * @param attributeKey The name of the attribute to convert.\n */\nexport function downcastImageAttribute(imageUtils, imageType, attributeKey) {\n const converter = (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const viewWriter = conversionApi.writer;\n const element = conversionApi.mapper.toViewElement(data.item);\n const img = imageUtils.findViewImgElement(element);\n viewWriter.setAttribute(data.attributeKey, data.attributeNewValue || '', img);\n };\n return dispatcher => {\n dispatcher.on(`attribute:${attributeKey}:${imageType}`, converter);\n };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/image/imageloadobserver\n */\nimport { Observer } from 'ckeditor5/src/engine';\n/**\n * Observes all new images added to the {@link module:engine/view/document~Document},\n * fires {@link module:engine/view/document~Document#event:imageLoaded} and\n * {@link module:engine/view/document~Document#event:layoutChanged} event every time when the new image\n * has been loaded.\n *\n * **Note:** This event is not fired for images that has been added to the document and rendered as `complete` (already loaded).\n */\nexport default class ImageLoadObserver extends Observer {\n /**\n * @inheritDoc\n */\n observe(domRoot) {\n this.listenTo(domRoot, 'load', (event, domEvent) => {\n const domElement = domEvent.target;\n if (this.checkShouldIgnoreEventFromTarget(domElement)) {\n return;\n }\n if (domElement.tagName == 'IMG') {\n this._fireEvents(domEvent);\n }\n // Use capture phase for better performance (#4504).\n }, { useCapture: true });\n }\n /**\n * @inheritDoc\n */\n stopObserving(domRoot) {\n this.stopListening(domRoot);\n }\n /**\n * Fires {@link module:engine/view/document~Document#event:layoutChanged} and\n * {@link module:engine/view/document~Document#event:imageLoaded}\n * if observer {@link #isEnabled is enabled}.\n *\n * @param domEvent The DOM event.\n */\n _fireEvents(domEvent) {\n if (this.isEnabled) {\n this.document.fire('layoutChanged');\n this.document.fire('imageLoaded', domEvent);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/image/insertimagecommand\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { logWarning, toArray } from 'ckeditor5/src/utils';\n/**\n * Insert image command.\n *\n * The command is registered by the {@link module:image/image/imageediting~ImageEditing} plugin as `insertImage`\n * and it is also available via aliased `imageInsert` name.\n *\n * In order to insert an image at the current selection position\n * (according to the {@link module:widget/utils~findOptimalInsertionRange} algorithm),\n * execute the command and specify the image source:\n *\n * ```ts\n * editor.execute( 'insertImage', { source: 'http://url.to.the/image' } );\n * ```\n *\n * It is also possible to insert multiple images at once:\n *\n * ```ts\n * editor.execute( 'insertImage', {\n * \tsource: [\n * \t\t'path/to/image.jpg',\n * \t\t'path/to/other-image.jpg'\n * \t]\n * } );\n * ```\n *\n * If you want to take the full control over the process, you can specify individual model attributes:\n *\n * ```ts\n * editor.execute( 'insertImage', {\n * \tsource: [\n * \t\t{ src: 'path/to/image.jpg', alt: 'First alt text' },\n * \t\t{ src: 'path/to/other-image.jpg', alt: 'Second alt text', customAttribute: 'My attribute value' }\n * \t]\n * } );\n * ```\n */\nexport default class InsertImageCommand extends Command {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n const configImageInsertType = editor.config.get('image.insert.type');\n if (!editor.plugins.has('ImageBlockEditing')) {\n if (configImageInsertType === 'block') {\n /**\n * The {@link module:image/imageblock~ImageBlock} plugin must be enabled to allow inserting block images. See\n * {@link module:image/imageconfig~ImageInsertConfig#type} to learn more.\n *\n * @error image-block-plugin-required\n */\n logWarning('image-block-plugin-required');\n }\n }\n if (!editor.plugins.has('ImageInlineEditing')) {\n if (configImageInsertType === 'inline') {\n /**\n * The {@link module:image/imageinline~ImageInline} plugin must be enabled to allow inserting inline images. See\n * {@link module:image/imageconfig~ImageInsertConfig#type} to learn more.\n *\n * @error image-inline-plugin-required\n */\n logWarning('image-inline-plugin-required');\n }\n }\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const imageUtils = this.editor.plugins.get('ImageUtils');\n this.isEnabled = imageUtils.isImageAllowed();\n }\n /**\n * Executes the command.\n *\n * @fires execute\n * @param options Options for the executed command.\n * @param options.source The image source or an array of image sources to insert.\n * See the documentation of the command to learn more about accepted formats.\n */\n execute(options) {\n const sourceDefinitions = toArray(options.source);\n const selection = this.editor.model.document.selection;\n const imageUtils = this.editor.plugins.get('ImageUtils');\n // In case of multiple images, each image (starting from the 2nd) will be inserted at a position that\n // follows the previous one. That will move the selection and, to stay on the safe side and make sure\n // all images inherit the same selection attributes, they are collected beforehand.\n //\n // Applying these attributes ensures, for instance, that inserting an (inline) image into a link does\n // not split that link but preserves its continuity.\n //\n // Note: Selection attributes that do not make sense for images will be filtered out by insertImage() anyway.\n const selectionAttributes = Object.fromEntries(selection.getAttributes());\n sourceDefinitions.forEach((sourceDefinition, index) => {\n const selectedElement = selection.getSelectedElement();\n if (typeof sourceDefinition === 'string') {\n sourceDefinition = { src: sourceDefinition };\n }\n // Inserting of an inline image replace the selected element and make a selection on the inserted image.\n // Therefore inserting multiple inline images requires creating position after each element.\n if (index && selectedElement && imageUtils.isImage(selectedElement)) {\n const position = this.editor.model.createPositionAfter(selectedElement);\n imageUtils.insertImage({ ...sourceDefinition, ...selectionAttributes }, position);\n }\n else {\n imageUtils.insertImage({ ...sourceDefinition, ...selectionAttributes });\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core';\n/**\n * @module image/image/replaceimagesourcecommand\n */\n/**\n * Replace image source command.\n *\n * Changes image source to the one provided. Can be executed as follows:\n *\n * ```ts\n * editor.execute( 'replaceImageSource', { source: 'http://url.to.the/image' } );\n * ```\n */\nexport default class ReplaceImageSourceCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const editor = this.editor;\n const imageUtils = editor.plugins.get('ImageUtils');\n const element = this.editor.model.document.selection.getSelectedElement();\n this.isEnabled = imageUtils.isImage(element);\n this.value = this.isEnabled ? element.getAttribute('src') : null;\n }\n /**\n * Executes the command.\n *\n * @fires execute\n * @param options Options for the executed command.\n * @param options.source The image source to replace.\n */\n execute(options) {\n const image = this.editor.model.document.selection.getSelectedElement();\n this.editor.model.change(writer => {\n writer.setAttribute('src', options.source, image);\n writer.removeAttribute('srcset', image);\n writer.removeAttribute('sizes', image);\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/image/imageediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport ImageLoadObserver from './imageloadobserver';\nimport InsertImageCommand from './insertimagecommand';\nimport ReplaceImageSourceCommand from './replaceimagesourcecommand';\nimport ImageUtils from '../imageutils';\n/**\n * The image engine plugin. This module loads common code shared between\n * {@link module:image/image/imageinlineediting~ImageInlineEditing} and\n * {@link module:image/image/imageblockediting~ImageBlockEditing} plugins.\n *\n * This plugin registers the {@link module:image/image/insertimagecommand~InsertImageCommand 'insertImage'} command.\n */\nexport default class ImageEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageUtils];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const conversion = editor.conversion;\n // See https://github.com/ckeditor/ckeditor5-image/issues/142.\n editor.editing.view.addObserver(ImageLoadObserver);\n conversion.for('upcast')\n .attributeToAttribute({\n view: {\n name: 'img',\n key: 'alt'\n },\n model: 'alt'\n })\n .attributeToAttribute({\n view: {\n name: 'img',\n key: 'srcset'\n },\n model: {\n key: 'srcset',\n value: (viewImage) => {\n const value = {\n data: viewImage.getAttribute('srcset')\n };\n if (viewImage.hasAttribute('width')) {\n value.width = viewImage.getAttribute('width');\n }\n return value;\n }\n }\n });\n const insertImageCommand = new InsertImageCommand(editor);\n const replaceImageSourceCommand = new ReplaceImageSourceCommand(editor);\n editor.commands.add('insertImage', insertImageCommand);\n editor.commands.add('replaceImageSource', replaceImageSourceCommand);\n // `imageInsert` is an alias for backward compatibility.\n editor.commands.add('imageInsert', insertImageCommand);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core';\n/**\n * The image type command. It changes the type of a selected image, depending on the configuration.\n */\nexport default class ImageTypeCommand extends Command {\n /**\n * @inheritDoc\n *\n * @param modelElementName Model element name the command converts to.\n */\n constructor(editor, modelElementName) {\n super(editor);\n this._modelElementName = modelElementName;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const editor = this.editor;\n const imageUtils = editor.plugins.get('ImageUtils');\n const element = imageUtils.getClosestSelectedImageElement(this.editor.model.document.selection);\n if (this._modelElementName === 'imageBlock') {\n this.isEnabled = imageUtils.isInlineImage(element);\n }\n else {\n this.isEnabled = imageUtils.isBlockImage(element);\n }\n }\n /**\n * Executes the command and changes the type of a selected image.\n *\n * @fires execute\n * @returns An object containing references to old and new model image elements\n * (for before and after the change) so external integrations can hook into the decorated\n * `execute` event and handle this change. `null` if the type change failed.\n */\n execute() {\n const editor = this.editor;\n const model = this.editor.model;\n const imageUtils = editor.plugins.get('ImageUtils');\n const oldElement = imageUtils.getClosestSelectedImageElement(model.document.selection);\n const attributes = Object.fromEntries(oldElement.getAttributes());\n // Don't change image type if \"src\" is missing (a broken image), unless there's \"uploadId\" set.\n // This state may happen during image upload (before it finishes) and it should be possible to change type\n // of the image in the meantime.\n if (!attributes.src && !attributes.uploadId) {\n return null;\n }\n return model.change(writer => {\n // Get all markers that contain the old image element.\n const markers = Array.from(model.markers)\n .filter(marker => marker.getRange().containsItem(oldElement));\n const newElement = imageUtils.insertImage(attributes, model.createSelection(oldElement, 'on'), this._modelElementName);\n if (!newElement) {\n return null;\n }\n const newElementRange = writer.createRangeOn(newElement);\n // Expand the previously intersecting markers' ranges to include the new image element.\n for (const marker of markers) {\n const markerRange = marker.getRange();\n // Join the survived part of the old marker range with the new element range\n // (loosely because there could be some new paragraph or the existing one might got split).\n const range = markerRange.root.rootName != '$graveyard' ?\n markerRange.getJoined(newElementRange, true) : newElementRange;\n writer.updateMarker(marker, { range });\n }\n return {\n oldElement,\n newElement\n };\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/image/imageblockediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ClipboardPipeline } from 'ckeditor5/src/clipboard';\nimport { UpcastWriter } from 'ckeditor5/src/engine';\nimport { downcastImageAttribute, downcastSrcsetAttribute, upcastImageFigure } from './converters';\nimport ImageEditing from './imageediting';\nimport ImageTypeCommand from './imagetypecommand';\nimport ImageUtils from '../imageutils';\nimport { getImgViewElementMatcher, createBlockImageViewElement, determineImageTypeForInsertionAtSelection } from '../image/utils';\n/**\n * The image block plugin.\n *\n * It registers:\n *\n * * `<imageBlock>` as a block element in the document schema, and allows `alt`, `src` and `srcset` attributes.\n * * converters for editing and data pipelines.,\n * * {@link module:image/image/imagetypecommand~ImageTypeCommand `'imageTypeBlock'`} command that converts inline images into\n * block images.\n */\nexport default class ImageBlockEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageEditing, ImageUtils, ClipboardPipeline];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageBlockEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n // Converters 'alt' and 'srcset' are added in 'ImageEditing' plugin.\n schema.register('imageBlock', {\n inheritAllFrom: '$blockObject',\n allowAttributes: ['alt', 'src', 'srcset']\n });\n this._setupConversion();\n if (editor.plugins.has('ImageInlineEditing')) {\n editor.commands.add('imageTypeBlock', new ImageTypeCommand(this.editor, 'imageBlock'));\n this._setupClipboardIntegration();\n }\n }\n /**\n * Configures conversion pipelines to support upcasting and downcasting\n * block images (block image widgets) and their attributes.\n */\n _setupConversion() {\n const editor = this.editor;\n const t = editor.t;\n const conversion = editor.conversion;\n const imageUtils = editor.plugins.get('ImageUtils');\n conversion.for('dataDowncast')\n .elementToStructure({\n model: 'imageBlock',\n view: (modelElement, { writer }) => createBlockImageViewElement(writer)\n });\n conversion.for('editingDowncast')\n .elementToStructure({\n model: 'imageBlock',\n view: (modelElement, { writer }) => imageUtils.toImageWidget(createBlockImageViewElement(writer), writer, t('image widget'))\n });\n conversion.for('downcast')\n .add(downcastImageAttribute(imageUtils, 'imageBlock', 'src'))\n .add(downcastImageAttribute(imageUtils, 'imageBlock', 'alt'))\n .add(downcastSrcsetAttribute(imageUtils, 'imageBlock'));\n // More image related upcasts are in 'ImageEditing' plugin.\n conversion.for('upcast')\n .elementToElement({\n view: getImgViewElementMatcher(editor, 'imageBlock'),\n model: (viewImage, { writer }) => writer.createElement('imageBlock', viewImage.hasAttribute('src') ? { src: viewImage.getAttribute('src') } : undefined)\n })\n .add(upcastImageFigure(imageUtils));\n }\n /**\n * Integrates the plugin with the clipboard pipeline.\n *\n * Idea is that the feature should recognize the user's intent when an **inline** image is\n * pasted or dropped. If such an image is pasted/dropped:\n *\n * * into an empty block (e.g. an empty paragraph),\n * * on another object (e.g. some block widget).\n *\n * it gets converted into a block image on the fly. We assume this is the user's intent\n * if they decided to put their image there.\n *\n * See the `ImageInlineEditing` for the similar integration that works in the opposite direction.\n */\n _setupClipboardIntegration() {\n const editor = this.editor;\n const model = editor.model;\n const editingView = editor.editing.view;\n const imageUtils = editor.plugins.get('ImageUtils');\n const clipboardPipeline = editor.plugins.get('ClipboardPipeline');\n this.listenTo(clipboardPipeline, 'inputTransformation', (evt, data) => {\n const docFragmentChildren = Array.from(data.content.getChildren());\n let modelRange;\n // Make sure only <img> elements are dropped or pasted. Otherwise, if there some other HTML\n // mixed up, this should be handled as a regular paste.\n if (!docFragmentChildren.every(imageUtils.isInlineImageView)) {\n return;\n }\n // When drag and dropping, data.targetRanges specifies where to drop because\n // this is usually a different place than the current model selection (the user\n // uses a drop marker to specify the drop location).\n if (data.targetRanges) {\n modelRange = editor.editing.mapper.toModelRange(data.targetRanges[0]);\n }\n // Pasting, however, always occurs at the current model selection.\n else {\n modelRange = model.document.selection.getFirstRange();\n }\n const selection = model.createSelection(modelRange);\n // Convert inline images into block images only when the currently selected block is empty\n // (e.g. an empty paragraph) or some object is selected (to replace it).\n if (determineImageTypeForInsertionAtSelection(model.schema, selection) === 'imageBlock') {\n const writer = new UpcastWriter(editingView.document);\n // Wrap <img ... /> -> <figure class=\"image\"><img .../></figure>\n const blockViewImages = docFragmentChildren.map(inlineViewImage => writer.createElement('figure', { class: 'image' }, inlineViewImage));\n data.content = writer.createDocumentFragment(blockViewImages);\n }\n });\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./image.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageblock\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Widget } from 'ckeditor5/src/widget';\nimport ImageTextAlternative from './imagetextalternative';\nimport ImageBlockEditing from './image/imageblockediting';\nimport '../theme/image.css';\n/**\n * The image block plugin.\n *\n * This is a \"glue\" plugin which loads the following plugins:\n *\n * * {@link module:image/image/imageblockediting~ImageBlockEditing},\n * * {@link module:image/imagetextalternative~ImageTextAlternative}.\n *\n * Usually, it is used in conjunction with other plugins from this package. See the {@glink api/image package page}\n * for more information.\n */\nexport default class ImageBlock extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageBlockEditing, Widget, ImageTextAlternative];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageBlock';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/image/imageinlineediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ClipboardPipeline } from 'ckeditor5/src/clipboard';\nimport { UpcastWriter } from 'ckeditor5/src/engine';\nimport { downcastImageAttribute, downcastSrcsetAttribute } from './converters';\nimport ImageEditing from './imageediting';\nimport ImageTypeCommand from './imagetypecommand';\nimport ImageUtils from '../imageutils';\nimport { getImgViewElementMatcher, createInlineImageViewElement, determineImageTypeForInsertionAtSelection } from '../image/utils';\n/**\n * The image inline plugin.\n *\n * It registers:\n *\n * * `<imageInline>` as an inline element in the document schema, and allows `alt`, `src` and `srcset` attributes.\n * * converters for editing and data pipelines.\n * * {@link module:image/image/imagetypecommand~ImageTypeCommand `'imageTypeInline'`} command that converts block images into\n * inline images.\n */\nexport default class ImageInlineEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageEditing, ImageUtils, ClipboardPipeline];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageInlineEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n // Converters 'alt' and 'srcset' are added in 'ImageEditing' plugin.\n schema.register('imageInline', {\n inheritAllFrom: '$inlineObject',\n allowAttributes: ['alt', 'src', 'srcset']\n });\n // Disallow inline images in captions (for now). This is the best spot to do that because\n // independent packages can introduce captions (ImageCaption, TableCaption, etc.) so better this\n // be future-proof.\n schema.addChildCheck((context, childDefinition) => {\n if (context.endsWith('caption') && childDefinition.name === 'imageInline') {\n return false;\n }\n });\n this._setupConversion();\n if (editor.plugins.has('ImageBlockEditing')) {\n editor.commands.add('imageTypeInline', new ImageTypeCommand(this.editor, 'imageInline'));\n this._setupClipboardIntegration();\n }\n }\n /**\n * Configures conversion pipelines to support upcasting and downcasting\n * inline images (inline image widgets) and their attributes.\n */\n _setupConversion() {\n const editor = this.editor;\n const t = editor.t;\n const conversion = editor.conversion;\n const imageUtils = editor.plugins.get('ImageUtils');\n conversion.for('dataDowncast')\n .elementToElement({\n model: 'imageInline',\n view: (modelElement, { writer }) => writer.createEmptyElement('img')\n });\n conversion.for('editingDowncast')\n .elementToStructure({\n model: 'imageInline',\n view: (modelElement, { writer }) => imageUtils.toImageWidget(createInlineImageViewElement(writer), writer, t('image widget'))\n });\n conversion.for('downcast')\n .add(downcastImageAttribute(imageUtils, 'imageInline', 'src'))\n .add(downcastImageAttribute(imageUtils, 'imageInline', 'alt'))\n .add(downcastSrcsetAttribute(imageUtils, 'imageInline'));\n // More image related upcasts are in 'ImageEditing' plugin.\n conversion.for('upcast')\n .elementToElement({\n view: getImgViewElementMatcher(editor, 'imageInline'),\n model: (viewImage, { writer }) => writer.createElement('imageInline', viewImage.hasAttribute('src') ? { src: viewImage.getAttribute('src') } : undefined)\n });\n }\n /**\n * Integrates the plugin with the clipboard pipeline.\n *\n * Idea is that the feature should recognize the user's intent when an **block** image is\n * pasted or dropped. If such an image is pasted/dropped into a non-empty block\n * (e.g. a paragraph with some text) it gets converted into an inline image on the fly.\n *\n * We assume this is the user's intent if they decided to put their image there.\n *\n * **Note**: If a block image has a caption, it will not be converted to an inline image\n * to avoid the confusion. Captions are added on purpose and they should never be lost\n * in the clipboard pipeline.\n *\n * See the `ImageBlockEditing` for the similar integration that works in the opposite direction.\n */\n _setupClipboardIntegration() {\n const editor = this.editor;\n const model = editor.model;\n const editingView = editor.editing.view;\n const imageUtils = editor.plugins.get('ImageUtils');\n const clipboardPipeline = editor.plugins.get('ClipboardPipeline');\n this.listenTo(clipboardPipeline, 'inputTransformation', (evt, data) => {\n const docFragmentChildren = Array.from(data.content.getChildren());\n let modelRange;\n // Make sure only <figure class=\"image\"></figure> elements are dropped or pasted. Otherwise, if there some other HTML\n // mixed up, this should be handled as a regular paste.\n if (!docFragmentChildren.every(imageUtils.isBlockImageView)) {\n return;\n }\n // When drag and dropping, data.targetRanges specifies where to drop because\n // this is usually a different place than the current model selection (the user\n // uses a drop marker to specify the drop location).\n if (data.targetRanges) {\n modelRange = editor.editing.mapper.toModelRange(data.targetRanges[0]);\n }\n // Pasting, however, always occurs at the current model selection.\n else {\n modelRange = model.document.selection.getFirstRange();\n }\n const selection = model.createSelection(modelRange);\n // Convert block images into inline images only when pasting or dropping into non-empty blocks\n // and when the block is not an object (e.g. pasting to replace another widget).\n if (determineImageTypeForInsertionAtSelection(model.schema, selection) === 'imageInline') {\n const writer = new UpcastWriter(editingView.document);\n // Unwrap <figure class=\"image\"><img .../></figure> -> <img ... />\n // but <figure class=\"image\"><img .../><figcaption>...</figcaption></figure> -> stays the same\n const inlineViewImages = docFragmentChildren.map(blockViewImage => {\n // If there's just one child, it can be either <img /> or <a><img></a>.\n // If there are other children than <img>, this means that the block image\n // has a caption or some other features and this kind of image should be\n // pasted/dropped without modifications.\n if (blockViewImage.childCount === 1) {\n // Pass the attributes which are present only in the <figure> to the <img>\n // (e.g. the style=\"width:10%\" attribute applied by the ImageResize plugin).\n Array.from(blockViewImage.getAttributes())\n .forEach(attribute => writer.setAttribute(...attribute, imageUtils.findViewImgElement(blockViewImage)));\n return blockViewImage.getChild(0);\n }\n else {\n return blockViewImage;\n }\n });\n data.content = writer.createDocumentFragment(inlineViewImages);\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageinline\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Widget } from 'ckeditor5/src/widget';\nimport ImageTextAlternative from './imagetextalternative';\nimport ImageInlineEditing from './image/imageinlineediting';\nimport '../theme/image.css';\n/**\n * The image inline plugin.\n *\n * This is a \"glue\" plugin which loads the following plugins:\n *\n * * {@link module:image/image/imageinlineediting~ImageInlineEditing},\n * * {@link module:image/imagetextalternative~ImageTextAlternative}.\n *\n * Usually, it is used in conjunction with other plugins from this package. See the {@glink api/image package page}\n * for more information.\n */\nexport default class ImageInline extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageInlineEditing, Widget, ImageTextAlternative];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageInline';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core';\nimport ImageBlockEditing from '../image/imageblockediting';\n/**\n * The toggle image caption command.\n *\n * This command is registered by {@link module:image/imagecaption/imagecaptionediting~ImageCaptionEditing} as the\n * `'toggleImageCaption'` editor command.\n *\n * Executing this command:\n *\n * * either adds or removes the image caption of a selected image (depending on whether the caption is present or not),\n * * removes the image caption if the selection is anchored in one.\n *\n * ```ts\n * // Toggle the presence of the caption.\n * editor.execute( 'toggleImageCaption' );\n * ```\n *\n * **Note**: Upon executing this command, the selection will be set on the image if previously anchored in the caption element.\n *\n * **Note**: You can move the selection to the caption right away as it shows up upon executing this command by using\n * the `focusCaptionOnShow` option:\n *\n * ```ts\n * editor.execute( 'toggleImageCaption', { focusCaptionOnShow: true } );\n * ```\n */\nexport default class ToggleImageCaptionCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const editor = this.editor;\n const imageCaptionUtils = editor.plugins.get('ImageCaptionUtils');\n const imageUtils = editor.plugins.get('ImageUtils');\n // Only block images can get captions.\n if (!editor.plugins.has(ImageBlockEditing)) {\n this.isEnabled = false;\n this.value = false;\n return;\n }\n const selection = editor.model.document.selection;\n const selectedElement = selection.getSelectedElement();\n if (!selectedElement) {\n const ancestorCaptionElement = imageCaptionUtils.getCaptionFromModelSelection(selection);\n this.isEnabled = !!ancestorCaptionElement;\n this.value = !!ancestorCaptionElement;\n return;\n }\n // Block images support captions by default but the command should also be enabled for inline\n // images because toggling the caption when one is selected should convert it into a block image.\n this.isEnabled = imageUtils.isImage(selectedElement);\n if (!this.isEnabled) {\n this.value = false;\n }\n else {\n this.value = !!imageCaptionUtils.getCaptionFromImageModelElement(selectedElement);\n }\n }\n /**\n * Executes the command.\n *\n * ```ts\n * editor.execute( 'toggleImageCaption' );\n * ```\n *\n * @param options Options for the executed command.\n * @param options.focusCaptionOnShow When true and the caption shows up, the selection will be moved into it straight away.\n * @fires execute\n */\n execute(options = {}) {\n const { focusCaptionOnShow } = options;\n this.editor.model.change(writer => {\n if (this.value) {\n this._hideImageCaption(writer);\n }\n else {\n this._showImageCaption(writer, focusCaptionOnShow);\n }\n });\n }\n /**\n * Shows the caption of the `<imageBlock>` or `<imageInline>`. Also:\n *\n * * it converts `<imageInline>` to `<imageBlock>` to show the caption,\n * * it attempts to restore the caption content from the `ImageCaptionEditing` caption registry,\n * * it moves the selection to the caption right away, it the `focusCaptionOnShow` option was set.\n */\n _showImageCaption(writer, focusCaptionOnShow) {\n const model = this.editor.model;\n const selection = model.document.selection;\n const imageCaptionEditing = this.editor.plugins.get('ImageCaptionEditing');\n const imageUtils = this.editor.plugins.get('ImageUtils');\n let selectedImage = selection.getSelectedElement();\n const savedCaption = imageCaptionEditing._getSavedCaption(selectedImage);\n // Convert imageInline -> image first.\n if (imageUtils.isInlineImage(selectedImage)) {\n this.editor.execute('imageTypeBlock');\n // Executing the command created a new model element. Let's pick it again.\n selectedImage = selection.getSelectedElement();\n }\n // Try restoring the caption from the ImageCaptionEditing plugin storage.\n const newCaptionElement = savedCaption || writer.createElement('caption');\n writer.append(newCaptionElement, selectedImage);\n if (focusCaptionOnShow) {\n writer.setSelection(newCaptionElement, 'in');\n }\n }\n /**\n * Hides the caption of a selected image (or an image caption the selection is anchored to).\n *\n * The content of the caption is stored in the `ImageCaptionEditing` caption registry to make this\n * a reversible action.\n */\n _hideImageCaption(writer) {\n const editor = this.editor;\n const selection = editor.model.document.selection;\n const imageCaptionEditing = editor.plugins.get('ImageCaptionEditing');\n const imageCaptionUtils = editor.plugins.get('ImageCaptionUtils');\n let selectedImage = selection.getSelectedElement();\n let captionElement;\n if (selectedImage) {\n captionElement = imageCaptionUtils.getCaptionFromImageModelElement(selectedImage);\n }\n else {\n captionElement = imageCaptionUtils.getCaptionFromModelSelection(selection);\n selectedImage = captionElement.parent;\n }\n // Store the caption content so it can be restored quickly if the user changes their mind even if they toggle image<->imageInline.\n imageCaptionEditing._saveCaption(selectedImage, captionElement);\n writer.setSelection(selectedImage, 'on');\n writer.remove(captionElement);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport ImageUtils from '../imageutils';\n/**\n * The image caption utilities plugin.\n */\nexport default class ImageCaptionUtils extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageCaptionUtils';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageUtils];\n }\n /**\n * Returns the caption model element from a given image element. Returns `null` if no caption is found.\n */\n getCaptionFromImageModelElement(imageModelElement) {\n for (const node of imageModelElement.getChildren()) {\n if (!!node && node.is('element', 'caption')) {\n return node;\n }\n }\n return null;\n }\n /**\n * Returns the caption model element for a model selection. Returns `null` if the selection has no caption element ancestor.\n */\n getCaptionFromModelSelection(selection) {\n const imageUtils = this.editor.plugins.get('ImageUtils');\n const captionElement = selection.getFirstPosition().findAncestor('caption');\n if (!captionElement) {\n return null;\n }\n if (imageUtils.isBlockImage(captionElement.parent)) {\n return captionElement;\n }\n return null;\n }\n /**\n * {@link module:engine/view/matcher~Matcher} pattern. Checks if a given element is a `<figcaption>` element that is placed\n * inside the image `<figure>` element.\n * @returns Returns the object accepted by {@link module:engine/view/matcher~Matcher} or `null` if the element\n * cannot be matched.\n */\n matchImageCaptionViewElement(element) {\n const imageUtils = this.editor.plugins.get('ImageUtils');\n // Convert only captions for images.\n if (element.name == 'figcaption' && imageUtils.isBlockImageView(element.parent)) {\n return { name: true };\n }\n return null;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagecaption/imagecaptionediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Element, enablePlaceholder } from 'ckeditor5/src/engine';\nimport { toWidgetEditable } from 'ckeditor5/src/widget';\nimport ToggleImageCaptionCommand from './toggleimagecaptioncommand';\nimport ImageUtils from '../imageutils';\nimport ImageCaptionUtils from './imagecaptionutils';\n/**\n * The image caption engine plugin. It is responsible for:\n *\n * * registering converters for the caption element,\n * * registering converters for the caption model attribute,\n * * registering the {@link module:image/imagecaption/toggleimagecaptioncommand~ToggleImageCaptionCommand `toggleImageCaption`} command.\n */\nexport default class ImageCaptionEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageUtils, ImageCaptionUtils];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageCaptionEditing';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n this._savedCaptionsMap = new WeakMap();\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n // Schema configuration.\n if (!schema.isRegistered('caption')) {\n schema.register('caption', {\n allowIn: 'imageBlock',\n allowContentOf: '$block',\n isLimit: true\n });\n }\n else {\n schema.extend('caption', {\n allowIn: 'imageBlock'\n });\n }\n editor.commands.add('toggleImageCaption', new ToggleImageCaptionCommand(this.editor));\n this._setupConversion();\n this._setupImageTypeCommandsIntegration();\n this._registerCaptionReconversion();\n }\n /**\n * Configures conversion pipelines to support upcasting and downcasting\n * image captions.\n */\n _setupConversion() {\n const editor = this.editor;\n const view = editor.editing.view;\n const imageUtils = editor.plugins.get('ImageUtils');\n const imageCaptionUtils = editor.plugins.get('ImageCaptionUtils');\n const t = editor.t;\n // View -> model converter for the data pipeline.\n editor.conversion.for('upcast').elementToElement({\n view: element => imageCaptionUtils.matchImageCaptionViewElement(element),\n model: 'caption'\n });\n // Model -> view converter for the data pipeline.\n editor.conversion.for('dataDowncast').elementToElement({\n model: 'caption',\n view: (modelElement, { writer }) => {\n if (!imageUtils.isBlockImage(modelElement.parent)) {\n return null;\n }\n return writer.createContainerElement('figcaption');\n }\n });\n // Model -> view converter for the editing pipeline.\n editor.conversion.for('editingDowncast').elementToElement({\n model: 'caption',\n view: (modelElement, { writer }) => {\n if (!imageUtils.isBlockImage(modelElement.parent)) {\n return null;\n }\n const figcaptionElement = writer.createEditableElement('figcaption');\n writer.setCustomProperty('imageCaption', true, figcaptionElement);\n enablePlaceholder({\n view,\n element: figcaptionElement,\n text: t('Enter image caption'),\n keepOnFocus: true\n });\n const imageAlt = modelElement.parent.getAttribute('alt');\n const label = imageAlt ? t('Caption for image: %0', [imageAlt]) : t('Caption for the image');\n return toWidgetEditable(figcaptionElement, writer, { label });\n }\n });\n }\n /**\n * Integrates with {@link module:image/image/imagetypecommand~ImageTypeCommand image type commands}\n * to make sure the caption is preserved when the type of an image changes so it can be restored\n * in the future if the user decides they want their caption back.\n */\n _setupImageTypeCommandsIntegration() {\n const editor = this.editor;\n const imageUtils = editor.plugins.get('ImageUtils');\n const imageCaptionUtils = editor.plugins.get('ImageCaptionUtils');\n const imageTypeInlineCommand = editor.commands.get('imageTypeInline');\n const imageTypeBlockCommand = editor.commands.get('imageTypeBlock');\n const handleImageTypeChange = evt => {\n // The image type command execution can be unsuccessful.\n if (!evt.return) {\n return;\n }\n const { oldElement, newElement } = evt.return;\n /* istanbul ignore if: paranoid check -- @preserve */\n if (!oldElement) {\n return;\n }\n if (imageUtils.isBlockImage(oldElement)) {\n const oldCaptionElement = imageCaptionUtils.getCaptionFromImageModelElement(oldElement);\n // If the old element was a captioned block image (the caption was visible),\n // simply save it so it can be restored.\n if (oldCaptionElement) {\n this._saveCaption(newElement, oldCaptionElement);\n return;\n }\n }\n const savedOldElementCaption = this._getSavedCaption(oldElement);\n // If either:\n //\n // * the block image didn't have a visible caption,\n // * the block image caption was hidden (and already saved),\n // * the inline image was passed\n //\n // just try to \"pass\" the saved caption from the old image to the new image\n // so it can be retrieved in the future if the user wants it back.\n if (savedOldElementCaption) {\n // Note: Since we're writing to a WeakMap, we don't bother with removing the\n // [ oldElement, savedOldElementCaption ] pair from it.\n this._saveCaption(newElement, savedOldElementCaption);\n }\n };\n // Presence of the commands depends on the Image(Inline|Block)Editing plugins loaded in the editor.\n if (imageTypeInlineCommand) {\n this.listenTo(imageTypeInlineCommand, 'execute', handleImageTypeChange, { priority: 'low' });\n }\n if (imageTypeBlockCommand) {\n this.listenTo(imageTypeBlockCommand, 'execute', handleImageTypeChange, { priority: 'low' });\n }\n }\n /**\n * Returns the saved {@link module:engine/model/element~Element#toJSON JSONified} caption\n * of an image model element.\n *\n * See {@link #_saveCaption}.\n *\n * @internal\n * @param imageModelElement The model element the caption should be returned for.\n * @returns The model caption element or `null` if there is none.\n */\n _getSavedCaption(imageModelElement) {\n const jsonObject = this._savedCaptionsMap.get(imageModelElement);\n return jsonObject ? Element.fromJSON(jsonObject) : null;\n }\n /**\n * Saves a {@link module:engine/model/element~Element#toJSON JSONified} caption for\n * an image element to allow restoring it in the future.\n *\n * A caption is saved every time it gets hidden and/or the type of an image changes. The\n * user should be able to restore it on demand.\n *\n * **Note**: The caption cannot be stored in the image model element attribute because,\n * for instance, when the model state propagates to collaborators, the attribute would get\n * lost (mainly because it does not convert to anything when the caption is hidden) and\n * the states of collaborators' models would de-synchronize causing numerous issues.\n *\n * See {@link #_getSavedCaption}.\n *\n * @internal\n * @param imageModelElement The model element the caption is saved for.\n * @param caption The caption model element to be saved.\n */\n _saveCaption(imageModelElement, caption) {\n this._savedCaptionsMap.set(imageModelElement, caption.toJSON());\n }\n /**\n * Reconverts image caption when image alt attribute changes.\n * The change of alt attribute is reflected in caption's aria-label attribute.\n */\n _registerCaptionReconversion() {\n const editor = this.editor;\n const model = editor.model;\n const imageUtils = editor.plugins.get('ImageUtils');\n const imageCaptionUtils = editor.plugins.get('ImageCaptionUtils');\n model.document.on('change:data', () => {\n const changes = model.document.differ.getChanges();\n for (const change of changes) {\n if (change.attributeKey !== 'alt') {\n continue;\n }\n const image = change.range.start.nodeAfter;\n if (imageUtils.isBlockImage(image)) {\n const caption = imageCaptionUtils.getCaptionFromImageModelElement(image);\n if (!caption) {\n return;\n }\n editor.editing.reconvertItem(caption);\n }\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagecaption/imagecaptionui\n */\nimport { Plugin, icons } from 'ckeditor5/src/core';\nimport { ButtonView } from 'ckeditor5/src/ui';\nimport ImageCaptionUtils from './imagecaptionutils';\n/**\n * The image caption UI plugin. It introduces the `'toggleImageCaption'` UI button.\n */\nexport default class ImageCaptionUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageCaptionUtils];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageCaptionUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const editingView = editor.editing.view;\n const imageCaptionUtils = editor.plugins.get('ImageCaptionUtils');\n const t = editor.t;\n editor.ui.componentFactory.add('toggleImageCaption', locale => {\n const command = editor.commands.get('toggleImageCaption');\n const view = new ButtonView(locale);\n view.set({\n icon: icons.caption,\n tooltip: true,\n isToggleable: true\n });\n view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n view.bind('label').to(command, 'value', value => value ? t('Toggle caption off') : t('Toggle caption on'));\n this.listenTo(view, 'execute', () => {\n editor.execute('toggleImageCaption', { focusCaptionOnShow: true });\n // Scroll to the selection and highlight the caption if the caption showed up.\n const modelCaptionElement = imageCaptionUtils.getCaptionFromModelSelection(editor.model.document.selection);\n if (modelCaptionElement) {\n const figcaptionElement = editor.editing.mapper.toViewElement(modelCaptionElement);\n editingView.scrollToTheSelection();\n editingView.change(writer => {\n writer.addClass('image__caption_highlighted', figcaptionElement);\n });\n }\n editor.editing.view.focus();\n });\n return view;\n });\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imagecaption.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module upload/filereader\n */\n/* globals window */\nimport { ObservableMixin } from '@ckeditor/ckeditor5-utils';\n/**\n * Wrapper over the native `FileReader`.\n */\nexport default class FileReader extends ObservableMixin() {\n /**\n * Creates an instance of the FileReader.\n */\n constructor() {\n super();\n const reader = new window.FileReader();\n this._reader = reader;\n this._data = undefined;\n this.set('loaded', 0);\n reader.onprogress = evt => {\n this.loaded = evt.loaded;\n };\n }\n /**\n * Returns error that occurred during file reading.\n */\n get error() {\n return this._reader.error;\n }\n /**\n * Holds the data of an already loaded file. The file must be first loaded\n * by using {@link module:upload/filereader~FileReader#read `read()`}.\n */\n get data() {\n return this._data;\n }\n /**\n * Reads the provided file.\n *\n * @param file Native File object.\n * @returns Returns a promise that will be resolved with file's content.\n * The promise will be rejected in case of an error or when the reading process is aborted.\n */\n read(file) {\n const reader = this._reader;\n this.total = file.size;\n return new Promise((resolve, reject) => {\n reader.onload = () => {\n const result = reader.result;\n this._data = result;\n resolve(result);\n };\n reader.onerror = () => {\n reject('error');\n };\n reader.onabort = () => {\n reject('aborted');\n };\n this._reader.readAsDataURL(file);\n });\n }\n /**\n * Aborts file reader.\n */\n abort() {\n this._reader.abort();\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module upload/filerepository\n */\nimport { Plugin, PendingActions } from '@ckeditor/ckeditor5-core';\nimport { CKEditorError, Collection, ObservableMixin, logWarning, uid } from '@ckeditor/ckeditor5-utils';\nimport FileReader from './filereader';\n/**\n * File repository plugin. A central point for managing file upload.\n *\n * To use it, first you need an upload adapter. Upload adapter's job is to handle communication with the server\n * (sending the file and handling server's response). You can use one of the existing plugins introducing upload adapters\n * (e.g. {@link module:easy-image/cloudservicesuploadadapter~CloudServicesUploadAdapter} or\n * {@link module:adapter-ckfinder/uploadadapter~CKFinderUploadAdapter}) or write your own one see\n * the {@glink framework/deep-dive/upload-adapter Custom image upload adapter deep-dive} guide.\n *\n * Then, you can use {@link module:upload/filerepository~FileRepository#createLoader `createLoader()`} and the returned\n * {@link module:upload/filerepository~FileLoader} instance to load and upload files.\n */\nexport default class FileRepository extends Plugin {\n constructor() {\n super(...arguments);\n /**\n * Collection of loaders associated with this repository.\n */\n this.loaders = new Collection();\n /**\n * Loaders mappings used to retrieve loaders references.\n */\n this._loadersMap = new Map();\n /**\n * Reference to a pending action registered in a {@link module:core/pendingactions~PendingActions} plugin\n * while upload is in progress. When there is no upload then value is `null`.\n */\n this._pendingAction = null;\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'FileRepository';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [PendingActions];\n }\n /**\n * @inheritDoc\n */\n init() {\n // Keeps upload in a sync with pending actions.\n this.loaders.on('change', () => this._updatePendingAction());\n this.set('uploaded', 0);\n this.set('uploadTotal', null);\n this.bind('uploadedPercent').to(this, 'uploaded', this, 'uploadTotal', (uploaded, total) => {\n return total ? (uploaded / total * 100) : 0;\n });\n }\n /**\n * Returns the loader associated with specified file or promise.\n *\n * To get loader by id use `fileRepository.loaders.get( id )`.\n *\n * @param fileOrPromise Native file or promise handle.\n */\n getLoader(fileOrPromise) {\n return this._loadersMap.get(fileOrPromise) || null;\n }\n /**\n * Creates a loader instance for the given file.\n *\n * Requires {@link #createUploadAdapter} factory to be defined.\n *\n * @param fileOrPromise Native File object or native Promise object which resolves to a File.\n */\n createLoader(fileOrPromise) {\n if (!this.createUploadAdapter) {\n /**\n * You need to enable an upload adapter in order to be able to upload files.\n *\n * This warning shows up when {@link module:upload/filerepository~FileRepository} is being used\n * without {@link module:upload/filerepository~FileRepository#createUploadAdapter defining an upload adapter}.\n *\n * **If you see this warning when using one of the {@glink installation/getting-started/predefined-builds\n * CKEditor 5 Builds}**\n * it means that you did not configure any of the upload adapters available by default in those builds.\n *\n * See the {@glink features/images/image-upload/image-upload comprehensive \"Image upload overview\"} to learn which upload\n * adapters are available in the builds and how to configure them.\n *\n * **If you see this warning when using a custom build** there is a chance that you enabled\n * a feature like {@link module:image/imageupload~ImageUpload},\n * or {@link module:image/imageupload/imageuploadui~ImageUploadUI} but you did not enable any upload adapter.\n * You can choose one of the existing upload adapters listed in the\n * {@glink features/images/image-upload/image-upload \"Image upload overview\"}.\n *\n * You can also implement your {@glink framework/deep-dive/upload-adapter own image upload adapter}.\n *\n * @error filerepository-no-upload-adapter\n */\n logWarning('filerepository-no-upload-adapter');\n return null;\n }\n const loader = new FileLoader(Promise.resolve(fileOrPromise), this.createUploadAdapter);\n this.loaders.add(loader);\n this._loadersMap.set(fileOrPromise, loader);\n // Store also file => loader mapping so loader can be retrieved by file instance returned upon Promise resolution.\n if (fileOrPromise instanceof Promise) {\n loader.file\n .then(file => {\n this._loadersMap.set(file, loader);\n })\n // Every then() must have a catch().\n // File loader state (and rejections) are handled in read() and upload().\n // Also, see the \"does not swallow the file promise rejection\" test.\n .catch(() => { });\n }\n loader.on('change:uploaded', () => {\n let aggregatedUploaded = 0;\n for (const loader of this.loaders) {\n aggregatedUploaded += loader.uploaded;\n }\n this.uploaded = aggregatedUploaded;\n });\n loader.on('change:uploadTotal', () => {\n let aggregatedTotal = 0;\n for (const loader of this.loaders) {\n if (loader.uploadTotal) {\n aggregatedTotal += loader.uploadTotal;\n }\n }\n this.uploadTotal = aggregatedTotal;\n });\n return loader;\n }\n /**\n * Destroys the given loader.\n *\n * @param fileOrPromiseOrLoader File or Promise associated with that loader or loader itself.\n */\n destroyLoader(fileOrPromiseOrLoader) {\n const loader = fileOrPromiseOrLoader instanceof FileLoader ? fileOrPromiseOrLoader : this.getLoader(fileOrPromiseOrLoader);\n loader._destroy();\n this.loaders.remove(loader);\n this._loadersMap.forEach((value, key) => {\n if (value === loader) {\n this._loadersMap.delete(key);\n }\n });\n }\n /**\n * Registers or deregisters pending action bound with upload progress.\n */\n _updatePendingAction() {\n const pendingActions = this.editor.plugins.get(PendingActions);\n if (this.loaders.length) {\n if (!this._pendingAction) {\n const t = this.editor.t;\n const getMessage = (value) => `${t('Upload in progress')} ${parseInt(value)}%.`;\n this._pendingAction = pendingActions.add(getMessage(this.uploadedPercent));\n this._pendingAction.bind('message').to(this, 'uploadedPercent', getMessage);\n }\n }\n else {\n pendingActions.remove(this._pendingAction);\n this._pendingAction = null;\n }\n }\n}\n/**\n * File loader class.\n *\n * It is used to control the process of reading the file and uploading it using the specified upload adapter.\n */\nclass FileLoader extends ObservableMixin() {\n /**\n * Creates a new instance of `FileLoader`.\n *\n * @param filePromise A promise which resolves to a file instance.\n * @param uploadAdapterCreator The function which returns {@link module:upload/filerepository~UploadAdapter} instance.\n */\n constructor(filePromise, uploadAdapterCreator) {\n super();\n this.id = uid();\n this._filePromiseWrapper = this._createFilePromiseWrapper(filePromise);\n this._adapter = uploadAdapterCreator(this);\n this._reader = new FileReader();\n this.set('status', 'idle');\n this.set('uploaded', 0);\n this.set('uploadTotal', null);\n this.bind('uploadedPercent').to(this, 'uploaded', this, 'uploadTotal', (uploaded, total) => {\n return total ? (uploaded / total * 100) : 0;\n });\n this.set('uploadResponse', null);\n }\n /**\n * A `Promise` which resolves to a `File` instance associated with this file loader.\n */\n get file() {\n if (!this._filePromiseWrapper) {\n // Loader was destroyed, return promise which resolves to null.\n return Promise.resolve(null);\n }\n else {\n // The `this._filePromiseWrapper.promise` is chained and not simply returned to handle a case when:\n //\n //\t\t* The `loader.file.then( ... )` is called by external code (returned promise is pending).\n //\t\t* Then `loader._destroy()` is called (call is synchronous) which destroys the `loader`.\n //\t\t* Promise returned by the first `loader.file.then( ... )` call is resolved.\n //\n // Returning `this._filePromiseWrapper.promise` will still resolve to a `File` instance so there\n // is an additional check needed in the chain to see if `loader` was destroyed in the meantime.\n return this._filePromiseWrapper.promise.then(file => this._filePromiseWrapper ? file : null);\n }\n }\n /**\n * Returns the file data. To read its data, you need for first load the file\n * by using the {@link module:upload/filerepository~FileLoader#read `read()`} method.\n */\n get data() {\n return this._reader.data;\n }\n /**\n * Reads file using {@link module:upload/filereader~FileReader}.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `filerepository-read-wrong-status` when status\n * is different than `idle`.\n *\n * Example usage:\n *\n * ```ts\n * fileLoader.read()\n * \t.then( data => { ... } )\n * \t.catch( err => {\n * \t\tif ( err === 'aborted' ) {\n * \t\t\tconsole.log( 'Reading aborted.' );\n * \t\t} else {\n * \t\t\tconsole.log( 'Reading error.', err );\n * \t\t}\n * \t} );\n * ```\n *\n * @returns Returns promise that will be resolved with read data. Promise will be rejected if error\n * occurs or if read process is aborted.\n */\n read() {\n if (this.status != 'idle') {\n /**\n * You cannot call read if the status is different than idle.\n *\n * @error filerepository-read-wrong-status\n */\n throw new CKEditorError('filerepository-read-wrong-status', this);\n }\n this.status = 'reading';\n return this.file\n .then(file => this._reader.read(file))\n .then(data => {\n // Edge case: reader was aborted after file was read - double check for proper status.\n // It can happen when image was deleted during its upload.\n if (this.status !== 'reading') {\n throw this.status;\n }\n this.status = 'idle';\n return data;\n })\n .catch(err => {\n if (err === 'aborted') {\n this.status = 'aborted';\n throw 'aborted';\n }\n this.status = 'error';\n throw this._reader.error ? this._reader.error : err;\n });\n }\n /**\n * Reads file using the provided {@link module:upload/filerepository~UploadAdapter}.\n *\n * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `filerepository-upload-wrong-status` when status\n * is different than `idle`.\n * Example usage:\n *\n * ```ts\n * fileLoader.upload()\n * \t.then( data => { ... } )\n * \t.catch( e => {\n * \t\tif ( e === 'aborted' ) {\n * \t\t\tconsole.log( 'Uploading aborted.' );\n * \t\t} else {\n * \t\t\tconsole.log( 'Uploading error.', e );\n * \t\t}\n * \t} );\n * ```\n *\n * @returns Returns promise that will be resolved with response data. Promise will be rejected if error\n * occurs or if read process is aborted.\n */\n upload() {\n if (this.status != 'idle') {\n /**\n * You cannot call upload if the status is different than idle.\n *\n * @error filerepository-upload-wrong-status\n */\n throw new CKEditorError('filerepository-upload-wrong-status', this);\n }\n this.status = 'uploading';\n return this.file\n .then(() => this._adapter.upload())\n .then(data => {\n this.uploadResponse = data;\n this.status = 'idle';\n return data;\n })\n .catch(err => {\n if (this.status === 'aborted') {\n throw 'aborted';\n }\n this.status = 'error';\n throw err;\n });\n }\n /**\n * Aborts loading process.\n */\n abort() {\n const status = this.status;\n this.status = 'aborted';\n if (!this._filePromiseWrapper.isFulfilled) {\n // Edge case: file loader is aborted before read() is called\n // so it might happen that no one handled the rejection of this promise.\n // See https://github.com/ckeditor/ckeditor5-upload/pull/100\n this._filePromiseWrapper.promise.catch(() => { });\n this._filePromiseWrapper.rejecter('aborted');\n }\n else if (status == 'reading') {\n this._reader.abort();\n }\n else if (status == 'uploading' && this._adapter.abort) {\n this._adapter.abort();\n }\n this._destroy();\n }\n /**\n * Performs cleanup.\n *\n * @internal\n */\n _destroy() {\n this._filePromiseWrapper = undefined;\n this._reader = undefined;\n this._adapter = undefined;\n this.uploadResponse = undefined;\n }\n /**\n * Wraps a given file promise into another promise giving additional\n * control (resolving, rejecting, checking if fulfilled) over it.\n *\n * @param filePromise The initial file promise to be wrapped.\n */\n _createFilePromiseWrapper(filePromise) {\n const wrapper = {};\n wrapper.promise = new Promise((resolve, reject) => {\n wrapper.rejecter = reject;\n wrapper.isFulfilled = false;\n filePromise\n .then(file => {\n wrapper.isFulfilled = true;\n resolve(file);\n })\n .catch(err => {\n wrapper.isFulfilled = true;\n reject(err);\n });\n });\n return wrapper;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module upload/ui/filedialogbuttonview\n */\nimport { ButtonView, View } from '@ckeditor/ckeditor5-ui';\n/**\n * The file dialog button view.\n *\n * This component provides a button that opens the native file selection dialog.\n * It can be used to implement the UI of a file upload feature.\n *\n * ```ts\n * const view = new FileDialogButtonView( locale );\n *\n * view.set( {\n * \tacceptedType: 'image/*',\n * \tallowMultipleFiles: true\n * } );\n *\n * view.buttonView.set( {\n * \tlabel: t( 'Insert image' ),\n * \ticon: imageIcon,\n * \ttooltip: true\n * } );\n *\n * view.on( 'done', ( evt, files ) => {\n * \tfor ( const file of Array.from( files ) ) {\n * \t\tconsole.log( 'Selected file', file );\n * \t}\n * } );\n * ```\n */\nexport default class FileDialogButtonView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.buttonView = new ButtonView(locale);\n this._fileInputView = new FileInputView(locale);\n this._fileInputView.bind('acceptedType').to(this);\n this._fileInputView.bind('allowMultipleFiles').to(this);\n this._fileInputView.delegate('done').to(this);\n this.setTemplate({\n tag: 'span',\n attributes: {\n class: 'ck-file-dialog-button'\n },\n children: [\n this.buttonView,\n this._fileInputView\n ]\n });\n this.buttonView.on('execute', () => {\n this._fileInputView.open();\n });\n }\n /**\n * Focuses the {@link #buttonView}.\n */\n focus() {\n this.buttonView.focus();\n }\n}\n/**\n * The hidden file input view class.\n */\nclass FileInputView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n this.set('acceptedType', undefined);\n this.set('allowMultipleFiles', false);\n const bind = this.bindTemplate;\n this.setTemplate({\n tag: 'input',\n attributes: {\n class: [\n 'ck-hidden'\n ],\n type: 'file',\n tabindex: '-1',\n accept: bind.to('acceptedType'),\n multiple: bind.to('allowMultipleFiles')\n },\n on: {\n // Removing from code coverage since we cannot programmatically set input element files.\n change: bind.to(/* istanbul ignore next -- @preserve */ () => {\n if (this.element && this.element.files && this.element.files.length) {\n this.fire('done', this.element.files);\n }\n this.element.value = '';\n })\n }\n });\n }\n /**\n * Opens file dialog.\n */\n open() {\n this.element.click();\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module upload/adapters/simpleuploadadapter\n */\n/* globals XMLHttpRequest, FormData */\nimport { Plugin } from '@ckeditor/ckeditor5-core';\nimport FileRepository from '../filerepository';\nimport { logWarning } from '@ckeditor/ckeditor5-utils';\n/**\n * The Simple upload adapter allows uploading images to an application running on your server using\n * the [`XMLHttpRequest`](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) API with a\n * minimal {@link module:upload/uploadconfig~SimpleUploadConfig editor configuration}.\n *\n * ```ts\n * ClassicEditor\n * \t.create( document.querySelector( '#editor' ), {\n * \t\tsimpleUpload: {\n * \t\t\tuploadUrl: 'http://example.com',\n * \t\t\theaders: {\n * \t\t\t\t...\n * \t\t\t}\n * \t\t}\n * \t} )\n * \t.then( ... )\n * \t.catch( ... );\n * ```\n *\n * See the {@glink features/images/image-upload/simple-upload-adapter \"Simple upload adapter\"} guide to learn how to\n * learn more about the feature (configuration, serverside requirements, etc.).\n *\n * Check out the {@glink features/images/image-upload/image-upload comprehensive \"Image upload overview\"} to learn about\n * other ways to upload images into CKEditor 5.\n */\nexport default class SimpleUploadAdapter extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [FileRepository];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'SimpleUploadAdapter';\n }\n /**\n * @inheritDoc\n */\n init() {\n const options = this.editor.config.get('simpleUpload');\n if (!options) {\n return;\n }\n if (!options.uploadUrl) {\n /**\n * The {@link module:upload/uploadconfig~SimpleUploadConfig#uploadUrl `config.simpleUpload.uploadUrl`}\n * configuration required by the {@link module:upload/adapters/simpleuploadadapter~SimpleUploadAdapter `SimpleUploadAdapter`}\n * is missing. Make sure the correct URL is specified for the image upload to work properly.\n *\n * @error simple-upload-adapter-missing-uploadurl\n */\n logWarning('simple-upload-adapter-missing-uploadurl');\n return;\n }\n this.editor.plugins.get(FileRepository).createUploadAdapter = loader => {\n return new Adapter(loader, options);\n };\n }\n}\n/**\n * Upload adapter.\n */\nclass Adapter {\n /**\n * Creates a new adapter instance.\n */\n constructor(loader, options) {\n this.loader = loader;\n this.options = options;\n }\n /**\n * Starts the upload process.\n *\n * @see module:upload/filerepository~UploadAdapter#upload\n */\n upload() {\n return this.loader.file\n .then(file => new Promise((resolve, reject) => {\n this._initRequest();\n this._initListeners(resolve, reject, file);\n this._sendRequest(file);\n }));\n }\n /**\n * Aborts the upload process.\n *\n * @see module:upload/filerepository~UploadAdapter#abort\n */\n abort() {\n if (this.xhr) {\n this.xhr.abort();\n }\n }\n /**\n * Initializes the `XMLHttpRequest` object using the URL specified as\n * {@link module:upload/uploadconfig~SimpleUploadConfig#uploadUrl `simpleUpload.uploadUrl`} in the editor's\n * configuration.\n */\n _initRequest() {\n const xhr = this.xhr = new XMLHttpRequest();\n xhr.open('POST', this.options.uploadUrl, true);\n xhr.responseType = 'json';\n }\n /**\n * Initializes XMLHttpRequest listeners\n *\n * @param resolve Callback function to be called when the request is successful.\n * @param reject Callback function to be called when the request cannot be completed.\n * @param file Native File object.\n */\n _initListeners(resolve, reject, file) {\n const xhr = this.xhr;\n const loader = this.loader;\n const genericErrorText = `Couldn't upload file: ${file.name}.`;\n xhr.addEventListener('error', () => reject(genericErrorText));\n xhr.addEventListener('abort', () => reject());\n xhr.addEventListener('load', () => {\n const response = xhr.response;\n if (!response || response.error) {\n return reject(response && response.error && response.error.message ? response.error.message : genericErrorText);\n }\n const urls = response.url ? { default: response.url } : response.urls;\n // Resolve with the normalized `urls` property and pass the rest of the response\n // to allow customizing the behavior of features relying on the upload adapters.\n resolve({\n ...response,\n urls\n });\n });\n // Upload progress when it is supported.\n /* istanbul ignore else -- @preserve */\n if (xhr.upload) {\n xhr.upload.addEventListener('progress', evt => {\n if (evt.lengthComputable) {\n loader.uploadTotal = evt.total;\n loader.uploaded = evt.loaded;\n }\n });\n }\n }\n /**\n * Prepares the data and sends the request.\n *\n * @param file File instance to be uploaded.\n */\n _sendRequest(file) {\n // Set headers if specified.\n const headers = this.options.headers || {};\n // Use the withCredentials flag if specified.\n const withCredentials = this.options.withCredentials || false;\n for (const headerName of Object.keys(headers)) {\n this.xhr.setRequestHeader(headerName, headers[headerName]);\n }\n this.xhr.withCredentials = withCredentials;\n // Prepare the form data.\n const data = new FormData();\n data.append('upload', file);\n // Send the request.\n this.xhr.send(data);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { global } from 'ckeditor5/src/utils';\n/**\n * Creates a regular expression used to test for image files.\n *\n * ```ts\n * const imageType = createImageTypeRegExp( [ 'png', 'jpeg', 'svg+xml', 'vnd.microsoft.icon' ] );\n *\n * console.log( 'is supported image', imageType.test( file.type ) );\n * ```\n */\nexport function createImageTypeRegExp(types) {\n // Sanitize the MIME type name which may include: \"+\", \"-\" or \".\".\n const regExpSafeNames = types.map(type => type.replace('+', '\\\\+'));\n return new RegExp(`^image\\\\/(${regExpSafeNames.join('|')})$`);\n}\n/**\n * Creates a promise that fetches the image local source (Base64 or blob) and resolves with a `File` object.\n *\n * @param image Image whose source to fetch.\n * @returns A promise which resolves when an image source is fetched and converted to a `File` instance.\n * It resolves with a `File` object. If there were any errors during file processing, the promise will be rejected.\n */\nexport function fetchLocalImage(image) {\n return new Promise((resolve, reject) => {\n const imageSrc = image.getAttribute('src');\n // Fetch works asynchronously and so does not block browser UI when processing data.\n fetch(imageSrc)\n .then(resource => resource.blob())\n .then(blob => {\n const mimeType = getImageMimeType(blob, imageSrc);\n const ext = mimeType.replace('image/', '');\n const filename = `image.${ext}`;\n const file = new File([blob], filename, { type: mimeType });\n resolve(file);\n })\n .catch(err => {\n // Fetch fails only, if it can't make a request due to a network failure or if anything prevented the request\n // from completing, i.e. the Content Security Policy rules. It is not possible to detect the exact cause of failure,\n // so we are just trying the fallback solution, if general TypeError is thrown.\n return err && err.name === 'TypeError' ?\n convertLocalImageOnCanvas(imageSrc).then(resolve).catch(reject) :\n reject(err);\n });\n });\n}\n/**\n * Checks whether a given node is an image element with a local source (Base64 or blob).\n *\n * @param node The node to check.\n */\nexport function isLocalImage(imageUtils, node) {\n if (!imageUtils.isInlineImageView(node) || !node.getAttribute('src')) {\n return false;\n }\n return !!node.getAttribute('src').match(/^data:image\\/\\w+;base64,/g) ||\n !!node.getAttribute('src').match(/^blob:/g);\n}\n/**\n * Extracts an image type based on its blob representation or its source.\n * @param blob Image blob representation.\n * @param src Image `src` attribute value.\n */\nfunction getImageMimeType(blob, src) {\n if (blob.type) {\n return blob.type;\n }\n else if (src.match(/data:(image\\/\\w+);base64/)) {\n return src.match(/data:(image\\/\\w+);base64/)[1].toLowerCase();\n }\n else {\n // Fallback to 'jpeg' as common extension.\n return 'image/jpeg';\n }\n}\n/**\n * Creates a promise that converts the image local source (Base64 or blob) to a blob using canvas and resolves\n * with a `File` object.\n * @param imageSrc Image `src` attribute value.\n * @returns A promise which resolves when an image source is converted to a `File` instance.\n * It resolves with a `File` object. If there were any errors during file processing, the promise will be rejected.\n */\nfunction convertLocalImageOnCanvas(imageSrc) {\n return getBlobFromCanvas(imageSrc).then(blob => {\n const mimeType = getImageMimeType(blob, imageSrc);\n const ext = mimeType.replace('image/', '');\n const filename = `image.${ext}`;\n return new File([blob], filename, { type: mimeType });\n });\n}\n/**\n * Creates a promise that resolves with a `Blob` object converted from the image source (Base64 or blob).\n * @param imageSrc Image `src` attribute value.\n */\nfunction getBlobFromCanvas(imageSrc) {\n return new Promise((resolve, reject) => {\n const image = global.document.createElement('img');\n image.addEventListener('load', () => {\n const canvas = global.document.createElement('canvas');\n canvas.width = image.width;\n canvas.height = image.height;\n const ctx = canvas.getContext('2d');\n ctx.drawImage(image, 0, 0);\n canvas.toBlob(blob => blob ? resolve(blob) : reject());\n });\n image.addEventListener('error', () => reject());\n image.src = imageSrc;\n });\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Plugin, icons } from 'ckeditor5/src/core';\nimport { FileDialogButtonView } from 'ckeditor5/src/upload';\nimport { createImageTypeRegExp } from './utils';\n/**\n * The image upload button plugin.\n *\n * For a detailed overview, check the {@glink features/images/image-upload/image-upload Image upload feature} documentation.\n *\n * Adds the `'uploadImage'` button to the {@link module:ui/componentfactory~ComponentFactory UI component factory}\n * and also the `imageUpload` button as an alias for backward compatibility.\n */\nexport default class ImageUploadUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageUploadUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n const componentCreator = (locale) => {\n const view = new FileDialogButtonView(locale);\n const command = editor.commands.get('uploadImage');\n const imageTypes = editor.config.get('image.upload.types');\n const imageTypesRegExp = createImageTypeRegExp(imageTypes);\n view.set({\n acceptedType: imageTypes.map(type => `image/${type}`).join(','),\n allowMultipleFiles: true\n });\n view.buttonView.set({\n label: t('Insert image'),\n icon: icons.image,\n tooltip: true\n });\n view.buttonView.bind('isEnabled').to(command);\n view.on('done', (evt, files) => {\n const imagesToUpload = Array.from(files).filter(file => imageTypesRegExp.test(file.type));\n if (imagesToUpload.length) {\n editor.execute('uploadImage', { file: imagesToUpload });\n editor.editing.view.focus();\n }\n });\n return view;\n };\n // Setup `uploadImage` button and add `imageUpload` button as an alias for backward compatibility.\n editor.ui.componentFactory.add('uploadImage', componentCreator);\n editor.ui.componentFactory.add('imageUpload', componentCreator);\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imageuploadprogress.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imageuploadicon.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imageuploadloader.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageupload/imageuploadprogress\n */\n/* globals setTimeout */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { FileRepository } from 'ckeditor5/src/upload';\nimport '../../theme/imageuploadprogress.css';\nimport '../../theme/imageuploadicon.css';\nimport '../../theme/imageuploadloader.css';\n/**\n * The image upload progress plugin.\n * It shows a placeholder when the image is read from the disk and a progress bar while the image is uploading.\n */\nexport default class ImageUploadProgress extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageUploadProgress';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n /**\n * This method is called each time the image `uploadStatus` attribute is changed.\n *\n * @param evt An object containing information about the fired event.\n * @param data Additional information about the change.\n */\n this.uploadStatusChange = (evt, data, conversionApi) => {\n const editor = this.editor;\n const modelImage = data.item;\n const uploadId = modelImage.getAttribute('uploadId');\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const imageUtils = editor.plugins.get('ImageUtils');\n const fileRepository = editor.plugins.get(FileRepository);\n const status = uploadId ? data.attributeNewValue : null;\n const placeholder = this.placeholder;\n const viewFigure = editor.editing.mapper.toViewElement(modelImage);\n const viewWriter = conversionApi.writer;\n if (status == 'reading') {\n // Start \"appearing\" effect and show placeholder with infinite progress bar on the top\n // while image is read from disk.\n _startAppearEffect(viewFigure, viewWriter);\n _showPlaceholder(imageUtils, placeholder, viewFigure, viewWriter);\n return;\n }\n // Show progress bar on the top of the image when image is uploading.\n if (status == 'uploading') {\n const loader = fileRepository.loaders.get(uploadId);\n // Start appear effect if needed - see https://github.com/ckeditor/ckeditor5-image/issues/191.\n _startAppearEffect(viewFigure, viewWriter);\n if (!loader) {\n // There is no loader associated with uploadId - this means that image came from external changes.\n // In such cases we still want to show the placeholder until image is fully uploaded.\n // Show placeholder if needed - see https://github.com/ckeditor/ckeditor5-image/issues/191.\n _showPlaceholder(imageUtils, placeholder, viewFigure, viewWriter);\n }\n else {\n // Hide placeholder and initialize progress bar showing upload progress.\n _hidePlaceholder(viewFigure, viewWriter);\n _showProgressBar(viewFigure, viewWriter, loader, editor.editing.view);\n _displayLocalImage(imageUtils, viewFigure, viewWriter, loader);\n }\n return;\n }\n if (status == 'complete' && fileRepository.loaders.get(uploadId)) {\n _showCompleteIcon(viewFigure, viewWriter, editor.editing.view);\n }\n // Clean up.\n _hideProgressBar(viewFigure, viewWriter);\n _hidePlaceholder(viewFigure, viewWriter);\n _stopAppearEffect(viewFigure, viewWriter);\n };\n this.placeholder = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Upload status change - update image's view according to that status.\n if (editor.plugins.has('ImageBlockEditing')) {\n editor.editing.downcastDispatcher.on('attribute:uploadStatus:imageBlock', this.uploadStatusChange);\n }\n if (editor.plugins.has('ImageInlineEditing')) {\n editor.editing.downcastDispatcher.on('attribute:uploadStatus:imageInline', this.uploadStatusChange);\n }\n }\n}\n/**\n * Adds ck-appear class to the image figure if one is not already applied.\n */\nfunction _startAppearEffect(viewFigure, writer) {\n if (!viewFigure.hasClass('ck-appear')) {\n writer.addClass('ck-appear', viewFigure);\n }\n}\n/**\n * Removes ck-appear class to the image figure if one is not already removed.\n */\nfunction _stopAppearEffect(viewFigure, writer) {\n writer.removeClass('ck-appear', viewFigure);\n}\n/**\n * Shows placeholder together with infinite progress bar on given image figure.\n */\nfunction _showPlaceholder(imageUtils, placeholder, viewFigure, writer) {\n if (!viewFigure.hasClass('ck-image-upload-placeholder')) {\n writer.addClass('ck-image-upload-placeholder', viewFigure);\n }\n const viewImg = imageUtils.findViewImgElement(viewFigure);\n if (viewImg.getAttribute('src') !== placeholder) {\n writer.setAttribute('src', placeholder, viewImg);\n }\n if (!_getUIElement(viewFigure, 'placeholder')) {\n writer.insert(writer.createPositionAfter(viewImg), _createPlaceholder(writer));\n }\n}\n/**\n * Removes placeholder together with infinite progress bar on given image figure.\n */\nfunction _hidePlaceholder(viewFigure, writer) {\n if (viewFigure.hasClass('ck-image-upload-placeholder')) {\n writer.removeClass('ck-image-upload-placeholder', viewFigure);\n }\n _removeUIElement(viewFigure, writer, 'placeholder');\n}\n/**\n * Shows progress bar displaying upload progress.\n * Attaches it to the file loader to update when upload percentace is changed.\n */\nfunction _showProgressBar(viewFigure, writer, loader, view) {\n const progressBar = _createProgressBar(writer);\n writer.insert(writer.createPositionAt(viewFigure, 'end'), progressBar);\n // Update progress bar width when uploadedPercent is changed.\n loader.on('change:uploadedPercent', (evt, name, value) => {\n view.change(writer => {\n writer.setStyle('width', value + '%', progressBar);\n });\n });\n}\n/**\n * Hides upload progress bar.\n */\nfunction _hideProgressBar(viewFigure, writer) {\n _removeUIElement(viewFigure, writer, 'progressBar');\n}\n/**\n * Shows complete icon and hides after a certain amount of time.\n */\nfunction _showCompleteIcon(viewFigure, writer, view) {\n const completeIcon = writer.createUIElement('div', { class: 'ck-image-upload-complete-icon' });\n writer.insert(writer.createPositionAt(viewFigure, 'end'), completeIcon);\n setTimeout(() => {\n view.change(writer => writer.remove(writer.createRangeOn(completeIcon)));\n }, 3000);\n}\n/**\n * Create progress bar element using {@link module:engine/view/uielement~UIElement}.\n */\nfunction _createProgressBar(writer) {\n const progressBar = writer.createUIElement('div', { class: 'ck-progress-bar' });\n writer.setCustomProperty('progressBar', true, progressBar);\n return progressBar;\n}\n/**\n * Create placeholder element using {@link module:engine/view/uielement~UIElement}.\n */\nfunction _createPlaceholder(writer) {\n const placeholder = writer.createUIElement('div', { class: 'ck-upload-placeholder-loader' });\n writer.setCustomProperty('placeholder', true, placeholder);\n return placeholder;\n}\n/**\n * Returns {@link module:engine/view/uielement~UIElement} of given unique property from image figure element.\n * Returns `undefined` if element is not found.\n */\nfunction _getUIElement(imageFigure, uniqueProperty) {\n for (const child of imageFigure.getChildren()) {\n if (child.getCustomProperty(uniqueProperty)) {\n return child;\n }\n }\n}\n/**\n * Removes {@link module:engine/view/uielement~UIElement} of given unique property from image figure element.\n */\nfunction _removeUIElement(viewFigure, writer, uniqueProperty) {\n const element = _getUIElement(viewFigure, uniqueProperty);\n if (element) {\n writer.remove(writer.createRangeOn(element));\n }\n}\n/**\n * Displays local data from file loader.\n */\nfunction _displayLocalImage(imageUtils, viewFigure, writer, loader) {\n if (loader.data) {\n const viewImg = imageUtils.findViewImgElement(viewFigure);\n writer.setAttribute('src', loader.data, viewImg);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { FileRepository } from 'ckeditor5/src/upload';\nimport { Command } from 'ckeditor5/src/core';\nimport { toArray } from 'ckeditor5/src/utils';\n/**\n * @module image/imageupload/uploadimagecommand\n */\n/**\n * The upload image command.\n *\n * The command is registered by the {@link module:image/imageupload/imageuploadediting~ImageUploadEditing} plugin as `uploadImage`\n * and it is also available via aliased `imageUpload` name.\n *\n * In order to upload an image at the current selection position\n * (according to the {@link module:widget/utils~findOptimalInsertionRange} algorithm),\n * execute the command and pass the native image file instance:\n *\n * ```ts\n * this.listenTo( editor.editing.view.document, 'clipboardInput', ( evt, data ) => {\n * \t// Assuming that only images were pasted:\n * \tconst images = Array.from( data.dataTransfer.files );\n *\n * \t// Upload the first image:\n * \teditor.execute( 'uploadImage', { file: images[ 0 ] } );\n * } );\n * ```\n *\n * It is also possible to insert multiple images at once:\n *\n * ```ts\n * editor.execute( 'uploadImage', {\n * \tfile: [\n * \t\tfile1,\n * \t\tfile2\n * \t]\n * } );\n * ```\n */\nexport default class UploadImageCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const editor = this.editor;\n const imageUtils = editor.plugins.get('ImageUtils');\n const selectedElement = editor.model.document.selection.getSelectedElement();\n // TODO: This needs refactoring.\n this.isEnabled = imageUtils.isImageAllowed() || imageUtils.isImage(selectedElement);\n }\n /**\n * Executes the command.\n *\n * @fires execute\n * @param options Options for the executed command.\n * @param options.file The image file or an array of image files to upload.\n */\n execute(options) {\n const files = toArray(options.file);\n const selection = this.editor.model.document.selection;\n const imageUtils = this.editor.plugins.get('ImageUtils');\n // In case of multiple files, each file (starting from the 2nd) will be inserted at a position that\n // follows the previous one. That will move the selection and, to stay on the safe side and make sure\n // all images inherit the same selection attributes, they are collected beforehand.\n //\n // Applying these attributes ensures, for instance, that inserting an (inline) image into a link does\n // not split that link but preserves its continuity.\n //\n // Note: Selection attributes that do not make sense for images will be filtered out by insertImage() anyway.\n const selectionAttributes = Object.fromEntries(selection.getAttributes());\n files.forEach((file, index) => {\n const selectedElement = selection.getSelectedElement();\n // Inserting of an inline image replace the selected element and make a selection on the inserted image.\n // Therefore inserting multiple inline images requires creating position after each element.\n if (index && selectedElement && imageUtils.isImage(selectedElement)) {\n const position = this.editor.model.createPositionAfter(selectedElement);\n this._uploadImage(file, selectionAttributes, position);\n }\n else {\n this._uploadImage(file, selectionAttributes);\n }\n });\n }\n /**\n * Handles uploading single file.\n */\n _uploadImage(file, attributes, position) {\n const editor = this.editor;\n const fileRepository = editor.plugins.get(FileRepository);\n const loader = fileRepository.createLoader(file);\n const imageUtils = editor.plugins.get('ImageUtils');\n // Do not throw when upload adapter is not set. FileRepository will log an error anyway.\n if (!loader) {\n return;\n }\n imageUtils.insertImage({ ...attributes, uploadId: loader.id }, position);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageupload/imageuploadediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { UpcastWriter } from 'ckeditor5/src/engine';\nimport { Notification } from 'ckeditor5/src/ui';\nimport { ClipboardPipeline } from 'ckeditor5/src/clipboard';\nimport { FileRepository } from 'ckeditor5/src/upload';\nimport { env } from 'ckeditor5/src/utils';\nimport ImageUtils from '../imageutils';\nimport UploadImageCommand from './uploadimagecommand';\nimport { fetchLocalImage, isLocalImage } from '../../src/imageupload/utils';\nimport { createImageTypeRegExp } from './utils';\n/**\n * The editing part of the image upload feature. It registers the `'uploadImage'` command\n * and the `imageUpload` command as an aliased name.\n *\n * When an image is uploaded, it fires the {@link ~ImageUploadEditing#event:uploadComplete `uploadComplete`} event\n * that allows adding custom attributes to the {@link module:engine/model/element~Element image element}.\n */\nexport default class ImageUploadEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [FileRepository, Notification, ClipboardPipeline, ImageUtils];\n }\n static get pluginName() {\n return 'ImageUploadEditing';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n editor.config.define('image', {\n upload: {\n types: ['jpeg', 'png', 'gif', 'bmp', 'webp', 'tiff']\n }\n });\n this._uploadImageElements = new Map();\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const doc = editor.model.document;\n const conversion = editor.conversion;\n const fileRepository = editor.plugins.get(FileRepository);\n const imageUtils = editor.plugins.get('ImageUtils');\n const clipboardPipeline = editor.plugins.get('ClipboardPipeline');\n const imageTypes = createImageTypeRegExp(editor.config.get('image.upload.types'));\n const uploadImageCommand = new UploadImageCommand(editor);\n // Register `uploadImage` command and add `imageUpload` command as an alias for backward compatibility.\n editor.commands.add('uploadImage', uploadImageCommand);\n editor.commands.add('imageUpload', uploadImageCommand);\n // Register upcast converter for uploadId.\n conversion.for('upcast')\n .attributeToAttribute({\n view: {\n name: 'img',\n key: 'uploadId'\n },\n model: 'uploadId'\n });\n // Handle pasted images.\n // For every image file, a new file loader is created and a placeholder image is\n // inserted into the content. Then, those images are uploaded once they appear in the model\n // (see Document#change listener below).\n this.listenTo(editor.editing.view.document, 'clipboardInput', (evt, data) => {\n // Skip if non empty HTML data is included.\n // https://github.com/ckeditor/ckeditor5-upload/issues/68\n if (isHtmlIncluded(data.dataTransfer)) {\n return;\n }\n const images = Array.from(data.dataTransfer.files).filter(file => {\n // See https://github.com/ckeditor/ckeditor5-image/pull/254.\n if (!file) {\n return false;\n }\n return imageTypes.test(file.type);\n });\n if (!images.length) {\n return;\n }\n evt.stop();\n editor.model.change(writer => {\n // Set selection to paste target.\n if (data.targetRanges) {\n writer.setSelection(data.targetRanges.map(viewRange => editor.editing.mapper.toModelRange(viewRange)));\n }\n // Upload images after the selection has changed in order to ensure the command's state is refreshed.\n editor.model.enqueueChange(() => {\n editor.execute('uploadImage', { file: images });\n });\n });\n });\n // Handle HTML pasted with images with base64 or blob sources.\n // For every image file, a new file loader is created and a placeholder image is\n // inserted into the content. Then, those images are uploaded once they appear in the model\n // (see Document#change listener below).\n this.listenTo(clipboardPipeline, 'inputTransformation', (evt, data) => {\n const fetchableImages = Array.from(editor.editing.view.createRangeIn(data.content))\n .map(value => value.item)\n .filter(viewElement => isLocalImage(imageUtils, viewElement) &&\n !viewElement.getAttribute('uploadProcessed'))\n .map(viewElement => { return { promise: fetchLocalImage(viewElement), imageElement: viewElement }; });\n if (!fetchableImages.length) {\n return;\n }\n const writer = new UpcastWriter(editor.editing.view.document);\n for (const fetchableImage of fetchableImages) {\n // Set attribute marking that the image was processed already.\n writer.setAttribute('uploadProcessed', true, fetchableImage.imageElement);\n const loader = fileRepository.createLoader(fetchableImage.promise);\n if (loader) {\n writer.setAttribute('src', '', fetchableImage.imageElement);\n writer.setAttribute('uploadId', loader.id, fetchableImage.imageElement);\n }\n }\n });\n // Prevents from the browser redirecting to the dropped image.\n editor.editing.view.document.on('dragover', (evt, data) => {\n data.preventDefault();\n });\n // Upload placeholder images that appeared in the model.\n doc.on('change', () => {\n // Note: Reversing changes to start with insertions and only then handle removals. If it was the other way around,\n // loaders for **all** images that land in the $graveyard would abort while in fact only those that were **not** replaced\n // by other images should be aborted.\n const changes = doc.differ.getChanges({ includeChangesInGraveyard: true }).reverse();\n const insertedImagesIds = new Set();\n for (const entry of changes) {\n if (entry.type == 'insert' && entry.name != '$text') {\n const item = entry.position.nodeAfter;\n const isInsertedInGraveyard = entry.position.root.rootName == '$graveyard';\n for (const imageElement of getImagesFromChangeItem(editor, item)) {\n // Check if the image element still has upload id.\n const uploadId = imageElement.getAttribute('uploadId');\n if (!uploadId) {\n continue;\n }\n // Check if the image is loaded on this client.\n const loader = fileRepository.loaders.get(uploadId);\n if (!loader) {\n continue;\n }\n if (isInsertedInGraveyard) {\n // If the image was inserted to the graveyard for good (**not** replaced by another image),\n // only then abort the loading process.\n if (!insertedImagesIds.has(uploadId)) {\n loader.abort();\n }\n }\n else {\n // Remember the upload id of the inserted image. If it acted as a replacement for another\n // image (which landed in the $graveyard), the related loader will not be aborted because\n // this is still the same image upload.\n insertedImagesIds.add(uploadId);\n // Keep the mapping between the upload ID and the image model element so the upload\n // can later resolve in the context of the correct model element. The model element could\n // change for the same upload if one image was replaced by another (e.g. image type was changed),\n // so this may also replace an existing mapping.\n this._uploadImageElements.set(uploadId, imageElement);\n if (loader.status == 'idle') {\n // If the image was inserted into content and has not been loaded yet, start loading it.\n this._readAndUpload(loader);\n }\n }\n }\n }\n }\n });\n // Set the default handler for feeding the image element with `src` and `srcset` attributes.\n this.on('uploadComplete', (evt, { imageElement, data }) => {\n const urls = data.urls ? data.urls : data;\n this.editor.model.change(writer => {\n writer.setAttribute('src', urls.default, imageElement);\n this._parseAndSetSrcsetAttributeOnImage(urls, imageElement, writer);\n });\n }, { priority: 'low' });\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n const schema = this.editor.model.schema;\n // Setup schema to allow uploadId and uploadStatus for images.\n // Wait for ImageBlockEditing or ImageInlineEditing to register their elements first,\n // that's why doing this in afterInit() instead of init().\n if (this.editor.plugins.has('ImageBlockEditing')) {\n schema.extend('imageBlock', {\n allowAttributes: ['uploadId', 'uploadStatus']\n });\n }\n if (this.editor.plugins.has('ImageInlineEditing')) {\n schema.extend('imageInline', {\n allowAttributes: ['uploadId', 'uploadStatus']\n });\n }\n }\n /**\n * Reads and uploads an image.\n *\n * The image is read from the disk and as a Base64-encoded string it is set temporarily to\n * `image[src]`. When the image is successfully uploaded, the temporary data is replaced with the target\n * image's URL (the URL to the uploaded image on the server).\n */\n _readAndUpload(loader) {\n const editor = this.editor;\n const model = editor.model;\n const t = editor.locale.t;\n const fileRepository = editor.plugins.get(FileRepository);\n const notification = editor.plugins.get(Notification);\n const imageUtils = editor.plugins.get('ImageUtils');\n const imageUploadElements = this._uploadImageElements;\n model.enqueueChange({ isUndoable: false }, writer => {\n writer.setAttribute('uploadStatus', 'reading', imageUploadElements.get(loader.id));\n });\n return loader.read()\n .then(() => {\n const promise = loader.upload();\n const imageElement = imageUploadElements.get(loader.id);\n // Force repaint in Safari. Without it, the image will display with a wrong size.\n // https://github.com/ckeditor/ckeditor5/issues/1975\n /* istanbul ignore next -- @preserve */\n if (env.isSafari) {\n const viewFigure = editor.editing.mapper.toViewElement(imageElement);\n const viewImg = imageUtils.findViewImgElement(viewFigure);\n editor.editing.view.once('render', () => {\n // Early returns just to be safe. There might be some code ran\n // in between the outer scope and this callback.\n if (!viewImg.parent) {\n return;\n }\n const domFigure = editor.editing.view.domConverter.mapViewToDom(viewImg.parent);\n if (!domFigure) {\n return;\n }\n const originalDisplay = domFigure.style.display;\n domFigure.style.display = 'none';\n // Make sure this line will never be removed during minification for having \"no effect\".\n domFigure._ckHack = domFigure.offsetHeight;\n domFigure.style.display = originalDisplay;\n });\n }\n model.enqueueChange({ isUndoable: false }, writer => {\n writer.setAttribute('uploadStatus', 'uploading', imageElement);\n });\n return promise;\n })\n .then(data => {\n model.enqueueChange({ isUndoable: false }, writer => {\n const imageElement = imageUploadElements.get(loader.id);\n writer.setAttribute('uploadStatus', 'complete', imageElement);\n this.fire('uploadComplete', { data, imageElement });\n });\n clean();\n })\n .catch(error => {\n // If status is not 'error' nor 'aborted' - throw error because it means that something else went wrong,\n // it might be generic error and it would be real pain to find what is going on.\n if (loader.status !== 'error' && loader.status !== 'aborted') {\n throw error;\n }\n // Might be 'aborted'.\n if (loader.status == 'error' && error) {\n notification.showWarning(error, {\n title: t('Upload failed'),\n namespace: 'upload'\n });\n }\n // Permanently remove image from insertion batch.\n model.enqueueChange({ isUndoable: false }, writer => {\n writer.remove(imageUploadElements.get(loader.id));\n });\n clean();\n });\n function clean() {\n model.enqueueChange({ isUndoable: false }, writer => {\n const imageElement = imageUploadElements.get(loader.id);\n writer.removeAttribute('uploadId', imageElement);\n writer.removeAttribute('uploadStatus', imageElement);\n imageUploadElements.delete(loader.id);\n });\n fileRepository.destroyLoader(loader);\n }\n }\n /**\n * Creates the `srcset` attribute based on a given file upload response and sets it as an attribute to a specific image element.\n *\n * @param data Data object from which `srcset` will be created.\n * @param image The image element on which the `srcset` attribute will be set.\n */\n _parseAndSetSrcsetAttributeOnImage(data, image, writer) {\n // Srcset attribute for responsive images support.\n let maxWidth = 0;\n const srcsetAttribute = Object.keys(data)\n // Filter out keys that are not integers.\n .filter(key => {\n const width = parseInt(key, 10);\n if (!isNaN(width)) {\n maxWidth = Math.max(maxWidth, width);\n return true;\n }\n })\n // Convert each key to srcset entry.\n .map(key => `${data[key]} ${key}w`)\n // Join all entries.\n .join(', ');\n if (srcsetAttribute != '') {\n writer.setAttribute('srcset', {\n data: srcsetAttribute,\n width: maxWidth\n }, image);\n }\n }\n}\n/**\n * Returns `true` if non-empty `text/html` is included in the data transfer.\n */\nexport function isHtmlIncluded(dataTransfer) {\n return Array.from(dataTransfer.types).includes('text/html') && dataTransfer.getData('text/html') !== '';\n}\nfunction getImagesFromChangeItem(editor, item) {\n const imageUtils = editor.plugins.get('ImageUtils');\n return Array.from(editor.model.createRangeOn(item))\n .filter(value => imageUtils.isImage(value.item))\n .map(value => value.item);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageupload\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport ImageUploadUI from './imageupload/imageuploadui';\nimport ImageUploadProgress from './imageupload/imageuploadprogress';\nimport ImageUploadEditing from './imageupload/imageuploadediting';\n/**\n * The image upload plugin.\n *\n * For a detailed overview, check the {@glink features/images/image-upload/image-upload image upload feature} documentation.\n *\n * This plugin does not do anything directly, but it loads a set of specific plugins to enable image uploading:\n *\n * * {@link module:image/imageupload/imageuploadediting~ImageUploadEditing},\n * * {@link module:image/imageupload/imageuploadui~ImageUploadUI},\n * * {@link module:image/imageupload/imageuploadprogress~ImageUploadProgress}.\n */\nexport default class ImageUpload extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageUpload';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageUploadEditing, ImageUploadUI, ImageUploadProgress];\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imageinsertformrowview.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { View } from 'ckeditor5/src/ui';\nimport '../../../theme/imageinsertformrowview.css';\n/**\n * The class representing a single row in a complex form,\n * used by {@link module:image/imageinsert/ui/imageinsertpanelview~ImageInsertPanelView}.\n *\n * **Note**: For now this class is private. When more use cases appear (beyond `ckeditor5-table` and `ckeditor5-image`),\n * it will become a component in `ckeditor5-ui`.\n *\n * @private\n */\nexport default class ImageUploadFormRowView extends View {\n /**\n * Creates an instance of the form row class.\n *\n * @param locale The locale instance.\n * @param options.labelView When passed, the row gets the `group` and `aria-labelledby`\n * DOM attributes and gets described by the label.\n */\n constructor(locale, options = {}) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('class', options.class || null);\n this.children = this.createCollection();\n if (options.children) {\n options.children.forEach(child => this.children.add(child));\n }\n this.set('_role', null);\n this.set('_ariaLabelledBy', null);\n if (options.labelView) {\n this.set({\n _role: 'group',\n _ariaLabelledBy: options.labelView.id\n });\n }\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-form__row',\n bind.to('class')\n ],\n role: bind.to('_role'),\n 'aria-labelledby': bind.to('_ariaLabelledBy')\n },\n children: this.children\n });\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imageinsert.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageinsert/ui/imageinsertpanelview\n */\nimport { icons } from 'ckeditor5/src/core';\nimport { ButtonView, View, ViewCollection, submitHandler, FocusCycler } from 'ckeditor5/src/ui';\nimport { Collection, FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils';\nimport ImageInsertFormRowView from './imageinsertformrowview';\nimport '../../../theme/imageinsert.css';\n/**\n * The insert an image via URL view controller class.\n *\n * See {@link module:image/imageinsert/ui/imageinsertpanelview~ImageInsertPanelView}.\n */\nexport default class ImageInsertPanelView extends View {\n /**\n * Creates a view for the dropdown panel of {@link module:image/imageinsert/imageinsertui~ImageInsertUI}.\n *\n * @param locale The localization services instance.\n * @param integrations An integrations object that contains components (or tokens for components) to be shown in the panel view.\n */\n constructor(locale, integrations = {}) {\n super(locale);\n const { insertButtonView, cancelButtonView } = this._createActionButtons(locale);\n this.insertButtonView = insertButtonView;\n this.cancelButtonView = cancelButtonView;\n this.set('imageURLInputValue', '');\n this.focusTracker = new FocusTracker();\n this.keystrokes = new KeystrokeHandler();\n this._focusables = new ViewCollection();\n this._focusCycler = new FocusCycler({\n focusables: this._focusables,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate form fields backwards using the Shift + Tab keystroke.\n focusPrevious: 'shift + tab',\n // Navigate form fields forwards using the Tab key.\n focusNext: 'tab'\n }\n });\n this.set('_integrations', new Collection());\n for (const [integration, integrationView] of Object.entries(integrations)) {\n if (integration === 'insertImageViaUrl') {\n integrationView.fieldView\n .bind('value').to(this, 'imageURLInputValue', (value) => value || '');\n integrationView.fieldView.on('input', () => {\n this.imageURLInputValue = integrationView.fieldView.element.value.trim();\n });\n }\n integrationView.name = integration;\n this._integrations.add(integrationView);\n }\n this.setTemplate({\n tag: 'form',\n attributes: {\n class: [\n 'ck',\n 'ck-image-insert-form'\n ],\n tabindex: '-1'\n },\n children: [\n ...this._integrations,\n new ImageInsertFormRowView(locale, {\n children: [\n this.insertButtonView,\n this.cancelButtonView\n ],\n class: 'ck-image-insert-form__action-row'\n })\n ]\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n submitHandler({\n view: this\n });\n const childViews = [\n ...this._integrations,\n this.insertButtonView,\n this.cancelButtonView\n ];\n childViews.forEach(v => {\n // Register the view as focusable.\n this._focusables.add(v);\n // Register the view in the focus tracker.\n this.focusTracker.add(v.element);\n });\n // Start listening for the keystrokes coming from #element.\n this.keystrokes.listenTo(this.element);\n const stopPropagation = (data) => data.stopPropagation();\n // Since the form is in the dropdown panel which is a child of the toolbar, the toolbar's\n // keystroke handler would take over the key management in the URL input. We need to prevent\n // this ASAP. Otherwise, the basic caret movement using the arrow keys will be impossible.\n this.keystrokes.set('arrowright', stopPropagation);\n this.keystrokes.set('arrowleft', stopPropagation);\n this.keystrokes.set('arrowup', stopPropagation);\n this.keystrokes.set('arrowdown', stopPropagation);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Returns a view of the integration.\n *\n * @param name The name of the integration.\n */\n getIntegration(name) {\n return this._integrations.find(integration => integration.name === name);\n }\n /**\n * Creates the following form controls:\n *\n * * {@link #insertButtonView},\n * * {@link #cancelButtonView}.\n *\n * @param locale The localization services instance.\n */\n _createActionButtons(locale) {\n const t = locale.t;\n const insertButtonView = new ButtonView(locale);\n const cancelButtonView = new ButtonView(locale);\n insertButtonView.set({\n label: t('Insert'),\n icon: icons.check,\n class: 'ck-button-save',\n type: 'submit',\n withText: true,\n isEnabled: this.imageURLInputValue\n });\n cancelButtonView.set({\n label: t('Cancel'),\n icon: icons.cancel,\n class: 'ck-button-cancel',\n withText: true\n });\n insertButtonView.bind('isEnabled').to(this, 'imageURLInputValue', value => !!value);\n insertButtonView.delegate('execute').to(this, 'submit');\n cancelButtonView.delegate('execute').to(this, 'cancel');\n return { insertButtonView, cancelButtonView };\n }\n /**\n * Focuses the first {@link #_focusables focusable} in the form.\n */\n focus() {\n this._focusCycler.focusFirst();\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { LabeledFieldView, createLabeledInputText } from 'ckeditor5/src/ui';\n/**\n * Creates integrations object that will be passed to the\n * {@link module:image/imageinsert/ui/imageinsertpanelview~ImageInsertPanelView}.\n *\n * @param editor Editor instance.\n *\n * @returns Integrations object.\n */\nexport function prepareIntegrations(editor) {\n const panelItems = editor.config.get('image.insert.integrations');\n const imageInsertUIPlugin = editor.plugins.get('ImageInsertUI');\n const PREDEFINED_INTEGRATIONS = {\n 'insertImageViaUrl': createLabeledInputView(editor.locale)\n };\n if (!panelItems) {\n return PREDEFINED_INTEGRATIONS;\n }\n // Prepares ckfinder component for the `openCKFinder` integration token.\n if (panelItems.find(item => item === 'openCKFinder') && editor.ui.componentFactory.has('ckfinder')) {\n const ckFinderButton = editor.ui.componentFactory.create('ckfinder');\n ckFinderButton.set({\n withText: true,\n class: 'ck-image-insert__ck-finder-button'\n });\n // We want to close the dropdown panel view when user clicks the ckFinderButton.\n ckFinderButton.delegate('execute').to(imageInsertUIPlugin, 'cancel');\n PREDEFINED_INTEGRATIONS.openCKFinder = ckFinderButton;\n }\n // Creates integrations object of valid views to pass it to the ImageInsertPanelView.\n return panelItems.reduce((object, key) => {\n if (PREDEFINED_INTEGRATIONS[key]) {\n object[key] = PREDEFINED_INTEGRATIONS[key];\n }\n else if (editor.ui.componentFactory.has(key)) {\n object[key] = editor.ui.componentFactory.create(key);\n }\n return object;\n }, {});\n}\n/**\n * Creates labeled field view.\n *\n * @param locale The localization services instance.\n */\nexport function createLabeledInputView(locale) {\n const t = locale.t;\n const labeledInputView = new LabeledFieldView(locale, createLabeledInputText);\n labeledInputView.set({\n label: t('Insert image via URL')\n });\n labeledInputView.fieldView.placeholder = 'https://example.com/image.png';\n return labeledInputView;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageinsert/imageinsertui\n */\nimport { Plugin, icons } from 'ckeditor5/src/core';\nimport { SplitButtonView, createDropdown } from 'ckeditor5/src/ui';\nimport ImageInsertPanelView from './ui/imageinsertpanelview';\nimport { prepareIntegrations } from './utils';\n/**\n * The image insert dropdown plugin.\n *\n * For a detailed overview, check the {@glink features/images/image-upload/image-upload Image upload feature}\n * and {@glink features/images/images-inserting Insert images via source URL} documentation.\n *\n * Adds the `'insertImage'` dropdown to the {@link module:ui/componentfactory~ComponentFactory UI component factory}\n * and also the `imageInsert` dropdown as an alias for backward compatibility.\n */\nexport default class ImageInsertUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageInsertUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const componentCreator = (locale) => {\n return this._createDropdownView(locale);\n };\n // Register `insertImage` dropdown and add `imageInsert` dropdown as an alias for backward compatibility.\n editor.ui.componentFactory.add('insertImage', componentCreator);\n editor.ui.componentFactory.add('imageInsert', componentCreator);\n }\n /**\n * Creates the dropdown view.\n *\n * @param locale The localization services instance.\n */\n _createDropdownView(locale) {\n const editor = this.editor;\n const t = locale.t;\n const uploadImageCommand = editor.commands.get('uploadImage');\n const insertImageCommand = editor.commands.get('insertImage');\n this.dropdownView = createDropdown(locale, uploadImageCommand ? SplitButtonView : undefined);\n const buttonView = this.dropdownView.buttonView;\n const panelView = this.dropdownView.panelView;\n buttonView.set({\n label: t('Insert image'),\n icon: icons.image,\n tooltip: true\n });\n panelView.extendTemplate({\n attributes: {\n class: 'ck-image-insert__panel'\n }\n });\n if (uploadImageCommand) {\n const splitButtonView = this.dropdownView.buttonView;\n // We are injecting custom button replacement to readonly field.\n splitButtonView.actionView = editor.ui.componentFactory.create('uploadImage');\n // After we replaced action button with `uploadImage` component,\n // we have lost a proper styling and some minor visual quirks have appeared.\n // Brining back original split button classes helps fix the button styling\n // See https://github.com/ckeditor/ckeditor5/issues/7986.\n splitButtonView.actionView.extendTemplate({\n attributes: {\n class: 'ck ck-button ck-splitbutton__action'\n }\n });\n }\n return this._setUpDropdown(uploadImageCommand || insertImageCommand);\n }\n /**\n * Sets up the dropdown view.\n *\n * @param command An uploadImage or insertImage command.\n */\n _setUpDropdown(command) {\n const editor = this.editor;\n const t = editor.t;\n const dropdownView = this.dropdownView;\n const panelView = dropdownView.panelView;\n const imageUtils = this.editor.plugins.get('ImageUtils');\n const replaceImageSourceCommand = editor.commands.get('replaceImageSource');\n let imageInsertView;\n dropdownView.bind('isEnabled').to(command);\n dropdownView.once('change:isOpen', () => {\n imageInsertView = new ImageInsertPanelView(editor.locale, prepareIntegrations(editor));\n imageInsertView.delegate('submit', 'cancel').to(dropdownView);\n panelView.children.add(imageInsertView);\n });\n dropdownView.on('change:isOpen', () => {\n const selectedElement = editor.model.document.selection.getSelectedElement();\n const insertButtonView = imageInsertView.insertButtonView;\n const insertImageViaUrlForm = imageInsertView.getIntegration('insertImageViaUrl');\n if (dropdownView.isOpen) {\n if (imageUtils.isImage(selectedElement)) {\n imageInsertView.imageURLInputValue = replaceImageSourceCommand.value;\n insertButtonView.label = t('Update');\n insertImageViaUrlForm.label = t('Update image URL');\n }\n else {\n imageInsertView.imageURLInputValue = '';\n insertButtonView.label = t('Insert');\n insertImageViaUrlForm.label = t('Insert image via URL');\n }\n }\n // Note: Use the low priority to make sure the following listener starts working after the\n // default action of the drop-down is executed (i.e. the panel showed up). Otherwise, the\n // invisible form/input cannot be focused/selected.\n }, { priority: 'low' });\n this.delegate('cancel').to(dropdownView);\n dropdownView.on('submit', () => {\n closePanel();\n onSubmit();\n });\n dropdownView.on('cancel', () => {\n closePanel();\n });\n function onSubmit() {\n const selectedElement = editor.model.document.selection.getSelectedElement();\n if (imageUtils.isImage(selectedElement)) {\n editor.execute('replaceImageSource', { source: imageInsertView.imageURLInputValue });\n }\n else {\n editor.execute('insertImage', { source: imageInsertView.imageURLInputValue });\n }\n }\n function closePanel() {\n editor.editing.view.focus();\n dropdownView.isOpen = false;\n }\n return dropdownView;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageinsertviaurl\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport ImageInsertUI from './imageinsert/imageinsertui';\n/**\n * The image insert via URL plugin.\n *\n * For a detailed overview, check the {@glink features/images/images-inserting\n * Insert images via source URL} documentation.\n *\n * This plugin does not do anything directly, but it loads a set of specific plugins\n * to enable image inserting via implemented integrations:\n *\n * * {@link module:image/imageinsert/imageinsertui~ImageInsertUI},\n */\nexport default class ImageInsertViaUrl extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageInsertViaUrl';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageInsertUI];\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageresize/resizeimagecommand\n */\nimport { Command } from 'ckeditor5/src/core';\n/**\n * The resize image command. Currently, it only supports the width attribute.\n */\nexport default class ResizeImageCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const editor = this.editor;\n const imageUtils = editor.plugins.get('ImageUtils');\n const element = imageUtils.getClosestSelectedImageElement(editor.model.document.selection);\n this.isEnabled = !!element;\n if (!element || !element.hasAttribute('width')) {\n this.value = null;\n }\n else {\n this.value = {\n width: element.getAttribute('width'),\n height: null\n };\n }\n }\n /**\n * Executes the command.\n *\n * ```ts\n * // Sets the width to 50%:\n * editor.execute( 'resizeImage', { width: '50%' } );\n *\n * // Removes the width attribute:\n * editor.execute( 'resizeImage', { width: null } );\n * ```\n *\n * @param options\n * @param options.width The new width of the image.\n * @fires execute\n */\n execute(options) {\n const editor = this.editor;\n const model = editor.model;\n const imageUtils = editor.plugins.get('ImageUtils');\n const imageElement = imageUtils.getClosestSelectedImageElement(model.document.selection);\n this.value = {\n width: options.width,\n height: null\n };\n if (imageElement) {\n model.change(writer => {\n writer.setAttribute('width', options.width, imageElement);\n });\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport ImageUtils from '../imageutils';\nimport ResizeImageCommand from './resizeimagecommand';\n/**\n * The image resize editing feature.\n *\n * It adds the ability to resize each image using handles or manually by\n * {@link module:image/imageresize/imageresizebuttons~ImageResizeButtons} buttons.\n */\nexport default class ImageResizeEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageUtils];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageResizeEditing';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n editor.config.define('image', {\n resizeUnit: '%',\n resizeOptions: [{\n name: 'resizeImage:original',\n value: null,\n icon: 'original'\n },\n {\n name: 'resizeImage:25',\n value: '25',\n icon: 'small'\n },\n {\n name: 'resizeImage:50',\n value: '50',\n icon: 'medium'\n },\n {\n name: 'resizeImage:75',\n value: '75',\n icon: 'large'\n }]\n });\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const resizeImageCommand = new ResizeImageCommand(editor);\n this._registerSchema();\n this._registerConverters('imageBlock');\n this._registerConverters('imageInline');\n // Register `resizeImage` command and add `imageResize` command as an alias for backward compatibility.\n editor.commands.add('resizeImage', resizeImageCommand);\n editor.commands.add('imageResize', resizeImageCommand);\n }\n _registerSchema() {\n if (this.editor.plugins.has('ImageBlockEditing')) {\n this.editor.model.schema.extend('imageBlock', { allowAttributes: 'width' });\n }\n if (this.editor.plugins.has('ImageInlineEditing')) {\n this.editor.model.schema.extend('imageInline', { allowAttributes: 'width' });\n }\n }\n /**\n * Registers image resize converters.\n *\n * @param imageType The type of the image.\n */\n _registerConverters(imageType) {\n const editor = this.editor;\n // Dedicated converter to propagate image's attribute to the img tag.\n editor.conversion.for('downcast').add(dispatcher => dispatcher.on(`attribute:width:${imageType}`, (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const viewWriter = conversionApi.writer;\n const figure = conversionApi.mapper.toViewElement(data.item);\n if (data.attributeNewValue !== null) {\n viewWriter.setStyle('width', data.attributeNewValue, figure);\n viewWriter.addClass('image_resized', figure);\n }\n else {\n viewWriter.removeStyle('width', figure);\n viewWriter.removeClass('image_resized', figure);\n }\n }));\n editor.conversion.for('upcast')\n .attributeToAttribute({\n view: {\n name: imageType === 'imageBlock' ? 'figure' : 'img',\n styles: {\n width: /.+/\n }\n },\n model: {\n key: 'width',\n value: (viewElement) => viewElement.getStyle('width')\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageresize/imageresizebuttons\n */\nimport { Plugin, icons } from 'ckeditor5/src/core';\nimport { ButtonView, DropdownButtonView, Model, createDropdown, addListToDropdown } from 'ckeditor5/src/ui';\nimport { CKEditorError, Collection } from 'ckeditor5/src/utils';\nimport ImageResizeEditing from './imageresizeediting';\nconst RESIZE_ICONS = {\n small: icons.objectSizeSmall,\n medium: icons.objectSizeMedium,\n large: icons.objectSizeLarge,\n original: icons.objectSizeFull\n};\n/**\n * The image resize buttons plugin.\n *\n * It adds a possibility to resize images using the toolbar dropdown or individual buttons, depending on the plugin configuration.\n */\nexport default class ImageResizeButtons extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageResizeEditing];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageResizeButtons';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n this._resizeUnit = editor.config.get('image.resizeUnit');\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const options = editor.config.get('image.resizeOptions');\n const command = editor.commands.get('resizeImage');\n this.bind('isEnabled').to(command);\n for (const option of options) {\n this._registerImageResizeButton(option);\n }\n this._registerImageResizeDropdown(options);\n }\n /**\n * A helper function that creates a standalone button component for the plugin.\n *\n * @param resizeOption A model of the resize option.\n */\n _registerImageResizeButton(option) {\n const editor = this.editor;\n const { name, value, icon } = option;\n const optionValueWithUnit = value ? value + this._resizeUnit : null;\n editor.ui.componentFactory.add(name, locale => {\n const button = new ButtonView(locale);\n const command = editor.commands.get('resizeImage');\n const labelText = this._getOptionLabelValue(option, true);\n if (!RESIZE_ICONS[icon]) {\n /**\n * When configuring {@link module:image/imageconfig~ImageConfig#resizeOptions `config.image.resizeOptions`} for standalone\n * buttons, a valid `icon` token must be set for each option.\n *\n * See all valid options described in the\n * {@link module:image/imageconfig~ImageResizeOption plugin configuration}.\n *\n * @error imageresizebuttons-missing-icon\n * @param option Invalid image resize option.\n */\n throw new CKEditorError('imageresizebuttons-missing-icon', editor, option);\n }\n button.set({\n // Use the `label` property for a verbose description (because of ARIA).\n label: labelText,\n icon: RESIZE_ICONS[icon],\n tooltip: labelText,\n isToggleable: true\n });\n // Bind button to the command.\n button.bind('isEnabled').to(this);\n button.bind('isOn').to(command, 'value', getIsOnButtonCallback(optionValueWithUnit));\n this.listenTo(button, 'execute', () => {\n editor.execute('resizeImage', { width: optionValueWithUnit });\n });\n return button;\n });\n }\n /**\n * A helper function that creates a dropdown component for the plugin containing all the resize options defined in\n * the editor configuration.\n *\n * @param options An array of configured options.\n */\n _registerImageResizeDropdown(options) {\n const editor = this.editor;\n const t = editor.t;\n const originalSizeOption = options.find(option => !option.value);\n const componentCreator = (locale) => {\n const command = editor.commands.get('resizeImage');\n const dropdownView = createDropdown(locale, DropdownButtonView);\n const dropdownButton = dropdownView.buttonView;\n const accessibleLabel = t('Resize image');\n dropdownButton.set({\n tooltip: accessibleLabel,\n commandValue: originalSizeOption.value,\n icon: RESIZE_ICONS.medium,\n isToggleable: true,\n label: this._getOptionLabelValue(originalSizeOption),\n withText: true,\n class: 'ck-resize-image-button',\n ariaLabel: accessibleLabel,\n ariaLabelledBy: undefined\n });\n dropdownButton.bind('label').to(command, 'value', commandValue => {\n if (commandValue && commandValue.width) {\n return commandValue.width;\n }\n else {\n return this._getOptionLabelValue(originalSizeOption);\n }\n });\n dropdownView.bind('isEnabled').to(this);\n addListToDropdown(dropdownView, () => this._getResizeDropdownListItemDefinitions(options, command), {\n ariaLabel: t('Image resize list'),\n role: 'menu'\n });\n // Execute command when an item from the dropdown is selected.\n this.listenTo(dropdownView, 'execute', evt => {\n editor.execute(evt.source.commandName, { width: evt.source.commandValue });\n editor.editing.view.focus();\n });\n return dropdownView;\n };\n // Register `resizeImage` dropdown and add `imageResize` dropdown as an alias for backward compatibility.\n editor.ui.componentFactory.add('resizeImage', componentCreator);\n editor.ui.componentFactory.add('imageResize', componentCreator);\n }\n /**\n * A helper function for creating an option label value string.\n *\n * @param option A resize option object.\n * @param forTooltip An optional flag for creating a tooltip label.\n * @returns A user-defined label combined from the numeric value and the resize unit or the default label\n * for reset options (`Original`).\n */\n _getOptionLabelValue(option, forTooltip = false) {\n const t = this.editor.t;\n if (option.label) {\n return option.label;\n }\n else if (forTooltip) {\n if (option.value) {\n return t('Resize image to %0', option.value + this._resizeUnit);\n }\n else {\n return t('Resize image to the original size');\n }\n }\n else {\n if (option.value) {\n return option.value + this._resizeUnit;\n }\n else {\n return t('Original');\n }\n }\n }\n /**\n * A helper function that parses the resize options and returns list item definitions ready for use in the dropdown.\n *\n * @param options The resize options.\n * @param command The resize image command.\n * @returns Dropdown item definitions.\n */\n _getResizeDropdownListItemDefinitions(options, command) {\n const itemDefinitions = new Collection();\n options.map(option => {\n const optionValueWithUnit = option.value ? option.value + this._resizeUnit : null;\n const definition = {\n type: 'button',\n model: new Model({\n commandName: 'resizeImage',\n commandValue: optionValueWithUnit,\n label: this._getOptionLabelValue(option),\n role: 'menuitemradio',\n withText: true,\n icon: null\n })\n };\n definition.model.bind('isOn').to(command, 'value', getIsOnButtonCallback(optionValueWithUnit));\n itemDefinitions.add(definition);\n });\n return itemDefinitions;\n }\n}\n/**\n * A helper function for setting the `isOn` state of buttons in value bindings.\n */\nfunction getIsOnButtonCallback(value) {\n return (commandValue) => {\n const objectCommandValue = commandValue;\n if (value === null && objectCommandValue === value) {\n return true;\n }\n return objectCommandValue !== null && objectCommandValue.width === value;\n };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { WidgetResize } from 'ckeditor5/src/widget';\nimport ImageLoadObserver from '../image/imageloadobserver';\nconst RESIZABLE_IMAGES_CSS_SELECTOR = 'figure.image.ck-widget > img,' +\n 'figure.image.ck-widget > picture > img,' +\n 'figure.image.ck-widget > a > img,' +\n 'figure.image.ck-widget > a > picture > img,' +\n 'span.image-inline.ck-widget > img,' +\n 'span.image-inline.ck-widget > picture > img';\nconst IMAGE_WIDGETS_CLASSES_MATCH_REGEXP = /(image|image-inline)/;\nconst RESIZED_IMAGE_CLASS = 'image_resized';\n/**\n * The image resize by handles feature.\n *\n * It adds the ability to resize each image using handles or manually by\n * {@link module:image/imageresize/imageresizebuttons~ImageResizeButtons} buttons.\n */\nexport default class ImageResizeHandles extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [WidgetResize];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageResizeHandles';\n }\n /**\n * @inheritDoc\n */\n init() {\n const command = this.editor.commands.get('resizeImage');\n this.bind('isEnabled').to(command);\n this._setupResizerCreator();\n }\n /**\n * Attaches the listeners responsible for creating a resizer for each image, except for images inside the HTML embed preview.\n */\n _setupResizerCreator() {\n const editor = this.editor;\n const editingView = editor.editing.view;\n editingView.addObserver(ImageLoadObserver);\n this.listenTo(editingView.document, 'imageLoaded', (evt, domEvent) => {\n // The resizer must be attached only to images loaded by the `ImageInsert`, `ImageUpload` or `LinkImage` plugins.\n if (!domEvent.target.matches(RESIZABLE_IMAGES_CSS_SELECTOR)) {\n return;\n }\n const domConverter = editor.editing.view.domConverter;\n const imageView = domConverter.domToView(domEvent.target);\n const widgetView = imageView.findAncestor({ classes: IMAGE_WIDGETS_CLASSES_MATCH_REGEXP });\n let resizer = this.editor.plugins.get(WidgetResize).getResizerByViewElement(widgetView);\n if (resizer) {\n // There are rare cases when the image will be triggered multiple times for the same widget, e.g. when\n // the image's source was changed after upload (https://github.com/ckeditor/ckeditor5/pull/8108#issuecomment-708302992).\n resizer.redraw();\n return;\n }\n const mapper = editor.editing.mapper;\n const imageModel = mapper.toModelElement(widgetView);\n resizer = editor.plugins\n .get(WidgetResize)\n .attachTo({\n unit: editor.config.get('image.resizeUnit'),\n modelElement: imageModel,\n viewElement: widgetView,\n editor,\n getHandleHost(domWidgetElement) {\n return domWidgetElement.querySelector('img');\n },\n getResizeHost() {\n // Return the model image element parent to avoid setting an inline element (<a>/<span>) as a resize host.\n return domConverter.mapViewToDom(mapper.toViewElement(imageModel.parent));\n },\n // TODO consider other positions.\n isCentered() {\n const imageStyle = imageModel.getAttribute('imageStyle');\n return !imageStyle || imageStyle == 'block' || imageStyle == 'alignCenter';\n },\n onCommit(newValue) {\n // Get rid of the CSS class in case the command execution that follows is unsuccessful\n // (e.g. Track Changes can override it and the new dimensions will not apply). Otherwise,\n // the presence of the class and the absence of the width style will cause it to take 100%\n // of the horizontal space.\n editingView.change(writer => {\n writer.removeClass(RESIZED_IMAGE_CLASS, widgetView);\n });\n editor.execute('resizeImage', { width: newValue });\n }\n });\n resizer.on('updateSize', () => {\n if (!widgetView.hasClass(RESIZED_IMAGE_CLASS)) {\n editingView.change(writer => {\n writer.addClass(RESIZED_IMAGE_CLASS, widgetView);\n });\n }\n });\n resizer.bind('isEnabled').to(this);\n });\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imageresize.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core';\n/**\n * The image style command. It is used to apply {@link module:image/imageconfig~ImageStyleConfig#options image style option}\n * to a selected image.\n *\n * **Note**: Executing this command may change the image model element if the desired style requires an image of a different\n * type. See {@link module:image/imagestyle/imagestylecommand~ImageStyleCommand#execute} to learn more.\n */\nexport default class ImageStyleCommand extends Command {\n /**\n * Creates an instance of the image style command. When executed, the command applies one of\n * {@link module:image/imageconfig~ImageStyleConfig#options style options} to the currently selected image.\n *\n * @param editor The editor instance.\n * @param styles The style options that this command supports.\n */\n constructor(editor, styles) {\n super(editor);\n this._defaultStyles = {\n imageBlock: false,\n imageInline: false\n };\n this._styles = new Map(styles.map(style => {\n if (style.isDefault) {\n for (const modelElementName of style.modelElements) {\n this._defaultStyles[modelElementName] = style.name;\n }\n }\n return [style.name, style];\n }));\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const editor = this.editor;\n const imageUtils = editor.plugins.get('ImageUtils');\n const element = imageUtils.getClosestSelectedImageElement(this.editor.model.document.selection);\n this.isEnabled = !!element;\n if (!this.isEnabled) {\n this.value = false;\n }\n else if (element.hasAttribute('imageStyle')) {\n this.value = element.getAttribute('imageStyle');\n }\n else {\n this.value = this._defaultStyles[element.name];\n }\n }\n /**\n * Executes the command and applies the style to the currently selected image:\n *\n * ```ts\n * editor.execute( 'imageStyle', { value: 'side' } );\n * ```\n *\n * **Note**: Executing this command may change the image model element if the desired style requires an image\n * of a different type. Learn more about {@link module:image/imageconfig~ImageStyleOptionDefinition#modelElements model element}\n * configuration for the style option.\n *\n * @param options.value The name of the style (as configured in {@link module:image/imageconfig~ImageStyleConfig#options}).\n * @fires execute\n */\n execute(options = {}) {\n const editor = this.editor;\n const model = editor.model;\n const imageUtils = editor.plugins.get('ImageUtils');\n model.change(writer => {\n const requestedStyle = options.value;\n let imageElement = imageUtils.getClosestSelectedImageElement(model.document.selection);\n // Change the image type if a style requires it.\n if (requestedStyle && this.shouldConvertImageType(requestedStyle, imageElement)) {\n this.editor.execute(imageUtils.isBlockImage(imageElement) ? 'imageTypeInline' : 'imageTypeBlock');\n // Update the imageElement to the newly created image.\n imageElement = imageUtils.getClosestSelectedImageElement(model.document.selection);\n }\n // Default style means that there is no `imageStyle` attribute in the model.\n // https://github.com/ckeditor/ckeditor5-image/issues/147\n if (!requestedStyle || this._styles.get(requestedStyle).isDefault) {\n writer.removeAttribute('imageStyle', imageElement);\n }\n else {\n writer.setAttribute('imageStyle', requestedStyle, imageElement);\n }\n });\n }\n /**\n * Returns `true` if requested style change would trigger the image type change.\n *\n * @param requestedStyle The name of the style (as configured in {@link module:image/imageconfig~ImageStyleConfig#options}).\n * @param imageElement The image model element.\n */\n shouldConvertImageType(requestedStyle, imageElement) {\n const supportedTypes = this._styles.get(requestedStyle).modelElements;\n return !supportedTypes.includes(imageElement.name);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagestyle/utils\n */\nimport { icons } from 'ckeditor5/src/core';\nimport { logWarning } from 'ckeditor5/src/utils';\nconst { objectFullWidth, objectInline, objectLeft, objectRight, objectCenter, objectBlockLeft, objectBlockRight } = icons;\n/**\n * Default image style options provided by the plugin that can be referred in the {@link module:image/imageconfig~ImageConfig#styles}\n * configuration.\n *\n * There are available 5 styles focused on formatting:\n *\n * * **`'alignLeft'`** aligns the inline or block image to the left and wraps it with the text using the `image-style-align-left` class,\n * * **`'alignRight'`** aligns the inline or block image to the right and wraps it with the text using the `image-style-align-right` class,\n * * **`'alignCenter'`** centers the block image using the `image-style-align-center` class,\n * * **`'alignBlockLeft'`** aligns the block image to the left using the `image-style-block-align-left` class,\n * * **`'alignBlockRight'`** aligns the block image to the right using the `image-style-block-align-right` class,\n *\n * and 3 semantic styles:\n *\n * * **`'inline'`** is an inline image without any CSS class,\n * * **`'block'`** is a block image without any CSS class,\n * * **`'side'`** is a block image styled with the `image-style-side` CSS class.\n */\nexport const DEFAULT_OPTIONS = {\n // This style represents an image placed in the line of text.\n get inline() {\n return {\n name: 'inline',\n title: 'In line',\n icon: objectInline,\n modelElements: ['imageInline'],\n isDefault: true\n };\n },\n // This style represents an image aligned to the left and wrapped with text.\n get alignLeft() {\n return {\n name: 'alignLeft',\n title: 'Left aligned image',\n icon: objectLeft,\n modelElements: ['imageBlock', 'imageInline'],\n className: 'image-style-align-left'\n };\n },\n // This style represents an image aligned to the left.\n get alignBlockLeft() {\n return {\n name: 'alignBlockLeft',\n title: 'Left aligned image',\n icon: objectBlockLeft,\n modelElements: ['imageBlock'],\n className: 'image-style-block-align-left'\n };\n },\n // This style represents a centered image.\n get alignCenter() {\n return {\n name: 'alignCenter',\n title: 'Centered image',\n icon: objectCenter,\n modelElements: ['imageBlock'],\n className: 'image-style-align-center'\n };\n },\n // This style represents an image aligned to the right and wrapped with text.\n get alignRight() {\n return {\n name: 'alignRight',\n title: 'Right aligned image',\n icon: objectRight,\n modelElements: ['imageBlock', 'imageInline'],\n className: 'image-style-align-right'\n };\n },\n // This style represents an image aligned to the right.\n get alignBlockRight() {\n return {\n name: 'alignBlockRight',\n title: 'Right aligned image',\n icon: objectBlockRight,\n modelElements: ['imageBlock'],\n className: 'image-style-block-align-right'\n };\n },\n // This option is equal to the situation when no style is applied.\n get block() {\n return {\n name: 'block',\n title: 'Centered image',\n icon: objectCenter,\n modelElements: ['imageBlock'],\n isDefault: true\n };\n },\n // This represents a side image.\n get side() {\n return {\n name: 'side',\n title: 'Side image',\n icon: objectRight,\n modelElements: ['imageBlock'],\n className: 'image-style-side'\n };\n }\n};\n/**\n * Default image style icons provided by the plugin that can be referred in the {@link module:image/imageconfig~ImageConfig#styles}\n * configuration.\n *\n * See {@link module:image/imageconfig~ImageStyleOptionDefinition#icon} to learn more.\n *\n * There are 7 default icons available: `'full'`, `'left'`, `'inlineLeft'`, `'center'`, `'right'`, `'inlineRight'`, and `'inline'`.\n */\nexport const DEFAULT_ICONS = {\n full: objectFullWidth,\n left: objectBlockLeft,\n right: objectBlockRight,\n center: objectCenter,\n inlineLeft: objectLeft,\n inlineRight: objectRight,\n inline: objectInline\n};\n/**\n * Default drop-downs provided by the plugin that can be referred in the {@link module:image/imageconfig~ImageConfig#toolbar}\n * configuration. The drop-downs are containers for the {@link module:image/imageconfig~ImageStyleConfig#options image style options}.\n *\n * If both of the `ImageEditing` plugins are loaded, there are 2 predefined drop-downs available:\n *\n * * **`'imageStyle:wrapText'`**, which contains the `alignLeft` and `alignRight` options, that is,\n * those that wraps the text around the image,\n * * **`'imageStyle:breakText'`**, which contains the `alignBlockLeft`, `alignCenter` and `alignBlockRight` options, that is,\n * those that breaks the text around the image.\n */\nexport const DEFAULT_DROPDOWN_DEFINITIONS = [{\n name: 'imageStyle:wrapText',\n title: 'Wrap text',\n defaultItem: 'imageStyle:alignLeft',\n items: ['imageStyle:alignLeft', 'imageStyle:alignRight']\n }, {\n name: 'imageStyle:breakText',\n title: 'Break text',\n defaultItem: 'imageStyle:block',\n items: ['imageStyle:alignBlockLeft', 'imageStyle:block', 'imageStyle:alignBlockRight']\n }];\n/**\n * Returns a list of the normalized and validated image style options.\n *\n * @param config\n * @param config.isInlinePluginLoaded\n * Determines whether the {@link module:image/image/imageblockediting~ImageBlockEditing `ImageBlockEditing`} plugin has been loaded.\n * @param config.isBlockPluginLoaded\n * Determines whether the {@link module:image/image/imageinlineediting~ImageInlineEditing `ImageInlineEditing`} plugin has been loaded.\n * @param config.configuredStyles\n * The image styles configuration provided in the image styles {@link module:image/imageconfig~ImageConfig#styles configuration}\n * as a default or custom value.\n * @returns\n * * Each of options contains a complete icon markup.\n * * The image style options not supported by any of the loaded plugins are filtered out.\n */\nfunction normalizeStyles(config) {\n const configuredStyles = config.configuredStyles.options || [];\n const styles = configuredStyles\n .map(arrangement => normalizeDefinition(arrangement))\n .filter(arrangement => isValidOption(arrangement, config));\n return styles;\n}\n/**\n * Returns the default image styles configuration depending on the loaded image editing plugins.\n *\n * @param isInlinePluginLoaded\n * Determines whether the {@link module:image/image/imageblockediting~ImageBlockEditing `ImageBlockEditing`} plugin has been loaded.\n *\n * @param isBlockPluginLoaded\n * Determines whether the {@link module:image/image/imageinlineediting~ImageInlineEditing `ImageInlineEditing`} plugin has been loaded.\n *\n * @returns\n * It returns an object with the lists of the image style options and groups defined as strings related to the\n * {@link module:image/imagestyle/utils#DEFAULT_OPTIONS default options}\n */\nfunction getDefaultStylesConfiguration(isBlockPluginLoaded, isInlinePluginLoaded) {\n if (isBlockPluginLoaded && isInlinePluginLoaded) {\n return {\n options: [\n 'inline', 'alignLeft', 'alignRight',\n 'alignCenter', 'alignBlockLeft', 'alignBlockRight',\n 'block', 'side'\n ]\n };\n }\n else if (isBlockPluginLoaded) {\n return {\n options: ['block', 'side']\n };\n }\n else if (isInlinePluginLoaded) {\n return {\n options: ['inline', 'alignLeft', 'alignRight']\n };\n }\n return {};\n}\n/**\n * Returns a list of the available predefined drop-downs' definitions depending on the loaded image editing plugins.\n */\nfunction getDefaultDropdownDefinitions(pluginCollection) {\n if (pluginCollection.has('ImageBlockEditing') && pluginCollection.has('ImageInlineEditing')) {\n return [...DEFAULT_DROPDOWN_DEFINITIONS];\n }\n else {\n return [];\n }\n}\n/**\n * Normalizes an image style option or group provided in the {@link module:image/imageconfig~ImageConfig#styles}\n * and returns it in a {@link module:image/imageconfig~ImageStyleOptionDefinition}/\n */\nfunction normalizeDefinition(definition) {\n if (typeof definition === 'string') {\n // Just the name of the style has been passed, but none of the defaults.\n if (!DEFAULT_OPTIONS[definition]) {\n // Normalize the style anyway to prevent errors.\n definition = { name: definition };\n }\n // Just the name of the style has been passed and it's one of the defaults, just use it.\n // Clone the style to avoid overriding defaults.\n else {\n definition = { ...DEFAULT_OPTIONS[definition] };\n }\n }\n else {\n // If an object style has been passed and if the name matches one of the defaults,\n // extend it with defaults the user wants to customize a default style.\n // Note: Don't override the userdefined style object, clone it instead.\n definition = extendStyle(DEFAULT_OPTIONS[definition.name], definition);\n }\n // If an icon is defined as a string and correspond with a name\n // in default icons, use the default icon provided by the plugin.\n if (typeof definition.icon === 'string') {\n definition.icon = DEFAULT_ICONS[definition.icon] || definition.icon;\n }\n return definition;\n}\n/**\n * Checks if the image style option is valid:\n * * if it has the modelElements fields defined and filled,\n * * if the defined modelElements are supported by any of the loaded image editing plugins.\n * It also displays a console warning these conditions are not met.\n *\n * @param option image style option\n */\nfunction isValidOption(option, { isBlockPluginLoaded, isInlinePluginLoaded }) {\n const { modelElements, name } = option;\n if (!modelElements || !modelElements.length || !name) {\n warnInvalidStyle({ style: option });\n return false;\n }\n else {\n const supportedElements = [isBlockPluginLoaded ? 'imageBlock' : null, isInlinePluginLoaded ? 'imageInline' : null];\n // Check if the option is supported by any of the loaded plugins.\n if (!modelElements.some(elementName => supportedElements.includes(elementName))) {\n /**\n * In order to work correctly, each image style {@link module:image/imageconfig~ImageStyleOptionDefinition option}\n * requires specific model elements (also: types of images) to be supported by the editor.\n *\n * Model element names to which the image style option can be applied are defined in the\n * {@link module:image/imageconfig~ImageStyleOptionDefinition#modelElements} property of the style option\n * definition.\n *\n * Explore the warning in the console to find out precisely which option is not supported and which editor plugins\n * are missing. Make sure these plugins are loaded in your editor to get this image style option working.\n *\n * @error image-style-missing-dependency\n * @param {String} [option] The name of the unsupported option.\n * @param {String} [missingPlugins] The names of the plugins one of which has to be loaded for the particular option.\n */\n logWarning('image-style-missing-dependency', {\n style: option,\n missingPlugins: modelElements.map(name => name === 'imageBlock' ? 'ImageBlockEditing' : 'ImageInlineEditing')\n });\n return false;\n }\n }\n return true;\n}\n/**\n * Extends the default style with a style provided by the developer.\n * Note: Don't override the customdefined style object, clone it instead.\n */\nfunction extendStyle(source, style) {\n const extendedStyle = { ...style };\n for (const prop in source) {\n if (!Object.prototype.hasOwnProperty.call(style, prop)) {\n extendedStyle[prop] = source[prop];\n }\n }\n return extendedStyle;\n}\n/**\n * Displays a console warning with the 'image-style-configuration-definition-invalid' error.\n */\nfunction warnInvalidStyle(info) {\n /**\n * The image style definition provided in the configuration is invalid.\n *\n * Please make sure the definition implements properly one of the following:\n *\n * * {@link module:image/imageconfig~ImageStyleOptionDefinition image style option definition},\n * * {@link module:image/imageconfig~ImageStyleDropdownDefinition image style dropdown definition}\n *\n * @error image-style-configuration-definition-invalid\n * @param {String} [dropdown] The name of the invalid drop-down\n * @param {String} [style] The name of the invalid image style option\n */\n logWarning('image-style-configuration-definition-invalid', info);\n}\nexport default {\n normalizeStyles,\n getDefaultStylesConfiguration,\n getDefaultDropdownDefinitions,\n warnInvalidStyle,\n DEFAULT_OPTIONS,\n DEFAULT_ICONS,\n DEFAULT_DROPDOWN_DEFINITIONS\n};\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { first } from 'ckeditor5/src/utils';\n/**\n * @module image/imagestyle/converters\n */\n/**\n * Returns a converter for the `imageStyle` attribute. It can be used for adding, changing and removing the attribute.\n *\n * @param styles An array containing available image style options.\n * @returns A model-to-view attribute converter.\n */\nexport function modelToViewStyleAttribute(styles) {\n return (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n // Check if there is class name associated with given value.\n const newStyle = getStyleDefinitionByName(data.attributeNewValue, styles);\n const oldStyle = getStyleDefinitionByName(data.attributeOldValue, styles);\n const viewElement = conversionApi.mapper.toViewElement(data.item);\n const viewWriter = conversionApi.writer;\n if (oldStyle) {\n viewWriter.removeClass(oldStyle.className, viewElement);\n }\n if (newStyle) {\n viewWriter.addClass(newStyle.className, viewElement);\n }\n };\n}\n/**\n * Returns a view-to-model converter converting image CSS classes to a proper value in the model.\n *\n * @param styles Image style options for which the converter is created.\n * @returns A view-to-model converter.\n */\nexport function viewToModelStyleAttribute(styles) {\n // Convert only nondefault styles.\n const nonDefaultStyles = {\n imageInline: styles.filter(style => !style.isDefault && style.modelElements.includes('imageInline')),\n imageBlock: styles.filter(style => !style.isDefault && style.modelElements.includes('imageBlock'))\n };\n return (evt, data, conversionApi) => {\n if (!data.modelRange) {\n return;\n }\n const viewElement = data.viewItem;\n const modelImageElement = first(data.modelRange.getItems());\n // Run this converter only if an image has been found in the model.\n // In some cases it may not be found (for example if we run this on a figure with different type than image).\n if (!modelImageElement) {\n return;\n }\n // ...and the `imageStyle` attribute is allowed for that element, otherwise stop conversion early.\n if (!conversionApi.schema.checkAttribute(modelImageElement, 'imageStyle')) {\n return;\n }\n // Convert styles one by one.\n for (const style of nonDefaultStyles[modelImageElement.name]) {\n // Try to consume class corresponding with the style.\n if (conversionApi.consumable.consume(viewElement, { classes: style.className })) {\n // And convert this style to model attribute.\n conversionApi.writer.setAttribute('imageStyle', style.name, modelImageElement);\n }\n }\n };\n}\n/**\n * Returns the style with a given `name` from an array of styles.\n */\nfunction getStyleDefinitionByName(name, styles) {\n for (const style of styles) {\n if (style.name === name) {\n return style;\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagestyle/imagestyleediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport ImageStyleCommand from './imagestylecommand';\nimport ImageUtils from '../imageutils';\nimport utils from './utils';\nimport { viewToModelStyleAttribute, modelToViewStyleAttribute } from './converters';\n/**\n * The image style engine plugin. It sets the default configuration, creates converters and registers\n * {@link module:image/imagestyle/imagestylecommand~ImageStyleCommand ImageStyleCommand}.\n */\nexport default class ImageStyleEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageStyleEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageUtils];\n }\n /**\n * @inheritDoc\n */\n init() {\n const { normalizeStyles, getDefaultStylesConfiguration } = utils;\n const editor = this.editor;\n const isBlockPluginLoaded = editor.plugins.has('ImageBlockEditing');\n const isInlinePluginLoaded = editor.plugins.has('ImageInlineEditing');\n editor.config.define('image.styles', getDefaultStylesConfiguration(isBlockPluginLoaded, isInlinePluginLoaded));\n this.normalizedStyles = normalizeStyles({\n configuredStyles: editor.config.get('image.styles'),\n isBlockPluginLoaded,\n isInlinePluginLoaded\n });\n this._setupConversion(isBlockPluginLoaded, isInlinePluginLoaded);\n this._setupPostFixer();\n // Register imageStyle command.\n editor.commands.add('imageStyle', new ImageStyleCommand(editor, this.normalizedStyles));\n }\n /**\n * Sets the editor conversion taking the presence of\n * {@link module:image/image/imageinlineediting~ImageInlineEditing `ImageInlineEditing`}\n * and {@link module:image/image/imageblockediting~ImageBlockEditing `ImageBlockEditing`} plugins into consideration.\n */\n _setupConversion(isBlockPluginLoaded, isInlinePluginLoaded) {\n const editor = this.editor;\n const schema = editor.model.schema;\n const modelToViewConverter = modelToViewStyleAttribute(this.normalizedStyles);\n const viewToModelConverter = viewToModelStyleAttribute(this.normalizedStyles);\n editor.editing.downcastDispatcher.on('attribute:imageStyle', modelToViewConverter);\n editor.data.downcastDispatcher.on('attribute:imageStyle', modelToViewConverter);\n // Allow imageStyle attribute in image and imageInline.\n // We could call it 'style' but https://github.com/ckeditor/ckeditor5-engine/issues/559.\n if (isBlockPluginLoaded) {\n schema.extend('imageBlock', { allowAttributes: 'imageStyle' });\n // Converter for figure element from view to model.\n editor.data.upcastDispatcher.on('element:figure', viewToModelConverter, { priority: 'low' });\n }\n if (isInlinePluginLoaded) {\n schema.extend('imageInline', { allowAttributes: 'imageStyle' });\n // Converter for the img element from view to model.\n editor.data.upcastDispatcher.on('element:img', viewToModelConverter, { priority: 'low' });\n }\n }\n /**\n * Registers a post-fixer that will make sure that the style attribute value is correct for a specific image type (block vs inline).\n */\n _setupPostFixer() {\n const editor = this.editor;\n const document = editor.model.document;\n const imageUtils = editor.plugins.get(ImageUtils);\n const stylesMap = new Map(this.normalizedStyles.map(style => [style.name, style]));\n // Make sure that style attribute is valid for the image type.\n document.registerPostFixer(writer => {\n let changed = false;\n for (const change of document.differ.getChanges()) {\n if (change.type == 'insert' || change.type == 'attribute' && change.attributeKey == 'imageStyle') {\n let element = change.type == 'insert' ? change.position.nodeAfter : change.range.start.nodeAfter;\n if (element && element.is('element', 'paragraph') && element.childCount > 0) {\n element = element.getChild(0);\n }\n if (!imageUtils.isImage(element)) {\n continue;\n }\n const imageStyle = element.getAttribute('imageStyle');\n if (!imageStyle) {\n continue;\n }\n const imageStyleDefinition = stylesMap.get(imageStyle);\n if (!imageStyleDefinition || !imageStyleDefinition.modelElements.includes(element.name)) {\n writer.removeAttribute('imageStyle', element);\n changed = true;\n }\n }\n }\n return changed;\n });\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./imagestyle.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagestyle/imagestyleui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ButtonView, createDropdown, addToolbarToDropdown, SplitButtonView } from 'ckeditor5/src/ui';\nimport { isObject, identity } from 'lodash-es';\nimport ImageStyleEditing from './imagestyleediting';\nimport utils from './utils';\nimport '../../theme/imagestyle.css';\n/**\n * The image style UI plugin.\n *\n * It registers buttons corresponding to the {@link module:image/imageconfig~ImageConfig#styles} configuration.\n * It also registers the {@link module:image/imagestyle/utils#DEFAULT_DROPDOWN_DEFINITIONS default drop-downs} and the\n * custom drop-downs defined by the developer in the {@link module:image/imageconfig~ImageConfig#toolbar} configuration.\n */\nexport default class ImageStyleUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageStyleEditing];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageStyleUI';\n }\n /**\n * Returns the default localized style titles provided by the plugin.\n *\n * The following localized titles corresponding with\n * {@link module:image/imagestyle/utils#DEFAULT_OPTIONS} are available:\n *\n * * `'Wrap text'`,\n * * `'Break text'`,\n * * `'In line'`,\n * * `'Full size image'`,\n * * `'Side image'`,\n * * `'Left aligned image'`,\n * * `'Centered image'`,\n * * `'Right aligned image'`\n */\n get localizedDefaultStylesTitles() {\n const t = this.editor.t;\n return {\n 'Wrap text': t('Wrap text'),\n 'Break text': t('Break text'),\n 'In line': t('In line'),\n 'Full size image': t('Full size image'),\n 'Side image': t('Side image'),\n 'Left aligned image': t('Left aligned image'),\n 'Centered image': t('Centered image'),\n 'Right aligned image': t('Right aligned image')\n };\n }\n /**\n * @inheritDoc\n */\n init() {\n const plugins = this.editor.plugins;\n const toolbarConfig = this.editor.config.get('image.toolbar') || [];\n const imageStyleEditing = plugins.get('ImageStyleEditing');\n const definedStyles = translateStyles(imageStyleEditing.normalizedStyles, this.localizedDefaultStylesTitles);\n for (const styleConfig of definedStyles) {\n this._createButton(styleConfig);\n }\n const definedDropdowns = translateStyles([\n ...toolbarConfig.filter(isObject),\n ...utils.getDefaultDropdownDefinitions(plugins)\n ], this.localizedDefaultStylesTitles);\n for (const dropdownConfig of definedDropdowns) {\n this._createDropdown(dropdownConfig, definedStyles);\n }\n }\n /**\n * Creates a dropdown and stores it in the editor {@link module:ui/componentfactory~ComponentFactory}.\n */\n _createDropdown(dropdownConfig, definedStyles) {\n const factory = this.editor.ui.componentFactory;\n factory.add(dropdownConfig.name, locale => {\n let defaultButton;\n const { defaultItem, items, title } = dropdownConfig;\n const buttonViews = items\n .filter(itemName => definedStyles.find(({ name }) => getUIComponentName(name) === itemName))\n .map(buttonName => {\n const button = factory.create(buttonName);\n if (buttonName === defaultItem) {\n defaultButton = button;\n }\n return button;\n });\n if (items.length !== buttonViews.length) {\n utils.warnInvalidStyle({ dropdown: dropdownConfig });\n }\n const dropdownView = createDropdown(locale, SplitButtonView);\n const splitButtonView = dropdownView.buttonView;\n const splitButtonViewArrow = splitButtonView.arrowView;\n addToolbarToDropdown(dropdownView, buttonViews, { enableActiveItemFocusOnDropdownOpen: true });\n splitButtonView.set({\n label: getDropdownButtonTitle(title, defaultButton.label),\n class: null,\n tooltip: true\n });\n splitButtonViewArrow.unbind('label');\n splitButtonViewArrow.set({\n label: title\n });\n splitButtonView.bind('icon').toMany(buttonViews, 'isOn', (...areOn) => {\n const index = areOn.findIndex(identity);\n return (index < 0) ? defaultButton.icon : buttonViews[index].icon;\n });\n splitButtonView.bind('label').toMany(buttonViews, 'isOn', (...areOn) => {\n const index = areOn.findIndex(identity);\n return getDropdownButtonTitle(title, (index < 0) ? defaultButton.label : buttonViews[index].label);\n });\n splitButtonView.bind('isOn').toMany(buttonViews, 'isOn', (...areOn) => areOn.some(identity));\n splitButtonView.bind('class')\n .toMany(buttonViews, 'isOn', (...areOn) => areOn.some(identity) ? 'ck-splitbutton_flatten' : undefined);\n splitButtonView.on('execute', () => {\n if (!buttonViews.some(({ isOn }) => isOn)) {\n defaultButton.fire('execute');\n }\n else {\n dropdownView.isOpen = !dropdownView.isOpen;\n }\n });\n dropdownView.bind('isEnabled')\n .toMany(buttonViews, 'isEnabled', (...areEnabled) => areEnabled.some(identity));\n // Focus the editable after executing the command.\n // Overrides a default behaviour where the focus is moved to the dropdown button (#12125).\n this.listenTo(dropdownView, 'execute', () => {\n this.editor.editing.view.focus();\n });\n return dropdownView;\n });\n }\n /**\n * Creates a button and stores it in the editor {@link module:ui/componentfactory~ComponentFactory}.\n */\n _createButton(buttonConfig) {\n const buttonName = buttonConfig.name;\n this.editor.ui.componentFactory.add(getUIComponentName(buttonName), locale => {\n const command = this.editor.commands.get('imageStyle');\n const view = new ButtonView(locale);\n view.set({\n label: buttonConfig.title,\n icon: buttonConfig.icon,\n tooltip: true,\n isToggleable: true\n });\n view.bind('isEnabled').to(command, 'isEnabled');\n view.bind('isOn').to(command, 'value', value => value === buttonName);\n view.on('execute', this._executeCommand.bind(this, buttonName));\n return view;\n });\n }\n _executeCommand(name) {\n this.editor.execute('imageStyle', { value: name });\n this.editor.editing.view.focus();\n }\n}\n/**\n * Returns the translated `title` from the passed styles array.\n */\nfunction translateStyles(styles, titles) {\n for (const style of styles) {\n // Localize the titles of the styles, if a title corresponds with\n // a localized default provided by the plugin.\n if (titles[style.title]) {\n style.title = titles[style.title];\n }\n }\n return styles;\n}\n/**\n * Returns the image style component name with the \"imageStyle:\" prefix.\n */\nfunction getUIComponentName(name) {\n return `imageStyle:${name}`;\n}\n/**\n * Returns title for the splitbutton containing the dropdown title and default action item title.\n */\nfunction getDropdownButtonTitle(dropdownTitle, buttonTitle) {\n return (dropdownTitle ? dropdownTitle + ': ' : '') + buttonTitle;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module indent/indentediting\n */\nimport { Plugin, MultiCommand } from 'ckeditor5/src/core';\n/**\n * The indent editing feature.\n *\n * This plugin registers the `'indent'` and `'outdent'` commands.\n *\n * **Note**: In order for the commands to work, at least one of the compatible features is required. Read more in the\n * {@link module:indent/indent~Indent indent feature} API documentation.\n */\nexport default class IndentEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'IndentEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n editor.commands.add('indent', new MultiCommand(editor));\n editor.commands.add('outdent', new MultiCommand(editor));\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zM1.632 6.95 5.02 9.358a.4.4 0 0 1-.013.661l-3.39 2.207A.4.4 0 0 1 1 11.892V7.275a.4.4 0 0 1 .632-.326z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M2 3.75c0 .414.336.75.75.75h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 0 0-.75.75zm5 6c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM2.75 16.5h14.5a.75.75 0 1 0 0-1.5H2.75a.75.75 0 1 0 0 1.5zm1.618-9.55L.98 9.358a.4.4 0 0 0 .013.661l3.39 2.207A.4.4 0 0 0 5 11.892V7.275a.4.4 0 0 0-.632-.326z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module indent/indentui\n */\nimport { ButtonView } from 'ckeditor5/src/ui';\nimport { Plugin } from 'ckeditor5/src/core';\nimport indentIcon from '../theme/icons/indent.svg';\nimport outdentIcon from '../theme/icons/outdent.svg';\n/**\n * The indent UI feature.\n *\n * This plugin registers the `'indent'` and `'outdent'` buttons.\n *\n * **Note**: In order for the commands to work, at least one of the compatible features is required. Read more in\n * the {@link module:indent/indent~Indent indent feature} API documentation.\n */\nexport default class IndentUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'IndentUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const locale = editor.locale;\n const t = editor.t;\n const localizedIndentIcon = locale.uiLanguageDirection == 'ltr' ? indentIcon : outdentIcon;\n const localizedOutdentIcon = locale.uiLanguageDirection == 'ltr' ? outdentIcon : indentIcon;\n this._defineButton('indent', t('Increase indent'), localizedIndentIcon);\n this._defineButton('outdent', t('Decrease indent'), localizedOutdentIcon);\n }\n /**\n * Defines a UI button.\n */\n _defineButton(commandName, label, icon) {\n const editor = this.editor;\n editor.ui.componentFactory.add(commandName, locale => {\n const command = editor.commands.get(commandName);\n const view = new ButtonView(locale);\n view.set({\n label,\n icon,\n tooltip: true\n });\n view.bind('isEnabled').to(command, 'isEnabled');\n this.listenTo(view, 'execute', () => {\n editor.execute(commandName);\n editor.editing.view.focus();\n });\n return view;\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module indent/indentblockcommand\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { first } from 'ckeditor5/src/utils';\n/**\n * The indent block command.\n *\n * The command is registered by the {@link module:indent/indentblock~IndentBlock} as `'indentBlock'` for indenting blocks and\n * `'outdentBlock'` for outdenting blocks.\n *\n * To increase block indentation at the current selection, execute the command:\n *\n * ```ts\n * editor.execute( 'indentBlock' );\n * ```\n *\n * To decrease block indentation at the current selection, execute the command:\n *\n * ```ts\n * editor.execute( 'outdentBlock' );\n * ```\n */\nexport default class IndentBlockCommand extends Command {\n /**\n * Creates an instance of the command.\n */\n constructor(editor, indentBehavior) {\n super(editor);\n this._indentBehavior = indentBehavior;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n // Check whether any of the position's ancestors is a list item.\n const editor = this.editor;\n const model = editor.model;\n const block = first(model.document.selection.getSelectedBlocks());\n if (!block || !model.schema.checkAttribute(block, 'blockIndent')) {\n this.isEnabled = false;\n return;\n }\n this.isEnabled = this._indentBehavior.checkEnabled(block.getAttribute('blockIndent'));\n }\n /**\n * @inheritDoc\n */\n execute() {\n const model = this.editor.model;\n const blocksToChange = getBlocksToChange(model);\n model.change(writer => {\n for (const block of blocksToChange) {\n const currentIndent = block.getAttribute('blockIndent');\n const nextIndent = this._indentBehavior.getNextIndent(currentIndent);\n if (nextIndent) {\n writer.setAttribute('blockIndent', nextIndent, block);\n }\n else {\n writer.removeAttribute('blockIndent', block);\n }\n }\n });\n }\n}\n/**\n * Returns blocks from selection that should have blockIndent selection set.\n */\nfunction getBlocksToChange(model) {\n const selection = model.document.selection;\n const schema = model.schema;\n const blocksInSelection = Array.from(selection.getSelectedBlocks());\n return blocksInSelection.filter(block => schema.checkAttribute(block, 'blockIndent'));\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * The block indentation behavior that uses offsets to set indentation.\n */\nexport default class IndentUsingOffset {\n /**\n * Creates an instance of the indentation behavior.\n *\n * @param config.direction The direction of indentation.\n * @param config.offset The offset of the next indentation step.\n * @param config.unit Indentation unit.\n */\n constructor(config) {\n this.isForward = config.direction === 'forward';\n this.offset = config.offset;\n this.unit = config.unit;\n }\n /**\n * @inheritDoc\n */\n checkEnabled(indentAttributeValue) {\n const currentOffset = parseFloat(indentAttributeValue || '0');\n // The command is always enabled for forward indentation.\n return this.isForward || currentOffset > 0;\n }\n /**\n * @inheritDoc\n */\n getNextIndent(indentAttributeValue) {\n const currentOffset = parseFloat(indentAttributeValue || '0');\n const isSameUnit = !indentAttributeValue || indentAttributeValue.endsWith(this.unit);\n if (!isSameUnit) {\n return this.isForward ? this.offset + this.unit : undefined;\n }\n const nextOffset = this.isForward ? this.offset : -this.offset;\n const offsetToSet = currentOffset + nextOffset;\n return offsetToSet > 0 ? offsetToSet + this.unit : undefined;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * The block indentation behavior that uses classes to set indentation.\n */\nexport default class IndentUsingClasses {\n /**\n * Creates an instance of the indentation behavior.\n *\n * @param config.direction The direction of indentation.\n * @param config.classes A list of classes used for indentation.\n */\n constructor(config) {\n this.isForward = config.direction === 'forward';\n this.classes = config.classes;\n }\n /**\n * @inheritDoc\n */\n checkEnabled(indentAttributeValue) {\n const currentIndex = this.classes.indexOf(indentAttributeValue);\n if (this.isForward) {\n return currentIndex < this.classes.length - 1;\n }\n else {\n return currentIndex >= 0;\n }\n }\n /**\n * @inheritDoc\n */\n getNextIndent(indentAttributeValue) {\n const currentIndex = this.classes.indexOf(indentAttributeValue);\n const indexStep = this.isForward ? 1 : -1;\n return this.classes[currentIndex + indexStep];\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module indent/indentblock\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { addMarginRules } from 'ckeditor5/src/engine';\nimport IndentBlockCommand from './indentblockcommand';\nimport IndentUsingOffset from './indentcommandbehavior/indentusingoffset';\nimport IndentUsingClasses from './indentcommandbehavior/indentusingclasses';\nconst DEFAULT_ELEMENTS = ['paragraph', 'heading1', 'heading2', 'heading3', 'heading4', 'heading5', 'heading6'];\n/**\n * The block indentation feature.\n *\n * It registers the `'indentBlock'` and `'outdentBlock'` commands.\n *\n * If the plugin {@link module:indent/indent~Indent} is defined, it also attaches the `'indentBlock'` and `'outdentBlock'` commands to\n * the `'indent'` and `'outdent'` commands.\n */\nexport default class IndentBlock extends Plugin {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n editor.config.define('indentBlock', {\n offset: 40,\n unit: 'px'\n });\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'IndentBlock';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const configuration = editor.config.get('indentBlock');\n if (configuration.classes && configuration.classes.length) {\n this._setupConversionUsingClasses(configuration.classes);\n editor.commands.add('indentBlock', new IndentBlockCommand(editor, new IndentUsingClasses({\n direction: 'forward',\n classes: configuration.classes\n })));\n editor.commands.add('outdentBlock', new IndentBlockCommand(editor, new IndentUsingClasses({\n direction: 'backward',\n classes: configuration.classes\n })));\n }\n else {\n editor.data.addStyleProcessorRules(addMarginRules);\n this._setupConversionUsingOffset();\n editor.commands.add('indentBlock', new IndentBlockCommand(editor, new IndentUsingOffset({\n direction: 'forward',\n offset: configuration.offset,\n unit: configuration.unit\n })));\n editor.commands.add('outdentBlock', new IndentBlockCommand(editor, new IndentUsingOffset({\n direction: 'backward',\n offset: configuration.offset,\n unit: configuration.unit\n })));\n }\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n const editor = this.editor;\n const schema = editor.model.schema;\n const indentCommand = editor.commands.get('indent');\n const outdentCommand = editor.commands.get('outdent');\n // Enable block indentation to heading configuration options. If it is not defined enable in paragraph and default headings.\n const options = editor.config.get('heading.options');\n const configuredElements = options && options.map(option => option.model);\n const knownElements = configuredElements || DEFAULT_ELEMENTS;\n knownElements.forEach(elementName => {\n if (schema.isRegistered(elementName)) {\n schema.extend(elementName, { allowAttributes: 'blockIndent' });\n }\n });\n schema.setAttributeProperties('blockIndent', { isFormatting: true });\n indentCommand.registerChildCommand(editor.commands.get('indentBlock'));\n outdentCommand.registerChildCommand(editor.commands.get('outdentBlock'));\n }\n /**\n * Setups conversion for using offset indents.\n */\n _setupConversionUsingOffset() {\n const conversion = this.editor.conversion;\n const locale = this.editor.locale;\n const marginProperty = locale.contentLanguageDirection === 'rtl' ? 'margin-right' : 'margin-left';\n conversion.for('upcast').attributeToAttribute({\n view: {\n styles: {\n [marginProperty]: /[\\s\\S]+/\n }\n },\n model: {\n key: 'blockIndent',\n value: (viewElement) => viewElement.getStyle(marginProperty)\n }\n });\n conversion.for('downcast').attributeToAttribute({\n model: 'blockIndent',\n view: modelAttributeValue => {\n return {\n key: 'style',\n value: {\n [marginProperty]: modelAttributeValue\n }\n };\n }\n });\n }\n /**\n * Setups conversion for using classes.\n */\n _setupConversionUsingClasses(classes) {\n const definition = {\n model: {\n key: 'blockIndent',\n values: []\n },\n view: {}\n };\n for (const className of classes) {\n definition.model.values.push(className);\n definition.view[className] = {\n key: 'class',\n value: [className]\n };\n }\n this.editor.conversion.attributeToAttribute(definition);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/italic/italicediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport AttributeCommand from '../attributecommand';\nconst ITALIC = 'italic';\n/**\n * The italic editing feature.\n *\n * It registers the `'italic'` command, the <kbd>Ctrl+I</kbd> keystroke and introduces the `italic` attribute in the model\n * which renders to the view as an `<i>` element.\n */\nexport default class ItalicEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ItalicEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Allow italic attribute on text nodes.\n editor.model.schema.extend('$text', { allowAttributes: ITALIC });\n editor.model.schema.setAttributeProperties(ITALIC, {\n isFormatting: true,\n copyOnEnter: true\n });\n editor.conversion.attributeToElement({\n model: ITALIC,\n view: 'i',\n upcastAlso: [\n 'em',\n {\n styles: {\n 'font-style': 'italic'\n }\n }\n ]\n });\n // Create italic command.\n editor.commands.add(ITALIC, new AttributeCommand(editor, ITALIC));\n // Set the Ctrl+I keystroke.\n editor.keystrokes.set('CTRL+I', ITALIC);\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m9.586 14.633.021.004c-.036.335.095.655.393.962.082.083.173.15.274.201h1.474a.6.6 0 1 1 0 1.2H5.304a.6.6 0 0 1 0-1.2h1.15c.474-.07.809-.182 1.005-.334.157-.122.291-.32.404-.597l2.416-9.55a1.053 1.053 0 0 0-.281-.823 1.12 1.12 0 0 0-.442-.296H8.15a.6.6 0 0 1 0-1.2h6.443a.6.6 0 1 1 0 1.2h-1.195c-.376.056-.65.155-.823.296-.215.175-.423.439-.623.79l-2.366 9.347z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/italic/italicui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ButtonView } from 'ckeditor5/src/ui';\nimport italicIcon from '../../theme/icons/italic.svg';\nconst ITALIC = 'italic';\n/**\n * The italic UI feature. It introduces the Italic button.\n */\nexport default class ItalicUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ItalicUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n // Add bold button to feature components.\n editor.ui.componentFactory.add(ITALIC, locale => {\n const command = editor.commands.get(ITALIC);\n const view = new ButtonView(locale);\n view.set({\n label: t('Italic'),\n icon: italicIcon,\n keystroke: 'CTRL+I',\n tooltip: true,\n isToggleable: true\n });\n view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n // Execute command.\n this.listenTo(view, 'execute', () => {\n editor.execute(ITALIC);\n editor.editing.view.focus();\n });\n return view;\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module link/utils/automaticdecorators\n */\nimport { toMap } from 'ckeditor5/src/utils';\n/**\n * Helper class that ties together all {@link module:link/linkconfig~LinkDecoratorAutomaticDefinition} and provides\n * the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement downcast dispatchers} for them.\n */\nexport default class AutomaticDecorators {\n constructor() {\n /**\n * Stores the definition of {@link module:link/linkconfig~LinkDecoratorAutomaticDefinition automatic decorators}.\n * This data is used as a source for a downcast dispatcher to create a proper conversion to output data.\n */\n this._definitions = new Set();\n }\n /**\n * Gives information about the number of decorators stored in the {@link module:link/utils/automaticdecorators~AutomaticDecorators}\n * instance.\n */\n get length() {\n return this._definitions.size;\n }\n /**\n * Adds automatic decorator objects or an array with them to be used during downcasting.\n *\n * @param item A configuration object of automatic rules for decorating links. It might also be an array of such objects.\n */\n add(item) {\n if (Array.isArray(item)) {\n item.forEach(item => this._definitions.add(item));\n }\n else {\n this._definitions.add(item);\n }\n }\n /**\n * Provides the conversion helper used in the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add} method.\n *\n * @returns A dispatcher function used as conversion helper in {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add}.\n */\n getDispatcher() {\n return dispatcher => {\n dispatcher.on('attribute:linkHref', (evt, data, conversionApi) => {\n // There is only test as this behavior decorates links and\n // it is run before dispatcher which actually consumes this node.\n // This allows on writing own dispatcher with highest priority,\n // which blocks both native converter and this additional decoration.\n if (!conversionApi.consumable.test(data.item, 'attribute:linkHref')) {\n return;\n }\n // Automatic decorators for block links are handled e.g. in LinkImageEditing.\n if (!(data.item.is('selection') || conversionApi.schema.isInline(data.item))) {\n return;\n }\n const viewWriter = conversionApi.writer;\n const viewSelection = viewWriter.document.selection;\n for (const item of this._definitions) {\n const viewElement = viewWriter.createAttributeElement('a', item.attributes, {\n priority: 5\n });\n if (item.classes) {\n viewWriter.addClass(item.classes, viewElement);\n }\n for (const key in item.styles) {\n viewWriter.setStyle(key, item.styles[key], viewElement);\n }\n viewWriter.setCustomProperty('link', true, viewElement);\n if (item.callback(data.attributeNewValue)) {\n if (data.item.is('selection')) {\n viewWriter.wrap(viewSelection.getFirstRange(), viewElement);\n }\n else {\n viewWriter.wrap(conversionApi.mapper.toViewRange(data.range), viewElement);\n }\n }\n else {\n viewWriter.unwrap(conversionApi.mapper.toViewRange(data.range), viewElement);\n }\n }\n }, { priority: 'high' });\n };\n }\n /**\n * Provides the conversion helper used in the {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add} method\n * when linking images.\n *\n * @returns A dispatcher function used as conversion helper in {@link module:engine/conversion/downcasthelpers~DowncastHelpers#add}.\n */\n getDispatcherForLinkedImage() {\n return dispatcher => {\n dispatcher.on('attribute:linkHref:imageBlock', (evt, data, { writer, mapper }) => {\n const viewFigure = mapper.toViewElement(data.item);\n const linkInImage = Array.from(viewFigure.getChildren())\n .find((child) => child.is('element', 'a'));\n for (const item of this._definitions) {\n const attributes = toMap(item.attributes);\n if (item.callback(data.attributeNewValue)) {\n for (const [key, val] of attributes) {\n // Left for backward compatibility. Since v30 decorator should\n // accept `classes` and `styles` separately from `attributes`.\n if (key === 'class') {\n writer.addClass(val, linkInImage);\n }\n else {\n writer.setAttribute(key, val, linkInImage);\n }\n }\n if (item.classes) {\n writer.addClass(item.classes, linkInImage);\n }\n for (const key in item.styles) {\n writer.setStyle(key, item.styles[key], linkInImage);\n }\n }\n else {\n for (const [key, val] of attributes) {\n if (key === 'class') {\n writer.removeClass(val, linkInImage);\n }\n else {\n writer.removeAttribute(key, linkInImage);\n }\n }\n if (item.classes) {\n writer.removeClass(item.classes, linkInImage);\n }\n for (const key in item.styles) {\n writer.removeStyle(key, linkInImage);\n }\n }\n }\n });\n };\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module link/linkcommand\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { findAttributeRange } from 'ckeditor5/src/typing';\nimport { Collection, first, toMap } from 'ckeditor5/src/utils';\nimport AutomaticDecorators from './utils/automaticdecorators';\nimport { isLinkableElement } from './utils';\n/**\n * The link command. It is used by the {@link module:link/link~Link link feature}.\n */\nexport default class LinkCommand extends Command {\n constructor() {\n super(...arguments);\n /**\n * A collection of {@link module:link/utils/manualdecorator~ManualDecorator manual decorators}\n * corresponding to the {@link module:link/linkconfig~LinkConfig#decorators decorator configuration}.\n *\n * You can consider it a model with states of manual decorators added to the currently selected link.\n */\n this.manualDecorators = new Collection();\n /**\n * An instance of the helper that ties together all {@link module:link/linkconfig~LinkDecoratorAutomaticDefinition}\n * that are used by the {@glink features/link link} and the {@glink features/images/images-linking linking images} features.\n */\n this.automaticDecorators = new AutomaticDecorators();\n }\n /**\n * Synchronizes the state of {@link #manualDecorators} with the currently present elements in the model.\n */\n restoreManualDecoratorStates() {\n for (const manualDecorator of this.manualDecorators) {\n manualDecorator.value = this._getDecoratorStateFromModel(manualDecorator.id);\n }\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const model = this.editor.model;\n const selection = model.document.selection;\n const selectedElement = selection.getSelectedElement() || first(selection.getSelectedBlocks());\n // A check for any integration that allows linking elements (e.g. `LinkImage`).\n // Currently the selection reads attributes from text nodes only. See #7429 and #7465.\n if (isLinkableElement(selectedElement, model.schema)) {\n this.value = selectedElement.getAttribute('linkHref');\n this.isEnabled = model.schema.checkAttribute(selectedElement, 'linkHref');\n }\n else {\n this.value = selection.getAttribute('linkHref');\n this.isEnabled = model.schema.checkAttributeInSelection(selection, 'linkHref');\n }\n for (const manualDecorator of this.manualDecorators) {\n manualDecorator.value = this._getDecoratorStateFromModel(manualDecorator.id);\n }\n }\n /**\n * Executes the command.\n *\n * When the selection is non-collapsed, the `linkHref` attribute will be applied to nodes inside the selection, but only to\n * those nodes where the `linkHref` attribute is allowed (disallowed nodes will be omitted).\n *\n * When the selection is collapsed and is not inside the text with the `linkHref` attribute, a\n * new {@link module:engine/model/text~Text text node} with the `linkHref` attribute will be inserted in place of the caret, but\n * only if such element is allowed in this place. The `_data` of the inserted text will equal the `href` parameter.\n * The selection will be updated to wrap the just inserted text node.\n *\n * When the selection is collapsed and inside the text with the `linkHref` attribute, the attribute value will be updated.\n *\n * # Decorators and model attribute management\n *\n * There is an optional argument to this command that applies or removes model\n * {@glink framework/architecture/editing-engine#text-attributes text attributes} brought by\n * {@link module:link/utils/manualdecorator~ManualDecorator manual link decorators}.\n *\n * Text attribute names in the model correspond to the entries in the {@link module:link/linkconfig~LinkConfig#decorators\n * configuration}.\n * For every decorator configured, a model text attribute exists with the \"link\" prefix. For example, a `'linkMyDecorator'` attribute\n * corresponds to `'myDecorator'` in the configuration.\n *\n * To learn more about link decorators, check out the {@link module:link/linkconfig~LinkConfig#decorators `config.link.decorators`}\n * documentation.\n *\n * Here is how to manage decorator attributes with the link command:\n *\n * ```ts\n * const linkCommand = editor.commands.get( 'link' );\n *\n * // Adding a new decorator attribute.\n * linkCommand.execute( 'http://example.com', {\n * \tlinkIsExternal: true\n * } );\n *\n * // Removing a decorator attribute from the selection.\n * linkCommand.execute( 'http://example.com', {\n * \tlinkIsExternal: false\n * } );\n *\n * // Adding multiple decorator attributes at the same time.\n * linkCommand.execute( 'http://example.com', {\n * \tlinkIsExternal: true,\n * \tlinkIsDownloadable: true,\n * } );\n *\n * // Removing and adding decorator attributes at the same time.\n * linkCommand.execute( 'http://example.com', {\n * \tlinkIsExternal: false,\n * \tlinkFoo: true,\n * \tlinkIsDownloadable: false,\n * } );\n * ```\n *\n * **Note**: If the decorator attribute name is not specified, its state remains untouched.\n *\n * **Note**: {@link module:link/unlinkcommand~UnlinkCommand#execute `UnlinkCommand#execute()`} removes all\n * decorator attributes.\n *\n * @fires execute\n * @param href Link destination.\n * @param manualDecoratorIds The information about manual decorator attributes to be applied or removed upon execution.\n */\n execute(href, manualDecoratorIds = {}) {\n const model = this.editor.model;\n const selection = model.document.selection;\n // Stores information about manual decorators to turn them on/off when command is applied.\n const truthyManualDecorators = [];\n const falsyManualDecorators = [];\n for (const name in manualDecoratorIds) {\n if (manualDecoratorIds[name]) {\n truthyManualDecorators.push(name);\n }\n else {\n falsyManualDecorators.push(name);\n }\n }\n model.change(writer => {\n // If selection is collapsed then update selected link or insert new one at the place of caret.\n if (selection.isCollapsed) {\n const position = selection.getFirstPosition();\n // When selection is inside text with `linkHref` attribute.\n if (selection.hasAttribute('linkHref')) {\n const linkText = extractTextFromSelection(selection);\n // Then update `linkHref` value.\n let linkRange = findAttributeRange(position, 'linkHref', selection.getAttribute('linkHref'), model);\n if (selection.getAttribute('linkHref') === linkText) {\n linkRange = this._updateLinkContent(model, writer, linkRange, href);\n }\n writer.setAttribute('linkHref', href, linkRange);\n truthyManualDecorators.forEach(item => {\n writer.setAttribute(item, true, linkRange);\n });\n falsyManualDecorators.forEach(item => {\n writer.removeAttribute(item, linkRange);\n });\n // Put the selection at the end of the updated link.\n writer.setSelection(writer.createPositionAfter(linkRange.end.nodeBefore));\n }\n // If not then insert text node with `linkHref` attribute in place of caret.\n // However, since selection is collapsed, attribute value will be used as data for text node.\n // So, if `href` is empty, do not create text node.\n else if (href !== '') {\n const attributes = toMap(selection.getAttributes());\n attributes.set('linkHref', href);\n truthyManualDecorators.forEach(item => {\n attributes.set(item, true);\n });\n const { end: positionAfter } = model.insertContent(writer.createText(href, attributes), position);\n // Put the selection at the end of the inserted link.\n // Using end of range returned from insertContent in case nodes with the same attributes got merged.\n writer.setSelection(positionAfter);\n }\n // Remove the `linkHref` attribute and all link decorators from the selection.\n // It stops adding a new content into the link element.\n ['linkHref', ...truthyManualDecorators, ...falsyManualDecorators].forEach(item => {\n writer.removeSelectionAttribute(item);\n });\n }\n else {\n // If selection has non-collapsed ranges, we change attribute on nodes inside those ranges\n // omitting nodes where the `linkHref` attribute is disallowed.\n const ranges = model.schema.getValidRanges(selection.getRanges(), 'linkHref');\n // But for the first, check whether the `linkHref` attribute is allowed on selected blocks (e.g. the \"image\" element).\n const allowedRanges = [];\n for (const element of selection.getSelectedBlocks()) {\n if (model.schema.checkAttribute(element, 'linkHref')) {\n allowedRanges.push(writer.createRangeOn(element));\n }\n }\n // Ranges that accept the `linkHref` attribute. Since we will iterate over `allowedRanges`, let's clone it.\n const rangesToUpdate = allowedRanges.slice();\n // For all selection ranges we want to check whether given range is inside an element that accepts the `linkHref` attribute.\n // If so, we don't want to propagate applying the attribute to its children.\n for (const range of ranges) {\n if (this._isRangeToUpdate(range, allowedRanges)) {\n rangesToUpdate.push(range);\n }\n }\n for (const range of rangesToUpdate) {\n let linkRange = range;\n if (rangesToUpdate.length === 1) {\n // Current text of the link in the document.\n const linkText = extractTextFromSelection(selection);\n if (selection.getAttribute('linkHref') === linkText) {\n linkRange = this._updateLinkContent(model, writer, range, href);\n writer.setSelection(writer.createSelection(linkRange));\n }\n }\n writer.setAttribute('linkHref', href, linkRange);\n truthyManualDecorators.forEach(item => {\n writer.setAttribute(item, true, linkRange);\n });\n falsyManualDecorators.forEach(item => {\n writer.removeAttribute(item, linkRange);\n });\n }\n }\n });\n }\n /**\n * Provides information whether a decorator with a given name is present in the currently processed selection.\n *\n * @param decoratorName The name of the manual decorator used in the model\n * @returns The information whether a given decorator is currently present in the selection.\n */\n _getDecoratorStateFromModel(decoratorName) {\n const model = this.editor.model;\n const selection = model.document.selection;\n const selectedElement = selection.getSelectedElement();\n // A check for the `LinkImage` plugin. If the selection contains an element, get values from the element.\n // Currently the selection reads attributes from text nodes only. See #7429 and #7465.\n if (isLinkableElement(selectedElement, model.schema)) {\n return selectedElement.getAttribute(decoratorName);\n }\n return selection.getAttribute(decoratorName);\n }\n /**\n * Checks whether specified `range` is inside an element that accepts the `linkHref` attribute.\n *\n * @param range A range to check.\n * @param allowedRanges An array of ranges created on elements where the attribute is accepted.\n */\n _isRangeToUpdate(range, allowedRanges) {\n for (const allowedRange of allowedRanges) {\n // A range is inside an element that will have the `linkHref` attribute. Do not modify its nodes.\n if (allowedRange.containsRange(range)) {\n return false;\n }\n }\n return true;\n }\n /**\n * Updates selected link with a new value as its content and as its href attribute.\n *\n * @param model Model is need to insert content.\n * @param writer Writer is need to create text element in model.\n * @param range A range where should be inserted content.\n * @param href A link value which should be in the href attribute and in the content.\n */\n _updateLinkContent(model, writer, range, href) {\n const text = writer.createText(href, { linkHref: href });\n return model.insertContent(text, range);\n }\n}\n// Returns a text of a link under the collapsed selection or a selection that contains the entire link.\nfunction extractTextFromSelection(selection) {\n if (selection.isCollapsed) {\n const firstPosition = selection.getFirstPosition();\n return firstPosition.textNode && firstPosition.textNode.data;\n }\n else {\n const rangeItems = Array.from(selection.getFirstRange().getItems());\n if (rangeItems.length > 1) {\n return null;\n }\n const firstNode = rangeItems[0];\n if (firstNode.is('$text') || firstNode.is('$textProxy')) {\n return firstNode.data;\n }\n return null;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module link/unlinkcommand\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { findAttributeRange } from 'ckeditor5/src/typing';\nimport { isLinkableElement } from './utils';\n/**\n * The unlink command. It is used by the {@link module:link/link~Link link plugin}.\n */\nexport default class UnlinkCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const model = this.editor.model;\n const selection = model.document.selection;\n const selectedElement = selection.getSelectedElement();\n // A check for any integration that allows linking elements (e.g. `LinkImage`).\n // Currently the selection reads attributes from text nodes only. See #7429 and #7465.\n if (isLinkableElement(selectedElement, model.schema)) {\n this.isEnabled = model.schema.checkAttribute(selectedElement, 'linkHref');\n }\n else {\n this.isEnabled = model.schema.checkAttributeInSelection(selection, 'linkHref');\n }\n }\n /**\n * Executes the command.\n *\n * When the selection is collapsed, it removes the `linkHref` attribute from each node with the same `linkHref` attribute value.\n * When the selection is non-collapsed, it removes the `linkHref` attribute from each node in selected ranges.\n *\n * # Decorators\n *\n * If {@link module:link/linkconfig~LinkConfig#decorators `config.link.decorators`} is specified,\n * all configured decorators are removed together with the `linkHref` attribute.\n *\n * @fires execute\n */\n execute() {\n const editor = this.editor;\n const model = this.editor.model;\n const selection = model.document.selection;\n const linkCommand = editor.commands.get('link');\n model.change(writer => {\n // Get ranges to unlink.\n const rangesToUnlink = selection.isCollapsed ?\n [findAttributeRange(selection.getFirstPosition(), 'linkHref', selection.getAttribute('linkHref'), model)] :\n model.schema.getValidRanges(selection.getRanges(), 'linkHref');\n // Remove `linkHref` attribute from specified ranges.\n for (const range of rangesToUnlink) {\n writer.removeAttribute('linkHref', range);\n // If there are registered custom attributes, then remove them during unlink.\n if (linkCommand) {\n for (const manualDecorator of linkCommand.manualDecorators) {\n writer.removeAttribute(manualDecorator.id, range);\n }\n }\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module link/utils/manualdecorator\n */\nimport { ObservableMixin } from 'ckeditor5/src/utils';\n/**\n * Helper class that stores manual decorators with observable {@link module:link/utils/manualdecorator~ManualDecorator#value}\n * to support integration with the UI state. An instance of this class is a model with the state of individual manual decorators.\n * These decorators are kept as collections in {@link module:link/linkcommand~LinkCommand#manualDecorators}.\n */\nexport default class ManualDecorator extends ObservableMixin() {\n /**\n * Creates a new instance of {@link module:link/utils/manualdecorator~ManualDecorator}.\n *\n * @param config.id The name of the attribute used in the model that represents a given manual decorator.\n * For example: `'linkIsExternal'`.\n * @param config.label The label used in the user interface to toggle the manual decorator.\n * @param config.attributes A set of attributes added to output data when the decorator is active for a specific link.\n * Attributes should keep the format of attributes defined in {@link module:engine/view/elementdefinition~ElementDefinition}.\n * @param [config.defaultValue] Controls whether the decorator is \"on\" by default.\n */\n constructor({ id, label, attributes, classes, styles, defaultValue }) {\n super();\n this.id = id;\n this.set('value', undefined);\n this.defaultValue = defaultValue;\n this.label = label;\n this.attributes = attributes;\n this.classes = classes;\n this.styles = styles;\n }\n /**\n * Returns {@link module:engine/view/matcher~MatcherPattern} with decorator attributes.\n *\n * @internal\n */\n _createPattern() {\n return {\n attributes: this.attributes,\n classes: this.classes,\n styles: this.styles\n };\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./link.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module link/linkediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { MouseObserver } from 'ckeditor5/src/engine';\nimport { Input, TwoStepCaretMovement, inlineHighlight, findAttributeRange } from 'ckeditor5/src/typing';\nimport { ClipboardPipeline } from 'ckeditor5/src/clipboard';\nimport { keyCodes, env } from 'ckeditor5/src/utils';\nimport LinkCommand from './linkcommand';\nimport UnlinkCommand from './unlinkcommand';\nimport ManualDecorator from './utils/manualdecorator';\nimport { createLinkElement, ensureSafeUrl, getLocalizedDecorators, normalizeDecorators, openLink, addLinkProtocolIfApplicable } from './utils';\nimport '../theme/link.css';\nconst HIGHLIGHT_CLASS = 'ck-link_selected';\nconst DECORATOR_AUTOMATIC = 'automatic';\nconst DECORATOR_MANUAL = 'manual';\nconst EXTERNAL_LINKS_REGEXP = /^(https?:)?\\/\\//;\n/**\n * The link engine feature.\n *\n * It introduces the `linkHref=\"url\"` attribute in the model which renders to the view as a `<a href=\"url\">` element\n * as well as `'link'` and `'unlink'` commands.\n */\nexport default class LinkEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'LinkEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n // Clipboard is required for handling cut and paste events while typing over the link.\n return [TwoStepCaretMovement, Input, ClipboardPipeline];\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n editor.config.define('link', {\n addTargetToExternalLinks: false\n });\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Allow link attribute on all inline nodes.\n editor.model.schema.extend('$text', { allowAttributes: 'linkHref' });\n editor.conversion.for('dataDowncast')\n .attributeToElement({ model: 'linkHref', view: createLinkElement });\n editor.conversion.for('editingDowncast')\n .attributeToElement({ model: 'linkHref', view: (href, conversionApi) => {\n return createLinkElement(ensureSafeUrl(href), conversionApi);\n } });\n editor.conversion.for('upcast')\n .elementToAttribute({\n view: {\n name: 'a',\n attributes: {\n href: true\n }\n },\n model: {\n key: 'linkHref',\n value: (viewElement) => viewElement.getAttribute('href')\n }\n });\n // Create linking commands.\n editor.commands.add('link', new LinkCommand(editor));\n editor.commands.add('unlink', new UnlinkCommand(editor));\n const linkDecorators = getLocalizedDecorators(editor.t, normalizeDecorators(editor.config.get('link.decorators')));\n this._enableAutomaticDecorators(linkDecorators\n .filter((item) => item.mode === DECORATOR_AUTOMATIC));\n this._enableManualDecorators(linkDecorators\n .filter((item) => item.mode === DECORATOR_MANUAL));\n // Enable two-step caret movement for `linkHref` attribute.\n const twoStepCaretMovementPlugin = editor.plugins.get(TwoStepCaretMovement);\n twoStepCaretMovementPlugin.registerAttribute('linkHref');\n // Setup highlight over selected link.\n inlineHighlight(editor, 'linkHref', 'a', HIGHLIGHT_CLASS);\n // Handle link following by CTRL+click or ALT+ENTER\n this._enableLinkOpen();\n // Change the attributes of the selection in certain situations after the link was inserted into the document.\n this._enableInsertContentSelectionAttributesFixer();\n // Handle a click at the beginning/end of a link element.\n this._enableClickingAfterLink();\n // Handle typing over the link.\n this._enableTypingOverLink();\n // Handle removing the content after the link element.\n this._handleDeleteContentAfterLink();\n // Handle adding default protocol to pasted links.\n this._enableClipboardIntegration();\n }\n /**\n * Processes an array of configured {@link module:link/linkconfig~LinkDecoratorAutomaticDefinition automatic decorators}\n * and registers a {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher downcast dispatcher}\n * for each one of them. Downcast dispatchers are obtained using the\n * {@link module:link/utils/automaticdecorators~AutomaticDecorators#getDispatcher} method.\n *\n * **Note**: This method also activates the automatic external link decorator if enabled with\n * {@link module:link/linkconfig~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}.\n */\n _enableAutomaticDecorators(automaticDecoratorDefinitions) {\n const editor = this.editor;\n // Store automatic decorators in the command instance as we do the same with manual decorators.\n // Thanks to that, `LinkImageEditing` plugin can re-use the same definitions.\n const command = editor.commands.get('link');\n const automaticDecorators = command.automaticDecorators;\n // Adds a default decorator for external links.\n if (editor.config.get('link.addTargetToExternalLinks')) {\n automaticDecorators.add({\n id: 'linkIsExternal',\n mode: DECORATOR_AUTOMATIC,\n callback: url => !!url && EXTERNAL_LINKS_REGEXP.test(url),\n attributes: {\n target: '_blank',\n rel: 'noopener noreferrer'\n }\n });\n }\n automaticDecorators.add(automaticDecoratorDefinitions);\n if (automaticDecorators.length) {\n editor.conversion.for('downcast').add(automaticDecorators.getDispatcher());\n }\n }\n /**\n * Processes an array of configured {@link module:link/linkconfig~LinkDecoratorManualDefinition manual decorators},\n * transforms them into {@link module:link/utils/manualdecorator~ManualDecorator} instances and stores them in the\n * {@link module:link/linkcommand~LinkCommand#manualDecorators} collection (a model for manual decorators state).\n *\n * Also registers an {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement attribute-to-element}\n * converter for each manual decorator and extends the {@link module:engine/model/schema~Schema model's schema}\n * with adequate model attributes.\n */\n _enableManualDecorators(manualDecoratorDefinitions) {\n if (!manualDecoratorDefinitions.length) {\n return;\n }\n const editor = this.editor;\n const command = editor.commands.get('link');\n const manualDecorators = command.manualDecorators;\n manualDecoratorDefinitions.forEach(decoratorDefinition => {\n editor.model.schema.extend('$text', { allowAttributes: decoratorDefinition.id });\n // Keeps reference to manual decorator to decode its name to attributes during downcast.\n const decorator = new ManualDecorator(decoratorDefinition);\n manualDecorators.add(decorator);\n editor.conversion.for('downcast').attributeToElement({\n model: decorator.id,\n view: (manualDecoratorValue, { writer, schema }, { item }) => {\n // Manual decorators for block links are handled e.g. in LinkImageEditing.\n if (!(item.is('selection') || schema.isInline(item))) {\n return;\n }\n if (manualDecoratorValue) {\n const element = writer.createAttributeElement('a', decorator.attributes, { priority: 5 });\n if (decorator.classes) {\n writer.addClass(decorator.classes, element);\n }\n for (const key in decorator.styles) {\n writer.setStyle(key, decorator.styles[key], element);\n }\n writer.setCustomProperty('link', true, element);\n return element;\n }\n }\n });\n editor.conversion.for('upcast').elementToAttribute({\n view: {\n name: 'a',\n ...decorator._createPattern()\n },\n model: {\n key: decorator.id\n }\n });\n });\n }\n /**\n * Attaches handlers for {@link module:engine/view/document~Document#event:enter} and\n * {@link module:engine/view/document~Document#event:click} to enable link following.\n */\n _enableLinkOpen() {\n const editor = this.editor;\n const view = editor.editing.view;\n const viewDocument = view.document;\n this.listenTo(viewDocument, 'click', (evt, data) => {\n const shouldOpen = env.isMac ? data.domEvent.metaKey : data.domEvent.ctrlKey;\n if (!shouldOpen) {\n return;\n }\n let clickedElement = data.domTarget;\n if (clickedElement.tagName.toLowerCase() != 'a') {\n clickedElement = clickedElement.closest('a');\n }\n if (!clickedElement) {\n return;\n }\n const url = clickedElement.getAttribute('href');\n if (!url) {\n return;\n }\n evt.stop();\n data.preventDefault();\n openLink(url);\n }, { context: '$capture' });\n // Open link on Alt+Enter.\n this.listenTo(viewDocument, 'keydown', (evt, data) => {\n const linkCommand = editor.commands.get('link');\n const url = linkCommand.value;\n const shouldOpen = !!url && data.keyCode === keyCodes.enter && data.altKey;\n if (!shouldOpen) {\n return;\n }\n evt.stop();\n openLink(url);\n });\n }\n /**\n * Starts listening to {@link module:engine/model/model~Model#event:insertContent} and corrects the model\n * selection attributes if the selection is at the end of a link after inserting the content.\n *\n * The purpose of this action is to improve the overall UX because the user is no longer \"trapped\" by the\n * `linkHref` attribute of the selection and they can type a \"clean\" (`linkHref`less) text right away.\n *\n * See https://github.com/ckeditor/ckeditor5/issues/6053.\n */\n _enableInsertContentSelectionAttributesFixer() {\n const editor = this.editor;\n const model = editor.model;\n const selection = model.document.selection;\n this.listenTo(model, 'insertContent', () => {\n const nodeBefore = selection.anchor.nodeBefore;\n const nodeAfter = selection.anchor.nodeAfter;\n // NOTE: ↰ and ↱ represent the gravity of the selection.\n // The only truly valid case is:\n //\n //\t\t ↰\n //\t\t...<$text linkHref=\"foo\">INSERTED[]</$text>\n //\n // If the selection is not \"trapped\" by the `linkHref` attribute after inserting, there's nothing\n // to fix there.\n if (!selection.hasAttribute('linkHref')) {\n return;\n }\n // Filter out the following case where a link with the same href (e.g. <a href=\"foo\">INSERTED</a>) is inserted\n // in the middle of an existing link:\n //\n // Before insertion:\n //\t\t ↰\n //\t\t<$text linkHref=\"foo\">l[]ink</$text>\n //\n // Expected after insertion:\n //\t\t ↰\n //\t\t<$text linkHref=\"foo\">lINSERTED[]ink</$text>\n //\n if (!nodeBefore) {\n return;\n }\n // Filter out the following case where the selection has the \"linkHref\" attribute because the\n // gravity is overridden and some text with another attribute (e.g. <b>INSERTED</b>) is inserted:\n //\n // Before insertion:\n //\n //\t\t ↱\n //\t\t<$text linkHref=\"foo\">[]link</$text>\n //\n // Expected after insertion:\n //\n //\t\t ↱\n //\t\t<$text bold=\"true\">INSERTED</$text><$text linkHref=\"foo\">[]link</$text>\n //\n if (!nodeBefore.hasAttribute('linkHref')) {\n return;\n }\n // Filter out the following case where a link is a inserted in the middle (or before) another link\n // (different URLs, so they will not merge). In this (let's say weird) case, we can leave the selection\n // attributes as they are because the user will end up writing in one link or another anyway.\n //\n // Before insertion:\n //\n //\t\t ↰\n //\t\t<$text linkHref=\"foo\">l[]ink</$text>\n //\n // Expected after insertion:\n //\n //\t\t ↰\n //\t\t<$text linkHref=\"foo\">l</$text><$text linkHref=\"bar\">INSERTED[]</$text><$text linkHref=\"foo\">ink</$text>\n //\n if (nodeAfter && nodeAfter.hasAttribute('linkHref')) {\n return;\n }\n model.change(writer => {\n removeLinkAttributesFromSelection(writer, getLinkAttributesAllowedOnText(model.schema));\n });\n }, { priority: 'low' });\n }\n /**\n * Starts listening to {@link module:engine/view/document~Document#event:mousedown} and\n * {@link module:engine/view/document~Document#event:selectionChange} and puts the selection before/after a link node\n * if clicked at the beginning/ending of the link.\n *\n * The purpose of this action is to allow typing around the link node directly after a click.\n *\n * See https://github.com/ckeditor/ckeditor5/issues/1016.\n */\n _enableClickingAfterLink() {\n const editor = this.editor;\n const model = editor.model;\n editor.editing.view.addObserver(MouseObserver);\n let clicked = false;\n // Detect the click.\n this.listenTo(editor.editing.view.document, 'mousedown', () => {\n clicked = true;\n });\n // When the selection has changed...\n this.listenTo(editor.editing.view.document, 'selectionChange', () => {\n if (!clicked) {\n return;\n }\n // ...and it was caused by the click...\n clicked = false;\n const selection = model.document.selection;\n // ...and no text is selected...\n if (!selection.isCollapsed) {\n return;\n }\n // ...and clicked text is the link...\n if (!selection.hasAttribute('linkHref')) {\n return;\n }\n const position = selection.getFirstPosition();\n const linkRange = findAttributeRange(position, 'linkHref', selection.getAttribute('linkHref'), model);\n // ...check whether clicked start/end boundary of the link.\n // If so, remove the `linkHref` attribute.\n if (position.isTouching(linkRange.start) || position.isTouching(linkRange.end)) {\n model.change(writer => {\n removeLinkAttributesFromSelection(writer, getLinkAttributesAllowedOnText(model.schema));\n });\n }\n });\n }\n /**\n * Starts listening to {@link module:engine/model/model~Model#deleteContent} and {@link module:engine/model/model~Model#insertContent}\n * and checks whether typing over the link. If so, attributes of removed text are preserved and applied to the inserted text.\n *\n * The purpose of this action is to allow modifying a text without loosing the `linkHref` attribute (and other).\n *\n * See https://github.com/ckeditor/ckeditor5/issues/4762.\n */\n _enableTypingOverLink() {\n const editor = this.editor;\n const view = editor.editing.view;\n // Selection attributes when started typing over the link.\n let selectionAttributes = null;\n // Whether pressed `Backspace` or `Delete`. If so, attributes should not be preserved.\n let deletedContent = false;\n // Detect pressing `Backspace` / `Delete`.\n this.listenTo(view.document, 'delete', () => {\n deletedContent = true;\n }, { priority: 'high' });\n // Listening to `model#deleteContent` allows detecting whether selected content was a link.\n // If so, before removing the element, we will copy its attributes.\n this.listenTo(editor.model, 'deleteContent', () => {\n const selection = editor.model.document.selection;\n // Copy attributes only if anything is selected.\n if (selection.isCollapsed) {\n return;\n }\n // When the content was deleted, do not preserve attributes.\n if (deletedContent) {\n deletedContent = false;\n return;\n }\n // Enabled only when typing.\n if (!isTyping(editor)) {\n return;\n }\n if (shouldCopyAttributes(editor.model)) {\n selectionAttributes = selection.getAttributes();\n }\n }, { priority: 'high' });\n // Listening to `model#insertContent` allows detecting the content insertion.\n // We want to apply attributes that were removed while typing over the link.\n this.listenTo(editor.model, 'insertContent', (evt, [element]) => {\n deletedContent = false;\n // Enabled only when typing.\n if (!isTyping(editor)) {\n return;\n }\n if (!selectionAttributes) {\n return;\n }\n editor.model.change(writer => {\n for (const [attribute, value] of selectionAttributes) {\n writer.setAttribute(attribute, value, element);\n }\n });\n selectionAttributes = null;\n }, { priority: 'high' });\n }\n /**\n * Starts listening to {@link module:engine/model/model~Model#deleteContent} and checks whether\n * removing a content right after the \"linkHref\" attribute.\n *\n * If so, the selection should not preserve the `linkHref` attribute. However, if\n * the {@link module:typing/twostepcaretmovement~TwoStepCaretMovement} plugin is active and\n * the selection has the \"linkHref\" attribute due to overriden gravity (at the end), the `linkHref` attribute should stay untouched.\n *\n * The purpose of this action is to allow removing the link text and keep the selection outside the link.\n *\n * See https://github.com/ckeditor/ckeditor5/issues/7521.\n */\n _handleDeleteContentAfterLink() {\n const editor = this.editor;\n const model = editor.model;\n const selection = model.document.selection;\n const view = editor.editing.view;\n // A flag whether attributes `linkHref` attribute should be preserved.\n let shouldPreserveAttributes = false;\n // A flag whether the `Backspace` key was pressed.\n let hasBackspacePressed = false;\n // Detect pressing `Backspace`.\n this.listenTo(view.document, 'delete', (evt, data) => {\n hasBackspacePressed = data.direction === 'backward';\n }, { priority: 'high' });\n // Before removing the content, check whether the selection is inside a link or at the end of link but with 2-SCM enabled.\n // If so, we want to preserve link attributes.\n this.listenTo(model, 'deleteContent', () => {\n // Reset the state.\n shouldPreserveAttributes = false;\n const position = selection.getFirstPosition();\n const linkHref = selection.getAttribute('linkHref');\n if (!linkHref) {\n return;\n }\n const linkRange = findAttributeRange(position, 'linkHref', linkHref, model);\n // Preserve `linkHref` attribute if the selection is in the middle of the link or\n // the selection is at the end of the link and 2-SCM is activated.\n shouldPreserveAttributes = linkRange.containsPosition(position) || linkRange.end.isEqual(position);\n }, { priority: 'high' });\n // After removing the content, check whether the current selection should preserve the `linkHref` attribute.\n this.listenTo(model, 'deleteContent', () => {\n // If didn't press `Backspace`.\n if (!hasBackspacePressed) {\n return;\n }\n hasBackspacePressed = false;\n // Disable the mechanism if inside a link (`<$text url=\"foo\">F[]oo</$text>` or <$text url=\"foo\">Foo[]</$text>`).\n if (shouldPreserveAttributes) {\n return;\n }\n // Use `model.enqueueChange()` in order to execute the callback at the end of the changes process.\n editor.model.enqueueChange(writer => {\n removeLinkAttributesFromSelection(writer, getLinkAttributesAllowedOnText(model.schema));\n });\n }, { priority: 'low' });\n }\n /**\n * Enables URL fixing on pasting.\n */\n _enableClipboardIntegration() {\n const editor = this.editor;\n const model = editor.model;\n const defaultProtocol = this.editor.config.get('link.defaultProtocol');\n if (!defaultProtocol) {\n return;\n }\n this.listenTo(editor.plugins.get('ClipboardPipeline'), 'contentInsertion', (evt, data) => {\n model.change(writer => {\n const range = writer.createRangeIn(data.content);\n for (const item of range.getItems()) {\n if (item.hasAttribute('linkHref')) {\n const newLink = addLinkProtocolIfApplicable(item.getAttribute('linkHref'), defaultProtocol);\n writer.setAttribute('linkHref', newLink, item);\n }\n }\n });\n });\n }\n}\n/**\n * Make the selection free of link-related model attributes.\n * All link-related model attributes start with \"link\". That includes not only \"linkHref\"\n * but also all decorator attributes (they have dynamic names), or even custom plugins.\n */\nfunction removeLinkAttributesFromSelection(writer, linkAttributes) {\n writer.removeSelectionAttribute('linkHref');\n for (const attribute of linkAttributes) {\n writer.removeSelectionAttribute(attribute);\n }\n}\n/**\n * Checks whether selection's attributes should be copied to the new inserted text.\n */\nfunction shouldCopyAttributes(model) {\n const selection = model.document.selection;\n const firstPosition = selection.getFirstPosition();\n const lastPosition = selection.getLastPosition();\n const nodeAtFirstPosition = firstPosition.nodeAfter;\n // The text link node does not exist...\n if (!nodeAtFirstPosition) {\n return false;\n }\n // ...or it isn't the text node...\n if (!nodeAtFirstPosition.is('$text')) {\n return false;\n }\n // ...or isn't the link.\n if (!nodeAtFirstPosition.hasAttribute('linkHref')) {\n return false;\n }\n // `textNode` = the position is inside the link element.\n // `nodeBefore` = the position is at the end of the link element.\n const nodeAtLastPosition = lastPosition.textNode || lastPosition.nodeBefore;\n // If both references the same node selection contains a single text node.\n if (nodeAtFirstPosition === nodeAtLastPosition) {\n return true;\n }\n // If nodes are not equal, maybe the link nodes has defined additional attributes inside.\n // First, we need to find the entire link range.\n const linkRange = findAttributeRange(firstPosition, 'linkHref', nodeAtFirstPosition.getAttribute('linkHref'), model);\n // Then we can check whether selected range is inside the found link range. If so, attributes should be preserved.\n return linkRange.containsRange(model.createRange(firstPosition, lastPosition), true);\n}\n/**\n * Checks whether provided changes were caused by typing.\n */\nfunction isTyping(editor) {\n const currentBatch = editor.model.change(writer => writer.batch);\n return currentBatch.isTyping;\n}\n/**\n * Returns an array containing names of the attributes allowed on `$text` that describes the link item.\n */\nfunction getLinkAttributesAllowedOnText(schema) {\n const textAttributes = schema.getDefinition('$text').allowAttributes;\n return textAttributes.filter(attribute => attribute.startsWith('link'));\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./linkform.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module link/ui/linkformview\n */\nimport { ButtonView, FocusCycler, LabeledFieldView, SwitchButtonView, View, ViewCollection, createLabeledInputText, submitHandler } from 'ckeditor5/src/ui';\nimport { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils';\nimport { icons } from 'ckeditor5/src/core';\n// See: #8833.\n// eslint-disable-next-line ckeditor5-rules/ckeditor-imports\nimport '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';\nimport '../../theme/linkform.css';\n/**\n * The link form view controller class.\n *\n * See {@link module:link/ui/linkformview~LinkFormView}.\n */\nexport default class LinkFormView extends View {\n /**\n * Creates an instance of the {@link module:link/ui/linkformview~LinkFormView} class.\n *\n * Also see {@link #render}.\n *\n * @param locale The localization services instance.\n * @param linkCommand Reference to {@link module:link/linkcommand~LinkCommand}.\n */\n constructor(locale, linkCommand) {\n super(locale);\n /**\n * Tracks information about DOM focus in the form.\n */\n this.focusTracker = new FocusTracker();\n /**\n * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.\n */\n this.keystrokes = new KeystrokeHandler();\n /**\n * A collection of views that can be focused in the form.\n */\n this._focusables = new ViewCollection();\n const t = locale.t;\n this.urlInputView = this._createUrlInput();\n this.saveButtonView = this._createButton(t('Save'), icons.check, 'ck-button-save');\n this.saveButtonView.type = 'submit';\n this.cancelButtonView = this._createButton(t('Cancel'), icons.cancel, 'ck-button-cancel', 'cancel');\n this._manualDecoratorSwitches = this._createManualDecoratorSwitches(linkCommand);\n this.children = this._createFormChildren(linkCommand.manualDecorators);\n this._focusCycler = new FocusCycler({\n focusables: this._focusables,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate form fields backwards using the Shift + Tab keystroke.\n focusPrevious: 'shift + tab',\n // Navigate form fields forwards using the Tab key.\n focusNext: 'tab'\n }\n });\n const classList = ['ck', 'ck-link-form', 'ck-responsive-form'];\n if (linkCommand.manualDecorators.length) {\n classList.push('ck-link-form_layout-vertical', 'ck-vertical-form');\n }\n this.setTemplate({\n tag: 'form',\n attributes: {\n class: classList,\n // https://github.com/ckeditor/ckeditor5-link/issues/90\n tabindex: '-1'\n },\n children: this.children\n });\n }\n /**\n * Obtains the state of the {@link module:ui/button/switchbuttonview~SwitchButtonView switch buttons} representing\n * {@link module:link/linkcommand~LinkCommand#manualDecorators manual link decorators}\n * in the {@link module:link/ui/linkformview~LinkFormView}.\n *\n * @returns Key-value pairs, where the key is the name of the decorator and the value is its state.\n */\n getDecoratorSwitchesState() {\n return Array\n .from(this._manualDecoratorSwitches)\n .reduce((accumulator, switchButton) => {\n accumulator[switchButton.name] = switchButton.isOn;\n return accumulator;\n }, {});\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n submitHandler({\n view: this\n });\n const childViews = [\n this.urlInputView,\n ...this._manualDecoratorSwitches,\n this.saveButtonView,\n this.cancelButtonView\n ];\n childViews.forEach(v => {\n // Register the view as focusable.\n this._focusables.add(v);\n // Register the view in the focus tracker.\n this.focusTracker.add(v.element);\n });\n // Start listening for the keystrokes coming from #element.\n this.keystrokes.listenTo(this.element);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Focuses the fist {@link #_focusables} in the form.\n */\n focus() {\n this._focusCycler.focusFirst();\n }\n /**\n * Creates a labeled input view.\n *\n * @returns Labeled field view instance.\n */\n _createUrlInput() {\n const t = this.locale.t;\n const labeledInput = new LabeledFieldView(this.locale, createLabeledInputText);\n labeledInput.label = t('Link URL');\n return labeledInput;\n }\n /**\n * Creates a button view.\n *\n * @param label The button label.\n * @param icon The button icon.\n * @param className The additional button CSS class name.\n * @param eventName An event name that the `ButtonView#execute` event will be delegated to.\n * @returns The button view instance.\n */\n _createButton(label, icon, className, eventName) {\n const button = new ButtonView(this.locale);\n button.set({\n label,\n icon,\n tooltip: true\n });\n button.extendTemplate({\n attributes: {\n class: className\n }\n });\n if (eventName) {\n button.delegate('execute').to(this, eventName);\n }\n return button;\n }\n /**\n * Populates {@link module:ui/viewcollection~ViewCollection} of {@link module:ui/button/switchbuttonview~SwitchButtonView}\n * made based on {@link module:link/linkcommand~LinkCommand#manualDecorators}.\n *\n * @param linkCommand A reference to the link command.\n * @returns ViewCollection of switch buttons.\n */\n _createManualDecoratorSwitches(linkCommand) {\n const switches = this.createCollection();\n for (const manualDecorator of linkCommand.manualDecorators) {\n const switchButton = new SwitchButtonView(this.locale);\n switchButton.set({\n name: manualDecorator.id,\n label: manualDecorator.label,\n withText: true\n });\n switchButton.bind('isOn').toMany([manualDecorator, linkCommand], 'value', (decoratorValue, commandValue) => {\n return commandValue === undefined && decoratorValue === undefined ? !!manualDecorator.defaultValue : !!decoratorValue;\n });\n switchButton.on('execute', () => {\n manualDecorator.set('value', !switchButton.isOn);\n });\n switches.add(switchButton);\n }\n return switches;\n }\n /**\n * Populates the {@link #children} collection of the form.\n *\n * If {@link module:link/linkcommand~LinkCommand#manualDecorators manual decorators} are configured in the editor, it creates an\n * additional `View` wrapping all {@link #_manualDecoratorSwitches} switch buttons corresponding\n * to these decorators.\n *\n * @param manualDecorators A reference to\n * the collection of manual decorators stored in the link command.\n * @returns The children of link form view.\n */\n _createFormChildren(manualDecorators) {\n const children = this.createCollection();\n children.add(this.urlInputView);\n if (manualDecorators.length) {\n const additionalButtonsView = new View();\n additionalButtonsView.setTemplate({\n tag: 'ul',\n children: this._manualDecoratorSwitches.map(switchButton => ({\n tag: 'li',\n children: [switchButton],\n attributes: {\n class: [\n 'ck',\n 'ck-list__item'\n ]\n }\n })),\n attributes: {\n class: [\n 'ck',\n 'ck-reset',\n 'ck-list'\n ]\n }\n });\n children.add(additionalButtonsView);\n }\n children.add(this.saveButtonView);\n children.add(this.cancelButtonView);\n return children;\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./linkactions.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module link/ui/linkactionsview\n */\nimport { ButtonView, View, ViewCollection, FocusCycler } from 'ckeditor5/src/ui';\nimport { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils';\nimport { icons } from 'ckeditor5/src/core';\nimport { ensureSafeUrl } from '../utils';\n// See: #8833.\n// eslint-disable-next-line ckeditor5-rules/ckeditor-imports\nimport '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';\nimport '../../theme/linkactions.css';\nimport unlinkIcon from '../../theme/icons/unlink.svg';\n/**\n * The link actions view class. This view displays the link preview, allows\n * unlinking or editing the link.\n */\nexport default class LinkActionsView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n /**\n * Tracks information about DOM focus in the actions.\n */\n this.focusTracker = new FocusTracker();\n /**\n * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.\n */\n this.keystrokes = new KeystrokeHandler();\n /**\n * A collection of views that can be focused in the view.\n */\n this._focusables = new ViewCollection();\n const t = locale.t;\n this.previewButtonView = this._createPreviewButton();\n this.unlinkButtonView = this._createButton(t('Unlink'), unlinkIcon, 'unlink');\n this.editButtonView = this._createButton(t('Edit link'), icons.pencil, 'edit');\n this.set('href', undefined);\n this._focusCycler = new FocusCycler({\n focusables: this._focusables,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate fields backwards using the Shift + Tab keystroke.\n focusPrevious: 'shift + tab',\n // Navigate fields forwards using the Tab key.\n focusNext: 'tab'\n }\n });\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-link-actions',\n 'ck-responsive-form'\n ],\n // https://github.com/ckeditor/ckeditor5-link/issues/90\n tabindex: '-1'\n },\n children: [\n this.previewButtonView,\n this.editButtonView,\n this.unlinkButtonView\n ]\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n const childViews = [\n this.previewButtonView,\n this.editButtonView,\n this.unlinkButtonView\n ];\n childViews.forEach(v => {\n // Register the view as focusable.\n this._focusables.add(v);\n // Register the view in the focus tracker.\n this.focusTracker.add(v.element);\n });\n // Start listening for the keystrokes coming from #element.\n this.keystrokes.listenTo(this.element);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Focuses the fist {@link #_focusables} in the actions.\n */\n focus() {\n this._focusCycler.focusFirst();\n }\n /**\n * Creates a button view.\n *\n * @param label The button label.\n * @param icon The button icon.\n * @param eventName An event name that the `ButtonView#execute` event will be delegated to.\n * @returns The button view instance.\n */\n _createButton(label, icon, eventName) {\n const button = new ButtonView(this.locale);\n button.set({\n label,\n icon,\n tooltip: true\n });\n button.delegate('execute').to(this, eventName);\n return button;\n }\n /**\n * Creates a link href preview button.\n *\n * @returns The button view instance.\n */\n _createPreviewButton() {\n const button = new ButtonView(this.locale);\n const bind = this.bindTemplate;\n const t = this.t;\n button.set({\n withText: true,\n tooltip: t('Open link in new tab')\n });\n button.extendTemplate({\n attributes: {\n class: [\n 'ck',\n 'ck-link-actions__preview'\n ],\n href: bind.to('href', href => href && ensureSafeUrl(href)),\n target: '_blank',\n rel: 'noopener noreferrer'\n }\n });\n button.bind('label').to(this, 'href', href => {\n return href || t('This link has no URL');\n });\n button.bind('isEnabled').to(this, 'href', href => !!href);\n button.template.tag = 'a';\n button.template.eventListeners = {};\n return button;\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184zm4.919 10.562-1.414 1.414a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.061-1.06l1.414 1.414 1.414-1.415a.75.75 0 0 1 1.061 1.061l-1.414 1.414 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m11.077 15 .991-1.416a.75.75 0 1 1 1.229.86l-1.148 1.64a.748.748 0 0 1-.217.206 5.251 5.251 0 0 1-8.503-5.955.741.741 0 0 1 .12-.274l1.147-1.639a.75.75 0 1 1 1.228.86L4.933 10.7l.006.003a3.75 3.75 0 0 0 6.132 4.294l.006.004zm5.494-5.335a.748.748 0 0 1-.12.274l-1.147 1.639a.75.75 0 1 1-1.228-.86l.86-1.23a3.75 3.75 0 0 0-6.144-4.301l-.86 1.229a.75.75 0 0 1-1.229-.86l1.148-1.64a.748.748 0 0 1 .217-.206 5.251 5.251 0 0 1 8.503 5.955zm-4.563-2.532a.75.75 0 0 1 .184 1.045l-3.155 4.505a.75.75 0 1 1-1.229-.86l3.155-4.506a.75.75 0 0 1 1.045-.184z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module link/linkui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ClickObserver } from 'ckeditor5/src/engine';\nimport { ButtonView, ContextualBalloon, clickOutsideHandler, CssTransitionDisablerMixin } from 'ckeditor5/src/ui';\nimport { isWidget } from 'ckeditor5/src/widget';\nimport LinkFormView from './ui/linkformview';\nimport LinkActionsView from './ui/linkactionsview';\nimport { addLinkProtocolIfApplicable, isLinkElement, LINK_KEYSTROKE } from './utils';\nimport linkIcon from '../theme/icons/link.svg';\nconst VISUAL_SELECTION_MARKER_NAME = 'link-ui';\n/**\n * The link UI plugin. It introduces the `'link'` and `'unlink'` buttons and support for the <kbd>Ctrl+K</kbd> keystroke.\n *\n * It uses the\n * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon plugin}.\n */\nexport default class LinkUI extends Plugin {\n constructor() {\n super(...arguments);\n /**\n * The actions view displayed inside of the balloon.\n */\n this.actionsView = null;\n /**\n * The form view displayed inside the balloon.\n */\n this.formView = null;\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ContextualBalloon];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'LinkUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n editor.editing.view.addObserver(ClickObserver);\n this._balloon = editor.plugins.get(ContextualBalloon);\n // Create toolbar buttons.\n this._createToolbarLinkButton();\n this._enableBalloonActivators();\n // Renders a fake visual selection marker on an expanded selection.\n editor.conversion.for('editingDowncast').markerToHighlight({\n model: VISUAL_SELECTION_MARKER_NAME,\n view: {\n classes: ['ck-fake-link-selection']\n }\n });\n // Renders a fake visual selection marker on a collapsed selection.\n editor.conversion.for('editingDowncast').markerToElement({\n model: VISUAL_SELECTION_MARKER_NAME,\n view: {\n name: 'span',\n classes: ['ck-fake-link-selection', 'ck-fake-link-selection_collapsed']\n }\n });\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n // Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).\n if (this.formView) {\n this.formView.destroy();\n }\n if (this.actionsView) {\n this.actionsView.destroy();\n }\n }\n /**\n * Creates views.\n */\n _createViews() {\n this.actionsView = this._createActionsView();\n this.formView = this._createFormView();\n // Attach lifecycle actions to the the balloon.\n this._enableUserBalloonInteractions();\n }\n /**\n * Creates the {@link module:link/ui/linkactionsview~LinkActionsView} instance.\n */\n _createActionsView() {\n const editor = this.editor;\n const actionsView = new LinkActionsView(editor.locale);\n const linkCommand = editor.commands.get('link');\n const unlinkCommand = editor.commands.get('unlink');\n actionsView.bind('href').to(linkCommand, 'value');\n actionsView.editButtonView.bind('isEnabled').to(linkCommand);\n actionsView.unlinkButtonView.bind('isEnabled').to(unlinkCommand);\n // Execute unlink command after clicking on the \"Edit\" button.\n this.listenTo(actionsView, 'edit', () => {\n this._addFormView();\n });\n // Execute unlink command after clicking on the \"Unlink\" button.\n this.listenTo(actionsView, 'unlink', () => {\n editor.execute('unlink');\n this._hideUI();\n });\n // Close the panel on esc key press when the **actions have focus**.\n actionsView.keystrokes.set('Esc', (data, cancel) => {\n this._hideUI();\n cancel();\n });\n // Open the form view on Ctrl+K when the **actions have focus**..\n actionsView.keystrokes.set(LINK_KEYSTROKE, (data, cancel) => {\n this._addFormView();\n cancel();\n });\n return actionsView;\n }\n /**\n * Creates the {@link module:link/ui/linkformview~LinkFormView} instance.\n */\n _createFormView() {\n const editor = this.editor;\n const linkCommand = editor.commands.get('link');\n const defaultProtocol = editor.config.get('link.defaultProtocol');\n const formView = new (CssTransitionDisablerMixin(LinkFormView))(editor.locale, linkCommand);\n formView.urlInputView.fieldView.bind('value').to(linkCommand, 'value');\n // Form elements should be read-only when corresponding commands are disabled.\n formView.urlInputView.bind('isEnabled').to(linkCommand, 'isEnabled');\n formView.saveButtonView.bind('isEnabled').to(linkCommand);\n // Execute link command after clicking the \"Save\" button.\n this.listenTo(formView, 'submit', () => {\n const { value } = formView.urlInputView.fieldView.element;\n const parsedUrl = addLinkProtocolIfApplicable(value, defaultProtocol);\n editor.execute('link', parsedUrl, formView.getDecoratorSwitchesState());\n this._closeFormView();\n });\n // Hide the panel after clicking the \"Cancel\" button.\n this.listenTo(formView, 'cancel', () => {\n this._closeFormView();\n });\n // Close the panel on esc key press when the **form has focus**.\n formView.keystrokes.set('Esc', (data, cancel) => {\n this._closeFormView();\n cancel();\n });\n return formView;\n }\n /**\n * Creates a toolbar Link button. Clicking this button will show\n * a {@link #_balloon} attached to the selection.\n */\n _createToolbarLinkButton() {\n const editor = this.editor;\n const linkCommand = editor.commands.get('link');\n const t = editor.t;\n editor.ui.componentFactory.add('link', locale => {\n const button = new ButtonView(locale);\n button.isEnabled = true;\n button.label = t('Link');\n button.icon = linkIcon;\n button.keystroke = LINK_KEYSTROKE;\n button.tooltip = true;\n button.isToggleable = true;\n // Bind button to the command.\n button.bind('isEnabled').to(linkCommand, 'isEnabled');\n button.bind('isOn').to(linkCommand, 'value', value => !!value);\n // Show the panel on button click.\n this.listenTo(button, 'execute', () => this._showUI(true));\n return button;\n });\n }\n /**\n * Attaches actions that control whether the balloon panel containing the\n * {@link #formView} should be displayed.\n */\n _enableBalloonActivators() {\n const editor = this.editor;\n const viewDocument = editor.editing.view.document;\n // Handle click on view document and show panel when selection is placed inside the link element.\n // Keep panel open until selection will be inside the same link element.\n this.listenTo(viewDocument, 'click', () => {\n const parentLink = this._getSelectedLinkElement();\n if (parentLink) {\n // Then show panel but keep focus inside editor editable.\n this._showUI();\n }\n });\n // Handle the `Ctrl+K` keystroke and show the panel.\n editor.keystrokes.set(LINK_KEYSTROKE, (keyEvtData, cancel) => {\n // Prevent focusing the search bar in FF, Chrome and Edge. See https://github.com/ckeditor/ckeditor5/issues/4811.\n cancel();\n if (editor.commands.get('link').isEnabled) {\n this._showUI(true);\n }\n });\n }\n /**\n * Attaches actions that control whether the balloon panel containing the\n * {@link #formView} is visible or not.\n */\n _enableUserBalloonInteractions() {\n // Focus the form if the balloon is visible and the Tab key has been pressed.\n this.editor.keystrokes.set('Tab', (data, cancel) => {\n if (this._areActionsVisible && !this.actionsView.focusTracker.isFocused) {\n this.actionsView.focus();\n cancel();\n }\n }, {\n // Use the high priority because the link UI navigation is more important\n // than other feature's actions, e.g. list indentation.\n // https://github.com/ckeditor/ckeditor5-link/issues/146\n priority: 'high'\n });\n // Close the panel on the Esc key press when the editable has focus and the balloon is visible.\n this.editor.keystrokes.set('Esc', (data, cancel) => {\n if (this._isUIVisible) {\n this._hideUI();\n cancel();\n }\n });\n // Close on click outside of balloon panel element.\n clickOutsideHandler({\n emitter: this.formView,\n activator: () => this._isUIInPanel,\n contextElements: () => [this._balloon.view.element],\n callback: () => this._hideUI()\n });\n }\n /**\n * Adds the {@link #actionsView} to the {@link #_balloon}.\n *\n * @internal\n */\n _addActionsView() {\n if (!this.actionsView) {\n this._createViews();\n }\n if (this._areActionsInPanel) {\n return;\n }\n this._balloon.add({\n view: this.actionsView,\n position: this._getBalloonPositionData()\n });\n }\n /**\n * Adds the {@link #formView} to the {@link #_balloon}.\n */\n _addFormView() {\n if (!this.formView) {\n this._createViews();\n }\n if (this._isFormInPanel) {\n return;\n }\n const editor = this.editor;\n const linkCommand = editor.commands.get('link');\n this.formView.disableCssTransitions();\n this._balloon.add({\n view: this.formView,\n position: this._getBalloonPositionData()\n });\n // Select input when form view is currently visible.\n if (this._balloon.visibleView === this.formView) {\n this.formView.urlInputView.fieldView.select();\n }\n this.formView.enableCssTransitions();\n // Make sure that each time the panel shows up, the URL field remains in sync with the value of\n // the command. If the user typed in the input, then canceled the balloon (`urlInputView.fieldView#value` stays\n // unaltered) and re-opened it without changing the value of the link command (e.g. because they\n // clicked the same link), they would see the old value instead of the actual value of the command.\n // https://github.com/ckeditor/ckeditor5-link/issues/78\n // https://github.com/ckeditor/ckeditor5-link/issues/123\n this.formView.urlInputView.fieldView.element.value = linkCommand.value || '';\n }\n /**\n * Closes the form view. Decides whether the balloon should be hidden completely or if the action view should be shown. This is\n * decided upon the link command value (which has a value if the document selection is in the link).\n *\n * Additionally, if any {@link module:link/linkconfig~LinkConfig#decorators} are defined in the editor configuration, the state of\n * switch buttons responsible for manual decorator handling is restored.\n */\n _closeFormView() {\n const linkCommand = this.editor.commands.get('link');\n // Restore manual decorator states to represent the current model state. This case is important to reset the switch buttons\n // when the user cancels the editing form.\n linkCommand.restoreManualDecoratorStates();\n if (linkCommand.value !== undefined) {\n this._removeFormView();\n }\n else {\n this._hideUI();\n }\n }\n /**\n * Removes the {@link #formView} from the {@link #_balloon}.\n */\n _removeFormView() {\n if (this._isFormInPanel) {\n // Blur the input element before removing it from DOM to prevent issues in some browsers.\n // See https://github.com/ckeditor/ckeditor5/issues/1501.\n this.formView.saveButtonView.focus();\n this._balloon.remove(this.formView);\n // Because the form has an input which has focus, the focus must be brought back\n // to the editor. Otherwise, it would be lost.\n this.editor.editing.view.focus();\n this._hideFakeVisualSelection();\n }\n }\n /**\n * Shows the correct UI type. It is either {@link #formView} or {@link #actionsView}.\n *\n * @internal\n */\n _showUI(forceVisible = false) {\n if (!this.formView) {\n this._createViews();\n }\n // When there's no link under the selection, go straight to the editing UI.\n if (!this._getSelectedLinkElement()) {\n // Show visual selection on a text without a link when the contextual balloon is displayed.\n // See https://github.com/ckeditor/ckeditor5/issues/4721.\n this._showFakeVisualSelection();\n this._addActionsView();\n // Be sure panel with link is visible.\n if (forceVisible) {\n this._balloon.showStack('main');\n }\n this._addFormView();\n }\n // If there's a link under the selection...\n else {\n // Go to the editing UI if actions are already visible.\n if (this._areActionsVisible) {\n this._addFormView();\n }\n // Otherwise display just the actions UI.\n else {\n this._addActionsView();\n }\n // Be sure panel with link is visible.\n if (forceVisible) {\n this._balloon.showStack('main');\n }\n }\n // Begin responding to ui#update once the UI is added.\n this._startUpdatingUI();\n }\n /**\n * Removes the {@link #formView} from the {@link #_balloon}.\n *\n * See {@link #_addFormView}, {@link #_addActionsView}.\n */\n _hideUI() {\n if (!this._isUIInPanel) {\n return;\n }\n const editor = this.editor;\n this.stopListening(editor.ui, 'update');\n this.stopListening(this._balloon, 'change:visibleView');\n // Make sure the focus always gets back to the editable _before_ removing the focused form view.\n // Doing otherwise causes issues in some browsers. See https://github.com/ckeditor/ckeditor5-link/issues/193.\n editor.editing.view.focus();\n // Remove form first because it's on top of the stack.\n this._removeFormView();\n // Then remove the actions view because it's beneath the form.\n this._balloon.remove(this.actionsView);\n this._hideFakeVisualSelection();\n }\n /**\n * Makes the UI react to the {@link module:ui/editorui/editorui~EditorUI#event:update} event to\n * reposition itself when the editor UI should be refreshed.\n *\n * See: {@link #_hideUI} to learn when the UI stops reacting to the `update` event.\n */\n _startUpdatingUI() {\n const editor = this.editor;\n const viewDocument = editor.editing.view.document;\n let prevSelectedLink = this._getSelectedLinkElement();\n let prevSelectionParent = getSelectionParent();\n const update = () => {\n const selectedLink = this._getSelectedLinkElement();\n const selectionParent = getSelectionParent();\n // Hide the panel if:\n //\n // * the selection went out of the EXISTING link element. E.g. user moved the caret out\n // of the link,\n // * the selection went to a different parent when creating a NEW link. E.g. someone\n // else modified the document.\n // * the selection has expanded (e.g. displaying link actions then pressing SHIFT+Right arrow).\n //\n // Note: #_getSelectedLinkElement will return a link for a non-collapsed selection only\n // when fully selected.\n if ((prevSelectedLink && !selectedLink) ||\n (!prevSelectedLink && selectionParent !== prevSelectionParent)) {\n this._hideUI();\n }\n // Update the position of the panel when:\n // * link panel is in the visible stack\n // * the selection remains in the original link element,\n // * there was no link element in the first place, i.e. creating a new link\n else if (this._isUIVisible) {\n // If still in a link element, simply update the position of the balloon.\n // If there was no link (e.g. inserting one), the balloon must be moved\n // to the new position in the editing view (a new native DOM range).\n this._balloon.updatePosition(this._getBalloonPositionData());\n }\n prevSelectedLink = selectedLink;\n prevSelectionParent = selectionParent;\n };\n function getSelectionParent() {\n return viewDocument.selection.focus.getAncestors()\n .reverse()\n .find((node) => node.is('element'));\n }\n this.listenTo(editor.ui, 'update', update);\n this.listenTo(this._balloon, 'change:visibleView', update);\n }\n /**\n * Returns `true` when {@link #formView} is in the {@link #_balloon}.\n */\n get _isFormInPanel() {\n return !!this.formView && this._balloon.hasView(this.formView);\n }\n /**\n * Returns `true` when {@link #actionsView} is in the {@link #_balloon}.\n */\n get _areActionsInPanel() {\n return !!this.actionsView && this._balloon.hasView(this.actionsView);\n }\n /**\n * Returns `true` when {@link #actionsView} is in the {@link #_balloon} and it is\n * currently visible.\n */\n get _areActionsVisible() {\n return !!this.actionsView && this._balloon.visibleView === this.actionsView;\n }\n /**\n * Returns `true` when {@link #actionsView} or {@link #formView} is in the {@link #_balloon}.\n */\n get _isUIInPanel() {\n return this._isFormInPanel || this._areActionsInPanel;\n }\n /**\n * Returns `true` when {@link #actionsView} or {@link #formView} is in the {@link #_balloon} and it is\n * currently visible.\n */\n get _isUIVisible() {\n const visibleView = this._balloon.visibleView;\n return !!this.formView && visibleView == this.formView || this._areActionsVisible;\n }\n /**\n * Returns positioning options for the {@link #_balloon}. They control the way the balloon is attached\n * to the target element or selection.\n *\n * If the selection is collapsed and inside a link element, the panel will be attached to the\n * entire link element. Otherwise, it will be attached to the selection.\n */\n _getBalloonPositionData() {\n const view = this.editor.editing.view;\n const model = this.editor.model;\n const viewDocument = view.document;\n let target;\n if (model.markers.has(VISUAL_SELECTION_MARKER_NAME)) {\n // There are cases when we highlight selection using a marker (#7705, #4721).\n const markerViewElements = Array.from(this.editor.editing.mapper.markerNameToElements(VISUAL_SELECTION_MARKER_NAME));\n const newRange = view.createRange(view.createPositionBefore(markerViewElements[0]), view.createPositionAfter(markerViewElements[markerViewElements.length - 1]));\n target = view.domConverter.viewRangeToDom(newRange);\n }\n else {\n // Make sure the target is calculated on demand at the last moment because a cached DOM range\n // (which is very fragile) can desynchronize with the state of the editing view if there was\n // any rendering done in the meantime. This can happen, for instance, when an inline widget\n // gets unlinked.\n target = () => {\n const targetLink = this._getSelectedLinkElement();\n return targetLink ?\n // When selection is inside link element, then attach panel to this element.\n view.domConverter.mapViewToDom(targetLink) :\n // Otherwise attach panel to the selection.\n view.domConverter.viewRangeToDom(viewDocument.selection.getFirstRange());\n };\n }\n return { target };\n }\n /**\n * Returns the link {@link module:engine/view/attributeelement~AttributeElement} under\n * the {@link module:engine/view/document~Document editing view's} selection or `null`\n * if there is none.\n *\n * **Note**: For a noncollapsed selection, the link element is returned when **fully**\n * selected and the **only** element within the selection boundaries, or when\n * a linked widget is selected.\n */\n _getSelectedLinkElement() {\n const view = this.editor.editing.view;\n const selection = view.document.selection;\n const selectedElement = selection.getSelectedElement();\n // The selection is collapsed or some widget is selected (especially inline widget).\n if (selection.isCollapsed || selectedElement && isWidget(selectedElement)) {\n return findLinkElementAncestor(selection.getFirstPosition());\n }\n else {\n // The range for fully selected link is usually anchored in adjacent text nodes.\n // Trim it to get closer to the actual link element.\n const range = selection.getFirstRange().getTrimmed();\n const startLink = findLinkElementAncestor(range.start);\n const endLink = findLinkElementAncestor(range.end);\n if (!startLink || startLink != endLink) {\n return null;\n }\n // Check if the link element is fully selected.\n if (view.createRangeIn(startLink).getTrimmed().isEqual(range)) {\n return startLink;\n }\n else {\n return null;\n }\n }\n }\n /**\n * Displays a fake visual selection when the contextual balloon is displayed.\n *\n * This adds a 'link-ui' marker into the document that is rendered as a highlight on selected text fragment.\n */\n _showFakeVisualSelection() {\n const model = this.editor.model;\n model.change(writer => {\n const range = model.document.selection.getFirstRange();\n if (model.markers.has(VISUAL_SELECTION_MARKER_NAME)) {\n writer.updateMarker(VISUAL_SELECTION_MARKER_NAME, { range });\n }\n else {\n if (range.start.isAtEnd) {\n const startPosition = range.start.getLastMatchingPosition(({ item }) => !model.schema.isContent(item), { boundaries: range });\n writer.addMarker(VISUAL_SELECTION_MARKER_NAME, {\n usingOperation: false,\n affectsData: false,\n range: writer.createRange(startPosition, range.end)\n });\n }\n else {\n writer.addMarker(VISUAL_SELECTION_MARKER_NAME, {\n usingOperation: false,\n affectsData: false,\n range\n });\n }\n }\n });\n }\n /**\n * Hides the fake visual selection created in {@link #_showFakeVisualSelection}.\n */\n _hideFakeVisualSelection() {\n const model = this.editor.model;\n if (model.markers.has(VISUAL_SELECTION_MARKER_NAME)) {\n model.change(writer => {\n writer.removeMarker(VISUAL_SELECTION_MARKER_NAME);\n });\n }\n }\n}\n/**\n * Returns a link element if there's one among the ancestors of the provided `Position`.\n *\n * @param View position to analyze.\n * @returns Link element at the position or null.\n */\nfunction findLinkElementAncestor(position) {\n return position.getAncestors().find((ancestor) => isLinkElement(ancestor)) || null;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module link/linkimageediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Matcher } from 'ckeditor5/src/engine';\nimport { toMap } from 'ckeditor5/src/utils';\nimport LinkEditing from './linkediting';\n/**\n * The link image engine feature.\n *\n * It accepts the `linkHref=\"url\"` attribute in the model for the {@link module:image/image~Image `<imageBlock>`} element\n * which allows linking images.\n */\nexport default class LinkImageEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return ['ImageEditing', 'ImageUtils', LinkEditing];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'LinkImageEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n if (editor.plugins.has('ImageBlockEditing')) {\n schema.extend('imageBlock', { allowAttributes: ['linkHref'] });\n }\n editor.conversion.for('upcast').add(upcastLink(editor));\n editor.conversion.for('downcast').add(downcastImageLink(editor));\n // Definitions for decorators are provided by the `link` command and the `LinkEditing` plugin.\n this._enableAutomaticDecorators();\n this._enableManualDecorators();\n }\n /**\n * Processes {@link module:link/linkconfig~LinkDecoratorAutomaticDefinition automatic decorators} definitions and\n * attaches proper converters that will work when linking an image.`\n */\n _enableAutomaticDecorators() {\n const editor = this.editor;\n const command = editor.commands.get('link');\n const automaticDecorators = command.automaticDecorators;\n if (automaticDecorators.length) {\n editor.conversion.for('downcast').add(automaticDecorators.getDispatcherForLinkedImage());\n }\n }\n /**\n * Processes transformed {@link module:link/utils/manualdecorator~ManualDecorator} instances and attaches proper converters\n * that will work when linking an image.\n */\n _enableManualDecorators() {\n const editor = this.editor;\n const command = editor.commands.get('link');\n for (const decorator of command.manualDecorators) {\n if (editor.plugins.has('ImageBlockEditing')) {\n editor.model.schema.extend('imageBlock', { allowAttributes: decorator.id });\n }\n if (editor.plugins.has('ImageInlineEditing')) {\n editor.model.schema.extend('imageInline', { allowAttributes: decorator.id });\n }\n editor.conversion.for('downcast').add(downcastImageLinkManualDecorator(decorator));\n editor.conversion.for('upcast').add(upcastImageLinkManualDecorator(editor, decorator));\n }\n }\n}\n/**\n * Returns a converter for linked block images that consumes the \"href\" attribute\n * if a link contains an image.\n *\n * @param editor The editor instance.\n */\nfunction upcastLink(editor) {\n const isImageInlinePluginLoaded = editor.plugins.has('ImageInlineEditing');\n const imageUtils = editor.plugins.get('ImageUtils');\n return dispatcher => {\n dispatcher.on('element:a', (evt, data, conversionApi) => {\n const viewLink = data.viewItem;\n const imageInLink = imageUtils.findViewImgElement(viewLink);\n if (!imageInLink) {\n return;\n }\n const blockImageView = imageInLink.findAncestor(element => imageUtils.isBlockImageView(element));\n // There are four possible cases to consider here\n //\n // 1. A \"root > ... > figure.image > a > img\" structure.\n // 2. A \"root > ... > figure.image > a > picture > img\" structure.\n // 3. A \"root > ... > block > a > img\" structure.\n // 4. A \"root > ... > block > a > picture > img\" structure.\n //\n // but the last 2 cases should only be considered by this converter when the inline image plugin\n // is NOT loaded in the editor (because otherwise, that would be a plain, linked inline image).\n if (isImageInlinePluginLoaded && !blockImageView) {\n return;\n }\n // There's an image inside an <a> element - we consume it so it won't be picked up by the Link plugin.\n const consumableAttributes = { attributes: ['href'] };\n // Consume the `href` attribute so the default one will not convert it to $text attribute.\n if (!conversionApi.consumable.consume(viewLink, consumableAttributes)) {\n // Might be consumed by something else - i.e. other converter with priority=highest - a standard check.\n return;\n }\n const linkHref = viewLink.getAttribute('href');\n // Missing the 'href' attribute.\n if (!linkHref) {\n return;\n }\n // A full definition of the image feature.\n // figure > a > img: parent of the view link element is an image element (figure).\n let modelElement = data.modelCursor.parent;\n if (!modelElement.is('element', 'imageBlock')) {\n // a > img: parent of the view link is not the image (figure) element. We need to convert it manually.\n const conversionResult = conversionApi.convertItem(imageInLink, data.modelCursor);\n // Set image range as conversion result.\n data.modelRange = conversionResult.modelRange;\n // Continue conversion where image conversion ends.\n data.modelCursor = conversionResult.modelCursor;\n modelElement = data.modelCursor.nodeBefore;\n }\n if (modelElement && modelElement.is('element', 'imageBlock')) {\n // Set the linkHref attribute from link element on model image element.\n conversionApi.writer.setAttribute('linkHref', linkHref, modelElement);\n }\n }, { priority: 'high' });\n // Using the same priority that `upcastImageLinkManualDecorator()` converter guarantees\n // that manual decorators will decorate the proper element.\n };\n}\n/**\n * Creates a converter that adds `<a>` to linked block image view elements.\n */\nfunction downcastImageLink(editor) {\n const imageUtils = editor.plugins.get('ImageUtils');\n return dispatcher => {\n dispatcher.on('attribute:linkHref:imageBlock', (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n // The image will be already converted - so it will be present in the view.\n const viewFigure = conversionApi.mapper.toViewElement(data.item);\n const writer = conversionApi.writer;\n // But we need to check whether the link element exists.\n const linkInImage = Array.from(viewFigure.getChildren())\n .find((child) => child.is('element', 'a'));\n const viewImage = imageUtils.findViewImgElement(viewFigure);\n // <picture>...<img/></picture> or <img/>\n const viewImgOrPicture = viewImage.parent.is('element', 'picture') ? viewImage.parent : viewImage;\n // If so, update the attribute if it's defined or remove the entire link if the attribute is empty.\n if (linkInImage) {\n if (data.attributeNewValue) {\n writer.setAttribute('href', data.attributeNewValue, linkInImage);\n }\n else {\n writer.move(writer.createRangeOn(viewImgOrPicture), writer.createPositionAt(viewFigure, 0));\n writer.remove(linkInImage);\n }\n }\n else {\n // But if it does not exist. Let's wrap already converted image by newly created link element.\n // 1. Create an empty link element.\n const linkElement = writer.createContainerElement('a', { href: data.attributeNewValue });\n // 2. Insert link inside the associated image.\n writer.insert(writer.createPositionAt(viewFigure, 0), linkElement);\n // 3. Move the image to the link.\n writer.move(writer.createRangeOn(viewImgOrPicture), writer.createPositionAt(linkElement, 0));\n }\n }, { priority: 'high' });\n };\n}\n/**\n * Returns a converter that decorates the `<a>` element when the image is the link label.\n */\nfunction downcastImageLinkManualDecorator(decorator) {\n return dispatcher => {\n dispatcher.on(`attribute:${decorator.id}:imageBlock`, (evt, data, conversionApi) => {\n const viewFigure = conversionApi.mapper.toViewElement(data.item);\n const linkInImage = Array.from(viewFigure.getChildren())\n .find((child) => child.is('element', 'a'));\n // The <a> element was removed by the time this converter is executed.\n // It may happen when the base `linkHref` and decorator attributes are removed\n // at the same time (see #8401).\n if (!linkInImage) {\n return;\n }\n for (const [key, val] of toMap(decorator.attributes)) {\n conversionApi.writer.setAttribute(key, val, linkInImage);\n }\n if (decorator.classes) {\n conversionApi.writer.addClass(decorator.classes, linkInImage);\n }\n for (const key in decorator.styles) {\n conversionApi.writer.setStyle(key, decorator.styles[key], linkInImage);\n }\n });\n };\n}\n/**\n * Returns a converter that checks whether manual decorators should be applied to the link.\n */\nfunction upcastImageLinkManualDecorator(editor, decorator) {\n const isImageInlinePluginLoaded = editor.plugins.has('ImageInlineEditing');\n const imageUtils = editor.plugins.get('ImageUtils');\n return dispatcher => {\n dispatcher.on('element:a', (evt, data, conversionApi) => {\n const viewLink = data.viewItem;\n const imageInLink = imageUtils.findViewImgElement(viewLink);\n // We need to check whether an image is inside a link because the converter handles\n // only manual decorators for linked images. See #7975.\n if (!imageInLink) {\n return;\n }\n const blockImageView = imageInLink.findAncestor(element => imageUtils.isBlockImageView(element));\n if (isImageInlinePluginLoaded && !blockImageView) {\n return;\n }\n const matcher = new Matcher(decorator._createPattern());\n const result = matcher.match(viewLink);\n // The link element does not have required attributes or/and proper values.\n if (!result) {\n return;\n }\n // Check whether we can consume those attributes.\n if (!conversionApi.consumable.consume(viewLink, result.match)) {\n return;\n }\n // At this stage we can assume that we have the `<imageBlock>` element.\n // `nodeBefore` comes after conversion: `<a><img></a>`.\n // `parent` comes with full image definition: `<figure><a><img></a></figure>.\n // See the body of the `upcastLink()` function.\n const modelElement = data.modelCursor.nodeBefore || data.modelCursor.parent;\n conversionApi.writer.setAttribute(decorator.id, true, modelElement);\n }, { priority: 'high' });\n // Using the same priority that `upcastLink()` converter guarantees that the linked image was properly converted.\n };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module link/linkimageui\n */\nimport { ButtonView } from 'ckeditor5/src/ui';\nimport { Plugin } from 'ckeditor5/src/core';\nimport LinkUI from './linkui';\nimport LinkEditing from './linkediting';\nimport { LINK_KEYSTROKE } from './utils';\nimport linkIcon from '../theme/icons/link.svg';\n/**\n * The link image UI plugin.\n *\n * This plugin provides the `'linkImage'` button that can be displayed in the {@link module:image/imagetoolbar~ImageToolbar}.\n * It can be used to wrap images in links.\n */\nexport default class LinkImageUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [LinkEditing, LinkUI, 'ImageBlockEditing'];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'LinkImageUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const viewDocument = editor.editing.view.document;\n this.listenTo(viewDocument, 'click', (evt, data) => {\n if (this._isSelectedLinkedImage(editor.model.document.selection)) {\n // Prevent browser navigation when clicking a linked image.\n data.preventDefault();\n // Block the `LinkUI` plugin when an image was clicked.\n // In such a case, we'd like to display the image toolbar.\n evt.stop();\n }\n }, { priority: 'high' });\n this._createToolbarLinkImageButton();\n }\n /**\n * Creates a `LinkImageUI` button view.\n *\n * Clicking this button shows a {@link module:link/linkui~LinkUI#_balloon} attached to the selection.\n * When an image is already linked, the view shows {@link module:link/linkui~LinkUI#actionsView} or\n * {@link module:link/linkui~LinkUI#formView} if it is not.\n */\n _createToolbarLinkImageButton() {\n const editor = this.editor;\n const t = editor.t;\n editor.ui.componentFactory.add('linkImage', locale => {\n const button = new ButtonView(locale);\n const plugin = editor.plugins.get('LinkUI');\n const linkCommand = editor.commands.get('link');\n button.set({\n isEnabled: true,\n label: t('Link image'),\n icon: linkIcon,\n keystroke: LINK_KEYSTROKE,\n tooltip: true,\n isToggleable: true\n });\n // Bind button to the command.\n button.bind('isEnabled').to(linkCommand, 'isEnabled');\n button.bind('isOn').to(linkCommand, 'value', value => !!value);\n // Show the actionsView or formView (both from LinkUI) on button click depending on whether the image is linked already.\n this.listenTo(button, 'execute', () => {\n if (this._isSelectedLinkedImage(editor.model.document.selection)) {\n plugin._addActionsView();\n }\n else {\n plugin._showUI(true);\n }\n });\n return button;\n });\n }\n /**\n * Returns true if a linked image (either block or inline) is the only selected element\n * in the model document.\n */\n _isSelectedLinkedImage(selection) {\n const selectedModelElement = selection.getSelectedElement();\n const imageUtils = this.editor.plugins.get('ImageUtils');\n return imageUtils.isImage(selectedModelElement) && selectedModelElement.hasAttribute('linkHref');\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./linkimage.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { first } from 'ckeditor5/src/utils';\n/**\n * The list command. It is used by the {@link module:list/list~List list feature}.\n */\nexport default class ListCommand extends Command {\n /**\n * Creates an instance of the command.\n *\n * @param editor The editor instance.\n * @param type List type that will be handled by this command.\n */\n constructor(editor, type) {\n super(editor);\n this.type = type;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n this.value = this._getValue();\n this.isEnabled = this._checkEnabled();\n }\n /**\n * Executes the list command.\n *\n * @fires execute\n * @param options Command options.\n * @param options.forceValue If set, it will force the command behavior. If `true`, the command will try to convert the\n * selected items and potentially the neighbor elements to the proper list items. If set to `false`, it will convert selected elements\n * to paragraphs. If not set, the command will toggle selected elements to list items or paragraphs, depending on the selection.\n */\n execute(options = {}) {\n const model = this.editor.model;\n const document = model.document;\n const blocks = Array.from(document.selection.getSelectedBlocks())\n .filter(block => checkCanBecomeListItem(block, model.schema));\n // Whether we are turning off some items.\n const turnOff = options.forceValue !== undefined ? !options.forceValue : this.value;\n // If we are turning off items, we are going to rename them to paragraphs.\n model.change(writer => {\n // If part of a list got turned off, we need to handle (outdent) all of sub-items of the last turned-off item.\n // To be sure that model is all the time in a good state, we first fix items below turned-off item.\n if (turnOff) {\n // Start from the model item that is just after the last turned-off item.\n let next = blocks[blocks.length - 1].nextSibling;\n let currentIndent = Number.POSITIVE_INFINITY;\n let changes = [];\n // Correct indent of all items after the last turned off item.\n // Rules that should be followed:\n // 1. All direct sub-items of turned-off item should become indent 0, because the first item after it\n // will be the first item of a new list. Other items are at the same level, so should have same 0 index.\n // 2. All items with indent lower than indent of turned-off item should become indent 0, because they\n // should not end up as a child of any of list items that they were not children of before.\n // 3. All other items should have their indent changed relatively to it's parent.\n //\n // For example:\n // 1 * --------\n // 2 * --------\n // 3 * --------\t\t\t<-- this is turned off.\n // 4 * --------\t\t<-- this has to become indent = 0, because it will be first item on a new list.\n // 5 * --------\t<-- this should be still be a child of item above, so indent = 1.\n // 6 * --------\t\t\t<-- this has to become indent = 0, because it should not be a child of any of items above.\n // 7 * --------\t\t<-- this should be still be a child of item above, so indent = 1.\n // 8 * --------\t\t\t\t<-- this has to become indent = 0.\n // 9 * --------\t\t\t<-- this should still be a child of item above, so indent = 1.\n // 10 * --------\t\t<-- this should still be a child of item above, so indent = 2.\n // 11 * --------\t\t<-- this should still be at the same level as item above, so indent = 2.\n // 12 * --------\t\t\t\t<-- this and all below are left unchanged.\n // 13 * --------\n // 14 * --------\n //\n // After turning off 3 the list becomes:\n //\n // 1 * --------\n // 2 * --------\n //\n // 3 --------\n //\n // 4 * --------\n // 5 * --------\n // 6 * --------\n // 7 * --------\n // 8 * --------\n // 9 * --------\n // 10 * --------\n // 11 * --------\n // 12 * --------\n // 13 * --------\n // 14 * --------\n //\n // Thanks to this algorithm no lists are mismatched and no items get unexpected children/parent, while\n // those parent-child connection which are possible to maintain are still maintained. It's worth noting\n // that this is the same effect that we would be get by multiple use of outdent command. However doing\n // it like this is much more efficient because it's less operation (less memory usage, easier OT) and\n // less conversion (faster).\n while (next && next.name == 'listItem' && next.getAttribute('listIndent') !== 0) {\n // Check each next list item, as long as its indent is bigger than 0.\n // If the indent is 0 we are not going to change anything anyway.\n const indent = next.getAttribute('listIndent');\n // We check if that's item indent is lower as current relative indent.\n if (indent < currentIndent) {\n // If it is, current relative indent becomes that indent.\n currentIndent = indent;\n }\n // Fix indent relatively to current relative indent.\n // Note, that if we just changed the current relative indent, the newIndent will be equal to 0.\n const newIndent = indent - currentIndent;\n // Save the entry in changes array. We do not apply it at the moment, because we will need to\n // reverse the changes so the last item is changed first.\n // This is to keep model in correct state all the time.\n changes.push({ element: next, listIndent: newIndent });\n // Find next item.\n next = next.nextSibling;\n }\n changes = changes.reverse();\n for (const item of changes) {\n writer.setAttribute('listIndent', item.listIndent, item.element);\n }\n }\n // If we are turning on, we might change some items that are already `listItem`s but with different type.\n // Changing one nested list item to other type should also trigger changing all its siblings so the\n // whole nested list is of the same type.\n // Example (assume changing to numbered list):\n // * ------\t\t\t\t<-- do not fix, top level item\n // * ------\t\t\t<-- fix, because latter list item of this item's list is changed\n // * ------\t\t<-- do not fix, item is not affected (different list)\n // * ------\t\t\t<-- fix, because latter list item of this item's list is changed\n // * ------\t\t<-- fix, because latter list item of this item's list is changed\n // * ---[--\t\t<-- already in selection\n // * ------\t\t\t<-- already in selection\n // * ------\t\t\t<-- already in selection\n // * ------\t\t\t\t<-- already in selection, but does not cause other list items to change because is top-level\n // * ---]--\t\t\t<-- already in selection\n // * ------\t\t\t<-- fix, because preceding list item of this item's list is changed\n // * ------\t\t<-- do not fix, item is not affected (different list)\n // * ------\t\t\t\t<-- do not fix, top level item\n if (!turnOff) {\n // Find lowest indent among selected items. This will be indicator what is the indent of\n // top-most list affected by the command.\n let lowestIndent = Number.POSITIVE_INFINITY;\n for (const item of blocks) {\n if (item.is('element', 'listItem') && item.getAttribute('listIndent') < lowestIndent) {\n lowestIndent = item.getAttribute('listIndent');\n }\n }\n // Do not execute the fix for top-level lists.\n lowestIndent = lowestIndent === 0 ? 1 : lowestIndent;\n // Fix types of list items that are \"before\" the selected blocks.\n _fixType(blocks, true, lowestIndent);\n // Fix types of list items that are \"after\" the selected blocks.\n _fixType(blocks, false, lowestIndent);\n }\n // Phew! Now it will be easier :).\n // For each block element that was in the selection, we will either: turn it to list item,\n // turn it to paragraph, or change it's type. Or leave it as it is.\n // Do it in reverse as there might be multiple blocks (same as with changing indents).\n for (const element of blocks.reverse()) {\n if (turnOff && element.name == 'listItem') {\n // We are turning off and the element is a `listItem` - it should be converted to `paragraph`.\n // List item specific attributes are removed by post fixer.\n writer.rename(element, 'paragraph');\n }\n else if (!turnOff && element.name != 'listItem') {\n // We are turning on and the element is not a `listItem` - it should be converted to `listItem`.\n // The order of operations is important to keep model in correct state.\n writer.setAttributes({ listType: this.type, listIndent: 0 }, element);\n writer.rename(element, 'listItem');\n }\n else if (!turnOff && element.name == 'listItem' && element.getAttribute('listType') != this.type) {\n // We are turning on and the element is a `listItem` but has different type - change it's type and\n // type of it's all siblings that have same indent.\n writer.setAttribute('listType', this.type, element);\n }\n }\n /**\n * Event fired by the {@link #execute} method.\n *\n * It allows to execute an action after executing the {@link ~ListCommand#execute} method, for example adjusting\n * attributes of changed blocks.\n *\n * @protected\n * @event _executeCleanup\n */\n this.fire('_executeCleanup', blocks);\n });\n }\n /**\n * Checks the command's {@link #value}.\n *\n * @returns The current value.\n */\n _getValue() {\n // Check whether closest `listItem` ancestor of the position has a correct type.\n const listItem = first(this.editor.model.document.selection.getSelectedBlocks());\n return !!listItem && listItem.is('element', 'listItem') && listItem.getAttribute('listType') == this.type;\n }\n /**\n * Checks whether the command can be enabled in the current context.\n *\n * @returns Whether the command should be enabled.\n */\n _checkEnabled() {\n // If command value is true it means that we are in list item, so the command should be enabled.\n if (this.value) {\n return true;\n }\n const selection = this.editor.model.document.selection;\n const schema = this.editor.model.schema;\n const firstBlock = first(selection.getSelectedBlocks());\n if (!firstBlock) {\n return false;\n }\n // Otherwise, check if list item can be inserted at the position start.\n return checkCanBecomeListItem(firstBlock, schema);\n }\n}\n/**\n * Helper function used when one or more list item have their type changed. Fixes type of other list items\n * that are affected by the change (are in same lists) but are not directly in selection. The function got extracted\n * not to duplicated code, as same fix has to be performed before and after selection.\n *\n * @param blocks Blocks that are in selection.\n * @param isBackward Specified whether fix will be applied for blocks before first selected block (`true`)\n * or blocks after last selected block (`false`).\n * @param lowestIndent Lowest indent among selected blocks.\n */\nfunction _fixType(blocks, isBackward, lowestIndent) {\n // We need to check previous sibling of first changed item and next siblings of last changed item.\n const startingItem = isBackward ? blocks[0] : blocks[blocks.length - 1];\n if (startingItem.is('element', 'listItem')) {\n let item = startingItem[isBackward ? 'previousSibling' : 'nextSibling'];\n // During processing items, keeps the lowest indent of already processed items.\n // This saves us from changing too many items.\n // Following example is for going forward as it is easier to read, however same applies to going backward.\n // * ------\n // * ------\n // * --[---\n // * ------\t\t<-- `lowestIndent` should be 1\n // * --]---\t\t<-- `startingItem`, `currentIndent` = 2, `lowestIndent` == 1\n // * ------\t\t<-- should be fixed, `indent` == 2 == `currentIndent`\n // * ------\t\t<-- should be fixed, set `currentIndent` to 1, `indent` == 1 == `currentIndent`\n // * ------\t\t<-- should not be fixed, item is in different list, `indent` = 2, `indent` != `currentIndent`\n // * ------\t\t<-- should be fixed, `indent` == 1 == `currentIndent`\n // * ------\t\t\t<-- break loop (`indent` < `lowestIndent`)\n let currentIndent = startingItem.getAttribute('listIndent');\n // Look back until a list item with indent lower than reference `lowestIndent`.\n // That would be the parent of nested sublist which contains item having `lowestIndent`.\n while (item && item.is('element', 'listItem') && item.getAttribute('listIndent') >= lowestIndent) {\n if (currentIndent > item.getAttribute('listIndent')) {\n currentIndent = item.getAttribute('listIndent');\n }\n // Found an item that is in the same nested sublist.\n if (item.getAttribute('listIndent') == currentIndent) {\n // Just add the item to selected blocks like it was selected by the user.\n blocks[isBackward ? 'unshift' : 'push'](item);\n }\n item = item[isBackward ? 'previousSibling' : 'nextSibling'];\n }\n }\n}\n/**\n * Checks whether the given block can be replaced by a listItem.\n *\n * @param block A block to be tested.\n * @param schema The schema of the document.\n */\nfunction checkCanBecomeListItem(block, schema) {\n return schema.checkChild(block.parent, 'listItem') && !schema.isObject(block);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { first } from 'ckeditor5/src/utils';\n/**\n * The list indent command. It is used by the {@link module:list/list~List list feature}.\n */\nexport default class IndentCommand extends Command {\n /**\n * Creates an instance of the command.\n *\n * @param editor The editor instance.\n * @param indentDirection The direction of indent. If it is equal to `backward`, the command will outdent a list item.\n */\n constructor(editor, indentDirection) {\n super(editor);\n this._indentBy = indentDirection == 'forward' ? 1 : -1;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n this.isEnabled = this._checkEnabled();\n }\n /**\n * Indents or outdents (depending on the {@link #constructor}'s `indentDirection` parameter) selected list items.\n *\n * @fires execute\n */\n execute() {\n const model = this.editor.model;\n const doc = model.document;\n let itemsToChange = Array.from(doc.selection.getSelectedBlocks());\n model.change(writer => {\n const lastItem = itemsToChange[itemsToChange.length - 1];\n // Indenting a list item should also indent all the items that are already sub-items of indented item.\n let next = lastItem.nextSibling;\n // Check all items after last indented item, as long as their indent is bigger than indent of that item.\n while (next && next.name == 'listItem' &&\n next.getAttribute('listIndent') > lastItem.getAttribute('listIndent')) {\n itemsToChange.push(next);\n next = next.nextSibling;\n }\n // We need to be sure to keep model in correct state after each small change, because converters\n // bases on that state and assumes that model is correct.\n // Because of that, if the command outdents items, we will outdent them starting from the last item, as\n // it is safer.\n if (this._indentBy < 0) {\n itemsToChange = itemsToChange.reverse();\n }\n for (const item of itemsToChange) {\n const indent = item.getAttribute('listIndent') + this._indentBy;\n // If indent is lower than 0, it means that the item got outdented when it was not indented.\n // This means that we need to convert that list item to paragraph.\n if (indent < 0) {\n // To keep the model as correct as possible, first rename listItem, then remove attributes,\n // as listItem without attributes is very incorrect and will cause problems in converters.\n // No need to remove attributes, will be removed by post fixer.\n writer.rename(item, 'paragraph');\n }\n // If indent is >= 0, change the attribute value.\n else {\n writer.setAttribute('listIndent', indent, item);\n }\n }\n // It allows to execute an action after executing the `~IndentCommand#execute` method, for example adjusting\n // attributes of changed list items.\n this.fire('_executeCleanup', itemsToChange);\n });\n }\n /**\n * Checks whether the command can be enabled in the current context.\n *\n * @returns Whether the command should be enabled.\n */\n _checkEnabled() {\n // Check whether any of position's ancestor is a list item.\n const listItem = first(this.editor.model.document.selection.getSelectedBlocks());\n // If selection is not in a list item, the command is disabled.\n if (!listItem || !listItem.is('element', 'listItem')) {\n return false;\n }\n if (this._indentBy > 0) {\n // Cannot indent first item in it's list. Check if before `listItem` is a list item that is in same list.\n // To be in the same list, the item has to have same attributes and cannot be \"split\" by an item with lower indent.\n const indent = listItem.getAttribute('listIndent');\n const type = listItem.getAttribute('listType');\n let prev = listItem.previousSibling;\n while (prev && prev.is('element', 'listItem') && prev.getAttribute('listIndent') >= indent) {\n if (prev.getAttribute('listIndent') == indent) {\n // The item is on the same level.\n // If it has same type, it means that we found a preceding sibling from the same list.\n // If it does not have same type, it means that `listItem` is on different list (this can happen only\n // on top level lists, though).\n return prev.getAttribute('listType') == type;\n }\n prev = prev.previousSibling;\n }\n // Could not find similar list item, this means that `listItem` is first in its list.\n return false;\n }\n // If we are outdenting it is enough to be in list item. Every list item can always be outdented.\n return true;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { TreeWalker, getFillerOffset } from 'ckeditor5/src/engine';\nimport { ButtonView } from 'ckeditor5/src/ui';\n/**\n * Creates a list item {@link module:engine/view/containerelement~ContainerElement}.\n *\n * @param writer The writer instance.\n */\nexport function createViewListItemElement(writer) {\n const viewItem = writer.createContainerElement('li');\n viewItem.getFillerOffset = getListItemFillerOffset;\n return viewItem;\n}\n/**\n * Helper function that creates a `<ul><li></li></ul>` or (`<ol>`) structure out of the given `modelItem` model `listItem` element.\n * Then, it binds the created view list item (`<li>`) with the model `listItem` element.\n * The function then returns the created view list item (`<li>`).\n *\n * @param modelItem Model list item.\n * @param conversionApi Conversion interface.\n * @returns View list element.\n */\nexport function generateLiInUl(modelItem, conversionApi) {\n const mapper = conversionApi.mapper;\n const viewWriter = conversionApi.writer;\n const listType = modelItem.getAttribute('listType') == 'numbered' ? 'ol' : 'ul';\n const viewItem = createViewListItemElement(viewWriter);\n const viewList = viewWriter.createContainerElement(listType, null);\n viewWriter.insert(viewWriter.createPositionAt(viewList, 0), viewItem);\n mapper.bindElements(modelItem, viewItem);\n return viewItem;\n}\n/**\n * Helper function that inserts a view list at a correct place and merges it with its siblings.\n * It takes a model list item element (`modelItem`) and a corresponding view list item element (`injectedItem`). The view list item\n * should be in a view list element (`<ul>` or `<ol>`) and should be its only child.\n * See comments below to better understand the algorithm.\n *\n * @param modelItem Model list item.\n * @param injectedItem\n * @param conversionApi Conversion interface.\n * @param model The model instance.\n */\nexport function injectViewList(modelItem, injectedItem, conversionApi, model) {\n const injectedList = injectedItem.parent;\n const mapper = conversionApi.mapper;\n const viewWriter = conversionApi.writer;\n // The position where the view list will be inserted.\n let insertPosition = mapper.toViewPosition(model.createPositionBefore(modelItem));\n // 1. Find the previous list item that has the same or smaller indent. Basically we are looking for the first model item\n // that is a \"parent\" or \"sibling\" of the injected model item.\n // If there is no such list item, it means that the injected list item is the first item in \"its list\".\n const refItem = getSiblingListItem(modelItem.previousSibling, {\n sameIndent: true,\n smallerIndent: true,\n listIndent: modelItem.getAttribute('listIndent')\n });\n const prevItem = modelItem.previousSibling;\n if (refItem && refItem.getAttribute('listIndent') == modelItem.getAttribute('listIndent')) {\n // There is a list item with the same indent - we found the same-level sibling.\n // Break the list after it. The inserted view item will be added in the broken space.\n const viewItem = mapper.toViewElement(refItem);\n insertPosition = viewWriter.breakContainer(viewWriter.createPositionAfter(viewItem));\n }\n else {\n // There is no list item with the same indent. Check the previous model item.\n if (prevItem && prevItem.name == 'listItem') {\n // If it is a list item, it has to have a lower indent.\n // It means that the inserted item should be added to it as its nested item.\n insertPosition = mapper.toViewPosition(model.createPositionAt(prevItem, 'end'));\n // There could be some not mapped elements (eg. span in to-do list) but we need to insert\n // a nested list directly inside the li element.\n const mappedViewAncestor = mapper.findMappedViewAncestor(insertPosition);\n const nestedList = findNestedList(mappedViewAncestor);\n // If there already is some nested list, then use it's position.\n if (nestedList) {\n insertPosition = viewWriter.createPositionBefore(nestedList);\n }\n else {\n // Else just put new list on the end of list item content.\n insertPosition = viewWriter.createPositionAt(mappedViewAncestor, 'end');\n }\n }\n else {\n // The previous item is not a list item (or does not exist at all).\n // Just map the position and insert the view item at the mapped position.\n insertPosition = mapper.toViewPosition(model.createPositionBefore(modelItem));\n }\n }\n insertPosition = positionAfterUiElements(insertPosition);\n // Insert the view item.\n viewWriter.insert(insertPosition, injectedList);\n // 2. Handle possible children of the injected model item.\n if (prevItem && prevItem.name == 'listItem') {\n const prevView = mapper.toViewElement(prevItem);\n const walkerBoundaries = viewWriter.createRange(viewWriter.createPositionAt(prevView, 0), insertPosition);\n const walker = walkerBoundaries.getWalker({ ignoreElementEnd: true });\n for (const value of walker) {\n if (value.item.is('element', 'li')) {\n const breakPosition = viewWriter.breakContainer(viewWriter.createPositionBefore(value.item));\n const viewList = value.item.parent;\n const targetPosition = viewWriter.createPositionAt(injectedItem, 'end');\n mergeViewLists(viewWriter, targetPosition.nodeBefore, targetPosition.nodeAfter);\n viewWriter.move(viewWriter.createRangeOn(viewList), targetPosition);\n // This is bad, but those lists will be removed soon anyway.\n walker._position = breakPosition;\n }\n }\n }\n else {\n const nextViewList = injectedList.nextSibling;\n if (nextViewList && (nextViewList.is('element', 'ul') || nextViewList.is('element', 'ol'))) {\n let lastSubChild = null;\n for (const child of nextViewList.getChildren()) {\n const modelChild = mapper.toModelElement(child);\n if (modelChild &&\n modelChild.getAttribute('listIndent') > modelItem.getAttribute('listIndent')) {\n lastSubChild = child;\n }\n else {\n break;\n }\n }\n if (lastSubChild) {\n viewWriter.breakContainer(viewWriter.createPositionAfter(lastSubChild));\n viewWriter.move(viewWriter.createRangeOn(lastSubChild.parent), viewWriter.createPositionAt(injectedItem, 'end'));\n }\n }\n }\n // Merge the inserted view list with its possible neighbor lists.\n mergeViewLists(viewWriter, injectedList, injectedList.nextSibling);\n mergeViewLists(viewWriter, injectedList.previousSibling, injectedList);\n}\nexport function mergeViewLists(viewWriter, firstList, secondList) {\n // Check if two lists are going to be merged.\n if (!firstList || !secondList || (firstList.name != 'ul' && firstList.name != 'ol')) {\n return null;\n }\n // Both parameters are list elements, so compare types now.\n if (firstList.name != secondList.name || firstList.getAttribute('class') !== secondList.getAttribute('class')) {\n return null;\n }\n return viewWriter.mergeContainers(viewWriter.createPositionAfter(firstList));\n}\n/**\n * Helper function that for a given `view.Position`, returns a `view.Position` that is after all `view.UIElement`s that\n * are after the given position.\n *\n * For example:\n * `<container:p>foo^<ui:span></ui:span><ui:span></ui:span>bar</container:p>`\n * For position ^, the position before \"bar\" will be returned.\n *\n */\nexport function positionAfterUiElements(viewPosition) {\n return viewPosition.getLastMatchingPosition(value => value.item.is('uiElement'));\n}\n/**\n * Helper function that searches for a previous list item sibling of a given model item that meets the given criteria\n * passed by the options object.\n *\n * @param options Search criteria.\n * @param options.sameIndent Whether the sought sibling should have the same indentation.\n * @param options.smallerIndent Whether the sought sibling should have a smaller indentation.\n * @param options.listIndent The reference indentation.\n * @param options.direction Walking direction.\n */\nexport function getSiblingListItem(modelItem, options) {\n const sameIndent = !!options.sameIndent;\n const smallerIndent = !!options.smallerIndent;\n const indent = options.listIndent;\n let item = modelItem;\n while (item && item.name == 'listItem') {\n const itemIndent = item.getAttribute('listIndent');\n if ((sameIndent && indent == itemIndent) || (smallerIndent && indent > itemIndent)) {\n return item;\n }\n if (options.direction === 'forward') {\n item = item.nextSibling;\n }\n else {\n item = item.previousSibling;\n }\n }\n return null;\n}\n/**\n * Helper method for creating a UI button and linking it with an appropriate command.\n *\n * @internal\n * @param editor The editor instance to which the UI component will be added.\n * @param commandName The name of the command.\n * @param label The button label.\n * @param icon The source of the icon.\n */\nexport function createUIComponent(editor, commandName, label, icon) {\n editor.ui.componentFactory.add(commandName, locale => {\n const command = editor.commands.get(commandName);\n const buttonView = new ButtonView(locale);\n buttonView.set({\n label,\n icon,\n tooltip: true,\n isToggleable: true\n });\n // Bind button model to command.\n buttonView.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n // Execute command.\n buttonView.on('execute', () => {\n editor.execute(commandName);\n editor.editing.view.focus();\n });\n return buttonView;\n });\n}\n/**\n * Returns a first list view element that is direct child of the given view element.\n */\nexport function findNestedList(viewElement) {\n for (const node of viewElement.getChildren()) {\n if (node.name == 'ul' || node.name == 'ol') {\n return node;\n }\n }\n return null;\n}\n/**\n * Returns an array with all `listItem` elements that represent the same list.\n *\n * It means that values of `listIndent`, `listType`, `listStyle`, `listReversed` and `listStart` for all items are equal.\n *\n * Additionally, if the `position` is inside a list item, that list item will be returned as well.\n *\n * @param position Starting position.\n * @param direction Walking direction.\n */\nexport function getSiblingNodes(position, direction) {\n const items = [];\n const listItem = position.parent;\n const walkerOptions = {\n ignoreElementEnd: false,\n startPosition: position,\n shallow: true,\n direction\n };\n const limitIndent = listItem.getAttribute('listIndent');\n const nodes = [...new TreeWalker(walkerOptions)]\n .filter(value => value.item.is('element'))\n .map(value => value.item);\n for (const element of nodes) {\n // If found something else than `listItem`, we're out of the list scope.\n if (!element.is('element', 'listItem')) {\n break;\n }\n // If current parsed item has lower indent that element that the element that was a starting point,\n // it means we left a nested list. Abort searching items.\n //\n // ■ List item 1. [listIndent=0]\n // ○ List item 2.[] [listIndent=1], limitIndent = 1,\n // ○ List item 3. [listIndent=1]\n // ■ List item 4. [listIndent=0]\n //\n // Abort searching when leave nested list.\n if (element.getAttribute('listIndent') < limitIndent) {\n break;\n }\n // ■ List item 1.[] [listIndent=0] limitIndent = 0,\n // ○ List item 2. [listIndent=1]\n // ○ List item 3. [listIndent=1]\n // ■ List item 4. [listIndent=0]\n //\n // Ignore nested lists.\n if (element.getAttribute('listIndent') > limitIndent) {\n continue;\n }\n // ■ List item 1.[] [listType=bulleted]\n // 1. List item 2. [listType=numbered]\n // 2.List item 3. [listType=numbered]\n //\n // Abort searching when found a different kind of a list.\n if (element.getAttribute('listType') !== listItem.getAttribute('listType')) {\n break;\n }\n // ■ List item 1.[] [listType=bulleted]\n // ■ List item 2. [listType=bulleted]\n // ○ List item 3. [listType=bulleted]\n // ○ List item 4. [listType=bulleted]\n //\n // Abort searching when found a different list style,\n if (element.getAttribute('listStyle') !== listItem.getAttribute('listStyle')) {\n break;\n }\n // ... different direction\n if (element.getAttribute('listReversed') !== listItem.getAttribute('listReversed')) {\n break;\n }\n // ... and different start index\n if (element.getAttribute('listStart') !== listItem.getAttribute('listStart')) {\n break;\n }\n if (direction === 'backward') {\n items.unshift(element);\n }\n else {\n items.push(element);\n }\n }\n return items;\n}\n/**\n * Returns an array with all `listItem` elements in the model selection.\n *\n * It returns all the items even if only a part of the list is selected, including items that belong to nested lists.\n * If no list is selected, it returns an empty array.\n * The order of the elements is not specified.\n *\n * @internal\n */\nexport function getSelectedListItems(model) {\n const document = model.document;\n // For all selected blocks find all list items that are being selected\n // and update the `listStyle` attribute in those lists.\n let listItems = [...document.selection.getSelectedBlocks()]\n .filter(element => element.is('element', 'listItem'))\n .map(element => {\n const position = model.change(writer => writer.createPositionAt(element, 0));\n return [\n ...getSiblingNodes(position, 'backward'),\n ...getSiblingNodes(position, 'forward')\n ];\n })\n .flat();\n // Since `getSelectedBlocks()` can return items that belong to the same list, and\n // `getSiblingNodes()` returns the entire list, we need to remove duplicated items.\n listItems = [...new Set(listItems)];\n return listItems;\n}\nconst BULLETED_LIST_STYLE_TYPES = ['disc', 'circle', 'square'];\n// There's a lot of them (https://www.w3.org/TR/css-counter-styles-3/#typedef-counter-style).\n// Let's support only those that can be selected by ListPropertiesUI.\nconst NUMBERED_LIST_STYLE_TYPES = [\n 'decimal',\n 'decimal-leading-zero',\n 'lower-roman',\n 'upper-roman',\n 'lower-latin',\n 'upper-latin'\n];\n/**\n * Checks whether the given list-style-type is supported by numbered or bulleted list.\n */\nexport function getListTypeFromListStyleType(listStyleType) {\n if (BULLETED_LIST_STYLE_TYPES.includes(listStyleType)) {\n return 'bulleted';\n }\n if (NUMBERED_LIST_STYLE_TYPES.includes(listStyleType)) {\n return 'numbered';\n }\n return null;\n}\n/**\n * Implementation of getFillerOffset for view list item element.\n *\n * @returns Block filler offset or `null` if block filler is not needed.\n */\nfunction getListItemFillerOffset() {\n const hasOnlyLists = !this.isEmpty && (this.getChild(0).name == 'ul' || this.getChild(0).name == 'ol');\n if (this.isEmpty || hasOnlyLists) {\n return 0;\n }\n return getFillerOffset.call(this);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { getListTypeFromListStyleType, getSelectedListItems, getSiblingNodes } from './utils';\n/**\n * A set of helpers related to document lists.\n */\nexport default class ListUtils extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ListUtils';\n }\n /**\n * Checks whether the given list-style-type is supported by numbered or bulleted list.\n */\n getListTypeFromListStyleType(listStyleType) {\n return getListTypeFromListStyleType(listStyleType);\n }\n /**\n * Returns an array with all `listItem` elements in the model selection.\n *\n * It returns all the items even if only a part of the list is selected, including items that belong to nested lists.\n * If no list is selected, it returns an empty array.\n * The order of the elements is not specified.\n */\n getSelectedListItems(model) {\n return getSelectedListItems(model);\n }\n /**\n * Returns an array with all `listItem` elements that represent the same list.\n *\n * It means that values of `listIndent`, `listType`, `listStyle`, `listReversed` and `listStart` for all items are equal.\n *\n * Additionally, if the `position` is inside a list item, that list item will be returned as well.\n *\n * @param position Starting position.\n * @param direction Walking direction.\n */\n getSiblingNodes(position, direction) {\n return getSiblingNodes(position, direction);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/list/converters\n */\nimport { TreeWalker } from 'ckeditor5/src/engine';\nimport { generateLiInUl, injectViewList, mergeViewLists, getSiblingListItem, positionAfterUiElements } from './utils';\n/**\n * A model-to-view converter for the `listItem` model element insertion.\n *\n * It creates a `<ul><li></li><ul>` (or `<ol>`) view structure out of a `listItem` model element, inserts it at the correct\n * position, and merges the list with surrounding lists (if available).\n *\n * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert\n * @param model Model instance.\n */\nexport function modelViewInsertion(model) {\n return (evt, data, conversionApi) => {\n const consumable = conversionApi.consumable;\n if (!consumable.test(data.item, 'insert') ||\n !consumable.test(data.item, 'attribute:listType') ||\n !consumable.test(data.item, 'attribute:listIndent')) {\n return;\n }\n consumable.consume(data.item, 'insert');\n consumable.consume(data.item, 'attribute:listType');\n consumable.consume(data.item, 'attribute:listIndent');\n const modelItem = data.item;\n const viewItem = generateLiInUl(modelItem, conversionApi);\n injectViewList(modelItem, viewItem, conversionApi, model);\n };\n}\n/**\n * A model-to-view converter for the `listItem` model element removal.\n *\n * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:remove\n * @param model Model instance.\n * @returns Returns a conversion callback.\n */\nexport function modelViewRemove(model) {\n return (evt, data, conversionApi) => {\n const viewPosition = conversionApi.mapper.toViewPosition(data.position);\n const viewStart = viewPosition.getLastMatchingPosition(value => !value.item.is('element', 'li'));\n const viewItem = viewStart.nodeAfter;\n const viewWriter = conversionApi.writer;\n // 1. Break the container after and before the list item.\n // This will create a view list with one view list item - the one to remove.\n viewWriter.breakContainer(viewWriter.createPositionBefore(viewItem));\n viewWriter.breakContainer(viewWriter.createPositionAfter(viewItem));\n // 2. Remove the list with the item to remove.\n const viewList = viewItem.parent;\n const viewListPrev = viewList.previousSibling;\n const removeRange = viewWriter.createRangeOn(viewList);\n const removed = viewWriter.remove(removeRange);\n // 3. Merge the whole created by breaking and removing the list.\n if (viewListPrev && viewListPrev.nextSibling) {\n mergeViewLists(viewWriter, viewListPrev, viewListPrev.nextSibling);\n }\n // 4. Bring back nested list that was in the removed <li>.\n const modelItem = conversionApi.mapper.toModelElement(viewItem);\n hoistNestedLists(modelItem.getAttribute('listIndent') + 1, data.position, removeRange.start, viewItem, conversionApi, model);\n // 5. Unbind removed view item and all children.\n for (const child of viewWriter.createRangeIn(removed).getItems()) {\n conversionApi.mapper.unbindViewElement(child);\n }\n evt.stop();\n };\n}\n/**\n * A model-to-view converter for the `type` attribute change on the `listItem` model element.\n *\n * This change means that the `<li>` element parent changes from `<ul>` to `<ol>` (or vice versa). This is accomplished\n * by breaking view elements and changing their name. The next {@link module:list/list/converters~modelViewMergeAfterChangeType}\n * converter will attempt to merge split nodes.\n *\n * Splitting this conversion into 2 steps makes it possible to add an additional conversion in the middle.\n * Check {@link module:list/todolist/todolistconverters~modelViewChangeType} to see an example of it.\n *\n * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute\n */\nexport const modelViewChangeType = (evt, data, conversionApi) => {\n if (!conversionApi.consumable.test(data.item, evt.name)) {\n return;\n }\n const viewItem = conversionApi.mapper.toViewElement(data.item);\n const viewWriter = conversionApi.writer;\n // Break the container after and before the list item.\n // This will create a view list with one view list item -- the one that changed type.\n viewWriter.breakContainer(viewWriter.createPositionBefore(viewItem));\n viewWriter.breakContainer(viewWriter.createPositionAfter(viewItem));\n // Change name of the view list that holds the changed view item.\n // We cannot just change name property, because that would not render properly.\n const viewList = viewItem.parent;\n const listName = data.attributeNewValue == 'numbered' ? 'ol' : 'ul';\n viewWriter.rename(listName, viewList);\n};\n/**\n * A model-to-view converter that attempts to merge nodes split by {@link module:list/list/converters~modelViewChangeType}.\n *\n * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute\n */\nexport const modelViewMergeAfterChangeType = (evt, data, conversionApi) => {\n conversionApi.consumable.consume(data.item, evt.name);\n const viewItem = conversionApi.mapper.toViewElement(data.item);\n const viewList = viewItem.parent;\n const viewWriter = conversionApi.writer;\n // Merge the changed view list with other lists, if possible.\n mergeViewLists(viewWriter, viewList, viewList.nextSibling);\n mergeViewLists(viewWriter, viewList.previousSibling, viewList);\n};\n/**\n * A model-to-view converter for the `listIndent` attribute change on the `listItem` model element.\n *\n * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute\n * @param model Model instance.\n * @returns Returns a conversion callback.\n */\nexport function modelViewChangeIndent(model) {\n return (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, 'attribute:listIndent')) {\n return;\n }\n const viewItem = conversionApi.mapper.toViewElement(data.item);\n const viewWriter = conversionApi.writer;\n // 1. Break the container after and before the list item.\n // This will create a view list with one view list item -- the one that changed type.\n viewWriter.breakContainer(viewWriter.createPositionBefore(viewItem));\n viewWriter.breakContainer(viewWriter.createPositionAfter(viewItem));\n // 2. Extract view list with changed view list item and merge \"hole\" possibly created by breaking and removing elements.\n const viewList = viewItem.parent;\n const viewListPrev = viewList.previousSibling;\n const removeRange = viewWriter.createRangeOn(viewList);\n viewWriter.remove(removeRange);\n if (viewListPrev && viewListPrev.nextSibling) {\n mergeViewLists(viewWriter, viewListPrev, viewListPrev.nextSibling);\n }\n // 3. Bring back nested list that was in the removed <li>.\n hoistNestedLists(data.attributeOldValue + 1, data.range.start, removeRange.start, viewItem, conversionApi, model);\n // 4. Inject view list like it is newly inserted.\n injectViewList(data.item, viewItem, conversionApi, model);\n // 5. Consume insertion of children inside the item. They are already handled by re-building the item in view.\n for (const child of data.item.getChildren()) {\n conversionApi.consumable.consume(child, 'insert');\n }\n };\n}\n/**\n * A special model-to-view converter introduced by the {@link module:list/list~List list feature}. This converter is fired for\n * insert change of every model item, and should be fired before the actual converter. The converter checks whether the inserted\n * model item is a non-`listItem` element. If it is, and it is inserted inside a view list, the converter breaks the\n * list so the model element is inserted to the view parent element corresponding to its model parent element.\n *\n * The converter prevents such situations:\n *\n * ```xml\n * // Model: // View:\n * <listItem>foo</listItem> <ul>\n * <listItem>bar</listItem> <li>foo</li>\n * <li>bar</li>\n * </ul>\n *\n * // After change: // Correct view guaranteed by this converter:\n * <listItem>foo</listItem> <ul><li>foo</li></ul><p>xxx</p><ul><li>bar</li></ul>\n * <paragraph>xxx</paragraph> // Instead of this wrong view state:\n * <listItem>bar</listItem> <ul><li>foo</li><p>xxx</p><li>bar</li></ul>\n * ```\n *\n * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert\n */\nexport const modelViewSplitOnInsert = (evt, data, conversionApi) => {\n if (!conversionApi.consumable.test(data.item, evt.name)) {\n return;\n }\n if (data.item.name != 'listItem') {\n let viewPosition = conversionApi.mapper.toViewPosition(data.range.start);\n const viewWriter = conversionApi.writer;\n const lists = [];\n // Break multiple ULs/OLs if there are.\n //\n // Imagine following list:\n //\n // 1 --------\n // 1.1 --------\n // 1.1.1 --------\n // 1.1.2 --------\n // 1.1.3 --------\n // 1.1.3.1 --------\n // 1.2 --------\n // 1.2.1 --------\n // 2 --------\n //\n // Insert paragraph after item 1.1.1:\n //\n // 1 --------\n // 1.1 --------\n // 1.1.1 --------\n //\n // Lorem ipsum.\n //\n // 1.1.2 --------\n // 1.1.3 --------\n // 1.1.3.1 --------\n // 1.2 --------\n // 1.2.1 --------\n // 2 --------\n //\n // In this case 1.1.2 has to become beginning of a new list.\n // We need to break list before 1.1.2 (obvious), then we need to break list also before 1.2.\n // Then we need to move those broken pieces one after another and merge:\n //\n // 1 --------\n // 1.1 --------\n // 1.1.1 --------\n //\n // Lorem ipsum.\n //\n // 1.1.2 --------\n // 1.1.3 --------\n // 1.1.3.1 --------\n // 1.2 --------\n // 1.2.1 --------\n // 2 --------\n //\n while (viewPosition.parent.name == 'ul' || viewPosition.parent.name == 'ol') {\n viewPosition = viewWriter.breakContainer(viewPosition);\n if (viewPosition.parent.name != 'li') {\n break;\n }\n // Remove lists that are after inserted element.\n // They will be brought back later, below the inserted element.\n const removeStart = viewPosition;\n const removeEnd = viewWriter.createPositionAt(viewPosition.parent, 'end');\n // Don't remove if there is nothing to remove.\n if (!removeStart.isEqual(removeEnd)) {\n const removed = viewWriter.remove(viewWriter.createRange(removeStart, removeEnd));\n lists.push(removed);\n }\n viewPosition = viewWriter.createPositionAfter(viewPosition.parent);\n }\n // Bring back removed lists.\n if (lists.length > 0) {\n for (let i = 0; i < lists.length; i++) {\n const previousList = viewPosition.nodeBefore;\n const insertedRange = viewWriter.insert(viewPosition, lists[i]);\n viewPosition = insertedRange.end;\n // Don't merge first list! We want a split in that place (this is why this converter is introduced).\n if (i > 0) {\n const mergePos = mergeViewLists(viewWriter, previousList, previousList.nextSibling);\n // If `mergePos` is in `previousList` it means that the lists got merged.\n // In this case, we need to fix insert position.\n if (mergePos && mergePos.parent == previousList) {\n viewPosition.offset--;\n }\n }\n }\n // Merge last inserted list with element after it.\n mergeViewLists(viewWriter, viewPosition.nodeBefore, viewPosition.nodeAfter);\n }\n }\n};\n/**\n * A special model-to-view converter introduced by the {@link module:list/list~List list feature}. This converter takes care of\n * merging view lists after something is removed or moved from near them.\n *\n * Example:\n *\n * ```xml\n * // Model: // View:\n * <listItem>foo</listItem> <ul><li>foo</li></ul>\n * <paragraph>xxx</paragraph> <p>xxx</p>\n * <listItem>bar</listItem> <ul><li>bar</li></ul>\n *\n * // After change: // Correct view guaranteed by this converter:\n * <listItem>foo</listItem> <ul>\n * <listItem>bar</listItem> <li>foo</li>\n * <li>bar</li>\n * </ul>\n * ```\n *\n * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:remove\n */\nexport const modelViewMergeAfter = (evt, data, conversionApi) => {\n const viewPosition = conversionApi.mapper.toViewPosition(data.position);\n const viewItemPrev = viewPosition.nodeBefore;\n const viewItemNext = viewPosition.nodeAfter;\n // Merge lists if something (remove, move) was done from inside of list.\n // Merging will be done only if both items are view lists of the same type.\n // The check is done inside the helper function.\n mergeViewLists(conversionApi.writer, viewItemPrev, viewItemNext);\n};\n/**\n * A view-to-model converter that converts the `<li>` view elements into the `listItem` model elements.\n *\n * To set correct values of the `listType` and `listIndent` attributes the converter:\n * * checks `<li>`'s parent,\n * * stores and increases the `conversionApi.store.indent` value when `<li>`'s sub-items are converted.\n *\n * @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element\n */\nexport const viewModelConverter = (evt, data, conversionApi) => {\n if (conversionApi.consumable.consume(data.viewItem, { name: true })) {\n const writer = conversionApi.writer;\n // 1. Create `listItem` model element.\n const listItem = writer.createElement('listItem');\n // 2. Handle `listItem` model element attributes.\n const indent = getIndent(data.viewItem);\n writer.setAttribute('listIndent', indent, listItem);\n // Set 'bulleted' as default. If this item is pasted into a context,\n const type = data.viewItem.parent && data.viewItem.parent.name == 'ol' ? 'numbered' : 'bulleted';\n writer.setAttribute('listType', type, listItem);\n if (!conversionApi.safeInsert(listItem, data.modelCursor)) {\n return;\n }\n const nextPosition = viewToModelListItemChildrenConverter(listItem, data.viewItem.getChildren(), conversionApi);\n // Result range starts before the first item and ends after the last.\n data.modelRange = writer.createRange(data.modelCursor, nextPosition);\n conversionApi.updateConversionResult(listItem, data);\n }\n};\n/**\n * A view-to-model converter for the `<ul>` and `<ol>` view elements that cleans the input view of garbage.\n * This is mostly to clean whitespaces from between the `<li>` view elements inside the view list element, however, also\n * incorrect data can be cleared if the view was incorrect.\n *\n * @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element\n */\nexport const cleanList = (evt, data, conversionApi) => {\n if (conversionApi.consumable.test(data.viewItem, { name: true })) {\n // Caching children because when we start removing them iterating fails.\n const children = Array.from(data.viewItem.getChildren());\n for (const child of children) {\n const isWrongElement = !(child.is('element', 'li') || isList(child));\n if (isWrongElement) {\n child._remove();\n }\n }\n }\n};\n/**\n * A view-to-model converter for the `<li>` elements that cleans whitespace formatting from the input view.\n *\n * @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element\n */\nexport const cleanListItem = (evt, data, conversionApi) => {\n if (conversionApi.consumable.test(data.viewItem, { name: true })) {\n if (data.viewItem.childCount === 0) {\n return;\n }\n const children = [...data.viewItem.getChildren()];\n let foundList = false;\n for (const child of children) {\n if (foundList && !isList(child)) {\n child._remove();\n }\n if (isList(child)) {\n // If this is a <ul> or <ol>, do not process it, just mark that we already visited list element.\n foundList = true;\n }\n }\n }\n};\n/**\n * Returns a callback for model position to view position mapping for {@link module:engine/conversion/mapper~Mapper}. The callback fixes\n * positions between the `listItem` elements that would be incorrectly mapped because of how list items are represented in the model\n * and in the view.\n */\nexport function modelToViewPosition(view) {\n return (evt, data) => {\n if (data.isPhantom) {\n return;\n }\n const modelItem = data.modelPosition.nodeBefore;\n if (modelItem && modelItem.is('element', 'listItem')) {\n const viewItem = data.mapper.toViewElement(modelItem);\n const topmostViewList = viewItem.getAncestors().find(isList);\n const walker = view.createPositionAt(viewItem, 0).getWalker();\n for (const value of walker) {\n if (value.type == 'elementStart' && value.item.is('element', 'li')) {\n data.viewPosition = value.previousPosition;\n break;\n }\n else if (value.type == 'elementEnd' && value.item == topmostViewList) {\n data.viewPosition = value.nextPosition;\n break;\n }\n }\n }\n };\n}\n/**\n * The callback for view position to model position mapping for {@link module:engine/conversion/mapper~Mapper}. The callback fixes\n * positions between the `<li>` elements that would be incorrectly mapped because of how list items are represented in the model\n * and in the view.\n *\n * @see module:engine/conversion/mapper~Mapper#event:viewToModelPosition\n * @param model Model instance.\n * @returns Returns a conversion callback.\n */\nexport function viewToModelPosition(model) {\n return (evt, data) => {\n const viewPos = data.viewPosition;\n const viewParent = viewPos.parent;\n const mapper = data.mapper;\n if (viewParent.name == 'ul' || viewParent.name == 'ol') {\n // Position is directly in <ul> or <ol>.\n if (!viewPos.isAtEnd) {\n // If position is not at the end, it must be before <li>.\n // Get that <li>, map it to `listItem` and set model position before that `listItem`.\n const modelNode = mapper.toModelElement(viewPos.nodeAfter);\n data.modelPosition = model.createPositionBefore(modelNode);\n }\n else {\n // Position is at the end of <ul> or <ol>, so there is no <li> after it to be mapped.\n // There is <li> before the position, but we cannot just map it to `listItem` and set model position after it,\n // because that <li> may contain nested items.\n // We will check \"model length\" of that <li>, in other words - how many `listItem`s are in that <li>.\n const modelNode = mapper.toModelElement(viewPos.nodeBefore);\n const modelLength = mapper.getModelLength(viewPos.nodeBefore);\n // Then we get model position before mapped `listItem` and shift it accordingly.\n data.modelPosition = model.createPositionBefore(modelNode).getShiftedBy(modelLength);\n }\n evt.stop();\n }\n else if (viewParent.name == 'li' &&\n viewPos.nodeBefore &&\n (viewPos.nodeBefore.name == 'ul' || viewPos.nodeBefore.name == 'ol')) {\n // In most cases when view position is in <li> it is in text and this is a correct position.\n // However, if position is after <ul> or <ol> we have to fix it -- because in model <ul>/<ol> are not in the `listItem`.\n const modelNode = mapper.toModelElement(viewParent);\n // Check all <ul>s and <ol>s that are in the <li> but before mapped position.\n // Get model length of those elements and then add it to the offset of `listItem` mapped to the original <li>.\n let modelLength = 1; // Starts from 1 because the original <li> has to be counted in too.\n let viewList = viewPos.nodeBefore;\n while (viewList && isList(viewList)) {\n modelLength += mapper.getModelLength(viewList);\n viewList = viewList.previousSibling;\n }\n data.modelPosition = model.createPositionBefore(modelNode).getShiftedBy(modelLength);\n evt.stop();\n }\n };\n}\n/**\n * Post-fixer that reacts to changes on document and fixes incorrect model states.\n *\n * In the example below, there is a correct list structure.\n * Then the middle element is removed so the list structure will become incorrect:\n *\n * ```xml\n * <listItem listType=\"bulleted\" listIndent=0>Item 1</listItem>\n * <listItem listType=\"bulleted\" listIndent=1>Item 2</listItem> <--- this is removed.\n * <listItem listType=\"bulleted\" listIndent=2>Item 3</listItem>\n * ```\n *\n * The list structure after the middle element is removed:\n *\n * ```xml\n * <listItem listType=\"bulleted\" listIndent=0>Item 1</listItem>\n * <listItem listType=\"bulleted\" listIndent=2>Item 3</listItem>\n * ```\n *\n * Should become:\n *\n * ```xml\n * <listItem listType=\"bulleted\" listIndent=0>Item 1</listItem>\n * <listItem listType=\"bulleted\" listIndent=1>Item 3</listItem> <--- note that indent got post-fixed.\n * ```\n *\n * @param model The data model.\n * @param writer The writer to do changes with.\n * @returns `true` if any change has been applied, `false` otherwise.\n */\nexport function modelChangePostFixer(model, writer) {\n const changes = model.document.differ.getChanges();\n const itemToListHead = new Map();\n let applied = false;\n for (const entry of changes) {\n if (entry.type == 'insert' && entry.name == 'listItem') {\n _addListToFix(entry.position);\n }\n else if (entry.type == 'insert' && entry.name != 'listItem') {\n if (entry.name != '$text') {\n // In case of renamed element.\n const item = entry.position.nodeAfter;\n if (item.hasAttribute('listIndent')) {\n writer.removeAttribute('listIndent', item);\n applied = true;\n }\n if (item.hasAttribute('listType')) {\n writer.removeAttribute('listType', item);\n applied = true;\n }\n if (item.hasAttribute('listStyle')) {\n writer.removeAttribute('listStyle', item);\n applied = true;\n }\n if (item.hasAttribute('listReversed')) {\n writer.removeAttribute('listReversed', item);\n applied = true;\n }\n if (item.hasAttribute('listStart')) {\n writer.removeAttribute('listStart', item);\n applied = true;\n }\n for (const innerItem of Array.from(model.createRangeIn(item)).filter(e => e.item.is('element', 'listItem'))) {\n _addListToFix(innerItem.previousPosition);\n }\n }\n const posAfter = entry.position.getShiftedBy(entry.length);\n _addListToFix(posAfter);\n }\n else if (entry.type == 'remove' && entry.name == 'listItem') {\n _addListToFix(entry.position);\n }\n else if (entry.type == 'attribute' && entry.attributeKey == 'listIndent') {\n _addListToFix(entry.range.start);\n }\n else if (entry.type == 'attribute' && entry.attributeKey == 'listType') {\n _addListToFix(entry.range.start);\n }\n }\n for (const listHead of itemToListHead.values()) {\n _fixListIndents(listHead);\n _fixListTypes(listHead);\n }\n return applied;\n function _addListToFix(position) {\n const previousNode = position.nodeBefore;\n if (!previousNode || !previousNode.is('element', 'listItem')) {\n const item = position.nodeAfter;\n if (item && item.is('element', 'listItem')) {\n itemToListHead.set(item, item);\n }\n }\n else {\n let listHead = previousNode;\n if (itemToListHead.has(listHead)) {\n return;\n }\n for (\n // Cache previousSibling and reuse for performance reasons. See #6581.\n let previousSibling = listHead.previousSibling; previousSibling && previousSibling.is('element', 'listItem'); previousSibling = listHead.previousSibling) {\n listHead = previousSibling;\n if (itemToListHead.has(listHead)) {\n return;\n }\n }\n itemToListHead.set(previousNode, listHead);\n }\n }\n function _fixListIndents(item) {\n let maxIndent = 0;\n let fixBy = null;\n while (item && item.is('element', 'listItem')) {\n const itemIndent = item.getAttribute('listIndent');\n if (itemIndent > maxIndent) {\n let newIndent;\n if (fixBy === null) {\n fixBy = itemIndent - maxIndent;\n newIndent = maxIndent;\n }\n else {\n if (fixBy > itemIndent) {\n fixBy = itemIndent;\n }\n newIndent = itemIndent - fixBy;\n }\n writer.setAttribute('listIndent', newIndent, item);\n applied = true;\n }\n else {\n fixBy = null;\n maxIndent = item.getAttribute('listIndent') + 1;\n }\n item = item.nextSibling;\n }\n }\n function _fixListTypes(item) {\n let typesStack = [];\n let prev = null;\n while (item && item.is('element', 'listItem')) {\n const itemIndent = item.getAttribute('listIndent');\n if (prev && prev.getAttribute('listIndent') > itemIndent) {\n typesStack = typesStack.slice(0, itemIndent + 1);\n }\n if (itemIndent != 0) {\n if (typesStack[itemIndent]) {\n const type = typesStack[itemIndent];\n if (item.getAttribute('listType') != type) {\n writer.setAttribute('listType', type, item);\n applied = true;\n }\n }\n else {\n typesStack[itemIndent] = item.getAttribute('listType');\n }\n }\n prev = item;\n item = item.nextSibling;\n }\n }\n}\n/**\n * A fixer for pasted content that includes list items.\n *\n * It fixes indentation of pasted list items so the pasted items match correctly to the context they are pasted into.\n *\n * Example:\n *\n * ```xml\n * <listItem listType=\"bulleted\" listIndent=0>A</listItem>\n * <listItem listType=\"bulleted\" listIndent=1>B^</listItem>\n * // At ^ paste: <listItem listType=\"bulleted\" listIndent=4>X</listItem>\n * // <listItem listType=\"bulleted\" listIndent=5>Y</listItem>\n * <listItem listType=\"bulleted\" listIndent=2>C</listItem>\n * ```\n *\n * Should become:\n *\n * ```xml\n * <listItem listType=\"bulleted\" listIndent=0>A</listItem>\n * <listItem listType=\"bulleted\" listIndent=1>BX</listItem>\n * <listItem listType=\"bulleted\" listIndent=2>Y/listItem>\n * <listItem listType=\"bulleted\" listIndent=2>C</listItem>\n * ```\n */\nexport const modelIndentPasteFixer = function (evt, [content, selectable]) {\n const model = this;\n // Check whether inserted content starts from a `listItem`. If it does not, it means that there are some other\n // elements before it and there is no need to fix indents, because even if we insert that content into a list,\n // that list will be broken.\n // Note: we also need to handle singular elements because inserting item with indent 0 into 0,1,[],2\n // would create incorrect model.\n let item = content.is('documentFragment') ? content.getChild(0) : content;\n let selection;\n if (!selectable) {\n selection = model.document.selection;\n }\n else {\n selection = model.createSelection(selectable);\n }\n if (item && item.is('element', 'listItem')) {\n // Get a reference list item. Inserted list items will be fixed according to that item.\n const pos = selection.getFirstPosition();\n let refItem = null;\n if (pos.parent.is('element', 'listItem')) {\n refItem = pos.parent;\n }\n else if (pos.nodeBefore && pos.nodeBefore.is('element', 'listItem')) {\n refItem = pos.nodeBefore;\n }\n // If there is `refItem` it means that we do insert list items into an existing list.\n if (refItem) {\n // First list item in `data` has indent equal to 0 (it is a first list item). It should have indent equal\n // to the indent of reference item. We have to fix the first item and all of it's children and following siblings.\n // Indent of all those items has to be adjusted to reference item.\n const indentChange = refItem.getAttribute('listIndent');\n // Fix only if there is anything to fix.\n if (indentChange > 0) {\n // Adjust indent of all \"first\" list items in inserted data.\n while (item && item.is('element', 'listItem')) {\n item._setAttribute('listIndent', item.getAttribute('listIndent') + indentChange);\n item = item.nextSibling;\n }\n }\n }\n }\n};\n/**\n * Helper function that converts children of a given `<li>` view element into corresponding model elements.\n * The function maintains proper order of elements if model `listItem` is split during the conversion\n * due to block children conversion.\n *\n * @param listItemModel List item model element to which converted children will be inserted.\n * @param viewChildren View elements which will be converted.\n * @param conversionApi Conversion interface to be used by the callback.\n * @returns Position on which next elements should be inserted after children conversion.\n */\nfunction viewToModelListItemChildrenConverter(listItemModel, viewChildren, conversionApi) {\n const { writer, schema } = conversionApi;\n // A position after the last inserted `listItem`.\n let nextPosition = writer.createPositionAfter(listItemModel);\n // Check all children of the converted `<li>`. At this point we assume there are no \"whitespace\" view text nodes\n // in view list, between view list items. This should be handled by `<ul>` and `<ol>` converters.\n for (const child of viewChildren) {\n if (child.name == 'ul' || child.name == 'ol') {\n // If the children is a list, we will insert its conversion result after currently handled `listItem`.\n // Then, next insertion position will be set after all the new list items (and maybe other elements if\n // something split list item).\n //\n // If this is a list, we expect that some `listItem`s and possibly other blocks will be inserted, however `.modelCursor`\n // should be set after last `listItem` (or block). This is why it feels safe to use it as `nextPosition`\n nextPosition = conversionApi.convertItem(child, nextPosition).modelCursor;\n }\n else {\n // If this is not a list, try inserting content at the end of the currently handled `listItem`.\n const result = conversionApi.convertItem(child, writer.createPositionAt(listItemModel, 'end'));\n // It may end up that the current `listItem` becomes split (if that content cannot be inside `listItem`). For example:\n //\n // <li><p>Foo</p></li>\n //\n // will be converted to:\n //\n // <listItem></listItem><paragraph>Foo</paragraph><listItem></listItem>\n //\n const convertedChild = result.modelRange.start.nodeAfter;\n const wasSplit = convertedChild && convertedChild.is('element') && !schema.checkChild(listItemModel, convertedChild.name);\n if (wasSplit) {\n // As `lastListItem` got split, we need to update it to the second part of the split `listItem` element.\n //\n // `modelCursor` should be set to a position where the conversion should continue. There are multiple possible scenarios\n // that may happen. Usually, `modelCursor` (marked as `#` below) would point to the second list item after conversion:\n //\n //\t\t`<li><p>Foo</p></li>` -> `<listItem></listItem><paragraph>Foo</paragraph><listItem>#</listItem>`\n //\n // However, in some cases, like auto-paragraphing, the position is placed at the end of the block element:\n //\n //\t\t`<li><div>Foo</div></li>` -> `<listItem></listItem><paragraph>Foo#</paragraph><listItem></listItem>`\n //\n // or after an element if another element broken auto-paragraphed element:\n //\n //\t\t`<li><div><h2>Foo</h2></div></li>` -> `<listItem></listItem><heading1>Foo</heading1>#<listItem></listItem>`\n //\n // We need to check for such cases and use proper list item and position based on it.\n //\n if (result.modelCursor.parent.is('element', 'listItem')) {\n // (1).\n listItemModel = result.modelCursor.parent;\n }\n else {\n // (2), (3).\n listItemModel = findNextListItem(result.modelCursor);\n }\n nextPosition = writer.createPositionAfter(listItemModel);\n }\n }\n }\n return nextPosition;\n}\n/**\n * Helper function that seeks for a next list item starting from given `startPosition`.\n */\nfunction findNextListItem(startPosition) {\n const treeWalker = new TreeWalker({ startPosition });\n let value;\n do {\n value = treeWalker.next();\n } while (!value.value.item.is('element', 'listItem'));\n return value.value.item;\n}\n/**\n * Helper function that takes all children of given `viewRemovedItem` and moves them in a correct place, according\n * to other given parameters.\n */\nfunction hoistNestedLists(nextIndent, modelRemoveStartPosition, viewRemoveStartPosition, viewRemovedItem, conversionApi, model) {\n // Find correct previous model list item element.\n // The element has to have either same or smaller indent than given reference indent.\n // This will be the model element which will get nested items (if it has smaller indent) or sibling items (if it has same indent).\n // Keep in mind that such element might not be found, if removed item was the first item.\n const prevModelItem = getSiblingListItem(modelRemoveStartPosition.nodeBefore, {\n sameIndent: true,\n smallerIndent: true,\n listIndent: nextIndent\n });\n const mapper = conversionApi.mapper;\n const viewWriter = conversionApi.writer;\n // Indent of found element or `null` if the element has not been found.\n const prevIndent = prevModelItem ? prevModelItem.getAttribute('listIndent') : null;\n let insertPosition;\n if (!prevModelItem) {\n // If element has not been found, simply insert lists at the position where the removed item was:\n //\n // Lorem ipsum.\n // 1 -------- <--- this is removed, no previous list item, put nested items in place of removed item.\n // 1.1 -------- <--- this is reference indent.\n // 1.1.1 --------\n // 1.1.2 --------\n // 1.2 --------\n //\n // Becomes:\n //\n // Lorem ipsum.\n // 1.1 --------\n // 1.1.1 --------\n // 1.1.2 --------\n // 1.2 --------\n insertPosition = viewRemoveStartPosition;\n }\n else if (prevIndent == nextIndent) {\n // If element has been found and has same indent as reference indent it means that nested items should\n // become siblings of found element:\n //\n // 1 --------\n // 1.1 --------\n // 1.2 -------- <--- this is `prevModelItem`.\n // 2 -------- <--- this is removed, previous list item has indent same as reference indent.\n // 2.1 -------- <--- this is reference indent, this and 2.2 should become siblings of 1.2.\n // 2.2 --------\n //\n // Becomes:\n //\n // 1 --------\n // 1.1 --------\n // 1.2 --------\n // 2.1 --------\n // 2.2 --------\n const prevViewList = mapper.toViewElement(prevModelItem).parent;\n insertPosition = viewWriter.createPositionAfter(prevViewList);\n }\n else {\n // If element has been found and has smaller indent as reference indent it means that nested items\n // should become nested items of found item:\n //\n // 1 -------- <--- this is `prevModelItem`.\n // 1.1 -------- <--- this is removed, previous list item has indent smaller than reference indent.\n // 1.1.1 -------- <--- this is reference indent, this and 1.1.1 should become nested items of 1.\n // 1.1.2 --------\n // 1.2 --------\n //\n // Becomes:\n //\n // 1 --------\n // 1.1.1 --------\n // 1.1.2 --------\n // 1.2 --------\n //\n // Note: in this case 1.1.1 have indent 2 while 1 have indent 0. In model that should not be possible,\n // because following item may have indent bigger only by one. But this is fixed by postfixer.\n const modelPosition = model.createPositionAt(prevModelItem, 'end');\n insertPosition = mapper.toViewPosition(modelPosition);\n }\n insertPosition = positionAfterUiElements(insertPosition);\n // Handle multiple lists. This happens if list item has nested numbered and bulleted lists. Following lists\n // are inserted after the first list (no need to recalculate insertion position for them).\n for (const child of [...viewRemovedItem.getChildren()]) {\n if (isList(child)) {\n insertPosition = viewWriter.move(viewWriter.createRangeOn(child), insertPosition).end;\n mergeViewLists(viewWriter, child, child.nextSibling);\n mergeViewLists(viewWriter, child.previousSibling, child);\n }\n }\n}\n/**\n * Checks if view element is a list type (ul or ol).\n */\nfunction isList(viewElement) {\n return viewElement.is('element', 'ol') || viewElement.is('element', 'ul');\n}\n/**\n * Calculates the indent value for a list item. Handles HTML compliant and non-compliant lists.\n *\n * Also, fixes non HTML compliant lists indents:\n *\n * ```\n * before: fixed list:\n * OL OL\n * |-> LI (parent LIs: 0) |-> LI (indent: 0)\n * |-> OL |-> OL\n * |-> OL |\n * | |-> OL |\n * | |-> OL |\n * | |-> LI (parent LIs: 1) |-> LI (indent: 1)\n * |-> LI (parent LIs: 1) |-> LI (indent: 1)\n *\n * before: fixed list:\n * OL OL\n * |-> OL |\n * |-> OL |\n * |-> OL |\n * |-> LI (parent LIs: 0) |-> LI (indent: 0)\n *\n * before: fixed list:\n * OL OL\n * |-> LI (parent LIs: 0) |-> LI (indent: 0)\n * |-> OL |-> OL\n * |-> LI (parent LIs: 0) |-> LI (indent: 1)\n * ```\n */\nfunction getIndent(listItem) {\n let indent = 0;\n let parent = listItem.parent;\n while (parent) {\n // Each LI in the tree will result in an increased indent for HTML compliant lists.\n if (parent.is('element', 'li')) {\n indent++;\n }\n else {\n // If however the list is nested in other list we should check previous sibling of any of the list elements...\n const previousSibling = parent.previousSibling;\n // ...because the we might need increase its indent:\n //\t\tbefore: fixed list:\n //\t\tOL OL\n //\t\t|-> LI (parent LIs: 0) |-> LI (indent: 0)\n //\t\t|-> OL |-> OL\n //\t\t |-> LI (parent LIs: 0) |-> LI (indent: 1)\n if (previousSibling && previousSibling.is('element', 'li')) {\n indent++;\n }\n }\n parent = parent.parent;\n }\n return indent;\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./list.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/list/listediting\n */\nimport ListCommand from './listcommand';\nimport IndentCommand from './indentcommand';\nimport ListUtils from './listutils';\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Enter } from 'ckeditor5/src/enter';\nimport { Delete } from 'ckeditor5/src/typing';\nimport { cleanList, cleanListItem, modelViewInsertion, modelViewChangeType, modelViewMergeAfterChangeType, modelViewMergeAfter, modelViewRemove, modelViewSplitOnInsert, modelViewChangeIndent, modelChangePostFixer, modelIndentPasteFixer, viewModelConverter, modelToViewPosition, viewToModelPosition } from './converters';\nimport '../../theme/list.css';\n/**\n * The engine of the list feature. It handles creating, editing and removing lists and list items.\n *\n * It registers the `'numberedList'`, `'bulletedList'`, `'indentList'` and `'outdentList'` commands.\n */\nexport default class ListEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ListEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [Enter, Delete, ListUtils];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Schema.\n // Note: in case `$block` will ever be allowed in `listItem`, keep in mind that this feature\n // uses `Selection#getSelectedBlocks()` without any additional processing to obtain all selected list items.\n // If there are blocks allowed inside list item, algorithms using `getSelectedBlocks()` will have to be modified.\n editor.model.schema.register('listItem', {\n inheritAllFrom: '$block',\n allowAttributes: ['listType', 'listIndent']\n });\n // Converters.\n const data = editor.data;\n const editing = editor.editing;\n editor.model.document.registerPostFixer(writer => modelChangePostFixer(editor.model, writer));\n editing.mapper.registerViewToModelLength('li', getViewListItemLength);\n data.mapper.registerViewToModelLength('li', getViewListItemLength);\n editing.mapper.on('modelToViewPosition', modelToViewPosition(editing.view));\n editing.mapper.on('viewToModelPosition', viewToModelPosition(editor.model));\n data.mapper.on('modelToViewPosition', modelToViewPosition(editing.view));\n editor.conversion.for('editingDowncast')\n .add(dispatcher => {\n dispatcher.on('insert', modelViewSplitOnInsert, { priority: 'high' });\n dispatcher.on('insert:listItem', modelViewInsertion(editor.model));\n dispatcher.on('attribute:listType:listItem', modelViewChangeType, { priority: 'high' });\n dispatcher.on('attribute:listType:listItem', modelViewMergeAfterChangeType, { priority: 'low' });\n dispatcher.on('attribute:listIndent:listItem', modelViewChangeIndent(editor.model));\n dispatcher.on('remove:listItem', modelViewRemove(editor.model));\n dispatcher.on('remove', modelViewMergeAfter, { priority: 'low' });\n });\n editor.conversion.for('dataDowncast')\n .add(dispatcher => {\n dispatcher.on('insert', modelViewSplitOnInsert, { priority: 'high' });\n dispatcher.on('insert:listItem', modelViewInsertion(editor.model));\n });\n editor.conversion.for('upcast')\n .add(dispatcher => {\n dispatcher.on('element:ul', cleanList, { priority: 'high' });\n dispatcher.on('element:ol', cleanList, { priority: 'high' });\n dispatcher.on('element:li', cleanListItem, { priority: 'high' });\n dispatcher.on('element:li', viewModelConverter);\n });\n // Fix indentation of pasted items.\n editor.model.on('insertContent', modelIndentPasteFixer, { priority: 'high' });\n // Register commands for numbered and bulleted list.\n editor.commands.add('numberedList', new ListCommand(editor, 'numbered'));\n editor.commands.add('bulletedList', new ListCommand(editor, 'bulleted'));\n // Register commands for indenting.\n editor.commands.add('indentList', new IndentCommand(editor, 'forward'));\n editor.commands.add('outdentList', new IndentCommand(editor, 'backward'));\n const viewDocument = editing.view.document;\n // Overwrite default Enter key behavior.\n // If Enter key is pressed with selection collapsed in empty list item, outdent it instead of breaking it.\n this.listenTo(viewDocument, 'enter', (evt, data) => {\n const doc = this.editor.model.document;\n const positionParent = doc.selection.getLastPosition().parent;\n if (doc.selection.isCollapsed && positionParent.name == 'listItem' && positionParent.isEmpty) {\n this.editor.execute('outdentList');\n data.preventDefault();\n evt.stop();\n }\n }, { context: 'li' });\n // Overwrite default Backspace key behavior.\n // If Backspace key is pressed with selection collapsed on first position in first list item, outdent it. #83\n this.listenTo(viewDocument, 'delete', (evt, data) => {\n // Check conditions from those that require less computations like those immediately available.\n if (data.direction !== 'backward') {\n return;\n }\n const selection = this.editor.model.document.selection;\n if (!selection.isCollapsed) {\n return;\n }\n const firstPosition = selection.getFirstPosition();\n if (!firstPosition.isAtStart) {\n return;\n }\n const positionParent = firstPosition.parent;\n if (positionParent.name !== 'listItem') {\n return;\n }\n const previousIsAListItem = positionParent.previousSibling && positionParent.previousSibling.name === 'listItem';\n if (previousIsAListItem) {\n return;\n }\n this.editor.execute('outdentList');\n data.preventDefault();\n evt.stop();\n }, { context: 'li' });\n this.listenTo(editor.editing.view.document, 'tab', (evt, data) => {\n const commandName = data.shiftKey ? 'outdentList' : 'indentList';\n const command = this.editor.commands.get(commandName);\n if (command.isEnabled) {\n editor.execute(commandName);\n data.stopPropagation();\n data.preventDefault();\n evt.stop();\n }\n }, { context: 'li' });\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n const commands = this.editor.commands;\n const indent = commands.get('indent');\n const outdent = commands.get('outdent');\n if (indent) {\n indent.registerChildCommand(commands.get('indentList'));\n }\n if (outdent) {\n outdent.registerChildCommand(commands.get('outdentList'));\n }\n }\n}\nfunction getViewListItemLength(element) {\n let length = 1;\n for (const child of element.getChildren()) {\n if (child.name == 'ul' || child.name == 'ol') {\n for (const item of child.getChildren()) {\n length += getViewListItemLength(item);\n }\n }\n }\n return length;\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zM3.5 3v5H2V3.7H1v-1h2.5V3zM.343 17.857l2.59-3.257H2.92a.6.6 0 1 0-1.04 0H.302a2 2 0 1 1 3.995 0h-.001c-.048.405-.16.734-.333.988-.175.254-.59.692-1.244 1.312H4.3v1h-4l.043-.043zM7 14.75a.75.75 0 0 1 .75-.75h9.5a.75.75 0 1 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M7 5.75c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0C1 4.784 1.777 4 2.75 4c.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75C1.784 7.5 1 6.723 1 5.75zm6 9c0 .414.336.75.75.75h9.5a.75.75 0 1 0 0-1.5h-9.5a.75.75 0 0 0-.75.75zm-6 0c0-.966.777-1.75 1.75-1.75.966 0 1.75.777 1.75 1.75 0 .966-.777 1.75-1.75 1.75-.966 0-1.75-.777-1.75-1.75z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/list/listui\n */\nimport { createUIComponent } from './utils';\nimport numberedListIcon from '../../theme/icons/numberedlist.svg';\nimport bulletedListIcon from '../../theme/icons/bulletedlist.svg';\nimport { Plugin } from 'ckeditor5/src/core';\n/**\n * The list UI feature. It introduces the `'numberedList'` and `'bulletedList'` buttons that\n * allow to convert paragraphs to and from list items and indent or outdent them.\n */\nexport default class ListUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ListUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const t = this.editor.t;\n // Create two buttons and link them with numberedList and bulletedList commands.\n createUIComponent(this.editor, 'numberedList', t('Numbered List'), numberedListIcon);\n createUIComponent(this.editor, 'bulletedList', t('Bulleted List'), bulletedListIcon);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/listproperties/liststylecommand\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { getListTypeFromListStyleType, getSelectedListItems } from '../list/utils';\n/**\n * The list style command. It changes the `listStyle` attribute of the selected list items.\n *\n * If the list type (numbered or bulleted) can be inferred from the passed style type,\n * the command tries to convert selected items to a list of that type.\n * It is used by the {@link module:list/listproperties~ListProperties list properties feature}.\n */\nexport default class ListStyleCommand extends Command {\n /**\n * Creates an instance of the command.\n *\n * @param editor The editor instance.\n * @param defaultType The list type that will be used by default if the value was not specified during\n * the command execution.\n */\n constructor(editor, defaultType) {\n super(editor);\n this.defaultType = defaultType;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n this.value = this._getValue();\n this.isEnabled = this._checkEnabled();\n }\n /**\n * Executes the command.\n *\n * @fires execute\n * @param options.type The type of the list style, e.g. `'disc'` or `'square'`. If `null` is specified, the default\n * style will be applied.\n */\n execute(options = {}) {\n this._tryToConvertItemsToList(options);\n const model = this.editor.model;\n const listItems = getSelectedListItems(model);\n if (!listItems.length) {\n return;\n }\n model.change(writer => {\n for (const item of listItems) {\n writer.setAttribute('listStyle', options.type || this.defaultType, item);\n }\n });\n }\n /**\n * Checks the command's {@link #value}.\n *\n * @returns The current value.\n */\n _getValue() {\n const listItem = this.editor.model.document.selection.getFirstPosition().parent;\n if (listItem && listItem.is('element', 'listItem')) {\n return listItem.getAttribute('listStyle');\n }\n return null;\n }\n /**\n * Checks whether the command can be enabled in the current context.\n *\n * @returns Whether the command should be enabled.\n */\n _checkEnabled() {\n const editor = this.editor;\n const numberedList = editor.commands.get('numberedList');\n const bulletedList = editor.commands.get('bulletedList');\n return numberedList.isEnabled || bulletedList.isEnabled;\n }\n /**\n * Checks if the provided list style is valid. Also changes the selection to a list if it's not set yet.\n *\n * @param The type of the list style. If `null` is specified, the function does nothing.\n */\n _tryToConvertItemsToList(options) {\n if (!options.type) {\n return;\n }\n const listType = getListTypeFromListStyleType(options.type);\n if (!listType) {\n return;\n }\n const editor = this.editor;\n const commandName = `${listType}List`;\n const command = editor.commands.get(commandName);\n if (!command.value) {\n editor.execute(commandName);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/listproperties/listreversedcommand\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { getSelectedListItems } from '../list/utils';\n/**\n * The reversed list command. It changes the `listReversed` attribute of the selected list items. As a result, the list order will be\n * reversed.\n * It is used by the {@link module:list/listproperties~ListProperties list properties feature}.\n */\nexport default class ListReversedCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const value = this._getValue();\n this.value = value;\n this.isEnabled = value != null;\n }\n /**\n * Executes the command.\n *\n * @fires execute\n * @param options.reversed Whether the list should be reversed.\n */\n execute(options = {}) {\n const model = this.editor.model;\n const listItems = getSelectedListItems(model)\n .filter(item => item.getAttribute('listType') == 'numbered');\n model.change(writer => {\n for (const item of listItems) {\n writer.setAttribute('listReversed', !!options.reversed, item);\n }\n });\n }\n /**\n * Checks the command's {@link #value}.\n *\n * @returns The current value.\n */\n _getValue() {\n const listItem = this.editor.model.document.selection.getFirstPosition().parent;\n if (listItem && listItem.is('element', 'listItem') && listItem.getAttribute('listType') == 'numbered') {\n return listItem.getAttribute('listReversed');\n }\n return null;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/listproperties/liststartcommand\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { getSelectedListItems } from '../list/utils';\n/**\n * The list start index command. It changes the `listStart` attribute of the selected list items.\n * It is used by the {@link module:list/listproperties~ListProperties list properties feature}.\n */\nexport default class ListStartCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const value = this._getValue();\n this.value = value;\n this.isEnabled = value != null;\n }\n /**\n * Executes the command.\n *\n * @fires execute\n * @param options.startIndex The list start index.\n */\n execute({ startIndex = 1 } = {}) {\n const model = this.editor.model;\n const listItems = getSelectedListItems(model)\n .filter(item => item.getAttribute('listType') == 'numbered');\n model.change(writer => {\n for (const item of listItems) {\n writer.setAttribute('listStart', startIndex >= 0 ? startIndex : 1, item);\n }\n });\n }\n /**\n * Checks the command's {@link #value}.\n *\n * @returns The current value.\n */\n _getValue() {\n const listItem = this.editor.model.document.selection.getFirstPosition().parent;\n if (listItem && listItem.is('element', 'listItem') && listItem.getAttribute('listType') == 'numbered') {\n return listItem.getAttribute('listStart');\n }\n return null;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/listproperties/listpropertiesediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport ListEditing from '../list/listediting';\nimport ListStyleCommand from './liststylecommand';\nimport ListReversedCommand from './listreversedcommand';\nimport ListStartCommand from './liststartcommand';\nimport { getSiblingListItem, getSiblingNodes } from '../list/utils';\nconst DEFAULT_LIST_TYPE = 'default';\n/**\n * The engine of the list properties feature.\n *\n * It sets the value for the `listItem` attribute of the {@link module:list/list~List `<listItem>`} element that\n * allows modifying the list style type.\n *\n * It registers the `'listStyle'`, `'listReversed'` and `'listStart'` commands if they are enabled in the configuration.\n * Read more in {@link module:list/listconfig~ListPropertiesConfig}.\n */\nexport default class ListPropertiesEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ListEditing];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ListPropertiesEditing';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n editor.config.define('list', {\n properties: {\n styles: true,\n startIndex: false,\n reversed: false\n }\n });\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const model = editor.model;\n const enabledProperties = editor.config.get('list.properties');\n const strategies = createAttributeStrategies(enabledProperties);\n // Extend schema.\n model.schema.extend('listItem', {\n allowAttributes: strategies.map(s => s.attributeName)\n });\n for (const strategy of strategies) {\n strategy.addCommand(editor);\n }\n // Fix list attributes when modifying their nesting levels (the `listIndent` attribute).\n this.listenTo(editor.commands.get('indentList'), '_executeCleanup', fixListAfterIndentListCommand(editor, strategies));\n this.listenTo(editor.commands.get('outdentList'), '_executeCleanup', fixListAfterOutdentListCommand(editor, strategies));\n this.listenTo(editor.commands.get('bulletedList'), '_executeCleanup', restoreDefaultListStyle(editor));\n this.listenTo(editor.commands.get('numberedList'), '_executeCleanup', restoreDefaultListStyle(editor));\n // Register a post-fixer that ensures that the attributes is specified in each `listItem` element.\n model.document.registerPostFixer(fixListAttributesOnListItemElements(editor, strategies));\n // Set up conversion.\n editor.conversion.for('upcast').add(upcastListItemAttributes(strategies));\n editor.conversion.for('downcast').add(downcastListItemAttributes(strategies));\n // Handle merging two separated lists into the single one.\n this._mergeListAttributesWhileMergingLists(strategies);\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n const editor = this.editor;\n // Enable post-fixer that removes the attributes from to-do list items only if the \"TodoList\" plugin is on.\n // We need to registry the hook here since the `TodoList` plugin can be added after the `ListPropertiesEditing`.\n if (editor.commands.get('todoList')) {\n editor.model.document.registerPostFixer(removeListItemAttributesFromTodoList(editor));\n }\n }\n /**\n * Starts listening to {@link module:engine/model/model~Model#deleteContent} and checks whether two lists will be merged into a single\n * one after deleting the content.\n *\n * The purpose of this action is to adjust the `listStyle`, `listReversed` and `listStart` values\n * for the list that was merged.\n *\n * Consider the following model's content:\n *\n * ```xml\n * <listItem listIndent=\"0\" listType=\"bulleted\" listStyle=\"square\">UL List item 1</listItem>\n * <listItem listIndent=\"0\" listType=\"bulleted\" listStyle=\"square\">UL List item 2</listItem>\n * <paragraph>[A paragraph.]</paragraph>\n * <listItem listIndent=\"0\" listType=\"bulleted\" listStyle=\"circle\">UL List item 1</listItem>\n * <listItem listIndent=\"0\" listType=\"bulleted\" listStyle=\"circle\">UL List item 2</listItem>\n * ```\n *\n * After removing the paragraph element, the second list will be merged into the first one.\n * We want to inherit the `listStyle` attribute for the second list from the first one.\n *\n * ```xml\n * <listItem listIndent=\"0\" listType=\"bulleted\" listStyle=\"square\">UL List item 1</listItem>\n * <listItem listIndent=\"0\" listType=\"bulleted\" listStyle=\"square\">UL List item 2</listItem>\n * <listItem listIndent=\"0\" listType=\"bulleted\" listStyle=\"square\">UL List item 1</listItem>\n * <listItem listIndent=\"0\" listType=\"bulleted\" listStyle=\"square\">UL List item 2</listItem>\n * ```\n *\n * See https://github.com/ckeditor/ckeditor5/issues/7879.\n *\n * @param attributeStrategies Strategies for the enabled attributes.\n */\n _mergeListAttributesWhileMergingLists(attributeStrategies) {\n const editor = this.editor;\n const model = editor.model;\n // First the outer-most`listItem` in the first list reference.\n // If found, the lists should be merged and this `listItem` provides the attributes\n // and it is also a starting point when searching for items in the second list.\n let firstMostOuterItem;\n // Check whether the removed content is between two lists.\n this.listenTo(model, 'deleteContent', (evt, [selection]) => {\n const firstPosition = selection.getFirstPosition();\n const lastPosition = selection.getLastPosition();\n // Typing or removing content in a single item. Aborting.\n if (firstPosition.parent === lastPosition.parent) {\n return;\n }\n // An element before the content that will be removed is not a list.\n if (!firstPosition.parent.is('element', 'listItem')) {\n return;\n }\n const nextSibling = lastPosition.parent.nextSibling;\n // An element after the content that will be removed is not a list.\n if (!nextSibling || !nextSibling.is('element', 'listItem')) {\n return;\n }\n // Find the outermost list item based on the `listIndent` attribute. We can't assume that `listIndent=0`\n // because the selection can be hooked in nested lists.\n //\n // <listItem listIndent=\"0\" listType=\"bulleted\" listStyle=\"square\">UL List item 1</listItem>\n // <listItem listIndent=\"1\" listType=\"bulleted\" listStyle=\"square\">UL List [item 1.1</listItem>\n // <listItem listIndent=\"0\" listType=\"bulleted\" listStyle=\"circle\">[]UL List item 1.</listItem>\n // <listItem listIndent=\"1\" listType=\"bulleted\" listStyle=\"circle\">UL List ]item 1.1</listItem>\n //\n // After deleting the content, we would like to inherit the \"square\" attribute for the last element:\n //\n // <listItem listIndent=\"0\" listType=\"bulleted\" listStyle=\"square\">UL List item 1</listItem>\n // <listItem listIndent=\"1\" listType=\"bulleted\" listStyle=\"square\">UL List []item 1.1</listItem>\n const mostOuterItemList = getSiblingListItem(firstPosition.parent, {\n sameIndent: true,\n listIndent: nextSibling.getAttribute('listIndent')\n });\n // The outermost list item may not exist while removing elements between lists with different value\n // of the `listIndent` attribute. In such a case we don't want to update anything. See: #8073.\n if (!mostOuterItemList) {\n return;\n }\n if (mostOuterItemList.getAttribute('listType') === nextSibling.getAttribute('listType')) {\n firstMostOuterItem = mostOuterItemList;\n }\n }, { priority: 'high' });\n // If so, update the `listStyle` attribute for the second list.\n this.listenTo(model, 'deleteContent', () => {\n if (!firstMostOuterItem) {\n return;\n }\n model.change(writer => {\n // Find the first most-outer item list in the merged list.\n // A case when the first list item in the second list was merged into the last item in the first list.\n //\n // <listItem listIndent=\"0\" listType=\"bulleted\" listStyle=\"square\">UL List item 1</listItem>\n // <listItem listIndent=\"0\" listType=\"bulleted\" listStyle=\"square\">UL List item 2</listItem>\n // <listItem listIndent=\"0\" listType=\"bulleted\" listStyle=\"circle\">[]UL List item 1</listItem>\n // <listItem listIndent=\"0\" listType=\"bulleted\" listStyle=\"circle\">UL List item 2</listItem>\n const secondListMostOuterItem = getSiblingListItem(firstMostOuterItem.nextSibling, {\n sameIndent: true,\n listIndent: firstMostOuterItem.getAttribute('listIndent'),\n direction: 'forward'\n });\n // If the selection ends in a non-list element, there are no <listItem>s that would require adjustments.\n // See: #8642.\n if (!secondListMostOuterItem) {\n firstMostOuterItem = null;\n return;\n }\n const items = [\n secondListMostOuterItem,\n ...getSiblingNodes(writer.createPositionAt(secondListMostOuterItem, 0), 'forward')\n ];\n for (const listItem of items) {\n for (const strategy of attributeStrategies) {\n if (strategy.appliesToListItem(listItem)) {\n const attributeName = strategy.attributeName;\n const value = firstMostOuterItem.getAttribute(attributeName);\n writer.setAttribute(attributeName, value, listItem);\n }\n }\n }\n });\n firstMostOuterItem = null;\n }, { priority: 'low' });\n }\n}\n/**\n * Creates an array of strategies for dealing with enabled listItem attributes.\n */\nfunction createAttributeStrategies(enabledProperties) {\n const strategies = [];\n if (enabledProperties.styles) {\n strategies.push({\n attributeName: 'listStyle',\n defaultValue: DEFAULT_LIST_TYPE,\n addCommand(editor) {\n editor.commands.add('listStyle', new ListStyleCommand(editor, DEFAULT_LIST_TYPE));\n },\n appliesToListItem() {\n return true;\n },\n setAttributeOnDowncast(writer, listStyle, element) {\n if (listStyle && listStyle !== DEFAULT_LIST_TYPE) {\n writer.setStyle('list-style-type', listStyle, element);\n }\n else {\n writer.removeStyle('list-style-type', element);\n }\n },\n getAttributeOnUpcast(listParent) {\n return listParent.getStyle('list-style-type') || DEFAULT_LIST_TYPE;\n }\n });\n }\n if (enabledProperties.reversed) {\n strategies.push({\n attributeName: 'listReversed',\n defaultValue: false,\n addCommand(editor) {\n editor.commands.add('listReversed', new ListReversedCommand(editor));\n },\n appliesToListItem(item) {\n return item.getAttribute('listType') == 'numbered';\n },\n setAttributeOnDowncast(writer, listReversed, element) {\n if (listReversed) {\n writer.setAttribute('reversed', 'reversed', element);\n }\n else {\n writer.removeAttribute('reversed', element);\n }\n },\n getAttributeOnUpcast(listParent) {\n return listParent.hasAttribute('reversed');\n }\n });\n }\n if (enabledProperties.startIndex) {\n strategies.push({\n attributeName: 'listStart',\n defaultValue: 1,\n addCommand(editor) {\n editor.commands.add('listStart', new ListStartCommand(editor));\n },\n appliesToListItem(item) {\n return item.getAttribute('listType') == 'numbered';\n },\n setAttributeOnDowncast(writer, listStart, element) {\n if (listStart == 0 || listStart > 1) {\n writer.setAttribute('start', listStart, element);\n }\n else {\n writer.removeAttribute('start', element);\n }\n },\n getAttributeOnUpcast(listParent) {\n const startAttributeValue = listParent.getAttribute('start');\n return startAttributeValue >= 0 ? startAttributeValue : 1;\n }\n });\n }\n return strategies;\n}\n/**\n * Returns a converter consumes the `style`, `reversed` and `start` attribute.\n * In `style` it searches for the `list-style-type` definition.\n * If not found, the `\"default\"` value will be used.\n */\nfunction upcastListItemAttributes(attributeStrategies) {\n return (dispatcher) => {\n dispatcher.on('element:li', (evt, data, conversionApi) => {\n // https://github.com/ckeditor/ckeditor5/issues/13858\n if (!data.modelRange) {\n return;\n }\n const listParent = data.viewItem.parent;\n const listItem = data.modelRange.start.nodeAfter || data.modelRange.end.nodeBefore;\n for (const strategy of attributeStrategies) {\n if (strategy.appliesToListItem(listItem)) {\n const listStyle = strategy.getAttributeOnUpcast(listParent);\n conversionApi.writer.setAttribute(strategy.attributeName, listStyle, listItem);\n }\n }\n }, { priority: 'low' });\n };\n}\n/**\n * Returns a converter that adds `reversed`, `start` attributes and adds `list-style-type` definition as a value for the `style` attribute.\n * The `\"default\"` values are removed and not present in the view/data.\n */\nfunction downcastListItemAttributes(attributeStrategies) {\n return (dispatcher) => {\n for (const strategy of attributeStrategies) {\n dispatcher.on(`attribute:${strategy.attributeName}:listItem`, (evt, data, conversionApi) => {\n const viewWriter = conversionApi.writer;\n const currentElement = data.item;\n const previousElement = getSiblingListItem(currentElement.previousSibling, {\n sameIndent: true,\n listIndent: currentElement.getAttribute('listIndent'),\n direction: 'backward'\n });\n const viewItem = conversionApi.mapper.toViewElement(currentElement);\n // A case when elements represent different lists. We need to separate their container.\n if (!areRepresentingSameList(currentElement, previousElement)) {\n viewWriter.breakContainer(viewWriter.createPositionBefore(viewItem));\n }\n strategy.setAttributeOnDowncast(viewWriter, data.attributeNewValue, viewItem.parent);\n }, { priority: 'low' });\n }\n };\n /**\n * Checks whether specified list items belong to the same list.\n */\n function areRepresentingSameList(listItem1, listItem2) {\n return listItem2 &&\n listItem1.getAttribute('listType') === listItem2.getAttribute('listType') &&\n listItem1.getAttribute('listIndent') === listItem2.getAttribute('listIndent') &&\n listItem1.getAttribute('listStyle') === listItem2.getAttribute('listStyle') &&\n listItem1.getAttribute('listReversed') === listItem2.getAttribute('listReversed') &&\n listItem1.getAttribute('listStart') === listItem2.getAttribute('listStart');\n }\n}\n/**\n * When indenting list, nested list should clear its value for the attributes or inherit from nested lists.\n *\n * ■ List item 1.\n * ■ List item 2.[]\n * ■ List item 3.\n * editor.execute( 'indentList' );\n *\n * ■ List item 1.\n * ○ List item 2.[]\n * ■ List item 3.\n */\nfunction fixListAfterIndentListCommand(editor, attributeStrategies) {\n return (evt, changedItems) => {\n const root = changedItems[0];\n const rootIndent = root.getAttribute('listIndent');\n const itemsToUpdate = changedItems.filter(item => item.getAttribute('listIndent') === rootIndent);\n // A case where a few list items are indented must be checked separately\n // since `getSiblingListItem()` returns the first changed element.\n // ■ List item 1.\n // ○ [List item 2.\n // ○ List item 3.]\n // ■ List item 4.\n //\n // List items: `2` and `3` should be adjusted.\n let previousSibling = null;\n if (root.previousSibling.getAttribute('listIndent') + 1 !== rootIndent) {\n previousSibling = getSiblingListItem(root.previousSibling, {\n sameIndent: true, direction: 'backward', listIndent: rootIndent\n });\n }\n editor.model.change(writer => {\n for (const item of itemsToUpdate) {\n for (const strategy of attributeStrategies) {\n if (strategy.appliesToListItem(item)) {\n const valueToSet = previousSibling == null ?\n strategy.defaultValue :\n previousSibling.getAttribute(strategy.attributeName);\n writer.setAttribute(strategy.attributeName, valueToSet, item);\n }\n }\n }\n });\n };\n}\n/**\n * When outdenting a list, a nested list should copy attribute values\n * from the previous sibling list item including the same value for the `listIndent` value.\n *\n * ■ List item 1.\n * ○ List item 2.[]\n * ■ List item 3.\n *\n * editor.execute( 'outdentList' );\n *\n * ■ List item 1.\n * ■ List item 2.[]\n * ■ List item 3.\n */\nfunction fixListAfterOutdentListCommand(editor, attributeStrategies) {\n return (evt, changedItems) => {\n changedItems = changedItems.reverse().filter(item => item.is('element', 'listItem'));\n if (!changedItems.length) {\n return;\n }\n const indent = changedItems[0].getAttribute('listIndent');\n const listType = changedItems[0].getAttribute('listType');\n let listItem = changedItems[0].previousSibling;\n // ■ List item 1.\n // ○ List item 2.\n // ○ List item 3.[]\n // ■ List item 4.\n //\n // After outdenting a list, `List item 3` should inherit the `listStyle` attribute from `List item 1`.\n //\n // ■ List item 1.\n // ○ List item 2.\n // ■ List item 3.[]\n // ■ List item 4.\n if (listItem.is('element', 'listItem')) {\n while (listItem.getAttribute('listIndent') !== indent) {\n listItem = listItem.previousSibling;\n }\n }\n else {\n listItem = null;\n }\n // Outdenting such a list should restore values based on `List item 4`.\n // ■ List item 1.[]\n // ○ List item 2.\n // ○ List item 3.\n // ■ List item 4.\n if (!listItem) {\n listItem = changedItems[changedItems.length - 1].nextSibling;\n }\n // And such a list should not modify anything.\n // However, `listItem` can indicate a node below the list. Be sure that we have the `listItem` element.\n // ■ List item 1.[]\n // ○ List item 2.\n // ○ List item 3.\n // <paragraph>The later if check.</paragraph>\n if (!listItem || !listItem.is('element', 'listItem')) {\n return;\n }\n // Do not modify the list if found `listItem` represents other type of list than outdented list items.\n if (listItem.getAttribute('listType') !== listType) {\n return;\n }\n editor.model.change(writer => {\n const itemsToUpdate = changedItems.filter(item => item.getAttribute('listIndent') === indent);\n for (const item of itemsToUpdate) {\n for (const strategy of attributeStrategies) {\n if (strategy.appliesToListItem(item)) {\n const attributeName = strategy.attributeName;\n const valueToSet = listItem.getAttribute(attributeName);\n writer.setAttribute(attributeName, valueToSet, item);\n }\n }\n }\n });\n };\n}\n/**\n * Each `listItem` element must have specified the `listStyle`, `listReversed` and `listStart` attributes\n * if they are enabled and supported by its `listType`.\n * This post-fixer checks whether inserted elements `listItem` elements should inherit the attribute values from\n * their sibling nodes or should use the default values.\n *\n * Paragraph[]\n * ■ List item 1. // [listStyle=\"square\", listType=\"bulleted\"]\n * ■ List item 2. // ...\n * ■ List item 3. // ...\n *\n * editor.execute( 'bulletedList' )\n *\n * ■ Paragraph[] // [listStyle=\"square\", listType=\"bulleted\"]\n * ■ List item 1. // [listStyle=\"square\", listType=\"bulleted\"]\n * ■ List item 2.\n * ■ List item 3.\n *\n * It also covers a such change:\n *\n * [Paragraph 1\n * Paragraph 2]\n * ■ List item 1. // [listStyle=\"square\", listType=\"bulleted\"]\n * ■ List item 2. // ...\n * ■ List item 3. // ...\n *\n * editor.execute( 'numberedList' )\n *\n * 1. [Paragraph 1 // [listStyle=\"default\", listType=\"numbered\"]\n * 2. Paragraph 2] // [listStyle=\"default\", listType=\"numbered\"]\n * ■ List item 1. // [listStyle=\"square\", listType=\"bulleted\"]\n * ■ List item 2. // ...\n * ■ List item 3. // ...\n */\nfunction fixListAttributesOnListItemElements(editor, attributeStrategies) {\n return (writer) => {\n let wasFixed = false;\n const insertedListItems = getChangedListItems(editor.model.document.differ.getChanges())\n .filter(item => {\n // Don't touch todo lists. They are handled in another post-fixer.\n return item.getAttribute('listType') !== 'todo';\n });\n if (!insertedListItems.length) {\n return wasFixed;\n }\n // Check whether the last inserted element is next to the `listItem` element.\n //\n // ■ Paragraph[] // <-- The inserted item.\n // ■ List item 1.\n let existingListItem = insertedListItems[insertedListItems.length - 1].nextSibling;\n // If it doesn't, maybe the `listItem` was inserted at the end of the list.\n //\n // ■ List item 1.\n // ■ Paragraph[] // <-- The inserted item.\n if (!existingListItem || !existingListItem.is('element', 'listItem')) {\n existingListItem = insertedListItems[0].previousSibling;\n if (existingListItem) {\n const indent = insertedListItems[0].getAttribute('listIndent');\n // But we need to find a `listItem` with the `listIndent=0` attribute.\n // If doesn't, maybe the `listItem` was inserted at the end of the list.\n //\n // ■ List item 1.\n // ○ List item 2.\n // ■ Paragraph[] // <-- The inserted item.\n while (existingListItem.is('element', 'listItem') && existingListItem.getAttribute('listIndent') !== indent) {\n existingListItem = existingListItem.previousSibling;\n // If the item does not exist, most probably there is no other content in the editor. See: #8072.\n if (!existingListItem) {\n break;\n }\n }\n }\n }\n for (const strategy of attributeStrategies) {\n const attributeName = strategy.attributeName;\n for (const item of insertedListItems) {\n if (!strategy.appliesToListItem(item)) {\n writer.removeAttribute(attributeName, item);\n continue;\n }\n if (!item.hasAttribute(attributeName)) {\n if (shouldInheritListType(existingListItem, item, strategy)) {\n writer.setAttribute(attributeName, existingListItem.getAttribute(attributeName), item);\n }\n else {\n writer.setAttribute(attributeName, strategy.defaultValue, item);\n }\n wasFixed = true;\n }\n else {\n // Adjust the `listStyle`, `listReversed` and `listStart`\n // attributes for inserted (pasted) items. See #8160.\n //\n // ■ List item 1. // [listStyle=\"square\", listType=\"bulleted\"]\n // ○ List item 1.1. // [listStyle=\"circle\", listType=\"bulleted\"]\n // ○ [] (selection is here)\n //\n // Then, pasting a list with different attributes (listStyle, listType):\n //\n // 1. First. // [listStyle=\"decimal\", listType=\"numbered\"]\n // 2. Second // [listStyle=\"decimal\", listType=\"numbered\"]\n //\n // The `listType` attribute will be corrected by the `ListEditing` converters.\n // We need to adjust the `listStyle` attribute. Expected structure:\n //\n // ■ List item 1. // [listStyle=\"square\", listType=\"bulleted\"]\n // ○ List item 1.1. // [listStyle=\"circle\", listType=\"bulleted\"]\n // ○ First. // [listStyle=\"circle\", listType=\"bulleted\"]\n // ○ Second // [listStyle=\"circle\", listType=\"bulleted\"]\n const previousSibling = item.previousSibling;\n if (shouldInheritListTypeFromPreviousItem(previousSibling, item, strategy.attributeName)) {\n writer.setAttribute(attributeName, previousSibling.getAttribute(attributeName), item);\n wasFixed = true;\n }\n }\n }\n }\n return wasFixed;\n };\n}\n/**\n * Checks whether the `listStyle`, `listReversed` and `listStart` attributes\n * should be copied from the `baseItem` element.\n *\n * The attribute should be copied if the inserted element does not have defined it and\n * the value for the element is other than default in the base element.\n */\nfunction shouldInheritListType(baseItem, itemToChange, attributeStrategy) {\n if (!baseItem) {\n return false;\n }\n const baseListAttribute = baseItem.getAttribute(attributeStrategy.attributeName);\n if (!baseListAttribute) {\n return false;\n }\n if (baseListAttribute == attributeStrategy.defaultValue) {\n return false;\n }\n if (baseItem.getAttribute('listType') !== itemToChange.getAttribute('listType')) {\n return false;\n }\n return true;\n}\n/**\n * Checks whether the `listStyle`, `listReversed` and `listStart` attributes\n * should be copied from previous list item.\n *\n * The attribute should be copied if there's a mismatch of styles of the pasted list into a nested list.\n * Top-level lists are not normalized as we allow side-by-side list of different types.\n */\nfunction shouldInheritListTypeFromPreviousItem(previousItem, itemToChange, attributeName) {\n if (!previousItem || !previousItem.is('element', 'listItem')) {\n return false;\n }\n if (itemToChange.getAttribute('listType') !== previousItem.getAttribute('listType')) {\n return false;\n }\n const previousItemIndent = previousItem.getAttribute('listIndent');\n if (previousItemIndent < 1 || previousItemIndent !== itemToChange.getAttribute('listIndent')) {\n return false;\n }\n const previousItemListAttribute = previousItem.getAttribute(attributeName);\n if (!previousItemListAttribute || previousItemListAttribute === itemToChange.getAttribute(attributeName)) {\n return false;\n }\n return true;\n}\n/**\n * Removes the `listStyle`, `listReversed` and `listStart` attributes from \"todo\" list items.\n */\nfunction removeListItemAttributesFromTodoList(editor) {\n return (writer) => {\n const todoListItems = getChangedListItems(editor.model.document.differ.getChanges())\n .filter(item => {\n // Handle the todo lists only. The rest is handled in another post-fixer.\n return item.getAttribute('listType') === 'todo' && (item.hasAttribute('listStyle') ||\n item.hasAttribute('listReversed') ||\n item.hasAttribute('listStart'));\n });\n if (!todoListItems.length) {\n return false;\n }\n for (const item of todoListItems) {\n writer.removeAttribute('listStyle', item);\n writer.removeAttribute('listReversed', item);\n writer.removeAttribute('listStart', item);\n }\n return true;\n };\n}\n/**\n * Restores the `listStyle` attribute after changing the list type.\n */\nfunction restoreDefaultListStyle(editor) {\n return (evt, changedItems) => {\n changedItems = changedItems.filter(item => item.is('element', 'listItem'));\n editor.model.change(writer => {\n for (const item of changedItems) {\n // Remove the attribute. Post-fixer will restore the proper value.\n writer.removeAttribute('listStyle', item);\n }\n });\n };\n}\n/**\n * Returns the `listItem` that was inserted or changed.\n *\n * @param changes The changes list returned by the differ.\n */\nfunction getChangedListItems(changes) {\n const items = [];\n for (const change of changes) {\n const item = getItemFromChange(change);\n if (item && item.is('element', 'listItem')) {\n items.push(item);\n }\n }\n return items;\n}\nfunction getItemFromChange(change) {\n if (change.type === 'attribute') {\n return change.range.start.nodeAfter;\n }\n if (change.type === 'insert') {\n return change.position.nodeAfter;\n }\n return null;\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./collapsible.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { View, ButtonView } from 'ckeditor5/src/ui';\n// eslint-disable-next-line ckeditor5-rules/ckeditor-imports\nimport dropdownArrowIcon from '@ckeditor/ckeditor5-ui/theme/icons/dropdown-arrow.svg';\nimport '../../../theme/collapsible.css';\n/**\n * A collapsible UI component. Consists of a labeled button and a container which can be collapsed\n * by clicking the button. The collapsible container can be a host to other UI views.\n *\n * @internal\n */\nexport default class CollapsibleView extends View {\n /**\n * Creates an instance of the collapsible view.\n *\n * @param locale The {@link module:core/editor/editor~Editor#locale} instance.\n * @param childViews An optional array of initial child views to be inserted into the collapsible.\n */\n constructor(locale, childViews) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('isCollapsed', false);\n this.set('label', '');\n this.buttonView = this._createButtonView();\n this.children = this.createCollection();\n this.set('_collapsibleAriaLabelUid', undefined);\n if (childViews) {\n this.children.addMany(childViews);\n }\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-collapsible',\n bind.if('isCollapsed', 'ck-collapsible_collapsed')\n ]\n },\n children: [\n this.buttonView,\n {\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-collapsible__children'\n ],\n role: 'region',\n hidden: bind.if('isCollapsed', 'hidden'),\n 'aria-labelledby': bind.to('_collapsibleAriaLabelUid')\n },\n children: this.children\n }\n ]\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this._collapsibleAriaLabelUid = this.buttonView.labelView.element.id;\n }\n /**\n * Creates the main {@link #buttonView} of the collapsible.\n */\n _createButtonView() {\n const buttonView = new ButtonView(this.locale);\n const bind = buttonView.bindTemplate;\n buttonView.set({\n withText: true,\n icon: dropdownArrowIcon\n });\n buttonView.extendTemplate({\n attributes: {\n 'aria-expanded': bind.to('isOn', value => String(value))\n }\n });\n buttonView.bind('label').to(this);\n buttonView.bind('isOn').to(this, 'isCollapsed', isCollapsed => !isCollapsed);\n buttonView.on('execute', () => {\n this.isCollapsed = !this.isCollapsed;\n });\n return buttonView;\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./listproperties.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/listproperties/ui/listpropertiesview\n */\nimport { View, ViewCollection, FocusCycler, SwitchButtonView, LabeledFieldView, createLabeledInputNumber, addKeyboardHandlingForGrid } from 'ckeditor5/src/ui';\nimport { FocusTracker, KeystrokeHandler, global } from 'ckeditor5/src/utils';\nimport CollapsibleView from './collapsibleview';\nimport '../../../theme/listproperties.css';\n/**\n * The list properties view to be displayed in the list dropdown.\n *\n * Contains a grid of available list styles and, for numbered list, also the list start index and reversed fields.\n *\n * @internal\n */\nexport default class ListPropertiesView extends View {\n /**\n * Creates an instance of the list properties view.\n *\n * @param locale The {@link module:core/editor/editor~Editor#locale} instance.\n * @param options Options of the view.\n * @param options.enabledProperties An object containing the configuration of enabled list property names.\n * Allows conditional rendering the sub-components of the properties view.\n * @param options.styleButtonViews A list of style buttons to be rendered\n * inside the styles grid. The grid will not be rendered when `enabledProperties` does not include the `'styles'` key.\n * @param options.styleGridAriaLabel An assistive technologies label set on the grid of styles (if the grid is rendered).\n */\n constructor(locale, { enabledProperties, styleButtonViews, styleGridAriaLabel }) {\n super(locale);\n /**\n * A view that renders the grid of list styles.\n */\n this.stylesView = null;\n /**\n * A collapsible view that hosts additional list property fields ({@link #startIndexFieldView} and\n * {@link #reversedSwitchButtonView}) to visually separate them from the {@link #stylesView grid of styles}.\n *\n * **Note**: Only present when:\n * * the view represents **numbered** list properties,\n * * and the {@link #stylesView} is rendered,\n * * and either {@link #startIndexFieldView} or {@link #reversedSwitchButtonView} is rendered.\n *\n * @readonly\n */\n this.additionalPropertiesCollapsibleView = null;\n /**\n * A labeled number field allowing the user to set the start index of the list.\n *\n * **Note**: Only present when the view represents **numbered** list properties.\n *\n * @readonly\n */\n this.startIndexFieldView = null;\n /**\n * A switch button allowing the user to make the edited list reversed.\n *\n * **Note**: Only present when the view represents **numbered** list properties.\n *\n * @readonly\n */\n this.reversedSwitchButtonView = null;\n /**\n * Tracks information about the DOM focus in the view.\n */\n this.focusTracker = new FocusTracker();\n /**\n * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.\n */\n this.keystrokes = new KeystrokeHandler();\n /**\n * A collection of views that can be focused in the properties view.\n */\n this.focusables = new ViewCollection();\n const elementCssClasses = [\n 'ck',\n 'ck-list-properties'\n ];\n this.children = this.createCollection();\n this.focusCycler = new FocusCycler({\n focusables: this.focusables,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate #children backwards using the <kbd>Shift</kbd> + <kbd>Tab</kbd> keystroke.\n focusPrevious: 'shift + tab',\n // Navigate #children forwards using the <kbd>Tab</kbd> key.\n focusNext: 'tab'\n }\n });\n // The rendering of the styles grid is conditional. When there is no styles grid, the view will render without collapsible\n // for numbered list properties, hence simplifying the layout.\n if (enabledProperties.styles) {\n this.stylesView = this._createStylesView(styleButtonViews, styleGridAriaLabel);\n this.children.add(this.stylesView);\n }\n else {\n elementCssClasses.push('ck-list-properties_without-styles');\n }\n // The rendering of the numbered list property views is also conditional. It only makes sense for the numbered list\n // dropdown. The unordered list does not have such properties.\n if (enabledProperties.startIndex || enabledProperties.reversed) {\n this._addNumberedListPropertyViews(enabledProperties);\n elementCssClasses.push('ck-list-properties_with-numbered-properties');\n }\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: elementCssClasses\n },\n children: this.children\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n if (this.stylesView) {\n this.focusables.add(this.stylesView);\n this.focusTracker.add(this.stylesView.element);\n // Register the collapsible toggle button to the focus system.\n if (this.startIndexFieldView || this.reversedSwitchButtonView) {\n this.focusables.add(this.children.last.buttonView);\n this.focusTracker.add(this.children.last.buttonView.element);\n }\n for (const item of this.stylesView.children) {\n this.stylesView.focusTracker.add(item.element);\n }\n addKeyboardHandlingForGrid({\n keystrokeHandler: this.stylesView.keystrokes,\n focusTracker: this.stylesView.focusTracker,\n gridItems: this.stylesView.children,\n // Note: The styles view has a different number of columns depending on whether the other properties\n // are enabled in the dropdown or not (https://github.com/ckeditor/ckeditor5/issues/12340)\n numberOfColumns: () => global.window\n .getComputedStyle(this.stylesView.element)\n .getPropertyValue('grid-template-columns')\n .split(' ')\n .length,\n uiLanguageDirection: this.locale && this.locale.uiLanguageDirection\n });\n }\n if (this.startIndexFieldView) {\n this.focusables.add(this.startIndexFieldView);\n this.focusTracker.add(this.startIndexFieldView.element);\n const stopPropagation = (data) => data.stopPropagation();\n // Since the form is in the dropdown panel which is a child of the toolbar, the toolbar's\n // keystroke handler would take over the key management in the input. We need to prevent\n // this ASAP. Otherwise, the basic caret movement using the arrow keys will be impossible.\n this.keystrokes.set('arrowright', stopPropagation);\n this.keystrokes.set('arrowleft', stopPropagation);\n this.keystrokes.set('arrowup', stopPropagation);\n this.keystrokes.set('arrowdown', stopPropagation);\n }\n if (this.reversedSwitchButtonView) {\n this.focusables.add(this.reversedSwitchButtonView);\n this.focusTracker.add(this.reversedSwitchButtonView.element);\n }\n // Start listening for the keystrokes coming from #element.\n this.keystrokes.listenTo(this.element);\n }\n /**\n * @inheritDoc\n */\n focus() {\n this.focusCycler.focusFirst();\n }\n /**\n * @inheritDoc\n */\n focusLast() {\n this.focusCycler.focusLast();\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Creates the list styles grid.\n *\n * @param styleButtons Buttons to be placed in the grid.\n * @param styleGridAriaLabel The assistive technology label of the grid.\n */\n _createStylesView(styleButtons, styleGridAriaLabel) {\n const stylesView = new View(this.locale);\n stylesView.children = stylesView.createCollection();\n stylesView.children.addMany(styleButtons);\n stylesView.setTemplate({\n tag: 'div',\n attributes: {\n 'aria-label': styleGridAriaLabel,\n class: [\n 'ck',\n 'ck-list-styles-list'\n ]\n },\n children: stylesView.children\n });\n stylesView.children.delegate('execute').to(this);\n stylesView.focus = function () {\n this.children.first.focus();\n };\n stylesView.focusTracker = new FocusTracker();\n stylesView.keystrokes = new KeystrokeHandler();\n stylesView.render();\n stylesView.keystrokes.listenTo(stylesView.element);\n return stylesView;\n }\n /**\n * Renders {@link #startIndexFieldView} and/or {@link #reversedSwitchButtonView} depending on the configuration of the properties view.\n *\n * @param enabledProperties An object containing the configuration of enabled list property names\n * (see {@link #constructor}).\n */\n _addNumberedListPropertyViews(enabledProperties) {\n const t = this.locale.t;\n const numberedPropertyViews = [];\n if (enabledProperties.startIndex) {\n this.startIndexFieldView = this._createStartIndexField();\n numberedPropertyViews.push(this.startIndexFieldView);\n }\n if (enabledProperties.reversed) {\n this.reversedSwitchButtonView = this._createReversedSwitchButton();\n numberedPropertyViews.push(this.reversedSwitchButtonView);\n }\n // When there are some style buttons, pack the numbered list properties into a collapsible to separate them.\n if (enabledProperties.styles) {\n this.additionalPropertiesCollapsibleView = new CollapsibleView(this.locale, numberedPropertyViews);\n this.additionalPropertiesCollapsibleView.set({\n label: t('List properties'),\n isCollapsed: true\n });\n // Don't enable the collapsible view unless either start index or reversed field is enabled (e.g. when no list is selected).\n this.additionalPropertiesCollapsibleView.buttonView.bind('isEnabled').toMany(numberedPropertyViews, 'isEnabled', (...areEnabled) => areEnabled.some(isEnabled => isEnabled));\n // Automatically collapse the additional properties collapsible when either start index or reversed field gets disabled.\n this.additionalPropertiesCollapsibleView.buttonView.on('change:isEnabled', (evt, data, isEnabled) => {\n if (!isEnabled) {\n this.additionalPropertiesCollapsibleView.isCollapsed = true;\n }\n });\n this.children.add(this.additionalPropertiesCollapsibleView);\n }\n else {\n this.children.addMany(numberedPropertyViews);\n }\n }\n /**\n * Creates the list start index labeled field.\n */\n _createStartIndexField() {\n const t = this.locale.t;\n const startIndexFieldView = new LabeledFieldView(this.locale, createLabeledInputNumber);\n startIndexFieldView.set({\n label: t('Start at'),\n class: 'ck-numbered-list-properties__start-index'\n });\n startIndexFieldView.fieldView.set({\n min: 0,\n step: 1,\n value: 1,\n inputMode: 'numeric'\n });\n startIndexFieldView.fieldView.on('input', () => {\n const inputElement = startIndexFieldView.fieldView.element;\n const startIndex = inputElement.valueAsNumber;\n if (Number.isNaN(startIndex)) {\n return;\n }\n if (!inputElement.checkValidity()) {\n startIndexFieldView.errorText = t('Start index must be greater than 0.');\n }\n else {\n this.fire('listStart', { startIndex });\n }\n });\n return startIndexFieldView;\n }\n /**\n * Creates the reversed list switch button.\n */\n _createReversedSwitchButton() {\n const t = this.locale.t;\n const reversedButtonView = new SwitchButtonView(this.locale);\n reversedButtonView.set({\n withText: true,\n label: t('Reversed order'),\n class: 'ck-numbered-list-properties__reversed-order'\n });\n reversedButtonView.delegate('execute').to(this, 'listReversed');\n return reversedButtonView;\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./liststyles.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/listproperties/listpropertiesui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ButtonView, SplitButtonView, createDropdown, focusChildOnDropdownOpen } from 'ckeditor5/src/ui';\nimport ListPropertiesView from './ui/listpropertiesview';\nimport bulletedListIcon from '../../theme/icons/bulletedlist.svg';\nimport numberedListIcon from '../../theme/icons/numberedlist.svg';\nimport listStyleDiscIcon from '../../theme/icons/liststyledisc.svg';\nimport listStyleCircleIcon from '../../theme/icons/liststylecircle.svg';\nimport listStyleSquareIcon from '../../theme/icons/liststylesquare.svg';\nimport listStyleDecimalIcon from '../../theme/icons/liststyledecimal.svg';\nimport listStyleDecimalWithLeadingZeroIcon from '../../theme/icons/liststyledecimalleadingzero.svg';\nimport listStyleLowerRomanIcon from '../../theme/icons/liststylelowerroman.svg';\nimport listStyleUpperRomanIcon from '../../theme/icons/liststyleupperroman.svg';\nimport listStyleLowerLatinIcon from '../../theme/icons/liststylelowerlatin.svg';\nimport listStyleUpperLatinIcon from '../../theme/icons/liststyleupperlatin.svg';\nimport '../../theme/liststyles.css';\n/**\n * The list properties UI plugin. It introduces the extended `'bulletedList'` and `'numberedList'` toolbar\n * buttons that allow users to control such aspects of list as the marker, start index or order.\n *\n * **Note**: Buttons introduced by this plugin override implementations from the {@link module:list/list/listui~ListUI}\n * (because they share the same names).\n */\nexport default class ListPropertiesUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ListPropertiesUI';\n }\n init() {\n const editor = this.editor;\n const t = editor.locale.t;\n const enabledProperties = editor.config.get('list.properties');\n // Note: When this plugin does not register the \"bulletedList\" dropdown due to properties configuration,\n // a simple button will be still registered under the same name by ListUI as a fallback. This should happen\n // in most editor configuration because the List plugin automatically requires ListUI.\n if (enabledProperties.styles) {\n editor.ui.componentFactory.add('bulletedList', getDropdownViewCreator({\n editor,\n parentCommandName: 'bulletedList',\n buttonLabel: t('Bulleted List'),\n buttonIcon: bulletedListIcon,\n styleGridAriaLabel: t('Bulleted list styles toolbar'),\n styleDefinitions: [\n {\n label: t('Toggle the disc list style'),\n tooltip: t('Disc'),\n type: 'disc',\n icon: listStyleDiscIcon\n },\n {\n label: t('Toggle the circle list style'),\n tooltip: t('Circle'),\n type: 'circle',\n icon: listStyleCircleIcon\n },\n {\n label: t('Toggle the square list style'),\n tooltip: t('Square'),\n type: 'square',\n icon: listStyleSquareIcon\n }\n ]\n }));\n }\n // Note: When this plugin does not register the \"numberedList\" dropdown due to properties configuration,\n // a simple button will be still registered under the same name by ListUI as a fallback. This should happen\n // in most editor configuration because the List plugin automatically requires ListUI.\n if (enabledProperties.styles || enabledProperties.startIndex || enabledProperties.reversed) {\n editor.ui.componentFactory.add('numberedList', getDropdownViewCreator({\n editor,\n parentCommandName: 'numberedList',\n buttonLabel: t('Numbered List'),\n buttonIcon: numberedListIcon,\n styleGridAriaLabel: t('Numbered list styles toolbar'),\n styleDefinitions: [\n {\n label: t('Toggle the decimal list style'),\n tooltip: t('Decimal'),\n type: 'decimal',\n icon: listStyleDecimalIcon\n },\n {\n label: t('Toggle the decimal with leading zero list style'),\n tooltip: t('Decimal with leading zero'),\n type: 'decimal-leading-zero',\n icon: listStyleDecimalWithLeadingZeroIcon\n },\n {\n label: t('Toggle the lowerroman list style'),\n tooltip: t('Lowerroman'),\n type: 'lower-roman',\n icon: listStyleLowerRomanIcon\n },\n {\n label: t('Toggle the upperroman list style'),\n tooltip: t('Upper-roman'),\n type: 'upper-roman',\n icon: listStyleUpperRomanIcon\n },\n {\n label: t('Toggle the lowerlatin list style'),\n tooltip: t('Lower-latin'),\n type: 'lower-latin',\n icon: listStyleLowerLatinIcon\n },\n {\n label: t('Toggle the upperlatin list style'),\n tooltip: t('Upper-latin'),\n type: 'upper-latin',\n icon: listStyleUpperLatinIcon\n }\n ]\n }));\n }\n }\n}\n/**\n * A helper that returns a function that creates a split button with a toolbar in the dropdown,\n * which in turn contains buttons allowing users to change list styles in the context of the current selection.\n *\n * @param options.editor\n * @param options.parentCommandName The name of the higher-order editor command associated with\n * the set of particular list styles (e.g. \"bulletedList\" for \"disc\", \"circle\", and \"square\" styles).\n * @param options.buttonLabel Label of the main part of the split button.\n * @param options.buttonIcon The SVG string of an icon for the main part of the split button.\n * @param options.styleGridAriaLabel The ARIA label for the styles grid in the split button dropdown.\n * @param options.styleDefinitions Definitions of the style buttons.\n * @returns A function that can be passed straight into {@link module:ui/componentfactory~ComponentFactory#add}.\n */\nfunction getDropdownViewCreator({ editor, parentCommandName, buttonLabel, buttonIcon, styleGridAriaLabel, styleDefinitions }) {\n const parentCommand = editor.commands.get(parentCommandName);\n return (locale) => {\n const dropdownView = createDropdown(locale, SplitButtonView);\n const mainButtonView = dropdownView.buttonView;\n dropdownView.bind('isEnabled').to(parentCommand);\n dropdownView.class = 'ck-list-styles-dropdown';\n // Main button was clicked.\n mainButtonView.on('execute', () => {\n editor.execute(parentCommandName);\n editor.editing.view.focus();\n });\n mainButtonView.set({\n label: buttonLabel,\n icon: buttonIcon,\n tooltip: true,\n isToggleable: true\n });\n mainButtonView.bind('isOn').to(parentCommand, 'value', value => !!value);\n dropdownView.once('change:isOpen', () => {\n const listPropertiesView = createListPropertiesView({\n editor,\n dropdownView,\n parentCommandName,\n styleGridAriaLabel,\n styleDefinitions\n });\n dropdownView.panelView.children.add(listPropertiesView);\n });\n // Focus the editable after executing the command.\n // Overrides a default behaviour where the focus is moved to the dropdown button (#12125).\n dropdownView.on('execute', () => {\n editor.editing.view.focus();\n });\n return dropdownView;\n };\n}\n/**\n * A helper that returns a function (factory) that creates individual buttons used by users to change styles\n * of lists.\n *\n * @param options.editor\n * @param options.listStyleCommand The instance of the `ListStylesCommand` class.\n * @param options.parentCommandName The name of the higher-order command associated with a\n * particular list style (e.g. \"bulletedList\" is associated with \"square\" and \"numberedList\" is associated with \"roman\").\n * @returns A function that can be passed straight into {@link module:ui/componentfactory~ComponentFactory#add}.\n */\nfunction getStyleButtonCreator({ editor, listStyleCommand, parentCommandName }) {\n const locale = editor.locale;\n const parentCommand = editor.commands.get(parentCommandName);\n return ({ label, type, icon, tooltip }) => {\n const button = new ButtonView(locale);\n button.set({ label, icon, tooltip });\n listStyleCommand.on('change:value', () => {\n button.isOn = listStyleCommand.value === type;\n });\n button.on('execute', () => {\n // If the content the selection is anchored to is a list, let's change its style.\n if (parentCommand.value) {\n // If the current list style is not set in the model or the style is different than the\n // one to be applied, simply apply the new style.\n if (listStyleCommand.value !== type) {\n editor.execute('listStyle', { type });\n }\n // If the style was the same, remove it (the button works as an off toggle).\n else {\n editor.execute('listStyle', { type: listStyleCommand.defaultType });\n }\n }\n // Otherwise, leave the creation of the styled list to the `ListStyleCommand`.\n else {\n editor.model.change(() => {\n editor.execute('listStyle', { type });\n });\n }\n });\n return button;\n };\n}\n/**\n * A helper that creates the properties view for the individual style dropdown.\n *\n * @param options.editor Editor instance.\n * @param options.dropdownView Styles dropdown view that hosts the properties view.\n * @param options.parentCommandName The name of the higher-order editor command associated with\n * the set of particular list styles (e.g. \"bulletedList\" for \"disc\", \"circle\", and \"square\" styles).\n * @param options.styleDefinitions Definitions of the style buttons.\n * @param options.styleGridAriaLabel An assistive technologies label set on the grid of styles (if the grid is rendered).\n */\nfunction createListPropertiesView({ editor, dropdownView, parentCommandName, styleDefinitions, styleGridAriaLabel }) {\n const locale = editor.locale;\n const enabledProperties = editor.config.get('list.properties');\n let styleButtonViews = null;\n if (parentCommandName != 'numberedList') {\n enabledProperties.startIndex = false;\n enabledProperties.reversed = false;\n }\n if (enabledProperties.styles) {\n const listStyleCommand = editor.commands.get('listStyle');\n const styleButtonCreator = getStyleButtonCreator({\n editor,\n parentCommandName,\n listStyleCommand\n });\n // The command can be ListStyleCommand or DocumentListStyleCommand.\n const isStyleTypeSupported = typeof listStyleCommand.isStyleTypeSupported == 'function' ?\n (styleDefinition) => listStyleCommand.isStyleTypeSupported(styleDefinition.type) :\n () => true;\n styleButtonViews = styleDefinitions.filter(isStyleTypeSupported).map(styleButtonCreator);\n }\n const listPropertiesView = new ListPropertiesView(locale, {\n styleGridAriaLabel,\n enabledProperties,\n styleButtonViews\n });\n if (enabledProperties.styles) {\n // Accessibility: focus the first active style when opening the dropdown.\n focusChildOnDropdownOpen(dropdownView, () => {\n return listPropertiesView.stylesView.children.find((child) => child.isOn);\n });\n }\n if (enabledProperties.startIndex) {\n const listStartCommand = editor.commands.get('listStart');\n listPropertiesView.startIndexFieldView.bind('isEnabled').to(listStartCommand);\n listPropertiesView.startIndexFieldView.fieldView.bind('value').to(listStartCommand);\n listPropertiesView.on('listStart', (evt, data) => editor.execute('listStart', data));\n }\n if (enabledProperties.reversed) {\n const listReversedCommand = editor.commands.get('listReversed');\n listPropertiesView.reversedSwitchButtonView.bind('isEnabled').to(listReversedCommand);\n listPropertiesView.reversedSwitchButtonView.bind('isOn').to(listReversedCommand, 'value', value => !!value);\n listPropertiesView.on('listReversed', () => {\n const isReversed = listReversedCommand.value;\n editor.execute('listReversed', { reversed: !isReversed });\n });\n }\n // Make sure applying styles closes the dropdown.\n listPropertiesView.delegate('execute').to(dropdownView);\n return listPropertiesView;\n}\n","export default \"<svg viewBox=\\\"0 0 44 44\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z\\\" fill-opacity=\\\".163\\\"/><path d=\\\"M11 27a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm0-9a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm0-9a3 3 0 1 1 0 6 3 3 0 0 1 0-6z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 44 44\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z\\\" fill-opacity=\\\".163\\\"/><path d=\\\"M11 27a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm0 1a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm0-10a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm0 1a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm0-10a3 3 0 1 1 0 6 3 3 0 0 1 0-6zm0 1a2 2 0 1 0 0 4 2 2 0 0 0 0-4z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 44 44\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z\\\" fill-opacity=\\\".163\\\"/><path d=\\\"M14 27v6H8v-6h6zm0-9v6H8v-6h6zm0-9v6H8V9h6z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 44 44\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z\\\" fill-opacity=\\\".163\\\"/><path d=\\\"M10.29 15V8.531H9.286c-.14.393-.4.736-.778 1.03-.378.295-.728.495-1.05.6v1.121a4.257 4.257 0 0 0 1.595-.936V15h1.235zm3.343 0v-1.235h-1.235V15h1.235zM11.3 24v-1.147H8.848c.064-.111.148-.226.252-.343.104-.117.351-.354.74-.712.39-.357.66-.631.81-.821.225-.288.39-.562.494-.824.104-.263.156-.539.156-.829 0-.51-.182-.936-.545-1.279-.363-.342-.863-.514-1.499-.514-.58 0-1.063.148-1.45.444-.387.296-.617.784-.69 1.463l1.23.124c.024-.36.112-.619.264-.774.153-.155.358-.233.616-.233.26 0 .465.074.613.222.148.148.222.36.222.635 0 .25-.085.501-.255.756-.126.185-.468.536-1.024 1.055-.692.641-1.155 1.156-1.389 1.544-.234.389-.375.8-.422 1.233H11.3zm2.333 0v-1.235h-1.235V24h1.235zM9.204 34.11c.615 0 1.129-.2 1.542-.598.413-.398.62-.88.62-1.446 0-.39-.11-.722-.332-.997a1.5 1.5 0 0 0-.886-.532c.619-.337.928-.788.928-1.353 0-.399-.151-.756-.453-1.073-.366-.386-.852-.58-1.459-.58a2.25 2.25 0 0 0-.96.2 1.617 1.617 0 0 0-.668.55c-.16.232-.28.544-.358.933l1.138.194c.032-.282.123-.495.272-.642.15-.146.33-.22.54-.22.215 0 .386.065.515.194s.193.302.193.518c0 .255-.087.46-.263.613-.176.154-.43.227-.765.218l-.136 1.006c.22-.061.409-.092.567-.092.24 0 .444.09.61.272.168.182.251.428.251.739 0 .328-.087.589-.261.782a.833.833 0 0 1-.644.29.841.841 0 0 1-.607-.242c-.167-.16-.27-.394-.307-.698l-1.196.145c.062.542.285.98.668 1.316.384.335.868.503 1.45.503zm4.43-.11v-1.235h-1.236V34h1.235z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 44 44\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z\\\" fill-opacity=\\\".163\\\"/><path d=\\\"M5.714 15.11c.624 0 1.11-.22 1.46-.66.421-.533.632-1.408.632-2.627 0-1.222-.21-2.096-.629-2.624-.351-.445-.839-.668-1.463-.668-.624 0-1.11.22-1.459.66-.422.533-.633 1.406-.633 2.619 0 1.236.192 2.095.576 2.577.384.482.89.723 1.516.723zm0-1.024a.614.614 0 0 1-.398-.14c-.115-.094-.211-.283-.287-.565-.077-.283-.115-.802-.115-1.558s.043-1.294.128-1.613c.064-.246.155-.417.272-.512a.617.617 0 0 1 .4-.143.61.61 0 0 1 .398.143c.116.095.211.284.288.567.076.283.114.802.114 1.558s-.043 1.292-.128 1.608c-.064.246-.155.417-.272.512a.617.617 0 0 1-.4.143zm6.078.914V8.531H10.79c-.14.393-.4.736-.778 1.03-.378.295-.728.495-1.05.6v1.121a4.257 4.257 0 0 0 1.595-.936V15h1.235zm3.344 0v-1.235h-1.235V15h1.235zm-9.422 9.11c.624 0 1.11-.22 1.46-.66.421-.533.632-1.408.632-2.627 0-1.222-.21-2.096-.629-2.624-.351-.445-.839-.668-1.463-.668-.624 0-1.11.22-1.459.66-.422.533-.633 1.406-.633 2.619 0 1.236.192 2.095.576 2.577.384.482.89.723 1.516.723zm0-1.024a.614.614 0 0 1-.398-.14c-.115-.094-.211-.283-.287-.565-.077-.283-.115-.802-.115-1.558s.043-1.294.128-1.613c.064-.246.155-.417.272-.512a.617.617 0 0 1 .4-.143.61.61 0 0 1 .398.143c.116.095.211.284.288.567.076.283.114.802.114 1.558s-.043 1.292-.128 1.608c-.064.246-.155.417-.272.512a.617.617 0 0 1-.4.143zm7.088.914v-1.147H10.35c.065-.111.149-.226.253-.343.104-.117.35-.354.74-.712.39-.357.66-.631.81-.821.225-.288.39-.562.493-.824.104-.263.156-.539.156-.829 0-.51-.181-.936-.544-1.279-.364-.342-.863-.514-1.499-.514-.58 0-1.063.148-1.45.444-.387.296-.617.784-.69 1.463l1.23.124c.024-.36.112-.619.264-.774.152-.155.357-.233.615-.233.261 0 .465.074.613.222.148.148.222.36.222.635 0 .25-.085.501-.255.756-.126.185-.467.536-1.024 1.055-.691.641-1.154 1.156-1.388 1.544-.235.389-.375.8-.422 1.233h4.328zm2.334 0v-1.235h-1.235V24h1.235zM5.714 34.11c.624 0 1.11-.22 1.46-.66.421-.533.632-1.408.632-2.627 0-1.222-.21-2.096-.629-2.624-.351-.445-.839-.668-1.463-.668-.624 0-1.11.22-1.459.66-.422.533-.633 1.406-.633 2.619 0 1.236.192 2.095.576 2.577.384.482.89.723 1.516.723zm0-1.024a.614.614 0 0 1-.398-.14c-.115-.094-.211-.283-.287-.565-.077-.283-.115-.802-.115-1.558s.043-1.294.128-1.613c.064-.246.155-.417.272-.512a.617.617 0 0 1 .4-.143.61.61 0 0 1 .398.143c.116.095.211.284.288.567.076.283.114.802.114 1.558s-.043 1.292-.128 1.608c-.064.246-.155.417-.272.512a.617.617 0 0 1-.4.143zm4.992 1.024c.616 0 1.13-.2 1.543-.598.413-.398.62-.88.62-1.446 0-.39-.111-.722-.332-.997a1.5 1.5 0 0 0-.886-.532c.618-.337.927-.788.927-1.353 0-.399-.15-.756-.452-1.073-.366-.386-.853-.58-1.46-.58a2.25 2.25 0 0 0-.96.2 1.617 1.617 0 0 0-.667.55c-.16.232-.28.544-.359.933l1.139.194c.032-.282.123-.495.272-.642.15-.146.33-.22.54-.22.214 0 .386.065.515.194s.193.302.193.518c0 .255-.088.46-.264.613-.175.154-.43.227-.764.218l-.136 1.006c.22-.061.408-.092.566-.092.24 0 .444.09.611.272.167.182.25.428.25.739 0 .328-.086.589-.26.782a.833.833 0 0 1-.644.29.841.841 0 0 1-.607-.242c-.167-.16-.27-.394-.308-.698l-1.195.145c.062.542.284.98.668 1.316.384.335.867.503 1.45.503zm4.43-.11v-1.235h-1.235V34h1.235z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 44 44\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z\\\" fill-opacity=\\\".163\\\"/><path d=\\\"M11.88 8.7V7.558h-1.234V8.7h1.234zm0 5.3V9.333h-1.234V14h1.234zm2.5 0v-1.235h-1.234V14h1.235zm-4.75 4.7v-1.142H8.395V18.7H9.63zm0 5.3v-4.667H8.395V24H9.63zm2.5-5.3v-1.142h-1.234V18.7h1.235zm0 5.3v-4.667h-1.234V24h1.235zm2.501 0v-1.235h-1.235V24h1.235zM7.38 28.7v-1.142H6.145V28.7H7.38zm0 5.3v-4.667H6.145V34H7.38zm2.5-5.3v-1.142H8.646V28.7H9.88zm0 5.3v-4.667H8.646V34H9.88zm2.5-5.3v-1.142h-1.234V28.7h1.235zm0 5.3v-4.667h-1.234V34h1.235zm2.501 0v-1.235h-1.235V34h1.235z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 44 44\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z\\\" fill-opacity=\\\".163\\\"/><path d=\\\"M11.916 15V8.558h-1.301V15h1.3zm2.465 0v-1.235h-1.235V15h1.235zM9.665 25v-6.442h-1.3V25h1.3zm2.5 0v-6.442h-1.3V25h1.3zm2.466 0v-1.235h-1.235V25h1.235zm-7.216 9v-6.442h-1.3V34h1.3zm2.5 0v-6.442h-1.3V34h1.3zm2.501 0v-6.442h-1.3V34h1.3zm2.465 0v-1.235h-1.235V34h1.235z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 44 44\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z\\\" fill-opacity=\\\".163\\\"/><path d=\\\"M9.62 14.105c.272 0 .528-.05.768-.153s.466-.257.677-.462c.009.024.023.072.044.145.047.161.086.283.119.365h1.221a2.649 2.649 0 0 1-.222-.626c-.04-.195-.059-.498-.059-.908l.013-1.441c0-.536-.055-.905-.165-1.105-.11-.201-.3-.367-.569-.497-.27-.13-.68-.195-1.23-.195-.607 0-1.064.108-1.371.325-.308.217-.525.55-.65 1.002l1.12.202c.076-.217.176-.369.299-.455.123-.086.294-.13.514-.13.325 0 .546.05.663.152.118.101.176.27.176.508v.123c-.222.093-.622.194-1.2.303-.427.082-.755.178-.982.288-.227.11-.403.268-.53.474a1.327 1.327 0 0 0-.188.706c0 .398.138.728.415.988.277.261.656.391 1.136.391zm.368-.87a.675.675 0 0 1-.492-.189.606.606 0 0 1-.193-.448c0-.176.08-.32.241-.435.106-.07.33-.142.673-.215a7.19 7.19 0 0 0 .751-.19v.247c0 .296-.016.496-.048.602a.773.773 0 0 1-.295.409 1.07 1.07 0 0 1-.637.22zm4.645.765v-1.235h-1.235V14h1.235zM10.2 25.105c.542 0 1.003-.215 1.382-.646.38-.43.57-1.044.57-1.84 0-.771-.187-1.362-.559-1.774a1.82 1.82 0 0 0-1.41-.617c-.522 0-.973.216-1.354.65v-2.32H7.594V25h1.147v-.686a1.9 1.9 0 0 0 .67.592c.26.133.523.2.79.2zm-.299-.975c-.354 0-.638-.164-.852-.492-.153-.232-.229-.59-.229-1.073 0-.468.098-.818.295-1.048a.93.93 0 0 1 .738-.345c.302 0 .55.118.743.354.193.236.29.62.29 1.154 0 .5-.096.868-.288 1.1-.192.233-.424.35-.697.35zm4.478.87v-1.235h-1.234V25h1.234zm-4.017 9.105c.6 0 1.08-.142 1.437-.426.357-.284.599-.704.725-1.261l-1.213-.207c-.061.326-.167.555-.316.688a.832.832 0 0 1-.576.2.916.916 0 0 1-.75-.343c-.185-.228-.278-.62-.278-1.173 0-.498.091-.853.274-1.066.183-.212.429-.318.736-.318.232 0 .42.061.565.184.145.123.238.306.28.55l1.216-.22c-.146-.501-.387-.874-.722-1.119-.336-.244-.788-.366-1.356-.366-.695 0-1.245.214-1.653.643-.407.43-.61 1.03-.61 1.8 0 .762.202 1.358.608 1.788.406.431.95.646 1.633.646zM14.633 34v-1.235h-1.235V34h1.235z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 44 44\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M35 29a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17zm0-9a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H18a1 1 0 0 1-1-1v-1a1 1 0 0 1 1-1h17z\\\" fill-opacity=\\\".163\\\"/><path d=\\\"m7.88 15 .532-1.463h2.575L11.549 15h1.415l-2.58-6.442H9.01L6.5 15h1.38zm2.69-2.549H8.811l.87-2.39.887 2.39zM14.88 15v-1.235h-1.234V15h1.234zM9.352 25c.83-.006 1.352-.02 1.569-.044.346-.038.636-.14.872-.305.236-.166.422-.387.558-.664.137-.277.205-.562.205-.855 0-.372-.106-.695-.317-.97-.21-.276-.512-.471-.905-.585a1.51 1.51 0 0 0 .661-.567 1.5 1.5 0 0 0 .244-.83c0-.28-.066-.53-.197-.754a1.654 1.654 0 0 0-.495-.539 1.676 1.676 0 0 0-.672-.266c-.25-.042-.63-.063-1.14-.063H7.158V25h2.193zm.142-3.88H8.46v-1.49h.747c.612 0 .983.007 1.112.022.217.026.38.102.49.226.11.125.165.287.165.486a.68.68 0 0 1-.192.503.86.86 0 0 1-.525.23 11.47 11.47 0 0 1-.944.023h.18zm.17 2.795H8.46v-1.723h1.05c.592 0 .977.03 1.154.092.177.062.313.16.406.295a.84.84 0 0 1 .14.492c0 .228-.06.41-.181.547a.806.806 0 0 1-.473.257c-.126.026-.423.04-.892.04zM14.88 25v-1.235h-1.234V25h1.234zm-5.018 9.11c.691 0 1.262-.17 1.711-.512.45-.341.772-.864.965-1.567l-1.261-.4c-.109.472-.287.818-.536 1.037-.25.22-.547.33-.892.33-.47 0-.85-.173-1.143-.519-.293-.345-.44-.925-.44-1.74 0-.767.15-1.322.447-1.665.297-.343.684-.514 1.162-.514.346 0 .64.096.881.29.242.193.4.457.477.79l1.288-.307c-.147-.516-.367-.911-.66-1.187-.492-.465-1.132-.698-1.92-.698-.902 0-1.63.296-2.184.89-.554.593-.83 1.426-.83 2.498 0 1.014.275 1.813.825 2.397.551.585 1.254.877 2.11.877zM14.88 34v-1.235h-1.234V34h1.234z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Returns a function that converts the model \"url\" attribute to the view representation.\n *\n * Depending on the configuration, the view representation can be \"semantic\" (for the data pipeline):\n *\n * ```html\n * <figure class=\"media\">\n * \t<oembed url=\"foo\"></oembed>\n * </figure>\n * ```\n *\n * or \"non-semantic\" (for the editing view pipeline):\n *\n * ```html\n * <figure class=\"media\">\n * \t<div data-oembed-url=\"foo\">[ non-semantic media preview for \"foo\" ]</div>\n * </figure>\n * ```\n *\n * **Note:** Changing the model \"url\" attribute replaces the entire content of the\n * `<figure>` in the view.\n *\n * @param registry The registry providing\n * the media and their content.\n * @param options options object with following properties:\n * - elementName When set, overrides the default element name for semantic media embeds.\n * - renderMediaPreview When `true`, the converter will create the view in the non-semantic form.\n * - renderForEditingView When `true`, the converter will create a view specific for the\n * editing pipeline (e.g. including CSS classes, content placeholders).\n */\nexport function modelToViewUrlAttributeConverter(registry, options) {\n const converter = (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const url = data.attributeNewValue;\n const viewWriter = conversionApi.writer;\n const figure = conversionApi.mapper.toViewElement(data.item);\n const mediaContentElement = [...figure.getChildren()]\n .find(child => child.getCustomProperty('media-content'));\n // TODO: removing the wrapper and creating it from scratch is a hack. We can do better than that.\n viewWriter.remove(mediaContentElement);\n const mediaViewElement = registry.getMediaViewElement(viewWriter, url, options);\n viewWriter.insert(viewWriter.createPositionAt(figure, 0), mediaViewElement);\n };\n return dispatcher => {\n dispatcher.on('attribute:url:media', converter);\n };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { isWidget, toWidget } from 'ckeditor5/src/widget';\n/**\n * Converts a given {@link module:engine/view/element~Element} to a media embed widget:\n * * Adds a {@link module:engine/view/element~Element#_setCustomProperty custom property} allowing to recognize the media widget element.\n * * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.\n *\n * @param writer An instance of the view writer.\n * @param label The element's label.\n */\nexport function toMediaWidget(viewElement, writer, label) {\n writer.setCustomProperty('media', true, viewElement);\n return toWidget(viewElement, writer, { label });\n}\n/**\n * Returns a media widget editing view element if one is selected.\n */\nexport function getSelectedMediaViewWidget(selection) {\n const viewElement = selection.getSelectedElement();\n if (viewElement && isMediaWidget(viewElement)) {\n return viewElement;\n }\n return null;\n}\n/**\n * Checks if a given view element is a media widget.\n */\nexport function isMediaWidget(viewElement) {\n return !!viewElement.getCustomProperty('media') && isWidget(viewElement);\n}\n/**\n * Creates a view element representing the media. Either a \"semantic\" one for the data pipeline:\n *\n * ```html\n * <figure class=\"media\">\n * \t<oembed url=\"foo\"></oembed>\n * </figure>\n * ```\n *\n * or a \"non-semantic\" (for the editing view pipeline):\n *\n * ```html\n * <figure class=\"media\">\n * \t<div data-oembed-url=\"foo\">[ non-semantic media preview for \"foo\" ]</div>\n * </figure>\n * ```\n */\nexport function createMediaFigureElement(writer, registry, url, options) {\n return writer.createContainerElement('figure', { class: 'media' }, [\n registry.getMediaViewElement(writer, url, options),\n writer.createSlot()\n ]);\n}\n/**\n * Returns a selected media element in the model, if any.\n */\nexport function getSelectedMediaModelWidget(selection) {\n const selectedElement = selection.getSelectedElement();\n if (selectedElement && selectedElement.is('element', 'media')) {\n return selectedElement;\n }\n return null;\n}\n/**\n * Creates a media element and inserts it into the model.\n *\n * **Note**: This method will use {@link module:engine/model/model~Model#insertContent `model.insertContent()`} logic of inserting content\n * if no `insertPosition` is passed.\n *\n * @param url An URL of an embeddable media.\n * @param findOptimalPosition If true it will try to find optimal position to insert media without breaking content\n * in which a selection is.\n */\nexport function insertMedia(model, url, selectable, findOptimalPosition) {\n model.change(writer => {\n const mediaElement = writer.createElement('media', { url });\n model.insertObject(mediaElement, selectable, null, {\n setSelection: 'on',\n findOptimalPosition: findOptimalPosition ? 'auto' : undefined\n });\n });\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { findOptimalInsertionRange } from 'ckeditor5/src/widget';\nimport { getSelectedMediaModelWidget, insertMedia } from './utils';\n/**\n * The insert media command.\n *\n * The command is registered by the {@link module:media-embed/mediaembedediting~MediaEmbedEditing} as `'mediaEmbed'`.\n *\n * To insert media at the current selection, execute the command and specify the URL:\n *\n * ```ts\n * editor.execute( 'mediaEmbed', 'http://url.to.the/media' );\n * ```\n */\nexport default class MediaEmbedCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const model = this.editor.model;\n const selection = model.document.selection;\n const selectedMedia = getSelectedMediaModelWidget(selection);\n this.value = selectedMedia ? selectedMedia.getAttribute('url') : undefined;\n this.isEnabled = isMediaSelected(selection) || isAllowedInParent(selection, model);\n }\n /**\n * Executes the command, which either:\n *\n * * updates the URL of the selected media,\n * * inserts the new media into the editor and puts the selection around it.\n *\n * @fires execute\n * @param url The URL of the media.\n */\n execute(url) {\n const model = this.editor.model;\n const selection = model.document.selection;\n const selectedMedia = getSelectedMediaModelWidget(selection);\n if (selectedMedia) {\n model.change(writer => {\n writer.setAttribute('url', url, selectedMedia);\n });\n }\n else {\n insertMedia(model, url, selection, true);\n }\n }\n}\n/**\n * Checks if the media embed is allowed in the parent.\n */\nfunction isAllowedInParent(selection, model) {\n const insertionRange = findOptimalInsertionRange(selection, model);\n let parent = insertionRange.start.parent;\n // The model.insertContent() will remove empty parent (unless it is a $root or a limit).\n if (parent.isEmpty && !model.schema.isLimit(parent)) {\n parent = parent.parent;\n }\n return model.schema.checkChild(parent, 'media');\n}\n/**\n * Checks if the media object is selected.\n */\nfunction isMediaSelected(selection) {\n const element = selection.getSelectedElement();\n return !!element && element.name === 'media';\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { IconView, Template } from 'ckeditor5/src/ui';\nimport { logWarning, toArray } from 'ckeditor5/src/utils';\nimport mediaPlaceholderIcon from '../theme/icons/media-placeholder.svg';\nconst mediaPlaceholderIconViewBox = '0 0 64 42';\n/**\n * A bridge between the raw media content provider definitions and the editor view content.\n *\n * It helps translating media URLs to corresponding {@link module:engine/view/element~Element view elements}.\n *\n * Mostly used by the {@link module:media-embed/mediaembedediting~MediaEmbedEditing} plugin.\n */\nexport default class MediaRegistry {\n /**\n * Creates an instance of the {@link module:media-embed/mediaregistry~MediaRegistry} class.\n *\n * @param locale The localization services instance.\n * @param config The configuration of the media embed feature.\n */\n constructor(locale, config) {\n const providers = config.providers;\n const extraProviders = config.extraProviders || [];\n const removedProviders = new Set(config.removeProviders);\n const providerDefinitions = providers\n .concat(extraProviders)\n .filter(provider => {\n const name = provider.name;\n if (!name) {\n /**\n * One of the providers (or extra providers) specified in the media embed configuration\n * has no name and will not be used by the editor. In order to get this media\n * provider working, double check your editor configuration.\n *\n * @error media-embed-no-provider-name\n */\n logWarning('media-embed-no-provider-name', { provider });\n return false;\n }\n return !removedProviders.has(name);\n });\n this.locale = locale;\n this.providerDefinitions = providerDefinitions;\n }\n /**\n * Checks whether the passed URL is representing a certain media type allowed in the editor.\n *\n * @param url The URL to be checked\n */\n hasMedia(url) {\n return !!this._getMedia(url);\n }\n /**\n * For the given media URL string and options, it returns the {@link module:engine/view/element~Element view element}\n * representing that media.\n *\n * **Note:** If no URL is specified, an empty view element is returned.\n *\n * @param writer The view writer used to produce a view element.\n * @param url The URL to be translated into a view element.\n */\n getMediaViewElement(writer, url, options) {\n return this._getMedia(url).getViewElement(writer, options);\n }\n /**\n * Returns a `Media` instance for the given URL.\n *\n * @param url The URL of the media.\n * @returns The `Media` instance or `null` when there is none.\n */\n _getMedia(url) {\n if (!url) {\n return new Media(this.locale);\n }\n url = url.trim();\n for (const definition of this.providerDefinitions) {\n const previewRenderer = definition.html;\n const pattern = toArray(definition.url);\n for (const subPattern of pattern) {\n const match = this._getUrlMatches(url, subPattern);\n if (match) {\n return new Media(this.locale, url, match, previewRenderer);\n }\n }\n }\n return null;\n }\n /**\n * Tries to match `url` to `pattern`.\n *\n * @param url The URL of the media.\n * @param pattern The pattern that should accept the media URL.\n */\n _getUrlMatches(url, pattern) {\n // 1. Try to match without stripping the protocol and \"www\" subdomain.\n let match = url.match(pattern);\n if (match) {\n return match;\n }\n // 2. Try to match after stripping the protocol.\n let rawUrl = url.replace(/^https?:\\/\\//, '');\n match = rawUrl.match(pattern);\n if (match) {\n return match;\n }\n // 3. Try to match after stripping the \"www\" subdomain.\n rawUrl = rawUrl.replace(/^www\\./, '');\n match = rawUrl.match(pattern);\n if (match) {\n return match;\n }\n return null;\n }\n}\n/**\n * Represents media defined by the provider configuration.\n *\n * It can be rendered to the {@link module:engine/view/element~Element view element} and used in the editing or data pipeline.\n */\nclass Media {\n constructor(locale, url, match, previewRenderer) {\n this.url = this._getValidUrl(url);\n this._locale = locale;\n this._match = match;\n this._previewRenderer = previewRenderer;\n }\n /**\n * Returns the view element representation of the media.\n *\n * @param writer The view writer used to produce a view element.\n */\n getViewElement(writer, options) {\n const attributes = {};\n let viewElement;\n if (options.renderForEditingView || (options.renderMediaPreview && this.url && this._previewRenderer)) {\n if (this.url) {\n attributes['data-oembed-url'] = this.url;\n }\n if (options.renderForEditingView) {\n attributes.class = 'ck-media__wrapper';\n }\n const mediaHtml = this._getPreviewHtml(options);\n viewElement = writer.createRawElement('div', attributes, (domElement, domConverter) => {\n domConverter.setContentOf(domElement, mediaHtml);\n });\n }\n else {\n if (this.url) {\n attributes.url = this.url;\n }\n viewElement = writer.createEmptyElement(options.elementName, attributes);\n }\n writer.setCustomProperty('media-content', true, viewElement);\n return viewElement;\n }\n /**\n * Returns the HTML string of the media content preview.\n */\n _getPreviewHtml(options) {\n if (this._previewRenderer) {\n return this._previewRenderer(this._match);\n }\n else {\n // The placeholder only makes sense for editing view and media which have URLs.\n // Placeholder is never displayed in data and URL-less media have no content.\n if (this.url && options.renderForEditingView) {\n return this._getPlaceholderHtml();\n }\n return '';\n }\n }\n /**\n * Returns the placeholder HTML when the media has no content preview.\n */\n _getPlaceholderHtml() {\n const icon = new IconView();\n const t = this._locale.t;\n icon.content = mediaPlaceholderIcon;\n icon.viewBox = mediaPlaceholderIconViewBox;\n const placeholder = new Template({\n tag: 'div',\n attributes: {\n class: 'ck ck-reset_all ck-media__placeholder'\n },\n children: [\n {\n tag: 'div',\n attributes: {\n class: 'ck-media__placeholder__icon'\n },\n children: [icon]\n },\n {\n tag: 'a',\n attributes: {\n class: 'ck-media__placeholder__url',\n target: '_blank',\n rel: 'noopener noreferrer',\n href: this.url,\n 'data-cke-tooltip-text': t('Open media in new tab')\n },\n children: [\n {\n tag: 'span',\n attributes: {\n class: 'ck-media__placeholder__url__text'\n },\n children: [this.url]\n }\n ]\n }\n ]\n }).render();\n return placeholder.outerHTML;\n }\n /**\n * Returns the full URL to the specified media.\n *\n * @param url The URL of the media.\n */\n _getValidUrl(url) {\n if (!url) {\n return null;\n }\n if (url.match(/^https?/)) {\n return url;\n }\n return 'https://' + url;\n }\n}\n","export default \"<svg viewBox=\\\"0 0 64 42\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M47.426 17V3.713L63.102 0v19.389h-.001l.001.272c0 1.595-2.032 3.43-4.538 4.098-2.506.668-4.538-.083-4.538-1.678 0-1.594 2.032-3.43 4.538-4.098.914-.244 2.032-.565 2.888-.603V4.516L49.076 7.447v9.556A1.014 1.014 0 0 0 49 17h-1.574zM29.5 17h-8.343a7.073 7.073 0 1 0-4.657 4.06v3.781H3.3a2.803 2.803 0 0 1-2.8-2.804V8.63a2.803 2.803 0 0 1 2.8-2.805h4.082L8.58 2.768A1.994 1.994 0 0 1 10.435 1.5h8.985c.773 0 1.477.448 1.805 1.149l1.488 3.177H26.7c1.546 0 2.8 1.256 2.8 2.805V17zm-11.637 0H17.5a1 1 0 0 0-1 1v.05A4.244 4.244 0 1 1 17.863 17zm29.684 2c.97 0 .953-.048.953.889v20.743c0 .953.016.905-.953.905H19.453c-.97 0-.953.048-.953-.905V19.89c0-.937-.016-.889.97-.889h28.077zm-4.701 19.338V22.183H24.154v16.155h18.692zM20.6 21.375v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616v-1.616H20.6zm0 3.231v1.616h1.616V37.53H20.6zm24.233-16.155v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615v-1.616h-1.615zm0 3.231v1.616h1.615V37.53h-1.615zM29.485 25.283a.4.4 0 0 1 .593-.35l9.05 4.977a.4.4 0 0 1 0 .701l-9.05 4.978a.4.4 0 0 1-.593-.35v-9.956z\\\"/></svg>\";","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./mediaembedediting.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module media-embed/mediaembedediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { first } from 'ckeditor5/src/utils';\nimport { modelToViewUrlAttributeConverter } from './converters';\nimport MediaEmbedCommand from './mediaembedcommand';\nimport MediaRegistry from './mediaregistry';\nimport { toMediaWidget, createMediaFigureElement } from './utils';\nimport '../theme/mediaembedediting.css';\n/**\n * The media embed editing feature.\n */\nexport default class MediaEmbedEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'MediaEmbedEditing';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n editor.config.define('mediaEmbed', {\n elementName: 'oembed',\n providers: [\n {\n name: 'dailymotion',\n url: /^dailymotion\\.com\\/video\\/(\\w+)/,\n html: match => {\n const id = match[1];\n return ('<div style=\"position: relative; padding-bottom: 100%; height: 0; \">' +\n `<iframe src=\"https://www.dailymotion.com/embed/video/${id}\" ` +\n 'style=\"position: absolute; width: 100%; height: 100%; top: 0; left: 0;\" ' +\n 'frameborder=\"0\" width=\"480\" height=\"270\" allowfullscreen allow=\"autoplay\">' +\n '</iframe>' +\n '</div>');\n }\n },\n {\n name: 'spotify',\n url: [\n /^open\\.spotify\\.com\\/(artist\\/\\w+)/,\n /^open\\.spotify\\.com\\/(album\\/\\w+)/,\n /^open\\.spotify\\.com\\/(track\\/\\w+)/\n ],\n html: match => {\n const id = match[1];\n return ('<div style=\"position: relative; padding-bottom: 100%; height: 0; padding-bottom: 126%;\">' +\n `<iframe src=\"https://open.spotify.com/embed/${id}\" ` +\n 'style=\"position: absolute; width: 100%; height: 100%; top: 0; left: 0;\" ' +\n 'frameborder=\"0\" allowtransparency=\"true\" allow=\"encrypted-media\">' +\n '</iframe>' +\n '</div>');\n }\n },\n {\n name: 'youtube',\n url: [\n /^(?:m\\.)?youtube\\.com\\/watch\\?v=([\\w-]+)(?:&t=(\\d+))?/,\n /^(?:m\\.)?youtube\\.com\\/v\\/([\\w-]+)(?:\\?t=(\\d+))?/,\n /^youtube\\.com\\/embed\\/([\\w-]+)(?:\\?start=(\\d+))?/,\n /^youtu\\.be\\/([\\w-]+)(?:\\?t=(\\d+))?/\n ],\n html: match => {\n const id = match[1];\n const time = match[2];\n return ('<div style=\"position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;\">' +\n `<iframe src=\"https://www.youtube.com/embed/${id}${time ? `?start=${time}` : ''}\" ` +\n 'style=\"position: absolute; width: 100%; height: 100%; top: 0; left: 0;\" ' +\n 'frameborder=\"0\" allow=\"autoplay; encrypted-media\" allowfullscreen>' +\n '</iframe>' +\n '</div>');\n }\n },\n {\n name: 'vimeo',\n url: [\n /^vimeo\\.com\\/(\\d+)/,\n /^vimeo\\.com\\/[^/]+\\/[^/]+\\/video\\/(\\d+)/,\n /^vimeo\\.com\\/album\\/[^/]+\\/video\\/(\\d+)/,\n /^vimeo\\.com\\/channels\\/[^/]+\\/(\\d+)/,\n /^vimeo\\.com\\/groups\\/[^/]+\\/videos\\/(\\d+)/,\n /^vimeo\\.com\\/ondemand\\/[^/]+\\/(\\d+)/,\n /^player\\.vimeo\\.com\\/video\\/(\\d+)/\n ],\n html: match => {\n const id = match[1];\n return ('<div style=\"position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;\">' +\n `<iframe src=\"https://player.vimeo.com/video/${id}\" ` +\n 'style=\"position: absolute; width: 100%; height: 100%; top: 0; left: 0;\" ' +\n 'frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen>' +\n '</iframe>' +\n '</div>');\n }\n },\n {\n name: 'instagram',\n url: /^instagram\\.com\\/p\\/(\\w+)/\n },\n {\n name: 'twitter',\n url: /^twitter\\.com/\n },\n {\n name: 'googleMaps',\n url: [\n /^google\\.com\\/maps/,\n /^goo\\.gl\\/maps/,\n /^maps\\.google\\.com/,\n /^maps\\.app\\.goo\\.gl/\n ]\n },\n {\n name: 'flickr',\n url: /^flickr\\.com/\n },\n {\n name: 'facebook',\n url: /^facebook\\.com/\n }\n ]\n });\n this.registry = new MediaRegistry(editor.locale, editor.config.get('mediaEmbed'));\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n const t = editor.t;\n const conversion = editor.conversion;\n const renderMediaPreview = editor.config.get('mediaEmbed.previewsInData');\n const elementName = editor.config.get('mediaEmbed.elementName');\n const registry = this.registry;\n editor.commands.add('mediaEmbed', new MediaEmbedCommand(editor));\n // Configure the schema.\n schema.register('media', {\n inheritAllFrom: '$blockObject',\n allowAttributes: ['url']\n });\n // Model -> Data\n conversion.for('dataDowncast').elementToStructure({\n model: 'media',\n view: (modelElement, { writer }) => {\n const url = modelElement.getAttribute('url');\n return createMediaFigureElement(writer, registry, url, {\n elementName,\n renderMediaPreview: !!url && renderMediaPreview\n });\n }\n });\n // Model -> Data (url -> data-oembed-url)\n conversion.for('dataDowncast').add(modelToViewUrlAttributeConverter(registry, {\n elementName,\n renderMediaPreview\n }));\n // Model -> View (element)\n conversion.for('editingDowncast').elementToStructure({\n model: 'media',\n view: (modelElement, { writer }) => {\n const url = modelElement.getAttribute('url');\n const figure = createMediaFigureElement(writer, registry, url, {\n elementName,\n renderForEditingView: true\n });\n return toMediaWidget(figure, writer, t('media widget'));\n }\n });\n // Model -> View (url -> data-oembed-url)\n conversion.for('editingDowncast').add(modelToViewUrlAttributeConverter(registry, {\n elementName,\n renderForEditingView: true\n }));\n // View -> Model (data-oembed-url -> url)\n conversion.for('upcast')\n // Upcast semantic media.\n .elementToElement({\n view: element => ['oembed', elementName].includes(element.name) && element.getAttribute('url') ?\n { name: true } :\n null,\n model: (viewMedia, { writer }) => {\n const url = viewMedia.getAttribute('url');\n if (registry.hasMedia(url)) {\n return writer.createElement('media', { url });\n }\n return null;\n }\n })\n // Upcast non-semantic media.\n .elementToElement({\n view: {\n name: 'div',\n attributes: {\n 'data-oembed-url': true\n }\n },\n model: (viewMedia, { writer }) => {\n const url = viewMedia.getAttribute('data-oembed-url');\n if (registry.hasMedia(url)) {\n return writer.createElement('media', { url });\n }\n return null;\n }\n })\n // Consume `<figure class=\"media\">` elements, that were left after upcast.\n .add(dispatcher => {\n const converter = (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.viewItem, { name: true, classes: 'media' })) {\n return;\n }\n const { modelRange, modelCursor } = conversionApi.convertChildren(data.viewItem, data.modelCursor);\n data.modelRange = modelRange;\n data.modelCursor = modelCursor;\n const modelElement = first(modelRange.getItems());\n if (!modelElement) {\n // Revert consumed figure so other features can convert it.\n conversionApi.consumable.revert(data.viewItem, { name: true, classes: 'media' });\n }\n };\n dispatcher.on('element:figure', converter);\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module media-embed/automediaembed\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { LiveRange, LivePosition } from 'ckeditor5/src/engine';\nimport { Clipboard } from 'ckeditor5/src/clipboard';\nimport { Delete } from 'ckeditor5/src/typing';\nimport { Undo } from 'ckeditor5/src/undo';\nimport { global } from 'ckeditor5/src/utils';\nimport MediaEmbedEditing from './mediaembedediting';\nimport { insertMedia } from './utils';\nconst URL_REGEXP = /^(?:http(s)?:\\/\\/)?[\\w-]+\\.[\\w-.~:/?#[\\]@!$&'()*+,;=%]+$/;\n/**\n * The auto-media embed plugin. It recognizes media links in the pasted content and embeds\n * them shortly after they are injected into the document.\n */\nexport default class AutoMediaEmbed extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [Clipboard, Delete, Undo];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'AutoMediaEmbed';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n this._timeoutId = null;\n this._positionToInsert = null;\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const modelDocument = editor.model.document;\n // We need to listen on `Clipboard#inputTransformation` because we need to save positions of selection.\n // After pasting, the content between those positions will be checked for a URL that could be transformed\n // into media.\n const clipboardPipeline = editor.plugins.get('ClipboardPipeline');\n this.listenTo(clipboardPipeline, 'inputTransformation', () => {\n const firstRange = modelDocument.selection.getFirstRange();\n const leftLivePosition = LivePosition.fromPosition(firstRange.start);\n leftLivePosition.stickiness = 'toPrevious';\n const rightLivePosition = LivePosition.fromPosition(firstRange.end);\n rightLivePosition.stickiness = 'toNext';\n modelDocument.once('change:data', () => {\n this._embedMediaBetweenPositions(leftLivePosition, rightLivePosition);\n leftLivePosition.detach();\n rightLivePosition.detach();\n }, { priority: 'high' });\n });\n const undoCommand = editor.commands.get('undo');\n undoCommand.on('execute', () => {\n if (this._timeoutId) {\n global.window.clearTimeout(this._timeoutId);\n this._positionToInsert.detach();\n this._timeoutId = null;\n this._positionToInsert = null;\n }\n }, { priority: 'high' });\n }\n /**\n * Analyzes the part of the document between provided positions in search for a URL representing media.\n * When the URL is found, it is automatically converted into media.\n *\n * @param leftPosition Left position of the selection.\n * @param rightPosition Right position of the selection.\n */\n _embedMediaBetweenPositions(leftPosition, rightPosition) {\n const editor = this.editor;\n const mediaRegistry = editor.plugins.get(MediaEmbedEditing).registry;\n // TODO: Use marker instead of LiveRange & LivePositions.\n const urlRange = new LiveRange(leftPosition, rightPosition);\n const walker = urlRange.getWalker({ ignoreElementEnd: true });\n let url = '';\n for (const node of walker) {\n if (node.item.is('$textProxy')) {\n url += node.item.data;\n }\n }\n url = url.trim();\n // If the URL does not match to universal URL regexp, let's skip that.\n if (!url.match(URL_REGEXP)) {\n urlRange.detach();\n return;\n }\n // If the URL represents a media, let's use it.\n if (!mediaRegistry.hasMedia(url)) {\n urlRange.detach();\n return;\n }\n const mediaEmbedCommand = editor.commands.get('mediaEmbed');\n // Do not anything if media element cannot be inserted at the current position (#47).\n if (!mediaEmbedCommand.isEnabled) {\n urlRange.detach();\n return;\n }\n // Position won't be available in the `setTimeout` function so let's clone it.\n this._positionToInsert = LivePosition.fromPosition(leftPosition);\n // This action mustn't be executed if undo was called between pasting and auto-embedding.\n this._timeoutId = global.window.setTimeout(() => {\n editor.model.change(writer => {\n this._timeoutId = null;\n writer.remove(urlRange);\n urlRange.detach();\n let insertionPosition = null;\n // Check if position where the media element should be inserted is still valid.\n // Otherwise leave it as undefined to use document.selection - default behavior of model.insertContent().\n if (this._positionToInsert.root.rootName !== '$graveyard') {\n insertionPosition = this._positionToInsert;\n }\n insertMedia(editor.model, url, insertionPosition, false);\n this._positionToInsert.detach();\n this._positionToInsert = null;\n });\n editor.plugins.get(Delete).requestUndoOnBackspace();\n }, 100);\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./mediaform.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module media-embed/ui/mediaformview\n */\nimport { ButtonView, FocusCycler, LabeledFieldView, View, ViewCollection, createLabeledInputText, submitHandler } from 'ckeditor5/src/ui';\nimport { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils';\nimport { icons } from 'ckeditor5/src/core';\n// See: #8833.\n// eslint-disable-next-line ckeditor5-rules/ckeditor-imports\nimport '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';\nimport '../../theme/mediaform.css';\n/**\n * The media form view controller class.\n *\n * See {@link module:media-embed/ui/mediaformview~MediaFormView}.\n */\nexport default class MediaFormView extends View {\n /**\n * @param validators Form validators used by {@link #isValid}.\n * @param locale The localization services instance.\n */\n constructor(validators, locale) {\n super(locale);\n const t = locale.t;\n this.focusTracker = new FocusTracker();\n this.keystrokes = new KeystrokeHandler();\n this.set('mediaURLInputValue', '');\n this.urlInputView = this._createUrlInput();\n this.saveButtonView = this._createButton(t('Save'), icons.check, 'ck-button-save');\n this.saveButtonView.type = 'submit';\n this.saveButtonView.bind('isEnabled').to(this, 'mediaURLInputValue', value => !!value);\n this.cancelButtonView = this._createButton(t('Cancel'), icons.cancel, 'ck-button-cancel', 'cancel');\n this._focusables = new ViewCollection();\n this._focusCycler = new FocusCycler({\n focusables: this._focusables,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate form fields backwards using the <kbd>Shift</kbd> + <kbd>Tab</kbd> keystroke.\n focusPrevious: 'shift + tab',\n // Navigate form fields forwards using the <kbd>Tab</kbd> key.\n focusNext: 'tab'\n }\n });\n this._validators = validators;\n this.setTemplate({\n tag: 'form',\n attributes: {\n class: [\n 'ck',\n 'ck-media-form',\n 'ck-responsive-form'\n ],\n tabindex: '-1'\n },\n children: [\n this.urlInputView,\n this.saveButtonView,\n this.cancelButtonView\n ]\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n submitHandler({\n view: this\n });\n const childViews = [\n this.urlInputView,\n this.saveButtonView,\n this.cancelButtonView\n ];\n childViews.forEach(v => {\n // Register the view as focusable.\n this._focusables.add(v);\n // Register the view in the focus tracker.\n this.focusTracker.add(v.element);\n });\n // Start listening for the keystrokes coming from #element.\n this.keystrokes.listenTo(this.element);\n const stopPropagation = (data) => data.stopPropagation();\n // Since the form is in the dropdown panel which is a child of the toolbar, the toolbar's\n // keystroke handler would take over the key management in the URL input. We need to prevent\n // this ASAP. Otherwise, the basic caret movement using the arrow keys will be impossible.\n this.keystrokes.set('arrowright', stopPropagation);\n this.keystrokes.set('arrowleft', stopPropagation);\n this.keystrokes.set('arrowup', stopPropagation);\n this.keystrokes.set('arrowdown', stopPropagation);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Focuses the fist {@link #_focusables} in the form.\n */\n focus() {\n this._focusCycler.focusFirst();\n }\n /**\n * The native DOM `value` of the {@link #urlInputView} element.\n *\n * **Note**: Do not confuse it with the {@link module:ui/inputtext/inputtextview~InputTextView#value}\n * which works one way only and may not represent the actual state of the component in the DOM.\n */\n get url() {\n return this.urlInputView.fieldView.element.value.trim();\n }\n set url(url) {\n this.urlInputView.fieldView.element.value = url.trim();\n }\n /**\n * Validates the form and returns `false` when some fields are invalid.\n */\n isValid() {\n this.resetFormStatus();\n for (const validator of this._validators) {\n const errorText = validator(this);\n // One error per field is enough.\n if (errorText) {\n // Apply updated error.\n this.urlInputView.errorText = errorText;\n return false;\n }\n }\n return true;\n }\n /**\n * Cleans up the supplementary error and information text of the {@link #urlInputView}\n * bringing them back to the state when the form has been displayed for the first time.\n *\n * See {@link #isValid}.\n */\n resetFormStatus() {\n this.urlInputView.errorText = null;\n this.urlInputView.infoText = this._urlInputViewInfoDefault;\n }\n /**\n * Creates a labeled input view.\n *\n * @returns Labeled input view instance.\n */\n _createUrlInput() {\n const t = this.locale.t;\n const labeledInput = new LabeledFieldView(this.locale, createLabeledInputText);\n const inputField = labeledInput.fieldView;\n this._urlInputViewInfoDefault = t('Paste the media URL in the input.');\n this._urlInputViewInfoTip = t('Tip: Paste the URL into the content to embed faster.');\n labeledInput.label = t('Media URL');\n labeledInput.infoText = this._urlInputViewInfoDefault;\n inputField.on('input', () => {\n // Display the tip text only when there is some value. Otherwise fall back to the default info text.\n labeledInput.infoText = inputField.element.value ? this._urlInputViewInfoTip : this._urlInputViewInfoDefault;\n this.mediaURLInputValue = inputField.element.value.trim();\n });\n return labeledInput;\n }\n /**\n * Creates a button view.\n *\n * @param label The button label.\n * @param icon The button icon.\n * @param className The additional button CSS class name.\n * @param eventName An event name that the `ButtonView#execute` event will be delegated to.\n * @returns The button view instance.\n */\n _createButton(label, icon, className, eventName) {\n const button = new ButtonView(this.locale);\n button.set({\n label,\n icon,\n tooltip: true\n });\n button.extendTemplate({\n attributes: {\n class: className\n }\n });\n if (eventName) {\n button.delegate('execute').to(this, eventName);\n }\n return button;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module media-embed/mediaembedui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { createDropdown, CssTransitionDisablerMixin } from 'ckeditor5/src/ui';\nimport MediaFormView from './ui/mediaformview';\nimport MediaEmbedEditing from './mediaembedediting';\nimport mediaIcon from '../theme/icons/media.svg';\n/**\n * The media embed UI plugin.\n */\nexport default class MediaEmbedUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [MediaEmbedEditing];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'MediaEmbedUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const command = editor.commands.get('mediaEmbed');\n editor.ui.componentFactory.add('mediaEmbed', locale => {\n const dropdown = createDropdown(locale);\n this._setUpDropdown(dropdown, command);\n return dropdown;\n });\n }\n _setUpDropdown(dropdown, command) {\n const editor = this.editor;\n const t = editor.t;\n const button = dropdown.buttonView;\n const registry = editor.plugins.get(MediaEmbedEditing).registry;\n dropdown.once('change:isOpen', () => {\n const form = new (CssTransitionDisablerMixin(MediaFormView))(getFormValidators(editor.t, registry), editor.locale);\n dropdown.panelView.children.add(form);\n // Note: Use the low priority to make sure the following listener starts working after the\n // default action of the drop-down is executed (i.e. the panel showed up). Otherwise, the\n // invisible form/input cannot be focused/selected.\n button.on('open', () => {\n form.disableCssTransitions();\n // Make sure that each time the panel shows up, the URL field remains in sync with the value of\n // the command. If the user typed in the input, then canceled (`urlInputView#fieldView#value` stays\n // unaltered) and re-opened it without changing the value of the media command (e.g. because they\n // didn't change the selection), they would see the old value instead of the actual value of the\n // command.\n form.url = command.value || '';\n form.urlInputView.fieldView.select();\n form.enableCssTransitions();\n }, { priority: 'low' });\n dropdown.on('submit', () => {\n if (form.isValid()) {\n editor.execute('mediaEmbed', form.url);\n editor.editing.view.focus();\n }\n });\n dropdown.on('change:isOpen', () => form.resetFormStatus());\n dropdown.on('cancel', () => {\n editor.editing.view.focus();\n });\n form.delegate('submit', 'cancel').to(dropdown);\n form.urlInputView.fieldView.bind('value').to(command, 'value');\n // Form elements should be read-only when corresponding commands are disabled.\n form.urlInputView.bind('isEnabled').to(command, 'isEnabled');\n });\n dropdown.bind('isEnabled').to(command);\n button.set({\n label: t('Insert media'),\n icon: mediaIcon,\n tooltip: true\n });\n }\n}\nfunction getFormValidators(t, registry) {\n return [\n form => {\n if (!form.url.length) {\n return t('The URL must not be empty.');\n }\n },\n form => {\n if (!registry.hasMedia(form.url)) {\n return t('This media URL is not supported.');\n }\n }\n ];\n}\n","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 20 20\\\"><path d=\\\"M18.68 3.03c.6 0 .59-.03.59.55v12.84c0 .59.01.56-.59.56H1.29c-.6 0-.59.03-.59-.56V3.58c0-.58-.01-.55.6-.55h17.38zM15.77 15V5H4.2v10h11.57zM2 4v1h1V4H2zm0 2v1h1V6H2zm0 2v1h1V8H2zm0 2v1h1v-1H2zm0 2v1h1v-1H2zm0 2v1h1v-1H2zM17 4v1h1V4h-1zm0 2v1h1V6h-1zm0 2v1h1V8h-1zm0 2v1h1v-1h-1zm0 2v1h1v-1h-1zm0 2v1h1v-1h-1zM7.5 7.177a.4.4 0 0 1 .593-.351l5.133 2.824a.4.4 0 0 1 0 .7l-5.133 2.824a.4.4 0 0 1-.593-.35V7.176v.001z\\\"/></svg>\";","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./mediaembed.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module page-break/pagebreakcommand\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { findOptimalInsertionRange } from 'ckeditor5/src/widget';\n/**\n * The page break command.\n *\n * The command is registered by {@link module:page-break/pagebreakediting~PageBreakEditing} as `'pageBreak'`.\n *\n * To insert a page break at the current selection, execute the command:\n *\n *\t\teditor.execute( 'pageBreak' );\n */\nexport default class PageBreakCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const model = this.editor.model;\n const schema = model.schema;\n const selection = model.document.selection;\n this.isEnabled = isPageBreakAllowedInParent(selection, schema, model);\n }\n /**\n * Executes the command.\n *\n * @fires execute\n */\n execute() {\n const model = this.editor.model;\n model.change(writer => {\n const pageBreakElement = writer.createElement('pageBreak');\n model.insertObject(pageBreakElement, null, null, {\n setSelection: 'after'\n });\n });\n }\n}\n/**\n * Checks if a page break is allowed by the schema in the optimal insertion parent.\n */\nfunction isPageBreakAllowedInParent(selection, schema, model) {\n const parent = getInsertPageBreakParent(selection, model);\n return schema.checkChild(parent, 'pageBreak');\n}\n/**\n * Returns a node that will be used to insert a page break with `model.insertContent` to check if the page break can be placed there.\n */\nfunction getInsertPageBreakParent(selection, model) {\n const insertionRange = findOptimalInsertionRange(selection, model);\n const parent = insertionRange.start.parent;\n if (parent.isEmpty && !parent.is('element', '$root')) {\n return parent.parent;\n }\n return parent;\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./pagebreak.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module page-break/pagebreakediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { toWidget } from 'ckeditor5/src/widget';\nimport PageBreakCommand from './pagebreakcommand';\nimport '../theme/pagebreak.css';\n/**\n * The page break editing feature.\n */\nexport default class PageBreakEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'PageBreakEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n const t = editor.t;\n const conversion = editor.conversion;\n schema.register('pageBreak', {\n inheritAllFrom: '$blockObject'\n });\n conversion.for('dataDowncast').elementToStructure({\n model: 'pageBreak',\n view: (modelElement, { writer }) => {\n const divElement = writer.createContainerElement('div', {\n class: 'page-break',\n // If user has no `.ck-content` styles, it should always break a page during print.\n style: 'page-break-after: always'\n }, \n // For a rationale of using span inside a div see:\n // https://github.com/ckeditor/ckeditor5-page-break/pull/1#discussion_r328934062.\n writer.createContainerElement('span', {\n style: 'display: none'\n }));\n return divElement;\n }\n });\n conversion.for('editingDowncast').elementToStructure({\n model: 'pageBreak',\n view: (modelElement, { writer }) => {\n const label = t('Page break');\n const viewWrapper = writer.createContainerElement('div');\n const viewLabelElement = writer.createRawElement('span', { class: 'page-break__label' }, function (domElement) {\n domElement.innerText = t('Page break');\n });\n writer.addClass('page-break', viewWrapper);\n writer.insert(writer.createPositionAt(viewWrapper, 0), viewLabelElement);\n return toPageBreakWidget(viewWrapper, writer, label);\n }\n });\n conversion.for('upcast')\n .elementToElement({\n view: element => {\n // For upcast conversion it's enough if we check for element style and verify if it's empty\n // or contains only hidden span element.\n const hasPageBreakBefore = element.getStyle('page-break-before') == 'always';\n const hasPageBreakAfter = element.getStyle('page-break-after') == 'always';\n if (!hasPageBreakBefore && !hasPageBreakAfter) {\n return null;\n }\n // The \"page break\" div accepts only single child or no child at all.\n if (element.childCount == 1) {\n const viewSpan = element.getChild(0);\n // The child must be the \"span\" element that is not displayed.\n if (!viewSpan.is('element', 'span') || viewSpan.getStyle('display') != 'none') {\n return null;\n }\n }\n else if (element.childCount > 1) {\n return null;\n }\n return { name: true };\n },\n model: 'pageBreak',\n // This conversion must be checked before <br> conversion because some editors use\n // <br style=\"page-break-before:always\"> as a page break marker.\n converterPriority: 'high'\n });\n editor.commands.add('pageBreak', new PageBreakCommand(editor));\n }\n}\n/**\n * Converts a given {@link module:engine/view/element~Element} to a page break widget:\n * * Adds a {@link module:engine/view/element~Element#_setCustomProperty custom property} allowing to\n * recognize the page break widget element.\n * * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.\n */\nfunction toPageBreakWidget(viewElement, writer, label) {\n writer.setCustomProperty('pageBreak', true, viewElement);\n return toWidget(viewElement, writer, { label });\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module page-break/pagebreakui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ButtonView } from 'ckeditor5/src/ui';\nimport pageBreakIcon from '../theme/icons/pagebreak.svg';\n/**\n * The page break UI plugin.\n */\nexport default class PageBreakUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'PageBreakUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n // Add pageBreak button to feature components.\n editor.ui.componentFactory.add('pageBreak', locale => {\n const command = editor.commands.get('pageBreak');\n const view = new ButtonView(locale);\n view.set({\n label: t('Page break'),\n icon: pageBreakIcon,\n tooltip: true\n });\n view.bind('isEnabled').to(command, 'isEnabled');\n // Execute command.\n this.listenTo(view, 'execute', () => {\n editor.execute('pageBreak');\n editor.editing.view.focus();\n });\n return view;\n });\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M3.598.687h1.5v5h-1.5zm14.5 0h1.5v5h-1.5z\\\"/><path d=\\\"M19.598 4.187v1.5h-16v-1.5zm-16 14.569h1.5v-5h-1.5zm14.5 0h1.5v-5h-1.5z\\\"/><path d=\\\"M19.598 15.256v-1.5h-16v1.5zM5.081 9h6v2h-6zm8 0h6v2h-6zm-9.483 1L0 12.5v-5z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paste-from-office/filters/list\n */\nimport { Matcher, UpcastWriter } from 'ckeditor5/src/engine';\n/**\n * Transforms Word specific list-like elements to the semantic HTML lists.\n *\n * Lists in Word are represented by block elements with special attributes like:\n *\n * ```xml\n * <p class=MsoListParagraphCxSpFirst style='mso-list:l1 level1 lfo1'>...</p> // Paragraph based list.\n * <h1 style='mso-list:l0 level1 lfo1'>...</h1> // Heading 1 based list.\n * ```\n *\n * @param documentFragment The view structure to be transformed.\n * @param stylesString Styles from which list-like elements styling will be extracted.\n */\nexport function transformListItemLikeElementsIntoLists(documentFragment, stylesString) {\n if (!documentFragment.childCount) {\n return;\n }\n const writer = new UpcastWriter(documentFragment.document);\n const itemLikeElements = findAllItemLikeElements(documentFragment, writer);\n if (!itemLikeElements.length) {\n return;\n }\n let currentList = null;\n let currentIndentation = 1;\n itemLikeElements.forEach((itemLikeElement, i) => {\n const isDifferentList = isNewListNeeded(itemLikeElements[i - 1], itemLikeElement);\n const previousItemLikeElement = isDifferentList ? null : itemLikeElements[i - 1];\n const indentationDifference = getIndentationDifference(previousItemLikeElement, itemLikeElement);\n if (isDifferentList) {\n currentList = null;\n currentIndentation = 1;\n }\n if (!currentList || indentationDifference !== 0) {\n const listStyle = detectListStyle(itemLikeElement, stylesString);\n if (!currentList) {\n currentList = insertNewEmptyList(listStyle, itemLikeElement.element, writer);\n }\n else if (itemLikeElement.indent > currentIndentation) {\n const lastListItem = currentList.getChild(currentList.childCount - 1);\n const lastListItemChild = lastListItem.getChild(lastListItem.childCount - 1);\n currentList = insertNewEmptyList(listStyle, lastListItemChild, writer);\n currentIndentation += 1;\n }\n else if (itemLikeElement.indent < currentIndentation) {\n const differentIndentation = currentIndentation - itemLikeElement.indent;\n currentList = findParentListAtLevel(currentList, differentIndentation);\n currentIndentation = itemLikeElement.indent;\n }\n if (itemLikeElement.indent <= currentIndentation) {\n if (!currentList.is('element', listStyle.type)) {\n currentList = writer.rename(listStyle.type, currentList);\n }\n }\n }\n const listItem = transformElementIntoListItem(itemLikeElement.element, writer);\n writer.appendChild(listItem, currentList);\n });\n}\n/**\n * Removes paragraph wrapping content inside a list item.\n */\nexport function unwrapParagraphInListItem(documentFragment, writer) {\n for (const value of writer.createRangeIn(documentFragment)) {\n const element = value.item;\n if (element.is('element', 'li')) {\n // Google Docs allows for single paragraph inside LI.\n const firstChild = element.getChild(0);\n if (firstChild && firstChild.is('element', 'p')) {\n writer.unwrapElement(firstChild);\n }\n }\n }\n}\n/**\n * Finds all list-like elements in a given document fragment.\n *\n * @param documentFragment Document fragment in which to look for list-like nodes.\n * @returns Array of found list-like items. Each item is an object containing:\n */\nfunction findAllItemLikeElements(documentFragment, writer) {\n const range = writer.createRangeIn(documentFragment);\n // Matcher for finding list-like elements.\n const itemLikeElementsMatcher = new Matcher({\n name: /^p|h\\d+$/,\n styles: {\n 'mso-list': /.*/\n }\n });\n const itemLikeElements = [];\n for (const value of range) {\n if (value.type === 'elementStart' && itemLikeElementsMatcher.match(value.item)) {\n const itemData = getListItemData(value.item);\n itemLikeElements.push({\n element: value.item,\n id: itemData.id,\n order: itemData.order,\n indent: itemData.indent\n });\n }\n }\n return itemLikeElements;\n}\n/**\n * Extracts list item style from the provided CSS.\n *\n * List item style is extracted from the CSS stylesheet. Each list with its specific style attribute\n * value (`mso-list:l1 level1 lfo1`) has its dedicated properties in a CSS stylesheet defined with a selector like:\n *\n * ```css\n * @list l1:level1 { ... }\n * ```\n *\n * It contains `mso-level-number-format` property which defines list numbering/bullet style. If this property\n * is not defined it means default `decimal` numbering.\n *\n * Here CSS string representation is used as `mso-level-number-format` property is an invalid CSS property\n * and will be removed during CSS parsing.\n *\n * @param listLikeItem List-like item for which list style will be searched for. Usually\n * a result of `findAllItemLikeElements()` function.\n * @param stylesString CSS stylesheet.\n * @returns An object with properties:\n *\n * * type - List type, could be `ul` or `ol`.\n * * startIndex - List start index, valid only for ordered lists.\n * * style - List style, for example: `decimal`, `lower-roman`, etc. It is extracted\n * directly from Word stylesheet and adjusted to represent proper values for the CSS `list-style-type` property.\n * If it cannot be adjusted, the `null` value is returned.\n */\nfunction detectListStyle(listLikeItem, stylesString) {\n const listStyleRegexp = new RegExp(`@list l${listLikeItem.id}:level${listLikeItem.indent}\\\\s*({[^}]*)`, 'gi');\n const listStyleTypeRegex = /mso-level-number-format:([^;]{0,100});/gi;\n const listStartIndexRegex = /mso-level-start-at:\\s{0,100}([0-9]{0,10})\\s{0,100};/gi;\n const listStyleMatch = listStyleRegexp.exec(stylesString);\n let listStyleType = 'decimal'; // Decimal is default one.\n let type = 'ol'; // <ol> is default list.\n let startIndex = null;\n if (listStyleMatch && listStyleMatch[1]) {\n const listStyleTypeMatch = listStyleTypeRegex.exec(listStyleMatch[1]);\n if (listStyleTypeMatch && listStyleTypeMatch[1]) {\n listStyleType = listStyleTypeMatch[1].trim();\n type = listStyleType !== 'bullet' && listStyleType !== 'image' ? 'ol' : 'ul';\n }\n // Styles for the numbered lists are always defined in the Word CSS stylesheet.\n // Unordered lists MAY contain a value for the Word CSS definition `mso-level-text` but sometimes\n // this tag is missing. And because of that, we cannot depend on that. We need to predict the list style value\n // based on the list style marker element.\n if (listStyleType === 'bullet') {\n const bulletedStyle = findBulletedListStyle(listLikeItem.element);\n if (bulletedStyle) {\n listStyleType = bulletedStyle;\n }\n }\n else {\n const listStartIndexMatch = listStartIndexRegex.exec(listStyleMatch[1]);\n if (listStartIndexMatch && listStartIndexMatch[1]) {\n startIndex = parseInt(listStartIndexMatch[1]);\n }\n }\n }\n return {\n type,\n startIndex,\n style: mapListStyleDefinition(listStyleType)\n };\n}\n/**\n * Tries to extract the `list-style-type` value based on the marker element for bulleted list.\n */\nfunction findBulletedListStyle(element) {\n const listMarkerElement = findListMarkerNode(element);\n if (!listMarkerElement) {\n return null;\n }\n const listMarker = listMarkerElement._data;\n if (listMarker === 'o') {\n return 'circle';\n }\n else if (listMarker === '·') {\n return 'disc';\n }\n // Word returns '§' instead of '■' for the square list style.\n else if (listMarker === '§') {\n return 'square';\n }\n return null;\n}\n/**\n * Tries to find a text node that represents the marker element (list-style-type).\n */\nfunction findListMarkerNode(element) {\n // If the first child is a text node, it is the data for the element.\n // The list-style marker is not present here.\n if (element.getChild(0).is('$text')) {\n return null;\n }\n for (const childNode of element.getChildren()) {\n // The list-style marker will be inside the `<span>` element. Let's ignore all non-span elements.\n // It may happen that the `<a>` element is added as the first child. Most probably, it's an anchor element.\n if (!childNode.is('element', 'span')) {\n continue;\n }\n const textNodeOrElement = childNode.getChild(0);\n if (!textNodeOrElement) {\n continue;\n }\n // If already found the marker element, use it.\n if (textNodeOrElement.is('$text')) {\n return textNodeOrElement;\n }\n return textNodeOrElement.getChild(0);\n }\n /* istanbul ignore next -- @preserve */\n return null;\n}\n/**\n * Parses the `list-style-type` value extracted directly from the Word CSS stylesheet and returns proper CSS definition.\n */\nfunction mapListStyleDefinition(value) {\n if (value.startsWith('arabic-leading-zero')) {\n return 'decimal-leading-zero';\n }\n switch (value) {\n case 'alpha-upper':\n return 'upper-alpha';\n case 'alpha-lower':\n return 'lower-alpha';\n case 'roman-upper':\n return 'upper-roman';\n case 'roman-lower':\n return 'lower-roman';\n case 'circle':\n case 'disc':\n case 'square':\n return value;\n default:\n return null;\n }\n}\n/**\n * Creates an empty list of a given type and inserts it after a specified element.\n *\n * @param listStyle List style object which determines the type of newly created list.\n * Usually a result of `detectListStyle()` function.\n * @param element Element after which list is inserted.\n * @returns Newly created list element.\n */\nfunction insertNewEmptyList(listStyle, element, writer) {\n const parent = element.parent;\n const list = writer.createElement(listStyle.type);\n const position = parent.getChildIndex(element) + 1;\n writer.insertChild(position, list, parent);\n // We do not support modifying the marker for a particular list item.\n // Set the value for the `list-style-type` property directly to the list container.\n if (listStyle.style) {\n writer.setStyle('list-style-type', listStyle.style, list);\n }\n if (listStyle.startIndex && listStyle.startIndex > 1) {\n writer.setAttribute('start', listStyle.startIndex, list);\n }\n return list;\n}\n/**\n * Transforms a given element into a semantic list item. As the function operates on a provided\n * {module:engine/src/view/element~Element element} it will modify the view structure to which this element belongs.\n *\n * @param element Element which will be transformed into a list item.\n * @returns New element to which the given one was transformed. It is\n * inserted in place of the old element (the reference to the old element is lost due to renaming).\n */\nfunction transformElementIntoListItem(element, writer) {\n removeBulletElement(element, writer);\n return writer.rename('li', element);\n}\n/**\n * Extracts list item information from Word specific list-like element style:\n *\n * ```\n * `style=\"mso-list:l1 level1 lfo1\"`\n * ```\n *\n * where:\n *\n * ```\n * * `l1` is a list id (however it does not mean this is a continuous list - see #43),\n * * `level1` is a list item indentation level,\n * * `lfo1` is a list insertion order in a document.\n * ```\n *\n * @param element Element from which style data is extracted.\n */\nfunction getListItemData(element) {\n const data = {};\n const listStyle = element.getStyle('mso-list');\n if (listStyle) {\n const idMatch = listStyle.match(/(^|\\s{1,100})l(\\d+)/i);\n const orderMatch = listStyle.match(/\\s{0,100}lfo(\\d+)/i);\n const indentMatch = listStyle.match(/\\s{0,100}level(\\d+)/i);\n if (idMatch && orderMatch && indentMatch) {\n data.id = idMatch[2];\n data.order = orderMatch[1];\n data.indent = parseInt(indentMatch[1]);\n }\n }\n return data;\n}\n/**\n * Removes span with a numbering/bullet from a given element.\n */\nfunction removeBulletElement(element, writer) {\n // Matcher for finding `span` elements holding lists numbering/bullets.\n const bulletMatcher = new Matcher({\n name: 'span',\n styles: {\n 'mso-list': 'Ignore'\n }\n });\n const range = writer.createRangeIn(element);\n for (const value of range) {\n if (value.type === 'elementStart' && bulletMatcher.match(value.item)) {\n writer.remove(value.item);\n }\n }\n}\n/**\n * Whether the previous and current items belong to the same list. It is determined based on `item.id`\n * (extracted from `mso-list` style, see #getListItemData) and a previous sibling of the current item.\n *\n * However, it's quite easy to change the `id` attribute for nested lists in Word. It will break the list feature while pasting.\n * Let's check also the `indent` attribute. If the difference between those two elements is equal to 1, we can assume that\n * the `currentItem` is a beginning of the nested list because lists in CKEditor 5 always start with the `indent=0` attribute.\n * See: https://github.com/ckeditor/ckeditor5/issues/7805.\n */\nfunction isNewListNeeded(previousItem, currentItem) {\n if (!previousItem) {\n return true;\n }\n if (previousItem.id !== currentItem.id) {\n // See: https://github.com/ckeditor/ckeditor5/issues/7805.\n //\n // * List item 1.\n // - Nested list item 1.\n if (currentItem.indent - previousItem.indent === 1) {\n return false;\n }\n return true;\n }\n const previousSibling = currentItem.element.previousSibling;\n if (!previousSibling) {\n return true;\n }\n // Even with the same id the list does not have to be continuous (#43).\n return !isList(previousSibling);\n}\nfunction isList(element) {\n return element.is('element', 'ol') || element.is('element', 'ul');\n}\n/**\n * Calculates the indentation difference between two given list items (based on the indent attribute\n * extracted from the `mso-list` style, see #getListItemData).\n */\nfunction getIndentationDifference(previousItem, currentItem) {\n return previousItem ? currentItem.indent - previousItem.indent : currentItem.indent - 1;\n}\n/**\n * Finds the parent list element (ul/ol) of a given list element with indentation level lower by a given value.\n *\n * @param listElement List element from which to start looking for a parent list.\n * @param indentationDifference Indentation difference between lists.\n * @returns Found list element with indentation level lower by a given value.\n */\nfunction findParentListAtLevel(listElement, indentationDifference) {\n const ancestors = listElement.getAncestors({ parentFirst: true });\n let parentList = null;\n let levelChange = 0;\n for (const ancestor of ancestors) {\n if (ancestor.is('element', 'ul') || ancestor.is('element', 'ol')) {\n levelChange++;\n }\n if (levelChange === indentationDifference) {\n parentList = ancestor;\n break;\n }\n }\n return parentList;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paste-from-office/filters/image\n */\n/* globals btoa */\nimport { Matcher, UpcastWriter } from 'ckeditor5/src/engine';\n/**\n * Replaces source attribute of all `<img>` elements representing regular\n * images (not the Word shapes) with inlined base64 image representation extracted from RTF or Blob data.\n *\n * @param documentFragment Document fragment on which transform images.\n * @param rtfData The RTF data from which images representation will be used.\n */\nexport function replaceImagesSourceWithBase64(documentFragment, rtfData) {\n if (!documentFragment.childCount) {\n return;\n }\n const upcastWriter = new UpcastWriter(documentFragment.document);\n const shapesIds = findAllShapesIds(documentFragment, upcastWriter);\n removeAllImgElementsRepresentingShapes(shapesIds, documentFragment, upcastWriter);\n insertMissingImgs(shapesIds, documentFragment, upcastWriter);\n removeAllShapeElements(documentFragment, upcastWriter);\n const images = findAllImageElementsWithLocalSource(documentFragment, upcastWriter);\n if (images.length) {\n replaceImagesFileSourceWithInlineRepresentation(images, extractImageDataFromRtf(rtfData), upcastWriter);\n }\n}\n/**\n * Converts given HEX string to base64 representation.\n *\n * @internal\n * @param hexString The HEX string to be converted.\n * @returns Base64 representation of a given HEX string.\n */\nexport function _convertHexToBase64(hexString) {\n return btoa(hexString.match(/\\w{2}/g).map(char => {\n return String.fromCharCode(parseInt(char, 16));\n }).join(''));\n}\n/**\n * Finds all shapes (`<v:*>...</v:*>`) ids. Shapes can represent images (canvas)\n * or Word shapes (which does not have RTF or Blob representation).\n *\n * @param documentFragment Document fragment from which to extract shape ids.\n * @returns Array of shape ids.\n */\nfunction findAllShapesIds(documentFragment, writer) {\n const range = writer.createRangeIn(documentFragment);\n const shapeElementsMatcher = new Matcher({\n name: /v:(.+)/\n });\n const shapesIds = [];\n for (const value of range) {\n if (value.type != 'elementStart') {\n continue;\n }\n const el = value.item;\n const previousSibling = el.previousSibling;\n const prevSiblingName = previousSibling && previousSibling.is('element') ? previousSibling.name : null;\n // If shape element have 'o:gfxdata' attribute and is not directly before `<v:shapetype>` element it means it represent Word shape.\n if (shapeElementsMatcher.match(el) && el.getAttribute('o:gfxdata') && prevSiblingName !== 'v:shapetype') {\n shapesIds.push(value.item.getAttribute('id'));\n }\n }\n return shapesIds;\n}\n/**\n * Removes all `<img>` elements which represents Word shapes and not regular images.\n *\n * @param shapesIds Shape ids which will be checked against `<img>` elements.\n * @param documentFragment Document fragment from which to remove `<img>` elements.\n */\nfunction removeAllImgElementsRepresentingShapes(shapesIds, documentFragment, writer) {\n const range = writer.createRangeIn(documentFragment);\n const imageElementsMatcher = new Matcher({\n name: 'img'\n });\n const imgs = [];\n for (const value of range) {\n if (value.item.is('element') && imageElementsMatcher.match(value.item)) {\n const el = value.item;\n const shapes = el.getAttribute('v:shapes') ? el.getAttribute('v:shapes').split(' ') : [];\n if (shapes.length && shapes.every(shape => shapesIds.indexOf(shape) > -1)) {\n imgs.push(el);\n // Shapes may also have empty source while content is paste in some browsers (Safari).\n }\n else if (!el.getAttribute('src')) {\n imgs.push(el);\n }\n }\n }\n for (const img of imgs) {\n writer.remove(img);\n }\n}\n/**\n * Removes all shape elements (`<v:*>...</v:*>`) so they do not pollute the output structure.\n *\n * @param documentFragment Document fragment from which to remove shape elements.\n */\nfunction removeAllShapeElements(documentFragment, writer) {\n const range = writer.createRangeIn(documentFragment);\n const shapeElementsMatcher = new Matcher({\n name: /v:(.+)/\n });\n const shapes = [];\n for (const value of range) {\n if (value.type == 'elementStart' && shapeElementsMatcher.match(value.item)) {\n shapes.push(value.item);\n }\n }\n for (const shape of shapes) {\n writer.remove(shape);\n }\n}\n/**\n * Inserts `img` tags if there is none after a shape.\n */\nfunction insertMissingImgs(shapeIds, documentFragment, writer) {\n const range = writer.createRangeIn(documentFragment);\n const shapes = [];\n for (const value of range) {\n if (value.type == 'elementStart' && value.item.is('element', 'v:shape')) {\n const id = value.item.getAttribute('id');\n if (shapeIds.includes(id)) {\n continue;\n }\n if (!containsMatchingImg(value.item.parent.getChildren(), id)) {\n shapes.push(value.item);\n }\n }\n }\n for (const shape of shapes) {\n const attrs = {\n src: findSrc(shape)\n };\n if (shape.hasAttribute('alt')) {\n attrs.alt = shape.getAttribute('alt');\n }\n const img = writer.createElement('img', attrs);\n writer.insertChild(shape.index + 1, img, shape.parent);\n }\n function containsMatchingImg(nodes, id) {\n for (const node of nodes) {\n /* istanbul ignore else -- @preserve */\n if (node.is('element')) {\n if (node.name == 'img' && node.getAttribute('v:shapes') == id) {\n return true;\n }\n if (containsMatchingImg(node.getChildren(), id)) {\n return true;\n }\n }\n }\n return false;\n }\n function findSrc(shape) {\n for (const child of shape.getChildren()) {\n /* istanbul ignore else -- @preserve */\n if (child.is('element') && child.getAttribute('src')) {\n return child.getAttribute('src');\n }\n }\n }\n}\n/**\n * Finds all `<img>` elements in a given document fragment which have source pointing to local `file://` resource.\n *\n * @param documentFragment Document fragment in which to look for `<img>` elements.\n * @returns result All found images grouped by source type.\n */\nfunction findAllImageElementsWithLocalSource(documentFragment, writer) {\n const range = writer.createRangeIn(documentFragment);\n const imageElementsMatcher = new Matcher({\n name: 'img'\n });\n const imgs = [];\n for (const value of range) {\n if (value.item.is('element') && imageElementsMatcher.match(value.item)) {\n if (value.item.getAttribute('src').startsWith('file://')) {\n imgs.push(value.item);\n }\n }\n }\n return imgs;\n}\n/**\n * Extracts all images HEX representations from a given RTF data.\n *\n * @param rtfData The RTF data from which to extract images HEX representation.\n * @returns Array of found HEX representations. Each array item is an object containing:\n *\n * * hex Image representation in HEX format.\n * * type Type of image, `image/png` or `image/jpeg`.\n */\nfunction extractImageDataFromRtf(rtfData) {\n if (!rtfData) {\n return [];\n }\n const regexPictureHeader = /{\\\\pict[\\s\\S]+?\\\\bliptag-?\\d+(\\\\blipupi-?\\d+)?({\\\\\\*\\\\blipuid\\s?[\\da-fA-F]+)?[\\s}]*?/;\n const regexPicture = new RegExp('(?:(' + regexPictureHeader.source + '))([\\\\da-fA-F\\\\s]+)\\\\}', 'g');\n const images = rtfData.match(regexPicture);\n const result = [];\n if (images) {\n for (const image of images) {\n let imageType = false;\n if (image.includes('\\\\pngblip')) {\n imageType = 'image/png';\n }\n else if (image.includes('\\\\jpegblip')) {\n imageType = 'image/jpeg';\n }\n if (imageType) {\n result.push({\n hex: image.replace(regexPictureHeader, '').replace(/[^\\da-fA-F]/g, ''),\n type: imageType\n });\n }\n }\n }\n return result;\n}\n/**\n * Replaces `src` attribute value of all given images with the corresponding base64 image representation.\n *\n * @param imageElements Array of image elements which will have its source replaced.\n * @param imagesHexSources Array of images hex sources (usually the result of `extractImageDataFromRtf()` function).\n * The array should be the same length as `imageElements` parameter.\n */\nfunction replaceImagesFileSourceWithInlineRepresentation(imageElements, imagesHexSources, writer) {\n // Assume there is an equal amount of image elements and images HEX sources so they can be matched accordingly based on existing order.\n if (imageElements.length === imagesHexSources.length) {\n for (let i = 0; i < imageElements.length; i++) {\n const newSrc = `data:${imagesHexSources[i].type};base64,${_convertHexToBase64(imagesHexSources[i].hex)}`;\n writer.setAttribute('src', newSrc, imageElements[i]);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paste-from-office/normalizers/mswordnormalizer\n */\nimport { transformListItemLikeElementsIntoLists } from '../filters/list';\nimport { replaceImagesSourceWithBase64 } from '../filters/image';\nconst msWordMatch1 = /<meta\\s*name=\"?generator\"?\\s*content=\"?microsoft\\s*word\\s*\\d+\"?\\/?>/i;\nconst msWordMatch2 = /xmlns:o=\"urn:schemas-microsoft-com/i;\n/**\n * Normalizer for the content pasted from Microsoft Word.\n */\nexport default class MSWordNormalizer {\n /**\n * Creates a new `MSWordNormalizer` instance.\n *\n * @param document View document.\n */\n constructor(document) {\n this.document = document;\n }\n /**\n * @inheritDoc\n */\n isActive(htmlString) {\n return msWordMatch1.test(htmlString) || msWordMatch2.test(htmlString);\n }\n /**\n * @inheritDoc\n */\n execute(data) {\n const { body: documentFragment, stylesString } = data._parsedData;\n transformListItemLikeElementsIntoLists(documentFragment, stylesString);\n replaceImagesSourceWithBase64(documentFragment, data.dataTransfer.getData('text/rtf'));\n data.content = documentFragment;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paste-from-office/filters/br\n */\nimport { DomConverter, ViewDocument } from 'ckeditor5/src/engine';\n/**\n * Transforms `<br>` elements that are siblings to some block element into a paragraphs.\n *\n * @param documentFragment The view structure to be transformed.\n */\nexport default function transformBlockBrsToParagraphs(documentFragment, writer) {\n const viewDocument = new ViewDocument(writer.document.stylesProcessor);\n const domConverter = new DomConverter(viewDocument, { renderingMode: 'data' });\n const blockElements = domConverter.blockElements;\n const inlineObjectElements = domConverter.inlineObjectElements;\n const elementsToReplace = [];\n for (const value of writer.createRangeIn(documentFragment)) {\n const element = value.item;\n if (element.is('element', 'br')) {\n const nextSibling = findSibling(element, 'forward', writer, { blockElements, inlineObjectElements });\n const previousSibling = findSibling(element, 'backward', writer, { blockElements, inlineObjectElements });\n const nextSiblingIsBlock = isBlockViewElement(nextSibling, blockElements);\n const previousSiblingIsBlock = isBlockViewElement(previousSibling, blockElements);\n // If the <br> is surrounded by blocks then convert it to a paragraph:\n // * <p>foo</p>[<br>]<p>bar</p> -> <p>foo</p>[<p></p>]<p>bar</p>\n // * <p>foo</p>[<br>] -> <p>foo</p>[<p></p>]\n // * [<br>]<p>foo</p> -> [<p></p>]<p>foo</p>\n if (previousSiblingIsBlock || nextSiblingIsBlock) {\n elementsToReplace.push(element);\n }\n }\n }\n for (const element of elementsToReplace) {\n if (element.hasClass('Apple-interchange-newline')) {\n writer.remove(element);\n }\n else {\n writer.replace(element, writer.createElement('p'));\n }\n }\n}\n/**\n * Returns sibling node, threats inline elements as transparent (but should stop on an inline objects).\n */\nfunction findSibling(viewElement, direction, writer, { blockElements, inlineObjectElements }) {\n let position = writer.createPositionAt(viewElement, direction == 'forward' ? 'after' : 'before');\n // Find first position that is just before a first:\n // * text node,\n // * block element,\n // * inline object element.\n // It's ignoring any inline (non-object) elements like span, strong, etc.\n position = position.getLastMatchingPosition(({ item }) => (item.is('element') &&\n !blockElements.includes(item.name) &&\n !inlineObjectElements.includes(item.name)), { direction });\n return direction == 'forward' ? position.nodeAfter : position.nodeBefore;\n}\n/**\n * Returns true for view elements that are listed as block view elements.\n */\nfunction isBlockViewElement(node, blockElements) {\n return !!node && node.is('element') && blockElements.includes(node.name);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paste-from-office/normalizers/googledocsnormalizer\n */\nimport { UpcastWriter } from 'ckeditor5/src/engine';\nimport removeBoldWrapper from '../filters/removeboldwrapper';\nimport transformBlockBrsToParagraphs from '../filters/br';\nimport { unwrapParagraphInListItem } from '../filters/list';\nconst googleDocsMatch = /id=(\"|')docs-internal-guid-[-0-9a-f]+(\"|')/i;\n/**\n * Normalizer for the content pasted from Google Docs.\n */\nexport default class GoogleDocsNormalizer {\n /**\n * Creates a new `GoogleDocsNormalizer` instance.\n *\n * @param document View document.\n */\n constructor(document) {\n this.document = document;\n }\n /**\n * @inheritDoc\n */\n isActive(htmlString) {\n return googleDocsMatch.test(htmlString);\n }\n /**\n * @inheritDoc\n */\n execute(data) {\n const writer = new UpcastWriter(this.document);\n const { body: documentFragment } = data._parsedData;\n removeBoldWrapper(documentFragment, writer);\n unwrapParagraphInListItem(documentFragment, writer);\n transformBlockBrsToParagraphs(documentFragment, writer);\n data.content = documentFragment;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Removes `<b>` tag wrapper added by Google Docs to a copied content.\n *\n * @param documentFragment element `data.content` obtained from clipboard\n */\nexport default function removeBoldWrapper(documentFragment, writer) {\n for (const child of documentFragment.getChildren()) {\n if (child.is('element', 'b') && child.getStyle('font-weight') === 'normal') {\n const childIndex = documentFragment.getChildIndex(child);\n writer.remove(child);\n writer.insertChild(childIndex, child.getChildren(), documentFragment);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paste-from-office/normalizers/googlesheetsnormalizer\n */\nimport { UpcastWriter } from 'ckeditor5/src/engine';\nimport removeXmlns from '../filters/removexmlns';\nimport removeGoogleSheetsTag from '../filters/removegooglesheetstag';\nimport removeInvalidTableWidth from '../filters/removeinvalidtablewidth';\nconst googleSheetsMatch = /<google-sheets-html-origin/i;\n/**\n * Normalizer for the content pasted from Google Sheets.\n */\nexport default class GoogleSheetsNormalizer {\n /**\n * Creates a new `GoogleSheetsNormalizer` instance.\n *\n * @param document View document.\n */\n constructor(document) {\n this.document = document;\n }\n /**\n * @inheritDoc\n */\n isActive(htmlString) {\n return googleSheetsMatch.test(htmlString);\n }\n /**\n * @inheritDoc\n */\n execute(data) {\n const writer = new UpcastWriter(this.document);\n const { body: documentFragment } = data._parsedData;\n removeGoogleSheetsTag(documentFragment, writer);\n removeXmlns(documentFragment, writer);\n removeInvalidTableWidth(documentFragment, writer);\n data.content = documentFragment;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Removes `<google-sheets-html-origin>` tag wrapper added by Google Sheets to a copied content.\n *\n * @param documentFragment element `data.content` obtained from clipboard\n */\nexport default function removeGoogleSheetsTag(documentFragment, writer) {\n for (const child of documentFragment.getChildren()) {\n if (child.is('element', 'google-sheets-html-origin')) {\n const childIndex = documentFragment.getChildIndex(child);\n writer.remove(child);\n writer.insertChild(childIndex, child.getChildren(), documentFragment);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Removes `xmlns` attribute from table pasted from Google Sheets.\n *\n * @param documentFragment element `data.content` obtained from clipboard\n */\nexport default function removeXmlns(documentFragment, writer) {\n for (const child of documentFragment.getChildren()) {\n if (child.is('element', 'table') && child.hasAttribute('xmlns')) {\n writer.removeAttribute('xmlns', child);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Removes `width:0px` style from table pasted from Google Sheets.\n *\n * @param documentFragment element `data.content` obtained from clipboard\n */\nexport default function removeInvalidTableWidth(documentFragment, writer) {\n for (const child of documentFragment.getChildren()) {\n if (child.is('element', 'table') && child.getStyle('width') === '0px') {\n writer.removeStyle('width', child);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paste-from-office/filters/space\n */\n/**\n * Replaces last space preceding elements closing tag with `&nbsp;`. Such operation prevents spaces from being removed\n * during further DOM/View processing (see especially {@link module:engine/view/domconverter~DomConverter#_processDataFromDomText}).\n * This method also takes into account Word specific `<o:p></o:p>` empty tags.\n * Additionally multiline sequences of spaces and new lines between tags are removed (see #39 and #40).\n *\n * @param htmlString HTML string in which spacing should be normalized.\n * @returns Input HTML with spaces normalized.\n */\nexport function normalizeSpacing(htmlString) {\n // Run normalizeSafariSpaceSpans() two times to cover nested spans.\n return normalizeSafariSpaceSpans(normalizeSafariSpaceSpans(htmlString))\n // Remove all \\r\\n from \"spacerun spans\" so the last replace line doesn't strip all whitespaces.\n .replace(/(<span\\s+style=['\"]mso-spacerun:yes['\"]>[^\\S\\r\\n]*?)[\\r\\n]+([^\\S\\r\\n]*<\\/span>)/g, '$1$2')\n .replace(/<span\\s+style=['\"]mso-spacerun:yes['\"]><\\/span>/g, '')\n .replace(/ <\\//g, '\\u00A0</')\n .replace(/ <o:p><\\/o:p>/g, '\\u00A0<o:p></o:p>')\n // Remove <o:p> block filler from empty paragraph. Safari uses \\u00A0 instead of &nbsp;.\n .replace(/<o:p>(&nbsp;|\\u00A0)<\\/o:p>/g, '')\n // Remove all whitespaces when they contain any \\r or \\n.\n .replace(/>([^\\S\\r\\n]*[\\r\\n]\\s*)</g, '><');\n}\n/**\n * Normalizes spacing in special Word `spacerun spans` (`<span style='mso-spacerun:yes'>\\s+</span>`) by replacing\n * all spaces with `&nbsp; ` pairs. This prevents spaces from being removed during further DOM/View processing\n * (see especially {@link module:engine/view/domconverter~DomConverter#_processDataFromDomText}).\n *\n * @param htmlDocument Native `Document` object in which spacing should be normalized.\n */\nexport function normalizeSpacerunSpans(htmlDocument) {\n htmlDocument.querySelectorAll('span[style*=spacerun]').forEach(el => {\n const htmlElement = el;\n const innerTextLength = htmlElement.innerText.length || 0;\n htmlElement.innerText = Array(innerTextLength + 1).join('\\u00A0 ').substr(0, innerTextLength);\n });\n}\n/**\n * Normalizes specific spacing generated by Safari when content pasted from Word (`<span class=\"Apple-converted-space\"> </span>`)\n * by replacing all spaces sequences longer than 1 space with `&nbsp; ` pairs. This prevents spaces from being removed during\n * further DOM/View processing (see especially {@link module:engine/view/domconverter~DomConverter#_processDataFromDomText}).\n *\n * This function is similar to {@link module:clipboard/utils/normalizeclipboarddata normalizeClipboardData util} but uses\n * regular spaces / &nbsp; sequence for replacement.\n *\n * @param htmlString HTML string in which spacing should be normalized\n * @returns Input HTML with spaces normalized.\n */\nfunction normalizeSafariSpaceSpans(htmlString) {\n return htmlString.replace(/<span(?: class=\"Apple-converted-space\"|)>(\\s+)<\\/span>/g, (fullMatch, spaces) => {\n return spaces.length === 1 ? ' ' : Array(spaces.length + 1).join('\\u00A0 ').substr(0, spaces.length);\n });\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paste-from-office/filters/parse\n */\n/* globals DOMParser */\nimport { DomConverter, ViewDocument } from 'ckeditor5/src/engine';\nimport { normalizeSpacing, normalizeSpacerunSpans } from './space';\n/**\n * Parses provided HTML extracting contents of `<body>` and `<style>` tags.\n *\n * @param htmlString HTML string to be parsed.\n */\nexport function parseHtml(htmlString, stylesProcessor) {\n const domParser = new DOMParser();\n // Remove Word specific \"if comments\" so content inside is not omitted by the parser.\n htmlString = htmlString.replace(/<!--\\[if gte vml 1]>/g, '');\n const normalizedHtml = normalizeSpacing(cleanContentAfterBody(htmlString));\n // Parse htmlString as native Document object.\n const htmlDocument = domParser.parseFromString(normalizedHtml, 'text/html');\n normalizeSpacerunSpans(htmlDocument);\n // Get `innerHTML` first as transforming to View modifies the source document.\n const bodyString = htmlDocument.body.innerHTML;\n // Transform document.body to View.\n const bodyView = documentToView(htmlDocument, stylesProcessor);\n // Extract stylesheets.\n const stylesObject = extractStyles(htmlDocument);\n return {\n body: bodyView,\n bodyString,\n styles: stylesObject.styles,\n stylesString: stylesObject.stylesString\n };\n}\n/**\n * Transforms native `Document` object into {@link module:engine/view/documentfragment~DocumentFragment}. Comments are skipped.\n *\n * @param htmlDocument Native `Document` object to be transformed.\n */\nfunction documentToView(htmlDocument, stylesProcessor) {\n const viewDocument = new ViewDocument(stylesProcessor);\n const domConverter = new DomConverter(viewDocument, { renderingMode: 'data' });\n const fragment = htmlDocument.createDocumentFragment();\n const nodes = htmlDocument.body.childNodes;\n while (nodes.length > 0) {\n fragment.appendChild(nodes[0]);\n }\n return domConverter.domToView(fragment, { skipComments: true });\n}\n/**\n * Extracts both `CSSStyleSheet` and string representation from all `style` elements available in a provided `htmlDocument`.\n *\n * @param htmlDocument Native `Document` object from which styles will be extracted.\n */\nfunction extractStyles(htmlDocument) {\n const styles = [];\n const stylesString = [];\n const styleTags = Array.from(htmlDocument.getElementsByTagName('style'));\n for (const style of styleTags) {\n if (style.sheet && style.sheet.cssRules && style.sheet.cssRules.length) {\n styles.push(style.sheet);\n stylesString.push(style.innerHTML);\n }\n }\n return {\n styles,\n stylesString: stylesString.join(' ')\n };\n}\n/**\n * Removes leftover content from between closing </body> and closing </html> tag:\n *\n * ```html\n * <html><body><p>Foo Bar</p></body><span>Fo</span></html> -> <html><body><p>Foo Bar</p></body></html>\n * ```\n *\n * This function is used as specific browsers (Edge) add some random content after `body` tag when pasting from Word.\n * @param htmlString The HTML string to be cleaned.\n * @returns The HTML string with leftover content removed.\n */\nfunction cleanContentAfterBody(htmlString) {\n const bodyCloseTag = '</body>';\n const htmlCloseTag = '</html>';\n const bodyCloseIndex = htmlString.indexOf(bodyCloseTag);\n if (bodyCloseIndex < 0) {\n return htmlString;\n }\n const htmlCloseIndex = htmlString.indexOf(htmlCloseTag, bodyCloseIndex + bodyCloseTag.length);\n return htmlString.substring(0, bodyCloseIndex + bodyCloseTag.length) +\n (htmlCloseIndex >= 0 ? htmlString.substring(htmlCloseIndex) : '');\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M8.69 14.915c.053.052.173.083.36.093a.366.366 0 0 1 .345.485l-.003.01a.738.738 0 0 1-.697.497h-2.67a.374.374 0 0 1-.353-.496l.013-.038a.681.681 0 0 1 .644-.458c.197-.012.325-.043.386-.093a.28.28 0 0 0 .072-.11L9.592 4.5H6.269c-.359-.017-.609.013-.75.09-.142.078-.289.265-.442.563-.192.29-.516.464-.864.464H4.17a.43.43 0 0 1-.407-.569L4.46 3h13.08l-.62 2.043a.81.81 0 0 1-.775.574h-.114a.486.486 0 0 1-.486-.486c.001-.284-.054-.464-.167-.54-.112-.076-.367-.106-.766-.091h-3.28l-2.68 10.257c-.006.074.007.127.038.158zM3 17h8a.5.5 0 1 1 0 1H3a.5.5 0 1 1 0-1zm11.299 1.17a.75.75 0 1 1-1.06-1.06l1.414-1.415-1.415-1.414a.75.75 0 0 1 1.06-1.06l1.415 1.414 1.414-1.415a.75.75 0 1 1 1.06 1.06l-1.413 1.415 1.414 1.415a.75.75 0 0 1-1.06 1.06l-1.415-1.414-1.414 1.414z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module remove-format/removeformatui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ButtonView } from 'ckeditor5/src/ui';\nimport removeFormatIcon from '../theme/icons/remove-format.svg';\nconst REMOVE_FORMAT = 'removeFormat';\n/**\n * The remove format UI plugin. It registers the `'removeFormat'` button which can be\n * used in the toolbar.\n */\nexport default class RemoveFormatUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'RemoveFormatUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n editor.ui.componentFactory.add(REMOVE_FORMAT, locale => {\n const command = editor.commands.get(REMOVE_FORMAT);\n const view = new ButtonView(locale);\n view.set({\n label: t('Remove Format'),\n icon: removeFormatIcon,\n tooltip: true\n });\n view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n // Execute the command.\n this.listenTo(view, 'execute', () => {\n editor.execute(REMOVE_FORMAT);\n editor.editing.view.focus();\n });\n return view;\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { first } from 'ckeditor5/src/utils';\n/**\n * The remove format command.\n *\n * It is used by the {@link module:remove-format/removeformat~RemoveFormat remove format feature}\n * to clear the formatting in the selection.\n *\n * ```ts\n * editor.execute( 'removeFormat' );\n * ```\n */\nexport default class RemoveFormatCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const model = this.editor.model;\n this.isEnabled = !!first(this._getFormattingItems(model.document.selection, model.schema));\n }\n /**\n * @inheritDoc\n */\n execute() {\n const model = this.editor.model;\n const schema = model.schema;\n model.change(writer => {\n for (const item of this._getFormattingItems(model.document.selection, schema)) {\n if (item.is('selection')) {\n for (const attributeName of this._getFormattingAttributes(item, schema)) {\n writer.removeSelectionAttribute(attributeName);\n }\n }\n else {\n // Workaround for items with multiple removable attributes. See\n // https://github.com/ckeditor/ckeditor5-remove-format/pull/1#pullrequestreview-220515609\n const itemRange = writer.createRangeOn(item);\n for (const attributeName of this._getFormattingAttributes(item, schema)) {\n writer.removeAttribute(attributeName, itemRange);\n }\n }\n }\n });\n }\n /**\n * Returns an iterable of items in a selection (including the selection itself) that have formatting model\n * attributes to be removed by the feature.\n *\n * @param schema The schema describing the item.\n */\n *_getFormattingItems(selection, schema) {\n const itemHasRemovableFormatting = (item) => {\n return !!first(this._getFormattingAttributes(item, schema));\n };\n // Check formatting on selected items that are not blocks.\n for (const curRange of selection.getRanges()) {\n for (const item of curRange.getItems()) {\n if (!schema.isBlock(item) && itemHasRemovableFormatting(item)) {\n yield item;\n }\n }\n }\n // Check formatting from selected blocks.\n for (const block of selection.getSelectedBlocks()) {\n if (itemHasRemovableFormatting(block)) {\n yield block;\n }\n }\n // Finally the selection might be formatted as well, so make sure to check it.\n if (itemHasRemovableFormatting(selection)) {\n yield selection;\n }\n }\n /**\n * Returns an iterable of formatting attributes of a given model item.\n *\n * **Note:** Formatting items have the `isFormatting` property set to `true`.\n *\n * @param schema The schema describing the item.\n * @returns The names of formatting attributes found in a given item.\n */\n *_getFormattingAttributes(item, schema) {\n for (const [attributeName] of item.getAttributes()) {\n const attributeProperties = schema.getAttributeProperties(attributeName);\n if (attributeProperties && attributeProperties.isFormatting) {\n yield attributeName;\n }\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module remove-format/removeformatediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport RemoveFormatCommand from './removeformatcommand';\n/**\n * The remove format editing plugin.\n *\n * It registers the {@link module:remove-format/removeformatcommand~RemoveFormatCommand removeFormat} command.\n */\nexport default class RemoveFormatEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'RemoveFormatEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n editor.commands.add('removeFormat', new RemoveFormatCommand(editor));\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module source-editing/utils/formathtml\n */\n/**\n * A simple (and naive) HTML code formatter that returns a formatted HTML markup that can be easily\n * parsed by human eyes. It beautifies the HTML code by adding new lines between elements that behave like block elements\n * (https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements\n * and a few more like `tr`, `td`, and similar ones) and inserting indents for nested content.\n *\n * WARNING: This function works only on a text that does not contain any indentations or new lines.\n * Calling this function on the already formatted text will damage the formatting.\n *\n * @param input An HTML string to format.\n */\nexport function formatHtml(input) {\n // A list of block-like elements around which the new lines should be inserted, and within which\n // the indentation of their children should be increased.\n // The list is partially based on https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements that contains\n // a full list of HTML block-level elements.\n // A void element is an element that cannot have any child - https://html.spec.whatwg.org/multipage/syntax.html#void-elements.\n // Note that <pre> element is not listed on this list to avoid breaking whitespace formatting.\n const elementsToFormat = [\n { name: 'address', isVoid: false },\n { name: 'article', isVoid: false },\n { name: 'aside', isVoid: false },\n { name: 'blockquote', isVoid: false },\n { name: 'br', isVoid: true },\n { name: 'details', isVoid: false },\n { name: 'dialog', isVoid: false },\n { name: 'dd', isVoid: false },\n { name: 'div', isVoid: false },\n { name: 'dl', isVoid: false },\n { name: 'dt', isVoid: false },\n { name: 'fieldset', isVoid: false },\n { name: 'figcaption', isVoid: false },\n { name: 'figure', isVoid: false },\n { name: 'footer', isVoid: false },\n { name: 'form', isVoid: false },\n { name: 'h1', isVoid: false },\n { name: 'h2', isVoid: false },\n { name: 'h3', isVoid: false },\n { name: 'h4', isVoid: false },\n { name: 'h5', isVoid: false },\n { name: 'h6', isVoid: false },\n { name: 'header', isVoid: false },\n { name: 'hgroup', isVoid: false },\n { name: 'hr', isVoid: true },\n { name: 'input', isVoid: true },\n { name: 'li', isVoid: false },\n { name: 'main', isVoid: false },\n { name: 'nav', isVoid: false },\n { name: 'ol', isVoid: false },\n { name: 'p', isVoid: false },\n { name: 'section', isVoid: false },\n { name: 'table', isVoid: false },\n { name: 'tbody', isVoid: false },\n { name: 'td', isVoid: false },\n { name: 'textarea', isVoid: false },\n { name: 'th', isVoid: false },\n { name: 'thead', isVoid: false },\n { name: 'tr', isVoid: false },\n { name: 'ul', isVoid: false }\n ];\n const elementNamesToFormat = elementsToFormat.map(element => element.name).join('|');\n // It is not the fastest way to format the HTML markup but the performance should be good enough.\n const lines = input\n // Add new line before and after `<tag>` and `</tag>`.\n // It may separate individual elements with two new lines, but this will be fixed below.\n .replace(new RegExp(`</?(${elementNamesToFormat})( .*?)?>`, 'g'), '\\n$&\\n')\n // Divide input string into lines, which start with either an opening tag, a closing tag, or just a text.\n .split('\\n');\n let indentCount = 0;\n return lines\n .filter(line => line.length)\n .map(line => {\n if (isNonVoidOpeningTag(line, elementsToFormat)) {\n return indentLine(line, indentCount++);\n }\n if (isClosingTag(line, elementsToFormat)) {\n return indentLine(line, --indentCount);\n }\n return indentLine(line, indentCount);\n })\n .join('\\n');\n}\n/**\n * Checks, if an argument is an opening tag of a non-void element to be formatted.\n *\n * @param line String to check.\n * @param elementsToFormat Elements to be formatted.\n */\nfunction isNonVoidOpeningTag(line, elementsToFormat) {\n return elementsToFormat.some(element => {\n if (element.isVoid) {\n return false;\n }\n if (!new RegExp(`<${element.name}( .*?)?>`).test(line)) {\n return false;\n }\n return true;\n });\n}\n/**\n * Checks, if an argument is a closing tag.\n *\n * @param line String to check.\n * @param elementsToFormat Elements to be formatted.\n */\nfunction isClosingTag(line, elementsToFormat) {\n return elementsToFormat.some(element => {\n return new RegExp(`</${element.name}>`).test(line);\n });\n}\n/**\n * Indents a line by a specified number of characters.\n *\n * @param line Line to indent.\n * @param indentCount Number of characters to use for indentation.\n * @param indentChar Indentation character(s). 4 spaces by default.\n */\nfunction indentLine(line, indentCount, indentChar = ' ') {\n // More about Math.max() here in https://github.com/ckeditor/ckeditor5/issues/10698.\n return `${indentChar.repeat(Math.max(0, indentCount))}${line}`;\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./sourceediting.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module source-editing/sourceediting\n */\n/* global console */\nimport { Plugin, PendingActions } from 'ckeditor5/src/core';\nimport { ButtonView } from 'ckeditor5/src/ui';\nimport { createElement, ElementReplacer } from 'ckeditor5/src/utils';\nimport { formatHtml } from './utils/formathtml';\nimport '../theme/sourceediting.css';\nimport sourceEditingIcon from '../theme/icons/source-editing.svg';\nconst COMMAND_FORCE_DISABLE_ID = 'SourceEditingMode';\n/**\n * The source editing feature.\n *\n * It provides the possibility to view and edit the source of the document.\n *\n * For a detailed overview, check the {@glink features/source-editing source editing feature documentation} and the\n * {@glink api/source-editing package page}.\n */\nexport default class SourceEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'SourceEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [PendingActions];\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n this.set('isSourceEditingMode', false);\n this._elementReplacer = new ElementReplacer();\n this._replacedRoots = new Map();\n this._dataFromRoots = new Map();\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n editor.ui.componentFactory.add('sourceEditing', locale => {\n const buttonView = new ButtonView(locale);\n buttonView.set({\n label: t('Source'),\n icon: sourceEditingIcon,\n tooltip: true,\n withText: true,\n class: 'ck-source-editing-button'\n });\n buttonView.bind('isOn').to(this, 'isSourceEditingMode');\n // The button should be disabled if one of the following conditions is met:\n buttonView.bind('isEnabled').to(this, 'isEnabled', editor, 'isReadOnly', editor.plugins.get(PendingActions), 'hasAny', (isEnabled, isEditorReadOnly, hasAnyPendingActions) => {\n // (1) The plugin itself is disabled.\n if (!isEnabled) {\n return false;\n }\n // (2) The editor is in read-only mode.\n if (isEditorReadOnly) {\n return false;\n }\n // (3) Any pending action is scheduled. It may change the model, so modifying the document source should be prevented\n // until the model is finally set.\n if (hasAnyPendingActions) {\n return false;\n }\n return true;\n });\n this.listenTo(buttonView, 'execute', () => {\n this.isSourceEditingMode = !this.isSourceEditingMode;\n });\n return buttonView;\n });\n // Currently, the plugin handles the source editing mode by itself only for the classic editor. To use this plugin with other\n // integrations, listen to the `change:isSourceEditingMode` event and act accordingly.\n if (this._isAllowedToHandleSourceEditingMode()) {\n this.on('change:isSourceEditingMode', (evt, name, isSourceEditingMode) => {\n if (isSourceEditingMode) {\n this._showSourceEditing();\n this._disableCommands();\n }\n else {\n this._hideSourceEditing();\n this._enableCommands();\n }\n });\n this.on('change:isEnabled', (evt, name, isEnabled) => this._handleReadOnlyMode(!isEnabled));\n this.listenTo(editor, 'change:isReadOnly', (evt, name, isReadOnly) => this._handleReadOnlyMode(isReadOnly));\n }\n // Update the editor data while calling editor.getData() in the source editing mode.\n editor.data.on('get', () => {\n if (this.isSourceEditingMode) {\n this.updateEditorData();\n }\n }, { priority: 'high' });\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n const editor = this.editor;\n const collaborationPluginNamesToWarn = [\n 'RealTimeCollaborativeEditing',\n 'CommentsEditing',\n 'TrackChangesEditing',\n 'RevisionHistory'\n ];\n // Currently, the basic integration with Collaboration Features is to display a warning in the console.\n if (collaborationPluginNamesToWarn.some(pluginName => editor.plugins.has(pluginName))) {\n console.warn('You initialized the editor with the source editing feature and at least one of the collaboration features. ' +\n 'Please be advised that the source editing feature may not work, and be careful when editing document source ' +\n 'that contains markers created by the collaboration features.');\n }\n // Restricted Editing integration can also lead to problems. Warn the user accordingly.\n if (editor.plugins.has('RestrictedEditingModeEditing')) {\n console.warn('You initialized the editor with the source editing feature and restricted editing feature. ' +\n 'Please be advised that the source editing feature may not work, and be careful when editing document source ' +\n 'that contains markers created by the restricted editing feature.');\n }\n }\n /**\n * Updates the source data in all hidden editing roots.\n */\n updateEditorData() {\n const editor = this.editor;\n const data = {};\n for (const [rootName, domSourceEditingElementWrapper] of this._replacedRoots) {\n const oldData = this._dataFromRoots.get(rootName);\n const newData = domSourceEditingElementWrapper.dataset.value;\n // Do not set the data unless some changes have been made in the meantime.\n // This prevents empty undo steps after switching to the normal editor.\n if (oldData !== newData) {\n data[rootName] = newData;\n }\n }\n if (Object.keys(data).length) {\n editor.data.set(data, { batchType: { isUndoable: true } });\n }\n }\n /**\n * Creates source editing wrappers that replace each editing root. Each wrapper contains the document source from the corresponding\n * root.\n *\n * The wrapper element contains a textarea and it solves the problem, that the textarea element cannot auto expand its height based on\n * the content it contains. The solution is to make the textarea more like a plain div element, which expands in height as much as it\n * needs to, in order to display the whole document source without scrolling. The wrapper element is a parent for the textarea and for\n * the pseudo-element `::after`, that replicates the look, content, and position of the textarea. The pseudo-element replica is hidden,\n * but it is styled to be an identical visual copy of the textarea with the same content. Then, the wrapper is a grid container and both\n * of its children (the textarea and the `::after` pseudo-element) are positioned within a CSS grid to occupy the same grid cell. The\n * content in the pseudo-element `::after` is set in CSS and it stretches the grid to the appropriate size based on the textarea value.\n * Since both children occupy the same grid cell, both have always the same height.\n */\n _showSourceEditing() {\n const editor = this.editor;\n const editingView = editor.editing.view;\n const model = editor.model;\n model.change(writer => {\n writer.setSelection(null);\n writer.removeSelectionAttribute(model.document.selection.getAttributeKeys());\n });\n // It is not needed to iterate through all editing roots, as currently the plugin supports only the Classic Editor with a single\n // main root, but this code may help understand and use this feature in external integrations.\n for (const [rootName, domRootElement] of editingView.domRoots) {\n const data = formatSource(editor.data.get({ rootName }));\n const domSourceEditingElementTextarea = createElement(domRootElement.ownerDocument, 'textarea', {\n rows: '1',\n 'aria-label': 'Source code editing area'\n });\n const domSourceEditingElementWrapper = createElement(domRootElement.ownerDocument, 'div', {\n class: 'ck-source-editing-area',\n 'data-value': data\n }, [domSourceEditingElementTextarea]);\n domSourceEditingElementTextarea.value = data;\n // Setting a value to textarea moves the input cursor to the end. We want the selection at the beginning.\n domSourceEditingElementTextarea.setSelectionRange(0, 0);\n // Bind the textarea's value to the wrapper's `data-value` property. Each change of the textarea's value updates the\n // wrapper's `data-value` property.\n domSourceEditingElementTextarea.addEventListener('input', () => {\n domSourceEditingElementWrapper.dataset.value = domSourceEditingElementTextarea.value;\n editor.ui.update();\n });\n editingView.change(writer => {\n const viewRoot = editingView.document.getRoot(rootName);\n writer.addClass('ck-hidden', viewRoot);\n });\n // Register the element so it becomes available for Alt+F10 and Esc navigation.\n editor.ui.setEditableElement('sourceEditing:' + rootName, domSourceEditingElementTextarea);\n this._replacedRoots.set(rootName, domSourceEditingElementWrapper);\n this._elementReplacer.replace(domRootElement, domSourceEditingElementWrapper);\n this._dataFromRoots.set(rootName, data);\n }\n this._focusSourceEditing();\n }\n /**\n * Restores all hidden editing roots and sets the source data in them.\n */\n _hideSourceEditing() {\n const editor = this.editor;\n const editingView = editor.editing.view;\n this.updateEditorData();\n editingView.change(writer => {\n for (const [rootName] of this._replacedRoots) {\n writer.removeClass('ck-hidden', editingView.document.getRoot(rootName));\n }\n });\n this._elementReplacer.restore();\n this._replacedRoots.clear();\n this._dataFromRoots.clear();\n editingView.focus();\n }\n /**\n * Focuses the textarea containing document source from the first editing root.\n */\n _focusSourceEditing() {\n const editor = this.editor;\n const [domSourceEditingElementWrapper] = this._replacedRoots.values();\n const textarea = domSourceEditingElementWrapper.querySelector('textarea');\n // The FocusObserver was disabled by View.render() while the DOM root was getting hidden and the replacer\n // revealed the textarea. So it couldn't notice that the DOM root got blurred in the process.\n // Let's sync this state manually here because otherwise Renderer will attempt to render selection\n // in an invisible DOM root.\n editor.editing.view.document.isFocused = false;\n textarea.focus();\n }\n /**\n * Disables all commands.\n */\n _disableCommands() {\n const editor = this.editor;\n for (const command of editor.commands.commands()) {\n command.forceDisabled(COMMAND_FORCE_DISABLE_ID);\n }\n }\n /**\n * Clears forced disable for all commands, that was previously set through {@link #_disableCommands}.\n */\n _enableCommands() {\n const editor = this.editor;\n for (const command of editor.commands.commands()) {\n command.clearForceDisabled(COMMAND_FORCE_DISABLE_ID);\n }\n }\n /**\n * Adds or removes the `readonly` attribute from the textarea from all roots, if document source mode is active.\n *\n * @param isReadOnly Indicates whether all textarea elements should be read-only.\n */\n _handleReadOnlyMode(isReadOnly) {\n if (!this.isSourceEditingMode) {\n return;\n }\n for (const [, domSourceEditingElementWrapper] of this._replacedRoots) {\n domSourceEditingElementWrapper.querySelector('textarea').readOnly = isReadOnly;\n }\n }\n /**\n * Checks, if the plugin is allowed to handle the source editing mode by itself. Currently, the source editing mode is supported only\n * for the {@link module:editor-classic/classiceditor~ClassicEditor classic editor}.\n */\n _isAllowedToHandleSourceEditingMode() {\n const editor = this.editor;\n const editable = editor.ui.view.editable;\n // Checks, if the editor's editable belongs to the editor's DOM tree.\n return editable && !editable.hasExternalElement;\n }\n}\n/**\n * Formats the content for a better readability.\n *\n * For a non-HTML source the unchanged input string is returned.\n *\n * @param input Input string to check.\n */\nfunction formatSource(input) {\n if (!isHtml(input)) {\n return input;\n }\n return formatHtml(input);\n}\n/**\n * Checks, if the document source is HTML. It is sufficient to just check the first character from the document data.\n *\n * @param input Input string to check.\n */\nfunction isHtml(input) {\n return input.startsWith('<');\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module special-characters/ui/specialcharactersnavigationview\n */\nimport { Collection } from 'ckeditor5/src/utils';\nimport { addListToDropdown, createDropdown, Model, FormHeaderView } from 'ckeditor5/src/ui';\n/**\n * A class representing the navigation part of the special characters UI. It is responsible\n * for describing the feature and allowing the user to select a particular character group.\n */\nexport default class SpecialCharactersNavigationView extends FormHeaderView {\n /**\n * Creates an instance of the {@link module:special-characters/ui/specialcharactersnavigationview~SpecialCharactersNavigationView}\n * class.\n *\n * @param locale The localization services instance.\n * @param groupNames The names of the character groups and their displayed labels.\n */\n constructor(locale, groupNames) {\n super(locale);\n const t = locale.t;\n this.set('class', 'ck-special-characters-navigation');\n this.groupDropdownView = this._createGroupDropdown(groupNames);\n this.groupDropdownView.panelPosition = locale.uiLanguageDirection === 'rtl' ? 'se' : 'sw';\n this.label = t('Special characters');\n this.children.add(this.groupDropdownView);\n }\n /**\n * Returns the name of the character group currently selected in the {@link #groupDropdownView}.\n */\n get currentGroupName() {\n return this.groupDropdownView.value;\n }\n /**\n * Focuses the character categories dropdown.\n */\n focus() {\n this.groupDropdownView.focus();\n }\n /**\n * Returns a dropdown that allows selecting character groups.\n *\n * @param groupNames The names of the character groups and their displayed labels.\n */\n _createGroupDropdown(groupNames) {\n const locale = this.locale;\n const t = locale.t;\n const dropdown = createDropdown(locale);\n const groupDefinitions = this._getCharacterGroupListItemDefinitions(dropdown, groupNames);\n const accessibleLabel = t('Character categories');\n dropdown.set('value', groupDefinitions.first.model.name);\n dropdown.buttonView.bind('label').to(dropdown, 'value', value => groupNames.get(value));\n dropdown.buttonView.set({\n isOn: false,\n withText: true,\n tooltip: accessibleLabel,\n class: ['ck-dropdown__button_label-width_auto'],\n ariaLabel: accessibleLabel,\n ariaLabelledBy: undefined\n });\n dropdown.on('execute', evt => {\n dropdown.value = evt.source.name;\n });\n dropdown.delegate('execute').to(this);\n addListToDropdown(dropdown, groupDefinitions, {\n ariaLabel: accessibleLabel,\n role: 'menu'\n });\n return dropdown;\n }\n /**\n * Returns list item definitions to be used in the character group dropdown\n * representing specific character groups.\n *\n * @param dropdown Dropdown view element\n * @param groupNames The names of the character groups and their displayed labels.\n */\n _getCharacterGroupListItemDefinitions(dropdown, groupNames) {\n const groupDefs = new Collection();\n for (const [name, label] of groupNames) {\n const model = new Model({\n name,\n label,\n withText: true,\n role: 'menuitemradio'\n });\n model.bind('isOn').to(dropdown, 'value', value => value === model.name);\n groupDefs.add({ type: 'button', model });\n }\n return groupDefs;\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./charactergrid.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module special-characters/ui/charactergridview\n */\nimport { View, ButtonView, addKeyboardHandlingForGrid } from 'ckeditor5/src/ui';\nimport { KeystrokeHandler, FocusTracker, global } from 'ckeditor5/src/utils';\nimport '../../theme/charactergrid.css';\n/**\n * A grid of character tiles. It allows browsing special characters and selecting the character to\n * be inserted into the content.\n */\nexport default class CharacterGridView extends View {\n /**\n * Creates an instance of a character grid containing tiles representing special characters.\n *\n * @param locale The localization services instance.\n */\n constructor(locale) {\n super(locale);\n this.tiles = this.createCollection();\n this.setTemplate({\n tag: 'div',\n children: [\n {\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-character-grid__tiles'\n ]\n },\n children: this.tiles\n }\n ],\n attributes: {\n class: [\n 'ck',\n 'ck-character-grid'\n ]\n }\n });\n this.focusTracker = new FocusTracker();\n this.keystrokes = new KeystrokeHandler();\n addKeyboardHandlingForGrid({\n keystrokeHandler: this.keystrokes,\n focusTracker: this.focusTracker,\n gridItems: this.tiles,\n numberOfColumns: () => global.window\n .getComputedStyle(this.element.firstChild) // Responsive .ck-character-grid__tiles\n .getPropertyValue('grid-template-columns')\n .split(' ')\n .length,\n uiLanguageDirection: this.locale && this.locale.uiLanguageDirection\n });\n }\n /**\n * Creates a new tile for the grid.\n *\n * @param character A human-readable character displayed as the label (e.g. \"ε\").\n * @param name The name of the character (e.g. \"greek small letter epsilon\").\n */\n createTile(character, name) {\n const tile = new ButtonView(this.locale);\n tile.set({\n label: character,\n withText: true,\n class: 'ck-character-grid__tile'\n });\n // Labels are vital for the users to understand what character they're looking at.\n // For now we're using native title attribute for that, see #5817.\n tile.extendTemplate({\n attributes: {\n title: name\n },\n on: {\n mouseover: tile.bindTemplate.to('mouseover'),\n focus: tile.bindTemplate.to('focus')\n }\n });\n tile.on('mouseover', () => {\n this.fire('tileHover', { name, character });\n });\n tile.on('focus', () => {\n this.fire('tileFocus', { name, character });\n });\n tile.on('execute', () => {\n this.fire('execute', { name, character });\n });\n return tile;\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n for (const item of this.tiles) {\n this.focusTracker.add(item.element);\n }\n this.tiles.on('change', (eventInfo, { added, removed }) => {\n if (added.length > 0) {\n for (const item of added) {\n this.focusTracker.add(item.element);\n }\n }\n if (removed.length > 0) {\n for (const item of removed) {\n this.focusTracker.remove(item.element);\n }\n }\n });\n this.keystrokes.listenTo(this.element);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Focuses the first focusable in {@link ~CharacterGridView#tiles}.\n */\n focus() {\n this.tiles.first.focus();\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./characterinfo.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { View } from 'ckeditor5/src/ui';\nimport '../../theme/characterinfo.css';\n/**\n * The view displaying detailed information about a special character glyph, e.g. upon\n * hovering it with a mouse.\n */\nexport default class CharacterInfoView extends View {\n constructor(locale) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('character', null);\n this.set('name', null);\n this.bind('code').to(this, 'character', characterToUnicodeString);\n this.setTemplate({\n tag: 'div',\n children: [\n {\n tag: 'span',\n attributes: {\n class: [\n 'ck-character-info__name'\n ]\n },\n children: [\n {\n // Note: ZWSP to prevent vertical collapsing.\n text: bind.to('name', name => name ? name : '\\u200B')\n }\n ]\n },\n {\n tag: 'span',\n attributes: {\n class: [\n 'ck-character-info__code'\n ]\n },\n children: [\n {\n text: bind.to('code')\n }\n ]\n }\n ],\n attributes: {\n class: [\n 'ck',\n 'ck-character-info'\n ]\n }\n });\n }\n}\n/**\n * Converts a character into a \"Unicode string\", for instance:\n *\n * \"$\" -> \"U+0024\"\n *\n * Returns an empty string when the character is `null`.\n */\nfunction characterToUnicodeString(character) {\n if (character === null) {\n return '';\n }\n const hexCode = character.codePointAt(0).toString(16);\n return 'U+' + ('0000' + hexCode).slice(-4);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module special-characters/ui/specialcharactersview\n */\nimport { View, FocusCycler } from 'ckeditor5/src/ui';\nimport { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils';\n/**\n * A view that glues pieces of the special characters dropdown panel together:\n *\n * * the navigation view (allows selecting the category),\n * * the grid view (displays characters as a grid),\n * * and the info view (displays detailed info about a specific character).\n */\nexport default class SpecialCharactersView extends View {\n /**\n * Creates an instance of the `SpecialCharactersView`.\n */\n constructor(locale, navigationView, gridView, infoView) {\n super(locale);\n this.navigationView = navigationView;\n this.gridView = gridView;\n this.infoView = infoView;\n this.items = this.createCollection();\n this.focusTracker = new FocusTracker();\n this.keystrokes = new KeystrokeHandler();\n this._focusCycler = new FocusCycler({\n focusables: this.items,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n focusPrevious: 'shift + tab',\n focusNext: 'tab'\n }\n });\n this.setTemplate({\n tag: 'div',\n children: [\n this.navigationView,\n this.gridView,\n this.infoView\n ],\n attributes: {\n // Avoid focus loss when the user clicks the area of the grid that is not a button.\n // https://github.com/ckeditor/ckeditor5/pull/12319#issuecomment-1231779819\n tabindex: '-1'\n }\n });\n this.items.add(this.navigationView.groupDropdownView.buttonView);\n this.items.add(this.gridView);\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n this.focusTracker.add(this.navigationView.groupDropdownView.buttonView.element);\n this.focusTracker.add(this.gridView.element);\n // Start listening for the keystrokes coming from #element.\n this.keystrokes.listenTo(this.element);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Focuses the first focusable in {@link #items}.\n */\n focus() {\n this.navigationView.focus();\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./specialcharacters.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module special-characters/specialcharacters\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Typing } from 'ckeditor5/src/typing';\nimport { createDropdown } from 'ckeditor5/src/ui';\nimport { CKEditorError } from 'ckeditor5/src/utils';\nimport SpecialCharactersNavigationView from './ui/specialcharactersnavigationview';\nimport CharacterGridView from './ui/charactergridview';\nimport CharacterInfoView from './ui/characterinfoview';\nimport SpecialCharactersView from './ui/specialcharactersview';\nimport specialCharactersIcon from '../theme/icons/specialcharacters.svg';\nimport '../theme/specialcharacters.css';\nconst ALL_SPECIAL_CHARACTERS_GROUP = 'All';\n/**\n * The special characters feature.\n *\n * Introduces the `'specialCharacters'` dropdown.\n */\nexport default class SpecialCharacters extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [Typing];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'SpecialCharacters';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n const t = editor.t;\n this._characters = new Map();\n this._groups = new Map();\n this._allSpecialCharactersGroupLabel = t('All');\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n const inputCommand = editor.commands.get('insertText');\n // Add the `specialCharacters` dropdown button to feature components.\n editor.ui.componentFactory.add('specialCharacters', locale => {\n const dropdownView = createDropdown(locale);\n let dropdownPanelContent;\n dropdownView.buttonView.set({\n label: t('Special characters'),\n icon: specialCharactersIcon,\n tooltip: true\n });\n dropdownView.bind('isEnabled').to(inputCommand);\n // Insert a special character when a tile was clicked.\n dropdownView.on('execute', (evt, data) => {\n editor.execute('insertText', { text: data.character });\n editor.editing.view.focus();\n });\n dropdownView.on('change:isOpen', () => {\n if (!dropdownPanelContent) {\n dropdownPanelContent = this._createDropdownPanelContent(locale, dropdownView);\n const specialCharactersView = new SpecialCharactersView(locale, dropdownPanelContent.navigationView, dropdownPanelContent.gridView, dropdownPanelContent.infoView);\n dropdownView.panelView.children.add(specialCharactersView);\n }\n dropdownPanelContent.infoView.set({\n character: null,\n name: null\n });\n });\n return dropdownView;\n });\n }\n /**\n * Adds a collection of special characters to the specified group. The title of a special character must be unique.\n *\n * **Note:** The \"All\" category name is reserved by the plugin and cannot be used as a new name for a special\n * characters category.\n */\n addItems(groupName, items, options = { label: groupName }) {\n if (groupName === ALL_SPECIAL_CHARACTERS_GROUP) {\n /**\n * The name \"All\" for a special category group cannot be used because it is a special category that displays all\n * available special characters.\n *\n * @error special-character-invalid-group-name\n */\n throw new CKEditorError('special-character-invalid-group-name', null);\n }\n const group = this._getGroup(groupName, options.label);\n for (const item of items) {\n group.items.add(item.title);\n this._characters.set(item.title, item.character);\n }\n }\n /**\n * Returns special character groups in an order determined based on configuration and registration sequence.\n */\n getGroups() {\n const groups = Array.from(this._groups.keys());\n const order = this.editor.config.get('specialCharacters.order') || [];\n const invalidGroup = order.find(item => !groups.includes(item));\n if (invalidGroup) {\n /**\n * One of the special character groups in the \"specialCharacters.order\" configuration doesn't exist.\n *\n * @error special-character-invalid-order-group-name\n */\n throw new CKEditorError('special-character-invalid-order-group-name', null, { invalidGroup });\n }\n return new Set([\n ...order,\n ...groups\n ]);\n }\n /**\n * Returns a collection of special characters symbol names (titles).\n */\n getCharactersForGroup(groupName) {\n if (groupName === ALL_SPECIAL_CHARACTERS_GROUP) {\n return new Set(this._characters.keys());\n }\n const group = this._groups.get(groupName);\n if (group) {\n return group.items;\n }\n }\n /**\n * Returns the symbol of a special character for the specified name. If the special character could not be found, `undefined`\n * is returned.\n *\n * @param title The title of a special character.\n */\n getCharacter(title) {\n return this._characters.get(title);\n }\n /**\n * Returns a group of special characters. If the group with the specified name does not exist, it will be created.\n *\n * @param groupName The name of the group to create.\n * @param label The label describing the new group.\n */\n _getGroup(groupName, label) {\n if (!this._groups.has(groupName)) {\n this._groups.set(groupName, {\n items: new Set(),\n label\n });\n }\n return this._groups.get(groupName);\n }\n /**\n * Updates the symbol grid depending on the currently selected character group.\n */\n _updateGrid(currentGroupName, gridView) {\n // Updating the grid starts with removing all tiles belonging to the old group.\n gridView.tiles.clear();\n const characterTitles = this.getCharactersForGroup(currentGroupName);\n for (const title of characterTitles) {\n const character = this.getCharacter(title);\n gridView.tiles.add(gridView.createTile(character, title));\n }\n }\n /**\n * Initializes the dropdown, used for lazy loading.\n *\n * @returns An object with `navigationView`, `gridView` and `infoView` properties, containing UI parts.\n */\n _createDropdownPanelContent(locale, dropdownView) {\n const groupEntries = Array\n .from(this.getGroups())\n .map(name => ([name, this._groups.get(name).label]));\n // The map contains a name of category (an identifier) and its label (a translational string).\n const specialCharsGroups = new Map([\n // Add a special group that shows all available special characters.\n [ALL_SPECIAL_CHARACTERS_GROUP, this._allSpecialCharactersGroupLabel],\n ...groupEntries\n ]);\n const navigationView = new SpecialCharactersNavigationView(locale, specialCharsGroups);\n const gridView = new CharacterGridView(locale);\n const infoView = new CharacterInfoView(locale);\n gridView.delegate('execute').to(dropdownView);\n gridView.on('tileHover', (evt, data) => {\n infoView.set(data);\n });\n gridView.on('tileFocus', (evt, data) => {\n infoView.set(data);\n });\n // Update the grid of special characters when a user changed the character group.\n navigationView.on('execute', () => {\n this._updateGrid(navigationView.currentGroupName, gridView);\n });\n // Set the initial content of the special characters grid.\n this._updateGrid(navigationView.currentGroupName, gridView);\n return { navigationView, gridView, infoView };\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module special-characters/specialcharactersarrows\n */\nimport { Plugin } from 'ckeditor5/src/core';\n/**\n * A plugin that provides special characters for the \"Arrows\" category.\n *\n * ```ts\n * ClassicEditor\n * .create( {\n * plugins: [ ..., SpecialCharacters, SpecialCharactersArrows ],\n * } )\n * .then( ... )\n * .catch( ... );\n * ```\n */\nexport default class SpecialCharactersArrows extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'SpecialCharactersArrows';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n const plugin = editor.plugins.get('SpecialCharacters');\n plugin.addItems('Arrows', [\n { title: t('leftwards simple arrow'), character: '←' },\n { title: t('rightwards simple arrow'), character: '→' },\n { title: t('upwards simple arrow'), character: '↑' },\n { title: t('downwards simple arrow'), character: '↓' },\n { title: t('leftwards double arrow'), character: '⇐' },\n { title: t('rightwards double arrow'), character: '⇒' },\n { title: t('upwards double arrow'), character: '⇑' },\n { title: t('downwards double arrow'), character: '⇓' },\n { title: t('leftwards dashed arrow'), character: '⇠' },\n { title: t('rightwards dashed arrow'), character: '⇢' },\n { title: t('upwards dashed arrow'), character: '⇡' },\n { title: t('downwards dashed arrow'), character: '⇣' },\n { title: t('leftwards arrow to bar'), character: '⇤' },\n { title: t('rightwards arrow to bar'), character: '⇥' },\n { title: t('upwards arrow to bar'), character: '⤒' },\n { title: t('downwards arrow to bar'), character: '⤓' },\n { title: t('up down arrow with base'), character: '↨' },\n { title: t('back with leftwards arrow above'), character: '🔙' },\n { title: t('end with leftwards arrow above'), character: '🔚' },\n { title: t('on with exclamation mark with left right arrow above'), character: '🔛' },\n { title: t('soon with rightwards arrow above'), character: '🔜' },\n { title: t('top with upwards arrow above'), character: '🔝' }\n ], { label: t('Arrows') });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module special-characters/specialcharacterscurrency\n */\nimport { Plugin } from 'ckeditor5/src/core';\n/**\n * A plugin that provides special characters for the \"Currency\" category.\n *\n * ```ts\n * ClassicEditor\n * .create( {\n * plugins: [ ..., SpecialCharacters, SpecialCharactersCurrency ],\n * } )\n * .then( ... )\n * .catch( ... );\n * ```\n */\nexport default class SpecialCharactersCurrency extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'SpecialCharactersCurrency';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n const plugin = editor.plugins.get('SpecialCharacters');\n plugin.addItems('Currency', [\n { character: '$', title: t('Dollar sign') },\n { character: '€', title: t('Euro sign') },\n { character: '¥', title: t('Yen sign') },\n { character: '£', title: t('Pound sign') },\n { character: '¢', title: t('Cent sign') },\n { character: '₠', title: t('Euro-currency sign') },\n { character: '₡', title: t('Colon sign') },\n { character: '₢', title: t('Cruzeiro sign') },\n { character: '₣', title: t('French franc sign') },\n { character: '₤', title: t('Lira sign') },\n { character: '¤', title: t('Currency sign') },\n { character: '₿', title: t('Bitcoin sign') },\n { character: '₥', title: t('Mill sign') },\n { character: '₦', title: t('Naira sign') },\n { character: '₧', title: t('Peseta sign') },\n { character: '₨', title: t('Rupee sign') },\n { character: '₩', title: t('Won sign') },\n { character: '₪', title: t('New sheqel sign') },\n { character: '₫', title: t('Dong sign') },\n { character: '₭', title: t('Kip sign') },\n { character: '₮', title: t('Tugrik sign') },\n { character: '₯', title: t('Drachma sign') },\n { character: '₰', title: t('German penny sign') },\n { character: '₱', title: t('Peso sign') },\n { character: '₲', title: t('Guarani sign') },\n { character: '₳', title: t('Austral sign') },\n { character: '₴', title: t('Hryvnia sign') },\n { character: '₵', title: t('Cedi sign') },\n { character: '₶', title: t('Livre tournois sign') },\n { character: '₷', title: t('Spesmilo sign') },\n { character: '₸', title: t('Tenge sign') },\n { character: '₹', title: t('Indian rupee sign') },\n { character: '₺', title: t('Turkish lira sign') },\n { character: '₻', title: t('Nordic mark sign') },\n { character: '₼', title: t('Manat sign') },\n { character: '₽', title: t('Ruble sign') }\n ], { label: t('Currency') });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module special-characters/specialcharactersmathematical\n */\nimport { Plugin } from 'ckeditor5/src/core';\n/**\n * A plugin that provides special characters for the \"Mathematical\" category.\n *\n * ```ts\n * ClassicEditor\n * .create( {\n * plugins: [ ..., SpecialCharacters, SpecialCharactersMathematical ],\n * } )\n * .then( ... )\n * .catch( ... );\n * ```\n */\nexport default class SpecialCharactersMathematical extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'SpecialCharactersMathematical';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n const plugin = editor.plugins.get('SpecialCharacters');\n plugin.addItems('Mathematical', [\n { character: '<', title: t('Less-than sign') },\n { character: '>', title: t('Greater-than sign') },\n { character: '≤', title: t('Less-than or equal to') },\n { character: '≥', title: t('Greater-than or equal to') },\n { character: '', title: t('En dash') },\n { character: '—', title: t('Em dash') },\n { character: '¯', title: t('Macron') },\n { character: '‾', title: t('Overline') },\n { character: '°', title: t('Degree sign') },\n { character: '', title: t('Minus sign') },\n { character: '±', title: t('Plus-minus sign') },\n { character: '÷', title: t('Division sign') },\n { character: '', title: t('Fraction slash') },\n { character: '×', title: t('Multiplication sign') },\n { character: 'ƒ', title: t('Latin small letter f with hook') },\n { character: '∫', title: t('Integral') },\n { character: '∑', title: t('N-ary summation') },\n { character: '∞', title: t('Infinity') },\n { character: '√', title: t('Square root') },\n { character: '', title: t('Tilde operator') },\n { character: '≅', title: t('Approximately equal to') },\n { character: '≈', title: t('Almost equal to') },\n { character: '≠', title: t('Not equal to') },\n { character: '≡', title: t('Identical to') },\n { character: '∈', title: t('Element of') },\n { character: '∉', title: t('Not an element of') },\n { character: '∋', title: t('Contains as member') },\n { character: '∏', title: t('N-ary product') },\n { character: '∧', title: t('Logical and') },\n { character: '', title: t('Logical or') },\n { character: '¬', title: t('Not sign') },\n { character: '∩', title: t('Intersection') },\n { character: '', title: t('Union') },\n { character: '∂', title: t('Partial differential') },\n { character: '∀', title: t('For all') },\n { character: '∃', title: t('There exists') },\n { character: '∅', title: t('Empty set') },\n { character: '∇', title: t('Nabla') },\n { character: '', title: t('Asterisk operator') },\n { character: '∝', title: t('Proportional to') },\n { character: '∠', title: t('Angle') },\n { character: '¼', title: t('Vulgar fraction one quarter') },\n { character: '½', title: t('Vulgar fraction one half') },\n { character: '¾', title: t('Vulgar fraction three quarters') }\n ], { label: t('Mathematical') });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module special-characters/specialcharacterslatin\n */\nimport { Plugin } from 'ckeditor5/src/core';\n/**\n * A plugin that provides special characters for the \"Latin\" category.\n *\n * ```ts\n * ClassicEditor\n * .create( {\n * plugins: [ ..., SpecialCharacters, SpecialCharactersLatin ],\n * } )\n * .then( ... )\n * .catch( ... );\n * ```\n */\nexport default class SpecialCharactersLatin extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'SpecialCharactersLatin';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n const plugin = editor.plugins.get('SpecialCharacters');\n plugin.addItems('Latin', [\n { character: 'Ā', title: t('Latin capital letter a with macron') },\n { character: 'ā', title: t('Latin small letter a with macron') },\n { character: 'Ă', title: t('Latin capital letter a with breve') },\n { character: 'ă', title: t('Latin small letter a with breve') },\n { character: 'Ą', title: t('Latin capital letter a with ogonek') },\n { character: 'ą', title: t('Latin small letter a with ogonek') },\n { character: 'Ć', title: t('Latin capital letter c with acute') },\n { character: 'ć', title: t('Latin small letter c with acute') },\n { character: 'Ĉ', title: t('Latin capital letter c with circumflex') },\n { character: 'ĉ', title: t('Latin small letter c with circumflex') },\n { character: 'Ċ', title: t('Latin capital letter c with dot above') },\n { character: 'ċ', title: t('Latin small letter c with dot above') },\n { character: 'Č', title: t('Latin capital letter c with caron') },\n { character: 'č', title: t('Latin small letter c with caron') },\n { character: 'Ď', title: t('Latin capital letter d with caron') },\n { character: 'ď', title: t('Latin small letter d with caron') },\n { character: 'Đ', title: t('Latin capital letter d with stroke') },\n { character: 'đ', title: t('Latin small letter d with stroke') },\n { character: 'Ē', title: t('Latin capital letter e with macron') },\n { character: 'ē', title: t('Latin small letter e with macron') },\n { character: 'Ĕ', title: t('Latin capital letter e with breve') },\n { character: 'ĕ', title: t('Latin small letter e with breve') },\n { character: 'Ė', title: t('Latin capital letter e with dot above') },\n { character: 'ė', title: t('Latin small letter e with dot above') },\n { character: 'Ę', title: t('Latin capital letter e with ogonek') },\n { character: 'ę', title: t('Latin small letter e with ogonek') },\n { character: 'Ě', title: t('Latin capital letter e with caron') },\n { character: 'ě', title: t('Latin small letter e with caron') },\n { character: 'Ĝ', title: t('Latin capital letter g with circumflex') },\n { character: 'ĝ', title: t('Latin small letter g with circumflex') },\n { character: 'Ğ', title: t('Latin capital letter g with breve') },\n { character: 'ğ', title: t('Latin small letter g with breve') },\n { character: 'Ġ', title: t('Latin capital letter g with dot above') },\n { character: 'ġ', title: t('Latin small letter g with dot above') },\n { character: 'Ģ', title: t('Latin capital letter g with cedilla') },\n { character: 'ģ', title: t('Latin small letter g with cedilla') },\n { character: 'Ĥ', title: t('Latin capital letter h with circumflex') },\n { character: 'ĥ', title: t('Latin small letter h with circumflex') },\n { character: 'Ħ', title: t('Latin capital letter h with stroke') },\n { character: 'ħ', title: t('Latin small letter h with stroke') },\n { character: 'Ĩ', title: t('Latin capital letter i with tilde') },\n { character: 'ĩ', title: t('Latin small letter i with tilde') },\n { character: 'Ī', title: t('Latin capital letter i with macron') },\n { character: 'ī', title: t('Latin small letter i with macron') },\n { character: 'Ĭ', title: t('Latin capital letter i with breve') },\n { character: 'ĭ', title: t('Latin small letter i with breve') },\n { character: 'Į', title: t('Latin capital letter i with ogonek') },\n { character: 'į', title: t('Latin small letter i with ogonek') },\n { character: 'İ', title: t('Latin capital letter i with dot above') },\n { character: 'ı', title: t('Latin small letter dotless i') },\n { character: 'IJ', title: t('Latin capital ligature ij') },\n { character: 'ij', title: t('Latin small ligature ij') },\n { character: 'Ĵ', title: t('Latin capital letter j with circumflex') },\n { character: 'ĵ', title: t('Latin small letter j with circumflex') },\n { character: 'Ķ', title: t('Latin capital letter k with cedilla') },\n { character: 'ķ', title: t('Latin small letter k with cedilla') },\n { character: 'ĸ', title: t('Latin small letter kra') },\n { character: 'Ĺ', title: t('Latin capital letter l with acute') },\n { character: 'ĺ', title: t('Latin small letter l with acute') },\n { character: 'Ļ', title: t('Latin capital letter l with cedilla') },\n { character: 'ļ', title: t('Latin small letter l with cedilla') },\n { character: 'Ľ', title: t('Latin capital letter l with caron') },\n { character: 'ľ', title: t('Latin small letter l with caron') },\n { character: 'Ŀ', title: t('Latin capital letter l with middle dot') },\n { character: 'ŀ', title: t('Latin small letter l with middle dot') },\n { character: 'Ł', title: t('Latin capital letter l with stroke') },\n { character: 'ł', title: t('Latin small letter l with stroke') },\n { character: 'Ń', title: t('Latin capital letter n with acute') },\n { character: 'ń', title: t('Latin small letter n with acute') },\n { character: 'Ņ', title: t('Latin capital letter n with cedilla') },\n { character: 'ņ', title: t('Latin small letter n with cedilla') },\n { character: 'Ň', title: t('Latin capital letter n with caron') },\n { character: 'ň', title: t('Latin small letter n with caron') },\n { character: 'ʼn', title: t('Latin small letter n preceded by apostrophe') },\n { character: 'Ŋ', title: t('Latin capital letter eng') },\n { character: 'ŋ', title: t('Latin small letter eng') },\n { character: 'Ō', title: t('Latin capital letter o with macron') },\n { character: 'ō', title: t('Latin small letter o with macron') },\n { character: 'Ŏ', title: t('Latin capital letter o with breve') },\n { character: 'ŏ', title: t('Latin small letter o with breve') },\n { character: 'Ő', title: t('Latin capital letter o with double acute') },\n { character: 'ő', title: t('Latin small letter o with double acute') },\n { character: 'Œ', title: t('Latin capital ligature oe') },\n { character: 'œ', title: t('Latin small ligature oe') },\n { character: 'Ŕ', title: t('Latin capital letter r with acute') },\n { character: 'ŕ', title: t('Latin small letter r with acute') },\n { character: 'Ŗ', title: t('Latin capital letter r with cedilla') },\n { character: 'ŗ', title: t('Latin small letter r with cedilla') },\n { character: 'Ř', title: t('Latin capital letter r with caron') },\n { character: 'ř', title: t('Latin small letter r with caron') },\n { character: 'Ś', title: t('Latin capital letter s with acute') },\n { character: 'ś', title: t('Latin small letter s with acute') },\n { character: 'Ŝ', title: t('Latin capital letter s with circumflex') },\n { character: 'ŝ', title: t('Latin small letter s with circumflex') },\n { character: 'Ş', title: t('Latin capital letter s with cedilla') },\n { character: 'ş', title: t('Latin small letter s with cedilla') },\n { character: 'Š', title: t('Latin capital letter s with caron') },\n { character: 'š', title: t('Latin small letter s with caron') },\n { character: 'Ţ', title: t('Latin capital letter t with cedilla') },\n { character: 'ţ', title: t('Latin small letter t with cedilla') },\n { character: 'Ť', title: t('Latin capital letter t with caron') },\n { character: 'ť', title: t('Latin small letter t with caron') },\n { character: 'Ŧ', title: t('Latin capital letter t with stroke') },\n { character: 'ŧ', title: t('Latin small letter t with stroke') },\n { character: 'Ũ', title: t('Latin capital letter u with tilde') },\n { character: 'ũ', title: t('Latin small letter u with tilde') },\n { character: 'Ū', title: t('Latin capital letter u with macron') },\n { character: 'ū', title: t('Latin small letter u with macron') },\n { character: 'Ŭ', title: t('Latin capital letter u with breve') },\n { character: 'ŭ', title: t('Latin small letter u with breve') },\n { character: 'Ů', title: t('Latin capital letter u with ring above') },\n { character: 'ů', title: t('Latin small letter u with ring above') },\n { character: 'Ű', title: t('Latin capital letter u with double acute') },\n { character: 'ű', title: t('Latin small letter u with double acute') },\n { character: 'Ų', title: t('Latin capital letter u with ogonek') },\n { character: 'ų', title: t('Latin small letter u with ogonek') },\n { character: 'Ŵ', title: t('Latin capital letter w with circumflex') },\n { character: 'ŵ', title: t('Latin small letter w with circumflex') },\n { character: 'Ŷ', title: t('Latin capital letter y with circumflex') },\n { character: 'ŷ', title: t('Latin small letter y with circumflex') },\n { character: 'Ÿ', title: t('Latin capital letter y with diaeresis') },\n { character: 'Ź', title: t('Latin capital letter z with acute') },\n { character: 'ź', title: t('Latin small letter z with acute') },\n { character: 'Ż', title: t('Latin capital letter z with dot above') },\n { character: 'ż', title: t('Latin small letter z with dot above') },\n { character: 'Ž', title: t('Latin capital letter z with caron') },\n { character: 'ž', title: t('Latin small letter z with caron') },\n { character: 'ſ', title: t('Latin small letter long s') }\n ], { label: t('Latin') });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module special-characters/specialcharacterstext\n */\nimport { Plugin } from 'ckeditor5/src/core';\n/**\n * A plugin that provides special characters for the \"Text\" category.\n *\n * ```ts\n * ClassicEditor\n * .create( {\n * plugins: [ ..., SpecialCharacters, SpecialCharactersText ],\n * } )\n * .then( ... )\n * .catch( ... );\n * ```\n */\nexport default class SpecialCharactersText extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'SpecialCharactersText';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n const plugin = editor.plugins.get('SpecialCharacters');\n plugin.addItems('Text', [\n { character: '', title: t('Single left-pointing angle quotation mark') },\n { character: '', title: t('Single right-pointing angle quotation mark') },\n { character: '«', title: t('Left-pointing double angle quotation mark') },\n { character: '»', title: t('Right-pointing double angle quotation mark') },\n { character: '', title: t('Left single quotation mark') },\n { character: '', title: t('Right single quotation mark') },\n { character: '“', title: t('Left double quotation mark') },\n { character: '”', title: t('Right double quotation mark') },\n { character: '', title: t('Single low-9 quotation mark') },\n { character: '„', title: t('Double low-9 quotation mark') },\n { character: '¡', title: t('Inverted exclamation mark') },\n { character: '¿', title: t('Inverted question mark') },\n { character: '‥', title: t('Two dot leader') },\n { character: '…', title: t('Horizontal ellipsis') },\n { character: '‡', title: t('Double dagger') },\n { character: '‰', title: t('Per mille sign') },\n { character: '‱', title: t('Per ten thousand sign') },\n { character: '‼', title: t('Double exclamation mark') },\n { character: '⁈', title: t('Question exclamation mark') },\n { character: '⁉', title: t('Exclamation question mark') },\n { character: '⁇', title: t('Double question mark') },\n { character: '©', title: t('Copyright sign') },\n { character: '®', title: t('Registered sign') },\n { character: '™', title: t('Trade mark sign') },\n { character: '§', title: t('Section sign') },\n { character: '¶', title: t('Paragraph sign') },\n { character: '⁋', title: t('Reversed paragraph sign') }\n ], { label: t('Text') });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/strikethrough/strikethroughediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport AttributeCommand from '../attributecommand';\nconst STRIKETHROUGH = 'strikethrough';\n/**\n * The strikethrough editing feature.\n *\n * It registers the `'strikethrough'` command, the <kbd>Ctrl+Shift+X</kbd> keystroke and introduces the\n * `strikethroughsthrough` attribute in the model which renders to the view\n * as a `<s>` element.\n */\nexport default class StrikethroughEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'StrikethroughEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Allow strikethrough attribute on text nodes.\n editor.model.schema.extend('$text', { allowAttributes: STRIKETHROUGH });\n editor.model.schema.setAttributeProperties(STRIKETHROUGH, {\n isFormatting: true,\n copyOnEnter: true\n });\n editor.conversion.attributeToElement({\n model: STRIKETHROUGH,\n view: 's',\n upcastAlso: [\n 'del',\n 'strike',\n {\n styles: {\n 'text-decoration': 'line-through'\n }\n }\n ]\n });\n // Create strikethrough command.\n editor.commands.add(STRIKETHROUGH, new AttributeCommand(editor, STRIKETHROUGH));\n // Set the Ctrl+Shift+X keystroke.\n editor.keystrokes.set('CTRL+SHIFT+X', 'strikethrough');\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M7 16.4c-.8-.4-1.5-.9-2.2-1.5a.6.6 0 0 1-.2-.5l.3-.6h1c1 1.2 2.1 1.7 3.7 1.7 1 0 1.8-.3 2.3-.6.6-.4.6-1.2.6-1.3.2-1.2-.9-2.1-.9-2.1h2.1c.3.7.4 1.2.4 1.7v.8l-.6 1.2c-.6.8-1.1 1-1.6 1.2a6 6 0 0 1-2.4.6c-1 0-1.8-.3-2.5-.6zM6.8 9 6 8.3c-.4-.5-.5-.8-.5-1.6 0-.7.1-1.3.5-1.8.4-.6 1-1 1.6-1.3a6.3 6.3 0 0 1 4.7 0 4 4 0 0 1 1.7 1l.3.7c0 .1.2.4-.2.7-.4.2-.9.1-1 0a3 3 0 0 0-1.2-1c-.4-.2-1-.3-2-.4-.7 0-1.4.2-2 .6-.8.6-1 .8-1 1.5 0 .8.5 1 1.2 1.5.6.4 1.1.7 1.9 1H6.8z\\\"/><path d=\\\"M3 10.5V9h14v1.5z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/strikethrough/strikethroughui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ButtonView } from 'ckeditor5/src/ui';\nimport strikethroughIcon from '../../theme/icons/strikethrough.svg';\nconst STRIKETHROUGH = 'strikethrough';\n/**\n * The strikethrough UI feature. It introduces the Strikethrough button.\n */\nexport default class StrikethroughUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'StrikethroughUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n // Add strikethrough button to feature components.\n editor.ui.componentFactory.add(STRIKETHROUGH, locale => {\n const command = editor.commands.get(STRIKETHROUGH);\n const view = new ButtonView(locale);\n view.set({\n label: t('Strikethrough'),\n icon: strikethroughIcon,\n keystroke: 'CTRL+SHIFT+X',\n tooltip: true,\n isToggleable: true\n });\n view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n // Execute command.\n this.listenTo(view, 'execute', () => {\n editor.execute(STRIKETHROUGH);\n editor.editing.view.focus();\n });\n return view;\n });\n }\n}\n","/**\r\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\r\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\r\n */\r\nimport { ButtonView, View } from 'ckeditor5/src/ui';\r\n/**\r\n * A class representing an individual button (style) in the grid. Renders a rich preview of the style.\r\n */\r\nexport default class StyleGridButtonView extends ButtonView {\r\n /**\r\n * Creates an instance of the {@link module:style/ui/stylegridbuttonview~StyleGridButtonView} class.\r\n *\r\n * @param locale The localization services instance.\r\n * @param styleDefinition Definition of the style.\r\n */\r\n constructor(locale, styleDefinition) {\r\n super(locale);\r\n this.styleDefinition = styleDefinition;\r\n this.previewView = this._createPreview();\r\n this.set({\r\n label: styleDefinition.name,\r\n class: 'ck-style-grid__button',\r\n withText: true\r\n });\r\n this.extendTemplate({\r\n attributes: {\r\n role: 'option'\r\n }\r\n });\r\n this.children.add(this.previewView, 0);\r\n }\r\n /**\r\n * Creates the view representing the preview of the style.\r\n */\r\n _createPreview() {\r\n const previewView = new View(this.locale);\r\n previewView.setTemplate({\r\n tag: 'div',\r\n attributes: {\r\n class: [\r\n 'ck',\r\n 'ck-reset_all-excluded',\r\n 'ck-style-grid__button__preview',\r\n 'ck-content'\r\n ],\r\n // The preview \"AaBbCcDdEeFfGgHhIiJj\" should not be read by screen readers because it is purely presentational.\r\n 'aria-hidden': 'true'\r\n },\r\n children: [\r\n this.styleDefinition.previewTemplate\r\n ]\r\n });\r\n return previewView;\r\n }\r\n}\r\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./stylegrid.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\r\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\r\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\r\n */\r\n/**\r\n * @module style/ui/stylegridview\r\n */\r\nimport { View, addKeyboardHandlingForGrid } from 'ckeditor5/src/ui';\r\nimport { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils';\r\nimport StyleGridButtonView from './stylegridbuttonview';\r\nimport '../../theme/stylegrid.css';\r\n/**\r\n * A class representing a grid of styles ({@link module:style/ui/stylegridbuttonview~StyleGridButtonView buttons}).\r\n * Allows users to select a style.\r\n */\r\nexport default class StyleGridView extends View {\r\n /**\r\n * Creates an instance of the {@link module:style/ui/stylegridview~StyleGridView} class.\r\n *\r\n * @param locale The localization services instance.\r\n * @param styleDefinitions Definitions of the styles.\r\n */\r\n constructor(locale, styleDefinitions) {\r\n super(locale);\r\n this.focusTracker = new FocusTracker();\r\n this.keystrokes = new KeystrokeHandler();\r\n this.set('activeStyles', []);\r\n this.set('enabledStyles', []);\r\n this.children = this.createCollection();\r\n this.children.delegate('execute').to(this);\r\n for (const definition of styleDefinitions) {\r\n const gridTileView = new StyleGridButtonView(locale, definition);\r\n this.children.add(gridTileView);\r\n }\r\n this.on('change:activeStyles', () => {\r\n for (const child of this.children) {\r\n child.isOn = this.activeStyles.includes(child.styleDefinition.name);\r\n }\r\n });\r\n this.on('change:enabledStyles', () => {\r\n for (const child of this.children) {\r\n child.isEnabled = this.enabledStyles.includes(child.styleDefinition.name);\r\n }\r\n });\r\n this.setTemplate({\r\n tag: 'div',\r\n attributes: {\r\n class: [\r\n 'ck',\r\n 'ck-style-grid'\r\n ],\r\n role: 'listbox'\r\n },\r\n children: this.children\r\n });\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n render() {\r\n super.render();\r\n for (const child of this.children) {\r\n this.focusTracker.add(child.element);\r\n }\r\n addKeyboardHandlingForGrid({\r\n keystrokeHandler: this.keystrokes,\r\n focusTracker: this.focusTracker,\r\n gridItems: this.children,\r\n numberOfColumns: 3,\r\n uiLanguageDirection: this.locale && this.locale.uiLanguageDirection\r\n });\r\n // Start listening for the keystrokes coming from the grid view.\r\n this.keystrokes.listenTo(this.element);\r\n }\r\n /**\r\n * Focuses the first style button in the grid.\r\n */\r\n focus() {\r\n this.children.first.focus();\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n destroy() {\r\n super.destroy();\r\n this.focusTracker.destroy();\r\n this.keystrokes.destroy();\r\n }\r\n}\r\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./stylegroup.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\r\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\r\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\r\n */\r\n/**\r\n * @module style/ui/stylegroupview\r\n */\r\nimport { LabelView, View } from 'ckeditor5/src/ui';\r\nimport StyleGridView from './stylegridview';\r\nimport '../../theme/stylegroup.css';\r\n/**\r\n * A class representing a group of styles (e.g. \"block\" or \"inline\").\r\n *\r\n * Renders a {@link module:style/ui/stylegridview~StyleGridView style grid} and a label.\r\n */\r\nexport default class StyleGroupView extends View {\r\n /**\r\n * Creates an instance of the {@link module:style/ui/stylegroupview~StyleGroupView} class.\r\n *\r\n * @param locale The localization services instance.\r\n * @param label The localized label of the group.\r\n * @param styleDefinitions Definitions of the styles in the group.\r\n */\r\n constructor(locale, label, styleDefinitions) {\r\n super(locale);\r\n this.labelView = new LabelView(locale);\r\n this.labelView.text = label;\r\n this.gridView = new StyleGridView(locale, styleDefinitions);\r\n this.setTemplate({\r\n tag: 'div',\r\n attributes: {\r\n class: [\r\n 'ck',\r\n 'ck-style-panel__style-group'\r\n ],\r\n role: 'group',\r\n 'aria-labelledby': this.labelView.id\r\n },\r\n children: [\r\n this.labelView,\r\n this.gridView\r\n ]\r\n });\r\n }\r\n}\r\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./stylepanel.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\r\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\r\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\r\n */\r\n/**\r\n * @module style/ui/stylepanelview\r\n */\r\nimport { FocusCycler, View, ViewCollection } from 'ckeditor5/src/ui';\r\nimport { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils';\r\nimport StyleGroupView from './stylegroupview';\r\nimport '../../theme/stylepanel.css';\r\n/**\r\n * A class representing a panel with available content styles. It renders styles in button grids, grouped\r\n * in categories.\r\n */\r\nexport default class StylePanelView extends View {\r\n /**\r\n * Creates an instance of the {@link module:style/ui/stylegroupview~StyleGroupView} class.\r\n *\r\n * @param locale The localization services instance.\r\n * @param styleDefinitions Normalized definitions of the styles.\r\n */\r\n constructor(locale, styleDefinitions) {\r\n super(locale);\r\n const t = locale.t;\r\n this.focusTracker = new FocusTracker();\r\n this.keystrokes = new KeystrokeHandler();\r\n this.children = this.createCollection();\r\n this.blockStylesGroupView = new StyleGroupView(locale, t('Block styles'), styleDefinitions.block);\r\n this.inlineStylesGroupView = new StyleGroupView(locale, t('Text styles'), styleDefinitions.inline);\r\n this.set('activeStyles', []);\r\n this.set('enabledStyles', []);\r\n this._focusables = new ViewCollection();\r\n this._focusCycler = new FocusCycler({\r\n focusables: this._focusables,\r\n focusTracker: this.focusTracker,\r\n keystrokeHandler: this.keystrokes,\r\n actions: {\r\n // Navigate style groups backwards using the <kbd>Shift</kbd> + <kbd>Tab</kbd> keystroke.\r\n focusPrevious: ['shift + tab'],\r\n // Navigate style groups forward using the <kbd>Tab</kbd> key.\r\n focusNext: ['tab']\r\n }\r\n });\r\n if (styleDefinitions.block.length) {\r\n this.children.add(this.blockStylesGroupView);\r\n }\r\n if (styleDefinitions.inline.length) {\r\n this.children.add(this.inlineStylesGroupView);\r\n }\r\n this.blockStylesGroupView.gridView.delegate('execute').to(this);\r\n this.inlineStylesGroupView.gridView.delegate('execute').to(this);\r\n this.blockStylesGroupView.gridView\r\n .bind('activeStyles', 'enabledStyles')\r\n .to(this, 'activeStyles', 'enabledStyles');\r\n this.inlineStylesGroupView.gridView\r\n .bind('activeStyles', 'enabledStyles')\r\n .to(this, 'activeStyles', 'enabledStyles');\r\n this.setTemplate({\r\n tag: 'div',\r\n attributes: {\r\n class: [\r\n 'ck',\r\n 'ck-style-panel'\r\n ]\r\n },\r\n children: this.children\r\n });\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n render() {\r\n super.render();\r\n // Register the views as focusable.\r\n this._focusables.add(this.blockStylesGroupView.gridView);\r\n this._focusables.add(this.inlineStylesGroupView.gridView);\r\n // Register the views in the focus tracker.\r\n this.focusTracker.add(this.blockStylesGroupView.gridView.element);\r\n this.focusTracker.add(this.inlineStylesGroupView.gridView.element);\r\n this.keystrokes.listenTo(this.element);\r\n }\r\n /**\r\n * Focuses the first focusable element in the panel.\r\n */\r\n focus() {\r\n this._focusCycler.focusFirst();\r\n }\r\n /**\r\n * Focuses the last focusable element in the panel.\r\n */\r\n focusLast() {\r\n this._focusCycler.focusLast();\r\n }\r\n}\r\n","/**\r\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\r\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\r\n */\r\n/**\r\n * @module style/styleutils\r\n */\r\nimport { Plugin } from 'ckeditor5/src/core';\r\nimport { isObject } from 'lodash-es';\r\n// These are intermediate element names that can't be rendered as style preview because they don't make sense standalone.\r\nconst NON_PREVIEWABLE_ELEMENT_NAMES = [\r\n 'caption', 'colgroup', 'dd', 'dt', 'figcaption', 'legend', 'li', 'optgroup', 'option', 'rp',\r\n 'rt', 'summary', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr'\r\n];\r\nexport default class StyleUtils extends Plugin {\r\n /**\r\n * @inheritDoc\r\n */\r\n static get pluginName() {\r\n return 'StyleUtils';\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n constructor(editor) {\r\n super(editor);\r\n this.decorate('isStyleEnabledForBlock');\r\n this.decorate('isStyleActiveForBlock');\r\n this.decorate('getAffectedBlocks');\r\n this.decorate('isStyleEnabledForInlineSelection');\r\n this.decorate('isStyleActiveForInlineSelection');\r\n this.decorate('getAffectedInlineSelectable');\r\n this.decorate('getStylePreview');\r\n this.decorate('configureGHSDataFilter');\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n init() {\r\n this._htmlSupport = this.editor.plugins.get('GeneralHtmlSupport');\r\n }\r\n /**\r\n * Normalizes {@link module:style/styleconfig~StyleConfig#definitions} in the configuration of the styles feature.\r\n * The structure of normalized styles looks as follows:\r\n *\r\n * ```ts\r\n * {\r\n * \tblock: [\r\n * \t\t<module:style/style~StyleDefinition>,\r\n * \t\t<module:style/style~StyleDefinition>,\r\n * \t\t...\r\n * \t],\r\n * \tinline: [\r\n * \t\t<module:style/style~StyleDefinition>,\r\n * \t\t<module:style/style~StyleDefinition>,\r\n * \t\t...\r\n * \t]\r\n * }\r\n * ```\r\n *\r\n * @returns An object with normalized style definitions grouped into `block` and `inline` categories (arrays).\r\n */\r\n normalizeConfig(dataSchema, styleDefinitions = []) {\r\n const normalizedDefinitions = {\r\n block: [],\r\n inline: []\r\n };\r\n for (const definition of styleDefinitions) {\r\n const modelElements = [];\r\n const ghsAttributes = [];\r\n for (const ghsDefinition of dataSchema.getDefinitionsForView(definition.element)) {\r\n const appliesToBlock = 'appliesToBlock' in ghsDefinition ? ghsDefinition.appliesToBlock : false;\r\n if (ghsDefinition.isBlock || appliesToBlock) {\r\n if (typeof appliesToBlock == 'string') {\r\n modelElements.push(appliesToBlock);\r\n }\r\n else if (ghsDefinition.isBlock) {\r\n const ghsBlockDefinition = ghsDefinition;\r\n modelElements.push(ghsDefinition.model);\r\n if (ghsBlockDefinition.paragraphLikeModel) {\r\n modelElements.push(ghsBlockDefinition.paragraphLikeModel);\r\n }\r\n }\r\n }\r\n else {\r\n ghsAttributes.push(ghsDefinition.model);\r\n }\r\n }\r\n const previewTemplate = this.getStylePreview(definition, [\r\n { text: 'AaBbCcDdEeFfGgHhIiJj' }\r\n ]);\r\n if (modelElements.length) {\r\n normalizedDefinitions.block.push({\r\n ...definition,\r\n previewTemplate,\r\n modelElements,\r\n isBlock: true\r\n });\r\n }\r\n else {\r\n normalizedDefinitions.inline.push({\r\n ...definition,\r\n previewTemplate,\r\n ghsAttributes\r\n });\r\n }\r\n }\r\n return normalizedDefinitions;\r\n }\r\n /**\r\n * Verifies if the given style is applicable to the provided block element.\r\n *\r\n * @internal\r\n */\r\n isStyleEnabledForBlock(definition, block) {\r\n const model = this.editor.model;\r\n const attributeName = this._htmlSupport.getGhsAttributeNameForElement(definition.element);\r\n if (!model.schema.checkAttribute(block, attributeName)) {\r\n return false;\r\n }\r\n return definition.modelElements.includes(block.name);\r\n }\r\n /**\r\n * Returns true if the given style is applied to the specified block element.\r\n *\r\n * @internal\r\n */\r\n isStyleActiveForBlock(definition, block) {\r\n const attributeName = this._htmlSupport.getGhsAttributeNameForElement(definition.element);\r\n const ghsAttributeValue = block.getAttribute(attributeName);\r\n return this.hasAllClasses(ghsAttributeValue, definition.classes);\r\n }\r\n /**\r\n * Returns an array of block elements that style should be applied to.\r\n *\r\n * @internal\r\n */\r\n getAffectedBlocks(definition, block) {\r\n if (definition.modelElements.includes(block.name)) {\r\n return [block];\r\n }\r\n return null;\r\n }\r\n /**\r\n * Verifies if the given style is applicable to the provided document selection.\r\n *\r\n * @internal\r\n */\r\n isStyleEnabledForInlineSelection(definition, selection) {\r\n const model = this.editor.model;\r\n for (const ghsAttributeName of definition.ghsAttributes) {\r\n if (model.schema.checkAttributeInSelection(selection, ghsAttributeName)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /**\r\n * Returns true if the given style is applied to the specified document selection.\r\n *\r\n * @internal\r\n */\r\n isStyleActiveForInlineSelection(definition, selection) {\r\n for (const ghsAttributeName of definition.ghsAttributes) {\r\n const ghsAttributeValue = this._getValueFromFirstAllowedNode(selection, ghsAttributeName);\r\n if (this.hasAllClasses(ghsAttributeValue, definition.classes)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /**\r\n * Returns a selectable that given style should be applied to.\r\n *\r\n * @internal\r\n */\r\n getAffectedInlineSelectable(definition, selection) {\r\n return selection;\r\n }\r\n /**\r\n * Returns the `TemplateDefinition` used by styles dropdown to render style preview.\r\n *\r\n * @internal\r\n */\r\n getStylePreview(definition, children) {\r\n const { element, classes } = definition;\r\n return {\r\n tag: isPreviewable(element) ? element : 'div',\r\n attributes: {\r\n class: classes\r\n },\r\n children\r\n };\r\n }\r\n /**\r\n * Verifies if all classes are present in the given GHS attribute.\r\n *\r\n * @internal\r\n */\r\n hasAllClasses(ghsAttributeValue, classes) {\r\n return isObject(ghsAttributeValue) &&\r\n hasClassesProperty(ghsAttributeValue) &&\r\n classes.every(className => ghsAttributeValue.classes.includes(className));\r\n }\r\n /**\r\n * This is where the styles feature configures the GHS feature. This method translates normalized\r\n * {@link module:style/styleconfig~StyleDefinition style definitions} to\r\n * {@link module:engine/view/matcher~MatcherPattern matcher patterns} and feeds them to the GHS\r\n * {@link module:html-support/datafilter~DataFilter} plugin.\r\n *\r\n * @internal\r\n */\r\n configureGHSDataFilter({ block, inline }) {\r\n const ghsDataFilter = this.editor.plugins.get('DataFilter');\r\n ghsDataFilter.loadAllowedConfig(block.map(normalizedStyleDefinitionToMatcherPattern));\r\n ghsDataFilter.loadAllowedConfig(inline.map(normalizedStyleDefinitionToMatcherPattern));\r\n }\r\n /**\r\n * Checks the attribute value of the first node in the selection that allows the attribute.\r\n * For the collapsed selection, returns the selection attribute.\r\n *\r\n * @param selection The document selection.\r\n * @param attributeName Name of the GHS attribute.\r\n * @returns The attribute value.\r\n */\r\n _getValueFromFirstAllowedNode(selection, attributeName) {\r\n const model = this.editor.model;\r\n const schema = model.schema;\r\n if (selection.isCollapsed) {\r\n return selection.getAttribute(attributeName);\r\n }\r\n for (const range of selection.getRanges()) {\r\n for (const item of range.getItems()) {\r\n if (schema.checkAttribute(item, attributeName)) {\r\n return item.getAttribute(attributeName);\r\n }\r\n }\r\n }\r\n return null;\r\n }\r\n}\r\n/**\r\n * Checks if given object has `classes` property which is an array.\r\n *\r\n * @param obj Object to check.\r\n */\r\nfunction hasClassesProperty(obj) {\r\n return Boolean(obj.classes) && Array.isArray(obj.classes);\r\n}\r\n/**\r\n * Decides whether an element should be created in the preview or a substitute `<div>` should\r\n * be used instead. This avoids previewing a standalone `<td>`, `<li>`, etc. without a parent.\r\n *\r\n * @param elementName Name of the element\r\n * @returns Boolean indicating whether the element can be rendered.\r\n */\r\nfunction isPreviewable(elementName) {\r\n return !NON_PREVIEWABLE_ELEMENT_NAMES.includes(elementName);\r\n}\r\n/**\r\n * Translates a normalized style definition to a view matcher pattern.\r\n */\r\nfunction normalizedStyleDefinitionToMatcherPattern({ element, classes }) {\r\n return {\r\n name: element,\r\n classes\r\n };\r\n}\r\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./style.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\r\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\r\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\r\n */\r\n/**\r\n * @module style/styleui\r\n */\r\nimport { Plugin } from 'ckeditor5/src/core';\r\nimport { createDropdown } from 'ckeditor5/src/ui';\r\nimport StylePanelView from './ui/stylepanelview';\r\nimport StyleUtils from './styleutils';\r\nimport '../theme/style.css';\r\n/**\r\n * The UI plugin of the style feature .\r\n *\r\n * It registers the `'style'` UI dropdown in the editor's {@link module:ui/componentfactory~ComponentFactory component factory}\r\n * that displays a grid of styles and allows changing styles of the content.\r\n */\r\nexport default class StyleUI extends Plugin {\r\n /**\r\n * @inheritDoc\r\n */\r\n static get pluginName() {\r\n return 'StyleUI';\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n static get requires() {\r\n return [StyleUtils];\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n init() {\r\n const editor = this.editor;\r\n const dataSchema = editor.plugins.get('DataSchema');\r\n const styleUtils = editor.plugins.get('StyleUtils');\r\n const styleDefinitions = editor.config.get('style.definitions');\r\n const normalizedStyleDefinitions = styleUtils.normalizeConfig(dataSchema, styleDefinitions);\r\n // Add the dropdown to the component factory.\r\n editor.ui.componentFactory.add('style', locale => {\r\n const t = locale.t;\r\n const dropdown = createDropdown(locale);\r\n const styleCommand = editor.commands.get('style');\r\n dropdown.once('change:isOpen', () => {\r\n const panelView = new StylePanelView(locale, normalizedStyleDefinitions);\r\n // Put the styles panel is the dropdown.\r\n dropdown.panelView.children.add(panelView);\r\n // Close the dropdown when a style is selected in the styles panel.\r\n panelView.delegate('execute').to(dropdown);\r\n // Bind the state of the styles panel to the command.\r\n panelView.bind('activeStyles').to(styleCommand, 'value');\r\n panelView.bind('enabledStyles').to(styleCommand, 'enabledStyles');\r\n });\r\n // The entire dropdown will be disabled together with the command (e.g. when the editor goes read-only).\r\n dropdown.bind('isEnabled').to(styleCommand);\r\n // This dropdown has no icon. It displays text label depending on the selection.\r\n dropdown.buttonView.withText = true;\r\n // The label of the dropdown is dynamic and depends on how many styles are active at a time.\r\n dropdown.buttonView.bind('label').to(styleCommand, 'value', value => {\r\n if (value.length > 1) {\r\n return t('Multiple styles');\r\n }\r\n else if (value.length === 1) {\r\n return value[0];\r\n }\r\n else {\r\n return t('Styles');\r\n }\r\n });\r\n // The dropdown has a static CSS class for easy customization. There's another CSS class\r\n // that gets displayed when multiple styles are active at a time allowing visual customization of\r\n // the label.\r\n dropdown.bind('class').to(styleCommand, 'value', value => {\r\n const classes = [\r\n 'ck-style-dropdown'\r\n ];\r\n if (value.length > 1) {\r\n classes.push('ck-style-dropdown_multiple-active');\r\n }\r\n return classes.join(' ');\r\n });\r\n // Execute the command when a style is selected in the styles panel.\r\n // Also focus the editable after executing the command.\r\n // It overrides a default behaviour where the focus is moved to the dropdown button (#12125).\r\n dropdown.on('execute', evt => {\r\n editor.execute('style', { styleName: evt.source.styleDefinition.name });\r\n editor.editing.view.focus();\r\n });\r\n return dropdown;\r\n });\r\n }\r\n}\r\n","/**\r\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\r\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\r\n */\r\nimport { Command } from 'ckeditor5/src/core';\r\nimport { logWarning, first } from 'ckeditor5/src/utils';\r\nimport StyleUtils from './styleutils';\r\n/**\r\n * Style command.\r\n *\r\n * Applies and removes styles from selection and elements.\r\n */\r\nexport default class StyleCommand extends Command {\r\n /**\r\n * Creates an instance of the command.\r\n *\r\n * @param editor Editor on which this command will be used.\r\n * @param styleDefinitions Normalized definitions of the styles.\r\n */\r\n constructor(editor, styleDefinitions) {\r\n super(editor);\r\n this.set('value', []);\r\n this.set('enabledStyles', []);\r\n this._styleDefinitions = styleDefinitions;\r\n this._styleUtils = this.editor.plugins.get(StyleUtils);\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n refresh() {\r\n const model = this.editor.model;\r\n const selection = model.document.selection;\r\n const value = new Set();\r\n const enabledStyles = new Set();\r\n // Inline styles.\r\n for (const definition of this._styleDefinitions.inline) {\r\n // Check if this inline style is enabled.\r\n if (this._styleUtils.isStyleEnabledForInlineSelection(definition, selection)) {\r\n enabledStyles.add(definition.name);\r\n }\r\n // Check if this inline style is active.\r\n if (this._styleUtils.isStyleActiveForInlineSelection(definition, selection)) {\r\n value.add(definition.name);\r\n }\r\n }\r\n // Block styles.\r\n const firstBlock = first(selection.getSelectedBlocks()) || selection.getFirstPosition().parent;\r\n if (firstBlock) {\r\n const ancestorBlocks = firstBlock.getAncestors({ includeSelf: true, parentFirst: true });\r\n for (const block of ancestorBlocks) {\r\n if (block.is('rootElement')) {\r\n break;\r\n }\r\n for (const definition of this._styleDefinitions.block) {\r\n // Check if this block style is enabled.\r\n if (!this._styleUtils.isStyleEnabledForBlock(definition, block)) {\r\n continue;\r\n }\r\n enabledStyles.add(definition.name);\r\n // Check if this block style is active.\r\n if (this._styleUtils.isStyleActiveForBlock(definition, block)) {\r\n value.add(definition.name);\r\n }\r\n }\r\n // E.g. reached a model table when the selection is in a cell. The command should not modify\r\n // ancestors of a table.\r\n if (model.schema.isObject(block)) {\r\n break;\r\n }\r\n }\r\n }\r\n this.enabledStyles = Array.from(enabledStyles).sort();\r\n this.isEnabled = this.enabledStyles.length > 0;\r\n this.value = this.isEnabled ? Array.from(value).sort() : [];\r\n }\r\n /**\r\n * Executes the command &mdash; applies the style classes to the selection or removes it from the selection.\r\n *\r\n * If the command value already contains the requested style, it will remove the style classes. Otherwise, it will set it.\r\n *\r\n * The execution result differs, depending on the {@link module:engine/model/document~Document#selection} and the\r\n * style type (inline or block):\r\n *\r\n * * When applying inline styles:\r\n * * If the selection is on a range, the command applies the style classes to all nodes in that range.\r\n * * If the selection is collapsed in a non-empty node, the command applies the style classes to the\r\n * {@link module:engine/model/document~Document#selection}.\r\n *\r\n * * When applying block styles:\r\n * * If the selection is on a range, the command applies the style classes to the nearest block parent element.\r\n *\r\n * @fires execute\r\n * @param options Command options.\r\n * @param options.styleName Style name matching the one defined in the\r\n * {@link module:style/styleconfig~StyleConfig#definitions configuration}.\r\n * @param options.forceValue Whether the command should add given style (`true`) or remove it (`false`) from the selection.\r\n * If not set (default), the command will toggle the style basing on the first selected node. Note, that this will not force\r\n * setting a style on an element that cannot receive given style.\r\n */\r\n execute({ styleName, forceValue }) {\r\n if (!this.enabledStyles.includes(styleName)) {\r\n /**\r\n * Style command can be executed only with a correct style name.\r\n *\r\n * This warning may be caused by:\r\n *\r\n * * passing a name that is not specified in the {@link module:style/styleconfig~StyleConfig#definitions configuration}\r\n * (e.g. a CSS class name),\r\n * * when trying to apply a style that is not allowed on a given element.\r\n *\r\n * @error style-command-executed-with-incorrect-style-name\r\n */\r\n logWarning('style-command-executed-with-incorrect-style-name');\r\n return;\r\n }\r\n const model = this.editor.model;\r\n const selection = model.document.selection;\r\n const htmlSupport = this.editor.plugins.get('GeneralHtmlSupport');\r\n const allDefinitions = [\r\n ...this._styleDefinitions.inline,\r\n ...this._styleDefinitions.block\r\n ];\r\n const activeDefinitions = allDefinitions.filter(({ name }) => this.value.includes(name));\r\n const definition = allDefinitions.find(({ name }) => name == styleName);\r\n const shouldAddStyle = forceValue === undefined ? !this.value.includes(definition.name) : forceValue;\r\n model.change(() => {\r\n let selectables;\r\n if (isBlockStyleDefinition(definition)) {\r\n selectables = this._findAffectedBlocks(getBlocksFromSelection(selection), definition);\r\n }\r\n else {\r\n selectables = [this._styleUtils.getAffectedInlineSelectable(definition, selection)];\r\n }\r\n for (const selectable of selectables) {\r\n if (shouldAddStyle) {\r\n htmlSupport.addModelHtmlClass(definition.element, definition.classes, selectable);\r\n }\r\n else {\r\n htmlSupport.removeModelHtmlClass(definition.element, getDefinitionExclusiveClasses(activeDefinitions, definition), selectable);\r\n }\r\n }\r\n });\r\n }\r\n /**\r\n * Returns a set of elements that should be affected by the block-style change.\r\n */\r\n _findAffectedBlocks(selectedBlocks, definition) {\r\n const blocks = new Set();\r\n for (const selectedBlock of selectedBlocks) {\r\n const ancestorBlocks = selectedBlock.getAncestors({ includeSelf: true, parentFirst: true });\r\n for (const block of ancestorBlocks) {\r\n if (block.is('rootElement')) {\r\n break;\r\n }\r\n const affectedBlocks = this._styleUtils.getAffectedBlocks(definition, block);\r\n if (affectedBlocks) {\r\n for (const affectedBlock of affectedBlocks) {\r\n blocks.add(affectedBlock);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n return blocks;\r\n }\r\n}\r\n/**\r\n * Returns classes that are defined only in the supplied definition and not in any other active definition. It's used\r\n * to ensure that classes used by other definitions are preserved when a style is removed. See #11748.\r\n *\r\n * @param activeDefinitions All currently active definitions affecting selected element(s).\r\n * @param definition Definition whose classes will be compared with all other active definition classes.\r\n * @returns Array of classes exclusive to the supplied definition.\r\n */\r\nfunction getDefinitionExclusiveClasses(activeDefinitions, definition) {\r\n return activeDefinitions.reduce((classes, currentDefinition) => {\r\n if (currentDefinition.name === definition.name) {\r\n return classes;\r\n }\r\n return classes.filter(className => !currentDefinition.classes.includes(className));\r\n }, definition.classes);\r\n}\r\n/**\r\n * Checks if provided style definition is of type block.\r\n */\r\nfunction isBlockStyleDefinition(definition) {\r\n return 'isBlock' in definition;\r\n}\r\n/**\r\n * Gets block elements from selection. If there are none, returns first selected element.\r\n * @param selection Current document's selection.\r\n * @returns Selected blocks if there are any, first selected element otherwise.\r\n */\r\nfunction getBlocksFromSelection(selection) {\r\n const blocks = Array.from(selection.getSelectedBlocks());\r\n if (blocks.length) {\r\n return blocks;\r\n }\r\n return [selection.getFirstPosition().parent];\r\n}\r\n","/**\r\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\r\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\r\n */\r\n/**\r\n * @module style/integrations/documentlist\r\n */\r\nimport { Plugin } from 'ckeditor5/src/core';\r\nimport StyleUtils from '../styleutils';\r\nexport default class DocumentListStyleSupport extends Plugin {\r\n /**\r\n * @inheritDoc\r\n */\r\n static get pluginName() {\r\n return 'DocumentListStyleSupport';\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n static get requires() {\r\n return [StyleUtils, 'GeneralHtmlSupport'];\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n init() {\r\n const editor = this.editor;\r\n if (!editor.plugins.has('DocumentListEditing')) {\r\n return;\r\n }\r\n this._styleUtils = editor.plugins.get(StyleUtils);\r\n this._documentListUtils = this.editor.plugins.get('DocumentListUtils');\r\n this._htmlSupport = this.editor.plugins.get('GeneralHtmlSupport');\r\n this.listenTo(this._styleUtils, 'isStyleEnabledForBlock', (evt, [definition, block]) => {\r\n if (this._isStyleEnabledForBlock(definition, block)) {\r\n evt.return = true;\r\n evt.stop();\r\n }\r\n }, { priority: 'high' });\r\n this.listenTo(this._styleUtils, 'isStyleActiveForBlock', (evt, [definition, block]) => {\r\n if (this._isStyleActiveForBlock(definition, block)) {\r\n evt.return = true;\r\n evt.stop();\r\n }\r\n }, { priority: 'high' });\r\n this.listenTo(this._styleUtils, 'getAffectedBlocks', (evt, [definition, block]) => {\r\n const blocks = this._getAffectedBlocks(definition, block);\r\n if (blocks) {\r\n evt.return = blocks;\r\n evt.stop();\r\n }\r\n }, { priority: 'high' });\r\n this.listenTo(this._styleUtils, 'getStylePreview', (evt, [definition, children]) => {\r\n const templateDefinition = this._getStylePreview(definition, children);\r\n if (templateDefinition) {\r\n evt.return = templateDefinition;\r\n evt.stop();\r\n }\r\n }, { priority: 'high' });\r\n }\r\n /**\r\n * Verifies if the given style is applicable to the provided block element.\r\n */\r\n _isStyleEnabledForBlock(definition, block) {\r\n const model = this.editor.model;\r\n if (!['ol', 'ul', 'li'].includes(definition.element)) {\r\n return false;\r\n }\r\n if (!this._documentListUtils.isListItemBlock(block)) {\r\n return false;\r\n }\r\n const attributeName = this._htmlSupport.getGhsAttributeNameForElement(definition.element);\r\n if (definition.element == 'ol' || definition.element == 'ul') {\r\n if (!model.schema.checkAttribute(block, attributeName)) {\r\n return false;\r\n }\r\n const viewElementName = block.getAttribute('listType') == 'numbered' ? 'ol' : 'ul';\r\n return definition.element == viewElementName;\r\n }\r\n else {\r\n return model.schema.checkAttribute(block, attributeName);\r\n }\r\n }\r\n /**\r\n * Returns true if the given style is applied to the specified block element.\r\n */\r\n _isStyleActiveForBlock(definition, block) {\r\n const attributeName = this._htmlSupport.getGhsAttributeNameForElement(definition.element);\r\n const ghsAttributeValue = block.getAttribute(attributeName);\r\n return this._styleUtils.hasAllClasses(ghsAttributeValue, definition.classes);\r\n }\r\n /**\r\n * Returns an array of block elements that style should be applied to.\r\n */\r\n _getAffectedBlocks(definition, block) {\r\n if (!this._isStyleEnabledForBlock(definition, block)) {\r\n return null;\r\n }\r\n if (definition.element == 'li') {\r\n return this._documentListUtils.expandListBlocksToCompleteItems(block, { withNested: false });\r\n }\r\n else {\r\n return this._documentListUtils.expandListBlocksToCompleteList(block);\r\n }\r\n }\r\n /**\r\n * Returns a view template definition for the style preview.\r\n */\r\n _getStylePreview(definition, children) {\r\n const { element, classes } = definition;\r\n if (element == 'ol' || element == 'ul') {\r\n return {\r\n tag: element,\r\n attributes: {\r\n class: classes\r\n },\r\n children: [\r\n {\r\n tag: 'li',\r\n children\r\n }\r\n ]\r\n };\r\n }\r\n else if (element == 'li') {\r\n return {\r\n tag: 'ol',\r\n children: [\r\n {\r\n tag: element,\r\n attributes: {\r\n class: classes\r\n },\r\n children\r\n }\r\n ]\r\n };\r\n }\r\n return null;\r\n }\r\n}\r\n","/**\r\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\r\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\r\n */\r\n/**\r\n * @module style/integrations/table\r\n */\r\nimport { Plugin } from 'ckeditor5/src/core';\r\nimport StyleUtils from '../styleutils';\r\nexport default class TableStyleSupport extends Plugin {\r\n /**\r\n * @inheritDoc\r\n */\r\n static get pluginName() {\r\n return 'TableStyleSupport';\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n static get requires() {\r\n return [StyleUtils];\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n init() {\r\n const editor = this.editor;\r\n if (!editor.plugins.has('TableEditing')) {\r\n return;\r\n }\r\n this._styleUtils = editor.plugins.get(StyleUtils);\r\n this._tableUtils = this.editor.plugins.get('TableUtils');\r\n this.listenTo(this._styleUtils, 'isStyleEnabledForBlock', (evt, [definition, block]) => {\r\n if (this._isApplicable(definition, block)) {\r\n evt.return = this._isStyleEnabledForBlock(definition, block);\r\n evt.stop();\r\n }\r\n }, { priority: 'high' });\r\n this.listenTo(this._styleUtils, 'getAffectedBlocks', (evt, [definition, block]) => {\r\n if (this._isApplicable(definition, block)) {\r\n evt.return = this._getAffectedBlocks(definition, block);\r\n evt.stop();\r\n }\r\n }, { priority: 'high' });\r\n this.listenTo(this._styleUtils, 'configureGHSDataFilter', (evt, [{ block }]) => {\r\n const ghsDataFilter = this.editor.plugins.get('DataFilter');\r\n ghsDataFilter.loadAllowedConfig(block\r\n .filter(definition => definition.element == 'figcaption')\r\n .map(definition => ({ name: 'caption', classes: definition.classes })));\r\n });\r\n }\r\n /**\r\n * Checks if this plugin's custom logic should be applied for defintion-block pair.\r\n *\r\n * @param definition Style definition that is being considered.\r\n * @param block Block element to check if should be styled.\r\n * @returns True if the defintion-block pair meet the plugin criteria, false otherwise.\r\n */\r\n _isApplicable(definition, block) {\r\n if (['td', 'th'].includes(definition.element)) {\r\n return block.name == 'tableCell';\r\n }\r\n if (['thead', 'tbody'].includes(definition.element)) {\r\n return block.name == 'table';\r\n }\r\n return false;\r\n }\r\n /**\r\n * Checks if the style definition should be applied to selected block.\r\n *\r\n * @param definition Style definition that is being considered.\r\n * @param block Block element to check if should be styled.\r\n * @returns True if the block should be style with the style description, false otherwise.\r\n */\r\n _isStyleEnabledForBlock(definition, block) {\r\n if (['td', 'th'].includes(definition.element)) {\r\n const location = this._tableUtils.getCellLocation(block);\r\n const tableRow = block.parent;\r\n const table = tableRow.parent;\r\n const headingRows = table.getAttribute('headingRows') || 0;\r\n const headingColumns = table.getAttribute('headingColumns') || 0;\r\n const isHeadingCell = location.row < headingRows || location.column < headingColumns;\r\n if (definition.element == 'th') {\r\n return isHeadingCell;\r\n }\r\n else {\r\n return !isHeadingCell;\r\n }\r\n }\r\n if (['thead', 'tbody'].includes(definition.element)) {\r\n const headingRows = block.getAttribute('headingRows') || 0;\r\n if (definition.element == 'thead') {\r\n return headingRows > 0;\r\n }\r\n else {\r\n return headingRows < this._tableUtils.getRows(block);\r\n }\r\n }\r\n /* istanbul ignore next -- @preserve */\r\n return false;\r\n }\r\n /**\r\n * Gets all blocks that the style should be applied to.\r\n *\r\n * @param definition Style definition that is being considered.\r\n * @param block A block element from selection.\r\n * @returns An array with the block that was passed as an argument if meets the criteria, null otherwise.\r\n */\r\n _getAffectedBlocks(definition, block) {\r\n if (!this._isStyleEnabledForBlock(definition, block)) {\r\n return null;\r\n }\r\n return [block];\r\n }\r\n}\r\n","/**\r\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\r\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\r\n */\r\n/**\r\n * @module style/integrations/link\r\n */\r\nimport { Plugin } from 'ckeditor5/src/core';\r\nimport { findAttributeRange, findAttributeRangeBound } from 'ckeditor5/src/typing';\r\nimport StyleUtils from '../styleutils';\r\nexport default class LinkStyleSupport extends Plugin {\r\n /**\r\n * @inheritDoc\r\n */\r\n static get pluginName() {\r\n return 'LinkStyleSupport';\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n static get requires() {\r\n return [StyleUtils, 'GeneralHtmlSupport'];\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n init() {\r\n const editor = this.editor;\r\n if (!editor.plugins.has('LinkEditing')) {\r\n return;\r\n }\r\n this._styleUtils = editor.plugins.get(StyleUtils);\r\n this._htmlSupport = this.editor.plugins.get('GeneralHtmlSupport');\r\n this.listenTo(this._styleUtils, 'isStyleEnabledForInlineSelection', (evt, [definition, selection]) => {\r\n if (definition.element == 'a') {\r\n evt.return = this._isStyleEnabled(definition, selection);\r\n evt.stop();\r\n }\r\n }, { priority: 'high' });\r\n this.listenTo(this._styleUtils, 'isStyleActiveForInlineSelection', (evt, [definition, selection]) => {\r\n if (definition.element == 'a') {\r\n evt.return = this._isStyleActive(definition, selection);\r\n evt.stop();\r\n }\r\n }, { priority: 'high' });\r\n this.listenTo(this._styleUtils, 'getAffectedInlineSelectable', (evt, [definition, selection]) => {\r\n if (definition.element != 'a') {\r\n return;\r\n }\r\n const selectable = this._getAffectedSelectable(definition, selection);\r\n if (selectable) {\r\n evt.return = selectable;\r\n evt.stop();\r\n }\r\n }, { priority: 'high' });\r\n }\r\n /**\r\n * Verifies if the given style is applicable to the provided document selection.\r\n */\r\n _isStyleEnabled(definition, selection) {\r\n const model = this.editor.model;\r\n // Handle collapsed selection.\r\n if (selection.isCollapsed) {\r\n return selection.hasAttribute('linkHref');\r\n }\r\n // Non-collapsed selection.\r\n for (const range of selection.getRanges()) {\r\n for (const item of range.getItems()) {\r\n if ((item.is('$textProxy') || model.schema.isInline(item)) && item.hasAttribute('linkHref')) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n /**\r\n * Returns true if the given style is applied to the specified document selection.\r\n */\r\n _isStyleActive(definition, selection) {\r\n const model = this.editor.model;\r\n const attributeName = this._htmlSupport.getGhsAttributeNameForElement(definition.element);\r\n // Handle collapsed selection.\r\n if (selection.isCollapsed) {\r\n if (selection.hasAttribute('linkHref')) {\r\n const ghsAttributeValue = selection.getAttribute(attributeName);\r\n if (this._styleUtils.hasAllClasses(ghsAttributeValue, definition.classes)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n // Non-collapsed selection.\r\n for (const range of selection.getRanges()) {\r\n for (const item of range.getItems()) {\r\n if ((item.is('$textProxy') || model.schema.isInline(item)) && item.hasAttribute('linkHref')) {\r\n const ghsAttributeValue = item.getAttribute(attributeName);\r\n return this._styleUtils.hasAllClasses(ghsAttributeValue, definition.classes);\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n /**\r\n * Returns a selectable that given style should be applied to.\r\n */\r\n _getAffectedSelectable(definition, selection) {\r\n const model = this.editor.model;\r\n // Handle collapsed selection.\r\n if (selection.isCollapsed) {\r\n const linkHref = selection.getAttribute('linkHref');\r\n return findAttributeRange(selection.getFirstPosition(), 'linkHref', linkHref, model);\r\n }\r\n // Non-collapsed selection.\r\n const ranges = [];\r\n for (const range of selection.getRanges()) {\r\n // First expand range to include the whole link.\r\n const expandedRange = model.createRange(expandAttributePosition(range.start, 'linkHref', true, model), expandAttributePosition(range.end, 'linkHref', false, model));\r\n // Pick only ranges on links.\r\n for (const item of expandedRange.getItems()) {\r\n if ((item.is('$textProxy') || model.schema.isInline(item)) && item.hasAttribute('linkHref')) {\r\n ranges.push(this.editor.model.createRangeOn(item));\r\n }\r\n }\r\n }\r\n // Make sure that we have a continuous range on a link\r\n // (not split between text nodes with mixed attributes like bold etc.)\r\n return normalizeRanges(ranges);\r\n }\r\n}\r\n/**\r\n * Walks forward or backward (depends on the `lookBack` flag), node by node, as long as they have the same attribute value\r\n * and returns a position just before or after (depends on the `lookBack` flag) the last matched node.\r\n */\r\nfunction expandAttributePosition(position, attributeName, lookBack, model) {\r\n const referenceNode = position.textNode || (lookBack ? position.nodeAfter : position.nodeBefore);\r\n if (!referenceNode || !referenceNode.hasAttribute(attributeName)) {\r\n return position;\r\n }\r\n const attributeValue = referenceNode.getAttribute(attributeName);\r\n return findAttributeRangeBound(position, attributeName, attributeValue, lookBack, model);\r\n}\r\n/**\r\n * Normalizes list of ranges by joining intersecting or \"touching\" ranges.\r\n *\r\n * Note: It assumes that ranges are sorted.\r\n */\r\nfunction normalizeRanges(ranges) {\r\n for (let i = 1; i < ranges.length; i++) {\r\n const joinedRange = ranges[i - 1].getJoined(ranges[i]);\r\n if (joinedRange) {\r\n // Replace the ranges on the list with the new joined range.\r\n ranges.splice(--i, 2, joinedRange);\r\n }\r\n }\r\n return ranges;\r\n}\r\n","/**\r\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\r\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\r\n */\r\n/**\r\n * @module style/styleediting\r\n */\r\nimport { Plugin } from 'ckeditor5/src/core';\r\nimport StyleCommand from './stylecommand';\r\nimport StyleUtils from './styleutils';\r\nimport DocumentListStyleSupport from './integrations/documentlist';\r\nimport TableStyleSupport from './integrations/table';\r\nimport LinkStyleSupport from './integrations/link';\r\n/**\r\n * The style engine feature.\r\n *\r\n * It configures the {@glink features/html/general-html-support General HTML Support feature} based on\r\n * {@link module:style/styleconfig~StyleConfig#definitions configured style definitions} and introduces the\r\n * {@link module:style/stylecommand~StyleCommand style command} that applies styles to the content of the document.\r\n */\r\nexport default class StyleEditing extends Plugin {\r\n /**\r\n * @inheritDoc\r\n */\r\n static get pluginName() {\r\n return 'StyleEditing';\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n static get requires() {\r\n return ['GeneralHtmlSupport', StyleUtils, DocumentListStyleSupport, TableStyleSupport, LinkStyleSupport];\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n init() {\r\n const editor = this.editor;\r\n const dataSchema = editor.plugins.get('DataSchema');\r\n const styleUtils = editor.plugins.get('StyleUtils');\r\n const styleDefinitions = editor.config.get('style.definitions');\r\n const normalizedStyleDefinitions = styleUtils.normalizeConfig(dataSchema, styleDefinitions);\r\n editor.commands.add('style', new StyleCommand(editor, normalizedStyleDefinitions));\r\n styleUtils.configureGHSDataFilter(normalizedStyleDefinitions);\r\n }\r\n}\r\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/subscript/subscriptediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport AttributeCommand from '../attributecommand';\nconst SUBSCRIPT = 'subscript';\n/**\n * The subscript editing feature.\n *\n * It registers the `sub` command and introduces the `sub` attribute in the model which renders to the view\n * as a `<sub>` element.\n */\nexport default class SubscriptEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'SubscriptEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Allow sub attribute on text nodes.\n editor.model.schema.extend('$text', { allowAttributes: SUBSCRIPT });\n editor.model.schema.setAttributeProperties(SUBSCRIPT, {\n isFormatting: true,\n copyOnEnter: true\n });\n // Build converter from model to view for data and editing pipelines.\n editor.conversion.attributeToElement({\n model: SUBSCRIPT,\n view: 'sub',\n upcastAlso: [\n {\n styles: {\n 'vertical-align': 'sub'\n }\n }\n ]\n });\n // Create sub command.\n editor.commands.add(SUBSCRIPT, new AttributeCommand(editor, SUBSCRIPT));\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m7.03 10.349 3.818-3.819a.8.8 0 1 1 1.132 1.132L8.16 11.48l3.819 3.818a.8.8 0 1 1-1.132 1.132L7.03 12.61l-3.818 3.82a.8.8 0 1 1-1.132-1.132L5.9 11.48 2.08 7.662A.8.8 0 1 1 3.212 6.53l3.818 3.82zm8.147 7.829h2.549c.254 0 .447.05.58.152a.49.49 0 0 1 .201.413.54.54 0 0 1-.159.393c-.105.108-.266.162-.48.162h-3.594c-.245 0-.435-.066-.572-.197a.621.621 0 0 1-.205-.463c0-.114.044-.265.132-.453a1.62 1.62 0 0 1 .288-.444c.433-.436.824-.81 1.172-1.122.348-.312.597-.517.747-.615.267-.183.49-.368.667-.553.177-.185.312-.375.405-.57.093-.194.139-.384.139-.57a1.008 1.008 0 0 0-.554-.917 1.197 1.197 0 0 0-.56-.133c-.426 0-.761.182-1.005.546a2.332 2.332 0 0 0-.164.39 1.609 1.609 0 0 1-.258.488c-.096.114-.237.17-.423.17a.558.558 0 0 1-.405-.156.568.568 0 0 1-.161-.427c0-.218.05-.446.151-.683.101-.238.252-.453.452-.646s.454-.349.762-.467a2.998 2.998 0 0 1 1.081-.178c.498 0 .923.076 1.274.228a1.916 1.916 0 0 1 1.004 1.032 1.984 1.984 0 0 1-.156 1.794c-.2.32-.405.572-.613.754-.208.182-.558.468-1.048.857-.49.39-.826.691-1.008.906a2.703 2.703 0 0 0-.24.309z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/subscript/subscriptui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ButtonView } from 'ckeditor5/src/ui';\nimport subscriptIcon from '../../theme/icons/subscript.svg';\nconst SUBSCRIPT = 'subscript';\n/**\n * The subscript UI feature. It introduces the Subscript button.\n */\nexport default class SubscriptUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'SubscriptUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n // Add subscript button to feature components.\n editor.ui.componentFactory.add(SUBSCRIPT, locale => {\n const command = editor.commands.get(SUBSCRIPT);\n const view = new ButtonView(locale);\n view.set({\n label: t('Subscript'),\n icon: subscriptIcon,\n tooltip: true,\n isToggleable: true\n });\n view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n // Execute command.\n this.listenTo(view, 'execute', () => {\n editor.execute(SUBSCRIPT);\n editor.editing.view.focus();\n });\n return view;\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/superscript/superscriptediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport AttributeCommand from '../attributecommand';\nconst SUPERSCRIPT = 'superscript';\n/**\n * The superscript editing feature.\n *\n * It registers the `super` command and introduces the `super` attribute in the model which renders to the view\n * as a `<super>` element.\n */\nexport default class SuperscriptEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'SuperscriptEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Allow super attribute on text nodes.\n editor.model.schema.extend('$text', { allowAttributes: SUPERSCRIPT });\n editor.model.schema.setAttributeProperties(SUPERSCRIPT, {\n isFormatting: true,\n copyOnEnter: true\n });\n // Build converter from model to view for data and editing pipelines.\n editor.conversion.attributeToElement({\n model: SUPERSCRIPT,\n view: 'sup',\n upcastAlso: [\n {\n styles: {\n 'vertical-align': 'super'\n }\n }\n ]\n });\n // Create super command.\n editor.commands.add(SUPERSCRIPT, new AttributeCommand(editor, SUPERSCRIPT));\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M15.677 8.678h2.549c.254 0 .447.05.58.152a.49.49 0 0 1 .201.413.54.54 0 0 1-.159.393c-.105.108-.266.162-.48.162h-3.594c-.245 0-.435-.066-.572-.197a.621.621 0 0 1-.205-.463c0-.114.044-.265.132-.453a1.62 1.62 0 0 1 .288-.444c.433-.436.824-.81 1.172-1.122.348-.312.597-.517.747-.615.267-.183.49-.368.667-.553.177-.185.312-.375.405-.57.093-.194.139-.384.139-.57a1.008 1.008 0 0 0-.554-.917 1.197 1.197 0 0 0-.56-.133c-.426 0-.761.182-1.005.546a2.332 2.332 0 0 0-.164.39 1.609 1.609 0 0 1-.258.488c-.096.114-.237.17-.423.17a.558.558 0 0 1-.405-.156.568.568 0 0 1-.161-.427c0-.218.05-.446.151-.683.101-.238.252-.453.452-.646s.454-.349.762-.467a2.998 2.998 0 0 1 1.081-.178c.498 0 .923.076 1.274.228a1.916 1.916 0 0 1 1.004 1.032 1.984 1.984 0 0 1-.156 1.794c-.2.32-.405.572-.613.754-.208.182-.558.468-1.048.857-.49.39-.826.691-1.008.906a2.703 2.703 0 0 0-.24.309zM7.03 10.349l3.818-3.819a.8.8 0 1 1 1.132 1.132L8.16 11.48l3.819 3.818a.8.8 0 1 1-1.132 1.132L7.03 12.61l-3.818 3.82a.8.8 0 1 1-1.132-1.132L5.9 11.48 2.08 7.662A.8.8 0 1 1 3.212 6.53l3.818 3.82z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/superscript/superscriptui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ButtonView } from 'ckeditor5/src/ui';\nimport superscriptIcon from '../../theme/icons/superscript.svg';\nconst SUPERSCRIPT = 'superscript';\n/**\n * The superscript UI feature. It introduces the Superscript button.\n */\nexport default class SuperscriptUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'SuperscriptUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n // Add superscript button to feature components.\n editor.ui.componentFactory.add(SUPERSCRIPT, locale => {\n const command = editor.commands.get(SUPERSCRIPT);\n const view = new ButtonView(locale);\n view.set({\n label: t('Superscript'),\n icon: superscriptIcon,\n tooltip: true,\n isToggleable: true\n });\n view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n // Execute command.\n this.listenTo(view, 'execute', () => {\n editor.execute(SUPERSCRIPT);\n editor.editing.view.focus();\n });\n return view;\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Conversion helper for upcasting attributes using normalized styles.\n *\n * @param options.modelAttribute The attribute to set.\n * @param options.styleName The style name to convert.\n * @param options.viewElement The view element name that should be converted.\n * @param options.defaultValue The default value for the specified `modelAttribute`.\n * @param options.shouldUpcast The function which returns `true` if style should be upcasted from this element.\n */\nexport function upcastStyleToAttribute(conversion, options) {\n const { modelAttribute, styleName, viewElement, defaultValue, reduceBoxSides = false, shouldUpcast = () => true } = options;\n conversion.for('upcast').attributeToAttribute({\n view: {\n name: viewElement,\n styles: {\n [styleName]: /[\\s\\S]+/\n }\n },\n model: {\n key: modelAttribute,\n value: (viewElement) => {\n if (!shouldUpcast(viewElement)) {\n return;\n }\n const normalized = viewElement.getNormalizedStyle(styleName);\n const value = reduceBoxSides ? reduceBoxSidesValue(normalized) : normalized;\n if (defaultValue !== value) {\n return value;\n }\n }\n }\n });\n}\n/**\n * Conversion helper for upcasting border styles for view elements.\n *\n * @param defaultBorder The default border values.\n * @param defaultBorder.color The default `borderColor` value.\n * @param defaultBorder.style The default `borderStyle` value.\n * @param defaultBorder.width The default `borderWidth` value.\n */\nexport function upcastBorderStyles(conversion, viewElementName, modelAttributes, defaultBorder) {\n conversion.for('upcast').add(dispatcher => dispatcher.on('element:' + viewElementName, (evt, data, conversionApi) => {\n // If the element was not converted by element-to-element converter,\n // we should not try to convert the style. See #8393.\n if (!data.modelRange) {\n return;\n }\n // Check the most detailed properties. These will be always set directly or\n // when using the \"group\" properties like: `border-(top|right|bottom|left)` or `border`.\n const stylesToConsume = [\n 'border-top-width',\n 'border-top-color',\n 'border-top-style',\n 'border-bottom-width',\n 'border-bottom-color',\n 'border-bottom-style',\n 'border-right-width',\n 'border-right-color',\n 'border-right-style',\n 'border-left-width',\n 'border-left-color',\n 'border-left-style'\n ].filter(styleName => data.viewItem.hasStyle(styleName));\n if (!stylesToConsume.length) {\n return;\n }\n const matcherPattern = {\n styles: stylesToConsume\n };\n // Try to consume appropriate values from consumable values list.\n if (!conversionApi.consumable.test(data.viewItem, matcherPattern)) {\n return;\n }\n const modelElement = [...data.modelRange.getItems({ shallow: true })].pop();\n conversionApi.consumable.consume(data.viewItem, matcherPattern);\n const normalizedBorder = {\n style: data.viewItem.getNormalizedStyle('border-style'),\n color: data.viewItem.getNormalizedStyle('border-color'),\n width: data.viewItem.getNormalizedStyle('border-width')\n };\n const reducedBorder = {\n style: reduceBoxSidesValue(normalizedBorder.style),\n color: reduceBoxSidesValue(normalizedBorder.color),\n width: reduceBoxSidesValue(normalizedBorder.width)\n };\n if (reducedBorder.style !== defaultBorder.style) {\n conversionApi.writer.setAttribute(modelAttributes.style, reducedBorder.style, modelElement);\n }\n if (reducedBorder.color !== defaultBorder.color) {\n conversionApi.writer.setAttribute(modelAttributes.color, reducedBorder.color, modelElement);\n }\n if (reducedBorder.width !== defaultBorder.width) {\n conversionApi.writer.setAttribute(modelAttributes.width, reducedBorder.width, modelElement);\n }\n }));\n}\n/**\n * Conversion helper for downcasting an attribute to a style.\n */\nexport function downcastAttributeToStyle(conversion, options) {\n const { modelElement, modelAttribute, styleName } = options;\n conversion.for('downcast').attributeToAttribute({\n model: {\n name: modelElement,\n key: modelAttribute\n },\n view: modelAttributeValue => ({\n key: 'style',\n value: {\n [styleName]: modelAttributeValue\n }\n })\n });\n}\n/**\n * Conversion helper for downcasting attributes from the model table to a view table (not to `<figure>`).\n */\nexport function downcastTableAttribute(conversion, options) {\n const { modelAttribute, styleName } = options;\n conversion.for('downcast').add(dispatcher => dispatcher.on(`attribute:${modelAttribute}:table`, (evt, data, conversionApi) => {\n const { item, attributeNewValue } = data;\n const { mapper, writer } = conversionApi;\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const table = [...mapper.toViewElement(item).getChildren()].find(child => child.is('element', 'table'));\n if (attributeNewValue) {\n writer.setStyle(styleName, attributeNewValue, table);\n }\n else {\n writer.removeStyle(styleName, table);\n }\n }));\n}\n/**\n * Reduces the full top, right, bottom, left object to a single string if all sides are equal.\n * Returns original style otherwise.\n */\nfunction reduceBoxSidesValue(style) {\n if (!style) {\n return;\n }\n const sides = ['top', 'right', 'bottom', 'left'];\n const allSidesDefined = sides.every(side => style[side]);\n if (!allSidesDefined) {\n return style;\n }\n const topSideStyle = style.top;\n const allSidesEqual = sides.every(side => style[side] === topSideStyle);\n if (!allSidesEqual) {\n return style;\n }\n return topSideStyle;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { downcastAttributeToStyle, upcastStyleToAttribute } from './../converters/tableproperties';\n/**\n * A common method to update the numeric value. If a value is the default one, it will be unset.\n *\n * @param key An attribute key.\n * @param value The new attribute value.\n * @param item A model item on which the attribute will be set.\n * @param defaultValue The default attribute value. If a value is lower or equal, it will be unset.\n */\nexport function updateNumericAttribute(key, value, item, writer, defaultValue = 1) {\n if (value !== undefined && value !== null && defaultValue !== undefined && defaultValue !== null && value > defaultValue) {\n writer.setAttribute(key, value, item);\n }\n else {\n writer.removeAttribute(key, item);\n }\n}\n/**\n * A common method to create an empty table cell. It creates a proper model structure as a table cell must have at least one block inside.\n *\n * @param writer The model writer.\n * @param insertPosition The position at which the table cell should be inserted.\n * @param attributes The element attributes.\n * @returns Created table cell.\n */\nexport function createEmptyTableCell(writer, insertPosition, attributes = {}) {\n const tableCell = writer.createElement('tableCell', attributes);\n writer.insertElement('paragraph', tableCell);\n writer.insert(tableCell, insertPosition);\n return tableCell;\n}\n/**\n * Checks if a table cell belongs to the heading column section.\n */\nexport function isHeadingColumnCell(tableUtils, tableCell) {\n const table = tableCell.parent.parent;\n const headingColumns = parseInt(table.getAttribute('headingColumns') || '0');\n const { column } = tableUtils.getCellLocation(tableCell);\n return !!headingColumns && column < headingColumns;\n}\n/**\n * Enables conversion for an attribute for simple view-model mappings.\n *\n * @param options.defaultValue The default value for the specified `modelAttribute`.\n */\nexport function enableProperty(schema, conversion, options) {\n const { modelAttribute } = options;\n schema.extend('tableCell', {\n allowAttributes: [modelAttribute]\n });\n upcastStyleToAttribute(conversion, { viewElement: /^(td|th)$/, ...options });\n downcastAttributeToStyle(conversion, { modelElement: 'tableCell', ...options });\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { createEmptyTableCell } from '../utils/common';\nimport { first } from 'ckeditor5/src/utils';\n/**\n * Returns a function that converts the table view representation:\n *\n * ```xml\n * <figure class=\"table\"><table>...</table></figure>\n * ```\n *\n * to the model representation:\n *\n * ```xml\n * <table></table>\n * ```\n */\nexport function upcastTableFigure() {\n return (dispatcher) => {\n dispatcher.on('element:figure', (evt, data, conversionApi) => {\n // Do not convert if this is not a \"table figure\".\n if (!conversionApi.consumable.test(data.viewItem, { name: true, classes: 'table' })) {\n return;\n }\n // Find a table element inside the figure element.\n const viewTable = getViewTableFromFigure(data.viewItem);\n // Do not convert if table element is absent or was already converted.\n if (!viewTable || !conversionApi.consumable.test(viewTable, { name: true })) {\n return;\n }\n // Consume the figure to prevent other converters from processing it again.\n conversionApi.consumable.consume(data.viewItem, { name: true, classes: 'table' });\n // Convert view table to model table.\n const conversionResult = conversionApi.convertItem(viewTable, data.modelCursor);\n // Get table element from conversion result.\n const modelTable = first(conversionResult.modelRange.getItems());\n // When table wasn't successfully converted then finish conversion.\n if (!modelTable) {\n // Revert consumed figure so other features can convert it.\n conversionApi.consumable.revert(data.viewItem, { name: true, classes: 'table' });\n return;\n }\n conversionApi.convertChildren(data.viewItem, conversionApi.writer.createPositionAt(modelTable, 'end'));\n conversionApi.updateConversionResult(modelTable, data);\n });\n };\n}\n/**\n * View table element to model table element conversion helper.\n *\n * This conversion helper converts the table element as well as table rows.\n *\n * @returns Conversion helper.\n */\nexport default function upcastTable() {\n return (dispatcher) => {\n dispatcher.on('element:table', (evt, data, conversionApi) => {\n const viewTable = data.viewItem;\n // When element was already consumed then skip it.\n if (!conversionApi.consumable.test(viewTable, { name: true })) {\n return;\n }\n const { rows, headingRows, headingColumns } = scanTable(viewTable);\n // Only set attributes if values is greater then 0.\n const attributes = {};\n if (headingColumns) {\n attributes.headingColumns = headingColumns;\n }\n if (headingRows) {\n attributes.headingRows = headingRows;\n }\n const table = conversionApi.writer.createElement('table', attributes);\n if (!conversionApi.safeInsert(table, data.modelCursor)) {\n return;\n }\n conversionApi.consumable.consume(viewTable, { name: true });\n // Upcast table rows in proper order (heading rows first).\n rows.forEach(row => conversionApi.convertItem(row, conversionApi.writer.createPositionAt(table, 'end')));\n // Convert everything else.\n conversionApi.convertChildren(viewTable, conversionApi.writer.createPositionAt(table, 'end'));\n // Create one row and one table cell for empty table.\n if (table.isEmpty) {\n const row = conversionApi.writer.createElement('tableRow');\n conversionApi.writer.insert(row, conversionApi.writer.createPositionAt(table, 'end'));\n createEmptyTableCell(conversionApi.writer, conversionApi.writer.createPositionAt(row, 'end'));\n }\n conversionApi.updateConversionResult(table, data);\n });\n };\n}\n/**\n * A conversion helper that skips empty <tr> elements from upcasting at the beginning of the table.\n *\n * An empty row is considered a table model error but when handling clipboard data there could be rows that contain only row-spanned cells\n * and empty TR-s are used to maintain the table structure (also {@link module:table/tablewalker~TableWalker} assumes that there are only\n * rows that have related `tableRow` elements).\n *\n * *Note:* Only the first empty rows are removed because they have no meaning and it solves the issue\n * of an improper table with all empty rows.\n *\n * @returns Conversion helper.\n */\nexport function skipEmptyTableRow() {\n return (dispatcher) => {\n dispatcher.on('element:tr', (evt, data) => {\n if (data.viewItem.isEmpty && data.modelCursor.index == 0) {\n evt.stop();\n }\n }, { priority: 'high' });\n };\n}\n/**\n * A converter that ensures an empty paragraph is inserted in a table cell if no other content was converted.\n *\n * @returns Conversion helper.\n */\nexport function ensureParagraphInTableCell(elementName) {\n return (dispatcher) => {\n dispatcher.on(`element:${elementName}`, (evt, data, { writer }) => {\n // The default converter will create a model range on converted table cell.\n if (!data.modelRange) {\n return;\n }\n const tableCell = data.modelRange.start.nodeAfter;\n const modelCursor = writer.createPositionAt(tableCell, 0);\n // Ensure a paragraph in the model for empty table cells for converted table cells.\n if (data.viewItem.isEmpty) {\n writer.insertElement('paragraph', modelCursor);\n return;\n }\n const childNodes = Array.from(tableCell.getChildren());\n // In case there are only markers inside the table cell then move them to the paragraph.\n if (childNodes.every(node => node.is('element', '$marker'))) {\n const paragraph = writer.createElement('paragraph');\n writer.insert(paragraph, writer.createPositionAt(tableCell, 0));\n for (const node of childNodes) {\n writer.move(writer.createRangeOn(node), writer.createPositionAt(paragraph, 'end'));\n }\n }\n }, { priority: 'low' });\n };\n}\n/**\n * Get view `<table>` element from the view widget (`<figure>`).\n */\nfunction getViewTableFromFigure(figureView) {\n for (const figureChild of figureView.getChildren()) {\n if (figureChild.is('element', 'table')) {\n return figureChild;\n }\n }\n}\n/**\n * Scans table rows and extracts required metadata from the table:\n *\n * headingRows - The number of rows that go as table headers.\n * headingColumns - The maximum number of row headings.\n * rows - Sorted `<tr>` elements as they should go into the model - ie. if `<thead>` is inserted after `<tbody>` in the view.\n */\nfunction scanTable(viewTable) {\n let headingRows = 0;\n let headingColumns = undefined;\n // The `<tbody>` and `<thead>` sections in the DOM do not have to be in order `<thead>` -> `<tbody>` and there might be more than one\n // of them.\n // As the model does not have these sections, rows from different sections must be sorted.\n // For example, below is a valid HTML table:\n //\n // <table>\n // <tbody><tr><td>2</td></tr></tbody>\n // <thead><tr><td>1</td></tr></thead>\n // <tbody><tr><td>3</td></tr></tbody>\n // </table>\n //\n // But browsers will render rows in order as: 1 as the heading and 2 and 3 as the body.\n const headRows = [];\n const bodyRows = [];\n // Currently the editor does not support more then one <thead> section.\n // Only the first <thead> from the view will be used as a heading row and the others will be converted to body rows.\n let firstTheadElement;\n for (const tableChild of Array.from(viewTable.getChildren())) {\n // Only `<thead>`, `<tbody>` & `<tfoot>` from allowed table children can have `<tr>`s.\n // The else is for future purposes (mainly `<caption>`).\n if (tableChild.name !== 'tbody' && tableChild.name !== 'thead' && tableChild.name !== 'tfoot') {\n continue;\n }\n // Save the first `<thead>` in the table as table header - all other ones will be converted to table body rows.\n if (tableChild.name === 'thead' && !firstTheadElement) {\n firstTheadElement = tableChild;\n }\n // There might be some extra empty text nodes between the `<tr>`s.\n // Make sure further code operates on `tr`s only. (#145)\n const trs = Array.from(tableChild.getChildren()).filter((el) => el.is('element', 'tr'));\n for (const tr of trs) {\n // This <tr> is a child of a first <thead> element.\n if ((firstTheadElement && tableChild === firstTheadElement) ||\n (tableChild.name === 'tbody' &&\n Array.from(tr.getChildren()).length &&\n Array.from(tr.getChildren()).every(e => e.is('element', 'th')))) {\n headingRows++;\n headRows.push(tr);\n }\n else {\n bodyRows.push(tr);\n // For other rows check how many column headings this row has.\n const headingCols = scanRowForHeadingColumns(tr);\n if (!headingColumns || headingCols < headingColumns) {\n headingColumns = headingCols;\n }\n }\n }\n }\n return {\n headingRows,\n headingColumns: headingColumns || 0,\n rows: [...headRows, ...bodyRows]\n };\n}\n/**\n * Scans a `<tr>` element and its children for metadata:\n * - For heading row:\n * - Adds this row to either the heading or the body rows.\n * - Updates the number of heading rows.\n * - For body rows:\n * - Calculates the number of column headings.\n */\nfunction scanRowForHeadingColumns(tr) {\n let headingColumns = 0;\n let index = 0;\n // Filter out empty text nodes from tr children.\n const children = Array.from(tr.getChildren())\n .filter(child => child.name === 'th' || child.name === 'td');\n // Count starting adjacent <th> elements of a <tr>.\n while (index < children.length && children[index].name === 'th') {\n const th = children[index];\n // Adjust columns calculation by the number of spanned columns.\n const colspan = parseInt(th.getAttribute('colspan') || '1');\n headingColumns = headingColumns + colspan;\n index++;\n }\n return headingColumns;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * The table iterator class. It allows to iterate over table cells. For each cell the iterator yields\n * {@link module:table/tablewalker~TableSlot} with proper table cell attributes.\n */\nexport default class TableWalker {\n /**\n * Creates an instance of the table walker.\n *\n * The table walker iterates internally by traversing the table from row index = 0 and column index = 0.\n * It walks row by row and column by column in order to output values defined in the constructor.\n * By default it will output only the locations that are occupied by a cell. To include also spanned rows and columns,\n * pass the `includeAllSlots` option to the constructor.\n *\n * The most important values of the iterator are column and row indexes of a cell.\n *\n * See {@link module:table/tablewalker~TableSlot} what values are returned by the table walker.\n *\n * To iterate over a given row:\n *\n * ```ts\n * const tableWalker = new TableWalker( table, { startRow: 1, endRow: 2 } );\n *\n * for ( const tableSlot of tableWalker ) {\n * console.log( 'A cell at row', tableSlot.row, 'and column', tableSlot.column );\n * }\n * ```\n *\n * For instance the code above for the following table:\n *\n * +----+----+----+----+----+----+\n * | 00 | 02 | 03 | 04 | 05 |\n * | +----+----+----+----+\n * | | 12 | 14 | 15 |\n * | +----+----+----+ +\n * | | 22 | |\n * |----+----+----+----+----+ +\n * | 30 | 31 | 32 | 33 | 34 | |\n * +----+----+----+----+----+----+\n *\n * will log in the console:\n *\n * 'A cell at row 1 and column 2'\n * 'A cell at row 1 and column 4'\n * 'A cell at row 1 and column 5'\n * 'A cell at row 2 and column 2'\n *\n * To also iterate over spanned cells:\n *\n * ```ts\n * const tableWalker = new TableWalker( table, { row: 1, includeAllSlots: true } );\n *\n * for ( const tableSlot of tableWalker ) {\n * console.log( 'Slot at', tableSlot.row, 'x', tableSlot.column, ':', tableSlot.isAnchor ? 'is anchored' : 'is spanned' );\n * }\n * ```\n *\n * will log in the console for the table from the previous example:\n *\n * 'Cell at 1 x 0 : is spanned'\n * 'Cell at 1 x 1 : is spanned'\n * 'Cell at 1 x 2 : is anchored'\n * 'Cell at 1 x 3 : is spanned'\n * 'Cell at 1 x 4 : is anchored'\n * 'Cell at 1 x 5 : is anchored'\n *\n * **Note**: Option `row` is a shortcut that sets both `startRow` and `endRow` to the same row.\n * (Use either `row` or `startRow` and `endRow` but never together). Similarly the `column` option sets both `startColumn`\n * and `endColumn` to the same column (Use either `column` or `startColumn` and `endColumn` but never together).\n *\n * @param table A table over which the walker iterates.\n * @param options An object with configuration.\n * @param options.row A row index for which this iterator will output cells. Can't be used together with `startRow` and `endRow`.\n * @param options.startRow A row index from which this iterator should start. Can't be used together with `row`. Default value is 0.\n * @param options.endRow A row index at which this iterator should end. Can't be used together with `row`.\n * @param options.column A column index for which this iterator will output cells.\n * Can't be used together with `startColumn` and `endColumn`.\n * @param options.startColumn A column index from which this iterator should start.\n * Can't be used together with `column`. Default value is 0.\n * @param options.endColumn A column index at which this iterator should end. Can't be used together with `column`.\n * @param options.includeAllSlots Also return values for spanned cells. Default value is \"false\".\n */\n constructor(table, options = {}) {\n this._table = table;\n this._startRow = options.row !== undefined ? options.row : options.startRow || 0;\n this._endRow = options.row !== undefined ? options.row : options.endRow;\n this._startColumn = options.column !== undefined ? options.column : options.startColumn || 0;\n this._endColumn = options.column !== undefined ? options.column : options.endColumn;\n this._includeAllSlots = !!options.includeAllSlots;\n this._skipRows = new Set();\n this._row = 0;\n this._rowIndex = 0;\n this._column = 0;\n this._cellIndex = 0;\n this._spannedCells = new Map();\n this._nextCellAtColumn = -1;\n }\n /**\n * Iterable interface.\n */\n [Symbol.iterator]() {\n return this;\n }\n /**\n * Gets the next table walker's value.\n *\n * @returns The next table walker's value.\n */\n next() {\n const row = this._table.getChild(this._rowIndex);\n // Iterator is done when there's no row (table ended) or the row is after `endRow` limit.\n if (!row || this._isOverEndRow()) {\n return { done: true, value: undefined };\n }\n // We step over current element when it is not a tableRow instance.\n if (!row.is('element', 'tableRow')) {\n this._rowIndex++;\n return this.next();\n }\n if (this._isOverEndColumn()) {\n return this._advanceToNextRow();\n }\n let outValue = null;\n const spanData = this._getSpanned();\n if (spanData) {\n if (this._includeAllSlots && !this._shouldSkipSlot()) {\n outValue = this._formatOutValue(spanData.cell, spanData.row, spanData.column);\n }\n }\n else {\n const cell = row.getChild(this._cellIndex);\n if (!cell) {\n // If there are no more cells left in row advance to the next row.\n return this._advanceToNextRow();\n }\n const colspan = parseInt(cell.getAttribute('colspan') || '1');\n const rowspan = parseInt(cell.getAttribute('rowspan') || '1');\n // Record this cell spans if it's not 1x1 cell.\n if (colspan > 1 || rowspan > 1) {\n this._recordSpans(cell, rowspan, colspan);\n }\n if (!this._shouldSkipSlot()) {\n outValue = this._formatOutValue(cell);\n }\n this._nextCellAtColumn = this._column + colspan;\n }\n // Advance to the next column before returning value.\n this._column++;\n if (this._column == this._nextCellAtColumn) {\n this._cellIndex++;\n }\n // The current value will be returned only if current row and column are not skipped.\n return outValue || this.next();\n }\n /**\n * Marks a row to skip in the next iteration. It will also skip cells from the current row if there are any cells from the current row\n * to output.\n *\n * @param row The row index to skip.\n */\n skipRow(row) {\n this._skipRows.add(row);\n }\n /**\n * Advances internal cursor to the next row.\n */\n _advanceToNextRow() {\n this._row++;\n this._rowIndex++;\n this._column = 0;\n this._cellIndex = 0;\n this._nextCellAtColumn = -1;\n return this.next();\n }\n /**\n * Checks if the current row is over {@link #_endRow}.\n */\n _isOverEndRow() {\n // If #_endRow is defined skip all rows after it.\n return this._endRow !== undefined && this._row > this._endRow;\n }\n /**\n * Checks if the current cell is over {@link #_endColumn}\n */\n _isOverEndColumn() {\n // If #_endColumn is defined skip all cells after it.\n return this._endColumn !== undefined && this._column > this._endColumn;\n }\n /**\n * A common method for formatting the iterator's output value.\n *\n * @param cell The table cell to output.\n * @param anchorRow The row index of a cell anchor slot.\n * @param anchorColumn The column index of a cell anchor slot.\n */\n _formatOutValue(cell, anchorRow = this._row, anchorColumn = this._column) {\n return {\n done: false,\n value: new TableSlot(this, cell, anchorRow, anchorColumn)\n };\n }\n /**\n * Checks if the current slot should be skipped.\n */\n _shouldSkipSlot() {\n const rowIsMarkedAsSkipped = this._skipRows.has(this._row);\n const rowIsBeforeStartRow = this._row < this._startRow;\n const columnIsBeforeStartColumn = this._column < this._startColumn;\n const columnIsAfterEndColumn = this._endColumn !== undefined && this._column > this._endColumn;\n return rowIsMarkedAsSkipped || rowIsBeforeStartRow || columnIsBeforeStartColumn || columnIsAfterEndColumn;\n }\n /**\n * Returns the cell element that is spanned over the current cell location.\n */\n _getSpanned() {\n const rowMap = this._spannedCells.get(this._row);\n // No spans for given row.\n if (!rowMap) {\n return null;\n }\n // If spans for given rows has entry for column it means that this location if spanned by other cell.\n return rowMap.get(this._column) || null;\n }\n /**\n * Updates spanned cells map relative to the current cell location and its span dimensions.\n *\n * @param cell A cell that is spanned.\n * @param rowspan Cell height.\n * @param colspan Cell width.\n */\n _recordSpans(cell, rowspan, colspan) {\n const data = {\n cell,\n row: this._row,\n column: this._column\n };\n for (let rowToUpdate = this._row; rowToUpdate < this._row + rowspan; rowToUpdate++) {\n for (let columnToUpdate = this._column; columnToUpdate < this._column + colspan; columnToUpdate++) {\n if (rowToUpdate != this._row || columnToUpdate != this._column) {\n this._markSpannedCell(rowToUpdate, columnToUpdate, data);\n }\n }\n }\n }\n /**\n * Marks the cell location as spanned by another cell.\n *\n * @param row The row index of the cell location.\n * @param column The column index of the cell location.\n * @param data A spanned cell details (cell element, anchor row and column).\n */\n _markSpannedCell(row, column, data) {\n if (!this._spannedCells.has(row)) {\n this._spannedCells.set(row, new Map());\n }\n const rowSpans = this._spannedCells.get(row);\n rowSpans.set(column, data);\n }\n}\n/**\n * An object returned by {@link module:table/tablewalker~TableWalker} when traversing table cells.\n */\nclass TableSlot {\n /**\n * Creates an instance of the table walker value.\n *\n * @param tableWalker The table walker instance.\n * @param cell The current table cell.\n * @param anchorRow The row index of a cell anchor slot.\n * @param anchorColumn The column index of a cell anchor slot.\n */\n constructor(tableWalker, cell, anchorRow, anchorColumn) {\n this.cell = cell;\n this.row = tableWalker._row;\n this.column = tableWalker._column;\n this.cellAnchorRow = anchorRow;\n this.cellAnchorColumn = anchorColumn;\n this._cellIndex = tableWalker._cellIndex;\n this._rowIndex = tableWalker._rowIndex;\n this._table = tableWalker._table;\n }\n // @if CK_DEBUG // public get isSpanned(): unknown { return throwMissingGetterError( 'isSpanned' ); }\n // @if CK_DEBUG // public get colspan(): unknown { return throwMissingGetterError( 'colspan' ); }\n // @if CK_DEBUG // public get rowspan(): unknown { return throwMissingGetterError( 'rowspan' ); }\n // @if CK_DEBUG // public get cellIndex(): unknown { return throwMissingGetterError( 'cellIndex' ); }\n /**\n * Whether the cell is anchored in the current slot.\n */\n get isAnchor() {\n return this.row === this.cellAnchorRow && this.column === this.cellAnchorColumn;\n }\n /**\n * The width of a cell defined by a `colspan` attribute. If the model attribute is not present, it is set to `1`.\n */\n get cellWidth() {\n return parseInt(this.cell.getAttribute('colspan') || '1');\n }\n /**\n * The height of a cell defined by a `rowspan` attribute. If the model attribute is not present, it is set to `1`.\n */\n get cellHeight() {\n return parseInt(this.cell.getAttribute('rowspan') || '1');\n }\n /**\n * The index of the current row element in the table.\n */\n get rowIndex() {\n return this._rowIndex;\n }\n /**\n * Returns the {@link module:engine/model/position~Position} before the table slot.\n */\n getPositionBefore() {\n const model = this._table.root.document.model;\n return model.createPositionAt(this._table.getChild(this.row), this._cellIndex);\n }\n}\n/**\n * This `TableSlot`'s getter (property) was removed in CKEditor 5 v20.0.0.\n *\n * Check out the new `TableWalker`'s API in the documentation.\n *\n * @error tableslot-getter-removed\n * @param getterName\n */\n// @if CK_DEBUG // function throwMissingGetterError( getterName: string ): void {\n// @if CK_DEBUG //\t\tthrow new CKEditorError( 'tableslot-getter-removed', null, {\n// @if CK_DEBUG //\t\t\tgetterName\n// @if CK_DEBUG //\t\t} );\n// @if CK_DEBUG // }\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/converters/downcast\n */\nimport { toWidget, toWidgetEditable } from 'ckeditor5/src/widget';\nimport TableWalker from './../tablewalker';\n/**\n * Model table element to view table element conversion helper.\n */\nexport function downcastTable(tableUtils, options) {\n return (table, { writer }) => {\n const headingRows = table.getAttribute('headingRows') || 0;\n const tableElement = writer.createContainerElement('table', null, []);\n const figureElement = writer.createContainerElement('figure', { class: 'table' }, tableElement);\n // Table head slot.\n if (headingRows > 0) {\n writer.insert(writer.createPositionAt(tableElement, 'end'), writer.createContainerElement('thead', null, writer.createSlot(element => element.is('element', 'tableRow') && element.index < headingRows)));\n }\n // Table body slot.\n if (headingRows < tableUtils.getRows(table)) {\n writer.insert(writer.createPositionAt(tableElement, 'end'), writer.createContainerElement('tbody', null, writer.createSlot(element => element.is('element', 'tableRow') && element.index >= headingRows)));\n }\n // Dynamic slots.\n for (const { positionOffset, filter } of options.additionalSlots) {\n writer.insert(writer.createPositionAt(tableElement, positionOffset), writer.createSlot(filter));\n }\n // Create a slot with items that don't fit into the table.\n writer.insert(writer.createPositionAt(tableElement, 'after'), writer.createSlot(element => {\n if (element.is('element', 'tableRow')) {\n return false;\n }\n return !options.additionalSlots.some(({ filter }) => filter(element));\n }));\n return options.asWidget ? toTableWidget(figureElement, writer) : figureElement;\n };\n}\n/**\n * Model table row element to view `<tr>` element conversion helper.\n *\n * @returns Element creator.\n */\nexport function downcastRow() {\n return (tableRow, { writer }) => {\n return tableRow.isEmpty ?\n writer.createEmptyElement('tr') :\n writer.createContainerElement('tr');\n };\n}\n/**\n * Model table cell element to view `<td>` or `<th>` element conversion helper.\n *\n * This conversion helper will create proper `<th>` elements for table cells that are in the heading section (heading row or column)\n * and `<td>` otherwise.\n *\n * @param options.asWidget If set to `true`, the downcast conversion will produce a widget.\n * @returns Element creator.\n */\nexport function downcastCell(options = {}) {\n return (tableCell, { writer }) => {\n const tableRow = tableCell.parent;\n const table = tableRow.parent;\n const rowIndex = table.getChildIndex(tableRow);\n const tableWalker = new TableWalker(table, { row: rowIndex });\n const headingRows = table.getAttribute('headingRows') || 0;\n const headingColumns = table.getAttribute('headingColumns') || 0;\n let result = null;\n // We need to iterate over a table in order to get proper row & column values from a walker.\n for (const tableSlot of tableWalker) {\n if (tableSlot.cell == tableCell) {\n const isHeading = tableSlot.row < headingRows || tableSlot.column < headingColumns;\n const cellElementName = isHeading ? 'th' : 'td';\n result = options.asWidget ?\n toWidgetEditable(writer.createEditableElement(cellElementName), writer) :\n writer.createContainerElement(cellElementName);\n break;\n }\n }\n return result;\n };\n}\n/**\n * Overrides paragraph inside table cell conversion.\n *\n * This converter:\n * * should be used to override default paragraph conversion.\n * * It will only convert `<paragraph>` placed directly inside `<tableCell>`.\n * * For a single paragraph without attributes it returns `<span>` to simulate data table.\n * * For all other cases it returns `<p>` element.\n *\n * @param options.asWidget If set to `true`, the downcast conversion will produce a widget.\n * @returns Element creator.\n */\nexport function convertParagraphInTableCell(options = {}) {\n return (modelElement, { writer }) => {\n if (!modelElement.parent.is('element', 'tableCell')) {\n return null;\n }\n if (!isSingleParagraphWithoutAttributes(modelElement)) {\n return null;\n }\n if (options.asWidget) {\n return writer.createContainerElement('span', { class: 'ck-table-bogus-paragraph' });\n }\n else {\n // Using `<p>` in case there are some markers on it and transparentRendering will render it anyway.\n const viewElement = writer.createContainerElement('p');\n writer.setCustomProperty('dataPipeline:transparentRendering', true, viewElement);\n return viewElement;\n }\n };\n}\n/**\n * Checks if given model `<paragraph>` is an only child of a parent (`<tableCell>`) and if it has any attribute set.\n *\n * The paragraph should be converted in the editing view to:\n *\n * * If returned `true` - to a `<span class=\"ck-table-bogus-paragraph\">`\n * * If returned `false` - to a `<p>`\n */\nexport function isSingleParagraphWithoutAttributes(modelElement) {\n const tableCell = modelElement.parent;\n const isSingleParagraph = tableCell.childCount == 1;\n return isSingleParagraph && !hasAnyAttribute(modelElement);\n}\n/**\n * Converts a given {@link module:engine/view/element~Element} to a table widget:\n * * Adds a {@link module:engine/view/element~Element#_setCustomProperty custom property} allowing to recognize the table widget element.\n * * Calls the {@link module:widget/utils~toWidget} function with the proper element's label creator.\n *\n * @param writer An instance of the view writer.\n * @param label The element's label. It will be concatenated with the table `alt` attribute if one is present.\n */\nfunction toTableWidget(viewElement, writer) {\n writer.setCustomProperty('table', true, viewElement);\n return toWidget(viewElement, writer, { hasSelectionHandle: true });\n}\n/**\n * Checks if an element has any attributes set.\n */\nfunction hasAnyAttribute(element) {\n const iteratorItem = element.getAttributeKeys().next();\n return !iteratorItem.done;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/commands/inserttablecommand\n */\nimport { Command } from 'ckeditor5/src/core';\n/**\n * The insert table command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTable'` editor command.\n *\n * To insert a table at the current selection, execute the command and specify the dimensions:\n *\n * ```ts\n * editor.execute( 'insertTable', { rows: 20, columns: 5 } );\n * ```\n */\nexport default class InsertTableCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const model = this.editor.model;\n const selection = model.document.selection;\n const schema = model.schema;\n this.isEnabled = isAllowedInParent(selection, schema);\n }\n /**\n * Executes the command.\n *\n * Inserts a table with the given number of rows and columns into the editor.\n *\n * @param options.rows The number of rows to create in the inserted table. Default value is 2.\n * @param options.columns The number of columns to create in the inserted table. Default value is 2.\n * @param options.headingRows The number of heading rows. If not provided it will default to\n * {@link module:table/tableconfig~TableConfig#defaultHeadings `config.table.defaultHeadings.rows`} table config.\n * @param options.headingColumns The number of heading columns. If not provided it will default to\n * {@link module:table/tableconfig~TableConfig#defaultHeadings `config.table.defaultHeadings.columns`} table config.\n * @fires execute\n */\n execute(options = {}) {\n const editor = this.editor;\n const model = editor.model;\n const tableUtils = editor.plugins.get('TableUtils');\n const defaultRows = editor.config.get('table.defaultHeadings.rows');\n const defaultColumns = editor.config.get('table.defaultHeadings.columns');\n if (options.headingRows === undefined && defaultRows) {\n options.headingRows = defaultRows;\n }\n if (options.headingColumns === undefined && defaultColumns) {\n options.headingColumns = defaultColumns;\n }\n model.change(writer => {\n const table = tableUtils.createTable(writer, options);\n model.insertObject(table, null, null, { findOptimalPosition: 'auto' });\n writer.setSelection(writer.createPositionAt(table.getNodeByPath([0, 0, 0]), 0));\n });\n }\n}\n/**\n * Checks if the table is allowed in the parent.\n */\nfunction isAllowedInParent(selection, schema) {\n const positionParent = selection.getFirstPosition().parent;\n const validParent = positionParent === positionParent.root ? positionParent : positionParent.parent;\n return schema.checkChild(validParent, 'table');\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/commands/insertrowcommand\n */\nimport { Command } from 'ckeditor5/src/core';\n/**\n * The insert row command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTableRowBelow'` and\n * `'insertTableRowAbove'` editor commands.\n *\n * To insert a row below the selected cell, execute the following command:\n *\n * ```ts\n * editor.execute( 'insertTableRowBelow' );\n * ```\n *\n * To insert a row above the selected cell, execute the following command:\n *\n * ```ts\n * editor.execute( 'insertTableRowAbove' );\n * ```\n */\nexport default class InsertRowCommand extends Command {\n /**\n * Creates a new `InsertRowCommand` instance.\n *\n * @param editor The editor on which this command will be used.\n * @param options.order The order of insertion relative to the row in which the caret is located.\n * Possible values: `\"above\"` and `\"below\"`. Default value is \"below\"\n */\n constructor(editor, options = {}) {\n super(editor);\n this.order = options.order || 'below';\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const selection = this.editor.model.document.selection;\n const tableUtils = this.editor.plugins.get('TableUtils');\n const isAnyCellSelected = !!tableUtils.getSelectionAffectedTableCells(selection).length;\n this.isEnabled = isAnyCellSelected;\n }\n /**\n * Executes the command.\n *\n * Depending on the command's {@link #order} value, it inserts a row `'below'` or `'above'` the row in which selection is set.\n *\n * @fires execute\n */\n execute() {\n const editor = this.editor;\n const selection = editor.model.document.selection;\n const tableUtils = editor.plugins.get('TableUtils');\n const insertAbove = this.order === 'above';\n const affectedTableCells = tableUtils.getSelectionAffectedTableCells(selection);\n const rowIndexes = tableUtils.getRowIndexes(affectedTableCells);\n const row = insertAbove ? rowIndexes.first : rowIndexes.last;\n const table = affectedTableCells[0].findAncestor('table');\n tableUtils.insertRows(table, { at: insertAbove ? row : row + 1, copyStructureFromAbove: !insertAbove });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/commands/insertcolumncommand\n */\nimport { Command } from 'ckeditor5/src/core';\n/**\n * The insert column command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'insertTableColumnLeft'` and\n * `'insertTableColumnRight'` editor commands.\n *\n * To insert a column to the left of the selected cell, execute the following command:\n *\n * ```ts\n * editor.execute( 'insertTableColumnLeft' );\n * ```\n *\n * To insert a column to the right of the selected cell, execute the following command:\n *\n * ```ts\n * editor.execute( 'insertTableColumnRight' );\n * ```\n */\nexport default class InsertColumnCommand extends Command {\n /**\n * Creates a new `InsertColumnCommand` instance.\n *\n * @param editor An editor on which this command will be used.\n * @param options.order The order of insertion relative to the column in which the caret is located.\n * Possible values: `\"left\"` and `\"right\"`. Default value is \"right\".\n */\n constructor(editor, options = {}) {\n super(editor);\n this.order = options.order || 'right';\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const selection = this.editor.model.document.selection;\n const tableUtils = this.editor.plugins.get('TableUtils');\n const isAnyCellSelected = !!tableUtils.getSelectionAffectedTableCells(selection).length;\n this.isEnabled = isAnyCellSelected;\n }\n /**\n * Executes the command.\n *\n * Depending on the command's {@link #order} value, it inserts a column to the `'left'` or `'right'` of the column\n * in which the selection is set.\n *\n * @fires execute\n */\n execute() {\n const editor = this.editor;\n const selection = editor.model.document.selection;\n const tableUtils = editor.plugins.get('TableUtils');\n const insertBefore = this.order === 'left';\n const affectedTableCells = tableUtils.getSelectionAffectedTableCells(selection);\n const columnIndexes = tableUtils.getColumnIndexes(affectedTableCells);\n const column = insertBefore ? columnIndexes.first : columnIndexes.last;\n const table = affectedTableCells[0].findAncestor('table');\n tableUtils.insertColumns(table, { columns: 1, at: insertBefore ? column : column + 1 });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/commands/splitcellcommand\n */\nimport { Command } from 'ckeditor5/src/core';\n/**\n * The split cell command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'splitTableCellVertically'`\n * and `'splitTableCellHorizontally'` editor commands.\n *\n * You can split any cell vertically or horizontally by executing this command. For example, to split the selected table cell vertically:\n *\n * ```ts\n * editor.execute( 'splitTableCellVertically' );\n * ```\n */\nexport default class SplitCellCommand extends Command {\n /**\n * Creates a new `SplitCellCommand` instance.\n *\n * @param editor The editor on which this command will be used.\n * @param options.direction Indicates whether the command should split cells `'horizontally'` or `'vertically'`.\n */\n constructor(editor, options = {}) {\n super(editor);\n this.direction = options.direction || 'horizontally';\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const tableUtils = this.editor.plugins.get('TableUtils');\n const selectedCells = tableUtils.getSelectionAffectedTableCells(this.editor.model.document.selection);\n this.isEnabled = selectedCells.length === 1;\n }\n /**\n * @inheritDoc\n */\n execute() {\n const tableUtils = this.editor.plugins.get('TableUtils');\n const tableCell = tableUtils.getSelectionAffectedTableCells(this.editor.model.document.selection)[0];\n const isHorizontal = this.direction === 'horizontally';\n if (isHorizontal) {\n tableUtils.splitCellHorizontally(tableCell, 2);\n }\n else {\n tableUtils.splitCellVertically(tableCell, 2);\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { default as TableWalker } from '../tablewalker';\nimport { createEmptyTableCell, updateNumericAttribute } from './common';\n/**\n * Returns a cropped table according to given dimensions.\n\n * To return a cropped table that starts at first row and first column and end in third row and column:\n *\n * ```ts\n * const croppedTable = cropTableToDimensions( table, {\n * startRow: 1,\n * endRow: 3,\n * startColumn: 1,\n * endColumn: 3\n * }, writer );\n * ```\n *\n * Calling the code above for the table below:\n *\n * 0 1 2 3 4 0 1 2\n * ┌───┬───┬───┬───┬───┐\n * 0 │ a │ b │ c │ d │ e │\n * ├───┴───┤ ├───┴───┤ ┌───┬───┬───┐\n * 1 │ f │ │ g │ │ │ │ g │ 0\n * ├───┬───┴───┼───┬───┤ will return: ├───┴───┼───┤\n * 2 │ h │ i │ j │ k │ │ i │ j │ 1\n * ├───┤ ├───┤ │ │ ├───┤\n * 3 │ l │ │ m │ │ │ │ m │ 2\n * ├───┼───┬───┤ ├───┤ └───────┴───┘\n * 4 │ n │ o │ p │ │ q │\n * └───┴───┴───┴───┴───┘\n */\nexport function cropTableToDimensions(sourceTable, cropDimensions, writer) {\n const { startRow, startColumn, endRow, endColumn } = cropDimensions;\n // Create empty table with empty rows equal to crop height.\n const croppedTable = writer.createElement('table');\n const cropHeight = endRow - startRow + 1;\n for (let i = 0; i < cropHeight; i++) {\n writer.insertElement('tableRow', croppedTable, 'end');\n }\n const tableMap = [...new TableWalker(sourceTable, { startRow, endRow, startColumn, endColumn, includeAllSlots: true })];\n // Iterate over source table slots (including empty - spanned - ones).\n for (const { row: sourceRow, column: sourceColumn, cell: tableCell, isAnchor, cellAnchorRow, cellAnchorColumn } of tableMap) {\n // Row index in cropped table.\n const rowInCroppedTable = sourceRow - startRow;\n const row = croppedTable.getChild(rowInCroppedTable);\n // For empty slots: fill the gap with empty table cell.\n if (!isAnchor) {\n // But fill the gap only if the spanning cell is anchored outside cropped area.\n // In the table from method jsdoc those cells are: \"c\" & \"f\".\n if (cellAnchorRow < startRow || cellAnchorColumn < startColumn) {\n createEmptyTableCell(writer, writer.createPositionAt(row, 'end'));\n }\n }\n // Otherwise clone the cell with all children and trim if it exceeds cropped area.\n else {\n const tableCellCopy = writer.cloneElement(tableCell);\n writer.append(tableCellCopy, row);\n // Trim table if it exceeds cropped area.\n // In the table from method jsdoc those cells are: \"g\" & \"m\".\n trimTableCellIfNeeded(tableCellCopy, sourceRow, sourceColumn, endRow, endColumn, writer);\n }\n }\n // Adjust heading rows & columns in cropped table if crop selection includes headings parts.\n addHeadingsToCroppedTable(croppedTable, sourceTable, startRow, startColumn, writer);\n return croppedTable;\n}\n/**\n * Returns slot info of cells that starts above and overlaps a given row.\n *\n * In a table below, passing `overlapRow = 3`\n *\n * ┌───┬───┬───┬───┬───┐\n * 0 │ a │ b │ c │ d │ e │\n * │ ├───┼───┼───┼───┤\n * 1 │ │ f │ g │ h │ i │\n * ├───┤ ├───┼───┤ │\n * 2 │ j │ │ k │ l │ │\n * │ │ │ ├───┼───┤\n * 3 │ │ │ │ m │ n │ <- overlap row to check\n * ├───┼───┤ │ ├───│\n * 4 │ o │ p │ │ │ q │\n * └───┴───┴───┴───┴───┘\n *\n * will return slot info for cells: \"j\", \"f\", \"k\".\n *\n * @param table The table to check.\n * @param overlapRow The index of the row to check.\n * @param startRow row to start analysis. Use it when it is known that the cells above that row will not overlap. Default value is 0.\n */\nexport function getVerticallyOverlappingCells(table, overlapRow, startRow = 0) {\n const cells = [];\n const tableWalker = new TableWalker(table, { startRow, endRow: overlapRow - 1 });\n for (const slotInfo of tableWalker) {\n const { row, cellHeight } = slotInfo;\n const cellEndRow = row + cellHeight - 1;\n if (row < overlapRow && overlapRow <= cellEndRow) {\n cells.push(slotInfo);\n }\n }\n return cells;\n}\n/**\n * Splits the table cell horizontally.\n *\n * @returns Created table cell, if any were created.\n */\nexport function splitHorizontally(tableCell, splitRow, writer) {\n const tableRow = tableCell.parent;\n const table = tableRow.parent;\n const rowIndex = tableRow.index;\n const rowspan = parseInt(tableCell.getAttribute('rowspan'));\n const newRowspan = splitRow - rowIndex;\n const newCellAttributes = {};\n const newCellRowSpan = rowspan - newRowspan;\n if (newCellRowSpan > 1) {\n newCellAttributes.rowspan = newCellRowSpan;\n }\n const colspan = parseInt(tableCell.getAttribute('colspan') || '1');\n if (colspan > 1) {\n newCellAttributes.colspan = colspan;\n }\n const startRow = rowIndex;\n const endRow = startRow + newRowspan;\n const tableMap = [...new TableWalker(table, { startRow, endRow, includeAllSlots: true })];\n let newCell = null;\n let columnIndex;\n for (const tableSlot of tableMap) {\n const { row, column, cell } = tableSlot;\n if (cell === tableCell && columnIndex === undefined) {\n columnIndex = column;\n }\n if (columnIndex !== undefined && columnIndex === column && row === endRow) {\n newCell = createEmptyTableCell(writer, tableSlot.getPositionBefore(), newCellAttributes);\n }\n }\n // Update the rowspan attribute after updating table.\n updateNumericAttribute('rowspan', newRowspan, tableCell, writer);\n return newCell;\n}\n/**\n * Returns slot info of cells that starts before and overlaps a given column.\n *\n * In a table below, passing `overlapColumn = 3`\n *\n * 0 1 2 3 4\n * ┌───────┬───────┬───┐\n * │ a │ b │ c │\n * │───┬───┴───────┼───┤\n * │ d │ e │ f │\n * ├───┼───┬───────┴───┤\n * │ g │ h │ i │\n * ├───┼───┼───┬───────┤\n * │ j │ k │ l │ m │\n * ├───┼───┴───┼───┬───┤\n * │ n │ o │ p │ q │\n * └───┴───────┴───┴───┘\n * ^\n * Overlap column to check\n *\n * will return slot info for cells: \"b\", \"e\", \"i\".\n *\n * @param table The table to check.\n * @param overlapColumn The index of the column to check.\n */\nexport function getHorizontallyOverlappingCells(table, overlapColumn) {\n const cellsToSplit = [];\n const tableWalker = new TableWalker(table);\n for (const slotInfo of tableWalker) {\n const { column, cellWidth } = slotInfo;\n const cellEndColumn = column + cellWidth - 1;\n if (column < overlapColumn && overlapColumn <= cellEndColumn) {\n cellsToSplit.push(slotInfo);\n }\n }\n return cellsToSplit;\n}\n/**\n * Splits the table cell vertically.\n *\n * @param columnIndex The table cell column index.\n * @param splitColumn The index of column to split cell on.\n * @returns Created table cell.\n */\nexport function splitVertically(tableCell, columnIndex, splitColumn, writer) {\n const colspan = parseInt(tableCell.getAttribute('colspan'));\n const newColspan = splitColumn - columnIndex;\n const newCellAttributes = {};\n const newCellColSpan = colspan - newColspan;\n if (newCellColSpan > 1) {\n newCellAttributes.colspan = newCellColSpan;\n }\n const rowspan = parseInt(tableCell.getAttribute('rowspan') || '1');\n if (rowspan > 1) {\n newCellAttributes.rowspan = rowspan;\n }\n const newCell = createEmptyTableCell(writer, writer.createPositionAfter(tableCell), newCellAttributes);\n // Update the colspan attribute after updating table.\n updateNumericAttribute('colspan', newColspan, tableCell, writer);\n return newCell;\n}\n/**\n * Adjusts table cell dimensions to not exceed limit row and column.\n *\n * If table cell width (or height) covers a column (or row) that is after a limit column (or row)\n * this method will trim \"colspan\" (or \"rowspan\") attribute so the table cell will fit in a defined limits.\n */\nexport function trimTableCellIfNeeded(tableCell, cellRow, cellColumn, limitRow, limitColumn, writer) {\n const colspan = parseInt(tableCell.getAttribute('colspan') || '1');\n const rowspan = parseInt(tableCell.getAttribute('rowspan') || '1');\n const endColumn = cellColumn + colspan - 1;\n if (endColumn > limitColumn) {\n const trimmedSpan = limitColumn - cellColumn + 1;\n updateNumericAttribute('colspan', trimmedSpan, tableCell, writer, 1);\n }\n const endRow = cellRow + rowspan - 1;\n if (endRow > limitRow) {\n const trimmedSpan = limitRow - cellRow + 1;\n updateNumericAttribute('rowspan', trimmedSpan, tableCell, writer, 1);\n }\n}\n/**\n * Sets proper heading attributes to a cropped table.\n */\nfunction addHeadingsToCroppedTable(croppedTable, sourceTable, startRow, startColumn, writer) {\n const headingRows = parseInt(sourceTable.getAttribute('headingRows') || '0');\n if (headingRows > 0) {\n const headingRowsInCrop = headingRows - startRow;\n updateNumericAttribute('headingRows', headingRowsInCrop, croppedTable, writer, 0);\n }\n const headingColumns = parseInt(sourceTable.getAttribute('headingColumns') || '0');\n if (headingColumns > 0) {\n const headingColumnsInCrop = headingColumns - startColumn;\n updateNumericAttribute('headingColumns', headingColumnsInCrop, croppedTable, writer, 0);\n }\n}\n/**\n * Removes columns that have no cells anchored.\n *\n * In table below:\n *\n * +----+----+----+----+----+----+----+\n * | 00 | 01 | 03 | 04 | 06 |\n * +----+----+----+----+ +----+\n * | 10 | 11 | 13 | | 16 |\n * +----+----+----+----+----+----+----+\n * | 20 | 21 | 23 | 24 | 26 |\n * +----+----+----+----+----+----+----+\n * ^--- empty ---^\n *\n * Will remove columns 2 and 5.\n *\n * **Note:** This is a low-level helper method for clearing invalid model state when doing table modifications.\n * To remove a column from a table use {@link module:table/tableutils~TableUtils#removeColumns `TableUtils.removeColumns()`}.\n *\n * @internal\n * @returns True if removed some columns.\n */\nexport function removeEmptyColumns(table, tableUtils) {\n const width = tableUtils.getColumns(table);\n const columnsMap = new Array(width).fill(0);\n for (const { column } of new TableWalker(table)) {\n columnsMap[column]++;\n }\n const emptyColumns = columnsMap.reduce((result, cellsCount, column) => {\n return cellsCount ? result : [...result, column];\n }, []);\n if (emptyColumns.length > 0) {\n // Remove only last empty column because it will recurrently trigger removing empty rows.\n const emptyColumn = emptyColumns[emptyColumns.length - 1];\n // @if CK_DEBUG_TABLE // console.log( `Removing empty column: ${ emptyColumn }.` );\n tableUtils.removeColumns(table, { at: emptyColumn });\n return true;\n }\n return false;\n}\n/**\n * Removes rows that have no cells anchored.\n *\n * In table below:\n *\n * +----+----+----+\n * | 00 | 01 | 02 |\n * +----+----+----+\n * | 10 | 11 | 12 |\n * + + + +\n * | | | | <-- empty\n * +----+----+----+\n * | 30 | 31 | 32 |\n * +----+----+----+\n * | 40 | 42 |\n * + + +\n * | | | <-- empty\n * +----+----+----+\n * | 60 | 61 | 62 |\n * +----+----+----+\n *\n * Will remove rows 2 and 5.\n *\n * **Note:** This is a low-level helper method for clearing invalid model state when doing table modifications.\n * To remove a row from a table use {@link module:table/tableutils~TableUtils#removeRows `TableUtils.removeRows()`}.\n *\n * @internal\n * @returns True if removed some rows.\n */\nexport function removeEmptyRows(table, tableUtils) {\n const emptyRows = [];\n const tableRowCount = tableUtils.getRows(table);\n for (let rowIndex = 0; rowIndex < tableRowCount; rowIndex++) {\n const tableRow = table.getChild(rowIndex);\n if (tableRow.isEmpty) {\n emptyRows.push(rowIndex);\n }\n }\n if (emptyRows.length > 0) {\n // Remove only last empty row because it will recurrently trigger removing empty columns.\n const emptyRow = emptyRows[emptyRows.length - 1];\n // @if CK_DEBUG_TABLE // console.log( `Removing empty row: ${ emptyRow }.` );\n tableUtils.removeRows(table, { at: emptyRow });\n return true;\n }\n return false;\n}\n/**\n * Removes rows and columns that have no cells anchored.\n *\n * In table below:\n *\n * +----+----+----+----+\n * | 00 | 02 |\n * +----+----+ +\n * | 10 | |\n * +----+----+----+----+\n * | 20 | 22 | 23 |\n * + + + +\n * | | | | <-- empty row\n * +----+----+----+----+\n * ^--- empty column\n *\n * Will remove row 3 and column 1.\n *\n * **Note:** This is a low-level helper method for clearing invalid model state when doing table modifications.\n * To remove a rows from a table use {@link module:table/tableutils~TableUtils#removeRows `TableUtils.removeRows()`} and\n * {@link module:table/tableutils~TableUtils#removeColumns `TableUtils.removeColumns()`} to remove a column.\n *\n * @internal\n */\nexport function removeEmptyRowsColumns(table, tableUtils) {\n const removedColumns = removeEmptyColumns(table, tableUtils);\n // If there was some columns removed then cleaning empty rows was already triggered.\n if (!removedColumns) {\n removeEmptyRows(table, tableUtils);\n }\n}\n/**\n * Returns adjusted last row index if selection covers part of a row with empty slots (spanned by other cells).\n * The `dimensions.lastRow` is equal to last row index but selection might be bigger.\n *\n * This happens *only* on rectangular selection so we analyze a case like this:\n *\n * +---+---+---+---+\n * 0 | a | b | c | d |\n * + + +---+---+\n * 1 | | e | f | g |\n * + +---+ +---+\n * 2 | | h | | i | <- last row, each cell has rowspan = 2,\n * + + + + + so we need to return 3, not 2\n * 3 | | | | |\n * +---+---+---+---+\n *\n * @returns Adjusted last row index.\n */\nexport function adjustLastRowIndex(table, dimensions) {\n const lastRowMap = Array.from(new TableWalker(table, {\n startColumn: dimensions.firstColumn,\n endColumn: dimensions.lastColumn,\n row: dimensions.lastRow\n }));\n const everyCellHasSingleRowspan = lastRowMap.every(({ cellHeight }) => cellHeight === 1);\n // It is a \"flat\" row, so the last row index is OK.\n if (everyCellHasSingleRowspan) {\n return dimensions.lastRow;\n }\n // Otherwise get any cell's rowspan and adjust the last row index.\n const rowspanAdjustment = lastRowMap[0].cellHeight - 1;\n return dimensions.lastRow + rowspanAdjustment;\n}\n/**\n * Returns adjusted last column index if selection covers part of a column with empty slots (spanned by other cells).\n * The `dimensions.lastColumn` is equal to last column index but selection might be bigger.\n *\n * This happens *only* on rectangular selection so we analyze a case like this:\n *\n * 0 1 2 3\n * +---+---+---+---+\n * | a |\n * +---+---+---+---+\n * | b | c | d |\n * +---+---+---+---+\n * | e | f |\n * +---+---+---+---+\n * | g | h |\n * +---+---+---+---+\n * ^\n * last column, each cell has colspan = 2, so we need to return 3, not 2\n *\n * @returns Adjusted last column index.\n */\nexport function adjustLastColumnIndex(table, dimensions) {\n const lastColumnMap = Array.from(new TableWalker(table, {\n startRow: dimensions.firstRow,\n endRow: dimensions.lastRow,\n column: dimensions.lastColumn\n }));\n const everyCellHasSingleColspan = lastColumnMap.every(({ cellWidth }) => cellWidth === 1);\n // It is a \"flat\" column, so the last column index is OK.\n if (everyCellHasSingleColspan) {\n return dimensions.lastColumn;\n }\n // Otherwise get any cell's colspan and adjust the last column index.\n const colspanAdjustment = lastColumnMap[0].cellWidth - 1;\n return dimensions.lastColumn + colspanAdjustment;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core';\nimport TableWalker from '../tablewalker';\nimport { isHeadingColumnCell } from '../utils/common';\nimport { removeEmptyRowsColumns } from '../utils/structure';\n/**\n * The merge cell command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'mergeTableCellRight'`, `'mergeTableCellLeft'`,\n * `'mergeTableCellUp'` and `'mergeTableCellDown'` editor commands.\n *\n * To merge a table cell at the current selection with another cell, execute the command corresponding with the preferred direction.\n *\n * For example, to merge with a cell to the right:\n *\n * ```ts\n * editor.execute( 'mergeTableCellRight' );\n * ```\n *\n * **Note**: If a table cell has a different [`rowspan`](https://www.w3.org/TR/html50/tabular-data.html#attr-tdth-rowspan)\n * (for `'mergeTableCellRight'` and `'mergeTableCellLeft'`) or [`colspan`](https://www.w3.org/TR/html50/tabular-data.html#attr-tdth-colspan)\n * (for `'mergeTableCellUp'` and `'mergeTableCellDown'`), the command will be disabled.\n */\nexport default class MergeCellCommand extends Command {\n /**\n * Creates a new `MergeCellCommand` instance.\n *\n * @param editor The editor on which this command will be used.\n * @param options.direction Indicates which cell to merge with the currently selected one.\n * Possible values are: `'left'`, `'right'`, `'up'` and `'down'`.\n */\n constructor(editor, options) {\n super(editor);\n this.direction = options.direction;\n this.isHorizontal = this.direction == 'right' || this.direction == 'left';\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const cellToMerge = this._getMergeableCell();\n this.value = cellToMerge;\n this.isEnabled = !!cellToMerge;\n }\n /**\n * Executes the command.\n *\n * Depending on the command's {@link #direction} value, it will merge the cell that is to the `'left'`, `'right'`, `'up'` or `'down'`.\n *\n * @fires execute\n */\n execute() {\n const model = this.editor.model;\n const doc = model.document;\n const tableUtils = this.editor.plugins.get('TableUtils');\n const tableCell = tableUtils.getTableCellsContainingSelection(doc.selection)[0];\n const cellToMerge = this.value;\n const direction = this.direction;\n model.change(writer => {\n const isMergeNext = direction == 'right' || direction == 'down';\n // The merge mechanism is always the same so sort cells to be merged.\n const cellToExpand = (isMergeNext ? tableCell : cellToMerge);\n const cellToRemove = (isMergeNext ? cellToMerge : tableCell);\n // Cache the parent of cell to remove for later check.\n const removedTableCellRow = cellToRemove.parent;\n mergeTableCells(cellToRemove, cellToExpand, writer);\n const spanAttribute = this.isHorizontal ? 'colspan' : 'rowspan';\n const cellSpan = parseInt(tableCell.getAttribute(spanAttribute) || '1');\n const cellToMergeSpan = parseInt(cellToMerge.getAttribute(spanAttribute) || '1');\n // Update table cell span attribute and merge set selection on merged contents.\n writer.setAttribute(spanAttribute, cellSpan + cellToMergeSpan, cellToExpand);\n writer.setSelection(writer.createRangeIn(cellToExpand));\n const tableUtils = this.editor.plugins.get('TableUtils');\n const table = removedTableCellRow.findAncestor('table');\n // Remove empty rows and columns after merging.\n removeEmptyRowsColumns(table, tableUtils);\n });\n }\n /**\n * Returns a cell that can be merged with the current cell depending on the command's direction.\n */\n _getMergeableCell() {\n const model = this.editor.model;\n const doc = model.document;\n const tableUtils = this.editor.plugins.get('TableUtils');\n const tableCell = tableUtils.getTableCellsContainingSelection(doc.selection)[0];\n if (!tableCell) {\n return;\n }\n // First get the cell on proper direction.\n const cellToMerge = this.isHorizontal ?\n getHorizontalCell(tableCell, this.direction, tableUtils) :\n getVerticalCell(tableCell, this.direction, tableUtils);\n if (!cellToMerge) {\n return;\n }\n // If found check if the span perpendicular to merge direction is equal on both cells.\n const spanAttribute = this.isHorizontal ? 'rowspan' : 'colspan';\n const span = parseInt(tableCell.getAttribute(spanAttribute) || '1');\n const cellToMergeSpan = parseInt(cellToMerge.getAttribute(spanAttribute) || '1');\n if (cellToMergeSpan === span) {\n return cellToMerge;\n }\n }\n}\n/**\n * Returns the cell that can be merged horizontally.\n */\nfunction getHorizontalCell(tableCell, direction, tableUtils) {\n const tableRow = tableCell.parent;\n const table = tableRow.parent;\n const horizontalCell = direction == 'right' ? tableCell.nextSibling : tableCell.previousSibling;\n const hasHeadingColumns = (table.getAttribute('headingColumns') || 0) > 0;\n if (!horizontalCell) {\n return;\n }\n // Sort cells:\n const cellOnLeft = (direction == 'right' ? tableCell : horizontalCell);\n const cellOnRight = (direction == 'right' ? horizontalCell : tableCell);\n // Get their column indexes:\n const { column: leftCellColumn } = tableUtils.getCellLocation(cellOnLeft);\n const { column: rightCellColumn } = tableUtils.getCellLocation(cellOnRight);\n const leftCellSpan = parseInt(cellOnLeft.getAttribute('colspan') || '1');\n const isCellOnLeftInHeadingColumn = isHeadingColumnCell(tableUtils, cellOnLeft);\n const isCellOnRightInHeadingColumn = isHeadingColumnCell(tableUtils, cellOnRight);\n // We cannot merge heading columns cells with regular cells.\n if (hasHeadingColumns && isCellOnLeftInHeadingColumn != isCellOnRightInHeadingColumn) {\n return;\n }\n // The cell on the right must have index that is distant to the cell on the left by the left cell's width (colspan).\n const cellsAreTouching = leftCellColumn + leftCellSpan === rightCellColumn;\n // If the right cell's column index is different it means that there are rowspanned cells between them.\n return cellsAreTouching ? horizontalCell : undefined;\n}\n/**\n * Returns the cell that can be merged vertically.\n */\nfunction getVerticalCell(tableCell, direction, tableUtils) {\n const tableRow = tableCell.parent;\n const table = tableRow.parent;\n const rowIndex = table.getChildIndex(tableRow);\n // Don't search for mergeable cell if direction points out of the table.\n if ((direction == 'down' && rowIndex === tableUtils.getRows(table) - 1) || (direction == 'up' && rowIndex === 0)) {\n return null;\n }\n const rowspan = parseInt(tableCell.getAttribute('rowspan') || '1');\n const headingRows = table.getAttribute('headingRows') || 0;\n const isMergeWithBodyCell = direction == 'down' && (rowIndex + rowspan) === headingRows;\n const isMergeWithHeadCell = direction == 'up' && rowIndex === headingRows;\n // Don't search for mergeable cell if direction points out of the current table section.\n if (headingRows && (isMergeWithBodyCell || isMergeWithHeadCell)) {\n return null;\n }\n const currentCellRowSpan = parseInt(tableCell.getAttribute('rowspan') || '1');\n const rowOfCellToMerge = direction == 'down' ? rowIndex + currentCellRowSpan : rowIndex;\n const tableMap = [...new TableWalker(table, { endRow: rowOfCellToMerge })];\n const currentCellData = tableMap.find(value => value.cell === tableCell);\n const mergeColumn = currentCellData.column;\n const cellToMergeData = tableMap.find(({ row, cellHeight, column }) => {\n if (column !== mergeColumn) {\n return false;\n }\n if (direction == 'down') {\n // If merging a cell below the mergeRow is already calculated.\n return row === rowOfCellToMerge;\n }\n else {\n // If merging a cell above calculate if it spans to mergeRow.\n return rowOfCellToMerge === row + cellHeight;\n }\n });\n return cellToMergeData && cellToMergeData.cell ? cellToMergeData.cell : null;\n}\n/**\n * Merges two table cells. It will ensure that after merging cells with an empty paragraph, the resulting table cell will only have one\n * paragraph. If one of the merged table cells is empty, the merged table cell will have the contents of the non-empty table cell.\n * If both are empty, the merged table cell will have only one empty paragraph.\n */\nfunction mergeTableCells(cellToRemove, cellToExpand, writer) {\n if (!isEmpty(cellToRemove)) {\n if (isEmpty(cellToExpand)) {\n writer.remove(writer.createRangeIn(cellToExpand));\n }\n writer.move(writer.createRangeIn(cellToRemove), writer.createPositionAt(cellToExpand, 'end'));\n }\n // Remove merged table cell.\n writer.remove(cellToRemove);\n}\n/**\n * Checks if the passed table cell contains an empty paragraph.\n */\nfunction isEmpty(tableCell) {\n const firstTableChild = tableCell.getChild(0);\n return tableCell.childCount == 1 && firstTableChild.is('element', 'paragraph') && firstTableChild.isEmpty;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/commands/removerowcommand\n */\nimport { Command } from 'ckeditor5/src/core';\n/**\n * The remove row command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'removeTableRow'` editor command.\n *\n * To remove the row containing the selected cell, execute the command:\n *\n * ```ts\n * editor.execute( 'removeTableRow' );\n * ```\n */\nexport default class RemoveRowCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const tableUtils = this.editor.plugins.get('TableUtils');\n const selectedCells = tableUtils.getSelectionAffectedTableCells(this.editor.model.document.selection);\n const firstCell = selectedCells[0];\n if (firstCell) {\n const table = firstCell.findAncestor('table');\n const tableRowCount = tableUtils.getRows(table);\n const lastRowIndex = tableRowCount - 1;\n const selectedRowIndexes = tableUtils.getRowIndexes(selectedCells);\n const areAllRowsSelected = selectedRowIndexes.first === 0 && selectedRowIndexes.last === lastRowIndex;\n // Disallow selecting whole table -> delete whole table should be used instead.\n this.isEnabled = !areAllRowsSelected;\n }\n else {\n this.isEnabled = false;\n }\n }\n /**\n * @inheritDoc\n */\n execute() {\n const model = this.editor.model;\n const tableUtils = this.editor.plugins.get('TableUtils');\n const referenceCells = tableUtils.getSelectionAffectedTableCells(model.document.selection);\n const removedRowIndexes = tableUtils.getRowIndexes(referenceCells);\n const firstCell = referenceCells[0];\n const table = firstCell.findAncestor('table');\n const columnIndexToFocus = tableUtils.getCellLocation(firstCell).column;\n model.change(writer => {\n const rowsToRemove = removedRowIndexes.last - removedRowIndexes.first + 1;\n tableUtils.removeRows(table, {\n at: removedRowIndexes.first,\n rows: rowsToRemove\n });\n const cellToFocus = getCellToFocus(table, removedRowIndexes.first, columnIndexToFocus, tableUtils.getRows(table));\n writer.setSelection(writer.createPositionAt(cellToFocus, 0));\n });\n }\n}\n/**\n * Returns a cell that should be focused before removing the row, belonging to the same column as the currently focused cell.\n * - If the row was not the last one, the cell to focus will be in the row that followed it (before removal).\n * - If the row was the last one, the cell to focus will be in the row that preceded it (before removal).\n */\nfunction getCellToFocus(table, removedRowIndex, columnToFocus, tableRowCount) {\n // Don't go beyond last row's index.\n const row = table.getChild(Math.min(removedRowIndex, tableRowCount - 1));\n // Default to first table cell.\n let cellToFocus = row.getChild(0);\n let column = 0;\n for (const tableCell of row.getChildren()) {\n if (column > columnToFocus) {\n return cellToFocus;\n }\n cellToFocus = tableCell;\n column += parseInt(tableCell.getAttribute('colspan') || '1');\n }\n return cellToFocus;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/commands/removecolumncommand\n */\nimport { Command } from 'ckeditor5/src/core';\nimport TableWalker from '../tablewalker';\n/**\n * The remove column command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'removeTableColumn'` editor command.\n *\n * To remove the column containing the selected cell, execute the command:\n *\n * ```ts\n * editor.execute( 'removeTableColumn' );\n * ```\n */\nexport default class RemoveColumnCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const tableUtils = this.editor.plugins.get('TableUtils');\n const selectedCells = tableUtils.getSelectionAffectedTableCells(this.editor.model.document.selection);\n const firstCell = selectedCells[0];\n if (firstCell) {\n const table = firstCell.findAncestor('table');\n const tableColumnCount = tableUtils.getColumns(table);\n const { first, last } = tableUtils.getColumnIndexes(selectedCells);\n this.isEnabled = last - first < (tableColumnCount - 1);\n }\n else {\n this.isEnabled = false;\n }\n }\n /**\n * @inheritDoc\n */\n execute() {\n const tableUtils = this.editor.plugins.get('TableUtils');\n const [firstCell, lastCell] = getBoundaryCells(this.editor.model.document.selection, tableUtils);\n const table = firstCell.parent.parent;\n // Cache the table before removing or updating colspans.\n const tableMap = [...new TableWalker(table)];\n // Store column indexes of removed columns.\n const removedColumnIndexes = {\n first: tableMap.find(value => value.cell === firstCell).column,\n last: tableMap.find(value => value.cell === lastCell).column\n };\n const cellToFocus = getCellToFocus(tableMap, firstCell, lastCell, removedColumnIndexes);\n this.editor.model.change(writer => {\n const columnsToRemove = removedColumnIndexes.last - removedColumnIndexes.first + 1;\n tableUtils.removeColumns(table, {\n at: removedColumnIndexes.first,\n columns: columnsToRemove\n });\n writer.setSelection(writer.createPositionAt(cellToFocus, 0));\n });\n }\n}\n/**\n * Returns a proper table cell to focus after removing a column.\n * - selection is on last table cell it will return previous cell.\n */\nfunction getCellToFocus(tableMap, firstCell, lastCell, removedColumnIndexes) {\n const colspan = parseInt(lastCell.getAttribute('colspan') || '1');\n // If the table cell is spanned over 2+ columns - it will be truncated so the selection should\n // stay in that cell.\n if (colspan > 1) {\n return lastCell;\n }\n // Normally, look for the cell in the same row that precedes the first cell to put selection there (\"column on the left\").\n // If the deleted column is the first column of the table, there will be no predecessor: use the cell\n // from the column that follows then (also in the same row).\n else if (firstCell.previousSibling || lastCell.nextSibling) {\n return lastCell.nextSibling || firstCell.previousSibling;\n }\n // It can happen that table cells have no siblings in a row, for instance, when there are row spans\n // in the table (in the previous row). Then just look for the closest cell that is in a column\n // that will not be removed to put the selection there.\n else {\n // Look for any cell in a column that precedes the first removed column.\n if (removedColumnIndexes.first) {\n return tableMap.reverse().find(({ column }) => {\n return column < removedColumnIndexes.first;\n }).cell;\n }\n // If the first removed column is the first column of the table, then\n // look for any cell that is in a column that follows the last removed column.\n else {\n return tableMap.reverse().find(({ column }) => {\n return column > removedColumnIndexes.last;\n }).cell;\n }\n }\n}\n/**\n * Returns helper object returning the first and the last cell contained in given selection, based on DOM order.\n */\nfunction getBoundaryCells(selection, tableUtils) {\n const referenceCells = tableUtils.getSelectionAffectedTableCells(selection);\n const firstCell = referenceCells[0];\n const lastCell = referenceCells.pop();\n const returnValue = [firstCell, lastCell];\n return firstCell.isBefore(lastCell) ? returnValue : returnValue.reverse();\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/commands/setheaderrowcommand\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { updateNumericAttribute } from '../utils/common';\nimport { getVerticallyOverlappingCells, splitHorizontally } from '../utils/structure';\n/**\n * The header row command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'setTableColumnHeader'` editor command.\n *\n * You can make the row containing the selected cell a [header](https://www.w3.org/TR/html50/tabular-data.html#the-th-element) by executing:\n *\n * ```ts\n * editor.execute( 'setTableRowHeader' );\n * ```\n *\n * **Note:** All preceding rows will also become headers. If the current row is already a header, executing this command\n * will make it a regular row back again (including the following rows).\n */\nexport default class SetHeaderRowCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const tableUtils = this.editor.plugins.get('TableUtils');\n const model = this.editor.model;\n const selectedCells = tableUtils.getSelectionAffectedTableCells(model.document.selection);\n const isInTable = selectedCells.length > 0;\n this.isEnabled = isInTable;\n this.value = isInTable && selectedCells.every(cell => this._isInHeading(cell, cell.parent.parent));\n }\n /**\n * Executes the command.\n *\n * When the selection is in a non-header row, the command will set the `headingRows` table attribute to cover that row.\n *\n * When the selection is already in a header row, it will set `headingRows` so the heading section will end before that row.\n *\n * @fires execute\n * @param options.forceValue If set, the command will set (`true`) or unset (`false`) the header rows according to\n * the `forceValue` parameter instead of the current model state.\n */\n execute(options = {}) {\n if (options.forceValue === this.value) {\n return;\n }\n const tableUtils = this.editor.plugins.get('TableUtils');\n const model = this.editor.model;\n const selectedCells = tableUtils.getSelectionAffectedTableCells(model.document.selection);\n const table = selectedCells[0].findAncestor('table');\n const { first, last } = tableUtils.getRowIndexes(selectedCells);\n const headingRowsToSet = this.value ? first : last + 1;\n const currentHeadingRows = table.getAttribute('headingRows') || 0;\n model.change(writer => {\n if (headingRowsToSet) {\n // Changing heading rows requires to check if any of a heading cell is overlapping vertically the table head.\n // Any table cell that has a rowspan attribute > 1 will not exceed the table head so we need to fix it in rows below.\n const startRow = headingRowsToSet > currentHeadingRows ? currentHeadingRows : 0;\n const overlappingCells = getVerticallyOverlappingCells(table, headingRowsToSet, startRow);\n for (const { cell } of overlappingCells) {\n splitHorizontally(cell, headingRowsToSet, writer);\n }\n }\n updateNumericAttribute('headingRows', headingRowsToSet, table, writer, 0);\n });\n }\n /**\n * Checks if a table cell is in the heading section.\n */\n _isInHeading(tableCell, table) {\n const headingRows = parseInt(table.getAttribute('headingRows') || '0');\n return !!headingRows && tableCell.parent.index < headingRows;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/commands/setheadercolumncommand\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { isHeadingColumnCell, updateNumericAttribute } from '../utils/common';\nimport { getHorizontallyOverlappingCells, splitVertically } from '../utils/structure';\n/**\n * The header column command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'setTableColumnHeader'` editor command.\n *\n * You can make the column containing the selected cell a [header](https://www.w3.org/TR/html50/tabular-data.html#the-th-element)\n * by executing:\n *\n * ```ts\n * editor.execute( 'setTableColumnHeader' );\n * ```\n *\n * **Note:** All preceding columns will also become headers. If the current column is already a header, executing this command\n * will make it a regular column back again (including the following columns).\n */\nexport default class SetHeaderColumnCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const model = this.editor.model;\n const tableUtils = this.editor.plugins.get('TableUtils');\n const selectedCells = tableUtils.getSelectionAffectedTableCells(model.document.selection);\n const isInTable = selectedCells.length > 0;\n this.isEnabled = isInTable;\n this.value = isInTable && selectedCells.every(cell => isHeadingColumnCell(tableUtils, cell));\n }\n /**\n * Executes the command.\n *\n * When the selection is in a non-header column, the command will set the `headingColumns` table attribute to cover that column.\n *\n * When the selection is already in a header column, it will set `headingColumns` so the heading section will end before that column.\n *\n * @fires execute\n * @param options.forceValue If set, the command will set (`true`) or unset (`false`) the header columns according to\n * the `forceValue` parameter instead of the current model state.\n */\n execute(options = {}) {\n if (options.forceValue === this.value) {\n return;\n }\n const tableUtils = this.editor.plugins.get('TableUtils');\n const model = this.editor.model;\n const selectedCells = tableUtils.getSelectionAffectedTableCells(model.document.selection);\n const table = selectedCells[0].findAncestor('table');\n const { first, last } = tableUtils.getColumnIndexes(selectedCells);\n const headingColumnsToSet = this.value ? first : last + 1;\n model.change(writer => {\n if (headingColumnsToSet) {\n // Changing heading columns requires to check if any of a heading cell is overlapping horizontally the table head.\n // Any table cell that has a colspan attribute > 1 will not exceed the table head so we need to fix it in columns before.\n const overlappingCells = getHorizontallyOverlappingCells(table, headingColumnsToSet);\n for (const { cell, column } of overlappingCells) {\n splitVertically(cell, column, headingColumnsToSet, writer);\n }\n }\n updateNumericAttribute('headingColumns', headingColumnsToSet, table, writer, 0);\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tableutils\n */\nimport { CKEditorError } from 'ckeditor5/src/utils';\nimport { Plugin } from 'ckeditor5/src/core';\nimport TableWalker from './tablewalker';\nimport { createEmptyTableCell, updateNumericAttribute } from './utils/common';\nimport { removeEmptyColumns, removeEmptyRows } from './utils/structure';\n/**\n * The table utilities plugin.\n */\nexport default class TableUtils extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableUtils';\n }\n /**\n * @inheritDoc\n */\n init() {\n this.decorate('insertColumns');\n this.decorate('insertRows');\n }\n /**\n * Returns the table cell location as an object with table row and table column indexes.\n *\n * For instance, in the table below:\n *\n * 0 1 2 3\n * +---+---+---+---+\n * 0 | a | b | c |\n * + + +---+\n * 1 | | | d |\n * +---+---+ +---+\n * 2 | e | | f |\n * +---+---+---+---+\n *\n * the method will return:\n *\n * ```ts\n * const cellA = table.getNodeByPath( [ 0, 0 ] );\n * editor.plugins.get( 'TableUtils' ).getCellLocation( cellA );\n * // will return { row: 0, column: 0 }\n *\n * const cellD = table.getNodeByPath( [ 1, 0 ] );\n * editor.plugins.get( 'TableUtils' ).getCellLocation( cellD );\n * // will return { row: 1, column: 3 }\n * ```\n *\n * @returns Returns a `{row, column}` object.\n */\n getCellLocation(tableCell) {\n const tableRow = tableCell.parent;\n const table = tableRow.parent;\n const rowIndex = table.getChildIndex(tableRow);\n const tableWalker = new TableWalker(table, { row: rowIndex });\n for (const { cell, row, column } of tableWalker) {\n if (cell === tableCell) {\n return { row, column };\n }\n }\n // Should be unreachable code.\n /* istanbul ignore next -- @preserve */\n return undefined;\n }\n /**\n * Creates an empty table with a proper structure. The table needs to be inserted into the model,\n * for example, by using the {@link module:engine/model/model~Model#insertContent} function.\n *\n * ```ts\n * model.change( ( writer ) => {\n * // Create a table of 2 rows and 7 columns:\n * const table = tableUtils.createTable( writer, { rows: 2, columns: 7 } );\n *\n * // Insert a table to the model at the best position taking the current selection:\n * model.insertContent( table );\n * }\n * ```\n *\n * @param writer The model writer.\n * @param options.rows The number of rows to create. Default value is 2.\n * @param options.columns The number of columns to create. Default value is 2.\n * @param options.headingRows The number of heading rows. Default value is 0.\n * @param options.headingColumns The number of heading columns. Default value is 0.\n * @returns The created table element.\n */\n createTable(writer, options) {\n const table = writer.createElement('table');\n const rows = options.rows || 2;\n const columns = options.columns || 2;\n createEmptyRows(writer, table, 0, rows, columns);\n if (options.headingRows) {\n updateNumericAttribute('headingRows', Math.min(options.headingRows, rows), table, writer, 0);\n }\n if (options.headingColumns) {\n updateNumericAttribute('headingColumns', Math.min(options.headingColumns, columns), table, writer, 0);\n }\n return table;\n }\n /**\n * Inserts rows into a table.\n *\n * ```ts\n * editor.plugins.get( 'TableUtils' ).insertRows( table, { at: 1, rows: 2 } );\n * ```\n *\n * Assuming the table on the left, the above code will transform it to the table on the right:\n *\n * row index\n * 0 +---+---+---+ `at` = 1, +---+---+---+ 0\n * | a | b | c | `rows` = 2, | a | b | c |\n * 1 + +---+---+ <-- insert here + +---+---+ 1\n * | | d | e | | | | |\n * 2 + +---+---+ will give: + +---+---+ 2\n * | | f | g | | | | |\n * 3 +---+---+---+ + +---+---+ 3\n * | | d | e |\n * + +---+---+ 4\n * + + f | g |\n * +---+---+---+ 5\n *\n * @param table The table model element where the rows will be inserted.\n * @param options.at The row index at which the rows will be inserted. Default value is 0.\n * @param options.rows The number of rows to insert. Default value is 1.\n * @param options.copyStructureFromAbove The flag for copying row structure. Note that\n * the row structure will not be copied if this option is not provided.\n */\n insertRows(table, options = {}) {\n const model = this.editor.model;\n const insertAt = options.at || 0;\n const rowsToInsert = options.rows || 1;\n const isCopyStructure = options.copyStructureFromAbove !== undefined;\n const copyStructureFrom = options.copyStructureFromAbove ? insertAt - 1 : insertAt;\n const rows = this.getRows(table);\n const columns = this.getColumns(table);\n if (insertAt > rows) {\n /**\n * The `options.at` points at a row position that does not exist.\n *\n * @error tableutils-insertrows-insert-out-of-range\n */\n throw new CKEditorError('tableutils-insertrows-insert-out-of-range', this, { options });\n }\n model.change(writer => {\n const headingRows = table.getAttribute('headingRows') || 0;\n // Inserting rows inside heading section requires to update `headingRows` attribute as the heading section will grow.\n if (headingRows > insertAt) {\n updateNumericAttribute('headingRows', headingRows + rowsToInsert, table, writer, 0);\n }\n // Inserting at the end or at the beginning of a table doesn't require to calculate anything special.\n if (!isCopyStructure && (insertAt === 0 || insertAt === rows)) {\n createEmptyRows(writer, table, insertAt, rowsToInsert, columns);\n return;\n }\n // Iterate over all the rows above the inserted rows in order to check for the row-spanned cells.\n const walkerEndRow = isCopyStructure ? Math.max(insertAt, copyStructureFrom) : insertAt;\n const tableIterator = new TableWalker(table, { endRow: walkerEndRow });\n // Store spans of the reference row to reproduce it's structure. This array is column number indexed.\n const rowColSpansMap = new Array(columns).fill(1);\n for (const { row, column, cellHeight, cellWidth, cell } of tableIterator) {\n const lastCellRow = row + cellHeight - 1;\n const isOverlappingInsertedRow = row < insertAt && insertAt <= lastCellRow;\n const isReferenceRow = row <= copyStructureFrom && copyStructureFrom <= lastCellRow;\n // If the cell is row-spanned and overlaps the inserted row, then reserve space for it in the row map.\n if (isOverlappingInsertedRow) {\n // This cell overlaps the inserted rows so we need to expand it further.\n writer.setAttribute('rowspan', cellHeight + rowsToInsert, cell);\n // Mark this cell with negative number to indicate how many cells should be skipped when adding the new cells.\n rowColSpansMap[column] = -cellWidth;\n }\n // Store the colspan from reference row.\n else if (isCopyStructure && isReferenceRow) {\n rowColSpansMap[column] = cellWidth;\n }\n }\n for (let rowIndex = 0; rowIndex < rowsToInsert; rowIndex++) {\n const tableRow = writer.createElement('tableRow');\n writer.insert(tableRow, table, insertAt);\n for (let cellIndex = 0; cellIndex < rowColSpansMap.length; cellIndex++) {\n const colspan = rowColSpansMap[cellIndex];\n const insertPosition = writer.createPositionAt(tableRow, 'end');\n // Insert the empty cell only if this slot is not row-spanned from any other cell.\n if (colspan > 0) {\n createEmptyTableCell(writer, insertPosition, colspan > 1 ? { colspan } : undefined);\n }\n // Skip the col-spanned slots, there won't be any cells.\n cellIndex += Math.abs(colspan) - 1;\n }\n }\n });\n }\n /**\n * Inserts columns into a table.\n *\n * ```ts\n * editor.plugins.get( 'TableUtils' ).insertColumns( table, { at: 1, columns: 2 } );\n * ```\n *\n * Assuming the table on the left, the above code will transform it to the table on the right:\n *\n * 0 1 2 3 0 1 2 3 4 5\n * +---+---+---+ +---+---+---+---+---+\n * | a | b | | a | b |\n * + +---+ + +---+\n * | | c | | | c |\n * +---+---+---+ will give: +---+---+---+---+---+\n * | d | e | f | | d | | | e | f |\n * +---+ +---+ +---+---+---+ +---+\n * | g | | h | | g | | | | h |\n * +---+---+---+ +---+---+---+---+---+\n * | i | | i |\n * +---+---+---+ +---+---+---+---+---+\n * ^---- insert here, `at` = 1, `columns` = 2\n *\n * @param table The table model element where the columns will be inserted.\n * @param options.at The column index at which the columns will be inserted. Default value is 0.\n * @param options.columns The number of columns to insert. Default value is 1.\n */\n insertColumns(table, options = {}) {\n const model = this.editor.model;\n const insertAt = options.at || 0;\n const columnsToInsert = options.columns || 1;\n model.change(writer => {\n const headingColumns = table.getAttribute('headingColumns');\n // Inserting columns inside heading section requires to update `headingColumns` attribute as the heading section will grow.\n if (insertAt < headingColumns) {\n writer.setAttribute('headingColumns', headingColumns + columnsToInsert, table);\n }\n const tableColumns = this.getColumns(table);\n // Inserting at the end and at the beginning of a table doesn't require to calculate anything special.\n if (insertAt === 0 || tableColumns === insertAt) {\n for (const tableRow of table.getChildren()) {\n // Ignore non-row elements inside the table (e.g. caption).\n if (!tableRow.is('element', 'tableRow')) {\n continue;\n }\n createCells(columnsToInsert, writer, writer.createPositionAt(tableRow, insertAt ? 'end' : 0));\n }\n return;\n }\n const tableWalker = new TableWalker(table, { column: insertAt, includeAllSlots: true });\n for (const tableSlot of tableWalker) {\n const { row, cell, cellAnchorColumn, cellAnchorRow, cellWidth, cellHeight } = tableSlot;\n // When iterating over column the table walker outputs either:\n // - cells at given column index (cell \"e\" from method docs),\n // - spanned columns (spanned cell from row between cells \"g\" and \"h\" - spanned by \"e\", only if `includeAllSlots: true`),\n // - or a cell from the same row which spans over this column (cell \"a\").\n if (cellAnchorColumn < insertAt) {\n // If cell is anchored in previous column, it is a cell that spans over an inserted column (cell \"a\" & \"i\").\n // For such cells expand them by a number of columns inserted.\n writer.setAttribute('colspan', cellWidth + columnsToInsert, cell);\n // This cell will overlap cells in rows below so skip them (because of `includeAllSlots` option) - (cell \"a\")\n const lastCellRow = cellAnchorRow + cellHeight - 1;\n for (let i = row; i <= lastCellRow; i++) {\n tableWalker.skipRow(i);\n }\n }\n else {\n // It's either cell at this column index or spanned cell by a row-spanned cell from row above.\n // In table above it's cell \"e\" and a spanned position from row below (empty cell between cells \"g\" and \"h\")\n createCells(columnsToInsert, writer, tableSlot.getPositionBefore());\n }\n }\n });\n }\n /**\n * Removes rows from the given `table`.\n *\n * This method re-calculates the table geometry including `rowspan` attribute of table cells overlapping removed rows\n * and table headings values.\n *\n * ```ts\n * editor.plugins.get( 'TableUtils' ).removeRows( table, { at: 1, rows: 2 } );\n * ```\n *\n * Executing the above code in the context of the table on the left will transform its structure as presented on the right:\n *\n * row index\n * ┌───┬───┬───┐ `at` = 1 ┌───┬───┬───┐\n * 0 │ a │ b │ c │ `rows` = 2 │ a │ b │ c │ 0\n * │ ├───┼───┤ │ ├───┼───┤\n * 1 │ │ d │ e │ <-- remove from here │ │ d │ g │ 1\n * │ │ ├───┤ will give: ├───┼───┼───┤\n * 2 │ │ │ f │ │ h │ i │ j │ 2\n * │ │ ├───┤ └───┴───┴───┘\n * 3 │ │ │ g │\n * ├───┼───┼───┤\n * 4 │ h │ i │ j │\n * └───┴───┴───┘\n *\n * @param options.at The row index at which the removing rows will start.\n * @param options.rows The number of rows to remove. Default value is 1.\n */\n removeRows(table, options) {\n const model = this.editor.model;\n const rowsToRemove = options.rows || 1;\n const rowCount = this.getRows(table);\n const first = options.at;\n const last = first + rowsToRemove - 1;\n if (last > rowCount - 1) {\n /**\n * The `options.at` param must point at existing row and `options.rows` must not exceed the rows in the table.\n *\n * @error tableutils-removerows-row-index-out-of-range\n */\n throw new CKEditorError('tableutils-removerows-row-index-out-of-range', this, { table, options });\n }\n model.change(writer => {\n const indexesObject = { first, last };\n // Removing rows from the table require that most calculations to be done prior to changing table structure.\n // Preparations must be done in the same enqueueChange callback to use the current table structure.\n // 1. Preparation - get row-spanned cells that have to be modified after removing rows.\n const { cellsToMove, cellsToTrim } = getCellsToMoveAndTrimOnRemoveRow(table, indexesObject);\n // 2. Execution\n // 2a. Move cells from removed rows that extends over a removed section - must be done before removing rows.\n // This will fill any gaps in a rows below that previously were empty because of row-spanned cells.\n if (cellsToMove.size) {\n const rowAfterRemovedSection = last + 1;\n moveCellsToRow(table, rowAfterRemovedSection, cellsToMove, writer);\n }\n // 2b. Remove all required rows.\n for (let i = last; i >= first; i--) {\n writer.remove(table.getChild(i));\n }\n // 2c. Update cells from rows above that overlap removed section. Similar to step 2 but does not involve moving cells.\n for (const { rowspan, cell } of cellsToTrim) {\n updateNumericAttribute('rowspan', rowspan, cell, writer);\n }\n // 2d. Adjust heading rows if removed rows were in a heading section.\n updateHeadingRows(table, indexesObject, writer);\n // 2e. Remove empty columns (without anchored cells) if there are any.\n if (!removeEmptyColumns(table, this)) {\n // If there wasn't any empty columns then we still need to check if this wasn't called\n // because of cleaning empty rows and we only removed one of them.\n removeEmptyRows(table, this);\n }\n });\n }\n /**\n * Removes columns from the given `table`.\n *\n * This method re-calculates the table geometry including the `colspan` attribute of table cells overlapping removed columns\n * and table headings values.\n *\n * ```ts\n * editor.plugins.get( 'TableUtils' ).removeColumns( table, { at: 1, columns: 2 } );\n * ```\n *\n * Executing the above code in the context of the table on the left will transform its structure as presented on the right:\n *\n * 0 1 2 3 4 0 1 2\n * ┌───────────────┬───┐ ┌───────┬───┐\n * │ a │ b │ │ a │ b │\n * │ ├───┤ │ ├───┤\n * │ │ c │ │ │ c │\n * ├───┬───┬───┬───┼───┤ will give: ├───┬───┼───┤\n * │ d │ e │ f │ g │ h │ │ d │ g │ h │\n * ├───┼───┼───┤ ├───┤ ├───┤ ├───┤\n * │ i │ j │ k │ │ l │ │ i │ │ l │\n * ├───┴───┴───┴───┴───┤ ├───┴───┴───┤\n * │ m │ │ m │\n * └───────────────────┘ └───────────┘\n * ^---- remove from here, `at` = 1, `columns` = 2\n *\n * @param options.at The row index at which the removing columns will start.\n * @param options.columns The number of columns to remove.\n */\n removeColumns(table, options) {\n const model = this.editor.model;\n const first = options.at;\n const columnsToRemove = options.columns || 1;\n const last = options.at + columnsToRemove - 1;\n model.change(writer => {\n adjustHeadingColumns(table, { first, last }, writer);\n for (let removedColumnIndex = last; removedColumnIndex >= first; removedColumnIndex--) {\n for (const { cell, column, cellWidth } of [...new TableWalker(table)]) {\n // If colspaned cell overlaps removed column decrease its span.\n if (column <= removedColumnIndex && cellWidth > 1 && column + cellWidth > removedColumnIndex) {\n updateNumericAttribute('colspan', cellWidth - 1, cell, writer);\n }\n else if (column === removedColumnIndex) {\n // The cell in removed column has colspan of 1.\n writer.remove(cell);\n }\n }\n }\n // Remove empty rows that could appear after removing columns.\n if (!removeEmptyRows(table, this)) {\n // If there wasn't any empty rows then we still need to check if this wasn't called\n // because of cleaning empty columns and we only removed one of them.\n removeEmptyColumns(table, this);\n }\n });\n }\n /**\n * Divides a table cell vertically into several ones.\n *\n * The cell will be visually split into more cells by updating colspans of other cells in a column\n * and inserting cells (columns) after that cell.\n *\n * In the table below, if cell \"a\" is split into 3 cells:\n *\n * +---+---+---+\n * | a | b | c |\n * +---+---+---+\n * | d | e | f |\n * +---+---+---+\n *\n * it will result in the table below:\n *\n * +---+---+---+---+---+\n * | a | | | b | c |\n * +---+---+---+---+---+\n * | d | e | f |\n * +---+---+---+---+---+\n *\n * So cell \"d\" will get its `colspan` updated to `3` and 2 cells will be added (2 columns will be created).\n *\n * Splitting a cell that already has a `colspan` attribute set will distribute the cell `colspan` evenly and the remainder\n * will be left to the original cell:\n *\n * +---+---+---+\n * | a |\n * +---+---+---+\n * | b | c | d |\n * +---+---+---+\n *\n * Splitting cell \"a\" with `colspan=3` into 2 cells will create 1 cell with a `colspan=a` and cell \"a\" that will have `colspan=2`:\n *\n * +---+---+---+\n * | a | |\n * +---+---+---+\n * | b | c | d |\n * +---+---+---+\n */\n splitCellVertically(tableCell, numberOfCells = 2) {\n const model = this.editor.model;\n const tableRow = tableCell.parent;\n const table = tableRow.parent;\n const rowspan = parseInt(tableCell.getAttribute('rowspan') || '1');\n const colspan = parseInt(tableCell.getAttribute('colspan') || '1');\n model.change(writer => {\n // First check - the cell spans over multiple rows so before doing anything else just split this cell.\n if (colspan > 1) {\n // Get spans of new (inserted) cells and span to update of split cell.\n const { newCellsSpan, updatedSpan } = breakSpanEvenly(colspan, numberOfCells);\n updateNumericAttribute('colspan', updatedSpan, tableCell, writer);\n // Each inserted cell will have the same attributes:\n const newCellsAttributes = {};\n // Do not store default value in the model.\n if (newCellsSpan > 1) {\n newCellsAttributes.colspan = newCellsSpan;\n }\n // Copy rowspan of split cell.\n if (rowspan > 1) {\n newCellsAttributes.rowspan = rowspan;\n }\n const cellsToInsert = colspan > numberOfCells ? numberOfCells - 1 : colspan - 1;\n createCells(cellsToInsert, writer, writer.createPositionAfter(tableCell), newCellsAttributes);\n }\n // Second check - the cell has colspan of 1 or we need to create more cells then the currently one spans over.\n if (colspan < numberOfCells) {\n const cellsToInsert = numberOfCells - colspan;\n // First step: expand cells on the same column as split cell.\n const tableMap = [...new TableWalker(table)];\n // Get the column index of split cell.\n const { column: splitCellColumn } = tableMap.find(({ cell }) => cell === tableCell);\n // Find cells which needs to be expanded vertically - those on the same column or those that spans over split cell's column.\n const cellsToUpdate = tableMap.filter(({ cell, cellWidth, column }) => {\n const isOnSameColumn = cell !== tableCell && column === splitCellColumn;\n const spansOverColumn = (column < splitCellColumn && column + cellWidth > splitCellColumn);\n return isOnSameColumn || spansOverColumn;\n });\n // Expand cells vertically.\n for (const { cell, cellWidth } of cellsToUpdate) {\n writer.setAttribute('colspan', cellWidth + cellsToInsert, cell);\n }\n // Second step: create columns after split cell.\n // Each inserted cell will have the same attributes:\n const newCellsAttributes = {};\n // Do not store default value in the model.\n // Copy rowspan of split cell.\n if (rowspan > 1) {\n newCellsAttributes.rowspan = rowspan;\n }\n createCells(cellsToInsert, writer, writer.createPositionAfter(tableCell), newCellsAttributes);\n const headingColumns = table.getAttribute('headingColumns') || 0;\n // Update heading section if split cell is in heading section.\n if (headingColumns > splitCellColumn) {\n updateNumericAttribute('headingColumns', headingColumns + cellsToInsert, table, writer);\n }\n }\n });\n }\n /**\n * Divides a table cell horizontally into several ones.\n *\n * The cell will be visually split into more cells by updating rowspans of other cells in the row and inserting rows with a single cell\n * below.\n *\n * If in the table below cell \"b\" is split into 3 cells:\n *\n * +---+---+---+\n * | a | b | c |\n * +---+---+---+\n * | d | e | f |\n * +---+---+---+\n *\n * It will result in the table below:\n *\n * +---+---+---+\n * | a | b | c |\n * + +---+ +\n * | | | |\n * + +---+ +\n * | | | |\n * +---+---+---+\n * | d | e | f |\n * +---+---+---+\n *\n * So cells \"a\" and \"b\" will get their `rowspan` updated to `3` and 2 rows with a single cell will be added.\n *\n * Splitting a cell that already has a `rowspan` attribute set will distribute the cell `rowspan` evenly and the remainder\n * will be left to the original cell:\n *\n * +---+---+---+\n * | a | b | c |\n * + +---+---+\n * | | d | e |\n * + +---+---+\n * | | f | g |\n * + +---+---+\n * | | h | i |\n * +---+---+---+\n *\n * Splitting cell \"a\" with `rowspan=4` into 3 cells will create 2 cells with a `rowspan=1` and cell \"a\" will have `rowspan=2`:\n *\n * +---+---+---+\n * | a | b | c |\n * + +---+---+\n * | | d | e |\n * +---+---+---+\n * | | f | g |\n * +---+---+---+\n * | | h | i |\n * +---+---+---+\n */\n splitCellHorizontally(tableCell, numberOfCells = 2) {\n const model = this.editor.model;\n const tableRow = tableCell.parent;\n const table = tableRow.parent;\n const splitCellRow = table.getChildIndex(tableRow);\n const rowspan = parseInt(tableCell.getAttribute('rowspan') || '1');\n const colspan = parseInt(tableCell.getAttribute('colspan') || '1');\n model.change(writer => {\n // First check - the cell spans over multiple rows so before doing anything else just split this cell.\n if (rowspan > 1) {\n // Cache table map before updating table.\n const tableMap = [...new TableWalker(table, {\n startRow: splitCellRow,\n endRow: splitCellRow + rowspan - 1,\n includeAllSlots: true\n })];\n // Get spans of new (inserted) cells and span to update of split cell.\n const { newCellsSpan, updatedSpan } = breakSpanEvenly(rowspan, numberOfCells);\n updateNumericAttribute('rowspan', updatedSpan, tableCell, writer);\n const { column: cellColumn } = tableMap.find(({ cell }) => cell === tableCell);\n // Each inserted cell will have the same attributes:\n const newCellsAttributes = {};\n // Do not store default value in the model.\n if (newCellsSpan > 1) {\n newCellsAttributes.rowspan = newCellsSpan;\n }\n // Copy colspan of split cell.\n if (colspan > 1) {\n newCellsAttributes.colspan = colspan;\n }\n for (const tableSlot of tableMap) {\n const { column, row } = tableSlot;\n // As both newly created cells and the split cell might have rowspan,\n // the insertion of new cells must go to appropriate rows:\n //\n // 1. It's a row after split cell + it's height.\n const isAfterSplitCell = row >= splitCellRow + updatedSpan;\n // 2. Is on the same column.\n const isOnSameColumn = column === cellColumn;\n // 3. And it's row index is after previous cell height.\n const isInEvenlySplitRow = (row + splitCellRow + updatedSpan) % newCellsSpan === 0;\n if (isAfterSplitCell && isOnSameColumn && isInEvenlySplitRow) {\n createCells(1, writer, tableSlot.getPositionBefore(), newCellsAttributes);\n }\n }\n }\n // Second check - the cell has rowspan of 1 or we need to create more cells than the current cell spans over.\n if (rowspan < numberOfCells) {\n // We already split the cell in check one so here we split to the remaining number of cells only.\n const cellsToInsert = numberOfCells - rowspan;\n // This check is needed since we need to check if there are any cells from previous rows than spans over this cell's row.\n const tableMap = [...new TableWalker(table, { startRow: 0, endRow: splitCellRow })];\n // First step: expand cells.\n for (const { cell, cellHeight, row } of tableMap) {\n // Expand rowspan of cells that are either:\n // - on the same row as current cell,\n // - or are below split cell row and overlaps that row.\n if (cell !== tableCell && row + cellHeight > splitCellRow) {\n const rowspanToSet = cellHeight + cellsToInsert;\n writer.setAttribute('rowspan', rowspanToSet, cell);\n }\n }\n // Second step: create rows with single cell below split cell.\n const newCellsAttributes = {};\n // Copy colspan of split cell.\n if (colspan > 1) {\n newCellsAttributes.colspan = colspan;\n }\n createEmptyRows(writer, table, splitCellRow + 1, cellsToInsert, 1, newCellsAttributes);\n // Update heading section if split cell is in heading section.\n const headingRows = table.getAttribute('headingRows') || 0;\n if (headingRows > splitCellRow) {\n updateNumericAttribute('headingRows', headingRows + cellsToInsert, table, writer);\n }\n }\n });\n }\n /**\n * Returns the number of columns for a given table.\n *\n * ```ts\n * editor.plugins.get( 'TableUtils' ).getColumns( table );\n * ```\n *\n * @param table The table to analyze.\n */\n getColumns(table) {\n // Analyze first row only as all the rows should have the same width.\n // Using the first row without checking if it's a tableRow because we expect\n // that table will have only tableRow model elements at the beginning.\n const row = table.getChild(0);\n return [...row.getChildren()].reduce((columns, row) => {\n const columnWidth = parseInt(row.getAttribute('colspan') || '1');\n return columns + columnWidth;\n }, 0);\n }\n /**\n * Returns the number of rows for a given table. Any other element present in the table model is omitted.\n *\n * ```ts\n * editor.plugins.get( 'TableUtils' ).getRows( table );\n * ```\n *\n * @param table The table to analyze.\n */\n getRows(table) {\n // Rowspan not included due to #6427.\n return Array.from(table.getChildren())\n .reduce((rowCount, child) => child.is('element', 'tableRow') ? rowCount + 1 : rowCount, 0);\n }\n /**\n * Creates an instance of the table walker.\n *\n * The table walker iterates internally by traversing the table from row index = 0 and column index = 0.\n * It walks row by row and column by column in order to output values defined in the options.\n * By default it will output only the locations that are occupied by a cell. To include also spanned rows and columns,\n * pass the `includeAllSlots` option.\n *\n * @internal\n * @param table A table over which the walker iterates.\n * @param options An object with configuration.\n */\n createTableWalker(table, options = {}) {\n return new TableWalker(table, options);\n }\n /**\n * Returns all model table cells that are fully selected (from the outside)\n * within the provided model selection's ranges.\n *\n * To obtain the cells selected from the inside, use\n * {@link #getTableCellsContainingSelection}.\n */\n getSelectedTableCells(selection) {\n const cells = [];\n for (const range of this.sortRanges(selection.getRanges())) {\n const element = range.getContainedElement();\n if (element && element.is('element', 'tableCell')) {\n cells.push(element);\n }\n }\n return cells;\n }\n /**\n * Returns all model table cells that the provided model selection's ranges\n * {@link module:engine/model/range~Range#start} inside.\n *\n * To obtain the cells selected from the outside, use\n * {@link #getSelectedTableCells}.\n */\n getTableCellsContainingSelection(selection) {\n const cells = [];\n for (const range of selection.getRanges()) {\n const cellWithSelection = range.start.findAncestor('tableCell');\n if (cellWithSelection) {\n cells.push(cellWithSelection);\n }\n }\n return cells;\n }\n /**\n * Returns all model table cells that are either completely selected\n * by selection ranges or host selection range\n * {@link module:engine/model/range~Range#start start positions} inside them.\n *\n * Combines {@link #getTableCellsContainingSelection} and\n * {@link #getSelectedTableCells}.\n */\n getSelectionAffectedTableCells(selection) {\n const selectedCells = this.getSelectedTableCells(selection);\n if (selectedCells.length) {\n return selectedCells;\n }\n return this.getTableCellsContainingSelection(selection);\n }\n /**\n * Returns an object with the `first` and `last` row index contained in the given `tableCells`.\n *\n * ```ts\n * const selectedTableCells = getSelectedTableCells( editor.model.document.selection );\n *\n * const { first, last } = getRowIndexes( selectedTableCells );\n *\n * console.log( `Selected rows: ${ first } to ${ last }` );\n * ```\n *\n * @returns Returns an object with the `first` and `last` table row indexes.\n */\n getRowIndexes(tableCells) {\n const indexes = tableCells.map(cell => cell.parent.index);\n return this._getFirstLastIndexesObject(indexes);\n }\n /**\n * Returns an object with the `first` and `last` column index contained in the given `tableCells`.\n *\n * ```ts\n * const selectedTableCells = getSelectedTableCells( editor.model.document.selection );\n *\n * const { first, last } = getColumnIndexes( selectedTableCells );\n *\n * console.log( `Selected columns: ${ first } to ${ last }` );\n * ```\n *\n * @returns Returns an object with the `first` and `last` table column indexes.\n */\n getColumnIndexes(tableCells) {\n const table = tableCells[0].findAncestor('table');\n const tableMap = [...new TableWalker(table)];\n const indexes = tableMap\n .filter(entry => tableCells.includes(entry.cell))\n .map(entry => entry.column);\n return this._getFirstLastIndexesObject(indexes);\n }\n /**\n * Checks if the selection contains cells that do not exceed rectangular selection.\n *\n * In a table below:\n *\n * ┌───┬───┬───┬───┐\n * │ a │ b │ c │ d │\n * ├───┴───┼───┤ │\n * │ e │ f │ │\n * │ ├───┼───┤\n * │ │ g │ h │\n * └───────┴───┴───┘\n *\n * Valid selections are these which create a solid rectangle (without gaps), such as:\n * - a, b (two horizontal cells)\n * - c, f (two vertical cells)\n * - a, b, e (cell \"e\" spans over four cells)\n * - c, d, f (cell d spans over a cell in the row below)\n *\n * While an invalid selection would be:\n * - a, c (the unselected cell \"b\" creates a gap)\n * - f, g, h (cell \"d\" spans over a cell from the row of \"f\" cell - thus creates a gap)\n */\n isSelectionRectangular(selectedTableCells) {\n if (selectedTableCells.length < 2 || !this._areCellInTheSameTableSection(selectedTableCells)) {\n return false;\n }\n // A valid selection is a fully occupied rectangle composed of table cells.\n // Below we will calculate the area of a selected table cells and the area of valid selection.\n // The area of a valid selection is defined by top-left and bottom-right cells.\n const rows = new Set();\n const columns = new Set();\n let areaOfSelectedCells = 0;\n for (const tableCell of selectedTableCells) {\n const { row, column } = this.getCellLocation(tableCell);\n const rowspan = parseInt(tableCell.getAttribute('rowspan')) || 1;\n const colspan = parseInt(tableCell.getAttribute('colspan')) || 1;\n // Record row & column indexes of current cell.\n rows.add(row);\n columns.add(column);\n // For cells that spans over multiple rows add also the last row that this cell spans over.\n if (rowspan > 1) {\n rows.add(row + rowspan - 1);\n }\n // For cells that spans over multiple columns add also the last column that this cell spans over.\n if (colspan > 1) {\n columns.add(column + colspan - 1);\n }\n areaOfSelectedCells += (rowspan * colspan);\n }\n // We can only merge table cells that are in adjacent rows...\n const areaOfValidSelection = getBiggestRectangleArea(rows, columns);\n return areaOfValidSelection == areaOfSelectedCells;\n }\n /**\n * Returns array of sorted ranges.\n */\n sortRanges(ranges) {\n return Array.from(ranges).sort(compareRangeOrder);\n }\n /**\n * Helper method to get an object with `first` and `last` indexes from an unsorted array of indexes.\n */\n _getFirstLastIndexesObject(indexes) {\n const allIndexesSorted = indexes.sort((indexA, indexB) => indexA - indexB);\n const first = allIndexesSorted[0];\n const last = allIndexesSorted[allIndexesSorted.length - 1];\n return { first, last };\n }\n /**\n * Checks if the selection does not mix a header (column or row) with other cells.\n *\n * For instance, in the table below valid selections consist of cells with the same letter only.\n * So, a-a (same heading row and column) or d-d (body cells) are valid while c-d or a-b are not.\n *\n * header columns\n * ↓ ↓\n * ┌───┬───┬───┬───┐\n * │ a │ a │ b │ b │ ← header row\n * ├───┼───┼───┼───┤\n * │ c │ c │ d │ d │\n * ├───┼───┼───┼───┤\n * │ c │ c │ d │ d │\n * └───┴───┴───┴───┘\n */\n _areCellInTheSameTableSection(tableCells) {\n const table = tableCells[0].findAncestor('table');\n const rowIndexes = this.getRowIndexes(tableCells);\n const headingRows = parseInt(table.getAttribute('headingRows')) || 0;\n // Calculating row indexes is a bit cheaper so if this check fails we can't merge.\n if (!this._areIndexesInSameSection(rowIndexes, headingRows)) {\n return false;\n }\n const columnIndexes = this.getColumnIndexes(tableCells);\n const headingColumns = parseInt(table.getAttribute('headingColumns')) || 0;\n // Similarly cells must be in same column section.\n return this._areIndexesInSameSection(columnIndexes, headingColumns);\n }\n /**\n * Unified check if table rows/columns indexes are in the same heading/body section.\n */\n _areIndexesInSameSection({ first, last }, headingSectionSize) {\n const firstCellIsInHeading = first < headingSectionSize;\n const lastCellIsInHeading = last < headingSectionSize;\n return firstCellIsInHeading === lastCellIsInHeading;\n }\n}\n/**\n * Creates empty rows at the given index in an existing table.\n *\n * @param insertAt The row index of row insertion.\n * @param rows The number of rows to create.\n * @param tableCellToInsert The number of cells to insert in each row.\n */\nfunction createEmptyRows(writer, table, insertAt, rows, tableCellToInsert, attributes = {}) {\n for (let i = 0; i < rows; i++) {\n const tableRow = writer.createElement('tableRow');\n writer.insert(tableRow, table, insertAt);\n createCells(tableCellToInsert, writer, writer.createPositionAt(tableRow, 'end'), attributes);\n }\n}\n/**\n * Creates cells at a given position.\n *\n * @param cells The number of cells to create\n */\nfunction createCells(cells, writer, insertPosition, attributes = {}) {\n for (let i = 0; i < cells; i++) {\n createEmptyTableCell(writer, insertPosition, attributes);\n }\n}\n/**\n * Evenly distributes the span of a cell to a number of provided cells.\n * The resulting spans will always be integer values.\n *\n * For instance breaking a span of 7 into 3 cells will return:\n *\n * ```ts\n * { newCellsSpan: 2, updatedSpan: 3 }\n * ```\n *\n * as two cells will have a span of 2 and the remainder will go the first cell so its span will change to 3.\n *\n * @param span The span value do break.\n * @param numberOfCells The number of resulting spans.\n */\nfunction breakSpanEvenly(span, numberOfCells) {\n if (span < numberOfCells) {\n return { newCellsSpan: 1, updatedSpan: 1 };\n }\n const newCellsSpan = Math.floor(span / numberOfCells);\n const updatedSpan = (span - newCellsSpan * numberOfCells) + newCellsSpan;\n return { newCellsSpan, updatedSpan };\n}\n/**\n * Updates heading columns attribute if removing a row from head section.\n */\nfunction adjustHeadingColumns(table, removedColumnIndexes, writer) {\n const headingColumns = table.getAttribute('headingColumns') || 0;\n if (headingColumns && removedColumnIndexes.first < headingColumns) {\n const headingsRemoved = Math.min(headingColumns - 1 /* Other numbers are 0-based */, removedColumnIndexes.last) -\n removedColumnIndexes.first + 1;\n writer.setAttribute('headingColumns', headingColumns - headingsRemoved, table);\n }\n}\n/**\n * Calculates a new heading rows value for removing rows from heading section.\n */\nfunction updateHeadingRows(table, { first, last }, writer) {\n const headingRows = table.getAttribute('headingRows') || 0;\n if (first < headingRows) {\n const newRows = last < headingRows ? headingRows - (last - first + 1) : first;\n updateNumericAttribute('headingRows', newRows, table, writer, 0);\n }\n}\n/**\n * Finds cells that will be:\n * - trimmed - Cells that are \"above\" removed rows sections and overlap the removed section - their rowspan must be trimmed.\n * - moved - Cells from removed rows section might stick out of. These cells are moved to the next row after a removed section.\n *\n * Sample table with overlapping & sticking out cells:\n *\n * +----+----+----+----+----+\n * | 00 | 01 | 02 | 03 | 04 |\n * +----+ + + + +\n * | 10 | | | | |\n * +----+----+ + + +\n * | 20 | 21 | | | | <-- removed row\n * + + +----+ + +\n * | | | 32 | | | <-- removed row\n * +----+ + +----+ +\n * | 40 | | | 43 | |\n * +----+----+----+----+----+\n *\n * In a table above:\n * - cells to trim: '02', '03' & '04'.\n * - cells to move: '21' & '32'.\n */\nfunction getCellsToMoveAndTrimOnRemoveRow(table, { first, last }) {\n const cellsToMove = new Map();\n const cellsToTrim = [];\n for (const { row, column, cellHeight, cell } of new TableWalker(table, { endRow: last })) {\n const lastRowOfCell = row + cellHeight - 1;\n const isCellStickingOutFromRemovedRows = row >= first && row <= last && lastRowOfCell > last;\n if (isCellStickingOutFromRemovedRows) {\n const rowspanInRemovedSection = last - row + 1;\n const rowSpanToSet = cellHeight - rowspanInRemovedSection;\n cellsToMove.set(column, {\n cell,\n rowspan: rowSpanToSet\n });\n }\n const isCellOverlappingRemovedRows = row < first && lastRowOfCell >= first;\n if (isCellOverlappingRemovedRows) {\n let rowspanAdjustment;\n // Cell fully covers removed section - trim it by removed rows count.\n if (lastRowOfCell >= last) {\n rowspanAdjustment = last - first + 1;\n }\n // Cell partially overlaps removed section - calculate cell's span that is in removed section.\n else {\n rowspanAdjustment = lastRowOfCell - first + 1;\n }\n cellsToTrim.push({\n cell,\n rowspan: cellHeight - rowspanAdjustment\n });\n }\n }\n return { cellsToMove, cellsToTrim };\n}\nfunction moveCellsToRow(table, targetRowIndex, cellsToMove, writer) {\n const tableWalker = new TableWalker(table, {\n includeAllSlots: true,\n row: targetRowIndex\n });\n const tableRowMap = [...tableWalker];\n const row = table.getChild(targetRowIndex);\n let previousCell;\n for (const { column, cell, isAnchor } of tableRowMap) {\n if (cellsToMove.has(column)) {\n const { cell: cellToMove, rowspan } = cellsToMove.get(column);\n const targetPosition = previousCell ?\n writer.createPositionAfter(previousCell) :\n writer.createPositionAt(row, 0);\n writer.move(writer.createRangeOn(cellToMove), targetPosition);\n updateNumericAttribute('rowspan', rowspan, cellToMove, writer);\n previousCell = cellToMove;\n }\n else if (isAnchor) {\n // If cell is spanned then `cell` holds reference to overlapping cell. See ckeditor/ckeditor5#6502.\n previousCell = cell;\n }\n }\n}\nfunction compareRangeOrder(rangeA, rangeB) {\n // Since table cell ranges are disjoint, it's enough to check their start positions.\n const posA = rangeA.start;\n const posB = rangeB.start;\n // Checking for equal position (returning 0) is not needed because this would be either:\n // a. Intersecting range (not allowed by model)\n // b. Collapsed range on the same position (allowed by model but should not happen).\n return posA.isBefore(posB) ? -1 : 1;\n}\n/**\n * Calculates the area of a maximum rectangle that can span over the provided row & column indexes.\n */\nfunction getBiggestRectangleArea(rows, columns) {\n const rowsIndexes = Array.from(rows.values());\n const columnIndexes = Array.from(columns.values());\n const lastRow = Math.max(...rowsIndexes);\n const firstRow = Math.min(...rowsIndexes);\n const lastColumn = Math.max(...columnIndexes);\n const firstColumn = Math.min(...columnIndexes);\n return (lastRow - firstRow + 1) * (lastColumn - firstColumn + 1);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core';\nimport TableUtils from '../tableutils';\nimport { updateNumericAttribute } from '../utils/common';\nimport { removeEmptyRowsColumns } from '../utils/structure';\n/**\n * The merge cells command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'mergeTableCells'` editor command.\n *\n * For example, to merge selected table cells:\n *\n * ```ts\n * editor.execute( 'mergeTableCells' );\n * ```\n */\nexport default class MergeCellsCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const tableUtils = this.editor.plugins.get(TableUtils);\n const selectedTableCells = tableUtils.getSelectedTableCells(this.editor.model.document.selection);\n this.isEnabled = tableUtils.isSelectionRectangular(selectedTableCells);\n }\n /**\n * Executes the command.\n *\n * @fires execute\n */\n execute() {\n const model = this.editor.model;\n const tableUtils = this.editor.plugins.get(TableUtils);\n model.change(writer => {\n const selectedTableCells = tableUtils.getSelectedTableCells(model.document.selection);\n // All cells will be merged into the first one.\n const firstTableCell = selectedTableCells.shift();\n // Update target cell dimensions.\n const { mergeWidth, mergeHeight } = getMergeDimensions(firstTableCell, selectedTableCells, tableUtils);\n updateNumericAttribute('colspan', mergeWidth, firstTableCell, writer);\n updateNumericAttribute('rowspan', mergeHeight, firstTableCell, writer);\n for (const tableCell of selectedTableCells) {\n mergeTableCells(tableCell, firstTableCell, writer);\n }\n const table = firstTableCell.findAncestor('table');\n // Remove rows and columns that become empty (have no anchored cells).\n removeEmptyRowsColumns(table, tableUtils);\n writer.setSelection(firstTableCell, 'in');\n });\n }\n}\n/**\n * Merges two table cells. It will ensure that after merging cells with empty paragraphs the resulting table cell will only have one\n * paragraph. If one of the merged table cells is empty, the merged table cell will have contents of the non-empty table cell.\n * If both are empty, the merged table cell will have only one empty paragraph.\n */\nfunction mergeTableCells(cellBeingMerged, targetCell, writer) {\n if (!isEmpty(cellBeingMerged)) {\n if (isEmpty(targetCell)) {\n writer.remove(writer.createRangeIn(targetCell));\n }\n writer.move(writer.createRangeIn(cellBeingMerged), writer.createPositionAt(targetCell, 'end'));\n }\n // Remove merged table cell.\n writer.remove(cellBeingMerged);\n}\n/**\n * Checks if the passed table cell contains an empty paragraph.\n */\nfunction isEmpty(tableCell) {\n const firstTableChild = tableCell.getChild(0);\n return tableCell.childCount == 1 && firstTableChild.is('element', 'paragraph') && firstTableChild.isEmpty;\n}\nfunction getMergeDimensions(firstTableCell, selectedTableCells, tableUtils) {\n let maxWidthOffset = 0;\n let maxHeightOffset = 0;\n for (const tableCell of selectedTableCells) {\n const { row, column } = tableUtils.getCellLocation(tableCell);\n maxWidthOffset = getMaxOffset(tableCell, column, maxWidthOffset, 'colspan');\n maxHeightOffset = getMaxOffset(tableCell, row, maxHeightOffset, 'rowspan');\n }\n // Update table cell span attribute and merge set selection on a merged contents.\n const { row: firstCellRow, column: firstCellColumn } = tableUtils.getCellLocation(firstTableCell);\n const mergeWidth = maxWidthOffset - firstCellColumn;\n const mergeHeight = maxHeightOffset - firstCellRow;\n return { mergeWidth, mergeHeight };\n}\nfunction getMaxOffset(tableCell, start, currentMaxOffset, which) {\n const dimensionValue = parseInt(tableCell.getAttribute(which) || '1');\n return Math.max(currentMaxOffset, start + dimensionValue);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/commands/selectrowcommand\n */\nimport { Command } from 'ckeditor5/src/core';\n/**\n * The select row command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'selectTableRow'` editor command.\n *\n * To select the rows containing the selected cells, execute the command:\n *\n * ```ts\n * editor.execute( 'selectTableRow' );\n * ```\n */\nexport default class SelectRowCommand extends Command {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n // It does not affect data so should be enabled in read-only mode.\n this.affectsData = false;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const tableUtils = this.editor.plugins.get('TableUtils');\n const selectedCells = tableUtils.getSelectionAffectedTableCells(this.editor.model.document.selection);\n this.isEnabled = selectedCells.length > 0;\n }\n /**\n * @inheritDoc\n */\n execute() {\n const model = this.editor.model;\n const tableUtils = this.editor.plugins.get('TableUtils');\n const referenceCells = tableUtils.getSelectionAffectedTableCells(model.document.selection);\n const rowIndexes = tableUtils.getRowIndexes(referenceCells);\n const table = referenceCells[0].findAncestor('table');\n const rangesToSelect = [];\n for (let rowIndex = rowIndexes.first; rowIndex <= rowIndexes.last; rowIndex++) {\n for (const cell of table.getChild(rowIndex).getChildren()) {\n rangesToSelect.push(model.createRangeOn(cell));\n }\n }\n model.change(writer => {\n writer.setSelection(rangesToSelect);\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/commands/selectcolumncommand\n */\nimport { Command } from 'ckeditor5/src/core';\nimport TableWalker from '../tablewalker';\n/**\n * The select column command.\n *\n * The command is registered by {@link module:table/tableediting~TableEditing} as the `'selectTableColumn'` editor command.\n *\n * To select the columns containing the selected cells, execute the command:\n *\n * ```ts\n * editor.execute( 'selectTableColumn' );\n * ```\n */\nexport default class SelectColumnCommand extends Command {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n // It does not affect data so should be enabled in read-only mode.\n this.affectsData = false;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const tableUtils = this.editor.plugins.get('TableUtils');\n const selectedCells = tableUtils.getSelectionAffectedTableCells(this.editor.model.document.selection);\n this.isEnabled = selectedCells.length > 0;\n }\n /**\n * @inheritDoc\n */\n execute() {\n const tableUtils = this.editor.plugins.get('TableUtils');\n const model = this.editor.model;\n const referenceCells = tableUtils.getSelectionAffectedTableCells(model.document.selection);\n const firstCell = referenceCells[0];\n const lastCell = referenceCells.pop();\n const table = firstCell.findAncestor('table');\n const startLocation = tableUtils.getCellLocation(firstCell);\n const endLocation = tableUtils.getCellLocation(lastCell);\n const startColumn = Math.min(startLocation.column, endLocation.column);\n const endColumn = Math.max(startLocation.column, endLocation.column);\n const rangesToSelect = [];\n for (const cellInfo of new TableWalker(table, { startColumn, endColumn })) {\n rangesToSelect.push(model.createRangeOn(cellInfo.cell));\n }\n model.change(writer => {\n writer.setSelection(rangesToSelect);\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TableWalker from './../tablewalker';\nimport { createEmptyTableCell, updateNumericAttribute } from '../utils/common';\n/**\n * Injects a table layout post-fixer into the model.\n *\n * The role of the table layout post-fixer is to ensure that the table rows have the correct structure\n * after a {@link module:engine/model/model~Model#change `change()`} block was executed.\n *\n * The correct structure means that:\n *\n * * All table rows have the same size.\n * * None of the table cells extend vertically beyond their section (either header or body).\n * * A table cell has always at least one element as a child.\n *\n * If the table structure is not correct, the post-fixer will automatically correct it in two steps:\n *\n * 1. It will clip table cells that extend beyond their section.\n * 2. It will add empty table cells to the rows that are narrower than the widest table row.\n *\n * ## Clipping overlapping table cells\n *\n * Such situation may occur when pasting a table (or a part of a table) to the editor from external sources.\n *\n * For example, see the following table which has a cell (FOO) with the rowspan attribute (2):\n *\n * ```xml\n * <table headingRows=\"1\">\n * <tableRow>\n * <tableCell rowspan=\"2\"><paragraph>FOO</paragraph></tableCell>\n * <tableCell colspan=\"2\"><paragraph>BAR</paragraph></tableCell>\n * </tableRow>\n * <tableRow>\n * <tableCell><paragraph>BAZ</paragraph></tableCell>\n * <tableCell><paragraph>XYZ</paragraph></tableCell>\n * </tableRow>\n * </table>\n * ```\n *\n * It will be rendered in the view as:\n *\n * ```xml\n * <table>\n * <thead>\n * <tr>\n * <td rowspan=\"2\">FOO</td>\n * <td colspan=\"2\">BAR</td>\n * </tr>\n * </thead>\n * <tbody>\n * <tr>\n * <td>BAZ</td>\n * <td>XYZ</td>\n * </tr>\n * </tbody>\n * </table>\n * ```\n *\n * In the above example the table will be rendered as a table with two rows: one in the header and second one in the body.\n * The table cell (FOO) cannot span over multiple rows as it would extend from the header to the body section.\n * The `rowspan` attribute must be changed to (1). The value (1) is the default value of the `rowspan` attribute\n * so the `rowspan` attribute will be removed from the model.\n *\n * The table cell with BAZ in the content will be in the first column of the table.\n *\n * ## Adding missing table cells\n *\n * The table post-fixer will insert empty table cells to equalize table row sizes (the number of columns).\n * The size of a table row is calculated by counting column spans of table cells, both horizontal (from the same row) and\n * vertical (from the rows above).\n *\n * In the above example, the table row in the body section of the table is narrower then the row from the header: it has two cells\n * with the default colspan (1). The header row has one cell with colspan (1) and the second with colspan (2).\n * The table cell (FOO) does not extend beyond the head section (and as such will be fixed in the first step of this post-fixer).\n * The post-fixer will add a missing table cell to the row in the body section of the table.\n *\n * The table from the above example will be fixed and rendered to the view as below:\n *\n * ```xml\n * <table>\n * <thead>\n * <tr>\n * <td rowspan=\"2\">FOO</td>\n * <td colspan=\"2\">BAR</td>\n * </tr>\n * </thead>\n * <tbody>\n * <tr>\n * <td>BAZ</td>\n * <td>XYZ</td>\n * </tr>\n * </tbody>\n * </table>\n * ```\n *\n * ## Collaboration and undo - Expectations vs post-fixer results\n *\n * The table post-fixer only ensures proper structure without a deeper analysis of the nature of the change. As such, it might lead\n * to a structure which was not intended by the user. In particular, it will also fix undo steps (in conjunction with collaboration)\n * in which the editor content might not return to the original state.\n *\n * This will usually happen when one or more users change the size of the table.\n *\n * As an example see the table below:\n *\n * ```xml\n * <table>\n * <tbody>\n * <tr>\n * <td>11</td>\n * <td>12</td>\n * </tr>\n * <tr>\n * <td>21</td>\n * <td>22</td>\n * </tr>\n * </tbody>\n * </table>\n * ```\n *\n * and the user actions:\n *\n * 1. Both users have a table with two rows and two columns.\n * 2. User A adds a column at the end of the table. This will insert empty table cells to two rows.\n * 3. User B adds a row at the end of the table. This will insert a row with two empty table cells.\n * 4. Both users will have a table as below:\n *\n * ```xml\n * <table>\n * <tbody>\n * <tr>\n * <td>11</td>\n * <td>12</td>\n * <td>(empty, inserted by A)</td>\n * </tr>\n * <tr>\n * <td>21</td>\n * <td>22</td>\n * <td>(empty, inserted by A)</td>\n * </tr>\n * <tr>\n * <td>(empty, inserted by B)</td>\n * <td>(empty, inserted by B)</td>\n * </tr>\n * </tbody>\n * </table>\n * ```\n *\n * The last row is shorter then others so the table post-fixer will add an empty row to the last row:\n *\n * ```xml\n * <table>\n * <tbody>\n * <tr>\n * <td>11</td>\n * <td>12</td>\n * <td>(empty, inserted by A)</td>\n * </tr>\n * <tr>\n * <td>21</td>\n * <td>22</td>\n * <td>(empty, inserted by A)</td>\n * </tr>\n * <tr>\n * <td>(empty, inserted by B)</td>\n * <td>(empty, inserted by B)</td>\n * <td>(empty, inserted by the post-fixer)</td>\n * </tr>\n * </tbody>\n * </table>\n * ```\n *\n * Unfortunately undo does not know the nature of the changes and depending on which user applies the post-fixer changes, undoing them\n * might lead to a broken table. If User B undoes inserting the column to the table, the undo engine will undo only the operations of\n * inserting empty cells to rows from the initial table state (row 1 and 2) but the cell in the post-fixed row will remain:\n *\n * ```xml\n * <table>\n * <tbody>\n * <tr>\n * <td>11</td>\n * <td>12</td>\n * </tr>\n * <tr>\n * <td>21</td>\n * <td>22</td>\n * </tr>\n * <tr>\n * <td>(empty, inserted by B)</td>\n * <td>(empty, inserted by B)</td>\n * <td>(empty, inserted by a post-fixer)</td>\n * </tr>\n * </tbody>\n * </table>\n * ```\n *\n * After undo, the table post-fixer will detect that two rows are shorter than others and will fix the table to:\n *\n * ```xml\n * <table>\n * <tbody>\n * <tr>\n * <td>11</td>\n * <td>12</td>\n * <td>(empty, inserted by a post-fixer after undo)</td>\n * </tr>\n * <tr>\n * <td>21</td>\n * <td>22</td>\n * <td>(empty, inserted by a post-fixer after undo)</td>\n * </tr>\n * <tr>\n * <td>(empty, inserted by B)</td>\n * <td>(empty, inserted by B)</td>\n * <td>(empty, inserted by a post-fixer)</td>\n * </tr>\n * </tbody>\n * </table>\n * ```\n */\nexport default function injectTableLayoutPostFixer(model) {\n model.document.registerPostFixer(writer => tableLayoutPostFixer(writer, model));\n}\n/**\n * The table layout post-fixer.\n */\nfunction tableLayoutPostFixer(writer, model) {\n const changes = model.document.differ.getChanges();\n let wasFixed = false;\n // Do not analyze the same table more then once - may happen for multiple changes in the same table.\n const analyzedTables = new Set();\n for (const entry of changes) {\n let table = null;\n if (entry.type == 'insert' && entry.name == 'table') {\n table = entry.position.nodeAfter;\n }\n // Fix table on adding/removing table cells and rows.\n if ((entry.type == 'insert' || entry.type == 'remove') && (entry.name == 'tableRow' || entry.name == 'tableCell')) {\n table = entry.position.findAncestor('table');\n }\n // Fix table on any table's attribute change - including attributes of table cells.\n if (isTableAttributeEntry(entry)) {\n table = entry.range.start.findAncestor('table');\n }\n if (table && !analyzedTables.has(table)) {\n // Step 1: correct rowspans of table cells if necessary.\n // The wasFixed flag should be true if any of tables in batch was fixed - might be more then one.\n wasFixed = fixTableCellsRowspan(table, writer) || wasFixed;\n // Step 2: fix table rows sizes.\n wasFixed = fixTableRowsSizes(table, writer) || wasFixed;\n analyzedTables.add(table);\n }\n }\n return wasFixed;\n}\n/**\n * Fixes the invalid value of the `rowspan` attribute because a table cell cannot vertically extend beyond the table section it belongs to.\n *\n * @returns Returns `true` if the table was fixed.\n */\nfunction fixTableCellsRowspan(table, writer) {\n let wasFixed = false;\n const cellsToTrim = findCellsToTrim(table);\n if (cellsToTrim.length) {\n // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: trimming cells row-spans (${ cellsToTrim.length }).` );\n wasFixed = true;\n for (const data of cellsToTrim) {\n updateNumericAttribute('rowspan', data.rowspan, data.cell, writer, 1);\n }\n }\n return wasFixed;\n}\n/**\n * Makes all table rows in a table the same size.\n *\n * @returns Returns `true` if the table was fixed.\n */\nfunction fixTableRowsSizes(table, writer) {\n let wasFixed = false;\n const childrenLengths = getChildrenLengths(table);\n const rowsToRemove = [];\n // Find empty rows.\n for (const [rowIndex, size] of childrenLengths.entries()) {\n // Ignore all non-row models.\n if (!size && table.getChild(rowIndex).is('element', 'tableRow')) {\n rowsToRemove.push(rowIndex);\n }\n }\n // Remove empty rows.\n if (rowsToRemove.length) {\n // @if CK_DEBUG_TABLE // console.log( `Post-fixing table: remove empty rows (${ rowsToRemove.length }).` );\n wasFixed = true;\n for (const rowIndex of rowsToRemove.reverse()) {\n writer.remove(table.getChild(rowIndex));\n childrenLengths.splice(rowIndex, 1);\n }\n }\n // Filter out everything that's not a table row.\n const rowsLengths = childrenLengths.filter((row, rowIndex) => table.getChild(rowIndex).is('element', 'tableRow'));\n // Verify if all the rows have the same number of columns.\n const tableSize = rowsLengths[0];\n const isValid = rowsLengths.every(length => length === tableSize);\n if (!isValid) {\n // @if CK_DEBUG_TABLE // console.log( 'Post-fixing table: adding missing cells.' );\n // Find the maximum number of columns.\n const maxColumns = rowsLengths.reduce((prev, current) => current > prev ? current : prev, 0);\n for (const [rowIndex, size] of rowsLengths.entries()) {\n const columnsToInsert = maxColumns - size;\n if (columnsToInsert) {\n for (let i = 0; i < columnsToInsert; i++) {\n createEmptyTableCell(writer, writer.createPositionAt(table.getChild(rowIndex), 'end'));\n }\n wasFixed = true;\n }\n }\n }\n return wasFixed;\n}\n/**\n * Searches for table cells that extend beyond the table section to which they belong to. It will return an array of objects\n * that stores table cells to be trimmed and the correct value of the `rowspan` attribute to set.\n */\nfunction findCellsToTrim(table) {\n const headingRows = parseInt(table.getAttribute('headingRows') || '0');\n const maxRows = Array.from(table.getChildren())\n .reduce((count, row) => row.is('element', 'tableRow') ? count + 1 : count, 0);\n const cellsToTrim = [];\n for (const { row, cell, cellHeight } of new TableWalker(table)) {\n // Skip cells that do not expand over its row.\n if (cellHeight < 2) {\n continue;\n }\n const isInHeader = row < headingRows;\n // Row limit is either end of header section or whole table as table body is after the header.\n const rowLimit = isInHeader ? headingRows : maxRows;\n // If table cell expands over its limit reduce it height to proper value.\n if (row + cellHeight > rowLimit) {\n const newRowspan = rowLimit - row;\n cellsToTrim.push({ cell, rowspan: newRowspan });\n }\n }\n return cellsToTrim;\n}\n/**\n * Returns an array with lengths of rows assigned to the corresponding row index.\n */\nfunction getChildrenLengths(table) {\n // TableWalker will not provide items for the empty rows, we need to pre-fill this array.\n const lengths = new Array(table.childCount).fill(0);\n for (const { rowIndex } of new TableWalker(table, { includeAllSlots: true })) {\n lengths[rowIndex]++;\n }\n return lengths;\n}\n/**\n * Checks if the differ entry for an attribute change is one of the table's attributes.\n */\nfunction isTableAttributeEntry(entry) {\n if (entry.type !== 'attribute') {\n return false;\n }\n const key = entry.attributeKey;\n return key === 'headingRows' || key === 'colspan' || key === 'rowspan';\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Injects a table cell post-fixer into the model which inserts a `paragraph` element into empty table cells.\n *\n * A table cell must contain at least one block element as a child. An empty table cell will have an empty `paragraph` as a child.\n *\n * ```xml\n * <table>\n * <tableRow>\n * <tableCell></tableCell>\n * </tableRow>\n * </table>\n * ```\n *\n * Will be fixed to:\n *\n * ```xml\n * <table>\n * <tableRow>\n * <tableCell><paragraph></paragraph></tableCell>\n * </tableRow>\n * </table>\n * ```\n */\nexport default function injectTableCellParagraphPostFixer(model) {\n model.document.registerPostFixer(writer => tableCellContentsPostFixer(writer, model));\n}\n/**\n * The table cell contents post-fixer.\n */\nfunction tableCellContentsPostFixer(writer, model) {\n const changes = model.document.differ.getChanges();\n let wasFixed = false;\n for (const entry of changes) {\n if (entry.type == 'insert' && entry.name == 'table') {\n wasFixed = fixTable(entry.position.nodeAfter, writer) || wasFixed;\n }\n if (entry.type == 'insert' && entry.name == 'tableRow') {\n wasFixed = fixTableRow(entry.position.nodeAfter, writer) || wasFixed;\n }\n if (entry.type == 'insert' && entry.name == 'tableCell') {\n wasFixed = fixTableCellContent(entry.position.nodeAfter, writer) || wasFixed;\n }\n if ((entry.type == 'remove' || entry.type == 'insert') && checkTableCellChange(entry)) {\n wasFixed = fixTableCellContent(entry.position.parent, writer) || wasFixed;\n }\n }\n return wasFixed;\n}\n/**\n * Fixes all table cells in a table.\n */\nfunction fixTable(table, writer) {\n let wasFixed = false;\n for (const row of table.getChildren()) {\n if (row.is('element', 'tableRow')) {\n wasFixed = fixTableRow(row, writer) || wasFixed;\n }\n }\n return wasFixed;\n}\n/**\n * Fixes all table cells in a table row.\n */\nfunction fixTableRow(tableRow, writer) {\n let wasFixed = false;\n for (const tableCell of tableRow.getChildren()) {\n wasFixed = fixTableCellContent(tableCell, writer) || wasFixed;\n }\n return wasFixed;\n}\n/**\n * Fixes all table cell content by:\n * - Adding a paragraph to a table cell without any child.\n * - Wrapping direct $text in a `<paragraph>`.\n */\nfunction fixTableCellContent(tableCell, writer) {\n // Insert paragraph to an empty table cell.\n if (tableCell.childCount == 0) {\n // @if CK_DEBUG_TABLE // console.log( 'Post-fixing table: insert paragraph in empty cell.' );\n writer.insertElement('paragraph', tableCell);\n return true;\n }\n // Check table cell children for directly placed text nodes.\n // Temporary solution. See https://github.com/ckeditor/ckeditor5/issues/1464.\n const textNodes = Array.from(tableCell.getChildren()).filter(child => child.is('$text'));\n // @if CK_DEBUG_TABLE // textNodes.length && console.log( 'Post-fixing table: wrap cell content with paragraph.' );\n for (const child of textNodes) {\n writer.wrap(writer.createRangeOn(child), 'paragraph');\n }\n // Return true when there were text nodes to fix.\n return !!textNodes.length;\n}\n/**\n * Checks if a differ change should fix the table cell. This happens on:\n * - Removing content from the table cell (i.e. `tableCell` can be left empty).\n * - Adding a text node directly into a table cell.\n */\nfunction checkTableCellChange(entry) {\n if (!entry.position.parent.is('element', 'tableCell')) {\n return false;\n }\n return entry.type == 'insert' && entry.name == '$text' || entry.type == 'remove';\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { isSingleParagraphWithoutAttributes } from './downcast';\n/**\n * A table cell refresh handler which marks the table cell in the differ to have it re-rendered.\n *\n * Model `paragraph` inside a table cell can be rendered as `<span>` or `<p>`. It is rendered as `<span>` if this is the only block\n * element in that table cell and it does not have any attributes. It is rendered as `<p>` otherwise.\n *\n * When table cell content changes, for example a second `paragraph` element is added, we need to ensure that the first `paragraph` is\n * re-rendered so it changes from `<span>` to `<p>`. The easiest way to do it is to re-render the entire table cell.\n */\nexport default function tableCellRefreshHandler(model, editing) {\n const differ = model.document.differ;\n // Stores cells to be refreshed, so the table cell will be refreshed once for multiple changes.\n const cellsToCheck = new Set();\n for (const change of differ.getChanges()) {\n const parent = change.type == 'attribute' ? change.range.start.parent : change.position.parent;\n if (parent.is('element', 'tableCell')) {\n cellsToCheck.add(parent);\n }\n }\n for (const tableCell of cellsToCheck.values()) {\n const paragraphsToRefresh = Array.from(tableCell.getChildren())\n .filter(child => shouldRefresh(child, editing.mapper));\n for (const paragraph of paragraphsToRefresh) {\n editing.reconvertItem(paragraph);\n }\n }\n}\n/**\n * Check if given model element needs refreshing.\n */\nfunction shouldRefresh(child, mapper) {\n if (!child.is('element', 'paragraph')) {\n return false;\n }\n const viewElement = mapper.toViewElement(child);\n if (!viewElement) {\n return false;\n }\n return isSingleParagraphWithoutAttributes(child) !== viewElement.is('element', 'span');\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tableediting.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tableediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport upcastTable, { ensureParagraphInTableCell, skipEmptyTableRow, upcastTableFigure } from './converters/upcasttable';\nimport { convertParagraphInTableCell, downcastCell, downcastRow, downcastTable } from './converters/downcast';\nimport InsertTableCommand from './commands/inserttablecommand';\nimport InsertRowCommand from './commands/insertrowcommand';\nimport InsertColumnCommand from './commands/insertcolumncommand';\nimport SplitCellCommand from './commands/splitcellcommand';\nimport MergeCellCommand from './commands/mergecellcommand';\nimport RemoveRowCommand from './commands/removerowcommand';\nimport RemoveColumnCommand from './commands/removecolumncommand';\nimport SetHeaderRowCommand from './commands/setheaderrowcommand';\nimport SetHeaderColumnCommand from './commands/setheadercolumncommand';\nimport MergeCellsCommand from './commands/mergecellscommand';\nimport SelectRowCommand from './commands/selectrowcommand';\nimport SelectColumnCommand from './commands/selectcolumncommand';\nimport TableUtils from '../src/tableutils';\nimport injectTableLayoutPostFixer from './converters/table-layout-post-fixer';\nimport injectTableCellParagraphPostFixer from './converters/table-cell-paragraph-post-fixer';\nimport tableHeadingsRefreshHandler from './converters/table-headings-refresh-handler';\nimport tableCellRefreshHandler from './converters/table-cell-refresh-handler';\nimport '../theme/tableediting.css';\n/**\n * The table editing feature.\n */\nexport default class TableEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TableUtils];\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n this._additionalSlots = [];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const model = editor.model;\n const schema = model.schema;\n const conversion = editor.conversion;\n const tableUtils = editor.plugins.get(TableUtils);\n schema.register('table', {\n inheritAllFrom: '$blockObject',\n allowAttributes: ['headingRows', 'headingColumns']\n });\n schema.register('tableRow', {\n allowIn: 'table',\n isLimit: true\n });\n schema.register('tableCell', {\n allowContentOf: '$container',\n allowIn: 'tableRow',\n allowAttributes: ['colspan', 'rowspan'],\n isLimit: true,\n isSelectable: true\n });\n // Figure conversion.\n conversion.for('upcast').add(upcastTableFigure());\n // Table conversion.\n conversion.for('upcast').add(upcastTable());\n conversion.for('editingDowncast').elementToStructure({\n model: {\n name: 'table',\n attributes: ['headingRows']\n },\n view: downcastTable(tableUtils, {\n asWidget: true,\n additionalSlots: this._additionalSlots\n })\n });\n conversion.for('dataDowncast').elementToStructure({\n model: {\n name: 'table',\n attributes: ['headingRows']\n },\n view: downcastTable(tableUtils, {\n additionalSlots: this._additionalSlots\n })\n });\n // Table row conversion.\n conversion.for('upcast').elementToElement({ model: 'tableRow', view: 'tr' });\n conversion.for('upcast').add(skipEmptyTableRow());\n conversion.for('downcast').elementToElement({\n model: 'tableRow',\n view: downcastRow()\n });\n // Table cell conversion.\n conversion.for('upcast').elementToElement({ model: 'tableCell', view: 'td' });\n conversion.for('upcast').elementToElement({ model: 'tableCell', view: 'th' });\n conversion.for('upcast').add(ensureParagraphInTableCell('td'));\n conversion.for('upcast').add(ensureParagraphInTableCell('th'));\n conversion.for('editingDowncast').elementToElement({\n model: 'tableCell',\n view: downcastCell({ asWidget: true })\n });\n conversion.for('dataDowncast').elementToElement({\n model: 'tableCell',\n view: downcastCell()\n });\n // Duplicates code - needed to properly refresh paragraph inside a table cell.\n conversion.for('editingDowncast').elementToElement({\n model: 'paragraph',\n view: convertParagraphInTableCell({ asWidget: true }),\n converterPriority: 'high'\n });\n conversion.for('dataDowncast').elementToElement({\n model: 'paragraph',\n view: convertParagraphInTableCell(),\n converterPriority: 'high'\n });\n // Table attributes conversion.\n conversion.for('downcast').attributeToAttribute({ model: 'colspan', view: 'colspan' });\n conversion.for('upcast').attributeToAttribute({\n model: { key: 'colspan', value: upcastCellSpan('colspan') },\n view: 'colspan'\n });\n conversion.for('downcast').attributeToAttribute({ model: 'rowspan', view: 'rowspan' });\n conversion.for('upcast').attributeToAttribute({\n model: { key: 'rowspan', value: upcastCellSpan('rowspan') },\n view: 'rowspan'\n });\n // Define the config.\n editor.config.define('table.defaultHeadings.rows', 0);\n editor.config.define('table.defaultHeadings.columns', 0);\n // Define all the commands.\n editor.commands.add('insertTable', new InsertTableCommand(editor));\n editor.commands.add('insertTableRowAbove', new InsertRowCommand(editor, { order: 'above' }));\n editor.commands.add('insertTableRowBelow', new InsertRowCommand(editor, { order: 'below' }));\n editor.commands.add('insertTableColumnLeft', new InsertColumnCommand(editor, { order: 'left' }));\n editor.commands.add('insertTableColumnRight', new InsertColumnCommand(editor, { order: 'right' }));\n editor.commands.add('removeTableRow', new RemoveRowCommand(editor));\n editor.commands.add('removeTableColumn', new RemoveColumnCommand(editor));\n editor.commands.add('splitTableCellVertically', new SplitCellCommand(editor, { direction: 'vertically' }));\n editor.commands.add('splitTableCellHorizontally', new SplitCellCommand(editor, { direction: 'horizontally' }));\n editor.commands.add('mergeTableCells', new MergeCellsCommand(editor));\n editor.commands.add('mergeTableCellRight', new MergeCellCommand(editor, { direction: 'right' }));\n editor.commands.add('mergeTableCellLeft', new MergeCellCommand(editor, { direction: 'left' }));\n editor.commands.add('mergeTableCellDown', new MergeCellCommand(editor, { direction: 'down' }));\n editor.commands.add('mergeTableCellUp', new MergeCellCommand(editor, { direction: 'up' }));\n editor.commands.add('setTableColumnHeader', new SetHeaderColumnCommand(editor));\n editor.commands.add('setTableRowHeader', new SetHeaderRowCommand(editor));\n editor.commands.add('selectTableRow', new SelectRowCommand(editor));\n editor.commands.add('selectTableColumn', new SelectColumnCommand(editor));\n injectTableLayoutPostFixer(model);\n injectTableCellParagraphPostFixer(model);\n this.listenTo(model.document, 'change:data', () => {\n tableHeadingsRefreshHandler(model, editor.editing);\n tableCellRefreshHandler(model, editor.editing);\n });\n }\n /**\n * Registers downcast handler for the additional table slot.\n */\n registerAdditionalSlot(slotHandler) {\n this._additionalSlots.push(slotHandler);\n }\n}\n/**\n * Returns fixed colspan and rowspan attrbutes values.\n *\n * @param type colspan or rowspan.\n * @returns conversion value function.\n */\nfunction upcastCellSpan(type) {\n return (cell) => {\n const span = parseInt(cell.getAttribute(type));\n if (Number.isNaN(span) || span <= 0) {\n return null;\n }\n return span;\n };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TableWalker from '../tablewalker';\n/**\n * A table headings refresh handler which marks the table cells or rows in the differ to have it re-rendered\n * if the headings attribute changed.\n *\n * Table heading rows and heading columns are represented in the model by a `headingRows` and `headingColumns` attributes.\n *\n * When table headings attribute changes, all the cells/rows are marked to re-render to change between `<td>` and `<th>`.\n */\nexport default function tableHeadingsRefreshHandler(model, editing) {\n const differ = model.document.differ;\n for (const change of differ.getChanges()) {\n let table;\n let isRowChange = false;\n if (change.type == 'attribute') {\n const element = change.range.start.nodeAfter;\n if (!element || !element.is('element', 'table')) {\n continue;\n }\n if (change.attributeKey != 'headingRows' && change.attributeKey != 'headingColumns') {\n continue;\n }\n table = element;\n isRowChange = change.attributeKey == 'headingRows';\n }\n else if (change.name == 'tableRow' || change.name == 'tableCell') {\n table = change.position.findAncestor('table');\n isRowChange = change.name == 'tableRow';\n }\n if (!table) {\n continue;\n }\n const headingRows = table.getAttribute('headingRows') || 0;\n const headingColumns = table.getAttribute('headingColumns') || 0;\n const tableWalker = new TableWalker(table);\n for (const tableSlot of tableWalker) {\n const isHeading = tableSlot.row < headingRows || tableSlot.column < headingColumns;\n const expectedElementName = isHeading ? 'th' : 'td';\n const viewElement = editing.mapper.toViewElement(tableSlot.cell);\n if (viewElement && viewElement.is('element') && viewElement.name != expectedElementName) {\n editing.reconvertItem((isRowChange ? tableSlot.cell.parent : tableSlot.cell));\n }\n }\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./inserttable.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/ui/inserttableview\n */\nimport { View, ButtonView, addKeyboardHandlingForGrid } from 'ckeditor5/src/ui';\nimport { KeystrokeHandler, FocusTracker } from 'ckeditor5/src/utils';\nimport './../../theme/inserttable.css';\n/**\n * The table size view.\n *\n * It renders a 10x10 grid to choose the inserted table size.\n */\nexport default class InsertTableView extends View {\n /**\n * @inheritDoc\n */\n constructor(locale) {\n super(locale);\n const bind = this.bindTemplate;\n this.items = this._createGridCollection();\n this.keystrokes = new KeystrokeHandler();\n this.focusTracker = new FocusTracker();\n this.set('rows', 0);\n this.set('columns', 0);\n this.bind('label').to(this, 'columns', this, 'rows', (columns, rows) => `${rows} × ${columns}`);\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: ['ck']\n },\n children: [\n {\n tag: 'div',\n attributes: {\n class: ['ck-insert-table-dropdown__grid']\n },\n on: {\n 'mouseover@.ck-insert-table-dropdown-grid-box': bind.to('boxover')\n },\n children: this.items\n },\n {\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-insert-table-dropdown__label'\n ],\n 'aria-hidden': true\n },\n children: [\n {\n text: bind.to('label')\n }\n ]\n }\n ],\n on: {\n mousedown: bind.to(evt => {\n evt.preventDefault();\n }),\n click: bind.to(() => {\n this.fire('execute');\n })\n }\n });\n // #rows and #columns are set via changes to #focusTracker on mouse over.\n this.on('boxover', (evt, domEvt) => {\n const { row, column } = domEvt.target.dataset;\n this.items.get((parseInt(row, 10) - 1) * 10 + (parseInt(column, 10) - 1)).focus();\n });\n // This allows the #rows and #columns to be updated when:\n // * the user navigates the grid using the keyboard,\n // * the user moves the mouse over grid items.\n this.focusTracker.on('change:focusedElement', (evt, name, focusedElement) => {\n if (!focusedElement) {\n return;\n }\n const { row, column } = focusedElement.dataset;\n // As row & column indexes are zero-based transform it to number of selected rows & columns.\n this.set({\n rows: parseInt(row),\n columns: parseInt(column)\n });\n });\n this.on('change:columns', () => this._highlightGridBoxes());\n this.on('change:rows', () => this._highlightGridBoxes());\n }\n render() {\n super.render();\n addKeyboardHandlingForGrid({\n keystrokeHandler: this.keystrokes,\n focusTracker: this.focusTracker,\n gridItems: this.items,\n numberOfColumns: 10,\n uiLanguageDirection: this.locale && this.locale.uiLanguageDirection\n });\n for (const item of this.items) {\n this.focusTracker.add(item.element);\n }\n this.keystrokes.listenTo(this.element);\n }\n /**\n * @inheritDoc\n */\n focus() {\n this.items.get(0).focus();\n }\n /**\n * @inheritDoc\n */\n focusLast() {\n this.items.get(0).focus();\n }\n /**\n * Highlights grid boxes depending on rows and columns selected.\n */\n _highlightGridBoxes() {\n const rows = this.rows;\n const columns = this.columns;\n this.items.map((boxView, index) => {\n // Translate box index to the row & column index.\n const itemRow = Math.floor(index / 10);\n const itemColumn = index % 10;\n // Grid box is highlighted when its row & column index belongs to selected number of rows & columns.\n const isOn = itemRow < rows && itemColumn < columns;\n boxView.set('isOn', isOn);\n });\n }\n /**\n * Creates a new Button for the grid.\n *\n * @param locale The locale instance.\n * @param row Row number.\n * @param column Column number.\n * @param label The grid button label.\n */\n _createGridButton(locale, row, column, label) {\n const button = new ButtonView(locale);\n button.set({\n label,\n class: 'ck-insert-table-dropdown-grid-box'\n });\n button.extendTemplate({\n attributes: {\n 'data-row': row,\n 'data-column': column\n }\n });\n return button;\n }\n /**\n * @returns A view collection containing boxes to be placed in a table grid.\n */\n _createGridCollection() {\n const boxes = [];\n // Add grid boxes to table selection view.\n for (let index = 0; index < 100; index++) {\n const row = Math.floor(index / 10);\n const column = index % 10;\n const label = `${row + 1} × ${column + 1}`;\n boxes.push(this._createGridButton(this.locale, row + 1, column + 1, label));\n }\n return this.createCollection(boxes);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tableui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { addListToDropdown, createDropdown, Model, SplitButtonView, SwitchButtonView } from 'ckeditor5/src/ui';\nimport { Collection } from 'ckeditor5/src/utils';\nimport InsertTableView from './ui/inserttableview';\nimport tableIcon from './../theme/icons/table.svg';\nimport tableColumnIcon from './../theme/icons/table-column.svg';\nimport tableRowIcon from './../theme/icons/table-row.svg';\nimport tableMergeCellIcon from './../theme/icons/table-merge-cell.svg';\n/**\n * The table UI plugin. It introduces:\n *\n * * The `'insertTable'` dropdown,\n * * The `'tableColumn'` dropdown,\n * * The `'tableRow'` dropdown,\n * * The `'mergeTableCells'` split button.\n *\n * The `'tableColumn'`, `'tableRow'` and `'mergeTableCells'` dropdowns work best with {@link module:table/tabletoolbar~TableToolbar}.\n */\nexport default class TableUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = this.editor.t;\n const contentLanguageDirection = editor.locale.contentLanguageDirection;\n const isContentLtr = contentLanguageDirection === 'ltr';\n editor.ui.componentFactory.add('insertTable', locale => {\n const command = editor.commands.get('insertTable');\n const dropdownView = createDropdown(locale);\n dropdownView.bind('isEnabled').to(command);\n // Decorate dropdown's button.\n dropdownView.buttonView.set({\n icon: tableIcon,\n label: t('Insert table'),\n tooltip: true\n });\n let insertTableView;\n dropdownView.on('change:isOpen', () => {\n if (insertTableView) {\n return;\n }\n // Prepare custom view for dropdown's panel.\n insertTableView = new InsertTableView(locale);\n dropdownView.panelView.children.add(insertTableView);\n insertTableView.delegate('execute').to(dropdownView);\n dropdownView.on('execute', () => {\n editor.execute('insertTable', { rows: insertTableView.rows, columns: insertTableView.columns });\n editor.editing.view.focus();\n });\n });\n return dropdownView;\n });\n editor.ui.componentFactory.add('tableColumn', locale => {\n const options = [\n {\n type: 'switchbutton',\n model: {\n commandName: 'setTableColumnHeader',\n label: t('Header column'),\n bindIsOn: true\n }\n },\n { type: 'separator' },\n {\n type: 'button',\n model: {\n commandName: isContentLtr ? 'insertTableColumnLeft' : 'insertTableColumnRight',\n label: t('Insert column left')\n }\n },\n {\n type: 'button',\n model: {\n commandName: isContentLtr ? 'insertTableColumnRight' : 'insertTableColumnLeft',\n label: t('Insert column right')\n }\n },\n {\n type: 'button',\n model: {\n commandName: 'removeTableColumn',\n label: t('Delete column')\n }\n },\n {\n type: 'button',\n model: {\n commandName: 'selectTableColumn',\n label: t('Select column')\n }\n }\n ];\n return this._prepareDropdown(t('Column'), tableColumnIcon, options, locale);\n });\n editor.ui.componentFactory.add('tableRow', locale => {\n const options = [\n {\n type: 'switchbutton',\n model: {\n commandName: 'setTableRowHeader',\n label: t('Header row'),\n bindIsOn: true\n }\n },\n { type: 'separator' },\n {\n type: 'button',\n model: {\n commandName: 'insertTableRowAbove',\n label: t('Insert row above')\n }\n },\n {\n type: 'button',\n model: {\n commandName: 'insertTableRowBelow',\n label: t('Insert row below')\n }\n },\n {\n type: 'button',\n model: {\n commandName: 'removeTableRow',\n label: t('Delete row')\n }\n },\n {\n type: 'button',\n model: {\n commandName: 'selectTableRow',\n label: t('Select row')\n }\n }\n ];\n return this._prepareDropdown(t('Row'), tableRowIcon, options, locale);\n });\n editor.ui.componentFactory.add('mergeTableCells', locale => {\n const options = [\n {\n type: 'button',\n model: {\n commandName: 'mergeTableCellUp',\n label: t('Merge cell up')\n }\n },\n {\n type: 'button',\n model: {\n commandName: isContentLtr ? 'mergeTableCellRight' : 'mergeTableCellLeft',\n label: t('Merge cell right')\n }\n },\n {\n type: 'button',\n model: {\n commandName: 'mergeTableCellDown',\n label: t('Merge cell down')\n }\n },\n {\n type: 'button',\n model: {\n commandName: isContentLtr ? 'mergeTableCellLeft' : 'mergeTableCellRight',\n label: t('Merge cell left')\n }\n },\n { type: 'separator' },\n {\n type: 'button',\n model: {\n commandName: 'splitTableCellVertically',\n label: t('Split cell vertically')\n }\n },\n {\n type: 'button',\n model: {\n commandName: 'splitTableCellHorizontally',\n label: t('Split cell horizontally')\n }\n }\n ];\n return this._prepareMergeSplitButtonDropdown(t('Merge cells'), tableMergeCellIcon, options, locale);\n });\n }\n /**\n * Creates a dropdown view from a set of options.\n *\n * @param label The dropdown button label.\n * @param icon An icon for the dropdown button.\n * @param options The list of options for the dropdown.\n */\n _prepareDropdown(label, icon, options, locale) {\n const editor = this.editor;\n const dropdownView = createDropdown(locale);\n const commands = this._fillDropdownWithListOptions(dropdownView, options);\n // Decorate dropdown's button.\n dropdownView.buttonView.set({\n label,\n icon,\n tooltip: true\n });\n // Make dropdown button disabled when all options are disabled.\n dropdownView.bind('isEnabled').toMany(commands, 'isEnabled', (...areEnabled) => {\n return areEnabled.some(isEnabled => isEnabled);\n });\n this.listenTo(dropdownView, 'execute', evt => {\n editor.execute(evt.source.commandName);\n // Toggling a switch button view should not move the focus to the editable.\n if (!(evt.source instanceof SwitchButtonView)) {\n editor.editing.view.focus();\n }\n });\n return dropdownView;\n }\n /**\n * Creates a dropdown view with a {@link module:ui/dropdown/button/splitbuttonview~SplitButtonView} for\n * merge (and split)related commands.\n *\n * @param label The dropdown button label.\n * @param icon An icon for the dropdown button.\n * @param options The list of options for the dropdown.\n */\n _prepareMergeSplitButtonDropdown(label, icon, options, locale) {\n const editor = this.editor;\n const dropdownView = createDropdown(locale, SplitButtonView);\n const mergeCommandName = 'mergeTableCells';\n // Main command.\n const mergeCommand = editor.commands.get(mergeCommandName);\n // Subcommands in the dropdown.\n const commands = this._fillDropdownWithListOptions(dropdownView, options);\n dropdownView.buttonView.set({\n label,\n icon,\n tooltip: true,\n isEnabled: true\n });\n // Make dropdown button disabled when all options are disabled together with the main command.\n dropdownView.bind('isEnabled').toMany([mergeCommand, ...commands], 'isEnabled', (...areEnabled) => {\n return areEnabled.some(isEnabled => isEnabled);\n });\n // Merge selected table cells when the main part of the split button is clicked.\n this.listenTo(dropdownView.buttonView, 'execute', () => {\n editor.execute(mergeCommandName);\n editor.editing.view.focus();\n });\n // Execute commands for events coming from the list in the dropdown panel.\n this.listenTo(dropdownView, 'execute', evt => {\n editor.execute(evt.source.commandName);\n editor.editing.view.focus();\n });\n return dropdownView;\n }\n /**\n * Injects a {@link module:ui/list/listview~ListView} into the passed dropdown with buttons\n * which execute editor commands as configured in passed options.\n *\n * @param options The list of options for the dropdown.\n * @returns Commands the list options are interacting with.\n */\n _fillDropdownWithListOptions(dropdownView, options) {\n const editor = this.editor;\n const commands = [];\n const itemDefinitions = new Collection();\n for (const option of options) {\n addListOption(option, editor, commands, itemDefinitions);\n }\n addListToDropdown(dropdownView, itemDefinitions);\n return commands;\n }\n}\n/**\n * Adds an option to a list view.\n *\n * @param option A configuration option.\n * @param commands The list of commands to update.\n * @param itemDefinitions A collection of dropdown items to update with the given option.\n */\nfunction addListOption(option, editor, commands, itemDefinitions) {\n if (option.type === 'button' || option.type === 'switchbutton') {\n const model = option.model = new Model(option.model);\n const { commandName, bindIsOn } = option.model;\n const command = editor.commands.get(commandName);\n commands.push(command);\n model.set({ commandName });\n model.bind('isEnabled').to(command);\n if (bindIsOn) {\n model.bind('isOn').to(command, 'value');\n }\n model.set({\n withText: true\n });\n }\n itemDefinitions.add(option);\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M3 6v3h4V6H3zm0 4v3h4v-3H3zm0 4v3h4v-3H3zm5 3h4v-3H8v3zm5 0h4v-3h-4v3zm4-4v-3h-4v3h4zm0-4V6h-4v3h4zm1.5 8a1.5 1.5 0 0 1-1.5 1.5H3A1.5 1.5 0 0 1 1.5 17V4c.222-.863 1.068-1.5 2-1.5h13c.932 0 1.778.637 2 1.5v13zM12 13v-3H8v3h4zm0-4V6H8v3h4z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z\\\" opacity=\\\".6\\\"/><path d=\\\"M18 7v1H2V7h16zm0 5v1H2v-1h16z\\\" opacity=\\\".6\\\"/><path d=\\\"M14 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V1a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1zm-2 1H8v4h4V2zm0 6H8v4h4V8zm0 6H8v4h4v-4z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z\\\" opacity=\\\".6\\\"/><path d=\\\"M7 2h1v16H7V2zm5 0h1v16h-1V2z\\\" opacity=\\\".6\\\"/><path d=\\\"M1 6h18a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1zm1 2v4h4V8H2zm6 0v4h4V8H8zm6 0v4h4V8h-4z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M2.5 1h15A1.5 1.5 0 0 1 19 2.5v15a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1zM2 2v16h16V2H2z\\\" opacity=\\\".6\\\"/><path d=\\\"M7 2h1v16H7V2zm5 0h1v7h-1V2zm6 5v1H2V7h16zM8 12v1H2v-1h6z\\\" opacity=\\\".6\\\"/><path d=\\\"M7 7h12a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1 2v9h10V9H8z\\\"/></svg>\";","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tableselection.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tableselection\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { first } from 'ckeditor5/src/utils';\nimport TableWalker from './tablewalker';\nimport TableUtils from './tableutils';\nimport { cropTableToDimensions, adjustLastRowIndex, adjustLastColumnIndex } from './utils/structure';\nimport '../theme/tableselection.css';\n/**\n * This plugin enables the advanced table cells, rows and columns selection.\n * It is loaded automatically by the {@link module:table/table~Table} plugin.\n */\nexport default class TableSelection extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableSelection';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TableUtils, TableUtils];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const model = editor.model;\n const view = editor.editing.view;\n this.listenTo(model, 'deleteContent', (evt, args) => this._handleDeleteContent(evt, args), { priority: 'high' });\n this.listenTo(view.document, 'insertText', (evt, data) => this._handleInsertTextEvent(evt, data), { priority: 'high' });\n this._defineSelectionConverter();\n this._enablePluginDisabling(); // sic!\n }\n /**\n * Returns the currently selected table cells or `null` if it is not a table cells selection.\n */\n getSelectedTableCells() {\n const tableUtils = this.editor.plugins.get(TableUtils);\n const selection = this.editor.model.document.selection;\n const selectedCells = tableUtils.getSelectedTableCells(selection);\n if (selectedCells.length == 0) {\n return null;\n }\n // This should never happen, but let's know if it ever happens.\n // @if CK_DEBUG //\tif ( selectedCells.length != selection.rangeCount ) {\n // @if CK_DEBUG //\t\tconsole.warn( 'Mixed selection warning. The selection contains table cells and some other ranges.' );\n // @if CK_DEBUG //\t}\n return selectedCells;\n }\n /**\n * Returns the selected table fragment as a document fragment.\n */\n getSelectionAsFragment() {\n const tableUtils = this.editor.plugins.get(TableUtils);\n const selectedCells = this.getSelectedTableCells();\n if (!selectedCells) {\n return null;\n }\n return this.editor.model.change(writer => {\n const documentFragment = writer.createDocumentFragment();\n const { first: firstColumn, last: lastColumn } = tableUtils.getColumnIndexes(selectedCells);\n const { first: firstRow, last: lastRow } = tableUtils.getRowIndexes(selectedCells);\n const sourceTable = selectedCells[0].findAncestor('table');\n let adjustedLastRow = lastRow;\n let adjustedLastColumn = lastColumn;\n // If the selection is rectangular there could be a case of all cells in the last row/column spanned over\n // next row/column so the real lastRow/lastColumn should be updated.\n if (tableUtils.isSelectionRectangular(selectedCells)) {\n const dimensions = {\n firstColumn,\n lastColumn,\n firstRow,\n lastRow\n };\n adjustedLastRow = adjustLastRowIndex(sourceTable, dimensions);\n adjustedLastColumn = adjustLastColumnIndex(sourceTable, dimensions);\n }\n const cropDimensions = {\n startRow: firstRow,\n startColumn: firstColumn,\n endRow: adjustedLastRow,\n endColumn: adjustedLastColumn\n };\n const table = cropTableToDimensions(sourceTable, cropDimensions, writer);\n writer.insert(table, documentFragment, 0);\n return documentFragment;\n });\n }\n /**\n * Sets the model selection based on given anchor and target cells (can be the same cell).\n * Takes care of setting the backward flag.\n *\n * ```ts\n * const modelRoot = editor.model.document.getRoot();\n * const firstCell = modelRoot.getNodeByPath( [ 0, 0, 0 ] );\n * const lastCell = modelRoot.getNodeByPath( [ 0, 0, 1 ] );\n *\n * const tableSelection = editor.plugins.get( 'TableSelection' );\n * tableSelection.setCellSelection( firstCell, lastCell );\n * ```\n */\n setCellSelection(anchorCell, targetCell) {\n const cellsToSelect = this._getCellsToSelect(anchorCell, targetCell);\n this.editor.model.change(writer => {\n writer.setSelection(cellsToSelect.cells.map(cell => writer.createRangeOn(cell)), { backward: cellsToSelect.backward });\n });\n }\n /**\n * Returns the focus cell from the current selection.\n */\n getFocusCell() {\n const selection = this.editor.model.document.selection;\n const focusCellRange = [...selection.getRanges()].pop();\n const element = focusCellRange.getContainedElement();\n if (element && element.is('element', 'tableCell')) {\n return element;\n }\n return null;\n }\n /**\n * Returns the anchor cell from the current selection.\n */\n getAnchorCell() {\n const selection = this.editor.model.document.selection;\n const anchorCellRange = first(selection.getRanges());\n const element = anchorCellRange.getContainedElement();\n if (element && element.is('element', 'tableCell')) {\n return element;\n }\n return null;\n }\n /**\n * Defines a selection converter which marks the selected cells with a specific class.\n *\n * The real DOM selection is put in the last cell. Since the order of ranges is dependent on whether the\n * selection is backward or not, the last cell will usually be close to the \"focus\" end of the selection\n * (a selection has anchor and focus).\n *\n * The real DOM selection is then hidden with CSS.\n */\n _defineSelectionConverter() {\n const editor = this.editor;\n const highlighted = new Set();\n editor.conversion.for('editingDowncast').add(dispatcher => dispatcher.on('selection', (evt, data, conversionApi) => {\n const viewWriter = conversionApi.writer;\n clearHighlightedTableCells(viewWriter);\n const selectedCells = this.getSelectedTableCells();\n if (!selectedCells) {\n return;\n }\n for (const tableCell of selectedCells) {\n const viewElement = conversionApi.mapper.toViewElement(tableCell);\n viewWriter.addClass('ck-editor__editable_selected', viewElement);\n highlighted.add(viewElement);\n }\n const lastViewCell = conversionApi.mapper.toViewElement(selectedCells[selectedCells.length - 1]);\n viewWriter.setSelection(lastViewCell, 0);\n }, { priority: 'lowest' }));\n function clearHighlightedTableCells(viewWriter) {\n for (const previouslyHighlighted of highlighted) {\n viewWriter.removeClass('ck-editor__editable_selected', previouslyHighlighted);\n }\n highlighted.clear();\n }\n }\n /**\n * Creates a listener that reacts to changes in {@link #isEnabled} and, if the plugin was disabled,\n * it collapses the multi-cell selection to a regular selection placed inside a table cell.\n *\n * This listener helps features that disable the table selection plugin bring the selection\n * to a clear state they can work with (for instance, because they don't support multiple cell selection).\n */\n _enablePluginDisabling() {\n const editor = this.editor;\n this.on('change:isEnabled', () => {\n if (!this.isEnabled) {\n const selectedCells = this.getSelectedTableCells();\n if (!selectedCells) {\n return;\n }\n editor.model.change(writer => {\n const position = writer.createPositionAt(selectedCells[0], 0);\n const range = editor.model.schema.getNearestSelectionRange(position);\n writer.setSelection(range);\n });\n }\n });\n }\n /**\n * Overrides the default `model.deleteContent()` behavior over a selected table fragment.\n *\n * @param args Delete content method arguments.\n */\n _handleDeleteContent(event, args) {\n const tableUtils = this.editor.plugins.get(TableUtils);\n const selection = args[0];\n const options = args[1];\n const model = this.editor.model;\n const isBackward = !options || options.direction == 'backward';\n const selectedTableCells = tableUtils.getSelectedTableCells(selection);\n if (!selectedTableCells.length) {\n return;\n }\n event.stop();\n model.change(writer => {\n const tableCellToSelect = selectedTableCells[isBackward ? selectedTableCells.length - 1 : 0];\n model.change(writer => {\n for (const tableCell of selectedTableCells) {\n model.deleteContent(writer.createSelection(tableCell, 'in'));\n }\n });\n const rangeToSelect = model.schema.getNearestSelectionRange(writer.createPositionAt(tableCellToSelect, 0));\n // Note: we ignore the case where rangeToSelect may be null because deleteContent() will always (unless someone broke it)\n // create an empty paragraph to accommodate the selection.\n if (selection.is('documentSelection')) {\n writer.setSelection(rangeToSelect);\n }\n else {\n selection.setTo(rangeToSelect);\n }\n });\n }\n /**\n * This handler makes it possible to remove the content of all selected cells by starting to type.\n * If you take a look at {@link #_defineSelectionConverter} you will find out that despite the multi-cell selection being set\n * in the model, the view selection is collapsed in the last cell (because most browsers are unable to render multi-cell selections;\n * yes, it's a hack).\n *\n * When multiple cells are selected in the model and the user starts to type, the\n * {@link module:engine/view/document~Document#event:insertText} event carries information provided by the\n * beforeinput DOM event, that in turn only knows about this collapsed DOM selection in the last cell.\n *\n * As a result, the selected cells have no chance to be cleaned up. To fix this, this listener intercepts\n * the event and injects the custom view selection in the data that translates correctly to the actual state\n * of the multi-cell selection in the model.\n *\n * @param data Insert text event data.\n */\n _handleInsertTextEvent(evt, data) {\n const editor = this.editor;\n const selectedCells = this.getSelectedTableCells();\n if (!selectedCells) {\n return;\n }\n const view = editor.editing.view;\n const mapper = editor.editing.mapper;\n const viewRanges = selectedCells.map(tableCell => view.createRangeOn(mapper.toViewElement(tableCell)));\n data.selection = view.createSelection(viewRanges);\n }\n /**\n * Returns an array of table cells that should be selected based on the\n * given anchor cell and target (focus) cell.\n *\n * The cells are returned in a reverse direction if the selection is backward.\n */\n _getCellsToSelect(anchorCell, targetCell) {\n const tableUtils = this.editor.plugins.get('TableUtils');\n const startLocation = tableUtils.getCellLocation(anchorCell);\n const endLocation = tableUtils.getCellLocation(targetCell);\n const startRow = Math.min(startLocation.row, endLocation.row);\n const endRow = Math.max(startLocation.row, endLocation.row);\n const startColumn = Math.min(startLocation.column, endLocation.column);\n const endColumn = Math.max(startLocation.column, endLocation.column);\n // 2-dimensional array of the selected cells to ease flipping the order of cells for backward selections.\n const selectionMap = new Array(endRow - startRow + 1).fill(null).map(() => []);\n const walkerOptions = {\n startRow,\n endRow,\n startColumn,\n endColumn\n };\n for (const { row, cell } of new TableWalker(anchorCell.findAncestor('table'), walkerOptions)) {\n selectionMap[row - startRow].push(cell);\n }\n const flipVertically = endLocation.row < startLocation.row;\n const flipHorizontally = endLocation.column < startLocation.column;\n if (flipVertically) {\n selectionMap.reverse();\n }\n if (flipHorizontally) {\n selectionMap.forEach(row => row.reverse());\n }\n return {\n cells: selectionMap.flat(),\n backward: flipVertically || flipHorizontally\n };\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport TableSelection from './tableselection';\nimport TableWalker from './tablewalker';\nimport TableUtils from './tableutils';\nimport { cropTableToDimensions, getHorizontallyOverlappingCells, getVerticallyOverlappingCells, removeEmptyRowsColumns, splitHorizontally, splitVertically, trimTableCellIfNeeded, adjustLastRowIndex, adjustLastColumnIndex } from './utils/structure';\n/**\n * This plugin adds support for copying/cutting/pasting fragments of tables.\n * It is loaded automatically by the {@link module:table/table~Table} plugin.\n */\nexport default class TableClipboard extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableClipboard';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TableSelection, TableUtils];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const viewDocument = editor.editing.view.document;\n this.listenTo(viewDocument, 'copy', (evt, data) => this._onCopyCut(evt, data));\n this.listenTo(viewDocument, 'cut', (evt, data) => this._onCopyCut(evt, data));\n this.listenTo(editor.model, 'insertContent', (evt, [content, selectable]) => this._onInsertContent(evt, content, selectable), { priority: 'high' });\n this.decorate('_replaceTableSlotCell');\n }\n /**\n * Copies table content to a clipboard on \"copy\" & \"cut\" events.\n *\n * @param evt An object containing information about the handled event.\n * @param data Clipboard event data.\n */\n _onCopyCut(evt, data) {\n const tableSelection = this.editor.plugins.get(TableSelection);\n if (!tableSelection.getSelectedTableCells()) {\n return;\n }\n if (evt.name == 'cut' && !this.editor.model.canEditAt(this.editor.model.document.selection)) {\n return;\n }\n data.preventDefault();\n evt.stop();\n const dataController = this.editor.data;\n const viewDocument = this.editor.editing.view.document;\n const content = dataController.toView(tableSelection.getSelectionAsFragment());\n viewDocument.fire('clipboardOutput', {\n dataTransfer: data.dataTransfer,\n content,\n method: evt.name\n });\n }\n /**\n * Overrides default {@link module:engine/model/model~Model#insertContent `model.insertContent()`} method to handle pasting table inside\n * selected table fragment.\n *\n * Depending on selected table fragment:\n * - If a selected table fragment is smaller than paste table it will crop pasted table to match dimensions.\n * - If dimensions are equal it will replace selected table fragment with a pasted table contents.\n *\n * @param content The content to insert.\n * @param selectable The selection into which the content should be inserted.\n * If not provided the current model document selection will be used.\n */\n _onInsertContent(evt, content, selectable) {\n if (selectable && !selectable.is('documentSelection')) {\n return;\n }\n const model = this.editor.model;\n const tableUtils = this.editor.plugins.get(TableUtils);\n // We might need to crop table before inserting so reference might change.\n let pastedTable = this.getTableIfOnlyTableInContent(content, model);\n if (!pastedTable) {\n return;\n }\n const selectedTableCells = tableUtils.getSelectionAffectedTableCells(model.document.selection);\n if (!selectedTableCells.length) {\n removeEmptyRowsColumns(pastedTable, tableUtils);\n return;\n }\n // Override default model.insertContent() handling at this point.\n evt.stop();\n model.change(writer => {\n const pastedDimensions = {\n width: tableUtils.getColumns(pastedTable),\n height: tableUtils.getRows(pastedTable)\n };\n // Prepare the table for pasting.\n const selection = prepareTableForPasting(selectedTableCells, pastedDimensions, writer, tableUtils);\n // Beyond this point we operate on a fixed content table with rectangular selection and proper last row/column values.\n const selectionHeight = selection.lastRow - selection.firstRow + 1;\n const selectionWidth = selection.lastColumn - selection.firstColumn + 1;\n // Crop pasted table if:\n // - Pasted table dimensions exceeds selection area.\n // - Pasted table has broken layout (ie some cells sticks out by the table dimensions established by the first and last row).\n //\n // Note: The table dimensions are established by the width of the first row and the total number of rows.\n // It is possible to programmatically create a table that has rows which would have cells anchored beyond first row width but\n // such table will not be created by other editing solutions.\n const cropDimensions = {\n startRow: 0,\n startColumn: 0,\n endRow: Math.min(selectionHeight, pastedDimensions.height) - 1,\n endColumn: Math.min(selectionWidth, pastedDimensions.width) - 1\n };\n pastedTable = cropTableToDimensions(pastedTable, cropDimensions, writer);\n // Content table to which we insert a pasted table.\n const selectedTable = selectedTableCells[0].findAncestor('table');\n const cellsToSelect = this._replaceSelectedCellsWithPasted(pastedTable, pastedDimensions, selectedTable, selection, writer);\n if (this.editor.plugins.get('TableSelection').isEnabled) {\n // Selection ranges must be sorted because the first and last selection ranges are considered\n // as anchor/focus cell ranges for multi-cell selection.\n const selectionRanges = tableUtils.sortRanges(cellsToSelect.map(cell => writer.createRangeOn(cell)));\n writer.setSelection(selectionRanges);\n }\n else {\n // Set selection inside first cell if multi-cell selection is disabled.\n writer.setSelection(cellsToSelect[0], 0);\n }\n });\n }\n /**\n * Replaces the part of selectedTable with pastedTable.\n */\n _replaceSelectedCellsWithPasted(pastedTable, pastedDimensions, selectedTable, selection, writer) {\n const { width: pastedWidth, height: pastedHeight } = pastedDimensions;\n // Holds two-dimensional array that is addressed by [ row ][ column ] that stores cells anchored at given location.\n const pastedTableLocationMap = createLocationMap(pastedTable, pastedWidth, pastedHeight);\n const selectedTableMap = [...new TableWalker(selectedTable, {\n startRow: selection.firstRow,\n endRow: selection.lastRow,\n startColumn: selection.firstColumn,\n endColumn: selection.lastColumn,\n includeAllSlots: true\n })];\n // Selection must be set to pasted cells (some might be removed or new created).\n const cellsToSelect = [];\n // Store next cell insert position.\n let insertPosition;\n // Content table replace cells algorithm iterates over a selected table fragment and:\n //\n // - Removes existing table cells at current slot (location).\n // - Inserts cell from a pasted table for a matched slots.\n //\n // This ensures proper table geometry after the paste\n for (const tableSlot of selectedTableMap) {\n const { row, column } = tableSlot;\n // Save the insert position for current row start.\n if (column === selection.firstColumn) {\n insertPosition = tableSlot.getPositionBefore();\n }\n // Map current table slot location to an pasted table slot location.\n const pastedRow = row - selection.firstRow;\n const pastedColumn = column - selection.firstColumn;\n const pastedCell = pastedTableLocationMap[pastedRow % pastedHeight][pastedColumn % pastedWidth];\n // Clone cell to insert (to duplicate its attributes and children).\n // Cloning is required to support repeating pasted table content when inserting to a bigger selection.\n const cellToInsert = pastedCell ? writer.cloneElement(pastedCell) : null;\n // Replace the cell from the current slot with new table cell.\n const newTableCell = this._replaceTableSlotCell(tableSlot, cellToInsert, insertPosition, writer);\n // The cell was only removed.\n if (!newTableCell) {\n continue;\n }\n // Trim the cell if it's row/col-spans would exceed selection area.\n trimTableCellIfNeeded(newTableCell, row, column, selection.lastRow, selection.lastColumn, writer);\n cellsToSelect.push(newTableCell);\n insertPosition = writer.createPositionAfter(newTableCell);\n }\n // If there are any headings, all the cells that overlap from heading must be splitted.\n const headingRows = parseInt(selectedTable.getAttribute('headingRows') || '0');\n const headingColumns = parseInt(selectedTable.getAttribute('headingColumns') || '0');\n const areHeadingRowsIntersectingSelection = selection.firstRow < headingRows && headingRows <= selection.lastRow;\n const areHeadingColumnsIntersectingSelection = selection.firstColumn < headingColumns && headingColumns <= selection.lastColumn;\n if (areHeadingRowsIntersectingSelection) {\n const columnsLimit = { first: selection.firstColumn, last: selection.lastColumn };\n const newCells = doHorizontalSplit(selectedTable, headingRows, columnsLimit, writer, selection.firstRow);\n cellsToSelect.push(...newCells);\n }\n if (areHeadingColumnsIntersectingSelection) {\n const rowsLimit = { first: selection.firstRow, last: selection.lastRow };\n const newCells = doVerticalSplit(selectedTable, headingColumns, rowsLimit, writer);\n cellsToSelect.push(...newCells);\n }\n return cellsToSelect;\n }\n /**\n * Replaces a single table slot.\n *\n * @returns Inserted table cell or null if slot should remain empty.\n * @private\n */\n _replaceTableSlotCell(tableSlot, cellToInsert, insertPosition, writer) {\n const { cell, isAnchor } = tableSlot;\n // If the slot is occupied by a cell in a selected table - remove it.\n // The slot of this cell will be either:\n // - Replaced by a pasted table cell.\n // - Spanned by a previously pasted table cell.\n if (isAnchor) {\n writer.remove(cell);\n }\n // There is no cell to insert (might be spanned by other cell in a pasted table) - advance to the next content table slot.\n if (!cellToInsert) {\n return null;\n }\n writer.insert(cellToInsert, insertPosition);\n return cellToInsert;\n }\n /**\n * Extracts the table for pasting into a table.\n *\n * @param content The content to insert.\n * @param model The editor model.\n */\n getTableIfOnlyTableInContent(content, model) {\n if (!content.is('documentFragment') && !content.is('element')) {\n return null;\n }\n // Table passed directly.\n if (content.is('element', 'table')) {\n return content;\n }\n // We do not support mixed content when pasting table into table.\n // See: https://github.com/ckeditor/ckeditor5/issues/6817.\n if (content.childCount == 1 && content.getChild(0).is('element', 'table')) {\n return content.getChild(0);\n }\n // If there are only whitespaces around a table then use that table for pasting.\n const contentRange = model.createRangeIn(content);\n for (const element of contentRange.getItems()) {\n if (element.is('element', 'table')) {\n // Stop checking if there is some content before table.\n const rangeBefore = model.createRange(contentRange.start, model.createPositionBefore(element));\n if (model.hasContent(rangeBefore, { ignoreWhitespaces: true })) {\n return null;\n }\n // Stop checking if there is some content after table.\n const rangeAfter = model.createRange(model.createPositionAfter(element), contentRange.end);\n if (model.hasContent(rangeAfter, { ignoreWhitespaces: true })) {\n return null;\n }\n // There wasn't any content neither before nor after.\n return element;\n }\n }\n return null;\n }\n}\n/**\n * Prepares a table for pasting and returns adjusted selection dimensions.\n */\nfunction prepareTableForPasting(selectedTableCells, pastedDimensions, writer, tableUtils) {\n const selectedTable = selectedTableCells[0].findAncestor('table');\n const columnIndexes = tableUtils.getColumnIndexes(selectedTableCells);\n const rowIndexes = tableUtils.getRowIndexes(selectedTableCells);\n const selection = {\n firstColumn: columnIndexes.first,\n lastColumn: columnIndexes.last,\n firstRow: rowIndexes.first,\n lastRow: rowIndexes.last\n };\n // Single cell selected - expand selection to pasted table dimensions.\n const shouldExpandSelection = selectedTableCells.length === 1;\n if (shouldExpandSelection) {\n selection.lastRow += pastedDimensions.height - 1;\n selection.lastColumn += pastedDimensions.width - 1;\n expandTableSize(selectedTable, selection.lastRow + 1, selection.lastColumn + 1, tableUtils);\n }\n // In case of expanding selection we do not reset the selection so in this case we will always try to fix selection\n // like in the case of a non-rectangular area. This might be fixed by re-setting selected cells array but this shortcut is safe.\n if (shouldExpandSelection || !tableUtils.isSelectionRectangular(selectedTableCells)) {\n // For a non-rectangular selection (ie in which some cells sticks out from a virtual selection rectangle) we need to create\n // a table layout that has a rectangular selection. This will split cells so the selection become rectangular.\n // Beyond this point we will operate on fixed content table.\n splitCellsToRectangularSelection(selectedTable, selection, writer);\n }\n // However a selected table fragment might be invalid if examined alone. Ie such table fragment:\n //\n // +---+---+---+---+\n // 0 | a | b | c | d |\n // + + +---+---+\n // 1 | | e | f | g |\n // + +---+ +---+\n // 2 | | h | | i | <- last row, each cell has rowspan = 2,\n // + + + + + so we need to return 3, not 2\n // 3 | | | | |\n // +---+---+---+---+\n //\n // is invalid as the cells \"h\" and \"i\" have rowspans.\n // This case needs only adjusting the selection dimension as the rest of the algorithm operates on empty slots also.\n else {\n selection.lastRow = adjustLastRowIndex(selectedTable, selection);\n selection.lastColumn = adjustLastColumnIndex(selectedTable, selection);\n }\n return selection;\n}\n/**\n * Expand table (in place) to expected size.\n */\nfunction expandTableSize(table, expectedHeight, expectedWidth, tableUtils) {\n const tableWidth = tableUtils.getColumns(table);\n const tableHeight = tableUtils.getRows(table);\n if (expectedWidth > tableWidth) {\n tableUtils.insertColumns(table, {\n at: tableWidth,\n columns: expectedWidth - tableWidth\n });\n }\n if (expectedHeight > tableHeight) {\n tableUtils.insertRows(table, {\n at: tableHeight,\n rows: expectedHeight - tableHeight\n });\n }\n}\n/**\n * Returns two-dimensional array that is addressed by [ row ][ column ] that stores cells anchored at given location.\n *\n * At given row & column location it might be one of:\n *\n * * cell - cell from pasted table anchored at this location.\n * * null - if no cell is anchored at this location.\n *\n * For instance, from a table below:\n *\n * +----+----+----+----+\n * | 00 | 01 | 02 | 03 |\n * + +----+----+----+\n * | | 11 | 13 |\n * +----+ +----+\n * | 20 | | 23 |\n * +----+----+----+----+\n *\n * The method will return an array (numbers represents cell element):\n *\n * ```ts\n * const map = [\n * [ '00', '01', '02', '03' ],\n * [ null, '11', null, '13' ],\n * [ '20', null, null, '23' ]\n * ]\n * ```\n *\n * This allows for a quick access to table at give row & column. For instance to access table cell \"13\" from pasted table call:\n *\n * ```ts\n * const cell = map[ 1 ][ 3 ]\n * ```\n */\nfunction createLocationMap(table, width, height) {\n // Create height x width (row x column) two-dimensional table to store cells.\n const map = new Array(height).fill(null)\n .map(() => new Array(width).fill(null));\n for (const { column, row, cell } of new TableWalker(table)) {\n map[row][column] = cell;\n }\n return map;\n}\n/**\n * Make selected cells rectangular by splitting the cells that stand out from a rectangular selection.\n *\n * In the table below a selection is shown with \"::\" and slots with anchor cells are named.\n *\n * +----+----+----+----+----+ +----+----+----+----+----+\n * | 00 | 01 | 02 | 03 | | 00 | 01 | 02 | 03 |\n * + +----+ +----+----+ | ::::::::::::::::----+\n * | | 11 | | 13 | 14 | | ::11 | | 13:: 14 | <- first row\n * +----+----+ + +----+ +----::---| | ::----+\n * | 20 | 21 | | | 24 | select cells: | 20 ::21 | | :: 24 |\n * +----+----+ +----+----+ 11 -> 33 +----::---| |---::----+\n * | 30 | | 33 | 34 | | 30 :: | | 33:: 34 | <- last row\n * + + +----+ + | :::::::::::::::: +\n * | | | 43 | | | | | 43 | |\n * +----+----+----+----+----+ +----+----+----+----+----+\n * ^ ^\n * first & last columns\n *\n * Will update table to:\n *\n * +----+----+----+----+----+\n * | 00 | 01 | 02 | 03 |\n * + +----+----+----+----+\n * | | 11 | | 13 | 14 |\n * +----+----+ + +----+\n * | 20 | 21 | | | 24 |\n * +----+----+ +----+----+\n * | 30 | | | 33 | 34 |\n * + +----+----+----+ +\n * | | | | 43 | |\n * +----+----+----+----+----+\n *\n * In th example above:\n * - Cell \"02\" which have `rowspan = 4` must be trimmed at first and at after last row.\n * - Cell \"03\" which have `rowspan = 2` and `colspan = 2` must be trimmed at first column and after last row.\n * - Cells \"00\", \"03\" & \"30\" which cannot be cut by this algorithm as they are outside the trimmed area.\n * - Cell \"13\" cannot be cut as it is inside the trimmed area.\n */\nfunction splitCellsToRectangularSelection(table, dimensions, writer) {\n const { firstRow, lastRow, firstColumn, lastColumn } = dimensions;\n const rowIndexes = { first: firstRow, last: lastRow };\n const columnIndexes = { first: firstColumn, last: lastColumn };\n // 1. Split cells vertically in two steps as first step might create cells that needs to split again.\n doVerticalSplit(table, firstColumn, rowIndexes, writer);\n doVerticalSplit(table, lastColumn + 1, rowIndexes, writer);\n // 2. Split cells horizontally in two steps as first step might create cells that needs to split again.\n doHorizontalSplit(table, firstRow, columnIndexes, writer);\n doHorizontalSplit(table, lastRow + 1, columnIndexes, writer, firstRow);\n}\nfunction doHorizontalSplit(table, splitRow, limitColumns, writer, startRow = 0) {\n // If selection starts at first row then no split is needed.\n if (splitRow < 1) {\n return;\n }\n const overlappingCells = getVerticallyOverlappingCells(table, splitRow, startRow);\n // Filter out cells that are not touching insides of the rectangular selection.\n const cellsToSplit = overlappingCells.filter(({ column, cellWidth }) => isAffectedBySelection(column, cellWidth, limitColumns));\n return cellsToSplit.map(({ cell }) => splitHorizontally(cell, splitRow, writer));\n}\nfunction doVerticalSplit(table, splitColumn, limitRows, writer) {\n // If selection starts at first column then no split is needed.\n if (splitColumn < 1) {\n return;\n }\n const overlappingCells = getHorizontallyOverlappingCells(table, splitColumn);\n // Filter out cells that are not touching insides of the rectangular selection.\n const cellsToSplit = overlappingCells.filter(({ row, cellHeight }) => isAffectedBySelection(row, cellHeight, limitRows));\n return cellsToSplit.map(({ cell, column }) => splitVertically(cell, column, splitColumn, writer));\n}\n/**\n * Checks if cell at given row (column) is affected by a rectangular selection defined by first/last column (row).\n *\n * The same check is used for row as for column.\n */\nfunction isAffectedBySelection(index, span, limit) {\n const endIndex = index + span - 1;\n const { first, last } = limit;\n const isInsideSelection = index >= first && index <= last;\n const overlapsSelectionFromOutside = index < first && endIndex >= first;\n return isInsideSelection || overlapsSelectionFromOutside;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tablekeyboard\n */\nimport TableSelection from './tableselection';\nimport TableWalker from './tablewalker';\nimport TableUtils from './tableutils';\nimport { Plugin } from 'ckeditor5/src/core';\nimport { getLocalizedArrowKeyCodeDirection } from 'ckeditor5/src/utils';\n/**\n * This plugin enables keyboard navigation for tables.\n * It is loaded automatically by the {@link module:table/table~Table} plugin.\n */\nexport default class TableKeyboard extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableKeyboard';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TableSelection, TableUtils];\n }\n /**\n * @inheritDoc\n */\n init() {\n const view = this.editor.editing.view;\n const viewDocument = view.document;\n this.listenTo(viewDocument, 'arrowKey', (...args) => this._onArrowKey(...args), { context: 'table' });\n this.listenTo(viewDocument, 'tab', (...args) => this._handleTabOnSelectedTable(...args), { context: 'figure' });\n this.listenTo(viewDocument, 'tab', (...args) => this._handleTab(...args), { context: ['th', 'td'] });\n }\n /**\n * Handles {@link module:engine/view/document~Document#event:tab tab} events for the <kbd>Tab</kbd> key executed\n * when the table widget is selected.\n */\n _handleTabOnSelectedTable(bubblingEventInfo, domEventData) {\n const editor = this.editor;\n const selection = editor.model.document.selection;\n const selectedElement = selection.getSelectedElement();\n if (!selectedElement || !selectedElement.is('element', 'table')) {\n return;\n }\n domEventData.preventDefault();\n domEventData.stopPropagation();\n bubblingEventInfo.stop();\n editor.model.change(writer => {\n writer.setSelection(writer.createRangeIn(selectedElement.getChild(0).getChild(0)));\n });\n }\n /**\n * Handles {@link module:engine/view/document~Document#event:tab tab} events for the <kbd>Tab</kbd> key executed\n * inside table cells.\n */\n _handleTab(bubblingEventInfo, domEventData) {\n const editor = this.editor;\n const tableUtils = this.editor.plugins.get(TableUtils);\n const tableSelection = this.editor.plugins.get('TableSelection');\n const selection = editor.model.document.selection;\n const isForward = !domEventData.shiftKey;\n let tableCell = tableUtils.getTableCellsContainingSelection(selection)[0];\n if (!tableCell) {\n tableCell = tableSelection.getFocusCell();\n }\n if (!tableCell) {\n return;\n }\n domEventData.preventDefault();\n domEventData.stopPropagation();\n bubblingEventInfo.stop();\n const tableRow = tableCell.parent;\n const table = tableRow.parent;\n const currentRowIndex = table.getChildIndex(tableRow);\n const currentCellIndex = tableRow.getChildIndex(tableCell);\n const isFirstCellInRow = currentCellIndex === 0;\n if (!isForward && isFirstCellInRow && currentRowIndex === 0) {\n // Set the selection over the whole table if the selection was in the first table cell.\n editor.model.change(writer => {\n writer.setSelection(writer.createRangeOn(table));\n });\n return;\n }\n const isLastCellInRow = currentCellIndex === tableRow.childCount - 1;\n const isLastRow = currentRowIndex === tableUtils.getRows(table) - 1;\n if (isForward && isLastRow && isLastCellInRow) {\n editor.execute('insertTableRowBelow');\n // Check if the command actually added a row. If `insertTableRowBelow` execution didn't add a row (because it was disabled\n // or it got overwritten) set the selection over the whole table to mirror the first cell case.\n if (currentRowIndex === tableUtils.getRows(table) - 1) {\n editor.model.change(writer => {\n writer.setSelection(writer.createRangeOn(table));\n });\n return;\n }\n }\n let cellToFocus;\n // Move to the first cell in the next row.\n if (isForward && isLastCellInRow) {\n const nextRow = table.getChild(currentRowIndex + 1);\n cellToFocus = nextRow.getChild(0);\n }\n // Move to the last cell in the previous row.\n else if (!isForward && isFirstCellInRow) {\n const previousRow = table.getChild(currentRowIndex - 1);\n cellToFocus = previousRow.getChild(previousRow.childCount - 1);\n }\n // Move to the next/previous cell.\n else {\n cellToFocus = tableRow.getChild(currentCellIndex + (isForward ? 1 : -1));\n }\n editor.model.change(writer => {\n writer.setSelection(writer.createRangeIn(cellToFocus));\n });\n }\n /**\n * Handles {@link module:engine/view/document~Document#event:keydown keydown} events.\n */\n _onArrowKey(eventInfo, domEventData) {\n const editor = this.editor;\n const keyCode = domEventData.keyCode;\n const direction = getLocalizedArrowKeyCodeDirection(keyCode, editor.locale.contentLanguageDirection);\n const wasHandled = this._handleArrowKeys(direction, domEventData.shiftKey);\n if (wasHandled) {\n domEventData.preventDefault();\n domEventData.stopPropagation();\n eventInfo.stop();\n }\n }\n /**\n * Handles arrow keys to move the selection around the table.\n *\n * @param direction The direction of the arrow key.\n * @param expandSelection If the current selection should be expanded.\n * @returns Returns `true` if key was handled.\n */\n _handleArrowKeys(direction, expandSelection) {\n const tableUtils = this.editor.plugins.get(TableUtils);\n const tableSelection = this.editor.plugins.get('TableSelection');\n const model = this.editor.model;\n const selection = model.document.selection;\n const isForward = ['right', 'down'].includes(direction);\n // In case one or more table cells are selected (from outside),\n // move the selection to a cell adjacent to the selected table fragment.\n const selectedCells = tableUtils.getSelectedTableCells(selection);\n if (selectedCells.length) {\n let focusCell;\n if (expandSelection) {\n focusCell = tableSelection.getFocusCell();\n }\n else {\n focusCell = isForward ? selectedCells[selectedCells.length - 1] : selectedCells[0];\n }\n this._navigateFromCellInDirection(focusCell, direction, expandSelection);\n return true;\n }\n // Abort if we're not in a table cell.\n const tableCell = selection.focus.findAncestor('tableCell');\n /* istanbul ignore if: paranoid check -- @preserve */\n if (!tableCell) {\n return false;\n }\n // When the selection is not collapsed.\n if (!selection.isCollapsed) {\n if (expandSelection) {\n // Navigation is in the opposite direction than the selection direction so this is shrinking of the selection.\n // Selection for sure will not approach cell edge.\n //\n // With a special case when all cell content is selected - then selection should expand to the other cell.\n // Note: When the entire cell gets selected using CTRL+A, the selection is always forward.\n if (selection.isBackward == isForward && !selection.containsEntireContent(tableCell)) {\n return false;\n }\n }\n else {\n const selectedElement = selection.getSelectedElement();\n // It will collapse for non-object selected so it's not going to move to other cell.\n if (!selectedElement || !model.schema.isObject(selectedElement)) {\n return false;\n }\n }\n }\n // Let's check if the selection is at the beginning/end of the cell.\n if (this._isSelectionAtCellEdge(selection, tableCell, isForward)) {\n this._navigateFromCellInDirection(tableCell, direction, expandSelection);\n return true;\n }\n return false;\n }\n /**\n * Returns `true` if the selection is at the boundary of a table cell according to the navigation direction.\n *\n * @param selection The current selection.\n * @param tableCell The current table cell element.\n * @param isForward The expected navigation direction.\n */\n _isSelectionAtCellEdge(selection, tableCell, isForward) {\n const model = this.editor.model;\n const schema = this.editor.model.schema;\n const focus = isForward ? selection.getLastPosition() : selection.getFirstPosition();\n // If the current limit element is not table cell we are for sure not at the cell edge.\n // Also `modifySelection` will not let us out of it.\n if (!schema.getLimitElement(focus).is('element', 'tableCell')) {\n const boundaryPosition = model.createPositionAt(tableCell, isForward ? 'end' : 0);\n return boundaryPosition.isTouching(focus);\n }\n const probe = model.createSelection(focus);\n model.modifySelection(probe, { direction: isForward ? 'forward' : 'backward' });\n // If there was no change in the focus position, then it's not possible to move the selection there.\n return focus.isEqual(probe.focus);\n }\n /**\n * Moves the selection from the given table cell in the specified direction.\n *\n * @param focusCell The table cell that is current multi-cell selection focus.\n * @param direction Direction in which selection should move.\n * @param expandSelection If the current selection should be expanded. Default value is false.\n */\n _navigateFromCellInDirection(focusCell, direction, expandSelection = false) {\n const model = this.editor.model;\n const table = focusCell.findAncestor('table');\n const tableMap = [...new TableWalker(table, { includeAllSlots: true })];\n const { row: lastRow, column: lastColumn } = tableMap[tableMap.length - 1];\n const currentCellInfo = tableMap.find(({ cell }) => cell == focusCell);\n let { row, column } = currentCellInfo;\n switch (direction) {\n case 'left':\n column--;\n break;\n case 'up':\n row--;\n break;\n case 'right':\n column += currentCellInfo.cellWidth;\n break;\n case 'down':\n row += currentCellInfo.cellHeight;\n break;\n }\n const isOutsideVertically = row < 0 || row > lastRow;\n const isBeforeFirstCell = column < 0 && row <= 0;\n const isAfterLastCell = column > lastColumn && row >= lastRow;\n // Note that if the table cell at the end of a row is row-spanned then isAfterLastCell will never be true.\n // However, we don't know if user was navigating on the last row or not, so let's stay in the table.\n if (isOutsideVertically || isBeforeFirstCell || isAfterLastCell) {\n model.change(writer => {\n writer.setSelection(writer.createRangeOn(table));\n });\n return;\n }\n if (column < 0) {\n column = expandSelection ? 0 : lastColumn;\n row--;\n }\n else if (column > lastColumn) {\n column = expandSelection ? lastColumn : 0;\n row++;\n }\n const cellToSelect = tableMap.find(cellInfo => cellInfo.row == row && cellInfo.column == column).cell;\n const isForward = ['right', 'down'].includes(direction);\n const tableSelection = this.editor.plugins.get('TableSelection');\n if (expandSelection && tableSelection.isEnabled) {\n const anchorCell = tableSelection.getAnchorCell() || focusCell;\n tableSelection.setCellSelection(anchorCell, cellToSelect);\n }\n else {\n const positionToSelect = model.createPositionAt(cellToSelect, isForward ? 0 : 'end');\n model.change(writer => {\n writer.setSelection(positionToSelect);\n });\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tablemouse/mouseeventsobserver\n */\nimport { DomEventObserver } from 'ckeditor5/src/engine';\n/**\n * The mouse selection event observer.\n *\n * It registers listeners for the following DOM events:\n *\n * - `'mousemove'`\n * - `'mouseleave'`\n *\n * Note that this observer is disabled by default. To enable this observer, it needs to be added to\n * {@link module:engine/view/view~View} using the {@link module:engine/view/view~View#addObserver} method.\n *\n * The observer is registered by the {@link module:table/tableselection~TableSelection} plugin.\n */\nexport default class MouseEventsObserver extends DomEventObserver {\n constructor() {\n super(...arguments);\n this.domEventType = [\n 'mousemove', 'mouseleave'\n ];\n }\n /**\n * @inheritDoc\n */\n onDomEvent(domEvent) {\n this.fire(domEvent.type, domEvent);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tablemouse\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport TableSelection from './tableselection';\nimport MouseEventsObserver from './tablemouse/mouseeventsobserver';\nimport TableUtils from './tableutils';\n/**\n * This plugin enables a table cells' selection with the mouse.\n * It is loaded automatically by the {@link module:table/table~Table} plugin.\n */\nexport default class TableMouse extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableMouse';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TableSelection, TableUtils];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Currently the MouseObserver only handles `mousedown` and `mouseup` events.\n // TODO move to the engine?\n editor.editing.view.addObserver(MouseEventsObserver);\n this._enableShiftClickSelection();\n this._enableMouseDragSelection();\n }\n /**\n * Enables making cells selection by <kbd>Shift</kbd>+click. Creates a selection from the cell which previously held\n * the selection to the cell which was clicked. It can be the same cell, in which case it selects a single cell.\n */\n _enableShiftClickSelection() {\n const editor = this.editor;\n const tableUtils = editor.plugins.get(TableUtils);\n let blockSelectionChange = false;\n const tableSelection = editor.plugins.get(TableSelection);\n this.listenTo(editor.editing.view.document, 'mousedown', (evt, domEventData) => {\n const selection = editor.model.document.selection;\n if (!this.isEnabled || !tableSelection.isEnabled) {\n return;\n }\n if (!domEventData.domEvent.shiftKey) {\n return;\n }\n const anchorCell = tableSelection.getAnchorCell() || tableUtils.getTableCellsContainingSelection(selection)[0];\n if (!anchorCell) {\n return;\n }\n const targetCell = this._getModelTableCellFromDomEvent(domEventData);\n if (targetCell && haveSameTableParent(anchorCell, targetCell)) {\n blockSelectionChange = true;\n tableSelection.setCellSelection(anchorCell, targetCell);\n domEventData.preventDefault();\n }\n });\n this.listenTo(editor.editing.view.document, 'mouseup', () => {\n blockSelectionChange = false;\n });\n // We need to ignore a `selectionChange` event that is fired after we render our new table cells selection.\n // When downcasting table cells selection to the view, we put the view selection in the last selected cell\n // in a place that may not be natively a \"correct\" location. This is we put it directly in the `<td>` element.\n // All browsers fire the native `selectionchange` event.\n // However, all browsers except Safari return the selection in the exact place where we put it\n // (even though it's visually normalized). Safari returns `<td><p>^foo` that makes our selection observer\n // fire our `selectionChange` event (because the view selection that we set in the first step differs from the DOM selection).\n // Since `selectionChange` is fired, we automatically update the model selection that moves it that paragraph.\n // This breaks our dear cells selection.\n //\n // Theoretically this issue concerns only Safari that is the only browser that do normalize the selection.\n // However, to avoid code branching and to have a good coverage for this event blocker, I enabled it for all browsers.\n //\n // Note: I'm keeping the `blockSelectionChange` state separately for shift+click and mouse drag (exact same logic)\n // so I don't have to try to analyze whether they don't overlap in some weird cases. Probably they don't.\n // But I have other things to do, like writing this comment.\n this.listenTo(editor.editing.view.document, 'selectionChange', evt => {\n if (blockSelectionChange) {\n // @if CK_DEBUG // console.log( 'Blocked selectionChange to avoid breaking table cells selection.' );\n evt.stop();\n }\n }, { priority: 'highest' });\n }\n /**\n * Enables making cells selection by dragging.\n *\n * The selection is made only on mousemove. Mouse tracking is started on mousedown.\n * However, the cells selection is enabled only after the mouse cursor left the anchor cell.\n * Thanks to that normal text selection within one cell works just fine. However, you can still select\n * just one cell by leaving the anchor cell and moving back to it.\n */\n _enableMouseDragSelection() {\n const editor = this.editor;\n let anchorCell, targetCell;\n let beganCellSelection = false;\n let blockSelectionChange = false;\n const tableSelection = editor.plugins.get(TableSelection);\n this.listenTo(editor.editing.view.document, 'mousedown', (evt, domEventData) => {\n if (!this.isEnabled || !tableSelection.isEnabled) {\n return;\n }\n // Make sure to not conflict with the shift+click listener and any other possible handler.\n if (domEventData.domEvent.shiftKey || domEventData.domEvent.ctrlKey || domEventData.domEvent.altKey) {\n return;\n }\n anchorCell = this._getModelTableCellFromDomEvent(domEventData);\n });\n this.listenTo(editor.editing.view.document, 'mousemove', (evt, domEventData) => {\n if (!domEventData.domEvent.buttons) {\n return;\n }\n if (!anchorCell) {\n return;\n }\n const newTargetCell = this._getModelTableCellFromDomEvent(domEventData);\n if (newTargetCell && haveSameTableParent(anchorCell, newTargetCell)) {\n targetCell = newTargetCell;\n // Switch to the cell selection mode after the mouse cursor left the anchor cell.\n // Switch off only on mouseup (makes selecting a single cell possible).\n if (!beganCellSelection && targetCell != anchorCell) {\n beganCellSelection = true;\n }\n }\n // Yep, not making a cell selection yet. See method docs.\n if (!beganCellSelection) {\n return;\n }\n blockSelectionChange = true;\n tableSelection.setCellSelection(anchorCell, targetCell);\n domEventData.preventDefault();\n });\n this.listenTo(editor.editing.view.document, 'mouseup', () => {\n beganCellSelection = false;\n blockSelectionChange = false;\n anchorCell = null;\n targetCell = null;\n });\n // See the explanation in `_enableShiftClickSelection()`.\n this.listenTo(editor.editing.view.document, 'selectionChange', evt => {\n if (blockSelectionChange) {\n // @if CK_DEBUG // console.log( 'Blocked selectionChange to avoid breaking table cells selection.' );\n evt.stop();\n }\n }, { priority: 'highest' });\n }\n /**\n * Returns the model table cell element based on the target element of the passed DOM event.\n *\n * @returns Returns the table cell or `undefined`.\n */\n _getModelTableCellFromDomEvent(domEventData) {\n // Note: Work with positions (not element mapping) because the target element can be an attribute or other non-mapped element.\n const viewTargetElement = domEventData.target;\n const viewPosition = this.editor.editing.view.createPositionAt(viewTargetElement, 0);\n const modelPosition = this.editor.editing.mapper.toModelPosition(viewPosition);\n const modelElement = modelPosition.parent;\n return modelElement.findAncestor('tableCell', { includeSelf: true });\n }\n}\nfunction haveSameTableParent(cellA, cellB) {\n return cellA.parent.parent == cellB.parent.parent;\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./table.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Injects a table caption post-fixer into the model.\n *\n * The role of the table caption post-fixer is to ensure that the table with caption have the correct structure\n * after a {@link module:engine/model/model~Model#change `change()`} block was executed.\n *\n * The correct structure means that:\n *\n * * If there are many caption model element, they are merged into one model.\n * * A final, merged caption model is placed at the end of the table.\n */\nexport default function injectTableCaptionPostFixer(model) {\n model.document.registerPostFixer(writer => tableCaptionPostFixer(writer, model));\n}\n/**\n * The table caption post-fixer.\n */\nfunction tableCaptionPostFixer(writer, model) {\n const changes = model.document.differ.getChanges();\n let wasFixed = false;\n for (const entry of changes) {\n if (entry.type != 'insert') {\n continue;\n }\n const positionParent = entry.position.parent;\n if (positionParent.is('element', 'table') || entry.name == 'table') {\n const table = (entry.name == 'table' ? entry.position.nodeAfter : positionParent);\n const captionsToMerge = Array.from(table.getChildren())\n .filter((child) => child.is('element', 'caption'));\n const firstCaption = captionsToMerge.shift();\n if (!firstCaption) {\n continue;\n }\n // Move all the contents of the captions to the first one.\n for (const caption of captionsToMerge) {\n writer.move(writer.createRangeIn(caption), firstCaption, 'end');\n writer.remove(caption);\n }\n // Make sure the final caption is at the end of the table.\n if (firstCaption.nextSibling) {\n writer.move(writer.createRangeOn(firstCaption), table, 'end');\n wasFixed = true;\n }\n // Do we merged captions and/or moved the single caption to the end of the table?\n wasFixed = !!captionsToMerge.length || wasFixed;\n }\n }\n return wasFixed;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Checks if the provided model element is a `table`.\n *\n * @param modelElement Element to check if it is a table.\n */\nexport function isTable(modelElement) {\n return !!modelElement && modelElement.is('element', 'table');\n}\n/**\n * Returns the caption model element from a given table element. Returns `null` if no caption is found.\n *\n * @param tableModelElement Table element in which we will try to find a caption element.\n */\nexport function getCaptionFromTableModelElement(tableModelElement) {\n for (const node of tableModelElement.getChildren()) {\n if (node.is('element', 'caption')) {\n return node;\n }\n }\n return null;\n}\n/**\n * Returns the caption model element for a model selection. Returns `null` if the selection has no caption element ancestor.\n *\n * @param selection The selection checked for caption presence.\n */\nexport function getCaptionFromModelSelection(selection) {\n const tableElement = getSelectionAffectedTable(selection);\n if (!tableElement) {\n return null;\n }\n return getCaptionFromTableModelElement(tableElement);\n}\n/**\n * {@link module:engine/view/matcher~Matcher} pattern. Checks if a given element is a caption.\n *\n * There are two possible forms of the valid caption:\n * - A `<figcaption>` element inside a `<figure class=\"table\">` element.\n * - A `<caption>` inside a <table>.\n *\n * @returns Returns the object accepted by {@link module:engine/view/matcher~Matcher} or `null` if the element cannot be matched.\n */\nexport function matchTableCaptionViewElement(element) {\n const parent = element.parent;\n if (element.name == 'figcaption' && parent && parent.is('element', 'figure') && parent.hasClass('table')) {\n return { name: true };\n }\n if (element.name == 'caption' && parent && parent.is('element', 'table')) {\n return { name: true };\n }\n return null;\n}\n/**\n * Depending on the position of the selection we either return the table under cursor or look for the table higher in the hierarchy.\n */\nexport function getSelectionAffectedTable(selection) {\n const selectedElement = selection.getSelectedElement();\n // Is the command triggered from the `tableToolbar`?\n if (selectedElement && selectedElement.is('element', 'table')) {\n return selectedElement;\n }\n return selection.getFirstPosition().findAncestor('table');\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n* @module table/tablecaption/toggletablecaptioncommand\n*/\nimport { Command } from 'ckeditor5/src/core';\nimport { getCaptionFromTableModelElement, getSelectionAffectedTable } from './utils';\n/**\n * The toggle table caption command.\n *\n * This command is registered by {@link module:table/tablecaption/tablecaptionediting~TableCaptionEditing} as the\n * `'toggleTableCaption'` editor command.\n *\n * Executing this command:\n *\n * * either adds or removes the table caption of a selected table (depending on whether the caption is present or not),\n * * removes the table caption if the selection is anchored in one.\n *\n * ```ts\n * // Toggle the presence of the caption.\n * editor.execute( 'toggleTableCaption' );\n * ```\n *\n * **Note**: You can move the selection to the caption right away as it shows up upon executing this command by using\n * the `focusCaptionOnShow` option:\n *\n * ```ts\n * editor.execute( 'toggleTableCaption', { focusCaptionOnShow: true } );\n * ```\n */\nexport default class ToggleTableCaptionCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const editor = this.editor;\n const tableElement = getSelectionAffectedTable(editor.model.document.selection);\n this.isEnabled = !!tableElement;\n if (!this.isEnabled) {\n this.value = false;\n }\n else {\n this.value = !!getCaptionFromTableModelElement(tableElement);\n }\n }\n /**\n * Executes the command.\n *\n * ```ts\n * editor.execute( 'toggleTableCaption' );\n * ```\n *\n * @param options Options for the executed command.\n * @param options.focusCaptionOnShow When true and the caption shows up, the selection will be moved into it straight away.\n * @fires execute\n */\n execute({ focusCaptionOnShow = false } = {}) {\n this.editor.model.change(writer => {\n if (this.value) {\n this._hideTableCaption(writer);\n }\n else {\n this._showTableCaption(writer, focusCaptionOnShow);\n }\n });\n }\n /**\n * Shows the table caption. Also:\n *\n * * it attempts to restore the caption content from the `TableCaptionEditing` caption registry,\n * * it moves the selection to the caption right away, it the `focusCaptionOnShow` option was set.\n *\n * @param focusCaptionOnShow Default focus behavior when showing the caption.\n */\n _showTableCaption(writer, focusCaptionOnShow) {\n const model = this.editor.model;\n const tableElement = getSelectionAffectedTable(model.document.selection);\n const tableCaptionEditing = this.editor.plugins.get('TableCaptionEditing');\n const savedCaptionElement = tableCaptionEditing._getSavedCaption(tableElement);\n // Try restoring the caption from the TableCaptionEditing plugin storage.\n const newCaptionElement = savedCaptionElement || writer.createElement('caption');\n model.insertContent(newCaptionElement, tableElement, 'end');\n if (focusCaptionOnShow) {\n writer.setSelection(newCaptionElement, 'in');\n }\n }\n /**\n * Hides the caption of a selected table (or an table caption the selection is anchored to).\n *\n * The content of the caption is stored in the `TableCaptionEditing` caption registry to make this\n * a reversible action.\n */\n _hideTableCaption(writer) {\n const model = this.editor.model;\n const tableElement = getSelectionAffectedTable(model.document.selection);\n const tableCaptionEditing = this.editor.plugins.get('TableCaptionEditing');\n const captionElement = getCaptionFromTableModelElement(tableElement);\n // Store the caption content so it can be restored quickly if the user changes their mind.\n tableCaptionEditing._saveCaption(tableElement, captionElement);\n model.deleteContent(writer.createSelection(captionElement, 'on'));\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tablecaption/tablecaptionediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Element, enablePlaceholder } from 'ckeditor5/src/engine';\nimport { toWidgetEditable } from 'ckeditor5/src/widget';\nimport injectTableCaptionPostFixer from '../converters/table-caption-post-fixer';\nimport ToggleTableCaptionCommand from './toggletablecaptioncommand';\nimport { isTable, matchTableCaptionViewElement } from './utils';\n/**\n * The table caption editing plugin.\n */\nexport default class TableCaptionEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableCaptionEditing';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n this._savedCaptionsMap = new WeakMap();\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n const view = editor.editing.view;\n const t = editor.t;\n if (!schema.isRegistered('caption')) {\n schema.register('caption', {\n allowIn: 'table',\n allowContentOf: '$block',\n isLimit: true\n });\n }\n else {\n schema.extend('caption', {\n allowIn: 'table'\n });\n }\n editor.commands.add('toggleTableCaption', new ToggleTableCaptionCommand(this.editor));\n // View -> model converter for the data pipeline.\n editor.conversion.for('upcast').elementToElement({\n view: matchTableCaptionViewElement,\n model: 'caption'\n });\n // Model -> view converter for the data pipeline.\n editor.conversion.for('dataDowncast').elementToElement({\n model: 'caption',\n view: (modelElement, { writer }) => {\n if (!isTable(modelElement.parent)) {\n return null;\n }\n return writer.createContainerElement('figcaption');\n }\n });\n // Model -> view converter for the editing pipeline.\n editor.conversion.for('editingDowncast').elementToElement({\n model: 'caption',\n view: (modelElement, { writer }) => {\n if (!isTable(modelElement.parent)) {\n return null;\n }\n const figcaptionElement = writer.createEditableElement('figcaption');\n writer.setCustomProperty('tableCaption', true, figcaptionElement);\n enablePlaceholder({\n view,\n element: figcaptionElement,\n text: t('Enter table caption'),\n keepOnFocus: true\n });\n return toWidgetEditable(figcaptionElement, writer);\n }\n });\n injectTableCaptionPostFixer(editor.model);\n }\n /**\n * Returns the saved {@link module:engine/model/element~Element#toJSON JSONified} caption\n * of a table model element.\n *\n * See {@link #_saveCaption}.\n *\n * @internal\n * @param tableModelElement The model element the caption should be returned for.\n * @returns The model caption element or `null` if there is none.\n */\n _getSavedCaption(tableModelElement) {\n const jsonObject = this._savedCaptionsMap.get(tableModelElement);\n return jsonObject ? Element.fromJSON(jsonObject) : null;\n }\n /**\n * Saves a {@link module:engine/model/element~Element#toJSON JSONified} caption for\n * a table element to allow restoring it in the future.\n *\n * A caption is saved every time it gets hidden. The\n * user should be able to restore it on demand.\n *\n * **Note**: The caption cannot be stored in the table model element attribute because,\n * for instance, when the model state propagates to collaborators, the attribute would get\n * lost (mainly because it does not convert to anything when the caption is hidden) and\n * the states of collaborators' models would de-synchronize causing numerous issues.\n *\n * See {@link #_getSavedCaption}.\n *\n * @internal\n * @param tableModelElement The model element the caption is saved for.\n * @param caption The caption model element to be saved.\n */\n _saveCaption(tableModelElement, caption) {\n this._savedCaptionsMap.set(tableModelElement, caption.toJSON());\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n* @module table/tablecaption/tablecaptionui\n*/\nimport { Plugin, icons } from 'ckeditor5/src/core';\nimport { ButtonView } from 'ckeditor5/src/ui';\nimport { getCaptionFromModelSelection } from './utils';\n/**\n * The table caption UI plugin. It introduces the `'toggleTableCaption'` UI button.\n */\nexport default class TableCaptionUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableCaptionUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const editingView = editor.editing.view;\n const t = editor.t;\n editor.ui.componentFactory.add('toggleTableCaption', locale => {\n const command = editor.commands.get('toggleTableCaption');\n const view = new ButtonView(locale);\n view.set({\n icon: icons.caption,\n tooltip: true,\n isToggleable: true\n });\n view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n view.bind('label').to(command, 'value', value => value ? t('Toggle caption off') : t('Toggle caption on'));\n this.listenTo(view, 'execute', () => {\n editor.execute('toggleTableCaption', { focusCaptionOnShow: true });\n // Scroll to the selection and highlight the caption if the caption showed up.\n if (command.value) {\n const modelCaptionElement = getCaptionFromModelSelection(editor.model.document.selection);\n const figcaptionElement = editor.editing.mapper.toViewElement(modelCaptionElement);\n if (!figcaptionElement) {\n return;\n }\n editingView.scrollToTheSelection();\n editingView.change(writer => {\n writer.addClass('table__caption_highlighted', figcaptionElement);\n });\n }\n editor.editing.view.focus();\n });\n return view;\n });\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tablecaption.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./colorinput.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/ui/colorinputview\n */\nimport { View, InputTextView, ButtonView, createDropdown, ColorGridView, FocusCycler, ViewCollection } from 'ckeditor5/src/ui';\nimport { icons } from 'ckeditor5/src/core';\nimport { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils';\nimport '../../theme/colorinput.css';\n/**\n * The color input view class. It allows the user to type in a color (hex, rgb, etc.)\n * or choose it from the configurable color palette with a preview.\n *\n * @internal\n */\nexport default class ColorInputView extends View {\n /**\n * Creates an instance of the color input view.\n *\n * @param locale The locale instance.\n * @param options The input options.\n * @param options.colorDefinitions The colors to be displayed in the palette inside the input's dropdown.\n * @param options.columns The number of columns in which the colors will be displayed.\n * @param options.defaultColorValue If specified, the color input view will replace the \"Remove color\" button with\n * the \"Restore default\" button. Instead of clearing the input field, the default color value will be set.\n */\n constructor(locale, options) {\n super(locale);\n this.set('value', '');\n this.set('isReadOnly', false);\n this.set('isFocused', false);\n this.set('isEmpty', true);\n this.options = options;\n this.focusTracker = new FocusTracker();\n this._focusables = new ViewCollection();\n this.dropdownView = this._createDropdownView();\n this.inputView = this._createInputTextView();\n this.keystrokes = new KeystrokeHandler();\n this._stillTyping = false;\n this._focusCycler = new FocusCycler({\n focusables: this._focusables,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate items backwards using the <kbd>Shift</kbd> + <kbd>Tab</kbd> keystroke.\n focusPrevious: 'shift + tab',\n // Navigate items forwards using the <kbd>Tab</kbd> key.\n focusNext: 'tab'\n }\n });\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-input-color'\n ]\n },\n children: [\n this.dropdownView,\n this.inputView\n ]\n });\n this.on('change:value', (evt, name, inputValue) => this._setInputValue(inputValue));\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n // Start listening for the keystrokes coming from the dropdown panel view.\n this.keystrokes.listenTo(this.dropdownView.panelView.element);\n }\n /**\n * Focuses the input.\n */\n focus() {\n this.inputView.focus();\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Creates and configures the {@link #dropdownView}.\n */\n _createDropdownView() {\n const locale = this.locale;\n const t = locale.t;\n const bind = this.bindTemplate;\n const colorGrid = this._createColorGrid(locale);\n const dropdown = createDropdown(locale);\n const colorPreview = new View();\n const removeColorButton = this._createRemoveColorButton();\n colorPreview.setTemplate({\n tag: 'span',\n attributes: {\n class: [\n 'ck',\n 'ck-input-color__button__preview'\n ],\n style: {\n backgroundColor: bind.to('value')\n }\n },\n children: [{\n tag: 'span',\n attributes: {\n class: [\n 'ck',\n 'ck-input-color__button__preview__no-color-indicator',\n bind.if('value', 'ck-hidden', value => value != '')\n ]\n }\n }]\n });\n dropdown.buttonView.extendTemplate({\n attributes: {\n class: 'ck-input-color__button'\n }\n });\n dropdown.buttonView.children.add(colorPreview);\n dropdown.buttonView.label = t('Color picker');\n dropdown.buttonView.tooltip = true;\n dropdown.panelPosition = locale.uiLanguageDirection === 'rtl' ? 'se' : 'sw';\n dropdown.panelView.children.add(removeColorButton);\n dropdown.panelView.children.add(colorGrid);\n dropdown.bind('isEnabled').to(this, 'isReadOnly', value => !value);\n this._focusables.add(removeColorButton);\n this._focusables.add(colorGrid);\n this.focusTracker.add(removeColorButton.element);\n this.focusTracker.add(colorGrid.element);\n return dropdown;\n }\n /**\n * Creates and configures an instance of {@link module:ui/inputtext/inputtextview~InputTextView}.\n *\n * @returns A configured instance to be set as {@link #inputView}.\n */\n _createInputTextView() {\n const locale = this.locale;\n const inputView = new InputTextView(locale);\n inputView.extendTemplate({\n on: {\n blur: inputView.bindTemplate.to('blur')\n }\n });\n inputView.value = this.value;\n inputView.bind('isReadOnly', 'hasError').to(this);\n this.bind('isFocused', 'isEmpty').to(inputView);\n inputView.on('input', () => {\n const inputValue = inputView.element.value;\n // Check if the value matches one of our defined colors' label.\n const mappedColor = this.options.colorDefinitions.find(def => inputValue === def.label);\n this._stillTyping = true;\n this.value = mappedColor && mappedColor.color || inputValue;\n });\n inputView.on('blur', () => {\n this._stillTyping = false;\n this._setInputValue(inputView.element.value);\n });\n inputView.delegate('input').to(this);\n return inputView;\n }\n /**\n * Creates and configures the button that clears the color.\n */\n _createRemoveColorButton() {\n const locale = this.locale;\n const t = locale.t;\n const removeColorButton = new ButtonView(locale);\n const defaultColor = this.options.defaultColorValue || '';\n const removeColorButtonLabel = defaultColor ? t('Restore default') : t('Remove color');\n removeColorButton.class = 'ck-input-color__remove-color';\n removeColorButton.withText = true;\n removeColorButton.icon = icons.eraser;\n removeColorButton.label = removeColorButtonLabel;\n removeColorButton.on('execute', () => {\n this.value = defaultColor;\n this.dropdownView.isOpen = false;\n this.fire('input');\n });\n return removeColorButton;\n }\n /**\n * Creates and configures the color grid inside the {@link #dropdownView}.\n */\n _createColorGrid(locale) {\n const colorGrid = new ColorGridView(locale, {\n colorDefinitions: this.options.colorDefinitions,\n columns: this.options.columns\n });\n colorGrid.on('execute', (evtData, data) => {\n this.value = data.value;\n this.dropdownView.isOpen = false;\n this.fire('input');\n });\n colorGrid.bind('selectedColor').to(this, 'value');\n return colorGrid;\n }\n /**\n * Sets {@link #inputView}'s value property to the color value or color label,\n * if there is one and the user is not typing.\n *\n * Handles cases like:\n *\n * * Someone picks the color in the grid.\n * * The color is set from the plugin level.\n *\n * @param inputValue Color value to be set.\n */\n _setInputValue(inputValue) {\n if (!this._stillTyping) {\n const normalizedInputValue = normalizeColor(inputValue);\n // Check if the value matches one of our defined colors.\n const mappedColor = this.options.colorDefinitions.find(def => normalizedInputValue === normalizeColor(def.color));\n if (mappedColor) {\n this.inputView.value = mappedColor.label;\n }\n else {\n this.inputView.value = inputValue || '';\n }\n }\n }\n}\n/**\n * Normalizes color value, by stripping extensive whitespace.\n * For example., transforms:\n * * ` rgb( 25 50 0 )` to `rgb(25 50 0)`,\n * * \"\\t rgb( 25 , 50,0 )\t\t\" to `rgb(25 50 0)`.\n *\n * @param colorString The value to be normalized.\n */\nfunction normalizeColor(colorString) {\n return colorString\n // Remove any whitespace right after `(` or `,`.\n .replace(/([(,])\\s+/g, '$1')\n // Remove any whitespace at the beginning or right before the end, `)`, `,`, or another whitespace.\n .replace(/^\\s+|\\s+(?=[),\\s]|$)/g, '')\n // Then, replace `,` or whitespace with a single space.\n .replace(/,|\\s/g, ' ');\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/utils/ui/table-properties\n */\nimport { ButtonView, Model } from 'ckeditor5/src/ui';\nimport { Collection } from 'ckeditor5/src/utils';\nimport { isColor, isLength, isPercentage } from 'ckeditor5/src/engine';\nimport ColorInputView from '../../ui/colorinputview';\nconst isEmpty = (val) => val === '';\n/**\n * Returns an object containing pairs of CSS border style values and their localized UI\n * labels. Used by {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView}\n * and {@link module:table/tableproperties/ui/tablepropertiesview~TablePropertiesView}.\n *\n * @param t The \"t\" function provided by the editor that is used to localize strings.\n */\nexport function getBorderStyleLabels(t) {\n return {\n none: t('None'),\n solid: t('Solid'),\n dotted: t('Dotted'),\n dashed: t('Dashed'),\n double: t('Double'),\n groove: t('Groove'),\n ridge: t('Ridge'),\n inset: t('Inset'),\n outset: t('Outset')\n };\n}\n/**\n * Returns a localized error string that can be displayed next to color (background, border)\n * fields that have an invalid value.\n *\n * @param t The \"t\" function provided by the editor that is used to localize strings.\n */\nexport function getLocalizedColorErrorText(t) {\n return t('The color is invalid. Try \"#FF0000\" or \"rgb(255,0,0)\" or \"red\".');\n}\n/**\n * Returns a localized error string that can be displayed next to length (padding, border width)\n * fields that have an invalid value.\n *\n * @param t The \"t\" function provided by the editor that is used to localize strings.\n */\nexport function getLocalizedLengthErrorText(t) {\n return t('The value is invalid. Try \"10px\" or \"2em\" or simply \"2\".');\n}\n/**\n * Returns `true` when the passed value is an empty string or a valid CSS color expression.\n * Otherwise, `false` is returned.\n *\n * See {@link module:engine/view/styles/utils~isColor}.\n */\nexport function colorFieldValidator(value) {\n value = value.trim();\n return isEmpty(value) || isColor(value);\n}\n/**\n * Returns `true` when the passed value is an empty string, a number without a unit or a valid CSS length expression.\n * Otherwise, `false` is returned.\n *\n * See {@link module:engine/view/styles/utils~isLength}.\n * See {@link module:engine/view/styles/utils~isPercentage}.\n */\nexport function lengthFieldValidator(value) {\n value = value.trim();\n return isEmpty(value) || isNumberString(value) || isLength(value) || isPercentage(value);\n}\n/**\n * Returns `true` when the passed value is an empty string, a number without a unit or a valid CSS length expression.\n * Otherwise, `false` is returned.\n *\n * See {@link module:engine/view/styles/utils~isLength}.\n */\nexport function lineWidthFieldValidator(value) {\n value = value.trim();\n return isEmpty(value) || isNumberString(value) || isLength(value);\n}\n/**\n * Generates item definitions for a UI dropdown that allows changing the border style of a table or a table cell.\n *\n * @param defaultStyle The default border.\n */\nexport function getBorderStyleDefinitions(view, defaultStyle) {\n const itemDefinitions = new Collection();\n const styleLabels = getBorderStyleLabels(view.t);\n for (const style in styleLabels) {\n const definition = {\n type: 'button',\n model: new Model({\n _borderStyleValue: style,\n label: styleLabels[style],\n role: 'menuitemradio',\n withText: true\n })\n };\n if (style === 'none') {\n definition.model.bind('isOn').to(view, 'borderStyle', value => {\n if (defaultStyle === 'none') {\n return !value;\n }\n return value === style;\n });\n }\n else {\n definition.model.bind('isOn').to(view, 'borderStyle', value => {\n return value === style;\n });\n }\n itemDefinitions.add(definition);\n }\n return itemDefinitions;\n}\n/**\n * A helper that fills a toolbar with buttons that:\n *\n * * have some labels,\n * * have some icons,\n * * set a certain UI view property value upon execution.\n *\n * @param nameToValue A function that maps a button name to a value. By default names are the same as values.\n */\nexport function fillToolbar(options) {\n const { view, icons, toolbar, labels, propertyName, nameToValue, defaultValue } = options;\n for (const name in labels) {\n const button = new ButtonView(view.locale);\n button.set({\n label: labels[name],\n icon: icons[name],\n tooltip: labels[name]\n });\n // If specified the `nameToValue()` callback, map the value based on the option's name.\n const buttonValue = nameToValue ? nameToValue(name) : name;\n button.bind('isOn').to(view, propertyName, value => {\n // `value` comes from `view[ propertyName ]`.\n let valueToCompare = value;\n // If it's empty, and the `defaultValue` is specified, use it instead.\n if (value === '' && defaultValue) {\n valueToCompare = defaultValue;\n }\n return buttonValue === valueToCompare;\n });\n button.on('execute', () => {\n view[propertyName] = buttonValue;\n });\n toolbar.items.add(button);\n }\n}\n/**\n * A default color palette used by various user interfaces related to tables, for instance,\n * by {@link module:table/tablecellproperties/tablecellpropertiesui~TableCellPropertiesUI} or\n * {@link module:table/tableproperties/tablepropertiesui~TablePropertiesUI}.\n *\n * The color palette follows the {@link module:table/tableconfig~TableColorConfig table color configuration format}\n * and contains the following color definitions:\n *\n * ```ts\n * const defaultColors = [\n * {\n * color: 'hsl(0, 0%, 0%)',\n * label: 'Black'\n * },\n * {\n * color: 'hsl(0, 0%, 30%)',\n * label: 'Dim grey'\n * },\n * {\n * color: 'hsl(0, 0%, 60%)',\n * label: 'Grey'\n * },\n * {\n * color: 'hsl(0, 0%, 90%)',\n * label: 'Light grey'\n * },\n * {\n * color: 'hsl(0, 0%, 100%)',\n * label: 'White',\n * hasBorder: true\n * },\n * {\n * color: 'hsl(0, 75%, 60%)',\n * label: 'Red'\n * },\n * {\n * color: 'hsl(30, 75%, 60%)',\n * label: 'Orange'\n * },\n * {\n * color: 'hsl(60, 75%, 60%)',\n * label: 'Yellow'\n * },\n * {\n * color: 'hsl(90, 75%, 60%)',\n * label: 'Light green'\n * },\n * {\n * color: 'hsl(120, 75%, 60%)',\n * label: 'Green'\n * },\n * {\n * color: 'hsl(150, 75%, 60%)',\n * label: 'Aquamarine'\n * },\n * {\n * color: 'hsl(180, 75%, 60%)',\n * label: 'Turquoise'\n * },\n * {\n * color: 'hsl(210, 75%, 60%)',\n * label: 'Light blue'\n * },\n * {\n * color: 'hsl(240, 75%, 60%)',\n * label: 'Blue'\n * },\n * {\n * color: 'hsl(270, 75%, 60%)',\n * label: 'Purple'\n * }\n * ];\n * ```\n */\nexport const defaultColors = [\n {\n color: 'hsl(0, 0%, 0%)',\n label: 'Black'\n },\n {\n color: 'hsl(0, 0%, 30%)',\n label: 'Dim grey'\n },\n {\n color: 'hsl(0, 0%, 60%)',\n label: 'Grey'\n },\n {\n color: 'hsl(0, 0%, 90%)',\n label: 'Light grey'\n },\n {\n color: 'hsl(0, 0%, 100%)',\n label: 'White',\n hasBorder: true\n },\n {\n color: 'hsl(0, 75%, 60%)',\n label: 'Red'\n },\n {\n color: 'hsl(30, 75%, 60%)',\n label: 'Orange'\n },\n {\n color: 'hsl(60, 75%, 60%)',\n label: 'Yellow'\n },\n {\n color: 'hsl(90, 75%, 60%)',\n label: 'Light green'\n },\n {\n color: 'hsl(120, 75%, 60%)',\n label: 'Green'\n },\n {\n color: 'hsl(150, 75%, 60%)',\n label: 'Aquamarine'\n },\n {\n color: 'hsl(180, 75%, 60%)',\n label: 'Turquoise'\n },\n {\n color: 'hsl(210, 75%, 60%)',\n label: 'Light blue'\n },\n {\n color: 'hsl(240, 75%, 60%)',\n label: 'Blue'\n },\n {\n color: 'hsl(270, 75%, 60%)',\n label: 'Purple'\n }\n];\n/**\n * Returns a creator for a color input with a label.\n *\n * For given options, it returns a function that creates an instance of a\n * {@link module:table/ui/colorinputview~ColorInputView color input} logically related to\n * a {@link module:ui/labeledfield/labeledfieldview~LabeledFieldView labeled view} in the DOM.\n *\n * The helper does the following:\n *\n * * It sets the color input `id` and `ariaDescribedById` attributes.\n * * It binds the color input `isReadOnly` to the labeled view.\n * * It binds the color input `hasError` to the labeled view.\n * * It enables a logic that cleans up the error when the user starts typing in the color input.\n *\n * Usage:\n *\n * ```ts\n * const colorInputCreator = getLabeledColorInputCreator( {\n * colorConfig: [ ... ],\n * columns: 3,\n * } );\n *\n * const labeledInputView = new LabeledFieldView( locale, colorInputCreator );\n * console.log( labeledInputView.view ); // A color input instance.\n * ```\n *\n * @internal\n * @param options Color input options.\n * @param options.colorConfig The configuration of the color palette displayed in the input's dropdown.\n * @param options.columns The configuration of the number of columns the color palette consists of in the input's dropdown.\n * @param options.defaultColorValue If specified, the color input view will replace the \"Remove color\" button with\n * the \"Restore default\" button. Instead of clearing the input field, the default color value will be set.\n */\nexport function getLabeledColorInputCreator(options) {\n return (labeledFieldView, viewUid, statusUid) => {\n const colorInputView = new ColorInputView(labeledFieldView.locale, {\n colorDefinitions: colorConfigToColorGridDefinitions(options.colorConfig),\n columns: options.columns,\n defaultColorValue: options.defaultColorValue\n });\n colorInputView.inputView.set({\n id: viewUid,\n ariaDescribedById: statusUid\n });\n colorInputView.bind('isReadOnly').to(labeledFieldView, 'isEnabled', value => !value);\n colorInputView.bind('hasError').to(labeledFieldView, 'errorText', value => !!value);\n colorInputView.on('input', () => {\n // UX: Make the error text disappear and disable the error indicator as the user\n // starts fixing the errors.\n labeledFieldView.errorText = null;\n });\n labeledFieldView.bind('isEmpty', 'isFocused').to(colorInputView);\n return colorInputView;\n };\n}\n/**\n * A simple helper method to detect number strings.\n * I allows full number notation, so omitting 0 is not allowed:\n */\nfunction isNumberString(value) {\n const parsedValue = parseFloat(value);\n return !Number.isNaN(parsedValue) && value === String(parsedValue);\n}\nfunction colorConfigToColorGridDefinitions(colorConfig) {\n return colorConfig.map(item => ({\n color: item.model,\n label: item.label,\n options: {\n hasBorder: item.hasBorder\n }\n }));\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./formrow.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/ui/formrowview\n */\nimport { View } from 'ckeditor5/src/ui';\nimport '../../theme/formrow.css';\n/**\n * The class representing a single row in a complex form,\n * used by {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView}.\n *\n * **Note**: For now this class is private. When more use cases arrive (beyond ckeditor5-table),\n * it will become a component in ckeditor5-ui.\n *\n * @internal\n */\nexport default class FormRowView extends View {\n /**\n * Creates an instance of the form row class.\n *\n * @param locale The locale instance.\n * @param options.labelView When passed, the row gets the `group` and `aria-labelledby`\n * DOM attributes and gets described by the label.\n */\n constructor(locale, options = {}) {\n super(locale);\n const bind = this.bindTemplate;\n this.set('class', options.class || null);\n this.children = this.createCollection();\n if (options.children) {\n options.children.forEach(child => this.children.add(child));\n }\n this.set('_role', null);\n this.set('_ariaLabelledBy', null);\n if (options.labelView) {\n this.set({\n _role: 'group',\n _ariaLabelledBy: options.labelView.id\n });\n }\n this.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-form__row',\n bind.to('class')\n ],\n role: bind.to('_role'),\n 'aria-labelledby': bind.to('_ariaLabelledBy')\n },\n children: this.children\n });\n }\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./form.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tableform.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tablecellproperties.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tablecellproperties/ui/tablecellpropertiesview\n */\nimport { addListToDropdown, ButtonView, createLabeledDropdown, createLabeledInputText, FocusCycler, FormHeaderView, LabeledFieldView, LabelView, submitHandler, ToolbarView, View, ViewCollection } from 'ckeditor5/src/ui';\nimport { KeystrokeHandler, FocusTracker } from 'ckeditor5/src/utils';\nimport { icons } from 'ckeditor5/src/core';\nimport { fillToolbar, getBorderStyleDefinitions, getBorderStyleLabels, getLabeledColorInputCreator } from '../../utils/ui/table-properties';\nimport FormRowView from '../../ui/formrowview';\nimport '../../../theme/form.css';\nimport '../../../theme/tableform.css';\nimport '../../../theme/tablecellproperties.css';\nconst ALIGNMENT_ICONS = {\n left: icons.alignLeft,\n center: icons.alignCenter,\n right: icons.alignRight,\n justify: icons.alignJustify,\n top: icons.alignTop,\n middle: icons.alignMiddle,\n bottom: icons.alignBottom\n};\n/**\n * The class representing a table cell properties form, allowing users to customize\n * certain style aspects of a table cell, for instance, border, padding, text alignment, etc..\n */\nexport default class TableCellPropertiesView extends View {\n /**\n * @param locale The {@link module:core/editor/editor~Editor#locale} instance.\n * @param options Additional configuration of the view.\n * @param options.borderColors A configuration of the border color palette used by the\n * {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView#borderColorInput}.\n * @param options.backgroundColors A configuration of the background color palette used by the\n * {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView#backgroundInput}.\n * @param options.defaultTableCellProperties The default table cell properties.\n */\n constructor(locale, options) {\n super(locale);\n this.set({\n borderStyle: '',\n borderWidth: '',\n borderColor: '',\n padding: '',\n backgroundColor: '',\n width: '',\n height: '',\n horizontalAlignment: '',\n verticalAlignment: ''\n });\n this.options = options;\n const { borderStyleDropdown, borderWidthInput, borderColorInput, borderRowLabel } = this._createBorderFields();\n const { backgroundRowLabel, backgroundInput } = this._createBackgroundFields();\n const { widthInput, operatorLabel, heightInput, dimensionsLabel } = this._createDimensionFields();\n const { horizontalAlignmentToolbar, verticalAlignmentToolbar, alignmentLabel } = this._createAlignmentFields();\n this.focusTracker = new FocusTracker();\n this.keystrokes = new KeystrokeHandler();\n this.children = this.createCollection();\n this.borderStyleDropdown = borderStyleDropdown;\n this.borderWidthInput = borderWidthInput;\n this.borderColorInput = borderColorInput;\n this.backgroundInput = backgroundInput;\n this.paddingInput = this._createPaddingField();\n this.widthInput = widthInput;\n this.heightInput = heightInput;\n this.horizontalAlignmentToolbar = horizontalAlignmentToolbar;\n this.verticalAlignmentToolbar = verticalAlignmentToolbar;\n // Defer creating to make sure other fields are present and the Save button can\n // bind its #isEnabled to their error messages so there's no way to save unless all\n // fields are valid.\n const { saveButtonView, cancelButtonView } = this._createActionButtons();\n this.saveButtonView = saveButtonView;\n this.cancelButtonView = cancelButtonView;\n this._focusables = new ViewCollection();\n this._focusCycler = new FocusCycler({\n focusables: this._focusables,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate form fields backwards using the Shift + Tab keystroke.\n focusPrevious: 'shift + tab',\n // Navigate form fields forwards using the Tab key.\n focusNext: 'tab'\n }\n });\n // Form header.\n this.children.add(new FormHeaderView(locale, {\n label: this.t('Cell properties')\n }));\n // Border row.\n this.children.add(new FormRowView(locale, {\n labelView: borderRowLabel,\n children: [\n borderRowLabel,\n borderStyleDropdown,\n borderColorInput,\n borderWidthInput\n ],\n class: 'ck-table-form__border-row'\n }));\n // Background.\n this.children.add(new FormRowView(locale, {\n labelView: backgroundRowLabel,\n children: [\n backgroundRowLabel,\n backgroundInput\n ],\n class: 'ck-table-form__background-row'\n }));\n // Dimensions row and padding.\n this.children.add(new FormRowView(locale, {\n children: [\n // Dimensions row.\n new FormRowView(locale, {\n labelView: dimensionsLabel,\n children: [\n dimensionsLabel,\n widthInput,\n operatorLabel,\n heightInput\n ],\n class: 'ck-table-form__dimensions-row'\n }),\n // Padding row.\n new FormRowView(locale, {\n children: [\n this.paddingInput\n ],\n class: 'ck-table-cell-properties-form__padding-row'\n })\n ]\n }));\n // Text alignment row.\n this.children.add(new FormRowView(locale, {\n labelView: alignmentLabel,\n children: [\n alignmentLabel,\n horizontalAlignmentToolbar,\n verticalAlignmentToolbar\n ],\n class: 'ck-table-cell-properties-form__alignment-row'\n }));\n // Action row.\n this.children.add(new FormRowView(locale, {\n children: [\n this.saveButtonView,\n this.cancelButtonView\n ],\n class: 'ck-table-form__action-row'\n }));\n this.setTemplate({\n tag: 'form',\n attributes: {\n class: [\n 'ck',\n 'ck-form',\n 'ck-table-form',\n 'ck-table-cell-properties-form'\n ],\n // https://github.com/ckeditor/ckeditor5-link/issues/90\n tabindex: '-1'\n },\n children: this.children\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n // Enable the \"submit\" event for this view. It can be triggered by the #saveButtonView\n // which is of the \"submit\" DOM \"type\".\n submitHandler({\n view: this\n });\n [\n this.borderStyleDropdown,\n this.borderColorInput,\n this.borderColorInput.fieldView.dropdownView.buttonView,\n this.borderWidthInput,\n this.backgroundInput,\n this.backgroundInput.fieldView.dropdownView.buttonView,\n this.widthInput,\n this.heightInput,\n this.paddingInput,\n this.horizontalAlignmentToolbar,\n this.verticalAlignmentToolbar,\n this.saveButtonView,\n this.cancelButtonView\n ].forEach(view => {\n // Register the view as focusable.\n this._focusables.add(view);\n // Register the view in the focus tracker.\n this.focusTracker.add(view.element);\n });\n // Mainly for closing using \"Esc\" and navigation using \"Tab\".\n this.keystrokes.listenTo(this.element);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Focuses the fist focusable field in the form.\n */\n focus() {\n this._focusCycler.focusFirst();\n }\n /**\n * Creates the following form fields:\n *\n * * {@link #borderStyleDropdown},\n * * {@link #borderWidthInput},\n * * {@link #borderColorInput}.\n */\n _createBorderFields() {\n const defaultTableCellProperties = this.options.defaultTableCellProperties;\n const defaultBorder = {\n style: defaultTableCellProperties.borderStyle,\n width: defaultTableCellProperties.borderWidth,\n color: defaultTableCellProperties.borderColor\n };\n const colorInputCreator = getLabeledColorInputCreator({\n colorConfig: this.options.borderColors,\n columns: 5,\n defaultColorValue: defaultBorder.color\n });\n const locale = this.locale;\n const t = this.t;\n const accessibleLabel = t('Style');\n // -- Group label ---------------------------------------------\n const borderRowLabel = new LabelView(locale);\n borderRowLabel.text = t('Border');\n // -- Style ---------------------------------------------------\n const styleLabels = getBorderStyleLabels(t);\n const borderStyleDropdown = new LabeledFieldView(locale, createLabeledDropdown);\n borderStyleDropdown.set({\n label: accessibleLabel,\n class: 'ck-table-form__border-style'\n });\n borderStyleDropdown.fieldView.buttonView.set({\n ariaLabel: accessibleLabel,\n ariaLabelledBy: undefined,\n isOn: false,\n withText: true,\n tooltip: accessibleLabel\n });\n borderStyleDropdown.fieldView.buttonView.bind('label').to(this, 'borderStyle', value => {\n return styleLabels[value ? value : 'none'];\n });\n borderStyleDropdown.fieldView.on('execute', evt => {\n this.borderStyle = evt.source._borderStyleValue;\n });\n borderStyleDropdown.bind('isEmpty').to(this, 'borderStyle', value => !value);\n addListToDropdown(borderStyleDropdown.fieldView, getBorderStyleDefinitions(this, defaultBorder.style), {\n role: 'menu',\n ariaLabel: accessibleLabel\n });\n // -- Width ---------------------------------------------------\n const borderWidthInput = new LabeledFieldView(locale, createLabeledInputText);\n borderWidthInput.set({\n label: t('Width'),\n class: 'ck-table-form__border-width'\n });\n borderWidthInput.fieldView.bind('value').to(this, 'borderWidth');\n borderWidthInput.bind('isEnabled').to(this, 'borderStyle', isBorderStyleSet);\n borderWidthInput.fieldView.on('input', () => {\n this.borderWidth = borderWidthInput.fieldView.element.value;\n });\n // -- Color ---------------------------------------------------\n const borderColorInput = new LabeledFieldView(locale, colorInputCreator);\n borderColorInput.set({\n label: t('Color'),\n class: 'ck-table-form__border-color'\n });\n borderColorInput.fieldView.bind('value').to(this, 'borderColor');\n borderColorInput.bind('isEnabled').to(this, 'borderStyle', isBorderStyleSet);\n borderColorInput.fieldView.on('input', () => {\n this.borderColor = borderColorInput.fieldView.value;\n });\n // Reset the border color and width fields depending on the `border-style` value.\n this.on('change:borderStyle', (evt, name, newValue, oldValue) => {\n // When removing the border (`border-style:none`), clear the remaining `border-*` properties.\n // See: https://github.com/ckeditor/ckeditor5/issues/6227.\n if (!isBorderStyleSet(newValue)) {\n this.borderColor = '';\n this.borderWidth = '';\n }\n // When setting the `border-style` from `none`, set the default `border-color` and `border-width` properties.\n if (!isBorderStyleSet(oldValue)) {\n this.borderColor = defaultBorder.color;\n this.borderWidth = defaultBorder.width;\n }\n });\n return {\n borderRowLabel,\n borderStyleDropdown,\n borderColorInput,\n borderWidthInput\n };\n }\n /**\n * Creates the following form fields:\n *\n * * {@link #backgroundInput}.\n */\n _createBackgroundFields() {\n const locale = this.locale;\n const t = this.t;\n // -- Group label ---------------------------------------------\n const backgroundRowLabel = new LabelView(locale);\n backgroundRowLabel.text = t('Background');\n // -- Background color input -----------------------------------\n const colorInputCreator = getLabeledColorInputCreator({\n colorConfig: this.options.backgroundColors,\n columns: 5,\n defaultColorValue: this.options.defaultTableCellProperties.backgroundColor\n });\n const backgroundInput = new LabeledFieldView(locale, colorInputCreator);\n backgroundInput.set({\n label: t('Color'),\n class: 'ck-table-cell-properties-form__background'\n });\n backgroundInput.fieldView.bind('value').to(this, 'backgroundColor');\n backgroundInput.fieldView.on('input', () => {\n this.backgroundColor = backgroundInput.fieldView.value;\n });\n return {\n backgroundRowLabel,\n backgroundInput\n };\n }\n /**\n * Creates the following form fields:\n *\n * * {@link #widthInput}.\n * * {@link #heightInput}.\n */\n _createDimensionFields() {\n const locale = this.locale;\n const t = this.t;\n // -- Label ---------------------------------------------------\n const dimensionsLabel = new LabelView(locale);\n dimensionsLabel.text = t('Dimensions');\n // -- Width ---------------------------------------------------\n const widthInput = new LabeledFieldView(locale, createLabeledInputText);\n widthInput.set({\n label: t('Width'),\n class: 'ck-table-form__dimensions-row__width'\n });\n widthInput.fieldView.bind('value').to(this, 'width');\n widthInput.fieldView.on('input', () => {\n this.width = widthInput.fieldView.element.value;\n });\n // -- Operator ---------------------------------------------------\n const operatorLabel = new View(locale);\n operatorLabel.setTemplate({\n tag: 'span',\n attributes: {\n class: [\n 'ck-table-form__dimension-operator'\n ]\n },\n children: [\n { text: '×' }\n ]\n });\n // -- Height ---------------------------------------------------\n const heightInput = new LabeledFieldView(locale, createLabeledInputText);\n heightInput.set({\n label: t('Height'),\n class: 'ck-table-form__dimensions-row__height'\n });\n heightInput.fieldView.bind('value').to(this, 'height');\n heightInput.fieldView.on('input', () => {\n this.height = heightInput.fieldView.element.value;\n });\n return {\n dimensionsLabel,\n widthInput,\n operatorLabel,\n heightInput\n };\n }\n /**\n * Creates the following form fields:\n *\n * * {@link #paddingInput}.\n */\n _createPaddingField() {\n const locale = this.locale;\n const t = this.t;\n const paddingInput = new LabeledFieldView(locale, createLabeledInputText);\n paddingInput.set({\n label: t('Padding'),\n class: 'ck-table-cell-properties-form__padding'\n });\n paddingInput.fieldView.bind('value').to(this, 'padding');\n paddingInput.fieldView.on('input', () => {\n this.padding = paddingInput.fieldView.element.value;\n });\n return paddingInput;\n }\n /**\n * Creates the following form fields:\n *\n * * {@link #horizontalAlignmentToolbar},\n * * {@link #verticalAlignmentToolbar}.\n */\n _createAlignmentFields() {\n const locale = this.locale;\n const t = this.t;\n const alignmentLabel = new LabelView(locale);\n alignmentLabel.text = t('Table cell text alignment');\n // -- Horizontal ---------------------------------------------------\n const horizontalAlignmentToolbar = new ToolbarView(locale);\n const isContentRTL = locale.contentLanguageDirection === 'rtl';\n horizontalAlignmentToolbar.set({\n isCompact: true,\n ariaLabel: t('Horizontal text alignment toolbar')\n });\n fillToolbar({\n view: this,\n icons: ALIGNMENT_ICONS,\n toolbar: horizontalAlignmentToolbar,\n labels: this._horizontalAlignmentLabels,\n propertyName: 'horizontalAlignment',\n nameToValue: name => {\n // For the RTL content, we want to swap the buttons \"align to the left\" and \"align to the right\".\n if (isContentRTL) {\n if (name === 'left') {\n return 'right';\n }\n else if (name === 'right') {\n return 'left';\n }\n }\n return name;\n },\n defaultValue: this.options.defaultTableCellProperties.horizontalAlignment\n });\n // -- Vertical -----------------------------------------------------\n const verticalAlignmentToolbar = new ToolbarView(locale);\n verticalAlignmentToolbar.set({\n isCompact: true,\n ariaLabel: t('Vertical text alignment toolbar')\n });\n fillToolbar({\n view: this,\n icons: ALIGNMENT_ICONS,\n toolbar: verticalAlignmentToolbar,\n labels: this._verticalAlignmentLabels,\n propertyName: 'verticalAlignment',\n defaultValue: this.options.defaultTableCellProperties.verticalAlignment\n });\n return {\n horizontalAlignmentToolbar,\n verticalAlignmentToolbar,\n alignmentLabel\n };\n }\n /**\n * Creates the following form controls:\n *\n * * {@link #saveButtonView},\n * * {@link #cancelButtonView}.\n */\n _createActionButtons() {\n const locale = this.locale;\n const t = this.t;\n const saveButtonView = new ButtonView(locale);\n const cancelButtonView = new ButtonView(locale);\n const fieldsThatShouldValidateToSave = [\n this.borderWidthInput,\n this.borderColorInput,\n this.backgroundInput,\n this.paddingInput\n ];\n saveButtonView.set({\n label: t('Save'),\n icon: icons.check,\n class: 'ck-button-save',\n type: 'submit',\n withText: true\n });\n saveButtonView.bind('isEnabled').toMany(fieldsThatShouldValidateToSave, 'errorText', (...errorTexts) => {\n return errorTexts.every(errorText => !errorText);\n });\n cancelButtonView.set({\n label: t('Cancel'),\n icon: icons.cancel,\n class: 'ck-button-cancel',\n withText: true\n });\n cancelButtonView.delegate('execute').to(this, 'cancel');\n return {\n saveButtonView, cancelButtonView\n };\n }\n /**\n * Provides localized labels for {@link #horizontalAlignmentToolbar} buttons.\n */\n get _horizontalAlignmentLabels() {\n const locale = this.locale;\n const t = this.t;\n const left = t('Align cell text to the left');\n const center = t('Align cell text to the center');\n const right = t('Align cell text to the right');\n const justify = t('Justify cell text');\n // Returns object with a proper order of labels.\n if (locale.uiLanguageDirection === 'rtl') {\n return { right, center, left, justify };\n }\n else {\n return { left, center, right, justify };\n }\n }\n /**\n * Provides localized labels for {@link #verticalAlignmentToolbar} buttons.\n */\n get _verticalAlignmentLabels() {\n const t = this.t;\n return {\n top: t('Align cell text to the top'),\n middle: t('Align cell text to the middle'),\n bottom: t('Align cell text to the bottom')\n };\n }\n}\nfunction isBorderStyleSet(value) {\n return value !== 'none';\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { isWidget } from 'ckeditor5/src/widget';\n/**\n * Returns a table widget editing view element if one is selected.\n */\nexport function getSelectedTableWidget(selection) {\n const viewElement = selection.getSelectedElement();\n if (viewElement && isTableWidget(viewElement)) {\n return viewElement;\n }\n return null;\n}\n/**\n * Returns a table widget editing view element if one is among the selection's ancestors.\n */\nexport function getTableWidgetAncestor(selection) {\n const selectionPosition = selection.getFirstPosition();\n if (!selectionPosition) {\n return null;\n }\n let parent = selectionPosition.parent;\n while (parent) {\n if (parent.is('element') && isTableWidget(parent)) {\n return parent;\n }\n parent = parent.parent;\n }\n return null;\n}\n/**\n * Checks if a given view element is a table widget.\n */\nfunction isTableWidget(viewElement) {\n return !!viewElement.getCustomProperty('table') && isWidget(viewElement);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/utils/ui/contextualballoon\n */\nimport { Rect } from 'ckeditor5/src/utils';\nimport { BalloonPanelView } from 'ckeditor5/src/ui';\nimport { getTableWidgetAncestor } from './widget';\nconst DEFAULT_BALLOON_POSITIONS = BalloonPanelView.defaultPositions;\nconst BALLOON_POSITIONS = [\n DEFAULT_BALLOON_POSITIONS.northArrowSouth,\n DEFAULT_BALLOON_POSITIONS.northArrowSouthWest,\n DEFAULT_BALLOON_POSITIONS.northArrowSouthEast,\n DEFAULT_BALLOON_POSITIONS.southArrowNorth,\n DEFAULT_BALLOON_POSITIONS.southArrowNorthWest,\n DEFAULT_BALLOON_POSITIONS.southArrowNorthEast,\n DEFAULT_BALLOON_POSITIONS.viewportStickyNorth\n];\n/**\n * A helper utility that positions the\n * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} instance\n * with respect to the table in the editor content, if one is selected.\n *\n * @param editor The editor instance.\n * @param target Either \"cell\" or \"table\". Determines the target the balloon will be attached to.\n */\nexport function repositionContextualBalloon(editor, target) {\n const balloon = editor.plugins.get('ContextualBalloon');\n if (getTableWidgetAncestor(editor.editing.view.document.selection)) {\n let position;\n if (target === 'cell') {\n position = getBalloonCellPositionData(editor);\n }\n else {\n position = getBalloonTablePositionData(editor);\n }\n balloon.updatePosition(position);\n }\n}\n/**\n * Returns the positioning options that control the geometry of the\n * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} with respect\n * to the selected table in the editor content.\n *\n * @param editor The editor instance.\n */\nexport function getBalloonTablePositionData(editor) {\n const firstPosition = editor.model.document.selection.getFirstPosition();\n const modelTable = firstPosition.findAncestor('table');\n const viewTable = editor.editing.mapper.toViewElement(modelTable);\n return {\n target: editor.editing.view.domConverter.mapViewToDom(viewTable),\n positions: BALLOON_POSITIONS\n };\n}\n/**\n * Returns the positioning options that control the geometry of the\n * {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} with respect\n * to the selected table cell in the editor content.\n *\n * @param editor The editor instance.\n */\nexport function getBalloonCellPositionData(editor) {\n const mapper = editor.editing.mapper;\n const domConverter = editor.editing.view.domConverter;\n const selection = editor.model.document.selection;\n if (selection.rangeCount > 1) {\n return {\n target: () => createBoundingRect(selection.getRanges(), editor),\n positions: BALLOON_POSITIONS\n };\n }\n const modelTableCell = getTableCellAtPosition(selection.getFirstPosition());\n const viewTableCell = mapper.toViewElement(modelTableCell);\n return {\n target: domConverter.mapViewToDom(viewTableCell),\n positions: BALLOON_POSITIONS\n };\n}\n/**\n * Returns the first selected table cell from a multi-cell or in-cell selection.\n *\n * @param position Document position.\n */\nfunction getTableCellAtPosition(position) {\n const isTableCellSelected = position.nodeAfter && position.nodeAfter.is('element', 'tableCell');\n return isTableCellSelected ? position.nodeAfter : position.findAncestor('tableCell');\n}\n/**\n * Returns bounding rectangle for given model ranges.\n *\n * @param ranges Model ranges that the bounding rect should be returned for.\n * @param editor The editor instance.\n */\nfunction createBoundingRect(ranges, editor) {\n const mapper = editor.editing.mapper;\n const domConverter = editor.editing.view.domConverter;\n const rects = Array.from(ranges).map(range => {\n const modelTableCell = getTableCellAtPosition(range.start);\n const viewTableCell = mapper.toViewElement(modelTableCell);\n return new Rect(domConverter.mapViewToDom(viewTableCell));\n });\n return Rect.getBoundingRect(rects);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { isObject } from 'lodash-es';\n/**\n * Returns a string if all four values of box sides are equal.\n *\n * If a string is passed, it is treated as a single value (pass-through).\n *\n * ```ts\n * // Returns 'foo':\n * getSingleValue( { top: 'foo', right: 'foo', bottom: 'foo', left: 'foo' } );\n * getSingleValue( 'foo' );\n *\n * // Returns undefined:\n * getSingleValue( { top: 'foo', right: 'foo', bottom: 'bar', left: 'foo' } );\n * getSingleValue( { top: 'foo', right: 'foo' } );\n * ```\n */\nexport function getSingleValue(objectOrString) {\n if (!objectOrString || !isObject(objectOrString)) {\n return objectOrString;\n }\n const { top, right, bottom, left } = objectOrString;\n if (top == right && right == bottom && bottom == left) {\n return top;\n }\n}\n/**\n * Adds a unit to a value if the value is a number or a string representing a number.\n *\n * **Note**: It does nothing to non-numeric values.\n *\n * ```ts\n * getSingleValue( 25, 'px' ); // '25px'\n * getSingleValue( 25, 'em' ); // '25em'\n * getSingleValue( '25em', 'px' ); // '25em'\n * getSingleValue( 'foo', 'px' ); // 'foo'\n * ```\n *\n * @param defaultUnit A default unit added to a numeric value.\n */\nexport function addDefaultUnitToNumericValue(value, defaultUnit) {\n const numericValue = parseFloat(value);\n if (Number.isNaN(numericValue)) {\n return value;\n }\n if (String(numericValue) !== String(value)) {\n return value;\n }\n return `${numericValue}${defaultUnit}`;\n}\n/**\n * Returns the normalized configuration.\n *\n * @param options.includeAlignmentProperty Whether the \"alignment\" property should be added.\n * @param options.includePaddingProperty Whether the \"padding\" property should be added.\n * @param options.includeVerticalAlignmentProperty Whether the \"verticalAlignment\" property should be added.\n * @param options.includeHorizontalAlignmentProperty Whether the \"horizontalAlignment\" property should be added.\n * @param options.isRightToLeftContent Whether the content is right-to-left.\n */\nexport function getNormalizedDefaultProperties(config, options = {}) {\n const normalizedConfig = {\n borderStyle: 'none',\n borderWidth: '',\n borderColor: '',\n backgroundColor: '',\n width: '',\n height: '',\n ...config\n };\n if (options.includeAlignmentProperty && !normalizedConfig.alignment) {\n normalizedConfig.alignment = 'center';\n }\n if (options.includePaddingProperty && !normalizedConfig.padding) {\n normalizedConfig.padding = '';\n }\n if (options.includeVerticalAlignmentProperty && !normalizedConfig.verticalAlignment) {\n normalizedConfig.verticalAlignment = 'middle';\n }\n if (options.includeHorizontalAlignmentProperty && !normalizedConfig.horizontalAlignment) {\n normalizedConfig.horizontalAlignment = options.isRightToLeftContent ? 'right' : 'left';\n }\n return normalizedConfig;\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tablecellproperties/tablecellpropertiesui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ButtonView, clickOutsideHandler, ContextualBalloon, getLocalizedColorOptions, normalizeColorOptions } from 'ckeditor5/src/ui';\nimport TableCellPropertiesView from './ui/tablecellpropertiesview';\nimport { colorFieldValidator, getLocalizedColorErrorText, getLocalizedLengthErrorText, defaultColors, lengthFieldValidator, lineWidthFieldValidator } from '../utils/ui/table-properties';\nimport { debounce } from 'lodash-es';\nimport { getTableWidgetAncestor } from '../utils/ui/widget';\nimport { getBalloonCellPositionData, repositionContextualBalloon } from '../utils/ui/contextualballoon';\nimport tableCellProperties from './../../theme/icons/table-cell-properties.svg';\nimport { getNormalizedDefaultProperties } from '../utils/table-properties';\nconst ERROR_TEXT_TIMEOUT = 500;\n// Map of view properties and related commands.\nconst propertyToCommandMap = {\n borderStyle: 'tableCellBorderStyle',\n borderColor: 'tableCellBorderColor',\n borderWidth: 'tableCellBorderWidth',\n height: 'tableCellHeight',\n width: 'tableCellWidth',\n padding: 'tableCellPadding',\n backgroundColor: 'tableCellBackgroundColor',\n horizontalAlignment: 'tableCellHorizontalAlignment',\n verticalAlignment: 'tableCellVerticalAlignment'\n};\n/**\n * The table cell properties UI plugin. It introduces the `'tableCellProperties'` button\n * that opens a form allowing to specify the visual styling of a table cell.\n *\n * It uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon plugin}.\n */\nexport default class TableCellPropertiesUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ContextualBalloon];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableCellPropertiesUI';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n editor.config.define('table.tableCellProperties', {\n borderColors: defaultColors,\n backgroundColors: defaultColors\n });\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n this._defaultTableCellProperties = getNormalizedDefaultProperties(editor.config.get('table.tableCellProperties.defaultProperties'), {\n includeVerticalAlignmentProperty: true,\n includeHorizontalAlignmentProperty: true,\n includePaddingProperty: true,\n isRightToLeftContent: editor.locale.contentLanguageDirection === 'rtl'\n });\n this._balloon = editor.plugins.get(ContextualBalloon);\n this.view = null;\n this._isReady = false;\n editor.ui.componentFactory.add('tableCellProperties', locale => {\n const view = new ButtonView(locale);\n view.set({\n label: t('Cell properties'),\n icon: tableCellProperties,\n tooltip: true\n });\n this.listenTo(view, 'execute', () => this._showView());\n const commands = Object.values(propertyToCommandMap)\n .map(commandName => editor.commands.get(commandName));\n view.bind('isEnabled').toMany(commands, 'isEnabled', (...areEnabled) => (areEnabled.some(isCommandEnabled => isCommandEnabled)));\n return view;\n });\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n // Destroy created UI components as they are not automatically destroyed.\n // See https://github.com/ckeditor/ckeditor5/issues/1341.\n if (this.view) {\n this.view.destroy();\n }\n }\n /**\n * Creates the {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView} instance.\n *\n * @returns The cell properties form view instance.\n */\n _createPropertiesView() {\n const editor = this.editor;\n const config = editor.config.get('table.tableCellProperties');\n const borderColorsConfig = normalizeColorOptions(config.borderColors);\n const localizedBorderColors = getLocalizedColorOptions(editor.locale, borderColorsConfig);\n const backgroundColorsConfig = normalizeColorOptions(config.backgroundColors);\n const localizedBackgroundColors = getLocalizedColorOptions(editor.locale, backgroundColorsConfig);\n const view = new TableCellPropertiesView(editor.locale, {\n borderColors: localizedBorderColors,\n backgroundColors: localizedBackgroundColors,\n defaultTableCellProperties: this._defaultTableCellProperties\n });\n const t = editor.t;\n // Render the view so its #element is available for the clickOutsideHandler.\n view.render();\n this.listenTo(view, 'submit', () => {\n this._hideView();\n });\n this.listenTo(view, 'cancel', () => {\n // https://github.com/ckeditor/ckeditor5/issues/6180\n if (this._undoStepBatch.operations.length) {\n editor.execute('undo', this._undoStepBatch);\n }\n this._hideView();\n });\n // Close the balloon on Esc key press.\n view.keystrokes.set('Esc', (data, cancel) => {\n this._hideView();\n cancel();\n });\n // Close on click outside of balloon panel element.\n clickOutsideHandler({\n emitter: view,\n activator: () => this._isViewInBalloon,\n contextElements: [this._balloon.view.element],\n callback: () => this._hideView()\n });\n const colorErrorText = getLocalizedColorErrorText(t);\n const lengthErrorText = getLocalizedLengthErrorText(t);\n // Create the \"UI -> editor data\" binding.\n // These listeners update the editor data (via table commands) when any observable\n // property of the view has changed. They also validate the value and display errors in the UI\n // when necessary. This makes the view live, which means the changes are\n // visible in the editing as soon as the user types or changes fields' values.\n view.on('change:borderStyle', this._getPropertyChangeCallback('tableCellBorderStyle'));\n view.on('change:borderColor', this._getValidatedPropertyChangeCallback({\n viewField: view.borderColorInput,\n commandName: 'tableCellBorderColor',\n errorText: colorErrorText,\n validator: colorFieldValidator\n }));\n view.on('change:borderWidth', this._getValidatedPropertyChangeCallback({\n viewField: view.borderWidthInput,\n commandName: 'tableCellBorderWidth',\n errorText: lengthErrorText,\n validator: lineWidthFieldValidator\n }));\n view.on('change:padding', this._getValidatedPropertyChangeCallback({\n viewField: view.paddingInput,\n commandName: 'tableCellPadding',\n errorText: lengthErrorText,\n validator: lengthFieldValidator\n }));\n view.on('change:width', this._getValidatedPropertyChangeCallback({\n viewField: view.widthInput,\n commandName: 'tableCellWidth',\n errorText: lengthErrorText,\n validator: lengthFieldValidator\n }));\n view.on('change:height', this._getValidatedPropertyChangeCallback({\n viewField: view.heightInput,\n commandName: 'tableCellHeight',\n errorText: lengthErrorText,\n validator: lengthFieldValidator\n }));\n view.on('change:backgroundColor', this._getValidatedPropertyChangeCallback({\n viewField: view.backgroundInput,\n commandName: 'tableCellBackgroundColor',\n errorText: colorErrorText,\n validator: colorFieldValidator\n }));\n view.on('change:horizontalAlignment', this._getPropertyChangeCallback('tableCellHorizontalAlignment'));\n view.on('change:verticalAlignment', this._getPropertyChangeCallback('tableCellVerticalAlignment'));\n return view;\n }\n /**\n * In this method the \"editor data -> UI\" binding is happening.\n *\n * When executed, this method obtains selected cell property values from various table commands\n * and passes them to the {@link #view}.\n *\n * This way, the UI stays uptodate with the editor data.\n */\n _fillViewFormFromCommandValues() {\n const commands = this.editor.commands;\n const borderStyleCommand = commands.get('tableCellBorderStyle');\n Object.entries(propertyToCommandMap)\n .map(([property, commandName]) => {\n const defaultValue = this._defaultTableCellProperties[property] || '';\n return [\n property,\n commands.get(commandName).value || defaultValue\n ];\n })\n .forEach(([property, value]) => {\n // Do not set the `border-color` and `border-width` fields if `border-style:none`.\n if ((property === 'borderColor' || property === 'borderWidth') && borderStyleCommand.value === 'none') {\n return;\n }\n this.view.set(property, value);\n });\n this._isReady = true;\n }\n /**\n * Shows the {@link #view} in the {@link #_balloon}.\n *\n * **Note**: Each time a view is shown, a new {@link #_undoStepBatch} is created. It contains\n * all changes made to the document when the view is visible, allowing a single undo step\n * for all of them.\n */\n _showView() {\n const editor = this.editor;\n if (!this.view) {\n this.view = this._createPropertiesView();\n }\n this.listenTo(editor.ui, 'update', () => {\n this._updateView();\n });\n // Update the view with the model values.\n this._fillViewFormFromCommandValues();\n this._balloon.add({\n view: this.view,\n position: getBalloonCellPositionData(editor)\n });\n // Create a new batch. Clicking \"Cancel\" will undo this batch.\n this._undoStepBatch = editor.model.createBatch();\n // Basic a11y.\n this.view.focus();\n }\n /**\n * Removes the {@link #view} from the {@link #_balloon}.\n */\n _hideView() {\n const editor = this.editor;\n this.stopListening(editor.ui, 'update');\n this._isReady = false;\n // Blur any input element before removing it from DOM to prevent issues in some browsers.\n // See https://github.com/ckeditor/ckeditor5/issues/1501.\n this.view.saveButtonView.focus();\n this._balloon.remove(this.view);\n // Make sure the focus is not lost in the process by putting it directly\n // into the editing view.\n this.editor.editing.view.focus();\n }\n /**\n * Repositions the {@link #_balloon} or hides the {@link #view} if a table cell is no longer selected.\n */\n _updateView() {\n const editor = this.editor;\n const viewDocument = editor.editing.view.document;\n if (!getTableWidgetAncestor(viewDocument.selection)) {\n this._hideView();\n }\n else if (this._isViewVisible) {\n repositionContextualBalloon(editor, 'cell');\n }\n }\n /**\n * Returns `true` when the {@link #view} is visible in the {@link #_balloon}.\n */\n get _isViewVisible() {\n return !!this.view && this._balloon.visibleView === this.view;\n }\n /**\n * Returns `true` when the {@link #view} is in the {@link #_balloon}.\n */\n get _isViewInBalloon() {\n return !!this.view && this._balloon.hasView(this.view);\n }\n /**\n * Creates a callback that when executed upon the {@link #view view's} property change\n * executes a related editor command with the new property value.\n *\n * @param defaultValue The default value of the command.\n */\n _getPropertyChangeCallback(commandName) {\n return (evt, propertyName, newValue) => {\n if (!this._isReady) {\n return;\n }\n this.editor.execute(commandName, {\n value: newValue,\n batch: this._undoStepBatch\n });\n };\n }\n /**\n * Creates a callback that when executed upon the {@link #view view's} property change:\n * * Executes a related editor command with the new property value if the value is valid,\n * * Or sets the error text next to the invalid field, if the value did not pass the validation.\n */\n _getValidatedPropertyChangeCallback(options) {\n const { commandName, viewField, validator, errorText } = options;\n const setErrorTextDebounced = debounce(() => {\n viewField.errorText = errorText;\n }, ERROR_TEXT_TIMEOUT);\n return (evt, propertyName, newValue) => {\n setErrorTextDebounced.cancel();\n // Do not execute the command on initial call (opening the table properties view).\n if (!this._isReady) {\n return;\n }\n if (validator(newValue)) {\n this.editor.execute(commandName, {\n value: newValue,\n batch: this._undoStepBatch\n });\n viewField.errorText = null;\n }\n else {\n setErrorTextDebounced();\n }\n };\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m11.105 18-.17 1H2.5A1.5 1.5 0 0 1 1 17.5v-15A1.5 1.5 0 0 1 2.5 1h15A1.5 1.5 0 0 1 19 2.5v9.975l-.85-.124-.15-.302V8h-5v4h.021l-.172.351-1.916.28-.151.027c-.287.063-.54.182-.755.341L8 13v5h3.105zM2 12h5V8H2v4zm10-4H8v4h4V8zM2 2v5h5V2H2zm0 16h5v-5H2v5zM13 7h5V2h-5v5zM8 2v5h4V2H8z\\\" opacity=\\\".6\\\"/><path d=\\\"m15.5 11.5 1.323 2.68 2.957.43-2.14 2.085.505 2.946L15.5 18.25l-2.645 1.39.505-2.945-2.14-2.086 2.957-.43L15.5 11.5zM13 6a1 1 0 0 1 1 1v3.172a2.047 2.047 0 0 0-.293.443l-.858 1.736-1.916.28-.151.027A1.976 1.976 0 0 0 9.315 14H7a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6zm-1 2H8v4h4V8z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tablecellproperties/commands/tablecellpropertycommand\n */\nimport { Command } from 'ckeditor5/src/core';\n/**\n * The table cell attribute command.\n *\n * The command is a base command for other table cell property commands.\n */\nexport default class TableCellPropertyCommand extends Command {\n /**\n * Creates a new `TableCellPropertyCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param attributeName Table cell attribute name.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, attributeName, defaultValue) {\n super(editor);\n this.attributeName = attributeName;\n this._defaultValue = defaultValue;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const editor = this.editor;\n const tableUtils = this.editor.plugins.get('TableUtils');\n const selectedTableCells = tableUtils.getSelectionAffectedTableCells(editor.model.document.selection);\n this.isEnabled = !!selectedTableCells.length;\n this.value = this._getSingleValue(selectedTableCells);\n }\n /**\n * Executes the command.\n *\n * @fires execute\n * @param options.value If set, the command will set the attribute on selected table cells.\n * If it is not set, the command will remove the attribute from the selected table cells.\n * @param options.batch Pass the model batch instance to the command to aggregate changes,\n * for example to allow a single undo step for multiple executions.\n */\n execute(options = {}) {\n const { value, batch } = options;\n const model = this.editor.model;\n const tableUtils = this.editor.plugins.get('TableUtils');\n const tableCells = tableUtils.getSelectionAffectedTableCells(model.document.selection);\n const valueToSet = this._getValueToSet(value);\n model.enqueueChange(batch, writer => {\n if (valueToSet) {\n tableCells.forEach(tableCell => writer.setAttribute(this.attributeName, valueToSet, tableCell));\n }\n else {\n tableCells.forEach(tableCell => writer.removeAttribute(this.attributeName, tableCell));\n }\n });\n }\n /**\n * Returns the attribute value for a table cell.\n */\n _getAttribute(tableCell) {\n if (!tableCell) {\n return;\n }\n const value = tableCell.getAttribute(this.attributeName);\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n /**\n * Returns the proper model value. It can be used to add a default unit to numeric values.\n */\n _getValueToSet(value) {\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n /**\n * Returns a single value for all selected table cells. If the value is the same for all cells,\n * it will be returned (`undefined` otherwise).\n */\n _getSingleValue(tableCells) {\n const firstCellValue = this._getAttribute(tableCells[0]);\n const everyCellHasAttribute = tableCells.every(tableCells => this._getAttribute(tableCells) === firstCellValue);\n return everyCellHasAttribute ? firstCellValue : undefined;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TableCellPropertyCommand from '../../tablecellproperties/commands/tablecellpropertycommand';\nimport { addDefaultUnitToNumericValue } from '../../utils/table-properties';\n/**\n * The table cell width command.\n *\n * The command is registered by the {@link module:table/tablecellwidth/tablecellwidthediting~TableCellWidthEditing} as\n * the `'tableCellWidth'` editor command.\n *\n * To change the width of selected cells, execute the command:\n *\n * ```ts\n * editor.execute( 'tableCellWidth', {\n * value: '50px'\n * } );\n * ```\n *\n * **Note**: This command adds a default `'px'` unit to numeric values. Executing:\n *\n * ```ts\n * editor.execute( 'tableCellWidth', {\n * value: '50'\n * } );\n * ```\n *\n * will set the `width` attribute to `'50px'` in the model.\n */\nexport default class TableCellWidthCommand extends TableCellPropertyCommand {\n /**\n * Creates a new `TableCellWidthCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableCellWidth', defaultValue);\n }\n /**\n * @inheritDoc\n */\n _getValueToSet(value) {\n value = addDefaultUnitToNumericValue(value, 'px');\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tablecellwidth/tablecellwidthediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport TableEditing from './../tableediting';\nimport TableCellWidthCommand from './commands/tablecellwidthcommand';\nimport { getNormalizedDefaultProperties } from '../utils/table-properties';\nimport { enableProperty } from '../utils/common';\n/**\n * The table cell width editing feature.\n *\n * Introduces `tableCellWidth` table cell model attribute alongside with its converters\n * and a command.\n */\nexport default class TableCellWidthEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableCellWidthEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TableEditing];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const defaultTableCellProperties = getNormalizedDefaultProperties(editor.config.get('table.tableCellProperties.defaultProperties'));\n enableProperty(editor.model.schema, editor.conversion, {\n modelAttribute: 'tableCellWidth',\n styleName: 'width',\n defaultValue: defaultTableCellProperties.width\n });\n editor.commands.add('tableCellWidth', new TableCellWidthCommand(editor, defaultTableCellProperties.width));\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TableCellPropertyCommand from './tablecellpropertycommand';\nimport { addDefaultUnitToNumericValue, getSingleValue } from '../../utils/table-properties';\n/**\n * The table cell padding command.\n *\n * The command is registered by the {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing} as\n * the `'tableCellPadding'` editor command.\n *\n * To change the padding of selected cells, execute the command:\n *\n * ```ts\n * editor.execute( 'tableCellPadding', {\n * value: '5px'\n * } );\n * ```\n *\n * **Note**: This command adds the default `'px'` unit to numeric values. Executing:\n *\n * ```ts\n * editor.execute( 'tableCellPadding', {\n * value: '5'\n * } );\n * ```\n *\n * will set the `padding` attribute to `'5px'` in the model.\n */\nexport default class TableCellPaddingCommand extends TableCellPropertyCommand {\n /**\n * Creates a new `TableCellPaddingCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableCellPadding', defaultValue);\n }\n /**\n * @inheritDoc\n */\n _getAttribute(tableCell) {\n if (!tableCell) {\n return;\n }\n const value = getSingleValue(tableCell.getAttribute(this.attributeName));\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n /**\n * @inheritDoc\n */\n _getValueToSet(value) {\n const newValue = addDefaultUnitToNumericValue(value, 'px');\n if (newValue === this._defaultValue) {\n return;\n }\n return newValue;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TableCellPropertyCommand from './tablecellpropertycommand';\nimport { addDefaultUnitToNumericValue } from '../../utils/table-properties';\n/**\n * The table cell height command.\n *\n * The command is registered by the {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing} as\n * the `'tableCellHeight'` editor command.\n *\n * To change the height of selected cells, execute the command:\n *\n * ```ts\n * editor.execute( 'tableCellHeight', {\n * value: '50px'\n * } );\n * ```\n *\n * **Note**: This command adds the default `'px'` unit to numeric values. Executing:\n *\n * ```ts\n * editor.execute( 'tableCellHeight', {\n * value: '50'\n * } );\n * ```\n *\n * will set the `height` attribute to `'50px'` in the model.\n */\nexport default class TableCellHeightCommand extends TableCellPropertyCommand {\n /**\n * Creates a new `TableCellHeightCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableCellHeight', defaultValue);\n }\n /**\n * @inheritDoc\n */\n _getValueToSet(value) {\n const newValue = addDefaultUnitToNumericValue(value, 'px');\n if (newValue === this._defaultValue) {\n return;\n }\n return newValue;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TableCellPropertyCommand from './tablecellpropertycommand';\n/**\n * The table cell background color command.\n *\n * The command is registered by the {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing} as\n * the `'tableCellBackgroundColor'` editor command.\n *\n * To change the background color of selected cells, execute the command:\n *\n * ```ts\n * editor.execute( 'tableCellBackgroundColor', {\n * value: '#f00'\n * } );\n * ```\n */\nexport default class TableCellBackgroundColorCommand extends TableCellPropertyCommand {\n /**\n * Creates a new `TableCellBackgroundColorCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableCellBackgroundColor', defaultValue);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TableCellPropertyCommand from './tablecellpropertycommand';\n/**\n * The table cell vertical alignment command.\n *\n * The command is registered by the {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing} as\n * the `'tableCellVerticalAlignment'` editor command.\n *\n * To change the vertical text alignment of selected cells, execute the command:\n *\n * ```ts\n * editor.execute( 'tableCellVerticalAlignment', {\n * value: 'top'\n * } );\n * ```\n *\n * The following values, corresponding to the\n * [`vertical-align` CSS attribute](https://developer.mozilla.org/en-US/docs/Web/CSS/vertical-align), are allowed:\n *\n * * `'top'`\n * * `'bottom'`\n *\n * The `'middle'` value is the default one so there is no need to set it.\n */\nexport default class TableCellVerticalAlignmentCommand extends TableCellPropertyCommand {\n /**\n * Creates a new `TableCellVerticalAlignmentCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value for the \"alignment\" attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableCellVerticalAlignment', defaultValue);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TableCellPropertyCommand from './tablecellpropertycommand';\n/**\n * The table cell horizontal alignment command.\n *\n * The command is registered by the {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing} as\n * the `'tableCellHorizontalAlignment'` editor command.\n *\n * To change the horizontal text alignment of selected cells, execute the command:\n *\n * ```ts\n * editor.execute( 'tableCellHorizontalAlignment', {\n * value: 'right'\n * } );\n * ```\n */\nexport default class TableCellHorizontalAlignmentCommand extends TableCellPropertyCommand {\n /**\n * Creates a new `TableCellHorizontalAlignmentCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value for the \"alignment\" attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableCellHorizontalAlignment', defaultValue);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TableCellPropertyCommand from './tablecellpropertycommand';\nimport { getSingleValue } from '../../utils/table-properties';\n/**\n * The table cell border style command.\n *\n * The command is registered by the {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing} as\n * the `'tableCellBorderStyle'` editor command.\n *\n * To change the border style of selected cells, execute the command:\n *\n * ```ts\n * editor.execute( 'tableCellBorderStyle', {\n * value: 'dashed'\n * } );\n * ```\n */\nexport default class TableCellBorderStyleCommand extends TableCellPropertyCommand {\n /**\n * Creates a new `TableCellBorderStyleCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableCellBorderStyle', defaultValue);\n }\n /**\n * @inheritDoc\n */\n _getAttribute(tableCell) {\n if (!tableCell) {\n return;\n }\n const value = getSingleValue(tableCell.getAttribute(this.attributeName));\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TableCellPropertyCommand from './tablecellpropertycommand';\nimport { getSingleValue } from '../../utils/table-properties';\n/**\n * The table cell border color command.\n *\n * The command is registered by the {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing} as\n * the `'tableCellBorderColor'` editor command.\n *\n * To change the border color of selected cells, execute the command:\n *\n * ```ts\n * editor.execute( 'tableCellBorderColor', {\n * value: '#f00'\n * } );\n * ```\n */\nexport default class TableCellBorderColorCommand extends TableCellPropertyCommand {\n /**\n * Creates a new `TableCellBorderColorCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableCellBorderColor', defaultValue);\n }\n /**\n * @inheritDoc\n */\n _getAttribute(tableCell) {\n if (!tableCell) {\n return;\n }\n const value = getSingleValue(tableCell.getAttribute(this.attributeName));\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TableCellPropertyCommand from './tablecellpropertycommand';\nimport { addDefaultUnitToNumericValue, getSingleValue } from '../../utils/table-properties';\n/**\n * The table cell border width command.\n *\n * The command is registered by the {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing} as\n * the `'tableCellBorderWidth'` editor command.\n *\n * To change the border width of selected cells, execute the command:\n *\n * ```ts\n * editor.execute( 'tableCellBorderWidth', {\n * value: '5px'\n * } );\n * ```\n *\n * **Note**: This command adds the default `'px'` unit to numeric values. Executing:\n *\n * ```ts\n * editor.execute( 'tableCellBorderWidth', {\n * value: '5'\n * } );\n * ```\n *\n * will set the `borderWidth` attribute to `'5px'` in the model.\n */\nexport default class TableCellBorderWidthCommand extends TableCellPropertyCommand {\n /**\n * Creates a new `TableCellBorderWidthCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableCellBorderWidth', defaultValue);\n }\n /**\n * @inheritDoc\n */\n _getAttribute(tableCell) {\n if (!tableCell) {\n return;\n }\n const value = getSingleValue(tableCell.getAttribute(this.attributeName));\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n /**\n * @inheritDoc\n */\n _getValueToSet(value) {\n const newValue = addDefaultUnitToNumericValue(value, 'px');\n if (newValue === this._defaultValue) {\n return;\n }\n return newValue;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tablecellproperties/tablecellpropertiesediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { addBorderRules, addPaddingRules, addBackgroundRules } from 'ckeditor5/src/engine';\nimport { downcastAttributeToStyle, upcastBorderStyles } from './../converters/tableproperties';\nimport TableEditing from './../tableediting';\nimport TableCellWidthEditing from '../tablecellwidth/tablecellwidthediting';\nimport TableCellPaddingCommand from './commands/tablecellpaddingcommand';\nimport TableCellHeightCommand from './commands/tablecellheightcommand';\nimport TableCellBackgroundColorCommand from './commands/tablecellbackgroundcolorcommand';\nimport TableCellVerticalAlignmentCommand from './commands/tablecellverticalalignmentcommand';\nimport TableCellHorizontalAlignmentCommand from './commands/tablecellhorizontalalignmentcommand';\nimport TableCellBorderStyleCommand from './commands/tablecellborderstylecommand';\nimport TableCellBorderColorCommand from './commands/tablecellbordercolorcommand';\nimport TableCellBorderWidthCommand from './commands/tablecellborderwidthcommand';\nimport { getNormalizedDefaultProperties } from '../utils/table-properties';\nimport { enableProperty } from '../utils/common';\nconst VALIGN_VALUES_REG_EXP = /^(top|middle|bottom)$/;\nconst ALIGN_VALUES_REG_EXP = /^(left|center|right|justify)$/;\n/**\n * The table cell properties editing feature.\n *\n * Introduces table cell model attributes and their conversion:\n *\n * - border: `tableCellBorderStyle`, `tableCellBorderColor` and `tableCellBorderWidth`\n * - background color: `tableCellBackgroundColor`\n * - cell padding: `tableCellPadding`\n * - horizontal and vertical alignment: `tableCellHorizontalAlignment`, `tableCellVerticalAlignment`\n * - cell width and height: `tableCellWidth`, `tableCellHeight`\n *\n * It also registers commands used to manipulate the above attributes:\n *\n * - border: the `'tableCellBorderStyle'`, `'tableCellBorderColor'` and `'tableCellBorderWidth'` commands\n * - background color: the `'tableCellBackgroundColor'` command\n * - cell padding: the `'tableCellPadding'` command\n * - horizontal and vertical alignment: the `'tableCellHorizontalAlignment'` and `'tableCellVerticalAlignment'` commands\n * - width and height: the `'tableCellWidth'` and `'tableCellHeight'` commands\n */\nexport default class TableCellPropertiesEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableCellPropertiesEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TableEditing, TableCellWidthEditing];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n const conversion = editor.conversion;\n editor.config.define('table.tableCellProperties.defaultProperties', {});\n const defaultTableCellProperties = getNormalizedDefaultProperties(editor.config.get('table.tableCellProperties.defaultProperties'), {\n includeVerticalAlignmentProperty: true,\n includeHorizontalAlignmentProperty: true,\n includePaddingProperty: true,\n isRightToLeftContent: editor.locale.contentLanguageDirection === 'rtl'\n });\n editor.data.addStyleProcessorRules(addBorderRules);\n enableBorderProperties(schema, conversion, {\n color: defaultTableCellProperties.borderColor,\n style: defaultTableCellProperties.borderStyle,\n width: defaultTableCellProperties.borderWidth\n });\n editor.commands.add('tableCellBorderStyle', new TableCellBorderStyleCommand(editor, defaultTableCellProperties.borderStyle));\n editor.commands.add('tableCellBorderColor', new TableCellBorderColorCommand(editor, defaultTableCellProperties.borderColor));\n editor.commands.add('tableCellBorderWidth', new TableCellBorderWidthCommand(editor, defaultTableCellProperties.borderWidth));\n enableProperty(schema, conversion, {\n modelAttribute: 'tableCellHeight',\n styleName: 'height',\n defaultValue: defaultTableCellProperties.height\n });\n editor.commands.add('tableCellHeight', new TableCellHeightCommand(editor, defaultTableCellProperties.height));\n editor.data.addStyleProcessorRules(addPaddingRules);\n enableProperty(schema, conversion, {\n modelAttribute: 'tableCellPadding',\n styleName: 'padding',\n reduceBoxSides: true,\n defaultValue: defaultTableCellProperties.padding\n });\n editor.commands.add('tableCellPadding', new TableCellPaddingCommand(editor, defaultTableCellProperties.padding));\n editor.data.addStyleProcessorRules(addBackgroundRules);\n enableProperty(schema, conversion, {\n modelAttribute: 'tableCellBackgroundColor',\n styleName: 'background-color',\n defaultValue: defaultTableCellProperties.backgroundColor\n });\n editor.commands.add('tableCellBackgroundColor', new TableCellBackgroundColorCommand(editor, defaultTableCellProperties.backgroundColor));\n enableHorizontalAlignmentProperty(schema, conversion, defaultTableCellProperties.horizontalAlignment);\n editor.commands.add('tableCellHorizontalAlignment', new TableCellHorizontalAlignmentCommand(editor, defaultTableCellProperties.horizontalAlignment));\n enableVerticalAlignmentProperty(schema, conversion, defaultTableCellProperties.verticalAlignment);\n editor.commands.add('tableCellVerticalAlignment', new TableCellVerticalAlignmentCommand(editor, defaultTableCellProperties.verticalAlignment));\n }\n}\n/**\n * Enables the `'tableCellBorderStyle'`, `'tableCellBorderColor'` and `'tableCellBorderWidth'` attributes for table cells.\n *\n * @param defaultBorder The default border values.\n * @param defaultBorder.color The default `tableCellBorderColor` value.\n * @param defaultBorder.style The default `tableCellBorderStyle` value.\n * @param defaultBorder.width The default `tableCellBorderWidth` value.\n */\nfunction enableBorderProperties(schema, conversion, defaultBorder) {\n const modelAttributes = {\n width: 'tableCellBorderWidth',\n color: 'tableCellBorderColor',\n style: 'tableCellBorderStyle'\n };\n schema.extend('tableCell', {\n allowAttributes: Object.values(modelAttributes)\n });\n upcastBorderStyles(conversion, 'td', modelAttributes, defaultBorder);\n upcastBorderStyles(conversion, 'th', modelAttributes, defaultBorder);\n downcastAttributeToStyle(conversion, { modelElement: 'tableCell', modelAttribute: modelAttributes.style, styleName: 'border-style' });\n downcastAttributeToStyle(conversion, { modelElement: 'tableCell', modelAttribute: modelAttributes.color, styleName: 'border-color' });\n downcastAttributeToStyle(conversion, { modelElement: 'tableCell', modelAttribute: modelAttributes.width, styleName: 'border-width' });\n}\n/**\n * Enables the `'tableCellHorizontalAlignment'` attribute for table cells.\n *\n * @param defaultValue The default horizontal alignment value.\n */\nfunction enableHorizontalAlignmentProperty(schema, conversion, defaultValue) {\n schema.extend('tableCell', {\n allowAttributes: ['tableCellHorizontalAlignment']\n });\n conversion.for('downcast')\n .attributeToAttribute({\n model: {\n name: 'tableCell',\n key: 'tableCellHorizontalAlignment'\n },\n view: alignment => ({\n key: 'style',\n value: {\n 'text-align': alignment\n }\n })\n });\n conversion.for('upcast')\n // Support for the `text-align:*;` CSS definition for the table cell alignment.\n .attributeToAttribute({\n view: {\n name: /^(td|th)$/,\n styles: {\n 'text-align': ALIGN_VALUES_REG_EXP\n }\n },\n model: {\n key: 'tableCellHorizontalAlignment',\n value: (viewElement) => {\n const align = viewElement.getStyle('text-align');\n return align === defaultValue ? null : align;\n }\n }\n })\n // Support for the `align` attribute as the backward compatibility while pasting from other sources.\n .attributeToAttribute({\n view: {\n name: /^(td|th)$/,\n attributes: {\n align: ALIGN_VALUES_REG_EXP\n }\n },\n model: {\n key: 'tableCellHorizontalAlignment',\n value: (viewElement) => {\n const align = viewElement.getAttribute('align');\n return align === defaultValue ? null : align;\n }\n }\n });\n}\n/**\n * Enables the `'verticalAlignment'` attribute for table cells.\n *\n * @param defaultValue The default vertical alignment value.\n */\nfunction enableVerticalAlignmentProperty(schema, conversion, defaultValue) {\n schema.extend('tableCell', {\n allowAttributes: ['tableCellVerticalAlignment']\n });\n conversion.for('downcast')\n .attributeToAttribute({\n model: {\n name: 'tableCell',\n key: 'tableCellVerticalAlignment'\n },\n view: alignment => ({\n key: 'style',\n value: {\n 'vertical-align': alignment\n }\n })\n });\n conversion.for('upcast')\n // Support for the `vertical-align:*;` CSS definition for the table cell alignment.\n .attributeToAttribute({\n view: {\n name: /^(td|th)$/,\n styles: {\n 'vertical-align': VALIGN_VALUES_REG_EXP\n }\n },\n model: {\n key: 'tableCellVerticalAlignment',\n value: (viewElement) => {\n const align = viewElement.getStyle('vertical-align');\n return align === defaultValue ? null : align;\n }\n }\n })\n // Support for the `align` attribute as the backward compatibility while pasting from other sources.\n .attributeToAttribute({\n view: {\n name: /^(td|th)$/,\n attributes: {\n valign: VALIGN_VALUES_REG_EXP\n }\n },\n model: {\n key: 'tableCellVerticalAlignment',\n value: (viewElement) => {\n const valign = viewElement.getAttribute('valign');\n return valign === defaultValue ? null : valign;\n }\n }\n });\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tablecolumnresize/constants\n */\n/**\n * The minimum column width given as a percentage value. Used in situations when the table is not yet rendered, so it is impossible to\n * calculate how many percentage of the table width would be {@link ~COLUMN_MIN_WIDTH_IN_PIXELS minimum column width in pixels}.\n */\nexport const COLUMN_MIN_WIDTH_AS_PERCENTAGE = 5;\n/**\n * The minimum column width in pixels when the maximum table width is known.\n */\nexport const COLUMN_MIN_WIDTH_IN_PIXELS = 40;\n/**\n * Determines how many digits after the decimal point are used to store the column width as a percentage value.\n */\nexport const COLUMN_WIDTH_PRECISION = 2;\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { global } from 'ckeditor5/src/utils';\nimport { COLUMN_WIDTH_PRECISION, COLUMN_MIN_WIDTH_AS_PERCENTAGE, COLUMN_MIN_WIDTH_IN_PIXELS } from './constants';\n/**\n * Returns all the inserted or changed table model elements in a given change set. Only the tables\n * with 'columnsWidth' attribute are taken into account. The returned set may be empty.\n *\n * Most notably if an entire table is removed it will not be included in returned set.\n *\n * @param model The model to collect the affected elements from.\n * @returns A set of table model elements.\n */\nexport function getChangedResizedTables(model) {\n const affectedTables = new Set();\n for (const change of model.document.differ.getChanges()) {\n let referencePosition = null;\n // Checks if the particular change from the differ is:\n // - an insertion or removal of a table, a row or a cell,\n // - an attribute change on a table, a row or a cell.\n switch (change.type) {\n case 'insert':\n referencePosition = ['table', 'tableRow', 'tableCell'].includes(change.name) ?\n change.position :\n null;\n break;\n case 'remove':\n // If the whole table is removed, there's no need to update its column widths (#12201).\n referencePosition = ['tableRow', 'tableCell'].includes(change.name) ?\n change.position :\n null;\n break;\n case 'attribute':\n if (change.range.start.nodeAfter) {\n referencePosition = ['table', 'tableRow', 'tableCell'].includes(change.range.start.nodeAfter.name) ?\n change.range.start :\n null;\n }\n break;\n }\n if (!referencePosition) {\n continue;\n }\n const tableNode = (referencePosition.nodeAfter && referencePosition.nodeAfter.is('element', 'table')) ?\n referencePosition.nodeAfter : referencePosition.findAncestor('table');\n // We iterate over the whole table looking for the nested tables that are also affected.\n for (const node of model.createRangeOn(tableNode).getItems()) {\n if (!node.is('element', 'table')) {\n continue;\n }\n if (!getColumnGroupElement(node)) {\n continue;\n }\n affectedTables.add(node);\n }\n }\n return affectedTables;\n}\n/**\n * Calculates the percentage of the minimum column width given in pixels for a given table.\n *\n * @param modelTable A table model element.\n * @param editor The editor instance.\n * @returns The minimal column width in percentage.\n */\nexport function getColumnMinWidthAsPercentage(modelTable, editor) {\n return COLUMN_MIN_WIDTH_IN_PIXELS * 100 / getTableWidthInPixels(modelTable, editor);\n}\n/**\n * Calculates the table width in pixels.\n *\n * @param modelTable A table model element.\n * @param editor The editor instance.\n * @returns The width of the table in pixels.\n */\nexport function getTableWidthInPixels(modelTable, editor) {\n // It is possible for a table to not have a <tbody> element - see #11878.\n const referenceElement = getChildrenViewElement(modelTable, 'tbody', editor) || getChildrenViewElement(modelTable, 'thead', editor);\n const domReferenceElement = editor.editing.view.domConverter.mapViewToDom(referenceElement);\n return getElementWidthInPixels(domReferenceElement);\n}\n/**\n * Returns the a view element with a given name that is nested directly in a `<table>` element\n * related to a given `modelTable`.\n *\n * @param elementName Name of a view to be looked for, e.g. `'colgroup`', `'thead`'.\n * @returns Matched view or `undefined` otherwise.\n */\nfunction getChildrenViewElement(modelTable, elementName, editor) {\n const viewFigure = editor.editing.mapper.toViewElement(modelTable);\n const viewTable = [...viewFigure.getChildren()]\n .find((node) => node.is('element', 'table'));\n return [...viewTable.getChildren()]\n .find((node) => node.is('element', elementName));\n}\n/**\n * Returns the computed width (in pixels) of the DOM element without padding and borders.\n *\n * @param domElement A DOM element.\n * @returns The width of the DOM element in pixels.\n */\nexport function getElementWidthInPixels(domElement) {\n const styles = global.window.getComputedStyle(domElement);\n // In the 'border-box' box sizing algorithm, the element's width\n // already includes the padding and border width (#12335).\n if (styles.boxSizing === 'border-box') {\n return parseFloat(styles.width) -\n parseFloat(styles.paddingLeft) -\n parseFloat(styles.paddingRight) -\n parseFloat(styles.borderLeftWidth) -\n parseFloat(styles.borderRightWidth);\n }\n else {\n return parseFloat(styles.width);\n }\n}\n/**\n * Returns the column indexes on the left and right edges of a cell. They differ if the cell spans\n * across multiple columns.\n *\n * @param cell A table cell model element.\n * @param tableUtils The Table Utils plugin instance.\n * @returns An object containing the indexes of the left and right edges of the cell.\n */\nexport function getColumnEdgesIndexes(cell, tableUtils) {\n const cellColumnIndex = tableUtils.getCellLocation(cell).column;\n const cellWidth = cell.getAttribute('colspan') || 1;\n return {\n leftEdge: cellColumnIndex,\n rightEdge: cellColumnIndex + cellWidth - 1\n };\n}\n/**\n * Rounds the provided value to a fixed-point number with defined number of digits after the decimal point.\n *\n * @param value A number to be rounded.\n * @returns The rounded number.\n */\nexport function toPrecision(value) {\n const multiplier = Math.pow(10, COLUMN_WIDTH_PRECISION);\n const number = typeof value === 'number' ? value : parseFloat(value);\n return Math.round(number * multiplier) / multiplier;\n}\n/**\n * Clamps the number within the inclusive lower (min) and upper (max) bounds. Returned number is rounded using the\n * {@link ~toPrecision `toPrecision()`} function.\n *\n * @param number A number to be clamped.\n * @param min A lower bound.\n * @param max An upper bound.\n * @returns The clamped number.\n */\nexport function clamp(number, min, max) {\n if (number <= min) {\n return toPrecision(min);\n }\n if (number >= max) {\n return toPrecision(max);\n }\n return toPrecision(number);\n}\n/**\n * Creates an array with defined length and fills all elements with defined value.\n *\n * @param length The length of the array.\n * @param value The value to fill the array with.\n * @returns An array with defined length and filled with defined value.\n */\nexport function createFilledArray(length, value) {\n return Array(length).fill(value);\n}\n/**\n * Sums all array values that can be parsed to a float.\n *\n * @param array An array of numbers.\n * @returns The sum of all array values.\n */\nexport function sumArray(array) {\n return array\n .map(value => typeof value === 'number' ? value : parseFloat(value))\n .filter(value => !Number.isNaN(value))\n .reduce((result, item) => result + item, 0);\n}\n/**\n * Makes sure that the sum of the widths from all columns is 100%. If the sum of all the widths is not equal 100%, all the widths are\n * changed proportionally so that they all sum back to 100%. If there are columns without specified width, the amount remaining\n * after assigning the known widths will be distributed equally between them.\n *\n * Currently, only widths provided as percentage values are supported.\n *\n * @param columnWidths An array of column widths.\n * @returns An array of column widths guaranteed to sum up to 100%.\n */\nexport function normalizeColumnWidths(columnWidths) {\n const widths = columnWidths.map(width => {\n // Possible values are 'auto' or string ending with '%'\n if (width === 'auto') {\n return width;\n }\n return parseFloat(width.replace('%', ''));\n });\n let normalizedWidths = calculateMissingColumnWidths(widths);\n const totalWidth = sumArray(normalizedWidths);\n if (totalWidth !== 100) {\n normalizedWidths = normalizedWidths\n // Adjust all the columns proportionally.\n .map(width => toPrecision(width * 100 / totalWidth))\n // Due to rounding of numbers it may happen that the sum of the widths of all columns will not be exactly 100%.\n // Therefore, the width of the last column is explicitly adjusted (narrowed or expanded), since all the columns\n // have been proportionally changed already.\n .map((columnWidth, columnIndex, width) => {\n const isLastColumn = columnIndex === width.length - 1;\n if (!isLastColumn) {\n return columnWidth;\n }\n const totalWidth = sumArray(width);\n return toPrecision(columnWidth + 100 - totalWidth);\n });\n }\n return normalizedWidths.map(width => width + '%');\n}\n/**\n * Initializes the column widths by parsing the attribute value and calculating the uninitialized column widths. The special value 'auto'\n * indicates that width for the column must be calculated. The width of such uninitialized column is calculated as follows:\n * - If there is enough free space in the table for all uninitialized columns to have at least the minimum allowed width for all of them,\n * then set this width equally for all uninitialized columns.\n * - Otherwise, just set the minimum allowed width for all uninitialized columns. The sum of all column widths will be greater than 100%,\n * but then it will be adjusted proportionally to 100% in {@link #normalizeColumnWidths `normalizeColumnWidths()`}.\n *\n * @param columnWidths An array of column widths.\n * @returns An array with 'auto' values replaced with calculated widths.\n */\nfunction calculateMissingColumnWidths(columnWidths) {\n const numberOfUninitializedColumns = columnWidths.filter(columnWidth => columnWidth === 'auto').length;\n if (numberOfUninitializedColumns === 0) {\n return columnWidths.map(columnWidth => toPrecision(columnWidth));\n }\n const totalWidthOfInitializedColumns = sumArray(columnWidths);\n const widthForUninitializedColumn = Math.max((100 - totalWidthOfInitializedColumns) / numberOfUninitializedColumns, COLUMN_MIN_WIDTH_AS_PERCENTAGE);\n return columnWidths\n .map(columnWidth => columnWidth === 'auto' ? widthForUninitializedColumn : columnWidth)\n .map(columnWidth => toPrecision(columnWidth));\n}\n/**\n * Calculates the total horizontal space taken by the cell. That includes:\n * * width,\n * * left and red padding,\n * * border width.\n *\n * @param domCell A DOM cell element.\n * @returns Width in pixels without `px` at the end.\n */\nexport function getDomCellOuterWidth(domCell) {\n const styles = global.window.getComputedStyle(domCell);\n // In the 'border-box' box sizing algorithm, the element's width\n // already includes the padding and border width (#12335).\n if (styles.boxSizing === 'border-box') {\n return parseInt(styles.width);\n }\n else {\n return parseFloat(styles.width) +\n parseFloat(styles.paddingLeft) +\n parseFloat(styles.paddingRight) +\n parseFloat(styles.borderWidth);\n }\n}\n/**\n * Updates column elements to match columns widths.\n *\n * @param columns\n * @param tableColumnGroup\n * @param normalizedWidths\n * @param writer\n */\nexport function updateColumnElements(columns, tableColumnGroup, normalizedWidths, writer) {\n for (let i = 0; i < Math.max(normalizedWidths.length, columns.length); i++) {\n const column = columns[i];\n const columnWidth = normalizedWidths[i];\n if (!columnWidth) {\n // Number of `<tableColumn>` elements exceeds actual number of columns.\n writer.remove(column);\n }\n else if (!column) {\n // There is fewer `<tableColumn>` elements than actual columns.\n writer.appendElement('tableColumn', { columnWidth }, tableColumnGroup);\n }\n else {\n // Update column width.\n writer.setAttribute('columnWidth', columnWidth, column);\n }\n }\n}\n/**\n * Returns a 'tableColumnGroup' element from the 'table'.\n *\n * @internal\n * @param element A 'table' or 'tableColumnGroup' element.\n * @returns A 'tableColumnGroup' element.\n */\nexport function getColumnGroupElement(element) {\n if (element.is('element', 'tableColumnGroup')) {\n return element;\n }\n const children = element.getChildren();\n return Array\n .from(children)\n .find(element => element.is('element', 'tableColumnGroup'));\n}\n/**\n * Returns an array of 'tableColumn' elements.\n *\n * @internal\n * @param element A 'table' or 'tableColumnGroup' element.\n * @returns An array of 'tableColumn' elements.\n */\nexport function getTableColumnElements(element) {\n return Array.from(getColumnGroupElement(element).getChildren());\n}\n/**\n * Returns an array of table column widths.\n *\n * @internal\n * @param element A 'table' or 'tableColumnGroup' element.\n * @returns An array of table column widths.\n */\nexport function getTableColumnsWidths(element) {\n return getTableColumnElements(element).map(column => column.getAttribute('columnWidth'));\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { normalizeColumnWidths } from './utils';\n/**\n * Command used by the {@link module:table/tablecolumnresize~TableColumnResize Table column resize feature} that\n * updates the width of the whole table as well as its individual columns.\n */\nexport default class TableWidthsCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n // The command is always enabled as it doesn't care about the actual selection - table can be resized\n // even if the selection is elsewhere.\n this.isEnabled = true;\n }\n /**\n * Updated the `tableWidth` attribute of the table and the `columnWidth` attribute of the columns of that table.\n */\n execute(options = {}) {\n const { model, plugins } = this.editor;\n let { table = model.document.selection.getSelectedElement(), columnWidths, tableWidth } = options;\n if (columnWidths) {\n // For backwards compatibility, columnWidths might be an array or a string of comma-separated values.\n columnWidths = Array.isArray(columnWidths) ?\n columnWidths :\n columnWidths.split(',');\n }\n model.change(writer => {\n if (tableWidth) {\n writer.setAttribute('tableWidth', tableWidth, table);\n }\n else {\n writer.removeAttribute('tableWidth', table);\n }\n const tableColumnGroup = plugins\n .get('TableColumnResizeEditing')\n .getColumnGroupElement(table);\n if (!columnWidths && !tableColumnGroup) {\n return;\n }\n if (!columnWidths) {\n return writer.remove(tableColumnGroup);\n }\n const widths = normalizeColumnWidths(columnWidths);\n if (!tableColumnGroup) {\n const colGroupElement = writer.createElement('tableColumnGroup');\n widths.forEach(columnWidth => writer.appendElement('tableColumn', { columnWidth }, colGroupElement));\n writer.append(colGroupElement, table);\n }\n else {\n Array\n .from(tableColumnGroup.getChildren())\n .forEach((column, index) => writer.setAttribute('columnWidth', widths[index], column));\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tablecolumnresize/tablecolumnresizeediting\n */\nimport { throttle, isEqual } from 'lodash-es';\nimport { global, DomEmitterMixin } from 'ckeditor5/src/utils';\nimport { Plugin } from 'ckeditor5/src/core';\nimport MouseEventsObserver from '../../src/tablemouse/mouseeventsobserver';\nimport TableEditing from '../tableediting';\nimport TableUtils from '../tableutils';\nimport TableWalker from '../tablewalker';\nimport TableWidthsCommand from './tablewidthscommand';\nimport { downcastTableResizedClass, upcastColgroupElement } from './converters';\nimport { clamp, createFilledArray, sumArray, getColumnEdgesIndexes, getChangedResizedTables, getColumnMinWidthAsPercentage, getElementWidthInPixels, getTableWidthInPixels, normalizeColumnWidths, toPrecision, getDomCellOuterWidth, updateColumnElements, getColumnGroupElement, getTableColumnElements, getTableColumnsWidths } from './utils';\nimport { COLUMN_MIN_WIDTH_IN_PIXELS } from './constants';\n/**\n * The table column resize editing plugin.\n */\nexport default class TableColumnResizeEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TableEditing, TableUtils];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableColumnResizeEditing';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n this._isResizingActive = false;\n this.set('_isResizingAllowed', true);\n this._resizingData = null;\n this._domEmitter = new (DomEmitterMixin())();\n this._tableUtilsPlugin = editor.plugins.get('TableUtils');\n this.on('change:_isResizingAllowed', (evt, name, value) => {\n // Toggling the `ck-column-resize_disabled` class shows and hides the resizers through CSS.\n const classAction = value ? 'removeClass' : 'addClass';\n editor.editing.view.change(writer => {\n for (const root of editor.editing.view.document.roots) {\n writer[classAction]('ck-column-resize_disabled', editor.editing.view.document.getRoot(root.rootName));\n }\n });\n });\n }\n /**\n * @inheritDoc\n */\n init() {\n this._extendSchema();\n this._registerPostFixer();\n this._registerConverters();\n this._registerResizingListeners();\n this._registerResizerInserter();\n const editor = this.editor;\n const columnResizePlugin = editor.plugins.get('TableColumnResize');\n const tableEditing = editor.plugins.get('TableEditing');\n tableEditing.registerAdditionalSlot({\n filter: element => element.is('element', 'tableColumnGroup'),\n positionOffset: 0\n });\n const tableWidthsCommand = new TableWidthsCommand(editor);\n // For backwards compatibility we have two commands that perform exactly the same operation.\n editor.commands.add('resizeTableWidth', tableWidthsCommand);\n editor.commands.add('resizeColumnWidths', tableWidthsCommand);\n // Currently the states of column resize and table resize (which is actually the last column resize) features\n // are bound together. They can be separated in the future by adding distinct listeners and applying\n // different CSS classes (e.g. `ck-column-resize_disabled` and `ck-table-resize_disabled`) to the editor root.\n // See #12148 for the details.\n this.bind('_isResizingAllowed').to(editor, 'isReadOnly', columnResizePlugin, 'isEnabled', tableWidthsCommand, 'isEnabled', (isEditorReadOnly, isPluginEnabled, isTableWidthsCommandCommandEnabled) => !isEditorReadOnly && isPluginEnabled && isTableWidthsCommandCommandEnabled);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n this._domEmitter.stopListening();\n super.destroy();\n }\n /**\n * Returns a 'tableColumnGroup' element from the 'table'.\n *\n * @param element A 'table' or 'tableColumnGroup' element.\n * @returns A 'tableColumnGroup' element.\n */\n getColumnGroupElement(element) {\n return getColumnGroupElement(element);\n }\n /**\n * Returns an array of 'tableColumn' elements.\n *\n * @param element A 'table' or 'tableColumnGroup' element.\n * @returns An array of 'tableColumn' elements.\n */\n getTableColumnElements(element) {\n return getTableColumnElements(element);\n }\n /**\n * Returns an array of table column widths.\n *\n * @param element A 'table' or 'tableColumnGroup' element.\n * @returns An array of table column widths.\n */\n getTableColumnsWidths(element) {\n return getTableColumnsWidths(element);\n }\n /**\n * Registers new attributes for a table model element.\n */\n _extendSchema() {\n this.editor.model.schema.extend('table', {\n allowAttributes: ['tableWidth']\n });\n this.editor.model.schema.register('tableColumnGroup', {\n allowIn: 'table',\n isLimit: true\n });\n this.editor.model.schema.register('tableColumn', {\n allowIn: 'tableColumnGroup',\n allowAttributes: ['columnWidth'],\n isLimit: true\n });\n }\n /**\n * Registers table column resize post-fixer.\n *\n * It checks if the change from the differ concerns a table-related element or attribute. For detected changes it:\n * * Adjusts the `columnWidths` attribute to guarantee that the sum of the widths from all columns is 100%.\n * * Checks if the `columnWidths` attribute gets updated accordingly after columns have been added or removed.\n */\n _registerPostFixer() {\n const editor = this.editor;\n const model = editor.model;\n model.document.registerPostFixer(writer => {\n let changed = false;\n for (const table of getChangedResizedTables(model)) {\n const tableColumnGroup = this.getColumnGroupElement(table);\n const columns = this.getTableColumnElements(tableColumnGroup);\n const columnWidths = this.getTableColumnsWidths(tableColumnGroup);\n // Adjust the `columnWidths` attribute to guarantee that the sum of the widths from all columns is 100%.\n let normalizedWidths = normalizeColumnWidths(columnWidths);\n // If the number of columns has changed, then we need to adjust the widths of the affected columns.\n normalizedWidths = adjustColumnWidths(normalizedWidths, table, this);\n if (isEqual(columnWidths, normalizedWidths)) {\n continue;\n }\n updateColumnElements(columns, tableColumnGroup, normalizedWidths, writer);\n changed = true;\n }\n return changed;\n });\n /**\n * Adjusts if necessary the `columnWidths` in case if the number of column has changed.\n *\n * @param columnWidths Note: this array **may be modified** by the function.\n * @param table Table to be checked.\n */\n function adjustColumnWidths(columnWidths, table, plugin) {\n const newTableColumnsCount = plugin._tableUtilsPlugin.getColumns(table);\n const columnsCountDelta = newTableColumnsCount - columnWidths.length;\n if (columnsCountDelta === 0) {\n return columnWidths;\n }\n const widths = columnWidths.map(width => Number(width.replace('%', '')));\n // Collect all cells that are affected by the change.\n const cellSet = getAffectedCells(plugin.editor.model.document.differ, table);\n for (const cell of cellSet) {\n const currentColumnsDelta = newTableColumnsCount - widths.length;\n if (currentColumnsDelta === 0) {\n continue;\n }\n // If the column count in the table changed, adjust the widths of the affected columns.\n const hasMoreColumns = currentColumnsDelta > 0;\n const currentColumnIndex = plugin._tableUtilsPlugin.getCellLocation(cell).column;\n if (hasMoreColumns) {\n const columnMinWidthAsPercentage = getColumnMinWidthAsPercentage(table, plugin.editor);\n const columnWidthsToInsert = createFilledArray(currentColumnsDelta, columnMinWidthAsPercentage);\n widths.splice(currentColumnIndex, 0, ...columnWidthsToInsert);\n }\n else {\n // Moves the widths of the removed columns to the preceding one.\n // Other editors either reduce the width of the whole table or adjust the widths\n // proportionally, so change of this behavior can be considered in the future.\n const removedColumnWidths = widths.splice(currentColumnIndex, Math.abs(currentColumnsDelta));\n widths[currentColumnIndex] += sumArray(removedColumnWidths);\n }\n }\n return widths.map(width => width + '%');\n }\n /**\n * Returns a set of cells that have been changed in a given table.\n */\n function getAffectedCells(differ, table) {\n const cellSet = new Set();\n for (const change of differ.getChanges()) {\n if (change.type == 'insert' &&\n change.position.nodeAfter &&\n change.position.nodeAfter.name == 'tableCell' &&\n change.position.nodeAfter.getAncestors().includes(table)) {\n cellSet.add(change.position.nodeAfter);\n }\n else if (change.type == 'remove') {\n // If the first cell was removed, use the node after the change position instead.\n const referenceNode = (change.position.nodeBefore || change.position.nodeAfter);\n if (referenceNode.name == 'tableCell' && referenceNode.getAncestors().includes(table)) {\n cellSet.add(referenceNode);\n }\n }\n }\n return cellSet;\n }\n }\n /**\n * Registers table column resize converters.\n */\n _registerConverters() {\n const editor = this.editor;\n const conversion = editor.conversion;\n // Table width style\n conversion.for('upcast').attributeToAttribute({\n view: {\n name: 'figure',\n key: 'style',\n value: {\n width: /[\\s\\S]+/\n }\n },\n model: {\n name: 'table',\n key: 'tableWidth',\n value: (viewElement) => viewElement.getStyle('width')\n }\n });\n conversion.for('downcast').attributeToAttribute({\n model: {\n name: 'table',\n key: 'tableWidth'\n },\n view: (width) => ({\n name: 'figure',\n key: 'style',\n value: {\n width\n }\n })\n });\n conversion.elementToElement({ model: 'tableColumnGroup', view: 'colgroup' });\n conversion.elementToElement({ model: 'tableColumn', view: 'col' });\n conversion.for('downcast').add(downcastTableResizedClass());\n conversion.for('upcast').add(upcastColgroupElement(this._tableUtilsPlugin));\n conversion.for('upcast').attributeToAttribute({\n view: {\n name: 'col',\n styles: {\n width: /.*/\n }\n },\n model: {\n key: 'columnWidth',\n value: (viewElement) => {\n const viewColWidth = viewElement.getStyle('width');\n if (!viewColWidth || !viewColWidth.endsWith('%')) {\n return 'auto';\n }\n return viewColWidth;\n }\n }\n });\n conversion.for('downcast').attributeToAttribute({\n model: {\n name: 'tableColumn',\n key: 'columnWidth'\n },\n view: width => ({ key: 'style', value: { width } })\n });\n }\n /**\n * Registers listeners to handle resizing process.\n */\n _registerResizingListeners() {\n const editingView = this.editor.editing.view;\n editingView.addObserver(MouseEventsObserver);\n editingView.document.on('mousedown', this._onMouseDownHandler.bind(this), { priority: 'high' });\n this._domEmitter.listenTo(global.window.document, 'mousemove', throttle(this._onMouseMoveHandler.bind(this), 50));\n this._domEmitter.listenTo(global.window.document, 'mouseup', this._onMouseUpHandler.bind(this));\n }\n /**\n * Handles the `mousedown` event on column resizer element:\n * * calculates the initial column pixel widths,\n * * inserts the `<colgroup>` element if it is not present in the `<table>`,\n * * puts the necessary data in the temporary storage,\n * * applies the attributes to the `<table>` view element.\n *\n * @param eventInfo An object containing information about the fired event.\n * @param domEventData The data related to the DOM event.\n */\n _onMouseDownHandler(eventInfo, domEventData) {\n const target = domEventData.target;\n if (!target.hasClass('ck-table-column-resizer')) {\n return;\n }\n if (!this._isResizingAllowed) {\n return;\n }\n const editor = this.editor;\n const modelTable = editor.editing.mapper.toModelElement(target.findAncestor('figure'));\n // Do not resize if table model is in non-editable place.\n if (!editor.model.canEditAt(modelTable)) {\n return;\n }\n domEventData.preventDefault();\n eventInfo.stop();\n // The column widths are calculated upon mousedown to allow lazy applying the `columnWidths` attribute on the table.\n const columnWidthsInPx = _calculateDomColumnWidths(modelTable, this._tableUtilsPlugin, editor);\n const viewTable = target.findAncestor('table');\n const editingView = editor.editing.view;\n // Insert colgroup for the table that is resized for the first time.\n if (!Array.from(viewTable.getChildren()).find(viewCol => viewCol.is('element', 'colgroup'))) {\n editingView.change(viewWriter => {\n _insertColgroupElement(viewWriter, columnWidthsInPx, viewTable);\n });\n }\n this._isResizingActive = true;\n this._resizingData = this._getResizingData(domEventData, columnWidthsInPx);\n // At this point we change only the editor view - we don't want other users to see our changes yet,\n // so we can't apply them in the model.\n editingView.change(writer => _applyResizingAttributesToTable(writer, viewTable, this._resizingData));\n /**\n * Calculates the DOM columns' widths. It is done by taking the width of the widest cell\n * from each table column (we rely on the {@link module:table/tablewalker~TableWalker}\n * to determine which column the cell belongs to).\n *\n * @param modelTable A table which columns should be measured.\n * @param tableUtils The Table Utils plugin instance.\n * @param editor The editor instance.\n * @returns Columns' widths expressed in pixels (without unit).\n */\n function _calculateDomColumnWidths(modelTable, tableUtilsPlugin, editor) {\n const columnWidthsInPx = Array(tableUtilsPlugin.getColumns(modelTable));\n const tableWalker = new TableWalker(modelTable);\n for (const cellSlot of tableWalker) {\n const viewCell = editor.editing.mapper.toViewElement(cellSlot.cell);\n const domCell = editor.editing.view.domConverter.mapViewToDom(viewCell);\n const domCellWidth = getDomCellOuterWidth(domCell);\n if (!columnWidthsInPx[cellSlot.column] || domCellWidth < columnWidthsInPx[cellSlot.column]) {\n columnWidthsInPx[cellSlot.column] = toPrecision(domCellWidth);\n }\n }\n return columnWidthsInPx;\n }\n /**\n * Creates a `<colgroup>` element with `<col>`s and inserts it into a given view table.\n *\n * @param viewWriter A writer instance.\n * @param columnWidthsInPx Column widths.\n * @param viewTable A table view element.\n */\n function _insertColgroupElement(viewWriter, columnWidthsInPx, viewTable) {\n const colgroup = viewWriter.createContainerElement('colgroup');\n for (let i = 0; i < columnWidthsInPx.length; i++) {\n const viewColElement = viewWriter.createEmptyElement('col');\n const columnWidthInPc = `${toPrecision(columnWidthsInPx[i] / sumArray(columnWidthsInPx) * 100)}%`;\n viewWriter.setStyle('width', columnWidthInPc, viewColElement);\n viewWriter.insert(viewWriter.createPositionAt(colgroup, 'end'), viewColElement);\n }\n viewWriter.insert(viewWriter.createPositionAt(viewTable, 0), colgroup);\n }\n /**\n * Applies the style and classes to the view table as the resizing begun.\n *\n * @param viewWriter A writer instance.\n * @param viewTable A table containing the clicked resizer.\n * @param resizingData Data related to the resizing.\n */\n function _applyResizingAttributesToTable(viewWriter, viewTable, resizingData) {\n const figureInitialPcWidth = resizingData.widths.viewFigureWidth / resizingData.widths.viewFigureParentWidth;\n viewWriter.addClass('ck-table-resized', viewTable);\n viewWriter.addClass('ck-table-column-resizer__active', resizingData.elements.viewResizer);\n viewWriter.setStyle('width', `${toPrecision(figureInitialPcWidth * 100)}%`, viewTable.findAncestor('figure'));\n }\n }\n /**\n * Handles the `mousemove` event.\n * * If resizing process is not in progress, it does nothing.\n * * If resizing is active but not allowed, it stops the resizing process instantly calling the `mousedown` event handler.\n * * Otherwise it dynamically updates the widths of the resized columns.\n *\n * @param eventInfo An object containing information about the fired event.\n * @param mouseEventData The native DOM event.\n */\n _onMouseMoveHandler(eventInfo, mouseEventData) {\n if (!this._isResizingActive) {\n return;\n }\n if (!this._isResizingAllowed) {\n this._onMouseUpHandler();\n return;\n }\n const { columnPosition, flags: { isRightEdge, isTableCentered, isLtrContent }, elements: { viewFigure, viewLeftColumn, viewRightColumn }, widths: { viewFigureParentWidth, tableWidth, leftColumnWidth, rightColumnWidth } } = this._resizingData;\n const dxLowerBound = -leftColumnWidth + COLUMN_MIN_WIDTH_IN_PIXELS;\n const dxUpperBound = isRightEdge ?\n viewFigureParentWidth - tableWidth :\n rightColumnWidth - COLUMN_MIN_WIDTH_IN_PIXELS;\n // The multiplier is needed for calculating the proper movement offset:\n // - it should negate the sign if content language direction is right-to-left,\n // - it should double the offset if the table edge is resized and table is centered.\n const multiplier = (isLtrContent ? 1 : -1) * (isRightEdge && isTableCentered ? 2 : 1);\n const dx = clamp((mouseEventData.clientX - columnPosition) * multiplier, Math.min(dxLowerBound, 0), Math.max(dxUpperBound, 0));\n if (dx === 0) {\n return;\n }\n this.editor.editing.view.change(writer => {\n const leftColumnWidthAsPercentage = toPrecision((leftColumnWidth + dx) * 100 / tableWidth);\n writer.setStyle('width', `${leftColumnWidthAsPercentage}%`, viewLeftColumn);\n if (isRightEdge) {\n const tableWidthAsPercentage = toPrecision((tableWidth + dx) * 100 / viewFigureParentWidth);\n writer.setStyle('width', `${tableWidthAsPercentage}%`, viewFigure);\n }\n else {\n const rightColumnWidthAsPercentage = toPrecision((rightColumnWidth - dx) * 100 / tableWidth);\n writer.setStyle('width', `${rightColumnWidthAsPercentage}%`, viewRightColumn);\n }\n });\n }\n /**\n * Handles the `mouseup` event.\n * * If resizing process is not in progress, it does nothing.\n * * If resizing is active but not allowed, it cancels the resizing process restoring the original widths.\n * * Otherwise it propagates the changes from view to the model by executing the adequate commands.\n */\n _onMouseUpHandler() {\n if (!this._isResizingActive) {\n return;\n }\n const { viewResizer, modelTable, viewFigure, viewColgroup } = this._resizingData.elements;\n const editor = this.editor;\n const editingView = editor.editing.view;\n const tableColumnGroup = this.getColumnGroupElement(modelTable);\n const viewColumns = Array\n .from(viewColgroup.getChildren())\n .filter((column) => column.is('view:element'));\n const columnWidthsAttributeOld = tableColumnGroup ?\n this.getTableColumnsWidths(tableColumnGroup) :\n null;\n const columnWidthsAttributeNew = viewColumns.map(column => column.getStyle('width'));\n const isColumnWidthsAttributeChanged = !isEqual(columnWidthsAttributeOld, columnWidthsAttributeNew);\n const tableWidthAttributeOld = modelTable.getAttribute('tableWidth');\n const tableWidthAttributeNew = viewFigure.getStyle('width');\n const isTableWidthAttributeChanged = tableWidthAttributeOld !== tableWidthAttributeNew;\n if (isColumnWidthsAttributeChanged || isTableWidthAttributeChanged) {\n if (this._isResizingAllowed) {\n editor.execute('resizeTableWidth', {\n table: modelTable,\n tableWidth: `${toPrecision(tableWidthAttributeNew)}%`,\n columnWidths: columnWidthsAttributeNew\n });\n }\n else {\n // In read-only mode revert all changes in the editing view. The model is not touched so it does not need to be restored.\n // This case can occur if the read-only mode kicks in during the resizing process.\n editingView.change(writer => {\n // If table had resized columns before, restore the previous column widths.\n // Otherwise clean up the view from the temporary column resizing markup.\n if (columnWidthsAttributeOld) {\n for (const viewCol of viewColumns) {\n writer.setStyle('width', columnWidthsAttributeOld.shift(), viewCol);\n }\n }\n else {\n writer.remove(viewColgroup);\n }\n if (isTableWidthAttributeChanged) {\n // If the whole table was already resized before, restore the previous table width.\n // Otherwise clean up the view from the temporary table resizing markup.\n if (tableWidthAttributeOld) {\n writer.setStyle('width', tableWidthAttributeOld, viewFigure);\n }\n else {\n writer.removeStyle('width', viewFigure);\n }\n }\n // If a table and its columns weren't resized before,\n // prune the remaining common resizing markup.\n if (!columnWidthsAttributeOld && !tableWidthAttributeOld) {\n writer.removeClass('ck-table-resized', [...viewFigure.getChildren()].find(element => element.name === 'table'));\n }\n });\n }\n }\n editingView.change(writer => {\n writer.removeClass('ck-table-column-resizer__active', viewResizer);\n });\n this._isResizingActive = false;\n this._resizingData = null;\n }\n /**\n * Retrieves and returns required data needed for the resizing process.\n *\n * @param domEventData The data of the `mousedown` event.\n * @param columnWidths The current widths of the columns.\n * @returns The data needed for the resizing process.\n */\n _getResizingData(domEventData, columnWidths) {\n const editor = this.editor;\n const columnPosition = domEventData.domEvent.clientX;\n const viewResizer = domEventData.target;\n const viewLeftCell = viewResizer.findAncestor('td') || viewResizer.findAncestor('th');\n const modelLeftCell = editor.editing.mapper.toModelElement(viewLeftCell);\n const modelTable = modelLeftCell.findAncestor('table');\n const leftColumnIndex = getColumnEdgesIndexes(modelLeftCell, this._tableUtilsPlugin).rightEdge;\n const lastColumnIndex = this._tableUtilsPlugin.getColumns(modelTable) - 1;\n const isRightEdge = leftColumnIndex === lastColumnIndex;\n const isTableCentered = !modelTable.hasAttribute('tableAlignment');\n const isLtrContent = editor.locale.contentLanguageDirection !== 'rtl';\n const viewTable = viewLeftCell.findAncestor('table');\n const viewFigure = viewTable.findAncestor('figure');\n const viewColgroup = [...viewTable.getChildren()]\n .find(viewCol => viewCol.is('element', 'colgroup'));\n const viewLeftColumn = viewColgroup.getChild(leftColumnIndex);\n const viewRightColumn = isRightEdge ? undefined : viewColgroup.getChild(leftColumnIndex + 1);\n const viewFigureParentWidth = getElementWidthInPixels(editor.editing.view.domConverter.mapViewToDom(viewFigure.parent));\n const viewFigureWidth = getElementWidthInPixels(editor.editing.view.domConverter.mapViewToDom(viewFigure));\n const tableWidth = getTableWidthInPixels(modelTable, editor);\n const leftColumnWidth = columnWidths[leftColumnIndex];\n const rightColumnWidth = isRightEdge ? undefined : columnWidths[leftColumnIndex + 1];\n return {\n columnPosition,\n flags: {\n isRightEdge,\n isTableCentered,\n isLtrContent\n },\n elements: {\n viewResizer,\n modelTable,\n viewFigure,\n viewColgroup,\n viewLeftColumn,\n viewRightColumn\n },\n widths: {\n viewFigureParentWidth,\n viewFigureWidth,\n tableWidth,\n leftColumnWidth,\n rightColumnWidth\n }\n };\n }\n /**\n * Registers a listener ensuring that each resizable cell have a resizer handle.\n */\n _registerResizerInserter() {\n this.editor.conversion.for('editingDowncast').add(dispatcher => {\n dispatcher.on('insert:tableCell', (evt, data, conversionApi) => {\n const modelElement = data.item;\n const viewElement = conversionApi.mapper.toViewElement(modelElement);\n const viewWriter = conversionApi.writer;\n viewWriter.insert(viewWriter.createPositionAt(viewElement, 'end'), viewWriter.createUIElement('div', { class: 'ck-table-column-resizer' }));\n }, { priority: 'lowest' });\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { normalizeColumnWidths, updateColumnElements, getColumnGroupElement, getTableColumnElements, getTableColumnsWidths } from './utils';\n/**\n * Returns a upcast helper that ensures the number of `<tableColumn>` elements corresponds to the actual number of columns in the table,\n * because the input data might have too few or too many <col> elements.\n */\nexport function upcastColgroupElement(tableUtilsPlugin) {\n return dispatcher => dispatcher.on('element:colgroup', (evt, data, conversionApi) => {\n const modelTable = data.modelCursor.findAncestor('table');\n const tableColumnGroup = getColumnGroupElement(modelTable);\n if (!tableColumnGroup) {\n return;\n }\n const columnElements = getTableColumnElements(tableColumnGroup);\n let columnWidths = getTableColumnsWidths(tableColumnGroup);\n const columnsCount = tableUtilsPlugin.getColumns(modelTable);\n columnWidths = Array.from({ length: columnsCount }, (_, index) => columnWidths[index] || 'auto');\n if (columnWidths.length != columnElements.length || columnWidths.includes('auto')) {\n updateColumnElements(columnElements, tableColumnGroup, normalizeColumnWidths(columnWidths), conversionApi.writer);\n }\n }, { priority: 'low' });\n}\n/**\n * Returns downcast helper for adding `ck-table-resized` class if there is a `<tableColumnGroup>` element inside the table.\n */\nexport function downcastTableResizedClass() {\n return dispatcher => dispatcher.on('insert:table', (evt, data, conversionApi) => {\n const viewWriter = conversionApi.writer;\n const modelTable = data.item;\n const viewElement = conversionApi.mapper.toViewElement(modelTable);\n const viewTable = viewElement.is('element', 'table') ?\n viewElement :\n Array.from(viewElement.getChildren()).find(viewChild => viewChild.is('element', 'table'));\n const tableColumnGroup = getColumnGroupElement(modelTable);\n if (tableColumnGroup) {\n viewWriter.addClass('ck-table-resized', viewTable);\n }\n else {\n viewWriter.removeClass('ck-table-resized', viewTable);\n }\n }, { priority: 'low' });\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tablecolumnresize.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core';\n/**\n * The table cell attribute command.\n *\n * This command is a base command for other table property commands.\n */\nexport default class TablePropertyCommand extends Command {\n /**\n * Creates a new `TablePropertyCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param attributeName Table cell attribute name.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, attributeName, defaultValue) {\n super(editor);\n this.attributeName = attributeName;\n this._defaultValue = defaultValue;\n }\n /**\n * @inheritDoc\n */\n refresh() {\n const editor = this.editor;\n const selection = editor.model.document.selection;\n const table = selection.getFirstPosition().findAncestor('table');\n this.isEnabled = !!table;\n this.value = this._getValue(table);\n }\n /**\n * Executes the command.\n *\n * @fires execute\n * @param options.value If set, the command will set the attribute on the selected table.\n * If not set, the command will remove the attribute from the selected table.\n * @param options.batch Pass the model batch instance to the command to aggregate changes,\n * for example, to allow a single undo step for multiple executions.\n */\n execute(options = {}) {\n const model = this.editor.model;\n const selection = model.document.selection;\n const { value, batch } = options;\n const table = selection.getFirstPosition().findAncestor('table');\n const valueToSet = this._getValueToSet(value);\n model.enqueueChange(batch, writer => {\n if (valueToSet) {\n writer.setAttribute(this.attributeName, valueToSet, table);\n }\n else {\n writer.removeAttribute(this.attributeName, table);\n }\n });\n }\n /**\n * Returns the attribute value for a table.\n */\n _getValue(table) {\n if (!table) {\n return;\n }\n const value = table.getAttribute(this.attributeName);\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n /**\n * Returns the proper model value. It can be used to add a default unit to numeric values.\n */\n _getValueToSet(value) {\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TablePropertyCommand from './tablepropertycommand';\n/**\n * The table background color command.\n *\n * The command is registered by the {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing} as\n * the `'tableBackgroundColor'` editor command.\n *\n * To change the background color of the selected table, execute the command:\n *\n * ```ts\n * editor.execute( 'tableBackgroundColor', {\n * value: '#f00'\n * } );\n * ```\n */\nexport default class TableBackgroundColorCommand extends TablePropertyCommand {\n /**\n * Creates a new `TableBackgroundColorCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableBackgroundColor', defaultValue);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TablePropertyCommand from './tablepropertycommand';\nimport { getSingleValue } from '../../utils/table-properties';\n/**\n * The table border color command.\n *\n * The command is registered by the {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing} as\n * the `'tableBorderColor'` editor command.\n *\n * To change the border color of the selected table, execute the command:\n *\n * ```ts\n * editor.execute( 'tableBorderColor', {\n * value: '#f00'\n * } );\n * ```\n */\nexport default class TableBorderColorCommand extends TablePropertyCommand {\n /**\n * Creates a new `TableBorderColorCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableBorderColor', defaultValue);\n }\n /**\n * @inheritDoc\n */\n _getValue(table) {\n if (!table) {\n return;\n }\n const value = getSingleValue(table.getAttribute(this.attributeName));\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TablePropertyCommand from './tablepropertycommand';\nimport { getSingleValue } from '../../utils/table-properties';\n/**\n * The table style border command.\n *\n * The command is registered by the {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing} as\n * the `'tableBorderStyle'` editor command.\n *\n * To change the border style of the selected table, execute the command:\n *\n * ```ts\n * editor.execute( 'tableBorderStyle', {\n * value: 'dashed'\n * } );\n * ```\n */\nexport default class TableBorderStyleCommand extends TablePropertyCommand {\n /**\n * Creates a new `TableBorderStyleCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableBorderStyle', defaultValue);\n }\n /**\n * @inheritDoc\n */\n _getValue(table) {\n if (!table) {\n return;\n }\n const value = getSingleValue(table.getAttribute(this.attributeName));\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TablePropertyCommand from './tablepropertycommand';\nimport { addDefaultUnitToNumericValue, getSingleValue } from '../../utils/table-properties';\n/**\n * The table width border command.\n *\n * The command is registered by the {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing} as\n * the `'tableBorderWidth'` editor command.\n *\n * To change the border width of the selected table, execute the command:\n *\n * ```ts\n * editor.execute( 'tableBorderWidth', {\n * value: '5px'\n * } );\n * ```\n *\n * **Note**: This command adds the default `'px'` unit to numeric values. Executing:\n *\n * ```ts\n * editor.execute( 'tableBorderWidth', {\n * value: '5'\n * } );\n * ```\n *\n * will set the `borderWidth` attribute to `'5px'` in the model.\n */\nexport default class TableBorderWidthCommand extends TablePropertyCommand {\n /**\n * Creates a new `TableBorderWidthCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableBorderWidth', defaultValue);\n }\n /**\n * @inheritDoc\n */\n _getValue(table) {\n if (!table) {\n return;\n }\n const value = getSingleValue(table.getAttribute(this.attributeName));\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n /**\n * @inheritDoc\n */\n _getValueToSet(value) {\n const newValue = addDefaultUnitToNumericValue(value, 'px');\n if (newValue === this._defaultValue) {\n return;\n }\n return newValue;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tableproperties/commands/tablewidthcommand\n */\nimport TablePropertyCommand from './tablepropertycommand';\nimport { addDefaultUnitToNumericValue } from '../../utils/table-properties';\n/**\n * The table width command.\n *\n * The command is registered by the {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing} as\n * the `'tableWidth'` editor command.\n *\n * To change the width of the selected table, execute the command:\n *\n * ```ts\n * editor.execute( 'tableWidth', {\n * value: '400px'\n * } );\n * ```\n *\n * **Note**: This command adds the default `'px'` unit to numeric values. Executing:\n *\n * ```ts\n * editor.execute( 'tableWidth', {\n * value: '50'\n * } );\n * ```\n *\n * will set the `width` attribute to `'50px'` in the model.\n */\nexport default class TableWidthCommand extends TablePropertyCommand {\n /**\n * Creates a new `TableWidthCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableWidth', defaultValue);\n }\n /**\n * @inheritDoc\n */\n _getValueToSet(value) {\n value = addDefaultUnitToNumericValue(value, 'px');\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tableproperties/commands/tableheightcommand\n */\nimport TablePropertyCommand from './tablepropertycommand';\nimport { addDefaultUnitToNumericValue } from '../../utils/table-properties';\n/**\n * The table height command.\n *\n * The command is registered by the {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing} as\n * the `'tableHeight'` editor command.\n *\n * To change the height of the selected table, execute the command:\n *\n * ```ts\n * editor.execute( 'tableHeight', {\n * value: '500px'\n * } );\n * ```\n *\n * **Note**: This command adds the default `'px'` unit to numeric values. Executing:\n *\n * ```ts\n * editor.execute( 'tableHeight', {\n * value: '50'\n * } );\n * ```\n *\n * will set the `height` attribute to `'50px'` in the model.\n */\nexport default class TableHeightCommand extends TablePropertyCommand {\n /**\n * Creates a new `TableHeightCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value of the attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableHeight', defaultValue);\n }\n /**\n * @inheritDoc\n */\n _getValueToSet(value) {\n value = addDefaultUnitToNumericValue(value, 'px');\n if (value === this._defaultValue) {\n return;\n }\n return value;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport TablePropertyCommand from './tablepropertycommand';\n/**\n * The table alignment command.\n *\n * The command is registered by the {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing} as\n * the `'tableAlignment'` editor command.\n *\n * To change the alignment of the selected table, execute the command:\n *\n * ```ts\n * editor.execute( 'tableAlignment', {\n * value: 'right'\n * } );\n * ```\n */\nexport default class TableAlignmentCommand extends TablePropertyCommand {\n /**\n * Creates a new `TableAlignmentCommand` instance.\n *\n * @param editor An editor in which this command will be used.\n * @param defaultValue The default value for the \"alignment\" attribute.\n */\n constructor(editor, defaultValue) {\n super(editor, 'tableAlignment', defaultValue);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tableproperties/tablepropertiesediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { addBackgroundRules, addBorderRules } from 'ckeditor5/src/engine';\nimport TableEditing from '../tableediting';\nimport { downcastAttributeToStyle, downcastTableAttribute, upcastBorderStyles, upcastStyleToAttribute } from '../converters/tableproperties';\nimport TableBackgroundColorCommand from './commands/tablebackgroundcolorcommand';\nimport TableBorderColorCommand from './commands/tablebordercolorcommand';\nimport TableBorderStyleCommand from './commands/tableborderstylecommand';\nimport TableBorderWidthCommand from './commands/tableborderwidthcommand';\nimport TableWidthCommand from './commands/tablewidthcommand';\nimport TableHeightCommand from './commands/tableheightcommand';\nimport TableAlignmentCommand from './commands/tablealignmentcommand';\nimport { getNormalizedDefaultProperties } from '../utils/table-properties';\nconst ALIGN_VALUES_REG_EXP = /^(left|center|right)$/;\nconst FLOAT_VALUES_REG_EXP = /^(left|none|right)$/;\n/**\n * The table properties editing feature.\n *\n * Introduces table's model attributes and their conversion:\n *\n * - border: `tableBorderStyle`, `tableBorderColor` and `tableBorderWidth`\n * - background color: `tableBackgroundColor`\n * - horizontal alignment: `tableAlignment`\n * - width & height: `tableWidth` & `tableHeight`\n *\n * It also registers commands used to manipulate the above attributes:\n *\n * - border: `'tableBorderStyle'`, `'tableBorderColor'` and `'tableBorderWidth'` commands\n * - background color: `'tableBackgroundColor'`\n * - horizontal alignment: `'tableAlignment'`\n * - width & height: `'tableWidth'` & `'tableHeight'`\n */\nexport default class TablePropertiesEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TablePropertiesEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TableEditing];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n const conversion = editor.conversion;\n editor.config.define('table.tableProperties.defaultProperties', {});\n const defaultTableProperties = getNormalizedDefaultProperties(editor.config.get('table.tableProperties.defaultProperties'), {\n includeAlignmentProperty: true\n });\n editor.data.addStyleProcessorRules(addBorderRules);\n enableBorderProperties(schema, conversion, {\n color: defaultTableProperties.borderColor,\n style: defaultTableProperties.borderStyle,\n width: defaultTableProperties.borderWidth\n });\n editor.commands.add('tableBorderColor', new TableBorderColorCommand(editor, defaultTableProperties.borderColor));\n editor.commands.add('tableBorderStyle', new TableBorderStyleCommand(editor, defaultTableProperties.borderStyle));\n editor.commands.add('tableBorderWidth', new TableBorderWidthCommand(editor, defaultTableProperties.borderWidth));\n enableAlignmentProperty(schema, conversion, defaultTableProperties.alignment);\n editor.commands.add('tableAlignment', new TableAlignmentCommand(editor, defaultTableProperties.alignment));\n enableTableToFigureProperty(schema, conversion, {\n modelAttribute: 'tableWidth',\n styleName: 'width',\n defaultValue: defaultTableProperties.width\n });\n editor.commands.add('tableWidth', new TableWidthCommand(editor, defaultTableProperties.width));\n enableTableToFigureProperty(schema, conversion, {\n modelAttribute: 'tableHeight',\n styleName: 'height',\n defaultValue: defaultTableProperties.height\n });\n editor.commands.add('tableHeight', new TableHeightCommand(editor, defaultTableProperties.height));\n editor.data.addStyleProcessorRules(addBackgroundRules);\n enableProperty(schema, conversion, {\n modelAttribute: 'tableBackgroundColor',\n styleName: 'background-color',\n defaultValue: defaultTableProperties.backgroundColor\n });\n editor.commands.add('tableBackgroundColor', new TableBackgroundColorCommand(editor, defaultTableProperties.backgroundColor));\n }\n}\n/**\n * Enables `tableBorderStyle'`, `tableBorderColor'` and `tableBorderWidth'` attributes for table.\n *\n * @param defaultBorder The default border values.\n * @param defaultBorder.color The default `tableBorderColor` value.\n * @param defaultBorder.style The default `tableBorderStyle` value.\n * @param defaultBorder.width The default `tableBorderWidth` value.\n */\nfunction enableBorderProperties(schema, conversion, defaultBorder) {\n const modelAttributes = {\n width: 'tableBorderWidth',\n color: 'tableBorderColor',\n style: 'tableBorderStyle'\n };\n schema.extend('table', {\n allowAttributes: Object.values(modelAttributes)\n });\n upcastBorderStyles(conversion, 'table', modelAttributes, defaultBorder);\n downcastTableAttribute(conversion, { modelAttribute: modelAttributes.color, styleName: 'border-color' });\n downcastTableAttribute(conversion, { modelAttribute: modelAttributes.style, styleName: 'border-style' });\n downcastTableAttribute(conversion, { modelAttribute: modelAttributes.width, styleName: 'border-width' });\n}\n/**\n * Enables the `'alignment'` attribute for table.\n *\n * @param defaultValue The default alignment value.\n */\nfunction enableAlignmentProperty(schema, conversion, defaultValue) {\n schema.extend('table', {\n allowAttributes: ['tableAlignment']\n });\n conversion.for('downcast')\n .attributeToAttribute({\n model: {\n name: 'table',\n key: 'tableAlignment'\n },\n view: alignment => ({\n key: 'style',\n value: {\n // Model: `alignment:center` => CSS: `float:none`.\n float: alignment === 'center' ? 'none' : alignment\n }\n }),\n converterPriority: 'high'\n });\n conversion.for('upcast')\n // Support for the `float:*;` CSS definition for the table alignment.\n .attributeToAttribute({\n view: {\n name: /^(table|figure)$/,\n styles: {\n float: FLOAT_VALUES_REG_EXP\n }\n },\n model: {\n key: 'tableAlignment',\n value: (viewElement) => {\n let align = viewElement.getStyle('float');\n // CSS: `float:none` => Model: `alignment:center`.\n if (align === 'none') {\n align = 'center';\n }\n return align === defaultValue ? null : align;\n }\n }\n })\n // Support for the `align` attribute as the backward compatibility while pasting from other sources.\n .attributeToAttribute({\n view: {\n attributes: {\n align: ALIGN_VALUES_REG_EXP\n }\n },\n model: {\n name: 'table',\n key: 'tableAlignment',\n value: (viewElement) => {\n const align = viewElement.getAttribute('align');\n return align === defaultValue ? null : align;\n }\n }\n });\n}\n/**\n * Enables conversion for an attribute for simple view-model mappings.\n *\n * @param options.defaultValue The default value for the specified `modelAttribute`.\n */\nfunction enableProperty(schema, conversion, options) {\n const { modelAttribute } = options;\n schema.extend('table', {\n allowAttributes: [modelAttribute]\n });\n upcastStyleToAttribute(conversion, { viewElement: 'table', ...options });\n downcastTableAttribute(conversion, options);\n}\n/**\n * Enables conversion for an attribute for simple view (figure) to model (table) mappings.\n */\nfunction enableTableToFigureProperty(schema, conversion, options) {\n const { modelAttribute } = options;\n schema.extend('table', {\n allowAttributes: [modelAttribute]\n });\n upcastStyleToAttribute(conversion, {\n viewElement: /^(table|figure)$/,\n shouldUpcast: (element) => !(element.name == 'table' && element.parent.name == 'figure'),\n ...options\n });\n downcastAttributeToStyle(conversion, { modelElement: 'table', ...options });\n}\n","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./tableproperties.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tableproperties/ui/tablepropertiesview\n */\nimport { addListToDropdown, ButtonView, createLabeledDropdown, createLabeledInputText, FocusCycler, FormHeaderView, LabeledFieldView, LabelView, submitHandler, ToolbarView, View, ViewCollection } from 'ckeditor5/src/ui';\nimport { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils';\nimport { icons } from 'ckeditor5/src/core';\nimport { fillToolbar, getBorderStyleDefinitions, getBorderStyleLabels, getLabeledColorInputCreator } from '../../utils/ui/table-properties';\nimport FormRowView from '../../ui/formrowview';\nimport '../../../theme/form.css';\nimport '../../../theme/tableform.css';\nimport '../../../theme/tableproperties.css';\nconst ALIGNMENT_ICONS = {\n left: icons.objectLeft,\n center: icons.objectCenter,\n right: icons.objectRight\n};\n/**\n * The class representing a table properties form, allowing users to customize\n * certain style aspects of a table, for instance, border, background color, alignment, etc..\n */\nexport default class TablePropertiesView extends View {\n /**\n * @param locale The {@link module:core/editor/editor~Editor#locale} instance.\n * @param options Additional configuration of the view.\n */\n constructor(locale, options) {\n super(locale);\n this.set({\n borderStyle: '',\n borderWidth: '',\n borderColor: '',\n backgroundColor: '',\n width: '',\n height: '',\n alignment: ''\n });\n this.options = options;\n const { borderStyleDropdown, borderWidthInput, borderColorInput, borderRowLabel } = this._createBorderFields();\n const { backgroundRowLabel, backgroundInput } = this._createBackgroundFields();\n const { widthInput, operatorLabel, heightInput, dimensionsLabel } = this._createDimensionFields();\n const { alignmentToolbar, alignmentLabel } = this._createAlignmentFields();\n this.focusTracker = new FocusTracker();\n this.keystrokes = new KeystrokeHandler();\n this.children = this.createCollection();\n this.borderStyleDropdown = borderStyleDropdown;\n this.borderWidthInput = borderWidthInput;\n this.borderColorInput = borderColorInput;\n this.backgroundInput = backgroundInput;\n this.widthInput = widthInput;\n this.heightInput = heightInput;\n this.alignmentToolbar = alignmentToolbar;\n // Defer creating to make sure other fields are present and the Save button can\n // bind its #isEnabled to their error messages so there's no way to save unless all\n // fields are valid.\n const { saveButtonView, cancelButtonView } = this._createActionButtons();\n this.saveButtonView = saveButtonView;\n this.cancelButtonView = cancelButtonView;\n this._focusables = new ViewCollection();\n this._focusCycler = new FocusCycler({\n focusables: this._focusables,\n focusTracker: this.focusTracker,\n keystrokeHandler: this.keystrokes,\n actions: {\n // Navigate form fields backwards using the Shift + Tab keystroke.\n focusPrevious: 'shift + tab',\n // Navigate form fields forwards using the Tab key.\n focusNext: 'tab'\n }\n });\n // Form header.\n this.children.add(new FormHeaderView(locale, {\n label: this.t('Table properties')\n }));\n // Border row.\n this.children.add(new FormRowView(locale, {\n labelView: borderRowLabel,\n children: [\n borderRowLabel,\n borderStyleDropdown,\n borderColorInput,\n borderWidthInput\n ],\n class: 'ck-table-form__border-row'\n }));\n // Background row.\n this.children.add(new FormRowView(locale, {\n labelView: backgroundRowLabel,\n children: [\n backgroundRowLabel,\n backgroundInput\n ],\n class: 'ck-table-form__background-row'\n }));\n this.children.add(new FormRowView(locale, {\n children: [\n // Dimensions row.\n new FormRowView(locale, {\n labelView: dimensionsLabel,\n children: [\n dimensionsLabel,\n widthInput,\n operatorLabel,\n heightInput\n ],\n class: 'ck-table-form__dimensions-row'\n }),\n // Alignment row.\n new FormRowView(locale, {\n labelView: alignmentLabel,\n children: [\n alignmentLabel,\n alignmentToolbar\n ],\n class: 'ck-table-properties-form__alignment-row'\n })\n ]\n }));\n // Action row.\n this.children.add(new FormRowView(locale, {\n children: [\n this.saveButtonView,\n this.cancelButtonView\n ],\n class: 'ck-table-form__action-row'\n }));\n this.setTemplate({\n tag: 'form',\n attributes: {\n class: [\n 'ck',\n 'ck-form',\n 'ck-table-form',\n 'ck-table-properties-form'\n ],\n // https://github.com/ckeditor/ckeditor5-link/issues/90\n tabindex: '-1'\n },\n children: this.children\n });\n }\n /**\n * @inheritDoc\n */\n render() {\n super.render();\n // Enable the \"submit\" event for this view. It can be triggered by the #saveButtonView\n // which is of the \"submit\" DOM \"type\".\n submitHandler({\n view: this\n });\n [\n this.borderStyleDropdown,\n this.borderColorInput,\n this.borderColorInput.fieldView.dropdownView.buttonView,\n this.borderWidthInput,\n this.backgroundInput,\n this.backgroundInput.fieldView.dropdownView.buttonView,\n this.widthInput,\n this.heightInput,\n this.alignmentToolbar,\n this.saveButtonView,\n this.cancelButtonView\n ].forEach(view => {\n // Register the view as focusable.\n this._focusables.add(view);\n // Register the view in the focus tracker.\n this.focusTracker.add(view.element);\n });\n // Mainly for closing using \"Esc\" and navigation using \"Tab\".\n this.keystrokes.listenTo(this.element);\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n this.focusTracker.destroy();\n this.keystrokes.destroy();\n }\n /**\n * Focuses the fist focusable field in the form.\n */\n focus() {\n this._focusCycler.focusFirst();\n }\n /**\n * Creates the following form fields:\n *\n * * {@link #borderStyleDropdown},\n * * {@link #borderWidthInput},\n * * {@link #borderColorInput}.\n */\n _createBorderFields() {\n const defaultTableProperties = this.options.defaultTableProperties;\n const defaultBorder = {\n style: defaultTableProperties.borderStyle,\n width: defaultTableProperties.borderWidth,\n color: defaultTableProperties.borderColor\n };\n const colorInputCreator = getLabeledColorInputCreator({\n colorConfig: this.options.borderColors,\n columns: 5,\n defaultColorValue: defaultBorder.color\n });\n const locale = this.locale;\n const t = this.t;\n const accessibleLabel = t('Style');\n // -- Group label ---------------------------------------------\n const borderRowLabel = new LabelView(locale);\n borderRowLabel.text = t('Border');\n // -- Style ---------------------------------------------------\n const styleLabels = getBorderStyleLabels(t);\n const borderStyleDropdown = new LabeledFieldView(locale, createLabeledDropdown);\n borderStyleDropdown.set({\n label: accessibleLabel,\n class: 'ck-table-form__border-style'\n });\n borderStyleDropdown.fieldView.buttonView.set({\n ariaLabel: accessibleLabel,\n ariaLabelledBy: undefined,\n isOn: false,\n withText: true,\n tooltip: accessibleLabel\n });\n borderStyleDropdown.fieldView.buttonView.bind('label').to(this, 'borderStyle', value => {\n return styleLabels[value ? value : 'none'];\n });\n borderStyleDropdown.fieldView.on('execute', evt => {\n this.borderStyle = evt.source._borderStyleValue;\n });\n borderStyleDropdown.bind('isEmpty').to(this, 'borderStyle', value => !value);\n addListToDropdown(borderStyleDropdown.fieldView, getBorderStyleDefinitions(this, defaultBorder.style), {\n role: 'menu',\n ariaLabel: accessibleLabel\n });\n // -- Width ---------------------------------------------------\n const borderWidthInput = new LabeledFieldView(locale, createLabeledInputText);\n borderWidthInput.set({\n label: t('Width'),\n class: 'ck-table-form__border-width'\n });\n borderWidthInput.fieldView.bind('value').to(this, 'borderWidth');\n borderWidthInput.bind('isEnabled').to(this, 'borderStyle', isBorderStyleSet);\n borderWidthInput.fieldView.on('input', () => {\n this.borderWidth = borderWidthInput.fieldView.element.value;\n });\n // -- Color ---------------------------------------------------\n const borderColorInput = new LabeledFieldView(locale, colorInputCreator);\n borderColorInput.set({\n label: t('Color'),\n class: 'ck-table-form__border-color'\n });\n borderColorInput.fieldView.bind('value').to(this, 'borderColor');\n borderColorInput.bind('isEnabled').to(this, 'borderStyle', isBorderStyleSet);\n borderColorInput.fieldView.on('input', () => {\n this.borderColor = borderColorInput.fieldView.value;\n });\n // Reset the border color and width fields depending on the `border-style` value.\n this.on('change:borderStyle', (evt, name, newValue, oldValue) => {\n // When removing the border (`border-style:none`), clear the remaining `border-*` properties.\n // See: https://github.com/ckeditor/ckeditor5/issues/6227.\n if (!isBorderStyleSet(newValue)) {\n this.borderColor = '';\n this.borderWidth = '';\n }\n // When setting the `border-style` from `none`, set the default `border-color` and `border-width` properties.\n if (!isBorderStyleSet(oldValue)) {\n this.borderColor = defaultBorder.color;\n this.borderWidth = defaultBorder.width;\n }\n });\n return {\n borderRowLabel,\n borderStyleDropdown,\n borderColorInput,\n borderWidthInput\n };\n }\n /**\n * Creates the following form fields:\n *\n * * {@link #backgroundInput}.\n */\n _createBackgroundFields() {\n const locale = this.locale;\n const t = this.t;\n // -- Group label ---------------------------------------------\n const backgroundRowLabel = new LabelView(locale);\n backgroundRowLabel.text = t('Background');\n // -- Background color input -----------------------------------\n const backgroundInputCreator = getLabeledColorInputCreator({\n colorConfig: this.options.backgroundColors,\n columns: 5,\n defaultColorValue: this.options.defaultTableProperties.backgroundColor\n });\n const backgroundInput = new LabeledFieldView(locale, backgroundInputCreator);\n backgroundInput.set({\n label: t('Color'),\n class: 'ck-table-properties-form__background'\n });\n backgroundInput.fieldView.bind('value').to(this, 'backgroundColor');\n backgroundInput.fieldView.on('input', () => {\n this.backgroundColor = backgroundInput.fieldView.value;\n });\n return {\n backgroundRowLabel,\n backgroundInput\n };\n }\n /**\n * Creates the following form fields:\n *\n * * {@link #widthInput},\n * * {@link #heightInput}.\n */\n _createDimensionFields() {\n const locale = this.locale;\n const t = this.t;\n // -- Label ---------------------------------------------------\n const dimensionsLabel = new LabelView(locale);\n dimensionsLabel.text = t('Dimensions');\n // -- Width ---------------------------------------------------\n const widthInput = new LabeledFieldView(locale, createLabeledInputText);\n widthInput.set({\n label: t('Width'),\n class: 'ck-table-form__dimensions-row__width'\n });\n widthInput.fieldView.bind('value').to(this, 'width');\n widthInput.fieldView.on('input', () => {\n this.width = widthInput.fieldView.element.value;\n });\n // -- Operator ---------------------------------------------------\n const operatorLabel = new View(locale);\n operatorLabel.setTemplate({\n tag: 'span',\n attributes: {\n class: [\n 'ck-table-form__dimension-operator'\n ]\n },\n children: [\n { text: '×' }\n ]\n });\n // -- Height ---------------------------------------------------\n const heightInput = new LabeledFieldView(locale, createLabeledInputText);\n heightInput.set({\n label: t('Height'),\n class: 'ck-table-form__dimensions-row__height'\n });\n heightInput.fieldView.bind('value').to(this, 'height');\n heightInput.fieldView.on('input', () => {\n this.height = heightInput.fieldView.element.value;\n });\n return {\n dimensionsLabel,\n widthInput,\n operatorLabel,\n heightInput\n };\n }\n /**\n * Creates the following form fields:\n *\n * * {@link #alignmentToolbar}.\n */\n _createAlignmentFields() {\n const locale = this.locale;\n const t = this.t;\n // -- Label ---------------------------------------------------\n const alignmentLabel = new LabelView(locale);\n alignmentLabel.text = t('Alignment');\n // -- Toolbar ---------------------------------------------------\n const alignmentToolbar = new ToolbarView(locale);\n alignmentToolbar.set({\n isCompact: true,\n ariaLabel: t('Table alignment toolbar')\n });\n fillToolbar({\n view: this,\n icons: ALIGNMENT_ICONS,\n toolbar: alignmentToolbar,\n labels: this._alignmentLabels,\n propertyName: 'alignment',\n defaultValue: this.options.defaultTableProperties.alignment\n });\n return {\n alignmentLabel,\n alignmentToolbar\n };\n }\n /**\n * Creates the following form controls:\n *\n * * {@link #saveButtonView},\n * * {@link #cancelButtonView}.\n */\n _createActionButtons() {\n const locale = this.locale;\n const t = this.t;\n const saveButtonView = new ButtonView(locale);\n const cancelButtonView = new ButtonView(locale);\n const fieldsThatShouldValidateToSave = [\n this.borderWidthInput,\n this.borderColorInput,\n this.backgroundInput,\n this.widthInput,\n this.heightInput\n ];\n saveButtonView.set({\n label: t('Save'),\n icon: icons.check,\n class: 'ck-button-save',\n type: 'submit',\n withText: true\n });\n saveButtonView.bind('isEnabled').toMany(fieldsThatShouldValidateToSave, 'errorText', (...errorTexts) => {\n return errorTexts.every(errorText => !errorText);\n });\n cancelButtonView.set({\n label: t('Cancel'),\n icon: icons.cancel,\n class: 'ck-button-cancel',\n withText: true\n });\n cancelButtonView.delegate('execute').to(this, 'cancel');\n return {\n saveButtonView, cancelButtonView\n };\n }\n /**\n * Provides localized labels for {@link #alignmentToolbar} buttons.\n */\n get _alignmentLabels() {\n const locale = this.locale;\n const t = this.t;\n const left = t('Align table to the left');\n const center = t('Center table');\n const right = t('Align table to the right');\n // Returns object with a proper order of labels.\n if (locale.uiLanguageDirection === 'rtl') {\n return { right, center, left };\n }\n else {\n return { left, center, right };\n }\n }\n}\nfunction isBorderStyleSet(value) {\n return value !== 'none';\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M8 2v5h4V2h1v5h5v1h-5v4h.021l-.172.351-1.916.28-.151.027c-.287.063-.54.182-.755.341L8 13v5H7v-5H2v-1h5V8H2V7h5V2h1zm4 6H8v4h4V8z\\\" opacity=\\\".6\\\"/><path d=\\\"m15.5 11.5 1.323 2.68 2.957.43-2.14 2.085.505 2.946L15.5 18.25l-2.645 1.39.505-2.945-2.14-2.086 2.957-.43L15.5 11.5zM17 1a2 2 0 0 1 2 2v9.475l-.85-.124-.857-1.736a2.048 2.048 0 0 0-.292-.44L17 3H3v14h7.808l.402.392L10.935 19H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h14z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tableproperties/tablepropertiesui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ButtonView, ContextualBalloon, clickOutsideHandler, getLocalizedColorOptions, normalizeColorOptions } from 'ckeditor5/src/ui';\nimport { debounce } from 'lodash-es';\nimport TablePropertiesView from './ui/tablepropertiesview';\nimport tableProperties from './../../theme/icons/table-properties.svg';\nimport { colorFieldValidator, getLocalizedColorErrorText, getLocalizedLengthErrorText, lengthFieldValidator, lineWidthFieldValidator, defaultColors } from '../utils/ui/table-properties';\nimport { getTableWidgetAncestor } from '../utils/ui/widget';\nimport { getBalloonTablePositionData, repositionContextualBalloon } from '../utils/ui/contextualballoon';\nimport { getNormalizedDefaultProperties } from '../utils/table-properties';\nconst ERROR_TEXT_TIMEOUT = 500;\n// Map of view properties and related commands.\nconst propertyToCommandMap = {\n borderStyle: 'tableBorderStyle',\n borderColor: 'tableBorderColor',\n borderWidth: 'tableBorderWidth',\n backgroundColor: 'tableBackgroundColor',\n width: 'tableWidth',\n height: 'tableHeight',\n alignment: 'tableAlignment'\n};\n/**\n * The table properties UI plugin. It introduces the `'tableProperties'` button\n * that opens a form allowing to specify visual styling of an entire table.\n *\n * It uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon plugin}.\n */\nexport default class TablePropertiesUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ContextualBalloon];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TablePropertiesUI';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n /**\n * The properties form view displayed inside the balloon.\n */\n this.view = null;\n editor.config.define('table.tableProperties', {\n borderColors: defaultColors,\n backgroundColors: defaultColors\n });\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n this._defaultTableProperties = getNormalizedDefaultProperties(editor.config.get('table.tableProperties.defaultProperties'), {\n includeAlignmentProperty: true\n });\n this._balloon = editor.plugins.get(ContextualBalloon);\n editor.ui.componentFactory.add('tableProperties', locale => {\n const view = new ButtonView(locale);\n view.set({\n label: t('Table properties'),\n icon: tableProperties,\n tooltip: true\n });\n this.listenTo(view, 'execute', () => this._showView());\n const commands = Object.values(propertyToCommandMap)\n .map(commandName => editor.commands.get(commandName));\n view.bind('isEnabled').toMany(commands, 'isEnabled', (...areEnabled) => (areEnabled.some(isCommandEnabled => isCommandEnabled)));\n return view;\n });\n }\n /**\n * @inheritDoc\n */\n destroy() {\n super.destroy();\n // Destroy created UI components as they are not automatically destroyed.\n // See https://github.com/ckeditor/ckeditor5/issues/1341.\n if (this.view) {\n this.view.destroy();\n }\n }\n /**\n * Creates the {@link module:table/tableproperties/ui/tablepropertiesview~TablePropertiesView} instance.\n *\n * @returns The table properties form view instance.\n */\n _createPropertiesView() {\n const editor = this.editor;\n const config = editor.config.get('table.tableProperties');\n const borderColorsConfig = normalizeColorOptions(config.borderColors);\n const localizedBorderColors = getLocalizedColorOptions(editor.locale, borderColorsConfig);\n const backgroundColorsConfig = normalizeColorOptions(config.backgroundColors);\n const localizedBackgroundColors = getLocalizedColorOptions(editor.locale, backgroundColorsConfig);\n const view = new TablePropertiesView(editor.locale, {\n borderColors: localizedBorderColors,\n backgroundColors: localizedBackgroundColors,\n defaultTableProperties: this._defaultTableProperties\n });\n const t = editor.t;\n // Render the view so its #element is available for the clickOutsideHandler.\n view.render();\n this.listenTo(view, 'submit', () => {\n this._hideView();\n });\n this.listenTo(view, 'cancel', () => {\n // https://github.com/ckeditor/ckeditor5/issues/6180\n if (this._undoStepBatch.operations.length) {\n editor.execute('undo', this._undoStepBatch);\n }\n this._hideView();\n });\n // Close the balloon on Esc key press.\n view.keystrokes.set('Esc', (data, cancel) => {\n this._hideView();\n cancel();\n });\n // Close on click outside of balloon panel element.\n clickOutsideHandler({\n emitter: view,\n activator: () => this._isViewInBalloon,\n contextElements: [this._balloon.view.element],\n callback: () => this._hideView()\n });\n const colorErrorText = getLocalizedColorErrorText(t);\n const lengthErrorText = getLocalizedLengthErrorText(t);\n // Create the \"UI -> editor data\" binding.\n // These listeners update the editor data (via table commands) when any observable\n // property of the view has changed. They also validate the value and display errors in the UI\n // when necessary. This makes the view live, which means the changes are\n // visible in the editing as soon as the user types or changes fields' values.\n view.on('change:borderStyle', this._getPropertyChangeCallback('tableBorderStyle'));\n view.on('change:borderColor', this._getValidatedPropertyChangeCallback({\n viewField: view.borderColorInput,\n commandName: 'tableBorderColor',\n errorText: colorErrorText,\n validator: colorFieldValidator\n }));\n view.on('change:borderWidth', this._getValidatedPropertyChangeCallback({\n viewField: view.borderWidthInput,\n commandName: 'tableBorderWidth',\n errorText: lengthErrorText,\n validator: lineWidthFieldValidator\n }));\n view.on('change:backgroundColor', this._getValidatedPropertyChangeCallback({\n viewField: view.backgroundInput,\n commandName: 'tableBackgroundColor',\n errorText: colorErrorText,\n validator: colorFieldValidator\n }));\n view.on('change:width', this._getValidatedPropertyChangeCallback({\n viewField: view.widthInput,\n commandName: 'tableWidth',\n errorText: lengthErrorText,\n validator: lengthFieldValidator\n }));\n view.on('change:height', this._getValidatedPropertyChangeCallback({\n viewField: view.heightInput,\n commandName: 'tableHeight',\n errorText: lengthErrorText,\n validator: lengthFieldValidator\n }));\n view.on('change:alignment', this._getPropertyChangeCallback('tableAlignment'));\n return view;\n }\n /**\n * In this method the \"editor data -> UI\" binding is happening.\n *\n * When executed, this method obtains selected table property values from various table commands\n * and passes them to the {@link #view}.\n *\n * This way, the UI stays uptodate with the editor data.\n */\n _fillViewFormFromCommandValues() {\n const commands = this.editor.commands;\n const borderStyleCommand = commands.get('tableBorderStyle');\n Object.entries(propertyToCommandMap)\n .map(([property, commandName]) => {\n const propertyKey = property;\n const defaultValue = this._defaultTableProperties[propertyKey] || '';\n return [propertyKey, (commands.get(commandName).value || defaultValue)];\n })\n .forEach(([property, value]) => {\n // Do not set the `border-color` and `border-width` fields if `border-style:none`.\n if ((property === 'borderColor' || property === 'borderWidth') && borderStyleCommand.value === 'none') {\n return;\n }\n this.view.set(property, value);\n });\n this._isReady = true;\n }\n /**\n * Shows the {@link #view} in the {@link #_balloon}.\n *\n * **Note**: Each time a view is shown, the new {@link #_undoStepBatch} is created that contains\n * all changes made to the document when the view is visible, allowing a single undo step\n * for all of them.\n */\n _showView() {\n const editor = this.editor;\n if (!this.view) {\n this.view = this._createPropertiesView();\n }\n this.listenTo(editor.ui, 'update', () => {\n this._updateView();\n });\n // Update the view with the model values.\n this._fillViewFormFromCommandValues();\n this._balloon.add({\n view: this.view,\n position: getBalloonTablePositionData(editor)\n });\n // Create a new batch. Clicking \"Cancel\" will undo this batch.\n this._undoStepBatch = editor.model.createBatch();\n // Basic a11y.\n this.view.focus();\n }\n /**\n * Removes the {@link #view} from the {@link #_balloon}.\n */\n _hideView() {\n const editor = this.editor;\n this.stopListening(editor.ui, 'update');\n this._isReady = false;\n // Blur any input element before removing it from DOM to prevent issues in some browsers.\n // See https://github.com/ckeditor/ckeditor5/issues/1501.\n this.view.saveButtonView.focus();\n this._balloon.remove(this.view);\n // Make sure the focus is not lost in the process by putting it directly\n // into the editing view.\n this.editor.editing.view.focus();\n }\n /**\n * Repositions the {@link #_balloon} or hides the {@link #view} if a table is no longer selected.\n */\n _updateView() {\n const editor = this.editor;\n const viewDocument = editor.editing.view.document;\n if (!getTableWidgetAncestor(viewDocument.selection)) {\n this._hideView();\n }\n else if (this._isViewVisible) {\n repositionContextualBalloon(editor, 'table');\n }\n }\n /**\n * Returns `true` when the {@link #view} is the visible in the {@link #_balloon}.\n */\n get _isViewVisible() {\n return !!this.view && this._balloon.visibleView === this.view;\n }\n /**\n * Returns `true` when the {@link #view} is in the {@link #_balloon}.\n */\n get _isViewInBalloon() {\n return !!this.view && this._balloon.hasView(this.view);\n }\n /**\n * Creates a callback that when executed upon {@link #view view's} property change\n * executes a related editor command with the new property value.\n *\n * If new value will be set to the default value, the command will not be executed.\n *\n * @param commandName The command that will be executed.\n */\n _getPropertyChangeCallback(commandName) {\n return (evt, propertyName, newValue) => {\n // Do not execute the command on initial call (opening the table properties view).\n if (!this._isReady) {\n return;\n }\n this.editor.execute(commandName, {\n value: newValue,\n batch: this._undoStepBatch\n });\n };\n }\n /**\n * Creates a callback that when executed upon {@link #view view's} property change:\n * * executes a related editor command with the new property value if the value is valid,\n * * or sets the error text next to the invalid field, if the value did not pass the validation.\n */\n _getValidatedPropertyChangeCallback(options) {\n const { commandName, viewField, validator, errorText } = options;\n const setErrorTextDebounced = debounce(() => {\n viewField.errorText = errorText;\n }, ERROR_TEXT_TIMEOUT);\n return (evt, propertyName, newValue) => {\n setErrorTextDebounced.cancel();\n // Do not execute the command on initial call (opening the table properties view).\n if (!this._isReady) {\n return;\n }\n if (validator(newValue)) {\n this.editor.execute(commandName, {\n value: newValue,\n batch: this._undoStepBatch\n });\n viewField.errorText = null;\n }\n else {\n setErrorTextDebounced();\n }\n };\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module language/utils\n */\nimport { getLanguageDirection } from 'ckeditor5/src/utils';\n/**\n * Returns the language attribute value in a human-readable text format:\n *\n * ```\n * <languageCode>:<textDirection>\n * ```\n *\n * * `languageCode` - The language code used for the `lang` attribute in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format.\n * * `textDirection` - One of the following values: `rtl` or `ltr`, indicating the reading direction of the language.\n *\n * See the {@link module:core/editor/editorconfig~LanguageConfig#textPartLanguage text part language configuration}\n * for more information about language properties.\n *\n * If the `textDirection` argument is omitted, it will be automatically detected based on `languageCode`.\n *\n * @param languageCode The language code in the ISO 639-1 format.\n * @param textDirection The language text direction. Automatically detected if omitted.\n */\nexport function stringifyLanguageAttribute(languageCode, textDirection) {\n textDirection = textDirection || getLanguageDirection(languageCode);\n return `${languageCode}:${textDirection}`;\n}\n/**\n * Retrieves language properties converted to attribute value by the\n * {@link module:language/utils~stringifyLanguageAttribute stringifyLanguageAttribute} function.\n *\n * @param str The attribute value.\n * @returns The object with properties:\n * * languageCode - The language code in the ISO 639 format.\n * * textDirection - The language text direction.\n */\nexport function parseLanguageAttribute(str) {\n const [languageCode, textDirection] = str.split(':');\n return { languageCode, textDirection };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Command } from 'ckeditor5/src/core';\nimport { stringifyLanguageAttribute } from './utils';\n/**\n * The text part language command plugin.\n */\nexport default class TextPartLanguageCommand extends Command {\n /**\n * @inheritDoc\n */\n refresh() {\n const model = this.editor.model;\n const doc = model.document;\n this.value = this._getValueFromFirstAllowedNode();\n this.isEnabled = model.schema.checkAttributeInSelection(doc.selection, 'language');\n }\n /**\n * Executes the command. Applies the attribute to the selection or removes it from the selection.\n *\n * If `languageCode` is set to `false` or a `null` value, it will remove attributes. Otherwise, it will set\n * the attribute in the `{@link #value value}` format.\n *\n * The execution result differs, depending on the {@link module:engine/model/document~Document#selection}:\n *\n * * If the selection is on a range, the command applies the attribute to all nodes in that range\n * (if they are allowed to have this attribute by the {@link module:engine/model/schema~Schema schema}).\n * * If the selection is collapsed in a non-empty node, the command applies the attribute to the\n * {@link module:engine/model/document~Document#selection} itself (note that typed characters copy attributes from the selection).\n * * If the selection is collapsed in an empty node, the command applies the attribute to the parent node of the selection (note\n * that the selection inherits all attributes from a node if it is in an empty node).\n *\n * @fires execute\n * @param options Command options.\n * @param options.languageCode The language code to be applied to the model.\n * @param options.textDirection The language text direction.\n */\n execute({ languageCode, textDirection } = {}) {\n const model = this.editor.model;\n const doc = model.document;\n const selection = doc.selection;\n const value = languageCode ? stringifyLanguageAttribute(languageCode, textDirection) : false;\n model.change(writer => {\n if (selection.isCollapsed) {\n if (value) {\n writer.setSelectionAttribute('language', value);\n }\n else {\n writer.removeSelectionAttribute('language');\n }\n }\n else {\n const ranges = model.schema.getValidRanges(selection.getRanges(), 'language');\n for (const range of ranges) {\n if (value) {\n writer.setAttribute('language', value, range);\n }\n else {\n writer.removeAttribute('language', range);\n }\n }\n }\n });\n }\n /**\n * Returns the attribute value of the first node in the selection that allows the attribute.\n * For a collapsed selection it returns the selection attribute.\n *\n * @returns The attribute value.\n */\n _getValueFromFirstAllowedNode() {\n const model = this.editor.model;\n const schema = model.schema;\n const selection = model.document.selection;\n if (selection.isCollapsed) {\n return selection.getAttribute('language') || false;\n }\n for (const range of selection.getRanges()) {\n for (const item of range.getItems()) {\n if (schema.checkAttribute(item, 'language')) {\n return item.getAttribute('language') || false;\n }\n }\n }\n return false;\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport TextPartLanguageCommand from './textpartlanguagecommand';\nimport { stringifyLanguageAttribute, parseLanguageAttribute } from './utils';\n/**\n * The text part language editing.\n *\n * Introduces the `'textPartLanguage'` command and the `'language'` model element attribute.\n */\nexport default class TextPartLanguageEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TextPartLanguageEditing';\n }\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n // Text part language options are only used to ensure that the feature works by default.\n // In the real usage it should be reconfigured by a developer. We are not providing\n // translations for `title` properties on purpose, as it's only an example configuration.\n editor.config.define('language', {\n textPartLanguage: [\n { title: 'Arabic', languageCode: 'ar' },\n { title: 'French', languageCode: 'fr' },\n { title: 'Spanish', languageCode: 'es' }\n ]\n });\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n editor.model.schema.extend('$text', { allowAttributes: 'language' });\n editor.model.schema.setAttributeProperties('language', {\n copyOnEnter: true\n });\n this._defineConverters();\n editor.commands.add('textPartLanguage', new TextPartLanguageCommand(editor));\n }\n /**\n * @private\n */\n _defineConverters() {\n const conversion = this.editor.conversion;\n conversion.for('upcast').elementToAttribute({\n model: {\n key: 'language',\n value: (viewElement) => {\n const languageCode = viewElement.getAttribute('lang');\n const textDirection = viewElement.getAttribute('dir');\n return stringifyLanguageAttribute(languageCode, textDirection);\n }\n },\n view: {\n name: 'span',\n attributes: { lang: /[\\s\\S]+/ }\n }\n });\n conversion.for('downcast').attributeToElement({\n model: 'language',\n view: (attributeValue, { writer }, data) => {\n if (!attributeValue) {\n return;\n }\n if (!data.item.is('$textProxy') && !data.item.is('documentSelection')) {\n return;\n }\n const { languageCode, textDirection } = parseLanguageAttribute(attributeValue);\n return writer.createAttributeElement('span', {\n lang: languageCode,\n dir: textDirection\n });\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module language/textpartlanguageui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Model, createDropdown, addListToDropdown } from 'ckeditor5/src/ui';\nimport { Collection } from 'ckeditor5/src/utils';\nimport { stringifyLanguageAttribute } from './utils';\n/**\n * The text part language UI plugin.\n *\n * It introduces the `'language'` dropdown.\n */\nexport default class TextPartLanguageUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TextPartLanguageUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n const options = editor.config.get('language.textPartLanguage');\n const defaultTitle = t('Choose language');\n const removeTitle = t('Remove language');\n const accessibleLabel = t('Language');\n // Register UI component.\n editor.ui.componentFactory.add('textPartLanguage', locale => {\n const itemDefinitions = new Collection();\n const titles = {};\n const languageCommand = editor.commands.get('textPartLanguage');\n // Item definition with false `languageCode` will behave as remove lang button.\n itemDefinitions.add({\n type: 'button',\n model: new Model({\n label: removeTitle,\n languageCode: false,\n withText: true\n })\n });\n itemDefinitions.add({\n type: 'separator'\n });\n for (const option of options) {\n const def = {\n type: 'button',\n model: new Model({\n label: option.title,\n languageCode: option.languageCode,\n role: 'menuitemradio',\n textDirection: option.textDirection,\n withText: true\n })\n };\n const language = stringifyLanguageAttribute(option.languageCode, option.textDirection);\n def.model.bind('isOn').to(languageCommand, 'value', value => value === language);\n itemDefinitions.add(def);\n titles[language] = option.title;\n }\n const dropdownView = createDropdown(locale);\n addListToDropdown(dropdownView, itemDefinitions, {\n ariaLabel: accessibleLabel,\n role: 'menu'\n });\n dropdownView.buttonView.set({\n ariaLabel: accessibleLabel,\n ariaLabelledBy: undefined,\n isOn: false,\n withText: true,\n tooltip: accessibleLabel\n });\n dropdownView.extendTemplate({\n attributes: {\n class: [\n 'ck-text-fragment-language-dropdown'\n ]\n }\n });\n dropdownView.bind('isEnabled').to(languageCommand, 'isEnabled');\n dropdownView.buttonView.bind('label').to(languageCommand, 'value', value => {\n return (value && titles[value]) || defaultTitle;\n });\n // Execute command when an item from the dropdown is selected.\n this.listenTo(dropdownView, 'execute', evt => {\n languageCommand.execute({\n languageCode: evt.source.languageCode,\n textDirection: evt.source.textDirection\n });\n editor.editing.view.focus();\n });\n return dropdownView;\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/todolist/checktodolistcommand\n */\nimport { Command } from 'ckeditor5/src/core';\nconst attributeKey = 'todoListChecked';\n/**\n * The check to-do command.\n *\n * The command is registered by the {@link module:list/todolist/todolistediting~TodoListEditing} as\n * the `checkTodoList` editor command and it is also available via aliased `todoListCheck` name.\n */\nexport default class CheckTodoListCommand extends Command {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n this._selectedElements = [];\n // Refresh command before executing to be sure all values are up to date.\n // It is needed when selection has changed before command execution, in the same change block.\n this.on('execute', () => {\n this.refresh();\n }, { priority: 'highest' });\n }\n /**\n * Updates the command's {@link #value} and {@link #isEnabled} properties based on the current selection.\n */\n refresh() {\n this._selectedElements = this._getSelectedItems();\n this.value = this._selectedElements.every(element => !!element.getAttribute(attributeKey));\n this.isEnabled = !!this._selectedElements.length;\n }\n /**\n * Gets all to-do list items selected by the {@link module:engine/model/selection~Selection}.\n */\n _getSelectedItems() {\n const model = this.editor.model;\n const schema = model.schema;\n const selectionRange = model.document.selection.getFirstRange();\n const startElement = selectionRange.start.parent;\n const elements = [];\n if (schema.checkAttribute(startElement, attributeKey)) {\n elements.push(startElement);\n }\n for (const item of selectionRange.getItems()) {\n if (schema.checkAttribute(item, attributeKey) && !elements.includes(item)) {\n elements.push(item);\n }\n }\n return elements;\n }\n /**\n * Executes the command.\n *\n * @param options.forceValue If set, it will force the command behavior. If `true`, the command will apply\n * the attribute. Otherwise, the command will remove the attribute. If not set, the command will look for its current\n * value to decide what it should do.\n */\n execute(options = {}) {\n this.editor.model.change(writer => {\n for (const element of this._selectedElements) {\n const value = (options.forceValue === undefined) ? !this.value : options.forceValue;\n if (value) {\n writer.setAttribute(attributeKey, true, element);\n }\n else {\n writer.removeAttribute(attributeKey, element);\n }\n }\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { createElement } from 'ckeditor5/src/utils';\nimport { generateLiInUl, injectViewList, positionAfterUiElements, findNestedList } from '../list/utils';\n/**\n * A model-to-view converter for the `listItem` model element insertion.\n *\n * It converts the `listItem` model element to an unordered list with a {@link module:engine/view/uielement~UIElement checkbox element}\n * at the beginning of each list item. It also merges the list with surrounding lists (if available).\n *\n * It is used by {@link module:engine/controller/editingcontroller~EditingController}.\n *\n * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert\n * @param model Model instance.\n * @param onCheckboxChecked Callback function.\n * @returns Returns a conversion callback.\n */\nexport function modelViewInsertion(model, onCheckboxChecked) {\n return (evt, data, conversionApi) => {\n const consumable = conversionApi.consumable;\n if (!consumable.test(data.item, 'insert') ||\n !consumable.test(data.item, 'attribute:listType') ||\n !consumable.test(data.item, 'attribute:listIndent')) {\n return;\n }\n if (data.item.getAttribute('listType') != 'todo') {\n return;\n }\n const modelItem = data.item;\n consumable.consume(modelItem, 'insert');\n consumable.consume(modelItem, 'attribute:listType');\n consumable.consume(modelItem, 'attribute:listIndent');\n consumable.consume(modelItem, 'attribute:todoListChecked');\n const viewWriter = conversionApi.writer;\n const viewItem = generateLiInUl(modelItem, conversionApi);\n const isChecked = !!modelItem.getAttribute('todoListChecked');\n const checkmarkElement = createCheckmarkElement(modelItem, viewWriter, isChecked, onCheckboxChecked);\n const span = viewWriter.createContainerElement('span', {\n class: 'todo-list__label__description'\n });\n viewWriter.addClass('todo-list', viewItem.parent);\n viewWriter.insert(viewWriter.createPositionAt(viewItem, 0), checkmarkElement);\n viewWriter.insert(viewWriter.createPositionAfter(checkmarkElement), span);\n injectViewList(modelItem, viewItem, conversionApi, model);\n };\n}\n/**\n * A model-to-view converter for the `listItem` model element insertion.\n *\n * It is used by {@link module:engine/controller/datacontroller~DataController}.\n *\n * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert\n * @param model Model instance.\n * @returns Returns a conversion callback.\n */\nexport function dataModelViewInsertion(model) {\n return (evt, data, conversionApi) => {\n const consumable = conversionApi.consumable;\n if (!consumable.test(data.item, 'insert') ||\n !consumable.test(data.item, 'attribute:listType') ||\n !consumable.test(data.item, 'attribute:listIndent')) {\n return;\n }\n if (data.item.getAttribute('listType') != 'todo') {\n return;\n }\n const modelItem = data.item;\n consumable.consume(modelItem, 'insert');\n consumable.consume(modelItem, 'attribute:listType');\n consumable.consume(modelItem, 'attribute:listIndent');\n consumable.consume(modelItem, 'attribute:todoListChecked');\n const viewWriter = conversionApi.writer;\n const viewItem = generateLiInUl(modelItem, conversionApi);\n viewWriter.addClass('todo-list', viewItem.parent);\n const label = viewWriter.createContainerElement('label', {\n class: 'todo-list__label'\n });\n const checkbox = viewWriter.createEmptyElement('input', {\n type: 'checkbox',\n disabled: 'disabled'\n });\n const span = viewWriter.createContainerElement('span', {\n class: 'todo-list__label__description'\n });\n if (modelItem.getAttribute('todoListChecked')) {\n viewWriter.setAttribute('checked', 'checked', checkbox);\n }\n viewWriter.insert(viewWriter.createPositionAt(viewItem, 0), label);\n viewWriter.insert(viewWriter.createPositionAt(label, 0), checkbox);\n viewWriter.insert(viewWriter.createPositionAfter(checkbox), span);\n injectViewList(modelItem, viewItem, conversionApi, model);\n };\n}\n/**\n * A view-to-model converter for the checkbox element inside a view list item.\n *\n * It changes the `listType` of the model `listItem` to a `todo` value.\n * When a view checkbox element is marked as checked, an additional `todoListChecked=\"true\"` attribute is added to the model item.\n *\n * It is used by {@link module:engine/controller/datacontroller~DataController}.\n *\n * @see module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element\n */\nexport const dataViewModelCheckmarkInsertion = (evt, data, conversionApi) => {\n const modelCursor = data.modelCursor;\n const modelItem = modelCursor.parent;\n const viewItem = data.viewItem;\n if (viewItem.getAttribute('type') != 'checkbox' || modelItem.name != 'listItem' || !modelCursor.isAtStart) {\n return;\n }\n if (!conversionApi.consumable.consume(viewItem, { name: true })) {\n return;\n }\n const writer = conversionApi.writer;\n writer.setAttribute('listType', 'todo', modelItem);\n if (data.viewItem.hasAttribute('checked')) {\n writer.setAttribute('todoListChecked', true, modelItem);\n }\n data.modelRange = writer.createRange(modelCursor);\n};\n/**\n * A model-to-view converter for the `listType` attribute change on the `listItem` model element.\n *\n * This change means that the `<li>` element parent changes to `<ul class=\"todo-list\">` and a\n * {@link module:engine/view/uielement~UIElement checkbox UI element} is added at the beginning\n * of the list item element (or vice versa).\n *\n * This converter is preceded by {@link module:list/list/converters~modelViewChangeType} and followed by\n * {@link module:list/list/converters~modelViewMergeAfterChangeType} to handle splitting and merging surrounding lists of the same type.\n *\n * It is used by {@link module:engine/controller/editingcontroller~EditingController}.\n *\n * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute\n * @param onCheckedChange Callback fired after clicking the checkbox UI element.\n * @param view Editing view controller.\n * @returns Returns a conversion callback.\n */\nexport function modelViewChangeType(onCheckedChange, view) {\n return (evt, data, conversionApi) => {\n if (!conversionApi.consumable.consume(data.item, evt.name)) {\n return;\n }\n const viewItem = conversionApi.mapper.toViewElement(data.item);\n const viewWriter = conversionApi.writer;\n const labelElement = findLabel(viewItem, view);\n if (data.attributeNewValue == 'todo') {\n const isChecked = !!data.item.getAttribute('todoListChecked');\n const checkmarkElement = createCheckmarkElement(data.item, viewWriter, isChecked, onCheckedChange);\n const span = viewWriter.createContainerElement('span', {\n class: 'todo-list__label__description'\n });\n const itemRange = viewWriter.createRangeIn(viewItem);\n const nestedList = findNestedList(viewItem);\n const descriptionStart = positionAfterUiElements(itemRange.start);\n const descriptionEnd = nestedList ? viewWriter.createPositionBefore(nestedList) : itemRange.end;\n const descriptionRange = viewWriter.createRange(descriptionStart, descriptionEnd);\n viewWriter.addClass('todo-list', viewItem.parent);\n viewWriter.move(descriptionRange, viewWriter.createPositionAt(span, 0));\n viewWriter.insert(viewWriter.createPositionAt(viewItem, 0), checkmarkElement);\n viewWriter.insert(viewWriter.createPositionAfter(checkmarkElement), span);\n }\n else if (data.attributeOldValue == 'todo') {\n const descriptionSpan = findDescription(viewItem, view);\n viewWriter.removeClass('todo-list', viewItem.parent);\n viewWriter.remove(labelElement);\n viewWriter.move(viewWriter.createRangeIn(descriptionSpan), viewWriter.createPositionBefore(descriptionSpan));\n viewWriter.remove(descriptionSpan);\n }\n };\n}\n/**\n * A model-to-view converter for the `todoListChecked` attribute change on the `listItem` model element.\n *\n * It marks the {@link module:engine/view/uielement~UIElement checkbox UI element} as checked.\n *\n * It is used by {@link module:engine/controller/editingcontroller~EditingController}.\n *\n * @see module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute\n * @param onCheckedChange Callback fired after clicking the checkbox UI element.\n * @returns Returns a conversion callback.\n */\nexport function modelViewChangeChecked(onCheckedChange) {\n return (evt, data, conversionApi) => {\n // Do not convert `todoListChecked` attribute when to-do list item has changed to other list item.\n // This attribute will be removed by the model post fixer.\n if (data.item.getAttribute('listType') != 'todo') {\n return;\n }\n if (!conversionApi.consumable.consume(data.item, 'attribute:todoListChecked')) {\n return;\n }\n const { mapper, writer: viewWriter } = conversionApi;\n const isChecked = !!data.item.getAttribute('todoListChecked');\n const viewItem = mapper.toViewElement(data.item);\n // Because of m -> v position mapper we can be sure checkbox is always at the beginning.\n const oldCheckmarkElement = viewItem.getChild(0);\n const newCheckmarkElement = createCheckmarkElement(data.item, viewWriter, isChecked, onCheckedChange);\n viewWriter.insert(viewWriter.createPositionAfter(oldCheckmarkElement), newCheckmarkElement);\n viewWriter.remove(oldCheckmarkElement);\n };\n}\n/**\n * A model-to-view position at zero offset mapper.\n *\n * This helper ensures that position inside todo-list in the view is mapped after the checkbox.\n *\n * It only handles the position at the beginning of a list item as other positions are properly mapped be the default mapper.\n */\nexport function mapModelToViewPosition(view) {\n return (evt, data) => {\n const modelPosition = data.modelPosition;\n const parent = modelPosition.parent;\n if (!parent.is('element', 'listItem') || parent.getAttribute('listType') != 'todo') {\n return;\n }\n const viewLi = data.mapper.toViewElement(parent);\n const descSpan = findDescription(viewLi, view);\n if (descSpan) {\n data.viewPosition = data.mapper.findPositionIn(descSpan, modelPosition.offset);\n }\n };\n}\n/**\n * Creates a checkbox UI element.\n */\nfunction createCheckmarkElement(modelItem, viewWriter, isChecked, onChange) {\n const uiElement = viewWriter.createUIElement('label', {\n class: 'todo-list__label',\n contenteditable: false\n }, function (domDocument) {\n const checkbox = createElement(document, 'input', { type: 'checkbox', tabindex: '-1' });\n if (isChecked) {\n checkbox.setAttribute('checked', 'checked');\n }\n checkbox.addEventListener('change', () => onChange(modelItem));\n const domElement = this.toDomElement(domDocument);\n domElement.appendChild(checkbox);\n return domElement;\n });\n return uiElement;\n}\n// Helper method to find label element inside li.\nfunction findLabel(viewItem, view) {\n const range = view.createRangeIn(viewItem);\n for (const value of range) {\n if (value.item.is('uiElement', 'label')) {\n return value.item;\n }\n }\n}\nfunction findDescription(viewItem, view) {\n const range = view.createRangeIn(viewItem);\n for (const value of range) {\n if (value.item.is('containerElement', 'span') && value.item.hasClass('todo-list__label__description')) {\n return value.item;\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { getCode, parseKeystroke, getLocalizedArrowKeyCodeDirection } from 'ckeditor5/src/utils';\nimport ListCommand from '../list/listcommand';\nimport ListEditing from '../list/listediting';\nimport CheckTodoListCommand from './checktodolistcommand';\nimport { dataModelViewInsertion, dataViewModelCheckmarkInsertion, mapModelToViewPosition, modelViewChangeChecked, modelViewChangeType, modelViewInsertion } from './todolistconverters';\nconst ITEM_TOGGLE_KEYSTROKE = parseKeystroke('Ctrl+Enter');\n/**\n * The engine of the to-do list feature. It handles creating, editing and removing to-do lists and their items.\n *\n * It registers the entire functionality of the {@link module:list/list/listediting~ListEditing list editing plugin} and extends\n * it with the commands:\n *\n * - `'todoList'`,\n * - `'checkTodoList'`,\n * - `'todoListCheck'` as an alias for `checkTodoList` command.\n */\nexport default class TodoListEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TodoListEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ListEditing];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const { editing, data, model } = editor;\n // Extend schema.\n model.schema.extend('listItem', {\n allowAttributes: ['todoListChecked']\n });\n // Disallow todoListChecked attribute on other nodes than listItem with to-do listType.\n model.schema.addAttributeCheck((context, attributeName) => {\n const item = context.last;\n if (attributeName == 'todoListChecked' && item.name == 'listItem' && item.getAttribute('listType') != 'todo') {\n return false;\n }\n });\n // Register `todoList` command.\n editor.commands.add('todoList', new ListCommand(editor, 'todo'));\n const checkTodoListCommand = new CheckTodoListCommand(editor);\n // Register `checkTodoList` command and add `todoListCheck` command as an alias for backward compatibility.\n editor.commands.add('checkTodoList', checkTodoListCommand);\n editor.commands.add('todoListCheck', checkTodoListCommand);\n // Define converters.\n data.downcastDispatcher.on('insert:listItem', dataModelViewInsertion(model), { priority: 'high' });\n data.upcastDispatcher.on('element:input', dataViewModelCheckmarkInsertion, { priority: 'high' });\n editing.downcastDispatcher.on('insert:listItem', modelViewInsertion(model, listItem => this._handleCheckmarkChange(listItem)), { priority: 'high' });\n editing.downcastDispatcher.on('attribute:listType:listItem', modelViewChangeType(listItem => this._handleCheckmarkChange(listItem), editing.view));\n editing.downcastDispatcher.on('attribute:todoListChecked:listItem', modelViewChangeChecked(listItem => this._handleCheckmarkChange(listItem)));\n editing.mapper.on('modelToViewPosition', mapModelToViewPosition(editing.view));\n data.mapper.on('modelToViewPosition', mapModelToViewPosition(editing.view));\n // Jump at the end of the previous node on left arrow key press, when selection is after the checkbox.\n //\n // <blockquote><p>Foo</p></blockquote>\n // <ul><li><checkbox/>{}Bar</li></ul>\n //\n // press: `<-`\n //\n // <blockquote><p>Foo{}</p></blockquote>\n // <ul><li><checkbox/>Bar</li></ul>\n //\n this.listenTo(editing.view.document, 'arrowKey', jumpOverCheckmarkOnSideArrowKeyPress(model, editor.locale), { context: 'li' });\n // Toggle check state of selected to-do list items on keystroke.\n this.listenTo(editing.view.document, 'keydown', (evt, data) => {\n if (getCode(data) === ITEM_TOGGLE_KEYSTROKE) {\n editor.execute('checkTodoList');\n evt.stop();\n }\n }, { priority: 'high' });\n // Remove `todoListChecked` attribute when a host element is no longer a to-do list item.\n const listItemsToFix = new Set();\n this.listenTo(model, 'applyOperation', (evt, args) => {\n const operation = args[0];\n if (operation.type == 'rename' && operation.oldName == 'listItem') {\n const item = operation.position.nodeAfter;\n if (item.hasAttribute('todoListChecked')) {\n listItemsToFix.add(item);\n }\n }\n else if (operation.type == 'changeAttribute' && operation.key == 'listType' && operation.oldValue === 'todo') {\n for (const item of operation.range.getItems()) {\n if (item.hasAttribute('todoListChecked') && item.getAttribute('listType') !== 'todo') {\n listItemsToFix.add(item);\n }\n }\n }\n });\n model.document.registerPostFixer(writer => {\n let hasChanged = false;\n for (const listItem of listItemsToFix) {\n writer.removeAttribute('todoListChecked', listItem);\n hasChanged = true;\n }\n listItemsToFix.clear();\n return hasChanged;\n });\n }\n /**\n * Handles the checkbox element change, moves the selection to the corresponding model item to make it possible\n * to toggle the `todoListChecked` attribute using the command, and restores the selection position.\n *\n * Some say it's a hack :) Moving the selection only for executing the command on a certain node and restoring it after,\n * is not a clear solution. We need to design an API for using commands beyond the selection range.\n * See https://github.com/ckeditor/ckeditor5/issues/1954.\n */\n _handleCheckmarkChange(listItem) {\n const editor = this.editor;\n const model = editor.model;\n const previousSelectionRanges = Array.from(model.document.selection.getRanges());\n model.change(writer => {\n writer.setSelection(listItem, 'end');\n editor.execute('checkTodoList');\n writer.setSelection(previousSelectionRanges);\n });\n }\n}\n/**\n * Handles the left/right (LTR/RTL content) arrow key and moves the selection at the end of the previous block element\n * if the selection is just after the checkbox element. In other words, it jumps over the checkbox element when\n * moving the selection to the left/right (LTR/RTL).\n *\n * @returns Callback for 'keydown' events.\n */\nfunction jumpOverCheckmarkOnSideArrowKeyPress(model, locale) {\n return (eventInfo, domEventData) => {\n const direction = getLocalizedArrowKeyCodeDirection(domEventData.keyCode, locale.contentLanguageDirection);\n if (direction != 'left') {\n return;\n }\n const schema = model.schema;\n const selection = model.document.selection;\n if (!selection.isCollapsed) {\n return;\n }\n const position = selection.getFirstPosition();\n const parent = position.parent;\n if (parent.name === 'listItem' && parent.getAttribute('listType') == 'todo' && position.isAtStart) {\n const newRange = schema.getNearestSelectionRange(model.createPositionBefore(parent), 'backward');\n if (newRange) {\n model.change(writer => writer.setSelection(newRange));\n }\n domEventData.preventDefault();\n domEventData.stopPropagation();\n eventInfo.stop();\n }\n };\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/todolist/todolistui\n */\nimport { createUIComponent } from '../list/utils';\nimport todoListIcon from '../../theme/icons/todolist.svg';\nimport { Plugin } from 'ckeditor5/src/core';\n/**\n * The to-do list UI feature. It introduces the `'todoList'` button that\n * allows to convert elements to and from to-do list items and to indent or outdent them.\n */\nexport default class TodoListUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TodoListUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const t = this.editor.t;\n createUIComponent(this.editor, 'todoList', t('To-do List'), todoListIcon);\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m2.315 14.705 2.224-2.24a.689.689 0 0 1 .963 0 .664.664 0 0 1 0 .949L2.865 16.07a.682.682 0 0 1-.112.089.647.647 0 0 1-.852-.051L.688 14.886a.635.635 0 0 1 0-.903.647.647 0 0 1 .91 0l.717.722zm5.185.045a.75.75 0 0 1 .75-.75h9.5a.75.75 0 1 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75zM2.329 5.745l2.21-2.226a.689.689 0 0 1 .963 0 .664.664 0 0 1 0 .95L2.865 7.125a.685.685 0 0 1-.496.196.644.644 0 0 1-.468-.187L.688 5.912a.635.635 0 0 1 0-.903.647.647 0 0 1 .91 0l.73.736zM7.5 5.75A.75.75 0 0 1 8.25 5h9.5a.75.75 0 1 1 0 1.5h-9.5a.75.75 0 0 1-.75-.75z\\\"/></svg>\";","import api from \"!../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../css-loader/dist/cjs.js!../../../postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!./todolist.css\";\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/underline/underlineediting\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport AttributeCommand from '../attributecommand';\nconst UNDERLINE = 'underline';\n/**\n * The underline editing feature.\n *\n * It registers the `'underline'` command, the <kbd>Ctrl+U</kbd> keystroke\n * and introduces the `underline` attribute in the model which renders to the view as an `<u>` element.\n */\nexport default class UnderlineEditing extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'UnderlineEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Allow strikethrough attribute on text nodes.\n editor.model.schema.extend('$text', { allowAttributes: UNDERLINE });\n editor.model.schema.setAttributeProperties(UNDERLINE, {\n isFormatting: true,\n copyOnEnter: true\n });\n editor.conversion.attributeToElement({\n model: UNDERLINE,\n view: 'u',\n upcastAlso: {\n styles: {\n 'text-decoration': 'underline'\n }\n }\n });\n // Create underline command.\n editor.commands.add(UNDERLINE, new AttributeCommand(editor, UNDERLINE));\n // Set the Ctrl+U keystroke.\n editor.keystrokes.set('CTRL+U', 'underline');\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M3 18v-1.5h14V18zm2.2-8V3.6c0-.4.4-.6.8-.6.3 0 .7.2.7.6v6.2c0 2 1.3 2.8 3.2 2.8 1.9 0 3.4-.9 3.4-2.9V3.6c0-.3.4-.5.8-.5.3 0 .7.2.7.5V10c0 2.7-2.2 4-4.9 4-2.6 0-4.7-1.2-4.7-4z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/underline/underlineui\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ButtonView } from 'ckeditor5/src/ui';\nimport underlineIcon from '../../theme/icons/underline.svg';\nconst UNDERLINE = 'underline';\n/**\n * The underline UI feature. It introduces the Underline button.\n */\nexport default class UnderlineUI extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'UnderlineUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n // Add bold button to feature components.\n editor.ui.componentFactory.add(UNDERLINE, locale => {\n const command = editor.commands.get(UNDERLINE);\n const view = new ButtonView(locale);\n view.set({\n label: t('Underline'),\n icon: underlineIcon,\n keystroke: 'CTRL+U',\n tooltip: true,\n isToggleable: true\n });\n view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n // Execute command.\n this.listenTo(view, 'execute', () => {\n editor.execute(UNDERLINE);\n editor.editing.view.focus();\n });\n return view;\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Returns a plain text representation of an element and its children.\n *\n * @returns Plain text representing the model's data.\n */\nexport function modelElementToPlainText(item) {\n if (item.is('$text') || item.is('$textProxy')) {\n return item.data;\n }\n const element = item;\n let text = '';\n let prev = null;\n for (const child of element.getChildren()) {\n const childText = modelElementToPlainText(child);\n // If last block was finish, start from new line.\n if (prev && prev.is('element')) {\n text += '\\n';\n }\n text += childText;\n prev = child;\n }\n return text;\n}\n","/**\n * @license Copyright (c) 2014-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor.js';\nimport Alignment from '@ckeditor/ckeditor5-alignment/src/alignment.js';\nimport AutoImage from '@ckeditor/ckeditor5-image/src/autoimage.js';\nimport Autoformat from '@ckeditor/ckeditor5-autoformat/src/autoformat.js';\nimport AutoLink from '@ckeditor/ckeditor5-link/src/autolink.js';\nimport BlockQuote from '@ckeditor/ckeditor5-block-quote/src/blockquote.js';\nimport Bold from '@ckeditor/ckeditor5-basic-styles/src/bold.js';\nimport Code from '@ckeditor/ckeditor5-basic-styles/src/code.js';\nimport CodeBlock from '@ckeditor/ckeditor5-code-block/src/codeblock.js';\nimport DataFilter from '@ckeditor/ckeditor5-html-support/src/datafilter.js';\nimport DataSchema from '@ckeditor/ckeditor5-html-support/src/dataschema.js';\nimport Essentials from '@ckeditor/ckeditor5-essentials/src/essentials.js';\nimport FindAndReplace from '@ckeditor/ckeditor5-find-and-replace/src/findandreplace.js';\nimport FontBackgroundColor from '@ckeditor/ckeditor5-font/src/fontbackgroundcolor.js';\nimport FontColor from '@ckeditor/ckeditor5-font/src/fontcolor.js';\nimport FontFamily from '@ckeditor/ckeditor5-font/src/fontfamily.js';\nimport FontSize from '@ckeditor/ckeditor5-font/src/fontsize.js';\nimport GeneralHtmlSupport from '@ckeditor/ckeditor5-html-support/src/generalhtmlsupport.js';\nimport Heading from '@ckeditor/ckeditor5-heading/src/heading.js';\nimport Highlight from '@ckeditor/ckeditor5-highlight/src/highlight.js';\nimport HorizontalLine from '@ckeditor/ckeditor5-horizontal-line/src/horizontalline.js';\nimport HtmlComment from '@ckeditor/ckeditor5-html-support/src/htmlcomment.js';\nimport HtmlEmbed from '@ckeditor/ckeditor5-html-embed/src/htmlembed.js';\nimport Image from '@ckeditor/ckeditor5-image/src/image.js';\nimport ImageCaption from '@ckeditor/ckeditor5-image/src/imagecaption.js';\nimport ImageInsert from '@ckeditor/ckeditor5-image/src/imageinsert.js';\nimport ImageResize from '@ckeditor/ckeditor5-image/src/imageresize.js';\nimport ImageStyle from '@ckeditor/ckeditor5-image/src/imagestyle.js';\nimport ImageToolbar from '@ckeditor/ckeditor5-image/src/imagetoolbar.js';\nimport ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload.js';\nimport Indent from '@ckeditor/ckeditor5-indent/src/indent.js';\nimport IndentBlock from '@ckeditor/ckeditor5-indent/src/indentblock.js';\nimport Italic from '@ckeditor/ckeditor5-basic-styles/src/italic.js';\nimport Link from '@ckeditor/ckeditor5-link/src/link.js';\nimport LinkImage from '@ckeditor/ckeditor5-link/src/linkimage.js';\nimport List from '@ckeditor/ckeditor5-list/src/list.js';\nimport ListProperties from '@ckeditor/ckeditor5-list/src/listproperties.js';\nimport MediaEmbed from '@ckeditor/ckeditor5-media-embed/src/mediaembed.js';\nimport MediaEmbedToolbar from '@ckeditor/ckeditor5-media-embed/src/mediaembedtoolbar.js';\nimport PageBreak from '@ckeditor/ckeditor5-page-break/src/pagebreak.js';\nimport Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph.js';\nimport PasteFromOffice from '@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice.js';\nimport RemoveFormat from '@ckeditor/ckeditor5-remove-format/src/removeformat.js';\nimport SelectAll from '@ckeditor/ckeditor5-select-all/src/selectall.js';\nimport SimpleUploadAdapter from '@ckeditor/ckeditor5-upload/src/adapters/simpleuploadadapter.js';\nimport SourceEditing from '@ckeditor/ckeditor5-source-editing/src/sourceediting.js';\nimport SpecialCharacters from '@ckeditor/ckeditor5-special-characters/src/specialcharacters.js';\nimport SpecialCharactersArrows from '@ckeditor/ckeditor5-special-characters/src/specialcharactersarrows.js';\nimport SpecialCharactersCurrency from '@ckeditor/ckeditor5-special-characters/src/specialcharacterscurrency.js';\nimport SpecialCharactersEssentials from '@ckeditor/ckeditor5-special-characters/src/specialcharactersessentials.js';\nimport SpecialCharactersLatin from '@ckeditor/ckeditor5-special-characters/src/specialcharacterslatin.js';\nimport SpecialCharactersMathematical from '@ckeditor/ckeditor5-special-characters/src/specialcharactersmathematical.js';\nimport SpecialCharactersText from '@ckeditor/ckeditor5-special-characters/src/specialcharacterstext.js';\nimport Strikethrough from '@ckeditor/ckeditor5-basic-styles/src/strikethrough.js';\nimport Style from '@ckeditor/ckeditor5-style/src/style.js';\nimport Subscript from '@ckeditor/ckeditor5-basic-styles/src/subscript.js';\nimport Superscript from '@ckeditor/ckeditor5-basic-styles/src/superscript.js';\nimport Table from '@ckeditor/ckeditor5-table/src/table.js';\nimport TableCaption from '@ckeditor/ckeditor5-table/src/tablecaption.js';\nimport TableCellProperties from '@ckeditor/ckeditor5-table/src/tablecellproperties';\nimport TableColumnResize from '@ckeditor/ckeditor5-table/src/tablecolumnresize.js';\nimport TableProperties from '@ckeditor/ckeditor5-table/src/tableproperties';\nimport TableToolbar from '@ckeditor/ckeditor5-table/src/tabletoolbar.js';\nimport TextPartLanguage from '@ckeditor/ckeditor5-language/src/textpartlanguage.js';\nimport TextTransformation from '@ckeditor/ckeditor5-typing/src/texttransformation.js';\nimport TodoList from '@ckeditor/ckeditor5-list/src/todolist';\nimport Underline from '@ckeditor/ckeditor5-basic-styles/src/underline.js';\nimport WordCount from '@ckeditor/ckeditor5-word-count/src/wordcount.js';\n\n\nclass Editor extends ClassicEditor {}\n\n// Plugins to include in the build.\nEditor.builtinPlugins = [\n\tAlignment,\n\tAutoImage,\n\tAutoformat,\n\tAutoLink,\n\tBlockQuote,\n\tBold,\n\tCode,\n\tCodeBlock,\n\tDataFilter,\n\tDataSchema,\n\tEssentials,\n\tFindAndReplace,\n\tFontBackgroundColor,\n\tFontColor,\n\tFontFamily,\n\tFontSize,\n\tGeneralHtmlSupport,\n\tHeading,\n\tHighlight,\n\tHorizontalLine,\n\tHtmlComment,\n\tHtmlEmbed,\n\tImage,\n\tImageCaption,\n\tImageInsert,\n\tImageResize,\n\tImageStyle,\n\tImageToolbar,\n\tImageUpload,\n\tIndent,\n\tIndentBlock,\n\tItalic,\n\tLink,\n\tLinkImage,\n\tList,\n\tListProperties,\n\tMediaEmbed,\n\tMediaEmbedToolbar,\n\tPageBreak,\n\tParagraph,\n\tPasteFromOffice,\n\tRemoveFormat,\n\tSelectAll,\n\tSimpleUploadAdapter,\n\tSourceEditing,\n\tSpecialCharacters,\n\tSpecialCharactersArrows,\n\tSpecialCharactersCurrency,\n\tSpecialCharactersEssentials,\n\tSpecialCharactersLatin,\n\tSpecialCharactersMathematical,\n\tSpecialCharactersText,\n\tStrikethrough,\n\tStyle,\n\tSubscript,\n\tSuperscript,\n\tTable,\n\tTableCaption,\n\tTableCellProperties,\n\tTableColumnResize,\n\tTableProperties,\n\tTableToolbar,\n\tTextPartLanguage,\n\tTextTransformation,\n\tTodoList,\n\tUnderline,\n\tWordCount\n];\n\n// Editor configuration.\nEditor.defaultConfig = {\n\ttoolbar: {\n\t\titems: [\n\t\t\t'heading',\n\t\t\t'|',\n\t\t\t'fontFamily',\n\t\t\t'fontSize',\n\t\t\t'fontColor',\n\t\t\t'fontBackgroundColor',\n\t\t\t'bold',\n\t\t\t'strikethrough',\n\t\t\t'underline',\n\t\t\t'italic',\n\t\t\t'link',\n\t\t\t'subscript',\n\t\t\t'superscript',\n\t\t\t'highlight',\n\t\t\t'removeFormat',\n\t\t\t'|',\n\t\t\t'alignment',\n\t\t\t'outdent',\n\t\t\t'indent',\n\t\t\t'pageBreak',\n\t\t\t'|',\n\t\t\t'imageInsert',\n\t\t\t'imageUpload',\n\t\t\t'blockQuote',\n\t\t\t'insertTable',\n\t\t\t'mediaEmbed',\n\t\t\t'undo',\n\t\t\t'redo',\n\t\t\t'-',\n\t\t\t'style',\n\t\t\t'findAndReplace',\n\t\t\t'specialCharacters',\n\t\t\t'code',\n\t\t\t'codeBlock',\n\t\t\t'sourceEditing',\n\t\t\t'selectAll',\n\t\t\t'htmlEmbed'\n\t\t],\n\t\tshouldNotGroupWhenFull: true\n\t},\n\tlanguage: 'en-gb',\n\timage: {\n\t\ttoolbar: [\n\t\t\t'imageTextAlternative',\n\t\t\t'toggleImageCaption',\n\t\t\t'imageStyle:inline',\n\t\t\t'imageStyle:block',\n\t\t\t'imageStyle:side',\n\t\t\t'linkImage'\n\t\t]\n\t},\n\ttable: {\n\t\tcontentToolbar: [\n\t\t\t'tableColumn',\n\t\t\t'tableRow',\n\t\t\t'mergeTableCells',\n\t\t\t'tableCellProperties',\n\t\t\t'tableProperties'\n\t\t]\n\t}\n};\n\nexport default Editor;\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module alignment/alignment\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport AlignmentEditing from './alignmentediting';\nimport AlignmentUI from './alignmentui';\n/**\n * The text alignment plugin.\n *\n * For a detailed overview, check the {@glink features/text-alignment Text alignment} feature guide\n * and the {@glink api/alignment package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:alignment/alignmentediting~AlignmentEditing} and\n * {@link module:alignment/alignmentui~AlignmentUI} plugins.\n */\nexport default class Alignment extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [AlignmentEditing, AlignmentUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Alignment';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module block-quote/blockquote\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport BlockQuoteEditing from './blockquoteediting';\nimport BlockQuoteUI from './blockquoteui';\n/**\n * The block quote plugin.\n *\n * For more information about this feature check the {@glink api/block-quote package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:block-quote/blockquoteediting~BlockQuoteEditing block quote editing feature}\n * and {@link module:block-quote/blockquoteui~BlockQuoteUI block quote UI feature}.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class BlockQuote extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [BlockQuoteEditing, BlockQuoteUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'BlockQuote';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/bold\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport BoldEditing from './bold/boldediting';\nimport BoldUI from './bold/boldui';\n/**\n * The bold feature.\n *\n * For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide\n * and the {@glink api/basic-styles package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:basic-styles/bold/boldediting~BoldEditing bold editing feature}\n * and {@link module:basic-styles/bold/boldui~BoldUI bold UI feature}.\n */\nexport default class Bold extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [BoldEditing, BoldUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Bold';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/code\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport CodeEditing from './code/codeediting';\nimport CodeUI from './code/codeui';\nimport '../theme/code.css';\n/**\n * The code feature.\n *\n * For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide\n * and the {@glink api/basic-styles package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:basic-styles/code/codeediting~CodeEditing code editing feature}\n * and {@link module:basic-styles/code/codeui~CodeUI code UI feature}.\n */\nexport default class Code extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [CodeEditing, CodeUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Code';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module code-block/codeblock\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport CodeBlockEditing from './codeblockediting';\nimport CodeBlockUI from './codeblockui';\n/**\n * The code block plugin.\n *\n * For more information about this feature check the {@glink api/code-block package page} and the\n * {@glink features/code-blocks code block} feature guide.\n *\n * This is a \"glue\" plugin that loads the {@link module:code-block/codeblockediting~CodeBlockEditing code block editing feature}\n * and the {@link module:code-block/codeblockui~CodeBlockUI code block UI feature}.\n */\nexport default class CodeBlock extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [CodeBlockEditing, CodeBlockUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'CodeBlock';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module essentials/essentials\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Clipboard } from 'ckeditor5/src/clipboard';\nimport { Enter, ShiftEnter } from 'ckeditor5/src/enter';\nimport { SelectAll } from 'ckeditor5/src/select-all';\nimport { Typing } from 'ckeditor5/src/typing';\nimport { Undo } from 'ckeditor5/src/undo';\n/**\n * A plugin including all essential editing features. It represents a set of features that enables similar functionalities\n * to a `<textarea>` element.\n *\n * It includes:\n *\n * * {@link module:clipboard/clipboard~Clipboard},\n * * {@link module:enter/enter~Enter},\n * * {@link module:select-all/selectall~SelectAll},\n * * {@link module:enter/shiftenter~ShiftEnter},\n * * {@link module:typing/typing~Typing},\n * * {@link module:undo/undo~Undo}.\n *\n * This plugin set does not define any block-level containers (such as {@link module:paragraph/paragraph~Paragraph}).\n * If your editor is supposed to handle block content, make sure to include it.\n */\nexport default class Essentials extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [Clipboard, Enter, SelectAll, ShiftEnter, Typing, Undo];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Essentials';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module find-and-replace/findandreplace\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport FindAndReplaceUI from './findandreplaceui';\nimport FindAndReplaceEditing from './findandreplaceediting';\n/**\n * The find and replace plugin.\n *\n * For a detailed overview, check the {@glink features/find-and-replace Find and replace feature documentation}.\n *\n * This is a \"glue\" plugin which loads the following plugins:\n *\n * * The {@link module:find-and-replace/findandreplaceediting~FindAndReplaceEditing find and replace editing feature},\n * * The {@link module:find-and-replace/findandreplaceui~FindAndReplaceUI find and replace UI feature}\n */\nexport default class FindAndReplace extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [FindAndReplaceEditing, FindAndReplaceUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'FindAndReplace';\n }\n /**\n * @inheritDoc\n */\n init() {\n const ui = this.editor.plugins.get('FindAndReplaceUI');\n const findAndReplaceEditing = this.editor.plugins.get('FindAndReplaceEditing');\n const state = findAndReplaceEditing.state;\n ui.on('findNext', (event, data) => {\n // Data is contained only for the \"find\" button.\n if (data) {\n state.searchText = data.searchText;\n this.editor.execute('find', data.searchText, data);\n }\n else {\n // Find next arrow button press.\n this.editor.execute('findNext');\n }\n });\n ui.on('findPrevious', (event, data) => {\n if (data && state.searchText !== data.searchText) {\n this.editor.execute('find', data.searchText);\n }\n else {\n // Subsequent calls.\n this.editor.execute('findPrevious');\n }\n });\n ui.on('replace', (event, data) => {\n if (state.searchText !== data.searchText) {\n this.editor.execute('find', data.searchText);\n }\n const highlightedResult = state.highlightedResult;\n if (highlightedResult) {\n this.editor.execute('replace', data.replaceText, highlightedResult);\n }\n });\n ui.on('replaceAll', (event, data) => {\n // The state hadn't been yet built for this search text.\n if (state.searchText !== data.searchText) {\n this.editor.execute('find', data.searchText);\n }\n this.editor.execute('replaceAll', data.replaceText, state.results);\n });\n // Reset the state when the user invalidated last search results, for instance,\n // by starting typing another search query or changing options.\n ui.on('searchReseted', () => {\n state.clear(this.editor.model);\n findAndReplaceEditing.stop();\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module font/fontbackgroundcolor\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport FontBackgroundColorEditing from './fontbackgroundcolor/fontbackgroundcolorediting';\nimport FontBackgroundColorUI from './fontbackgroundcolor/fontbackgroundcolorui';\n/**\n * The font background color plugin.\n *\n * For a detailed overview, check the {@glink features/font font feature} documentation\n * and the {@glink api/font package page}.\n *\n * This is a \"glue\" plugin which loads\n * the {@link module:font/fontbackgroundcolor/fontbackgroundcolorediting~FontBackgroundColorEditing} and\n * {@link module:font/fontbackgroundcolor/fontbackgroundcolorui~FontBackgroundColorUI} features in the editor.\n */\nexport default class FontBackgroundColor extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [FontBackgroundColorEditing, FontBackgroundColorUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'FontBackgroundColor';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module font/fontcolor\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport FontColorEditing from './fontcolor/fontcolorediting';\nimport FontColorUI from './fontcolor/fontcolorui';\n/**\n * The font color plugin.\n *\n * For a detailed overview, check the {@glink features/font font feature} documentation\n * and the {@glink api/font package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:font/fontcolor/fontcolorediting~FontColorEditing} and\n * {@link module:font/fontcolor/fontcolorui~FontColorUI} features in the editor.\n */\nexport default class FontColor extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [FontColorEditing, FontColorUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'FontColor';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module font/fontfamily\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport FontFamilyEditing from './fontfamily/fontfamilyediting';\nimport FontFamilyUI from './fontfamily/fontfamilyui';\n/**\n * The font family plugin.\n *\n * For a detailed overview, check the {@glink features/font font feature} documentatiom\n * and the {@glink api/font package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:font/fontfamily/fontfamilyediting~FontFamilyEditing} and\n * {@link module:font/fontfamily/fontfamilyui~FontFamilyUI} features in the editor.\n */\nexport default class FontFamily extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [FontFamilyEditing, FontFamilyUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'FontFamily';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module font/fontsize\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport FontSizeEditing from './fontsize/fontsizeediting';\nimport FontSizeUI from './fontsize/fontsizeui';\nimport { normalizeOptions } from './fontsize/utils';\n/**\n * The font size plugin.\n *\n * For a detailed overview, check the {@glink features/font font feature} documentation\n * and the {@glink api/font package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:font/fontsize/fontsizeediting~FontSizeEditing} and\n * {@link module:font/fontsize/fontsizeui~FontSizeUI} features in the editor.\n */\nexport default class FontSize extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [FontSizeEditing, FontSizeUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'FontSize';\n }\n /**\n * Normalizes and translates the {@link module:font/fontconfig~FontSizeConfig#options configuration options}\n * to the {@link module:font/fontconfig~FontSizeOption} format.\n *\n * @param configuredOptions An array of options taken from the configuration.\n */\n normalizeSizeOptions(options) {\n return normalizeOptions(options);\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module heading/heading\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport HeadingEditing from './headingediting';\nimport HeadingUI from './headingui';\nimport '../theme/heading.css';\n/**\n * The headings feature.\n *\n * For a detailed overview, check the {@glink features/headings Headings feature} guide\n * and the {@glink api/heading package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:heading/headingediting~HeadingEditing heading editing feature}\n * and {@link module:heading/headingui~HeadingUI heading UI feature}.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class Heading extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [HeadingEditing, HeadingUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Heading';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module highlight/highlight\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport HighlightEditing from './highlightediting';\nimport HighlightUI from './highlightui';\n/**\n * The highlight plugin.\n *\n * For a detailed overview, check the {@glink features/highlight Highlight feature} documentation.\n *\n * This is a \"glue\" plugin which loads the {@link module:highlight/highlightediting~HighlightEditing} and\n * {@link module:highlight/highlightui~HighlightUI} plugins.\n */\nexport default class Highlight extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [HighlightEditing, HighlightUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Highlight';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module horizontal-line/horizontalline\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Widget } from 'ckeditor5/src/widget';\nimport HorizontalLineEditing from './horizontallineediting';\nimport HorizontalLineUI from './horizontallineui';\n/**\n * The horizontal line feature.\n *\n * It provides the possibility to insert a horizontal line into the rich-text editor.\n *\n * For a detailed overview, check the {@glink features/horizontal-line Horizontal line feature} documentation.\n */\nexport default class HorizontalLine extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [HorizontalLineEditing, HorizontalLineUI, Widget];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'HorizontalLine';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { uid } from 'ckeditor5/src/utils';\n/**\n * The HTML comment feature. It preserves the HTML comments (`<!-- -->`) in the editor data.\n *\n * For a detailed overview, check the {@glink features/html/html-comments HTML comment feature documentation}.\n */\nexport default class HtmlComment extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'HtmlComment';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n editor.data.processor.skipComments = false;\n // Allow storing comment's content as the $root attribute with the name `$comment:<unique id>`.\n editor.model.schema.addAttributeCheck((context, attributeName) => {\n if (context.endsWith('$root') && attributeName.startsWith('$comment')) {\n return true;\n }\n });\n // Convert the `$comment` view element to `$comment:<unique id>` marker and store its content (the comment itself) as a $root\n // attribute. The comment content is needed in the `dataDowncast` pipeline to re-create the comment node.\n editor.conversion.for('upcast').elementToMarker({\n view: '$comment',\n model: (viewElement, { writer }) => {\n const root = this.editor.model.document.getRoot();\n const commentContent = viewElement.getCustomProperty('$rawContent');\n const markerName = `$comment:${uid()}`;\n writer.setAttribute(markerName, commentContent, root);\n return markerName;\n }\n });\n // Convert the `$comment` marker to `$comment` UI element with `$rawContent` custom property containing the comment content.\n editor.conversion.for('dataDowncast').markerToElement({\n model: '$comment',\n view: (modelElement, { writer }) => {\n const root = this.editor.model.document.getRoot();\n const markerName = modelElement.markerName;\n const commentContent = root.getAttribute(markerName);\n const comment = writer.createUIElement('$comment');\n writer.setCustomProperty('$rawContent', commentContent, comment);\n return comment;\n }\n });\n // Remove comments' markers and their corresponding $root attributes, which are no longer present.\n editor.model.document.registerPostFixer(writer => {\n const root = editor.model.document.getRoot();\n const changedMarkers = editor.model.document.differ.getChangedMarkers();\n const changedCommentMarkers = changedMarkers.filter(marker => {\n return marker.name.startsWith('$comment');\n });\n const removedCommentMarkers = changedCommentMarkers.filter(marker => {\n const newRange = marker.data.newRange;\n return newRange && newRange.root.rootName === '$graveyard';\n });\n if (removedCommentMarkers.length === 0) {\n return false;\n }\n for (const marker of removedCommentMarkers) {\n writer.removeMarker(marker.name);\n writer.removeAttribute(marker.name, root);\n }\n return true;\n });\n // Delete all comment markers from the document before setting new data.\n editor.data.on('set', () => {\n for (const commentMarker of editor.model.markers.getMarkersGroup('$comment')) {\n this.removeHtmlComment(commentMarker.name);\n }\n }, { priority: 'high' });\n // Delete all comment markers that are within a removed range.\n // Delete all comment markers at the limit element boundaries if the whole content of the limit element is removed.\n editor.model.on('deleteContent', (evt, [selection]) => {\n for (const range of selection.getRanges()) {\n const limitElement = editor.model.schema.getLimitElement(range);\n const firstPosition = editor.model.createPositionAt(limitElement, 0);\n const lastPosition = editor.model.createPositionAt(limitElement, 'end');\n let affectedCommentIDs;\n if (firstPosition.isTouching(range.start) && lastPosition.isTouching(range.end)) {\n affectedCommentIDs = this.getHtmlCommentsInRange(editor.model.createRange(firstPosition, lastPosition));\n }\n else {\n affectedCommentIDs = this.getHtmlCommentsInRange(range, { skipBoundaries: true });\n }\n for (const commentMarkerID of affectedCommentIDs) {\n this.removeHtmlComment(commentMarkerID);\n }\n }\n }, { priority: 'high' });\n }\n /**\n * Creates an HTML comment on the specified position and returns its ID.\n *\n * *Note*: If two comments are created at the same position, the second comment will be inserted before the first one.\n *\n * @returns Comment ID. This ID can be later used to e.g. remove the comment from the content.\n */\n createHtmlComment(position, content) {\n const id = uid();\n const editor = this.editor;\n const model = editor.model;\n const root = model.document.getRoot();\n const markerName = `$comment:${id}`;\n return model.change(writer => {\n const range = writer.createRange(position);\n writer.addMarker(markerName, {\n usingOperation: true,\n affectsData: true,\n range\n });\n writer.setAttribute(markerName, content, root);\n return markerName;\n });\n }\n /**\n * Removes an HTML comment with the given comment ID.\n *\n * It does nothing and returns `false` if the comment with the given ID does not exist.\n * Otherwise it removes the comment and returns `true`.\n *\n * Note that a comment can be removed also by removing the content around the comment.\n *\n * @param commentID The ID of the comment to be removed.\n * @returns `true` when the comment with the given ID was removed, `false` otherwise.\n */\n removeHtmlComment(commentID) {\n const editor = this.editor;\n const root = editor.model.document.getRoot();\n const marker = editor.model.markers.get(commentID);\n if (!marker) {\n return false;\n }\n editor.model.change(writer => {\n writer.removeMarker(marker);\n writer.removeAttribute(commentID, root);\n });\n return true;\n }\n /**\n * Gets the HTML comment data for the comment with a given ID.\n *\n * Returns `null` if the comment does not exist.\n *\n */\n getHtmlCommentData(commentID) {\n const editor = this.editor;\n const marker = editor.model.markers.get(commentID);\n const root = editor.model.document.getRoot();\n if (!marker) {\n return null;\n }\n return {\n content: root.getAttribute(commentID),\n position: marker.getStart()\n };\n }\n /**\n * Gets all HTML comments in the given range.\n *\n * By default it includes comments at the range boundaries.\n *\n * @param range\n * @param options.skipBoundaries When set to `true` the range boundaries will be skipped.\n * @returns HTML comment IDs\n */\n getHtmlCommentsInRange(range, { skipBoundaries = false } = {}) {\n const includeBoundaries = !skipBoundaries;\n // Unfortunately, MarkerCollection#getMarkersAtPosition() filters out collapsed markers.\n return Array.from(this.editor.model.markers.getMarkersGroup('$comment'))\n .filter(marker => isCommentMarkerInRange(marker, range))\n .map(marker => marker.name);\n function isCommentMarkerInRange(commentMarker, range) {\n const position = commentMarker.getRange().start;\n return ((position.isAfter(range.start) || (includeBoundaries && position.isEqual(range.start))) &&\n (position.isBefore(range.end) || (includeBoundaries && position.isEqual(range.end))));\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module html-embed/htmlembed\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Widget } from 'ckeditor5/src/widget';\nimport HtmlEmbedEditing from './htmlembedediting';\nimport HtmlEmbedUI from './htmlembedui';\n/**\n * The HTML embed feature.\n *\n * It allows inserting HTML snippets directly into the editor.\n *\n * For a detailed overview, check the {@glink features/html/html-embed HTML embed feature} documentation.\n */\nexport default class HtmlEmbed extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [HtmlEmbedEditing, HtmlEmbedUI, Widget];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'HtmlEmbed';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/image\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport ImageBlock from './imageblock';\nimport ImageInline from './imageinline';\nimport '../theme/image.css';\n/**\n * The image plugin.\n *\n * For a detailed overview, check the {@glink features/images/images-overview image feature} documentation.\n *\n * This is a \"glue\" plugin which loads the following plugins:\n *\n * * {@link module:image/imageblock~ImageBlock},\n * * {@link module:image/imageinline~ImageInline},\n *\n * Usually, it is used in conjunction with other plugins from this package. See the {@glink api/image package page}\n * for more information.\n */\nexport default class Image extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageBlock, ImageInline];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Image';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagecaption\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport ImageCaptionEditing from './imagecaption/imagecaptionediting';\nimport ImageCaptionUI from './imagecaption/imagecaptionui';\nimport '../theme/imagecaption.css';\n/**\n * The image caption plugin.\n *\n * For a detailed overview, check the {@glink features/images/images-captions image caption} documentation.\n */\nexport default class ImageCaption extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageCaptionEditing, ImageCaptionUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageCaption';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageinsert\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport ImageUpload from './imageupload';\nimport ImageInsertViaUrl from './imageinsertviaurl';\nimport ImageInsertUI from './imageinsert/imageinsertui';\n/**\n * The image insert plugin.\n *\n * For a detailed overview, check the {@glink features/images/image-upload/image-upload Image upload feature}\n * and {@glink features/images/images-inserting Insert images via source URL} documentation.\n *\n * This plugin does not do anything directly, but it loads a set of specific plugins\n * to enable image uploading or inserting via implemented integrations:\n *\n * * {@link module:image/imageupload~ImageUpload}\n * * {@link module:image/imageinsert/imageinsertui~ImageInsertUI}\n */\nexport default class ImageInsert extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageInsert';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageUpload, ImageInsertViaUrl, ImageInsertUI];\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imageresize\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport ImageResizeButtons from './imageresize/imageresizebuttons';\nimport ImageResizeEditing from './imageresize/imageresizeediting';\nimport ImageResizeHandles from './imageresize/imageresizehandles';\nimport '../theme/imageresize.css';\n/**\n * The image resize plugin.\n *\n * It adds a possibility to resize each image using handles.\n */\nexport default class ImageResize extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageResizeEditing, ImageResizeHandles, ImageResizeButtons];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageResize';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagestyle\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport ImageStyleEditing from './imagestyle/imagestyleediting';\nimport ImageStyleUI from './imagestyle/imagestyleui';\n/**\n * The image style plugin.\n *\n * For a detailed overview of the image styles feature, check the {@glink features/images/images-styles documentation}.\n *\n * This is a \"glue\" plugin which loads the following plugins:\n * * {@link module:image/imagestyle/imagestyleediting~ImageStyleEditing},\n * * {@link module:image/imagestyle/imagestyleui~ImageStyleUI}\n *\n * It provides a default configuration, which can be extended or overwritten.\n * Read more about the {@link module:image/imageconfig~ImageConfig#styles image styles configuration}.\n */\nexport default class ImageStyle extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ImageStyleEditing, ImageStyleUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageStyle';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module image/imagetoolbar\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { WidgetToolbarRepository } from 'ckeditor5/src/widget';\nimport ImageUtils from './imageutils';\nimport { isObject } from 'lodash-es';\n/**\n * The image toolbar plugin. It creates and manages the image toolbar (the toolbar displayed when an image is selected).\n *\n * For an overview, check the {@glink features/images/images-overview#image-contextual-toolbar image contextual toolbar} documentation.\n *\n * Instances of toolbar components (e.g. buttons) are created using the editor's\n * {@link module:ui/componentfactory~ComponentFactory component factory}\n * based on the {@link module:image/imageconfig~ImageConfig#toolbar `image.toolbar` configuration option}.\n *\n * The toolbar uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.\n */\nexport default class ImageToolbar extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [WidgetToolbarRepository, ImageUtils];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ImageToolbar';\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n const editor = this.editor;\n const t = editor.t;\n const widgetToolbarRepository = editor.plugins.get(WidgetToolbarRepository);\n const imageUtils = editor.plugins.get('ImageUtils');\n widgetToolbarRepository.register('image', {\n ariaLabel: t('Image toolbar'),\n items: normalizeDeclarativeConfig(editor.config.get('image.toolbar') || []),\n getRelatedElement: selection => imageUtils.getClosestSelectedImageWidget(selection)\n });\n }\n}\n/**\n * Convert the dropdown definitions to their keys registered in the ComponentFactory.\n * The registration precess should be handled by the plugin which handles the UI of a particular feature.\n */\nfunction normalizeDeclarativeConfig(config) {\n return config.map(item => isObject(item) ? item.name : item);\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module indent/indent\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport IndentEditing from './indentediting';\nimport IndentUI from './indentui';\n/**\n * The indent feature.\n *\n * This plugin acts as a single entry point plugin for other features that implement indentation of elements like lists or paragraphs.\n *\n * The compatible features are:\n *\n * * The {@link module:list/list~List} or {@link module:list/list/listediting~ListEditing} feature for list indentation.\n * * The {@link module:indent/indentblock~IndentBlock} feature for block indentation.\n *\n * This is a \"glue\" plugin that loads the following plugins:\n *\n * * The {@link module:indent/indentediting~IndentEditing indent editing feature}.\n * * The {@link module:indent/indentui~IndentUI indent UI feature}.\n *\n * The dependent plugins register the `'indent'` and `'outdent'` commands and introduce the `'indent'` and `'outdent'` buttons\n * that allow to increase or decrease text indentation of supported elements.\n *\n * **Note**: In order for the commands and buttons to work, at least one of compatible features is required.\n */\nexport default class Indent extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Indent';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [IndentEditing, IndentUI];\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/italic\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport ItalicEditing from './italic/italicediting';\nimport ItalicUI from './italic/italicui';\n/**\n * The italic feature.\n *\n * For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide\n * and the {@glink api/basic-styles package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:basic-styles/italic/italicediting~ItalicEditing} and\n * {@link module:basic-styles/italic/italicui~ItalicUI} plugins.\n */\nexport default class Italic extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ItalicEditing, ItalicUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Italic';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module link/link\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport LinkEditing from './linkediting';\nimport LinkUI from './linkui';\nimport AutoLink from './autolink';\n/**\n * The link plugin.\n *\n * This is a \"glue\" plugin that loads the {@link module:link/linkediting~LinkEditing link editing feature}\n * and {@link module:link/linkui~LinkUI link UI feature}.\n */\nexport default class Link extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [LinkEditing, LinkUI, AutoLink];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Link';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module link/linkimage\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport LinkImageEditing from './linkimageediting';\nimport LinkImageUI from './linkimageui';\nimport '../theme/linkimage.css';\n/**\n * The `LinkImage` plugin.\n *\n * This is a \"glue\" plugin that loads the {@link module:link/linkimageediting~LinkImageEditing link image editing feature}\n * and {@link module:link/linkimageui~LinkImageUI link image UI feature}.\n */\nexport default class LinkImage extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [LinkImageEditing, LinkImageUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'LinkImage';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/list\n */\nimport ListEditing from './list/listediting';\nimport ListUI from './list/listui';\nimport { Plugin } from 'ckeditor5/src/core';\n/**\n * The list feature.\n *\n * This is a \"glue\" plugin that loads the {@link module:list/list/listediting~ListEditing list editing feature}\n * and {@link module:list/list/listui~ListUI list UI feature}.\n */\nexport default class List extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ListEditing, ListUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'List';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/listproperties\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport ListPropertiesEditing from './listproperties/listpropertiesediting';\nimport ListPropertiesUI from './listproperties/listpropertiesui';\n/**\n * The list properties feature.\n *\n * This is a \"glue\" plugin that loads the {@link module:list/listproperties/listpropertiesediting~ListPropertiesEditing list properties\n * editing feature} and the {@link module:list/listproperties/listpropertiesui~ListPropertiesUI list properties UI feature}.\n */\nexport default class ListProperties extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ListPropertiesEditing, ListPropertiesUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ListProperties';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module media-embed/mediaembed\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Widget } from 'ckeditor5/src/widget';\nimport MediaEmbedEditing from './mediaembedediting';\nimport AutoMediaEmbed from './automediaembed';\nimport MediaEmbedUI from './mediaembedui';\nimport '../theme/mediaembed.css';\n/**\n * The media embed plugin.\n *\n * For a detailed overview, check the {@glink features/media-embed Media Embed feature documentation}.\n *\n * This is a \"glue\" plugin which loads the following plugins:\n *\n * * The {@link module:media-embed/mediaembedediting~MediaEmbedEditing media embed editing feature},\n * * The {@link module:media-embed/mediaembedui~MediaEmbedUI media embed UI feature} and\n * * The {@link module:media-embed/automediaembed~AutoMediaEmbed auto-media embed feature}.\n */\nexport default class MediaEmbed extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [MediaEmbedEditing, MediaEmbedUI, AutoMediaEmbed, Widget];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'MediaEmbed';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module media-embed/mediaembedtoolbar\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { WidgetToolbarRepository } from 'ckeditor5/src/widget';\nimport { getSelectedMediaViewWidget } from './utils';\nimport './mediaembedconfig';\n/**\n * The media embed toolbar plugin. It creates a toolbar for media embed that shows up when the media element is selected.\n *\n * Instances of toolbar components (e.g. buttons) are created based on the\n * {@link module:media-embed/mediaembedconfig~MediaEmbedConfig#toolbar `media.toolbar` configuration option}.\n */\nexport default class MediaEmbedToolbar extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [WidgetToolbarRepository];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'MediaEmbedToolbar';\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n const editor = this.editor;\n const t = editor.t;\n const widgetToolbarRepository = editor.plugins.get(WidgetToolbarRepository);\n widgetToolbarRepository.register('mediaEmbed', {\n ariaLabel: t('Media toolbar'),\n items: editor.config.get('mediaEmbed.toolbar') || [],\n getRelatedElement: getSelectedMediaViewWidget\n });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module page-break/pagebreak\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Widget } from 'ckeditor5/src/widget';\nimport PageBreakEditing from './pagebreakediting';\nimport PageBreakUI from './pagebreakui';\n/**\n * The page break feature.\n *\n * It provides the possibility to insert a page break into the rich-text editor.\n *\n * For a detailed overview, check the {@glink features/page-break Page break feature} documentation.\n */\nexport default class PageBreak extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [PageBreakEditing, PageBreakUI, Widget];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'PageBreak';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module paste-from-office/pastefromoffice\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ClipboardPipeline } from 'ckeditor5/src/clipboard';\nimport MSWordNormalizer from './normalizers/mswordnormalizer';\nimport GoogleDocsNormalizer from './normalizers/googledocsnormalizer';\nimport GoogleSheetsNormalizer from './normalizers/googlesheetsnormalizer';\nimport { parseHtml } from './filters/parse';\n/**\n * The Paste from Office plugin.\n *\n * This plugin handles content pasted from Office apps and transforms it (if necessary)\n * to a valid structure which can then be understood by the editor features.\n *\n * Transformation is made by a set of predefined {@link module:paste-from-office/normalizer~Normalizer normalizers}.\n * This plugin includes following normalizers:\n * * {@link module:paste-from-office/normalizers/mswordnormalizer~MSWordNormalizer Microsoft Word normalizer}\n * * {@link module:paste-from-office/normalizers/googledocsnormalizer~GoogleDocsNormalizer Google Docs normalizer}\n *\n * For more information about this feature check the {@glink api/paste-from-office package page}.\n */\nexport default class PasteFromOffice extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'PasteFromOffice';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ClipboardPipeline];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const clipboardPipeline = editor.plugins.get('ClipboardPipeline');\n const viewDocument = editor.editing.view.document;\n const normalizers = [];\n normalizers.push(new MSWordNormalizer(viewDocument));\n normalizers.push(new GoogleDocsNormalizer(viewDocument));\n normalizers.push(new GoogleSheetsNormalizer(viewDocument));\n clipboardPipeline.on('inputTransformation', (evt, data) => {\n if (data._isTransformedWithPasteFromOffice) {\n return;\n }\n const codeBlock = editor.model.document.selection.getFirstPosition().parent;\n if (codeBlock.is('element', 'codeBlock')) {\n return;\n }\n const htmlString = data.dataTransfer.getData('text/html');\n const activeNormalizer = normalizers.find(normalizer => normalizer.isActive(htmlString));\n if (activeNormalizer) {\n data._parsedData = parseHtml(htmlString, viewDocument.stylesProcessor);\n activeNormalizer.execute(data);\n data._isTransformedWithPasteFromOffice = true;\n }\n }, { priority: 'high' });\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module remove-format/removeformat\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport RemoveFormatUI from './removeformatui';\nimport RemoveFormatEditing from './removeformatediting';\n/**\n * The remove format plugin.\n *\n * This is a \"glue\" plugin which loads the {@link module:remove-format/removeformatediting~RemoveFormatEditing}\n * and {@link module:remove-format/removeformatui~RemoveFormatUI} plugins.\n *\n * For a detailed overview, check out the {@glink features/remove-format remove format} feature documentation.\n */\nexport default class RemoveFormat extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [RemoveFormatEditing, RemoveFormatUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'RemoveFormat';\n }\n}\n","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"m12.5 0 5 4.5v15.003h-16V0h11zM3 1.5v3.25l-1.497 1-.003 8 1.5 1v3.254L7.685 18l-.001 1.504H17.5V8.002L16 9.428l-.004-4.22-4.222-3.692L3 1.5z\\\"/><path d=\\\"M4.06 6.64a.75.75 0 0 1 .958 1.15l-.085.07L2.29 9.75l2.646 1.89c.302.216.4.62.232.951l-.058.095a.75.75 0 0 1-.951.232l-.095-.058-3.5-2.5V9.14l3.496-2.5zm4.194 6.22a.75.75 0 0 1-.958-1.149l.085-.07 2.643-1.89-2.646-1.89a.75.75 0 0 1-.232-.952l.058-.095a.75.75 0 0 1 .95-.232l.096.058 3.5 2.5v1.22l-3.496 2.5zm7.644-.836 2.122 2.122-5.825 5.809-2.125-.005.003-2.116zm2.539-1.847 1.414 1.414a.5.5 0 0 1 0 .707l-1.06 1.06-2.122-2.12 1.061-1.061a.5.5 0 0 1 .707 0z\\\"/></svg>\";","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M10 2.5a7.47 7.47 0 0 1 4.231 1.31 7.268 7.268 0 0 1 2.703 3.454 7.128 7.128 0 0 1 .199 4.353c-.39 1.436-1.475 2.72-2.633 3.677h2.013c0-.226.092-.443.254-.603a.876.876 0 0 1 1.229 0c.163.16.254.377.254.603v.853c0 .209-.078.41-.22.567a.873.873 0 0 1-.547.28l-.101.006h-4.695a.517.517 0 0 1-.516-.518v-1.265c0-.21.128-.398.317-.489a5.601 5.601 0 0 0 2.492-2.371 5.459 5.459 0 0 0 .552-3.693 5.53 5.53 0 0 0-1.955-3.2A5.71 5.71 0 0 0 10 4.206 5.708 5.708 0 0 0 6.419 5.46 5.527 5.527 0 0 0 4.46 8.663a5.457 5.457 0 0 0 .554 3.695 5.6 5.6 0 0 0 2.497 2.37.55.55 0 0 1 .317.49v1.264c0 .286-.23.518-.516.518H2.618a.877.877 0 0 1-.614-.25.845.845 0 0 1-.254-.603v-.853c0-.226.091-.443.254-.603a.876.876 0 0 1 1.228 0c.163.16.255.377.255.603h1.925c-1.158-.958-2.155-2.241-2.545-3.678a7.128 7.128 0 0 1 .199-4.352 7.268 7.268 0 0 1 2.703-3.455A7.475 7.475 0 0 1 10 2.5z\\\"/></svg>\";","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module special-characters/specialcharactersessentials\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport SpecialCharactersCurrency from './specialcharacterscurrency';\nimport SpecialCharactersMathematical from './specialcharactersmathematical';\nimport SpecialCharactersArrows from './specialcharactersarrows';\nimport SpecialCharactersLatin from './specialcharacterslatin';\nimport SpecialCharactersText from './specialcharacterstext';\n/**\n * A plugin combining a basic set of characters for the special characters plugin.\n *\n * ```ts\n * ClassicEditor\n * .create( {\n * plugins: [ ..., SpecialCharacters, SpecialCharactersEssentials ],\n * } )\n * .then( ... )\n * .catch( ... );\n * ```\n */\nexport default class SpecialCharactersEssentials extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'SpecialCharactersEssentials';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [\n SpecialCharactersCurrency,\n SpecialCharactersText,\n SpecialCharactersMathematical,\n SpecialCharactersArrows,\n SpecialCharactersLatin\n ];\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/strikethrough\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport StrikethroughEditing from './strikethrough/strikethroughediting';\nimport StrikethroughUI from './strikethrough/strikethroughui';\n/**\n * The strikethrough feature.\n *\n * For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide\n * and the {@glink api/basic-styles package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:basic-styles/strikethrough/strikethroughediting~StrikethroughEditing} and\n * {@link module:basic-styles/strikethrough/strikethroughui~StrikethroughUI} plugins.\n */\nexport default class Strikethrough extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [StrikethroughEditing, StrikethroughUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Strikethrough';\n }\n}\n","/**\r\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\r\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\r\n */\r\n/**\r\n * @module style/style\r\n */\r\nimport { Plugin } from 'ckeditor5/src/core';\r\nimport StyleUI from './styleui';\r\nimport StyleEditing from './styleediting';\r\n/**\r\n * The style plugin.\r\n *\r\n * This is a \"glue\" plugin that loads the {@link module:style/styleediting~StyleEditing style editing feature}\r\n * and {@link module:style/styleui~StyleUI style UI feature}.\r\n */\r\nexport default class Style extends Plugin {\r\n /**\r\n * @inheritDoc\r\n */\r\n static get pluginName() {\r\n return 'Style';\r\n }\r\n /**\r\n * @inheritDoc\r\n */\r\n static get requires() {\r\n return [StyleEditing, StyleUI];\r\n }\r\n}\r\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/subscript\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport SubscriptEditing from './subscript/subscriptediting';\nimport SubscriptUI from './subscript/subscriptui';\n/**\n * The subscript feature.\n *\n * It loads the {@link module:basic-styles/subscript/subscriptediting~SubscriptEditing} and\n * {@link module:basic-styles/subscript/subscriptui~SubscriptUI} plugins.\n */\nexport default class Subscript extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [SubscriptEditing, SubscriptUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Subscript';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/superscript\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport SuperscriptEditing from './superscript/superscriptediting';\nimport SuperscriptUI from './superscript/superscriptui';\n/**\n * The superscript feature.\n *\n * It loads the {@link module:basic-styles/superscript/superscriptediting~SuperscriptEditing} and\n * {@link module:basic-styles/superscript/superscriptui~SuperscriptUI} plugins.\n */\nexport default class Superscript extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [SuperscriptEditing, SuperscriptUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Superscript';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/table\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Widget } from 'ckeditor5/src/widget';\nimport TableEditing from './tableediting';\nimport TableUI from './tableui';\nimport TableSelection from './tableselection';\nimport TableClipboard from './tableclipboard';\nimport TableKeyboard from './tablekeyboard';\nimport TableMouse from './tablemouse';\nimport '../theme/table.css';\n/**\n * The table plugin.\n *\n * For a detailed overview, check the {@glink features/tables/tables Table feature documentation}.\n *\n * This is a \"glue\" plugin that loads the following table features:\n *\n * * {@link module:table/tableediting~TableEditing editing feature},\n * * {@link module:table/tableselection~TableSelection selection feature},\n * * {@link module:table/tablekeyboard~TableKeyboard keyboard navigation feature},\n * * {@link module:table/tablemouse~TableMouse mouse selection feature},\n * * {@link module:table/tableclipboard~TableClipboard clipboard feature},\n * * {@link module:table/tableui~TableUI UI feature}.\n */\nexport default class Table extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TableEditing, TableUI, TableSelection, TableMouse, TableKeyboard, TableClipboard, Widget];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Table';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tablecaption\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport TableCaptionEditing from './tablecaption/tablecaptionediting';\nimport TableCaptionUI from './tablecaption/tablecaptionui';\nimport '../theme/tablecaption.css';\n/**\n * The table caption plugin.\n */\nexport default class TableCaption extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableCaption';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TableCaptionEditing, TableCaptionUI];\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tablecellproperties\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport TableCellPropertiesUI from './tablecellproperties/tablecellpropertiesui';\nimport TableCellPropertiesEditing from './tablecellproperties/tablecellpropertiesediting';\n/**\n * The table cell properties feature. Enables support for setting properties of table cells (size, border, background, etc.).\n *\n * Read more in the {@glink features/tables/tables-styling Table and cell styling tools} section.\n * See also the {@link module:table/tableproperties~TableProperties} plugin.\n *\n * This is a \"glue\" plugin that loads the\n * {@link module:table/tablecellproperties/tablecellpropertiesediting~TableCellPropertiesEditing table cell properties editing feature} and\n * the {@link module:table/tablecellproperties/tablecellpropertiesui~TableCellPropertiesUI table cell properties UI feature}.\n */\nexport default class TableCellProperties extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableCellProperties';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TableCellPropertiesEditing, TableCellPropertiesUI];\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tablecolumnresize\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport TableColumnResizeEditing from './tablecolumnresize/tablecolumnresizeediting';\nimport TableCellWidthEditing from './tablecellwidth/tablecellwidthediting';\nimport '../theme/tablecolumnresize.css';\n/**\n * The table column resize feature.\n *\n * It provides the possibility to set the width of each column in a table using a resize handler.\n */\nexport default class TableColumnResize extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TableColumnResizeEditing, TableCellWidthEditing];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableColumnResize';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tableproperties\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport TablePropertiesEditing from './tableproperties/tablepropertiesediting';\nimport TablePropertiesUI from './tableproperties/tablepropertiesui';\n/**\n * The table properties feature. Enables support for setting properties of tables (size, border, background, etc.).\n *\n * Read more in the {@glink features/tables/tables-styling Table and cell styling tools} section.\n * See also the {@link module:table/tablecellproperties~TableCellProperties} plugin.\n *\n * This is a \"glue\" plugin that loads the\n * {@link module:table/tableproperties/tablepropertiesediting~TablePropertiesEditing table properties editing feature} and\n * the {@link module:table/tableproperties/tablepropertiesui~TablePropertiesUI table properties UI feature}.\n */\nexport default class TableProperties extends Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableProperties';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TablePropertiesEditing, TablePropertiesUI];\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module table/tabletoolbar\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { WidgetToolbarRepository } from 'ckeditor5/src/widget';\nimport { getSelectedTableWidget, getTableWidgetAncestor } from './utils/ui/widget';\n/**\n * The table toolbar class. It creates toolbars for the table feature and its content (for now only for the table cell content).\n *\n * The table toolbar shows up when a table widget is selected. Its components (e.g. buttons) are created based on the\n * {@link module:table/tableconfig~TableConfig#tableToolbar `table.tableToolbar` configuration option}.\n *\n * Table content toolbar shows up when the selection is inside the content of a table. It creates its component based on the\n * {@link module:table/tableconfig~TableConfig#contentToolbar `table.contentToolbar` configuration option}.\n */\nexport default class TableToolbar extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [WidgetToolbarRepository];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TableToolbar';\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n const editor = this.editor;\n const t = editor.t;\n const widgetToolbarRepository = editor.plugins.get(WidgetToolbarRepository);\n const tableContentToolbarItems = editor.config.get('table.contentToolbar');\n const tableToolbarItems = editor.config.get('table.tableToolbar');\n if (tableContentToolbarItems) {\n widgetToolbarRepository.register('tableContent', {\n ariaLabel: t('Table toolbar'),\n items: tableContentToolbarItems,\n getRelatedElement: getTableWidgetAncestor\n });\n }\n if (tableToolbarItems) {\n widgetToolbarRepository.register('table', {\n ariaLabel: t('Table toolbar'),\n items: tableToolbarItems,\n getRelatedElement: getSelectedTableWidget\n });\n }\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module language/textpartlanguage\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport TextPartLanguageEditing from './textpartlanguageediting';\nimport TextPartLanguageUI from './textpartlanguageui';\n/**\n * The text part language feature.\n *\n * This feature allows setting a language of the document's text part to support\n * [WCAG 3.1.2 Language of Parts](https://www.w3.org/TR/UNDERSTANDING-WCAG20/meaning-other-lang-id.html) specification.\n *\n * To change the editor's UI language, refer to the {@glink features/ui-language Setting the UI language} guide.\n *\n * For more information about this feature, check the {@glink api/language package page} as well as the {@glink features/language\n * Text part language} feature guide.\n *\n * This is a \"glue\" plugin which loads the\n * {@link module:language/textpartlanguageediting~TextPartLanguageEditing text part language editing feature}\n * and the {@link module:language/textpartlanguageui~TextPartLanguageUI text part language UI feature}.\n */\nexport default class TextPartLanguage extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TextPartLanguageEditing, TextPartLanguageUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TextPartLanguage';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module list/todolist\n */\nimport TodoListEditing from './todolist/todolistediting';\nimport TodoListUI from './todolist/todolistui';\nimport { Plugin } from 'ckeditor5/src/core';\nimport '../theme/todolist.css';\n/**\n * The to-do list feature.\n *\n * This is a \"glue\" plugin that loads the {@link module:list/todolist/todolistediting~TodoListEditing to-do list editing feature}\n * and the {@link module:list/todolist/todolistui~TodoListUI to-do list UI feature}.\n */\nexport default class TodoList extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [TodoListEditing, TodoListUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'TodoList';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/underline\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport UnderlineEditing from './underline/underlineediting';\nimport UnderlineUI from './underline/underlineui';\n/**\n * The underline feature.\n *\n * For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide\n * and the {@glink api/basic-styles package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:basic-styles/underline/underlineediting~UnderlineEditing} and\n * {@link module:basic-styles/underline/underlineui~UnderlineUI} plugins.\n */\nexport default class Underline extends Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [UnderlineEditing, UnderlineUI];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Underline';\n }\n}\n","/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Template, View } from 'ckeditor5/src/ui';\nimport { env } from 'ckeditor5/src/utils';\nimport { modelElementToPlainText } from './utils';\nimport { throttle, isElement } from 'lodash-es';\n/**\n * The word count plugin.\n *\n * This plugin calculates all words and characters in all {@link module:engine/model/text~Text text nodes} available in the model.\n * It also provides an HTML element that updates its state whenever the editor content is changed.\n *\n * The model's data is first converted to plain text using {@link module:word-count/utils~modelElementToPlainText}.\n * The number of words and characters in your text are determined based on the created plain text. Please keep in mind\n * that every block in the editor is separated with a newline character, which is included in the calculation.\n *\n * Here are some examples of how the word and character calculations are made:\n *\n * ```html\n * <paragraph>foo</paragraph>\n * <paragraph>bar</paragraph>\n * // Words: 2, Characters: 7\n *\n * <paragraph><$text bold=\"true\">foo</$text>bar</paragraph>\n * // Words: 1, Characters: 6\n *\n * <paragraph>*&^%)</paragraph>\n * // Words: 0, Characters: 5\n *\n * <paragraph>foo(bar)</paragraph>\n * //Words: 1, Characters: 8\n *\n * <paragraph>12345</paragraph>\n * // Words: 1, Characters: 5\n * ```\n */\nexport default class WordCount extends Plugin {\n /**\n * @inheritDoc\n */\n constructor(editor) {\n super(editor);\n this.set('characters', 0);\n this.set('words', 0);\n // Don't wait for the #update event to set the value of the properties but obtain it right away.\n // This way, accessing the properties directly returns precise numbers, e.g. for validation, etc.\n // If not accessed directly, the properties will be refreshed upon #update anyway.\n Object.defineProperties(this, {\n characters: {\n get() {\n return (this.characters = this._getCharacters());\n }\n },\n words: {\n get() {\n return (this.words = this._getWords());\n }\n }\n });\n this.set('_wordsLabel', undefined);\n this.set('_charactersLabel', undefined);\n this._config = editor.config.get('wordCount') || {};\n this._outputView = undefined;\n this._wordsMatchRegExp = env.features.isRegExpUnicodePropertySupported ?\n // Usage of regular expression literal cause error during build (ckeditor/ckeditor5-dev#534).\n // Groups:\n // {L} - Any kind of letter from any language.\n // {N} - Any kind of numeric character in any script.\n new RegExp('([\\\\p{L}\\\\p{N}]+\\\\S?)+', 'gu') :\n /([a-zA-Z0-9À-ž]+\\S?)+/gu;\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'WordCount';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n editor.model.document.on('change:data', throttle(this._refreshStats.bind(this), 250));\n if (typeof this._config.onUpdate == 'function') {\n this.on('update', (evt, data) => {\n this._config.onUpdate(data);\n });\n }\n if (isElement(this._config.container)) {\n this._config.container.appendChild(this.wordCountContainer);\n }\n }\n /**\n * @inheritDoc\n */\n destroy() {\n if (this._outputView) {\n this._outputView.element.remove();\n this._outputView.destroy();\n }\n super.destroy();\n }\n /**\n * Creates a self-updating HTML element. Repeated executions return the same element.\n * The returned element has the following HTML structure:\n *\n * ```html\n * <div class=\"ck ck-word-count\">\n * \t<div class=\"ck-word-count__words\">Words: 4</div>\n * \t<div class=\"ck-word-count__characters\">Characters: 28</div>\n * </div>\n * ```\n */\n get wordCountContainer() {\n const editor = this.editor;\n const t = editor.t;\n const displayWords = editor.config.get('wordCount.displayWords');\n const displayCharacters = editor.config.get('wordCount.displayCharacters');\n const bind = Template.bind(this, this);\n const children = [];\n if (!this._outputView) {\n this._outputView = new View();\n if (displayWords || displayWords === undefined) {\n this.bind('_wordsLabel').to(this, 'words', words => {\n return t('Words: %0', words);\n });\n children.push({\n tag: 'div',\n children: [\n {\n text: [bind.to('_wordsLabel')]\n }\n ],\n attributes: {\n class: 'ck-word-count__words'\n }\n });\n }\n if (displayCharacters || displayCharacters === undefined) {\n this.bind('_charactersLabel').to(this, 'characters', words => {\n return t('Characters: %0', words);\n });\n children.push({\n tag: 'div',\n children: [\n {\n text: [bind.to('_charactersLabel')]\n }\n ],\n attributes: {\n class: 'ck-word-count__characters'\n }\n });\n }\n this._outputView.setTemplate({\n tag: 'div',\n attributes: {\n class: [\n 'ck',\n 'ck-word-count'\n ]\n },\n children\n });\n this._outputView.render();\n }\n return this._outputView.element;\n }\n /**\n * Determines the number of characters in the current editor's model.\n */\n _getCharacters() {\n const txt = modelElementToPlainText(this.editor.model.document.getRoot());\n return txt.replace(/\\n/g, '').length;\n }\n /**\n * Determines the number of words in the current editor's model.\n */\n _getWords() {\n const txt = modelElementToPlainText(this.editor.model.document.getRoot());\n const detectedWords = txt.match(this._wordsMatchRegExp) || [];\n return detectedWords.length;\n }\n /**\n * Determines the number of words and characters in the current editor's model and assigns it to {@link #characters} and {@link #words}.\n * It also fires the {@link #event:update}.\n *\n * @fires update\n */\n _refreshStats() {\n const words = this.words = this._getWords();\n const characters = this.characters = this._getCharacters();\n this.fire('update', {\n words,\n characters\n });\n }\n}\n"],"names":["root","factory","exports","module","define","amd","self","cssKeywords","reverseKeywords","key","Object","keys","convert","rgb","channels","labels","hsl","hsv","hwb","cmyk","xyz","lab","lch","hex","keyword","ansi16","ansi256","hcg","apple","gray","model","Error","length","defineProperty","value","r","g","b","min","Math","max","delta","h","s","l","rdif","gdif","bdif","v","diff","diffc","c","w","k","reversed","currentClosestKeyword","currentClosestDistance","Infinity","distance","y","x","z","t2","t3","val","t1","i","smin","lmin","hi","floor","f","p","q","t","vmin","sl","wh","bl","ratio","n","m","y2","x2","z2","a","atan2","PI","sqrt","hr","cos","sin","args","saturation","round","ansi","color","mult","rem","string","toString","toUpperCase","substring","match","colorString","split","map","char","join","integer","parseInt","chroma","grayscale","hue","pure","mg","conversions","route","forEach","fromModel","routes","toModel","fn","wrappedFn","arg0","result","len","conversion","wrapRounded","raw","wrapRaw","deriveBFS","graph","models","parent","buildGraph","queue","current","pop","adjacents","adjacent","node","unshift","link","from","to","wrapConversion","path","cur","___CSS_LOADER_EXPORT___","push","id","cssWithMappingToString","list","this","item","content","concat","modules","mediaQuery","dedupe","alreadyImportedModules","_i","_slicedToArray","arr","Array","isArray","_arrayWithHoles","Symbol","iterator","_s","_e","_arr","_n","_d","call","next","done","err","_iterableToArrayLimit","o","minLen","_arrayLikeToArray","prototype","slice","constructor","name","test","_unsupportedIterableToArray","TypeError","_nonIterableRest","arr2","_item","cssMapping","btoa","base64","unescape","encodeURIComponent","JSON","stringify","data","sourceMapping","sourceURLs","sources","source","sourceRoot","memo","isOldIE","Boolean","window","document","all","atob","getTarget","target","styleTarget","querySelector","HTMLIFrameElement","contentDocument","head","e","stylesInDom","getIndexByIdentifier","identifier","modulesToDom","options","idCountMap","identifiers","base","count","index","obj","css","media","sourceMap","references","updater","addStyle","insertStyleElement","style","createElement","attributes","nonce","setAttribute","insert","appendChild","textStore","replaceText","replacement","filter","applyToSingletonTag","remove","styleSheet","cssText","cssNode","createTextNode","childNodes","removeChild","insertBefore","applyToTag","removeAttribute","firstChild","singleton","singletonCounter","update","styleIndex","bind","parentNode","removeStyleElement","newObj","lastIdentifiers","newList","newLastIdentifiers","_index","splice","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","__esModule","d","definition","enumerable","get","globalThis","Function","prop","hasOwnProperty","nc","emitter","activator","callback","contextElements","listenTo","evt","domEvt","composedPath","contextElementsList","contextElement","contains","includes","CssTransitionDisablerMixin","view","disableCssTransitions","_isCssTransitionsDisabled","enableCssTransitions","super","set","initializeCssTransitionDisablerMixin","extendTemplate","class","bindTemplate","if","submitHandler","element","preventDefault","fire","useCapture","addKeyboardHandlingForGrid","keystrokeHandler","focusTracker","gridItems","numberOfColumns","uiLanguageDirection","getNumberOfColumns","getGridItemFocuser","getIndexToFocus","focusedElement","find","focusedElementIndex","getIndex","nextIndexToFocus","focus","stopPropagation","getRightElementIndex","elementIndex","collectionLength","getLeftElementIndex","nextIndex","userAgent","navigator","toLowerCase","getUserAgent","isMac","isWindows","indexOf","isGecko","isSafari","isiOS","maxTouchPoints","isAndroid","isBlink","features","isRegExpUnicodePropertySupported","isSupported","search","RegExp","error","fastDiff","cmp","atomicChanges","arrayA","arrayB","changeIndexes","arr1","firstIndex","findFirstDifferenceIndex","lastIndexOld","lastIndexNew","oldArrayReversed","cutAndReverse","newArrayReversed","lastIndex","findChangeBoundaryIndexes","newLength","fill","changeIndexesToAtomicChanges","newArray","type","values","howMany","changeIndexesToChanges","reverse","aLength","bLength","_insert","_delete","tmp","es","fp","snake","y1","dir","spy","called","EventInfo","stop","off","HEX_NUMBERS","_","r1","random","r2","r3","r4","priority","normal","highest","high","low","lowest","insertToPriorityArray","objects","objectToInsert","DOCUMENTATION_URL","errorName","context","processedObjects","WeakSet","circularReferencesReplacer","has","add","stringifiedData","documentationLink","getLinkToDocumentationMessage","getErrorMessage","is","static","message","stack","logWarning","console","warn","formatConsoleArguments","documentationMessage","version","releaseDate","Date","windowOrGlobal","CKEDITOR_VERSION","_listeningTo","_emitterId","_delegations","defaultEmitterClass","EmitterMixin","on","event","once","wasFired","stopListening","emitterInfo","eventCallbacks","emitters","_getEmitterId","_setEmitterId","emitterId","callbacks","listener","_addEventListener","addEventListener","removeEventListener","eventOrInfo","eventInfo","getCallbacksForEvent","callbackArgs","apply","_removeEventListener","delegations","destinations","passAllDestinations","fireDelegatedEvents","return","rethrowUnexpectedError","delegate","events","nameOrFunction","Map","eventName","stopDelegating","delete","clear","getEvents","childEventName","newEventNodes","childEvents","substr","lastIndexOf","createEventNamespace","lists","getCallbacksListsForNamespace","callbackDefinition","_events","eventNode","callbacksLists","childCallbacksLists","fireArgs","delegatedInfo","observablePropertiesSymbol","boundObservablesSymbol","boundPropertiesSymbol","decoratedMethods","decoratedOriginal","defaultObservableClass","ObservableMixin","property","initObservable","properties","configurable","oldValue","newValue","bindProperties","isStringArray","Set","size","boundProperties","propertyName","bindings","binding","bindTo","toMany","bindToMany","_observable","_bindProperties","_to","_bindings","unbind","unbindProperties","boundObservables","toObservable","toProperty","toProperties","toPropertyBindings","boundObservable","decorate","methodName","originalMethod","object","observable","parsedArgs","parsed","lastObservable","parseBindToArgs","bindingsKeys","numberOfBindings","updateBoundObservableProperty","chain","toPropertyName","bindingsToObservable","updateBoundObservables","updateBindToBound","observables","attribute","observableAndAttributePairs","getBindingTargets","every","propertyValue","ElementReplacer","_replacedElements","replace","newElement","display","nextSibling","restore","iterable","compareArrays","isIterable","global","freeSelf","objectProto","nativeObjectToString","symToStringTag","toStringTag","isOwn","tag","unmasked","doc","children","namespace","xmlns","createElementNS","child","func","transform","arg","getPrototypeOf","funcProto","funcToString","objectCtorString","proto","Ctor","__data__","other","array","ListCache","entries","entry","maskSrcKey","uid","exec","IE_PROTO","reIsHostCtor","reIsNative","Hash","MapCache","pairs","LARGE_ARRAY_SIZE","Stack","iteratee","objValue","props","customizer","isNew","propertyIsEnumerable","arguments","freeExports","nodeType","freeModule","Buffer","isBuffer","reIsUint","typedArrayTags","freeProcess","process","types","require","nodeIsTypedArray","isTypedArray","inherited","isArr","isArg","isBuff","isType","skipIndexes","String","isProto","allocUnsafe","buffer","isDeep","copy","predicate","resIndex","nativeGetSymbols","getOwnPropertySymbols","symbol","offset","keysFunc","symbolsFunc","promiseTag","dataViewCtorString","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","getTag","ArrayBuffer","resolve","ctorString","input","Uint8Array","arrayBuffer","byteLength","dataView","byteOffset","reFlags","regexp","symbolProto","symbolValueOf","valueOf","typedArray","objectCreate","create","nodeIsMap","isMap","nodeIsSet","isSet","cloneableTags","baseClone","bitmask","isFlat","isFull","isFunc","stacked","subValue","Config","configurations","defaultConfigurations","_config","cloneConfig","_setObjectToTarget","_setToTarget","_getFromSource","isDefine","parts","part","configuration","leaveDOMReferences","isNode","defaultView","Document","ownerDocument","Node","isWindow","stringifiedObject","proxyOptions","capture","passive","usePassive","proxyEmitter","_getProxyEmitter","ProxyEmitter","proxyEmitters","_getAllProxyEmitters","proxy","listeningEmitter","listenedToEmitterId","listeningTo","_getEmitterListenedTo","getProxyEmitterId","_domNode","_options","attach","_domListeners","domListener","_createDomListener","detach","removeListener","getNodeUID","option","sort","globalVar","getAncestors","nodes","currentNode","DOCUMENT_NODE","isText","isRange","getBorderWidths","getComputedStyle","top","borderTopWidth","right","borderRightWidth","bottom","borderBottomWidth","left","borderLeftWidth","rectProperties","isSourceRange","_source","writable","isDomElement","rangeRects","getDomRangeRects","copyRectProperties","getBoundingRect","getBoundingClientRect","innerWidth","innerHeight","width","height","clone","moveTo","moveBy","getIntersection","anotherRect","rect","getIntersectionArea","getArea","getVisible","visibleRect","isBody","commonAncestorContainer","parentRect","intersectionRect","isEqual","intersectRect","excludeScrollbarsAndBorders","scrollBarWidth","scrollBarHeight","direction","documentElement","clientWidth","clientHeight","borderWidths","offsetWidth","offsetHeight","range","rects","clientRects","getClientRects","startContainer","boundingRectData","Number","POSITIVE_INFINITY","NEGATIVE_INFINITY","rectangleCount","body","_observerInstance","_createObserver","_element","_callback","_addElementCallback","observe","destroy","_deleteElementCallback","_elementCallbacks","_getElementCallbacks","unobserve","ResizeObserver","setDataInElement","el","HTMLTextAreaElement","innerHTML","toUnit","unit","previousSibling","insertAt","parentElement","nodeToInsert","isComment","COMMENT_NODE","isValidAttributeName","createAttribute","isVisible","positions","limiter","fitInViewport","viewportOffsetConfig","positionedElementAncestor","offsetParent","getPositionedAncestor","elementRect","targetRect","bestPosition","viewportRect","assign","getConstrainedViewportRect","positionOptions","limiterRect","elementRectArea","positionInstances","positioningFunction","PositionObject","position","maxFitFactor","limiterIntersectionArea","viewportIntersectionArea","fitFactor","getBestPosition","getRectForAbsolutePositioning","scrollX","scrollY","positioningFunctionOutput","config","_positioningFunctionCorrdinates","_absoluteRect","_rect","limiterViewportIntersectRect","_cachedRect","_cachedAbsoluteRect","ancestorPosition","ancestorBorderWidths","moveX","moveY","scrollLeft","scrollTop","shiftRectToCompensatePositionedAncestor","scrollViewportToShowTarget","viewportOffset","ancestorOffset","alignToTop","forceScroll","targetWindow","getWindow","currentWindow","currentFrame","firstAncestorToScroll","getParentElement","scrollAncestorsToShowRect","getRect","getRectRelativeToWindow","scrollWindowToShowRect","frameElement","targetShiftedDownRect","targetShiftedUpRect","forceScrollToTop","allRectsFitInViewport","initialScrollX","initialScrollY","isAbove","isBelow","isLeftOf","isRightOf","scrollTo","parentWindow","targetFitsInTarget","firstRect","secondRect","elementOrRange","relativeWindow","frame","frameRect","modifiersToGlyphsMac","ctrl","cmd","alt","shift","modifiersToGlyphsNonMac","keyCodes","arrowleft","arrowup","arrowright","arrowdown","backspace","enter","space","esc","tab","code","fromCharCode","charCodeAt","generateKnownKeyCodes","keyCodeNames","fromEntries","charAt","getCode","keyCode","altKey","ctrlKey","shiftKey","metaKey","parseKeystroke","keystroke","trim","splitKeystrokeText","endsWith","getEnvKeyCode","reduce","sum","getEnvKeystrokeText","keystrokeCode","modifiers","glyph","getLocalizedArrowKeyCodeDirection","contentLanguageDirection","isLtrContent","RTL_LANGUAGE_CODES","getLanguageDirection","languageCode","toArray","_translate","language","quantity","numberOfLanguages","CKEDITOR_TRANSLATIONS","messageId","dictionary","hasTranslation","plural","getPluralForm","translation","Locale","uiLanguage","contentLanguage","_t","interpolateString","Collection","initialItemsOrOptions","hasInitialItems","_items","_itemMap","_idProperty","idProperty","_bindToExternalToInternalMap","WeakMap","_bindToInternalToExternalMap","_skippedIndexesFromExternal","_getItemIdBeforeAdding","first","last","addMany","items","itemId","currentItemIndex","added","removed","idOrIndex","itemOrId","subject","_remove","ctx","_bindToCollection","removedItems","externalCollection","as","Class","_setUpBindToBinding","using","callbackOrProperty","addItem","externalItem","isExternalBoundToThis","externalItemBound","finalIndex","skipped","itemDoesNotExist","iteratorItem","_elements","_nextEventLoopTimeout","_focus","_blur","clearTimeout","isFocused","setTimeout","KeystrokeHandler","_listener","keyEvtData","press","toMap","objectToMap","wait","timer","delayed","cancel","isInsideSurrogatePair","character","isLowSurrogateHalf","isInsideCombinedSymbol","EMOJI_PATTERN","flagSequence","emoji","buildEmojiRegexp","isInsideEmojiSequence","matches","matchAll","some","ViewCollection","initialItems","_renderViewIntoCollectionParent","_parentElement","setParent","elementOrDocFragment","dest","evtName","isRendered","render","locals","locale","_viewCollections","_unboundChildren","createCollection","collection","_bindTemplate","Template","views","registerChild","deregisterChild","setTemplate","template","extend","getViews","_revertData","revert","def","normalize","_isRendered","_renderNode","intoFragment","isApplying","revertData","_revertTemplateFromNode","isView","isTemplate","eventNameOrFunctionOrAttribute","TemplateToBinding","eventNameOrFunction","valueIfTrue","TemplateIfBinding","isInvalid","text","_renderText","_renderElement","ns","_renderAttributes","_renderElementChildren","_setUpListeners","textContent","hasTemplateBinding","_bindToObservable","schema","getTextUpdater","attrName","domAttrValue","getAttribute","attrValue","attrNs","isNamespaced","valueToBind","shouldExtend","getAttributeUpdater","_renderStyleAttribute","prev","arrayValueReducer","isFalsy","setAttributeNS","styles","styleName","styleValue","getStyleUpdater","container","createDocumentFragment","childIndex","isViewCollection","childRevertData","eventListeners","revertBindings","schemaItem","domEvtName","domSelector","activateDomEventListener","syncValueSchemaValue","templateBinding","activateAttributeListener","revertBinding","TemplateBinding","getValue","getValueSchemaValue","removeAttributeNS","normalizePlainTextDefinition","normalizeTextDefinition","listeners","arrayify","normalizeListeners","normalizeAttributes","extendObjectValueArray","ext","childDef","BodyCollection","attachToDom","_bodyCollectionContainer","wrapper","detachFromDom","childElementCount","IconView","viewBox","_updateXMLContent","_colorFillPaths","svg","DOMParser","parseFromString","presentationalAttributeNames","fillColor","querySelectorAll","_focusDelayed","ariaLabelUid","labelView","_createLabelView","iconView","keystrokeView","_createKeystrokeView","_getTooltipString","role","tabindex","isToggleable","click","isEnabled","mousedown","mouseup","icon","withKeystroke","ariaLabelledBy","tooltip","label","SwitchButtonView","toggleSwitchView","_createToggleView","getLocalizedColorOptions","localizedColorNames","Black","Grey","White","Red","Orange","Yellow","Green","Aquamarine","Turquoise","Blue","Purple","colorOption","normalizeColorOptions","normalizeSingleColorDefinition","hasBorder","ColorTileView","backgroundColor","ColorGridView","colorDefinitions","columns","viewStyleAttribute","gridTemplateColumns","keystrokes","colorTile","isOn","selectedColor","focusLast","cstr","alpha","isRGB","parseFloat","baseHues","isNaN","red","R","green","G","blue","B","H","S","lightness","L","brightness","opacity","orange","yellow","purple","convertColor","outputFormat","colorObject","parseColorString","parsedColor","toColorSpace","format","formatColorOutput","hexValue","startsWith","parsedHex","now","reWhitespace","reTrimStart","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","isBinary","nativeMax","nativeMin","lastArgs","lastThis","maxWait","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","invokeFunc","time","thisArg","shouldInvoke","timeSinceLastCall","timerExpired","trailingEdge","timeWaiting","remainingWait","debounced","isInvoking","leadingEdge","flush","LabelView","for","LabeledFieldView","viewCreator","viewUid","statusUid","fieldView","statusView","_createStatusView","fieldWrapperChildren","errorText","infoText","InputView","placeholder","readonly","inputmode","_updateIsEmpty","change","_setDomElementValue","select","isEmpty","InputTextView","InputNumberView","step","DropdownPanelView","selectstart","tagName","toLocaleLowerCase","childView","dropdownPanel","lastChild","DropdownView","buttonView","panelView","isOpen","panelPosition","_getOptimalPosition","_panelPositions","closeDropdown","south","north","southEast","southWest","northEast","northWest","southMiddleEast","southMiddleWest","northMiddleEast","northMiddleWest","defaultPanelPositions","buttonRect","panelRect","DropdownButtonView","arrowView","_createArrowView","FocusCycler","focusables","actions","isFocusable","_getFocusableItem","previous","viewIndex","focused","focusFirst","focusNext","focusPrevious","ToolbarSeparatorView","ToolbarLineBreakView","removeItems","editor","_disableStack","forceDisabled","forceDisable","clearForceDisabled","isContextPlugin","Command","_affectsData","_isEnabledBasedOnSelection","refresh","affectsData","isReadOnly","canEditAt","selection","execute","MultiCommand","_childCommandsDefinitions","command","_getFirstEnabledCommand","registerChildCommand","_checkEnabled","commandDefinition","PluginCollection","availablePlugins","contextPlugins","_plugins","_context","_availablePlugins","PluginConstructor","pluginName","_contextPlugins","pluginInstance","plugin","init","plugins","pluginsToRemove","pluginsSubstitutions","that","findAvailablePluginConstructors","processed","isPluginConstructor","requires","validatePlugins","pluginConstructors","getPluginConstructors","isPluginRemoved","pluginItem","pluginToReplace","indexInPluginConstructors","substitutePlugins","pluginInstances","_add","loadPlugins","initPlugins","then","removedPlugin","getPluginName","parentPluginConstructor","missingPlugin","requiredBy","checkMissingPlugin","checkContextPlugin","checkRemovedPlugin","method","promise","Promise","promises","plugin1","plugin2","Context","_contextOwner","defaultConfig","builtinPlugins","languageConfig","ui","editors","Plugin","_addEditor","isContextOwner","_removeEditor","_getEditorConfig","names","ContextPlugin","documentPlaceholders","enablePlaceholder","isDirectHost","keepOnFocus","registerPostFixer","writer","updateDocumentPlaceholders","hostElement","hidePlaceholder","hasClass","removeClass","placeholders","directHostElements","wasViewModified","updatePlaceholder","getChildPlaceholderHostSubstitute","childCount","isAttached","hasContent","getChildren","selectionAnchor","anchor","isComposing","needsPlaceholder","addClass","showPlaceholder","getChild","TypeCheckable","pos","getChildIndex","getPath","ancestors","includeSelf","parentFirst","getCommonAncestor","ancestorsA","ancestorsB","isBefore","thisPath","nodePath","isAfter","_removeChildren","_fireChange","toJSON","json","_textData","_data","isSimilar","otherNode","_clone","TextProxy","textNode","offsetInText","offsetSize","isPartial","Matcher","pattern","_patterns","singleElement","isElementMatching","results","getElementName","matchName","patterns","attributeKeys","getAttributeKeys","matchPatterns","matchAttributes","classes","getClassNames","matchClasses","getStyleNames","getStyle","matchStyles","valueGetter","normalizedPatterns","normalizePatterns","normalizedItems","patternKey","patternValue","itemKey","isKeyMatched","itemValue","isValueMatched","reIsDeepProp","reIsPlainProp","memoize","resolver","memoized","cache","Cache","rePropName","reEscapeChar","stringToPath","number","quote","subString","symbolToString","baseToString","start","end","defaultValue","fromRight","srcIndex","mergeFunc","srcValue","isCommon","isTyped","baseMerge","otherArgs","nativeNow","lastCalled","stamp","remaining","assigner","guard","nested","StylesMap","styleProcessor","_styles","_styleProcessor","setTo","inlineStyle","parsedStyles","stylesString","quoteType","propertyNameStart","propertyValueStart","stylesMap","parseInlineStyles","toNormalizedForm","propertyDescriptor","getReducedForm","nameOrObject","valueOrObject","toPath","_cleanEmptyObjectsOnPath","getNormalized","_getStylesEntries","getAsString","expand","pathParts","parentPath","parentObject","StylesProcessor","_normalizers","_extractors","_reducers","_consumables","appendStyleValue","normalizer","extractor","normalizedValue","reducer","expandedStyleNames","styleNamesKeysSet","getRelatedStyles","setNormalizer","setExtractor","callbackOrPath","setReducer","setStyleRelation","shorthandName","styleNames","_mapStyleNames","alsoName","stylesObject","nameOrPath","valueToSet","Element","attrs","_unsafeAttributesToRender","_customProperties","_attrs","attrsMap","parseAttributes","_children","_insertChild","_classes","classString","parseClasses","stylesProcessor","hasAttribute","otherElement","className","getNormalizedStyle","hasStyle","findAncestor","matcher","getCustomProperty","getIdentity","shouldRenderUnsafeAttribute","attributeName","deep","childrenClone","cloned","getFillerOffset","_appendChild","_setAttribute","stringValue","_removeAttribute","_addClass","_removeClass","_setStyle","_removeStyle","_setCustomProperty","_removeCustomProperty","classesSet","classesString","classArray","ContainerElement","EditableElement","editableElement","rootNameSymbol","RootEditableElement","rootName","_name","TreeWalker","boundaries","startPosition","_position","Position","_createAt","singleCharacters","shallow","ignoreElementEnd","_boundaryStartParent","_boundaryEndParent","skip","nextResult","prevPosition","_next","_previous","previousPosition","isAtEnd","_createAfter","_formatReturnValue","charactersCount","textLength","textProxy","isAtStart","_createBefore","startOffset","nextPosition","nodeAfter","nodeBefore","endOffset","editable","getShiftedBy","shifted","getLastMatchingPosition","treeWalker","otherPosition","compareWith","otherPath","getWalker","itemOrPosition","Range","isCollapsed","getEnlarged","enlargeTrimSkip","getTrimmed","nodeAfterStart","nodeBeforeEnd","otherRange","containsPosition","containsRange","loose","containsStart","containsEnd","getDifference","ranges","isIntersecting","commonRangeStart","commonRangeEnd","getContainedElement","startElement","endElement","_createFromParentsAndOffsets","_createFromPositionAndShift","Selection","_ranges","_lastRangeBackward","_isFake","_fakeSelectionLabel","isFake","fakeSelectionLabel","rangeCount","isBackward","getFirstRange","getLastRange","getFirstPosition","firstRange","getLastPosition","lastRange","otherSelection","thisRange","found","numOfRangesA","getRanges","rangeA","rangeB","getSelectedElement","selectable","placeOrOffset","_setRanges","_setFakeOptions","DocumentSelection","fake","backward","_createIn","_createOn","setFocus","newFocus","_addRange","newRanges","isLastBackward","_pushRange","storedRange","addedRange","intersectingRange","_selection","_setTo","_setFocus","BubblingEventInfo","startRange","_eventPhase","_currentTarget","eventPhase","currentTarget","contextsSymbol","BubblingEmitterMixin","eventArgs","eventContexts","getBubblingContexts","updateEventInfo","fireListenerFor","selectedElement","isCustomContext","getCustomContext","startParent","endParent","startPath","endPath","getDeeperRangeParent","contexts","mixin","_postFixers","roots","getRoot","postFixer","_callPostFixers","wasFixed","AttributeElement","_priority","_id","_clonesGroup","getElementsWithSameId","nonUiChildrenCount","DEFAULT_PRIORITY","EmptyElement","UIElement","domDocument","domConverter","toDomElement","domElement","injectUiElementHandling","domSelection","domTarget","getSelection","domSelectionCollapsed","getRangeAt","collapsed","domParent","focusNode","domOffset","focusOffset","viewPosition","domPositionToView","jumpedOverAnyUiElement","nextViewPosition","newDomPosition","viewPositionToDom","collapse","jumpOverUiElement","RawElement","DocumentFragment","DowncastWriter","_cloneGroups","_slotFactory","setSelection","setSelectionFocus","createText","createAttributeElement","attributeElement","renderUnsafeAttributes","createContainerElement","childrenOrOptions","containerElement","createEditableElement","createEmptyElement","emptyElement","createUIElement","renderFunction","uiElement","createRawElement","rawElement","setStyle","removeStyle","setCustomProperty","removeCustomProperty","breakAttributes","positionOrRange","_breakAttributes","_breakAttributesRange","breakContainer","sourceRange","targetPosition","move","mergeAttributes","positionOffset","positionParent","_removeFromClonedElementsGroup","mergeTextNodes","mergeContainers","newPosition","validateNodesToInsert","nodeGroups","groups","lastGroup","_insertNodes","rangeOrItem","validateRangeContainer","breakStart","breakEnd","parentContainer","mergePosition","walker","rangeToRemove","ancestor","countBefore","wrap","_wrapPosition","viewSelection","_wrapRange","unwrap","newRange","_unwrapChildren","rename","newName","viewElement","getAttributes","clearClonedElementsGroup","groupName","createPositionAt","createPositionAfter","createPositionBefore","createRange","createRangeOn","createRangeIn","createSelection","createSlot","modeOrFilter","_registerSlotFactory","slotFactory","_clearSlotFactory","insertionPosition","getParentContainer","breakTextNode","_addToClonedElementsGroup","endPosition","_wrapChildren","wrapElement","wrapPositions","isAttribute","_wrapAttributeElement","shouldABeOutsideB","newAttribute","offsetChange","unwrapElement","unwrapPositions","unwrapped","_unwrapAttributeElement","movePositionToTextNode","fakeElement","wrapRange","toWrap","canBeJoined","toUnwrap","forceSplitText","rangeStart","rangeEnd","isContainerOrFragment","offsetAfter","clonedNode","nodesToMove","group","textToMove","nodeBeforeLength","validNodesToInsert","errorContext","validNode","endContainer","NBSP_FILLER","MARKED_NBSP_FILLER","span","dataset","ckeFiller","innerText","BR_FILLER","fillerBr","INLINE_FILLER_LENGTH","INLINE_FILLER","repeat","startsWithFiller","domNode","isInlineFiller","domText","getDataWithoutFiller","jumpOverInlineFiller","Renderer","domDocuments","markedAttributes","markedChildren","markedTexts","_inlineFiller","_fakeSelectionContainer","isSelecting","markToSync","mapViewToDom","inlineFillerPosition","isInlineFillerRenderingPossible","_updateChildrenMappings","_isSelectionInInlineFiller","_removeInlineFiller","_getInlineFillerPosition","_needsInlineFillerAtSelection","_updateAttrs","_updateChildren","_updateText","fillerDomPosition","addInlineFiller","_updateFocus","_updateSelection","actualDomChildren","expectedDomChildren","viewChildrenToDom","withChildren","_diffNodeLists","_findUpdateActions","areSimilarElements","counter","equal","action","insertIndex","deleteIndex","viewChild","_updateElementMappings","unbindDomElement","bindElements","firstPos","selectionPosition","domFillerNode","selectionParent","selectionOffset","isEditable","viewText","findCorrespondingDomText","expectedText","viewToDom","filler","updateTextNode","domAttrKeys","attr","viewAttrKeys","setDomElementAttribute","removeDomElementAttribute","previousDomNode","areTextNodes","nodesToUnbind","_markDescendantTextToSync","domToView","domChildList","fakeSelectionContainer","childList","filterOutFakeSelectionContainer","sameNodes","actualDom","expectedDom","comparator","newActions","actualSlice","expectedSlice","viewNode","_removeDomSelection","_removeFakeSelection","domRoot","_updateFakeSelection","isConnected","_updateDomSelection","createFakeSelectionContainer","bindFakeSelection","_fakeSelectionNeedsUpdate","domRange","removeAllRanges","selectNodeContents","addRange","_domSelectionNeedsUpdate","ELEMENT_NODE","childAtOffset","fixGeckoSelectionAfterBr","isDomSelectionCorrect","oldViewSelection","domSelectionToView","anchorNode","activeDomElement","activeElement","mapDomToView","domParentOrArray","nodeAfterFiller","fillerNode","node1","node2","actualDomChild","expectedDomChild","isBlockFiller","actualText","insertData","deleteData","BR_FILLER_REF","NBSP_FILLER_REF","MARKED_NBSP_FILLER_REF","UNSAFE_ATTRIBUTE_NAME_PREFIX","UNSAFE_ELEMENT_REPLACEMENT_ATTRIBUTE","DomConverter","blockFillerMode","renderingMode","_domToViewMapping","_viewToDomMapping","_fakeSelectionMapping","_rawContentElementMatcher","_encounteredRawContentDomNodes","preElements","blockElements","inlineObjectElements","unsafeElements","_domDocument","implementation","createHTMLDocument","viewDocumentSelection","fakeSelectionToView","bindDocumentFragments","domFragment","viewFragment","shouldRenderAttribute","attributeKey","attributeValue","elementName","setContentOf","html","fragment","bodyChildNodes","createTreeWalker","NodeFilter","SHOW_ELEMENT","nextNode","getAttributeNames","_shouldRenameElement","_logUnsafeElement","replaceWith","_createReplacementDomElement","append","textData","_processDataFromViewText","createComment","relatedViewElement","fillerPositionOffset","_getBlockFiller","transparentRendering","viewRangeToDom","viewRange","domStart","domEnd","setStart","setEnd","viewParent","domBefore","domAfter","getHostViewElement","skipComments","_processDataFromDomText","isDocumentFragment","_createViewElement","_isViewElementWithRawContent","rawContent","domChildrenToView","domChild","isDomSelectionBackward","viewRanges","domRangeToView","viewStart","viewEnd","findCorrespondingViewText","viewBefore","domElementOrDocumentFragment","isElement","documentFragmentOrElement","viewEditable","domEditable","scrollPositions","forEachDomElementAncestor","DOCUMENT_FRAGMENT_NODE","isEqualNode","hasBlockParent","isNBSP","isNbspBlockFiller","anchorOffset","_isDomSelectionPositionCorrect","registerRawContentMatcher","prevNode","_getTouchingInlineViewNode","_nodeEndsWithSpace","nextStartsWithSpace","parents","_hasDomParentOfType","_getTouchingInlineDomNode","shouldLeftTrim","_checkShouldLeftTrimDomText","shouldRightTrim","_checkShouldRightTrimDomText","Text","isNextNodeInlineObjectElement","isNextNodeStartingWithSpace","getNext","stepInto","stepOver","skipChildren","returnNode","_isBlockElement","_isInlineObjectElement","viewName","keepOriginalCase","originalDomElement","newDomElement","Observer","_isEnabled","enable","disable","checkShouldIgnoreEventFromTarget","DomEventData","domEvent","additionalData","DomEventObserver","domEventType","onDomEvent","stopObserving","eventType","KeyObserver","FakeSelectionObserver","_fireSelectionChangeDoneDebounced","_handleSelectionMove","newSelection","oldSelection","SetCache","equalFunc","arrLength","othLength","arrStacked","othStacked","seen","arrValue","othValue","compared","othIndex","objProps","objLength","objStacked","skipCtor","objCtor","othCtor","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","baseIsEqual","MutationObserver","characterData","subtree","renderer","_renderer","_domElements","_mutationObserver","_onMutations","takeRecords","disconnect","domMutations","mutatedTextNodes","elementsWithMutatedChildren","mutation","_isBogusBrMutation","hasMutations","viewChildren","newViewChildren","forceRender","addedNode","removedNodes","addedNodes","child1","child2","FocusObserver","_isFocusChanging","_renderTimeoutId","selectedEditable","SelectionObserver","mutationObserver","getObserver","focusObserver","_documents","_clearInfiniteLoopInterval","setInterval","_clearInfiniteLoop","_documentIsSelectingInactivityTimeoutDebounced","_loopbackCounter","endDocumentIsSelecting","_handleSelectionChange","clearInterval","_reportInfiniteLoop","newViewSelection","hasDomSelection","CompositionObserver","DataTransfer","nativeDataTransfer","_files","cacheFiles","getFiles","_native","files","getData","setData","effectAllowed","dropEffect","setDragImage","image","isCanceled","mozUserCancelled","kind","getAsFile","InputObserver","domTargetRanges","getTargetRanges","viewDocument","dataTransfer","targetRanges","inputType","partTargetRanges","dataPart","ArrowKeysObserver","TabObserver","domRoots","_initialDomRootAttributes","_observers","_ongoingChange","_postFixersInProgress","_renderingDisabled","_hasChangedSinceTheLastRendering","_writer","addObserver","_render","attachDomRoot","viewRoot","initialDomRootAttributes","updateContenteditableAttribute","observer","detachDomRoot","getDomRoot","ObserverConstructor","disableObservers","enableObservers","scrollToTheSelection","isRenderingInProgress","callbackResult","_disableRendering","flag","getChildStartOffset","_deep","_setAttributesTo","_clearAttributes","NodeList","_nodes","maxOffset","getNode","getNodeIndex","getNodeStartOffset","indexToOffset","offsetToIndex","totalOffset","nodeList","newTarget","spliceArray","_removeNodes","indexStart","getNodeByPath","relativePath","parentName","fromJSON","stickiness","_visitedParent","prevVisitedParent","textNodeAtPosition","getTextNodeAtPosition","getNodeAfterPosition","formatReturnValue","offsetInTextNode","getNodeBeforePosition","newOffset","getParentPath","getCommonPath","diffAt","isTouching","commonLevel","level","checkTouchingBranch","checkOnlyZeroes","hasSameParentAs","getTransformedByOperation","operation","_getTransformedByInsertOperation","_getTransformedByMoveOperation","_getTransformedBySplitOperation","_getTransformedByMergeOperation","_getTransformedByInsertion","_getTransformedByMove","sourcePosition","movedRange","_getCombined","splitPosition","moveTargetPosition","graveyardPosition","_getTransformedByDeletion","deletionPosition","deletePosition","transformed","insertPosition","combined","graveyard","idx","checkOnlyMaxOffset","containsItem","getJoined","shouldJoin","getMinimalFlatRanges","posParent","getTransformedByOperations","operations","j","spread","newPos","moveRange","differenceSet","difference","common","transformedCommon","newStart","newEnd","ref","refIndex","Mapper","_modelToViewMapping","_viewToModelMapping","_viewToModelLengthCallbacks","_markerNameToElements","_elementToMarkerNames","_deferredBindingRemovals","_unboundMarkerNames","viewContainer","modelPosition","findPositionIn","viewBlock","findMappedViewAncestor","modelParent","modelOffset","_toModelOffset","modelElement","unbindViewElement","toModelElement","markerName","defer","unbindModelElement","toViewElement","bindElementToMarker","elements","unbindElementFromMarkerName","nameToElements","elementToNames","flushUnboundMarkerNames","markerNames","flushDeferredBindings","clearBindings","toModelRange","toModelPosition","toViewRange","modelRange","toViewPosition","mapper","isPhantom","markerNameToElements","boundElements","registerViewToModelLength","viewElementName","lengthCallback","viewOffset","getModelLength","expectedOffset","lastLength","_moveViewPositionToTextNode","ModelConsumable","_consumable","_textProxyRegistry","_normalizeConsumableType","_getSymbolForTextProxy","consume","itemConsumables","verifyAllConsumed","eventGroup","consumables","canConsume","eventPrefix","description","startMap","endMap","_addSymbolForTextProxy","DowncastDispatcher","conversionApi","_conversionApi","dispatcher","_firedEventsMap","convertChanges","differ","markers","_createConversionApi","getRefreshedItems","getMarkersToRemove","_convertMarkerRemove","changes","_reduceChanges","getChanges","_convertInsert","_convertReinsert","_convertRemove","_convertAttribute","attributeOldValue","attributeNewValue","markerRange","getRange","_convertMarkerAdd","getMarkersToAdd","consumable","convertSelection","markersAtSelection","getMarkersAtPosition","_addConsumablesForSelection","marker","shouldMarkerChangeBeConverted","doNotAddConsumables","_addConsumablesForInsert","walkerValueToEventData","_testAndFire","_addConsumablesForRange","walkerValues","reconversion","getItems","getEventName","eventsFiredForConversion","eventsFiredForItem","_testAndFireAddAttributes","refreshedItems","convertItem","convertChildren","convertAttributes","canReuseView","anyNewRange","oldRange","_replaceAllRanges","directChange","_popRange","visited","startBlock","getParentBlock","isStartBlockSelected","block","isUnvisitedTopBlock","endBlock","isEndBlockSelected","containsEntireContent","limitStartPosition","limitEndPosition","_checkRange","_removeAllRanges","isUnvisitedBlock","isBlock","isTopBlockInRange","hasParentLimit","isLimit","parentBlock","findAncestorBlock","bindWithDocument","toRange","isDocumentOperation","_createFromRanges","boundariesChanged","contentChanged","doesOperationChangeRangeContent","storePrefix","LiveSelection","hasOwnRange","isGravityOverridden","getSelectedBlocks","updateMarkers","_updateAttributes","observeMarkers","prefixOrName","_getStoredAttributes","getStoredAttributes","_overrideGravity","overrideGravity","_restoreGravity","restoreGravity","_attributePriority","_selectionRestorePosition","_hasChangedRange","_overriddenGravityRegister","_observedMarkers","_model","_document","_fixGraveyardSelection","_validateSelectionRanges","_updateMarker","batch","changeParent","enqueueChange","storedAttributes","clearAttributesStoredInElement","_getDefaultRange","overrideUid","liveRange","_prepareRange","_validateSelectionRange","fromRange","changed","markerGroup","selectionRange","oldMarkers","hasMarker","contained","clearAll","newAttributes","_getSurroundingAttributes","oldAttributes","newKey","oldKey","realKey","getAttrsIfCharacter","isInline","isObject","getNearestSelectionRange","ConversionHelpers","dispatchers","_dispatchers","conversionHelper","DowncastHelpers","elementToElement","normalizeModelElementConfig","normalizeToElementConfig","elementCreator","consumer","defaultConsumer","preflight","reinsertOrConvertNodes","insertElement","createConsumer","converterPriority","createChangeReducer","downcastElementToElement","elementToStructure","checkChild","slotsMap","slot","createSlotFactory","childrenInSlots","flat","uniqueChildrenInSlots","validateSlotsChildren","toViewPositionMapping","currentSlot","currentSlotNodes","fillSlots","downcastElementToStructure","attributeToElement","modelValue","getFromAttributeCreator","oldViewElement","newViewElement","viewWriter","downcastAttributeToElement","attributeToAttribute","normalizeToAttributeConfig","attributeCreator","oldAttribute","downcastAttributeToAttribute","markerToElement","isOpening","viewStartElement","viewEndElement","downcastMarkerToElement","markerToHighlight","highlightDescriptor","descriptor","prepareDescriptor","createViewElementFromHighlightDescriptor","rangeAfterWrap","addHighlightCallback","highlightElement","viewHighlightElement","removeHighlightCallback","removeHighlight","downcastMarkerToHighlight","markerToData","viewMarkerData","handleMarkerBoundary","viewData","removeMarkerFromAttribute","removeMarkerData","downcastMarkerToData","isStart","elementAfter","elementBefore","insertMarkerAsAttribute","insertMarkerAsElement","viewElementType","modelData","viewElementDefinition","createViewElementFromDefinition","modelAttributeValue","shouldReplace","createChangeReducerCallback","reducedChanges","reconvertedElements","changeIndex","positionRelation","modelNodes","modelChildNode","reinsertNode","modelNode","viewChildNode","autoParagraphEmptyRoots","getRootNames","isParagraphable","nodeOrType","createContext","wrapInParagraph","paragraph","UpcastHelpers","upcastElementToElement","elementToAttribute","normalizeModelAttributeConfig","converter","prepareToAttributeConverter","getViewElementNameFromConfig","upcastElementToAttribute","viewKey","normalized","normalizeViewAttributeKeyValueConfig","upcastAttributeToAttribute","elementToMarker","normalizeElementToMarkerModelConfig","upcastElementToMarker","dataToMarker","normalizedConfig","converterStart","prepareToElementConverter","normalizeDataToMarkerConfig","converterEnd","basePriority","maxPriority","priorityFactor","addMarkerElements","markerViewNames","markerViewName","modelCursor","viewItem","upcastAttributeToMarker","upcastDataToMarker","viewConfig","matcherResult","getModelElement","safeInsert","updateConversionResult","viewAttributeKeyToCopy","defaultModelValue","configToTest","onlyViewNameIsDefined","modelKey","attributeWasSet","modelAttribute","checkAttribute","setAttributeOn","injectSelectionPostFixer","correctedRange","tryFixingRange","rangesToMerge","rangeIndexesToRemove","currentRangeIndex","currentRange","previousRanges","previousRangeIndex","previousRange","mergedRange","mergeIntersectingRanges","selectionPostFixer","originalPosition","nearestSelectionRange","ancestorObject","fixedPosition","tryFixingCollapsedRange","isTextAllowedOnStart","isTextAllowedOnEnd","startLimitElement","getLimitElement","endLimitElement","startIsOnBlock","endIsOnBlock","checkSelectionOnNonLimitElements","fixedStart","isSelectable","fixedEnd","isStartInLimit","isEndInLimit","bothInSameParent","expandStart","expandEnd","findOutermostLimitAncestor","tryFixingNonCollapsedRage","startingNode","isLimitNode","EditingController","downcastDispatcher","modelSelection","convertSelectionChange","modelEnd","brokenPosition","reconvertMarker","markerOrName","currentMarker","_refresh","reconvertItem","_refreshItem","ViewConsumable","elementConsumables","ViewElementConsumables","instance","consumablesFromElement","createFrom","CONSUMABLE_TYPES","_canConsumeName","_test","_consume","_revert","consumableName","toConsume","Schema","_sourceDefinitions","_attributeProperties","SchemaContext","getDefinition","register","itemName","_clearCache","getDefinitions","_compiledDefinitions","_compile","isRegistered","isContent","_checkContextMatch","allowAttributes","checkMerge","positionOrBaseElement","elementToMerge","addChildCheck","retValue","addAttributeCheck","setAttributeProperties","getAttributeProperties","selectionOrRangeOrPosition","rangeCommonAncestor","checkAttributeInSelection","convertToMinimalFlatRanges","_getValidRangesForRange","backwardWalker","forwardWalker","limitElement","forward","combineWalkers","findAllowedParent","setAllowedAttributes","removeDisallowedAttributes","removeDisallowedAttributeFromNode","positionsInRange","getPositions","getAttributesWithProperty","attributeProperties","compiledDefinitions","sourceRules","itemNames","compileBaseItemRule","compileAllowChildren","compileAllowContentOf","compileAllowWhere","compileAllowAttributesOf","compileInheritPropertiesFrom","cleanUpAllowIn","setupAllowChildren","cleanUpAllowAttributes","contextItemIndex","contextItem","getItem","allowIn","parentRule","mapContextItem","query","getNames","sourceItemRules","itemRule","allowContentOf","allowWhere","allowAttributesOf","allowChildren","inheritTypesFrom","sourceItemRule","typeNames","copyTypes","copyProperty","inheritFrom","inheritAllFrom","makeInheritAllWork","allowChildrenItem","allowedChildren","allowContentOfItemName","getAllowedChildren","allowedItem","allowWhereItemName","allowedIn","allowAttributeOfItem","inheritAttributes","inheritPropertiesOfItem","existingItems","itemToCheck","allowedParentItemName","ctxItem","UpcastDispatcher","_splitParts","_cursorParents","_modelCursor","_emptyElementsToKeep","store","_convertItem","positionOrElement","_convertChildren","_safeInsert","_updateConversionResult","splitToAllowedParent","_splitToAllowedParent","getSplitParts","_getSplitParts","keepEmptyElement","_keepEmptyElement","contextDefinition","createContextTree","documentFragment","_removeEmptyElements","modelItem","markerElements","markerElement","currentPosition","extractMarkersFromModelFragment","elementOrModelCursor","nextModelCursor","splitResult","savedCursorParent","allowedParent","treeWalkerValue","originalPart","splitPart","_registerSplitPair","cursorParent","anyRemoved","BasicHtmlWriter","getHtml","HtmlDataProcessor","domParser","htmlWriter","toData","toView","_toDom","useFillerType","DataController","upcastDispatcher","htmlProcessor","processor","_viewWriter","isUndoable","_checkIfRootsExists","ignoreWhitespaces","modelElementOrFragment","viewDocumentFragment","elementRange","isMarkerCollapsed","isMarkerAtElementBoundary","updatedMarkerRange","n1","n2","localeCompare","_getMarkersRelativeToElement","initialData","main","modelRoot","parse","newData","batchType","removeSelectionAttribute","viewElementOrFragment","addStyleProcessorRules","rootNames","Conversion","downcastDispatchers","upcastDispatchers","_helpers","_downcast","_createConversionHelpers","isDowncast","_upcast","addAlias","alias","_getAllUpcastDefinitions","helpers","upcastAlso","_getUpcastDefinition","upcastAlsoItem","Operation","baseVersion","_validate","__className","normalizedNodes","_normalizeNodes","_splitNodeAtPosition","_mergeNodesAtIndex","_move","_haveSameAttributes","mergedNode","offsetDiff","firstPart","secondPart","nodeA","nodeB","iteratorA","iteratorB","MoveOperation","affectedSelectable","getMovedRangeStart","getReversed","newTargetPosition","sourceElement","targetElement","sourceOffset","targetOffset","_execute","InsertOperation","shouldReceiveAttributes","gyPosition","originalNodes","SplitOperation","MergeOperation","splitElement","mergedElement","MarkerOperation","_markers","_set","AttributeOperation","NoOperation","RenameOperation","oldName","RootAttributeOperation","RootOperation","isAdd","createRoot","_isAttached","OperationFactory","transformations","setTransformation","OperationA","OperationB","transformationFunction","aGroup","noUpdateTransformation","getTransformation","transformSets","operationsA","operationsB","contextFactory","ContextFactory","useRelations","forceWeakRemove","setOriginalOperations","originalOperations","nextTransformIndex","op","nextBaseVersionA","nextBaseVersionB","originalOperationsACount","originalOperationsBCount","opA","indexB","opB","newOpsA","getContext","newOpsB","updateRelation","newOpA","padWithNoOps","brokenOperationsACount","brokenOperationsBCount","updateBaseVersions","_history","history","_useRelations","_forceWeakRemove","_relations","takeFrom","originalOperation","_setRelation","affectedLeft","affectedRight","side","wasInLeftElement","wasStartBeforeMergedElement","wasEndBeforeMergedElement","wasInRightElement","aIsStrong","aWasUndone","_wasUndone","bWasUndone","abRelation","_getRelation","baRelation","originalOp","wasUndone","isUndoneOperation","origB","undoneB","getUndoneOperation","origA","relationsA","relation","_getComplementaryAttributeOperations","insertOperation","insertValue","_moveTargetIntoMovedRange","_makeMoveOperationsFromRanges","moveOp","diffs","_breakRangeByMoveOperation","aNewRange","aToGraveyard","bToGraveyard","removedRange","mergeInside","mergeSplittingElement","aCompB","shouldSpread","rightRange","movesGraveyardElement","gyMoveSource","splitNodesMoveSource","gyMoveTarget","gyMove","splitNodesMoveTargetPath","splitNodesMoveTarget","splitNodesMove","extraRename","splitPath","getInsertionPosition","additionalSplit","rangeToMove","gyElementMoved","newParentPosition","newTargetPath","splitAtTarget","howManyRemoved","aInGraveyard","bInGraveyard","newPositionPath","LivePosition","toPosition","oldPosition","Batch","isLocal","isUndo","isTyping","addOperation","Differ","markerCollection","_changesInElement","_elementSnapshots","_changedMarkers","_changedRoots","_changeCount","_cachedChanges","_cachedChangesWithGraveyard","_refreshedItems","_markerCollection","bufferOperation","operationToBuffer","_isInInsertedElement","_markInsert","_markAttribute","sourceParentInserted","targetParentInserted","_markRemove","getMarkersIntersectingRange","markerData","bufferMarkerChange","graveyardParent","mergedIntoElement","_bufferRootStateChange","_bufferRootAttributeChange","oldMarkerData","newMarkerData","buffered","getChangedMarkers","hasDataChanges","markerAdded","markerRemoved","markerChanged","includeChangesInGraveyard","diffSet","snapshotChildren","elementChildren","_getChildrenSnapshot","_generateActionsFromChanges","_getInsertDiff","_getRemoveDiff","elementAttributes","snapshotAttributes","_getAttributesDiff","changeCount","prevIndex","prevDiff","thisDiff","isConsecutiveTextRemove","isConsecutiveTextAdd","isConsecutiveAttributeChange","_changesInGraveyardFilter","getChangedRoots","diffItem","state","reset","attrEntry","changeItem","_markChange","_removeAllNestedChanges","_makeSnapshot","_getChangesForElement","_handleChange","inc","nodesToHandle","old","incEnd","oldEnd","intersectionLength","howManyAfter","attributePart","elementSnapshot","snapshot","oldChildrenLength","oldChildrenHandled","posInGy","rangeInGy","History","_operations","_undoPairs","_undoneOperations","_baseVersionToOperationIndex","_version","_gaps","lastOperation","historyVersion","getOperations","fromBaseVersion","toBaseVersion","firstOperation","inclusiveTo","gapFrom","gapTo","fromIndex","toIndex","getOperation","operationIndex","setOperationAsUndone","undoneOperation","undoingOperation","isUndoingOperation","RootElement","graveyardName","_hasSelectionChangedFromTheLastChangeBlock","removeMarker","includeDetached","_handleChangeBlock","_hasDocumentChangedFromTheLastChangeBlock","_getDefaultRoot","defaultRoot","createPositionFromPath","validateTextNodePosition","rangeBoundary","MarkerCollection","Marker","managedUsingOperations","oldMarker","hasChanged","_attachLiveRange","_managedUsingOperations","_destroyMarker","prefix","_detachLiveRange","_liveRange","getStart","getEnd","DetachOperation","Writer","cloneElement","_assertWriterUsedCorrectly","isSameTree","applyOperation","rangeRootPosition","usingOperation","updateMarker","addMarker","insertText","itemOrPositionOrOffset","appendText","appendElement","itemOrRange","setAttributeOnRange","setAttributeOnItem","setAttributes","clearAttributes","removeAttributesFromItem","_addOperationForAffectedMarkers","applyRemoveOperation","merge","_merge","_mergeDetached","renameOperation","firstSplitElement","firstCopyElement","elementOrString","shiftedRange","applyMarkerOperation","hasUsingOperationDefined","affectsDataDefined","updatedRange","addRoot","detachRoot","rootOrName","setSelectionAttribute","keyOrObjectOrIterable","_setSelectionAttribute","keyOrIterableOfKeys","_removeSelectionAttribute","overrideSelectionGravity","restoreSelectionGravity","storeKey","_getStoreAttributeKey","_currentWriter","isAffected","affectedInLeftElement","affectedInRightElement","affectedAfterLeftElement","affectedBeforeRightElement","valueBefore","valueAfter","lastSplitPosition","previousValue","rootA","rootB","deleteContent","selRange","doNotResetEntireContent","shouldEntireContentBeReplacedWithParagraph","insertParagraph","replaceEntireContentWithParagraph","attributesForAutoparagraph","doNotAutoparagraph","ignoreMarkers","modifySelection","newEndPosition","skippedRange","fromPosition","getLivePositionsForSelectedBlocks","leaveUnmerged","checkShouldMerge","startAncestor","endAncestor","positionA","positionB","getAncestorsJustBelowCommonAncestor","mergeBranchesRight","mergeBranchesLeft","mergeBranches","collapseSelectionAt","isTextAllowed","isParagraphAllowed","shouldAutoparagraph","commonAncestor","parentToRemove","mergeRight","leftPos","rightPos","rangeToCheck","isCrossingLimitElement","removeRangeContent","parentsToCheck","itemRange","parentToCheck","removeRange","Insertion","_firstNode","_lastNode","_lastAutoParagraph","_filterAttributesOf","_affectedStart","_affectedEnd","_nodeToSelect","canMergeWith","_documentFragment","_documentFragmentPosition","handleNodes","_handleNode","_insertPartialFragment","_updateLastNodeFromAutoParagraph","_mergeOnRight","positionAfterLastNode","positionAfterNode","_setAffectedBoundaries","getSelectionRange","getAffectedRange","_handleObject","isAllowed","_checkAndAutoParagraphToAllowedPosition","_checkAndSplitToAllowedPosition","_appendToFragment","_handleDisallowedNode","livePosition","_mergeOnLeft","_tryAutoparagraphing","_canMergeLeft","mergePosLeft","_canMergeRight","mergePosRight","_getAllowedIn","tempPos","childNode","findOptimalInsertionRange","place","firstBlock","positionAfter","insertObject","originalSelection","insertionSelection","findOptimalPosition","firstSelectedBlock","attributesToCopy","elementToInsert","insertionPositionParent","affectedRange","insertContent","paragraphAttributes","nextElement","canSetSelection","updateSelection","wordBoundaryCharacters","tryExtendingTo","isForward","treatEmojiAsSingleUnit","isAtNodeBoundary","isAtWordBoundary","getCorrectWordBreakPosition","getCorrectPosition","getSearchRange","searchEnd","offsetToCheck","Model","_pendingChanges","childDefinition","insertion","fakeMarkerElements","nodesToInsert","markersPosition","posA","posB","isAtBeginning","selectionLiveRange","markersData","isStartBoundary","elementPosition","rangeOnInsertion","_runPendingChanges","batchOrType","rest","normalizeSelectable","getSelectedContent","frag","commonPath","commonParent","flatSubtreeRange","leftExcessRange","rangeOrElement","intersectingMarker","createBatch","createOperationFromJSON","ret","currentBatch","callbackReturnValue","ClickObserver","UpcastWriter","insertChild","removeChildren","oldElement","valueOrElement","HEX_COLOR_REGEXP","RGB_COLOR_REGEXP","RGBA_COLOR_REGEXP","HSL_COLOR_REGEXP","HSLA_COLOR_REGEXP","COLOR_NAMES","isColor","lineStyleValues","isLineStyle","lengthRegExp","PERCENTAGE_VALUE_REGEXP","isPercentage","repeatValues","isRepeat","positionValues","isPosition","attachmentValues","isAttachment","urlRegExp","isURL","getBoxSidesValues","getShorthandValues","getBoxSidesValueReducer","styleShorthand","reduced","getBoxSidesShorthandValue","out","getPositionShorthandNormalizer","shorthand","addBackgroundRules","background","attachment","addBorderRules","normalizeBorderShorthand","getBorderPositionNormalizer","getBorderPropertyNormalizer","getBorderPropertyPositionNormalizer","getBorderPositionExtractor","getBorderPositionReducer","topStyles","extractBorderPosition","rightStyles","bottomStyles","leftStyles","borderStyles","borderStylesByType","getReducedStyleValueForType","reducedBorderStyle","reduceBorderPosition","reducedStyleTypes","getBorderReducer","border","toBorderPropertyShorthand","which","borderTypes","borderValue","addMarginRules","addPaddingRules","CommandCollection","_commands","commandName","commandParams","commands","EditingKeystrokeHandler","evtData","Editor","_readOnlyLocks","editing","enableReadOnlyMode","lockId","disableReadOnlyMode","removePlugins","extraPlugins","readyPromise","DataApiMixin","ElementApiMixin","updateSourceElement","shouldUpdateSourceElement","isSourceElementTextArea","PendingActions","_actions","hasAny","icons","bold","caption","check","cog","eraser","lowVision","importExport","plus","alignBottom","alignMiddle","alignTop","alignLeft","alignCenter","alignRight","alignJustify","objectLeft","objectCenter","objectRight","objectFullWidth","objectInline","objectBlockLeft","objectBlockRight","objectSizeFull","objectSizeLarge","objectSizeSmall","objectSizeMedium","pencil","pilcrow","threeVerticalDots","NESTED_TOOLBAR_ICONS","itemsView","ItemsView","isRtl","_focusCycler","shouldGroupWhenFull","isFloating","maxWidth","_behavior","DynamicGrouping","StaticLayout","fillFromConfig","itemsOrConfig","_buildItemsFromConfig","normalizedRemoveItems","_cleanItemsConfiguration","_createNestedToolbarDropdown","filteredItems","_cleanSeparatorsAndLineBreaks","nonSeparatorPredicate","firstCommandItemIndex","findIndex","lastCommandItemIndex","componentFactory","withText","dropdownView","createDropdown","addToolbarToDropdown","toolbarView","resizeObserver","cachedPadding","shouldUpdateGroupingOnNextResize","viewFocusables","viewItemsView","viewFocusTracker","viewLocale","ungroupedItems","groupedItems","groupedItemsDropdown","_createGroupedItemsDropdown","_updateFocusCycleableItems","changeData","removedItem","currentIndex","addedItem","_updateGrouping","_enableGroupingOnResize","_enableGroupingOnMaxWidthChange","initialGroupedItemsCount","wereItemsGrouped","_areItemsOverflowing","_groupLastItem","_ungroupFirstItem","lastChildRect","toolbarRect","computedStyle","paddingProperty","previousWidth","contentRect","dropdown","tooltipPosition","ListView","ListItemView","ListSeparatorView","SplitButtonView","actionView","_createActionView","ButtonClass","closeDropdownOnClickOutside","closeDropdownOnExecute","closeDropdownOnBlur","focusDropdownContentsOnArrows","focusDropdownButtonOnClose","focusDropdownPanelOnOpen","addDefaultBehavior","buttonsOrCallback","addToolbarToOpenDropdown","enableActiveItemFocusOnDropdownOpen","focusChildOnDropdownOpen","buttons","ariaLabel","isCompact","isVertical","addListToDropdown","itemsOrCallback","addListToOpenDropdown","listView","listItemView","childSelectorCallback","childToFocus","createLabeledInputText","labeledFieldView","inputView","ariaDescribedById","createLabeledInputNumber","inputMode","createLabeledDropdown","clamp","digits","pow","hexToRgba","hsvaToHsla","hh","hsvaToHslString","hsva","hsvaToRgba","rgbaToHex","alphaHex","rgbaToHsva","equalColorObjects","second","tpl","detail","dispatchEvent","CustomEvent","bubbles","hasTouched","isTouch","pointerMove","pointer","touches","getMove","pageX","pageXOffset","pageY","pageYOffset","Slider","aria","xy","cloneNode","dragging","toggleEvent","handleEvent","isValid","button","keyMove","setProperty","Hue","Saturation","$isSame","$color","$hsva","$update","$parts","$css","$sliders","ColorPicker","HTMLElement","observedAttributes","newColor","newHsva","colorModel","toHsva","attachShadow","mode","slider","connectedCallback","defaultColor","attributeChangedCallback","_attr","_oldVal","newVal","fromAttr","oldHsva","fromHsva","HexBase","customElements","ColorPickerView","_format","hexInputRow","_createInputRow","_debounceColorPickerEvent","_hexColor","convertColorToCommonHexFormat","picker","_createSlidersView","styleSheetForFocusedColorPicker","shadowRoot","slidersView","SliderView","hashView","HashView","colorInput","_createColorInput","ColorPickerInputRowView","labeledInput","pickerColor","inputValue","trimmedValue","hashlessInput","inputColor","convertToHex","ComponentFactory","_components","originalName","toPx","defaultLimiterElement","_pinWhenIsVisibleCallback","show","hide","attachTo","defaultPositions","southArrowNorth","southArrowNorthMiddleWest","southArrowNorthMiddleEast","southArrowNorthWest","southArrowNorthEast","northArrowSouth","northArrowSouthMiddleWest","northArrowSouthMiddleEast","northArrowSouthWest","northArrowSouthEast","viewportStickyNorth","optimalPosition","withArrow","pin","unpin","_startPinning","_stopPinning","getDomElement","limiterElement","scrollTarget","isWithinScrollTarget","isLimiterWithinScrollTarget","sideOffset","arrowSideOffset","heightOffset","arrowHeightOffset","stickyVerticalOffset","northWestArrowSouthWest","balloonRect","getNorthTop","northWestArrowSouthMiddleWest","northWestArrowSouth","northWestArrowSouthMiddleEast","northWestArrowSouthEast","northEastArrowSouthWest","northEastArrowSouthMiddleWest","northEastArrowSouth","northEastArrowSouthMiddleEast","northEastArrowSouthEast","southWestArrowNorthWest","getSouthTop","southWestArrowNorthMiddleWest","southWestArrowNorth","southWestArrowNorthMiddleEast","southWestArrowNorthEast","southEastArrowNorthWest","southEastArrowNorthMiddleWest","southEastArrowNorth","southEastArrowNorthMiddleEast","southEastArrowNorthEast","westArrowEast","eastArrowWest","BALLOON_CLASS","TooltipManager","_currentElementWithTooltip","_currentTooltipPosition","_resizeObserver","_editors","_instance","tooltipTextView","balloonPanelView","_pinTooltipDebounced","_pinTooltip","_onEnterOrFocus","_onLeaveOrBlur","_onScroll","_watchdogExcluded","editorBodyViewCollection","_unpinTooltip","defaultBalloonPositions","sw","se","elementWithTooltipAttribute","getDescendantWithTooltip","ckeTooltipText","ckeTooltipPosition","cssClass","ckeTooltipClass","relatedTarget","descendantWithTooltip","relatedDescendantWithTooltip","targetDomElement","bodyViewCollection","getPositioningFunctions","_updateTooltipPosition","closest","NARROW_ROOT_HEIGHT_THRESHOLD","NARROW_ROOT_WIDTH_THRESHOLD","DEFAULT_LABEL","OFF_THE_SCREEN_POSITION","PoweredBy","_balloonView","_lastFocusedEditableElement","_showBalloonThrottled","_showBalloon","_handleEditorReady","balloon","token","oldTokenCheck","decryptedData","decryptedSecondElement","splittedDecryptedData","firstElement","secondElement","year","monthIndex","day","date","verifyLicense","_updateLastFocusedEditableElement","_hideBalloon","_createBalloonView","poweredByConfig","getNormalizedConfig","PoweredByView","attachOptions","focusedEditableElement","getLowerCornerPosition","rootRect","horizontalOffset","getLowerRightCornerPosition","getLowerLeftCornerPosition","getBalloonAttachOptions","editableEditorElements","getEditableElementsNames","getEditableElement","isColorInherited","ICON_WIDTH","ICON_HEIGHT","href","dragstart","getBalloonLeft","editableElementRect","visibleEditableElementRect","balloonTop","verticalOffset","balloonLeft","newBalloonRect","firstScrollableEditableElementAncestor","overflow","overflowY","findClosestScrollableAncestor","firstScrollableEditableElementAncestorRect","userConfig","EditorUI","isReady","_editableElementsMap","_focusableToolbarDefinitions","tooltipManager","poweredBy","_readViewportOffsetFromConfig","_initFocusTracking","ckeditorInstance","setEditableElement","setUpKeystrokeHandler","removeEditableElement","addToolbar","_editableElements","editorUI","legacyOffsetConfig","editingView","lastFocusedForeignElement","candidateDefinitions","currentFocusedToolbarDefinition","_getCurrentFocusedToolbarDefinition","_getFocusableCandidateToolbarDefinitions","candidateDefinition","_focusFocusableCandidateToolbar","afterBlur","focusedToolbarDef","definitions","toolbarDef","beforeFocus","defA","defB","getToolbarDefinitionWeight","candidateToolbarDefinition","weight","isContextual","EditorUIView","BoxedEditorUIView","_voiceLabelView","_createVoiceLabel","lang","voiceLabel","EditableUIView","_editableElement","_hasExternalElement","_editingView","_updateIsFocusedClasses","hasExternalElement","updateAfterRender","InlineEditableUIView","_generateLabel","FormHeaderView","Notification","alert","showSuccess","_showNotification","title","showInfo","showWarning","_viewToStack","_idToStack","_view","_rotatorView","_fakePanelsView","positionLimiter","_createPanelView","hasView","stackId","_numberOfStacks","_visibleStack","singleViewMode","showStack","_showView","_singleViewMode","visibleView","_showNextStack","hideView","_getStackId","updatePosition","_getBalloonPosition","visibleStack","_createRotatorView","_createFakePanelsView","stacks","_showPrevStack","RotatorView","isSingleViewMode","numberOfStacks","buttonNextView","buttonPrevView","FakePanelsView","balloonClassName","showView","_createButtonView","_balloonPanelView","_addPanels","_removePanels","numberOfPanels","StickyPanelView","_contentPanelPlaceholder","isSticky","_panelRect","_contentPanel","_hasViewportTopOffset","viewportTopOffset","_isStickyToTheLimiter","limiterBottomOffset","marginLeft","_checkIfShouldBeSticky","_limiterRect","isActive","_marginLeft","ClassicEditorUI","_toolbarConfig","_elementReplacer","replacementElement","editingRoot","_initPlaceholder","_initToolbar","stickyPanel","toolbar","placeholderText","ClassicEditorUIView","shouldToolbarGroupWhenFull","Watchdog","crashes","_now","_crashNumberLimit","crashNumberLimit","_minimumNonErrorTimePeriod","minimumNonErrorTimePeriod","_boundErrorHandler","reason","_handleError","_listeners","_restart","_stopErrorHandling","cb","_fire","_startErrorHandling","_shouldReactToError","filename","ErrorEvent","lineno","colno","causesRestart","_shouldRestart","_isErrorComingFromThisItem","excludedProperties","subNodes","nodeIndex","shouldNodeBeIncluded","typeOfNode","EventTarget","Event","areConnectedThroughProperties","target1","target2","excludedNodes","structure","subNodes1","subNodes2","EditorWatchdog","watchdogConfig","_editor","_throttledSave","_save","saveInterval","_creator","elementOrData","_destructor","setCreator","creator","setDestructor","destructor","_destroy","catch","_elementOrData","updatedConfig","_cloneEditorConfiguration","_lastDocumentVersion","_getData","_setExcludedProperties","_excludedProps","mainQueueId","ActionQueues","_onEmptyCallbacks","_queues","_activeActions","onEmpty","onEmptyCallback","enqueue","queueId","isMainAction","queueWithAction","nonErrorQueue","finally","elementOrArray","ClassicEditor","sourceElementOrData","getInitialData","isTextArea","form","originalSubmit","onSubmit","submit","attachToForm","ContextWatchdog","_watchdogs","_contextProps","_actionQueues","_watchdogConfig","contextConfig","_contextConfig","_create","_getWatchdog","getItemState","itemConfigurationOrItemConfigurations","itemConfigurations","watchdog","res","rethrowRestartEventOnce","itemIdOrItemIds","itemIds","supportedOptions","isDefault","alignment","normalizeAlignmentOptions","configuredOptions","normalizedOptions","isNameValid","classNameCount","allOptions","succeedingOptions","ALIGNMENT","AlignmentCommand","_canBeAligned","blocks","currentAlignment","removeAlignmentFromSelection","setAlignmentOnSelection","AlignmentEditing","optionsToConvert","shouldUseClasses","isFormatting","buildClassDefinition","buildDowncastInlineDefinition","upcastInlineDefinitions","buildUpcastInlineDefinitions","upcastCompatibilityDefinitions","buildUpcastCompatibilityDefinitions","iconsMap","AlignmentUI","localizedOptionTitles","_addButton","defaultIcon","handleInput","dropRange","clipboardData","domDoc","clientX","clientY","caretRangeFromPoint","rangeParent","rangeOffset","getDropViewRange","smallPaddingElements","viewToPlainText","childText","_setupPasteDrop","_setupCopyCut","contentData","fullMatch","spaces","modelFragment","resultRange","modelDocument","onCopyCut","ChangeBuffer","limit","_batch","_size","_isLocked","_changeCallback","_reset","_selectionChangeCallback","isLocked","lock","unlock","ignoreLock","InsertTextCommand","undoStepSize","_buffer","textInsertions","TYPING_INPUT_TYPES","InsertTextObserver","Input","insertTextCommand","viewResultRange","modelRanges","selectedText","rangeText","insertTextCommandData","deleteSelectionContent","DeleteCommand","sequence","_shouldEntireContentBeReplacedWithParagraph","_replaceEntireContentWithParagraph","_shouldReplaceFirstBlockWithParagraph","limitElementFirstChild","DELETE_WORD","DELETE_SELECTION","DELETE_BACKWARD","DELETE_FORWARD","DELETE_EVENT_TYPES","deleteContentBackward","deleteWordBackward","deleteHardLineBackward","deleteSoftLineBackward","deleteContentForward","deleteWordForward","deleteHardLineForward","deleteSoftLineForward","DeleteObserver","deleteEventSpec","selectionToRemove","shouldUseTargetRanges","pressedKeyCode","beforeInputReceived","isDeleteKeyCode","getDeleteDirection","shouldFireDeleteEvent","targetRange","enableChromeWorkaround","Delete","_undoOnBackspace","deleteForwardCommand","commandData","requestUndoOnBackspace","Typing","getLastTextLine","TextWatcher","testCallback","_hasMatch","_startListening","hasMatch","_evaluateTextBeforeSelection","suffix","rangeBeforeSelection","testResult","eventData","TwoStepCaretMovement","_overrideUid","arrowRightPressed","arrowLeftPressed","contentDirection","isMovementHandled","_handleForwardMovement","_handleBackwardMovement","_isNextGravityRestorationSkipped","_isGravityOverridden","isBetweenDifferentAttributes","registerAttribute","hasAnyAttribute","preventCaretMovement","setSelectionAttributesFromTheNodeBefore","positionBefore","isStepAfterAnyAttributeBoundary","observedAttribute","attrBefore","reHasRegExpChar","TRANSFORMATIONS","copyright","registeredTrademark","trademark","oneHalf","oneThird","twoThirds","oneForth","threeQuarters","lessThanOrEqual","greaterThanOrEqual","notEqual","arrowLeft","arrowRight","horizontalEllipsis","enDash","emDash","quotesPrimary","buildQuotesRegExp","quotesSecondary","quotesPrimaryEnGb","quotesSecondaryEnGb","quotesPrimaryPl","quotesSecondaryPl","TRANSFORMATION_GROUPS","symbols","mathematical","typography","quotes","DEFAULT_TRANSFORMATIONS","normalizeFrom","normalizeTo","getTextAttributesAfterPosition","quoteCharacter","findAttributeRange","findAttributeRangeBound","lookBack","lastNode","inlineHighlight","highlightedElements","getCopyOnEnterAttributes","allAttributes","copyOnEnter","EnterCommand","enterBlock","isSelectionEmpty","splitBlock","isContainedWithinOneElement","splitPos","ENTER_EVENT_TYPES","isSoft","insertLineBreak","EnterObserver","shiftPressed","enterEventSpec","Enter","ShiftEnterCommand","insertBreak","softBreakAction","anchorPos","isInsideLimitElement","breakLineElement","ShiftEnter","HighlightStack","_stack","oldTop","_insertDescriptor","newTop","compareDescriptors","oldDescriptor","newDescriptor","_removeDescriptor","shouldABeBeforeB","classesToString","WIDGET_CLASS_NAME","WIDGET_SELECTED_CLASS_NAME","toWidget","labelOrCreator","widgetLabel","setLabel","hasSelectionHandle","widgetElement","selectionHandle","addSelectionHandle","setHighlightHandling","addHighlight","toWidgetEditable","typeAroundFakeCaretPosition","getTypeAroundFakeCaretPosition","TYPE_AROUND_SELECTION_ATTRIBUTE","isTypeAroundWidget","POSSIBLE_INSERTION_POSITIONS","RETURN_ARROW_ICON_ELEMENT","PLUGIN_DISABLED_EDITING_ROOT_CLASS","WidgetTypeAround","_currentFakeCaretModelElement","_enableTypeAroundUIInjection","_enableInsertingParagraphsOnButtonClick","_enableInsertingParagraphsOnEnterKeypress","_enableInsertingParagraphsOnTypingKeystroke","_enableTypeAroundFakeCaretActivationUsingKeyboardArrows","_enableDeleteIntegration","_enableInsertContentIntegration","_enableInsertObjectIntegration","_enableDeleteContentIntegration","_insertParagraph","widgetModelElement","_listenToIfEnabled","_insertParagraphAccordingToFakeCaretPosition","selectedModelElement","buttonTitles","before","after","widgetViewElement","typeAroundWrapper","wrapperDomElement","buttonTemplate","importNode","injectButtons","caretTemplate","injectFakeCaret","injectUIIntoWidget","positionToWidgetCssClass","domEventData","_handleArrowKeyPress","selectedViewElement","localizedKeyCodeDirection","isForwardArrowKeyCode","shouldStopAndPreventDefault","_handleArrowKeyPressOnSelectedWidget","_handleArrowKeyPressWhenSelectionNextToAWidget","_handleArrowKeyPressWhenNonCollapsedSelection","widgetPlugin","modelElementNextToSelection","_getObjectElementNextToSelection","_setSelectionOverElement","selectedModelNode","buttonPosition","classList","getTypeAroundButtonPosition","widgetDomElement","getClosestWidgetViewElement","wasHandled","selectedModelWidget","isDeleteForward","probe","deepestEmptyRangeAncestor","deepestEmptyAncestor","getDeepestEmptyElementAncestor","documentSelection","verticalNavigationHandler","arrowUpPressed","arrowDownPressed","expandSelection","selectionWillShrink","getNearestNonInlineLimit","lastRangePosition","getNearestTextPosition","firstRangePosition","findTextRangeFromSelection","boundaryVerticalPosition","isSingleLineRange","walkerValueType","_previouslySelected","_clearPreviouslySelectedWidgets","lastMarked","isChild","_onMousedown","_handleSelectionChangeOnArrowKeyPress","_preventDefaultOnArrowKeyPress","_handleDelete","currentElement","isInsideNestedEditable","objectElement","isVerticalNavigation","firstPosition","lastPosition","firstSelectedNode","lastSelectedNode","objectElementNextToSelection","previousNode","nodeToRemove","widget","WidgetToolbarRepository","_toolbarDefinitions","balloonToolbar","isWidgetSelected","_balloon","_updateToolbarsVisibility","toolbarConfig","toolbarId","getRelatedElement","toolbarDefinition","itemsConfig","initialized","relatedElement","_showToolbar","_hideToolbar","maxRelatedElementDepth","deepestRelatedElement","deepestToolbarDefinition","relatedElementDepth","_isToolbarVisible","_isToolbarInBalloon","repositionContextualBalloon","getBalloonPositionData","ResizeState","_referenceCoordinates","originalWidth","_originalWidth","originalHeight","_originalHeight","originalWidthPercents","_originalWidthPercents","aspectRatio","_aspectRatio","begin","domResizeHandle","domHandleHost","domResizeHost","clientRect","activeHandlePosition","domHandle","resizerPositions","getResizerHandleClass","getHandlePosition","resizerPosition","positionParts","getAbsoluteBoundaryPoint","replacements","getOppositePosition","widthStyle","resizeHostRect","domResizeHostParent","parentWidth","ancestorLevelLimit","currentLevel","checkedElement","calculateHostPercentageWidth","newSize","proposedWidth","proposedHeight","proposedWidthPercents","widthPercents","proposedHandleHostWidth","handleHostWidth","proposedHandleHostHeight","handleHostHeight","SizeView","visible","_bindToState","resizeState","_dismiss","_isVisible","Resizer","_viewResizerWrapper","isSelected","_cleanup","_state","viewResizerWrapper","_appendHandles","_appendSizeUI","redraw","_sizeView","_initialViewWidth","_getHandleHost","_getResizeHost","updateSize","_proposeNewSize","newWidth","domHandleHostRect","domResizeHostRect","commit","onCommit","handleHostRect","domWrapper","_domResizerWrapper","widgetWrapper","handleHost","resizerWrapper","currentDimensions","newDimensions","isSameNode","offsetLeft","offsetTop","containsHandle","currentCoordinates","isCentered","enlargement","abs","getResizeHost","getHandleHost","WidgetResize","_resizers","_observer","_mouseDownListener","_mouseMoveListener","_mouseUpListener","_redrawSelectedResizerThrottled","redrawSelectedResizer","resizer","getResizerByViewElement","deselect","selectedResizer","widgetToolbarRepository","_getResizerByHandle","resizeHandle","isResizeHandle","_activeResizer","DragDrop","_draggedRange","_draggingUid","_draggableElement","_updateDropMarkerThrottled","_updateDropMarker","_removeDropMarkerDelayed","_removeDropMarker","_clearDraggableAttributesDelayed","_clearDraggableAttributes","_setupDragging","_setupContentInsertionIntegration","_setupClipboardInputIntegration","_setupDropMarker","_setupDraggableAttributeHandling","_finalizeDragging","draggableWidget","findDraggableWidget","canEditAtDraggedRange","draggedSelection","findDropTargetRange","getFinalDropEffect","clipboardPipeline","isMove","isSuccess","draggableElement","moved","targetViewRanges","targetViewElement","targetViewPosition","findDropTargetRangeOnWidget","targetModelElement","getClosestMappedModelElement","targetModelPosition","positionAtElementStart","betweenBlocksPosition","findDropTargetRangeBetweenBlocks","findDropTargetRangeOnAncestorObject","findDropTargetRangeInElement","PastePlainText","isPlainTextFragment","textAttributes","Clipboard","BaseCommand","_createdBatches","clearStack","createdBatches","addBatch","docSelection","_restoreSelection","selectionRanges","transformedRangeGroups","allRanges","rangeGroup","isRangeContainedByAnyOtherRange","normalizeRanges","_undo","batchToUndo","undoingBatch","operationsToUndo","operationToUndo","nextBaseVersion","historyOperations","reversedOperations","joinedRange","UndoCommand","batchIndex","RedoCommand","redoingBatch","UndoEditing","_batchRegistry","_undoCommand","_redoCommand","isRedoBatch","isUndoBatch","undoneBatch","UndoUI","localizedUndoIcon","undo","redo","localizedRedoIcon","Icon","Undo","createBlockImageViewElement","getImgViewElementMatcher","matchImageType","imageUtils","areBothImagePluginsLoaded","isInlineImageView","getPositiveMatchPattern","isBlockImageView","determineImageTypeForInsertionAtSelection","ImageUtils","isImage","isInlineImage","isBlockImage","insertImage","imageType","determineImageTypeForInsertion","imageElement","getClosestSelectedImageWidget","isImageWidget","getClosestSelectedImageElement","isImageAllowed","insertionRange","getInsertImageParent","isImageAllowedInParent","isNotInsideImage","toImageWidget","altText","findViewImgElement","figureView","configImageInsertType","IMAGE_URL_REGEXP","blockAutoformatEditing","callbackOrCommand","blockToFormat","firstNode","firstNodeRange","blockRange","inlineAutoformatEditing","testRegexpOrCallback","formatCallback","regExp","leftDel","rightDel","delStart","delEnd","getTextAfterCode","testOutput","rangesToFormat","testOutputToRanges","rangesToRemove","arrays","getCallbackFunctionForInlineAutoformat","validRanges","getValidRanges","reHasUnicode","rsAstral","rsCombo","rsFitz","rsNonAstral","rsRegional","rsSurrPair","reOptMod","rsOptVar","rsSeq","rsSymbol","reUnicode","strSymbols","chr","ATTRIBUTE_WHITESPACES","SAFE_URL","EMAIL_REG_EXP","PROTOCOL_REG_EXP","LINK_KEYSTROKE","createLinkElement","linkElement","ensureSafeUrl","url","urlString","normalizedUrl","isSafeUrl","isLinkableElement","addLinkProtocolIfApplicable","defaultProtocol","protocol","isProtocolNeeded","linkHasProtocol","openLink","open","URL_REG_EXP","AutoLink","_enableTypingHandling","afterInit","_enableEnterHandling","_enableShiftEnterHandling","watcher","isSingleSpaceAtTheEnd","getUrlAtTextEnd","linkEnd","linkStart","linkRange","_applyAutoLink","enterCommand","_checkAndApplyAutoLinkOnRange","shiftEnterCommand","fullUrl","isLinkAllowedOnRange","linkIsAlreadySet","_persistAutoLink","deletePlugin","BlockQuoteCommand","_getValue","forceValue","blocksToQuote","findQuote","checkCanBeQuoted","_applyQuote","_removeQuote","getRangesOfBlockGroups","groupRange","quotesToMerge","currentQuote","nextQuote","elementOrPosition","nextBlock","isBQAllowed","isBlockAllowedInBQ","BlockQuoteEditing","blockQuoteCommand","BlockQuoteUI","AttributeCommand","_getValueFromFirstAllowedNode","BOLD","BoldEditing","fontWeight","BoldUI","CODE","CodeEditing","CodeUI","getNormalizedAndLocalizedLanguageDefinitions","languageDefs","getPropertyAssociation","association","getLeadingWhiteSpaces","getIndentOutdentPositions","leadingWhiteSpaces","isModelSelectionInCodeBlock","canBeCodeBlock","CodeBlockCommand","_lastLanguage","firstLanguageInConfig","lastLanguage","defaultLanguage","usePreviousLanguageChoice","getLanguage","_applyCodeBlock","_removeCodeBlock","allowedBlocks","currentBlock","codeBlocks","IndentCodeBlockCommand","_indentSequence","indentSequenceTextElement","OutdentCodeBlockCommand","getLastOutdentableSequenceRange","nodeAtPosition","getCodeLineTextNodeAtPosition","lastIndexOfSequence","modelToViewCodeBlockInsertion","useLabels","languagesToClasses","languagesToLabels","codeBlockLanguage","preAttributes","spellcheck","codeAttributes","pre","DEFAULT_ELEMENT","CodeBlockEditing","languages","indentSequence","isDocumentListEditingLoaded","normalizedLanguagesDefs","isDocumentListAttributeOnCodeBlock","modelToDataViewSoftBreakInsertion","classesToLanguages","defaultLanguageName","viewCodeElement","viewPreElement","codeBlock","viewChildClasses","dataViewToModelCodeBlockInsertion","textLines","lastLine","softBreak","preElement","preChildren","childCodeElement","line","lineIndex","rawSnippetTextToViewDocumentFragment","docFragment","newDocumentFragment","indent","outdent","isSoftEnter","modelDoc","lastSelectionPosition","isSoftBreakNode","newBlock","leaveBlockStartOnEnter","emptyLineRangeToRemoveOnEnter","isEmptyishTextNode","leaveBlockEndOnEnter","breakLineOnEnter","CodeBlockUI","normalizedLanguageDefs","splitButtonView","accessibleLabel","_codeBlockLanguage","_getLanguageListItemDefinitions","itemDefinitions","languageDef","updateViewAttributes","oldViewAttributes","newViewAttributes","viewAttributes","removeViewAttributes","setViewAttributes","mergeViewElementAttributes","modifyGhsAttribute","ghsAttributeName","viewToModelObjectConverter","modelName","htmlContent","toObjectWidgetConverter","createObjectView","attributeToViewInlineConverter","viewToModelBlockAttributeConverter","dataFilter","processViewAttributes","modelToViewBlockAttributeConverter","modelSchema","paragraphLikeModel","appliesToBlock","coupledAttribute","DataSchema","_definitions","registerBlockElement","registerInlineElement","extendBlockElement","_extendDefinition","extendInlineElement","getDefinitionsForView","includeReferences","_getMatchingViewDefinitions","reference","_getReferences","getDefinitionsForModel","testViewName","inheritProperties","referenceName","currentDefinitions","currentDefinition","computed","DataFilter","_dataSchema","_allowedAttributes","_disallowedAttributes","_allowedElements","_disallowedElements","_dataInitialized","_coupledAttributes","_registerElementsAfterInit","_registerElementHandlers","_registerModelPostFixer","loadAllowedConfig","rules","splitRules","allowElement","loadDisallowedConfig","disallowElement","disallowAttributes","_addAllowedElement","consumeAttributes","relatedDefinition","_fireRegisterEvent","_registerObjectElement","_registerBlockElement","_registerInlineElement","coupledAttributes","_getCoupledAttributesMap","attributeNames","attributesToAdd","viewToAttributeInlineConverter","consumedMatches","removeConsumedAttributes","consumeAttributeMatches","matchResult","mergeMatchResults","iterableToObject","attributesObject","splitPattern","splittedRules","SelectAllCommand","scopeElement","isSelectAllScope","SELECT_ALL_KEYSTROKE","SelectAllEditing","SelectAllUI","SelectAll","FindAndReplaceFormView","matchCount","isDirty","_findInputView","_createInputField","_replaceInputView","_findButtonView","_createButton","_findPrevButtonView","_findNextButtonView","_optionsDropdown","_createOptionsDropdown","_replaceButtonView","_replaceAllButtonView","_findFieldsetView","_createFindFieldset","_replaceFieldsetView","_createReplaceFieldset","_focusTracker","_keystrokes","_focusables","_initFocusCycling","_initKeystrokeHandling","_textToFind","_textToReplace","fieldsetView","_onFindButtonExecute","findPrevious","findNext","_injectFindResultsCounter","searchText","matchCase","_matchCase","wholeWords","_wholeWordsOnly","resultsCounterView","highlightOffset","updateFindInputPadding","inputElement","counterWidth","paddingPropertyName","resultsFound","replaceAll","matchCaseModel","_isMatchCaseSwitch","wholeWordsOnlyModel","stopPropagationAndPreventDefault","_areCommandsEnabled","FindAndReplaceUI","formView","findCommand","_setupFormView","_setupDropdownButton","cancelEvent","editingState","sortMapping","same","different","highlightedResult","findNextCommand","findPreviousCommand","replaceCommand","replaceAllCommand","FindCommand","callbackOrText","findAndReplaceUtils","findCallback","findByTextCallback","currentResults","updateFindResultFromRange","matchWholeWords","ReplaceCommandBase","_replace","replacementText","ReplaceCommand","ReplaceAllCommand","newText","textToReplace","searchResult","FindNextCommand","FindPreviousCommand","previousIndex","FindAndReplaceState","highlightedResultRemoved","removedResult","nextHighlightedIndex","oldMatchId","FindAndReplaceUtils","startResults","foundItems","rangeToText","foundItem","resultId","resultsList","markerToInsert","findInsertIndex","searchTerm","flags","regExpQuery","nonLetterGroup","regexpMatchToFindResult","lastGroupIndex","FindAndReplaceEditing","_activeResults","_defineConverters","_defineCommands","newMatchId","debouncedScrollListener","searchCallback","changedNodes","removedMarkers","markerAtChange","nodeToCheck","onDocumentChange","FontCommand","updateAttribute","DocumentColorCollection","hasColor","ColorTableView","colors","removeButtonLabel","documentColorsLabel","documentColorsCount","colorPickerLabel","colorPickerConfig","_colorPickerConfig","colorGridsPageView","ColorGridsPageView","colorPickerPageView","ColorPickerPageView","appendGrids","appendUI","_appendColorPicker","showColorPicker","colorPickerView","showColorGrids","updateDocumentColors","updateSelectedColors","colorPickerButtonView","addColorPickerButton","documentColors","_removeButtonLabel","_colorPickerLabel","_documentColorsLabel","removeColorButtonView","_createRemoveColorButton","maxCount","_addColorToDocumentColors","documentColorsGrid","staticColorsGrid","_createStaticColorsGrid","_createDocumentColorsGrid","_createColorPickerButton","_addColorTablesElementsToFocusTracker","colorGrid","colorObj","predefinedColor","_pickerConfig","saveButtonView","cancelButtonView","_createActionButtons","actionBarView","_createActionBarView","_addColorPickersElementsToFocusTracker","_stopPropagationOnArrowsKeys","_executeOnEnterPress","_executeUponColorChange","actionBarRow","FONT_SIZE","FONT_FAMILY","FONT_COLOR","FONT_BACKGROUND_COLOR","buildDefinition","modelAttributeKey","renderUpcastAttribute","styleAttr","renderDowncastElement","FontBackgroundColorCommand","FontBackgroundColorEditing","ColorUI","componentName","dropdownLabel","colorTableView","componentConfig","localizedColors","hasColorPicker","colorPicker","dropdownContentRendered","addColorTableToDropdown","_undoStepBatch","FontBackgroundColorUI","FontColorCommand","FontColorEditing","FontColorUI","FontFamilyCommand","normalizeOptions","getOptionDefinition","fontDefinition","fontNames","firstFontName","cssFontNames","normalizeFontNameForCSS","generateFontPreset","fontName","FontFamilyEditing","supportAllValues","_prepareAnyValueConverters","_prepareCompatibilityConverter","FontFamilyUI","_getLocalizedOptions","commandParam","_prepareListOptions","FontSizeCommand","attachPriority","preset","namedPresets","findPreset","numberValue","isNumericalDefinition","generatePixelPreset","tiny","small","big","huge","styleFontSize","FontSizeEditing","presets","isRelative","maxSize","clampedSize","FontSizeUI","localizedTitles","Default","Tiny","Small","Big","Huge","CodeBlockElementSupport","preserveElementAttributes","viewToModelCodeBlockAttributeConverter","DualContentModelElementSupport","blockDefinition","paragraphLikeModelDefinition","_hasBlockContent","_addAttributeConversion","HeadingElementSupport","registerHeadingElements","removeClassesOnEnter","dataSchema","headerModels","getDescendantElement","ImageElementSupport","viewFigureElement","viewToModelFigureAttributeConverter","viewImageElement","viewContainerElement","preserveLinkAttributes","viewToModelImageAttributeConverter","addInlineAttributeConversion","addBlockAttributeConversion","MediaEmbedElementSupport","mediaElementName","viewToModelFigureAttributesConverter","upcastMedia","viewToModelMediaAttributesConverter","addAttributeConversionDispatcherHandler","modelToViewMediaAttributeConverter","ScriptElementSupport","TableElementSupport","tableUtils","viewTableElement","viewToModelTableAttributeConverter","table","hasTHeadAttributes","hasTBodyAttributes","getRows","createHeadingRowsPostFixer","StyleElementSupport","DocumentListElementSupport","documentListEditing","registerDowncastStrategy","scope","setAttributeOnDowncast","viewToModelListAttributeConverter","listNodes","previousNodesByIndent","nodeIndent","previousNodeIndent","previousNodeInList","indentList","changedBlocks","CustomElementSupport","preLikeElements","isValidElementName","htmlElementName","htmlAttributes","customElement","getItemsToUpdateGhsAttribute","getValidRangesForSelectable","ParagraphCommand","checkCanBecomeParagraph","InsertParagraphCommand","paragraphLikeElements","HeadingCommand","modelElements","heading","checkCanBecomeHeading","defaultModelElement","HeadingEditing","_addDefaultH1Conversion","HeadingUI","getLocalizedOptions","defaultTitle","titles","headingCommand","paragraphCommand","commandValue","areEnabled","para","whichModel","HighlightCommand","highlighter","isSameHighlight","highlightStart","highlightEnd","highlightRange","HighlightEditing","_buildDefinition","HighlightUI","_addHighlighterButton","_addRemoveHighlightButton","_addDropdown","getIconForType","decorateButton","localized","startingHighlighter","optionsMap","retVal","lastExecuted","getActiveOption","whichHighlighter","bindToolbarIconStyleToActiveColor","HorizontalLineCommand","getInsertHorizontalLineParent","isHorizontalLineAllowedInParent","horizontalElement","HorizontalLineEditing","viewWrapper","toHorizontalLineWidget","HorizontalLineUI","HtmlEmbedCommand","selectedRawHtmlElement","getSelectedRawHtmlModelWidget","getInsertHtmlEmbedParent","isHtmlEmbedAllowedInParent","htmlEmbedElement","HtmlEmbedEditing","_widgetButtonViewReferences","showPreviews","sanitizeHtml","rawHtml","_setupConversion","widgetButtonViewReferences","htmlEmbedConfig","renderContent","domTextarea","textareaProps","isDisabled","textareaPlaceholder","createDomTextarea","previewContainerProps","sanitizedOutput","getRawHtmlValue","domPreviewPlaceholder","domPreviewContent","domDocumentFragment","createContextualFragment","domPreviewContainer","createPreviewContainer","buttonsWrapperProps","onEditClick","onSaveClick","onCancelClick","prepend","domButtonsWrapper","createUIButton","editButtonView","createDomButtonsWrapper","disabled","domContentWrapper","viewContentWrapper","rawHtmlApi","makeEditable","save","onClick","HtmlEmbedUI","ImageTextAlternativeCommand","ImageTextAlternativeEditing","TextAlternativeFormView","_createLabeledInputView","ImageTextAlternativeUI","_form","_showForm","_createForm","_hideForm","_isInBalloon","focusEditable","ImageTextAlternative","downcastSrcsetAttribute","img","srcset","downcastImageAttribute","ImageLoadObserver","_fireEvents","InsertImageCommand","sourceDefinitions","selectionAttributes","sourceDefinition","src","ReplaceImageSourceCommand","ImageEditing","viewImage","insertImageCommand","replaceImageSourceCommand","ImageTypeCommand","modelElementName","_modelElementName","uploadId","newElementRange","ImageBlockEditing","_setupClipboardIntegration","modelImage","upcastImageFigure","docFragmentChildren","blockViewImages","inlineViewImage","ImageBlock","ImageInlineEditing","createInlineImageViewElement","inlineViewImages","blockViewImage","ImageInline","ToggleImageCaptionCommand","imageCaptionUtils","ancestorCaptionElement","getCaptionFromModelSelection","getCaptionFromImageModelElement","focusCaptionOnShow","_hideImageCaption","_showImageCaption","imageCaptionEditing","selectedImage","savedCaption","_getSavedCaption","newCaptionElement","captionElement","_saveCaption","ImageCaptionUtils","imageModelElement","matchImageCaptionViewElement","ImageCaptionEditing","_savedCaptionsMap","_setupImageTypeCommandsIntegration","_registerCaptionReconversion","figcaptionElement","imageAlt","imageTypeInlineCommand","imageTypeBlockCommand","handleImageTypeChange","oldCaptionElement","savedOldElementCaption","jsonObject","ImageCaptionUI","modelCaptionElement","FileReader","reader","_reader","onprogress","loaded","read","file","total","reject","onload","onerror","onabort","readAsDataURL","abort","loaders","_loadersMap","_pendingAction","_updatePendingAction","uploaded","getLoader","fileOrPromise","createLoader","createUploadAdapter","loader","FileLoader","aggregatedUploaded","aggregatedTotal","uploadTotal","destroyLoader","fileOrPromiseOrLoader","pendingActions","getMessage","uploadedPercent","filePromise","uploadAdapterCreator","_filePromiseWrapper","_createFilePromiseWrapper","_adapter","status","upload","uploadResponse","isFulfilled","rejecter","FileDialogButtonView","_fileInputView","FileInputView","accept","multiple","_initRequest","_initListeners","_sendRequest","xhr","XMLHttpRequest","uploadUrl","responseType","genericErrorText","response","urls","default","lengthComputable","headers","withCredentials","headerName","setRequestHeader","FormData","send","createImageTypeRegExp","regExpSafeNames","fetchLocalImage","imageSrc","fetch","resource","blob","mimeType","getImageMimeType","File","canvas","drawImage","toBlob","getBlobFromCanvas","convertLocalImageOnCanvas","ImageUploadUI","componentCreator","imageTypes","imageTypesRegExp","acceptedType","allowMultipleFiles","imagesToUpload","ImageUploadProgress","uploadStatusChange","fileRepository","viewFigure","_startAppearEffect","_showPlaceholder","_hidePlaceholder","progressBar","_createProgressBar","_showProgressBar","viewImg","_displayLocalImage","completeIcon","_showCompleteIcon","_removeUIElement","_hideProgressBar","_stopAppearEffect","_getUIElement","_createPlaceholder","imageFigure","uniqueProperty","UploadImageCommand","_uploadImage","ImageUploadEditing","_uploadImageElements","uploadImageCommand","images","fetchableImages","isLocalImage","fetchableImage","insertedImagesIds","isInsertedInGraveyard","getImagesFromChangeItem","_readAndUpload","_parseAndSetSrcsetAttributeOnImage","notification","imageUploadElements","domFigure","originalDisplay","_ckHack","clean","srcsetAttribute","ImageUpload","ImageUploadFormRowView","_role","_ariaLabelledBy","ImageInsertPanelView","integrations","insertButtonView","integration","integrationView","imageURLInputValue","_integrations","getIntegration","createLabeledInputView","labeledInputView","ImageInsertUI","_createDropdownView","_setUpDropdown","imageInsertView","closePanel","panelItems","imageInsertUIPlugin","PREDEFINED_INTEGRATIONS","ckFinderButton","openCKFinder","prepareIntegrations","insertImageViaUrlForm","ImageInsertViaUrl","ResizeImageCommand","ImageResizeEditing","resizeUnit","resizeOptions","resizeImageCommand","_registerSchema","_registerConverters","figure","RESIZE_ICONS","medium","large","original","ImageResizeButtons","_resizeUnit","_registerImageResizeButton","_registerImageResizeDropdown","optionValueWithUnit","labelText","_getOptionLabelValue","getIsOnButtonCallback","originalSizeOption","dropdownButton","_getResizeDropdownListItemDefinitions","forTooltip","IMAGE_WIDGETS_CLASSES_MATCH_REGEXP","RESIZED_IMAGE_CLASS","ImageResizeHandles","_setupResizerCreator","widgetView","imageModel","domWidgetElement","imageStyle","ImageStyleCommand","_defaultStyles","imageBlock","imageInline","requestedStyle","shouldConvertImageType","DEFAULT_OPTIONS","inline","alignBlockLeft","alignBlockRight","DEFAULT_ICONS","full","center","inlineLeft","inlineRight","DEFAULT_DROPDOWN_DEFINITIONS","defaultItem","warnInvalidStyle","info","normalizeStyles","configuredStyles","arrangement","extendedStyle","extendStyle","normalizeDefinition","isBlockPluginLoaded","isInlinePluginLoaded","supportedElements","missingPlugins","isValidOption","getDefaultStylesConfiguration","getDefaultDropdownDefinitions","pluginCollection","getStyleDefinitionByName","ImageStyleEditing","utils","normalizedStyles","_setupPostFixer","modelToViewConverter","newStyle","oldStyle","viewToModelConverter","nonDefaultStyles","modelImageElement","viewToModelStyleAttribute","imageStyleDefinition","ImageStyleUI","localizedDefaultStylesTitles","definedStyles","translateStyles","styleConfig","definedDropdowns","dropdownConfig","_createDropdown","defaultButton","buttonViews","getUIComponentName","buttonName","splitButtonViewArrow","getDropdownButtonTitle","areOn","buttonConfig","_executeCommand","dropdownTitle","buttonTitle","IndentEditing","IndentUI","localizedIndentIcon","localizedOutdentIcon","_defineButton","IndentBlockCommand","indentBehavior","_indentBehavior","checkEnabled","blocksToChange","getBlocksToChange","currentIndent","nextIndent","getNextIndent","IndentUsingOffset","indentAttributeValue","currentOffset","offsetToSet","IndentUsingClasses","indexStep","DEFAULT_ELEMENTS","ITALIC","ItalicEditing","ItalicUI","AutomaticDecorators","getDispatcher","getDispatcherForLinkedImage","linkInImage","LinkCommand","manualDecorators","automaticDecorators","restoreManualDecoratorStates","manualDecorator","_getDecoratorStateFromModel","manualDecoratorIds","truthyManualDecorators","falsyManualDecorators","linkText","extractTextFromSelection","_updateLinkContent","allowedRanges","rangesToUpdate","_isRangeToUpdate","decoratorName","allowedRange","linkHref","rangeItems","UnlinkCommand","linkCommand","rangesToUnlink","ManualDecorator","_createPattern","DECORATOR_AUTOMATIC","EXTERNAL_LINKS_REGEXP","LinkEditing","addTargetToExternalLinks","linkDecorators","decorators","localizedDecoratorsLabels","decorator","getLocalizedDecorators","retArray","normalizeDecorators","_enableAutomaticDecorators","_enableManualDecorators","_enableLinkOpen","_enableInsertContentSelectionAttributesFixer","_enableClickingAfterLink","_enableTypingOverLink","_handleDeleteContentAfterLink","_enableClipboardIntegration","automaticDecoratorDefinitions","rel","manualDecoratorDefinitions","decoratorDefinition","manualDecoratorValue","clickedElement","removeLinkAttributesFromSelection","getLinkAttributesAllowedOnText","clicked","deletedContent","nodeAtFirstPosition","nodeAtLastPosition","shouldCopyAttributes","shouldPreserveAttributes","hasBackspacePressed","newLink","linkAttributes","LinkFormView","urlInputView","_createUrlInput","_manualDecoratorSwitches","_createManualDecoratorSwitches","_createFormChildren","getDecoratorSwitchesState","accumulator","switchButton","switches","decoratorValue","additionalButtonsView","LinkActionsView","previewButtonView","_createPreviewButton","unlinkButtonView","VISUAL_SELECTION_MARKER_NAME","LinkUI","actionsView","_createToolbarLinkButton","_enableBalloonActivators","_createViews","_createActionsView","_createFormView","_enableUserBalloonInteractions","unlinkCommand","_addFormView","_hideUI","parsedUrl","_closeFormView","_showUI","_getSelectedLinkElement","_areActionsVisible","_isUIVisible","_isUIInPanel","_addActionsView","_areActionsInPanel","_getBalloonPositionData","_isFormInPanel","_removeFormView","_hideFakeVisualSelection","forceVisible","_showFakeVisualSelection","_startUpdatingUI","prevSelectedLink","prevSelectionParent","getSelectionParent","selectedLink","markerViewElements","targetLink","findLinkElementAncestor","startLink","endLink","isLinkElement","LinkImageEditing","isImageInlinePluginLoaded","viewLink","imageInLink","blockImageView","consumableAttributes","conversionResult","upcastLink","viewImgOrPicture","downcastImageLink","downcastImageLinkManualDecorator","upcastImageLinkManualDecorator","LinkImageUI","_isSelectedLinkedImage","_createToolbarLinkImageButton","ListCommand","checkCanBecomeListItem","turnOff","newIndent","listIndent","lowestIndent","_fixType","listType","listItem","startingItem","IndentCommand","indentDirection","_indentBy","itemsToChange","lastItem","generateLiInUl","getListItemFillerOffset","createViewListItemElement","viewList","injectViewList","injectedItem","injectedList","refItem","getSiblingListItem","sameIndent","smallerIndent","prevItem","mappedViewAncestor","nestedList","findNestedList","positionAfterUiElements","prevView","breakPosition","mergeViewLists","nextViewList","lastSubChild","modelChild","firstList","secondList","itemIndent","createUIComponent","getSiblingNodes","walkerOptions","limitIndent","getSelectedListItems","listItems","BULLETED_LIST_STYLE_TYPES","NUMBERED_LIST_STYLE_TYPES","getListTypeFromListStyleType","listStyleType","hasOnlyLists","ListUtils","modelViewInsertion","modelViewChangeType","listName","modelViewMergeAfterChangeType","modelViewSplitOnInsert","removeStart","removeEnd","previousList","mergePos","modelViewMergeAfter","viewItemPrev","viewItemNext","viewModelConverter","getIndent","listItemModel","convertedChild","findNextListItem","viewToModelListItemChildrenConverter","cleanList","isList","cleanListItem","foundList","modelToViewPosition","topmostViewList","modelIndentPasteFixer","indentChange","hoistNestedLists","modelRemoveStartPosition","viewRemoveStartPosition","viewRemovedItem","prevModelItem","prevIndent","prevViewList","ListEditing","itemToListHead","applied","_addListToFix","innerItem","listHead","_fixListIndents","_fixListTypes","maxIndent","fixBy","typesStack","modelChangePostFixer","getViewListItemLength","viewPos","modelLength","viewListPrev","modelViewChangeIndent","modelViewRemove","ListUI","ListStyleCommand","defaultType","_tryToConvertItemsToList","numberedList","bulletedList","ListReversedCommand","ListStartCommand","startIndex","DEFAULT_LIST_TYPE","ListPropertiesEditing","strategies","enabledProperties","addCommand","appliesToListItem","listStyle","getAttributeOnUpcast","listParent","listReversed","listStart","startAttributeValue","createAttributeStrategies","strategy","attributeStrategies","changedItems","rootIndent","itemsToUpdate","fixListAfterIndentListCommand","fixListAfterOutdentListCommand","restoreDefaultListStyle","insertedListItems","getChangedListItems","existingListItem","shouldInheritListTypeFromPreviousItem","shouldInheritListType","fixListAttributesOnListItemElements","previousElement","areRepresentingSameList","listItem1","listItem2","downcastListItemAttributes","_mergeListAttributesWhileMergingLists","todoListItems","removeListItemAttributesFromTodoList","firstMostOuterItem","mostOuterItemList","secondListMostOuterItem","baseItem","itemToChange","attributeStrategy","baseListAttribute","previousItem","previousItemIndent","previousItemListAttribute","getItemFromChange","CollapsibleView","childViews","hidden","_collapsibleAriaLabelUid","ListPropertiesView","styleButtonViews","styleGridAriaLabel","stylesView","additionalPropertiesCollapsibleView","startIndexFieldView","reversedSwitchButtonView","elementCssClasses","focusCycler","_createStylesView","_addNumberedListPropertyViews","getPropertyValue","styleButtons","numberedPropertyViews","_createStartIndexField","_createReversedSwitchButton","valueAsNumber","checkValidity","reversedButtonView","ListPropertiesUI","getDropdownViewCreator","parentCommandName","buttonLabel","buttonIcon","styleDefinitions","parentCommand","mainButtonView","listPropertiesView","listStyleCommand","styleButtonCreator","getStyleButtonCreator","isStyleTypeSupported","styleDefinition","listStartCommand","listReversedCommand","isReversed","createListPropertiesView","modelToViewUrlAttributeConverter","registry","mediaContentElement","mediaViewElement","getMediaViewElement","getSelectedMediaViewWidget","isMediaWidget","createMediaFigureElement","getSelectedMediaModelWidget","insertMedia","mediaElement","MediaEmbedCommand","selectedMedia","isMediaSelected","isAllowedInParent","MediaRegistry","providers","extraProviders","removedProviders","removeProviders","providerDefinitions","provider","hasMedia","_getMedia","getViewElement","Media","previewRenderer","subPattern","_getUrlMatches","rawUrl","_getValidUrl","_locale","_match","_previewRenderer","renderForEditingView","renderMediaPreview","mediaHtml","_getPreviewHtml","_getPlaceholderHtml","outerHTML","MediaEmbedEditing","toMediaWidget","viewMedia","URL_REGEXP","AutoMediaEmbed","_timeoutId","_positionToInsert","leftLivePosition","rightLivePosition","_embedMediaBetweenPositions","leftPosition","rightPosition","mediaRegistry","urlRange","MediaFormView","validators","_validators","resetFormStatus","validator","_urlInputViewInfoDefault","inputField","_urlInputViewInfoTip","mediaURLInputValue","MediaEmbedUI","getFormValidators","PageBreakCommand","getInsertPageBreakParent","isPageBreakAllowedInParent","pageBreakElement","PageBreakEditing","viewLabelElement","toPageBreakWidget","hasPageBreakBefore","hasPageBreakAfter","viewSpan","PageBreakUI","transformListItemLikeElementsIntoLists","itemLikeElements","itemLikeElementsMatcher","itemData","getListItemData","order","findAllItemLikeElements","currentList","currentIndentation","itemLikeElement","isDifferentList","currentItem","isNewListNeeded","previousItemLikeElement","indentationDifference","listLikeItem","listStyleRegexp","listStyleTypeRegex","listStartIndexRegex","listStyleMatch","listStyleTypeMatch","bulletedStyle","listMarkerElement","textNodeOrElement","findListMarkerNode","listMarker","findBulletedListStyle","listStartIndexMatch","mapListStyleDefinition","detectListStyle","lastListItem","lastListItemChild","insertNewEmptyList","differentIndentation","listElement","parentList","levelChange","findParentListAtLevel","bulletMatcher","removeBulletElement","transformElementIntoListItem","idMatch","orderMatch","indentMatch","replaceImagesSourceWithBase64","rtfData","upcastWriter","shapesIds","shapeElementsMatcher","prevSiblingName","findAllShapesIds","imageElementsMatcher","imgs","shapes","shape","removeAllImgElementsRepresentingShapes","shapeIds","containsMatchingImg","findSrc","insertMissingImgs","removeAllShapeElements","findAllImageElementsWithLocalSource","imageElements","imagesHexSources","newSrc","_convertHexToBase64","replaceImagesFileSourceWithInlineRepresentation","regexPictureHeader","regexPicture","extractImageDataFromRtf","hexString","msWordMatch1","msWordMatch2","MSWordNormalizer","htmlString","_parsedData","findSibling","isBlockViewElement","googleDocsMatch","GoogleDocsNormalizer","removeBoldWrapper","unwrapParagraphInListItem","elementsToReplace","nextSiblingIsBlock","transformBlockBrsToParagraphs","googleSheetsMatch","GoogleSheetsNormalizer","removeGoogleSheetsTag","removeXmlns","removeInvalidTableWidth","normalizeSafariSpaceSpans","parseHtml","normalizedHtml","normalizeSpacing","bodyCloseTag","htmlCloseTag","bodyCloseIndex","htmlCloseIndex","cleanContentAfterBody","htmlDocument","htmlElement","innerTextLength","normalizeSpacerunSpans","bodyString","bodyView","documentToView","styleTags","getElementsByTagName","sheet","cssRules","extractStyles","REMOVE_FORMAT","RemoveFormatUI","RemoveFormatCommand","_getFormattingItems","_getFormattingAttributes","itemHasRemovableFormatting","curRange","RemoveFormatEditing","formatHtml","elementsToFormat","isVoid","elementNamesToFormat","lines","indentCount","isNonVoidOpeningTag","indentLine","isClosingTag","indentChar","COMMAND_FORCE_DISABLE_ID","formatSource","isHtml","SpecialCharactersNavigationView","groupNames","groupDropdownView","_createGroupDropdown","currentGroupName","groupDefinitions","_getCharacterGroupListItemDefinitions","groupDefs","CharacterGridView","tiles","createTile","tile","mouseover","CharacterInfoView","characterToUnicodeString","codePointAt","SpecialCharactersView","navigationView","gridView","infoView","ALL_SPECIAL_CHARACTERS_GROUP","SpecialCharactersArrows","addItems","SpecialCharactersCurrency","SpecialCharactersMathematical","SpecialCharactersLatin","SpecialCharactersText","STRIKETHROUGH","StrikethroughEditing","StrikethroughUI","StyleGridButtonView","previewView","_createPreview","previewTemplate","StyleGridView","gridTileView","activeStyles","enabledStyles","StyleGroupView","StylePanelView","blockStylesGroupView","inlineStylesGroupView","NON_PREVIEWABLE_ELEMENT_NAMES","StyleUtils","_htmlSupport","normalizeConfig","normalizedDefinitions","ghsAttributes","ghsDefinition","ghsBlockDefinition","getStylePreview","isStyleEnabledForBlock","getGhsAttributeNameForElement","isStyleActiveForBlock","ghsAttributeValue","hasAllClasses","getAffectedBlocks","isStyleEnabledForInlineSelection","isStyleActiveForInlineSelection","getAffectedInlineSelectable","configureGHSDataFilter","ghsDataFilter","normalizedStyleDefinitionToMatcherPattern","StyleUI","styleUtils","normalizedStyleDefinitions","styleCommand","StyleCommand","_styleDefinitions","_styleUtils","ancestorBlocks","htmlSupport","allDefinitions","activeDefinitions","shouldAddStyle","selectables","isBlockStyleDefinition","_findAffectedBlocks","getBlocksFromSelection","addModelHtmlClass","removeModelHtmlClass","getDefinitionExclusiveClasses","selectedBlocks","selectedBlock","affectedBlocks","affectedBlock","DocumentListStyleSupport","_documentListUtils","_isStyleEnabledForBlock","_isStyleActiveForBlock","_getAffectedBlocks","templateDefinition","_getStylePreview","isListItemBlock","expandListBlocksToCompleteItems","withNested","expandListBlocksToCompleteList","TableStyleSupport","_tableUtils","_isApplicable","location","getCellLocation","headingRows","headingColumns","isHeadingCell","row","column","LinkStyleSupport","_isStyleEnabled","_isStyleActive","_getAffectedSelectable","expandedRange","expandAttributePosition","referenceNode","StyleEditing","SUBSCRIPT","SubscriptEditing","SubscriptUI","SUPERSCRIPT","SuperscriptEditing","SuperscriptUI","upcastStyleToAttribute","reduceBoxSides","shouldUpcast","reduceBoxSidesValue","upcastBorderStyles","modelAttributes","defaultBorder","stylesToConsume","matcherPattern","normalizedBorder","reducedBorder","downcastAttributeToStyle","downcastTableAttribute","sides","topSideStyle","updateNumericAttribute","createEmptyTableCell","tableCell","isHeadingColumnCell","enableProperty","upcastTable","viewTable","rows","headRows","bodyRows","firstTheadElement","tableChild","trs","tr","headingCols","scanRowForHeadingColumns","scanTable","ensureParagraphInTableCell","th","TableWalker","_table","_startRow","startRow","_endRow","endRow","_startColumn","startColumn","_endColumn","endColumn","_includeAllSlots","includeAllSlots","_skipRows","_row","_rowIndex","_column","_cellIndex","_spannedCells","_nextCellAtColumn","_isOverEndRow","_isOverEndColumn","_advanceToNextRow","outValue","spanData","_getSpanned","_shouldSkipSlot","_formatOutValue","cell","colspan","rowspan","_recordSpans","skipRow","anchorRow","anchorColumn","TableSlot","rowIsMarkedAsSkipped","rowIsBeforeStartRow","columnIsBeforeStartColumn","columnIsAfterEndColumn","rowMap","rowToUpdate","columnToUpdate","_markSpannedCell","tableWalker","cellAnchorRow","cellAnchorColumn","isAnchor","cellWidth","cellHeight","rowIndex","getPositionBefore","downcastTable","tableElement","figureElement","additionalSlots","asWidget","toTableWidget","downcastCell","tableRow","tableSlot","cellElementName","convertParagraphInTableCell","isSingleParagraphWithoutAttributes","InsertTableCommand","validParent","defaultRows","defaultColumns","createTable","InsertRowCommand","isAnyCellSelected","getSelectionAffectedTableCells","insertAbove","affectedTableCells","rowIndexes","getRowIndexes","insertRows","at","copyStructureFromAbove","InsertColumnCommand","columnIndexes","getColumnIndexes","insertColumns","SplitCellCommand","selectedCells","splitCellHorizontally","splitCellVertically","cropTableToDimensions","sourceTable","cropDimensions","croppedTable","cropHeight","tableMap","sourceRow","sourceColumn","rowInCroppedTable","tableCellCopy","trimTableCellIfNeeded","addHeadingsToCroppedTable","getVerticallyOverlappingCells","overlapRow","cells","slotInfo","splitHorizontally","splitRow","newRowspan","newCellAttributes","newCellRowSpan","columnIndex","newCell","getHorizontallyOverlappingCells","overlapColumn","cellsToSplit","splitVertically","splitColumn","newColspan","newCellColSpan","cellRow","cellColumn","limitRow","limitColumn","removeEmptyColumns","getColumns","columnsMap","emptyColumns","cellsCount","emptyColumn","removeColumns","removeEmptyRows","emptyRows","tableRowCount","emptyRow","removeRows","removeEmptyRowsColumns","adjustLastRowIndex","dimensions","lastRowMap","firstColumn","lastColumn","lastRow","rowspanAdjustment","adjustLastColumnIndex","lastColumnMap","firstRow","colspanAdjustment","MergeCellCommand","isHorizontal","cellToMerge","_getMergeableCell","getTableCellsContainingSelection","isMergeNext","cellToExpand","cellToRemove","removedTableCellRow","mergeTableCells","spanAttribute","cellSpan","cellToMergeSpan","horizontalCell","hasHeadingColumns","cellOnLeft","cellOnRight","leftCellColumn","rightCellColumn","leftCellSpan","isCellOnLeftInHeadingColumn","isCellOnRightInHeadingColumn","getHorizontalCell","isMergeWithBodyCell","isMergeWithHeadCell","currentCellRowSpan","rowOfCellToMerge","currentCellData","mergeColumn","cellToMergeData","getVerticalCell","firstTableChild","RemoveRowCommand","firstCell","lastRowIndex","selectedRowIndexes","areAllRowsSelected","referenceCells","removedRowIndexes","columnIndexToFocus","rowsToRemove","cellToFocus","removedRowIndex","columnToFocus","getCellToFocus","RemoveColumnCommand","tableColumnCount","lastCell","returnValue","getBoundaryCells","removedColumnIndexes","columnsToRemove","SetHeaderRowCommand","isInTable","_isInHeading","headingRowsToSet","currentHeadingRows","overlappingCells","SetHeaderColumnCommand","headingColumnsToSet","TableUtils","createEmptyRows","rowsToInsert","isCopyStructure","copyStructureFrom","walkerEndRow","tableIterator","rowColSpansMap","lastCellRow","isReferenceRow","cellIndex","columnsToInsert","tableColumns","createCells","rowCount","indexesObject","cellsToMove","cellsToTrim","lastRowOfCell","rowSpanToSet","getCellsToMoveAndTrimOnRemoveRow","targetRowIndex","tableRowMap","previousCell","cellToMove","moveCellsToRow","updateHeadingRows","headingsRemoved","adjustHeadingColumns","removedColumnIndex","numberOfCells","newCellsSpan","updatedSpan","breakSpanEvenly","newCellsAttributes","cellsToInsert","splitCellColumn","cellsToUpdate","splitCellRow","rowspanToSet","createTableWalker","getSelectedTableCells","sortRanges","cellWithSelection","tableCells","indexes","_getFirstLastIndexesObject","isSelectionRectangular","selectedTableCells","_areCellInTheSameTableSection","areaOfSelectedCells","areaOfValidSelection","rowsIndexes","getBiggestRectangleArea","compareRangeOrder","allIndexesSorted","indexA","_areIndexesInSameSection","headingSectionSize","tableCellToInsert","MergeCellsCommand","firstTableCell","mergeWidth","mergeHeight","maxWidthOffset","maxHeightOffset","getMaxOffset","firstCellRow","firstCellColumn","getMergeDimensions","cellBeingMerged","targetCell","currentMaxOffset","dimensionValue","SelectRowCommand","rangesToSelect","SelectColumnCommand","startLocation","endLocation","cellInfo","injectTableLayoutPostFixer","analyzedTables","isTableAttributeEntry","fixTableCellsRowspan","fixTableRowsSizes","tableLayoutPostFixer","maxRows","rowLimit","findCellsToTrim","childrenLengths","lengths","getChildrenLengths","rowsLengths","tableSize","maxColumns","injectTableCellParagraphPostFixer","fixTable","fixTableRow","fixTableCellContent","checkTableCellChange","tableCellContentsPostFixer","textNodes","shouldRefresh","TableEditing","_additionalSlots","figureChild","getViewTableFromFigure","modelTable","upcastCellSpan","isRowChange","expectedElementName","tableHeadingsRefreshHandler","cellsToCheck","paragraphsToRefresh","tableCellRefreshHandler","registerAdditionalSlot","slotHandler","InsertTableView","_createGridCollection","_highlightGridBoxes","boxView","_createGridButton","boxes","TableUI","isContentLtr","insertTableView","bindIsOn","_prepareDropdown","_prepareMergeSplitButtonDropdown","_fillDropdownWithListOptions","mergeCommandName","mergeCommand","addListOption","TableSelection","_handleDeleteContent","_handleInsertTextEvent","_defineSelectionConverter","_enablePluginDisabling","getSelectionAsFragment","adjustedLastRow","adjustedLastColumn","setCellSelection","anchorCell","cellsToSelect","_getCellsToSelect","getFocusCell","getAnchorCell","highlighted","previouslyHighlighted","clearHighlightedTableCells","lastViewCell","tableCellToSelect","rangeToSelect","selectionMap","flipVertically","flipHorizontally","TableClipboard","_onCopyCut","_onInsertContent","tableSelection","dataController","pastedTable","getTableIfOnlyTableInContent","pastedDimensions","selectedTable","shouldExpandSelection","expectedHeight","expectedWidth","tableWidth","tableHeight","expandTableSize","doVerticalSplit","doHorizontalSplit","splitCellsToRectangularSelection","prepareTableForPasting","selectionHeight","selectionWidth","_replaceSelectedCellsWithPasted","pastedWidth","pastedHeight","pastedTableLocationMap","createLocationMap","selectedTableMap","pastedRow","pastedColumn","pastedCell","cellToInsert","newTableCell","_replaceTableSlotCell","areHeadingRowsIntersectingSelection","areHeadingColumnsIntersectingSelection","newCells","contentRange","rangeBefore","rangeAfter","limitColumns","isAffectedBySelection","limitRows","endIndex","TableKeyboard","_onArrowKey","_handleTabOnSelectedTable","_handleTab","bubblingEventInfo","currentRowIndex","currentCellIndex","isFirstCellInRow","isLastCellInRow","isLastRow","nextRow","previousRow","_handleArrowKeys","focusCell","_navigateFromCellInDirection","_isSelectionAtCellEdge","currentCellInfo","cellToSelect","positionToSelect","MouseEventsObserver","TableMouse","_enableShiftClickSelection","_enableMouseDragSelection","blockSelectionChange","_getModelTableCellFromDomEvent","haveSameTableParent","beganCellSelection","newTargetCell","viewTargetElement","cellA","cellB","injectTableCaptionPostFixer","captionsToMerge","firstCaption","tableCaptionPostFixer","isTable","getCaptionFromTableModelElement","tableModelElement","matchTableCaptionViewElement","getSelectionAffectedTable","ToggleTableCaptionCommand","_hideTableCaption","_showTableCaption","tableCaptionEditing","TableCaptionEditing","TableCaptionUI","ColorInputView","_createInputTextView","_stillTyping","_setInputValue","_createColorGrid","colorPreview","removeColorButton","blur","mappedColor","defaultColorValue","removeColorButtonLabel","normalizedInputValue","normalizeColor","getBorderStyleLabels","none","solid","dotted","dashed","double","groove","ridge","inset","outset","getLocalizedColorErrorText","getLocalizedLengthErrorText","colorFieldValidator","lengthFieldValidator","isNumberString","lineWidthFieldValidator","getBorderStyleDefinitions","defaultStyle","styleLabels","_borderStyleValue","fillToolbar","nameToValue","buttonValue","valueToCompare","defaultColors","getLabeledColorInputCreator","colorInputView","colorConfig","parsedValue","FormRowView","ALIGNMENT_ICONS","justify","middle","TableCellPropertiesView","borderStyle","borderWidth","borderColor","padding","horizontalAlignment","verticalAlignment","borderStyleDropdown","borderWidthInput","borderColorInput","borderRowLabel","_createBorderFields","backgroundRowLabel","backgroundInput","_createBackgroundFields","widthInput","operatorLabel","heightInput","dimensionsLabel","_createDimensionFields","horizontalAlignmentToolbar","verticalAlignmentToolbar","alignmentLabel","_createAlignmentFields","paddingInput","_createPaddingField","defaultTableCellProperties","colorInputCreator","borderColors","isBorderStyleSet","backgroundColors","isContentRTL","_horizontalAlignmentLabels","_verticalAlignmentLabels","fieldsThatShouldValidateToSave","errorTexts","getSelectedTableWidget","isTableWidget","getTableWidgetAncestor","DEFAULT_BALLOON_POSITIONS","BALLOON_POSITIONS","getBalloonCellPositionData","getBalloonTablePositionData","modelTableCell","getTableCellAtPosition","viewTableCell","createBoundingRect","getSingleValue","objectOrString","addDefaultUnitToNumericValue","defaultUnit","numericValue","getNormalizedDefaultProperties","includeAlignmentProperty","includePaddingProperty","includeVerticalAlignmentProperty","includeHorizontalAlignmentProperty","isRightToLeftContent","propertyToCommandMap","TableCellPropertiesUI","_defaultTableCellProperties","_isReady","isCommandEnabled","_createPropertiesView","borderColorsConfig","localizedBorderColors","backgroundColorsConfig","localizedBackgroundColors","_hideView","_isViewInBalloon","colorErrorText","lengthErrorText","_getPropertyChangeCallback","_getValidatedPropertyChangeCallback","viewField","_fillViewFormFromCommandValues","borderStyleCommand","_updateView","_isViewVisible","setErrorTextDebounced","TableCellPropertyCommand","_defaultValue","_getSingleValue","_getValueToSet","_getAttribute","firstCellValue","TableCellWidthCommand","TableCellWidthEditing","TableCellPaddingCommand","TableCellHeightCommand","TableCellBackgroundColorCommand","TableCellVerticalAlignmentCommand","TableCellHorizontalAlignmentCommand","TableCellBorderStyleCommand","TableCellBorderColorCommand","TableCellBorderWidthCommand","VALIGN_VALUES_REG_EXP","ALIGN_VALUES_REG_EXP","TableCellPropertiesEditing","enableBorderProperties","align","enableHorizontalAlignmentProperty","valign","enableVerticalAlignmentProperty","COLUMN_MIN_WIDTH_AS_PERCENTAGE","COLUMN_WIDTH_PRECISION","getColumnMinWidthAsPercentage","COLUMN_MIN_WIDTH_IN_PIXELS","getTableWidthInPixels","referenceElement","getChildrenViewElement","getElementWidthInPixels","boxSizing","paddingLeft","paddingRight","toPrecision","multiplier","sumArray","normalizeColumnWidths","columnWidths","normalizedWidths","numberOfUninitializedColumns","columnWidth","totalWidthOfInitializedColumns","widthForUninitializedColumn","calculateMissingColumnWidths","totalWidth","getDomCellOuterWidth","domCell","updateColumnElements","tableColumnGroup","getColumnGroupElement","getTableColumnElements","getTableColumnsWidths","TableWidthsCommand","widths","colGroupElement","TableColumnResizeEditing","_isResizingActive","_resizingData","_domEmitter","_tableUtilsPlugin","classAction","_extendSchema","_registerPostFixer","_registerResizingListeners","_registerResizerInserter","columnResizePlugin","tableWidthsCommand","isEditorReadOnly","isPluginEnabled","isTableWidthsCommandCommandEnabled","adjustColumnWidths","newTableColumnsCount","cellSet","getAffectedCells","currentColumnsDelta","hasMoreColumns","currentColumnIndex","columnMinWidthAsPercentage","columnWidthsToInsert","removedColumnWidths","affectedTables","referencePosition","tableNode","getChangedResizedTables","tableUtilsPlugin","columnElements","columnsCount","viewColWidth","_onMouseDownHandler","_onMouseMoveHandler","_onMouseUpHandler","_isResizingAllowed","columnWidthsInPx","cellSlot","viewCell","domCellWidth","_calculateDomColumnWidths","viewCol","colgroup","viewColElement","columnWidthInPc","_insertColgroupElement","_getResizingData","resizingData","figureInitialPcWidth","viewFigureWidth","viewFigureParentWidth","viewResizer","_applyResizingAttributesToTable","mouseEventData","columnPosition","isRightEdge","isTableCentered","viewLeftColumn","viewRightColumn","leftColumnWidth","rightColumnWidth","dxLowerBound","dxUpperBound","dx","leftColumnWidthAsPercentage","tableWidthAsPercentage","rightColumnWidthAsPercentage","viewColgroup","viewColumns","columnWidthsAttributeOld","columnWidthsAttributeNew","isColumnWidthsAttributeChanged","tableWidthAttributeOld","tableWidthAttributeNew","isTableWidthAttributeChanged","viewLeftCell","modelLeftCell","leftColumnIndex","cellColumnIndex","leftEdge","rightEdge","getColumnEdgesIndexes","TablePropertyCommand","TableBackgroundColorCommand","TableBorderColorCommand","TableBorderStyleCommand","TableBorderWidthCommand","TableWidthCommand","TableHeightCommand","TableAlignmentCommand","FLOAT_VALUES_REG_EXP","TablePropertiesEditing","defaultTableProperties","float","enableAlignmentProperty","enableTableToFigureProperty","TablePropertiesView","alignmentToolbar","backgroundInputCreator","_alignmentLabels","TablePropertiesUI","_defaultTableProperties","propertyKey","stringifyLanguageAttribute","textDirection","TextPartLanguageCommand","TextPartLanguageEditing","textPartLanguage","str","parseLanguageAttribute","TextPartLanguageUI","removeTitle","languageCommand","CheckTodoListCommand","_selectedElements","_getSelectedItems","dataViewModelCheckmarkInsertion","mapModelToViewPosition","descSpan","findDescription","createCheckmarkElement","isChecked","onChange","contenteditable","checkbox","ITEM_TOGGLE_KEYSTROKE","TodoListEditing","checkTodoListCommand","onCheckedChange","dataModelViewInsertion","onCheckboxChecked","checkmarkElement","_handleCheckmarkChange","labelElement","findLabel","descriptionStart","descriptionEnd","descriptionRange","descriptionSpan","oldCheckmarkElement","newCheckmarkElement","modelViewChangeChecked","jumpOverCheckmarkOnSideArrowKeyPress","listItemsToFix","previousSelectionRanges","TodoListUI","UNDERLINE","UnderlineEditing","UnderlineUI","modelElementToPlainText","_embedImageBetweenPositions","_addListAutoformats","_addBasicStylesAutoformats","_addHeadingAutoformats","_addBlockQuoteAutoformats","_addCodeBlockAutoformats","_addHorizontalLineAutoformats","boldCallback","italicCallback","codeCallback","strikethroughCallback","findAndReplaceEditing","normalizeSizeOptions","inlineDefinition","setModelHtmlAttributes","attributesMap","removeModelHtmlAttributes","setModelHtmlStyles","removeModelHtmlStyles","commentContent","comment","changedCommentMarkers","removedCommentMarkers","commentMarker","getMarkersGroup","removeHtmlComment","affectedCommentIDs","getHtmlCommentsInRange","skipBoundaries","commentMarkerID","createHtmlComment","commentID","getHtmlCommentData","includeBoundaries","isCommentMarkerInRange","_setupConversionUsingClasses","_setupConversionUsingOffset","indentCommand","outdentCommand","marginProperty","normalizers","_isTransformedWithPasteFromOffice","activeNormalizer","_replacedRoots","_dataFromRoots","hasAnyPendingActions","isSourceEditingMode","_isAllowedToHandleSourceEditingMode","_showSourceEditing","_disableCommands","_hideSourceEditing","_enableCommands","_handleReadOnlyMode","updateEditorData","domSourceEditingElementWrapper","oldData","domRootElement","domSourceEditingElementTextarea","setSelectionRange","_focusSourceEditing","textarea","readOnly","_characters","_groups","_allSpecialCharactersGroupLabel","inputCommand","dropdownPanelContent","_createDropdownPanelContent","specialCharactersView","_getGroup","getGroups","invalidGroup","getCharactersForGroup","getCharacter","_updateGrid","characterTitles","groupEntries","specialCharsGroups","tableContentToolbarItems","tableToolbarItems","include","_enableTransformationWatchers","normalizedTransformations","extra","isNotRemoved","transformation","definedTransformations","transformationOrGroup","expandGroupsAndRemoveDuplicates","normalizeTransformations","normalizedTransformation","replaces","matchedRange","replacePosition","replaceRange","defineProperties","characters","_getCharacters","words","_getWords","_outputView","_wordsMatchRegExp","_refreshStats","onUpdate","wordCountContainer","displayWords","displayCharacters","shouldNotGroupWhenFull","contentToolbar"],"sourceRoot":""}