{ "version": 3, "sources": ["../../javascript/jquery-shim.js", "../../../node_modules/slick-carousel/slick/slick.js", "../../../node_modules/@fullcalendar/core/main.esm.js", "../../../node_modules/@fullcalendar/daygrid/main.esm.js", "../../../node_modules/@fullcalendar/timegrid/main.esm.js", "../../../node_modules/@rails/ujs/app/assets/javascripts/rails-ujs.esm.js", "../../javascript/application.js", "../../../node_modules/es-toolkit/dist/predicate/isLength.mjs", "../../../node_modules/es-toolkit/dist/compat/predicate/isArrayLike.mjs", "../../../node_modules/es-toolkit/dist/function/identity.mjs", "../../../node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs", "../../../node_modules/es-toolkit/dist/compat/_internal/isDeepKey.mjs", "../../../node_modules/es-toolkit/dist/compat/_internal/toKey.mjs", "../../../node_modules/es-toolkit/dist/compat/util/toPath.mjs", "../../../node_modules/es-toolkit/dist/compat/object/get.mjs", "../../../node_modules/es-toolkit/dist/compat/object/property.mjs", "../../../node_modules/es-toolkit/dist/compat/predicate/isObject.mjs", "../../../node_modules/es-toolkit/dist/predicate/isPrimitive.mjs", "../../../node_modules/es-toolkit/dist/compat/util/eq.mjs", "../../../node_modules/es-toolkit/dist/compat/predicate/isMatchWith.mjs", "../../../node_modules/es-toolkit/dist/compat/predicate/isMatch.mjs", "../../../node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs", "../../../node_modules/es-toolkit/dist/compat/_internal/getTag.mjs", "../../../node_modules/es-toolkit/dist/compat/_internal/tags.mjs", "../../../node_modules/es-toolkit/dist/predicate/isTypedArray.mjs", "../../../node_modules/es-toolkit/dist/object/cloneDeepWith.mjs", "../../../node_modules/es-toolkit/dist/object/cloneDeep.mjs", "../../../node_modules/es-toolkit/dist/compat/predicate/matches.mjs", "../../../node_modules/es-toolkit/dist/compat/object/cloneDeepWith.mjs", "../../../node_modules/es-toolkit/dist/compat/object/cloneDeep.mjs", "../../../node_modules/es-toolkit/dist/compat/_internal/isIndex.mjs", "../../../node_modules/es-toolkit/dist/compat/predicate/isArguments.mjs", "../../../node_modules/es-toolkit/dist/compat/object/has.mjs", "../../../node_modules/es-toolkit/dist/compat/predicate/matchesProperty.mjs", "../../../node_modules/es-toolkit/dist/compat/util/iteratee.mjs", "../../../node_modules/es-toolkit/dist/compat/predicate/isObjectLike.mjs", "../../../node_modules/es-toolkit/dist/compat/predicate/isSymbol.mjs", "../../../node_modules/es-toolkit/dist/compat/util/toNumber.mjs", "../../../node_modules/es-toolkit/dist/compat/util/toFinite.mjs", "../../../node_modules/es-toolkit/dist/compat/util/toInteger.mjs", "../../../node_modules/es-toolkit/dist/compat/predicate/isString.mjs", "../../../node_modules/es-toolkit/dist/compat/_internal/isKey.mjs", "../../../node_modules/es-toolkit/dist/compat/predicate/isArray.mjs", "../../../node_modules/es-toolkit/dist/compat/_internal/assignValue.mjs", "../../../node_modules/es-toolkit/dist/compat/object/updateWith.mjs", "../../../node_modules/es-toolkit/dist/compat/object/set.mjs", "../../../node_modules/es-toolkit/dist/function/debounce.mjs", "../../../node_modules/es-toolkit/dist/compat/function/debounce.mjs", "../../../node_modules/es-toolkit/dist/compat/function/throttle.mjs", "../../../node_modules/es-toolkit/dist/compat/util/toString.mjs", "../../../node_modules/es-toolkit/dist/predicate/isPlainObject.mjs", "../../../node_modules/es-toolkit/dist/predicate/isEqualWith.mjs", "../../../node_modules/es-toolkit/dist/function/noop.mjs", "../../../node_modules/es-toolkit/dist/predicate/isEqual.mjs", "../../../node_modules/es-toolkit/dist/predicate/isBuffer.mjs", "../../../node_modules/es-toolkit/dist/compat/_internal/isPrototype.mjs", "../../../node_modules/es-toolkit/dist/compat/predicate/isTypedArray.mjs", "../../../node_modules/es-toolkit/dist/compat/util/times.mjs", "../../../node_modules/es-toolkit/dist/compat/object/keysIn.mjs", "../../../node_modules/es-toolkit/dist/compat/object/assignIn.mjs", "../../../node_modules/es-toolkit/dist/compat/object/clone.mjs", "../../../node_modules/es-toolkit/dist/compat/predicate/isPlainObject.mjs", "../../../node_modules/es-toolkit/dist/object/mapValues.mjs", "../../../node_modules/es-toolkit/dist/compat/object/mapValues.mjs", "../../../node_modules/es-toolkit/dist/object/clone.mjs", "../../../node_modules/es-toolkit/dist/compat/object/mergeWith.mjs", "../../../node_modules/es-toolkit/dist/compat/object/merge.mjs", "../../../node_modules/es-toolkit/dist/compat/predicate/isFunction.mjs", "../../../node_modules/es-toolkit/dist/compat/predicate/isElement.mjs", "../../../node_modules/es-toolkit/dist/function/after.mjs", "../../../node_modules/es-toolkit/dist/compat/predicate/isEqualWith.mjs", "../../../node_modules/es-toolkit/dist/string/upperFirst.mjs", "../../../node_modules/es-toolkit/dist/compat/string/upperFirst.mjs", "../../../node_modules/@ckeditor/ckeditor5-utils/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/global.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/env.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/fastdiff.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/diff.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/difftochanges.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/areconnectedthroughproperties.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/spy.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/eventinfo.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/uid.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/priorities.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/inserttopriorityarray.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/ckeditorerror.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/version.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/emittermixin.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/observablemixin.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/elementreplacer.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/abortabledebounce.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/count.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/comparearrays.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/isiterable.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/createelement.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/config.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/isnode.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/iswindow.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/emittermixin.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/findclosestscrollableancestor.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/getancestors.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/getdatafromelement.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/getborderwidths.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/getrangefrommouseevent.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/getcommonancestor.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/getpositionedancestor.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/istext.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/isrange.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/rect.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/resizeobserver.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/setdatainelement.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/tounit.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/indexof.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/insertat.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/iscomment.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/isvalidattributename.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/isvisible.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/position.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/remove.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/getvisualviewportoffset.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/dom/scroll.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/keyboard.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/language.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/toarray.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/translation-service.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/locale.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/collection.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/first.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/nth.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/focustracker.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/keystrokehandler.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/objecttomap.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/tomap.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/mapsequal.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/wait.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/retry.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/splicearray.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/delay.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/parsebase64encodedobject.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/crc32.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/collectstylesheets.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/formathtml.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/unicode.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/decodelicensekey.ts", "../../../node_modules/@ckeditor/ckeditor5-utils/src/isfeatureblockedbylicensekey.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/placeholder.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/typecheckable.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/node.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/text.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/textproxy.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/conversion/viewconsumable.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/matcher.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/stylesmap.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/tokenlist.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/element.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/containerelement.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/editableelement.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/rooteditableelement.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/treewalker.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/position.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/range.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/selection.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/documentselection.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingeventinfo.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/observer/bubblingemittermixin.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/document.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/attributeelement.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/emptyelement.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/uielement.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/rawelement.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/documentfragment.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/downcastwriter.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/filler.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/renderer.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/domconverter.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/observer/observer.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventdata.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/observer/domeventobserver.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/observer/keyobserver.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/observer/fakeselectionobserver.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mutationobserver.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/observer/focusobserver.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/observer/selectionobserver.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/observer/compositionobserver.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/datatransfer.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/observer/inputobserver.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/observer/arrowkeysobserver.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/observer/tabobserver.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/view.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/typecheckable.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/textproxy.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/treewalker.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/position.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/range.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/conversion/mapper.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/conversion/modelconsumable.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcastdispatcher.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/node.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/selection.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/liverange.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/text.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/documentselection.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/nodelist.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/element.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversionhelpers.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/conversion/downcasthelpers.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/utils/autoparagraphing.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcasthelpers.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/controller/editingcontroller.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/schema.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/conversion/upcastdispatcher.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/basichtmlwriter.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/controller/datacontroller.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/conversion/conversion.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/dataprocessor/xmldataprocessor.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operation.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/operation/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/operation/moveoperation.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/operation/insertoperation.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/operation/splitoperation.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/operation/mergeoperation.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/operation/markeroperation.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/operation/attributeoperation.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/operation/nooperation.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/operation/renameoperation.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootattributeoperation.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/operation/rootoperation.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/operation/operationfactory.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/operation/transform.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/liveposition.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/batch.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/differ.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/history.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/rootelement.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/document.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/markercollection.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/operation/detachoperation.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/documentfragment.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/writer.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/utils/selection-post-fixer.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/utils/deletecontent.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/utils/getselectedcontent.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/utils/insertcontent.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/utils/insertobject.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/utils/modifyselection.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/model/model.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/observer/clickobserver.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/observer/mouseobserver.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/observer/touchobserver.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/observer/pointerobserver.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/upcastwriter.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/styles/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/styles/background.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/styles/border.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/styles/margin.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/view/styles/padding.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/dev-utils/view.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/dev-utils/model.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/dev-utils/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-engine/src/dev-utils/operationreplayer.ts", "../../../node_modules/@ckeditor/ckeditor5-watchdog/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-watchdog/src/watchdog.ts", "../../../node_modules/@ckeditor/ckeditor5-watchdog/src/utils/getsubnodes.ts", "../../../node_modules/@ckeditor/ckeditor5-watchdog/src/utils/areconnectedthroughproperties.ts", "../../../node_modules/@ckeditor/ckeditor5-watchdog/src/editorwatchdog.ts", "../../../node_modules/@ckeditor/ckeditor5-watchdog/src/contextwatchdog.ts", "../../../node_modules/@ckeditor/ckeditor5-watchdog/src/actionsrecorder.ts", "../../../node_modules/@ckeditor/ckeditor5-core/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-core/src/plugin.ts", "../../../node_modules/@ckeditor/ckeditor5-core/src/command.ts", "../../../node_modules/@ckeditor/ckeditor5-core/src/multicommand.ts", "../../../node_modules/@ckeditor/ckeditor5-core/src/commandcollection.ts", "../../../node_modules/@ckeditor/ckeditor5-core/src/plugincollection.ts", "../../../node_modules/@ckeditor/ckeditor5-core/src/context.ts", "../../../node_modules/@ckeditor/ckeditor5-core/src/contextplugin.ts", "../../../node_modules/@ckeditor/ckeditor5-core/src/editingkeystrokehandler.ts", "../../../node_modules/@ckeditor/ckeditor5-core/src/accessibility.ts", "../../../node_modules/@ckeditor/ckeditor5-core/src/editor/utils/editorusagedata.ts", "../../../node_modules/@ckeditor/ckeditor5-core/src/editor/editor.ts", "../../../node_modules/@ckeditor/ckeditor5-core/src/editor/utils/attachtoform.ts", "../../../node_modules/@ckeditor/ckeditor5-core/src/editor/utils/elementapimixin.ts", "../../../node_modules/@ckeditor/ckeditor5-core/src/editor/utils/securesourceelement.ts", "../../../node_modules/@ckeditor/ckeditor5-core/src/pendingactions.ts", "../../../node_modules/@ckeditor/ckeditor5-icons/dist/index.js", "../../../node_modules/color-name/index.js", "../../../node_modules/color-convert/conversions.js", "../../../node_modules/color-convert/route.js", "../../../node_modules/color-convert/index.js", "../../../node_modules/@ckeditor/ckeditor5-ui/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-ui/src/viewcollection.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/template.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/view.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/arialiveannouncer.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/bindings/csstransitiondisablermixin.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/bindings/draggableviewmixin.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/bindings/submithandler.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/bindings/addkeyboardhandlingforgrid.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/label/labelview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/editorui/accessibilityhelp/accessibilityhelpcontentview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/icon/iconview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/button/buttonlabelview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/button/buttonview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/formheader/formheaderview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/focuscycler.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/dialog/dialogactionsview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/dialog/dialogcontentview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/dialog/dialogview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/dialog/dialog.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/button/listitembuttonview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/menubar/menubarmenulistitembuttonview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/editorui/accessibilityhelp/accessibilityhelp.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/editorui/bodycollection.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/balloonpanelview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/badge/badge.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/editorui/poweredby.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/button/switchbuttonview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/button/filedialogbuttonview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/collapsible/collapsibleview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colortileview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/colorgrid/colorgridview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/colorpicker/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/input/inputbase.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/input/inputview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/inputtext/inputtextview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/inputnumber/inputnumberview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/textarea/textareaview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownpanelview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/dropdown/dropdownview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbuttonview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/dropdown/menu/dropdownmenulistitembuttonview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/dropdown/menu/dropdownmenubuttonview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/list/listitemview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/list/listseparatorview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/list/listitemgroupview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/list/listview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/dropdown/menu/dropdownmenulistview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/dropdown/menu/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/dropdown/menu/dropdownmenulistitemview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/dropdown/menu/dropdownmenubehaviors.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/dropdown/menu/dropdownmenunestedmenupanelview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/dropdown/menu/dropdownmenunestedmenuview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/dropdown/menu/dropdownmenurootlistview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarseparatorview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarlinebreakview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/bindings/preventdefault.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/toolbar/toolbarview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/dropdown/button/splitbuttonview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/dropdown/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/labeledfield/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/colorpicker/colorpickerview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/colorselector/documentcolorcollection.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/colorselector/colorgridsfragmentview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/colorselector/colorpickerfragmentview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/colorselector/colorselectorview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/componentfactory.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/tooltipmanager.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/editorui/evaluationbadge.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/menubar/menubarmenulistitemview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/menubar/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/editorui/editorui.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/editorui/editoruiview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/editorui/boxed/boxededitoruiview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/editableui/editableuiview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/editableui/inline/inlineeditableuiview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/formrow/formrowview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/iframe/iframeview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/labeledinput/labeledinputview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/search/filtergroupanditemnames.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/notification/notification.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/model.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/panel/balloon/contextualballoon.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/panel/sticky/stickypanelview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/search/text/searchtextqueryview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/search/searchinfoview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/search/searchresultsview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/search/text/searchtextview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/autocomplete/autocompleteview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/highlightedtext/highlightedtextview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/highlightedtext/buttonlabelwithhighlightview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/highlightedtext/labelwithhighlightview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/spinner/spinnerview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/toolbar/balloon/balloontoolbar.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blockbuttonview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/toolbar/block/blocktoolbar.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/menubar/menubarmenubuttonview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/menubar/menubarmenupanelview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/menubar/menubarmenuview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/menubar/menubarmenulistview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/menubar/menubarmenulistitemfiledialogbuttonview.ts", "../../../node_modules/@ckeditor/ckeditor5-ui/src/menubar/menubarview.ts", "../../../node_modules/@ckeditor/ckeditor5-typing/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-typing/src/utils/changebuffer.ts", "../../../node_modules/@ckeditor/ckeditor5-typing/src/inserttextcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-typing/src/inserttextobserver.ts", "../../../node_modules/@ckeditor/ckeditor5-typing/src/input.ts", "../../../node_modules/@ckeditor/ckeditor5-typing/src/deletecommand.ts", "../../../node_modules/@ckeditor/ckeditor5-typing/src/deleteobserver.ts", "../../../node_modules/@ckeditor/ckeditor5-typing/src/delete.ts", "../../../node_modules/@ckeditor/ckeditor5-typing/src/typing.ts", "../../../node_modules/@ckeditor/ckeditor5-typing/src/utils/getlasttextline.ts", "../../../node_modules/@ckeditor/ckeditor5-typing/src/textwatcher.ts", "../../../node_modules/@ckeditor/ckeditor5-typing/src/twostepcaretmovement.ts", "../../../node_modules/@ckeditor/ckeditor5-typing/src/texttransformation.ts", "../../../node_modules/@ckeditor/ckeditor5-typing/src/utils/findattributerange.ts", "../../../node_modules/@ckeditor/ckeditor5-typing/src/utils/inlinehighlight.ts", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.ts", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldediting.ts", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/src/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldui.ts", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/src/bold.ts", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/src/code/codeediting.ts", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/src/code/codeui.ts", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/src/code.ts", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicediting.ts", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicui.ts", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/src/italic.ts", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughediting.ts", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughui.ts", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough.ts", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptediting.ts", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptui.ts", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript.ts", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptediting.ts", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptui.ts", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript.ts", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineediting.ts", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineui.ts", "../../../node_modules/@ckeditor/ckeditor5-basic-styles/src/underline.ts", "../../../node_modules/@ckeditor/ckeditor5-enter/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-enter/src/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-enter/src/entercommand.ts", "../../../node_modules/@ckeditor/ckeditor5-enter/src/enterobserver.ts", "../../../node_modules/@ckeditor/ckeditor5-enter/src/enter.ts", "../../../node_modules/@ckeditor/ckeditor5-enter/src/shiftentercommand.ts", "../../../node_modules/@ckeditor/ckeditor5-enter/src/shiftenter.ts", "../../../node_modules/@ckeditor/ckeditor5-block-quote/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-block-quote/src/blockquotecommand.ts", "../../../node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteediting.ts", "../../../node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteui.ts", "../../../node_modules/@ckeditor/ckeditor5-block-quote/src/blockquote.ts", "../../../node_modules/@ckeditor/ckeditor5-widget/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-widget/src/highlightstack.ts", "../../../node_modules/@ckeditor/ckeditor5-widget/src/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-widget/src/widgettypearound/widgettypearound.ts", "../../../node_modules/@ckeditor/ckeditor5-widget/src/verticalnavigation.ts", "../../../node_modules/@ckeditor/ckeditor5-widget/src/widget.ts", "../../../node_modules/@ckeditor/ckeditor5-widget/src/widgettoolbarrepository.ts", "../../../node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizerstate.ts", "../../../node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/sizeview.ts", "../../../node_modules/@ckeditor/ckeditor5-widget/src/widgetresize/resizer.ts", "../../../node_modules/@ckeditor/ckeditor5-widget/src/widgetresize.ts", "../../../node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.ts", "../../../node_modules/@ckeditor/ckeditor5-clipboard/src/utils/plaintexttohtml.ts", "../../../node_modules/@ckeditor/ckeditor5-clipboard/src/utils/normalizeclipboarddata.ts", "../../../node_modules/@ckeditor/ckeditor5-clipboard/src/utils/viewtoplaintext.ts", "../../../node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardmarkersutils.ts", "../../../node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.ts", "../../../node_modules/@ckeditor/ckeditor5-clipboard/src/lineview.ts", "../../../node_modules/@ckeditor/ckeditor5-clipboard/src/dragdroptarget.ts", "../../../node_modules/@ckeditor/ckeditor5-clipboard/src/dragdropblocktoolbar.ts", "../../../node_modules/@ckeditor/ckeditor5-clipboard/src/dragdrop.ts", "../../../node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.ts", "../../../node_modules/@ckeditor/ckeditor5-clipboard/src/clipboard.ts", "../../../node_modules/@ckeditor/ckeditor5-editor-classic/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditorui.ts", "../../../node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditoruiview.ts", "../../../node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.ts", "../../../node_modules/@ckeditor/ckeditor5-select-all/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-select-all/src/selectallcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-select-all/src/selectallediting.ts", "../../../node_modules/@ckeditor/ckeditor5-select-all/src/selectallui.ts", "../../../node_modules/@ckeditor/ckeditor5-select-all/src/selectall.ts", "../../../node_modules/@ckeditor/ckeditor5-undo/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-undo/src/basecommand.ts", "../../../node_modules/@ckeditor/ckeditor5-undo/src/undocommand.ts", "../../../node_modules/@ckeditor/ckeditor5-undo/src/redocommand.ts", "../../../node_modules/@ckeditor/ckeditor5-undo/src/undoediting.ts", "../../../node_modules/@ckeditor/ckeditor5-undo/src/undoui.ts", "../../../node_modules/@ckeditor/ckeditor5-undo/src/undo.ts", "../../../node_modules/@ckeditor/ckeditor5-essentials/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-essentials/src/essentials.ts", "../../../node_modules/@ckeditor/ckeditor5-font/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-font/src/fontcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-font/src/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-font/src/fontfamily/fontfamilycommand.ts", "../../../node_modules/@ckeditor/ckeditor5-font/src/fontfamily/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-font/src/fontfamily/fontfamilyediting.ts", "../../../node_modules/@ckeditor/ckeditor5-font/src/fontfamily/fontfamilyui.ts", "../../../node_modules/@ckeditor/ckeditor5-font/src/fontfamily.ts", "../../../node_modules/@ckeditor/ckeditor5-font/src/fontsize/fontsizecommand.ts", "../../../node_modules/@ckeditor/ckeditor5-font/src/fontsize/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-font/src/fontsize/fontsizeediting.ts", "../../../node_modules/@ckeditor/ckeditor5-font/src/fontsize/fontsizeui.ts", "../../../node_modules/@ckeditor/ckeditor5-font/src/fontsize.ts", "../../../node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorediting.ts", "../../../node_modules/@ckeditor/ckeditor5-font/src/ui/colorui.ts", "../../../node_modules/@ckeditor/ckeditor5-font/src/fontcolor/fontcolorui.ts", "../../../node_modules/@ckeditor/ckeditor5-font/src/fontcolor.ts", "../../../node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorediting.ts", "../../../node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor/fontbackgroundcolorui.ts", "../../../node_modules/@ckeditor/ckeditor5-font/src/fontbackgroundcolor.ts", "../../../node_modules/@ckeditor/ckeditor5-font/src/font.ts", "../../../node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-paragraph/src/insertparagraphcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.ts", "../../../node_modules/@ckeditor/ckeditor5-paragraph/src/paragraphbuttonui.ts", "../../../node_modules/@ckeditor/ckeditor5-heading/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-heading/src/headingcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-heading/src/headingediting.ts", "../../../node_modules/@ckeditor/ckeditor5-heading/src/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-heading/src/headingui.ts", "../../../node_modules/@ckeditor/ckeditor5-heading/src/heading.ts", "../../../node_modules/@ckeditor/ckeditor5-heading/src/headingbuttonsui.ts", "../../../node_modules/@ckeditor/ckeditor5-heading/src/title.ts", "../../../node_modules/@ckeditor/ckeditor5-image/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-image/src/image/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageutils.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/autoimage.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativecommand.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeediting.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/ui/textalternativeformview.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/image/ui/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative/imagetextalternativeui.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imagetextalternative.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/image/converters.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/image/imageloadobserver.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/image/insertimagecommand.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/image/replaceimagesourcecommand.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/image/imageediting.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imagesizeattributes.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/image/imagetypecommand.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/image/imageplaceholder.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/image/imageblockediting.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageinsert/ui/imageinsertformview.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageinsert/imageinsertui.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageblock.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/image/imageinlineediting.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageinline.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/image.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionutils.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imagecaption/toggleimagecaptioncommand.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionediting.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imagecaption/imagecaptionui.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imagecaption.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageupload/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadui.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadprogress.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageupload/uploadimagecommand.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageupload/imageuploadediting.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageupload.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageinsert/ui/imageinserturlview.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageinsert/imageinsertviaurlui.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageinsertviaurl.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageinsert.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageresize/resizeimagecommand.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizeediting.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizebuttons.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageresize/imageresizehandles.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageresize/utils/tryparsedimensionwithunit.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageresize/utils/getselectedimageeditornodes.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageresize/utils/getselectedimagewidthinunits.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageresize/ui/imagecustomresizeformview.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageresize/utils/getselectedimagepossibleresizerange.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageresize/imagecustomresizeui.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imageresize.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestylecommand.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imagestyle/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imagestyle/converters.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleediting.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imagestyle/imagestyleui.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imagestyle.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/imagetoolbar.ts", "../../../node_modules/@ckeditor/ckeditor5-image/src/pictureediting.ts", "../../../node_modules/@ckeditor/ckeditor5-indent/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-indent/src/indentediting.ts", "../../../node_modules/@ckeditor/ckeditor5-indent/src/indentui.ts", "../../../node_modules/@ckeditor/ckeditor5-indent/src/indent.ts", "../../../node_modules/@ckeditor/ckeditor5-indent/src/indentblockcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-indent/src/indentcommandbehavior/indentusingoffset.ts", "../../../node_modules/@ckeditor/ckeditor5-indent/src/indentcommandbehavior/indentusingclasses.ts", "../../../node_modules/@ckeditor/ckeditor5-indent/src/indentblock.ts", "../../../node_modules/@ckeditor/ckeditor5-link/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-link/src/utils/automaticdecorators.ts", "../../../node_modules/@ckeditor/ckeditor5-link/src/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-link/src/linkcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-link/src/unlinkcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-link/src/utils/manualdecorator.ts", "../../../node_modules/@ckeditor/ckeditor5-link/src/linkediting.ts", "../../../node_modules/@ckeditor/ckeditor5-link/src/ui/linkpreviewbuttonview.ts", "../../../node_modules/@ckeditor/ckeditor5-link/src/ui/linkformview.ts", "../../../node_modules/@ckeditor/ckeditor5-link/src/ui/linkprovideritemsview.ts", "../../../node_modules/@ckeditor/ckeditor5-link/src/ui/linkpropertiesview.ts", "../../../node_modules/@ckeditor/ckeditor5-link/src/ui/linkbuttonview.ts", "../../../node_modules/@ckeditor/ckeditor5-link/src/linkui.ts", "../../../node_modules/@ckeditor/ckeditor5-link/src/autolink.ts", "../../../node_modules/@ckeditor/ckeditor5-link/src/link.ts", "../../../node_modules/@ckeditor/ckeditor5-link/src/linkimageediting.ts", "../../../node_modules/@ckeditor/ckeditor5-link/src/linkimageui.ts", "../../../node_modules/@ckeditor/ckeditor5-link/src/linkimage.ts", "../../../node_modules/@ckeditor/ckeditor5-list/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-list/src/list/utils/listwalker.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/list/utils/model.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/list/listindentcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/list/listcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/list/listmergecommand.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/list/listsplitcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/listformatting/listitemboldintegration.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/listformatting/listitemitalicintegration.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/listformatting/listitemfontsizeintegration.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/listformatting/listitemfontcolorintegration.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/listformatting/listitemfontfamilyintegration.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/listformatting.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/list/listutils.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/list/utils/view.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/list/utils/postfixers.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/list/converters.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/list/listediting.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/list/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/list/listui.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/list.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/listproperties/liststartcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/listproperties/utils/style.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/listproperties/liststylecommand.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/listproperties/listreversedcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/listproperties/converters.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/listproperties/listpropertiesutils.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/listproperties/utils/config.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/listproperties/listpropertiesediting.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/listproperties/ui/listpropertiesview.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/listproperties/listpropertiesui.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/listproperties.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/todolist/checktodolistcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/todolist/todocheckboxchangeobserver.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/todolist/todolistediting.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/todolist/todolistui.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/todolist.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/legacylist/legacylistcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/legacylist/legacyindentcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/legacylist/legacyutils.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/legacylist/legacylistutils.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/legacylist/legacyconverters.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/legacylist/legacylistediting.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/legacylist.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/legacylistproperties/legacyliststylecommand.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/legacylistproperties/legacylistreversedcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/legacylistproperties/legacyliststartcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/legacylistproperties/legacylistpropertiesediting.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/legacylistproperties.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/legacytodolist/legacychecktodolistcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/legacytodolist/legacytodolistconverters.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/legacytodolist/legacytodolistediting.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/legacytodolist.ts", "../../../node_modules/@ckeditor/ckeditor5-list/src/list/adjacentlistssupport.ts", "../../../node_modules/@ckeditor/ckeditor5-mention/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-mention/src/mentioncommand.ts", "../../../node_modules/@ckeditor/ckeditor5-mention/src/mentionediting.ts", "../../../node_modules/@ckeditor/ckeditor5-mention/src/ui/mentionsview.ts", "../../../node_modules/@ckeditor/ckeditor5-mention/src/ui/domwrapperview.ts", "../../../node_modules/@ckeditor/ckeditor5-mention/src/ui/mentionlistitemview.ts", "../../../node_modules/@ckeditor/ckeditor5-mention/src/mentionui.ts", "../../../node_modules/@ckeditor/ckeditor5-mention/src/mention.ts", "../../../node_modules/@ckeditor/ckeditor5-paste-from-office/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/bookmark.ts", "../../../node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/list.ts", "../../../node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/image.ts", "../../../node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removemsattributes.ts", "../../../node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/table.ts", "../../../node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removeinvalidtablewidth.ts", "../../../node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/replacemsfootnotes.ts", "../../../node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/mswordnormalizer.ts", "../../../node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removeboldwrapper.ts", "../../../node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/br.ts", "../../../node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/replacetabswithinprewithspaces.ts", "../../../node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/googledocsnormalizer.ts", "../../../node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removexmlns.ts", "../../../node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removegooglesheetstag.ts", "../../../node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/removestyleblock.ts", "../../../node_modules/@ckeditor/ckeditor5-paste-from-office/src/normalizers/googlesheetsnormalizer.ts", "../../../node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/space.ts", "../../../node_modules/@ckeditor/ckeditor5-paste-from-office/src/filters/parse.ts", "../../../node_modules/@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice.ts", "../../../node_modules/@ckeditor/ckeditor5-table/dist/index.js", "../../../node_modules/@ckeditor/ckeditor5-table/src/converters/tableproperties.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/utils/common.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablewalker.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/utils/structure.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/converters/upcasttable.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/utils/table-properties.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/converters/downcast.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/commands/inserttablecommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/commands/insertrowcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/commands/insertcolumncommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/commands/splitcellcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/commands/removerowcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/commands/removecolumncommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/commands/setheaderrowcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/commands/setheadercolumncommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecolumnresize/constants.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecolumnresize/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tableutils.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/commands/mergecellscommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/commands/selectrowcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/commands/selectcolumncommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/converters/table-layout-post-fixer.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-paragraph-post-fixer.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/converters/table-headings-refresh-handler.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/converters/table-cell-refresh-handler.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tableediting.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/ui/inserttableview.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tableui.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tableselection.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tableclipboard.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablekeyboard.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablemouse/mouseeventsobserver.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablemouse.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/table.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/plaintableoutput.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/utils/ui/widget.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tabletoolbar.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/ui/colorinputview.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/utils/ui/table-properties.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/ui/tablecellpropertiesview.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/utils/ui/contextualballoon.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/tablecellpropertiesui.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellpropertycommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecellwidth/commands/tablecellwidthcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecellwidth/tablecellwidthediting.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellpaddingcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellheightcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellbackgroundcolorcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellverticalalignmentcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellhorizontalalignmentcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellborderstylecommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellbordercolorcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/commands/tablecellborderwidthcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/tablecellpropertiesediting.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablelayout/tablelayoutui.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/commands/inserttablelayoutcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecolumnresize/tablewidthscommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecolumnresize/converters.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecolumnresize/tablecolumnresizeediting.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecolumnresize.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablelayout/commands/tabletypecommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablelayout/tablelayoutediting.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablelayout.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tablepropertycommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tablebackgroundcolorcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tablebordercolorcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tableborderstylecommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tableborderwidthcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tablewidthcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tableheightcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tableproperties/commands/tablealignmentcommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tableproperties/tablepropertiesediting.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tableproperties/ui/tablepropertiesview.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tableproperties/tablepropertiesui.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tableproperties.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/converters/table-caption-post-fixer.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecaption/utils.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecaption/toggletablecaptioncommand.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecaption/tablecaptionediting.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecaption/tablecaptionui.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecaption.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/utils/ui/table-propertiesexperimental.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tableproperties/ui/tablepropertiesviewexperimental.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tableproperties/tablepropertiesuiexperimental.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/ui/tablecellpropertiesviewexperimental.ts", "../../../node_modules/@ckeditor/ckeditor5-table/src/tablecellproperties/tablecellpropertiesuiexperimental.ts"], "sourcesContent": ["// Shim to make CDN-loaded jQuery available to CommonJS modules\nmodule.exports = window.jQuery;\n", "/*\n _ _ _ _\n ___| (_) ___| | __ (_)___\n/ __| | |/ __| |/ / | / __|\n\\__ \\ | | (__| < _ | \\__ \\\n|___/_|_|\\___|_|\\_(_)/ |___/\n |__/\n\n Version: 1.8.1\n Author: Ken Wheeler\n Website: http://kenwheeler.github.io\n Docs: http://kenwheeler.github.io/slick\n Repo: http://github.com/kenwheeler/slick\n Issues: http://github.com/kenwheeler/slick/issues\n\n */\n/* global window, document, define, jQuery, setInterval, clearInterval */\n;(function(factory) {\n 'use strict';\n if (typeof define === 'function' && define.amd) {\n define(['jquery'], factory);\n } else if (typeof exports !== 'undefined') {\n module.exports = factory(require('jquery'));\n } else {\n factory(jQuery);\n }\n\n}(function($) {\n 'use strict';\n var Slick = window.Slick || {};\n\n Slick = (function() {\n\n var instanceUid = 0;\n\n function Slick(element, settings) {\n\n var _ = this, dataSettings;\n\n _.defaults = {\n accessibility: true,\n adaptiveHeight: false,\n appendArrows: $(element),\n appendDots: $(element),\n arrows: true,\n asNavFor: null,\n prevArrow: '',\n nextArrow: '',\n autoplay: false,\n autoplaySpeed: 3000,\n centerMode: false,\n centerPadding: '50px',\n cssEase: 'ease',\n customPaging: function(slider, i) {\n return $('');\n buttonEl.addEventListener('click', buttonClick);\n groupChildren.push(buttonEl);\n }\n }\n });\n if (groupChildren.length > 1) {\n groupEl = document.createElement('div');\n var buttonGroupClassName = theme.getClass('buttonGroup');\n if (isOnlyButtons && buttonGroupClassName) {\n groupEl.classList.add(buttonGroupClassName);\n }\n appendToElement(groupEl, groupChildren);\n sectionEl.appendChild(groupEl);\n }\n else {\n appendToElement(sectionEl, groupChildren); // 1 or 0 children\n }\n });\n }\n return sectionEl;\n };\n Toolbar.prototype.updateToday = function (isTodayEnabled) {\n this.toggleButtonEnabled('today', isTodayEnabled);\n };\n Toolbar.prototype.updatePrev = function (isPrevEnabled) {\n this.toggleButtonEnabled('prev', isPrevEnabled);\n };\n Toolbar.prototype.updateNext = function (isNextEnabled) {\n this.toggleButtonEnabled('next', isNextEnabled);\n };\n Toolbar.prototype.updateTitle = function (text) {\n findElements(this.el, 'h2').forEach(function (titleEl) {\n titleEl.innerText = text;\n });\n };\n Toolbar.prototype.updateActiveButton = function (buttonName) {\n var theme = this.context.theme;\n var className = theme.getClass('buttonActive');\n findElements(this.el, 'button').forEach(function (buttonEl) {\n if (buttonName && buttonEl.classList.contains('fc-' + buttonName + '-button')) {\n buttonEl.classList.add(className);\n }\n else {\n buttonEl.classList.remove(className);\n }\n });\n };\n Toolbar.prototype.toggleButtonEnabled = function (buttonName, bool) {\n findElements(this.el, '.fc-' + buttonName + '-button').forEach(function (buttonEl) {\n buttonEl.disabled = !bool;\n });\n };\n return Toolbar;\n}(Component));\n\nvar CalendarComponent = /** @class */ (function (_super) {\n __extends(CalendarComponent, _super);\n function CalendarComponent(el) {\n var _this = _super.call(this) || this;\n _this.elClassNames = [];\n _this.renderSkeleton = memoizeRendering(_this._renderSkeleton, _this._unrenderSkeleton);\n _this.renderToolbars = memoizeRendering(_this._renderToolbars, _this._unrenderToolbars, [_this.renderSkeleton]);\n _this.buildComponentContext = memoize(buildComponentContext);\n _this.buildViewPropTransformers = memoize(buildViewPropTransformers);\n _this.el = el;\n _this.computeTitle = memoize(computeTitle);\n _this.parseBusinessHours = memoize(function (input) {\n return parseBusinessHours(input, _this.context.calendar);\n });\n return _this;\n }\n CalendarComponent.prototype.render = function (props, context) {\n this.freezeHeight();\n var title = this.computeTitle(props.dateProfile, props.viewSpec.options);\n this.renderSkeleton(context);\n this.renderToolbars(props.viewSpec, props.dateProfile, props.currentDate, title);\n this.renderView(props, title);\n this.updateSize();\n this.thawHeight();\n };\n CalendarComponent.prototype.destroy = function () {\n if (this.header) {\n this.header.destroy();\n }\n if (this.footer) {\n this.footer.destroy();\n }\n this.renderSkeleton.unrender(); // will call destroyView\n _super.prototype.destroy.call(this);\n };\n CalendarComponent.prototype._renderSkeleton = function (context) {\n this.updateElClassNames(context);\n prependToElement(this.el, this.contentEl = createElement('div', { className: 'fc-view-container' }));\n var calendar = context.calendar;\n for (var _i = 0, _a = calendar.pluginSystem.hooks.viewContainerModifiers; _i < _a.length; _i++) {\n var modifyViewContainer = _a[_i];\n modifyViewContainer(this.contentEl, calendar);\n }\n };\n CalendarComponent.prototype._unrenderSkeleton = function () {\n // weird to have this here\n if (this.view) {\n this.savedScroll = this.view.queryScroll();\n this.view.destroy();\n this.view = null;\n }\n removeElement(this.contentEl);\n this.removeElClassNames();\n };\n CalendarComponent.prototype.removeElClassNames = function () {\n var classList = this.el.classList;\n for (var _i = 0, _a = this.elClassNames; _i < _a.length; _i++) {\n var className = _a[_i];\n classList.remove(className);\n }\n this.elClassNames = [];\n };\n CalendarComponent.prototype.updateElClassNames = function (context) {\n this.removeElClassNames();\n var theme = context.theme, options = context.options;\n this.elClassNames = [\n 'fc',\n 'fc-' + options.dir,\n theme.getClass('widget')\n ];\n var classList = this.el.classList;\n for (var _i = 0, _a = this.elClassNames; _i < _a.length; _i++) {\n var className = _a[_i];\n classList.add(className);\n }\n };\n CalendarComponent.prototype._renderToolbars = function (viewSpec, dateProfile, currentDate, title) {\n var _a = this, context = _a.context, header = _a.header, footer = _a.footer;\n var options = context.options, calendar = context.calendar;\n var headerLayout = options.header;\n var footerLayout = options.footer;\n var dateProfileGenerator = this.props.dateProfileGenerator;\n var now = calendar.getNow();\n var todayInfo = dateProfileGenerator.build(now);\n var prevInfo = dateProfileGenerator.buildPrev(dateProfile, currentDate);\n var nextInfo = dateProfileGenerator.buildNext(dateProfile, currentDate);\n var toolbarProps = {\n title: title,\n activeButton: viewSpec.type,\n isTodayEnabled: todayInfo.isValid && !rangeContainsMarker(dateProfile.currentRange, now),\n isPrevEnabled: prevInfo.isValid,\n isNextEnabled: nextInfo.isValid\n };\n if (headerLayout) {\n if (!header) {\n header = this.header = new Toolbar('fc-header-toolbar');\n prependToElement(this.el, header.el);\n }\n header.receiveProps(__assign({ layout: headerLayout }, toolbarProps), context);\n }\n else if (header) {\n header.destroy();\n header = this.header = null;\n }\n if (footerLayout) {\n if (!footer) {\n footer = this.footer = new Toolbar('fc-footer-toolbar');\n appendToElement(this.el, footer.el);\n }\n footer.receiveProps(__assign({ layout: footerLayout }, toolbarProps), context);\n }\n else if (footer) {\n footer.destroy();\n footer = this.footer = null;\n }\n };\n CalendarComponent.prototype._unrenderToolbars = function () {\n if (this.header) {\n this.header.destroy();\n this.header = null;\n }\n if (this.footer) {\n this.footer.destroy();\n this.footer = null;\n }\n };\n CalendarComponent.prototype.renderView = function (props, title) {\n var view = this.view;\n var _a = this.context, calendar = _a.calendar, options = _a.options;\n var viewSpec = props.viewSpec, dateProfileGenerator = props.dateProfileGenerator;\n if (!view || view.viewSpec !== viewSpec) {\n if (view) {\n view.destroy();\n }\n view = this.view = new viewSpec['class'](viewSpec, this.contentEl);\n if (this.savedScroll) {\n view.addScroll(this.savedScroll, true);\n this.savedScroll = null;\n }\n }\n view.title = title; // for the API\n var viewProps = {\n dateProfileGenerator: dateProfileGenerator,\n dateProfile: props.dateProfile,\n businessHours: this.parseBusinessHours(viewSpec.options.businessHours),\n eventStore: props.eventStore,\n eventUiBases: props.eventUiBases,\n dateSelection: props.dateSelection,\n eventSelection: props.eventSelection,\n eventDrag: props.eventDrag,\n eventResize: props.eventResize\n };\n var transformers = this.buildViewPropTransformers(calendar.pluginSystem.hooks.viewPropsTransformers);\n for (var _i = 0, transformers_1 = transformers; _i < transformers_1.length; _i++) {\n var transformer = transformers_1[_i];\n __assign(viewProps, transformer.transform(viewProps, viewSpec, props, options));\n }\n view.receiveProps(viewProps, this.buildComponentContext(this.context, viewSpec, view));\n };\n // Sizing\n // -----------------------------------------------------------------------------------------------------------------\n CalendarComponent.prototype.updateSize = function (isResize) {\n if (isResize === void 0) { isResize = false; }\n var view = this.view;\n if (!view) {\n return; // why?\n }\n if (isResize || this.isHeightAuto == null) {\n this.computeHeightVars();\n }\n view.updateSize(isResize, this.viewHeight, this.isHeightAuto);\n view.updateNowIndicator(); // we need to guarantee this will run after updateSize\n view.popScroll(isResize);\n };\n CalendarComponent.prototype.computeHeightVars = function () {\n var calendar = this.context.calendar; // yuck. need to handle dynamic options\n var heightInput = calendar.opt('height');\n var contentHeightInput = calendar.opt('contentHeight');\n this.isHeightAuto = heightInput === 'auto' || contentHeightInput === 'auto';\n if (typeof contentHeightInput === 'number') { // exists and not 'auto'\n this.viewHeight = contentHeightInput;\n }\n else if (typeof contentHeightInput === 'function') { // exists and is a function\n this.viewHeight = contentHeightInput();\n }\n else if (typeof heightInput === 'number') { // exists and not 'auto'\n this.viewHeight = heightInput - this.queryToolbarsHeight();\n }\n else if (typeof heightInput === 'function') { // exists and is a function\n this.viewHeight = heightInput() - this.queryToolbarsHeight();\n }\n else if (heightInput === 'parent') { // set to height of parent element\n var parentEl = this.el.parentNode;\n this.viewHeight = parentEl.getBoundingClientRect().height - this.queryToolbarsHeight();\n }\n else {\n this.viewHeight = Math.round(this.contentEl.getBoundingClientRect().width /\n Math.max(calendar.opt('aspectRatio'), .5));\n }\n };\n CalendarComponent.prototype.queryToolbarsHeight = function () {\n var height = 0;\n if (this.header) {\n height += computeHeightAndMargins(this.header.el);\n }\n if (this.footer) {\n height += computeHeightAndMargins(this.footer.el);\n }\n return height;\n };\n // Height \"Freezing\"\n // -----------------------------------------------------------------------------------------------------------------\n CalendarComponent.prototype.freezeHeight = function () {\n applyStyle(this.el, {\n height: this.el.getBoundingClientRect().height,\n overflow: 'hidden'\n });\n };\n CalendarComponent.prototype.thawHeight = function () {\n applyStyle(this.el, {\n height: '',\n overflow: ''\n });\n };\n return CalendarComponent;\n}(Component));\n// Title and Date Formatting\n// -----------------------------------------------------------------------------------------------------------------\n// Computes what the title at the top of the calendar should be for this view\nfunction computeTitle(dateProfile, viewOptions) {\n var range;\n // for views that span a large unit of time, show the proper interval, ignoring stray days before and after\n if (/^(year|month)$/.test(dateProfile.currentRangeUnit)) {\n range = dateProfile.currentRange;\n }\n else { // for day units or smaller, use the actual day range\n range = dateProfile.activeRange;\n }\n return this.context.dateEnv.formatRange(range.start, range.end, createFormatter(viewOptions.titleFormat || computeTitleFormat(dateProfile), viewOptions.titleRangeSeparator), { isEndExclusive: dateProfile.isRangeAllDay });\n}\n// Generates the format string that should be used to generate the title for the current date range.\n// Attempts to compute the most appropriate format if not explicitly specified with `titleFormat`.\nfunction computeTitleFormat(dateProfile) {\n var currentRangeUnit = dateProfile.currentRangeUnit;\n if (currentRangeUnit === 'year') {\n return { year: 'numeric' };\n }\n else if (currentRangeUnit === 'month') {\n return { year: 'numeric', month: 'long' }; // like \"September 2014\"\n }\n else {\n var days = diffWholeDays(dateProfile.currentRange.start, dateProfile.currentRange.end);\n if (days !== null && days > 1) {\n // multi-day range. shorter, like \"Sep 9 - 10 2014\"\n return { year: 'numeric', month: 'short', day: 'numeric' };\n }\n else {\n // one day. longer, like \"September 9 2014\"\n return { year: 'numeric', month: 'long', day: 'numeric' };\n }\n }\n}\n// build a context scoped to the view\nfunction buildComponentContext(context, viewSpec, view) {\n return context.extend(viewSpec.options, view);\n}\n// Plugin\n// -----------------------------------------------------------------------------------------------------------------\nfunction buildViewPropTransformers(theClasses) {\n return theClasses.map(function (theClass) {\n return new theClass();\n });\n}\n\nvar Interaction = /** @class */ (function () {\n function Interaction(settings) {\n this.component = settings.component;\n }\n Interaction.prototype.destroy = function () {\n };\n return Interaction;\n}());\nfunction parseInteractionSettings(component, input) {\n return {\n component: component,\n el: input.el,\n useEventCenter: input.useEventCenter != null ? input.useEventCenter : true\n };\n}\nfunction interactionSettingsToStore(settings) {\n var _a;\n return _a = {},\n _a[settings.component.uid] = settings,\n _a;\n}\n// global state\nvar interactionSettingsStore = {};\n\n/*\nDetects when the user clicks on an event within a DateComponent\n*/\nvar EventClicking = /** @class */ (function (_super) {\n __extends(EventClicking, _super);\n function EventClicking(settings) {\n var _this = _super.call(this, settings) || this;\n _this.handleSegClick = function (ev, segEl) {\n var component = _this.component;\n var _a = component.context, calendar = _a.calendar, view = _a.view;\n var seg = getElSeg(segEl);\n if (seg && // might be the
surrounding the more link\n component.isValidSegDownEl(ev.target)) {\n // our way to simulate a link click for elements that can't be tags\n // grab before trigger fired in case trigger trashes DOM thru rerendering\n var hasUrlContainer = elementClosest(ev.target, '.fc-has-url');\n var url = hasUrlContainer ? hasUrlContainer.querySelector('a[href]').href : '';\n calendar.publiclyTrigger('eventClick', [\n {\n el: segEl,\n event: new EventApi(component.context.calendar, seg.eventRange.def, seg.eventRange.instance),\n jsEvent: ev,\n view: view\n }\n ]);\n if (url && !ev.defaultPrevented) {\n window.location.href = url;\n }\n }\n };\n var component = settings.component;\n _this.destroy = listenBySelector(component.el, 'click', component.fgSegSelector + ',' + component.bgSegSelector, _this.handleSegClick);\n return _this;\n }\n return EventClicking;\n}(Interaction));\n\n/*\nTriggers events and adds/removes core classNames when the user's pointer\nenters/leaves event-elements of a component.\n*/\nvar EventHovering = /** @class */ (function (_super) {\n __extends(EventHovering, _super);\n function EventHovering(settings) {\n var _this = _super.call(this, settings) || this;\n // for simulating an eventMouseLeave when the event el is destroyed while mouse is over it\n _this.handleEventElRemove = function (el) {\n if (el === _this.currentSegEl) {\n _this.handleSegLeave(null, _this.currentSegEl);\n }\n };\n _this.handleSegEnter = function (ev, segEl) {\n if (getElSeg(segEl)) { // TODO: better way to make sure not hovering over more+ link or its wrapper\n segEl.classList.add('fc-allow-mouse-resize');\n _this.currentSegEl = segEl;\n _this.triggerEvent('eventMouseEnter', ev, segEl);\n }\n };\n _this.handleSegLeave = function (ev, segEl) {\n if (_this.currentSegEl) {\n segEl.classList.remove('fc-allow-mouse-resize');\n _this.currentSegEl = null;\n _this.triggerEvent('eventMouseLeave', ev, segEl);\n }\n };\n var component = settings.component;\n _this.removeHoverListeners = listenToHoverBySelector(component.el, component.fgSegSelector + ',' + component.bgSegSelector, _this.handleSegEnter, _this.handleSegLeave);\n // how to make sure component already has context?\n component.context.calendar.on('eventElRemove', _this.handleEventElRemove);\n return _this;\n }\n EventHovering.prototype.destroy = function () {\n this.removeHoverListeners();\n this.component.context.calendar.off('eventElRemove', this.handleEventElRemove);\n };\n EventHovering.prototype.triggerEvent = function (publicEvName, ev, segEl) {\n var component = this.component;\n var _a = component.context, calendar = _a.calendar, view = _a.view;\n var seg = getElSeg(segEl);\n if (!ev || component.isValidSegDownEl(ev.target)) {\n calendar.publiclyTrigger(publicEvName, [\n {\n el: segEl,\n event: new EventApi(calendar, seg.eventRange.def, seg.eventRange.instance),\n jsEvent: ev,\n view: view\n }\n ]);\n }\n };\n return EventHovering;\n}(Interaction));\n\nvar StandardTheme = /** @class */ (function (_super) {\n __extends(StandardTheme, _super);\n function StandardTheme() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return StandardTheme;\n}(Theme));\nStandardTheme.prototype.classes = {\n widget: 'fc-unthemed',\n widgetHeader: 'fc-widget-header',\n widgetContent: 'fc-widget-content',\n buttonGroup: 'fc-button-group',\n button: 'fc-button fc-button-primary',\n buttonActive: 'fc-button-active',\n popoverHeader: 'fc-widget-header',\n popoverContent: 'fc-widget-content',\n // day grid\n headerRow: 'fc-widget-header',\n dayRow: 'fc-widget-content',\n // list view\n listView: 'fc-widget-content'\n};\nStandardTheme.prototype.baseIconClass = 'fc-icon';\nStandardTheme.prototype.iconClasses = {\n close: 'fc-icon-x',\n prev: 'fc-icon-chevron-left',\n next: 'fc-icon-chevron-right',\n prevYear: 'fc-icon-chevrons-left',\n nextYear: 'fc-icon-chevrons-right'\n};\nStandardTheme.prototype.iconOverrideOption = 'buttonIcons';\nStandardTheme.prototype.iconOverrideCustomButtonOption = 'icon';\nStandardTheme.prototype.iconOverridePrefix = 'fc-icon-';\n\nvar Calendar = /** @class */ (function () {\n function Calendar(el, overrides) {\n var _this = this;\n this.buildComponentContext = memoize(buildComponentContext$1);\n this.parseRawLocales = memoize(parseRawLocales);\n this.buildLocale = memoize(buildLocale);\n this.buildDateEnv = memoize(buildDateEnv);\n this.buildTheme = memoize(buildTheme);\n this.buildEventUiSingleBase = memoize(this._buildEventUiSingleBase);\n this.buildSelectionConfig = memoize(this._buildSelectionConfig);\n this.buildEventUiBySource = memoizeOutput(buildEventUiBySource, isPropsEqual);\n this.buildEventUiBases = memoize(buildEventUiBases);\n this.interactionsStore = {};\n this.actionQueue = [];\n this.isReducing = false;\n // isDisplaying: boolean = false // installed in DOM? accepting renders?\n this.needsRerender = false; // needs a render?\n this.isRendering = false; // currently in the executeRender function?\n this.renderingPauseDepth = 0;\n this.buildDelayedRerender = memoize(buildDelayedRerender);\n this.afterSizingTriggers = {};\n this.isViewUpdated = false;\n this.isDatesUpdated = false;\n this.isEventsUpdated = false;\n this.el = el;\n this.optionsManager = new OptionsManager(overrides || {});\n this.pluginSystem = new PluginSystem();\n // only do once. don't do in handleOptions. because can't remove plugins\n this.addPluginInputs(this.optionsManager.computed.plugins || []);\n this.handleOptions(this.optionsManager.computed);\n this.publiclyTrigger('_init'); // for tests\n this.hydrate();\n this.calendarInteractions = this.pluginSystem.hooks.calendarInteractions\n .map(function (calendarInteractionClass) {\n return new calendarInteractionClass(_this);\n });\n }\n Calendar.prototype.addPluginInputs = function (pluginInputs) {\n var pluginDefs = refinePluginDefs(pluginInputs);\n for (var _i = 0, pluginDefs_1 = pluginDefs; _i < pluginDefs_1.length; _i++) {\n var pluginDef = pluginDefs_1[_i];\n this.pluginSystem.add(pluginDef);\n }\n };\n Object.defineProperty(Calendar.prototype, \"view\", {\n // public API\n get: function () {\n return this.component ? this.component.view : null;\n },\n enumerable: true,\n configurable: true\n });\n // Public API for rendering\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.render = function () {\n if (!this.component) {\n this.component = new CalendarComponent(this.el);\n this.renderableEventStore = createEmptyEventStore();\n this.bindHandlers();\n this.executeRender();\n }\n else {\n this.requestRerender();\n }\n };\n Calendar.prototype.destroy = function () {\n if (this.component) {\n this.unbindHandlers();\n this.component.destroy(); // don't null-out. in case API needs access\n this.component = null; // umm ???\n for (var _i = 0, _a = this.calendarInteractions; _i < _a.length; _i++) {\n var interaction = _a[_i];\n interaction.destroy();\n }\n this.publiclyTrigger('_destroyed');\n }\n };\n // Handlers\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.bindHandlers = function () {\n var _this = this;\n // event delegation for nav links\n this.removeNavLinkListener = listenBySelector(this.el, 'click', 'a[data-goto]', function (ev, anchorEl) {\n var gotoOptions = anchorEl.getAttribute('data-goto');\n gotoOptions = gotoOptions ? JSON.parse(gotoOptions) : {};\n var dateEnv = _this.dateEnv;\n var dateMarker = dateEnv.createMarker(gotoOptions.date);\n var viewType = gotoOptions.type;\n // property like \"navLinkDayClick\". might be a string or a function\n var customAction = _this.viewOpt('navLink' + capitaliseFirstLetter(viewType) + 'Click');\n if (typeof customAction === 'function') {\n customAction(dateEnv.toDate(dateMarker), ev);\n }\n else {\n if (typeof customAction === 'string') {\n viewType = customAction;\n }\n _this.zoomTo(dateMarker, viewType);\n }\n });\n if (this.opt('handleWindowResize')) {\n window.addEventListener('resize', this.windowResizeProxy = debounce(// prevents rapid calls\n this.windowResize.bind(this), this.opt('windowResizeDelay')));\n }\n };\n Calendar.prototype.unbindHandlers = function () {\n this.removeNavLinkListener();\n if (this.windowResizeProxy) {\n window.removeEventListener('resize', this.windowResizeProxy);\n this.windowResizeProxy = null;\n }\n };\n // Dispatcher\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.hydrate = function () {\n var _this = this;\n this.state = this.buildInitialState();\n var rawSources = this.opt('eventSources') || [];\n var singleRawSource = this.opt('events');\n var sources = []; // parsed\n if (singleRawSource) {\n rawSources.unshift(singleRawSource);\n }\n for (var _i = 0, rawSources_1 = rawSources; _i < rawSources_1.length; _i++) {\n var rawSource = rawSources_1[_i];\n var source = parseEventSource(rawSource, this);\n if (source) {\n sources.push(source);\n }\n }\n this.batchRendering(function () {\n _this.dispatch({ type: 'INIT' }); // pass in sources here?\n _this.dispatch({ type: 'ADD_EVENT_SOURCES', sources: sources });\n _this.dispatch({\n type: 'SET_VIEW_TYPE',\n viewType: _this.opt('defaultView') || _this.pluginSystem.hooks.defaultView\n });\n });\n };\n Calendar.prototype.buildInitialState = function () {\n return {\n viewType: null,\n loadingLevel: 0,\n eventSourceLoadingLevel: 0,\n currentDate: this.getInitialDate(),\n dateProfile: null,\n eventSources: {},\n eventStore: createEmptyEventStore(),\n dateSelection: null,\n eventSelection: '',\n eventDrag: null,\n eventResize: null\n };\n };\n Calendar.prototype.dispatch = function (action) {\n this.actionQueue.push(action);\n if (!this.isReducing) {\n this.isReducing = true;\n var oldState = this.state;\n while (this.actionQueue.length) {\n this.state = this.reduce(this.state, this.actionQueue.shift(), this);\n }\n var newState = this.state;\n this.isReducing = false;\n if (!oldState.loadingLevel && newState.loadingLevel) {\n this.publiclyTrigger('loading', [true]);\n }\n else if (oldState.loadingLevel && !newState.loadingLevel) {\n this.publiclyTrigger('loading', [false]);\n }\n var view = this.component && this.component.view;\n if (oldState.eventStore !== newState.eventStore) {\n if (oldState.eventStore) {\n this.isEventsUpdated = true;\n }\n }\n if (oldState.dateProfile !== newState.dateProfile) {\n if (oldState.dateProfile && view) { // why would view be null!?\n this.publiclyTrigger('datesDestroy', [\n {\n view: view,\n el: view.el\n }\n ]);\n }\n this.isDatesUpdated = true;\n }\n if (oldState.viewType !== newState.viewType) {\n if (oldState.viewType && view) { // why would view be null!?\n this.publiclyTrigger('viewSkeletonDestroy', [\n {\n view: view,\n el: view.el\n }\n ]);\n }\n this.isViewUpdated = true;\n }\n this.requestRerender();\n }\n };\n Calendar.prototype.reduce = function (state, action, calendar) {\n return reduce(state, action, calendar);\n };\n // Render Queue\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.requestRerender = function () {\n this.needsRerender = true;\n this.delayedRerender(); // will call a debounced-version of tryRerender\n };\n Calendar.prototype.tryRerender = function () {\n if (this.component && // must be accepting renders\n this.needsRerender && // indicates that a rerender was requested\n !this.renderingPauseDepth && // not paused\n !this.isRendering // not currently in the render loop\n ) {\n this.executeRender();\n }\n };\n Calendar.prototype.batchRendering = function (func) {\n this.renderingPauseDepth++;\n func();\n this.renderingPauseDepth--;\n if (this.needsRerender) {\n this.requestRerender();\n }\n };\n // Rendering\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.executeRender = function () {\n // clear these BEFORE the render so that new values will accumulate during render\n this.needsRerender = false;\n this.isRendering = true;\n this.renderComponent();\n this.isRendering = false;\n // received a rerender request while rendering\n if (this.needsRerender) {\n this.delayedRerender();\n }\n };\n /*\n don't call this directly. use executeRender instead\n */\n Calendar.prototype.renderComponent = function () {\n var _a = this, state = _a.state, component = _a.component;\n var viewType = state.viewType;\n var viewSpec = this.viewSpecs[viewType];\n if (!viewSpec) {\n throw new Error(\"View type \\\"\" + viewType + \"\\\" is not valid\");\n }\n // if event sources are still loading and progressive rendering hasn't been enabled,\n // keep rendering the last fully loaded set of events\n var renderableEventStore = this.renderableEventStore =\n (state.eventSourceLoadingLevel && !this.opt('progressiveEventRendering')) ?\n this.renderableEventStore :\n state.eventStore;\n var eventUiSingleBase = this.buildEventUiSingleBase(viewSpec.options);\n var eventUiBySource = this.buildEventUiBySource(state.eventSources);\n var eventUiBases = this.eventUiBases = this.buildEventUiBases(renderableEventStore.defs, eventUiSingleBase, eventUiBySource);\n component.receiveProps(__assign({}, state, { viewSpec: viewSpec, dateProfileGenerator: this.dateProfileGenerators[viewType], dateProfile: state.dateProfile, eventStore: renderableEventStore, eventUiBases: eventUiBases, dateSelection: state.dateSelection, eventSelection: state.eventSelection, eventDrag: state.eventDrag, eventResize: state.eventResize }), this.buildComponentContext(this.theme, this.dateEnv, this.optionsManager.computed));\n if (this.isViewUpdated) {\n this.isViewUpdated = false;\n this.publiclyTrigger('viewSkeletonRender', [\n {\n view: component.view,\n el: component.view.el\n }\n ]);\n }\n if (this.isDatesUpdated) {\n this.isDatesUpdated = false;\n this.publiclyTrigger('datesRender', [\n {\n view: component.view,\n el: component.view.el\n }\n ]);\n }\n if (this.isEventsUpdated) {\n this.isEventsUpdated = false;\n }\n this.releaseAfterSizingTriggers();\n };\n // Options\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.setOption = function (name, val) {\n var _a;\n this.mutateOptions((_a = {}, _a[name] = val, _a), [], true);\n };\n Calendar.prototype.getOption = function (name) {\n return this.optionsManager.computed[name];\n };\n Calendar.prototype.opt = function (name) {\n return this.optionsManager.computed[name];\n };\n Calendar.prototype.viewOpt = function (name) {\n return this.viewOpts()[name];\n };\n Calendar.prototype.viewOpts = function () {\n return this.viewSpecs[this.state.viewType].options;\n };\n /*\n handles option changes (like a diff)\n */\n Calendar.prototype.mutateOptions = function (updates, removals, isDynamic, deepEqual) {\n var _this = this;\n var changeHandlers = this.pluginSystem.hooks.optionChangeHandlers;\n var normalUpdates = {};\n var specialUpdates = {};\n var oldDateEnv = this.dateEnv; // do this before handleOptions\n var isTimeZoneDirty = false;\n var isSizeDirty = false;\n var anyDifficultOptions = Boolean(removals.length);\n for (var name_1 in updates) {\n if (changeHandlers[name_1]) {\n specialUpdates[name_1] = updates[name_1];\n }\n else {\n normalUpdates[name_1] = updates[name_1];\n }\n }\n for (var name_2 in normalUpdates) {\n if (/^(height|contentHeight|aspectRatio)$/.test(name_2)) {\n isSizeDirty = true;\n }\n else if (/^(defaultDate|defaultView)$/.test(name_2)) ;\n else {\n anyDifficultOptions = true;\n if (name_2 === 'timeZone') {\n isTimeZoneDirty = true;\n }\n }\n }\n this.optionsManager.mutate(normalUpdates, removals, isDynamic);\n if (anyDifficultOptions) {\n this.handleOptions(this.optionsManager.computed);\n }\n this.batchRendering(function () {\n if (anyDifficultOptions) {\n if (isTimeZoneDirty) {\n _this.dispatch({\n type: 'CHANGE_TIMEZONE',\n oldDateEnv: oldDateEnv\n });\n }\n /* HACK\n has the same effect as calling this.requestRerender()\n but recomputes the state's dateProfile\n */\n _this.dispatch({\n type: 'SET_VIEW_TYPE',\n viewType: _this.state.viewType\n });\n }\n else if (isSizeDirty) {\n _this.updateSize();\n }\n // special updates\n if (deepEqual) {\n for (var name_3 in specialUpdates) {\n changeHandlers[name_3](specialUpdates[name_3], _this, deepEqual);\n }\n }\n });\n };\n /*\n rebuilds things based off of a complete set of refined options\n */\n Calendar.prototype.handleOptions = function (options) {\n var _this = this;\n var pluginHooks = this.pluginSystem.hooks;\n this.defaultAllDayEventDuration = createDuration(options.defaultAllDayEventDuration);\n this.defaultTimedEventDuration = createDuration(options.defaultTimedEventDuration);\n this.delayedRerender = this.buildDelayedRerender(options.rerenderDelay);\n this.theme = this.buildTheme(options);\n var available = this.parseRawLocales(options.locales);\n this.availableRawLocales = available.map;\n var locale = this.buildLocale(options.locale || available.defaultCode, available.map);\n this.dateEnv = this.buildDateEnv(locale, options.timeZone, pluginHooks.namedTimeZonedImpl, options.firstDay, options.weekNumberCalculation, options.weekLabel, pluginHooks.cmdFormatter);\n this.selectionConfig = this.buildSelectionConfig(options); // needs dateEnv. do after :(\n // ineffecient to do every time?\n this.viewSpecs = buildViewSpecs(pluginHooks.views, this.optionsManager);\n // ineffecient to do every time?\n this.dateProfileGenerators = mapHash(this.viewSpecs, function (viewSpec) {\n return new viewSpec.class.prototype.dateProfileGeneratorClass(viewSpec, _this);\n });\n };\n Calendar.prototype.getAvailableLocaleCodes = function () {\n return Object.keys(this.availableRawLocales);\n };\n Calendar.prototype._buildSelectionConfig = function (rawOpts) {\n return processScopedUiProps('select', rawOpts, this);\n };\n Calendar.prototype._buildEventUiSingleBase = function (rawOpts) {\n if (rawOpts.editable) { // so 'editable' affected events\n rawOpts = __assign({}, rawOpts, { eventEditable: true });\n }\n return processScopedUiProps('event', rawOpts, this);\n };\n // Trigger\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.hasPublicHandlers = function (name) {\n return this.hasHandlers(name) ||\n this.opt(name); // handler specified in options\n };\n Calendar.prototype.publiclyTrigger = function (name, args) {\n var optHandler = this.opt(name);\n this.triggerWith(name, this, args);\n if (optHandler) {\n return optHandler.apply(this, args);\n }\n };\n Calendar.prototype.publiclyTriggerAfterSizing = function (name, args) {\n var afterSizingTriggers = this.afterSizingTriggers;\n (afterSizingTriggers[name] || (afterSizingTriggers[name] = [])).push(args);\n };\n Calendar.prototype.releaseAfterSizingTriggers = function () {\n var afterSizingTriggers = this.afterSizingTriggers;\n for (var name_4 in afterSizingTriggers) {\n for (var _i = 0, _a = afterSizingTriggers[name_4]; _i < _a.length; _i++) {\n var args = _a[_i];\n this.publiclyTrigger(name_4, args);\n }\n }\n this.afterSizingTriggers = {};\n };\n // View\n // -----------------------------------------------------------------------------------------------------------------\n // Returns a boolean about whether the view is okay to instantiate at some point\n Calendar.prototype.isValidViewType = function (viewType) {\n return Boolean(this.viewSpecs[viewType]);\n };\n Calendar.prototype.changeView = function (viewType, dateOrRange) {\n var dateMarker = null;\n if (dateOrRange) {\n if (dateOrRange.start && dateOrRange.end) { // a range\n this.optionsManager.mutate({ visibleRange: dateOrRange }, []); // will not rerender\n this.handleOptions(this.optionsManager.computed); // ...but yuck\n }\n else { // a date\n dateMarker = this.dateEnv.createMarker(dateOrRange); // just like gotoDate\n }\n }\n this.unselect();\n this.dispatch({\n type: 'SET_VIEW_TYPE',\n viewType: viewType,\n dateMarker: dateMarker\n });\n };\n // Forces navigation to a view for the given date.\n // `viewType` can be a specific view name or a generic one like \"week\" or \"day\".\n // needs to change\n Calendar.prototype.zoomTo = function (dateMarker, viewType) {\n var spec;\n viewType = viewType || 'day'; // day is default zoom\n spec = this.viewSpecs[viewType] ||\n this.getUnitViewSpec(viewType);\n this.unselect();\n if (spec) {\n this.dispatch({\n type: 'SET_VIEW_TYPE',\n viewType: spec.type,\n dateMarker: dateMarker\n });\n }\n else {\n this.dispatch({\n type: 'SET_DATE',\n dateMarker: dateMarker\n });\n }\n };\n // Given a duration singular unit, like \"week\" or \"day\", finds a matching view spec.\n // Preference is given to views that have corresponding buttons.\n Calendar.prototype.getUnitViewSpec = function (unit) {\n var component = this.component;\n var viewTypes = [];\n var i;\n var spec;\n // put views that have buttons first. there will be duplicates, but oh\n if (component.header) {\n viewTypes.push.apply(viewTypes, component.header.viewsWithButtons);\n }\n if (component.footer) {\n viewTypes.push.apply(viewTypes, component.footer.viewsWithButtons);\n }\n for (var viewType in this.viewSpecs) {\n viewTypes.push(viewType);\n }\n for (i = 0; i < viewTypes.length; i++) {\n spec = this.viewSpecs[viewTypes[i]];\n if (spec) {\n if (spec.singleUnit === unit) {\n return spec;\n }\n }\n }\n };\n // Current Date\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.getInitialDate = function () {\n var defaultDateInput = this.opt('defaultDate');\n // compute the initial ambig-timezone date\n if (defaultDateInput != null) {\n return this.dateEnv.createMarker(defaultDateInput);\n }\n else {\n return this.getNow(); // getNow already returns unzoned\n }\n };\n Calendar.prototype.prev = function () {\n this.unselect();\n this.dispatch({ type: 'PREV' });\n };\n Calendar.prototype.next = function () {\n this.unselect();\n this.dispatch({ type: 'NEXT' });\n };\n Calendar.prototype.prevYear = function () {\n this.unselect();\n this.dispatch({\n type: 'SET_DATE',\n dateMarker: this.dateEnv.addYears(this.state.currentDate, -1)\n });\n };\n Calendar.prototype.nextYear = function () {\n this.unselect();\n this.dispatch({\n type: 'SET_DATE',\n dateMarker: this.dateEnv.addYears(this.state.currentDate, 1)\n });\n };\n Calendar.prototype.today = function () {\n this.unselect();\n this.dispatch({\n type: 'SET_DATE',\n dateMarker: this.getNow()\n });\n };\n Calendar.prototype.gotoDate = function (zonedDateInput) {\n this.unselect();\n this.dispatch({\n type: 'SET_DATE',\n dateMarker: this.dateEnv.createMarker(zonedDateInput)\n });\n };\n Calendar.prototype.incrementDate = function (deltaInput) {\n var delta = createDuration(deltaInput);\n if (delta) { // else, warn about invalid input?\n this.unselect();\n this.dispatch({\n type: 'SET_DATE',\n dateMarker: this.dateEnv.add(this.state.currentDate, delta)\n });\n }\n };\n // for external API\n Calendar.prototype.getDate = function () {\n return this.dateEnv.toDate(this.state.currentDate);\n };\n // Date Formatting Utils\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.formatDate = function (d, formatter) {\n var dateEnv = this.dateEnv;\n return dateEnv.format(dateEnv.createMarker(d), createFormatter(formatter));\n };\n // `settings` is for formatter AND isEndExclusive\n Calendar.prototype.formatRange = function (d0, d1, settings) {\n var dateEnv = this.dateEnv;\n return dateEnv.formatRange(dateEnv.createMarker(d0), dateEnv.createMarker(d1), createFormatter(settings, this.opt('defaultRangeSeparator')), settings);\n };\n Calendar.prototype.formatIso = function (d, omitTime) {\n var dateEnv = this.dateEnv;\n return dateEnv.formatIso(dateEnv.createMarker(d), { omitTime: omitTime });\n };\n // Sizing\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.windowResize = function (ev) {\n if (!this.isHandlingWindowResize &&\n this.component && // why?\n ev.target === window // not a jqui resize event\n ) {\n this.isHandlingWindowResize = true;\n this.updateSize();\n this.publiclyTrigger('windowResize', [this.view]);\n this.isHandlingWindowResize = false;\n }\n };\n Calendar.prototype.updateSize = function () {\n if (this.component) { // when?\n this.component.updateSize(true);\n }\n };\n // Component Registration\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.registerInteractiveComponent = function (component, settingsInput) {\n var settings = parseInteractionSettings(component, settingsInput);\n var DEFAULT_INTERACTIONS = [\n EventClicking,\n EventHovering\n ];\n var interactionClasses = DEFAULT_INTERACTIONS.concat(this.pluginSystem.hooks.componentInteractions);\n var interactions = interactionClasses.map(function (interactionClass) {\n return new interactionClass(settings);\n });\n this.interactionsStore[component.uid] = interactions;\n interactionSettingsStore[component.uid] = settings;\n };\n Calendar.prototype.unregisterInteractiveComponent = function (component) {\n for (var _i = 0, _a = this.interactionsStore[component.uid]; _i < _a.length; _i++) {\n var listener = _a[_i];\n listener.destroy();\n }\n delete this.interactionsStore[component.uid];\n delete interactionSettingsStore[component.uid];\n };\n // Date Selection / Event Selection / DayClick\n // -----------------------------------------------------------------------------------------------------------------\n // this public method receives start/end dates in any format, with any timezone\n // NOTE: args were changed from v3\n Calendar.prototype.select = function (dateOrObj, endDate) {\n var selectionInput;\n if (endDate == null) {\n if (dateOrObj.start != null) {\n selectionInput = dateOrObj;\n }\n else {\n selectionInput = {\n start: dateOrObj,\n end: null\n };\n }\n }\n else {\n selectionInput = {\n start: dateOrObj,\n end: endDate\n };\n }\n var selection = parseDateSpan(selectionInput, this.dateEnv, createDuration({ days: 1 }) // TODO: cache this?\n );\n if (selection) { // throw parse error otherwise?\n this.dispatch({ type: 'SELECT_DATES', selection: selection });\n this.triggerDateSelect(selection);\n }\n };\n // public method\n Calendar.prototype.unselect = function (pev) {\n if (this.state.dateSelection) {\n this.dispatch({ type: 'UNSELECT_DATES' });\n this.triggerDateUnselect(pev);\n }\n };\n Calendar.prototype.triggerDateSelect = function (selection, pev) {\n var arg = __assign({}, this.buildDateSpanApi(selection), { jsEvent: pev ? pev.origEvent : null, view: this.view });\n this.publiclyTrigger('select', [arg]);\n };\n Calendar.prototype.triggerDateUnselect = function (pev) {\n this.publiclyTrigger('unselect', [\n {\n jsEvent: pev ? pev.origEvent : null,\n view: this.view\n }\n ]);\n };\n // TODO: receive pev?\n Calendar.prototype.triggerDateClick = function (dateSpan, dayEl, view, ev) {\n var arg = __assign({}, this.buildDatePointApi(dateSpan), { dayEl: dayEl, jsEvent: ev, // Is this always a mouse event? See #4655\n view: view });\n this.publiclyTrigger('dateClick', [arg]);\n };\n Calendar.prototype.buildDatePointApi = function (dateSpan) {\n var props = {};\n for (var _i = 0, _a = this.pluginSystem.hooks.datePointTransforms; _i < _a.length; _i++) {\n var transform = _a[_i];\n __assign(props, transform(dateSpan, this));\n }\n __assign(props, buildDatePointApi(dateSpan, this.dateEnv));\n return props;\n };\n Calendar.prototype.buildDateSpanApi = function (dateSpan) {\n var props = {};\n for (var _i = 0, _a = this.pluginSystem.hooks.dateSpanTransforms; _i < _a.length; _i++) {\n var transform = _a[_i];\n __assign(props, transform(dateSpan, this));\n }\n __assign(props, buildDateSpanApi(dateSpan, this.dateEnv));\n return props;\n };\n // Date Utils\n // -----------------------------------------------------------------------------------------------------------------\n // Returns a DateMarker for the current date, as defined by the client's computer or from the `now` option\n Calendar.prototype.getNow = function () {\n var now = this.opt('now');\n if (typeof now === 'function') {\n now = now();\n }\n if (now == null) {\n return this.dateEnv.createNowMarker();\n }\n return this.dateEnv.createMarker(now);\n };\n // Event-Date Utilities\n // -----------------------------------------------------------------------------------------------------------------\n // Given an event's allDay status and start date, return what its fallback end date should be.\n // TODO: rename to computeDefaultEventEnd\n Calendar.prototype.getDefaultEventEnd = function (allDay, marker) {\n var end = marker;\n if (allDay) {\n end = startOfDay(end);\n end = this.dateEnv.add(end, this.defaultAllDayEventDuration);\n }\n else {\n end = this.dateEnv.add(end, this.defaultTimedEventDuration);\n }\n return end;\n };\n // Public Events API\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.addEvent = function (eventInput, sourceInput) {\n if (eventInput instanceof EventApi) {\n var def = eventInput._def;\n var instance = eventInput._instance;\n // not already present? don't want to add an old snapshot\n if (!this.state.eventStore.defs[def.defId]) {\n this.dispatch({\n type: 'ADD_EVENTS',\n eventStore: eventTupleToStore({ def: def, instance: instance }) // TODO: better util for two args?\n });\n }\n return eventInput;\n }\n var sourceId;\n if (sourceInput instanceof EventSourceApi) {\n sourceId = sourceInput.internalEventSource.sourceId;\n }\n else if (sourceInput != null) {\n var sourceApi = this.getEventSourceById(sourceInput); // TODO: use an internal function\n if (!sourceApi) {\n console.warn('Could not find an event source with ID \"' + sourceInput + '\"'); // TODO: test\n return null;\n }\n else {\n sourceId = sourceApi.internalEventSource.sourceId;\n }\n }\n var tuple = parseEvent(eventInput, sourceId, this);\n if (tuple) {\n this.dispatch({\n type: 'ADD_EVENTS',\n eventStore: eventTupleToStore(tuple)\n });\n return new EventApi(this, tuple.def, tuple.def.recurringDef ? null : tuple.instance);\n }\n return null;\n };\n // TODO: optimize\n Calendar.prototype.getEventById = function (id) {\n var _a = this.state.eventStore, defs = _a.defs, instances = _a.instances;\n id = String(id);\n for (var defId in defs) {\n var def = defs[defId];\n if (def.publicId === id) {\n if (def.recurringDef) {\n return new EventApi(this, def, null);\n }\n else {\n for (var instanceId in instances) {\n var instance = instances[instanceId];\n if (instance.defId === def.defId) {\n return new EventApi(this, def, instance);\n }\n }\n }\n }\n }\n return null;\n };\n Calendar.prototype.getEvents = function () {\n var _a = this.state.eventStore, defs = _a.defs, instances = _a.instances;\n var eventApis = [];\n for (var id in instances) {\n var instance = instances[id];\n var def = defs[instance.defId];\n eventApis.push(new EventApi(this, def, instance));\n }\n return eventApis;\n };\n Calendar.prototype.removeAllEvents = function () {\n this.dispatch({ type: 'REMOVE_ALL_EVENTS' });\n };\n Calendar.prototype.rerenderEvents = function () {\n this.dispatch({ type: 'RESET_EVENTS' });\n };\n // Public Event Sources API\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.getEventSources = function () {\n var sourceHash = this.state.eventSources;\n var sourceApis = [];\n for (var internalId in sourceHash) {\n sourceApis.push(new EventSourceApi(this, sourceHash[internalId]));\n }\n return sourceApis;\n };\n Calendar.prototype.getEventSourceById = function (id) {\n var sourceHash = this.state.eventSources;\n id = String(id);\n for (var sourceId in sourceHash) {\n if (sourceHash[sourceId].publicId === id) {\n return new EventSourceApi(this, sourceHash[sourceId]);\n }\n }\n return null;\n };\n Calendar.prototype.addEventSource = function (sourceInput) {\n if (sourceInput instanceof EventSourceApi) {\n // not already present? don't want to add an old snapshot\n if (!this.state.eventSources[sourceInput.internalEventSource.sourceId]) {\n this.dispatch({\n type: 'ADD_EVENT_SOURCES',\n sources: [sourceInput.internalEventSource]\n });\n }\n return sourceInput;\n }\n var eventSource = parseEventSource(sourceInput, this);\n if (eventSource) { // TODO: error otherwise?\n this.dispatch({ type: 'ADD_EVENT_SOURCES', sources: [eventSource] });\n return new EventSourceApi(this, eventSource);\n }\n return null;\n };\n Calendar.prototype.removeAllEventSources = function () {\n this.dispatch({ type: 'REMOVE_ALL_EVENT_SOURCES' });\n };\n Calendar.prototype.refetchEvents = function () {\n this.dispatch({ type: 'FETCH_EVENT_SOURCES' });\n };\n // Scroll\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.scrollToTime = function (timeInput) {\n var duration = createDuration(timeInput);\n if (duration) {\n this.component.view.scrollToDuration(duration);\n }\n };\n return Calendar;\n}());\nEmitterMixin.mixInto(Calendar);\n// for memoizers\n// -----------------------------------------------------------------------------------------------------------------\nfunction buildComponentContext$1(theme, dateEnv, options) {\n return new ComponentContext(this, theme, dateEnv, options, null);\n}\nfunction buildDateEnv(locale, timeZone, namedTimeZoneImpl, firstDay, weekNumberCalculation, weekLabel, cmdFormatter) {\n return new DateEnv({\n calendarSystem: 'gregory',\n timeZone: timeZone,\n namedTimeZoneImpl: namedTimeZoneImpl,\n locale: locale,\n weekNumberCalculation: weekNumberCalculation,\n firstDay: firstDay,\n weekLabel: weekLabel,\n cmdFormatter: cmdFormatter\n });\n}\nfunction buildTheme(calendarOptions) {\n var themeClass = this.pluginSystem.hooks.themeClasses[calendarOptions.themeSystem] || StandardTheme;\n return new themeClass(calendarOptions);\n}\nfunction buildDelayedRerender(wait) {\n var func = this.tryRerender.bind(this);\n if (wait != null) {\n func = debounce(func, wait);\n }\n return func;\n}\nfunction buildEventUiBySource(eventSources) {\n return mapHash(eventSources, function (eventSource) {\n return eventSource.ui;\n });\n}\nfunction buildEventUiBases(eventDefs, eventUiSingleBase, eventUiBySource) {\n var eventUiBases = { '': eventUiSingleBase };\n for (var defId in eventDefs) {\n var def = eventDefs[defId];\n if (def.sourceId && eventUiBySource[def.sourceId]) {\n eventUiBases[defId] = eventUiBySource[def.sourceId];\n }\n }\n return eventUiBases;\n}\n\nvar View = /** @class */ (function (_super) {\n __extends(View, _super);\n function View(viewSpec, parentEl) {\n var _this = _super.call(this, createElement('div', { className: 'fc-view fc-' + viewSpec.type + '-view' })) || this;\n _this.renderDatesMem = memoizeRendering(_this.renderDatesWrap, _this.unrenderDatesWrap);\n _this.renderBusinessHoursMem = memoizeRendering(_this.renderBusinessHours, _this.unrenderBusinessHours, [_this.renderDatesMem]);\n _this.renderDateSelectionMem = memoizeRendering(_this.renderDateSelectionWrap, _this.unrenderDateSelectionWrap, [_this.renderDatesMem]);\n _this.renderEventsMem = memoizeRendering(_this.renderEvents, _this.unrenderEvents, [_this.renderDatesMem]);\n _this.renderEventSelectionMem = memoizeRendering(_this.renderEventSelectionWrap, _this.unrenderEventSelectionWrap, [_this.renderEventsMem]);\n _this.renderEventDragMem = memoizeRendering(_this.renderEventDragWrap, _this.unrenderEventDragWrap, [_this.renderDatesMem]);\n _this.renderEventResizeMem = memoizeRendering(_this.renderEventResizeWrap, _this.unrenderEventResizeWrap, [_this.renderDatesMem]);\n _this.viewSpec = viewSpec;\n _this.type = viewSpec.type;\n parentEl.appendChild(_this.el);\n _this.initialize();\n return _this;\n }\n View.prototype.initialize = function () {\n };\n Object.defineProperty(View.prototype, \"activeStart\", {\n // Date Setting/Unsetting\n // -----------------------------------------------------------------------------------------------------------------\n get: function () {\n return this.context.dateEnv.toDate(this.props.dateProfile.activeRange.start);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(View.prototype, \"activeEnd\", {\n get: function () {\n return this.context.dateEnv.toDate(this.props.dateProfile.activeRange.end);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(View.prototype, \"currentStart\", {\n get: function () {\n return this.context.dateEnv.toDate(this.props.dateProfile.currentRange.start);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(View.prototype, \"currentEnd\", {\n get: function () {\n return this.context.dateEnv.toDate(this.props.dateProfile.currentRange.end);\n },\n enumerable: true,\n configurable: true\n });\n // General Rendering\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.render = function (props, context) {\n this.renderDatesMem(props.dateProfile);\n this.renderBusinessHoursMem(props.businessHours);\n this.renderDateSelectionMem(props.dateSelection);\n this.renderEventsMem(props.eventStore);\n this.renderEventSelectionMem(props.eventSelection);\n this.renderEventDragMem(props.eventDrag);\n this.renderEventResizeMem(props.eventResize);\n };\n View.prototype.beforeUpdate = function () {\n this.addScroll(this.queryScroll());\n };\n View.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.renderDatesMem.unrender(); // should unrender everything else\n };\n // Sizing\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.updateSize = function (isResize, viewHeight, isAuto) {\n var calendar = this.context.calendar;\n if (isResize) {\n this.addScroll(this.queryScroll()); // NOTE: same code as in beforeUpdate\n }\n if (isResize || // HACKS...\n calendar.isViewUpdated ||\n calendar.isDatesUpdated ||\n calendar.isEventsUpdated) {\n // sort of the catch-all sizing\n // anything that might cause dimension changes\n this.updateBaseSize(isResize, viewHeight, isAuto);\n }\n // NOTE: popScroll is called by CalendarComponent\n };\n View.prototype.updateBaseSize = function (isResize, viewHeight, isAuto) {\n };\n // Date Rendering\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.renderDatesWrap = function (dateProfile) {\n this.renderDates(dateProfile);\n this.addScroll({\n duration: createDuration(this.context.options.scrollTime)\n });\n };\n View.prototype.unrenderDatesWrap = function () {\n this.stopNowIndicator();\n this.unrenderDates();\n };\n View.prototype.renderDates = function (dateProfile) { };\n View.prototype.unrenderDates = function () { };\n // Business Hours\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.renderBusinessHours = function (businessHours) { };\n View.prototype.unrenderBusinessHours = function () { };\n // Date Selection\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.renderDateSelectionWrap = function (selection) {\n if (selection) {\n this.renderDateSelection(selection);\n }\n };\n View.prototype.unrenderDateSelectionWrap = function (selection) {\n if (selection) {\n this.unrenderDateSelection(selection);\n }\n };\n View.prototype.renderDateSelection = function (selection) { };\n View.prototype.unrenderDateSelection = function (selection) { };\n // Event Rendering\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.renderEvents = function (eventStore) { };\n View.prototype.unrenderEvents = function () { };\n // util for subclasses\n View.prototype.sliceEvents = function (eventStore, allDay) {\n var props = this.props;\n return sliceEventStore(eventStore, props.eventUiBases, props.dateProfile.activeRange, allDay ? this.context.nextDayThreshold : null).fg;\n };\n // Event Selection\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.renderEventSelectionWrap = function (instanceId) {\n if (instanceId) {\n this.renderEventSelection(instanceId);\n }\n };\n View.prototype.unrenderEventSelectionWrap = function (instanceId) {\n if (instanceId) {\n this.unrenderEventSelection(instanceId);\n }\n };\n View.prototype.renderEventSelection = function (instanceId) { };\n View.prototype.unrenderEventSelection = function (instanceId) { };\n // Event Drag\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.renderEventDragWrap = function (state) {\n if (state) {\n this.renderEventDrag(state);\n }\n };\n View.prototype.unrenderEventDragWrap = function (state) {\n if (state) {\n this.unrenderEventDrag(state);\n }\n };\n View.prototype.renderEventDrag = function (state) { };\n View.prototype.unrenderEventDrag = function (state) { };\n // Event Resize\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.renderEventResizeWrap = function (state) {\n if (state) {\n this.renderEventResize(state);\n }\n };\n View.prototype.unrenderEventResizeWrap = function (state) {\n if (state) {\n this.unrenderEventResize(state);\n }\n };\n View.prototype.renderEventResize = function (state) { };\n View.prototype.unrenderEventResize = function (state) { };\n /* Now Indicator\n ------------------------------------------------------------------------------------------------------------------*/\n // Immediately render the current time indicator and begins re-rendering it at an interval,\n // which is defined by this.getNowIndicatorUnit().\n // TODO: somehow do this for the current whole day's background too\n // USAGE: must be called manually from subclasses' render methods! don't need to call stopNowIndicator tho\n View.prototype.startNowIndicator = function (dateProfile, dateProfileGenerator) {\n var _this = this;\n var _a = this.context, calendar = _a.calendar, dateEnv = _a.dateEnv, options = _a.options;\n var unit;\n var update;\n var delay; // ms wait value\n if (options.nowIndicator && !this.initialNowDate) {\n unit = this.getNowIndicatorUnit(dateProfile, dateProfileGenerator);\n if (unit) {\n update = this.updateNowIndicator.bind(this);\n this.initialNowDate = calendar.getNow();\n this.initialNowQueriedMs = new Date().valueOf();\n // wait until the beginning of the next interval\n delay = dateEnv.add(dateEnv.startOf(this.initialNowDate, unit), createDuration(1, unit)).valueOf() - this.initialNowDate.valueOf();\n // TODO: maybe always use setTimeout, waiting until start of next unit\n this.nowIndicatorTimeoutID = setTimeout(function () {\n _this.nowIndicatorTimeoutID = null;\n update();\n if (unit === 'second') {\n delay = 1000; // every second\n }\n else {\n delay = 1000 * 60; // otherwise, every minute\n }\n _this.nowIndicatorIntervalID = setInterval(update, delay); // update every interval\n }, delay);\n }\n // rendering will be initiated in updateSize\n }\n };\n // rerenders the now indicator, computing the new current time from the amount of time that has passed\n // since the initial getNow call.\n View.prototype.updateNowIndicator = function () {\n if (this.props.dateProfile && // a way to determine if dates were rendered yet\n this.initialNowDate // activated before?\n ) {\n this.unrenderNowIndicator(); // won't unrender if unnecessary\n this.renderNowIndicator(addMs(this.initialNowDate, new Date().valueOf() - this.initialNowQueriedMs));\n this.isNowIndicatorRendered = true;\n }\n };\n // Immediately unrenders the view's current time indicator and stops any re-rendering timers.\n // Won't cause side effects if indicator isn't rendered.\n View.prototype.stopNowIndicator = function () {\n if (this.nowIndicatorTimeoutID) {\n clearTimeout(this.nowIndicatorTimeoutID);\n this.nowIndicatorTimeoutID = null;\n }\n if (this.nowIndicatorIntervalID) {\n clearInterval(this.nowIndicatorIntervalID);\n this.nowIndicatorIntervalID = null;\n }\n if (this.isNowIndicatorRendered) {\n this.unrenderNowIndicator();\n this.isNowIndicatorRendered = false;\n }\n };\n View.prototype.getNowIndicatorUnit = function (dateProfile, dateProfileGenerator) {\n // subclasses should implement\n };\n // Renders a current time indicator at the given datetime\n View.prototype.renderNowIndicator = function (date) {\n // SUBCLASSES MUST PASS TO CHILDREN!\n };\n // Undoes the rendering actions from renderNowIndicator\n View.prototype.unrenderNowIndicator = function () {\n // SUBCLASSES MUST PASS TO CHILDREN!\n };\n /* Scroller\n ------------------------------------------------------------------------------------------------------------------*/\n View.prototype.addScroll = function (scroll, isForced) {\n if (isForced) {\n scroll.isForced = isForced;\n }\n __assign(this.queuedScroll || (this.queuedScroll = {}), scroll);\n };\n View.prototype.popScroll = function (isResize) {\n this.applyQueuedScroll(isResize);\n this.queuedScroll = null;\n };\n View.prototype.applyQueuedScroll = function (isResize) {\n if (this.queuedScroll) {\n this.applyScroll(this.queuedScroll, isResize);\n }\n };\n View.prototype.queryScroll = function () {\n var scroll = {};\n if (this.props.dateProfile) { // dates rendered yet?\n __assign(scroll, this.queryDateScroll());\n }\n return scroll;\n };\n View.prototype.applyScroll = function (scroll, isResize) {\n var duration = scroll.duration, isForced = scroll.isForced;\n if (duration != null && !isForced) {\n delete scroll.duration;\n if (this.props.dateProfile) { // dates rendered yet?\n __assign(scroll, this.computeDateScroll(duration));\n }\n }\n if (this.props.dateProfile) { // dates rendered yet?\n this.applyDateScroll(scroll);\n }\n };\n View.prototype.computeDateScroll = function (duration) {\n return {}; // subclasses must implement\n };\n View.prototype.queryDateScroll = function () {\n return {}; // subclasses must implement\n };\n View.prototype.applyDateScroll = function (scroll) {\n // subclasses must implement\n };\n // for API\n View.prototype.scrollToDuration = function (duration) {\n this.applyScroll({ duration: duration }, false);\n };\n return View;\n}(DateComponent));\nEmitterMixin.mixInto(View);\nView.prototype.usesMinMaxTime = false;\nView.prototype.dateProfileGeneratorClass = DateProfileGenerator;\n\nvar FgEventRenderer = /** @class */ (function () {\n function FgEventRenderer() {\n this.segs = [];\n this.isSizeDirty = false;\n }\n FgEventRenderer.prototype.renderSegs = function (context, segs, mirrorInfo) {\n this.context = context;\n this.rangeUpdated(); // called too frequently :(\n // render an `.el` on each seg\n // returns a subset of the segs. segs that were actually rendered\n segs = this.renderSegEls(segs, mirrorInfo);\n this.segs = segs;\n this.attachSegs(segs, mirrorInfo);\n this.isSizeDirty = true;\n triggerRenderedSegs(this.context, this.segs, Boolean(mirrorInfo));\n };\n FgEventRenderer.prototype.unrender = function (context, _segs, mirrorInfo) {\n triggerWillRemoveSegs(this.context, this.segs, Boolean(mirrorInfo));\n this.detachSegs(this.segs);\n this.segs = [];\n };\n // Updates values that rely on options and also relate to range\n FgEventRenderer.prototype.rangeUpdated = function () {\n var options = this.context.options;\n var displayEventTime;\n var displayEventEnd;\n this.eventTimeFormat = createFormatter(options.eventTimeFormat || this.computeEventTimeFormat(), options.defaultRangeSeparator);\n displayEventTime = options.displayEventTime;\n if (displayEventTime == null) {\n displayEventTime = this.computeDisplayEventTime(); // might be based off of range\n }\n displayEventEnd = options.displayEventEnd;\n if (displayEventEnd == null) {\n displayEventEnd = this.computeDisplayEventEnd(); // might be based off of range\n }\n this.displayEventTime = displayEventTime;\n this.displayEventEnd = displayEventEnd;\n };\n // Renders and assigns an `el` property for each foreground event segment.\n // Only returns segments that successfully rendered.\n FgEventRenderer.prototype.renderSegEls = function (segs, mirrorInfo) {\n var html = '';\n var i;\n if (segs.length) { // don't build an empty html string\n // build a large concatenation of event segment HTML\n for (i = 0; i < segs.length; i++) {\n html += this.renderSegHtml(segs[i], mirrorInfo);\n }\n // Grab individual elements from the combined HTML string. Use each as the default rendering.\n // Then, compute the 'el' for each segment. An el might be null if the eventRender callback returned false.\n htmlToElements(html).forEach(function (el, i) {\n var seg = segs[i];\n if (el) {\n seg.el = el;\n }\n });\n segs = filterSegsViaEls(this.context, segs, Boolean(mirrorInfo));\n }\n return segs;\n };\n // Generic utility for generating the HTML classNames for an event segment's element\n FgEventRenderer.prototype.getSegClasses = function (seg, isDraggable, isResizable, mirrorInfo) {\n var classes = [\n 'fc-event',\n seg.isStart ? 'fc-start' : 'fc-not-start',\n seg.isEnd ? 'fc-end' : 'fc-not-end'\n ].concat(seg.eventRange.ui.classNames);\n if (isDraggable) {\n classes.push('fc-draggable');\n }\n if (isResizable) {\n classes.push('fc-resizable');\n }\n if (mirrorInfo) {\n classes.push('fc-mirror');\n if (mirrorInfo.isDragging) {\n classes.push('fc-dragging');\n }\n if (mirrorInfo.isResizing) {\n classes.push('fc-resizing');\n }\n }\n return classes;\n };\n // Compute the text that should be displayed on an event's element.\n // `range` can be the Event object itself, or something range-like, with at least a `start`.\n // If event times are disabled, or the event has no time, will return a blank string.\n // If not specified, formatter will default to the eventTimeFormat setting,\n // and displayEnd will default to the displayEventEnd setting.\n FgEventRenderer.prototype.getTimeText = function (eventRange, formatter, displayEnd) {\n var def = eventRange.def, instance = eventRange.instance;\n return this._getTimeText(instance.range.start, def.hasEnd ? instance.range.end : null, def.allDay, formatter, displayEnd, instance.forcedStartTzo, instance.forcedEndTzo);\n };\n FgEventRenderer.prototype._getTimeText = function (start, end, allDay, formatter, displayEnd, forcedStartTzo, forcedEndTzo) {\n var dateEnv = this.context.dateEnv;\n if (formatter == null) {\n formatter = this.eventTimeFormat;\n }\n if (displayEnd == null) {\n displayEnd = this.displayEventEnd;\n }\n if (this.displayEventTime && !allDay) {\n if (displayEnd && end) {\n return dateEnv.formatRange(start, end, formatter, {\n forcedStartTzo: forcedStartTzo,\n forcedEndTzo: forcedEndTzo\n });\n }\n else {\n return dateEnv.format(start, formatter, {\n forcedTzo: forcedStartTzo\n });\n }\n }\n return '';\n };\n FgEventRenderer.prototype.computeEventTimeFormat = function () {\n return {\n hour: 'numeric',\n minute: '2-digit',\n omitZeroMinute: true\n };\n };\n FgEventRenderer.prototype.computeDisplayEventTime = function () {\n return true;\n };\n FgEventRenderer.prototype.computeDisplayEventEnd = function () {\n return true;\n };\n // Utility for generating event skin-related CSS properties\n FgEventRenderer.prototype.getSkinCss = function (ui) {\n return {\n 'background-color': ui.backgroundColor,\n 'border-color': ui.borderColor,\n color: ui.textColor\n };\n };\n FgEventRenderer.prototype.sortEventSegs = function (segs) {\n var specs = this.context.eventOrderSpecs;\n var objs = segs.map(buildSegCompareObj);\n objs.sort(function (obj0, obj1) {\n return compareByFieldSpecs(obj0, obj1, specs);\n });\n return objs.map(function (c) {\n return c._seg;\n });\n };\n FgEventRenderer.prototype.computeSizes = function (force) {\n if (force || this.isSizeDirty) {\n this.computeSegSizes(this.segs);\n }\n };\n FgEventRenderer.prototype.assignSizes = function (force) {\n if (force || this.isSizeDirty) {\n this.assignSegSizes(this.segs);\n this.isSizeDirty = false;\n }\n };\n FgEventRenderer.prototype.computeSegSizes = function (segs) {\n };\n FgEventRenderer.prototype.assignSegSizes = function (segs) {\n };\n // Manipulation on rendered segs\n FgEventRenderer.prototype.hideByHash = function (hash) {\n if (hash) {\n for (var _i = 0, _a = this.segs; _i < _a.length; _i++) {\n var seg = _a[_i];\n if (hash[seg.eventRange.instance.instanceId]) {\n seg.el.style.visibility = 'hidden';\n }\n }\n }\n };\n FgEventRenderer.prototype.showByHash = function (hash) {\n if (hash) {\n for (var _i = 0, _a = this.segs; _i < _a.length; _i++) {\n var seg = _a[_i];\n if (hash[seg.eventRange.instance.instanceId]) {\n seg.el.style.visibility = '';\n }\n }\n }\n };\n FgEventRenderer.prototype.selectByInstanceId = function (instanceId) {\n if (instanceId) {\n for (var _i = 0, _a = this.segs; _i < _a.length; _i++) {\n var seg = _a[_i];\n var eventInstance = seg.eventRange.instance;\n if (eventInstance && eventInstance.instanceId === instanceId &&\n seg.el // necessary?\n ) {\n seg.el.classList.add('fc-selected');\n }\n }\n }\n };\n FgEventRenderer.prototype.unselectByInstanceId = function (instanceId) {\n if (instanceId) {\n for (var _i = 0, _a = this.segs; _i < _a.length; _i++) {\n var seg = _a[_i];\n if (seg.el) { // necessary?\n seg.el.classList.remove('fc-selected');\n }\n }\n }\n };\n return FgEventRenderer;\n}());\n// returns a object with all primitive props that can be compared\nfunction buildSegCompareObj(seg) {\n var eventDef = seg.eventRange.def;\n var range = seg.eventRange.instance.range;\n var start = range.start ? range.start.valueOf() : 0; // TODO: better support for open-range events\n var end = range.end ? range.end.valueOf() : 0; // \"\n return __assign({}, eventDef.extendedProps, eventDef, { id: eventDef.publicId, start: start,\n end: end, duration: end - start, allDay: Number(eventDef.allDay), _seg: seg // for later retrieval\n });\n}\n\n/*\nTODO: when refactoring this class, make a new FillRenderer instance for each `type`\n*/\nvar FillRenderer = /** @class */ (function () {\n function FillRenderer() {\n this.fillSegTag = 'div';\n this.dirtySizeFlags = {};\n this.containerElsByType = {};\n this.segsByType = {};\n }\n FillRenderer.prototype.getSegsByType = function (type) {\n return this.segsByType[type] || [];\n };\n FillRenderer.prototype.renderSegs = function (type, context, segs) {\n var _a;\n this.context = context;\n var renderedSegs = this.renderSegEls(type, segs); // assignes `.el` to each seg. returns successfully rendered segs\n var containerEls = this.attachSegs(type, renderedSegs);\n if (containerEls) {\n (_a = (this.containerElsByType[type] || (this.containerElsByType[type] = []))).push.apply(_a, containerEls);\n }\n this.segsByType[type] = renderedSegs;\n if (type === 'bgEvent') {\n triggerRenderedSegs(context, renderedSegs, false); // isMirror=false\n }\n this.dirtySizeFlags[type] = true;\n };\n // Unrenders a specific type of fill that is currently rendered on the grid\n FillRenderer.prototype.unrender = function (type, context) {\n var segs = this.segsByType[type];\n if (segs) {\n if (type === 'bgEvent') {\n triggerWillRemoveSegs(context, segs, false); // isMirror=false\n }\n this.detachSegs(type, segs);\n }\n };\n // Renders and assigns an `el` property for each fill segment. Generic enough to work with different types.\n // Only returns segments that successfully rendered.\n FillRenderer.prototype.renderSegEls = function (type, segs) {\n var _this = this;\n var html = '';\n var i;\n if (segs.length) {\n // build a large concatenation of segment HTML\n for (i = 0; i < segs.length; i++) {\n html += this.renderSegHtml(type, segs[i]);\n }\n // Grab individual elements from the combined HTML string. Use each as the default rendering.\n // Then, compute the 'el' for each segment.\n htmlToElements(html).forEach(function (el, i) {\n var seg = segs[i];\n if (el) {\n seg.el = el;\n }\n });\n if (type === 'bgEvent') {\n segs = filterSegsViaEls(this.context, segs, false // isMirror. background events can never be mirror elements\n );\n }\n // correct element type? (would be bad if a non-TD were inserted into a table for example)\n segs = segs.filter(function (seg) {\n return elementMatches(seg.el, _this.fillSegTag);\n });\n }\n return segs;\n };\n // Builds the HTML needed for one fill segment. Generic enough to work with different types.\n FillRenderer.prototype.renderSegHtml = function (type, seg) {\n var css = null;\n var classNames = [];\n if (type !== 'highlight' && type !== 'businessHours') {\n css = {\n 'background-color': seg.eventRange.ui.backgroundColor\n };\n }\n if (type !== 'highlight') {\n classNames = classNames.concat(seg.eventRange.ui.classNames);\n }\n if (type === 'businessHours') {\n classNames.push('fc-bgevent');\n }\n else {\n classNames.push('fc-' + type.toLowerCase());\n }\n return '<' + this.fillSegTag +\n (classNames.length ? ' class=\"' + classNames.join(' ') + '\"' : '') +\n (css ? ' style=\"' + cssToStr(css) + '\"' : '') +\n '>';\n };\n FillRenderer.prototype.detachSegs = function (type, segs) {\n var containerEls = this.containerElsByType[type];\n if (containerEls) {\n containerEls.forEach(removeElement);\n delete this.containerElsByType[type];\n }\n };\n FillRenderer.prototype.computeSizes = function (force) {\n for (var type in this.segsByType) {\n if (force || this.dirtySizeFlags[type]) {\n this.computeSegSizes(this.segsByType[type]);\n }\n }\n };\n FillRenderer.prototype.assignSizes = function (force) {\n for (var type in this.segsByType) {\n if (force || this.dirtySizeFlags[type]) {\n this.assignSegSizes(this.segsByType[type]);\n }\n }\n this.dirtySizeFlags = {};\n };\n FillRenderer.prototype.computeSegSizes = function (segs) {\n };\n FillRenderer.prototype.assignSegSizes = function (segs) {\n };\n return FillRenderer;\n}());\n\nvar NamedTimeZoneImpl = /** @class */ (function () {\n function NamedTimeZoneImpl(timeZoneName) {\n this.timeZoneName = timeZoneName;\n }\n return NamedTimeZoneImpl;\n}());\n\n/*\nAn abstraction for a dragging interaction originating on an event.\nDoes higher-level things than PointerDragger, such as possibly:\n- a \"mirror\" that moves with the pointer\n- a minimum number of pixels or other criteria for a true drag to begin\n\nsubclasses must emit:\n- pointerdown\n- dragstart\n- dragmove\n- pointerup\n- dragend\n*/\nvar ElementDragging = /** @class */ (function () {\n function ElementDragging(el) {\n this.emitter = new EmitterMixin();\n }\n ElementDragging.prototype.destroy = function () {\n };\n ElementDragging.prototype.setMirrorIsVisible = function (bool) {\n // optional if subclass doesn't want to support a mirror\n };\n ElementDragging.prototype.setMirrorNeedsRevert = function (bool) {\n // optional if subclass doesn't want to support a mirror\n };\n ElementDragging.prototype.setAutoScrollEnabled = function (bool) {\n // optional\n };\n return ElementDragging;\n}());\n\nfunction formatDate(dateInput, settings) {\n if (settings === void 0) { settings = {}; }\n var dateEnv = buildDateEnv$1(settings);\n var formatter = createFormatter(settings);\n var dateMeta = dateEnv.createMarkerMeta(dateInput);\n if (!dateMeta) { // TODO: warning?\n return '';\n }\n return dateEnv.format(dateMeta.marker, formatter, {\n forcedTzo: dateMeta.forcedTzo\n });\n}\nfunction formatRange(startInput, endInput, settings // mixture of env and formatter settings\n) {\n var dateEnv = buildDateEnv$1(typeof settings === 'object' && settings ? settings : {}); // pass in if non-null object\n var formatter = createFormatter(settings, globalDefaults.defaultRangeSeparator);\n var startMeta = dateEnv.createMarkerMeta(startInput);\n var endMeta = dateEnv.createMarkerMeta(endInput);\n if (!startMeta || !endMeta) { // TODO: warning?\n return '';\n }\n return dateEnv.formatRange(startMeta.marker, endMeta.marker, formatter, {\n forcedStartTzo: startMeta.forcedTzo,\n forcedEndTzo: endMeta.forcedTzo,\n isEndExclusive: settings.isEndExclusive\n });\n}\n// TODO: more DRY and optimized\nfunction buildDateEnv$1(settings) {\n var locale = buildLocale(settings.locale || 'en', parseRawLocales([]).map); // TODO: don't hardcode 'en' everywhere\n // ensure required settings\n settings = __assign({ timeZone: globalDefaults.timeZone, calendarSystem: 'gregory' }, settings, { locale: locale });\n return new DateEnv(settings);\n}\n\nvar DRAG_META_PROPS = {\n startTime: createDuration,\n duration: createDuration,\n create: Boolean,\n sourceId: String\n};\nvar DRAG_META_DEFAULTS = {\n create: true\n};\nfunction parseDragMeta(raw) {\n var leftoverProps = {};\n var refined = refineProps(raw, DRAG_META_PROPS, DRAG_META_DEFAULTS, leftoverProps);\n refined.leftoverProps = leftoverProps;\n return refined;\n}\n\n// Computes a default column header formatting string if `colFormat` is not explicitly defined\nfunction computeFallbackHeaderFormat(datesRepDistinctDays, dayCnt) {\n // if more than one week row, or if there are a lot of columns with not much space,\n // put just the day numbers will be in each cell\n if (!datesRepDistinctDays || dayCnt > 10) {\n return { weekday: 'short' }; // \"Sat\"\n }\n else if (dayCnt > 1) {\n return { weekday: 'short', month: 'numeric', day: 'numeric', omitCommas: true }; // \"Sat 11/12\"\n }\n else {\n return { weekday: 'long' }; // \"Saturday\"\n }\n}\nfunction renderDateCell(dateMarker, dateProfile, datesRepDistinctDays, colCnt, colHeadFormat, context, colspan, otherAttrs) {\n var dateEnv = context.dateEnv, theme = context.theme, options = context.options;\n var isDateValid = rangeContainsMarker(dateProfile.activeRange, dateMarker); // TODO: called too frequently. cache somehow.\n var classNames = [\n 'fc-day-header',\n theme.getClass('widgetHeader')\n ];\n var innerHtml;\n if (typeof options.columnHeaderHtml === 'function') {\n innerHtml = options.columnHeaderHtml(dateEnv.toDate(dateMarker));\n }\n else if (typeof options.columnHeaderText === 'function') {\n innerHtml = htmlEscape(options.columnHeaderText(dateEnv.toDate(dateMarker)));\n }\n else {\n innerHtml = htmlEscape(dateEnv.format(dateMarker, colHeadFormat));\n }\n // if only one row of days, the classNames on the header can represent the specific days beneath\n if (datesRepDistinctDays) {\n classNames = classNames.concat(\n // includes the day-of-week class\n // noThemeHighlight=true (don't highlight the header)\n getDayClasses(dateMarker, dateProfile, context, true));\n }\n else {\n classNames.push('fc-' + DAY_IDS[dateMarker.getUTCDay()]); // only add the day-of-week class\n }\n return '' +\n ' 1 ?\n ' colspan=\"' + colspan + '\"' :\n '') +\n (otherAttrs ?\n ' ' + otherAttrs :\n '') +\n '>' +\n (isDateValid ?\n // don't make a link if the heading could represent multiple days, or if there's only one day (forceOff)\n buildGotoAnchorHtml(options, dateEnv, { date: dateMarker, forceOff: !datesRepDistinctDays || colCnt === 1 }, innerHtml) :\n // if not valid, display text, but no link\n innerHtml) +\n '';\n}\n\nvar DayHeader = /** @class */ (function (_super) {\n __extends(DayHeader, _super);\n function DayHeader(parentEl) {\n var _this = _super.call(this) || this;\n _this.renderSkeleton = memoizeRendering(_this._renderSkeleton, _this._unrenderSkeleton);\n _this.parentEl = parentEl;\n return _this;\n }\n DayHeader.prototype.render = function (props, context) {\n var dates = props.dates, datesRepDistinctDays = props.datesRepDistinctDays;\n var parts = [];\n this.renderSkeleton(context);\n if (props.renderIntroHtml) {\n parts.push(props.renderIntroHtml());\n }\n var colHeadFormat = createFormatter(context.options.columnHeaderFormat ||\n computeFallbackHeaderFormat(datesRepDistinctDays, dates.length));\n for (var _i = 0, dates_1 = dates; _i < dates_1.length; _i++) {\n var date = dates_1[_i];\n parts.push(renderDateCell(date, props.dateProfile, datesRepDistinctDays, dates.length, colHeadFormat, context));\n }\n if (context.isRtl) {\n parts.reverse();\n }\n this.thead.innerHTML = '' + parts.join('') + '';\n };\n DayHeader.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.renderSkeleton.unrender();\n };\n DayHeader.prototype._renderSkeleton = function (context) {\n var theme = context.theme;\n var parentEl = this.parentEl;\n parentEl.innerHTML = ''; // because might be nbsp\n parentEl.appendChild(this.el = htmlToElement('
' +\n '' +\n '' +\n '
' +\n '
'));\n this.thead = this.el.querySelector('thead');\n };\n DayHeader.prototype._unrenderSkeleton = function () {\n removeElement(this.el);\n };\n return DayHeader;\n}(Component));\n\nvar DaySeries = /** @class */ (function () {\n function DaySeries(range, dateProfileGenerator) {\n var date = range.start;\n var end = range.end;\n var indices = [];\n var dates = [];\n var dayIndex = -1;\n while (date < end) { // loop each day from start to end\n if (dateProfileGenerator.isHiddenDay(date)) {\n indices.push(dayIndex + 0.5); // mark that it's between indices\n }\n else {\n dayIndex++;\n indices.push(dayIndex);\n dates.push(date);\n }\n date = addDays(date, 1);\n }\n this.dates = dates;\n this.indices = indices;\n this.cnt = dates.length;\n }\n DaySeries.prototype.sliceRange = function (range) {\n var firstIndex = this.getDateDayIndex(range.start); // inclusive first index\n var lastIndex = this.getDateDayIndex(addDays(range.end, -1)); // inclusive last index\n var clippedFirstIndex = Math.max(0, firstIndex);\n var clippedLastIndex = Math.min(this.cnt - 1, lastIndex);\n // deal with in-between indices\n clippedFirstIndex = Math.ceil(clippedFirstIndex); // in-between starts round to next cell\n clippedLastIndex = Math.floor(clippedLastIndex); // in-between ends round to prev cell\n if (clippedFirstIndex <= clippedLastIndex) {\n return {\n firstIndex: clippedFirstIndex,\n lastIndex: clippedLastIndex,\n isStart: firstIndex === clippedFirstIndex,\n isEnd: lastIndex === clippedLastIndex\n };\n }\n else {\n return null;\n }\n };\n // Given a date, returns its chronolocial cell-index from the first cell of the grid.\n // If the date lies between cells (because of hiddenDays), returns a floating-point value between offsets.\n // If before the first offset, returns a negative number.\n // If after the last offset, returns an offset past the last cell offset.\n // Only works for *start* dates of cells. Will not work for exclusive end dates for cells.\n DaySeries.prototype.getDateDayIndex = function (date) {\n var indices = this.indices;\n var dayOffset = Math.floor(diffDays(this.dates[0], date));\n if (dayOffset < 0) {\n return indices[0] - 1;\n }\n else if (dayOffset >= indices.length) {\n return indices[indices.length - 1] + 1;\n }\n else {\n return indices[dayOffset];\n }\n };\n return DaySeries;\n}());\n\nvar DayTable = /** @class */ (function () {\n function DayTable(daySeries, breakOnWeeks) {\n var dates = daySeries.dates;\n var daysPerRow;\n var firstDay;\n var rowCnt;\n if (breakOnWeeks) {\n // count columns until the day-of-week repeats\n firstDay = dates[0].getUTCDay();\n for (daysPerRow = 1; daysPerRow < dates.length; daysPerRow++) {\n if (dates[daysPerRow].getUTCDay() === firstDay) {\n break;\n }\n }\n rowCnt = Math.ceil(dates.length / daysPerRow);\n }\n else {\n rowCnt = 1;\n daysPerRow = dates.length;\n }\n this.rowCnt = rowCnt;\n this.colCnt = daysPerRow;\n this.daySeries = daySeries;\n this.cells = this.buildCells();\n this.headerDates = this.buildHeaderDates();\n }\n DayTable.prototype.buildCells = function () {\n var rows = [];\n for (var row = 0; row < this.rowCnt; row++) {\n var cells = [];\n for (var col = 0; col < this.colCnt; col++) {\n cells.push(this.buildCell(row, col));\n }\n rows.push(cells);\n }\n return rows;\n };\n DayTable.prototype.buildCell = function (row, col) {\n return {\n date: this.daySeries.dates[row * this.colCnt + col]\n };\n };\n DayTable.prototype.buildHeaderDates = function () {\n var dates = [];\n for (var col = 0; col < this.colCnt; col++) {\n dates.push(this.cells[0][col].date);\n }\n return dates;\n };\n DayTable.prototype.sliceRange = function (range) {\n var colCnt = this.colCnt;\n var seriesSeg = this.daySeries.sliceRange(range);\n var segs = [];\n if (seriesSeg) {\n var firstIndex = seriesSeg.firstIndex, lastIndex = seriesSeg.lastIndex;\n var index = firstIndex;\n while (index <= lastIndex) {\n var row = Math.floor(index / colCnt);\n var nextIndex = Math.min((row + 1) * colCnt, lastIndex + 1);\n segs.push({\n row: row,\n firstCol: index % colCnt,\n lastCol: (nextIndex - 1) % colCnt,\n isStart: seriesSeg.isStart && index === firstIndex,\n isEnd: seriesSeg.isEnd && (nextIndex - 1) === lastIndex\n });\n index = nextIndex;\n }\n }\n return segs;\n };\n return DayTable;\n}());\n\nvar Slicer = /** @class */ (function () {\n function Slicer() {\n this.sliceBusinessHours = memoize(this._sliceBusinessHours);\n this.sliceDateSelection = memoize(this._sliceDateSpan);\n this.sliceEventStore = memoize(this._sliceEventStore);\n this.sliceEventDrag = memoize(this._sliceInteraction);\n this.sliceEventResize = memoize(this._sliceInteraction);\n }\n Slicer.prototype.sliceProps = function (props, dateProfile, nextDayThreshold, calendar, component) {\n var extraArgs = [];\n for (var _i = 5; _i < arguments.length; _i++) {\n extraArgs[_i - 5] = arguments[_i];\n }\n var eventUiBases = props.eventUiBases;\n var eventSegs = this.sliceEventStore.apply(this, [props.eventStore, eventUiBases, dateProfile, nextDayThreshold, component].concat(extraArgs));\n return {\n dateSelectionSegs: this.sliceDateSelection.apply(this, [props.dateSelection, eventUiBases, component].concat(extraArgs)),\n businessHourSegs: this.sliceBusinessHours.apply(this, [props.businessHours, dateProfile, nextDayThreshold, calendar, component].concat(extraArgs)),\n fgEventSegs: eventSegs.fg,\n bgEventSegs: eventSegs.bg,\n eventDrag: this.sliceEventDrag.apply(this, [props.eventDrag, eventUiBases, dateProfile, nextDayThreshold, component].concat(extraArgs)),\n eventResize: this.sliceEventResize.apply(this, [props.eventResize, eventUiBases, dateProfile, nextDayThreshold, component].concat(extraArgs)),\n eventSelection: props.eventSelection\n }; // TODO: give interactionSegs?\n };\n Slicer.prototype.sliceNowDate = function (// does not memoize\n date, component) {\n var extraArgs = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n extraArgs[_i - 2] = arguments[_i];\n }\n return this._sliceDateSpan.apply(this, [{ range: { start: date, end: addMs(date, 1) }, allDay: false },\n {},\n component].concat(extraArgs));\n };\n Slicer.prototype._sliceBusinessHours = function (businessHours, dateProfile, nextDayThreshold, calendar, component) {\n var extraArgs = [];\n for (var _i = 5; _i < arguments.length; _i++) {\n extraArgs[_i - 5] = arguments[_i];\n }\n if (!businessHours) {\n return [];\n }\n return this._sliceEventStore.apply(this, [expandRecurring(businessHours, computeActiveRange(dateProfile, Boolean(nextDayThreshold)), calendar),\n {},\n dateProfile,\n nextDayThreshold,\n component].concat(extraArgs)).bg;\n };\n Slicer.prototype._sliceEventStore = function (eventStore, eventUiBases, dateProfile, nextDayThreshold, component) {\n var extraArgs = [];\n for (var _i = 5; _i < arguments.length; _i++) {\n extraArgs[_i - 5] = arguments[_i];\n }\n if (eventStore) {\n var rangeRes = sliceEventStore(eventStore, eventUiBases, computeActiveRange(dateProfile, Boolean(nextDayThreshold)), nextDayThreshold);\n return {\n bg: this.sliceEventRanges(rangeRes.bg, component, extraArgs),\n fg: this.sliceEventRanges(rangeRes.fg, component, extraArgs)\n };\n }\n else {\n return { bg: [], fg: [] };\n }\n };\n Slicer.prototype._sliceInteraction = function (interaction, eventUiBases, dateProfile, nextDayThreshold, component) {\n var extraArgs = [];\n for (var _i = 5; _i < arguments.length; _i++) {\n extraArgs[_i - 5] = arguments[_i];\n }\n if (!interaction) {\n return null;\n }\n var rangeRes = sliceEventStore(interaction.mutatedEvents, eventUiBases, computeActiveRange(dateProfile, Boolean(nextDayThreshold)), nextDayThreshold);\n return {\n segs: this.sliceEventRanges(rangeRes.fg, component, extraArgs),\n affectedInstances: interaction.affectedEvents.instances,\n isEvent: interaction.isEvent,\n sourceSeg: interaction.origSeg\n };\n };\n Slicer.prototype._sliceDateSpan = function (dateSpan, eventUiBases, component) {\n var extraArgs = [];\n for (var _i = 3; _i < arguments.length; _i++) {\n extraArgs[_i - 3] = arguments[_i];\n }\n if (!dateSpan) {\n return [];\n }\n var eventRange = fabricateEventRange(dateSpan, eventUiBases, component.context.calendar);\n var segs = this.sliceRange.apply(this, [dateSpan.range].concat(extraArgs));\n for (var _a = 0, segs_1 = segs; _a < segs_1.length; _a++) {\n var seg = segs_1[_a];\n seg.component = component;\n seg.eventRange = eventRange;\n }\n return segs;\n };\n /*\n \"complete\" seg means it has component and eventRange\n */\n Slicer.prototype.sliceEventRanges = function (eventRanges, component, // TODO: kill\n extraArgs) {\n var segs = [];\n for (var _i = 0, eventRanges_1 = eventRanges; _i < eventRanges_1.length; _i++) {\n var eventRange = eventRanges_1[_i];\n segs.push.apply(segs, this.sliceEventRange(eventRange, component, extraArgs));\n }\n return segs;\n };\n /*\n \"complete\" seg means it has component and eventRange\n */\n Slicer.prototype.sliceEventRange = function (eventRange, component, // TODO: kill\n extraArgs) {\n var segs = this.sliceRange.apply(this, [eventRange.range].concat(extraArgs));\n for (var _i = 0, segs_2 = segs; _i < segs_2.length; _i++) {\n var seg = segs_2[_i];\n seg.component = component;\n seg.eventRange = eventRange;\n seg.isStart = eventRange.isStart && seg.isStart;\n seg.isEnd = eventRange.isEnd && seg.isEnd;\n }\n return segs;\n };\n return Slicer;\n}());\n/*\nfor incorporating minTime/maxTime if appropriate\nTODO: should be part of DateProfile!\nTimelineDateProfile already does this btw\n*/\nfunction computeActiveRange(dateProfile, isComponentAllDay) {\n var range = dateProfile.activeRange;\n if (isComponentAllDay) {\n return range;\n }\n return {\n start: addMs(range.start, dateProfile.minTime.milliseconds),\n end: addMs(range.end, dateProfile.maxTime.milliseconds - 864e5) // 864e5 = ms in a day\n };\n}\n\n// exports\n// --------------------------------------------------------------------------------------------------\nvar version = '4.4.2';\n\nexport { Calendar, Component, ComponentContext, DateComponent, DateEnv, DateProfileGenerator, DayHeader, DaySeries, DayTable, ElementDragging, ElementScrollController, EmitterMixin, EventApi, FgEventRenderer, FillRenderer, Interaction, Mixin, NamedTimeZoneImpl, PositionCache, ScrollComponent, ScrollController, Slicer, Splitter, Theme, View, WindowScrollController, addDays, addDurations, addMs, addWeeks, allowContextMenu, allowSelection, appendToElement, applyAll, applyMutationToEventStore, applyStyle, applyStyleProp, asRoughMinutes, asRoughMs, asRoughSeconds, buildGotoAnchorHtml, buildSegCompareObj, capitaliseFirstLetter, combineEventUis, compareByFieldSpec, compareByFieldSpecs, compareNumbers, compensateScroll, computeClippingRect, computeEdges, computeEventDraggable, computeEventEndResizable, computeEventStartResizable, computeFallbackHeaderFormat, computeHeightAndMargins, computeInnerRect, computeRect, computeVisibleDayRange, config, constrainPoint, createDuration, createElement, createEmptyEventStore, createEventInstance, createFormatter, createPlugin, cssToStr, debounce, diffDates, diffDayAndTime, diffDays, diffPoints, diffWeeks, diffWholeDays, diffWholeWeeks, disableCursor, distributeHeight, elementClosest, elementMatches, enableCursor, eventTupleToStore, filterEventStoreDefs, filterHash, findChildren, findElements, flexibleCompare, forceClassName, formatDate, formatIsoTimeString, formatRange, getAllDayHtml, getClippingParents, getDayClasses, getElSeg, getRectCenter, getRelevantEvents, globalDefaults, greatestDurationDenominator, hasBgRendering, htmlEscape, htmlToElement, insertAfterElement, interactionSettingsStore, interactionSettingsToStore, intersectRanges, intersectRects, isArraysEqual, isDateSpansEqual, isInt, isInteractionValid, isMultiDayRange, isPropsEqual, isPropsValid, isSingleDay, isValidDate, listenBySelector, mapHash, matchCellWidths, memoize, memoizeOutput, memoizeRendering, mergeEventStores, multiplyDuration, padStart, parseBusinessHours, parseDragMeta, parseEventDef, parseFieldSpecs, parse as parseMarker, pointInsideRect, prependToElement, preventContextMenu, preventDefault, preventSelection, processScopedUiProps, rangeContainsMarker, rangeContainsRange, rangesEqual, rangesIntersect, refineProps, removeElement, removeExact, renderDateCell, requestJson, sliceEventStore, startOfDay, subtractInnerElHeight, translateRect, uncompensateScroll, undistributeHeight, unpromisify, version, whenTransitionDone, wholeDivideDurations };\n", "/*!\nFullCalendar Day Grid Plugin v4.4.2\nDocs & License: https://fullcalendar.io/\n(c) 2019 Adam Shaw\n*/\n\nimport { addWeeks, diffWeeks, DateProfileGenerator, createElement, listenBySelector, removeElement, computeRect, computeClippingRect, applyStyle, computeEventDraggable, computeEventStartResizable, computeEventEndResizable, cssToStr, htmlEscape, FgEventRenderer, appendToElement, prependToElement, htmlToElement, FillRenderer, memoizeRendering, createFormatter, addDays, DateComponent, rangeContainsMarker, getDayClasses, findElements, PositionCache, buildGotoAnchorHtml, findChildren, insertAfterElement, intersectRanges, memoize, ScrollComponent, matchCellWidths, uncompensateScroll, compensateScroll, subtractInnerElHeight, distributeHeight, undistributeHeight, View, Slicer, DayHeader, DaySeries, DayTable, createPlugin } from '@fullcalendar/core';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\n\nvar DayGridDateProfileGenerator = /** @class */ (function (_super) {\n __extends(DayGridDateProfileGenerator, _super);\n function DayGridDateProfileGenerator() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n // Computes the date range that will be rendered.\n DayGridDateProfileGenerator.prototype.buildRenderRange = function (currentRange, currentRangeUnit, isRangeAllDay) {\n var dateEnv = this.dateEnv;\n var renderRange = _super.prototype.buildRenderRange.call(this, currentRange, currentRangeUnit, isRangeAllDay);\n var start = renderRange.start;\n var end = renderRange.end;\n var endOfWeek;\n // year and month views should be aligned with weeks. this is already done for week\n if (/^(year|month)$/.test(currentRangeUnit)) {\n start = dateEnv.startOfWeek(start);\n // make end-of-week if not already\n endOfWeek = dateEnv.startOfWeek(end);\n if (endOfWeek.valueOf() !== end.valueOf()) {\n end = addWeeks(endOfWeek, 1);\n }\n }\n // ensure 6 weeks\n if (this.options.monthMode &&\n this.options.fixedWeekCount) {\n var rowCnt = Math.ceil(// could be partial weeks due to hiddenDays\n diffWeeks(start, end));\n end = addWeeks(end, 6 - rowCnt);\n }\n return { start: start, end: end };\n };\n return DayGridDateProfileGenerator;\n}(DateProfileGenerator));\n\n/* A rectangular panel that is absolutely positioned over other content\n------------------------------------------------------------------------------------------------------------------------\nOptions:\n - className (string)\n - content (HTML string, element, or element array)\n - parentEl\n - top\n - left\n - right (the x coord of where the right edge should be. not a \"CSS\" right)\n - autoHide (boolean)\n - show (callback)\n - hide (callback)\n*/\nvar Popover = /** @class */ (function () {\n function Popover(options) {\n var _this = this;\n this.isHidden = true;\n this.margin = 10; // the space required between the popover and the edges of the scroll container\n // Triggered when the user clicks *anywhere* in the document, for the autoHide feature\n this.documentMousedown = function (ev) {\n // only hide the popover if the click happened outside the popover\n if (_this.el && !_this.el.contains(ev.target)) {\n _this.hide();\n }\n };\n this.options = options;\n }\n // Shows the popover on the specified position. Renders it if not already\n Popover.prototype.show = function () {\n if (this.isHidden) {\n if (!this.el) {\n this.render();\n }\n this.el.style.display = '';\n this.position();\n this.isHidden = false;\n this.trigger('show');\n }\n };\n // Hides the popover, through CSS, but does not remove it from the DOM\n Popover.prototype.hide = function () {\n if (!this.isHidden) {\n this.el.style.display = 'none';\n this.isHidden = true;\n this.trigger('hide');\n }\n };\n // Creates `this.el` and renders content inside of it\n Popover.prototype.render = function () {\n var _this = this;\n var options = this.options;\n var el = this.el = createElement('div', {\n className: 'fc-popover ' + (options.className || ''),\n style: {\n top: '0',\n left: '0'\n }\n });\n if (typeof options.content === 'function') {\n options.content(el);\n }\n options.parentEl.appendChild(el);\n // when a click happens on anything inside with a 'fc-close' className, hide the popover\n listenBySelector(el, 'click', '.fc-close', function (ev) {\n _this.hide();\n });\n if (options.autoHide) {\n document.addEventListener('mousedown', this.documentMousedown);\n }\n };\n // Hides and unregisters any handlers\n Popover.prototype.destroy = function () {\n this.hide();\n if (this.el) {\n removeElement(this.el);\n this.el = null;\n }\n document.removeEventListener('mousedown', this.documentMousedown);\n };\n // Positions the popover optimally, using the top/left/right options\n Popover.prototype.position = function () {\n var options = this.options;\n var el = this.el;\n var elDims = el.getBoundingClientRect(); // only used for width,height\n var origin = computeRect(el.offsetParent);\n var clippingRect = computeClippingRect(options.parentEl);\n var top; // the \"position\" (not \"offset\") values for the popover\n var left; //\n // compute top and left\n top = options.top || 0;\n if (options.left !== undefined) {\n left = options.left;\n }\n else if (options.right !== undefined) {\n left = options.right - elDims.width; // derive the left value from the right value\n }\n else {\n left = 0;\n }\n // constrain to the view port. if constrained by two edges, give precedence to top/left\n top = Math.min(top, clippingRect.bottom - elDims.height - this.margin);\n top = Math.max(top, clippingRect.top + this.margin);\n left = Math.min(left, clippingRect.right - elDims.width - this.margin);\n left = Math.max(left, clippingRect.left + this.margin);\n applyStyle(el, {\n top: top - origin.top,\n left: left - origin.left\n });\n };\n // Triggers a callback. Calls a function in the option hash of the same name.\n // Arguments beyond the first `name` are forwarded on.\n // TODO: better code reuse for this. Repeat code\n // can kill this???\n Popover.prototype.trigger = function (name) {\n if (this.options[name]) {\n this.options[name].apply(this, Array.prototype.slice.call(arguments, 1));\n }\n };\n return Popover;\n}());\n\n/* Event-rendering methods for the DayGrid class\n----------------------------------------------------------------------------------------------------------------------*/\n// \"Simple\" is bad a name. has nothing to do with SimpleDayGrid\nvar SimpleDayGridEventRenderer = /** @class */ (function (_super) {\n __extends(SimpleDayGridEventRenderer, _super);\n function SimpleDayGridEventRenderer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n // Builds the HTML to be used for the default element for an individual segment\n SimpleDayGridEventRenderer.prototype.renderSegHtml = function (seg, mirrorInfo) {\n var context = this.context;\n var eventRange = seg.eventRange;\n var eventDef = eventRange.def;\n var eventUi = eventRange.ui;\n var allDay = eventDef.allDay;\n var isDraggable = computeEventDraggable(context, eventDef, eventUi);\n var isResizableFromStart = allDay && seg.isStart && computeEventStartResizable(context, eventDef, eventUi);\n var isResizableFromEnd = allDay && seg.isEnd && computeEventEndResizable(context, eventDef, eventUi);\n var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd, mirrorInfo);\n var skinCss = cssToStr(this.getSkinCss(eventUi));\n var timeHtml = '';\n var timeText;\n var titleHtml;\n classes.unshift('fc-day-grid-event', 'fc-h-event');\n // Only display a timed events time if it is the starting segment\n if (seg.isStart) {\n timeText = this.getTimeText(eventRange);\n if (timeText) {\n timeHtml = '' + htmlEscape(timeText) + '';\n }\n }\n titleHtml =\n '' +\n (htmlEscape(eventDef.title || '') || ' ') + // we always want one line of height\n '';\n return '
' +\n '
' +\n (context.options.dir === 'rtl' ?\n titleHtml + ' ' + timeHtml : // put a natural space in between\n timeHtml + ' ' + titleHtml //\n ) +\n '
' +\n (isResizableFromStart ?\n '
' :\n '') +\n (isResizableFromEnd ?\n '
' :\n '') +\n '
';\n };\n // Computes a default event time formatting string if `eventTimeFormat` is not explicitly defined\n SimpleDayGridEventRenderer.prototype.computeEventTimeFormat = function () {\n return {\n hour: 'numeric',\n minute: '2-digit',\n omitZeroMinute: true,\n meridiem: 'narrow'\n };\n };\n SimpleDayGridEventRenderer.prototype.computeDisplayEventEnd = function () {\n return false; // TODO: somehow consider the originating DayGrid's column count\n };\n return SimpleDayGridEventRenderer;\n}(FgEventRenderer));\n\n/* Event-rendering methods for the DayGrid class\n----------------------------------------------------------------------------------------------------------------------*/\nvar DayGridEventRenderer = /** @class */ (function (_super) {\n __extends(DayGridEventRenderer, _super);\n function DayGridEventRenderer(dayGrid) {\n var _this = _super.call(this) || this;\n _this.dayGrid = dayGrid;\n return _this;\n }\n // Renders the given foreground event segments onto the grid\n DayGridEventRenderer.prototype.attachSegs = function (segs, mirrorInfo) {\n var rowStructs = this.rowStructs = this.renderSegRows(segs);\n // append to each row's content skeleton\n this.dayGrid.rowEls.forEach(function (rowNode, i) {\n rowNode.querySelector('.fc-content-skeleton > table').appendChild(rowStructs[i].tbodyEl);\n });\n // removes the \"more..\" events popover\n if (!mirrorInfo) {\n this.dayGrid.removeSegPopover();\n }\n };\n // Unrenders all currently rendered foreground event segments\n DayGridEventRenderer.prototype.detachSegs = function () {\n var rowStructs = this.rowStructs || [];\n var rowStruct;\n while ((rowStruct = rowStructs.pop())) {\n removeElement(rowStruct.tbodyEl);\n }\n this.rowStructs = null;\n };\n // Uses the given events array to generate elements that should be appended to each row's content skeleton.\n // Returns an array of rowStruct objects (see the bottom of `renderSegRow`).\n // PRECONDITION: each segment shoud already have a rendered and assigned `.el`\n DayGridEventRenderer.prototype.renderSegRows = function (segs) {\n var rowStructs = [];\n var segRows;\n var row;\n segRows = this.groupSegRows(segs); // group into nested arrays\n // iterate each row of segment groupings\n for (row = 0; row < segRows.length; row++) {\n rowStructs.push(this.renderSegRow(row, segRows[row]));\n }\n return rowStructs;\n };\n // Given a row # and an array of segments all in the same row, render a element, a skeleton that contains\n // the segments. Returns object with a bunch of internal data about how the render was calculated.\n // NOTE: modifies rowSegs\n DayGridEventRenderer.prototype.renderSegRow = function (row, rowSegs) {\n var isRtl = this.context.isRtl;\n var dayGrid = this.dayGrid;\n var colCnt = dayGrid.colCnt;\n var segLevels = this.buildSegLevels(rowSegs); // group into sub-arrays of levels\n var levelCnt = Math.max(1, segLevels.length); // ensure at least one level\n var tbody = document.createElement('tbody');\n var segMatrix = []; // lookup for which segments are rendered into which level+col cells\n var cellMatrix = []; // lookup for all elements of the level+col matrix\n var loneCellMatrix = []; // lookup for elements that only take up a single column\n var i;\n var levelSegs;\n var col;\n var tr;\n var j;\n var seg;\n var td;\n // populates empty cells from the current column (`col`) to `endCol`\n function emptyCellsUntil(endCol) {\n while (col < endCol) {\n // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n td = (loneCellMatrix[i - 1] || [])[col];\n if (td) {\n td.rowSpan = (td.rowSpan || 1) + 1;\n }\n else {\n td = document.createElement('td');\n tr.appendChild(td);\n }\n cellMatrix[i][col] = td;\n loneCellMatrix[i][col] = td;\n col++;\n }\n }\n for (i = 0; i < levelCnt; i++) { // iterate through all levels\n levelSegs = segLevels[i];\n col = 0;\n tr = document.createElement('tr');\n segMatrix.push([]);\n cellMatrix.push([]);\n loneCellMatrix.push([]);\n // levelCnt might be 1 even though there are no actual levels. protect against this.\n // this single empty row is useful for styling.\n if (levelSegs) {\n for (j = 0; j < levelSegs.length; j++) { // iterate through segments in level\n seg = levelSegs[j];\n var leftCol = isRtl ? (colCnt - 1 - seg.lastCol) : seg.firstCol;\n var rightCol = isRtl ? (colCnt - 1 - seg.firstCol) : seg.lastCol;\n emptyCellsUntil(leftCol);\n // create a container that occupies or more columns. append the event element.\n td = createElement('td', { className: 'fc-event-container' }, seg.el);\n if (leftCol !== rightCol) {\n td.colSpan = rightCol - leftCol + 1;\n }\n else { // a single-column segment\n loneCellMatrix[i][col] = td;\n }\n while (col <= rightCol) {\n cellMatrix[i][col] = td;\n segMatrix[i][col] = seg;\n col++;\n }\n tr.appendChild(td);\n }\n }\n emptyCellsUntil(colCnt); // finish off the row\n var introHtml = dayGrid.renderProps.renderIntroHtml();\n if (introHtml) {\n if (isRtl) {\n appendToElement(tr, introHtml);\n }\n else {\n prependToElement(tr, introHtml);\n }\n }\n tbody.appendChild(tr);\n }\n return {\n row: row,\n tbodyEl: tbody,\n cellMatrix: cellMatrix,\n segMatrix: segMatrix,\n segLevels: segLevels,\n segs: rowSegs\n };\n };\n // Stacks a flat array of segments, which are all assumed to be in the same row, into subarrays of vertical levels.\n // NOTE: modifies segs\n DayGridEventRenderer.prototype.buildSegLevels = function (segs) {\n var isRtl = this.context.isRtl;\n var colCnt = this.dayGrid.colCnt;\n var levels = [];\n var i;\n var seg;\n var j;\n // Give preference to elements with certain criteria, so they have\n // a chance to be closer to the top.\n segs = this.sortEventSegs(segs);\n for (i = 0; i < segs.length; i++) {\n seg = segs[i];\n // loop through levels, starting with the topmost, until the segment doesn't collide with other segments\n for (j = 0; j < levels.length; j++) {\n if (!isDaySegCollision(seg, levels[j])) {\n break;\n }\n }\n // `j` now holds the desired subrow index\n seg.level = j;\n seg.leftCol = isRtl ? (colCnt - 1 - seg.lastCol) : seg.firstCol; // for sorting only\n seg.rightCol = isRtl ? (colCnt - 1 - seg.firstCol) : seg.lastCol // for sorting only\n ;\n (levels[j] || (levels[j] = [])).push(seg);\n }\n // order segments left-to-right. very important if calendar is RTL\n for (j = 0; j < levels.length; j++) {\n levels[j].sort(compareDaySegCols);\n }\n return levels;\n };\n // Given a flat array of segments, return an array of sub-arrays, grouped by each segment's row\n DayGridEventRenderer.prototype.groupSegRows = function (segs) {\n var segRows = [];\n var i;\n for (i = 0; i < this.dayGrid.rowCnt; i++) {\n segRows.push([]);\n }\n for (i = 0; i < segs.length; i++) {\n segRows[segs[i].row].push(segs[i]);\n }\n return segRows;\n };\n // Computes a default `displayEventEnd` value if one is not expliclty defined\n DayGridEventRenderer.prototype.computeDisplayEventEnd = function () {\n return this.dayGrid.colCnt === 1; // we'll likely have space if there's only one day\n };\n return DayGridEventRenderer;\n}(SimpleDayGridEventRenderer));\n// Computes whether two segments' columns collide. They are assumed to be in the same row.\nfunction isDaySegCollision(seg, otherSegs) {\n var i;\n var otherSeg;\n for (i = 0; i < otherSegs.length; i++) {\n otherSeg = otherSegs[i];\n if (otherSeg.firstCol <= seg.lastCol &&\n otherSeg.lastCol >= seg.firstCol) {\n return true;\n }\n }\n return false;\n}\n// A cmp function for determining the leftmost event\nfunction compareDaySegCols(a, b) {\n return a.leftCol - b.leftCol;\n}\n\nvar DayGridMirrorRenderer = /** @class */ (function (_super) {\n __extends(DayGridMirrorRenderer, _super);\n function DayGridMirrorRenderer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DayGridMirrorRenderer.prototype.attachSegs = function (segs, mirrorInfo) {\n var sourceSeg = mirrorInfo.sourceSeg;\n var rowStructs = this.rowStructs = this.renderSegRows(segs);\n // inject each new event skeleton into each associated row\n this.dayGrid.rowEls.forEach(function (rowNode, row) {\n var skeletonEl = htmlToElement('
'); // will be absolutely positioned\n var skeletonTopEl;\n var skeletonTop;\n // If there is an original segment, match the top position. Otherwise, put it at the row's top level\n if (sourceSeg && sourceSeg.row === row) {\n skeletonTopEl = sourceSeg.el;\n }\n else {\n skeletonTopEl = rowNode.querySelector('.fc-content-skeleton tbody');\n if (!skeletonTopEl) { // when no events\n skeletonTopEl = rowNode.querySelector('.fc-content-skeleton table');\n }\n }\n skeletonTop = skeletonTopEl.getBoundingClientRect().top -\n rowNode.getBoundingClientRect().top; // the offsetParent origin\n skeletonEl.style.top = skeletonTop + 'px';\n skeletonEl.querySelector('table').appendChild(rowStructs[row].tbodyEl);\n rowNode.appendChild(skeletonEl);\n });\n };\n return DayGridMirrorRenderer;\n}(DayGridEventRenderer));\n\nvar EMPTY_CELL_HTML = '';\nvar DayGridFillRenderer = /** @class */ (function (_super) {\n __extends(DayGridFillRenderer, _super);\n function DayGridFillRenderer(dayGrid) {\n var _this = _super.call(this) || this;\n _this.fillSegTag = 'td'; // override the default tag name\n _this.dayGrid = dayGrid;\n return _this;\n }\n DayGridFillRenderer.prototype.renderSegs = function (type, context, segs) {\n // don't render timed background events\n if (type === 'bgEvent') {\n segs = segs.filter(function (seg) {\n return seg.eventRange.def.allDay;\n });\n }\n _super.prototype.renderSegs.call(this, type, context, segs);\n };\n DayGridFillRenderer.prototype.attachSegs = function (type, segs) {\n var els = [];\n var i;\n var seg;\n var skeletonEl;\n for (i = 0; i < segs.length; i++) {\n seg = segs[i];\n skeletonEl = this.renderFillRow(type, seg);\n this.dayGrid.rowEls[seg.row].appendChild(skeletonEl);\n els.push(skeletonEl);\n }\n return els;\n };\n // Generates the HTML needed for one row of a fill. Requires the seg's el to be rendered.\n DayGridFillRenderer.prototype.renderFillRow = function (type, seg) {\n var dayGrid = this.dayGrid;\n var isRtl = this.context.isRtl;\n var colCnt = dayGrid.colCnt;\n var leftCol = isRtl ? (colCnt - 1 - seg.lastCol) : seg.firstCol;\n var rightCol = isRtl ? (colCnt - 1 - seg.firstCol) : seg.lastCol;\n var startCol = leftCol;\n var endCol = rightCol + 1;\n var className;\n var skeletonEl;\n var trEl;\n if (type === 'businessHours') {\n className = 'bgevent';\n }\n else {\n className = type.toLowerCase();\n }\n skeletonEl = htmlToElement('
' +\n '
' +\n '
');\n trEl = skeletonEl.getElementsByTagName('tr')[0];\n if (startCol > 0) {\n appendToElement(trEl, \n // will create (startCol + 1) td's\n new Array(startCol + 1).join(EMPTY_CELL_HTML));\n }\n seg.el.colSpan = endCol - startCol;\n trEl.appendChild(seg.el);\n if (endCol < colCnt) {\n appendToElement(trEl, \n // will create (colCnt - endCol) td's\n new Array(colCnt - endCol + 1).join(EMPTY_CELL_HTML));\n }\n var introHtml = dayGrid.renderProps.renderIntroHtml();\n if (introHtml) {\n if (isRtl) {\n appendToElement(trEl, introHtml);\n }\n else {\n prependToElement(trEl, introHtml);\n }\n }\n return skeletonEl;\n };\n return DayGridFillRenderer;\n}(FillRenderer));\n\nvar DayTile = /** @class */ (function (_super) {\n __extends(DayTile, _super);\n function DayTile(el) {\n var _this = _super.call(this, el) || this;\n var eventRenderer = _this.eventRenderer = new DayTileEventRenderer(_this);\n var renderFrame = _this.renderFrame = memoizeRendering(_this._renderFrame);\n _this.renderFgEvents = memoizeRendering(eventRenderer.renderSegs.bind(eventRenderer), eventRenderer.unrender.bind(eventRenderer), [renderFrame]);\n _this.renderEventSelection = memoizeRendering(eventRenderer.selectByInstanceId.bind(eventRenderer), eventRenderer.unselectByInstanceId.bind(eventRenderer), [_this.renderFgEvents]);\n _this.renderEventDrag = memoizeRendering(eventRenderer.hideByHash.bind(eventRenderer), eventRenderer.showByHash.bind(eventRenderer), [renderFrame]);\n _this.renderEventResize = memoizeRendering(eventRenderer.hideByHash.bind(eventRenderer), eventRenderer.showByHash.bind(eventRenderer), [renderFrame]);\n return _this;\n }\n DayTile.prototype.firstContext = function (context) {\n context.calendar.registerInteractiveComponent(this, {\n el: this.el,\n useEventCenter: false\n });\n };\n DayTile.prototype.render = function (props, context) {\n this.renderFrame(props.date);\n this.renderFgEvents(context, props.fgSegs);\n this.renderEventSelection(props.eventSelection);\n this.renderEventDrag(props.eventDragInstances);\n this.renderEventResize(props.eventResizeInstances);\n };\n DayTile.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.renderFrame.unrender(); // should unrender everything else\n this.context.calendar.unregisterInteractiveComponent(this);\n };\n DayTile.prototype._renderFrame = function (date) {\n var _a = this.context, theme = _a.theme, dateEnv = _a.dateEnv, options = _a.options;\n var title = dateEnv.format(date, createFormatter(options.dayPopoverFormat) // TODO: cache\n );\n this.el.innerHTML =\n '
' +\n '' +\n htmlEscape(title) +\n '' +\n '' +\n '
' +\n '
' +\n '
' +\n '
';\n this.segContainerEl = this.el.querySelector('.fc-event-container');\n };\n DayTile.prototype.queryHit = function (positionLeft, positionTop, elWidth, elHeight) {\n var date = this.props.date; // HACK\n if (positionLeft < elWidth && positionTop < elHeight) {\n return {\n component: this,\n dateSpan: {\n allDay: true,\n range: { start: date, end: addDays(date, 1) }\n },\n dayEl: this.el,\n rect: {\n left: 0,\n top: 0,\n right: elWidth,\n bottom: elHeight\n },\n layer: 1\n };\n }\n };\n return DayTile;\n}(DateComponent));\nvar DayTileEventRenderer = /** @class */ (function (_super) {\n __extends(DayTileEventRenderer, _super);\n function DayTileEventRenderer(dayTile) {\n var _this = _super.call(this) || this;\n _this.dayTile = dayTile;\n return _this;\n }\n DayTileEventRenderer.prototype.attachSegs = function (segs) {\n for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {\n var seg = segs_1[_i];\n this.dayTile.segContainerEl.appendChild(seg.el);\n }\n };\n DayTileEventRenderer.prototype.detachSegs = function (segs) {\n for (var _i = 0, segs_2 = segs; _i < segs_2.length; _i++) {\n var seg = segs_2[_i];\n removeElement(seg.el);\n }\n };\n return DayTileEventRenderer;\n}(SimpleDayGridEventRenderer));\n\nvar DayBgRow = /** @class */ (function () {\n function DayBgRow(context) {\n this.context = context;\n }\n DayBgRow.prototype.renderHtml = function (props) {\n var parts = [];\n if (props.renderIntroHtml) {\n parts.push(props.renderIntroHtml());\n }\n for (var _i = 0, _a = props.cells; _i < _a.length; _i++) {\n var cell = _a[_i];\n parts.push(renderCellHtml(cell.date, props.dateProfile, this.context, cell.htmlAttrs));\n }\n if (!props.cells.length) {\n parts.push('');\n }\n if (this.context.options.dir === 'rtl') {\n parts.reverse();\n }\n return '' + parts.join('') + '';\n };\n return DayBgRow;\n}());\nfunction renderCellHtml(date, dateProfile, context, otherAttrs) {\n var dateEnv = context.dateEnv, theme = context.theme;\n var isDateValid = rangeContainsMarker(dateProfile.activeRange, date); // TODO: called too frequently. cache somehow.\n var classes = getDayClasses(date, dateProfile, context);\n classes.unshift('fc-day', theme.getClass('widgetContent'));\n return '';\n}\n\nvar DAY_NUM_FORMAT = createFormatter({ day: 'numeric' });\nvar WEEK_NUM_FORMAT = createFormatter({ week: 'numeric' });\nvar DayGrid = /** @class */ (function (_super) {\n __extends(DayGrid, _super);\n function DayGrid(el, renderProps) {\n var _this = _super.call(this, el) || this;\n _this.bottomCoordPadding = 0; // hack for extending the hit area for the last row of the coordinate grid\n _this.isCellSizesDirty = false;\n _this.renderProps = renderProps;\n var eventRenderer = _this.eventRenderer = new DayGridEventRenderer(_this);\n var fillRenderer = _this.fillRenderer = new DayGridFillRenderer(_this);\n _this.mirrorRenderer = new DayGridMirrorRenderer(_this);\n var renderCells = _this.renderCells = memoizeRendering(_this._renderCells, _this._unrenderCells);\n _this.renderBusinessHours = memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'businessHours'), fillRenderer.unrender.bind(fillRenderer, 'businessHours'), [renderCells]);\n _this.renderDateSelection = memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'highlight'), fillRenderer.unrender.bind(fillRenderer, 'highlight'), [renderCells]);\n _this.renderBgEvents = memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'bgEvent'), fillRenderer.unrender.bind(fillRenderer, 'bgEvent'), [renderCells]);\n _this.renderFgEvents = memoizeRendering(eventRenderer.renderSegs.bind(eventRenderer), eventRenderer.unrender.bind(eventRenderer), [renderCells]);\n _this.renderEventSelection = memoizeRendering(eventRenderer.selectByInstanceId.bind(eventRenderer), eventRenderer.unselectByInstanceId.bind(eventRenderer), [_this.renderFgEvents]);\n _this.renderEventDrag = memoizeRendering(_this._renderEventDrag, _this._unrenderEventDrag, [renderCells]);\n _this.renderEventResize = memoizeRendering(_this._renderEventResize, _this._unrenderEventResize, [renderCells]);\n return _this;\n }\n DayGrid.prototype.render = function (props, context) {\n var cells = props.cells;\n this.rowCnt = cells.length;\n this.colCnt = cells[0].length;\n this.renderCells(cells, props.isRigid);\n this.renderBusinessHours(context, props.businessHourSegs);\n this.renderDateSelection(context, props.dateSelectionSegs);\n this.renderBgEvents(context, props.bgEventSegs);\n this.renderFgEvents(context, props.fgEventSegs);\n this.renderEventSelection(props.eventSelection);\n this.renderEventDrag(props.eventDrag);\n this.renderEventResize(props.eventResize);\n if (this.segPopoverTile) {\n this.updateSegPopoverTile();\n }\n };\n DayGrid.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.renderCells.unrender(); // will unrender everything else\n };\n DayGrid.prototype.getCellRange = function (row, col) {\n var start = this.props.cells[row][col].date;\n var end = addDays(start, 1);\n return { start: start, end: end };\n };\n DayGrid.prototype.updateSegPopoverTile = function (date, segs) {\n var ownProps = this.props;\n this.segPopoverTile.receiveProps({\n date: date || this.segPopoverTile.props.date,\n fgSegs: segs || this.segPopoverTile.props.fgSegs,\n eventSelection: ownProps.eventSelection,\n eventDragInstances: ownProps.eventDrag ? ownProps.eventDrag.affectedInstances : null,\n eventResizeInstances: ownProps.eventResize ? ownProps.eventResize.affectedInstances : null\n }, this.context);\n };\n /* Date Rendering\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype._renderCells = function (cells, isRigid) {\n var _a = this.context, calendar = _a.calendar, view = _a.view, isRtl = _a.isRtl, dateEnv = _a.dateEnv;\n var _b = this, rowCnt = _b.rowCnt, colCnt = _b.colCnt;\n var html = '';\n var row;\n var col;\n for (row = 0; row < rowCnt; row++) {\n html += this.renderDayRowHtml(row, isRigid);\n }\n this.el.innerHTML = html;\n this.rowEls = findElements(this.el, '.fc-row');\n this.cellEls = findElements(this.el, '.fc-day, .fc-disabled-day');\n if (isRtl) {\n this.cellEls.reverse();\n }\n this.rowPositions = new PositionCache(this.el, this.rowEls, false, true // vertical\n );\n this.colPositions = new PositionCache(this.el, this.cellEls.slice(0, colCnt), // only the first row\n true, false // horizontal\n );\n // trigger dayRender with each cell's element\n for (row = 0; row < rowCnt; row++) {\n for (col = 0; col < colCnt; col++) {\n calendar.publiclyTrigger('dayRender', [\n {\n date: dateEnv.toDate(cells[row][col].date),\n el: this.getCellEl(row, col),\n view: view\n }\n ]);\n }\n }\n this.isCellSizesDirty = true;\n };\n DayGrid.prototype._unrenderCells = function () {\n this.removeSegPopover();\n };\n // Generates the HTML for a single row, which is a div that wraps a table.\n // `row` is the row number.\n DayGrid.prototype.renderDayRowHtml = function (row, isRigid) {\n var theme = this.context.theme;\n var classes = ['fc-row', 'fc-week', theme.getClass('dayRow')];\n if (isRigid) {\n classes.push('fc-rigid');\n }\n var bgRow = new DayBgRow(this.context);\n return '' +\n '
' +\n '
' +\n '' +\n bgRow.renderHtml({\n cells: this.props.cells[row],\n dateProfile: this.props.dateProfile,\n renderIntroHtml: this.renderProps.renderBgIntroHtml\n }) +\n '
' +\n '
' +\n '
' +\n '' +\n (this.getIsNumbersVisible() ?\n '' +\n this.renderNumberTrHtml(row) +\n '' :\n '') +\n '
' +\n '
' +\n '
';\n };\n DayGrid.prototype.getIsNumbersVisible = function () {\n return this.getIsDayNumbersVisible() ||\n this.renderProps.cellWeekNumbersVisible ||\n this.renderProps.colWeekNumbersVisible;\n };\n DayGrid.prototype.getIsDayNumbersVisible = function () {\n return this.rowCnt > 1;\n };\n /* Grid Number Rendering\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype.renderNumberTrHtml = function (row) {\n var isRtl = this.context.isRtl;\n var intro = this.renderProps.renderNumberIntroHtml(row, this);\n return '' +\n '' +\n (isRtl ? '' : intro) +\n this.renderNumberCellsHtml(row) +\n (isRtl ? intro : '') +\n '';\n };\n DayGrid.prototype.renderNumberCellsHtml = function (row) {\n var htmls = [];\n var col;\n var date;\n for (col = 0; col < this.colCnt; col++) {\n date = this.props.cells[row][col].date;\n htmls.push(this.renderNumberCellHtml(date));\n }\n if (this.context.isRtl) {\n htmls.reverse();\n }\n return htmls.join('');\n };\n // Generates the HTML for the s of the \"number\" row in the DayGrid's content skeleton.\n // The number row will only exist if either day numbers or week numbers are turned on.\n DayGrid.prototype.renderNumberCellHtml = function (date) {\n var _a = this.context, dateEnv = _a.dateEnv, options = _a.options;\n var html = '';\n var isDateValid = rangeContainsMarker(this.props.dateProfile.activeRange, date); // TODO: called too frequently. cache somehow.\n var isDayNumberVisible = this.getIsDayNumbersVisible() && isDateValid;\n var classes;\n var weekCalcFirstDow;\n if (!isDayNumberVisible && !this.renderProps.cellWeekNumbersVisible) {\n // no numbers in day cell (week number must be along the side)\n return ''; // will create an empty space above events :(\n }\n classes = getDayClasses(date, this.props.dateProfile, this.context);\n classes.unshift('fc-day-top');\n if (this.renderProps.cellWeekNumbersVisible) {\n weekCalcFirstDow = dateEnv.weekDow;\n }\n html += '';\n if (this.renderProps.cellWeekNumbersVisible && (date.getUTCDay() === weekCalcFirstDow)) {\n html += buildGotoAnchorHtml(options, dateEnv, { date: date, type: 'week' }, { 'class': 'fc-week-number' }, dateEnv.format(date, WEEK_NUM_FORMAT) // inner HTML\n );\n }\n if (isDayNumberVisible) {\n html += buildGotoAnchorHtml(options, dateEnv, date, { 'class': 'fc-day-number' }, dateEnv.format(date, DAY_NUM_FORMAT) // inner HTML\n );\n }\n html += '';\n return html;\n };\n /* Sizing\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype.updateSize = function (isResize) {\n var calendar = this.context.calendar;\n var _a = this, fillRenderer = _a.fillRenderer, eventRenderer = _a.eventRenderer, mirrorRenderer = _a.mirrorRenderer;\n if (isResize ||\n this.isCellSizesDirty ||\n calendar.isEventsUpdated // hack\n ) {\n this.buildPositionCaches();\n this.isCellSizesDirty = false;\n }\n fillRenderer.computeSizes(isResize);\n eventRenderer.computeSizes(isResize);\n mirrorRenderer.computeSizes(isResize);\n fillRenderer.assignSizes(isResize);\n eventRenderer.assignSizes(isResize);\n mirrorRenderer.assignSizes(isResize);\n };\n DayGrid.prototype.buildPositionCaches = function () {\n this.buildColPositions();\n this.buildRowPositions();\n };\n DayGrid.prototype.buildColPositions = function () {\n this.colPositions.build();\n };\n DayGrid.prototype.buildRowPositions = function () {\n this.rowPositions.build();\n this.rowPositions.bottoms[this.rowCnt - 1] += this.bottomCoordPadding; // hack\n };\n /* Hit System\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype.positionToHit = function (leftPosition, topPosition) {\n var _a = this, colPositions = _a.colPositions, rowPositions = _a.rowPositions;\n var col = colPositions.leftToIndex(leftPosition);\n var row = rowPositions.topToIndex(topPosition);\n if (row != null && col != null) {\n return {\n row: row,\n col: col,\n dateSpan: {\n range: this.getCellRange(row, col),\n allDay: true\n },\n dayEl: this.getCellEl(row, col),\n relativeRect: {\n left: colPositions.lefts[col],\n right: colPositions.rights[col],\n top: rowPositions.tops[row],\n bottom: rowPositions.bottoms[row]\n }\n };\n }\n };\n /* Cell System\n ------------------------------------------------------------------------------------------------------------------*/\n // FYI: the first column is the leftmost column, regardless of date\n DayGrid.prototype.getCellEl = function (row, col) {\n return this.cellEls[row * this.colCnt + col];\n };\n /* Event Drag Visualization\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype._renderEventDrag = function (state) {\n if (state) {\n this.eventRenderer.hideByHash(state.affectedInstances);\n this.fillRenderer.renderSegs('highlight', this.context, state.segs);\n }\n };\n DayGrid.prototype._unrenderEventDrag = function (state) {\n if (state) {\n this.eventRenderer.showByHash(state.affectedInstances);\n this.fillRenderer.unrender('highlight', this.context);\n }\n };\n /* Event Resize Visualization\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype._renderEventResize = function (state) {\n if (state) {\n this.eventRenderer.hideByHash(state.affectedInstances);\n this.fillRenderer.renderSegs('highlight', this.context, state.segs);\n this.mirrorRenderer.renderSegs(this.context, state.segs, { isResizing: true, sourceSeg: state.sourceSeg });\n }\n };\n DayGrid.prototype._unrenderEventResize = function (state) {\n if (state) {\n this.eventRenderer.showByHash(state.affectedInstances);\n this.fillRenderer.unrender('highlight', this.context);\n this.mirrorRenderer.unrender(this.context, state.segs, { isResizing: true, sourceSeg: state.sourceSeg });\n }\n };\n /* More+ Link Popover\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype.removeSegPopover = function () {\n if (this.segPopover) {\n this.segPopover.hide(); // in handler, will call segPopover's removeElement\n }\n };\n // Limits the number of \"levels\" (vertically stacking layers of events) for each row of the grid.\n // `levelLimit` can be false (don't limit), a number, or true (should be computed).\n DayGrid.prototype.limitRows = function (levelLimit) {\n var rowStructs = this.eventRenderer.rowStructs || [];\n var row; // row #\n var rowLevelLimit;\n for (row = 0; row < rowStructs.length; row++) {\n this.unlimitRow(row);\n if (!levelLimit) {\n rowLevelLimit = false;\n }\n else if (typeof levelLimit === 'number') {\n rowLevelLimit = levelLimit;\n }\n else {\n rowLevelLimit = this.computeRowLevelLimit(row);\n }\n if (rowLevelLimit !== false) {\n this.limitRow(row, rowLevelLimit);\n }\n }\n };\n // Computes the number of levels a row will accomodate without going outside its bounds.\n // Assumes the row is \"rigid\" (maintains a constant height regardless of what is inside).\n // `row` is the row number.\n DayGrid.prototype.computeRowLevelLimit = function (row) {\n var rowEl = this.rowEls[row]; // the containing \"fake\" row div\n var rowBottom = rowEl.getBoundingClientRect().bottom; // relative to viewport!\n var trEls = findChildren(this.eventRenderer.rowStructs[row].tbodyEl);\n var i;\n var trEl;\n // Reveal one level at a time and stop when we find one out of bounds\n for (i = 0; i < trEls.length; i++) {\n trEl = trEls[i];\n trEl.classList.remove('fc-limited'); // reset to original state (reveal)\n if (trEl.getBoundingClientRect().bottom > rowBottom) {\n return i;\n }\n }\n return false; // should not limit at all\n };\n // Limits the given grid row to the maximum number of levels and injects \"more\" links if necessary.\n // `row` is the row number.\n // `levelLimit` is a number for the maximum (inclusive) number of levels allowed.\n DayGrid.prototype.limitRow = function (row, levelLimit) {\n var _this = this;\n var colCnt = this.colCnt;\n var isRtl = this.context.isRtl;\n var rowStruct = this.eventRenderer.rowStructs[row];\n var moreNodes = []; // array of \"more\" links and DOM nodes\n var col = 0; // col #, left-to-right (not chronologically)\n var levelSegs; // array of segment objects in the last allowable level, ordered left-to-right\n var cellMatrix; // a matrix (by level, then column) of all elements in the row\n var limitedNodes; // array of temporarily hidden level and segment DOM nodes\n var i;\n var seg;\n var segsBelow; // array of segment objects below `seg` in the current `col`\n var totalSegsBelow; // total number of segments below `seg` in any of the columns `seg` occupies\n var colSegsBelow; // array of segment arrays, below seg, one for each column (offset from segs's first column)\n var td;\n var rowSpan;\n var segMoreNodes; // array of \"more\" cells that will stand-in for the current seg's cell\n var j;\n var moreTd;\n var moreWrap;\n var moreLink;\n // Iterates through empty level cells and places \"more\" links inside if need be\n var emptyCellsUntil = function (endCol) {\n while (col < endCol) {\n segsBelow = _this.getCellSegs(row, col, levelLimit);\n if (segsBelow.length) {\n td = cellMatrix[levelLimit - 1][col];\n moreLink = _this.renderMoreLink(row, col, segsBelow);\n moreWrap = createElement('div', null, moreLink);\n td.appendChild(moreWrap);\n moreNodes.push(moreWrap);\n }\n col++;\n }\n };\n if (levelLimit && levelLimit < rowStruct.segLevels.length) { // is it actually over the limit?\n levelSegs = rowStruct.segLevels[levelLimit - 1];\n cellMatrix = rowStruct.cellMatrix;\n limitedNodes = findChildren(rowStruct.tbodyEl).slice(levelLimit); // get level elements past the limit\n limitedNodes.forEach(function (node) {\n node.classList.add('fc-limited'); // hide elements and get a simple DOM-nodes array\n });\n // iterate though segments in the last allowable level\n for (i = 0; i < levelSegs.length; i++) {\n seg = levelSegs[i];\n var leftCol = isRtl ? (colCnt - 1 - seg.lastCol) : seg.firstCol;\n var rightCol = isRtl ? (colCnt - 1 - seg.firstCol) : seg.lastCol;\n emptyCellsUntil(leftCol); // process empty cells before the segment\n // determine *all* segments below `seg` that occupy the same columns\n colSegsBelow = [];\n totalSegsBelow = 0;\n while (col <= rightCol) {\n segsBelow = this.getCellSegs(row, col, levelLimit);\n colSegsBelow.push(segsBelow);\n totalSegsBelow += segsBelow.length;\n col++;\n }\n if (totalSegsBelow) { // do we need to replace this segment with one or many \"more\" links?\n td = cellMatrix[levelLimit - 1][leftCol]; // the segment's parent cell\n rowSpan = td.rowSpan || 1;\n segMoreNodes = [];\n // make a replacement for each column the segment occupies. will be one for each colspan\n for (j = 0; j < colSegsBelow.length; j++) {\n moreTd = createElement('td', { className: 'fc-more-cell', rowSpan: rowSpan });\n segsBelow = colSegsBelow[j];\n moreLink = this.renderMoreLink(row, leftCol + j, [seg].concat(segsBelow) // count seg as hidden too\n );\n moreWrap = createElement('div', null, moreLink);\n moreTd.appendChild(moreWrap);\n segMoreNodes.push(moreTd);\n moreNodes.push(moreTd);\n }\n td.classList.add('fc-limited');\n insertAfterElement(td, segMoreNodes);\n limitedNodes.push(td);\n }\n }\n emptyCellsUntil(this.colCnt); // finish off the level\n rowStruct.moreEls = moreNodes; // for easy undoing later\n rowStruct.limitedEls = limitedNodes; // for easy undoing later\n }\n };\n // Reveals all levels and removes all \"more\"-related elements for a grid's row.\n // `row` is a row number.\n DayGrid.prototype.unlimitRow = function (row) {\n var rowStruct = this.eventRenderer.rowStructs[row];\n if (rowStruct.moreEls) {\n rowStruct.moreEls.forEach(removeElement);\n rowStruct.moreEls = null;\n }\n if (rowStruct.limitedEls) {\n rowStruct.limitedEls.forEach(function (limitedEl) {\n limitedEl.classList.remove('fc-limited');\n });\n rowStruct.limitedEls = null;\n }\n };\n // Renders an element that represents hidden event element for a cell.\n // Responsible for attaching click handler as well.\n DayGrid.prototype.renderMoreLink = function (row, col, hiddenSegs) {\n var _this = this;\n var _a = this.context, calendar = _a.calendar, view = _a.view, dateEnv = _a.dateEnv, options = _a.options, isRtl = _a.isRtl;\n var a = createElement('a', { className: 'fc-more' });\n a.innerText = this.getMoreLinkText(hiddenSegs.length);\n a.addEventListener('click', function (ev) {\n var clickOption = options.eventLimitClick;\n var _col = isRtl ? _this.colCnt - col - 1 : col; // HACK: props.cells has different dir system?\n var date = _this.props.cells[row][_col].date;\n var moreEl = ev.currentTarget;\n var dayEl = _this.getCellEl(row, col);\n var allSegs = _this.getCellSegs(row, col);\n // rescope the segments to be within the cell's date\n var reslicedAllSegs = _this.resliceDaySegs(allSegs, date);\n var reslicedHiddenSegs = _this.resliceDaySegs(hiddenSegs, date);\n if (typeof clickOption === 'function') {\n // the returned value can be an atomic option\n clickOption = calendar.publiclyTrigger('eventLimitClick', [\n {\n date: dateEnv.toDate(date),\n allDay: true,\n dayEl: dayEl,\n moreEl: moreEl,\n segs: reslicedAllSegs,\n hiddenSegs: reslicedHiddenSegs,\n jsEvent: ev,\n view: view\n }\n ]);\n }\n if (clickOption === 'popover') {\n _this.showSegPopover(row, col, moreEl, reslicedAllSegs);\n }\n else if (typeof clickOption === 'string') { // a view name\n calendar.zoomTo(date, clickOption);\n }\n });\n return a;\n };\n // Reveals the popover that displays all events within a cell\n DayGrid.prototype.showSegPopover = function (row, col, moreLink, segs) {\n var _this = this;\n var _a = this.context, calendar = _a.calendar, view = _a.view, theme = _a.theme, isRtl = _a.isRtl;\n var _col = isRtl ? this.colCnt - col - 1 : col; // HACK: props.cells has different dir system?\n var moreWrap = moreLink.parentNode; // the
wrapper around the \n var topEl; // the element we want to match the top coordinate of\n var options;\n if (this.rowCnt === 1) {\n topEl = view.el; // will cause the popover to cover any sort of header\n }\n else {\n topEl = this.rowEls[row]; // will align with top of row\n }\n options = {\n className: 'fc-more-popover ' + theme.getClass('popover'),\n parentEl: view.el,\n top: computeRect(topEl).top,\n autoHide: true,\n content: function (el) {\n _this.segPopoverTile = new DayTile(el);\n _this.updateSegPopoverTile(_this.props.cells[row][_col].date, segs);\n },\n hide: function () {\n _this.segPopoverTile.destroy();\n _this.segPopoverTile = null;\n _this.segPopover.destroy();\n _this.segPopover = null;\n }\n };\n // Determine horizontal coordinate.\n // We use the moreWrap instead of the to avoid border confusion.\n if (isRtl) {\n options.right = computeRect(moreWrap).right + 1; // +1 to be over cell border\n }\n else {\n options.left = computeRect(moreWrap).left - 1; // -1 to be over cell border\n }\n this.segPopover = new Popover(options);\n this.segPopover.show();\n calendar.releaseAfterSizingTriggers(); // hack for eventPositioned\n };\n // Given the events within an array of segment objects, reslice them to be in a single day\n DayGrid.prototype.resliceDaySegs = function (segs, dayDate) {\n var dayStart = dayDate;\n var dayEnd = addDays(dayStart, 1);\n var dayRange = { start: dayStart, end: dayEnd };\n var newSegs = [];\n for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {\n var seg = segs_1[_i];\n var eventRange = seg.eventRange;\n var origRange = eventRange.range;\n var slicedRange = intersectRanges(origRange, dayRange);\n if (slicedRange) {\n newSegs.push(__assign({}, seg, { eventRange: {\n def: eventRange.def,\n ui: __assign({}, eventRange.ui, { durationEditable: false }),\n instance: eventRange.instance,\n range: slicedRange\n }, isStart: seg.isStart && slicedRange.start.valueOf() === origRange.start.valueOf(), isEnd: seg.isEnd && slicedRange.end.valueOf() === origRange.end.valueOf() }));\n }\n }\n return newSegs;\n };\n // Generates the text that should be inside a \"more\" link, given the number of events it represents\n DayGrid.prototype.getMoreLinkText = function (num) {\n var opt = this.context.options.eventLimitText;\n if (typeof opt === 'function') {\n return opt(num);\n }\n else {\n return '+' + num + ' ' + opt;\n }\n };\n // Returns segments within a given cell.\n // If `startLevel` is specified, returns only events including and below that level. Otherwise returns all segs.\n DayGrid.prototype.getCellSegs = function (row, col, startLevel) {\n var segMatrix = this.eventRenderer.rowStructs[row].segMatrix;\n var level = startLevel || 0;\n var segs = [];\n var seg;\n while (level < segMatrix.length) {\n seg = segMatrix[level][col];\n if (seg) {\n segs.push(seg);\n }\n level++;\n }\n return segs;\n };\n return DayGrid;\n}(DateComponent));\n\nvar WEEK_NUM_FORMAT$1 = createFormatter({ week: 'numeric' });\n/* An abstract class for the daygrid views, as well as month view. Renders one or more rows of day cells.\n----------------------------------------------------------------------------------------------------------------------*/\n// It is a manager for a DayGrid subcomponent, which does most of the heavy lifting.\n// It is responsible for managing width/height.\nvar AbstractDayGridView = /** @class */ (function (_super) {\n __extends(AbstractDayGridView, _super);\n function AbstractDayGridView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.processOptions = memoize(_this._processOptions);\n _this.renderSkeleton = memoizeRendering(_this._renderSkeleton, _this._unrenderSkeleton);\n /* Header Rendering\n ------------------------------------------------------------------------------------------------------------------*/\n // Generates the HTML that will go before the day-of week header cells\n _this.renderHeadIntroHtml = function () {\n var _a = _this.context, theme = _a.theme, options = _a.options;\n if (_this.colWeekNumbersVisible) {\n return '' +\n '' +\n '' + // needed for matchCellWidths\n htmlEscape(options.weekLabel) +\n '' +\n '';\n }\n return '';\n };\n /* Day Grid Rendering\n ------------------------------------------------------------------------------------------------------------------*/\n // Generates the HTML that will go before content-skeleton cells that display the day/week numbers\n _this.renderDayGridNumberIntroHtml = function (row, dayGrid) {\n var _a = _this.context, options = _a.options, dateEnv = _a.dateEnv;\n var weekStart = dayGrid.props.cells[row][0].date;\n if (_this.colWeekNumbersVisible) {\n return '' +\n '' +\n buildGotoAnchorHtml(// aside from link, important for matchCellWidths\n options, dateEnv, { date: weekStart, type: 'week', forceOff: dayGrid.colCnt === 1 }, dateEnv.format(weekStart, WEEK_NUM_FORMAT$1) // inner HTML\n ) +\n '';\n }\n return '';\n };\n // Generates the HTML that goes before the day bg cells for each day-row\n _this.renderDayGridBgIntroHtml = function () {\n var theme = _this.context.theme;\n if (_this.colWeekNumbersVisible) {\n return '';\n }\n return '';\n };\n // Generates the HTML that goes before every other type of row generated by DayGrid.\n // Affects mirror-skeleton and highlight-skeleton rows.\n _this.renderDayGridIntroHtml = function () {\n if (_this.colWeekNumbersVisible) {\n return '';\n }\n return '';\n };\n return _this;\n }\n AbstractDayGridView.prototype._processOptions = function (options) {\n if (options.weekNumbers) {\n if (options.weekNumbersWithinDays) {\n this.cellWeekNumbersVisible = true;\n this.colWeekNumbersVisible = false;\n }\n else {\n this.cellWeekNumbersVisible = false;\n this.colWeekNumbersVisible = true;\n }\n }\n else {\n this.colWeekNumbersVisible = false;\n this.cellWeekNumbersVisible = false;\n }\n };\n AbstractDayGridView.prototype.render = function (props, context) {\n _super.prototype.render.call(this, props, context);\n this.processOptions(context.options);\n this.renderSkeleton(context);\n };\n AbstractDayGridView.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.renderSkeleton.unrender();\n };\n AbstractDayGridView.prototype._renderSkeleton = function (context) {\n this.el.classList.add('fc-dayGrid-view');\n this.el.innerHTML = this.renderSkeletonHtml();\n this.scroller = new ScrollComponent('hidden', // overflow x\n 'auto' // overflow y\n );\n var dayGridContainerEl = this.scroller.el;\n this.el.querySelector('.fc-body > tr > td').appendChild(dayGridContainerEl);\n dayGridContainerEl.classList.add('fc-day-grid-container');\n var dayGridEl = createElement('div', { className: 'fc-day-grid' });\n dayGridContainerEl.appendChild(dayGridEl);\n this.dayGrid = new DayGrid(dayGridEl, {\n renderNumberIntroHtml: this.renderDayGridNumberIntroHtml,\n renderBgIntroHtml: this.renderDayGridBgIntroHtml,\n renderIntroHtml: this.renderDayGridIntroHtml,\n colWeekNumbersVisible: this.colWeekNumbersVisible,\n cellWeekNumbersVisible: this.cellWeekNumbersVisible\n });\n };\n AbstractDayGridView.prototype._unrenderSkeleton = function () {\n this.el.classList.remove('fc-dayGrid-view');\n this.dayGrid.destroy();\n this.scroller.destroy();\n };\n // Builds the HTML skeleton for the view.\n // The day-grid component will render inside of a container defined by this HTML.\n AbstractDayGridView.prototype.renderSkeletonHtml = function () {\n var _a = this.context, theme = _a.theme, options = _a.options;\n return '' +\n '' +\n (options.columnHeader ?\n '' +\n '' +\n '' +\n '' +\n '' :\n '') +\n '' +\n '' +\n '' +\n '' +\n '' +\n '
 
';\n };\n // Generates an HTML attribute string for setting the width of the week number column, if it is known\n AbstractDayGridView.prototype.weekNumberStyleAttr = function () {\n if (this.weekNumberWidth != null) {\n return 'style=\"width:' + this.weekNumberWidth + 'px\"';\n }\n return '';\n };\n // Determines whether each row should have a constant height\n AbstractDayGridView.prototype.hasRigidRows = function () {\n var eventLimit = this.context.options.eventLimit;\n return eventLimit && typeof eventLimit !== 'number';\n };\n /* Dimensions\n ------------------------------------------------------------------------------------------------------------------*/\n AbstractDayGridView.prototype.updateSize = function (isResize, viewHeight, isAuto) {\n _super.prototype.updateSize.call(this, isResize, viewHeight, isAuto); // will call updateBaseSize. important that executes first\n this.dayGrid.updateSize(isResize);\n };\n // Refreshes the horizontal dimensions of the view\n AbstractDayGridView.prototype.updateBaseSize = function (isResize, viewHeight, isAuto) {\n var dayGrid = this.dayGrid;\n var eventLimit = this.context.options.eventLimit;\n var headRowEl = this.header ? this.header.el : null; // HACK\n var scrollerHeight;\n var scrollbarWidths;\n // hack to give the view some height prior to dayGrid's columns being rendered\n // TODO: separate setting height from scroller VS dayGrid.\n if (!dayGrid.rowEls) {\n if (!isAuto) {\n scrollerHeight = this.computeScrollerHeight(viewHeight);\n this.scroller.setHeight(scrollerHeight);\n }\n return;\n }\n if (this.colWeekNumbersVisible) {\n // Make sure all week number cells running down the side have the same width.\n this.weekNumberWidth = matchCellWidths(findElements(this.el, '.fc-week-number'));\n }\n // reset all heights to be natural\n this.scroller.clear();\n if (headRowEl) {\n uncompensateScroll(headRowEl);\n }\n dayGrid.removeSegPopover(); // kill the \"more\" popover if displayed\n // is the event limit a constant level number?\n if (eventLimit && typeof eventLimit === 'number') {\n dayGrid.limitRows(eventLimit); // limit the levels first so the height can redistribute after\n }\n // distribute the height to the rows\n // (viewHeight is a \"recommended\" value if isAuto)\n scrollerHeight = this.computeScrollerHeight(viewHeight);\n this.setGridHeight(scrollerHeight, isAuto);\n // is the event limit dynamically calculated?\n if (eventLimit && typeof eventLimit !== 'number') {\n dayGrid.limitRows(eventLimit); // limit the levels after the grid's row heights have been set\n }\n if (!isAuto) { // should we force dimensions of the scroll container?\n this.scroller.setHeight(scrollerHeight);\n scrollbarWidths = this.scroller.getScrollbarWidths();\n if (scrollbarWidths.left || scrollbarWidths.right) { // using scrollbars?\n if (headRowEl) {\n compensateScroll(headRowEl, scrollbarWidths);\n }\n // doing the scrollbar compensation might have created text overflow which created more height. redo\n scrollerHeight = this.computeScrollerHeight(viewHeight);\n this.scroller.setHeight(scrollerHeight);\n }\n // guarantees the same scrollbar widths\n this.scroller.lockOverflow(scrollbarWidths);\n }\n };\n // given a desired total height of the view, returns what the height of the scroller should be\n AbstractDayGridView.prototype.computeScrollerHeight = function (viewHeight) {\n return viewHeight -\n subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller\n };\n // Sets the height of just the DayGrid component in this view\n AbstractDayGridView.prototype.setGridHeight = function (height, isAuto) {\n if (this.context.options.monthMode) {\n // if auto, make the height of each row the height that it would be if there were 6 weeks\n if (isAuto) {\n height *= this.dayGrid.rowCnt / 6;\n }\n distributeHeight(this.dayGrid.rowEls, height, !isAuto); // if auto, don't compensate for height-hogging rows\n }\n else {\n if (isAuto) {\n undistributeHeight(this.dayGrid.rowEls); // let the rows be their natural height with no expanding\n }\n else {\n distributeHeight(this.dayGrid.rowEls, height, true); // true = compensate for height-hogging rows\n }\n }\n };\n /* Scroll\n ------------------------------------------------------------------------------------------------------------------*/\n AbstractDayGridView.prototype.computeDateScroll = function (duration) {\n return { top: 0 };\n };\n AbstractDayGridView.prototype.queryDateScroll = function () {\n return { top: this.scroller.getScrollTop() };\n };\n AbstractDayGridView.prototype.applyDateScroll = function (scroll) {\n if (scroll.top !== undefined) {\n this.scroller.setScrollTop(scroll.top);\n }\n };\n return AbstractDayGridView;\n}(View));\nAbstractDayGridView.prototype.dateProfileGeneratorClass = DayGridDateProfileGenerator;\n\nvar SimpleDayGrid = /** @class */ (function (_super) {\n __extends(SimpleDayGrid, _super);\n function SimpleDayGrid(dayGrid) {\n var _this = _super.call(this, dayGrid.el) || this;\n _this.slicer = new DayGridSlicer();\n _this.dayGrid = dayGrid;\n return _this;\n }\n SimpleDayGrid.prototype.firstContext = function (context) {\n context.calendar.registerInteractiveComponent(this, { el: this.dayGrid.el });\n };\n SimpleDayGrid.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.context.calendar.unregisterInteractiveComponent(this);\n };\n SimpleDayGrid.prototype.render = function (props, context) {\n var dayGrid = this.dayGrid;\n var dateProfile = props.dateProfile, dayTable = props.dayTable;\n dayGrid.receiveContext(context); // hack because context is used in sliceProps\n dayGrid.receiveProps(__assign({}, this.slicer.sliceProps(props, dateProfile, props.nextDayThreshold, context.calendar, dayGrid, dayTable), { dateProfile: dateProfile, cells: dayTable.cells, isRigid: props.isRigid }), context);\n };\n SimpleDayGrid.prototype.buildPositionCaches = function () {\n this.dayGrid.buildPositionCaches();\n };\n SimpleDayGrid.prototype.queryHit = function (positionLeft, positionTop) {\n var rawHit = this.dayGrid.positionToHit(positionLeft, positionTop);\n if (rawHit) {\n return {\n component: this.dayGrid,\n dateSpan: rawHit.dateSpan,\n dayEl: rawHit.dayEl,\n rect: {\n left: rawHit.relativeRect.left,\n right: rawHit.relativeRect.right,\n top: rawHit.relativeRect.top,\n bottom: rawHit.relativeRect.bottom\n },\n layer: 0\n };\n }\n };\n return SimpleDayGrid;\n}(DateComponent));\nvar DayGridSlicer = /** @class */ (function (_super) {\n __extends(DayGridSlicer, _super);\n function DayGridSlicer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DayGridSlicer.prototype.sliceRange = function (dateRange, dayTable) {\n return dayTable.sliceRange(dateRange);\n };\n return DayGridSlicer;\n}(Slicer));\n\nvar DayGridView = /** @class */ (function (_super) {\n __extends(DayGridView, _super);\n function DayGridView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.buildDayTable = memoize(buildDayTable);\n return _this;\n }\n DayGridView.prototype.render = function (props, context) {\n _super.prototype.render.call(this, props, context); // will call _renderSkeleton/_unrenderSkeleton\n var dateProfile = this.props.dateProfile;\n var dayTable = this.dayTable =\n this.buildDayTable(dateProfile, props.dateProfileGenerator);\n if (this.header) {\n this.header.receiveProps({\n dateProfile: dateProfile,\n dates: dayTable.headerDates,\n datesRepDistinctDays: dayTable.rowCnt === 1,\n renderIntroHtml: this.renderHeadIntroHtml\n }, context);\n }\n this.simpleDayGrid.receiveProps({\n dateProfile: dateProfile,\n dayTable: dayTable,\n businessHours: props.businessHours,\n dateSelection: props.dateSelection,\n eventStore: props.eventStore,\n eventUiBases: props.eventUiBases,\n eventSelection: props.eventSelection,\n eventDrag: props.eventDrag,\n eventResize: props.eventResize,\n isRigid: this.hasRigidRows(),\n nextDayThreshold: this.context.nextDayThreshold\n }, context);\n };\n DayGridView.prototype._renderSkeleton = function (context) {\n _super.prototype._renderSkeleton.call(this, context);\n if (context.options.columnHeader) {\n this.header = new DayHeader(this.el.querySelector('.fc-head-container'));\n }\n this.simpleDayGrid = new SimpleDayGrid(this.dayGrid);\n };\n DayGridView.prototype._unrenderSkeleton = function () {\n _super.prototype._unrenderSkeleton.call(this);\n if (this.header) {\n this.header.destroy();\n }\n this.simpleDayGrid.destroy();\n };\n return DayGridView;\n}(AbstractDayGridView));\nfunction buildDayTable(dateProfile, dateProfileGenerator) {\n var daySeries = new DaySeries(dateProfile.renderRange, dateProfileGenerator);\n return new DayTable(daySeries, /year|month|week/.test(dateProfile.currentRangeUnit));\n}\n\nvar main = createPlugin({\n defaultView: 'dayGridMonth',\n views: {\n dayGrid: DayGridView,\n dayGridDay: {\n type: 'dayGrid',\n duration: { days: 1 }\n },\n dayGridWeek: {\n type: 'dayGrid',\n duration: { weeks: 1 }\n },\n dayGridMonth: {\n type: 'dayGrid',\n duration: { months: 1 },\n monthMode: true,\n fixedWeekCount: true\n }\n }\n});\n\nexport default main;\nexport { AbstractDayGridView, DayBgRow, DayGrid, DayGridSlicer, DayGridView, SimpleDayGrid, buildDayTable as buildBasicDayTable };\n", "/*!\nFullCalendar Time Grid Plugin v4.4.2\nDocs & License: https://fullcalendar.io/\n(c) 2019 Adam Shaw\n*/\n\nimport { createFormatter, removeElement, computeEventDraggable, computeEventStartResizable, computeEventEndResizable, cssToStr, isMultiDayRange, htmlEscape, compareByFieldSpecs, applyStyle, FgEventRenderer, buildSegCompareObj, FillRenderer, memoize, memoizeRendering, createDuration, wholeDivideDurations, findElements, PositionCache, startOfDay, asRoughMs, formatIsoTimeString, addDurations, htmlToElement, createElement, multiplyDuration, DateComponent, hasBgRendering, Splitter, diffDays, buildGotoAnchorHtml, getAllDayHtml, ScrollComponent, matchCellWidths, uncompensateScroll, compensateScroll, subtractInnerElHeight, View, intersectRanges, Slicer, DayHeader, DaySeries, DayTable, createPlugin } from '@fullcalendar/core';\nimport { DayBgRow, DayGrid, SimpleDayGrid } from '@fullcalendar/daygrid';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\n\n/*\nOnly handles foreground segs.\nDoes not own rendering. Use for low-level util methods by TimeGrid.\n*/\nvar TimeGridEventRenderer = /** @class */ (function (_super) {\n __extends(TimeGridEventRenderer, _super);\n function TimeGridEventRenderer(timeGrid) {\n var _this = _super.call(this) || this;\n _this.timeGrid = timeGrid;\n return _this;\n }\n TimeGridEventRenderer.prototype.renderSegs = function (context, segs, mirrorInfo) {\n _super.prototype.renderSegs.call(this, context, segs, mirrorInfo);\n // TODO: dont do every time. memoize\n this.fullTimeFormat = createFormatter({\n hour: 'numeric',\n minute: '2-digit',\n separator: this.context.options.defaultRangeSeparator\n });\n };\n // Given an array of foreground segments, render a DOM element for each, computes position,\n // and attaches to the column inner-container elements.\n TimeGridEventRenderer.prototype.attachSegs = function (segs, mirrorInfo) {\n var segsByCol = this.timeGrid.groupSegsByCol(segs);\n // order the segs within each column\n // TODO: have groupSegsByCol do this?\n for (var col = 0; col < segsByCol.length; col++) {\n segsByCol[col] = this.sortEventSegs(segsByCol[col]);\n }\n this.segsByCol = segsByCol;\n this.timeGrid.attachSegsByCol(segsByCol, this.timeGrid.fgContainerEls);\n };\n TimeGridEventRenderer.prototype.detachSegs = function (segs) {\n segs.forEach(function (seg) {\n removeElement(seg.el);\n });\n this.segsByCol = null;\n };\n TimeGridEventRenderer.prototype.computeSegSizes = function (allSegs) {\n var _a = this, timeGrid = _a.timeGrid, segsByCol = _a.segsByCol;\n var colCnt = timeGrid.colCnt;\n timeGrid.computeSegVerticals(allSegs); // horizontals relies on this\n if (segsByCol) {\n for (var col = 0; col < colCnt; col++) {\n this.computeSegHorizontals(segsByCol[col]); // compute horizontal coordinates, z-index's, and reorder the array\n }\n }\n };\n TimeGridEventRenderer.prototype.assignSegSizes = function (allSegs) {\n var _a = this, timeGrid = _a.timeGrid, segsByCol = _a.segsByCol;\n var colCnt = timeGrid.colCnt;\n timeGrid.assignSegVerticals(allSegs); // horizontals relies on this\n if (segsByCol) {\n for (var col = 0; col < colCnt; col++) {\n this.assignSegCss(segsByCol[col]);\n }\n }\n };\n // Computes a default event time formatting string if `eventTimeFormat` is not explicitly defined\n TimeGridEventRenderer.prototype.computeEventTimeFormat = function () {\n return {\n hour: 'numeric',\n minute: '2-digit',\n meridiem: false\n };\n };\n // Computes a default `displayEventEnd` value if one is not expliclty defined\n TimeGridEventRenderer.prototype.computeDisplayEventEnd = function () {\n return true;\n };\n // Renders the HTML for a single event segment's default rendering\n TimeGridEventRenderer.prototype.renderSegHtml = function (seg, mirrorInfo) {\n var eventRange = seg.eventRange;\n var eventDef = eventRange.def;\n var eventUi = eventRange.ui;\n var allDay = eventDef.allDay;\n var isDraggable = computeEventDraggable(this.context, eventDef, eventUi);\n var isResizableFromStart = seg.isStart && computeEventStartResizable(this.context, eventDef, eventUi);\n var isResizableFromEnd = seg.isEnd && computeEventEndResizable(this.context, eventDef, eventUi);\n var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd, mirrorInfo);\n var skinCss = cssToStr(this.getSkinCss(eventUi));\n var timeText;\n var fullTimeText; // more verbose time text. for the print stylesheet\n var startTimeText; // just the start time text\n classes.unshift('fc-time-grid-event');\n // if the event appears to span more than one day...\n if (isMultiDayRange(eventRange.range)) {\n // Don't display time text on segments that run entirely through a day.\n // That would appear as midnight-midnight and would look dumb.\n // Otherwise, display the time text for the *segment's* times (like 6pm-midnight or midnight-10am)\n if (seg.isStart || seg.isEnd) {\n var unzonedStart = seg.start;\n var unzonedEnd = seg.end;\n timeText = this._getTimeText(unzonedStart, unzonedEnd, allDay); // TODO: give the timezones\n fullTimeText = this._getTimeText(unzonedStart, unzonedEnd, allDay, this.fullTimeFormat);\n startTimeText = this._getTimeText(unzonedStart, unzonedEnd, allDay, null, false); // displayEnd=false\n }\n }\n else {\n // Display the normal time text for the *event's* times\n timeText = this.getTimeText(eventRange);\n fullTimeText = this.getTimeText(eventRange, this.fullTimeFormat);\n startTimeText = this.getTimeText(eventRange, null, false); // displayEnd=false\n }\n return '
' +\n '
' +\n (timeText ?\n '
' +\n '' + htmlEscape(timeText) + '' +\n '
' :\n '') +\n (eventDef.title ?\n '
' +\n htmlEscape(eventDef.title) +\n '
' :\n '') +\n '
' +\n /* TODO: write CSS for this\n (isResizableFromStart ?\n '
' :\n ''\n ) +\n */\n (isResizableFromEnd ?\n '
' :\n '') +\n '
';\n };\n // Given an array of segments that are all in the same column, sets the backwardCoord and forwardCoord on each.\n // Assumed the segs are already ordered.\n // NOTE: Also reorders the given array by date!\n TimeGridEventRenderer.prototype.computeSegHorizontals = function (segs) {\n var levels;\n var level0;\n var i;\n levels = buildSlotSegLevels(segs);\n computeForwardSlotSegs(levels);\n if ((level0 = levels[0])) {\n for (i = 0; i < level0.length; i++) {\n computeSlotSegPressures(level0[i]);\n }\n for (i = 0; i < level0.length; i++) {\n this.computeSegForwardBack(level0[i], 0, 0);\n }\n }\n };\n // Calculate seg.forwardCoord and seg.backwardCoord for the segment, where both values range\n // from 0 to 1. If the calendar is left-to-right, the seg.backwardCoord maps to \"left\" and\n // seg.forwardCoord maps to \"right\" (via percentage). Vice-versa if the calendar is right-to-left.\n //\n // The segment might be part of a \"series\", which means consecutive segments with the same pressure\n // who's width is unknown until an edge has been hit. `seriesBackwardPressure` is the number of\n // segments behind this one in the current series, and `seriesBackwardCoord` is the starting\n // coordinate of the first segment in the series.\n TimeGridEventRenderer.prototype.computeSegForwardBack = function (seg, seriesBackwardPressure, seriesBackwardCoord) {\n var forwardSegs = seg.forwardSegs;\n var i;\n if (seg.forwardCoord === undefined) { // not already computed\n if (!forwardSegs.length) {\n // if there are no forward segments, this segment should butt up against the edge\n seg.forwardCoord = 1;\n }\n else {\n // sort highest pressure first\n this.sortForwardSegs(forwardSegs);\n // this segment's forwardCoord will be calculated from the backwardCoord of the\n // highest-pressure forward segment.\n this.computeSegForwardBack(forwardSegs[0], seriesBackwardPressure + 1, seriesBackwardCoord);\n seg.forwardCoord = forwardSegs[0].backwardCoord;\n }\n // calculate the backwardCoord from the forwardCoord. consider the series\n seg.backwardCoord = seg.forwardCoord -\n (seg.forwardCoord - seriesBackwardCoord) / // available width for series\n (seriesBackwardPressure + 1); // # of segments in the series\n // use this segment's coordinates to computed the coordinates of the less-pressurized\n // forward segments\n for (i = 0; i < forwardSegs.length; i++) {\n this.computeSegForwardBack(forwardSegs[i], 0, seg.forwardCoord);\n }\n }\n };\n TimeGridEventRenderer.prototype.sortForwardSegs = function (forwardSegs) {\n var objs = forwardSegs.map(buildTimeGridSegCompareObj);\n var specs = [\n // put higher-pressure first\n { field: 'forwardPressure', order: -1 },\n // put segments that are closer to initial edge first (and favor ones with no coords yet)\n { field: 'backwardCoord', order: 1 }\n ].concat(this.context.eventOrderSpecs);\n objs.sort(function (obj0, obj1) {\n return compareByFieldSpecs(obj0, obj1, specs);\n });\n return objs.map(function (c) {\n return c._seg;\n });\n };\n // Given foreground event segments that have already had their position coordinates computed,\n // assigns position-related CSS values to their elements.\n TimeGridEventRenderer.prototype.assignSegCss = function (segs) {\n for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {\n var seg = segs_1[_i];\n applyStyle(seg.el, this.generateSegCss(seg));\n if (seg.level > 0) {\n seg.el.classList.add('fc-time-grid-event-inset');\n }\n // if the event is short that the title will be cut off,\n // attach a className that condenses the title into the time area.\n if (seg.eventRange.def.title && seg.bottom - seg.top < 30) {\n seg.el.classList.add('fc-short'); // TODO: \"condensed\" is a better name\n }\n }\n };\n // Generates an object with CSS properties/values that should be applied to an event segment element.\n // Contains important positioning-related properties that should be applied to any event element, customized or not.\n TimeGridEventRenderer.prototype.generateSegCss = function (seg) {\n var shouldOverlap = this.context.options.slotEventOverlap;\n var backwardCoord = seg.backwardCoord; // the left side if LTR. the right side if RTL. floating-point\n var forwardCoord = seg.forwardCoord; // the right side if LTR. the left side if RTL. floating-point\n var props = this.timeGrid.generateSegVerticalCss(seg); // get top/bottom first\n var isRtl = this.context.isRtl;\n var left; // amount of space from left edge, a fraction of the total width\n var right; // amount of space from right edge, a fraction of the total width\n if (shouldOverlap) {\n // double the width, but don't go beyond the maximum forward coordinate (1.0)\n forwardCoord = Math.min(1, backwardCoord + (forwardCoord - backwardCoord) * 2);\n }\n if (isRtl) {\n left = 1 - forwardCoord;\n right = backwardCoord;\n }\n else {\n left = backwardCoord;\n right = 1 - forwardCoord;\n }\n props.zIndex = seg.level + 1; // convert from 0-base to 1-based\n props.left = left * 100 + '%';\n props.right = right * 100 + '%';\n if (shouldOverlap && seg.forwardPressure) {\n // add padding to the edge so that forward stacked events don't cover the resizer's icon\n props[isRtl ? 'marginLeft' : 'marginRight'] = 10 * 2; // 10 is a guesstimate of the icon's width\n }\n return props;\n };\n return TimeGridEventRenderer;\n}(FgEventRenderer));\n// Builds an array of segments \"levels\". The first level will be the leftmost tier of segments if the calendar is\n// left-to-right, or the rightmost if the calendar is right-to-left. Assumes the segments are already ordered by date.\nfunction buildSlotSegLevels(segs) {\n var levels = [];\n var i;\n var seg;\n var j;\n for (i = 0; i < segs.length; i++) {\n seg = segs[i];\n // go through all the levels and stop on the first level where there are no collisions\n for (j = 0; j < levels.length; j++) {\n if (!computeSlotSegCollisions(seg, levels[j]).length) {\n break;\n }\n }\n seg.level = j;\n (levels[j] || (levels[j] = [])).push(seg);\n }\n return levels;\n}\n// For every segment, figure out the other segments that are in subsequent\n// levels that also occupy the same vertical space. Accumulate in seg.forwardSegs\nfunction computeForwardSlotSegs(levels) {\n var i;\n var level;\n var j;\n var seg;\n var k;\n for (i = 0; i < levels.length; i++) {\n level = levels[i];\n for (j = 0; j < level.length; j++) {\n seg = level[j];\n seg.forwardSegs = [];\n for (k = i + 1; k < levels.length; k++) {\n computeSlotSegCollisions(seg, levels[k], seg.forwardSegs);\n }\n }\n }\n}\n// Figure out which path forward (via seg.forwardSegs) results in the longest path until\n// the furthest edge is reached. The number of segments in this path will be seg.forwardPressure\nfunction computeSlotSegPressures(seg) {\n var forwardSegs = seg.forwardSegs;\n var forwardPressure = 0;\n var i;\n var forwardSeg;\n if (seg.forwardPressure === undefined) { // not already computed\n for (i = 0; i < forwardSegs.length; i++) {\n forwardSeg = forwardSegs[i];\n // figure out the child's maximum forward path\n computeSlotSegPressures(forwardSeg);\n // either use the existing maximum, or use the child's forward pressure\n // plus one (for the forwardSeg itself)\n forwardPressure = Math.max(forwardPressure, 1 + forwardSeg.forwardPressure);\n }\n seg.forwardPressure = forwardPressure;\n }\n}\n// Find all the segments in `otherSegs` that vertically collide with `seg`.\n// Append into an optionally-supplied `results` array and return.\nfunction computeSlotSegCollisions(seg, otherSegs, results) {\n if (results === void 0) { results = []; }\n for (var i = 0; i < otherSegs.length; i++) {\n if (isSlotSegCollision(seg, otherSegs[i])) {\n results.push(otherSegs[i]);\n }\n }\n return results;\n}\n// Do these segments occupy the same vertical space?\nfunction isSlotSegCollision(seg1, seg2) {\n return seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n}\nfunction buildTimeGridSegCompareObj(seg) {\n var obj = buildSegCompareObj(seg);\n obj.forwardPressure = seg.forwardPressure;\n obj.backwardCoord = seg.backwardCoord;\n return obj;\n}\n\nvar TimeGridMirrorRenderer = /** @class */ (function (_super) {\n __extends(TimeGridMirrorRenderer, _super);\n function TimeGridMirrorRenderer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TimeGridMirrorRenderer.prototype.attachSegs = function (segs, mirrorInfo) {\n this.segsByCol = this.timeGrid.groupSegsByCol(segs);\n this.timeGrid.attachSegsByCol(this.segsByCol, this.timeGrid.mirrorContainerEls);\n this.sourceSeg = mirrorInfo.sourceSeg;\n };\n TimeGridMirrorRenderer.prototype.generateSegCss = function (seg) {\n var props = _super.prototype.generateSegCss.call(this, seg);\n var sourceSeg = this.sourceSeg;\n if (sourceSeg && sourceSeg.col === seg.col) {\n var sourceSegProps = _super.prototype.generateSegCss.call(this, sourceSeg);\n props.left = sourceSegProps.left;\n props.right = sourceSegProps.right;\n props.marginLeft = sourceSegProps.marginLeft;\n props.marginRight = sourceSegProps.marginRight;\n }\n return props;\n };\n return TimeGridMirrorRenderer;\n}(TimeGridEventRenderer));\n\nvar TimeGridFillRenderer = /** @class */ (function (_super) {\n __extends(TimeGridFillRenderer, _super);\n function TimeGridFillRenderer(timeGrid) {\n var _this = _super.call(this) || this;\n _this.timeGrid = timeGrid;\n return _this;\n }\n TimeGridFillRenderer.prototype.attachSegs = function (type, segs) {\n var timeGrid = this.timeGrid;\n var containerEls;\n // TODO: more efficient lookup\n if (type === 'bgEvent') {\n containerEls = timeGrid.bgContainerEls;\n }\n else if (type === 'businessHours') {\n containerEls = timeGrid.businessContainerEls;\n }\n else if (type === 'highlight') {\n containerEls = timeGrid.highlightContainerEls;\n }\n timeGrid.attachSegsByCol(timeGrid.groupSegsByCol(segs), containerEls);\n return segs.map(function (seg) {\n return seg.el;\n });\n };\n TimeGridFillRenderer.prototype.computeSegSizes = function (segs) {\n this.timeGrid.computeSegVerticals(segs);\n };\n TimeGridFillRenderer.prototype.assignSegSizes = function (segs) {\n this.timeGrid.assignSegVerticals(segs);\n };\n return TimeGridFillRenderer;\n}(FillRenderer));\n\n/* A component that renders one or more columns of vertical time slots\n----------------------------------------------------------------------------------------------------------------------*/\n// potential nice values for the slot-duration and interval-duration\n// from largest to smallest\nvar AGENDA_STOCK_SUB_DURATIONS = [\n { hours: 1 },\n { minutes: 30 },\n { minutes: 15 },\n { seconds: 30 },\n { seconds: 15 }\n];\nvar TimeGrid = /** @class */ (function (_super) {\n __extends(TimeGrid, _super);\n function TimeGrid(el, renderProps) {\n var _this = _super.call(this, el) || this;\n _this.isSlatSizesDirty = false;\n _this.isColSizesDirty = false;\n _this.processOptions = memoize(_this._processOptions);\n _this.renderSkeleton = memoizeRendering(_this._renderSkeleton);\n _this.renderSlats = memoizeRendering(_this._renderSlats, null, [_this.renderSkeleton]);\n _this.renderColumns = memoizeRendering(_this._renderColumns, _this._unrenderColumns, [_this.renderSkeleton]);\n _this.renderProps = renderProps;\n var renderColumns = _this.renderColumns;\n var eventRenderer = _this.eventRenderer = new TimeGridEventRenderer(_this);\n var fillRenderer = _this.fillRenderer = new TimeGridFillRenderer(_this);\n _this.mirrorRenderer = new TimeGridMirrorRenderer(_this);\n _this.renderBusinessHours = memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'businessHours'), fillRenderer.unrender.bind(fillRenderer, 'businessHours'), [renderColumns]);\n _this.renderDateSelection = memoizeRendering(_this._renderDateSelection, _this._unrenderDateSelection, [renderColumns]);\n _this.renderFgEvents = memoizeRendering(eventRenderer.renderSegs.bind(eventRenderer), eventRenderer.unrender.bind(eventRenderer), [renderColumns]);\n _this.renderBgEvents = memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'bgEvent'), fillRenderer.unrender.bind(fillRenderer, 'bgEvent'), [renderColumns]);\n _this.renderEventSelection = memoizeRendering(eventRenderer.selectByInstanceId.bind(eventRenderer), eventRenderer.unselectByInstanceId.bind(eventRenderer), [_this.renderFgEvents]);\n _this.renderEventDrag = memoizeRendering(_this._renderEventDrag, _this._unrenderEventDrag, [renderColumns]);\n _this.renderEventResize = memoizeRendering(_this._renderEventResize, _this._unrenderEventResize, [renderColumns]);\n return _this;\n }\n /* Options\n ------------------------------------------------------------------------------------------------------------------*/\n // Parses various options into properties of this object\n // MUST have context already set\n TimeGrid.prototype._processOptions = function (options) {\n var slotDuration = options.slotDuration, snapDuration = options.snapDuration;\n var snapsPerSlot;\n var input;\n slotDuration = createDuration(slotDuration);\n snapDuration = snapDuration ? createDuration(snapDuration) : slotDuration;\n snapsPerSlot = wholeDivideDurations(slotDuration, snapDuration);\n if (snapsPerSlot === null) {\n snapDuration = slotDuration;\n snapsPerSlot = 1;\n // TODO: say warning?\n }\n this.slotDuration = slotDuration;\n this.snapDuration = snapDuration;\n this.snapsPerSlot = snapsPerSlot;\n // might be an array value (for TimelineView).\n // if so, getting the most granular entry (the last one probably).\n input = options.slotLabelFormat;\n if (Array.isArray(input)) {\n input = input[input.length - 1];\n }\n this.labelFormat = createFormatter(input || {\n hour: 'numeric',\n minute: '2-digit',\n omitZeroMinute: true,\n meridiem: 'short'\n });\n input = options.slotLabelInterval;\n this.labelInterval = input ?\n createDuration(input) :\n this.computeLabelInterval(slotDuration);\n };\n // Computes an automatic value for slotLabelInterval\n TimeGrid.prototype.computeLabelInterval = function (slotDuration) {\n var i;\n var labelInterval;\n var slotsPerLabel;\n // find the smallest stock label interval that results in more than one slots-per-label\n for (i = AGENDA_STOCK_SUB_DURATIONS.length - 1; i >= 0; i--) {\n labelInterval = createDuration(AGENDA_STOCK_SUB_DURATIONS[i]);\n slotsPerLabel = wholeDivideDurations(labelInterval, slotDuration);\n if (slotsPerLabel !== null && slotsPerLabel > 1) {\n return labelInterval;\n }\n }\n return slotDuration; // fall back\n };\n /* Rendering\n ------------------------------------------------------------------------------------------------------------------*/\n TimeGrid.prototype.render = function (props, context) {\n this.processOptions(context.options);\n var cells = props.cells;\n this.colCnt = cells.length;\n this.renderSkeleton(context.theme);\n this.renderSlats(props.dateProfile);\n this.renderColumns(props.cells, props.dateProfile);\n this.renderBusinessHours(context, props.businessHourSegs);\n this.renderDateSelection(props.dateSelectionSegs);\n this.renderFgEvents(context, props.fgEventSegs);\n this.renderBgEvents(context, props.bgEventSegs);\n this.renderEventSelection(props.eventSelection);\n this.renderEventDrag(props.eventDrag);\n this.renderEventResize(props.eventResize);\n };\n TimeGrid.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n // should unrender everything else too\n this.renderSlats.unrender();\n this.renderColumns.unrender();\n this.renderSkeleton.unrender();\n };\n TimeGrid.prototype.updateSize = function (isResize) {\n var _a = this, fillRenderer = _a.fillRenderer, eventRenderer = _a.eventRenderer, mirrorRenderer = _a.mirrorRenderer;\n if (isResize || this.isSlatSizesDirty) {\n this.buildSlatPositions();\n this.isSlatSizesDirty = false;\n }\n if (isResize || this.isColSizesDirty) {\n this.buildColPositions();\n this.isColSizesDirty = false;\n }\n fillRenderer.computeSizes(isResize);\n eventRenderer.computeSizes(isResize);\n mirrorRenderer.computeSizes(isResize);\n fillRenderer.assignSizes(isResize);\n eventRenderer.assignSizes(isResize);\n mirrorRenderer.assignSizes(isResize);\n };\n TimeGrid.prototype._renderSkeleton = function (theme) {\n var el = this.el;\n el.innerHTML =\n '
' +\n '
' +\n '
';\n this.rootBgContainerEl = el.querySelector('.fc-bg');\n this.slatContainerEl = el.querySelector('.fc-slats');\n this.bottomRuleEl = el.querySelector('.fc-divider');\n };\n TimeGrid.prototype._renderSlats = function (dateProfile) {\n var theme = this.context.theme;\n this.slatContainerEl.innerHTML =\n '' +\n this.renderSlatRowHtml(dateProfile) +\n '
';\n this.slatEls = findElements(this.slatContainerEl, 'tr');\n this.slatPositions = new PositionCache(this.el, this.slatEls, false, true // vertical\n );\n this.isSlatSizesDirty = true;\n };\n // Generates the HTML for the horizontal \"slats\" that run width-wise. Has a time axis on a side. Depends on RTL.\n TimeGrid.prototype.renderSlatRowHtml = function (dateProfile) {\n var _a = this.context, dateEnv = _a.dateEnv, theme = _a.theme, isRtl = _a.isRtl;\n var html = '';\n var dayStart = startOfDay(dateProfile.renderRange.start);\n var slotTime = dateProfile.minTime;\n var slotIterator = createDuration(0);\n var slotDate; // will be on the view's first day, but we only care about its time\n var isLabeled;\n var axisHtml;\n // Calculate the time for each slot\n while (asRoughMs(slotTime) < asRoughMs(dateProfile.maxTime)) {\n slotDate = dateEnv.add(dayStart, slotTime);\n isLabeled = wholeDivideDurations(slotIterator, this.labelInterval) !== null;\n axisHtml =\n '' +\n (isLabeled ?\n '' + // for matchCellWidths\n htmlEscape(dateEnv.format(slotDate, this.labelFormat)) +\n '' :\n '') +\n '';\n html +=\n '' +\n (!isRtl ? axisHtml : '') +\n '' +\n (isRtl ? axisHtml : '') +\n '';\n slotTime = addDurations(slotTime, this.slotDuration);\n slotIterator = addDurations(slotIterator, this.slotDuration);\n }\n return html;\n };\n TimeGrid.prototype._renderColumns = function (cells, dateProfile) {\n var _a = this.context, calendar = _a.calendar, view = _a.view, isRtl = _a.isRtl, theme = _a.theme, dateEnv = _a.dateEnv;\n var bgRow = new DayBgRow(this.context);\n this.rootBgContainerEl.innerHTML =\n '' +\n bgRow.renderHtml({\n cells: cells,\n dateProfile: dateProfile,\n renderIntroHtml: this.renderProps.renderBgIntroHtml\n }) +\n '
';\n this.colEls = findElements(this.el, '.fc-day, .fc-disabled-day');\n for (var col = 0; col < this.colCnt; col++) {\n calendar.publiclyTrigger('dayRender', [\n {\n date: dateEnv.toDate(cells[col].date),\n el: this.colEls[col],\n view: view\n }\n ]);\n }\n if (isRtl) {\n this.colEls.reverse();\n }\n this.colPositions = new PositionCache(this.el, this.colEls, true, // horizontal\n false);\n this.renderContentSkeleton();\n this.isColSizesDirty = true;\n };\n TimeGrid.prototype._unrenderColumns = function () {\n this.unrenderContentSkeleton();\n };\n /* Content Skeleton\n ------------------------------------------------------------------------------------------------------------------*/\n // Renders the DOM that the view's content will live in\n TimeGrid.prototype.renderContentSkeleton = function () {\n var isRtl = this.context.isRtl;\n var parts = [];\n var skeletonEl;\n parts.push(this.renderProps.renderIntroHtml());\n for (var i = 0; i < this.colCnt; i++) {\n parts.push('' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '
' +\n '');\n }\n if (isRtl) {\n parts.reverse();\n }\n skeletonEl = this.contentSkeletonEl = htmlToElement('
' +\n '' +\n '' + parts.join('') + '' +\n '
' +\n '
');\n this.colContainerEls = findElements(skeletonEl, '.fc-content-col');\n this.mirrorContainerEls = findElements(skeletonEl, '.fc-mirror-container');\n this.fgContainerEls = findElements(skeletonEl, '.fc-event-container:not(.fc-mirror-container)');\n this.bgContainerEls = findElements(skeletonEl, '.fc-bgevent-container');\n this.highlightContainerEls = findElements(skeletonEl, '.fc-highlight-container');\n this.businessContainerEls = findElements(skeletonEl, '.fc-business-container');\n if (isRtl) {\n this.colContainerEls.reverse();\n this.mirrorContainerEls.reverse();\n this.fgContainerEls.reverse();\n this.bgContainerEls.reverse();\n this.highlightContainerEls.reverse();\n this.businessContainerEls.reverse();\n }\n this.el.appendChild(skeletonEl);\n };\n TimeGrid.prototype.unrenderContentSkeleton = function () {\n removeElement(this.contentSkeletonEl);\n };\n // Given a flat array of segments, return an array of sub-arrays, grouped by each segment's col\n TimeGrid.prototype.groupSegsByCol = function (segs) {\n var segsByCol = [];\n var i;\n for (i = 0; i < this.colCnt; i++) {\n segsByCol.push([]);\n }\n for (i = 0; i < segs.length; i++) {\n segsByCol[segs[i].col].push(segs[i]);\n }\n return segsByCol;\n };\n // Given segments grouped by column, insert the segments' elements into a parallel array of container\n // elements, each living within a column.\n TimeGrid.prototype.attachSegsByCol = function (segsByCol, containerEls) {\n var col;\n var segs;\n var i;\n for (col = 0; col < this.colCnt; col++) { // iterate each column grouping\n segs = segsByCol[col];\n for (i = 0; i < segs.length; i++) {\n containerEls[col].appendChild(segs[i].el);\n }\n }\n };\n /* Now Indicator\n ------------------------------------------------------------------------------------------------------------------*/\n TimeGrid.prototype.getNowIndicatorUnit = function () {\n return 'minute'; // will refresh on the minute\n };\n TimeGrid.prototype.renderNowIndicator = function (segs, date) {\n // HACK: if date columns not ready for some reason (scheduler)\n if (!this.colContainerEls) {\n return;\n }\n var top = this.computeDateTop(date);\n var nodes = [];\n var i;\n // render lines within the columns\n for (i = 0; i < segs.length; i++) {\n var lineEl = createElement('div', { className: 'fc-now-indicator fc-now-indicator-line' });\n lineEl.style.top = top + 'px';\n this.colContainerEls[segs[i].col].appendChild(lineEl);\n nodes.push(lineEl);\n }\n // render an arrow over the axis\n if (segs.length > 0) { // is the current time in view?\n var arrowEl = createElement('div', { className: 'fc-now-indicator fc-now-indicator-arrow' });\n arrowEl.style.top = top + 'px';\n this.contentSkeletonEl.appendChild(arrowEl);\n nodes.push(arrowEl);\n }\n this.nowIndicatorEls = nodes;\n };\n TimeGrid.prototype.unrenderNowIndicator = function () {\n if (this.nowIndicatorEls) {\n this.nowIndicatorEls.forEach(removeElement);\n this.nowIndicatorEls = null;\n }\n };\n /* Coordinates\n ------------------------------------------------------------------------------------------------------------------*/\n TimeGrid.prototype.getTotalSlatHeight = function () {\n return this.slatContainerEl.getBoundingClientRect().height;\n };\n // Computes the top coordinate, relative to the bounds of the grid, of the given date.\n // A `startOfDayDate` must be given for avoiding ambiguity over how to treat midnight.\n TimeGrid.prototype.computeDateTop = function (when, startOfDayDate) {\n if (!startOfDayDate) {\n startOfDayDate = startOfDay(when);\n }\n return this.computeTimeTop(createDuration(when.valueOf() - startOfDayDate.valueOf()));\n };\n // Computes the top coordinate, relative to the bounds of the grid, of the given time (a Duration).\n TimeGrid.prototype.computeTimeTop = function (duration) {\n var len = this.slatEls.length;\n var dateProfile = this.props.dateProfile;\n var slatCoverage = (duration.milliseconds - asRoughMs(dateProfile.minTime)) / asRoughMs(this.slotDuration); // floating-point value of # of slots covered\n var slatIndex;\n var slatRemainder;\n // compute a floating-point number for how many slats should be progressed through.\n // from 0 to number of slats (inclusive)\n // constrained because minTime/maxTime might be customized.\n slatCoverage = Math.max(0, slatCoverage);\n slatCoverage = Math.min(len, slatCoverage);\n // an integer index of the furthest whole slat\n // from 0 to number slats (*exclusive*, so len-1)\n slatIndex = Math.floor(slatCoverage);\n slatIndex = Math.min(slatIndex, len - 1);\n // how much further through the slatIndex slat (from 0.0-1.0) must be covered in addition.\n // could be 1.0 if slatCoverage is covering *all* the slots\n slatRemainder = slatCoverage - slatIndex;\n return this.slatPositions.tops[slatIndex] +\n this.slatPositions.getHeight(slatIndex) * slatRemainder;\n };\n // For each segment in an array, computes and assigns its top and bottom properties\n TimeGrid.prototype.computeSegVerticals = function (segs) {\n var options = this.context.options;\n var eventMinHeight = options.timeGridEventMinHeight;\n var i;\n var seg;\n var dayDate;\n for (i = 0; i < segs.length; i++) {\n seg = segs[i];\n dayDate = this.props.cells[seg.col].date;\n seg.top = this.computeDateTop(seg.start, dayDate);\n seg.bottom = Math.max(seg.top + eventMinHeight, this.computeDateTop(seg.end, dayDate));\n }\n };\n // Given segments that already have their top/bottom properties computed, applies those values to\n // the segments' elements.\n TimeGrid.prototype.assignSegVerticals = function (segs) {\n var i;\n var seg;\n for (i = 0; i < segs.length; i++) {\n seg = segs[i];\n applyStyle(seg.el, this.generateSegVerticalCss(seg));\n }\n };\n // Generates an object with CSS properties for the top/bottom coordinates of a segment element\n TimeGrid.prototype.generateSegVerticalCss = function (seg) {\n return {\n top: seg.top,\n bottom: -seg.bottom // flipped because needs to be space beyond bottom edge of event container\n };\n };\n /* Sizing\n ------------------------------------------------------------------------------------------------------------------*/\n TimeGrid.prototype.buildPositionCaches = function () {\n this.buildColPositions();\n this.buildSlatPositions();\n };\n TimeGrid.prototype.buildColPositions = function () {\n this.colPositions.build();\n };\n TimeGrid.prototype.buildSlatPositions = function () {\n this.slatPositions.build();\n };\n /* Hit System\n ------------------------------------------------------------------------------------------------------------------*/\n TimeGrid.prototype.positionToHit = function (positionLeft, positionTop) {\n var dateEnv = this.context.dateEnv;\n var _a = this, snapsPerSlot = _a.snapsPerSlot, slatPositions = _a.slatPositions, colPositions = _a.colPositions;\n var colIndex = colPositions.leftToIndex(positionLeft);\n var slatIndex = slatPositions.topToIndex(positionTop);\n if (colIndex != null && slatIndex != null) {\n var slatTop = slatPositions.tops[slatIndex];\n var slatHeight = slatPositions.getHeight(slatIndex);\n var partial = (positionTop - slatTop) / slatHeight; // floating point number between 0 and 1\n var localSnapIndex = Math.floor(partial * snapsPerSlot); // the snap # relative to start of slat\n var snapIndex = slatIndex * snapsPerSlot + localSnapIndex;\n var dayDate = this.props.cells[colIndex].date;\n var time = addDurations(this.props.dateProfile.minTime, multiplyDuration(this.snapDuration, snapIndex));\n var start = dateEnv.add(dayDate, time);\n var end = dateEnv.add(start, this.snapDuration);\n return {\n col: colIndex,\n dateSpan: {\n range: { start: start, end: end },\n allDay: false\n },\n dayEl: this.colEls[colIndex],\n relativeRect: {\n left: colPositions.lefts[colIndex],\n right: colPositions.rights[colIndex],\n top: slatTop,\n bottom: slatTop + slatHeight\n }\n };\n }\n };\n /* Event Drag Visualization\n ------------------------------------------------------------------------------------------------------------------*/\n TimeGrid.prototype._renderEventDrag = function (state) {\n if (state) {\n this.eventRenderer.hideByHash(state.affectedInstances);\n if (state.isEvent) {\n this.mirrorRenderer.renderSegs(this.context, state.segs, { isDragging: true, sourceSeg: state.sourceSeg });\n }\n else {\n this.fillRenderer.renderSegs('highlight', this.context, state.segs);\n }\n }\n };\n TimeGrid.prototype._unrenderEventDrag = function (state) {\n if (state) {\n this.eventRenderer.showByHash(state.affectedInstances);\n if (state.isEvent) {\n this.mirrorRenderer.unrender(this.context, state.segs, { isDragging: true, sourceSeg: state.sourceSeg });\n }\n else {\n this.fillRenderer.unrender('highlight', this.context);\n }\n }\n };\n /* Event Resize Visualization\n ------------------------------------------------------------------------------------------------------------------*/\n TimeGrid.prototype._renderEventResize = function (state) {\n if (state) {\n this.eventRenderer.hideByHash(state.affectedInstances);\n this.mirrorRenderer.renderSegs(this.context, state.segs, { isResizing: true, sourceSeg: state.sourceSeg });\n }\n };\n TimeGrid.prototype._unrenderEventResize = function (state) {\n if (state) {\n this.eventRenderer.showByHash(state.affectedInstances);\n this.mirrorRenderer.unrender(this.context, state.segs, { isResizing: true, sourceSeg: state.sourceSeg });\n }\n };\n /* Selection\n ------------------------------------------------------------------------------------------------------------------*/\n // Renders a visual indication of a selection. Overrides the default, which was to simply render a highlight.\n TimeGrid.prototype._renderDateSelection = function (segs) {\n if (segs) {\n if (this.context.options.selectMirror) {\n this.mirrorRenderer.renderSegs(this.context, segs, { isSelecting: true });\n }\n else {\n this.fillRenderer.renderSegs('highlight', this.context, segs);\n }\n }\n };\n TimeGrid.prototype._unrenderDateSelection = function (segs) {\n if (segs) {\n if (this.context.options.selectMirror) {\n this.mirrorRenderer.unrender(this.context, segs, { isSelecting: true });\n }\n else {\n this.fillRenderer.unrender('highlight', this.context);\n }\n }\n };\n return TimeGrid;\n}(DateComponent));\n\nvar AllDaySplitter = /** @class */ (function (_super) {\n __extends(AllDaySplitter, _super);\n function AllDaySplitter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AllDaySplitter.prototype.getKeyInfo = function () {\n return {\n allDay: {},\n timed: {}\n };\n };\n AllDaySplitter.prototype.getKeysForDateSpan = function (dateSpan) {\n if (dateSpan.allDay) {\n return ['allDay'];\n }\n else {\n return ['timed'];\n }\n };\n AllDaySplitter.prototype.getKeysForEventDef = function (eventDef) {\n if (!eventDef.allDay) {\n return ['timed'];\n }\n else if (hasBgRendering(eventDef)) {\n return ['timed', 'allDay'];\n }\n else {\n return ['allDay'];\n }\n };\n return AllDaySplitter;\n}(Splitter));\n\nvar TIMEGRID_ALL_DAY_EVENT_LIMIT = 5;\nvar WEEK_HEADER_FORMAT = createFormatter({ week: 'short' });\n/* An abstract class for all timegrid-related views. Displays one more columns with time slots running vertically.\n----------------------------------------------------------------------------------------------------------------------*/\n// Is a manager for the TimeGrid subcomponent and possibly the DayGrid subcomponent (if allDaySlot is on).\n// Responsible for managing width/height.\nvar AbstractTimeGridView = /** @class */ (function (_super) {\n __extends(AbstractTimeGridView, _super);\n function AbstractTimeGridView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.splitter = new AllDaySplitter();\n _this.renderSkeleton = memoizeRendering(_this._renderSkeleton, _this._unrenderSkeleton);\n /* Header Render Methods\n ------------------------------------------------------------------------------------------------------------------*/\n // Generates the HTML that will go before the day-of week header cells\n _this.renderHeadIntroHtml = function () {\n var _a = _this.context, theme = _a.theme, dateEnv = _a.dateEnv, options = _a.options;\n var range = _this.props.dateProfile.renderRange;\n var dayCnt = diffDays(range.start, range.end);\n var weekText;\n if (options.weekNumbers) {\n weekText = dateEnv.format(range.start, WEEK_HEADER_FORMAT);\n return '' +\n '' +\n buildGotoAnchorHtml(// aside from link, important for matchCellWidths\n options, dateEnv, { date: range.start, type: 'week', forceOff: dayCnt > 1 }, htmlEscape(weekText) // inner HTML\n ) +\n '';\n }\n else {\n return '';\n }\n };\n /* Time Grid Render Methods\n ------------------------------------------------------------------------------------------------------------------*/\n // Generates the HTML that goes before the bg of the TimeGrid slot area. Long vertical column.\n _this.renderTimeGridBgIntroHtml = function () {\n var theme = _this.context.theme;\n return '';\n };\n // Generates the HTML that goes before all other types of cells.\n // Affects content-skeleton, mirror-skeleton, highlight-skeleton for both the time-grid and day-grid.\n _this.renderTimeGridIntroHtml = function () {\n return '';\n };\n /* Day Grid Render Methods\n ------------------------------------------------------------------------------------------------------------------*/\n // Generates the HTML that goes before the all-day cells\n _this.renderDayGridBgIntroHtml = function () {\n var _a = _this.context, theme = _a.theme, options = _a.options;\n return '' +\n '' +\n '' + // needed for matchCellWidths\n getAllDayHtml(options) +\n '' +\n '';\n };\n // Generates the HTML that goes before all other types of cells.\n // Affects content-skeleton, mirror-skeleton, highlight-skeleton for both the time-grid and day-grid.\n _this.renderDayGridIntroHtml = function () {\n return '';\n };\n return _this;\n }\n AbstractTimeGridView.prototype.render = function (props, context) {\n _super.prototype.render.call(this, props, context);\n this.renderSkeleton(context);\n };\n AbstractTimeGridView.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.renderSkeleton.unrender();\n };\n AbstractTimeGridView.prototype._renderSkeleton = function (context) {\n this.el.classList.add('fc-timeGrid-view');\n this.el.innerHTML = this.renderSkeletonHtml();\n this.scroller = new ScrollComponent('hidden', // overflow x\n 'auto' // overflow y\n );\n var timeGridWrapEl = this.scroller.el;\n this.el.querySelector('.fc-body > tr > td').appendChild(timeGridWrapEl);\n timeGridWrapEl.classList.add('fc-time-grid-container');\n var timeGridEl = createElement('div', { className: 'fc-time-grid' });\n timeGridWrapEl.appendChild(timeGridEl);\n this.timeGrid = new TimeGrid(timeGridEl, {\n renderBgIntroHtml: this.renderTimeGridBgIntroHtml,\n renderIntroHtml: this.renderTimeGridIntroHtml\n });\n if (context.options.allDaySlot) { // should we display the \"all-day\" area?\n this.dayGrid = new DayGrid(// the all-day subcomponent of this view\n this.el.querySelector('.fc-day-grid'), {\n renderNumberIntroHtml: this.renderDayGridIntroHtml,\n renderBgIntroHtml: this.renderDayGridBgIntroHtml,\n renderIntroHtml: this.renderDayGridIntroHtml,\n colWeekNumbersVisible: false,\n cellWeekNumbersVisible: false\n });\n // have the day-grid extend it's coordinate area over the
dividing the two grids\n var dividerEl = this.el.querySelector('.fc-divider');\n this.dayGrid.bottomCoordPadding = dividerEl.getBoundingClientRect().height;\n }\n };\n AbstractTimeGridView.prototype._unrenderSkeleton = function () {\n this.el.classList.remove('fc-timeGrid-view');\n this.timeGrid.destroy();\n if (this.dayGrid) {\n this.dayGrid.destroy();\n }\n this.scroller.destroy();\n };\n /* Rendering\n ------------------------------------------------------------------------------------------------------------------*/\n // Builds the HTML skeleton for the view.\n // The day-grid and time-grid components will render inside containers defined by this HTML.\n AbstractTimeGridView.prototype.renderSkeletonHtml = function () {\n var _a = this.context, theme = _a.theme, options = _a.options;\n return '' +\n '' +\n (options.columnHeader ?\n '' +\n '' +\n '' +\n '' +\n '' :\n '') +\n '' +\n '' +\n '' +\n '' +\n '' +\n '
 
' +\n (options.allDaySlot ?\n '
' +\n '
' :\n '') +\n '
';\n };\n /* Now Indicator\n ------------------------------------------------------------------------------------------------------------------*/\n AbstractTimeGridView.prototype.getNowIndicatorUnit = function () {\n return this.timeGrid.getNowIndicatorUnit();\n };\n // subclasses should implement\n // renderNowIndicator(date: DateMarker) {\n // }\n AbstractTimeGridView.prototype.unrenderNowIndicator = function () {\n this.timeGrid.unrenderNowIndicator();\n };\n /* Dimensions\n ------------------------------------------------------------------------------------------------------------------*/\n AbstractTimeGridView.prototype.updateSize = function (isResize, viewHeight, isAuto) {\n _super.prototype.updateSize.call(this, isResize, viewHeight, isAuto); // will call updateBaseSize. important that executes first\n this.timeGrid.updateSize(isResize);\n if (this.dayGrid) {\n this.dayGrid.updateSize(isResize);\n }\n };\n // Adjusts the vertical dimensions of the view to the specified values\n AbstractTimeGridView.prototype.updateBaseSize = function (isResize, viewHeight, isAuto) {\n var _this = this;\n var eventLimit;\n var scrollerHeight;\n var scrollbarWidths;\n // make all axis cells line up\n this.axisWidth = matchCellWidths(findElements(this.el, '.fc-axis'));\n // hack to give the view some height prior to timeGrid's columns being rendered\n // TODO: separate setting height from scroller VS timeGrid.\n if (!this.timeGrid.colEls) {\n if (!isAuto) {\n scrollerHeight = this.computeScrollerHeight(viewHeight);\n this.scroller.setHeight(scrollerHeight);\n }\n return;\n }\n // set of fake row elements that must compensate when scroller has scrollbars\n var noScrollRowEls = findElements(this.el, '.fc-row').filter(function (node) {\n return !_this.scroller.el.contains(node);\n });\n // reset all dimensions back to the original state\n this.timeGrid.bottomRuleEl.style.display = 'none'; // will be shown later if this
is necessary\n this.scroller.clear(); // sets height to 'auto' and clears overflow\n noScrollRowEls.forEach(uncompensateScroll);\n // limit number of events in the all-day area\n if (this.dayGrid) {\n this.dayGrid.removeSegPopover(); // kill the \"more\" popover if displayed\n eventLimit = this.context.options.eventLimit;\n if (eventLimit && typeof eventLimit !== 'number') {\n eventLimit = TIMEGRID_ALL_DAY_EVENT_LIMIT; // make sure \"auto\" goes to a real number\n }\n if (eventLimit) {\n this.dayGrid.limitRows(eventLimit);\n }\n }\n if (!isAuto) { // should we force dimensions of the scroll container?\n scrollerHeight = this.computeScrollerHeight(viewHeight);\n this.scroller.setHeight(scrollerHeight);\n scrollbarWidths = this.scroller.getScrollbarWidths();\n if (scrollbarWidths.left || scrollbarWidths.right) { // using scrollbars?\n // make the all-day and header rows lines up\n noScrollRowEls.forEach(function (rowEl) {\n compensateScroll(rowEl, scrollbarWidths);\n });\n // the scrollbar compensation might have changed text flow, which might affect height, so recalculate\n // and reapply the desired height to the scroller.\n scrollerHeight = this.computeScrollerHeight(viewHeight);\n this.scroller.setHeight(scrollerHeight);\n }\n // guarantees the same scrollbar widths\n this.scroller.lockOverflow(scrollbarWidths);\n // if there's any space below the slats, show the horizontal rule.\n // this won't cause any new overflow, because lockOverflow already called.\n if (this.timeGrid.getTotalSlatHeight() < scrollerHeight) {\n this.timeGrid.bottomRuleEl.style.display = '';\n }\n }\n };\n // given a desired total height of the view, returns what the height of the scroller should be\n AbstractTimeGridView.prototype.computeScrollerHeight = function (viewHeight) {\n return viewHeight -\n subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller\n };\n /* Scroll\n ------------------------------------------------------------------------------------------------------------------*/\n // Computes the initial pre-configured scroll state prior to allowing the user to change it\n AbstractTimeGridView.prototype.computeDateScroll = function (duration) {\n var top = this.timeGrid.computeTimeTop(duration);\n // zoom can give weird floating-point values. rather scroll a little bit further\n top = Math.ceil(top);\n if (top) {\n top++; // to overcome top border that slots beyond the first have. looks better\n }\n return { top: top };\n };\n AbstractTimeGridView.prototype.queryDateScroll = function () {\n return { top: this.scroller.getScrollTop() };\n };\n AbstractTimeGridView.prototype.applyDateScroll = function (scroll) {\n if (scroll.top !== undefined) {\n this.scroller.setScrollTop(scroll.top);\n }\n };\n // Generates an HTML attribute string for setting the width of the axis, if it is known\n AbstractTimeGridView.prototype.axisStyleAttr = function () {\n if (this.axisWidth != null) {\n return 'style=\"width:' + this.axisWidth + 'px\"';\n }\n return '';\n };\n return AbstractTimeGridView;\n}(View));\nAbstractTimeGridView.prototype.usesMinMaxTime = true; // indicates that minTime/maxTime affects rendering\n\nvar SimpleTimeGrid = /** @class */ (function (_super) {\n __extends(SimpleTimeGrid, _super);\n function SimpleTimeGrid(timeGrid) {\n var _this = _super.call(this, timeGrid.el) || this;\n _this.buildDayRanges = memoize(buildDayRanges);\n _this.slicer = new TimeGridSlicer();\n _this.timeGrid = timeGrid;\n return _this;\n }\n SimpleTimeGrid.prototype.firstContext = function (context) {\n context.calendar.registerInteractiveComponent(this, {\n el: this.timeGrid.el\n });\n };\n SimpleTimeGrid.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.context.calendar.unregisterInteractiveComponent(this);\n };\n SimpleTimeGrid.prototype.render = function (props, context) {\n var dateEnv = this.context.dateEnv;\n var dateProfile = props.dateProfile, dayTable = props.dayTable;\n var dayRanges = this.dayRanges = this.buildDayRanges(dayTable, dateProfile, dateEnv);\n var timeGrid = this.timeGrid;\n timeGrid.receiveContext(context); // hack because context is used in sliceProps\n timeGrid.receiveProps(__assign({}, this.slicer.sliceProps(props, dateProfile, null, context.calendar, timeGrid, dayRanges), { dateProfile: dateProfile, cells: dayTable.cells[0] }), context);\n };\n SimpleTimeGrid.prototype.renderNowIndicator = function (date) {\n this.timeGrid.renderNowIndicator(this.slicer.sliceNowDate(date, this.timeGrid, this.dayRanges), date);\n };\n SimpleTimeGrid.prototype.buildPositionCaches = function () {\n this.timeGrid.buildPositionCaches();\n };\n SimpleTimeGrid.prototype.queryHit = function (positionLeft, positionTop) {\n var rawHit = this.timeGrid.positionToHit(positionLeft, positionTop);\n if (rawHit) {\n return {\n component: this.timeGrid,\n dateSpan: rawHit.dateSpan,\n dayEl: rawHit.dayEl,\n rect: {\n left: rawHit.relativeRect.left,\n right: rawHit.relativeRect.right,\n top: rawHit.relativeRect.top,\n bottom: rawHit.relativeRect.bottom\n },\n layer: 0\n };\n }\n };\n return SimpleTimeGrid;\n}(DateComponent));\nfunction buildDayRanges(dayTable, dateProfile, dateEnv) {\n var ranges = [];\n for (var _i = 0, _a = dayTable.headerDates; _i < _a.length; _i++) {\n var date = _a[_i];\n ranges.push({\n start: dateEnv.add(date, dateProfile.minTime),\n end: dateEnv.add(date, dateProfile.maxTime)\n });\n }\n return ranges;\n}\nvar TimeGridSlicer = /** @class */ (function (_super) {\n __extends(TimeGridSlicer, _super);\n function TimeGridSlicer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TimeGridSlicer.prototype.sliceRange = function (range, dayRanges) {\n var segs = [];\n for (var col = 0; col < dayRanges.length; col++) {\n var segRange = intersectRanges(range, dayRanges[col]);\n if (segRange) {\n segs.push({\n start: segRange.start,\n end: segRange.end,\n isStart: segRange.start.valueOf() === range.start.valueOf(),\n isEnd: segRange.end.valueOf() === range.end.valueOf(),\n col: col\n });\n }\n }\n return segs;\n };\n return TimeGridSlicer;\n}(Slicer));\n\nvar TimeGridView = /** @class */ (function (_super) {\n __extends(TimeGridView, _super);\n function TimeGridView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.buildDayTable = memoize(buildDayTable);\n return _this;\n }\n TimeGridView.prototype.render = function (props, context) {\n _super.prototype.render.call(this, props, context); // for flags for updateSize. also _renderSkeleton/_unrenderSkeleton\n var _a = this.props, dateProfile = _a.dateProfile, dateProfileGenerator = _a.dateProfileGenerator;\n var nextDayThreshold = context.nextDayThreshold;\n var dayTable = this.buildDayTable(dateProfile, dateProfileGenerator);\n var splitProps = this.splitter.splitProps(props);\n if (this.header) {\n this.header.receiveProps({\n dateProfile: dateProfile,\n dates: dayTable.headerDates,\n datesRepDistinctDays: true,\n renderIntroHtml: this.renderHeadIntroHtml\n }, context);\n }\n this.simpleTimeGrid.receiveProps(__assign({}, splitProps['timed'], { dateProfile: dateProfile,\n dayTable: dayTable }), context);\n if (this.simpleDayGrid) {\n this.simpleDayGrid.receiveProps(__assign({}, splitProps['allDay'], { dateProfile: dateProfile,\n dayTable: dayTable,\n nextDayThreshold: nextDayThreshold, isRigid: false }), context);\n }\n this.startNowIndicator(dateProfile, dateProfileGenerator);\n };\n TimeGridView.prototype._renderSkeleton = function (context) {\n _super.prototype._renderSkeleton.call(this, context);\n if (context.options.columnHeader) {\n this.header = new DayHeader(this.el.querySelector('.fc-head-container'));\n }\n this.simpleTimeGrid = new SimpleTimeGrid(this.timeGrid);\n if (this.dayGrid) {\n this.simpleDayGrid = new SimpleDayGrid(this.dayGrid);\n }\n };\n TimeGridView.prototype._unrenderSkeleton = function () {\n _super.prototype._unrenderSkeleton.call(this);\n if (this.header) {\n this.header.destroy();\n }\n this.simpleTimeGrid.destroy();\n if (this.simpleDayGrid) {\n this.simpleDayGrid.destroy();\n }\n };\n TimeGridView.prototype.renderNowIndicator = function (date) {\n this.simpleTimeGrid.renderNowIndicator(date);\n };\n return TimeGridView;\n}(AbstractTimeGridView));\nfunction buildDayTable(dateProfile, dateProfileGenerator) {\n var daySeries = new DaySeries(dateProfile.renderRange, dateProfileGenerator);\n return new DayTable(daySeries, false);\n}\n\nvar main = createPlugin({\n defaultView: 'timeGridWeek',\n views: {\n timeGrid: {\n class: TimeGridView,\n allDaySlot: true,\n slotDuration: '00:30:00',\n slotEventOverlap: true // a bad name. confused with overlap/constraint system\n },\n timeGridDay: {\n type: 'timeGrid',\n duration: { days: 1 }\n },\n timeGridWeek: {\n type: 'timeGrid',\n duration: { weeks: 1 }\n }\n }\n});\n\nexport default main;\nexport { AbstractTimeGridView, TimeGrid, TimeGridSlicer, TimeGridView, buildDayRanges, buildDayTable };\n", "/*\nUnobtrusive JavaScript\nhttps://github.com/rails/rails/blob/main/actionview/app/javascript\nReleased under the MIT license\n */\nconst linkClickSelector = \"a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]\";\n\nconst buttonClickSelector = {\n selector: \"button[data-remote]:not([form]), button[data-confirm]:not([form])\",\n exclude: \"form button\"\n};\n\nconst inputChangeSelector = \"select[data-remote], input[data-remote], textarea[data-remote]\";\n\nconst formSubmitSelector = \"form:not([data-turbo=true])\";\n\nconst formInputClickSelector = \"form:not([data-turbo=true]) input[type=submit], form:not([data-turbo=true]) input[type=image], form:not([data-turbo=true]) button[type=submit], form:not([data-turbo=true]) button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])\";\n\nconst formDisableSelector = \"input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled\";\n\nconst formEnableSelector = \"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled\";\n\nconst fileInputSelector = \"input[name][type=file]:not([disabled])\";\n\nconst linkDisableSelector = \"a[data-disable-with], a[data-disable]\";\n\nconst buttonDisableSelector = \"button[data-remote][data-disable-with], button[data-remote][data-disable]\";\n\nlet nonce = null;\n\nconst loadCSPNonce = () => {\n const metaTag = document.querySelector(\"meta[name=csp-nonce]\");\n return nonce = metaTag && metaTag.content;\n};\n\nconst cspNonce = () => nonce || loadCSPNonce();\n\nconst m = Element.prototype.matches || Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector;\n\nconst matches = function(element, selector) {\n if (selector.exclude) {\n return m.call(element, selector.selector) && !m.call(element, selector.exclude);\n } else {\n return m.call(element, selector);\n }\n};\n\nconst EXPANDO = \"_ujsData\";\n\nconst getData = (element, key) => element[EXPANDO] ? element[EXPANDO][key] : undefined;\n\nconst setData = function(element, key, value) {\n if (!element[EXPANDO]) {\n element[EXPANDO] = {};\n }\n return element[EXPANDO][key] = value;\n};\n\nconst $ = selector => Array.prototype.slice.call(document.querySelectorAll(selector));\n\nconst isContentEditable = function(element) {\n var isEditable = false;\n do {\n if (element.isContentEditable) {\n isEditable = true;\n break;\n }\n element = element.parentElement;\n } while (element);\n return isEditable;\n};\n\nconst csrfToken = () => {\n const meta = document.querySelector(\"meta[name=csrf-token]\");\n return meta && meta.content;\n};\n\nconst csrfParam = () => {\n const meta = document.querySelector(\"meta[name=csrf-param]\");\n return meta && meta.content;\n};\n\nconst CSRFProtection = xhr => {\n const token = csrfToken();\n if (token) {\n return xhr.setRequestHeader(\"X-CSRF-Token\", token);\n }\n};\n\nconst refreshCSRFTokens = () => {\n const token = csrfToken();\n const param = csrfParam();\n if (token && param) {\n return $('form input[name=\"' + param + '\"]').forEach((input => input.value = token));\n }\n};\n\nconst AcceptHeaders = {\n \"*\": \"*/*\",\n text: \"text/plain\",\n html: \"text/html\",\n xml: \"application/xml, text/xml\",\n json: \"application/json, text/javascript\",\n script: \"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript\"\n};\n\nconst ajax = options => {\n options = prepareOptions(options);\n var xhr = createXHR(options, (function() {\n const response = processResponse(xhr.response != null ? xhr.response : xhr.responseText, xhr.getResponseHeader(\"Content-Type\"));\n if (Math.floor(xhr.status / 100) === 2) {\n if (typeof options.success === \"function\") {\n options.success(response, xhr.statusText, xhr);\n }\n } else {\n if (typeof options.error === \"function\") {\n options.error(response, xhr.statusText, xhr);\n }\n }\n return typeof options.complete === \"function\" ? options.complete(xhr, xhr.statusText) : undefined;\n }));\n if (options.beforeSend && !options.beforeSend(xhr, options)) {\n return false;\n }\n if (xhr.readyState === XMLHttpRequest.OPENED) {\n return xhr.send(options.data);\n }\n};\n\nvar prepareOptions = function(options) {\n options.url = options.url || location.href;\n options.type = options.type.toUpperCase();\n if (options.type === \"GET\" && options.data) {\n if (options.url.indexOf(\"?\") < 0) {\n options.url += \"?\" + options.data;\n } else {\n options.url += \"&\" + options.data;\n }\n }\n if (!(options.dataType in AcceptHeaders)) {\n options.dataType = \"*\";\n }\n options.accept = AcceptHeaders[options.dataType];\n if (options.dataType !== \"*\") {\n options.accept += \", */*; q=0.01\";\n }\n return options;\n};\n\nvar createXHR = function(options, done) {\n const xhr = new XMLHttpRequest;\n xhr.open(options.type, options.url, true);\n xhr.setRequestHeader(\"Accept\", options.accept);\n if (typeof options.data === \"string\") {\n xhr.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded; charset=UTF-8\");\n }\n if (!options.crossDomain) {\n xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n CSRFProtection(xhr);\n }\n xhr.withCredentials = !!options.withCredentials;\n xhr.onreadystatechange = function() {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n return done(xhr);\n }\n };\n return xhr;\n};\n\nvar processResponse = function(response, type) {\n if (typeof response === \"string\" && typeof type === \"string\") {\n if (type.match(/\\bjson\\b/)) {\n try {\n response = JSON.parse(response);\n } catch (error) {}\n } else if (type.match(/\\b(?:java|ecma)script\\b/)) {\n const script = document.createElement(\"script\");\n script.setAttribute(\"nonce\", cspNonce());\n script.text = response;\n document.head.appendChild(script).parentNode.removeChild(script);\n } else if (type.match(/\\b(xml|html|svg)\\b/)) {\n const parser = new DOMParser;\n type = type.replace(/;.+/, \"\");\n try {\n response = parser.parseFromString(response, type);\n } catch (error1) {}\n }\n }\n return response;\n};\n\nconst href = element => element.href;\n\nconst isCrossDomain = function(url) {\n const originAnchor = document.createElement(\"a\");\n originAnchor.href = location.href;\n const urlAnchor = document.createElement(\"a\");\n try {\n urlAnchor.href = url;\n return !((!urlAnchor.protocol || urlAnchor.protocol === \":\") && !urlAnchor.host || originAnchor.protocol + \"//\" + originAnchor.host === urlAnchor.protocol + \"//\" + urlAnchor.host);\n } catch (e) {\n return true;\n }\n};\n\nlet preventDefault;\n\nlet {CustomEvent: CustomEvent} = window;\n\nif (typeof CustomEvent !== \"function\") {\n CustomEvent = function(event, params) {\n const evt = document.createEvent(\"CustomEvent\");\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n return evt;\n };\n CustomEvent.prototype = window.Event.prototype;\n ({preventDefault: preventDefault} = CustomEvent.prototype);\n CustomEvent.prototype.preventDefault = function() {\n const result = preventDefault.call(this);\n if (this.cancelable && !this.defaultPrevented) {\n Object.defineProperty(this, \"defaultPrevented\", {\n get() {\n return true;\n }\n });\n }\n return result;\n };\n}\n\nconst fire = (obj, name, data) => {\n const event = new CustomEvent(name, {\n bubbles: true,\n cancelable: true,\n detail: data\n });\n obj.dispatchEvent(event);\n return !event.defaultPrevented;\n};\n\nconst stopEverything = e => {\n fire(e.target, \"ujs:everythingStopped\");\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation();\n};\n\nconst delegate = (element, selector, eventType, handler) => element.addEventListener(eventType, (function(e) {\n let {target: target} = e;\n while (!!(target instanceof Element) && !matches(target, selector)) {\n target = target.parentNode;\n }\n if (target instanceof Element && handler.call(target, e) === false) {\n e.preventDefault();\n e.stopPropagation();\n }\n}));\n\nconst toArray = e => Array.prototype.slice.call(e);\n\nconst serializeElement = (element, additionalParam) => {\n let inputs = [ element ];\n if (matches(element, \"form\")) {\n inputs = toArray(element.elements);\n }\n const params = [];\n inputs.forEach((function(input) {\n if (!input.name || input.disabled) {\n return;\n }\n if (matches(input, \"fieldset[disabled] *\")) {\n return;\n }\n if (matches(input, \"select\")) {\n toArray(input.options).forEach((function(option) {\n if (option.selected) {\n params.push({\n name: input.name,\n value: option.value\n });\n }\n }));\n } else if (input.checked || [ \"radio\", \"checkbox\", \"submit\" ].indexOf(input.type) === -1) {\n params.push({\n name: input.name,\n value: input.value\n });\n }\n }));\n if (additionalParam) {\n params.push(additionalParam);\n }\n return params.map((function(param) {\n if (param.name) {\n return `${encodeURIComponent(param.name)}=${encodeURIComponent(param.value)}`;\n } else {\n return param;\n }\n })).join(\"&\");\n};\n\nconst formElements = (form, selector) => {\n if (matches(form, \"form\")) {\n return toArray(form.elements).filter((el => matches(el, selector)));\n } else {\n return toArray(form.querySelectorAll(selector));\n }\n};\n\nconst handleConfirmWithRails = rails => function(e) {\n if (!allowAction(this, rails)) {\n stopEverything(e);\n }\n};\n\nconst confirm = (message, element) => window.confirm(message);\n\nvar allowAction = function(element, rails) {\n let callback;\n const message = element.getAttribute(\"data-confirm\");\n if (!message) {\n return true;\n }\n let answer = false;\n if (fire(element, \"confirm\")) {\n try {\n answer = rails.confirm(message, element);\n } catch (error) {}\n callback = fire(element, \"confirm:complete\", [ answer ]);\n }\n return answer && callback;\n};\n\nconst handleDisabledElement = function(e) {\n const element = this;\n if (element.disabled) {\n stopEverything(e);\n }\n};\n\nconst enableElement = e => {\n let element;\n if (e instanceof Event) {\n if (isXhrRedirect(e)) {\n return;\n }\n element = e.target;\n } else {\n element = e;\n }\n if (isContentEditable(element)) {\n return;\n }\n if (matches(element, linkDisableSelector)) {\n return enableLinkElement(element);\n } else if (matches(element, buttonDisableSelector) || matches(element, formEnableSelector)) {\n return enableFormElement(element);\n } else if (matches(element, formSubmitSelector)) {\n return enableFormElements(element);\n }\n};\n\nconst disableElement = e => {\n const element = e instanceof Event ? e.target : e;\n if (isContentEditable(element)) {\n return;\n }\n if (matches(element, linkDisableSelector)) {\n return disableLinkElement(element);\n } else if (matches(element, buttonDisableSelector) || matches(element, formDisableSelector)) {\n return disableFormElement(element);\n } else if (matches(element, formSubmitSelector)) {\n return disableFormElements(element);\n }\n};\n\nvar disableLinkElement = function(element) {\n if (getData(element, \"ujs:disabled\")) {\n return;\n }\n const replacement = element.getAttribute(\"data-disable-with\");\n if (replacement != null) {\n setData(element, \"ujs:enable-with\", element.innerHTML);\n element.innerHTML = replacement;\n }\n element.addEventListener(\"click\", stopEverything);\n return setData(element, \"ujs:disabled\", true);\n};\n\nvar enableLinkElement = function(element) {\n const originalText = getData(element, \"ujs:enable-with\");\n if (originalText != null) {\n element.innerHTML = originalText;\n setData(element, \"ujs:enable-with\", null);\n }\n element.removeEventListener(\"click\", stopEverything);\n return setData(element, \"ujs:disabled\", null);\n};\n\nvar disableFormElements = form => formElements(form, formDisableSelector).forEach(disableFormElement);\n\nvar disableFormElement = function(element) {\n if (getData(element, \"ujs:disabled\")) {\n return;\n }\n const replacement = element.getAttribute(\"data-disable-with\");\n if (replacement != null) {\n if (matches(element, \"button\")) {\n setData(element, \"ujs:enable-with\", element.innerHTML);\n element.innerHTML = replacement;\n } else {\n setData(element, \"ujs:enable-with\", element.value);\n element.value = replacement;\n }\n }\n element.disabled = true;\n return setData(element, \"ujs:disabled\", true);\n};\n\nvar enableFormElements = form => formElements(form, formEnableSelector).forEach((element => enableFormElement(element)));\n\nvar enableFormElement = function(element) {\n const originalText = getData(element, \"ujs:enable-with\");\n if (originalText != null) {\n if (matches(element, \"button\")) {\n element.innerHTML = originalText;\n } else {\n element.value = originalText;\n }\n setData(element, \"ujs:enable-with\", null);\n }\n element.disabled = false;\n return setData(element, \"ujs:disabled\", null);\n};\n\nvar isXhrRedirect = function(event) {\n const xhr = event.detail ? event.detail[0] : undefined;\n return xhr && xhr.getResponseHeader(\"X-Xhr-Redirect\");\n};\n\nconst handleMethodWithRails = rails => function(e) {\n const link = this;\n const method = link.getAttribute(\"data-method\");\n if (!method) {\n return;\n }\n if (isContentEditable(this)) {\n return;\n }\n const href = rails.href(link);\n const csrfToken$1 = csrfToken();\n const csrfParam$1 = csrfParam();\n const form = document.createElement(\"form\");\n let formContent = ``;\n if (csrfParam$1 && csrfToken$1 && !isCrossDomain(href)) {\n formContent += ``;\n }\n formContent += '';\n form.method = \"post\";\n form.action = href;\n form.target = link.target;\n form.innerHTML = formContent;\n form.style.display = \"none\";\n document.body.appendChild(form);\n form.querySelector('[type=\"submit\"]').click();\n stopEverything(e);\n};\n\nconst isRemote = function(element) {\n const value = element.getAttribute(\"data-remote\");\n return value != null && value !== \"false\";\n};\n\nconst handleRemoteWithRails = rails => function(e) {\n let data, method, url;\n const element = this;\n if (!isRemote(element)) {\n return true;\n }\n if (!fire(element, \"ajax:before\")) {\n fire(element, \"ajax:stopped\");\n return false;\n }\n if (isContentEditable(element)) {\n fire(element, \"ajax:stopped\");\n return false;\n }\n const withCredentials = element.getAttribute(\"data-with-credentials\");\n const dataType = element.getAttribute(\"data-type\") || \"script\";\n if (matches(element, formSubmitSelector)) {\n const button = getData(element, \"ujs:submit-button\");\n method = getData(element, \"ujs:submit-button-formmethod\") || element.getAttribute(\"method\") || \"get\";\n url = getData(element, \"ujs:submit-button-formaction\") || element.getAttribute(\"action\") || location.href;\n if (method.toUpperCase() === \"GET\") {\n url = url.replace(/\\?.*$/, \"\");\n }\n if (element.enctype === \"multipart/form-data\") {\n data = new FormData(element);\n if (button != null) {\n data.append(button.name, button.value);\n }\n } else {\n data = serializeElement(element, button);\n }\n setData(element, \"ujs:submit-button\", null);\n setData(element, \"ujs:submit-button-formmethod\", null);\n setData(element, \"ujs:submit-button-formaction\", null);\n } else if (matches(element, buttonClickSelector) || matches(element, inputChangeSelector)) {\n method = element.getAttribute(\"data-method\");\n url = element.getAttribute(\"data-url\");\n data = serializeElement(element, element.getAttribute(\"data-params\"));\n } else {\n method = element.getAttribute(\"data-method\");\n url = rails.href(element);\n data = element.getAttribute(\"data-params\");\n }\n ajax({\n type: method || \"GET\",\n url: url,\n data: data,\n dataType: dataType,\n beforeSend(xhr, options) {\n if (fire(element, \"ajax:beforeSend\", [ xhr, options ])) {\n return fire(element, \"ajax:send\", [ xhr ]);\n } else {\n fire(element, \"ajax:stopped\");\n return false;\n }\n },\n success(...args) {\n return fire(element, \"ajax:success\", args);\n },\n error(...args) {\n return fire(element, \"ajax:error\", args);\n },\n complete(...args) {\n return fire(element, \"ajax:complete\", args);\n },\n crossDomain: isCrossDomain(url),\n withCredentials: withCredentials != null && withCredentials !== \"false\"\n });\n stopEverything(e);\n};\n\nconst formSubmitButtonClick = function(e) {\n const button = this;\n const {form: form} = button;\n if (!form) {\n return;\n }\n if (button.name) {\n setData(form, \"ujs:submit-button\", {\n name: button.name,\n value: button.value\n });\n }\n setData(form, \"ujs:formnovalidate-button\", button.formNoValidate);\n setData(form, \"ujs:submit-button-formaction\", button.getAttribute(\"formaction\"));\n return setData(form, \"ujs:submit-button-formmethod\", button.getAttribute(\"formmethod\"));\n};\n\nconst preventInsignificantClick = function(e) {\n const link = this;\n const method = (link.getAttribute(\"data-method\") || \"GET\").toUpperCase();\n const data = link.getAttribute(\"data-params\");\n const metaClick = e.metaKey || e.ctrlKey;\n const insignificantMetaClick = metaClick && method === \"GET\" && !data;\n const nonPrimaryMouseClick = e.button != null && e.button !== 0;\n if (nonPrimaryMouseClick || insignificantMetaClick) {\n e.stopImmediatePropagation();\n }\n};\n\nconst Rails = {\n $: $,\n ajax: ajax,\n buttonClickSelector: buttonClickSelector,\n buttonDisableSelector: buttonDisableSelector,\n confirm: confirm,\n cspNonce: cspNonce,\n csrfToken: csrfToken,\n csrfParam: csrfParam,\n CSRFProtection: CSRFProtection,\n delegate: delegate,\n disableElement: disableElement,\n enableElement: enableElement,\n fileInputSelector: fileInputSelector,\n fire: fire,\n formElements: formElements,\n formEnableSelector: formEnableSelector,\n formDisableSelector: formDisableSelector,\n formInputClickSelector: formInputClickSelector,\n formSubmitButtonClick: formSubmitButtonClick,\n formSubmitSelector: formSubmitSelector,\n getData: getData,\n handleDisabledElement: handleDisabledElement,\n href: href,\n inputChangeSelector: inputChangeSelector,\n isCrossDomain: isCrossDomain,\n linkClickSelector: linkClickSelector,\n linkDisableSelector: linkDisableSelector,\n loadCSPNonce: loadCSPNonce,\n matches: matches,\n preventInsignificantClick: preventInsignificantClick,\n refreshCSRFTokens: refreshCSRFTokens,\n serializeElement: serializeElement,\n setData: setData,\n stopEverything: stopEverything\n};\n\nconst handleConfirm = handleConfirmWithRails(Rails);\n\nRails.handleConfirm = handleConfirm;\n\nconst handleMethod = handleMethodWithRails(Rails);\n\nRails.handleMethod = handleMethod;\n\nconst handleRemote = handleRemoteWithRails(Rails);\n\nRails.handleRemote = handleRemote;\n\nconst start = function() {\n if (window._rails_loaded) {\n throw new Error(\"rails-ujs has already been loaded!\");\n }\n window.addEventListener(\"pageshow\", (function() {\n $(formEnableSelector).forEach((function(el) {\n if (getData(el, \"ujs:disabled\")) {\n enableElement(el);\n }\n }));\n $(linkDisableSelector).forEach((function(el) {\n if (getData(el, \"ujs:disabled\")) {\n enableElement(el);\n }\n }));\n }));\n delegate(document, linkDisableSelector, \"ajax:complete\", enableElement);\n delegate(document, linkDisableSelector, \"ajax:stopped\", enableElement);\n delegate(document, buttonDisableSelector, \"ajax:complete\", enableElement);\n delegate(document, buttonDisableSelector, \"ajax:stopped\", enableElement);\n delegate(document, linkClickSelector, \"click\", preventInsignificantClick);\n delegate(document, linkClickSelector, \"click\", handleDisabledElement);\n delegate(document, linkClickSelector, \"click\", handleConfirm);\n delegate(document, linkClickSelector, \"click\", disableElement);\n delegate(document, linkClickSelector, \"click\", handleRemote);\n delegate(document, linkClickSelector, \"click\", handleMethod);\n delegate(document, buttonClickSelector, \"click\", preventInsignificantClick);\n delegate(document, buttonClickSelector, \"click\", handleDisabledElement);\n delegate(document, buttonClickSelector, \"click\", handleConfirm);\n delegate(document, buttonClickSelector, \"click\", disableElement);\n delegate(document, buttonClickSelector, \"click\", handleRemote);\n delegate(document, inputChangeSelector, \"change\", handleDisabledElement);\n delegate(document, inputChangeSelector, \"change\", handleConfirm);\n delegate(document, inputChangeSelector, \"change\", handleRemote);\n delegate(document, formSubmitSelector, \"submit\", handleDisabledElement);\n delegate(document, formSubmitSelector, \"submit\", handleConfirm);\n delegate(document, formSubmitSelector, \"submit\", handleRemote);\n delegate(document, formSubmitSelector, \"submit\", (e => setTimeout((() => disableElement(e)), 13)));\n delegate(document, formSubmitSelector, \"ajax:send\", disableElement);\n delegate(document, formSubmitSelector, \"ajax:complete\", enableElement);\n delegate(document, formInputClickSelector, \"click\", preventInsignificantClick);\n delegate(document, formInputClickSelector, \"click\", handleDisabledElement);\n delegate(document, formInputClickSelector, \"click\", handleConfirm);\n delegate(document, formInputClickSelector, \"click\", formSubmitButtonClick);\n document.addEventListener(\"DOMContentLoaded\", refreshCSRFTokens);\n document.addEventListener(\"DOMContentLoaded\", loadCSPNonce);\n return window._rails_loaded = true;\n};\n\nRails.start = start;\n\nif (typeof jQuery !== \"undefined\" && jQuery && jQuery.ajax) {\n if (jQuery.rails) {\n throw new Error(\"If you load both jquery_ujs and rails-ujs, use rails-ujs only.\");\n }\n jQuery.rails = Rails;\n jQuery.ajaxPrefilter((function(options, originalOptions, xhr) {\n if (!options.crossDomain) {\n return CSRFProtection(xhr);\n }\n }));\n}\n\nexport { Rails as default };\n", "/* eslint no-console:0 */\n// This file is bundled by esbuild via jsbundling-rails.\n// Output goes to app/assets/builds/application.js\n\n// import \"@rails/actiontext\";\n\nimport { Calendar } from \"@fullcalendar/core\";\nimport dayGridPlugin from \"@fullcalendar/daygrid\";\nimport timeGridPlugin from \"@fullcalendar/timegrid\";\n\nimport \"@fullcalendar/core/main.css\";\nimport \"@fullcalendar/daygrid/main.css\";\nimport \"@fullcalendar/timegrid/main.css\";\nimport \"@fullcalendar/list/main.css\";\nimport \"@fullcalendar/timeline/main.css\";\n\nimport 'font-awesome/css/font-awesome.min.css';\n\nimport \"typeface-roboto/index.css\";\nimport \"typeface-roboto-condensed/index.css\";\n\n// jQuery is loaded via CDN in _head.html.erb (before this module)\n// to ensure legacy Sprockets plugins have access to it\nconst $ = window.jQuery;\n\n// jQuery.curCSS polyfill (needed by some legacy plugins)\njQuery.curCSS = function(element, prop, val) {\n return jQuery(element).css(prop, val);\n};\n\n// Rails UJS for data-remote, data-confirm, data-method, etc.\nimport Rails from \"@rails/ujs\";\nRails.start();\n\n// Slick carousel\nimport 'slick-carousel';\nimport 'slick-carousel/slick/slick.css';\nimport 'slick-carousel/slick/slick-theme.css';\n\n// CKEditor 5\nimport {\n ClassicEditor,\n Essentials,\n Bold,\n Italic,\n Underline,\n Strikethrough,\n Heading,\n Paragraph,\n List,\n Link,\n BlockQuote,\n Indent,\n IndentBlock,\n PasteFromOffice\n} from 'ckeditor5';\nimport 'ckeditor5/ckeditor5.css';\n\n// Initialize CKEditor 5 on elements with data-ckeditor attribute\nfunction initCKEditor() {\n // Get license key from meta tag, default to 'GPL'\n const licenseKeyMeta = document.querySelector('meta[name=\"ckeditor-license-key\"]');\n const licenseKey = licenseKeyMeta ? licenseKeyMeta.content : 'GPL';\n\n document.querySelectorAll('[data-ckeditor]').forEach((element) => {\n // Skip if already initialized\n if (element.dataset.ckeditorInitialized) return;\n\n ClassicEditor\n .create(element, {\n licenseKey: licenseKey,\n plugins: [\n Essentials,\n Bold,\n Italic,\n Underline,\n Strikethrough,\n Heading,\n Paragraph,\n List,\n Link,\n BlockQuote,\n Indent,\n IndentBlock,\n PasteFromOffice\n ],\n toolbar: [\n 'heading',\n '|',\n 'bold',\n 'italic',\n 'underline',\n 'strikethrough',\n '|',\n 'link',\n 'bulletedList',\n 'numberedList',\n '|',\n 'outdent',\n 'indent',\n '|',\n 'blockQuote',\n '|',\n 'undo',\n 'redo'\n ],\n language: 'de'\n })\n .then(editor => {\n element.dataset.ckeditorInitialized = 'true';\n console.log('CKEditor initialized', editor);\n })\n .catch(error => {\n console.error('CKEditor initialization error:', error);\n });\n });\n}\n\nfunction display_eventsource_for(calendar) {\n var k, last;\n last = new Date();\n var all = calendar.getEventSources();\n for (var i = 0; i < all.length; i++) {\n all[i].remove();\n }\n console.log(\"displaying calendar data\", eventsource_for);\n for (k in eventsource_for) {\n if (eventsource_for.hasOwnProperty(k)) {\n if ($(\"#\" + k).is(\":checked\")) {\n console.log(\"found that this is checked: \", k);\n calendar.addEventSource(eventsource_for[k]);\n }\n }\n }\n for (let i in fixed_moduls_and_courses) {\n if (fixed_moduls_and_courses.hasOwnProperty(i)) {\n k = fixed_moduls_and_courses[i];\n if (!calendar.getEventSourceById(k)) {\n calendar.addEventSource(eventsource_for[k]);\n }\n }\n }\n\n for (let i in recommended_courses) {\n if (recommended_courses.hasOwnProperty(i)) {\n let k = recommended_courses[i];\n if (eventsource_for[k] && !calendar.getEventSourceById(k)) {\n calendar.addEventSource(eventsource_for[k]);\n }\n }\n }\n}\n\nfunction apply_filters(calendar, data) {\n fixed_moduls_and_courses = data;\n display_eventsource_for(calendar);\n}\n\nfunction height_for_mode(mode) {\n if (mode == \"small\") {\n return 200;\n } else {\n return 600;\n }\n}\n\nfunction buttons_for_mode(mode) {\n if (mode == \"small\") {\n return \"dayGridWeek,dayGridDitact\";\n } else {\n return \"timeGridWeek,timeGridDitact\";\n }\n}\n\nfunction default_for_mode(mode) {\n if (mode == \"small\") {\n return \"dayGridDitact\";\n } else {\n return \"timeGridDitact\";\n }\n}\n\nfunction recalc() {\n var target = document.querySelector(\".gesamt.kosten\");\n if (!target) return;\n var fees = document.querySelectorAll(\n \".edit_enroll input[type=checkbox]:checked\"\n );\n var sum = 0;\n for (var i = 0; i < fees.length; i++) {\n var node = fees[i];\n sum += parseFloat(node.dataset.fee);\n }\n target.innerHTML = sum;\n console.log(\"doing recalc: \", sum);\n}\n\n//\n// ======================= on load ==================0\n//\n\n// Navigation menu resize handler\nfunction resize_me(event) {\n if (window.innerWidth > 1000) {\n $('#main_nav .menu').show();\n $('#main_nav button').hide();\n } else {\n $('#main_nav .menu').hide();\n $('#main_nav button').show();\n }\n}\n\nwindow.addEventListener(\"load\", function () {\n recalc();\n\n // Initialize CKEditor 5 on any textareas with data-ckeditor attribute\n initCKEditor();\n\n // Initialize dropdown navigation\n if ($('#main_nav').length) {\n $('#main_nav .menu').hide();\n $('#dropdown_burger').on('click', function() {\n $('#main_nav .menu').toggle();\n });\n $('').appendTo('li.menu-item-has-children>a');\n $('li.menu-item-has-children button').on('click', function(e) {\n $(this).parent().next('ul').toggle();\n e.preventDefault();\n });\n resize_me();\n window.addEventListener('resize', resize_me);\n }\n\n // Initialize slick carousel on homepage\n if ($('.slickit').length) {\n $('.slickit').slick({\n dots: true,\n infinite: false,\n speed: 300,\n slidesToShow: 3,\n slidesToScroll: 1,\n arrows: true,\n responsive: [\n {\n breakpoint: 1200,\n settings: {\n slidesToShow: 2,\n slidesToScroll: 1\n }\n },\n {\n breakpoint: 850,\n settings: \"unslick\"\n }\n ]\n });\n }\n\n var calendar_node = document.getElementById(\"calendar\");\n console.log(\"display calendar in\", calendar_node);\n\n if (calendar_node) {\n calendar = new Calendar(calendar_node, {\n plugins: [timeGridPlugin, dayGridPlugin],\n timeZone: \"Europe/Vienna\",\n views: {\n timeGridDitact: {\n type: \"timeGrid\",\n duration: { days: 13 },\n buttonText: \"ganze ditact\",\n },\n dayGridDitact: {\n type: \"dayGridWeek\",\n duration: { days: 13 },\n buttonText: \"ganze ditact\",\n },\n },\n defaultView: default_for_mode(mode),\n buttonText: {\n today: \"Heute\",\n month: \"Monat\",\n week: \"Eine Woche\",\n day: \"Tag\",\n list: \"Liste\",\n },\n height: height_for_mode(mode),\n allDaySlot: false,\n hiddenDays: [0],\n columnHeaderFormat: {\n weekday: \"short\",\n month: \"numeric\",\n day: \"numeric\",\n },\n slotLabelFormat: {\n hour: \"numeric\",\n minute: \"2-digit\",\n omitZeroMinute: true,\n meridiem: \"short\",\n hourCycle: \"h24\",\n },\n eventTimeFormat: {\n hour: \"numeric\",\n minute: \"2-digit\",\n omitZeroMinute: true,\n meridiem: \"short\",\n hourCycle: \"h24\",\n },\n firstDay: 1, // Monday\n date: calendar_startday,\n minTime: \"08:00:00\",\n maxTime: \"20:00:00\",\n header: {\n left: \"prev,next\",\n center: \"\",\n right: buttons_for_mode(mode),\n },\n });\n\n calendar.render();\n calendar.gotoDate(calendar_endday);\n display_eventsource_for(calendar);\n\n var myNodeList = document.querySelectorAll(\n \".edit_enroll input[type=checkbox]\"\n );\n\n for (var i = 0; i < myNodeList.length; i++) {\n var checkbox = myNodeList[i];\n var k = checkbox.id;\n checkbox.addEventListener(\"change\", function (event) {\n if (event.target.checked) {\n console.log(\"this is checkbox \", this, \" now showing \", this.id);\n calendar.addEventSource(eventsource_for[this.id]);\n } else {\n console.log(\"this is checkbox \", this, \" now removing \", this.id);\n calendar.getEventSourceById(this.id).remove();\n }\n recalc();\n });\n }\n }\n\n var grid_node = document.getElementById(\"grid\");\n\n if (grid_node) {\n console.log(\"displaying calendar grid\", grid_data);\n\n grid_data.plugins = [timeGridPlugin, dayGridPlugin];\n\n let grid = new Calendar(grid_node, grid_data);\n grid.render();\n grid.gotoDate(grid_data.date);\n }\n});\n", "function isLength(value) {\n return Number.isSafeInteger(value) && value >= 0;\n}\n\nexport { isLength };\n", "import { isLength } from '../../predicate/isLength.mjs';\n\nfunction isArrayLike(value) {\n return value != null && typeof value !== 'function' && isLength(value.length);\n}\n\nexport { isArrayLike };\n", "function identity(x) {\n return x;\n}\n\nexport { identity };\n", "function isUnsafeProperty(key) {\n return key === '__proto__';\n}\n\nexport { isUnsafeProperty };\n", "function isDeepKey(key) {\n switch (typeof key) {\n case 'number':\n case 'symbol': {\n return false;\n }\n case 'string': {\n return key.includes('.') || key.includes('[') || key.includes(']');\n }\n }\n}\n\nexport { isDeepKey };\n", "function toKey(value) {\n if (typeof value === 'string' || typeof value === 'symbol') {\n return value;\n }\n if (Object.is(value?.valueOf?.(), -0)) {\n return '-0';\n }\n return String(value);\n}\n\nexport { toKey };\n", "function toPath(deepKey) {\n const result = [];\n const length = deepKey.length;\n if (length === 0) {\n return result;\n }\n let index = 0;\n let key = '';\n let quoteChar = '';\n let bracket = false;\n if (deepKey.charCodeAt(0) === 46) {\n result.push('');\n index++;\n }\n while (index < length) {\n const char = deepKey[index];\n if (quoteChar) {\n if (char === '\\\\' && index + 1 < length) {\n index++;\n key += deepKey[index];\n }\n else if (char === quoteChar) {\n quoteChar = '';\n }\n else {\n key += char;\n }\n }\n else if (bracket) {\n if (char === '\"' || char === \"'\") {\n quoteChar = char;\n }\n else if (char === ']') {\n bracket = false;\n result.push(key);\n key = '';\n }\n else {\n key += char;\n }\n }\n else {\n if (char === '[') {\n bracket = true;\n if (key) {\n result.push(key);\n key = '';\n }\n }\n else if (char === '.') {\n if (key) {\n result.push(key);\n key = '';\n }\n }\n else {\n key += char;\n }\n }\n index++;\n }\n if (key) {\n result.push(key);\n }\n return result;\n}\n\nexport { toPath };\n", "import { isUnsafeProperty } from '../../_internal/isUnsafeProperty.mjs';\nimport { isDeepKey } from '../_internal/isDeepKey.mjs';\nimport { toKey } from '../_internal/toKey.mjs';\nimport { toPath } from '../util/toPath.mjs';\n\nfunction get(object, path, defaultValue) {\n if (object == null) {\n return defaultValue;\n }\n switch (typeof path) {\n case 'string': {\n if (isUnsafeProperty(path)) {\n return defaultValue;\n }\n const result = object[path];\n if (result === undefined) {\n if (isDeepKey(path)) {\n return get(object, toPath(path), defaultValue);\n }\n else {\n return defaultValue;\n }\n }\n return result;\n }\n case 'number':\n case 'symbol': {\n if (typeof path === 'number') {\n path = toKey(path);\n }\n const result = object[path];\n if (result === undefined) {\n return defaultValue;\n }\n return result;\n }\n default: {\n if (Array.isArray(path)) {\n return getWithPath(object, path, defaultValue);\n }\n if (Object.is(path?.valueOf(), -0)) {\n path = '-0';\n }\n else {\n path = String(path);\n }\n if (isUnsafeProperty(path)) {\n return defaultValue;\n }\n const result = object[path];\n if (result === undefined) {\n return defaultValue;\n }\n return result;\n }\n }\n}\nfunction getWithPath(object, path, defaultValue) {\n if (path.length === 0) {\n return defaultValue;\n }\n let current = object;\n for (let index = 0; index < path.length; index++) {\n if (current == null) {\n return defaultValue;\n }\n if (isUnsafeProperty(path[index])) {\n return defaultValue;\n }\n current = current[path[index]];\n }\n if (current === undefined) {\n return defaultValue;\n }\n return current;\n}\n\nexport { get };\n", "import { get } from './get.mjs';\n\nfunction property(path) {\n return function (object) {\n return get(object, path);\n };\n}\n\nexport { property };\n", "function isObject(value) {\n return value !== null && (typeof value === 'object' || typeof value === 'function');\n}\n\nexport { isObject };\n", "function isPrimitive(value) {\n return value == null || (typeof value !== 'object' && typeof value !== 'function');\n}\n\nexport { isPrimitive };\n", "function eq(value, other) {\n return value === other || (Number.isNaN(value) && Number.isNaN(other));\n}\n\nexport { eq };\n", "import { isMatch } from './isMatch.mjs';\nimport { isObject } from './isObject.mjs';\nimport { isPrimitive } from '../../predicate/isPrimitive.mjs';\nimport { eq } from '../util/eq.mjs';\n\nfunction isMatchWith(target, source, compare) {\n if (typeof compare !== 'function') {\n return isMatch(target, source);\n }\n return isMatchWithInternal(target, source, function doesMatch(objValue, srcValue, key, object, source, stack) {\n const isEqual = compare(objValue, srcValue, key, object, source, stack);\n if (isEqual !== undefined) {\n return Boolean(isEqual);\n }\n return isMatchWithInternal(objValue, srcValue, doesMatch, stack);\n }, new Map());\n}\nfunction isMatchWithInternal(target, source, compare, stack) {\n if (source === target) {\n return true;\n }\n switch (typeof source) {\n case 'object': {\n return isObjectMatch(target, source, compare, stack);\n }\n case 'function': {\n const sourceKeys = Object.keys(source);\n if (sourceKeys.length > 0) {\n return isMatchWithInternal(target, { ...source }, compare, stack);\n }\n return eq(target, source);\n }\n default: {\n if (!isObject(target)) {\n return eq(target, source);\n }\n if (typeof source === 'string') {\n return source === '';\n }\n return true;\n }\n }\n}\nfunction isObjectMatch(target, source, compare, stack) {\n if (source == null) {\n return true;\n }\n if (Array.isArray(source)) {\n return isArrayMatch(target, source, compare, stack);\n }\n if (source instanceof Map) {\n return isMapMatch(target, source, compare, stack);\n }\n if (source instanceof Set) {\n return isSetMatch(target, source, compare, stack);\n }\n const keys = Object.keys(source);\n if (target == null) {\n return keys.length === 0;\n }\n if (keys.length === 0) {\n return true;\n }\n if (stack && stack.has(source)) {\n return stack.get(source) === target;\n }\n if (stack) {\n stack.set(source, target);\n }\n try {\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (!isPrimitive(target) && !(key in target)) {\n return false;\n }\n if (source[key] === undefined && target[key] !== undefined) {\n return false;\n }\n if (source[key] === null && target[key] !== null) {\n return false;\n }\n const isEqual = compare(target[key], source[key], key, target, source, stack);\n if (!isEqual) {\n return false;\n }\n }\n return true;\n }\n finally {\n if (stack) {\n stack.delete(source);\n }\n }\n}\nfunction isMapMatch(target, source, compare, stack) {\n if (source.size === 0) {\n return true;\n }\n if (!(target instanceof Map)) {\n return false;\n }\n for (const [key, sourceValue] of source.entries()) {\n const targetValue = target.get(key);\n const isEqual = compare(targetValue, sourceValue, key, target, source, stack);\n if (isEqual === false) {\n return false;\n }\n }\n return true;\n}\nfunction isArrayMatch(target, source, compare, stack) {\n if (source.length === 0) {\n return true;\n }\n if (!Array.isArray(target)) {\n return false;\n }\n const countedIndex = new Set();\n for (let i = 0; i < source.length; i++) {\n const sourceItem = source[i];\n let found = false;\n for (let j = 0; j < target.length; j++) {\n if (countedIndex.has(j)) {\n continue;\n }\n const targetItem = target[j];\n let matches = false;\n const isEqual = compare(targetItem, sourceItem, i, target, source, stack);\n if (isEqual) {\n matches = true;\n }\n if (matches) {\n countedIndex.add(j);\n found = true;\n break;\n }\n }\n if (!found) {\n return false;\n }\n }\n return true;\n}\nfunction isSetMatch(target, source, compare, stack) {\n if (source.size === 0) {\n return true;\n }\n if (!(target instanceof Set)) {\n return false;\n }\n return isArrayMatch([...target], [...source], compare, stack);\n}\n\nexport { isMatchWith, isSetMatch };\n", "import { isMatchWith } from './isMatchWith.mjs';\n\nfunction isMatch(target, source) {\n return isMatchWith(target, source, () => undefined);\n}\n\nexport { isMatch };\n", "function getSymbols(object) {\n return Object.getOwnPropertySymbols(object).filter(symbol => Object.prototype.propertyIsEnumerable.call(object, symbol));\n}\n\nexport { getSymbols };\n", "function getTag(value) {\n if (value == null) {\n return value === undefined ? '[object Undefined]' : '[object Null]';\n }\n return Object.prototype.toString.call(value);\n}\n\nexport { getTag };\n", "const regexpTag = '[object RegExp]';\nconst stringTag = '[object String]';\nconst numberTag = '[object Number]';\nconst booleanTag = '[object Boolean]';\nconst argumentsTag = '[object Arguments]';\nconst symbolTag = '[object Symbol]';\nconst dateTag = '[object Date]';\nconst mapTag = '[object Map]';\nconst setTag = '[object Set]';\nconst arrayTag = '[object Array]';\nconst functionTag = '[object Function]';\nconst arrayBufferTag = '[object ArrayBuffer]';\nconst objectTag = '[object Object]';\nconst errorTag = '[object Error]';\nconst dataViewTag = '[object DataView]';\nconst uint8ArrayTag = '[object Uint8Array]';\nconst uint8ClampedArrayTag = '[object Uint8ClampedArray]';\nconst uint16ArrayTag = '[object Uint16Array]';\nconst uint32ArrayTag = '[object Uint32Array]';\nconst bigUint64ArrayTag = '[object BigUint64Array]';\nconst int8ArrayTag = '[object Int8Array]';\nconst int16ArrayTag = '[object Int16Array]';\nconst int32ArrayTag = '[object Int32Array]';\nconst bigInt64ArrayTag = '[object BigInt64Array]';\nconst float32ArrayTag = '[object Float32Array]';\nconst float64ArrayTag = '[object Float64Array]';\n\nexport { argumentsTag, arrayBufferTag, arrayTag, bigInt64ArrayTag, bigUint64ArrayTag, booleanTag, dataViewTag, dateTag, errorTag, float32ArrayTag, float64ArrayTag, functionTag, int16ArrayTag, int32ArrayTag, int8ArrayTag, mapTag, numberTag, objectTag, regexpTag, setTag, stringTag, symbolTag, uint16ArrayTag, uint32ArrayTag, uint8ArrayTag, uint8ClampedArrayTag };\n", "function isTypedArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n\nexport { isTypedArray };\n", "import { getSymbols } from '../compat/_internal/getSymbols.mjs';\nimport { getTag } from '../compat/_internal/getTag.mjs';\nimport { uint32ArrayTag, uint16ArrayTag, uint8ClampedArrayTag, uint8ArrayTag, symbolTag, stringTag, setTag, regexpTag, objectTag, numberTag, mapTag, int32ArrayTag, int16ArrayTag, int8ArrayTag, float64ArrayTag, float32ArrayTag, dateTag, booleanTag, dataViewTag, arrayBufferTag, arrayTag, argumentsTag } from '../compat/_internal/tags.mjs';\nimport { isPrimitive } from '../predicate/isPrimitive.mjs';\nimport { isTypedArray } from '../predicate/isTypedArray.mjs';\n\nfunction cloneDeepWith(obj, cloneValue) {\n return cloneDeepWithImpl(obj, undefined, obj, new Map(), cloneValue);\n}\nfunction cloneDeepWithImpl(valueToClone, keyToClone, objectToClone, stack = new Map(), cloneValue = undefined) {\n const cloned = cloneValue?.(valueToClone, keyToClone, objectToClone, stack);\n if (cloned != null) {\n return cloned;\n }\n if (isPrimitive(valueToClone)) {\n return valueToClone;\n }\n if (stack.has(valueToClone)) {\n return stack.get(valueToClone);\n }\n if (Array.isArray(valueToClone)) {\n const result = new Array(valueToClone.length);\n stack.set(valueToClone, result);\n for (let i = 0; i < valueToClone.length; i++) {\n result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);\n }\n if (Object.hasOwn(valueToClone, 'index')) {\n result.index = valueToClone.index;\n }\n if (Object.hasOwn(valueToClone, 'input')) {\n result.input = valueToClone.input;\n }\n return result;\n }\n if (valueToClone instanceof Date) {\n return new Date(valueToClone.getTime());\n }\n if (valueToClone instanceof RegExp) {\n const result = new RegExp(valueToClone.source, valueToClone.flags);\n result.lastIndex = valueToClone.lastIndex;\n return result;\n }\n if (valueToClone instanceof Map) {\n const result = new Map();\n stack.set(valueToClone, result);\n for (const [key, value] of valueToClone) {\n result.set(key, cloneDeepWithImpl(value, key, objectToClone, stack, cloneValue));\n }\n return result;\n }\n if (valueToClone instanceof Set) {\n const result = new Set();\n stack.set(valueToClone, result);\n for (const value of valueToClone) {\n result.add(cloneDeepWithImpl(value, undefined, objectToClone, stack, cloneValue));\n }\n return result;\n }\n if (typeof Buffer !== 'undefined' && Buffer.isBuffer(valueToClone)) {\n return valueToClone.subarray();\n }\n if (isTypedArray(valueToClone)) {\n const result = new (Object.getPrototypeOf(valueToClone).constructor)(valueToClone.length);\n stack.set(valueToClone, result);\n for (let i = 0; i < valueToClone.length; i++) {\n result[i] = cloneDeepWithImpl(valueToClone[i], i, objectToClone, stack, cloneValue);\n }\n return result;\n }\n if (valueToClone instanceof ArrayBuffer ||\n (typeof SharedArrayBuffer !== 'undefined' && valueToClone instanceof SharedArrayBuffer)) {\n return valueToClone.slice(0);\n }\n if (valueToClone instanceof DataView) {\n const result = new DataView(valueToClone.buffer.slice(0), valueToClone.byteOffset, valueToClone.byteLength);\n stack.set(valueToClone, result);\n copyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n return result;\n }\n if (typeof File !== 'undefined' && valueToClone instanceof File) {\n const result = new File([valueToClone], valueToClone.name, {\n type: valueToClone.type,\n });\n stack.set(valueToClone, result);\n copyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n return result;\n }\n if (valueToClone instanceof Blob) {\n const result = new Blob([valueToClone], { type: valueToClone.type });\n stack.set(valueToClone, result);\n copyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n return result;\n }\n if (valueToClone instanceof Error) {\n const result = new valueToClone.constructor();\n stack.set(valueToClone, result);\n result.message = valueToClone.message;\n result.name = valueToClone.name;\n result.stack = valueToClone.stack;\n result.cause = valueToClone.cause;\n copyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n return result;\n }\n if (typeof valueToClone === 'object' && isCloneableObject(valueToClone)) {\n const result = Object.create(Object.getPrototypeOf(valueToClone));\n stack.set(valueToClone, result);\n copyProperties(result, valueToClone, objectToClone, stack, cloneValue);\n return result;\n }\n return valueToClone;\n}\nfunction copyProperties(target, source, objectToClone = target, stack, cloneValue) {\n const keys = [...Object.keys(source), ...getSymbols(source)];\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const descriptor = Object.getOwnPropertyDescriptor(target, key);\n if (descriptor == null || descriptor.writable) {\n target[key] = cloneDeepWithImpl(source[key], key, objectToClone, stack, cloneValue);\n }\n }\n}\nfunction isCloneableObject(object) {\n switch (getTag(object)) {\n case argumentsTag:\n case arrayTag:\n case arrayBufferTag:\n case dataViewTag:\n case booleanTag:\n case dateTag:\n case float32ArrayTag:\n case float64ArrayTag:\n case int8ArrayTag:\n case int16ArrayTag:\n case int32ArrayTag:\n case mapTag:\n case numberTag:\n case objectTag:\n case regexpTag:\n case setTag:\n case stringTag:\n case symbolTag:\n case uint8ArrayTag:\n case uint8ClampedArrayTag:\n case uint16ArrayTag:\n case uint32ArrayTag: {\n return true;\n }\n default: {\n return false;\n }\n }\n}\n\nexport { cloneDeepWith, cloneDeepWithImpl, copyProperties };\n", "import { cloneDeepWithImpl } from './cloneDeepWith.mjs';\n\nfunction cloneDeep(obj) {\n return cloneDeepWithImpl(obj, undefined, obj, new Map(), undefined);\n}\n\nexport { cloneDeep };\n", "import { isMatch } from './isMatch.mjs';\nimport { cloneDeep } from '../../object/cloneDeep.mjs';\n\nfunction matches(source) {\n source = cloneDeep(source);\n return (target) => {\n return isMatch(target, source);\n };\n}\n\nexport { matches };\n", "import { cloneDeepWith as cloneDeepWith$1, copyProperties } from '../../object/cloneDeepWith.mjs';\nimport { argumentsTag, booleanTag, stringTag, numberTag } from '../_internal/tags.mjs';\n\nfunction cloneDeepWith(obj, customizer) {\n return cloneDeepWith$1(obj, (value, key, object, stack) => {\n const cloned = customizer?.(value, key, object, stack);\n if (cloned != null) {\n return cloned;\n }\n if (typeof obj !== 'object') {\n return undefined;\n }\n switch (Object.prototype.toString.call(obj)) {\n case numberTag:\n case stringTag:\n case booleanTag: {\n const result = new obj.constructor(obj?.valueOf());\n copyProperties(result, obj);\n return result;\n }\n case argumentsTag: {\n const result = {};\n copyProperties(result, obj);\n result.length = obj.length;\n result[Symbol.iterator] = obj[Symbol.iterator];\n return result;\n }\n default: {\n return undefined;\n }\n }\n });\n}\n\nexport { cloneDeepWith };\n", "import { cloneDeepWith } from './cloneDeepWith.mjs';\n\nfunction cloneDeep(obj) {\n return cloneDeepWith(obj);\n}\n\nexport { cloneDeep };\n", "const IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\\d*)$/;\nfunction isIndex(value, length = Number.MAX_SAFE_INTEGER) {\n switch (typeof value) {\n case 'number': {\n return Number.isInteger(value) && value >= 0 && value < length;\n }\n case 'symbol': {\n return false;\n }\n case 'string': {\n return IS_UNSIGNED_INTEGER.test(value);\n }\n }\n}\n\nexport { isIndex };\n", "import { getTag } from '../_internal/getTag.mjs';\n\nfunction isArguments(value) {\n return value !== null && typeof value === 'object' && getTag(value) === '[object Arguments]';\n}\n\nexport { isArguments };\n", "import { isDeepKey } from '../_internal/isDeepKey.mjs';\nimport { isIndex } from '../_internal/isIndex.mjs';\nimport { isArguments } from '../predicate/isArguments.mjs';\nimport { toPath } from '../util/toPath.mjs';\n\nfunction has(object, path) {\n let resolvedPath;\n if (Array.isArray(path)) {\n resolvedPath = path;\n }\n else if (typeof path === 'string' && isDeepKey(path) && object?.[path] == null) {\n resolvedPath = toPath(path);\n }\n else {\n resolvedPath = [path];\n }\n if (resolvedPath.length === 0) {\n return false;\n }\n let current = object;\n for (let i = 0; i < resolvedPath.length; i++) {\n const key = resolvedPath[i];\n if (current == null || !Object.hasOwn(current, key)) {\n const isSparseIndex = (Array.isArray(current) || isArguments(current)) && isIndex(key) && key < current.length;\n if (!isSparseIndex) {\n return false;\n }\n }\n current = current[key];\n }\n return true;\n}\n\nexport { has };\n", "import { isMatch } from './isMatch.mjs';\nimport { toKey } from '../_internal/toKey.mjs';\nimport { cloneDeep } from '../object/cloneDeep.mjs';\nimport { get } from '../object/get.mjs';\nimport { has } from '../object/has.mjs';\n\nfunction matchesProperty(property, source) {\n switch (typeof property) {\n case 'object': {\n if (Object.is(property?.valueOf(), -0)) {\n property = '-0';\n }\n break;\n }\n case 'number': {\n property = toKey(property);\n break;\n }\n }\n source = cloneDeep(source);\n return function (target) {\n const result = get(target, property);\n if (result === undefined) {\n return has(target, property);\n }\n if (source === undefined) {\n return result === undefined;\n }\n return isMatch(result, source);\n };\n}\n\nexport { matchesProperty };\n", "import { identity } from '../../function/identity.mjs';\nimport { property } from '../object/property.mjs';\nimport { matches } from '../predicate/matches.mjs';\nimport { matchesProperty } from '../predicate/matchesProperty.mjs';\n\nfunction iteratee(value) {\n if (value == null) {\n return identity;\n }\n switch (typeof value) {\n case 'function': {\n return value;\n }\n case 'object': {\n if (Array.isArray(value) && value.length === 2) {\n return matchesProperty(value[0], value[1]);\n }\n return matches(value);\n }\n case 'string':\n case 'symbol':\n case 'number': {\n return property(value);\n }\n }\n}\n\nexport { iteratee };\n", "function isObjectLike(value) {\n return typeof value === 'object' && value !== null;\n}\n\nexport { isObjectLike };\n", "function isSymbol(value) {\n return typeof value === 'symbol' || value instanceof Symbol;\n}\n\nexport { isSymbol };\n", "import { isSymbol } from '../predicate/isSymbol.mjs';\n\nfunction toNumber(value) {\n if (isSymbol(value)) {\n return NaN;\n }\n return Number(value);\n}\n\nexport { toNumber };\n", "import { toNumber } from './toNumber.mjs';\n\nfunction toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === Infinity || value === -Infinity) {\n const sign = value < 0 ? -1 : 1;\n return sign * Number.MAX_VALUE;\n }\n return value === value ? value : 0;\n}\n\nexport { toFinite };\n", "import { toFinite } from './toFinite.mjs';\n\nfunction toInteger(value) {\n const finite = toFinite(value);\n const remainder = finite % 1;\n return remainder ? finite - remainder : finite;\n}\n\nexport { toInteger };\n", "function isString(value) {\n return typeof value === 'string' || value instanceof String;\n}\n\nexport { isString };\n", "import { isSymbol } from '../predicate/isSymbol.mjs';\n\nconst regexIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/;\nconst regexIsPlainProp = /^\\w*$/;\nfunction isKey(value, object) {\n if (Array.isArray(value)) {\n return false;\n }\n if (typeof value === 'number' || typeof value === 'boolean' || value == null || isSymbol(value)) {\n return true;\n }\n return ((typeof value === 'string' && (regexIsPlainProp.test(value) || !regexIsDeepProp.test(value))) ||\n (object != null && Object.hasOwn(object, value)));\n}\n\nexport { isKey };\n", "function isArray(value) {\n return Array.isArray(value);\n}\n\nexport { isArray };\n", "import { eq } from '../util/eq.mjs';\n\nconst assignValue = (object, key, value) => {\n const objValue = object[key];\n if (!(Object.hasOwn(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) {\n object[key] = value;\n }\n};\n\nexport { assignValue };\n", "import { isUnsafeProperty } from '../../_internal/isUnsafeProperty.mjs';\nimport { assignValue } from '../_internal/assignValue.mjs';\nimport { isIndex } from '../_internal/isIndex.mjs';\nimport { isKey } from '../_internal/isKey.mjs';\nimport { toKey } from '../_internal/toKey.mjs';\nimport { isObject } from '../predicate/isObject.mjs';\nimport { toPath } from '../util/toPath.mjs';\n\nfunction updateWith(obj, path, updater, customizer) {\n if (obj == null && !isObject(obj)) {\n return obj;\n }\n const resolvedPath = isKey(path, obj)\n ? [path]\n : Array.isArray(path)\n ? path\n : typeof path === 'string'\n ? toPath(path)\n : [path];\n let current = obj;\n for (let i = 0; i < resolvedPath.length && current != null; i++) {\n const key = toKey(resolvedPath[i]);\n if (isUnsafeProperty(key)) {\n continue;\n }\n let newValue;\n if (i === resolvedPath.length - 1) {\n newValue = updater(current[key]);\n }\n else {\n const objValue = current[key];\n const customizerResult = customizer?.(objValue, key, obj);\n newValue =\n customizerResult !== undefined\n ? customizerResult\n : isObject(objValue)\n ? objValue\n : isIndex(resolvedPath[i + 1])\n ? []\n : {};\n }\n assignValue(current, key, newValue);\n current = current[key];\n }\n return obj;\n}\n\nexport { updateWith };\n", "import { updateWith } from './updateWith.mjs';\n\nfunction set(obj, path, value) {\n return updateWith(obj, path, () => value, () => undefined);\n}\n\nexport { set };\n", "function debounce(func, debounceMs, { signal, edges } = {}) {\n let pendingThis = undefined;\n let pendingArgs = null;\n const leading = edges != null && edges.includes('leading');\n const trailing = edges == null || edges.includes('trailing');\n const invoke = () => {\n if (pendingArgs !== null) {\n func.apply(pendingThis, pendingArgs);\n pendingThis = undefined;\n pendingArgs = null;\n }\n };\n const onTimerEnd = () => {\n if (trailing) {\n invoke();\n }\n cancel();\n };\n let timeoutId = null;\n const schedule = () => {\n if (timeoutId != null) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(() => {\n timeoutId = null;\n onTimerEnd();\n }, debounceMs);\n };\n const cancelTimer = () => {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n };\n const cancel = () => {\n cancelTimer();\n pendingThis = undefined;\n pendingArgs = null;\n };\n const flush = () => {\n cancelTimer();\n invoke();\n };\n const debounced = function (...args) {\n if (signal?.aborted) {\n return;\n }\n pendingThis = this;\n pendingArgs = args;\n const isFirstCall = timeoutId == null;\n schedule();\n if (leading && isFirstCall) {\n invoke();\n }\n };\n debounced.schedule = schedule;\n debounced.cancel = cancel;\n debounced.flush = flush;\n signal?.addEventListener('abort', cancel, { once: true });\n return debounced;\n}\n\nexport { debounce };\n", "import { debounce as debounce$1 } from '../../function/debounce.mjs';\n\nfunction debounce(func, debounceMs = 0, options = {}) {\n if (typeof options !== 'object') {\n options = {};\n }\n const { leading = false, trailing = true, maxWait } = options;\n const edges = Array(2);\n if (leading) {\n edges[0] = 'leading';\n }\n if (trailing) {\n edges[1] = 'trailing';\n }\n let result = undefined;\n let pendingAt = null;\n const _debounced = debounce$1(function (...args) {\n result = func.apply(this, args);\n pendingAt = null;\n }, debounceMs, { edges });\n const debounced = function (...args) {\n if (maxWait != null) {\n if (pendingAt === null) {\n pendingAt = Date.now();\n }\n if (Date.now() - pendingAt >= maxWait) {\n result = func.apply(this, args);\n pendingAt = Date.now();\n _debounced.cancel();\n _debounced.schedule();\n return result;\n }\n }\n _debounced.apply(this, args);\n return result;\n };\n const flush = () => {\n _debounced.flush();\n return result;\n };\n debounced.cancel = _debounced.cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nexport { debounce };\n", "import { debounce } from './debounce.mjs';\n\nfunction throttle(func, throttleMs = 0, options = {}) {\n if (typeof options !== 'object') {\n options = {};\n }\n const { leading = true, trailing = true } = options;\n return debounce(func, throttleMs, {\n leading,\n trailing,\n maxWait: throttleMs,\n });\n}\n\nexport { throttle };\n", "function toString(value) {\n if (value == null) {\n return '';\n }\n if (typeof value === 'string') {\n return value;\n }\n if (Array.isArray(value)) {\n return value.map(toString).join(',');\n }\n const result = String(value);\n if (result === '0' && Object.is(Number(value), -0)) {\n return '-0';\n }\n return result;\n}\n\nexport { toString };\n", "function isPlainObject(value) {\n if (!value || typeof value !== 'object') {\n return false;\n }\n const proto = Object.getPrototypeOf(value);\n const hasObjectPrototype = proto === null ||\n proto === Object.prototype ||\n Object.getPrototypeOf(proto) === null;\n if (!hasObjectPrototype) {\n return false;\n }\n return Object.prototype.toString.call(value) === '[object Object]';\n}\n\nexport { isPlainObject };\n", "import { isPlainObject } from './isPlainObject.mjs';\nimport { getSymbols } from '../compat/_internal/getSymbols.mjs';\nimport { getTag } from '../compat/_internal/getTag.mjs';\nimport { functionTag, regexpTag, symbolTag, dateTag, booleanTag, numberTag, stringTag, objectTag, errorTag, dataViewTag, arrayBufferTag, float64ArrayTag, float32ArrayTag, bigInt64ArrayTag, int32ArrayTag, int16ArrayTag, int8ArrayTag, bigUint64ArrayTag, uint32ArrayTag, uint16ArrayTag, uint8ClampedArrayTag, uint8ArrayTag, arrayTag, setTag, mapTag, argumentsTag } from '../compat/_internal/tags.mjs';\nimport { eq } from '../compat/util/eq.mjs';\n\nfunction isEqualWith(a, b, areValuesEqual) {\n return isEqualWithImpl(a, b, undefined, undefined, undefined, undefined, areValuesEqual);\n}\nfunction isEqualWithImpl(a, b, property, aParent, bParent, stack, areValuesEqual) {\n const result = areValuesEqual(a, b, property, aParent, bParent, stack);\n if (result !== undefined) {\n return result;\n }\n if (typeof a === typeof b) {\n switch (typeof a) {\n case 'bigint':\n case 'string':\n case 'boolean':\n case 'symbol':\n case 'undefined': {\n return a === b;\n }\n case 'number': {\n return a === b || Object.is(a, b);\n }\n case 'function': {\n return a === b;\n }\n case 'object': {\n return areObjectsEqual(a, b, stack, areValuesEqual);\n }\n }\n }\n return areObjectsEqual(a, b, stack, areValuesEqual);\n}\nfunction areObjectsEqual(a, b, stack, areValuesEqual) {\n if (Object.is(a, b)) {\n return true;\n }\n let aTag = getTag(a);\n let bTag = getTag(b);\n if (aTag === argumentsTag) {\n aTag = objectTag;\n }\n if (bTag === argumentsTag) {\n bTag = objectTag;\n }\n if (aTag !== bTag) {\n return false;\n }\n switch (aTag) {\n case stringTag:\n return a.toString() === b.toString();\n case numberTag: {\n const x = a.valueOf();\n const y = b.valueOf();\n return eq(x, y);\n }\n case booleanTag:\n case dateTag:\n case symbolTag:\n return Object.is(a.valueOf(), b.valueOf());\n case regexpTag: {\n return a.source === b.source && a.flags === b.flags;\n }\n case functionTag: {\n return a === b;\n }\n }\n stack = stack ?? new Map();\n const aStack = stack.get(a);\n const bStack = stack.get(b);\n if (aStack != null && bStack != null) {\n return aStack === b;\n }\n stack.set(a, b);\n stack.set(b, a);\n try {\n switch (aTag) {\n case mapTag: {\n if (a.size !== b.size) {\n return false;\n }\n for (const [key, value] of a.entries()) {\n if (!b.has(key) || !isEqualWithImpl(value, b.get(key), key, a, b, stack, areValuesEqual)) {\n return false;\n }\n }\n return true;\n }\n case setTag: {\n if (a.size !== b.size) {\n return false;\n }\n const aValues = Array.from(a.values());\n const bValues = Array.from(b.values());\n for (let i = 0; i < aValues.length; i++) {\n const aValue = aValues[i];\n const index = bValues.findIndex(bValue => {\n return isEqualWithImpl(aValue, bValue, undefined, a, b, stack, areValuesEqual);\n });\n if (index === -1) {\n return false;\n }\n bValues.splice(index, 1);\n }\n return true;\n }\n case arrayTag:\n case uint8ArrayTag:\n case uint8ClampedArrayTag:\n case uint16ArrayTag:\n case uint32ArrayTag:\n case bigUint64ArrayTag:\n case int8ArrayTag:\n case int16ArrayTag:\n case int32ArrayTag:\n case bigInt64ArrayTag:\n case float32ArrayTag:\n case float64ArrayTag: {\n if (typeof Buffer !== 'undefined' && Buffer.isBuffer(a) !== Buffer.isBuffer(b)) {\n return false;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (!isEqualWithImpl(a[i], b[i], i, a, b, stack, areValuesEqual)) {\n return false;\n }\n }\n return true;\n }\n case arrayBufferTag: {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n return areObjectsEqual(new Uint8Array(a), new Uint8Array(b), stack, areValuesEqual);\n }\n case dataViewTag: {\n if (a.byteLength !== b.byteLength || a.byteOffset !== b.byteOffset) {\n return false;\n }\n return areObjectsEqual(new Uint8Array(a), new Uint8Array(b), stack, areValuesEqual);\n }\n case errorTag: {\n return a.name === b.name && a.message === b.message;\n }\n case objectTag: {\n const areEqualInstances = areObjectsEqual(a.constructor, b.constructor, stack, areValuesEqual) ||\n (isPlainObject(a) && isPlainObject(b));\n if (!areEqualInstances) {\n return false;\n }\n const aKeys = [...Object.keys(a), ...getSymbols(a)];\n const bKeys = [...Object.keys(b), ...getSymbols(b)];\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n for (let i = 0; i < aKeys.length; i++) {\n const propKey = aKeys[i];\n const aProp = a[propKey];\n if (!Object.hasOwn(b, propKey)) {\n return false;\n }\n const bProp = b[propKey];\n if (!isEqualWithImpl(aProp, bProp, propKey, a, b, stack, areValuesEqual)) {\n return false;\n }\n }\n return true;\n }\n default: {\n return false;\n }\n }\n }\n finally {\n stack.delete(a);\n stack.delete(b);\n }\n}\n\nexport { isEqualWith };\n", "function noop() { }\n\nexport { noop };\n", "import { isEqualWith } from './isEqualWith.mjs';\nimport { noop } from '../function/noop.mjs';\n\nfunction isEqual(a, b) {\n return isEqualWith(a, b, noop);\n}\n\nexport { isEqual };\n", "function isBuffer(x) {\n return typeof Buffer !== 'undefined' && Buffer.isBuffer(x);\n}\n\nexport { isBuffer };\n", "function isPrototype(value) {\n const constructor = value?.constructor;\n const prototype = typeof constructor === 'function' ? constructor.prototype : Object.prototype;\n return value === prototype;\n}\n\nexport { isPrototype };\n", "import { isTypedArray as isTypedArray$1 } from '../../predicate/isTypedArray.mjs';\n\nfunction isTypedArray(x) {\n return isTypedArray$1(x);\n}\n\nexport { isTypedArray };\n", "import { toInteger } from './toInteger.mjs';\n\nfunction times(n, getValue) {\n n = toInteger(n);\n if (n < 1 || !Number.isSafeInteger(n)) {\n return [];\n }\n const result = new Array(n);\n for (let i = 0; i < n; i++) {\n result[i] = typeof getValue === 'function' ? getValue(i) : i;\n }\n return result;\n}\n\nexport { times };\n", "import { isBuffer } from '../../predicate/isBuffer.mjs';\nimport { isPrototype } from '../_internal/isPrototype.mjs';\nimport { isArrayLike } from '../predicate/isArrayLike.mjs';\nimport { isTypedArray } from '../predicate/isTypedArray.mjs';\nimport { times } from '../util/times.mjs';\n\nfunction keysIn(object) {\n if (object == null) {\n return [];\n }\n switch (typeof object) {\n case 'object':\n case 'function': {\n if (isArrayLike(object)) {\n return arrayLikeKeysIn(object);\n }\n if (isPrototype(object)) {\n return prototypeKeysIn(object);\n }\n return keysInImpl(object);\n }\n default: {\n return keysInImpl(Object(object));\n }\n }\n}\nfunction keysInImpl(object) {\n const result = [];\n for (const key in object) {\n result.push(key);\n }\n return result;\n}\nfunction prototypeKeysIn(object) {\n const keys = keysInImpl(object);\n return keys.filter(key => key !== 'constructor');\n}\nfunction arrayLikeKeysIn(object) {\n const indices = times(object.length, index => `${index}`);\n const filteredKeys = new Set(indices);\n if (isBuffer(object)) {\n filteredKeys.add('offset');\n filteredKeys.add('parent');\n }\n if (isTypedArray(object)) {\n filteredKeys.add('buffer');\n filteredKeys.add('byteLength');\n filteredKeys.add('byteOffset');\n }\n return [...indices, ...keysInImpl(object).filter(key => !filteredKeys.has(key))];\n}\n\nexport { keysIn };\n", "import { keysIn } from './keysIn.mjs';\nimport { eq } from '../util/eq.mjs';\n\nfunction assignIn(object, ...sources) {\n for (let i = 0; i < sources.length; i++) {\n assignInImpl(object, sources[i]);\n }\n return object;\n}\nfunction assignInImpl(object, source) {\n const keys = keysIn(source);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (!(key in object) || !eq(object[key], source[key])) {\n object[key] = source[key];\n }\n }\n}\n\nexport { assignIn };\n", "import { isPrimitive } from '../../predicate/isPrimitive.mjs';\nimport { getTag } from '../_internal/getTag.mjs';\nimport { arrayBufferTag, dataViewTag, booleanTag, numberTag, stringTag, dateTag, regexpTag, symbolTag, mapTag, setTag, argumentsTag, uint32ArrayTag, uint16ArrayTag, uint8ClampedArrayTag, uint8ArrayTag, objectTag, int32ArrayTag, int16ArrayTag, int8ArrayTag, float64ArrayTag, float32ArrayTag, arrayTag } from '../_internal/tags.mjs';\nimport { isArray } from '../predicate/isArray.mjs';\nimport { isTypedArray } from '../predicate/isTypedArray.mjs';\n\nfunction clone(obj) {\n if (isPrimitive(obj)) {\n return obj;\n }\n const tag = getTag(obj);\n if (!isCloneableObject(obj)) {\n return {};\n }\n if (isArray(obj)) {\n const result = Array.from(obj);\n if (obj.length > 0 && typeof obj[0] === 'string' && Object.hasOwn(obj, 'index')) {\n result.index = obj.index;\n result.input = obj.input;\n }\n return result;\n }\n if (isTypedArray(obj)) {\n const typedArray = obj;\n const Ctor = typedArray.constructor;\n return new Ctor(typedArray.buffer, typedArray.byteOffset, typedArray.length);\n }\n if (tag === arrayBufferTag) {\n return new ArrayBuffer(obj.byteLength);\n }\n if (tag === dataViewTag) {\n const dataView = obj;\n const buffer = dataView.buffer;\n const byteOffset = dataView.byteOffset;\n const byteLength = dataView.byteLength;\n const clonedBuffer = new ArrayBuffer(byteLength);\n const srcView = new Uint8Array(buffer, byteOffset, byteLength);\n const destView = new Uint8Array(clonedBuffer);\n destView.set(srcView);\n return new DataView(clonedBuffer);\n }\n if (tag === booleanTag || tag === numberTag || tag === stringTag) {\n const Ctor = obj.constructor;\n const clone = new Ctor(obj.valueOf());\n if (tag === stringTag) {\n cloneStringObjectProperties(clone, obj);\n }\n else {\n copyOwnProperties(clone, obj);\n }\n return clone;\n }\n if (tag === dateTag) {\n return new Date(Number(obj));\n }\n if (tag === regexpTag) {\n const regExp = obj;\n const clone = new RegExp(regExp.source, regExp.flags);\n clone.lastIndex = regExp.lastIndex;\n return clone;\n }\n if (tag === symbolTag) {\n return Object(Symbol.prototype.valueOf.call(obj));\n }\n if (tag === mapTag) {\n const map = obj;\n const result = new Map();\n map.forEach((obj, key) => {\n result.set(key, obj);\n });\n return result;\n }\n if (tag === setTag) {\n const set = obj;\n const result = new Set();\n set.forEach(obj => {\n result.add(obj);\n });\n return result;\n }\n if (tag === argumentsTag) {\n const args = obj;\n const result = {};\n copyOwnProperties(result, args);\n result.length = args.length;\n result[Symbol.iterator] = args[Symbol.iterator];\n return result;\n }\n const result = {};\n copyPrototype(result, obj);\n copyOwnProperties(result, obj);\n copySymbolProperties(result, obj);\n return result;\n}\nfunction isCloneableObject(object) {\n switch (getTag(object)) {\n case argumentsTag:\n case arrayTag:\n case arrayBufferTag:\n case dataViewTag:\n case booleanTag:\n case dateTag:\n case float32ArrayTag:\n case float64ArrayTag:\n case int8ArrayTag:\n case int16ArrayTag:\n case int32ArrayTag:\n case mapTag:\n case numberTag:\n case objectTag:\n case regexpTag:\n case setTag:\n case stringTag:\n case symbolTag:\n case uint8ArrayTag:\n case uint8ClampedArrayTag:\n case uint16ArrayTag:\n case uint32ArrayTag: {\n return true;\n }\n default: {\n return false;\n }\n }\n}\nfunction copyOwnProperties(target, source) {\n for (const key in source) {\n if (Object.hasOwn(source, key)) {\n target[key] = source[key];\n }\n }\n}\nfunction copySymbolProperties(target, source) {\n const symbols = Object.getOwnPropertySymbols(source);\n for (let i = 0; i < symbols.length; i++) {\n const symbol = symbols[i];\n if (Object.prototype.propertyIsEnumerable.call(source, symbol)) {\n target[symbol] = source[symbol];\n }\n }\n}\nfunction cloneStringObjectProperties(target, source) {\n const stringLength = source.valueOf().length;\n for (const key in source) {\n if (Object.hasOwn(source, key) && (Number.isNaN(Number(key)) || Number(key) >= stringLength)) {\n target[key] = source[key];\n }\n }\n}\nfunction copyPrototype(target, source) {\n const proto = Object.getPrototypeOf(source);\n if (proto !== null) {\n const Ctor = source.constructor;\n if (typeof Ctor === 'function') {\n Object.setPrototypeOf(target, proto);\n }\n }\n}\n\nexport { clone };\n", "function isPlainObject(object) {\n if (typeof object !== 'object') {\n return false;\n }\n if (object == null) {\n return false;\n }\n if (Object.getPrototypeOf(object) === null) {\n return true;\n }\n if (Object.prototype.toString.call(object) !== '[object Object]') {\n const tag = object[Symbol.toStringTag];\n if (tag == null) {\n return false;\n }\n const isTagReadonly = !Object.getOwnPropertyDescriptor(object, Symbol.toStringTag)?.writable;\n if (isTagReadonly) {\n return false;\n }\n return object.toString() === `[object ${tag}]`;\n }\n let proto = object;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(object) === proto;\n}\n\nexport { isPlainObject };\n", "function mapValues(object, getNewValue) {\n const result = {};\n const keys = Object.keys(object);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const value = object[key];\n result[key] = getNewValue(value, key, object);\n }\n return result;\n}\n\nexport { mapValues };\n", "import { identity } from '../../function/identity.mjs';\nimport { mapValues as mapValues$1 } from '../../object/mapValues.mjs';\nimport { iteratee } from '../util/iteratee.mjs';\n\nfunction mapValues(object, getNewValue = identity) {\n if (object == null) {\n return {};\n }\n return mapValues$1(object, iteratee(getNewValue));\n}\n\nexport { mapValues };\n", "import { isPrimitive } from '../predicate/isPrimitive.mjs';\nimport { isTypedArray } from '../predicate/isTypedArray.mjs';\n\nfunction clone(obj) {\n if (isPrimitive(obj)) {\n return obj;\n }\n if (Array.isArray(obj) ||\n isTypedArray(obj) ||\n obj instanceof ArrayBuffer ||\n (typeof SharedArrayBuffer !== 'undefined' && obj instanceof SharedArrayBuffer)) {\n return obj.slice(0);\n }\n const prototype = Object.getPrototypeOf(obj);\n const Constructor = prototype.constructor;\n if (obj instanceof Date || obj instanceof Map || obj instanceof Set) {\n return new Constructor(obj);\n }\n if (obj instanceof RegExp) {\n const newRegExp = new Constructor(obj);\n newRegExp.lastIndex = obj.lastIndex;\n return newRegExp;\n }\n if (obj instanceof DataView) {\n return new Constructor(obj.buffer.slice(0));\n }\n if (obj instanceof Error) {\n const newError = new Constructor(obj.message);\n newError.stack = obj.stack;\n newError.name = obj.name;\n newError.cause = obj.cause;\n return newError;\n }\n if (typeof File !== 'undefined' && obj instanceof File) {\n const newFile = new Constructor([obj], obj.name, { type: obj.type, lastModified: obj.lastModified });\n return newFile;\n }\n if (typeof obj === 'object') {\n const newObject = Object.create(prototype);\n return Object.assign(newObject, obj);\n }\n return obj;\n}\n\nexport { clone };\n", "import { cloneDeep } from './cloneDeep.mjs';\nimport { isUnsafeProperty } from '../../_internal/isUnsafeProperty.mjs';\nimport { clone } from '../../object/clone.mjs';\nimport { isPrimitive } from '../../predicate/isPrimitive.mjs';\nimport { getSymbols } from '../_internal/getSymbols.mjs';\nimport { isArguments } from '../predicate/isArguments.mjs';\nimport { isObjectLike } from '../predicate/isObjectLike.mjs';\nimport { isPlainObject } from '../predicate/isPlainObject.mjs';\nimport { isTypedArray } from '../predicate/isTypedArray.mjs';\n\nfunction mergeWith(object, ...otherArgs) {\n const sources = otherArgs.slice(0, -1);\n const merge = otherArgs[otherArgs.length - 1];\n let result = object;\n for (let i = 0; i < sources.length; i++) {\n const source = sources[i];\n result = mergeWithDeep(result, source, merge, new Map());\n }\n return result;\n}\nfunction mergeWithDeep(target, source, merge, stack) {\n if (isPrimitive(target)) {\n target = Object(target);\n }\n if (source == null || typeof source !== 'object') {\n return target;\n }\n if (stack.has(source)) {\n return clone(stack.get(source));\n }\n stack.set(source, target);\n if (Array.isArray(source)) {\n source = source.slice();\n for (let i = 0; i < source.length; i++) {\n source[i] = source[i] ?? undefined;\n }\n }\n const sourceKeys = [...Object.keys(source), ...getSymbols(source)];\n for (let i = 0; i < sourceKeys.length; i++) {\n const key = sourceKeys[i];\n if (isUnsafeProperty(key)) {\n continue;\n }\n let sourceValue = source[key];\n let targetValue = target[key];\n if (isArguments(sourceValue)) {\n sourceValue = { ...sourceValue };\n }\n if (isArguments(targetValue)) {\n targetValue = { ...targetValue };\n }\n if (typeof Buffer !== 'undefined' && Buffer.isBuffer(sourceValue)) {\n sourceValue = cloneDeep(sourceValue);\n }\n if (Array.isArray(sourceValue)) {\n if (typeof targetValue === 'object' && targetValue != null) {\n const cloned = [];\n const targetKeys = Reflect.ownKeys(targetValue);\n for (let i = 0; i < targetKeys.length; i++) {\n const targetKey = targetKeys[i];\n cloned[targetKey] = targetValue[targetKey];\n }\n targetValue = cloned;\n }\n else {\n targetValue = [];\n }\n }\n const merged = merge(targetValue, sourceValue, key, target, source, stack);\n if (merged != null) {\n target[key] = merged;\n }\n else if (Array.isArray(sourceValue)) {\n target[key] = mergeWithDeep(targetValue, sourceValue, merge, stack);\n }\n else if (isObjectLike(targetValue) && isObjectLike(sourceValue)) {\n target[key] = mergeWithDeep(targetValue, sourceValue, merge, stack);\n }\n else if (targetValue == null && isPlainObject(sourceValue)) {\n target[key] = mergeWithDeep({}, sourceValue, merge, stack);\n }\n else if (targetValue == null && isTypedArray(sourceValue)) {\n target[key] = cloneDeep(sourceValue);\n }\n else if (targetValue === undefined || sourceValue !== undefined) {\n target[key] = sourceValue;\n }\n }\n return target;\n}\n\nexport { mergeWith };\n", "import { mergeWith } from './mergeWith.mjs';\nimport { noop } from '../../function/noop.mjs';\n\nfunction merge(object, ...sources) {\n return mergeWith(object, ...sources, noop);\n}\n\nexport { merge };\n", "function isFunction(value) {\n return typeof value === 'function';\n}\n\nexport { isFunction };\n", "import { isObjectLike } from './isObjectLike.mjs';\nimport { isPlainObject } from './isPlainObject.mjs';\n\nfunction isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n}\n\nexport { isElement };\n", "function after(n, func) {\n if (!Number.isInteger(n) || n < 0) {\n throw new Error(`n must be a non-negative integer.`);\n }\n let counter = 0;\n return (...args) => {\n if (++counter >= n) {\n return func(...args);\n }\n return undefined;\n };\n}\n\nexport { after };\n", "import { after } from '../../function/after.mjs';\nimport { isEqualWith as isEqualWith$1 } from '../../predicate/isEqualWith.mjs';\n\nfunction isEqualWith(a, b, areValuesEqual) {\n if (typeof areValuesEqual !== 'function') {\n areValuesEqual = () => undefined;\n }\n return isEqualWith$1(a, b, (...args) => {\n const result = areValuesEqual(...args);\n if (result !== undefined) {\n return Boolean(result);\n }\n if (a instanceof Map && b instanceof Map) {\n return isEqualWith(Array.from(a), Array.from(b), after(2, areValuesEqual));\n }\n if (a instanceof Set && b instanceof Set) {\n return isEqualWith(Array.from(a), Array.from(b), after(2, areValuesEqual));\n }\n });\n}\n\nexport { isEqualWith };\n", "function upperFirst(str) {\n return str.substring(0, 1).toUpperCase() + str.substring(1);\n}\n\nexport { upperFirst };\n", "import { upperFirst as upperFirst$1 } from '../../string/upperFirst.mjs';\nimport { toString } from '../util/toString.mjs';\n\nfunction upperFirst(str) {\n return upperFirst$1(toString(str));\n}\n\nexport { upperFirst };\n", "import { isObject as isObject$1, isString, isPlainObject, cloneDeepWith, isElement as isElement$1, isFunction, merge } from 'es-toolkit/compat';\n\n/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/global\n */ // This interface exists to make our API pages more readable.\n/**\n * A helper (module) giving an access to the global DOM objects such as `window` and `document`.\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 */ let 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 = {\n window,\n document\n };\n} catch {\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 */ // 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 = {\n window: {},\n document: {}\n };\n}\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 *\n * @internal\n */ function getUserAgent() {\n // In some environments navigator API might not be available.\n try {\n return navigator.userAgent.toLowerCase();\n } catch {\n return '';\n }\n}\nconst userAgent = /* #__PURE__ */ getUserAgent();\n/**\n * A namespace containing environment and browser information.\n */ const env = {\n isMac: /* #__PURE__ */ isMac(userAgent),\n isWindows: /* #__PURE__ */ isWindows(userAgent),\n isGecko: /* #__PURE__ */ isGecko(userAgent),\n isSafari: /* #__PURE__ */ isSafari(userAgent),\n isiOS: /* #__PURE__ */ isiOS(userAgent),\n isAndroid: /* #__PURE__ */ isAndroid(userAgent),\n isBlink: /* #__PURE__ */ isBlink(userAgent),\n get isMediaForcedColors () {\n return isMediaForcedColors();\n },\n get isMotionReduced () {\n return isMotionReduced();\n },\n features: {\n isRegExpUnicodePropertySupported: /* #__PURE__ */ isRegExpUnicodePropertySupported()\n }\n};\n/**\n * Checks if User Agent represented by the string is running on Macintosh.\n *\n * @internal\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is running on Macintosh or not.\n */ 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 * @internal\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is running on Windows or not.\n */ 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 * @internal\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is Firefox or not.\n */ function isGecko(userAgent) {\n return !!userAgent.match(/gecko\\/\\d+/);\n}\n/**\n * Checks if User Agent represented by the string is Safari.\n *\n * @internal\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is Safari or not.\n */ 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 * @internal\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is running in iOS or not.\n */ 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 * @internal\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is Safari or not.\n */ 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 * @internal\n * @param userAgent **Lowercase** `navigator.userAgent` string.\n * @returns Whether User Agent is Blink engine or not.\n */ 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 *\n * @internal\n */ 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 } catch {\n // Firefox throws a SyntaxError when the group is unsupported.\n }\n return isSupported;\n}\n/**\n * Checks if the user agent has enabled a forced colors mode (e.g. Windows High Contrast mode).\n *\n * Returns `false` in environments where `window` global object is not available.\n *\n * @internal\n */ function isMediaForcedColors() {\n return globalVar.window.matchMedia ? globalVar.window.matchMedia('(forced-colors: active)').matches : false;\n}\n/**\n * Checks if the user enabled \"prefers reduced motion\" setting in browser.\n *\n * Returns `false` in environments where `window` global object is not available.\n *\n * @internal\n */ function isMotionReduced() {\n return globalVar.window.matchMedia ? globalVar.window.matchMedia('(prefers-reduced-motion)').matches : false;\n}\n\n/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/fastdiff\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 */ 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 ? changeIndexesToAtomicChanges(changeIndexes, arrayB.length) : 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 */ function 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 {\n firstIndex: -1,\n lastIndexOld: -1,\n lastIndexNew: -1\n };\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 {\n firstIndex,\n lastIndexOld,\n lastIndexNew\n };\n}\n/**\n * Returns a first index on which given arrays differ. If both arrays are the same, -1 is returned.\n */ function 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 */ function 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 */ function 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 */ function 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// 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 */ 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 } 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/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/difftochanges\n */ /**\n * Creates a set of changes which need to be applied to the input in order to transform\n * it into the output. This function can be used with strings or arrays.\n *\n * ```ts\n * const input = Array.from( 'abc' );\n * const output = Array.from( 'xaby' );\n * const changes = diffToChanges( diff( input, output ), output );\n *\n * changes.forEach( change => {\n * \tif ( change.type == 'insert' ) {\n * \t\tinput.splice( change.index, 0, ...change.values );\n * \t} else if ( change.type == 'delete' ) {\n * \t\tinput.splice( change.index, change.howMany );\n * \t}\n * } );\n *\n * input.join( '' ) == output.join( '' ); // -> true\n * ```\n *\n * @typeParam T The type of output array element.\n * @param diff Result of {@link module:utils/diff~diff}.\n * @param output The string or array which was passed as diff's output.\n * @returns Set of changes (insert or delete) which need to be applied to the input\n * in order to transform it into the output.\n */ function diffToChanges(diff, output) {\n const changes = [];\n let index = 0;\n let lastOperation = null;\n diff.forEach((change)=>{\n if (change == 'equal') {\n pushLast();\n index++;\n } else if (change == 'insert') {\n if (lastOperation && lastOperation.type == 'insert') {\n lastOperation.values.push(output[index]);\n } else {\n pushLast();\n lastOperation = {\n type: 'insert',\n index,\n values: [\n output[index]\n ]\n };\n }\n index++;\n } else /* if ( change == 'delete' ) */ {\n if (lastOperation && lastOperation.type == 'delete') {\n lastOperation.howMany++;\n } else {\n pushLast();\n lastOperation = {\n type: 'delete',\n index,\n howMany: 1\n };\n }\n }\n });\n pushLast();\n return changes;\n function pushLast() {\n if (lastOperation) {\n changes.push(lastOperation);\n lastOperation = null;\n }\n }\n}\n\n/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/areconnectedthroughproperties\n */ /**\n * Traverses both structures to find out whether there is a reference that is shared between both structures.\n */ function areConnectedThroughProperties(obj1, obj2) {\n if (obj1 === obj2 && isObject(obj1)) {\n return true;\n }\n const subNodes1 = getSubNodes(obj1);\n const subNodes2 = getSubNodes(obj2);\n for (const node of subNodes1){\n if (subNodes2.has(node)) {\n return true;\n }\n }\n return false;\n}\n/**\n * Traverses JS structure and stores all sub-nodes, including the head node.\n * It walks into each iterable structures with the `try catch` block to omit errors that might be thrown during\n * tree walking. All primitives, functions and built-ins are skipped.\n */ function getSubNodes(head) {\n const nodes = [\n head\n ];\n // Nodes are stored to prevent infinite looping.\n const subNodes = new Set();\n while(nodes.length > 0){\n const node = nodes.shift();\n if (subNodes.has(node) || shouldNodeBeSkipped(node)) {\n continue;\n }\n subNodes.add(node);\n // Handle arrays, maps, sets, custom collections that implements `[ Symbol.iterator ]()`, etc.\n if (node[Symbol.iterator]) {\n // The custom editor iterators might cause some problems if the editor is crashed.\n try {\n nodes.push(...node);\n } // eslint-disable-next-line no-empty\n catch {}\n } else {\n nodes.push(...Object.values(node));\n }\n }\n return subNodes;\n}\nfunction shouldNodeBeSkipped(node) {\n const type = Object.prototype.toString.call(node);\n return type === '[object Number]' || type === '[object Boolean]' || type === '[object String]' || type === '[object Symbol]' || type === '[object Function]' || type === '[object Date]' || type === '[object RegExp]' || node === undefined || node === null || // Skip native DOM objects, e.g. Window, nodes, events, etc.\n node instanceof EventTarget || node instanceof Event;\n}\nfunction isObject(structure) {\n return typeof structure === 'object' && structure !== null;\n}\n\n/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/spy\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 */ function spy() {\n return function spy() {\n spy.called = true;\n };\n}\n\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 */ class EventInfo {\n /**\n\t * The object that fired the event.\n\t */ source;\n /**\n\t * The event name.\n\t */ name;\n /**\n\t * Path this event has followed. See {@link module:utils/emittermixin~Emitter#delegate}.\n\t */ path;\n /**\n\t * Stops the event emitter to call further callbacks for this event interaction.\n\t */ stop;\n /**\n\t * Removes the current callback from future interactions of this event.\n\t */ off;\n /**\n\t * The value which will be returned by {@link module:utils/emittermixin~Emitter#fire}.\n\t *\n\t * It's `undefined` by default and can be changed by an event listener:\n\t *\n\t * ```ts\n\t * dataController.fire( 'getSelectedContent', ( evt ) => {\n\t * \t// This listener will make `dataController.fire( 'getSelectedContent' )`\n\t * \t// always return an empty DocumentFragment.\n\t * \tevt.return = new DocumentFragment();\n\t *\n\t * \t// Make sure no other listeners are executed.\n\t * \tevt.stop();\n\t * } );\n\t * ```\n\t */ return;\n /**\n\t * @param source The emitter.\n\t * @param name The event name.\n\t */ 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/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/uid\n */ /**\n * A hash table of hex numbers to avoid using toString() in uid() which is costly.\n * [ '00', '01', '02', ..., 'fe', 'ff' ]\n */ const HEX_NUMBERS = new Array(256).fill('').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 */ function uid() {\n // Let's create some positive random 32bit integers first.\n const [r1, r2, r3, r4] = crypto.getRandomValues(new Uint32Array(4));\n // Make sure that id does not start with number.\n return 'e' + HEX_NUMBERS[r1 >> 0 & 0xFF] + HEX_NUMBERS[r1 >> 8 & 0xFF] + HEX_NUMBERS[r1 >> 16 & 0xFF] + HEX_NUMBERS[r1 >> 24 & 0xFF] + HEX_NUMBERS[r2 >> 0 & 0xFF] + HEX_NUMBERS[r2 >> 8 & 0xFF] + HEX_NUMBERS[r2 >> 16 & 0xFF] + HEX_NUMBERS[r2 >> 24 & 0xFF] + HEX_NUMBERS[r3 >> 0 & 0xFF] + HEX_NUMBERS[r3 >> 8 & 0xFF] + HEX_NUMBERS[r3 >> 16 & 0xFF] + HEX_NUMBERS[r3 >> 24 & 0xFF] + HEX_NUMBERS[r4 >> 0 & 0xFF] + HEX_NUMBERS[r4 >> 8 & 0xFF] + HEX_NUMBERS[r4 >> 16 & 0xFF] + HEX_NUMBERS[r4 >> 24 & 0xFF];\n}\n\n/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/priorities\n */ /**\n * String representing a priority value.\n */ /**\n * Provides group of constants to use instead of hardcoding numeric priority values.\n */ const priorities = {\n get (priority = 'normal') {\n if (typeof priority != 'number') {\n return this[priority] || this.normal;\n } else {\n return priority;\n }\n },\n highest: 100000,\n high: 1000,\n normal: 0,\n low: -1e3,\n lowest: -1e5\n};\n\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 */ function insertToPriorityArray(objects, objectToInsert) {\n const priority = priorities.get(objectToInsert.priority);\n // Binary search for better performance in large tables.\n let left = 0;\n let right = objects.length;\n while(left < right){\n const mid = left + right >> 1; // Use bitwise operator for faster floor division by 2.\n const midPriority = priorities.get(objects[mid].priority);\n if (midPriority < priority) {\n right = mid;\n } else {\n left = mid + 1;\n }\n }\n objects.splice(left, 0, objectToInsert);\n}\n\n/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/ckeditorerror\n */ /**\n * URL to the documentation with error codes.\n */ 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 */ class CKEditorError extends Error {\n /**\n\t * A context of the error by which the Watchdog is able to determine which editor crashed.\n\t */ context;\n /**\n\t * The additional error data passed to the constructor. Undefined if none was passed.\n\t */ data;\n /**\n\t * Creates an instance of the CKEditorError class.\n\t *\n\t * @param errorName The error id in an `error-name` format. A link to this error documentation page will be added\n\t * to the thrown error's `message`.\n\t * @param context A context of the error by which the {@link module:watchdog/watchdog~Watchdog watchdog}\n\t * is able to determine which editor crashed. It should be an editor instance or a property connected to it. It can be also\n\t * a `null` value if the editor should not be restarted in case of the error (e.g. during the editor initialization).\n\t * The error context should be checked using the `areConnectedThroughProperties( editor, context )` utility\n\t * to check if the object works as the context.\n\t * @param data Additional data describing the error. A stringified version of this object\n\t * will be appended to the error message, so the data are quickly visible in the console. The original\n\t * data object will also be later available under the {@link #data} property.\n\t * @param originalError An optional original error that is being wrapped in the `CKEditorError` instance.\n\t */ constructor(errorName, context, data, originalError){\n super(getErrorMessage(errorName, data, originalError));\n this.name = 'CKEditorError';\n this.context = context;\n this.data = data;\n // Wrapping an original error in a CKEditorError instance.\n if (originalError) {\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 this.stack = originalError.stack;\n }\n }\n /**\n\t * Checks if the error is of the `CKEditorError` type.\n\t */ is(type) {\n return type === 'CKEditorError';\n }\n /**\n\t * A utility that ensures that the thrown error is a {@link module:utils/ckeditorerror~CKEditorError} one.\n\t * It is useful when combined with the {@link module:watchdog/watchdog~Watchdog} feature, which can restart the editor in case\n\t * of a {@link module:utils/ckeditorerror~CKEditorError} error.\n\t *\n\t * @param error The error to rethrow.\n\t * @param context An object connected through properties with the editor instance. This context will be used\n\t * by the watchdog to verify which editor should be restarted.\n\t */ static rethrowUnexpectedError(error, context) {\n if (error.is && error.is('CKEditorError')) {\n throw error;\n }\n /**\n\t\t * An unexpected error occurred inside the CKEditor 5 codebase. This error will look like the original one\n\t\t * to make the debugging easier.\n\t\t *\n\t\t * This error is only useful when the editor is initialized using the {@link module:watchdog/watchdog~Watchdog} feature.\n\t\t * In case of such error (or any {@link module:utils/ckeditorerror~CKEditorError} error) the watchdog should restart the editor.\n\t\t *\n\t\t * @error unexpected-error\n\t\t */ throw new CKEditorError('unexpected-error', context, undefined, 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 */ 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 */ function logError(errorName, data) {\n console.error(...formatConsoleArguments(errorName, data));\n}\n/**\n * Returns formatted link to documentation message.\n */ function getLinkToDocumentationMessage(errorName) {\n return `\\nRead more: ${DOCUMENTATION_URL}#error-${errorName}`;\n}\n/**\n * Returns formatted error message.\n */ function getErrorMessage(errorName, data, originalError) {\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 const originalErrorMessage = originalError ? `\\nOriginal error: ${originalError.name}: ${originalError.message}` : '';\n return errorName + stringifiedData + documentationLink + originalErrorMessage;\n}\n/**\n * Returns formatted console error arguments.\n */ function formatConsoleArguments(errorName, data) {\n const documentationMessage = getLinkToDocumentationMessage(errorName);\n return data ? [\n errorName,\n data,\n documentationMessage\n ] : [\n errorName,\n documentationMessage\n ];\n}\n\nconst version = '47.3.0';\n// The second argument is not a month. It is `monthIndex` and starts from `0`.\nconst releaseDate = new Date(2025, 11, 3);\n/* istanbul ignore next -- @preserve */ if (globalThis.CKEDITOR_VERSION) {\n /**\n\t * This error is thrown when, due to a mistake in the way CKEditor 5 was installed,\n\t * imported, or initialized, some of its modules were evaluated and executed twice.\n\t * Duplicate modules inevitably lead to runtime errors and increased bundle size.\n\t *\n\t * # Check dependency versions\n\t *\n\t * First, make sure that you use the latest version of all CKEditor 5 dependencies.\n\t * Depending on the installation method, you should check the versions of the `ckeditor5`,\n\t * `ckeditor5-premium-features`, or `@ckeditor/ckeditor5-` packages. If you cannot update\n\t * to the latest version, ensure that all the CKEditor 5 packages are\n\t * in the same version.\n\t *\n\t * If you use third-party plugins, make sure to update them, too. If they are incompatible\n\t * with the version of CKEditor 5 you use, you may need to downgrade the CKEditor 5 packages\n\t * (which we do not recommend). Ask the plugin's author to upgrade the dependencies,\n\t * or fork their project and update it yourself.\n\t *\n\t * # Check imports\n\t *\n\t * The next step is to look at how you import CKEditor 5 into your project.\n\t *\n\t * **The {@glink updating/nim-migration/migration-to-new-installation-methods new installation methods}\n\t * are designed to prevent module duplication, so if you are not using them yet, you should consider\n\t * updating your project**. However, several legacy installation methods are still supported for backward\n\t * compatibility, and mixing them may result in module duplication.\n\t *\n\t * These are the most common import methods of the CKEditor 5 packages.\n\t *\n\t * - **New installation methods (NIM)** – Imports from the `ckeditor5` and `ckeditor5-premium-features` packages.\n\t * - **Optimized build** for the new installation methods – Imports from the `@ckeditor/ckeditor5-/dist/index.js`.\n\t * - **Predefined builds** (no longer supported) – Imports from the `@ckeditor/ckeditor5-build-` packages.\n\t * - **Default imports** (legacy) – Imports from the `@ckeditor/ckeditor5-` packages (default export).\n\t * - **`src`** (legacy) – Imports from the `@ckeditor/ckeditor5-/src/*`.\n\t * - **DLL builds** (legacy) – Imports from the `ckeditor5/build/` and `@ckeditor/ckeditor5-/build/*`.\n\t *\n\t * The best way to avoid duplicate modules is to avoid mixing these installation methods. For example, if you use imports\n\t * specific to the optimized build, you should use them for all CKEditor 5 packages. In addition, since\n\t * the DLL builds already include the core of the editor, they cannot be used with other types of imports.\n\t *\n\t * Here is a matrix showing which installation methods are compatible with each other:\n\t *\n\t * | | NIM | Optimized build | Predefined builds | Default imports | `src` | DLL builds |\n\t * |------------------|-----|-----------------|-------------------|-----------------|-------|------------|\n\t * | NIM | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |\n\t * | Optimized builds | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |\n\t * | Predefined build | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ |\n\t * | Default imports | ❌ | ❌ | ❌ | ✅ | ✅ | ❌ |\n\t * | `src` | ❌ | ❌ | ❌ | ✅ | ✅ | ❌ |\n\t * | DLL builds | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |\n\t *\n\t * If you use any third-party plugins, make sure the way you import them is compatible with\n\t * the way you import CKEditor 5.\n\t *\n\t *
\n\t * New installation methods and optimized builds\n\t *\n\t * If you use the {@glink updating/nim-migration/migration-to-new-installation-methods new installation methods},\n\t * you should only import { code } from the `ckeditor5` and `ckeditor5-premium-features` packages.\n\t * Do not import { code } from the `@ckeditor/ckeditor5-` packages unless you follow\n\t * the {@glink getting-started/setup/optimizing-build-size Optimizing build size} guide and the imports from\n\t * the `@ckeditor/ckeditor5-` packages end with `/dist/index.js`.\n\t *\n\t * If you use a CDN, ensure that some files are not included twice in your project.\n\t *\n\t * Examples of valid and invalid import paths:\n\t *\n\t * ```js\n\t * import { ClassicEditor, Highlight } from 'ckeditor5'; // ✅\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight/dist/index.js'; // ✅\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight/src/highlight.js'; // ❌\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight'; // ❌\n\t * import '@ckeditor/ckeditor5-highlight/build/highlight.js'; // ❌\n\t * ```\n\t *
\n\t *\n\t *
\n\t * (Deprecated) Predefined builds\n\t *\n\t * **As of April, 2025 predefined build are no longer supported. Please refer to the\n\t * {@glink getting-started/index Quick Start} guide\n\t * to choose one of the modern installation and integration methods available**.\n\t *\n\t * If you use the predefined builds, you cannot import any additional plugins.\n\t * These builds already include the editor's core and selected plugins and importing additional\n\t * ones will cause some modules to be bundled and loaded twice.\n\t *\n\t * Examples of valid and invalid import paths:\n\t *\n\t * ```js\n\t * import { ClassicEditor } from '@ckeditor/ckeditor5-build-classic'; // ✅\n\t * import { Highlight } from 'ckeditor5'; // ❌\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight/dist/index.js'; // ❌\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight'; // ❌\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight/src/highlight'; // ❌\n\t * import '@ckeditor/ckeditor5-highlight/build/highlight'; // ❌\n\t * ```\n\t *\n\t * If you are missing some features from the list of plugins, you should switch to the\n\t * {@glink updating/nim-migration/migration-to-new-installation-methods new installation methods}\n\t * which do not have this limitation.\n\t *
\n\t *\n\t *
\n\t * (Legacy) Default imports and `src` imports\n\t *\n\t * If you use the {@glink getting-started/legacy/installation-methods/quick-start-other legacy customized installation}\n\t * method, you should only import { code from the `@ckeditor/ckeditor5-` packages. While you can import code } from\n\t * the `@ckeditor/ckeditor5-/src/*` files, it is not recommended as it can make migration to the new installation\n\t * methods more difficult.\n\t *\n\t * If you use this installation method, you should not import { code } from the `ckeditor5` or `ckeditor5-premium-features` packages.\n\t *\n\t * Examples of valid and invalid import paths:\n\t *\n\t * ```js\n\t * import { ClassicEditor } from '@ckeditor/ckeditor5-editor-classic'; // ✅\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight'; // ✅\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight/src/highlight.js'; // ✅ (not recommended)\n\t * import { Highlight } from 'ckeditor5'; // ❌\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight/dist/index.js'; // ❌\n\t * import '@ckeditor/ckeditor5-highlight/build/highlight'; // ❌\n\t * ```\n\t *
\n\t *\n\t *
\n\t * (Legacy) DLL builds\n\t *\n\t * If you are using the {@glink getting-started/legacy/advanced/alternative-setups/dll-builds legacy DLL builds},\n\t * you should not import any non-DLL modules.\n\t *\n\t * Examples of valid and invalid import paths:\n\t *\n\t * ```js\n\t * import 'ckeditor5/build/ckeditor5-dll.js';// ✅\n\t * import '@ckeditor/ckeditor5-editor-classic/build/editor-classic.js';// ✅\n\t * import '@ckeditor/ckeditor5-highlight/build/highlight.js';// ✅\n\t * import { Highlight } from 'ckeditor5'; // ❌\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight/dist/index.js'; // ❌\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight'; // ❌\n\t * import { Highlight } from '@ckeditor/ckeditor5-highlight/src/highlight.js'; // ❌\n\t * ```\n\t *
\n\t *\n\t * # Reinstall `node_modules`\n\t *\n\t * Usually, npm and other package managers deduplicate all packages - for example, `ckeditor5` is only installed once\n\t * in `node_modules/`. However, it is known to fail to do so occasionally.\n\t *\n\t * To rule out this possibility, you can try the following:\n\t *\n\t * 1. Remove the `node_modules` directory.\n\t * 2. Remove the `package-lock.json`, `yarn.lock`, or `pnpm-lock.yaml` files (depending on the package manager used).\n\t * 3. Run `npm install` to reinstall all packages.\n\t * 4. Run `npm ls` to check how many times packages like `@ckeditor/ckeditor5-core` are installed.\n\t * If they are installed more than once, verify which package causes that.\n\t *\n\t * @error ckeditor-duplicated-modules\n\t */ throw new CKEditorError('ckeditor-duplicated-modules', null);\n} else {\n globalThis.CKEDITOR_VERSION = version;\n}\n\nconst _listeningTo = Symbol('listeningTo');\nconst _emitterId = Symbol('emitterId');\nconst _delegations = Symbol('delegations');\nconst defaultEmitterClass$1 = /* #__PURE__ */ EmitterMixin(Object);\nfunction EmitterMixin(base) {\n if (!base) {\n return defaultEmitterClass$1;\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 } else {\n removeEventListener(this, emitter, event, callback);\n }\n }\n } else if (eventCallbacks) {\n while(callback = eventCallbacks.pop()){\n removeEventListener(this, emitter, event, callback);\n }\n delete emitterInfo.callbacks[event];\n } else if (emitterInfo) {\n for(event in emitterInfo.callbacks){\n this.stopListening(emitter, event);\n }\n delete emitters[emitterId];\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 // 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 = callbacks.slice();\n for(let i = 0; i < callbacks.length; i++){\n const fn = callbacks[i].callback;\n fn.call(this, eventInfo, ...args);\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, fn);\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 } catch (err) {\n // @if CK_DEBUG // throw err;\n /* istanbul ignore next -- @preserve */ 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([\n [\n emitter,\n nameOrFunction\n ]\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 } else if (!emitter) {\n this[_delegations].delete(event);\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/**\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 */ 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 */ 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 */ 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 */ function 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 */ function 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 */ function 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 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 */ function getCallbacksListsForNamespace(source, eventName) {\n const eventNode = getEvents(source)[eventName];\n if (!eventNode) {\n return [];\n }\n let callbacksLists = [\n eventNode.callbacks\n ];\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 */ function getCallbacksForEvent(source, eventName) {\n if (!source._events) {\n return null;\n }\n let currentEventName = eventName;\n do {\n const event = source._events[currentEventName];\n if (event && event.callbacks && event.callbacks.length) {\n return event.callbacks;\n }\n const colonIndex = currentEventName.lastIndexOf(':');\n currentEventName = colonIndex > -1 ? currentEventName.substring(0, colonIndex) : '';\n }while (currentEventName)\n return null;\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 */ function fireDelegatedEvents(destinations, eventInfo, fireArgs) {\n for (let [emitter, name] of destinations){\n if (!name) {\n name = eventInfo.name;\n } else if (typeof name == 'function') {\n name = name(eventInfo.name);\n }\n const delegatedInfo = new EventInfo(eventInfo.source, name);\n delegatedInfo.path = [\n ...eventInfo.path\n ];\n emitter.fire(delegatedInfo, ...fireArgs);\n }\n}\n/**\n * Helper for registering event callback on the emitter.\n */ function addEventListener(listener, emitter, event, callback, options) {\n if (emitter._addEventListener) {\n emitter._addEventListener(event, callback, options);\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 */ function removeEventListener(listener, emitter, event, callback) {\n if (emitter._removeEventListener) {\n emitter._removeEventListener(event, callback);\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\nconst observablePropertiesSymbol = Symbol('observableProperties');\nconst boundObservablesSymbol = Symbol('boundObservables');\nconst boundPropertiesSymbol = Symbol('boundProperties');\nconst decoratedMethods = Symbol('decoratedMethods');\nconst decoratedOriginal = Symbol('decoratedOriginal');\nconst defaultObservableClass = /* #__PURE__ */ ObservableMixin(/* #__PURE__ */ EmitterMixin());\nfunction 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$1(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\t\t\t\t * Cannot override an existing property.\n\t\t\t\t *\n\t\t\t\t * This error is thrown when trying to {@link module:utils/observablemixin~Observable#set set} a property with\n\t\t\t\t * a name of an already existing property. For example:\n\t\t\t\t *\n\t\t\t\t * ```ts\n\t\t\t\t * let observable = new Model();\n\t\t\t\t * observable.property = 1;\n\t\t\t\t * observable.set( 'property', 2 );\t\t\t// throws\n\t\t\t\t *\n\t\t\t\t * observable.set( 'property', 1 );\n\t\t\t\t * observable.set( 'property', 2 );\t\t\t// ok, because this is an existing property.\n\t\t\t\t * ```\n\t\t\t\t *\n\t\t\t\t * @error observable-set-cannot-override\n\t\t\t\t */ 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\t\t\t\t * All properties must be strings.\n\t\t\t\t *\n\t\t\t\t * @error observable-bind-wrong-properties\n\t\t\t\t */ throw new CKEditorError('observable-bind-wrong-properties', this);\n }\n if (new Set(bindProperties).size !== bindProperties.length) {\n /**\n\t\t\t\t * Properties must be unique.\n\t\t\t\t *\n\t\t\t\t * @error observable-bind-duplicate-properties\n\t\t\t\t */ 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\t\t\t\t\t * Cannot bind the same property more than once.\n\t\t\t\t\t *\n\t\t\t\t\t * @error observable-bind-rebind\n\t\t\t\t\t */ throw new CKEditorError('observable-bind-rebind', this);\n }\n });\n const bindings = new Map();\n bindProperties.forEach((a)=>{\n const binding = {\n property: a,\n to: []\n };\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\t\t\t\t\t * Properties must be strings.\n\t\t\t\t\t *\n\t\t\t\t\t * @error observable-unbind-wrong-properties\n\t\t\t\t\t */ 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 } 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\t\t\t\t * Cannot decorate an undefined method.\n\t\t\t\t *\n\t\t\t\t * @error observablemixin-cannot-decorate-undefined\n\t\t\t\t * @param {object} object The object which method should be decorated.\n\t\t\t\t * @param {string} methodName Name of the method which does not exist.\n\t\t\t\t */ throw new CKEditorError('observablemixin-cannot-decorate-undefined', this, {\n object: this,\n methodName\n });\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 [observablePropertiesSymbol];\n [decoratedMethods];\n [boundPropertiesSymbol];\n [boundObservablesSymbol];\n }\n return Mixin;\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 */ function 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\t\t * Binding multiple observables only possible with callback.\n\t\t *\n\t\t * @error observable-bind-to-no-callback\n\t\t */ 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\t\t * Cannot bind multiple properties and use a callback in one binding.\n\t\t *\n\t\t * @error observable-bind-to-extra-callback\n\t\t */ 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\t\t\t * The number of properties must match.\n\t\t\t *\n\t\t\t * @error observable-bind-to-properties-length\n\t\t\t */ 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 */ function bindToMany(observables, attribute, callback) {\n if (this._bindings.size > 1) {\n /**\n\t\t * Binding one attribute to many observables only possible with one attribute.\n\t\t *\n\t\t * @error observable-bind-to-many-not-one-binding\n\t\t */ throw new CKEditorError('observable-bind-to-many-not-one-binding', this);\n }\n this.to(// Bind to #attribute of each observable...\n ...getBindingTargets(observables, attribute), // ...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 */ function getBindingTargets(observables, attribute) {\n const observableAndAttributePairs = observables.map((observable)=>[\n observable,\n attribute\n ]);\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 */ function 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 */ function parseBindToArgs(...args) {\n // Eliminate A.bind( 'x' ).to()\n if (!args.length) {\n /**\n\t\t * Invalid argument syntax in `to()`.\n\t\t *\n\t\t * @error observable-bind-to-parse-error\n\t\t */ throw new CKEditorError('observable-bind-to-parse-error', null);\n }\n const parsed = {\n to: []\n };\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 } else if (typeof a == 'object') {\n lastObservable = {\n observable: a,\n properties: []\n };\n parsed.to.push(lastObservable);\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 */ function 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 */ function 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([\n to.observable,\n toProperty\n ]);\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 */ function 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 } 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 } 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 */ function 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/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/elementreplacer\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 */ class ElementReplacer {\n /**\n\t * The elements replaced by {@link #replace} and their replacements.\n\t */ _replacedElements;\n constructor(){\n this._replacedElements = [];\n }\n /**\n\t * Hides the `element` and, if specified, inserts the the given element next to it.\n\t *\n\t * The effect of this method can be reverted by {@link #restore}.\n\t *\n\t * @param element The element to replace.\n\t * @param newElement The replacement element. If not passed, then the `element` will just be hidden.\n\t */ replace(element, newElement) {\n this._replacedElements.push({\n element,\n newElement\n });\n element.style.display = 'none';\n if (newElement) {\n element.parentNode.insertBefore(newElement, element.nextSibling);\n }\n }\n /**\n\t * Restores what {@link #replace} did.\n\t */ 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/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/abortabledebounce\n */ /**\n * Returns a function wrapper that will execute the provided function and abort any previous call that is still in progress.\n *\n * @param func The function to be called. It will be provided with `AbortSignal` as the first parameter.\n */ function abortableDebounce(func) {\n let controller = new AbortController();\n function abortable(...args) {\n controller.abort();\n controller = new AbortController();\n return func(controller.signal, ...args);\n }\n abortable.abort = ()=>controller.abort();\n return abortable;\n}\n\n/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/count\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 */ function count(iterable) {\n let count = 0;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n for (const _ of iterable){\n count++;\n }\n return count;\n}\n\n/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/comparearrays\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 */ 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 } else if (a.length < b.length) {\n // Compared array is shorter so it is a prefix of the other array.\n return 'prefix';\n } else {\n // Compared array is longer so it is an extension of the other array.\n return 'extension';\n }\n}\n\n/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/isiterable\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 */ function isIterable(value) {\n return !!(value && value[Symbol.iterator]);\n}\n\n/**\n * Creates an HTML or SVG element with attributes and children elements.\n *\n * ```ts\n * createElement( document, 'p' ); //

\n * createElement( document, 'mask', { xmlns: 'http://www.w3.org/2000/svg' } ); // \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 */ 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 = [\n children\n ];\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/**\n * Handles a configuration dictionary.\n *\n * @typeParam Cfg A type of the configuration dictionary.\n */ class Config {\n /**\n\t * Store for the whole configuration.\n\t */ _config;\n /**\n\t * Creates an instance of the {@link ~Config} class.\n\t *\n\t * @param configurations The initial configurations to be set. Usually, provided by the user.\n\t * @param defaultConfigurations The default configurations. Usually, provided by the system.\n\t */ constructor(configurations, defaultConfigurations){\n this._config = Object.create(null);\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\t * Gets the value for a configuration entry.\n\t *\n\t * ```ts\n\t * config.get( 'name' );\n\t * ```\n\t *\n\t * Deep configurations can be retrieved by separating each part with a dot.\n\t *\n\t * ```ts\n\t * config.get( 'toolbar.collapsed' );\n\t * ```\n\t *\n\t * @param name The configuration name. Configuration names are case-sensitive.\n\t * @returns The configuration value or `undefined` if the configuration entry was not found.\n\t */ get(name) {\n return this._getFromSource(this._config, name);\n }\n /**\n\t * Iterates over all top level configuration names.\n\t */ *names() {\n for (const name of Object.keys(this._config)){\n yield name;\n }\n }\n /**\n\t * Saves passed configuration to the specified target (nested object).\n\t *\n\t * @param target Nested config object.\n\t * @param name The configuration name or an object from which take properties as\n\t * configuration entries. Configuration names are case-sensitive.\n\t * @param value The configuration value. Used if a name is passed.\n\t * @param isDefine Define if passed configuration should overwrite existing one.\n\t */ _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] = Object.create(null);\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] = Object.create(null);\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\t * Get specified configuration from specified source (nested object).\n\t *\n\t * @param source level of nested object.\n\t * @param name The configuration name. Configuration names are case-sensitive.\n\t * @returns The configuration value or `undefined` if the configuration entry was not found.\n\t */ _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\t * Iterates through passed object and calls {@link #_setToTarget} method with object key and value for each property.\n\t *\n\t * @param target Nested config object.\n\t * @param configuration Configuration data set\n\t * @param isDefine Defines if passed configuration is default configuration or not.\n\t */ _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 */ function cloneConfig(source) {\n return cloneDeepWith(source, leaveItemReferences);\n}\n/**\n * A customized function for cloneDeepWith.\n * In case if it's a DOM Element it will leave references to DOM Elements instead of cloning them.\n * If it's a function it will leave reference to actuall function.\n */ function leaveItemReferences(value) {\n return isElement$1(value) || typeof value === 'function' ? value : undefined;\n}\n\n/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/isnode\n */ /**\n * Checks if the object is a native DOM Node.\n */ function isNode(obj) {\n if (obj) {\n if (obj.defaultView) {\n return obj instanceof obj.defaultView.Document;\n } else if (obj.ownerDocument && obj.ownerDocument.defaultView) {\n return obj instanceof obj.ownerDocument.defaultView.Node;\n }\n }\n return false;\n}\n\n/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/iswindow\n */ /**\n * Checks if the object is a native DOM Window.\n */ 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\nconst defaultEmitterClass = /* #__PURE__ */ DomEmitterMixin(/* #__PURE__ */ EmitterMixin());\nfunction 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) || emitter instanceof globalVar.window.EventTarget) {\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 } 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) || emitter instanceof globalVar.window.EventTarget) {\n const proxyEmitters = this._getAllProxyEmitters(emitter);\n for (const proxy of proxyEmitters){\n this.stopListening(proxy, event, callback);\n }\n } else {\n // Execute parent class method with Emitter (or ProxyEmitter) instance.\n super.stopListening(emitter, event, callback);\n }\n }\n /**\n\t\t * Retrieves ProxyEmitter instance for given DOM Node residing in this Host and given options.\n\t\t *\n\t\t * @param node DOM Node of the ProxyEmitter.\n\t\t * @param options Additional options.\n\t\t * @param options.useCapture Indicates that events of this type will be dispatched to the registered\n\t\t * listener before being dispatched to any EventTarget beneath it in the DOM tree.\n\t\t * @param options.usePassive Indicates that the function specified by listener will never call preventDefault()\n\t\t * and prevents blocking browser's main thread by this event handler.\n\t\t * @returns ProxyEmitter instance bound to the DOM Node.\n\t\t */ _getProxyEmitter(node, options) {\n return _getEmitterListenedTo(this, getProxyEmitterId(node, options));\n }\n /**\n\t\t * Retrieves all the ProxyEmitter instances for given DOM Node residing in this Host.\n\t\t *\n\t\t * @param node DOM Node of the ProxyEmitter.\n\t\t */ _getAllProxyEmitters(node) {\n return [\n {\n capture: false,\n passive: false\n },\n {\n capture: false,\n passive: true\n },\n {\n capture: true,\n passive: false\n },\n {\n capture: true,\n passive: true\n }\n ].map((options)=>this._getProxyEmitter(node, options)).filter((proxy)=>!!proxy);\n }\n }\n return Mixin;\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 */ class ProxyEmitter extends /* #__PURE__ */ EmitterMixin() {\n _domNode;\n _options;\n /**\n\t * @param node DOM Node that fires events.\n\t * @param options Additional options.\n\t * @param options.useCapture Indicates that events of this type will be dispatched to the registered\n\t * listener before being dispatched to any EventTarget beneath it in the DOM tree.\n\t * @param options.usePassive Indicates that the function specified by listener will never call preventDefault()\n\t * and prevents blocking browser's main thread by this event handler.\n\t */ 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\t * Collection of native DOM listeners.\n\t */ _domListeners;\n /**\n\t * Registers a callback function to be executed when an event is fired.\n\t *\n\t * It attaches a native DOM listener to the DOM Node. When fired,\n\t * a corresponding Emitter event will also fire with DOM Event object as an argument.\n\t *\n\t * **Note**: This is automatically called by the\n\t * {@link module:utils/emittermixin~Emitter#listenTo `Emitter#listenTo()`}.\n\t *\n\t * @param event The name of the event.\n\t */ 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\t * Stops executing the callback on the given event.\n\t *\n\t * **Note**: This is automatically called by the\n\t * {@link module:utils/emittermixin~Emitter#stopListening `Emitter#stopListening()`}.\n\t *\n\t * @param event The name of the event.\n\t */ 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\t * Adds callback to emitter for given event.\n\t *\n\t * @internal\n\t * @param event The name of the event.\n\t * @param callback The function to be called on event.\n\t * @param options Additional options.\n\t */ _addEventListener(event, callback, options) {\n this.attach(event);\n EmitterMixin().prototype._addEventListener.call(this, event, callback, options);\n }\n /**\n\t * Removes callback from emitter for given event.\n\t *\n\t * @internal\n\t * @param event The name of the event.\n\t * @param callback The function to stop being called.\n\t */ _removeEventListener(event, callback) {\n EmitterMixin().prototype._removeEventListener.call(this, event, callback);\n this.detach(event);\n }\n /**\n\t * Creates a native DOM listener callback. When the native DOM event\n\t * is fired it will fire corresponding event on this ProxyEmitter.\n\t * Note: A native DOM Event is passed as an argument.\n\t *\n\t * @param event The name of the event.\n\t * @returns The DOM listener callback.\n\t */ _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 */ function 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 */ function 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/**\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 */ 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 || globalVar.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/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/getancestors\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 */ 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/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/getdatafromelement\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 */ function getDataFromElement(el) {\n if (el instanceof HTMLTextAreaElement) {\n return el.value;\n }\n return el.innerHTML;\n}\n\n/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/getborderwidths\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 */ 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/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/getrangefrommouseevent\n */ /**\n * Returns a DOM range from a given point specified by a mouse event.\n *\n * @param domEvent The mouse event.\n * @returns The DOM range.\n */ function getRangeFromMouseEvent(domEvent) {\n if (!domEvent.target) {\n return null;\n }\n const domDoc = domEvent.target.ownerDocument;\n const x = domEvent.clientX;\n const y = domEvent.clientY;\n let domRange = null;\n // Webkit & Blink.\n if (domDoc.caretRangeFromPoint && domDoc.caretRangeFromPoint(x, y)) {\n domRange = domDoc.caretRangeFromPoint(x, y);\n } else if (domEvent.rangeParent) {\n domRange = domDoc.createRange();\n domRange.setStart(domEvent.rangeParent, domEvent.rangeOffset);\n domRange.collapse(true);\n }\n return domRange;\n}\n\n/**\n * Searches and returns the lowest common ancestor of two given nodes.\n *\n * @param nodeA First node.\n * @param nodeB Second node.\n * @returns Lowest common ancestor of both nodes or `null` if nodes do not have a common ancestor.\n */ function getCommonAncestor(nodeA, nodeB) {\n const ancestorsA = getAncestors(nodeA);\n const ancestorsB = getAncestors(nodeB);\n let i = 0;\n // It does not matter which array is shorter.\n while(ancestorsA[i] == ancestorsB[i] && ancestorsA[i]){\n i++;\n }\n return i === 0 ? null : ancestorsA[i - 1];\n}\n\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 */ function getPositionedAncestor(element) {\n if (!element || !element.parentNode) {\n return null;\n }\n if (element.offsetParent === globalVar.document.body) {\n return null;\n }\n return element.offsetParent;\n}\n\n/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/istext\n */ /**\n * Checks if the object is a native DOM Text node.\n */ function isText(obj) {\n return Object.prototype.toString.call(obj) == '[object Text]';\n}\n\n/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/isrange\n */ /**\n * Checks if the object is a native DOM Range.\n */ function isRange(obj) {\n return Object.prototype.toString.apply(obj) == '[object Range]';\n}\n\nconst rectProperties = [\n 'top',\n 'right',\n 'bottom',\n 'left',\n 'width',\n 'height'\n];\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 */ class Rect {\n /**\n\t * The \"top\" value of the rect.\n\t *\n\t * @readonly\n\t */ top;\n /**\n\t * The \"right\" value of the rect.\n\t *\n\t * @readonly\n\t */ right;\n /**\n\t * The \"bottom\" value of the rect.\n\t *\n\t * @readonly\n\t */ bottom;\n /**\n\t * The \"left\" value of the rect.\n\t *\n\t * @readonly\n\t */ left;\n /**\n\t * The \"width\" value of the rect.\n\t *\n\t * @readonly\n\t */ width;\n /**\n\t * The \"height\" value of the rect.\n\t *\n\t * @readonly\n\t */ height;\n /**\n\t * The object this rect is for.\n\t *\n\t * @readonly\n\t */ _source;\n /**\n\t * Creates an instance of rect.\n\t *\n\t * ```ts\n\t * // Rect of an HTMLElement.\n\t * const rectA = new Rect( document.body );\n\t *\n\t * // Rect of a DOM Range.\n\t * const rectB = new Rect( document.getSelection().getRangeAt( 0 ) );\n\t *\n\t * // Rect of a window (web browser viewport).\n\t * const rectC = new Rect( window );\n\t *\n\t * // Rect out of an object.\n\t * const rectD = new Rect( { top: 0, right: 10, bottom: 10, left: 0, width: 10, height: 10 } );\n\t *\n\t * // Rect out of another Rect instance.\n\t * const rectE = new Rect( rectD );\n\t *\n\t * // Rect out of a ClientRect.\n\t * const rectF = new Rect( document.body.getClientRects().item( 0 ) );\n\t * ```\n\t *\n\t * **Note**: By default a rect of an HTML element includes its CSS borders and scrollbars (if any)\n\t * ant the rect of a `window` includes scrollbars too. Use {@link #excludeScrollbarsAndBorders}\n\t * to get the inner part of the rect.\n\t *\n\t * @param source A source object to create the rect.\n\t */ 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 } else {\n copyRectProperties(this, source.getBoundingClientRect());\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 } else {\n copyRectProperties(this, source);\n }\n }\n /**\n\t * Returns a clone of the rect.\n\t *\n\t * @returns A cloned rect.\n\t */ clone() {\n return new Rect(this);\n }\n /**\n\t * Moves the rect so that its upper–left corner lands in desired `[ x, y ]` location.\n\t *\n\t * @param x Desired horizontal location.\n\t * @param y Desired vertical location.\n\t * @returns A rect which has been moved.\n\t */ 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\t * Moves the rect in–place by a dedicated offset.\n\t *\n\t * @param x A horizontal offset.\n\t * @param y A vertical offset\n\t * @returns A rect which has been moved.\n\t */ 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\t * Returns a new rect a a result of intersection with another rect.\n\t */ 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 } else {\n const newRect = new Rect(rect);\n newRect._source = this._source;\n return newRect;\n }\n }\n /**\n\t * Returns the area of intersection with another rect.\n\t *\n\t * @returns Area of intersection.\n\t */ getIntersectionArea(anotherRect) {\n const rect = this.getIntersection(anotherRect);\n if (rect) {\n return rect.getArea();\n } else {\n return 0;\n }\n }\n /**\n\t * Returns the area of the rect.\n\t */ getArea() {\n return this.width * this.height;\n }\n /**\n\t * Returns a new rect, a part of the original rect, which is actually visible to the user and is relative to the,`body`,\n\t * e.g. an original rect cropped by parent element rects which have `overflow` set in CSS\n\t * other than `\"visible\"`.\n\t *\n\t * If there's no such visible rect, which is when the rect is limited by one or many of\n\t * the ancestors, `null` is returned.\n\t *\n\t * **Note**: This method does not consider the boundaries of the viewport (window).\n\t * To get a rect cropped by all ancestors and the viewport, use an intersection such as:\n\t *\n\t * ```ts\n\t * const visibleInViewportRect = new Rect( window ).getIntersection( new Rect( source ).getVisible() );\n\t * ```\n\t *\n\t * @returns A visible rect instance or `null`, if there's none.\n\t */ getVisible() {\n const source = this._source;\n let visibleRect = this.clone();\n // There's no ancestor to crop with the overflow.\n if (isBody(source)) {\n return visibleRect;\n }\n let child = source;\n let parent = source.parentNode || source.commonAncestorContainer;\n let absolutelyPositionedChildElement;\n // Check the ancestors all the way up to the .\n while(parent && !isBody(parent)){\n const isParentOverflowVisible = getElementOverflow(parent) === 'visible';\n if (child instanceof HTMLElement && getElementPosition(child) === 'absolute') {\n absolutelyPositionedChildElement = child;\n }\n const parentElementPosition = getElementPosition(parent);\n // The child will be cropped only if it has `position: absolute` and the parent has `position: relative` + some overflow.\n // Otherwise there's no chance of visual clipping and the parent can be skipped\n // https://github.com/ckeditor/ckeditor5/issues/14107.\n //\n // condition: isParentOverflowVisible\n // \t\t+---------------------------+\n //\t\t| #parent\t\t\t\t\t|\n //\t\t| (overflow: visible)\t\t|\n //\t\t|\t\t\t\t+-----------+---------------+\n //\t\t|\t\t\t\t| child\t\t\t\t\t\t|\n //\t\t|\t\t\t\t+-----------+---------------+\n //\t\t+---------------------------+\n //\n // condition: absolutelyPositionedChildElement && parentElementPosition === 'relative' && isParentOverflowVisible\n // \t\t+---------------------------+\n //\t\t| parent\t\t\t\t\t|\n //\t\t| (position: relative;)\t\t|\n //\t\t| (overflow: visible;)\t\t|\n //\t\t|\t\t\t\t+-----------+---------------+\n //\t\t|\t\t\t\t| child \t\t\t\t\t|\n //\t\t|\t\t\t\t| (position: absolute;)\t\t|\n //\t\t|\t\t\t\t+-----------+---------------+\n //\t\t+---------------------------+\n //\n // condition: absolutelyPositionedChildElement && parentElementPosition !== 'relative'\n // \t\t+---------------------------+\n //\t\t| parent\t\t\t\t\t|\n //\t\t| (position: static;)\t\t|\n //\t\t|\t\t\t\t+-----------+---------------+\n //\t\t|\t\t\t\t| child \t\t\t\t\t|\n //\t\t|\t\t\t\t| (position: absolute;)\t\t|\n //\t\t|\t\t\t\t+-----------+---------------+\n //\t\t+---------------------------+\n if (isParentOverflowVisible || absolutelyPositionedChildElement && (parentElementPosition === 'relative' && isParentOverflowVisible || parentElementPosition !== 'relative')) {\n child = parent;\n parent = parent.parentNode;\n continue;\n }\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 } else {\n // There's no intersection, the rect is completely invisible.\n return null;\n }\n child = parent;\n parent = parent.parentNode;\n }\n return visibleRect;\n }\n /**\n\t * Checks if all property values ({@link #top}, {@link #left}, {@link #right},\n\t * {@link #bottom}, {@link #width} and {@link #height}) are the equal in both rect\n\t * instances.\n\t *\n\t * @param anotherRect A rect instance to compare with.\n\t * @returns `true` when Rects are equal. `false` otherwise.\n\t */ 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\t * Checks whether a rect fully contains another rect instance.\n\t *\n\t * @param anotherRect\n\t * @returns `true` if contains, `false` otherwise.\n\t */ contains(anotherRect) {\n const intersectRect = this.getIntersection(anotherRect);\n return !!(intersectRect && intersectRect.isEqual(anotherRect));\n }\n /**\n\t * Recalculates screen coordinates to coordinates relative to the positioned ancestor offset.\n\t */ toAbsoluteRect() {\n const { scrollX, scrollY } = globalVar.window;\n const absoluteRect = this.clone().moveBy(scrollX, scrollY);\n if (isDomElement(absoluteRect._source)) {\n const positionedAncestor = getPositionedAncestor(absoluteRect._source);\n if (positionedAncestor) {\n shiftRectToCompensatePositionedAncestor(absoluteRect, positionedAncestor);\n }\n }\n return absoluteRect;\n }\n /**\n\t * Excludes scrollbars and CSS borders from the rect.\n\t *\n\t * * Borders are removed when {@link #_source} is an HTML element.\n\t * * Scrollbars are excluded from HTML elements and the `window`.\n\t *\n\t * @returns A rect which has been updated.\n\t */ 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 } 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 } else {\n this.left += scrollBarWidth;\n }\n this.height -= scrollBarHeight;\n this.bottom -= scrollBarHeight;\n return this;\n }\n /**\n\t * Returns an array of rects of the given native DOM Range.\n\t *\n\t * @param range A native DOM range.\n\t * @returns DOM Range rects.\n\t */ 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 } 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\t * Returns a bounding rectangle that contains all the given `rects`.\n\t *\n\t * @param rects A list of rectangles that should be contained in the result rectangle.\n\t * @returns Bounding rectangle or `null` if no `rects` were given.\n\t */ 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 */ function copyRectProperties(rect, source) {\n for (const p of rectProperties){\n rect[p] = source[p];\n }\n}\n/**\n * Checks if provided object is a HTML element.\n */ function 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 */ function 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 * Returns the value of the `position` style of an `HTMLElement`.\n */ function getElementPosition(element) {\n return element instanceof HTMLElement ? element.ownerDocument.defaultView.getComputedStyle(element).position : 'static';\n}\n/**\n * Returns the value of the `overflow` style of an `HTMLElement` or a `Range`.\n */ function getElementOverflow(element) {\n return element instanceof HTMLElement ? element.ownerDocument.defaultView.getComputedStyle(element).overflow : 'visible';\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 real–life to position elements with `position: absolute`, which are scoped by any positioned\n * (and scrollable) ancestors.\n */ function shiftRectToCompensatePositionedAncestor(rect, positionedElementAncestor) {\n const ancestorPosition = 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/**\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 */ class ResizeObserver {\n /**\n\t * The element observed by this observer.\n\t */ _element;\n /**\n\t * The callback executed each time {@link #_element} is resized.\n\t */ _callback;\n /**\n\t * The single native observer instance shared across all {@link module:utils/dom/resizeobserver~ResizeObserver} instances.\n\t */ static _observerInstance = null;\n /**\n\t * A mapping of native DOM elements and their callbacks shared across all\n\t * {@link module:utils/dom/resizeobserver~ResizeObserver} instances.\n\t */ static _elementCallbacks = null;\n /**\n\t * Creates an instance of the `ResizeObserver` class.\n\t *\n\t * @param element A DOM element that is to be observed for resizing. Note that\n\t * the element must be visible (i.e. not detached from DOM) for the observer to work.\n\t * @param callback A function called when the observed element was resized. It passes\n\t * the [`ResizeObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry)\n\t * object with information about the resize event.\n\t */ 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\t * The element observed by this observer.\n\t */ get element() {\n return this._element;\n }\n /**\n\t * Destroys the observer which disables the `callback` passed to the {@link #constructor}.\n\t */ destroy() {\n ResizeObserver._deleteElementCallback(this._element, this._callback);\n }\n /**\n\t * Registers a new resize callback for the DOM element.\n\t */ 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\t * Removes a resize callback from the DOM element. If no callbacks are left\n\t * for the element, it removes the element from the native observer.\n\t */ 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\t * Returns are registered resize callbacks for the DOM element.\n\t */ static _getElementCallbacks(element) {\n if (!ResizeObserver._elementCallbacks) {\n return null;\n }\n return ResizeObserver._elementCallbacks.get(element);\n }\n /**\n\t * Creates the single native observer shared across all `ResizeObserver` instances.\n\t */ static _createObserver() {\n ResizeObserver._observerInstance = new globalVar.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/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/setdatainelement\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 */ function setDataInElement(el, data) {\n if (el instanceof HTMLTextAreaElement) {\n el.value = data;\n }\n el.innerHTML = data;\n}\n\n/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/tounit\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 */ function toUnit(unit) {\n return (value)=>value + unit;\n}\n\n/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/indexof\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 */ function indexOf(node) {\n let index = 0;\n while(node.previousSibling){\n node = node.previousSibling;\n index++;\n }\n return index;\n}\n\n/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/insertat\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 */ function insertAt(parentElement, index, nodeToInsert) {\n parentElement.insertBefore(nodeToInsert, parentElement.childNodes[index] || null);\n}\n\n/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/iscomment\n */ /**\n * Checks whether the object is a native DOM Comment node.\n */ function isComment(obj) {\n return obj && obj.nodeType === Node.COMMENT_NODE;\n}\n\n/**\n * Checks if the given attribute name is valid in terms of HTML.\n *\n * @param name Attribute name.\n */ function isValidAttributeName(name) {\n try {\n globalVar.document.createAttribute(name);\n } catch {\n return false;\n }\n return true;\n}\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 */ function isVisible(element) {\n if (!element) {\n return false;\n }\n if (isText(element)) {\n return isVisible(element.parentElement);\n }\n if (element.getClientRects) {\n return !!element.getClientRects().length;\n }\n return false;\n}\n\n// @if CK_DEBUG_POSITION // const {\n// @if CK_DEBUG_POSITION // \tdefault: RectDrawer,\n// @if CK_DEBUG_POSITION // \tdiagonalStylesBlack,\n// @if CK_DEBUG_POSITION // \tdiagonalStylesGreen,\n// @if CK_DEBUG_POSITION // \tdiagonalStylesRed\n// @if CK_DEBUG_POSITION // } = require( '@ckeditor/ckeditor5-utils/tests/_utils/rectdrawer' );\n// @if CK_DEBUG_POSITION // const TARGET_RECT_STYLE = {\n// @if CK_DEBUG_POSITION // \toutlineWidth: '2px', outlineStyle: 'dashed', outlineColor: 'blue', outlineOffset: '2px'\n// @if CK_DEBUG_POSITION // };\n// @if CK_DEBUG_POSITION // const VISIBLE_TARGET_RECT_STYLE = {\n// @if CK_DEBUG_POSITION //\t\t...diagonalStylesBlack,\n// @if CK_DEBUG_POSITION //\t\topacity: '1',\n// @if CK_DEBUG_POSITION //\t\tbackgroundColor: '#00000033',\n// @if CK_DEBUG_POSITION //\t\toutlineWidth: '2px'\n// @if CK_DEBUG_POSITION // };\n// @if CK_DEBUG_POSITION // const VIEWPORT_RECT_STYLE = {\n// @if CK_DEBUG_POSITION // \toutlineWidth: '2px',\n// @if CK_DEBUG_POSITION // \toutlineOffset: '-2px',\n// @if CK_DEBUG_POSITION // \toutlineStyle: 'solid',\n// @if CK_DEBUG_POSITION // \toutlineColor: 'red'\n// @if CK_DEBUG_POSITION // };\n// @if CK_DEBUG_POSITION // const VISIBLE_LIMITER_RECT_STYLE = {\n// @if CK_DEBUG_POSITION // \t...diagonalStylesGreen,\n// @if CK_DEBUG_POSITION // \toutlineWidth: '2px',\n// @if CK_DEBUG_POSITION // \toutlineOffset: '-2px'\n// @if CK_DEBUG_POSITION // };\n// @if CK_DEBUG_POSITION // const ELEMENT_RECT_STYLE = {\n// @if CK_DEBUG_POSITION // \toutlineWidth: '2px', outlineColor: 'orange', outlineOffset: '-2px'\n// @if CK_DEBUG_POSITION // };\n// @if CK_DEBUG_POSITION // const CHOSEN_POSITION_RECT_STYLE = {\n// @if CK_DEBUG_POSITION // \topacity: .5, outlineColor: 'magenta', backgroundColor: 'magenta'\n// @if CK_DEBUG_POSITION // };\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 * **Note**: If there are no position coordinates found that meet the requirements (arguments of this helper),\n * `null` is returned.\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 .\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 */ 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 constrainedViewportRect = getConstrainedViewportRect(viewportOffsetConfig);\n const elementRect = new Rect(element);\n const visibleTargetRect = getVisibleViewportIntersectionRect(target, constrainedViewportRect);\n let bestPosition;\n // @if CK_DEBUG_POSITION // const targetRect = new Rect( target );\n // @if CK_DEBUG_POSITION // RectDrawer.clear();\n // @if CK_DEBUG_POSITION // RectDrawer.draw( targetRect, TARGET_RECT_STYLE, 'Target' );\n // @if CK_DEBUG_POSITION // if ( constrainedViewportRect ) {\n // @if CK_DEBUG_POSITION //\t\tRectDrawer.draw( constrainedViewportRect, VIEWPORT_RECT_STYLE, 'Viewport' );\n // @if CK_DEBUG_POSITION // }\n // If the target got cropped by ancestors or went off the screen, positioning does not make any sense.\n if (!visibleTargetRect || !constrainedViewportRect.getIntersection(visibleTargetRect)) {\n return null;\n }\n // @if CK_DEBUG_POSITION //\tRectDrawer.draw( visibleTargetRect, VISIBLE_TARGET_RECT_STYLE, 'VisTgt' );\n const positionOptions = {\n targetRect: visibleTargetRect,\n elementRect,\n positionedElementAncestor,\n viewportRect: constrainedViewportRect\n };\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 } else {\n if (limiter) {\n const visibleLimiterRect = getVisibleViewportIntersectionRect(limiter, constrainedViewportRect);\n if (visibleLimiterRect) {\n positionOptions.limiterRect = visibleLimiterRect;\n // @if CK_DEBUG_POSITION // RectDrawer.draw( visibleLimiterRect, VISIBLE_LIMITER_RECT_STYLE, 'VisLim' );\n }\n }\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 return `null`\n bestPosition = getBestPosition(positions, positionOptions);\n }\n return bestPosition;\n}\n/**\n * Returns intersection of visible source `Rect` with Viewport `Rect`. In case when source `Rect` is not visible\n * or there is no intersection between source `Rect` and Viewport `Rect`, `null` will be returned.\n */ function getVisibleViewportIntersectionRect(source, viewportRect) {\n const visibleSourceRect = new Rect(source).getVisible();\n if (!visibleSourceRect) {\n return null;\n }\n return visibleSourceRect.getIntersection(viewportRect);\n}\n/**\n * Returns a viewport `Rect` shrunk by the viewport offset config from all sides.\n */ function getConstrainedViewportRect(viewportOffsetConfig) {\n viewportOffsetConfig = Object.assign({\n top: 0,\n bottom: 0,\n left: 0,\n right: 0\n }, viewportOffsetConfig);\n const viewportRect = new Rect(globalVar.window);\n viewportRect.top += viewportOffsetConfig.top;\n viewportRect.height -= viewportOffsetConfig.top;\n viewportRect.bottom -= viewportOffsetConfig.bottom;\n viewportRect.height -= viewportOffsetConfig.bottom;\n viewportRect.left += viewportOffsetConfig.left;\n viewportRect.right -= viewportOffsetConfig.right;\n viewportRect.width -= viewportOffsetConfig.left + viewportOffsetConfig.right;\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 */ function getBestPosition(positions, options) {\n const { elementRect } = options;\n // This is when element is fully visible.\n const elementRectArea = elementRect.getArea();\n const positionInstances = positions.map((positioningFunction)=>new PositionObject(positioningFunction, options))// 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 // @if CK_DEBUG_POSITION //\tRectDrawer.draw( position._rect, CHOSEN_POSITION_RECT_STYLE, [\n // @if CK_DEBUG_POSITION //\t\tposition.name,\n // @if CK_DEBUG_POSITION //\t\t'100% fit',\n // @if CK_DEBUG_POSITION //\t].join( '\\n' ) );\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 CK_DEBUG_POSITION //\tRectDrawer.draw( position._rect, { opacity: .4 }, [\n // @if CK_DEBUG_POSITION //\t\tposition.name,\n // @if CK_DEBUG_POSITION //\t\t'Vi=' + Math.round( viewportIntersectionArea ),\n // @if CK_DEBUG_POSITION //\t\t'Li=' + Math.round( limiterIntersectionArea )\n // @if CK_DEBUG_POSITION //\t].join( '\\n' ) );\n if (fitFactor > maxFitFactor) {\n maxFitFactor = fitFactor;\n bestPosition = position;\n }\n }\n // @if CK_DEBUG_POSITION // if ( bestPosition ) {\n // @if CK_DEBUG_POSITION // \tRectDrawer.draw( bestPosition._rect, CHOSEN_POSITION_RECT_STYLE );\n // @if CK_DEBUG_POSITION // }\n return bestPosition;\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 */ class PositionObject {\n name;\n config;\n _positioningFunctionCoordinates;\n _options;\n _cachedRect;\n _cachedAbsoluteRect;\n /**\n\t * Creates an instance of the {@link module:utils/dom/position~PositionObject} class.\n\t *\n\t * @param positioningFunction function The function that defines the expected\n\t * coordinates the positioned element should move to.\n\t * @param options options object.\n\t * @param options.elementRect The positioned element rect.\n\t * @param options.targetRect The target element rect.\n\t * @param options.viewportRect The viewport rect.\n\t * @param options.limiterRect The limiter rect.\n\t * @param options.positionedElementAncestor Nearest element ancestor element which CSS position is not \"static\".\n\t */ constructor(positioningFunction, options){\n const positioningFunctionOutput = positioningFunction(options.targetRect, options.elementRect, options.viewportRect, options.limiterRect);\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._positioningFunctionCoordinates = {\n left,\n top\n };\n this._options = options;\n }\n /**\n\t * The left value in pixels in the CSS `position: absolute` coordinate system.\n\t * Set it on the positioned element in DOM to move it to the position.\n\t */ get left() {\n return this._absoluteRect.left;\n }\n /**\n\t * The top value in pixels in the CSS `position: absolute` coordinate system.\n\t * Set it on the positioned element in DOM to move it to the position.\n\t */ get top() {\n return this._absoluteRect.top;\n }\n /**\n\t * An intersection area between positioned element and limiter within viewport constraints.\n\t */ get limiterIntersectionArea() {\n const limiterRect = this._options.limiterRect;\n if (limiterRect) {\n return limiterRect.getIntersectionArea(this._rect);\n }\n return 0;\n }\n /**\n\t * An intersection area between positioned element and viewport.\n\t */ get viewportIntersectionArea() {\n const viewportRect = this._options.viewportRect;\n return viewportRect.getIntersectionArea(this._rect);\n }\n /**\n\t * An already positioned element rect. A clone of the element rect passed to the constructor\n\t * but placed in the viewport according to the positioning function.\n\t */ get _rect() {\n if (this._cachedRect) {\n return this._cachedRect;\n }\n this._cachedRect = this._options.elementRect.clone().moveTo(this._positioningFunctionCoordinates.left, this._positioningFunctionCoordinates.top);\n return this._cachedRect;\n }\n /**\n\t * An already absolutely positioned element rect. See ({@link #_rect}).\n\t */ get _absoluteRect() {\n if (this._cachedAbsoluteRect) {\n return this._cachedAbsoluteRect;\n }\n this._cachedAbsoluteRect = this._rect.toAbsoluteRect();\n return this._cachedAbsoluteRect;\n }\n}\n\n/**\n * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */ /**\n * @module utils/dom/remove\n */ /**\n * Removes given node from parent.\n *\n * @param node Node to remove.\n */ function remove(node) {\n const parent = node.parentNode;\n if (parent) {\n parent.removeChild(node);\n }\n}\n\n/**\n * Returns the visual viewport offsets to adjust elements with `position: fixed` style.\n */ function getVisualViewportOffset() {\n const visualViewport = globalVar.window.visualViewport;\n if (!visualViewport || !(env.isiOS || env.isSafari)) {\n return {\n left: 0,\n top: 0\n };\n }\n const left = Math.max(Math.round(visualViewport.offsetLeft), 0);\n const top = Math.max(Math.round(visualViewport.offsetTop), 0);\n return {\n left,\n top\n };\n}\n\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 */ function scrollViewportToShowTarget({ target, viewportOffset = 0, ancestorOffset = 0, alignToTop, forceScroll }) {\n const targetWindow = getWindow(target);\n let currentWindow = targetWindow;\n let currentFrame = null;\n viewportOffset = normalizeViewportOffset(viewportOffset);\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 } 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 let targetRect = getRectRelativeToWindow(target, currentWindow);\n // Detect situation where the target is higher than the first scrollable ancestor.\n // In such case scrolling the viewport to reveal the target might be malfunctioning because\n // the target `.top` position is lower than the ancestor's `.top` position. If it's large enough it can be negative.\n // It causes the `scrollWindowToShowRect` to scroll the viewport to the negative top position which is not possible\n // and leads to the viewport being scrolled to the absolute top of the document. To prevent this, the target's rect\n // must be shifted to the ancestor's top position. It should not affect the target's visibility because the ancestor\n // is already scrolled to reveal the target.\n // See more: https://github.com/ckeditor/ckeditor5/issues/17079\n const ancestorWindowRelativeRect = getRectRelativeToWindow(firstAncestorToScroll, currentWindow);\n if (targetRect.height > ancestorWindowRelativeRect.height) {\n const ancestorTargetIntersection = targetRect.getIntersection(ancestorWindowRelativeRect);\n if (ancestorTargetIntersection) {\n targetRect = ancestorTargetIntersection;\n }\n }\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