From 8d901c046ccc451e7c015f48a32d91d04e0bf7ef Mon Sep 17 00:00:00 2001 From: pdelboca Date: Tue, 14 Feb 2023 08:25:04 -0300 Subject: [PATCH 01/20] Refactor plugin class --- ckanext/showcase/{commands => }/cli.py | 2 +- ckanext/showcase/commands/__init__.py | 0 ckanext/showcase/commands/paster.py | 46 ------------------- .../{plugin/__init__.py => plugin.py} | 34 ++++++++------ ckanext/showcase/plugin/flask_plugin.py | 21 --------- ckanext/showcase/plugin/pylons_plugin.py | 42 ----------------- setup.py | 2 - 7 files changed, 22 insertions(+), 125 deletions(-) rename ckanext/showcase/{commands => }/cli.py (93%) delete mode 100644 ckanext/showcase/commands/__init__.py delete mode 100644 ckanext/showcase/commands/paster.py rename ckanext/showcase/{plugin/__init__.py => plugin.py} (93%) delete mode 100644 ckanext/showcase/plugin/flask_plugin.py delete mode 100644 ckanext/showcase/plugin/pylons_plugin.py diff --git a/ckanext/showcase/commands/cli.py b/ckanext/showcase/cli.py similarity index 93% rename from ckanext/showcase/commands/cli.py rename to ckanext/showcase/cli.py index 7d1d7385..55c56e36 100644 --- a/ckanext/showcase/commands/cli.py +++ b/ckanext/showcase/cli.py @@ -23,4 +23,4 @@ def markdown_to_html(): def get_commands(): - return [showcase] \ No newline at end of file + return [showcase] diff --git a/ckanext/showcase/commands/__init__.py b/ckanext/showcase/commands/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/ckanext/showcase/commands/paster.py b/ckanext/showcase/commands/paster.py deleted file mode 100644 index d1c751c7..00000000 --- a/ckanext/showcase/commands/paster.py +++ /dev/null @@ -1,46 +0,0 @@ -# -*- coding: utf-8 -*- - -from __future__ import print_function - -from ckan.lib.cli import CkanCommand - -from ckanext.showcase import utils - -# Paster commands for CKAN 2.8 and below - - -class MigrationCommand(CkanCommand): - ''' - ckanext-showcase migration command. - - Usage:: - - paster showcase markdown-to-html -c - - Migrate the notes of all showcases from markdown to html. - - Must be run from the ckanext-showcase directory. - ''' - summary = __doc__.split('\n')[0] - usage = __doc__ - - def __init__(self, name): - super(CkanCommand, self).__init__(name) - - def command(self): - ''' - Parse command line arguments and call appropriate method. - ''' - if not self.args or self.args[0] in ['--help', '-h', 'help']: - print(self.__doc__) - return - - cmd = self.args[0] - self._load_config() - - if cmd == 'markdown-to-html': - self.markdown_to_html() - else: - print('Command "{0}" not recognized'.format(cmd)) - - def markdown_to_html(self): - utils.markdown_to_html() diff --git a/ckanext/showcase/plugin/__init__.py b/ckanext/showcase/plugin.py similarity index 93% rename from ckanext/showcase/plugin/__init__.py rename to ckanext/showcase/plugin.py index ff36a0da..3dfd9c4f 100644 --- a/ckanext/showcase/plugin/__init__.py +++ b/ckanext/showcase/plugin.py @@ -14,17 +14,14 @@ import ckan.lib.helpers as h -import ckanext.showcase.utils as utils +from ckanext.showcase import cli +from ckanext.showcase import utils +from ckanext.showcase import views from ckanext.showcase.logic import auth, action +from ckanext.showcase.model import setup as model_setup import ckanext.showcase.logic.schema as showcase_schema import ckanext.showcase.logic.helpers as showcase_helpers -from ckanext.showcase.model import setup as model_setup - -if tk.check_ckan_version(u'2.9'): - from ckanext.showcase.plugin.flask_plugin import MixinPlugin -else: - from ckanext.showcase.plugin.pylons_plugin import MixinPlugin _ = tk._ @@ -33,8 +30,7 @@ DATASET_TYPE_NAME = utils.DATASET_TYPE_NAME -class ShowcasePlugin( - MixinPlugin, plugins.SingletonPlugin, lib_plugins.DefaultDatasetForm): +class ShowcasePlugin(plugins.SingletonPlugin, lib_plugins.DefaultDatasetForm): plugins.implements(plugins.IConfigurable) plugins.implements(plugins.IConfigurer) plugins.implements(plugins.IDatasetForm) @@ -44,13 +40,25 @@ class ShowcasePlugin( plugins.implements(plugins.IPackageController, inherit=True) plugins.implements(plugins.ITemplateHelpers) plugins.implements(plugins.ITranslation) + plugins.implements(plugins.IBlueprint) + plugins.implements(plugins.IClick) + + # IBlueprint + + def get_blueprint(self): + return views.get_blueprints() + + # IClick + + def get_commands(self): + return cli.get_commands() # IConfigurer def update_config(self, config): - tk.add_template_directory(config, '../templates') - tk.add_public_directory(config, '../public') - tk.add_resource('../fanstatic', 'showcase') + tk.add_template_directory(config, 'templates') + tk.add_public_directory(config, 'public') + tk.add_resource('fanstatic', 'showcase') if tk.check_ckan_version(min_version='2.7', max_version='2.9.0'): tk.add_ckan_admin_tab(config, 'showcase_admins', 'Showcase Config') @@ -201,7 +209,7 @@ def before_dataset_search(self, search_params): if filter not in fq: search_params.update({'fq': fq + " -" + filter}) return search_params - + # CKAN < 2.10 (Remove when dropping support for 2.9) def after_show(self, context, pkg_dict): ''' diff --git a/ckanext/showcase/plugin/flask_plugin.py b/ckanext/showcase/plugin/flask_plugin.py deleted file mode 100644 index 54cdef90..00000000 --- a/ckanext/showcase/plugin/flask_plugin.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- - -import ckan.plugins as p -import ckanext.showcase.views as views - -from ckanext.showcase.commands import cli - - -class MixinPlugin(p.SingletonPlugin): - p.implements(p.IBlueprint) - p.implements(p.IClick) - - # IBlueprint - - def get_blueprint(self): - return views.get_blueprints() - - # IClick - - def get_commands(self): - return cli.get_commands() diff --git a/ckanext/showcase/plugin/pylons_plugin.py b/ckanext/showcase/plugin/pylons_plugin.py deleted file mode 100644 index bda3916e..00000000 --- a/ckanext/showcase/plugin/pylons_plugin.py +++ /dev/null @@ -1,42 +0,0 @@ -# -*- coding: utf-8 -*- - -from routes.mapper import SubMapper -import ckan.plugins as p - - -class MixinPlugin(p.SingletonPlugin): - p.implements(p.IRoutes, inherit=True) - - # IRoutes - - def before_map(self, map): - # These named routes are used for custom dataset forms which will use - # the names below based on the dataset.type ('dataset' is the default - # type) - with SubMapper( - map, controller='ckanext.showcase.controller:ShowcaseController' - ) as m: - m.connect('showcase_index', '/showcase', action='search', - highlight_actions='index search') - m.connect('showcase_new', '/showcase/new', action='new') - m.connect('showcase_delete', '/showcase/delete/{id}', - action='delete') - m.connect('showcase_read', '/showcase/{id}', action='read', - ckan_icon='picture') - m.connect('showcase_edit', '/showcase/edit/{id}', - action='edit', ckan_icon='edit') - m.connect('showcase_manage_datasets', - '/showcase/manage_datasets/{id}', - action="manage_datasets", ckan_icon="sitemap") - m.connect('showcase_dataset_showcase_list', '/dataset/showcases/{id}', - action='dataset_showcase_list', ckan_icon='picture') - m.connect('showcase_admins', '/ckan-admin/showcase_admins', - action='manage_showcase_admins', ckan_icon='picture'), - m.connect('showcase_admin_remove', - '/ckan-admin/showcase_admin_remove', - action='remove_showcase_admin'), - m.connect('showcase_upload', '/showcase_upload', - action='showcase_upload') - map.redirect('/showcases', '/showcase') - map.redirect('/showcases/{url:.*}', '/showcase/{url}') - return map diff --git a/setup.py b/setup.py index cd232d64..44e339f0 100644 --- a/setup.py +++ b/setup.py @@ -82,8 +82,6 @@ [babel.extractors] ckan = ckan.lib.extract:extract_ckan - [paste.paster_command] - showcase=ckanext.showcase.commands.paster:MigrationCommand ''', message_extractors={ From 4d96646a59cc9858f763de271cca3d8e10a20c53 Mon Sep 17 00:00:00 2001 From: pdelboca Date: Tue, 14 Feb 2023 08:42:30 -0300 Subject: [PATCH 02/20] Sanitize blueprint endpoints. --- ckanext/showcase/plugin.py | 24 +----------------------- ckanext/showcase/tests/test_plugin.py | 10 +++++----- ckanext/showcase/views.py | 24 +++++++++++++++--------- 3 files changed, 21 insertions(+), 37 deletions(-) diff --git a/ckanext/showcase/plugin.py b/ckanext/showcase/plugin.py index 3dfd9c4f..3dd907fc 100644 --- a/ckanext/showcase/plugin.py +++ b/ckanext/showcase/plugin.py @@ -59,29 +59,7 @@ def update_config(self, config): tk.add_template_directory(config, 'templates') tk.add_public_directory(config, 'public') tk.add_resource('fanstatic', 'showcase') - if tk.check_ckan_version(min_version='2.7', max_version='2.9.0'): - tk.add_ckan_admin_tab(config, 'showcase_admins', - 'Showcase Config') - elif tk.check_ckan_version(min_version='2.9.0'): - tk.add_ckan_admin_tab(config, 'showcase_blueprint.admins', - 'Showcase Config') - - if tk.check_ckan_version(min_version='2.9.0'): - mappings = config.get('ckan.legacy_route_mappings', {}) - if isinstance(mappings, string_types): - mappings = json.loads(mappings) - - bp_routes = [ - 'index', 'new', 'delete', - 'read', 'edit', 'manage_datasets', - 'dataset_showcase_list', 'admins', 'admin_remove' - ] - mappings.update({ - 'showcase_' + route: 'showcase_blueprint.' + route - for route in bp_routes - }) - # https://github.com/ckan/ckan/pull/4521 - config['ckan.legacy_route_mappings'] = json.dumps(mappings) + tk.add_ckan_admin_tab(config, 'showcase_blueprint.admins', 'Showcase Config') # IConfigurable diff --git a/ckanext/showcase/tests/test_plugin.py b/ckanext/showcase/tests/test_plugin.py index 5b81557c..9bddd790 100644 --- a/ckanext/showcase/tests/test_plugin.py +++ b/ckanext/showcase/tests/test_plugin.py @@ -188,7 +188,7 @@ def test_dataset_showcase_page_lists_showcases_no_associations(self, app): dataset = factories.Dataset(name="my-dataset") response = app.get( - url=url_for("showcase_dataset_showcase_list", id=dataset["id"]) + url=url_for("showcase_blueprint.dataset_showcase_list", id=dataset["id"]) ) assert ( @@ -230,7 +230,7 @@ def test_dataset_showcase_page_lists_showcases_two_associations(self, app): ) response = app.get( - url=url_for("showcase_dataset_showcase_list", id=dataset["id"]) + url=url_for("showcase_blueprint.dataset_showcase_list", id=dataset["id"]) ) assert len(BeautifulSoup(response.body).select("li.media-item")) == 2 @@ -390,7 +390,7 @@ def test_showcase_admin_manage_page_returns_correct_status(self, app): sysadmin = factories.Sysadmin() env = {"REMOTE_USER": sysadmin["name"].encode("ascii")} - app.get(url=url_for("showcase_admins"), status=200, extra_environ=env) + app.get(url=url_for("showcase_blueprint.admins"), status=200, extra_environ=env) def test_showcase_admin_manage_page_lists_showcase_admins(self, app): """ @@ -412,7 +412,7 @@ def test_showcase_admin_manage_page_lists_showcase_admins(self, app): env = {"REMOTE_USER": sysadmin["name"].encode("ascii")} response = app.get( - url=url_for("showcase_admins"), status=200, extra_environ=env + url=url_for("showcase_blueprint.admins"), status=200, extra_environ=env ) assert "/user/{0}".format(user_one["name"]) in response @@ -428,7 +428,7 @@ def test_showcase_admin_manage_page_no_admins_message(self, app): env = {"REMOTE_USER": sysadmin["name"].encode("ascii")} response = app.get( - url=url_for("showcase_admins"), status=200, extra_environ=env + url=url_for("showcase_blueprint.admins"), status=200, extra_environ=env ) assert "There are currently no Showcase Admins" in response diff --git a/ckanext/showcase/views.py b/ckanext/showcase/views.py index fd6fdd8b..5d8c5786 100644 --- a/ckanext/showcase/views.py +++ b/ckanext/showcase/views.py @@ -118,27 +118,33 @@ def upload(): return utils.upload() -showcase.add_url_rule('/showcase', view_func=index) -showcase.add_url_rule('/showcase/new', view_func=CreateView.as_view('new')) +showcase.add_url_rule('/showcase', view_func=index, endpoint="index") +showcase.add_url_rule('/showcase/new', view_func=CreateView.as_view('new'), endpoint="new") showcase.add_url_rule('/showcase/delete/', view_func=delete, - methods=[u'GET', u'POST']) -showcase.add_url_rule('/showcase/', view_func=read) + methods=[u'GET', u'POST'], + endpoint="delete") +showcase.add_url_rule('/showcase/', view_func=read, endpoint="read") showcase.add_url_rule('/showcase/edit/', view_func=EditView.as_view('edit'), - methods=[u'GET', u'POST']) + methods=[u'GET', u'POST'], + endpoint="edit") showcase.add_url_rule('/showcase/manage_datasets/', view_func=manage_datasets, - methods=[u'GET', u'POST']) + methods=[u'GET', u'POST'], + endpoint="manage_datasets") showcase.add_url_rule('/dataset/showcases/', view_func=dataset_showcase_list, - methods=[u'GET', u'POST']) + methods=[u'GET', u'POST'], + endpoint="dataset_showcase_list") showcase.add_url_rule('/ckan-admin/showcase_admins', view_func=admins, - methods=[u'GET', u'POST']) + methods=[u'GET', u'POST'], + endpoint="admins") showcase.add_url_rule('/ckan-admin/showcase_admin_remove', view_func=admin_remove, - methods=[u'GET', u'POST']) + methods=[u'GET', u'POST'], + endpoint='admin_remove') showcase.add_url_rule('/showcase_upload', view_func=upload, methods=[u'POST']) From 3708a99dba21429bec2150bca2f02bd3ba59962e Mon Sep 17 00:00:00 2001 From: pdelboca Date: Tue, 14 Feb 2023 08:54:48 -0300 Subject: [PATCH 03/20] Drop code checking for older versions --- ckanext/showcase/logic/auth.py | 1 + ckanext/showcase/logic/helpers.py | 5 +-- ckanext/showcase/plugin.py | 3 -- ckanext/showcase/utils.py | 66 ++++++++++--------------------- 4 files changed, 22 insertions(+), 53 deletions(-) diff --git a/ckanext/showcase/logic/auth.py b/ckanext/showcase/logic/auth.py index 4cf43307..86e58cf2 100644 --- a/ckanext/showcase/logic/auth.py +++ b/ckanext/showcase/logic/auth.py @@ -114,6 +114,7 @@ def showcase_admin_list(context, data_dict): '''Only sysadmins can list showcase admin users.''' return {'success': False} + def showcase_upload(context, data_dict): '''Only sysadmins can upload images.''' return {'success': _is_showcase_admin(context)} diff --git a/ckanext/showcase/logic/helpers.py b/ckanext/showcase/logic/helpers.py index 88ff9fc7..4c2bfa96 100644 --- a/ckanext/showcase/logic/helpers.py +++ b/ckanext/showcase/logic/helpers.py @@ -7,10 +7,7 @@ def facet_remove_field(key, value=None, replace=None): A custom remove field function to be used by the Showcase search page to render the remove link for the tag pills. ''' - if tk.check_ckan_version(min_version='2.9.0'): - index_route = 'showcase_blueprint.index' - else: - index_route = 'showcase_index' + index_route = 'showcase_blueprint.index' return h.remove_url_param( key, value=value, replace=replace, diff --git a/ckanext/showcase/plugin.py b/ckanext/showcase/plugin.py index 3dd907fc..83ef7bb3 100644 --- a/ckanext/showcase/plugin.py +++ b/ckanext/showcase/plugin.py @@ -2,12 +2,9 @@ import os import sys -import json import logging from collections import OrderedDict -from six import string_types - import ckan.plugins as plugins import ckan.plugins.toolkit as tk import ckan.lib.plugins as lib_plugins diff --git a/ckanext/showcase/utils.py b/ckanext/showcase/utils.py index f388bdee..ec269da1 100644 --- a/ckanext/showcase/utils.py +++ b/ckanext/showcase/utils.py @@ -21,7 +21,6 @@ log = logging.getLogger(__name__) DATASET_TYPE_NAME = 'showcase' -ckan_29_or_higher = tk.check_ckan_version(min_version='2.9.0') def check_edit_view_auth(id): @@ -117,15 +116,10 @@ def manage_datasets_view(id): except tk.NotAuthorized: return tk.abort(401, _('Unauthorized to read showcase')) - # Are we removing a showcase/dataset association? - form_data = tk.request.form if tk.check_ckan_version( - '2.9') else tk.request.params - - if tk.check_ckan_version(min_version='2.9.0'): - manage_route = 'showcase_blueprint.manage_datasets' - else: - manage_route = 'showcase_manage_datasets' + form_data = tk.request.form + manage_route = 'showcase_blueprint.manage_datasets' + # Are we removing a showcase/dataset association? if (tk.request.method == 'POST' and 'bulk_action.showcase_remove' in form_data): # Find the datasets to perform the action on, they are prefixed by @@ -191,6 +185,7 @@ def manage_datasets_view(id): return tk.render('showcase/manage_datasets.html') + def _add_dataset_search(showcase_id, showcase_name): ''' Search logic for discovering datasets to add to a showcase. @@ -399,10 +394,8 @@ def url_with_params(url, params): def delete_view(id): - if 'cancel' in tk.request.params: - tk.redirect_to( - 'showcase_blueprint.edit' if tk.check_ckan_version(min_version='2.9.0') - else 'showcase_edit', id=id) + if 'cancel' in tk.request.args: + tk.redirect_to('showcase_blueprint.edit', id=id) context = { 'model': model, @@ -416,10 +409,7 @@ def delete_view(id): except tk.NotAuthorized: return tk.abort(401, _('Unauthorized to delete showcase')) - if tk.check_ckan_version(min_version='2.9.0'): - index_route = 'showcase_blueprint.index' - else: - index_route = 'showcase_index' + index_route = 'showcase_blueprint.index' context = {'user': tk.g.user} try: @@ -432,7 +422,7 @@ def delete_view(id): tk.abort(401, _('Unauthorized to delete showcase')) except tk.ObjectNotFound: tk.abort(404, _('Showcase not found')) - + return tk.render('showcase/confirm_delete.html', extra_vars={'dataset_type': DATASET_TYPE_NAME}) @@ -465,15 +455,11 @@ def dataset_showcase_list(id): except tk.NotAuthorized: return tk.abort(401, _('Unauthorized to read package')) - if tk.check_ckan_version(min_version='2.9.0'): - list_route = 'showcase_blueprint.dataset_showcase_list' - else: - list_route = 'showcase_dataset_showcase_list' + list_route = 'showcase_blueprint.dataset_showcase_list' if tk.request.method == 'POST': # Are we adding the dataset to a showcase? - form_data = tk.request.form if tk.check_ckan_version( - '2.9') else tk.request.params + form_data = tk.request.form new_showcase = form_data.get('showcase_added') if new_showcase: @@ -531,13 +517,8 @@ def manage_showcase_admins(): except tk.NotAuthorized: return tk.abort(401, _('User not authorized to view page')) - form_data = tk.request.form if tk.check_ckan_version( - '2.9') else tk.request.params - - if tk.check_ckan_version(min_version='2.9.0'): - admins_route = 'showcase_blueprint.admins' - else: - admins_route = 'showcase_admins' + form_data = tk.request.form + admins_route = 'showcase_blueprint.admins' # We're trying to add a user to the showcase admins list. if tk.request.method == 'POST' and form_data['username']: @@ -578,13 +559,8 @@ def remove_showcase_admin(): except tk.NotAuthorized: return tk.abort(401, _('User not authorized to view page')) - form_data = tk.request.form if tk.check_ckan_version( - '2.9') else tk.request.params - - if tk.check_ckan_version(min_version='2.9.0'): - admins_route = 'showcase_blueprint.admins' - else: - admins_route = 'showcase_admins' + form_data = tk.request.form + admins_route = 'showcase_blueprint.admins' if 'cancel' in form_data: return tk.redirect_to(admins_route) @@ -646,16 +622,14 @@ def upload(): if not tk.request.method == 'POST': tk.abort(409, _('Only Posting is availiable')) - if ckan_29_or_higher: - data_dict = logic.clean_dict( - dict_fns.unflatten( - logic.tuplize_dict( - logic.parse_params(tk.request.files) - ) + data_dict = logic.clean_dict( + dict_fns.unflatten( + logic.tuplize_dict( + logic.parse_params(tk.request.files) ) ) - else: - data_dict = tk.request.POST + ) + try: url = tk.get_action('ckanext_showcase_upload')( From da8e0ee428bab1e1b19906fece2cbc4d97273cb7 Mon Sep 17 00:00:00 2001 From: pdelboca Date: Tue, 14 Feb 2023 08:54:58 -0300 Subject: [PATCH 04/20] Remove old controller class --- ckanext/showcase/controller.py | 130 --------------------------------- 1 file changed, 130 deletions(-) delete mode 100644 ckanext/showcase/controller.py diff --git a/ckanext/showcase/controller.py b/ckanext/showcase/controller.py deleted file mode 100644 index 04151918..00000000 --- a/ckanext/showcase/controller.py +++ /dev/null @@ -1,130 +0,0 @@ -import logging -import json - - -from ckan.plugins import toolkit as tk -import ckan.lib.helpers as h -import ckan.lib.navl.dictization_functions as dict_fns -import ckan.logic as logic -from ckan.controllers.package import (PackageController) - - -from ckanext.showcase import utils -from ckanext.showcase.utils import DATASET_TYPE_NAME - -_ = tk._ -c = tk.c -request = tk.request -render = tk.render -abort = tk.abort -redirect = tk.redirect_to -NotFound = tk.ObjectNotFound -ValidationError = tk.ValidationError -check_access = tk.check_access -get_action = tk.get_action -tuplize_dict = logic.tuplize_dict -clean_dict = logic.clean_dict -parse_params = logic.parse_params -NotAuthorized = tk.NotAuthorized - -log = logging.getLogger(__name__) - - -class ShowcaseController(PackageController): - def new(self, data=None, errors=None, error_summary=None): - - utils.check_new_view_auth() - return super(ShowcaseController, self).new(data=data, - errors=errors, - error_summary=error_summary) - - def edit(self, id, data=None, errors=None, error_summary=None): - utils.check_edit_view_auth(id) - return super(ShowcaseController, - self).edit(id, - data=data, - errors=errors, - error_summary=error_summary) - - def _guess_package_type(self, expecting_name=False): - """Showcase packages are always DATASET_TYPE_NAME.""" - - return DATASET_TYPE_NAME - - def _save_new(self, context, package_type=None): - ''' - The showcase is created then redirects to the manage_dataset page to - associated packages with the new showcase. - ''' - - data_dict = clean_dict( - dict_fns.unflatten(tuplize_dict(parse_params(request.POST)))) - - data_dict['type'] = package_type - - try: - pkg_dict = get_action('ckanext_showcase_create')(context, - data_dict) - except ValidationError as e: - errors = e.error_dict - error_summary = e.error_summary - data_dict['state'] = 'none' - return self.new(data_dict, errors, error_summary) - - # redirect to manage datasets - url = h.url_for('showcase_manage_datasets', id=pkg_dict['name']) - redirect(url) - - def _save_edit(self, name_or_id, context, package_type=None): - ''' - Edit a showcase's details, then redirect to the showcase read page. - ''' - - data_dict = clean_dict( - dict_fns.unflatten(tuplize_dict(parse_params(request.POST)))) - - data_dict['id'] = name_or_id - try: - pkg = get_action('ckanext_showcase_update')(context, data_dict) - except ValidationError as e: - errors = e.error_dict - error_summary = e.error_summary - return self.edit(name_or_id, data_dict, errors, error_summary) - - c.pkg_dict = pkg - - # redirect to showcase details page - url = h.url_for('showcase_read', id=pkg['name']) - redirect(url) - - def read(self, id, format='html'): - ''' - Detail view for a single showcase, listing its associated datasets. - ''' - - return utils.read_view(id) - - def delete(self, id): - return utils.delete_view(id) - - def dataset_showcase_list(self, id): - ''' - Display a list of showcases a dataset is associated with, with an - option to add to showcase from a list. - ''' - return utils.dataset_showcase_list(id) - - def manage_datasets(self, id): - ''' - List datasets associated with the given showcase id. - ''' - return utils.manage_datasets_view(id) - - def manage_showcase_admins(self): - return utils.manage_showcase_admins() - - def remove_showcase_admin(self): - return utils.remove_showcase_admin() - - def showcase_upload(self): - return utils.upload() From 48185b2dd114799830fa5bc5b81ab4af21275886 Mon Sep 17 00:00:00 2001 From: pdelboca Date: Tue, 14 Feb 2023 08:56:16 -0300 Subject: [PATCH 05/20] Do not run tests in not supported versions --- .github/workflows/test.yml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 968a168e..9b11b07c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,10 +4,10 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 with: - python-version: '3.6' + python-version: '3.10' - name: Install requirements run: pip install flake8 pycodestyle - name: Check syntax @@ -17,7 +17,7 @@ jobs: needs: lint strategy: matrix: - ckan-version: ["2.10", 2.9, 2.9-py2, 2.8, 2.7] + ckan-version: ["2.10", 2.9] fail-fast: false name: CKAN ${{ matrix.ckan-version }} @@ -44,7 +44,7 @@ jobs: CKAN_REDIS_URL: redis://redis:6379/1 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install requirements run: | pip install -r requirements.txt @@ -53,16 +53,10 @@ jobs: # Replace default path to CKAN core config file with the one on the container sed -i -e 's/use = config:.*/use = config:\/srv\/app\/src\/ckan\/test-core.ini/' test.ini - name: Setup extension (CKAN >= 2.9) - if: ${{ matrix.ckan-version != '2.7' && matrix.ckan-version != '2.8' }} run: | ckan -c test.ini db init - - name: Setup extension (CKAN < 2.9) - if: ${{ matrix.ckan-version == '2.7' || matrix.ckan-version == '2.8' }} - run: | - paster --plugin=ckan db init -c test.ini - name: Run tests run: pytest --ckan-ini=test.ini --cov=ckanext.showcase --cov-report=xml --cov-append --disable-warnings ckanext/showcase/tests - - name: Upload coverage report to codecov uses: codecov/codecov-action@v1 with: From 20f9ab193525ffbc4eed70ed4d3b360a11b23698 Mon Sep 17 00:00:00 2001 From: pdelboca Date: Tue, 14 Feb 2023 09:06:01 -0300 Subject: [PATCH 06/20] Drop pylons route support in templates --- .../admin/confirm_remove_showcase_admin.html | 3 +-- .../templates/admin/manage_showcase_admins.html | 3 +-- ckanext/showcase/templates/header.html | 12 +++++------- ckanext/showcase/templates/home/snippets/stats.html | 9 ++++----- ckanext/showcase/templates/package/read_base.html | 3 +-- .../showcase/templates/showcase/confirm_delete.html | 4 +--- ckanext/showcase/templates/showcase/edit_base.html | 10 +++++----- .../templates/showcase/new_package_form.html | 7 +++---- ckanext/showcase/templates/showcase/read.html | 7 +++---- ckanext/showcase/templates/showcase/search.html | 6 +++--- .../showcase/templates/showcase/snippets/helper.html | 3 +-- .../templates/showcase/snippets/showcase_item.html | 4 +--- .../showcase/templates/showcase/snippets/tags.html | 3 +-- 13 files changed, 30 insertions(+), 44 deletions(-) diff --git a/ckanext/showcase/templates/admin/confirm_remove_showcase_admin.html b/ckanext/showcase/templates/admin/confirm_remove_showcase_admin.html index b890becb..342012b9 100644 --- a/ckanext/showcase/templates/admin/confirm_remove_showcase_admin.html +++ b/ckanext/showcase/templates/admin/confirm_remove_showcase_admin.html @@ -1,6 +1,5 @@ {% extends "page.html" %} -{% set ckan_29_or_higher = h.ckan_version().split('.')[1] | int >= 9 %} -{% set showcase_admin_remove_route = 'showcase_blueprint.admin_remove' if ckan_29_or_higher else 'showcase_admin_remove' %} +{% set showcase_admin_remove_route = 'showcase_blueprint.admin_remove' %} {% block subtitle %}{{ _("Confirm Remove") }}{% endblock %} diff --git a/ckanext/showcase/templates/admin/manage_showcase_admins.html b/ckanext/showcase/templates/admin/manage_showcase_admins.html index 9961df1d..e129f4a5 100644 --- a/ckanext/showcase/templates/admin/manage_showcase_admins.html +++ b/ckanext/showcase/templates/admin/manage_showcase_admins.html @@ -3,8 +3,7 @@ {% import 'macros/form.html' as form %} {% set user = c.user_dict %} -{% set ckan_29_or_higher = h.ckan_version().split('.')[1] | int >= 9 %} -{% set showcase_admin_remove_route = 'showcase_blueprint.admin_remove' if ckan_29_or_higher else 'showcase_admin_remove' %} +{% set showcase_admin_remove_route = 'showcase_blueprint.admin_remove' %} {% block primary_content_inner %} diff --git a/ckanext/showcase/templates/header.html b/ckanext/showcase/templates/header.html index 1bc498cc..51e2afd8 100644 --- a/ckanext/showcase/templates/header.html +++ b/ckanext/showcase/templates/header.html @@ -1,12 +1,10 @@ {% ckan_extends %} -{% set ckan_29_or_higher = h.ckan_version().split('.')[1] | int >= 9 %} - -{% set search_route = 'dataset.search' if ckan_29_or_higher else 'search' %} -{% set org_route = 'organization.index' if ckan_29_or_higher else 'organizations_index' %} -{% set group_route = 'group.index' if ckan_29_or_higher else 'group_index' %} -{% set showcase_route = 'showcase_blueprint.index' if ckan_29_or_higher else 'showcase_index' %} -{% set about_route = 'home.about' if ckan_29_or_higher else 'about' %} +{% set search_route = 'dataset.search' %} +{% set org_route = 'organization.index' %} +{% set group_route = 'group.index' %} +{% set showcase_route = 'showcase_blueprint.index' %} +{% set about_route = 'home.about' %} {% block header_site_navigation_tabs %} diff --git a/ckanext/showcase/templates/home/snippets/stats.html b/ckanext/showcase/templates/home/snippets/stats.html index a122f7aa..978f063b 100644 --- a/ckanext/showcase/templates/home/snippets/stats.html +++ b/ckanext/showcase/templates/home/snippets/stats.html @@ -1,8 +1,7 @@ -{% set ckan_29_or_higher = h.ckan_version().split('.')[1] | int >= 9 %} -{% set showcase_index_route = 'showcase_blueprint.index' if ckan_29_or_higher else 'showcase_index' %} -{% set search_route = 'dataset.search' if ckan_29_or_higher else 'package_search' %} -{% set organization_route = 'organization.index' if ckan_29_or_higher else 'organization_index' %} -{% set group_route = 'group.index' if ckan_29_or_higher else 'group_index' %} +{% set showcase_index_route = 'showcase_blueprint.index' %} +{% set search_route = 'dataset.search' %} +{% set organization_route = 'organization.index' %} +{% set group_route = 'group.index' %} {% set stats = h.get_site_statistics() %} diff --git a/ckanext/showcase/templates/package/read_base.html b/ckanext/showcase/templates/package/read_base.html index 31682fe7..e41d3263 100644 --- a/ckanext/showcase/templates/package/read_base.html +++ b/ckanext/showcase/templates/package/read_base.html @@ -1,6 +1,5 @@ {% ckan_extends %} -{% set ckan_29_or_higher = h.ckan_version().split('.')[1] | int >= 9 %} -{% set showcase_dataset_showcase_list_route = 'showcase_blueprint.dataset_showcase_list' if ckan_29_or_higher else 'showcase_dataset_showcase_list' %} +{% set showcase_dataset_showcase_list_route = 'showcase_blueprint.dataset_showcase_list' %} {% block content_primary_nav %} {{ super() }} diff --git a/ckanext/showcase/templates/showcase/confirm_delete.html b/ckanext/showcase/templates/showcase/confirm_delete.html index 5cf9b082..ad88eab2 100644 --- a/ckanext/showcase/templates/showcase/confirm_delete.html +++ b/ckanext/showcase/templates/showcase/confirm_delete.html @@ -1,9 +1,7 @@ {% extends "page.html" %} {% set pkg = pkg_dict or c.pkg_dict %} - -{% set ckan_29_or_higher = h.ckan_version().split('.')[1] | int >= 9 %} -{% set showcase_delete_route = 'showcase_blueprint.delete' if ckan_29_or_higher else 'showcase_delete' %} +{% set showcase_delete_route = 'showcase_blueprint.delete' %} {% block subtitle %}{{ _("Confirm Delete") }}{% endblock %} diff --git a/ckanext/showcase/templates/showcase/edit_base.html b/ckanext/showcase/templates/showcase/edit_base.html index cc0da4aa..e690d51e 100644 --- a/ckanext/showcase/templates/showcase/edit_base.html +++ b/ckanext/showcase/templates/showcase/edit_base.html @@ -1,11 +1,11 @@ {% extends 'page.html' %} {% set pkg = pkg_dict or c.pkg_dict %} -{% set ckan_29_or_higher = h.ckan_version().split('.')[1] | int >= 9 %} -{% set showcase_index_route = 'showcase_blueprint.index' if ckan_29_or_higher else 'showcase_index' %} -{% set showcase_read_route = 'showcase_blueprint.read' if ckan_29_or_higher else 'showcase_read' %} -{% set showcase_edit_route = 'showcase_blueprint.edit' if ckan_29_or_higher else 'showcase_edit' %} -{% set showcase_manage_route = 'showcase_blueprint.manage_datasets' if ckan_29_or_higher else 'showcase_manage_datasets' %} + +{% set showcase_index_route = 'showcase_blueprint.index' %} +{% set showcase_read_route = 'showcase_blueprint.read' %} +{% set showcase_edit_route = 'showcase_blueprint.edit' %} +{% set showcase_manage_route = 'showcase_blueprint.manage_datasets' %} diff --git a/ckanext/showcase/templates/showcase/new_package_form.html b/ckanext/showcase/templates/showcase/new_package_form.html index 626adafc..e5e1a447 100644 --- a/ckanext/showcase/templates/showcase/new_package_form.html +++ b/ckanext/showcase/templates/showcase/new_package_form.html @@ -1,13 +1,12 @@ {% import 'macros/form.html' as form %} {% set action = c.form_action or '' %} {% set form_style = c.form_style or c.action %} -{% set ckan_29_or_higher = h.ckan_version().split('.')[1] | int >= 9 %} -{% set showcase_read_route = 'showcase_blueprint.read' if ckan_29_or_higher else 'showcase_read' %} -{% set showcase_delete_route = 'showcase_blueprint.delete' if ckan_29_or_higher else 'showcase_delete' %} +{% set showcase_read_route = 'showcase_blueprint.read' %} +{% set showcase_delete_route = 'showcase_blueprint.delete' %}
- + {{ h.csrf_input() if 'csrf_input' in h }} {# pkg_name used in 3 stage edit #} diff --git a/ckanext/showcase/templates/showcase/read.html b/ckanext/showcase/templates/showcase/read.html index 62fbf8ac..fb951514 100644 --- a/ckanext/showcase/templates/showcase/read.html +++ b/ckanext/showcase/templates/showcase/read.html @@ -4,10 +4,9 @@ {% set name = pkg.title or pkg.name %} {% set editor = h.get_wysiwyg_editor() %} -{% set ckan_29_or_higher = h.ckan_version().split('.')[1] | int >= 9 %} -{% set showcase_read_route = 'showcase_blueprint.read' if ckan_29_or_higher else 'showcase_read' %} -{% set showcase_index_route = 'showcase_blueprint.index' if ckan_29_or_higher else 'showcase_index' %} -{% set showcase_edit_route = 'showcase_blueprint.edit' if ckan_29_or_higher else 'showcase_edit' %} +{% set showcase_read_route = 'showcase_blueprint.read' %} +{% set showcase_index_route = 'showcase_blueprint.index' %} +{% set showcase_edit_route = 'showcase_blueprint.edit' %} {% block subtitle %}{{ pkg.title or pkg.name }} - {{ _('Showcases') }}{% endblock %} diff --git a/ckanext/showcase/templates/showcase/search.html b/ckanext/showcase/templates/showcase/search.html index b975a013..4296519c 100644 --- a/ckanext/showcase/templates/showcase/search.html +++ b/ckanext/showcase/templates/showcase/search.html @@ -1,8 +1,8 @@ {% extends "package/search.html" %} {% import 'macros/form.html' as form %} -{% set ckan_29_or_higher = h.ckan_version().split('.')[1] | int >= 9 %} -{% set showcase_index_route = 'showcase_blueprint.index' if ckan_29_or_higher else 'showcase_index' %} -{% set showcase_new_route = 'showcase_blueprint.new' if ckan_29_or_higher else 'showcase_new' %} + +{% set showcase_index_route = 'showcase_blueprint.index' %} +{% set showcase_new_route = 'showcase_blueprint.new' %} {% block subtitle %}{{ _("Showcases") }}{% endblock %} diff --git a/ckanext/showcase/templates/showcase/snippets/helper.html b/ckanext/showcase/templates/showcase/snippets/helper.html index eb61c16e..de0cf06b 100644 --- a/ckanext/showcase/templates/showcase/snippets/helper.html +++ b/ckanext/showcase/templates/showcase/snippets/helper.html @@ -1,5 +1,4 @@ -{% set ckan_29_or_higher = h.ckan_version().split('.')[1] | int >= 9 %} -{% set showcase_admins_route = 'showcase_blueprint.admins' if ckan_29_or_higher else 'showcase_admins' %} +{% set showcase_admins_route = 'showcase_blueprint.admins' %}

diff --git a/ckanext/showcase/templates/showcase/snippets/showcase_item.html b/ckanext/showcase/templates/showcase/snippets/showcase_item.html index ca8c199e..36362830 100644 --- a/ckanext/showcase/templates/showcase/snippets/showcase_item.html +++ b/ckanext/showcase/templates/showcase/snippets/showcase_item.html @@ -13,9 +13,7 @@ {% set title = package.title or package.name %} {% set notes = h.markdown_extract(package.notes, extract_length=truncate) %} -{% set ckan_29_or_higher = h.ckan_version().split('.')[1] | int >= 9 %} - -{% set showcase_read_route = 'showcase_blueprint.read' if ckan_29_or_higher else 'showcase_read' %} +{% set showcase_read_route = 'showcase_blueprint.read' %} {% block package_item %} diff --git a/ckanext/showcase/templates/showcase/snippets/tags.html b/ckanext/showcase/templates/showcase/snippets/tags.html index dae2e08e..8b60fa2d 100644 --- a/ckanext/showcase/templates/showcase/snippets/tags.html +++ b/ckanext/showcase/templates/showcase/snippets/tags.html @@ -1,6 +1,5 @@ {% if tags %} - {% set ckan_29_or_higher = h.ckan_version().split('.')[1] | int >= 9 %} - {% set showcase_index_route = 'showcase_blueprint.index' if ckan_29_or_higher else 'showcase_index' %} + {% set showcase_index_route = 'showcase_blueprint.index' %}
{% set _class = 'tag-list well' %} From e12a275f33758fdd3e2b48597c4023626f82cf9a Mon Sep 17 00:00:00 2001 From: pdelboca Date: Tue, 14 Feb 2023 09:12:09 -0300 Subject: [PATCH 07/20] Migrate static logic to assets --- .../showcase/{fanstatic => assets}/ckanext_showcase.css | 0 .../{fanstatic => assets}/ckeditor-content-style.css | 0 ckanext/showcase/{fanstatic => assets}/dist/ckeditor.js | 0 .../{fanstatic => assets}/js/showcase-ckeditor.js | 0 ckanext/showcase/{fanstatic => assets}/src/ckeditor.js | 0 ckanext/showcase/{fanstatic => assets}/webassets.yml | 0 ckanext/showcase/fanstatic/resource.config | 8 -------- ckanext/showcase/plugin.py | 2 +- ckanext/showcase/templates/showcase/edit_base.html | 3 +-- ckanext/showcase/templates/showcase/manage_datasets.html | 4 ++-- ckanext/showcase/templates/showcase/new_package_form.html | 3 +-- ckanext/showcase/templates/showcase/read.html | 5 ++--- .../templates/showcase/snippets/ckeditor_asset.html | 1 - .../showcase/snippets/ckeditor_content_css_asset.html | 1 - .../showcase/snippets/ckeditor_content_css_resource.html | 1 - .../templates/showcase/snippets/ckeditor_resource.html | 1 - .../templates/showcase/snippets/showcase_css_asset.html | 1 - .../showcase/snippets/showcase_css_resource.html | 1 - .../templates/showcase/snippets/showcase_info.html | 2 +- 19 files changed, 8 insertions(+), 25 deletions(-) rename ckanext/showcase/{fanstatic => assets}/ckanext_showcase.css (100%) rename ckanext/showcase/{fanstatic => assets}/ckeditor-content-style.css (100%) rename ckanext/showcase/{fanstatic => assets}/dist/ckeditor.js (100%) rename ckanext/showcase/{fanstatic => assets}/js/showcase-ckeditor.js (100%) rename ckanext/showcase/{fanstatic => assets}/src/ckeditor.js (100%) rename ckanext/showcase/{fanstatic => assets}/webassets.yml (100%) delete mode 100644 ckanext/showcase/fanstatic/resource.config delete mode 100644 ckanext/showcase/templates/showcase/snippets/ckeditor_asset.html delete mode 100644 ckanext/showcase/templates/showcase/snippets/ckeditor_content_css_asset.html delete mode 100644 ckanext/showcase/templates/showcase/snippets/ckeditor_content_css_resource.html delete mode 100644 ckanext/showcase/templates/showcase/snippets/ckeditor_resource.html delete mode 100644 ckanext/showcase/templates/showcase/snippets/showcase_css_asset.html delete mode 100644 ckanext/showcase/templates/showcase/snippets/showcase_css_resource.html diff --git a/ckanext/showcase/fanstatic/ckanext_showcase.css b/ckanext/showcase/assets/ckanext_showcase.css similarity index 100% rename from ckanext/showcase/fanstatic/ckanext_showcase.css rename to ckanext/showcase/assets/ckanext_showcase.css diff --git a/ckanext/showcase/fanstatic/ckeditor-content-style.css b/ckanext/showcase/assets/ckeditor-content-style.css similarity index 100% rename from ckanext/showcase/fanstatic/ckeditor-content-style.css rename to ckanext/showcase/assets/ckeditor-content-style.css diff --git a/ckanext/showcase/fanstatic/dist/ckeditor.js b/ckanext/showcase/assets/dist/ckeditor.js similarity index 100% rename from ckanext/showcase/fanstatic/dist/ckeditor.js rename to ckanext/showcase/assets/dist/ckeditor.js diff --git a/ckanext/showcase/fanstatic/js/showcase-ckeditor.js b/ckanext/showcase/assets/js/showcase-ckeditor.js similarity index 100% rename from ckanext/showcase/fanstatic/js/showcase-ckeditor.js rename to ckanext/showcase/assets/js/showcase-ckeditor.js diff --git a/ckanext/showcase/fanstatic/src/ckeditor.js b/ckanext/showcase/assets/src/ckeditor.js similarity index 100% rename from ckanext/showcase/fanstatic/src/ckeditor.js rename to ckanext/showcase/assets/src/ckeditor.js diff --git a/ckanext/showcase/fanstatic/webassets.yml b/ckanext/showcase/assets/webassets.yml similarity index 100% rename from ckanext/showcase/fanstatic/webassets.yml rename to ckanext/showcase/assets/webassets.yml diff --git a/ckanext/showcase/fanstatic/resource.config b/ckanext/showcase/fanstatic/resource.config deleted file mode 100644 index 07a8ea2a..00000000 --- a/ckanext/showcase/fanstatic/resource.config +++ /dev/null @@ -1,8 +0,0 @@ -[depends] - -ckeditor = base/main - -[groups] -ckeditor = - dist/ckeditor.js - js/showcase-ckeditor.js diff --git a/ckanext/showcase/plugin.py b/ckanext/showcase/plugin.py index 83ef7bb3..882c455b 100644 --- a/ckanext/showcase/plugin.py +++ b/ckanext/showcase/plugin.py @@ -55,7 +55,7 @@ def get_commands(self): def update_config(self, config): tk.add_template_directory(config, 'templates') tk.add_public_directory(config, 'public') - tk.add_resource('fanstatic', 'showcase') + tk.add_resource('assets', 'showcase') tk.add_ckan_admin_tab(config, 'showcase_blueprint.admins', 'Showcase Config') # IConfigurable diff --git a/ckanext/showcase/templates/showcase/edit_base.html b/ckanext/showcase/templates/showcase/edit_base.html index e690d51e..6e25d8ed 100644 --- a/ckanext/showcase/templates/showcase/edit_base.html +++ b/ckanext/showcase/templates/showcase/edit_base.html @@ -13,8 +13,7 @@ {% block styles %} {{ super() }} - {% set _type = 'asset' if h.ckan_version().split('.')[1] | int >= 9 else 'resource' %} - {% snippet 'showcase/snippets/showcase_css_' ~ _type ~ '.html' %} + {% asset "showcase/ckanext-showcase-css" %} {% endblock %} {% block breadcrumb_content_selected %}{% endblock %} diff --git a/ckanext/showcase/templates/showcase/manage_datasets.html b/ckanext/showcase/templates/showcase/manage_datasets.html index b1da5c6e..4b408624 100644 --- a/ckanext/showcase/templates/showcase/manage_datasets.html +++ b/ckanext/showcase/templates/showcase/manage_datasets.html @@ -66,7 +66,7 @@

{{ _('Datasets available to add to this showcase') }}

- {{ h.link_to(title|truncate(truncate_title), h.url_for(controller='dataset' if h.ckan_version().split('.')[1] | int >= 9 else 'package', action='read', id=package.name)) }} + {{ h.link_to(title|truncate(truncate_title), h.url_for('dataset.read', id=package.name)) }}

{% if notes %}

{{ notes|urlize }}

@@ -124,7 +124,7 @@

{{ _('Datasets in this showcase') }}

- {{ h.link_to(title|truncate(truncate_title), h.url_for(controller='dataset' if h.ckan_version().split('.')[1] | int >= 9 else 'package', action='read', id=package.name)) }} + {{ h.link_to(title|truncate(truncate_title), h.url_for('dataset.read', id=package.name)) }}

{% if notes %}

{{ notes|urlize }}

diff --git a/ckanext/showcase/templates/showcase/new_package_form.html b/ckanext/showcase/templates/showcase/new_package_form.html index e5e1a447..9d2985bc 100644 --- a/ckanext/showcase/templates/showcase/new_package_form.html +++ b/ckanext/showcase/templates/showcase/new_package_form.html @@ -30,8 +30,7 @@ {% block package_basic_fields_description %} {% set editor = h.get_wysiwyg_editor() %} {% if editor == 'ckeditor' %} - {% set _type = 'asset' if h.ckan_version().split('.')[1] | int >= 9 else 'resource' %} - {% snippet 'showcase/snippets/ckeditor_' ~ _type ~ '.html' %} + {% asset 'showcase/ckeditor' %} {% set ckeditor_attrs = { 'data-module': 'showcase-ckeditor', diff --git a/ckanext/showcase/templates/showcase/read.html b/ckanext/showcase/templates/showcase/read.html index fb951514..a2436f2b 100644 --- a/ckanext/showcase/templates/showcase/read.html +++ b/ckanext/showcase/templates/showcase/read.html @@ -12,10 +12,9 @@ {% block styles %} {{ super() }} - {% set _type = 'asset' if h.ckan_version().split('.')[1] | int >= 9 else 'resource' %} - {% snippet 'showcase/snippets/showcase_css_' ~ _type ~ '.html' %} + {% asset "showcase/ckanext-showcase-css" %} {% if editor == 'ckeditor' %} - {% snippet 'showcase/snippets/ckeditor_content_css_' ~ _type ~ '.html' %} + {% asset 'showcase/ckeditor' %} {% endif %} {% endblock %} diff --git a/ckanext/showcase/templates/showcase/snippets/ckeditor_asset.html b/ckanext/showcase/templates/showcase/snippets/ckeditor_asset.html deleted file mode 100644 index 732e7e92..00000000 --- a/ckanext/showcase/templates/showcase/snippets/ckeditor_asset.html +++ /dev/null @@ -1 +0,0 @@ -{% asset 'showcase/ckeditor' %} diff --git a/ckanext/showcase/templates/showcase/snippets/ckeditor_content_css_asset.html b/ckanext/showcase/templates/showcase/snippets/ckeditor_content_css_asset.html deleted file mode 100644 index d3bc8c9c..00000000 --- a/ckanext/showcase/templates/showcase/snippets/ckeditor_content_css_asset.html +++ /dev/null @@ -1 +0,0 @@ -{% asset "showcase/ckeditor-content-css" %} \ No newline at end of file diff --git a/ckanext/showcase/templates/showcase/snippets/ckeditor_content_css_resource.html b/ckanext/showcase/templates/showcase/snippets/ckeditor_content_css_resource.html deleted file mode 100644 index 57ef2812..00000000 --- a/ckanext/showcase/templates/showcase/snippets/ckeditor_content_css_resource.html +++ /dev/null @@ -1 +0,0 @@ -{% resource "showcase/ckeditor-content-style.css" %} \ No newline at end of file diff --git a/ckanext/showcase/templates/showcase/snippets/ckeditor_resource.html b/ckanext/showcase/templates/showcase/snippets/ckeditor_resource.html deleted file mode 100644 index 8a65271b..00000000 --- a/ckanext/showcase/templates/showcase/snippets/ckeditor_resource.html +++ /dev/null @@ -1 +0,0 @@ -{% resource 'showcase/ckeditor' %} diff --git a/ckanext/showcase/templates/showcase/snippets/showcase_css_asset.html b/ckanext/showcase/templates/showcase/snippets/showcase_css_asset.html deleted file mode 100644 index a7c6dabe..00000000 --- a/ckanext/showcase/templates/showcase/snippets/showcase_css_asset.html +++ /dev/null @@ -1 +0,0 @@ -{% asset "showcase/ckanext-showcase-css" %} \ No newline at end of file diff --git a/ckanext/showcase/templates/showcase/snippets/showcase_css_resource.html b/ckanext/showcase/templates/showcase/snippets/showcase_css_resource.html deleted file mode 100644 index dee33209..00000000 --- a/ckanext/showcase/templates/showcase/snippets/showcase_css_resource.html +++ /dev/null @@ -1 +0,0 @@ -{% resource "showcase/ckanext_showcase.css" %} \ No newline at end of file diff --git a/ckanext/showcase/templates/showcase/snippets/showcase_info.html b/ckanext/showcase/templates/showcase/snippets/showcase_info.html index fb1e3a0f..4b8f7b2a 100644 --- a/ckanext/showcase/templates/showcase/snippets/showcase_info.html +++ b/ckanext/showcase/templates/showcase/snippets/showcase_info.html @@ -40,7 +40,7 @@

{{ h.link_to(title|truncate(truncate_title), h.url_for(controller='dataset' if h.ckan_version().split('.')[1] | int >= 9 else 'package', action='read', id=package.name)) }} + {% endfor %} {% else %} From ac1ec04048828b75c94d111570170ef4179806a1 Mon Sep 17 00:00:00 2001 From: pdelboca Date: Tue, 14 Feb 2023 09:58:53 -0300 Subject: [PATCH 08/20] Fix search endpoint --- ckanext/showcase/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckanext/showcase/utils.py b/ckanext/showcase/utils.py index ec269da1..f982f4fc 100644 --- a/ckanext/showcase/utils.py +++ b/ckanext/showcase/utils.py @@ -380,7 +380,7 @@ def pager_url(q=None, page=None): def _search_url(params, name): - url = h.url_for('showcase_manage_datasets', id=name) + url = h.url_for('showcase_blueprint.manage_datasets', id=name) return url_with_params(url, params) From 7157c153a75301ca04c850a3d78d7469933d5d48 Mon Sep 17 00:00:00 2001 From: pdelboca Date: Tue, 14 Feb 2023 10:29:08 -0300 Subject: [PATCH 09/20] Refactor test for 2.9/2.10 support --- ckanext/showcase/tests/test_plugin.py | 110 ++++++++------------------ 1 file changed, 34 insertions(+), 76 deletions(-) diff --git a/ckanext/showcase/tests/test_plugin.py b/ckanext/showcase/tests/test_plugin.py index 9bddd790..6a1b2271 100644 --- a/ckanext/showcase/tests/test_plugin.py +++ b/ckanext/showcase/tests/test_plugin.py @@ -42,39 +42,30 @@ def test_showcase_create_form_renders(self, app): def test_showcase_new_redirects_to_manage_datasets(self, app): """Creating a new showcase redirects to the manage datasets form.""" - if tk.check_ckan_version("2.9"): - pytest.skip("submit_and_follow not supported") - sysadmin = factories.Sysadmin() # need a dataset for the 'bulk_action.showcase_add' button to show factories.Dataset() env = {"REMOTE_USER": sysadmin["name"].encode("ascii")} - response = app.get(url=url_for("showcase_new"), extra_environ=env,) - - # create showcase - form = response.forms["dataset-edit"] - form["name"] = u"my-showcase" - create_response = helpers.submit_and_follow(app, form, env, "save") + response = app.post( + url=url_for("showcase_blueprint.new"), + extra_environ=env, + data={"name": "my-showcase"}, + follow_redirects=False + ) - # Unique to manage_datasets page - assert "bulk_action.showcase_add" in create_response # Requested page is the manage_datasets url. assert ( - url_for("showcase_manage_datasets", id="my-showcase") - == create_response.request.path + url_for("showcase_blueprint.manage_datasets", id="my-showcase") + in response.location ) def test_create_showcase(self, app): - if not tk.check_ckan_version(min_version='2.9.0'): - # Remove when dropping support for 2.8 - pytest.skip("data argument not supported in post()") - sysadmin = factories.Sysadmin() env = {"REMOTE_USER": sysadmin["name"].encode("ascii")} app.post( - url=url_for("showcase_new"), + url=url_for("showcase_blueprint.new"), extra_environ=env, data={ "name": "my-test-showcase", @@ -84,7 +75,7 @@ def test_create_showcase(self, app): ) res = app.get( - url=url_for("showcase_read", id="my-test-showcase"), + url=url_for("showcase_blueprint.read", id="my-test-showcase"), extra_environ=env, ) assert "my-test-showcase" in res.body @@ -133,16 +124,12 @@ def test_showcase_edit_redirects_to_showcase_details(self, app): ) def test_edit_showcase(self, app): - if not tk.check_ckan_version(min_version='2.9.0'): - # Remove when dropping support for 2.8 - pytest.skip("data argument not supported in post()") - sysadmin = factories.Sysadmin() factories.Dataset(name="my-showcase", type="showcase") env = {"REMOTE_USER": sysadmin["name"]} app.post( - url=url_for("showcase_edit", id="my-showcase"), + url=url_for("showcase_blueprint.edit", id="my-showcase"), extra_environ=env, data={ "name": "my-edited-showcase", @@ -151,7 +138,7 @@ def test_edit_showcase(self, app): } ) res = app.get( - url=url_for("showcase_edit", id="my-edited-showcase"), + url=url_for("showcase_blueprint.edit", id="my-edited-showcase"), extra_environ=env, ) assert "my-edited-showcase" in res.body @@ -170,12 +157,8 @@ def test_dataset_read_has_showcases_tab(self, app): dataset = factories.Dataset(name="my-dataset") - if tk.check_ckan_version("2.9"): - url = url = url_for("dataset.read", id=dataset["id"]) - else: - url = url_for( - controller="package", action="read", id=dataset["id"] - ) + url = url = url_for("dataset.read", id=dataset["id"]) + response = app.get(url) # response contains link to dataset's showcase list assert "/dataset/showcases/{0}".format(dataset["name"]) in response @@ -243,9 +226,6 @@ def test_dataset_showcase_page_add_to_showcase_dropdown_list(self, app): Add to showcase dropdown only lists showcases that aren't already associated with dataset. """ - if tk.check_ckan_version("2.9"): - pytest.skip("submit_and_follow not supported") - sysadmin = factories.Sysadmin() dataset = factories.Dataset(name="my-dataset") showcase_one = factories.Dataset( @@ -267,19 +247,15 @@ def test_dataset_showcase_page_add_to_showcase_dropdown_list(self, app): ) response = app.get( - url=url_for("showcase_dataset_showcase_list", id=dataset["id"]), + url=url_for("showcase_blueprint.dataset_showcase_list", id=dataset["id"]), extra_environ={"REMOTE_USER": str(sysadmin["name"])}, ) - showcase_add_form = response.forms["showcase-add"] - showcase_added_options = [ - value for (value, _) in showcase_add_form["showcase_added"].options - ] - assert showcase_one["id"] not in showcase_added_options - assert showcase_two["id"] in showcase_added_options - assert showcase_three["id"] in showcase_added_options + assert f'

diff --git a/ckanext/showcase/templates/showcase/search.html b/ckanext/showcase/templates/showcase/search.html index 4296519c..1f2ade19 100644 --- a/ckanext/showcase/templates/showcase/search.html +++ b/ckanext/showcase/templates/showcase/search.html @@ -34,7 +34,7 @@ (_('Last Modified'), 'metadata_modified desc'), (_('Popular'), 'views_recent desc') if g.tracking_enabled else (false, false) ] %} - {% snippet 'showcase/snippets/showcase_search_form.html', type='showcase', placeholder=_('Search showcases...'), query=c.q, sorting=sorting, sorting_selected=c.sort_by_selected, count=c.page.item_count, facets=facets, show_empty=request.params, error=c.query_error, fields=c.fields, no_bottom_border=true %} + {% snippet 'showcase/snippets/showcase_search_form.html', type='showcase', placeholder=_('Search showcases...'), query=c.q, sorting=sorting, sorting_selected=c.sort_by_selected, count=c.page.item_count, facets=facets, show_empty=request.args, error=c.query_error, fields=c.fields, no_bottom_border=true %} {% endblock %} {% block package_search_results_list %} diff --git a/ckanext/showcase/utils.py b/ckanext/showcase/utils.py index a004416b..ed069e0b 100644 --- a/ckanext/showcase/utils.py +++ b/ckanext/showcase/utils.py @@ -28,7 +28,7 @@ def check_edit_view_auth(id): 'session': model.Session, 'user': tk.g.user or tk.g.author, 'auth_user_obj': tk.g.userobj, - 'save': 'save' in tk.request.params, + 'save': 'save' in tk.request.args, 'pending': True } @@ -47,7 +47,7 @@ def check_new_view_auth(): 'session': model.Session, 'user': tk.g.user or tk.g.author, 'auth_user_obj': tk.g.userobj, - 'save': 'save' in tk.request.params + 'save': 'save' in tk.request.args } # Check access here, then continue with PackageController.new() @@ -195,14 +195,14 @@ def _add_dataset_search(showcase_id, showcase_name): package_type = 'dataset' # unicode format (decoded from utf8) - q = tk.g.q = tk.request.params.get('q', u'') + q = tk.g.q = tk.request.args.get('q', u'') tk.g.query_error = False - page = h.get_page_number(tk.request.params) + page = h.get_page_number(tk.request.args) limit = int(tk.config.get('ckan.datasets_per_page', 20)) # most search operations should reset the page counter: - params_nopage = [(k, v) for k, v in tk.request.params.items() + params_nopage = [(k, v) for k, v in tk.request.args.items() if k != 'page'] def remove_field(key, value=None, replace=None): @@ -215,7 +215,7 @@ def remove_field(key, value=None, replace=None): tk.g.remove_field = remove_field - sort_by = tk.request.params.get('sort', None) + sort_by = tk.request.args.get('sort', None) params_nosort = [(k, v) for k, v in params_nopage if k != 'sort'] def _sort_by(fields): @@ -255,7 +255,7 @@ def pager_url(q=None, page=None): tk.g.fields_grouped = {} search_extras = {} fq = '' - for (param, value) in tk.request.params.items(): + for (param, value) in tk.request.args.items(): if param not in ['q', 'page', 'sort'] \ and len(value) and not param.startswith('_'): if not param.startswith('ext_'): @@ -367,7 +367,7 @@ def pager_url(q=None, page=None): for facet in tk.g.search_facets.keys(): try: limit = int( - tk.request.params.get( + tk.request.args.get( '_%s_limit' % facet, int(tk.config.get('search.facets.default', 10)))) except tk.ValueError: @@ -564,9 +564,9 @@ def remove_showcase_admin(): if 'cancel' in form_data: return tk.redirect_to(admins_route) - user_id = tk.request.params['user'] + user_id = tk.request.args['user'] if tk.request.method == 'POST' and user_id: - user_id = tk.request.params['user'] + user_id = tk.request.args['user'] try: tk.get_action('ckanext_showcase_admin_remove')( {}, {'username': user_id} From 506c8ee13a7e44aae6effc25450077dfb6f01a65 Mon Sep 17 00:00:00 2001 From: pdelboca Date: Tue, 14 Feb 2023 12:57:41 -0300 Subject: [PATCH 17/20] Upgrade CKEditor version --- ckanext/showcase/assets/dist/ckeditor.js | 8923 ++++++++++++--- package-lock.json | 12477 ++++++--------------- package.json | 80 +- webpack.config.js | 51 +- 4 files changed, 11018 insertions(+), 10513 deletions(-) diff --git a/ckanext/showcase/assets/dist/ckeditor.js b/ckanext/showcase/assets/dist/ckeditor.js index fb3afb59..a0923184 100644 --- a/ckanext/showcase/assets/dist/ckeditor.js +++ b/ckanext/showcase/assets/dist/ckeditor.js @@ -1,1350 +1,7575 @@ -!function(t){const e=t.en=t.en||{};e.dictionary=Object.assign(e.dictionary||{},{"%0 of %1":"%0 of %1","Block quote":"Block quote",Bold:"Bold","Bulleted List":"Bulleted List",Cancel:"Cancel","Cannot upload file:":"Cannot upload file:","Centered image":"Centered image","Change image text alternative":"Change image text alternative","Choose heading":"Choose heading",Code:"Code","Decrease indent":"Decrease indent",Downloadable:"Downloadable","Dropdown toolbar":"Dropdown toolbar","Edit link":"Edit link","Editor toolbar":"Editor toolbar","Enter image caption":"Enter image caption","Full size image":"Full size image",Heading:"Heading","Heading 1":"Heading 1","Heading 2":"Heading 2","Heading 3":"Heading 3","Heading 4":"Heading 4","Heading 5":"Heading 5","Heading 6":"Heading 6","Horizontal line":"Horizontal line","Image toolbar":"Image toolbar","image widget":"image widget","Increase indent":"Increase indent","Insert image":"Insert image",Italic:"Italic","Left aligned image":"Left aligned image",Link:"Link","Link URL":"Link URL",Next:"Next","Numbered List":"Numbered List","Open in a new tab":"Open in a new tab","Open link in new tab":"Open link in new tab",Paragraph:"Paragraph",Previous:"Previous",Redo:"Redo","Rich Text Editor":"Rich Text Editor","Rich Text Editor, %0":"Rich Text Editor, %0","Right aligned image":"Right aligned image",Save:"Save","Show more items":"Show more items","Side image":"Side image",Strikethrough:"Strikethrough",Subscript:"Subscript",Superscript:"Superscript","Text alternative":"Text alternative","This link has no URL":"This link has no URL",Underline:"Underline",Undo:"Undo",Unlink:"Unlink","Upload failed":"Upload failed","Upload in progress":"Upload in progress","Widget toolbar":"Widget toolbar"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=82)}([function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"a",(function(){return o}));class n extends Error{constructor(t,e,i){t=o(t),i&&(t+=" "+JSON.stringify(i)),super(t),this.name="CKEditorError",this.context=e,this.data=i}is(t){return"CKEditorError"===t}static rethrowUnexpectedError(t,e){if(t.is&&t.is("CKEditorError"))throw t;const i=new n(t.message,e);throw i.stack=t.stack,i}}function o(t){const e=t.match(/^([^:]+):/);return e?t+` Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-${e[1]}\n`:t}},function(t,e,i){"use strict";var n,o=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},r=function(){var t={};return function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}t[e]=i}return t[e]}}(),s=[];function a(t){for(var e=-1,i=0;i:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-editor__editable_inline.ck-blurred ::selection{background:var(--ck-color-editable-blur-selection)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-base-foreground)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-base-foreground)}"},function(t,e,i){var n=i(1),o=i(21);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}"},function(t,e,i){var n=i(1),o=i(23);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{z-index:var(--ck-z-modal);position:fixed;top:0}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{top:auto;position:absolute}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{box-shadow:var(--ck-drop-shadow),0 0;border-width:0 1px 1px;border-top-left-radius:0;border-top-right-radius:0}"},function(t,e,i){var n=i(1),o=i(25);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on .ck-tooltip{display:none}.ck.ck-dropdown .ck-dropdown__panel{-webkit-backface-visibility:hidden;display:none;z-index:var(--ck-z-modal);position:absolute}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{top:100%;bottom:auto}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se{left:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}:root{--ck-dropdown-arrow-size:calc(0.5*var(--ck-icon-size))}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{width:var(--ck-dropdown-arrow-size)}[dir=ltr] .ck.ck-dropdown .ck-dropdown__arrow{right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-standard)}[dir=rtl] .ck.ck-dropdown .ck-dropdown__arrow{left:var(--ck-spacing-standard);margin-right:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}[dir=ltr] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}[dir=rtl] .ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-right:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{width:7em;overflow:hidden;text-overflow:ellipsis}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-dropdown__button_label-width_auto .ck-button__label{width:auto}.ck.ck-dropdown__panel{border-radius:0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-dropdown__panel{box-shadow:var(--ck-drop-shadow),0 0;background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;min-width:100%}.ck.ck-dropdown__panel.ck-dropdown__panel_se{border-top-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_sw{border-top-right-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_ne{border-bottom-left-radius:0}.ck.ck-dropdown__panel.ck-dropdown__panel_nw{border-bottom-right-radius:0}"},function(t,e,i){var n=i(1),o=i(27);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{width:var(--ck-icon-size);height:var(--ck-icon-size);font-size:.8333350694em;will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon :not([fill]){fill:currentColor}"},function(t,e,i){var n=i(1),o=i(29);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports='.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{position:absolute;pointer-events:none;-webkit-backface-visibility:hidden}.ck.ck-tooltip{visibility:hidden;opacity:0;display:none;z-index:var(--ck-z-modal)}.ck.ck-tooltip .ck-tooltip__text{display:inline-block}.ck.ck-tooltip .ck-tooltip__text:after{content:"";width:0;height:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%;top:0;transition:opacity .2s ease-in-out .2s}.ck.ck-tooltip .ck-tooltip__text{border-radius:0}.ck-rounded-corners .ck.ck-tooltip .ck-tooltip__text,.ck.ck-tooltip .ck-tooltip__text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-tooltip .ck-tooltip__text{font-size:.9em;line-height:1.5;color:var(--ck-color-tooltip-text);padding:var(--ck-spacing-small) var(--ck-spacing-medium);background:var(--ck-color-tooltip-background);position:relative;left:-50%}.ck.ck-tooltip .ck-tooltip__text:after{transition:opacity .2s ease-in-out .2s;border-style:solid;left:50%}.ck.ck-tooltip.ck-tooltip_s{bottom:calc(-1*var(--ck-tooltip-arrow-size));transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after{top:calc(-1*var(--ck-tooltip-arrow-size));transform:translateX(-50%);border-left-color:transparent;border-bottom-color:var(--ck-color-tooltip-background);border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:0}.ck.ck-tooltip.ck-tooltip_n{top:calc(-1*var(--ck-tooltip-arrow-size));transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(-1*var(--ck-tooltip-arrow-size));transform:translateX(-50%);border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;border-top-color:var(--ck-color-tooltip-background);border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:0;border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}'},function(t,e,i){var n=i(1),o=i(31);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-button,a.ck.ck-button{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:block}@media (hover:none){.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:none}}.ck.ck-button,a.ck.ck-button{position:relative;display:inline-flex;align-items:center;justify-content:left}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{display:none}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:not(.ck-button_with-text),a.ck.ck-button:not(.ck-button_with-text){justify-content:center}.ck.ck-button:hover .ck-tooltip,a.ck.ck-button:hover .ck-tooltip{visibility:visible;opacity:1}.ck.ck-button:focus:not(:hover) .ck-tooltip,a.ck.ck-button:focus:not(:hover) .ck-tooltip{display:none}.ck.ck-button,a.ck.ck-button{background:var(--ck-color-button-default-background)}.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-default-active-shadow)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck.ck-button,a.ck.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button,a.ck.ck-button{white-space:nowrap;cursor:default;vertical-align:middle;padding:var(--ck-spacing-tiny);text-align:center;min-width:var(--ck-ui-component-min-height);min-height:var(--ck-ui-component-min-height);line-height:1;font-size:inherit;border:1px solid transparent;transition:box-shadow .2s ease-in-out,border .2s ease-in-out;-webkit-appearance:none}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{font-size:inherit;font-weight:inherit;color:inherit;cursor:inherit;vertical-align:middle}[dir=ltr] .ck.ck-button .ck-button__label,[dir=ltr] a.ck.ck-button .ck-button__label{text-align:left}[dir=rtl] .ck.ck-button .ck-button__label,[dir=rtl] a.ck.ck-button .ck-button__label{text-align:right}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{color:inherit}[dir=ltr] .ck.ck-button .ck-button__keystroke,[dir=ltr] a.ck.ck-button .ck-button__keystroke{margin-left:var(--ck-spacing-large)}[dir=rtl] .ck.ck-button .ck-button__keystroke,[dir=rtl] a.ck.ck-button .ck-button__keystroke{margin-right:var(--ck-spacing-large)}.ck.ck-button .ck-button__keystroke,a.ck.ck-button .ck-button__keystroke{font-weight:700;opacity:.7}.ck.ck-button.ck-disabled:active,.ck.ck-button.ck-disabled:focus,a.ck.ck-button.ck-disabled:active,a.ck.ck-button.ck-disabled:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__icon{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__keystroke,a.ck.ck-button.ck-disabled .ck-button__keystroke{opacity:.3}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}[dir=ltr] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=ltr] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:calc(-1*var(--ck-spacing-small));margin-right:var(--ck-spacing-small)}[dir=rtl] .ck.ck-button.ck-button_with-text .ck-button__icon,[dir=rtl] a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-right:calc(-1*var(--ck-spacing-small));margin-left:var(--ck-spacing-small)}.ck.ck-button.ck-button_with-keystroke .ck-button__label,a.ck.ck-button.ck-button_with-keystroke .ck-button__label{flex-grow:1}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background)}.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-hover-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-on-active-shadow)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background)}.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-action-active-shadow)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-action,a.ck.ck-button-action{color:var(--ck-color-button-action-text)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}"},function(t,e,i){var n=i(1),o=i(33);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-list{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:column}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{list-style-type:none;background:var(--ck-color-list-background)}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{min-height:unset;width:100%;text-align:left;border-radius:0;padding:calc(0.2*var(--ck-line-height-base)*var(--ck-font-size-base)) calc(0.4*var(--ck-line-height-base)*var(--ck-font-size-base))}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(1.2*var(--ck-line-height-base)*var(--ck-font-size-base))}.ck.ck-list__item .ck-button:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on{background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item .ck-button.ck-on:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item .ck-button.ck-on:focus:not(.ck-disabled){border-color:var(--ck-color-base-background)}.ck.ck-list__item .ck-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item .ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item .ck-switchbutton.ck-on:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck.ck-list__separator{height:1px;width:100%;background:var(--ck-color-base-border)}"},function(t,e,i){var n=i(1),o=i(35);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:1.0769230769em;--ck-switch-button-toggle-spacing:1px;--ck-switch-button-translation:calc(var(--ck-switch-button-toggle-width) - var(--ck-switch-button-toggle-inner-size) - 2*var(--ck-switch-button-toggle-spacing))}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(2*var(--ck-spacing-large))}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__label{margin-left:calc(2*var(--ck-spacing-large))}.ck.ck-button.ck-switchbutton .ck-button__toggle{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle.ck-rounded-corners{border-radius:var(--ck-border-radius)}[dir=ltr] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-left:auto}[dir=rtl] .ck.ck-button.ck-switchbutton .ck-button__toggle{margin-right:auto}.ck.ck-button.ck-switchbutton .ck-button__toggle{transition:background .4s ease;width:var(--ck-switch-button-toggle-width);background:var(--ck-color-switch-button-off-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:calc(0.5*var(--ck-border-radius))}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{margin:var(--ck-switch-button-toggle-spacing);width:var(--ck-switch-button-toggle-inner-size);height:var(--ck-switch-button-toggle-inner-size);background:var(--ck-color-switch-button-inner-background);transition:all .3s ease}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover{background:var(--ck-color-switch-button-off-hover-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle:hover .ck-button__toggle__inner{box-shadow:0 0 0 5px var(--ck-color-switch-button-inner-shadow)}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle{background:var(--ck-color-switch-button-on-background)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle:hover{background:var(--ck-color-switch-button-on-hover-background)}[dir=ltr] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(var(--ck-switch-button-translation))}[dir=rtl] .ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(calc(-1*var(--ck-switch-button-translation)))}"},function(t,e,i){var n=i(1),o=i(37);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-toolbar-dropdown .ck.ck-toolbar .ck.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar-dropdown .ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}"},function(t,e,i){var n=i(1),o=i(39);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}"},function(t,e,i){var n=i(1),o=i(41);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-toolbar{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-flow:row nowrap;align-items:center}.ck.ck-toolbar>.ck-toolbar__items{display:flex;flex-flow:row wrap;align-items:center;flex-grow:1}.ck.ck-toolbar .ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar .ck.ck-toolbar__separator:first-child,.ck.ck-toolbar .ck.ck-toolbar__separator:last-child{display:none}.ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating>.ck-toolbar__items{flex-wrap:nowrap}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck-dropdown__button .ck-dropdown__arrow{display:none}.ck.ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);padding:0 var(--ck-spacing-small);border:1px solid var(--ck-color-toolbar-border)}.ck.ck-toolbar .ck.ck-toolbar__separator{align-self:stretch;width:1px;min-width:1px;margin-top:0;margin-bottom:0;background:var(--ck-color-toolbar-border)}.ck.ck-toolbar>.ck-toolbar__items>*{margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small);margin-right:var(--ck-spacing-small)}.ck.ck-toolbar>.ck-toolbar__items:empty+.ck.ck-toolbar__separator{display:none}.ck.ck-toolbar>.ck-toolbar__items>*,.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown{margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>.ck-toolbar__items>.ck{width:100%;margin:0;border-radius:0;border:0}.ck.ck-toolbar.ck-toolbar_compact{padding:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>*{margin:0}.ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>:not(:first-child):not(:last-child){border-radius:0}.ck.ck-toolbar>.ck.ck-toolbar__grouped-dropdown>.ck.ck-button.ck-dropdown__button{padding-left:var(--ck-spacing-tiny)}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck{margin-right:0}.ck.ck-toolbar[dir=rtl]:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck,[dir=rtl] .ck.ck-toolbar:not(.ck-toolbar_compact)>.ck-toolbar__items>.ck{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl]>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-left:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=rtl].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=rtl] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=rtl]>.ck.ck-toolbar__separator,[dir=rtl] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=rtl].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=rtl] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-left:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr]>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar>.ck-toolbar__items>.ck:last-child{margin-right:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:first-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.ck.ck-toolbar[dir=ltr].ck-toolbar_compact>.ck-toolbar__items>.ck:last-child,[dir=ltr] .ck.ck-toolbar.ck-toolbar_compact>.ck-toolbar__items>.ck:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.ck.ck-toolbar[dir=ltr]>.ck.ck-toolbar__separator,[dir=ltr] .ck.ck-toolbar>.ck.ck-toolbar__separator{margin-right:var(--ck-spacing-small)}.ck.ck-toolbar[dir=ltr].ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child),[dir=ltr] .ck.ck-toolbar.ck-toolbar_grouping>.ck-toolbar__items:not(:empty):not(:only-child){margin-right:var(--ck-spacing-small)}"},function(t,e,i){var n=i(1),o=i(43);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-modal)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}"},function(t,e){t.exports=".ck-content code{background-color:hsla(0,0%,78%,.3);padding:.15em;border-radius:2px}"},function(t,e,i){var n=i(1),o=i(46);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck-editor__editable .ck-horizontal-line{overflow:hidden}.ck-content hr{border:solid #5e5e5e;border-width:1px 0 0;margin:0}.ck-editor__editable .ck-horizontal-line{padding:5px 0}"},function(t,e,i){var n=i(1),o=i(48);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck-content blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;margin-right:0;font-style:italic;border-left:5px solid #ccc}.ck-content[dir=rtl] blockquote{border-left:0;border-right:5px solid #ccc}"},function(t,e){t.exports=".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}"},function(t,e,i){var n=i(1),o=i(51);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=":root{--ck-color-resizer:var(--ck-color-focus-border);--ck-resizer-size:10px;--ck-resizer-border-width:1px;--ck-resizer-border-radius:2px;--ck-resizer-offset:calc(var(--ck-resizer-size)/-2 - 2px);--ck-resizer-tooltip-offset:10px;--ck-color-resizer-tooltip-background:#262626;--ck-color-resizer-tooltip-text:#f2f2f2}.ck .ck-widget.ck-widget_with-selection-handle{position:relative}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{position:absolute}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected .ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle:hover .ck-widget__selection-handle{visibility:visible}.ck .ck-size-view{background:var(--ck-color-resizer-tooltip-background);color:var(--ck-color-resizer-tooltip-text);border:1px solid var(--ck-color-resizer-tooltip-text);border-radius:var(--ck-resizer-border-radius);font-size:var(--ck-font-size-tiny);display:block;padding:var(--ck-spacing-small)}.ck .ck-size-view.ck-orientation-bottom-left,.ck .ck-size-view.ck-orientation-bottom-right,.ck .ck-size-view.ck-orientation-top-left,.ck .ck-size-view.ck-orientation-top-right{position:absolute}.ck .ck-size-view.ck-orientation-top-left{top:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-top-right{top:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-right{bottom:var(--ck-resizer-tooltip-offset);right:var(--ck-resizer-tooltip-offset)}.ck .ck-size-view.ck-orientation-bottom-left{bottom:var(--ck-resizer-tooltip-offset);left:var(--ck-resizer-tooltip-offset)}:root{--ck-widget-outline-thickness:3px;--ck-widget-handler-icon-size:16px;--ck-widget-handler-animation-duration:200ms;--ck-widget-handler-animation-curve:ease;--ck-color-widget-blurred-border:#dedede;--ck-color-widget-hover-border:#ffc83d;--ck-color-widget-editable-focus-background:var(--ck-color-base-background);--ck-color-widget-drag-handler-icon-color:var(--ck-color-base-background)}.ck .ck-widget{outline-width:var(--ck-widget-outline-thickness);outline-style:solid;outline-color:transparent;transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck .ck-widget:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;background-color:var(--ck-color-widget-editable-focus-background)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{padding:4px;box-sizing:border-box;background-color:transparent;opacity:0;transition:background-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),visibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;transform:translateY(-100%);left:calc(0px - var(--ck-widget-outline-thickness))}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon{width:var(--ck-widget-handler-icon-size);height:var(--ck-widget-handler-icon-size);color:var(--ck-color-widget-drag-handler-icon-color)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handle:hover .ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-widget-hover-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected .ck-widget__selection-handle,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover .ck-widget__selection-handle{opacity:1;background-color:var(--ck-color-focus-border)}.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handle.ck-widget_selected:hover .ck-widget__selection-handle .ck-icon .ck-icon__selected-indicator{opacity:1}.ck[dir=rtl] .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle{left:auto;right:calc(0px - var(--ck-widget-outline-thickness))}.ck.ck-editor__editable.ck-read-only .ck-widget{transition:none}.ck.ck-editor__editable.ck-read-only .ck-widget:not(.ck-widget_selected){--ck-widget-outline-thickness:0}.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-read-only .ck-widget.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected.ck-widget_with-selection-handle .ck-widget__selection-handle:hover,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle .ck-widget__selection-handle,.ck.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover.ck-widget_with-selection-handle .ck-widget__selection-handle:hover{background:var(--ck-color-widget-blurred-border)}.ck.ck-editor__editable>.ck-widget.ck-widget_with-selection-handle:first-child,.ck.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handle:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}"},function(t,e,i){var n=i(1),o=i(53);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-labeled-field-view .ck-labeled-field-view__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-field-view .ck-labeled-field-view__status_error{color:var(--ck-color-base-error)}.ck.ck-labeled-field-view>.ck.ck-label{width:100%;text-overflow:ellipsis;overflow:hidden}"},function(t,e,i){var n=i(1),o=i(55);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=":root{--ck-input-text-width:18em}.ck.ck-input-text{border-radius:0}.ck-rounded-corners .ck.ck-input-text,.ck.ck-input-text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-text{box-shadow:var(--ck-inner-shadow),0 0;background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);min-width:var(--ck-input-text-width);min-height:var(--ck-ui-component-min-height);transition:box-shadow .2s ease-in-out,border .2s ease-in-out}.ck.ck-input-text:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),var(--ck-inner-shadow)}.ck.ck-input-text[readonly]{border:1px solid var(--ck-color-input-disabled-border);background:var(--ck-color-input-disabled-background);color:var(--ck-color-input-disabled-text)}.ck.ck-input-text[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),var(--ck-inner-shadow)}.ck.ck-input-text.ck-error{border-color:var(--ck-color-input-error-border);animation:ck-text-input-shake .3s ease both}.ck.ck-input-text.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),var(--ck-inner-shadow)}@keyframes ck-text-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}"},function(t,e,i){var n=i(1),o=i(57);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-field-view{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}.ck.ck-text-alternative-form{padding:var(--ck-spacing-standard)}.ck.ck-text-alternative-form:focus{outline:none}[dir=ltr] .ck.ck-text-alternative-form>:not(:first-child),[dir=rtl] .ck.ck-text-alternative-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-text-alternative-form{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-text-alternative-form .ck-labeled-field-view{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-text-alternative-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-text-alternative-form .ck-button{padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-text-alternative-form .ck-button{margin-left:0}[dir=ltr] .ck.ck-text-alternative-form .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-text-alternative-form .ck-button{margin-left:0}[dir=rtl] .ck.ck-text-alternative-form .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}}"},function(t,e,i){var n=i(1),o=i(59);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=':root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-modal)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:"";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px}.ck.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{width:0;height:0;border-style:solid}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:var(--ck-balloon-arrow-height);border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:0}.ck.ck-balloon-panel[class*=arrow_n]:before{border-bottom-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-color:transparent;border-right-color:transparent;border-top-color:transparent}.ck.ck-balloon-panel[class*=arrow_n]:after{border-bottom-color:var(--ck-color-panel-background);margin-top:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:0;border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-top-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent}.ck.ck-balloon-panel[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background);margin-bottom:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(-1*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{left:50%;margin-left:calc(-1*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{left:calc(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{right:calc(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sme:before{right:25%;margin-right:calc(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_smw:before{left:25%;margin-left:calc(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nme:before{right:25%;margin-right:calc(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nmw:before{left:25%;margin-left:calc(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}'},function(t,e,i){var n=i(1),o=i(61);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck .ck-balloon-rotator__navigation{display:flex;align-items:center;justify-content:center}.ck .ck-balloon-rotator__content .ck-toolbar{justify-content:center}.ck .ck-balloon-rotator__navigation{background:var(--ck-color-toolbar-background);border-bottom:1px solid var(--ck-color-toolbar-border);padding:0 var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation>*{margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck .ck-balloon-rotator__navigation .ck-balloon-rotator__counter{margin-right:var(--ck-spacing-standard);margin-left:var(--ck-spacing-small)}.ck .ck-balloon-rotator__content .ck.ck-annotation-wrapper{box-shadow:none}"},function(t,e,i){var n=i(1),o=i(63);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck .ck-fake-panel{position:absolute;z-index:calc(var(--ck-z-modal) - 1)}.ck .ck-fake-panel div{position:absolute}.ck .ck-fake-panel div:first-child{z-index:2}.ck .ck-fake-panel div:nth-child(2){z-index:1}:root{--ck-balloon-fake-panel-offset-horizontal:6px;--ck-balloon-fake-panel-offset-vertical:6px}.ck .ck-fake-panel div{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border);border-radius:var(--ck-border-radius);width:100%;height:100%}.ck .ck-fake-panel div:first-child{margin-left:var(--ck-balloon-fake-panel-offset-horizontal);margin-top:var(--ck-balloon-fake-panel-offset-vertical)}.ck .ck-fake-panel div:nth-child(2){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*2);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*2)}.ck .ck-fake-panel div:nth-child(3){margin-left:calc(var(--ck-balloon-fake-panel-offset-horizontal)*3);margin-top:calc(var(--ck-balloon-fake-panel-offset-vertical)*3)}.ck .ck-balloon-panel_arrow_s+.ck-fake-panel,.ck .ck-balloon-panel_arrow_se+.ck-fake-panel,.ck .ck-balloon-panel_arrow_sw+.ck-fake-panel{--ck-balloon-fake-panel-offset-vertical:-6px}"},function(t,e,i){var n=i(1),o=i(65);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck-content .image{display:table;clear:both;text-align:center;margin:1em auto}.ck-content .image>img{display:block;margin:0 auto;max-width:100%;min-width:50px}"},function(t,e,i){var n=i(1),o=i(67);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck-content .image>figcaption{display:table-caption;caption-side:bottom;word-break:break-word;color:#333;background-color:#f7f7f7;padding:.6em;font-size:.75em;outline-offset:-1px}"},function(t,e,i){var n=i(1),o=i(69);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=":root{--ck-image-style-spacing:1.5em}.ck-content .image-style-align-center,.ck-content .image-style-align-left,.ck-content .image-style-align-right,.ck-content .image-style-side{max-width:50%}.ck-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing)}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}"},function(t,e,i){var n=i(1),o=i(71);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-editor__editable .image{position:relative}.ck.ck-editor__editable .image .ck-progress-bar{position:absolute;top:0;left:0}.ck.ck-editor__editable .image.ck-appear{animation:fadeIn .7s}.ck.ck-editor__editable .image .ck-progress-bar{height:2px;width:0;background:var(--ck-color-upload-bar-background);transition:width .1s}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}"},function(t,e,i){var n=i(1),o=i(73);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports='.ck-image-upload-complete-icon{display:block;position:absolute;top:10px;right:10px;border-radius:50%}.ck-image-upload-complete-icon:after{content:"";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20px;--ck-image-upload-icon-width:2px}.ck-image-upload-complete-icon{width:var(--ck-image-upload-icon-size);height:var(--ck-image-upload-icon-size);opacity:0;background:var(--ck-color-image-upload-icon-background);animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;animation-fill-mode:forwards,forwards;animation-duration:.5s,.5s;font-size:var(--ck-image-upload-icon-size);animation-delay:0ms,3s}.ck-image-upload-complete-icon:after{left:25%;top:50%;opacity:0;height:0;width:0;transform:scaleX(-1) rotate(135deg);transform-origin:left top;border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);animation-name:ck-upload-complete-icon-check;animation-duration:.5s;animation-delay:.5s;animation-fill-mode:forwards;box-sizing:border-box}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{opacity:1;width:0;height:0}33%{width:.3em;height:0}to{opacity:1;width:.3em;height:.45em}}'},function(t,e,i){var n=i(1),o=i(75);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports='.ck .ck-upload-placeholder-loader{position:absolute;display:flex;align-items:center;justify-content:center;top:0;left:0}.ck .ck-upload-placeholder-loader:before{content:"";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px}.ck .ck-image-upload-placeholder{width:100%;margin:0}.ck .ck-upload-placeholder-loader{width:100%;height:100%}.ck .ck-upload-placeholder-loader:before{width:var(--ck-upload-placeholder-loader-size);height:var(--ck-upload-placeholder-loader-size);border-radius:50%;border-top:3px solid var(--ck-color-upload-placeholder-loader);border-right:2px solid transparent;animation:ck-upload-placeholder-loader 1s linear infinite}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}'},function(t,e,i){var n=i(1),o=i(77);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}"},function(t,e,i){var n=i(1),o=i(79);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-link-form{display:flex}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-field-view{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form_layout-vertical{display:block}.ck.ck-link-form{padding:var(--ck-spacing-standard)}.ck.ck-link-form:focus{outline:none}[dir=ltr] .ck.ck-link-form>:not(:first-child),[dir=rtl] .ck.ck-link-form>:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-form{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-link-form .ck-labeled-field-view{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-form .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form .ck-button{padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-link-form .ck-button{margin-left:0}[dir=ltr] .ck.ck-link-form .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-link-form .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}}.ck.ck-link-form_layout-vertical{padding:0;min-width:var(--ck-input-text-width)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) var(--ck-spacing-small)}.ck.ck-link-form_layout-vertical .ck-labeled-field-view .ck-input-text{min-width:0;width:100%}.ck.ck-link-form_layout-vertical .ck-button{padding:var(--ck-spacing-standard);margin:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border);width:50%}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=ltr] .ck.ck-link-form_layout-vertical .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button{margin-left:0}[dir=rtl] .ck.ck-link-form_layout-vertical .ck-button:last-of-type{border-right:1px solid var(--ck-color-base-border)}.ck.ck-link-form_layout-vertical .ck.ck-list{margin-left:0}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton{border:0;width:100%}.ck.ck-link-form_layout-vertical .ck.ck-list .ck-button.ck-switchbutton:hover{background:none}"},function(t,e,i){var n=i(1),o=i(81);"string"==typeof(o=o.__esModule?o.default:o)&&(o=[[t.i,o,""]]);var r={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};n(o,r);t.exports=o.locals||{}},function(t,e){t.exports=".ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions{padding:var(--ck-spacing-standard)}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{padding:0 var(--ck-spacing-medium);color:var(--ck-color-link-default);text-overflow:ellipsis;cursor:pointer;max-width:var(--ck-input-text-width);min-width:3em;text-align:center}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}.ck.ck-link-actions:focus{outline:none}[dir=ltr] .ck.ck-link-actions .ck-button:not(:first-child),[dir=rtl] .ck.ck-link-actions .ck-button:not(:last-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{min-width:0;max-width:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}[dir=ltr] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview):first-of-type{border-right:1px solid var(--ck-color-base-border)}[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:0}[dir=rtl] .ck.ck-link-actions .ck-button:not(.ck-link-actions__preview):last-of-type{border-right:1px solid var(--ck-color-base-border)}}"},function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return zg}));var n=i(3),o=n.a.Symbol,r=Object.prototype,s=r.hasOwnProperty,a=r.toString,c=o?o.toStringTag:void 0;var l=function(t){var e=s.call(t,c),i=t[c];try{t[c]=void 0;var n=!0}catch(t){}var o=a.call(t);return n&&(e?t[c]=i:delete t[c]),o},d=Object.prototype.toString;var h=function(t){return d.call(t)},u=o?o.toStringTag:void 0;var f=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":u&&u in Object(t)?l(t):h(t)};var g=function(t,e){return function(i){return t(e(i))}},m=g(Object.getPrototypeOf,Object);var p=function(t){return null!=t&&"object"==typeof t},b=Function.prototype,w=Object.prototype,k=b.toString,_=w.hasOwnProperty,v=k.call(Object);var y=function(t){if(!p(t)||"[object Object]"!=f(t))return!1;var e=m(t);if(null===e)return!0;var i=_.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&k.call(i)==v};var x=function(){this.__data__=[],this.size=0};var A=function(t,e){return t===e||t!=t&&e!=e};var P=function(t,e){for(var i=t.length;i--;)if(A(t[i][0],e))return i;return-1},C=Array.prototype.splice;var T=function(t){var e=this.__data__,i=P(e,t);return!(i<0)&&(i==e.length-1?e.pop():C.call(e,i,1),--this.size,!0)};var S=function(t){var e=this.__data__,i=P(e,t);return i<0?void 0:e[i][1]};var E=function(t){return P(this.__data__,t)>-1};var O=function(t,e){var i=this.__data__,n=P(i,t);return n<0?(++this.size,i.push([t,e])):i[n][1]=e,this};function R(t){var e=-1,i=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991},zt={};zt["[object Float32Array]"]=zt["[object Float64Array]"]=zt["[object Int8Array]"]=zt["[object Int16Array]"]=zt["[object Int32Array]"]=zt["[object Uint8Array]"]=zt["[object Uint8ClampedArray]"]=zt["[object Uint16Array]"]=zt["[object Uint32Array]"]=!0,zt["[object Arguments]"]=zt["[object Array]"]=zt["[object ArrayBuffer]"]=zt["[object Boolean]"]=zt["[object DataView]"]=zt["[object Date]"]=zt["[object Error]"]=zt["[object Function]"]=zt["[object Map]"]=zt["[object Number]"]=zt["[object Object]"]=zt["[object RegExp]"]=zt["[object Set]"]=zt["[object String]"]=zt["[object WeakMap]"]=!1;var jt=function(t){return p(t)&&Lt(t.length)&&!!zt[f(t)]};var qt=function(t){return function(e){return t(e)}},Wt=i(5),Ht=Wt.a&&Wt.a.isTypedArray,Ut=Ht?qt(Ht):jt,$t=Object.prototype.hasOwnProperty;var Gt=function(t,e){var i=Vt(t),n=!i&&Nt(t),o=!i&&!n&&Object(Bt.a)(t),r=!i&&!n&&!o&&Ut(t),s=i||n||o||r,a=s?Et(t.length,String):[],c=a.length;for(var l in t)!e&&!$t.call(t,l)||s&&("length"==l||o&&("offset"==l||"parent"==l)||r&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Dt(l,c))||a.push(l);return a},Kt=Object.prototype;var Jt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Kt)},Qt=g(Object.keys,Object),Yt=Object.prototype.hasOwnProperty;var Xt=function(t){if(!Jt(t))return Qt(t);var e=[];for(var i in Object(t))Yt.call(t,i)&&"constructor"!=i&&e.push(i);return e};var Zt=function(t){return null!=t&&Lt(t.length)&&!L(t)};var te=function(t){return Zt(t)?Gt(t):Xt(t)};var ee=function(t,e){return t&&St(e,te(e),t)};var ie=function(t){var e=[];if(null!=t)for(var i in Object(t))e.push(i);return e},ne=Object.prototype.hasOwnProperty;var oe=function(t){if(!F(t))return ie(t);var e=Jt(t),i=[];for(var n in t)("constructor"!=n||!e&&ne.call(t,n))&&i.push(n);return i};var re=function(t){return Zt(t)?Gt(t,!0):oe(t)};var se=function(t,e){return t&&St(e,re(e),t)},ae=i(8);var ce=function(t,e){var i=-1,n=t.length;for(e||(e=Array(n));++i{this._setToTarget(t,n,e[n],i)})}}function oi(t){return ei(t,ri)}function ri(t){return ii(t)?t:void 0} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */var si=function(){return function t(){t.called=!0}}; -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class ai{constructor(t,e){this.source=t,this.name=e,this.path=[],this.stop=si(),this.off=si()}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */const ci=new Array(256).fill().map((t,e)=>("0"+e.toString(16)).slice(-2));function li(){const t=4294967296*Math.random()>>>0,e=4294967296*Math.random()>>>0,i=4294967296*Math.random()>>>0,n=4294967296*Math.random()>>>0;return"e"+ci[t>>0&255]+ci[t>>8&255]+ci[t>>16&255]+ci[t>>24&255]+ci[e>>0&255]+ci[e>>8&255]+ci[e>>16&255]+ci[e>>24&255]+ci[i>>0&255]+ci[i>>8&255]+ci[i>>16&255]+ci[i>>24&255]+ci[n>>0&255]+ci[n>>8&255]+ci[n>>16&255]+ci[n>>24&255]} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */var di={get(t){return"number"!=typeof t?this[t]||this.normal:t},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5},hi=(i(6),i(0)); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license +/* + * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). + * This devtool is neither made for production nor for readable output files. + * It uses "eval()" calls to create a separate source file in the browser devtools. + * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) + * or disable the default devtool with "devtool: false". + * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). */ -const ui=Symbol("listeningTo"),fi=Symbol("emitterId");var gi={on(t,e,i={}){this.listenTo(this,t,e,i)},once(t,e,i){let n=!1;this.listenTo(this,t,(function(t,...i){n||(n=!0,t.off(),e.call(this,t,...i))}),i)},off(t,e){this.stopListening(this,t,e)},listenTo(t,e,i,n={}){let o,r;this[ui]||(this[ui]={});const s=this[ui];pi(t)||mi(t);const a=pi(t);(o=s[a])||(o=s[a]={emitter:t,callbacks:{}}),(r=o.callbacks[e])||(r=o.callbacks[e]=[]),r.push(i),function(t,e){const i=bi(t);if(i[e])return;let n=e,o=null;const r=[];for(;""!==n&&!i[n];)i[n]={callbacks:[],childEvents:[]},r.push(i[n]),o&&i[n].childEvents.push(o),o=n,n=n.substr(0,n.lastIndexOf(":"));if(""!==n){for(const t of r)t.callbacks=i[n].callbacks.slice();i[n].childEvents.push(o)}}(t,e);const c=wi(t,e),l=di.get(n.priority),d={callback:i,priority:l};for(const t of c){let e=!1;for(let i=0;i-1?t(e,i.substr(0,i.lastIndexOf(":"))):null;return n.callbacks}(this,n);if(i.path.push(this),o){const t=[i,...e];o=Array.from(o);for(let e=0;e{this._delegations||(this._delegations=new Map),t.forEach(t=>{const n=this._delegations.get(t);n?n.set(e,i):this._delegations.set(t,new Map([[e,i]]))})}}},stopDelegating(t,e){if(this._delegations)if(t)if(e){const i=this._delegations.get(t);i&&i.delete(e)}else this._delegations.delete(t);else this._delegations.clear()}};function mi(t,e){t[fi]||(t[fi]=e||li())}function pi(t){return t[fi]}function bi(t){return t._events||Object.defineProperty(t,"_events",{value:{}}),t._events}function wi(t,e){const i=bi(t)[e];if(!i)return[];let n=[i.callbacks];for(let e=0;e{Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e)).forEach(i=>{if(i in t.prototype)return;const n=Object.getOwnPropertyDescriptor(e,i);n.enumerable=!1,Object.defineProperty(t.prototype,i,n)})})} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class xi{constructor(t={},e={}){const i=vi(t);if(i||(e=t),this._items=[],this._itemMap=new Map,this._idProperty=e.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],i)for(const e of t)this._items.push(e),this._itemMap.set(this._getItemIdBeforeAdding(e),e)}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(t,e){const i=this._getItemIdBeforeAdding(t);if(void 0===e)e=this._items.length;else if(e>this._items.length||e<0)throw new hi.b("collection-add-item-invalid-index",this);return this._items.splice(e,0,t),this._itemMap.set(i,t),this.fire("add",t,e),this}get(t){let e;if("string"==typeof t)e=this._itemMap.get(t);else{if("number"!=typeof t)throw new hi.b("collection-get-invalid-arg: Index or id must be given.",this);e=this._items[t]}return e||null}has(t){if("string"==typeof t)return this._itemMap.has(t);{const e=t[this._idProperty];return this._itemMap.has(e)}}getIndex(t){let e;return e="string"==typeof t?this._itemMap.get(t):t,this._items.indexOf(e)}remove(t){let e,i,n,o=!1;const r=this._idProperty;if("string"==typeof t?(i=t,n=this._itemMap.get(i),o=!n,n&&(e=this._items.indexOf(n))):"number"==typeof t?(e=t,n=this._items[e],o=!n,n&&(i=n[r])):(n=t,i=n[r],e=this._items.indexOf(n),o=-1==e||!this._itemMap.get(i)),o)throw new hi.b("collection-remove-404: Item not found.",this);this._items.splice(e,1),this._itemMap.delete(i);const s=this._bindToInternalToExternalMap.get(n);return this._bindToInternalToExternalMap.delete(n),this._bindToExternalToInternalMap.delete(s),this.fire("remove",n,e),n}map(t,e){return this._items.map(t,e)}find(t,e){return this._items.find(t,e)}filter(t,e){return this._items.filter(t,e)}clear(){for(this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);this.length;)this.remove(0)}bindTo(t){if(this._bindToCollection)throw new hi.b("collection-bind-to-rebind: The collection cannot be bound more than once.",this);return this._bindToCollection=t,{as:t=>{this._setUpBindToBinding(e=>new t(e))},using:t=>{"function"==typeof t?this._setUpBindToBinding(e=>t(e)):this._setUpBindToBinding(e=>e[t])}}}_setUpBindToBinding(t){const e=this._bindToCollection,i=(i,n,o)=>{const r=e._bindToCollection==this,s=e._bindToInternalToExternalMap.get(n);if(r&&s)this._bindToExternalToInternalMap.set(n,s),this._bindToInternalToExternalMap.set(s,n);else{const i=t(n);if(!i)return void this._skippedIndexesFromExternal.push(o);let r=o;for(const t of this._skippedIndexesFromExternal)o>t&&r--;for(const t of e._skippedIndexesFromExternal)r>=t&&r++;this._bindToExternalToInternalMap.set(n,i),this._bindToInternalToExternalMap.set(i,n),this.add(i,r);for(let t=0;t{const n=this._bindToExternalToInternalMap.get(e);n&&this.remove(n),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((t,e)=>(ie&&t.push(e),t),[])})}_getItemIdBeforeAdding(t){const e=this._idProperty;let i;if(e in t){if(i=t[e],"string"!=typeof i)throw new hi.b("collection-add-invalid-id",this);if(this.get(i))throw new hi.b("collection-add-item-already-exists",this)}else t[e]=i=li();return i}[Symbol.iterator](){return this._items[Symbol.iterator]()}}yi(xi,gi); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class Ai{constructor(t,e=[],i=[]){this._context=t,this._plugins=new Map,this._availablePlugins=new Map;for(const t of e)t.pluginName&&this._availablePlugins.set(t.pluginName,t);this._contextPlugins=new Map;for(const[t,e]of i)this._contextPlugins.set(t,e),this._contextPlugins.set(e,t),t.pluginName&&this._availablePlugins.set(t.pluginName,t)}*[Symbol.iterator](){for(const t of this._plugins)"function"==typeof t[0]&&(yield t)}get(t){const e=this._plugins.get(t);if(!e){const e="plugincollection-plugin-not-loaded: The requested plugin is not loaded.";let i=t;throw"function"==typeof t&&(i=t.pluginName||t.name),new hi.b(e,this._context,{plugin:i})}return e}has(t){return this._plugins.has(t)}init(t,e=[]){const i=this,n=this._context,o=new Set,r=[],s=u(t),a=u(e),c=function(t){const e=[];for(const i of t)h(i)||e.push(i);return e.length?e:null}(t);if(c){const t="plugincollection-plugin-not-found: Some plugins are not available and could not be loaded.";return console.error(Object(hi.a)(t),{plugins:c}),Promise.reject(new hi.b(t,n,{plugins:c}))}return Promise.all(s.map(l)).then(()=>d(r,"init")).then(()=>d(r,"afterInit")).then(()=>r);function l(t){if(!a.includes(t)&&!i._plugins.has(t)&&!o.has(t))return function(t){return new Promise(s=>{o.add(t),t.requires&&t.requires.forEach(i=>{const o=h(i);if(t.isContextPlugin&&!o.isContextPlugin)throw new hi.b("plugincollection-context-required: Context plugin can not require plugin which is not a context plugin",null,{plugin:o.name,requiredBy:t.name});if(e.includes(o))throw new hi.b("plugincollection-required: Cannot load a plugin because one of its dependencies is listed inthe `removePlugins` option.",n,{plugin:o.name,requiredBy:t.name});l(o)});const a=i._contextPlugins.get(t)||new t(n);i._add(t,a),r.push(a),s()})}(t).catch(e=>{throw console.error(Object(hi.a)("plugincollection-load: It was not possible to load the plugin."),{plugin:t}),e})}function d(t,e){return t.reduce((t,n)=>n[e]?i._contextPlugins.has(n)?t:t.then(n[e].bind(n)):t,Promise.resolve())}function h(t){return"function"==typeof t?t:i._availablePlugins.get(t)}function u(t){return t.map(t=>h(t)).filter(t=>!!t)}}destroy(){const t=[];for(const[,e]of this)"function"!=typeof e.destroy||this._contextPlugins.has(e)||t.push(e.destroy());return Promise.all(t)}_add(t,e){this._plugins.set(t,e);const i=t.pluginName;if(i){if(this._plugins.has(i))throw new hi.b("plugincollection-plugin-name-conflict: Two plugins with the same name were loaded.",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:t});this._plugins.set(i,e)}}}function Pi(t,e,i=1){if("number"!=typeof i)throw new hi.b("translation-service-quantity-not-a-number: Expecting `quantity` to be a number.",null,{quantity:i});const n=Object.keys(window.CKEDITOR_TRANSLATIONS).length;1===n&&(t=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]);const o=e.id||e.string;if(0===n||!function(t,e){return!!window.CKEDITOR_TRANSLATIONS[t]&&!!window.CKEDITOR_TRANSLATIONS[t].dictionary[e]}(t,o))return 1!==i?e.plural:e.string;const r=window.CKEDITOR_TRANSLATIONS[t].dictionary,s=window.CKEDITOR_TRANSLATIONS[t].getPluralForm||(t=>1===t?0:1);if("string"==typeof r[o])return r[o];const a=Number(s(i));return r[o][a]}yi(Ai,gi), -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -const Ci=["ar","fa","he","ku","ug"];class Ti{constructor(t={}){this.uiLanguage=t.uiLanguage||"en",this.contentLanguage=t.contentLanguage||this.uiLanguage,this.uiLanguageDirection=Si(this.uiLanguage),this.contentLanguageDirection=Si(this.contentLanguage),this.t=(t,e)=>this._t(t,e)}get language(){return console.warn("locale-deprecated-language-property: The Locale#language property has been deprecated and will be removed in the near future. Please use #uiLanguage and #contentLanguage properties instead."),this.uiLanguage}_t(t,e=[]){Array.isArray(e)||(e=[e]),"string"==typeof t&&(t={string:t});const i=!!t.plural?e[0]:1;return function(t,e){return t.replace(/%(\d+)/g,(t,i)=>it.destroy())).then(()=>this.plugins.destroy())}_addEditor(t,e){if(this._contextOwner)throw new hi.b("context-addEditor-private-context: Cannot add multiple editors to the context which is created by the editor.");this.editors.add(t),e&&(this._contextOwner=t)}_removeEditor(t){return this.editors.has(t)&&this.editors.remove(t),this._contextOwner===t?this.destroy():Promise.resolve()}_getEditorConfig(){const t={};for(const e of this.config.names())["plugins","removePlugins","extraPlugins"].includes(e)||(t[e]=this.config.get(e));return t}static create(t){return new Promise(e=>{const i=new this(t);e(i.initPlugins().then(()=>i))})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function Oi(t,e){const i=Math.min(t.length,e.length);for(let n=0;nt.data.length)throw new hi.b("view-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.",this);if(i<0||e+i>t.data.length)throw new hi.b("view-textproxy-wrong-length: Given length value is incorrect.",this);this.data=t.data.substring(e,e+i),this.offsetInText=e}get offsetSize(){return this.data.length}get isPartial(){return this.data.length!==this.textNode.data.length}get parent(){return this.textNode.parent}get root(){return this.textNode.root}get document(){return this.textNode.document}is(t){return"textProxy"===t||"view:textProxy"===t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let i=t.includeSelf?this.textNode:this.parent;for(;null!==i;)e[t.parentFirst?"push":"unshift"](i),i=i.parent;return e}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -function Vi(t){return vi(t)?new Map(t):function(t){const e=new Map;for(const i in t)e.set(i,t[i]);return e}(t)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Bi{constructor(...t){this._patterns=[],this.add(...t)}add(...t){for(let e of t)("string"==typeof e||e instanceof RegExp)&&(e={name:e}),e.classes&&("string"==typeof e.classes||e.classes instanceof RegExp)&&(e.classes=[e.classes]),this._patterns.push(e)}match(...t){for(const e of t)for(const t of this._patterns){const i=Fi(e,t);if(i)return{element:e,pattern:t,match:i}}return null}matchAll(...t){const e=[];for(const i of t)for(const t of this._patterns){const n=Fi(i,t);n&&e.push({element:i,pattern:t,match:n})}return e.length>0?e:null}getElementName(){if(1!==this._patterns.length)return null;const t=this._patterns[0],e=t.name;return"function"==typeof t||!e||e instanceof RegExp?null:e}}function Fi(t,e){if("function"==typeof e)return e(t);const i={};return e.name&&(i.name=function(t,e){if(t instanceof RegExp)return t.test(e);return t===e}(e.name,t.name),!i.name)||e.attributes&&(i.attributes=function(t,e){const i=[];for(const n in t){const o=t[n];if(!e.hasAttribute(n))return null;{const t=e.getAttribute(n);if(!0===o)i.push(n);else if(o instanceof RegExp){if(!o.test(t))return null;i.push(n)}else{if(t!==o)return null;i.push(n)}}}return i}(e.attributes,t),!i.attributes)?null:!(e.classes&&(i.classes=function(t,e){const i=[];for(const n of t)if(n instanceof RegExp){const t=e.getClassNames();for(const e of t)n.test(e)&&i.push(e);if(0===i.length)return null}else{if(!e.hasClass(n))return null;i.push(n)}return i}(e.classes,t),!i.classes))&&(!(e.styles&&(i.styles=function(t,e){const i=[];for(const n in t){const o=t[n];if(!e.hasStyle(n))return null;{const t=e.getStyle(n);if(o instanceof RegExp){if(!o.test(t))return null;i.push(n)}else{if(t!==o)return null;i.push(n)}}}return i}(e.styles,t),!i.styles))&&i)}var Di=function(t){return"symbol"==typeof t||p(t)&&"[object Symbol]"==f(t)},Li=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zi=/^\w*$/;var ji=function(t,e){if(Vt(t))return!1;var i=typeof t;return!("number"!=i&&"symbol"!=i&&"boolean"!=i&&null!=t&&!Di(t))||(zi.test(t)||!Li.test(t)||null!=e&&t in Object(e))};function qi(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var i=function(){var n=arguments,o=e?e.apply(this,n):n[0],r=i.cache;if(r.has(o))return r.get(o);var s=t.apply(this,n);return i.cache=r.set(o,s)||r,s};return i.cache=new(qi.Cache||kt),i}qi.Cache=kt;var Wi=qi;var Hi=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ui=/\\(\\)?/g,$i=function(t){var e=Wi(t,(function(t){return 500===i.size&&i.clear(),t})),i=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Hi,(function(t,i,n,o){e.push(n?o.replace(Ui,"$1"):i||t)})),e}));var Gi=function(t,e){for(var i=-1,n=null==t?0:t.length,o=Array(n);++io?0:o+e),(i=i>o?o:i)<0&&(i+=o),o=e>i?0:i-e>>>0,e>>>=0;for(var r=Array(o);++n0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(_n);var xn=function(t,e){return yn(wn(t,e,mn),t+"")};var An=function(t,e,i){if(!F(i))return!1;var n=typeof e;return!!("number"==n?Zt(i)&&Dt(e,i.length):"string"==n&&e in i)&&A(i[e],t)};var Pn=function(t){return xn((function(e,i){var n=-1,o=i.length,r=o>1?i[o-1]:void 0,s=o>2?i[2]:void 0;for(r=t.length>3&&"function"==typeof r?(o--,r):void 0,s&&An(i[0],i[1],s)&&(r=o<3?void 0:r,o=1),e=Object(e);++ne===t);return Array.isArray(e)}set(t,e){if(F(t))for(const[e,i]of Object.entries(t))this._styleProcessor.toNormalizedForm(e,i,this._styles);else this._styleProcessor.toNormalizedForm(t,e,this._styles)}remove(t){const e=Rn(t);sn(this._styles,e),delete this._styles[t],this._cleanEmptyObjectsOnPath(e)}getNormalized(t){return this._styleProcessor.getNormalized(t,this._styles)}toString(){return this.isEmpty?"":this._getStylesEntries().map(t=>t.join(":")).sort().join(";")+";"}getAsString(t){if(this.isEmpty)return;if(this._styles[t]&&!F(this._styles[t]))return this._styles[t];const e=this._styleProcessor.getReducedForm(t,this._styles).find(([e])=>e===t);return Array.isArray(e)?e[1]:void 0}getStyleNames(){if(this.isEmpty)return[];return this._getStylesEntries().map(([t])=>t)}clear(){this._styles={}}_getStylesEntries(){const t=[],e=Object.keys(this._styles);for(const i of e)t.push(...this._styleProcessor.getReducedForm(i,this._styles));return t}_cleanEmptyObjectsOnPath(t){const e=t.split(".");if(!(e.length>1))return;const i=e.splice(0,e.length-1).join("."),n=an(this._styles,i);n&&!Array.from(Object.keys(n)).length&&this.remove(i)}}class On{constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(t,e,i){if(F(e))In(i,Rn(t),e);else if(this._normalizers.has(t)){const n=this._normalizers.get(t),{path:o,value:r}=n(e);In(i,o,r)}else In(i,t,e)}getNormalized(t,e){if(!t)return Cn({},e);if(void 0!==e[t])return e[t];if(this._extractors.has(t)){const i=this._extractors.get(t);if("string"==typeof i)return an(e,i);const n=i(t,e);if(n)return n}return an(e,Rn(t))}getReducedForm(t,e){const i=this.getNormalized(t,e);if(void 0===i)return[];if(this._reducers.has(t)){return this._reducers.get(t)(i)}return[[t,i]]}getRelatedStyles(t){return this._consumables.get(t)||[]}setNormalizer(t,e){this._normalizers.set(t,e)}setExtractor(t,e){this._extractors.set(t,e)}setReducer(t,e){this._reducers.set(t,e)}setStyleRelation(t,e){this._mapStyleNames(t,e);for(const i of e)this._mapStyleNames(i,[t])}_mapStyleNames(t,e){this._consumables.has(t)||this._consumables.set(t,[]),this._consumables.get(t).push(...e)}}function Rn(t){return t.replace("-",".")}function In(t,e,i){let n=i;F(i)&&(n=Cn({},an(t,e),i)),Sn(t,e,n)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Mn extends Ii{constructor(t,e,i,n){if(super(t),this.name=e,this._attrs=function(t){t=Vi(t);for(const[e,i]of t)null===i?t.delete(e):"string"!=typeof i&&t.set(e,String(i));return t}(i),this._children=[],n&&this._insertChild(0,n),this._classes=new Set,this._attrs.has("class")){const t=this._attrs.get("class");Nn(this._classes,t),this._attrs.delete("class")}this._styles=new En(this.document.stylesProcessor),this._attrs.has("style")&&(this._styles.setTo(this._attrs.get("style")),this._attrs.delete("style")),this._customProperties=new Map}get childCount(){return this._children.length}get isEmpty(){return 0===this._children.length}is(t,e=null){return e?e===this.name&&("element"===t||"view:element"===t):t===this.name||t==="view:"+this.name||"element"===t||"view:element"===t||"node"===t||"view:node"===t}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}*getAttributeKeys(){this._classes.size>0&&(yield"class"),this._styles.isEmpty||(yield"style"),yield*this._attrs.keys()}*getAttributes(){yield*this._attrs.entries(),this._classes.size>0&&(yield["class",this.getAttribute("class")]),this._styles.isEmpty||(yield["style",this.getAttribute("style")])}getAttribute(t){if("class"==t)return this._classes.size>0?[...this._classes].join(" "):void 0;if("style"==t){const t=this._styles.toString();return""==t?void 0:t}return this._attrs.get(t)}hasAttribute(t){return"class"==t?this._classes.size>0:"style"==t?!this._styles.isEmpty:this._attrs.has(t)}isSimilar(t){if(!(t instanceof Mn))return!1;if(this===t)return!0;if(this.name!=t.name)return!1;if(this._attrs.size!==t._attrs.size||this._classes.size!==t._classes.size||this._styles.size!==t._styles.size)return!1;for(const[e,i]of this._attrs)if(!t._attrs.has(e)||t._attrs.get(e)!==i)return!1;for(const e of this._classes)if(!t._classes.has(e))return!1;for(const e of this._styles.getStyleNames())if(!t._styles.has(e)||t._styles.getAsString(e)!==this._styles.getAsString(e))return!1;return!0}hasClass(...t){for(const e of t)if(!this._classes.has(e))return!1;return!0}getClassNames(){return this._classes.keys()}getStyle(t){return this._styles.getAsString(t)}getNormalizedStyle(t){return this._styles.getNormalized(t)}getStyleNames(){return this._styles.getStyleNames()}hasStyle(...t){for(const e of t)if(!this._styles.has(e))return!1;return!0}findAncestor(...t){const e=new Bi(...t);let i=this.parent;for(;i;){if(e.match(i))return i;i=i.parent}return null}getCustomProperty(t){return this._customProperties.get(t)}*getCustomProperties(){yield*this._customProperties.entries()}getIdentity(){const t=Array.from(this._classes).sort().join(","),e=this._styles.toString(),i=Array.from(this._attrs).map(t=>`${t[0]}="${t[1]}"`).sort().join(" ");return this.name+(""==t?"":` class="${t}"`)+(e?` style="${e}"`:"")+(""==i?"":" "+i)}_clone(t=!1){const e=[];if(t)for(const i of this.getChildren())e.push(i._clone(t));const i=new this.constructor(this.document,this.name,this._attrs,e);return i._classes=new Set(this._classes),i._styles.set(this._styles.getNormalized()),i._customProperties=new Map(this._customProperties),i.getFillerOffset=this.getFillerOffset,i}_appendChild(t){return this._insertChild(this.childCount,t)}_insertChild(t,e){this._fireChange("children",this);let i=0;const n=function(t,e){if("string"==typeof e)return[new Mi(t,e)];vi(e)||(e=[e]);return Array.from(e).map(e=>"string"==typeof e?new Mi(t,e):e instanceof Ni?new Mi(t,e.data):e)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(this.document,e);for(const e of n)null!==e.parent&&e._remove(),e.parent=this,e.document=this.document,this._children.splice(t,0,e),t++,i++;return i}_removeChildren(t,e=1){this._fireChange("children",this);for(let i=t;i0&&(this._classes.clear(),!0):"style"==t?!this._styles.isEmpty&&(this._styles.clear(),!0):this._attrs.delete(t)}_addClass(t){this._fireChange("attributes",this),(t=Array.isArray(t)?t:[t]).forEach(t=>this._classes.add(t))}_removeClass(t){this._fireChange("attributes",this),(t=Array.isArray(t)?t:[t]).forEach(t=>this._classes.delete(t))}_setStyle(t,e){this._fireChange("attributes",this),this._styles.set(t,e)}_removeStyle(t){this._fireChange("attributes",this),(t=Array.isArray(t)?t:[t]).forEach(t=>this._styles.remove(t))}_setCustomProperty(t,e){this._customProperties.set(t,e)}_removeCustomProperty(t){return this._customProperties.delete(t)}}function Nn(t,e){const i=e.split(/\s+/);t.clear(),i.forEach(e=>t.add(e))}class Vn extends Mn{constructor(t,e,i,n){super(t,e,i,n),this.getFillerOffset=Bn}is(t,e=null){return e?e===this.name&&("containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"containerElement"===t||"view:containerElement"===t||t===this.name||t==="view:"+this.name||"element"===t||"view:element"===t||"node"===t||"view:node"===t}}function Bn(){const t=[...this.getChildren()],e=t[this.childCount-1];if(e&&e.is("element","br"))return this.childCount;for(const e of t)if(!e.is("uiElement"))return null;return this.childCount}var Fn=Pn((function(t,e){St(e,re(e),t)})); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -const Dn=Symbol("observableProperties"),Ln=Symbol("boundObservables"),zn=Symbol("boundProperties"),jn={set(t,e){if(F(t))return void Object.keys(t).forEach(e=>{this.set(e,t[e])},this);Wn(this);const i=this[Dn];if(t in this&&!i.has(t))throw new hi.b("observable-set-cannot-override: Cannot override an existing property.",this);Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get:()=>i.get(t),set(e){const n=i.get(t);let o=this.fire("set:"+t,t,e,n);void 0===o&&(o=e),n===o&&i.has(t)||(i.set(t,o),this.fire("change:"+t,t,o,n))}}),this[t]=e},bind(...t){if(!t.length||!$n(t))throw new hi.b("observable-bind-wrong-properties: All properties must be strings.",this);if(new Set(t).size!==t.length)throw new hi.b("observable-bind-duplicate-properties: Properties must be unique.",this);Wn(this);const e=this[zn];t.forEach(t=>{if(e.has(t))throw new hi.b("observable-bind-rebind: Cannot bind the same property more than once.",this)});const i=new Map;return t.forEach(t=>{const n={property:t,to:[]};e.set(t,n),i.set(t,n)}),{to:Hn,toMany:Un,_observable:this,_bindProperties:t,_to:[],_bindings:i}},unbind(...t){if(!this[Dn])return;const e=this[zn],i=this[Ln];if(t.length){if(!$n(t))throw new hi.b("observable-unbind-wrong-properties: Properties must be strings.",this);t.forEach(t=>{const n=e.get(t);if(!n)return;let o,r,s,a;n.to.forEach(t=>{o=t[0],r=t[1],s=i.get(o),a=s[r],a.delete(n),a.size||delete s[r],Object.keys(s).length||(i.delete(o),this.stopListening(o,"change"))}),e.delete(t)})}else i.forEach((t,e)=>{this.stopListening(e,"change")}),i.clear(),e.clear()},decorate(t){const e=this[t];if(!e)throw new hi.b("observablemixin-cannot-decorate-undefined: Cannot decorate an undefined method.",this,{object:this,methodName:t});this.on(t,(t,i)=>{t.return=e.apply(this,i)}),this[t]=function(...e){return this.fire(t,e)}}};Fn(jn,gi);var qn=jn;function Wn(t){t[Dn]||(Object.defineProperty(t,Dn,{value:new Map}),Object.defineProperty(t,Ln,{value:new Map}),Object.defineProperty(t,zn,{value:new Map}))}function Hn(...t){const e=function(...t){if(!t.length)throw new hi.b("observable-bind-to-parse-error: Invalid argument syntax in `to()`.",null);const e={to:[]};let i;"function"==typeof t[t.length-1]&&(e.callback=t.pop());return t.forEach(t=>{if("string"==typeof t)i.properties.push(t);else{if("object"!=typeof t)throw new hi.b("observable-bind-to-parse-error: Invalid argument syntax in `to()`.",null);i={observable:t,properties:[]},e.to.push(i)}}),e}(...t),i=Array.from(this._bindings.keys()),n=i.length;if(!e.callback&&e.to.length>1)throw new hi.b("observable-bind-to-no-callback: Binding multiple observables only possible with callback.",this);if(n>1&&e.callback)throw new hi.b("observable-bind-to-extra-callback: Cannot bind multiple properties and use a callback in one binding.",this);var o; -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */e.to.forEach(t=>{if(t.properties.length&&t.properties.length!==n)throw new hi.b("observable-bind-to-properties-length: The number of properties must match.",this);t.properties.length||(t.properties=this._bindProperties)}),this._to=e.to,e.callback&&(this._bindings.get(i[0]).callback=e.callback),o=this._observable,this._to.forEach(t=>{const e=o[Ln];let i;e.get(t.observable)||o.listenTo(t.observable,"change",(n,r)=>{i=e.get(t.observable)[r],i&&i.forEach(t=>{Gn(o,t.property)})})}),function(t){let e;t._bindings.forEach((i,n)=>{t._to.forEach(o=>{e=o.properties[i.callback?0:t._bindProperties.indexOf(n)],i.to.push([o.observable,e]),function(t,e,i,n){const o=t[Ln],r=o.get(i),s=r||{};s[n]||(s[n]=new Set);s[n].add(e),r||o.set(i,s)}(t._observable,i,o.observable,e)})})}(this),this._bindProperties.forEach(t=>{Gn(this._observable,t)})}function Un(t,e,i){if(this._bindings.size>1)throw new hi.b("observable-bind-to-many-not-one-binding: Cannot bind multiple properties with toMany().",this);this.to(...function(t,e){const i=t.map(t=>[t,e]);return Array.prototype.concat.apply([],i)}(t,e),i)}function $n(t){return t.every(t=>"string"==typeof t)}function Gn(t,e){const i=t[zn].get(e);let n;i.callback?n=i.callback.apply(t,i.to.map(t=>t[0][t[1]])):(n=i.to[0],n=n[0][n[1]]),t.hasOwnProperty(e)?t[e]=n:t.set(e,n)}class Kn extends Vn{constructor(t,e,i,n){super(t,e,i,n),this.set("isReadOnly",!1),this.set("isFocused",!1),this.bind("isReadOnly").to(t),this.bind("isFocused").to(t,"isFocused",e=>e&&t.selection.editableElement==this),this.listenTo(t.selection,"change",()=>{this.isFocused=t.isFocused&&t.selection.editableElement==this})}is(t,e=null){return e?e===this.name&&("editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||t===this.name||t==="view:"+this.name||"element"===t||"view:element"===t||"node"===t||"view:node"===t}destroy(){this.stopListening()}}yi(Kn,qn); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -const Jn=Symbol("rootName");class Qn extends Kn{constructor(t,e){super(t,e),this.rootName="main"}is(t,e=null){return e?e===this.name&&("rootElement"===t||"view:rootElement"===t||"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||"element"===t||"view:element"===t):"rootElement"===t||"view:rootElement"===t||"editableElement"===t||"view:editableElement"===t||"containerElement"===t||"view:containerElement"===t||t===this.name||t==="view:"+this.name||"element"===t||"view:element"===t||"node"===t||"view:node"===t}get rootName(){return this.getCustomProperty(Jn)}set rootName(t){this._setCustomProperty(Jn,t)}set _name(t){this.name=t}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Yn{constructor(t={}){if(!t.boundaries&&!t.startPosition)throw new hi.b("view-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.",null);if(t.direction&&"forward"!=t.direction&&"backward"!=t.direction)throw new hi.b("view-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.",t.startPosition,{direction:t.direction});this.boundaries=t.boundaries||null,t.startPosition?this.position=Xn._createAt(t.startPosition):this.position=Xn._createAt(t.boundaries["backward"==t.direction?"end":"start"]),this.direction=t.direction||"forward",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}skip(t){let e,i,n;do{n=this.position,({done:e,value:i}=this.next())}while(!e&&t(i));e||(this.position=n)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){let t=this.position.clone();const e=this.position,i=t.parent;if(null===i.parent&&t.offset===i.childCount)return{done:!0};if(i===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};let n;if(i instanceof Mi){if(t.isAtEnd)return this.position=Xn._createAfter(i),this._next();n=i.data[t.offset]}else n=i.getChild(t.offset);if(n instanceof Mn)return this.shallow?t.offset++:t=new Xn(n,0),this.position=t,this._formatReturnValue("elementStart",n,e,t,1);if(n instanceof Mi){if(this.singleCharacters)return t=new Xn(n,0),this.position=t,this._next();{let i,o=n.data.length;return n==this._boundaryEndParent?(o=this.boundaries.end.offset,i=new Ni(n,0,o),t=Xn._createAfter(i)):(i=new Ni(n,0,n.data.length),t.offset++),this.position=t,this._formatReturnValue("text",i,e,t,o)}}if("string"==typeof n){let n;if(this.singleCharacters)n=1;else{n=(i===this._boundaryEndParent?this.boundaries.end.offset:i.data.length)-t.offset}const o=new Ni(i,t.offset,n);return t.offset+=n,this.position=t,this._formatReturnValue("text",o,e,t,n)}return t=Xn._createAfter(i),this.position=t,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",i,e,t)}_previous(){let t=this.position.clone();const e=this.position,i=t.parent;if(null===i.parent&&0===t.offset)return{done:!0};if(i==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0};let n;if(i instanceof Mi){if(t.isAtStart)return this.position=Xn._createBefore(i),this._previous();n=i.data[t.offset-1]}else n=i.getChild(t.offset-1);if(n instanceof Mn)return this.shallow?(t.offset--,this.position=t,this._formatReturnValue("elementStart",n,e,t,1)):(t=new Xn(n,n.childCount),this.position=t,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",n,e,t));if(n instanceof Mi){if(this.singleCharacters)return t=new Xn(n,n.data.length),this.position=t,this._previous();{let i,o=n.data.length;if(n==this._boundaryStartParent){const e=this.boundaries.start.offset;i=new Ni(n,e,n.data.length-e),o=i.data.length,t=Xn._createBefore(i)}else i=new Ni(n,0,n.data.length),t.offset--;return this.position=t,this._formatReturnValue("text",i,e,t,o)}}if("string"==typeof n){let n;if(this.singleCharacters)n=1;else{const e=i===this._boundaryStartParent?this.boundaries.start.offset:0;n=t.offset-e}t.offset-=n;const o=new Ni(i,t.offset,n);return this.position=t,this._formatReturnValue("text",o,e,t,n)}return t=Xn._createBefore(i),this.position=t,this._formatReturnValue("elementStart",i,e,t,1)}_formatReturnValue(t,e,i,n,o){return e instanceof Ni&&(e.offsetInText+e.data.length==e.textNode.data.length&&("forward"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?i=Xn._createAfter(e.textNode):(n=Xn._createAfter(e.textNode),this.position=n)),0===e.offsetInText&&("backward"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?i=Xn._createBefore(e.textNode):(n=Xn._createBefore(e.textNode),this.position=n))),{done:!1,value:{type:t,item:e,previousPosition:i,nextPosition:n,length:o}}}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Xn{constructor(t,e){this.parent=t,this.offset=e}get nodeAfter(){return this.parent.is("text")?null:this.parent.getChild(this.offset)||null}get nodeBefore(){return this.parent.is("text")?null:this.parent.getChild(this.offset-1)||null}get isAtStart(){return 0===this.offset}get isAtEnd(){const t=this.parent.is("text")?this.parent.data.length:this.parent.childCount;return this.offset===t}get root(){return this.parent.root}get editableElement(){let t=this.parent;for(;!(t instanceof Kn);){if(!t.parent)return null;t=t.parent}return t}getShiftedBy(t){const e=Xn._createAt(this),i=e.offset+t;return e.offset=i<0?0:i,e}getLastMatchingPosition(t,e={}){e.startPosition=this;const i=new Yn(e);return i.skip(t),i.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(t){const e=this.getAncestors(),i=t.getAncestors();let n=0;for(;e[n]==i[n]&&e[n];)n++;return 0===n?null:e[n-1]}is(t){return"position"===t||"view:position"===t}isEqual(t){return this.parent==t.parent&&this.offset==t.offset}isBefore(t){return"before"==this.compareWith(t)}isAfter(t){return"after"==this.compareWith(t)}compareWith(t){if(this.root!==t.root)return"different";if(this.isEqual(t))return"same";const e=this.parent.is("node")?this.parent.getPath():[],i=t.parent.is("node")?t.parent.getPath():[];e.push(this.offset),i.push(t.offset);const n=Oi(e,i);switch(n){case"prefix":return"before";case"extension":return"after";default:return e[n]0?new this(i,n):new this(n,i)}static _createIn(t){return this._createFromParentsAndOffsets(t,0,t,t.childCount)}static _createOn(t){const e=t.is("textProxy")?t.offsetSize:1;return this._createFromPositionAndShift(Xn._createBefore(t),e)}}function to(t){return!(!t.item.is("attributeElement")&&!t.item.is("uiElement"))} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function eo(t){let e=0;for(const i of t)e++;return e} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class io{constructor(t=null,e,i){this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",this.setTo(t,e,i)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.end:t.start).clone()}get focus(){if(!this._ranges.length)return null;const t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.start:t.end).clone()}get isCollapsed(){return 1===this.rangeCount&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}get editableElement(){return this.anchor?this.anchor.editableElement:null}*getRanges(){for(const t of this._ranges)yield t.clone()}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?t.clone():null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?t.clone():null}getFirstPosition(){const t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){const t=this.getLastRange();return t?t.end.clone():null}isEqual(t){if(this.isFake!=t.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=t.fakeSelectionLabel)return!1;if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let i=!1;for(const n of t._ranges)if(e.isEqual(n)){i=!0;break}if(!i)return!1}return!0}isSimilar(t){if(this.isBackward!=t.isBackward)return!1;const e=eo(this.getRanges());if(e!=eo(t.getRanges()))return!1;if(0==e)return!0;for(let e of this.getRanges()){e=e.getTrimmed();let i=!1;for(let n of t.getRanges())if(n=n.getTrimmed(),e.start.isEqual(n.start)&&e.end.isEqual(n.end)){i=!0;break}if(!i)return!1}return!0}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}setTo(t,e,i){if(null===t)this._setRanges([]),this._setFakeOptions(e);else if(t instanceof io||t instanceof no)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof Zn)this._setRanges([t],e&&e.backward),this._setFakeOptions(e);else if(t instanceof Xn)this._setRanges([new Zn(t)]),this._setFakeOptions(e);else if(t instanceof Ii){const n=!!i&&!!i.backward;let o;if(void 0===e)throw new hi.b("view-selection-setTo-required-second-parameter: selection.setTo requires the second parameter when the first parameter is a node.",this);o="in"==e?Zn._createIn(t):"on"==e?Zn._createOn(t):new Zn(Xn._createAt(t,e)),this._setRanges([o],n),this._setFakeOptions(i)}else{if(!vi(t))throw new hi.b("view-selection-setTo-not-selectable: Cannot set selection to given place.",this);this._setRanges(t,e&&e.backward),this._setFakeOptions(e)}this.fire("change")}setFocus(t,e){if(null===this.anchor)throw new hi.b("view-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.",this);const i=Xn._createAt(t,e);if("same"==i.compareWith(this.focus))return;const n=this.anchor;this._ranges.pop(),"before"==i.compareWith(n)?this._addRange(new Zn(i,n),!0):this._addRange(new Zn(n,i)),this.fire("change")}is(t){return"selection"===t||"view:selection"===t}_setRanges(t,e=!1){t=Array.from(t),this._ranges=[];for(const e of t)this._addRange(e);this._lastRangeBackward=!!e}_setFakeOptions(t={}){this._isFake=!!t.fake,this._fakeSelectionLabel=t.fake&&t.label||""}_addRange(t,e=!1){if(!(t instanceof Zn))throw new hi.b("view-selection-add-range-not-range: Selection range set to an object that is not an instance of view.Range",this);this._pushRange(t),this._lastRangeBackward=!!e}_pushRange(t){for(const e of this._ranges)if(t.isIntersecting(e))throw new hi.b("view-selection-range-intersects: Trying to add a range that intersects with another range from selection.",this,{addedRange:t,intersectingRange:e});this._ranges.push(new Zn(t.start,t.end))}}yi(io,gi); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class no{constructor(t=null,e,i){this._selection=new io,this._selection.delegate("change").to(this),this._selection.setTo(t,e,i)}get isFake(){return this._selection.isFake}get fakeSelectionLabel(){return this._selection.fakeSelectionLabel}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get isCollapsed(){return this._selection.isCollapsed}get rangeCount(){return this._selection.rangeCount}get isBackward(){return this._selection.isBackward}get editableElement(){return this._selection.editableElement}get _ranges(){return this._selection._ranges}*getRanges(){yield*this._selection.getRanges()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getSelectedElement(){return this._selection.getSelectedElement()}isEqual(t){return this._selection.isEqual(t)}isSimilar(t){return this._selection.isSimilar(t)}is(t){return"selection"===t||"documentSelection"==t||"view:selection"==t||"view:documentSelection"==t}_setTo(t,e,i){this._selection.setTo(t,e,i)}_setFocus(t,e){this._selection.setFocus(t,e)}}yi(no,gi); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class oo{constructor(t){this.selection=new no,this.roots=new xi({idProperty:"rootName"}),this.stylesProcessor=t,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isComposing",!1),this._postFixers=new Set}getRoot(t="main"){return this.roots.get(t)}registerPostFixer(t){this._postFixers.add(t)}destroy(){this.roots.map(t=>t.destroy()),this.stopListening()}_callPostFixers(t){let e=!1;do{for(const i of this._postFixers)if(e=i(t),e)break}while(e)}}yi(oo,qn);class ro extends Mn{constructor(t,e,i,n){super(t,e,i,n),this.getFillerOffset=so,this._priority=10,this._id=null,this._clonesGroup=null}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(null===this.id)throw new hi.b("attribute-element-get-elements-with-same-id-no-id: Cannot get elements with the same id for an attribute element without id.",this);return new Set(this._clonesGroup)}is(t,e=null){return e?e===this.name&&("attributeElement"===t||"view:attributeElement"===t||"element"===t||"view:element"===t):"attributeElement"===t||"view:attributeElement"===t||t===this.name||t==="view:"+this.name||"element"===t||"view:element"===t||"node"===t||"view:node"===t}isSimilar(t){return null!==this.id||null!==t.id?this.id===t.id:super.isSimilar(t)&&this.priority==t.priority}_clone(t){const e=super._clone(t);return e._priority=this._priority,e._id=this._id,e}}function so(){if(ao(this))return null;let t=this.parent;for(;t&&t.is("attributeElement");){if(ao(t)>1)return null;t=t.parent}return!t||ao(t)>1?null:this.childCount}function ao(t){return Array.from(t.getChildren()).filter(t=>!t.is("uiElement")).length} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ro.DEFAULT_PRIORITY=10;class co extends Mn{constructor(t,e,i,n){super(t,e,i,n),this.getFillerOffset=lo}is(t,e=null){return e?e===this.name&&("emptyElement"===t||"view:emptyElement"===t||"element"===t||"view:element"===t):"emptyElement"===t||"view:emptyElement"===t||t===this.name||t==="view:"+this.name||"element"===t||"view:element"===t||"node"===t||"view:node"===t}_insertChild(t,e){if(e&&(e instanceof Ii||Array.from(e).length>0))throw new hi.b("view-emptyelement-cannot-add: Cannot add child nodes to EmptyElement instance.",[this,e])}}function lo(){return null} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */const ho=navigator.userAgent.toLowerCase();var uo={isMac:function(t){return t.indexOf("macintosh")>-1}(ho),isGecko:function(t){return!!t.match(/gecko\/\d+/)}(ho),isSafari:function(t){return t.indexOf(" applewebkit/")>-1&&-1===t.indexOf("chrome")}(ho),isAndroid:function(t){return t.indexOf("android")>-1}(ho),features:{isRegExpUnicodePropertySupported:function(){let t=!1;try{t=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch(t){}return t} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */()}};const fo={"⌘":"ctrl","⇧":"shift","⌥":"alt"},go={ctrl:"⌘",shift:"⇧",alt:"⌥"},mo=function(){const t={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,cmd:1114112,shift:2228224,alt:4456448};for(let e=65;e<=90;e++){const i=String.fromCharCode(e);t[i.toLowerCase()]=e}for(let e=48;e<=57;e++)t[e-48]=e;for(let e=112;e<=123;e++)t["f"+(e-111)]=e;return t}();function po(t){let e;if("string"==typeof t){if(e=mo[t.toLowerCase()],!e)throw new hi.b("keyboard-unknown-key: Unknown key name.",null,{key:t})}else e=t.keyCode+(t.altKey?mo.alt:0)+(t.ctrlKey?mo.ctrl:0)+(t.shiftKey?mo.shift:0);return e}function bo(t){return"string"==typeof t&&(t=ko(t)),t.map(t=>"string"==typeof t?po(t):t).reduce((t,e)=>e+t,0)}function wo(t){return uo.isMac?ko(t).map(t=>go[t.toLowerCase()]||t).reduce((t,e)=>t.slice(-1)in fo?t+e:t+"+"+e):t}function ko(t){return t.split(/\s*\+\s*/)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class _o extends Mn{constructor(t,e,i,n){super(t,e,i,n),this.getFillerOffset=yo}is(t,e=null){return e?e===this.name&&("uiElement"===t||"view:uiElement"===t||"element"===t||"view:element"===t):"uiElement"===t||"view:uiElement"===t||t===this.name||t==="view:"+this.name||"element"===t||"view:element"===t||"node"===t||"view:node"===t}_insertChild(t,e){if(e&&(e instanceof Ii||Array.from(e).length>0))throw new hi.b("view-uielement-cannot-add: Cannot add child nodes to UIElement instance.",this)}render(t){return this.toDomElement(t)}toDomElement(t){const e=t.createElement(this.name);for(const t of this.getAttributeKeys())e.setAttribute(t,this.getAttribute(t));return e}}function vo(t){t.document.on("keydown",(e,i)=>function(t,e,i){if(e.keyCode==mo.arrowright){const t=e.domTarget.ownerDocument.defaultView.getSelection(),n=1==t.rangeCount&&t.getRangeAt(0).collapsed;if(n||e.shiftKey){const e=t.focusNode,o=t.focusOffset,r=i.domPositionToView(e,o);if(null===r)return;let s=!1;const a=r.getLastMatchingPosition(t=>(t.item.is("uiElement")&&(s=!0),!(!t.item.is("uiElement")&&!t.item.is("attributeElement"))));if(s){const e=i.viewPositionToDom(a);n?t.collapse(e.parent,e.offset):t.extend(e.parent,e.offset)}}}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(0,i,t.domConverter))}function yo(){return null}class xo{constructor(t,e){this.document=t,this._children=[],e&&this._insertChild(0,e)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(t){return"documentFragment"===t||"view:documentFragment"===t}_appendChild(t){return this._insertChild(this.childCount,t)}getChild(t){return this._children[t]}getChildIndex(t){return this._children.indexOf(t)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(t,e){this._fireChange("children",this);let i=0;const n=function(t,e){if("string"==typeof e)return[new Mi(t,e)];vi(e)||(e=[e]);return Array.from(e).map(e=>"string"==typeof e?new Mi(t,e):e instanceof Ni?new Mi(t,e.data):e)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(this.document,e);for(const e of n)null!==e.parent&&e._remove(),e.parent=this,this._children.splice(t,0,e),t++,i++;return i}_removeChildren(t,e=1){this._fireChange("children",this);for(let i=t;in instanceof t))throw new hi.b("view-writer-insert-invalid-node",i);n.is("text")||t(n.getChildren(),i)}})(e=vi(e)?[...e]:[e],this.document);const i=Po(t);if(!i)throw new hi.b("view-writer-invalid-position-container",this.document);const n=this._breakAttributes(t,!0),o=i._insertChild(n.offset,e);for(const t of e)this._addToClonedElementsGroup(t);const r=n.getShiftedBy(o),s=this.mergeAttributes(n);if(0===o)return new Zn(s,s);{s.isEqual(n)||r.offset--;const t=this.mergeAttributes(r);return new Zn(s,t)}}remove(t){const e=t instanceof Zn?t:Zn._createOn(t);if(Io(e,this.document),e.isCollapsed)return new xo(this.document);const{start:i,end:n}=this._breakAttributesRange(e,!0),o=i.parent,r=n.offset-i.offset,s=o._removeChildren(i.offset,r);for(const t of s)this._removeFromClonedElementsGroup(t);const a=this.mergeAttributes(i);return e.start=a,e.end=a.clone(),new xo(this.document,s)}clear(t,e){Io(t,this.document);const i=t.getWalker({direction:"backward",ignoreElementEnd:!0});for(const n of i){const i=n.item;let o;if(i.is("element")&&e.isSimilar(i))o=Zn._createOn(i);else if(!n.nextPosition.isAfter(t.start)&&i.is("textProxy")){const t=i.getAncestors().find(t=>t.is("element")&&e.isSimilar(t));t&&(o=Zn._createIn(t))}o&&(o.end.isAfter(t.end)&&(o.end=t.end),o.start.isBefore(t.start)&&(o.start=t.start),this.remove(o))}}move(t,e){let i;if(e.isAfter(t.end)){const n=(e=this._breakAttributes(e,!0)).parent,o=n.childCount;t=this._breakAttributesRange(t,!0),i=this.remove(t),e.offset+=n.childCount-o}else i=this.remove(t);return this.insert(e,i)}wrap(t,e){if(!(e instanceof ro))throw new hi.b("view-writer-wrap-invalid-attribute",this.document);if(Io(t,this.document),t.isCollapsed){let n=t.start;n.parent.is("element")&&(i=n.parent,!Array.from(i.getChildren()).some(t=>!t.is("uiElement")))&&(n=n.getLastMatchingPosition(t=>t.item.is("uiElement"))),n=this._wrapPosition(n,e);const o=this.document.selection;return o.isCollapsed&&o.getFirstPosition().isEqual(t.start)&&this.setSelection(n),new Zn(n)}return this._wrapRange(t,e);var i}unwrap(t,e){if(!(e instanceof ro))throw new hi.b("view-writer-unwrap-invalid-attribute",this.document);if(Io(t,this.document),t.isCollapsed)return t;const{start:i,end:n}=this._breakAttributesRange(t,!0),o=i.parent,r=this._unwrapChildren(o,i.offset,n.offset,e),s=this.mergeAttributes(r.start);s.isEqual(r.start)||r.end.offset--;const a=this.mergeAttributes(r.end);return new Zn(s,a)}rename(t,e){const i=new Vn(this.document,t,e.getAttributes());return this.insert(Xn._createAfter(e),i),this.move(Zn._createIn(e),Xn._createAt(i,0)),this.remove(Zn._createOn(e)),i}clearClonedElementsGroup(t){this._cloneGroups.delete(t)}createPositionAt(t,e){return Xn._createAt(t,e)}createPositionAfter(t){return Xn._createAfter(t)}createPositionBefore(t){return Xn._createBefore(t)}createRange(t,e){return new Zn(t,e)}createRangeOn(t){return Zn._createOn(t)}createRangeIn(t){return Zn._createIn(t)}createSelection(t,e,i){return new io(t,e,i)}_wrapChildren(t,e,i,n){let o=e;const r=[];for(;o!1,t.parent._insertChild(t.offset,i);const n=new Zn(t,t.getShiftedBy(1));this.wrap(n,e);const o=new Xn(i.parent,i.index);i._remove();const r=o.nodeBefore,s=o.nodeAfter;return r instanceof Mi&&s instanceof Mi?Eo(r,s):To(o)}_wrapAttributeElement(t,e){if(!Mo(t,e))return!1;if(t.name!==e.name||t.priority!==e.priority)return!1;for(const i of t.getAttributeKeys())if("class"!==i&&"style"!==i&&e.hasAttribute(i)&&e.getAttribute(i)!==t.getAttribute(i))return!1;for(const i of t.getStyleNames())if(e.hasStyle(i)&&e.getStyle(i)!==t.getStyle(i))return!1;for(const i of t.getAttributeKeys())"class"!==i&&"style"!==i&&(e.hasAttribute(i)||this.setAttribute(i,t.getAttribute(i),e));for(const i of t.getStyleNames())e.hasStyle(i)||this.setStyle(i,t.getStyle(i),e);for(const i of t.getClassNames())e.hasClass(i)||this.addClass(i,e);return!0}_unwrapAttributeElement(t,e){if(!Mo(t,e))return!1;if(t.name!==e.name||t.priority!==e.priority)return!1;for(const i of t.getAttributeKeys())if("class"!==i&&"style"!==i&&(!e.hasAttribute(i)||e.getAttribute(i)!==t.getAttribute(i)))return!1;if(!e.hasClass(...t.getClassNames()))return!1;for(const i of t.getStyleNames())if(!e.hasStyle(i)||e.getStyle(i)!==t.getStyle(i))return!1;for(const i of t.getAttributeKeys())"class"!==i&&"style"!==i&&this.removeAttribute(i,e);return this.removeClass(Array.from(t.getClassNames()),e),this.removeStyle(Array.from(t.getStyleNames()),e),!0}_breakAttributesRange(t,e=!1){const i=t.start,n=t.end;if(Io(t,this.document),t.isCollapsed){const i=this._breakAttributes(t.start,e);return new Zn(i,i)}const o=this._breakAttributes(n,e),r=o.parent.childCount,s=this._breakAttributes(i,e);return o.offset+=o.parent.childCount-r,new Zn(s,o)}_breakAttributes(t,e=!1){const i=t.offset,n=t.parent;if(t.parent.is("emptyElement"))throw new hi.b("view-writer-cannot-break-empty-element",this.document);if(t.parent.is("uiElement"))throw new hi.b("view-writer-cannot-break-ui-element",this.document);if(!e&&n.is("text")&&Ro(n.parent))return t.clone();if(Ro(n))return t.clone();if(n.is("text"))return this._breakAttributes(So(t),e);if(i==n.childCount){const t=new Xn(n.parent,n.index+1);return this._breakAttributes(t,e)}if(0===i){const t=new Xn(n.parent,n.index);return this._breakAttributes(t,e)}{const t=n.index+1,o=n._clone();n.parent._insertChild(t,o),this._addToClonedElementsGroup(o);const r=n.childCount-i,s=n._removeChildren(i,r);o._appendChild(s);const a=new Xn(n.parent,t);return this._breakAttributes(a,e)}}_addToClonedElementsGroup(t){if(!t.root.is("rootElement"))return;if(t.is("element"))for(const e of t.getChildren())this._addToClonedElementsGroup(e);const e=t.id;if(!e)return;let i=this._cloneGroups.get(e);i||(i=new Set,this._cloneGroups.set(e,i)),i.add(t),t._clonesGroup=i}_removeFromClonedElementsGroup(t){if(t.is("element"))for(const e of t.getChildren())this._removeFromClonedElementsGroup(e);const e=t.id;if(!e)return;const i=this._cloneGroups.get(e);i&&i.delete(t)}}function Po(t){let e=t.parent;for(;!Ro(e);){if(!e)return;e=e.parent}return e}function Co(t,e){return t.prioritye.priority)&&t.getIdentity()t.createTextNode(" "),Bo=t=>{const e=t.createElement("br");return e.dataset.ckeFiller=!0,e},Fo=(()=>{let t="";for(let e=0;e<7;e++)t+="​";return t})();function Do(t){return No(t)&&t.data.substr(0,7)===Fo}function Lo(t){return 7==t.data.length&&Do(t)}function zo(t){return Do(t)?t.data.slice(7):t.data}function jo(t,e){if(e.keyCode==mo.arrowleft){const t=e.domTarget.ownerDocument.defaultView.getSelection();if(1==t.rangeCount&&t.getRangeAt(0).collapsed){const e=t.getRangeAt(0).startContainer,i=t.getRangeAt(0).startOffset;Do(e)&&i<=7&&t.collapse(e,0)}}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function qo(t,e,i,n=!1){i=i||function(t,e){return t===e},Array.isArray(t)||(t=Array.prototype.slice.call(t)),Array.isArray(e)||(e=Array.prototype.slice.call(e));const o=function(t,e,i){const n=Wo(t,e,i);if(-1===n)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};const o=Ho(t,n),r=Ho(e,n),s=Wo(o,r,i),a=t.length-s,c=e.length-s;return{firstIndex:n,lastIndexOld:a,lastIndexNew:c}}(t,e,i);return n?function(t,e){const{firstIndex:i,lastIndexOld:n,lastIndexNew:o}=t;if(-1===i)return Array(e).fill("equal");let r=[];i>0&&(r=r.concat(Array(i).fill("equal")));o-i>0&&(r=r.concat(Array(o-i).fill("insert")));n-i>0&&(r=r.concat(Array(n-i).fill("delete")));o0&&i.push({index:n,type:"insert",values:t.slice(n,r)});o-n>0&&i.push({index:n+(r-n),type:"delete",howMany:o-n});return i}(e,o)}function Wo(t,e,i){for(let n=0;n200||o>200||n+o>300)return Uo.fastDiff(t,e,i,!0);let r,s;if(ol?-1:1;d[n+u]&&(d[n]=d[n+u].slice(0)),d[n]||(d[n]=[]),d[n].push(o>l?r:s);let f=Math.max(o,l),g=f-n;for(;gl;f--)h[f]=u(f);h[l]=u(l),g++}while(h[l]!==c);return d[l].slice(1)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -function $o(t,e,i){t.insertBefore(i,t.childNodes[e]||null)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function Go(t){const e=t.parentNode;e&&e.removeChild(t)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function Ko(t){if(t){if(t.defaultView)return t instanceof t.defaultView.Document;if(t.ownerDocument&&t.ownerDocument.defaultView)return t instanceof t.ownerDocument.defaultView.Node}return!1} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */Uo.fastDiff=qo;class Jo{constructor(t,e){this.domDocuments=new Set,this.domConverter=t,this.markedAttributes=new Set,this.markedChildren=new Set,this.markedTexts=new Set,this.selection=e,this.isFocused=!1,this._inlineFiller=null,this._fakeSelectionContainer=null}markToSync(t,e){if("text"===t)this.domConverter.mapViewToDom(e.parent)&&this.markedTexts.add(e);else{if(!this.domConverter.mapViewToDom(e))return;if("attributes"===t)this.markedAttributes.add(e);else{if("children"!==t)throw new hi.b("view-renderer-unknown-type: Unknown type passed to Renderer.markToSync.",this);this.markedChildren.add(e)}}}render(){let t;for(const t of this.markedChildren)this._updateChildrenMappings(t);this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?t=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(t=this.selection.getFirstPosition(),this.markedChildren.add(t.parent));for(const t of this.markedAttributes)this._updateAttrs(t);for(const e of this.markedChildren)this._updateChildren(e,{inlineFillerPosition:t});for(const e of this.markedTexts)!this.markedChildren.has(e.parent)&&this.domConverter.mapViewToDom(e.parent)&&this._updateText(e,{inlineFillerPosition:t});if(t){const e=this.domConverter.viewPositionToDom(t),i=e.parent.ownerDocument;Do(e.parent)?this._inlineFiller=e.parent:this._inlineFiller=Qo(i,e.parent,e.offset)}else this._inlineFiller=null;this._updateSelection(),this._updateFocus(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const i=this.domConverter.mapViewToDom(t).childNodes,n=Array.from(this.domConverter.viewChildrenToDom(t,e.ownerDocument,{withChildren:!1})),o=this._diffNodeLists(i,n),r=this._findReplaceActions(o,i,n);if(-1!==r.indexOf("replace")){const e={equal:0,insert:0,delete:0};for(const o of r)if("replace"===o){const o=e.equal+e.insert,r=e.equal+e.delete,s=t.getChild(o);s&&!s.is("uiElement")&&this._updateElementMappings(s,i[r]),Go(n[o]),e.equal++}else e[o]++}}_updateElementMappings(t,e){this.domConverter.unbindDomElement(e),this.domConverter.bindElements(e,t),this.markedChildren.add(t),this.markedAttributes.add(t)}_getInlineFillerPosition(){const t=this.selection.getFirstPosition();return t.parent.is("text")?Xn._createBefore(this.selection.getFirstPosition().parent):t}_isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=this.domConverter.viewPositionToDom(t);return!!(e&&No(e.parent)&&Do(e.parent))}_removeInlineFiller(){const t=this._inlineFiller;if(!Do(t))throw new hi.b("view-renderer-filler-was-lost: The inline filler node was lost.",this);Lo(t)?t.parentNode.removeChild(t):t.data=t.data.substr(7),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;const t=this.selection.getFirstPosition(),e=t.parent,i=t.offset;if(!this.domConverter.mapViewToDom(e.root))return!1;if(!e.is("element"))return!1;if(!function(t){if("false"==t.getAttribute("contenteditable"))return!1;const e=t.findAncestor(t=>t.hasAttribute("contenteditable"));return!e||"true"==e.getAttribute("contenteditable")}(e))return!1;if(i===e.getFillerOffset())return!1;const n=t.nodeBefore,o=t.nodeAfter;return!(n instanceof Mi||o instanceof Mi)}_updateText(t,e){const i=this.domConverter.findCorrespondingDomText(t),n=this.domConverter.viewToDom(t,i.ownerDocument),o=i.data;let r=n.data;const s=e.inlineFillerPosition;if(s&&s.parent==t.parent&&s.offset==t.index&&(r=Fo+r),o!=r){const t=qo(o,r);for(const e of t)"insert"===e.type?i.insertData(e.index,e.values.join("")):i.deleteData(e.index,e.howMany)}}_updateAttrs(t){const e=this.domConverter.mapViewToDom(t);if(!e)return;const i=Array.from(e.attributes).map(t=>t.name),n=t.getAttributeKeys();for(const i of n)e.setAttribute(i,t.getAttribute(i));for(const n of i)t.hasAttribute(n)||e.removeAttribute(n)}_updateChildren(t,e){const i=this.domConverter.mapViewToDom(t);if(!i)return;const n=e.inlineFillerPosition,o=this.domConverter.mapViewToDom(t).childNodes,r=Array.from(this.domConverter.viewChildrenToDom(t,i.ownerDocument,{bind:!0,inlineFillerPosition:n}));n&&n.parent===t&&Qo(i.ownerDocument,r,n.offset);const s=this._diffNodeLists(o,r);let a=0;const c=new Set;for(const t of s)"delete"===t?(c.add(o[a]),Go(o[a])):"equal"===t&&a++;a=0;for(const t of s)"insert"===t?($o(i,a,r[a]),a++):"equal"===t&&(this._markDescendantTextToSync(this.domConverter.domToView(r[a])),a++);for(const t of c)t.parentNode||this.domConverter.unbindDomElement(t)}_diffNodeLists(t,e){return Uo(t=function(t,e){const i=Array.from(t);if(0==i.length||!e)return i;i[i.length-1]==e&&i.pop();return i}(t,this._fakeSelectionContainer),e,Xo.bind(null,this.domConverter))}_findReplaceActions(t,e,i){if(-1===t.indexOf("insert")||-1===t.indexOf("delete"))return t;let n=[],o=[],r=[];const s={equal:0,insert:0,delete:0};for(const a of t)"insert"===a?r.push(i[s.equal+s.insert]):"delete"===a?o.push(e[s.equal+s.delete]):(n=n.concat(Uo(o,r,Yo).map(t=>"equal"===t?"replace":t)),n.push("equal"),o=[],r=[]),s[a]++;return n.concat(Uo(o,r,Yo).map(t=>"equal"===t?"replace":t))}_markDescendantTextToSync(t){if(t)if(t.is("text"))this.markedTexts.add(t);else if(t.is("element"))for(const e of t.getChildren())this._markDescendantTextToSync(e)}_updateSelection(){if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();const t=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&t&&(this.selection.isFake?this._updateFakeSelection(t):(this._removeFakeSelection(),this._updateDomSelection(t)))}_updateFakeSelection(t){const e=t.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=function(t){const e=t.createElement("div");return Object.assign(e.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),e.textContent=" ",e} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(e));const i=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(i,this.selection),!this._fakeSelectionNeedsUpdate(t))return;i.parentElement&&i.parentElement==t||t.appendChild(i),i.textContent=this.selection.fakeSelectionLabel||" ";const n=e.getSelection(),o=e.createRange();n.removeAllRanges(),o.selectNodeContents(i),n.addRange(o)}_updateDomSelection(t){const e=t.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(e))return;const i=this.domConverter.viewPositionToDom(this.selection.anchor),n=this.domConverter.viewPositionToDom(this.selection.focus);t.focus(),e.collapse(i.parent,i.offset),e.extend(n.parent,n.offset),uo.isGecko&&function(t,e){const i=t.parent;if(i.nodeType!=Node.ELEMENT_NODE||t.offset!=i.childNodes.length-1)return;const n=i.childNodes[t.offset];n&&"BR"==n.tagName&&e.addRange(e.getRangeAt(0))}(n,e)}_domSelectionNeedsUpdate(t){if(!this.domConverter.isDomSelectionCorrect(t))return!0;const e=t&&this.domConverter.domSelectionToView(t);return(!e||!this.selection.isEqual(e))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(e))}_fakeSelectionNeedsUpdate(t){const e=this._fakeSelectionContainer,i=t.ownerDocument.getSelection();return!e||e.parentElement!==t||(i.anchorNode!==e&&!e.contains(i.anchorNode)||e.textContent!==this.selection.fakeSelectionLabel)}_removeDomSelection(){for(const t of this.domDocuments){if(t.getSelection().rangeCount){const e=t.activeElement,i=this.domConverter.mapDomToView(e);e&&i&&t.getSelection().removeAllRanges()}}}_removeFakeSelection(){const t=this._fakeSelectionContainer;t&&t.remove()}_updateFocus(){if(this.isFocused){const t=this.selection.editableElement;t&&this.domConverter.focus(t)}}}function Qo(t,e,i){const n=e instanceof Array?e:e.childNodes,o=n[i];if(No(o))return o.data=Fo+o.data,o;{const o=t.createTextNode(Fo);return Array.isArray(e)?n.splice(i,0,o):$o(e,i,o),o}}function Yo(t,e){return Ko(t)&&Ko(e)&&!No(t)&&!No(e)&&t.tagName.toLowerCase()===e.tagName.toLowerCase()}function Xo(t,e,i){return e===i||(No(e)&&No(i)?e.data===i.data:!(!t.isBlockFiller(e)||!t.isBlockFiller(i)))}yi(Jo,qn);var Zo={window:window,document:document}; -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function tr(t){let e=0;for(;t.previousSibling;)t=t.previousSibling,e++;return e} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function er(t){const e=[];for(;t&&t.nodeType!=Node.DOCUMENT_NODE;)e.unshift(t),t=t.parentNode;return e} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -const ir=Bo(document);class nr{constructor(t,e={}){this.document=t,this.blockFillerMode=e.blockFillerMode||"br",this.preElements=["pre"],this.blockElements=["p","div","h1","h2","h3","h4","h5","h6","li","dd","dt","figcaption"],this._blockFiller="br"==this.blockFillerMode?Bo:Vo,this._domToViewMapping=new WeakMap,this._viewToDomMapping=new WeakMap,this._fakeSelectionMapping=new WeakMap}bindFakeSelection(t,e){this._fakeSelectionMapping.set(t,new io(e))}fakeSelectionToView(t){return this._fakeSelectionMapping.get(t)}bindElements(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}unbindDomElement(t){const e=this._domToViewMapping.get(t);if(e){this._domToViewMapping.delete(t),this._viewToDomMapping.delete(e);for(const e of t.childNodes)this.unbindDomElement(e)}}bindDocumentFragments(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t)}viewToDom(t,e,i={}){if(t.is("text")){const i=this._processDataFromViewText(t);return e.createTextNode(i)}{if(this.mapViewToDom(t))return this.mapViewToDom(t);let n;if(t.is("documentFragment"))n=e.createDocumentFragment(),i.bind&&this.bindDocumentFragments(n,t);else{if(t.is("uiElement"))return n=t.render(e),i.bind&&this.bindElements(n,t),n;n=t.hasAttribute("xmlns")?e.createElementNS(t.getAttribute("xmlns"),t.name):e.createElement(t.name),i.bind&&this.bindElements(n,t);for(const e of t.getAttributeKeys())n.setAttribute(e,t.getAttribute(e))}if(i.withChildren||void 0===i.withChildren)for(const o of this.viewChildrenToDom(t,e,i))n.appendChild(o);return n}}*viewChildrenToDom(t,e,i={}){const n=t.getFillerOffset&&t.getFillerOffset();let o=0;for(const r of t.getChildren())n===o&&(yield this._blockFiller(e)),yield this.viewToDom(r,e,i),o++;n===o&&(yield this._blockFiller(e))}viewRangeToDom(t){const e=this.viewPositionToDom(t.start),i=this.viewPositionToDom(t.end),n=document.createRange();return n.setStart(e.parent,e.offset),n.setEnd(i.parent,i.offset),n}viewPositionToDom(t){const e=t.parent;if(e.is("text")){const i=this.findCorrespondingDomText(e);if(!i)return null;let n=t.offset;return Do(i)&&(n+=7),{parent:i,offset:n}}{let i,n,o;if(0===t.offset){if(i=this.mapViewToDom(e),!i)return null;o=i.childNodes[0]}else{const e=t.nodeBefore;if(n=e.is("text")?this.findCorrespondingDomText(e):this.mapViewToDom(t.nodeBefore),!n)return null;i=n.parentNode,o=n.nextSibling}if(No(o)&&Do(o))return{parent:o,offset:7};return{parent:i,offset:n?tr(n)+1:0}}}domToView(t,e={}){if(this.isBlockFiller(t,this.blockFillerMode))return null;const i=this.getParentUIElement(t,this._domToViewMapping);if(i)return i;if(No(t)){if(Lo(t))return null;{const e=this._processDataFromDomText(t);return""===e?null:new Mi(this.document,e)}}if(this.isComment(t))return null;{if(this.mapDomToView(t))return this.mapDomToView(t);let i;if(this.isDocumentFragment(t))i=new xo(this.document),e.bind&&this.bindDocumentFragments(t,i);else{const n=e.keepOriginalCase?t.tagName:t.tagName.toLowerCase();i=new Mn(this.document,n),e.bind&&this.bindElements(t,i);const o=t.attributes;for(let t=o.length-1;t>=0;t--)i._setAttribute(o[t].name,o[t].value)}if(e.withChildren||void 0===e.withChildren)for(const n of this.domChildrenToView(t,e))i._appendChild(n);return i}}*domChildrenToView(t,e={}){for(let i=0;i{const{scrollLeft:e,scrollTop:i}=t;n.push([e,i])}),e.focus(),rr(e,t=>{const[e,i]=n.shift();t.scrollLeft=e,t.scrollTop=i}),Zo.window.scrollTo(t,i)}}isElement(t){return t&&t.nodeType==Node.ELEMENT_NODE}isDocumentFragment(t){return t&&t.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isComment(t){return t&&t.nodeType==Node.COMMENT_NODE}isBlockFiller(t){return"br"==this.blockFillerMode?t.isEqualNode(ir):!("BR"!==t.tagName||!sr(t,this.blockElements)||1!==t.parentNode.childNodes.length)||function(t,e){return No(t)&&" "==t.data&&sr(t,e)&&1===t.parentNode.childNodes.length}(t,this.blockElements)}isDomSelectionBackward(t){if(t.isCollapsed)return!1;const e=document.createRange();e.setStart(t.anchorNode,t.anchorOffset),e.setEnd(t.focusNode,t.focusOffset);const i=e.collapsed;return e.detach(),i}getParentUIElement(t){const e=er(t);for(e.pop();e.length;){const t=e.pop(),i=this._domToViewMapping.get(t);if(i&&i.is("uiElement"))return i}return null}isDomSelectionCorrect(t){return this._isDomSelectionPositionCorrect(t.anchorNode,t.anchorOffset)&&this._isDomSelectionPositionCorrect(t.focusNode,t.focusOffset)}_isDomSelectionPositionCorrect(t,e){if(No(t)&&Do(t)&&e<7)return!1;if(this.isElement(t)&&Do(t.childNodes[e]))return!1;const i=this.mapDomToView(t);return!i||!i.is("uiElement")}_processDataFromViewText(t){let e=t.data;if(t.getAncestors().some(t=>this.preElements.includes(t.name)))return e;if(" "==e.charAt(0)){const i=this._getTouchingViewTextNode(t,!1);!(i&&this._nodeEndsWithSpace(i))&&i||(e=" "+e.substr(1))}if(" "==e.charAt(e.length-1)){const i=this._getTouchingViewTextNode(t,!0);" "!=e.charAt(e.length-2)&&i&&" "!=i.data.charAt(0)||(e=e.substr(0,e.length-1)+" ")}return e.replace(/ {2}/g,"  ")}_nodeEndsWithSpace(t){if(t.getAncestors().some(t=>this.preElements.includes(t.name)))return!1;const e=this._processDataFromViewText(t);return" "==e.charAt(e.length-1)}_processDataFromDomText(t){let e=t.data;if(or(t,this.preElements))return zo(t);e=e.replace(/[ \n\t\r]{1,}/g," ");const i=this._getTouchingInlineDomNode(t,!1),n=this._getTouchingInlineDomNode(t,!0),o=this._checkShouldLeftTrimDomText(i),r=this._checkShouldRightTrimDomText(t,n);return o&&(e=e.replace(/^ /,"")),r&&(e=e.replace(/ $/,"")),e=zo(new Text(e)),e=e.replace(/ \u00A0/g," "),(/( |\u00A0)\u00A0$/.test(e)||!n||n.data&&" "==n.data.charAt(0))&&(e=e.replace(/\u00A0$/," ")),o&&(e=e.replace(/^\u00A0/," ")),e}_checkShouldLeftTrimDomText(t){return!t||(!!ii(t)||/[^\S\u00A0]/.test(t.data.charAt(t.data.length-1)))}_checkShouldRightTrimDomText(t,e){return!e&&!Do(t)}_getTouchingViewTextNode(t,e){const i=new Yn({startPosition:e?Xn._createAfter(t):Xn._createBefore(t),direction:e?"forward":"backward"});for(const t of i){if(t.item.is("containerElement"))return null;if(t.item.is("br"))return null;if(t.item.is("textProxy"))return t.item}return null}_getTouchingInlineDomNode(t,e){if(!t.parentNode)return null;const i=e?"nextNode":"previousNode",n=t.ownerDocument,o=er(t)[0],r=n.createTreeWalker(o,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,{acceptNode:t=>No(t)||"BR"==t.tagName?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});r.currentNode=t;const s=r[i]();if(null!==s){const e=function(t,e){const i=er(t),n=er(e);let o=0;for(;i[o]==n[o]&&i[o];)o++;return 0===o?null:i[o-1]}(t,s);if(e&&!or(t,this.blockElements,e)&&!or(s,this.blockElements,e))return s}return null}}function or(t,e,i){let n=er(t);return i&&(n=n.slice(n.indexOf(i)+1)),n.some(t=>t.tagName&&e.includes(t.tagName.toLowerCase()))}function rr(t,e){for(;t&&t!=Zo.document;)e(t),t=t.parentNode}function sr(t,e){const i=t.parentNode;return i&&i.tagName&&e.includes(i.tagName.toLowerCase())} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function ar(t){const e=Object.prototype.toString.apply(t);return"[object Window]"==e||"[object global]"==e} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */var cr=Fn({},gi,{listenTo(t,...e){if(Ko(t)||ar(t)){const i=this._getProxyEmitter(t)||new lr(t);i.attach(...e),t=i}gi.listenTo.call(this,t,...e)},stopListening(t,e,i){if(Ko(t)||ar(t)){const e=this._getProxyEmitter(t);if(!e)return;t=e}gi.stopListening.call(this,t,e,i),t instanceof lr&&t.detach(e)},_getProxyEmitter(t){return e=this,i=dr(t),e[ui]&&e[ui][i]?e[ui][i].emitter:null;var e,i}});class lr{constructor(t){mi(this,dr(t)),this._domNode=t}}function dr(t){return t["data-ck-expando"]||(t["data-ck-expando"]=li())} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */Fn(lr.prototype,gi,{attach(t,e,i={}){if(this._domListeners&&this._domListeners[t])return;const n=this._createDomListener(t,!!i.useCapture);this._domNode.addEventListener(t,n,!!i.useCapture),this._domListeners||(this._domListeners={}),this._domListeners[t]=n},detach(t){let e;!this._domListeners[t]||(e=this._events[t])&&e.callbacks.length||this._domListeners[t].removeListener()},_createDomListener(t,e){const i=e=>{this.fire(t,e)};return i.removeListener=()=>{this._domNode.removeEventListener(t,i,e),delete this._domListeners[t]},i}});class hr{constructor(t){this.view=t,this.document=t.document,this.isEnabled=!1}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}destroy(){this.disable(),this.stopListening()}}yi(hr,cr);var ur=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};var fr=function(t){return this.__data__.has(t)};function gr(t){var e=-1,i=null==t?0:t.length;for(this.__data__=new kt;++ea))return!1;var l=r.get(t);if(l&&r.get(e))return l==e;var d=-1,h=!0,u=2&i?new mr:void 0;for(r.set(t,e),r.set(e,t);++d{this.listenTo(t,e,(t,e)=>{this.isEnabled&&this.onDomEvent(e)},{useCapture:this.useCapture})})}fire(t,e,i){this.isEnabled&&this.document.fire(t,new Rr(this.view,e,i))}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Mr extends Ir{constructor(t){super(t),this.domEventType=["keydown","keyup"]}onDomEvent(t){this.fire(t.type,t,{keyCode:t.keyCode,altKey:t.altKey,ctrlKey:t.ctrlKey||t.metaKey,shiftKey:t.shiftKey,get keystroke(){return po(this)}})}}var Nr=function(){return n.a.Date.now()},Vr=/^\s+|\s+$/g,Br=/^[-+]0x[0-9a-f]+$/i,Fr=/^0b[01]+$/i,Dr=/^0o[0-7]+$/i,Lr=parseInt;var zr=function(t){if("number"==typeof t)return t;if(Di(t))return NaN;if(F(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=F(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Vr,"");var i=Fr.test(t);return i||Dr.test(t)?Lr(t.slice(2),i?2:8):Br.test(t)?NaN:+t},jr=Math.max,qr=Math.min;var Wr=function(t,e,i){var n,o,r,s,a,c,l=0,d=!1,h=!1,u=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function f(e){var i=n,r=o;return n=o=void 0,l=e,s=t.apply(r,i)}function g(t){return l=t,a=setTimeout(p,e),d?f(t):s}function m(t){var i=t-c;return void 0===c||i>=e||i<0||h&&t-l>=r}function p(){var t=Nr();if(m(t))return b(t);a=setTimeout(p,function(t){var i=e-(t-c);return h?qr(i,r-(t-l)):i}(t))}function b(t){return a=void 0,u&&n?f(t):(n=o=void 0,s)}function w(){var t=Nr(),i=m(t);if(n=arguments,o=this,c=t,i){if(void 0===a)return g(c);if(h)return clearTimeout(a),a=setTimeout(p,e),f(c)}return void 0===a&&(a=setTimeout(p,e)),s}return e=zr(e)||0,F(i)&&(d=!!i.leading,r=(h="maxWait"in i)?jr(zr(i.maxWait)||0,e):r,u="trailing"in i?!!i.trailing:u),w.cancel=function(){void 0!==a&&clearTimeout(a),l=0,n=c=o=a=void 0},w.flush=function(){return void 0===a?s:b(Nr())},w}; -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Hr extends hr{constructor(t){super(t),this._fireSelectionChangeDoneDebounced=Wr(t=>this.document.fire("selectionChangeDone",t),200)}observe(){const t=this.document;t.on("keydown",(e,i)=>{var n; -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */t.selection.isFake&&((n=i.keyCode)==mo.arrowright||n==mo.arrowleft||n==mo.arrowup||n==mo.arrowdown)&&this.isEnabled&&(i.preventDefault(),this._handleSelectionMove(i.keyCode))},{priority:"lowest"})}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(t){const e=this.document.selection,i=new io(e.getRanges(),{backward:e.isBackward,fake:!1});t!=mo.arrowleft&&t!=mo.arrowup||i.setTo(i.getFirstPosition()),t!=mo.arrowright&&t!=mo.arrowdown||i.setTo(i.getLastPosition());const n={oldSelection:e,newSelection:i,domSelection:null};this.document.fire("selectionChange",n),this._fireSelectionChangeDoneDebounced(n)}}class Ur extends hr{constructor(t){super(t),this.mutationObserver=t.getObserver(Or),this.selection=this.document.selection,this.domConverter=t.domConverter,this._documents=new WeakSet,this._fireSelectionChangeDoneDebounced=Wr(t=>this.document.fire("selectionChangeDone",t),200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._loopbackCounter=0}observe(t){const e=t.ownerDocument;this._documents.has(e)||(this.listenTo(e,"selectionchange",()=>{this._handleSelectionChange(e)}),this._documents.add(e))}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionChange(t){if(!this.isEnabled)return;this.mutationObserver.flush();const e=t.defaultView.getSelection(),i=this.domConverter.domSelectionToView(e);if(0!=i.rangeCount){if(this.view.hasDomSelection=!0,!(this.selection.isEqual(i)&&this.domConverter.isDomSelectionCorrect(e)||++this._loopbackCounter>60))if(this.selection.isSimilar(i))this.view.forceRender();else{const t={oldSelection:this.selection,newSelection:i,domSelection:e};this.document.fire("selectionChange",t),this._fireSelectionChangeDoneDebounced(t)}}else this.view.hasDomSelection=!1}_clearInfiniteLoop(){this._loopbackCounter=0}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class $r extends Ir{constructor(t){super(t),this.domEventType=["focus","blur"],this.useCapture=!0;const e=this.document;e.on("focus",()=>{e.isFocused=!0,this._renderTimeoutId=setTimeout(()=>t.forceRender(),50)}),e.on("blur",(i,n)=>{const o=e.selection.editableElement;null!==o&&o!==n.target||(e.isFocused=!1,t.forceRender())})}onDomEvent(t){this.fire(t.type,t)}destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),super.destroy()}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Gr extends Ir{constructor(t){super(t),this.domEventType=["compositionstart","compositionupdate","compositionend"];const e=this.document;e.on("compositionstart",()=>{e.isComposing=!0}),e.on("compositionend",()=>{e.isComposing=!1})}onDomEvent(t){this.fire(t.type,t)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md. - */class Kr extends Ir{constructor(t){super(t),this.domEventType=["beforeinput"]}onDomEvent(t){this.fire(t.type,t)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function Jr(t){return"[object Range]"==Object.prototype.toString.apply(t)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function Qr(t){const e=t.ownerDocument.defaultView.getComputedStyle(t);return{top:parseInt(e.borderTopWidth,10),right:parseInt(e.borderRightWidth,10),bottom:parseInt(e.borderBottomWidth,10),left:parseInt(e.borderLeftWidth,10)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */const Yr=["top","right","bottom","left","width","height"];class Xr{constructor(t){const e=Jr(t);if(Object.defineProperty(this,"_source",{value:t._source||t,writable:!0,enumerable:!1}),ii(t)||e)Zr(this,e?Xr.getDomRangeRects(t)[0]:t.getBoundingClientRect());else if(ar(t)){const{innerWidth:e,innerHeight:i}=t;Zr(this,{top:0,right:e,bottom:i,left:0,width:e,height:i})}else Zr(this,t)}clone(){return new Xr(this)}moveTo(t,e){return this.top=e,this.right=t+this.width,this.bottom=e+this.height,this.left=t,this}moveBy(t,e){return this.top+=e,this.right+=t,this.left+=t,this.bottom+=e,this}getIntersection(t){const e={top:Math.max(this.top,t.top),right:Math.min(this.right,t.right),bottom:Math.min(this.bottom,t.bottom),left:Math.max(this.left,t.left)};return e.width=e.right-e.left,e.height=e.bottom-e.top,e.width<0||e.height<0?null:new Xr(e)}getIntersectionArea(t){const e=this.getIntersection(t);return e?e.getArea():0}getArea(){return this.width*this.height}getVisible(){const t=this._source;let e=this.clone();if(!ts(t)){let i=t.parentNode||t.commonAncestorContainer;for(;i&&!ts(i);){const t=new Xr(i),n=e.getIntersection(t);if(!n)return null;n.getArea()ds(t,n));const s=ds(t,n);if(is(n,s,e),n.parent!=n){if(o=n.frameElement,n=n.parent,!o)return}else n=null}}function is(t,e,i){const n=e.clone().moveBy(0,i),o=e.clone().moveBy(0,-i),r=new Xr(t).excludeScrollbarsAndBorders();if(![o,n].every(t=>r.contains(t))){let{scrollX:s,scrollY:a}=t;rs(o,r)?a-=r.top-e.top+i:os(n,r)&&(a+=e.bottom-r.bottom+i),ss(e,r)?s-=r.left-e.left+i:as(e,r)&&(s+=e.right-r.right+i),t.scrollTo(s,a)}}function ns(t,e){const i=cs(t);let n,o;for(;t!=i.document.body;)o=e(),n=new Xr(t).excludeScrollbarsAndBorders(),n.contains(o)||(rs(o,n)?t.scrollTop-=n.top-o.top:os(o,n)&&(t.scrollTop+=o.bottom-n.bottom),ss(o,n)?t.scrollLeft-=n.left-o.left:as(o,n)&&(t.scrollLeft+=o.right-n.right)),t=t.parentNode}function os(t,e){return t.bottom>e.bottom}function rs(t,e){return t.tope.right}function cs(t){return Jr(t)?t.startContainer.ownerDocument.defaultView:t.ownerDocument.defaultView}function ls(t){if(Jr(t)){let e=t.commonAncestorContainer;return No(e)&&(e=e.parentNode),e}return t.parentNode}function ds(t,e){const i=cs(t),n=new Xr(t);if(i===e)return n;{let t=i;for(;t!=e;){const e=t.frameElement,i=new Xr(e).excludeScrollbarsAndBorders();n.moveBy(i.left,i.top),t=t.parent}}return n} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */Object.assign({},{scrollViewportToShowTarget:es,scrollAncestorsToShowTarget:function(t){ns(ls(t),()=>new Xr(t))}});class hs{constructor(t){this.document=new oo(t),this.domConverter=new nr(this.document),this.domRoots=new Map,this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new Jo(this.domConverter,this.document.selection),this._renderer.bind("isFocused").to(this.document),this._initialDomRootAttributes=new WeakMap,this._observers=new Map,this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this._writer=new Ao(this.document),this.addObserver(Or),this.addObserver(Ur),this.addObserver($r),this.addObserver(Mr),this.addObserver(Hr),this.addObserver(Gr),uo.isAndroid&&this.addObserver(Kr),this.document.on("keydown",jo),vo(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0})}attachDomRoot(t,e="main"){const i=this.document.getRoot(e);i._name=t.tagName.toLowerCase();const n={};for(const{name:e,value:o}of Array.from(t.attributes))n[e]=o,"class"===e?this._writer.addClass(o.split(" "),i):this._writer.setAttribute(e,o,i);this._initialDomRootAttributes.set(t,n);const o=()=>{this._writer.setAttribute("contenteditable",!i.isReadOnly,i),i.isReadOnly?this._writer.addClass("ck-read-only",i):this._writer.removeClass("ck-read-only",i)};o(),this.domRoots.set(e,t),this.domConverter.bindElements(t,i),this._renderer.markToSync("children",i),this._renderer.markToSync("attributes",i),this._renderer.domDocuments.add(t.ownerDocument),i.on("change:children",(t,e)=>this._renderer.markToSync("children",e)),i.on("change:attributes",(t,e)=>this._renderer.markToSync("attributes",e)),i.on("change:text",(t,e)=>this._renderer.markToSync("text",e)),i.on("change:isReadOnly",()=>this.change(o)),i.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(const i of this._observers.values())i.observe(t,e)}detachDomRoot(t){const e=this.domRoots.get(t);Array.from(e.attributes).forEach(({name:t})=>e.removeAttribute(t));const i=this._initialDomRootAttributes.get(e);for(const t in i)e.setAttribute(t,i[t]);this.domRoots.delete(t),this.domConverter.unbindDomElement(e)}getDomRoot(t="main"){return this.domRoots.get(t)}addObserver(t){let e=this._observers.get(t);if(e)return e;e=new t(this),this._observers.set(t,e);for(const[t,i]of this.domRoots)e.observe(i,t);return e.enable(),e}getObserver(t){return this._observers.get(t)}disableObservers(){for(const t of this._observers.values())t.disable()}enableObservers(){for(const t of this._observers.values())t.enable()}scrollToTheSelection(){const t=this.document.selection.getFirstRange();t&&es({target:this.domConverter.viewRangeToDom(t),viewportOffset:20})}focus(){if(!this.document.isFocused){const t=this.document.selection.editableElement;t&&(this.domConverter.focus(t),this.forceRender())}}change(t){if(this.isRenderingInProgress||this._postFixersInProgress)throw new hi.b("cannot-change-view-tree: Attempting to make changes to the view when it is in an incorrect state: rendering or post-fixers are in progress. This may cause some unexpected behavior and inconsistency between the DOM and the view.",this);try{if(this._ongoingChange)return t(this._writer);this._ongoingChange=!0;const e=t(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),e}catch(t){hi.b.rethrowUnexpectedError(t,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.change(()=>{})}destroy(){for(const t of this._observers.values())t.destroy();this.document.destroy(),this.stopListening()}createPositionAt(t,e){return Xn._createAt(t,e)}createPositionAfter(t){return Xn._createAfter(t)}createPositionBefore(t){return Xn._createBefore(t)}createRange(t,e){return new Zn(t,e)}createRangeOn(t){return Zn._createOn(t)}createRangeIn(t){return Zn._createIn(t)}createSelection(t,e,i){return new io(t,e,i)}_disableRendering(t){this._renderingDisabled=t,0==t&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}}yi(hs,qn); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class us{constructor(t){this.parent=null,this._attrs=Vi(t)}get index(){let t;if(!this.parent)return null;if(null===(t=this.parent.getChildIndex(this)))throw new hi.b("model-node-not-found-in-parent: The node's parent does not contain this node.",this);return t}get startOffset(){let t;if(!this.parent)return null;if(null===(t=this.parent.getChildStartOffset(this)))throw new hi.b("model-node-not-found-in-parent: The node's parent does not contain this node.",this);return t}get offsetSize(){return 1}get endOffset(){return this.parent?this.startOffset+this.offsetSize:null}get nextSibling(){const t=this.index;return null!==t&&this.parent.getChild(t+1)||null}get previousSibling(){const t=this.index;return null!==t&&this.parent.getChild(t-1)||null}get root(){let t=this;for(;t.parent;)t=t.parent;return t}isAttached(){return this.root.is("rootElement")}getPath(){const t=[];let e=this;for(;e.parent;)t.unshift(e.startOffset),e=e.parent;return t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let i=t.includeSelf?this:this.parent;for(;i;)e[t.parentFirst?"push":"unshift"](i),i=i.parent;return e}getCommonAncestor(t,e={}){const i=this.getAncestors(e),n=t.getAncestors(e);let o=0;for(;i[o]==n[o]&&i[o];)o++;return 0===o?null:i[o-1]}isBefore(t){if(this==t)return!1;if(this.root!==t.root)return!1;const e=this.getPath(),i=t.getPath(),n=Oi(e,i);switch(n){case"prefix":return!0;case"extension":return!1;default:return e[n](t[e[0]]=e[1],t),{})),t}is(t){return"node"===t||"model:node"===t}_clone(){return new us(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(t,e){this._attrs.set(t,e)}_setAttributesTo(t){this._attrs=Vi(t)}_removeAttribute(t){return this._attrs.delete(t)}_clearAttributes(){this._attrs.clear()}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class fs extends us{constructor(t,e){super(e),this._data=t||""}get offsetSize(){return this.data.length}get data(){return this._data}is(t){return"text"===t||"model:text"===t||"node"===t||"model:node"===t}toJSON(){const t=super.toJSON();return t.data=this.data,t}_clone(){return new fs(this.data,this.getAttributes())}static fromJSON(t){return new fs(t.data,t.attributes)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class gs{constructor(t,e,i){if(this.textNode=t,e<0||e>t.offsetSize)throw new hi.b("model-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.",this);if(i<0||e+i>t.offsetSize)throw new hi.b("model-textproxy-wrong-length: Given length value is incorrect.",this);this.data=t.data.substring(e,e+i),this.offsetInText=e}get startOffset(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return null!==this.startOffset?this.startOffset+this.offsetSize:null}get isPartial(){return this.offsetSize!==this.textNode.offsetSize}get parent(){return this.textNode.parent}get root(){return this.textNode.root}is(t){return"textProxy"===t||"model:textProxy"===t}getPath(){const t=this.textNode.getPath();return t.length>0&&(t[t.length-1]+=this.offsetInText),t}getAncestors(t={includeSelf:!1,parentFirst:!1}){const e=[];let i=t.includeSelf?this:this.parent;for(;i;)e[t.parentFirst?"push":"unshift"](i),i=i.parent;return e}hasAttribute(t){return this.textNode.hasAttribute(t)}getAttribute(t){return this.textNode.getAttribute(t)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class ms{constructor(t){this._nodes=[],t&&this._insertNodes(0,t)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._nodes.reduce((t,e)=>t+e.offsetSize,0)}getNode(t){return this._nodes[t]||null}getNodeIndex(t){const e=this._nodes.indexOf(t);return-1==e?null:e}getNodeStartOffset(t){const e=this.getNodeIndex(t);return null===e?null:this._nodes.slice(0,e).reduce((t,e)=>t+e.offsetSize,0)}indexToOffset(t){if(t==this._nodes.length)return this.maxOffset;const e=this._nodes[t];if(!e)throw new hi.b("model-nodelist-index-out-of-bounds: Given index cannot be found in the node list.",this);return this.getNodeStartOffset(e)}offsetToIndex(t){let e=0;for(const i of this._nodes){if(t>=e&&tt.toJSON())}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class ps extends us{constructor(t,e,i){super(e),this.name=t,this._children=new ms,i&&this._insertChild(0,i)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}is(t,e=null){return e?e===this.name&&("element"===t||"model:element"===t):"element"===t||"model:element"===t||t===this.name||t==="model:"+this.name||"node"===t||"model:node"===t}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}offsetToIndex(t){return this._children.offsetToIndex(t)}getNodeByPath(t){let e=this;for(const i of t)e=e.getChild(e.offsetToIndex(i));return e}toJSON(){const t=super.toJSON();if(t.name=this.name,this._children.length>0){t.children=[];for(const e of this._children)t.children.push(e.toJSON())}return t}_clone(t=!1){const e=t?Array.from(this._children).map(t=>t._clone(!0)):null;return new ps(this.name,this.getAttributes(),e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const i=function(t){if("string"==typeof t)return[new fs(t)];vi(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new fs(t):t instanceof gs?new fs(t.data,t.getAttributes()):t)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(e);for(const t of i)null!==t.parent&&t._remove(),t.parent=this;this._children._insertNodes(t,i)}_removeChildren(t,e=1){const i=this._children._removeNodes(t,e);for(const t of i)t.parent=null;return i}static fromJSON(t){let e=null;if(t.children){e=[];for(const i of t.children)i.name?e.push(ps.fromJSON(i)):e.push(fs.fromJSON(i))}return new ps(t.name,t.attributes,e)}}class bs{constructor(t={}){if(!t.boundaries&&!t.startPosition)throw new hi.b("model-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.",null);const e=t.direction||"forward";if("forward"!=e&&"backward"!=e)throw new hi.b("model-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.",t,{direction:e});this.direction=e,this.boundaries=t.boundaries||null,t.startPosition?this.position=t.startPosition.clone():this.position=ks._createAt(this.boundaries["backward"==this.direction?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent}[Symbol.iterator](){return this}skip(t){let e,i,n,o;do{n=this.position,o=this._visitedParent,({done:e,value:i}=this.next())}while(!e&&t(i));e||(this.position=n,this._visitedParent=o)}next(){return"forward"==this.direction?this._next():this._previous()}_next(){const t=this.position,e=this.position.clone(),i=this._visitedParent;if(null===i.parent&&e.offset===i.maxOffset)return{done:!0};if(i===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0};const n=e.parent,o=_s(e,n),r=o||vs(e,n,o);if(r instanceof ps)return this.shallow?e.offset++:(e.path.push(0),this._visitedParent=r),this.position=e,ws("elementStart",r,t,e,1);if(r instanceof fs){let n;if(this.singleCharacters)n=1;else{let t=r.endOffset;this._boundaryEndParent==i&&this.boundaries.end.offsett&&(t=this.boundaries.start.offset),n=e.offset-t}const o=e.offset-r.startOffset,s=new gs(r,o-n,n);return e.offset-=n,this.position=e,ws("text",s,t,e,n)}return e.path.pop(),this.position=e,this._visitedParent=i.parent,ws("elementStart",i,t,e,1)}}function ws(t,e,i,n,o){return{done:!1,value:{type:t,item:e,previousPosition:i,nextPosition:n,length:o}}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class ks{constructor(t,e,i="toNone"){if(!t.is("element")&&!t.is("documentFragment"))throw new hi.b("model-position-root-invalid: Position root invalid.",t);if(!(e instanceof Array)||0===e.length)throw new hi.b("model-position-path-incorrect-format: Position path must be an array with at least one item.",t,{path:e});t.is("rootElement")?e=e.slice():(e=[...t.getPath(),...e],t=t.root),this.root=t,this.path=e,this.stickiness=i}get offset(){return this.path[this.path.length-1]}set offset(t){this.path[this.path.length-1]=t}get parent(){let t=this.root;for(let e=0;ei.path.length){if(e.offset!==n.maxOffset)return!1;e.path=e.path.slice(0,-1),n=n.parent,e.offset++}else{if(0!==i.offset)return!1;i.path=i.path.slice(0,-1)}}}is(t){return"position"===t||"model:position"===t}hasSameParentAs(t){if(this.root!==t.root)return!1;return"same"==Oi(this.getParentPath(),t.getParentPath())}getTransformedByOperation(t){let e;switch(t.type){case"insert":e=this._getTransformedByInsertOperation(t);break;case"move":case"remove":case"reinsert":e=this._getTransformedByMoveOperation(t);break;case"split":e=this._getTransformedBySplitOperation(t);break;case"merge":e=this._getTransformedByMergeOperation(t);break;default:e=ks._createAt(this)}return e}_getTransformedByInsertOperation(t){return this._getTransformedByInsertion(t.position,t.howMany)}_getTransformedByMoveOperation(t){return this._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany)}_getTransformedBySplitOperation(t){const e=t.movedRange;return e.containsPosition(this)||e.start.isEqual(this)&&"toNext"==this.stickiness?this._getCombined(t.splitPosition,t.moveTargetPosition):t.graveyardPosition?this._getTransformedByMove(t.graveyardPosition,t.insertionPosition,1):this._getTransformedByInsertion(t.insertionPosition,1)}_getTransformedByMergeOperation(t){const e=t.movedRange;let i;return e.containsPosition(this)||e.start.isEqual(this)?(i=this._getCombined(t.sourcePosition,t.targetPosition),t.sourcePosition.isBefore(t.targetPosition)&&(i=i._getTransformedByDeletion(t.deletionPosition,1))):i=this.isEqual(t.deletionPosition)?ks._createAt(t.deletionPosition):this._getTransformedByMove(t.deletionPosition,t.graveyardPosition,1),i}_getTransformedByDeletion(t,e){const i=ks._createAt(this);if(this.root!=t.root)return i;if("same"==Oi(t.getParentPath(),this.getParentPath())){if(t.offsetthis.offset)return null;i.offset-=e}}else if("prefix"==Oi(t.getParentPath(),this.getParentPath())){const n=t.path.length-1;if(t.offset<=this.path[n]){if(t.offset+e>this.path[n])return null;i.path[n]-=e}}return i}_getTransformedByInsertion(t,e){const i=ks._createAt(this);if(this.root!=t.root)return i;if("same"==Oi(t.getParentPath(),this.getParentPath()))(t.offsete+1;){const e=n.maxOffset-i.offset;0!==e&&t.push(new xs(i,i.getShiftedBy(e))),i.path=i.path.slice(0,-1),i.offset++,n=n.parent}for(;i.path.length<=this.end.path.length;){const e=this.end.path[i.path.length-1],n=e-i.offset;0!==n&&t.push(new xs(i,i.getShiftedBy(n))),i.offset=e,i.path.push(0)}return t}getWalker(t={}){return t.boundaries=this,new bs(t)}*getItems(t={}){t.boundaries=this,t.ignoreElementEnd=!0;const e=new bs(t);for(const t of e)yield t.item}*getPositions(t={}){t.boundaries=this;const e=new bs(t);yield e.position;for(const t of e)yield t.nextPosition}getTransformedByOperation(t){switch(t.type){case"insert":return this._getTransformedByInsertOperation(t);case"move":case"remove":case"reinsert":return this._getTransformedByMoveOperation(t);case"split":return[this._getTransformedBySplitOperation(t)];case"merge":return[this._getTransformedByMergeOperation(t)]}return[new xs(this.start,this.end)]}getTransformedByOperations(t){const e=[new xs(this.start,this.end)];for(const i of t)for(let t=0;t0?new this(i,n):new this(n,i)}static _createIn(t){return new this(ks._createAt(t,0),ks._createAt(t,t.maxOffset))}static _createOn(t){return this._createFromPositionAndShift(ks._createBefore(t),t.offsetSize)}static _createFromRanges(t){if(0===t.length)throw new hi.b("range-create-from-ranges-empty-array: At least one range has to be passed.",null);if(1==t.length)return t[0].clone();const e=t[0];t.sort((t,e)=>t.start.isAfter(e.start)?1:-1);const i=t.indexOf(e),n=new this(e.start,e.end);if(i>0)for(let e=i-1;t[e].end.isEqual(n.start);e++)n.start=ks._createAt(t[e].start);for(let e=i+1;e{if(e.viewPosition)return;const i=this._modelToViewMapping.get(e.modelPosition.parent);e.viewPosition=this._findPositionIn(i,e.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(t,e)=>{if(e.modelPosition)return;const i=this.findMappedViewAncestor(e.viewPosition),n=this._viewToModelMapping.get(i),o=this._toModelOffset(e.viewPosition.parent,e.viewPosition.offset,i);e.modelPosition=ks._createAt(n,o)},{priority:"low"})}bindElements(t,e){this._modelToViewMapping.set(t,e),this._viewToModelMapping.set(e,t)}unbindViewElement(t){const e=this.toModelElement(t);if(this._viewToModelMapping.delete(t),this._elementToMarkerNames.has(t))for(const e of this._elementToMarkerNames.get(t))this._unboundMarkerNames.add(e);this._modelToViewMapping.get(e)==t&&this._modelToViewMapping.delete(e)}unbindModelElement(t){const e=this.toViewElement(t);this._modelToViewMapping.delete(t),this._viewToModelMapping.get(e)==t&&this._viewToModelMapping.delete(e)}bindElementToMarker(t,e){const i=this._markerNameToElements.get(e)||new Set;i.add(t);const n=this._elementToMarkerNames.get(t)||new Set;n.add(e),this._markerNameToElements.set(e,i),this._elementToMarkerNames.set(t,n)}unbindElementFromMarkerName(t,e){const i=this._markerNameToElements.get(e);i&&(i.delete(t),0==i.size&&this._markerNameToElements.delete(e));const n=this._elementToMarkerNames.get(t);n&&(n.delete(e),0==n.size&&this._elementToMarkerNames.delete(t))}flushUnboundMarkerNames(){const t=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),t}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set}toModelElement(t){return this._viewToModelMapping.get(t)}toViewElement(t){return this._modelToViewMapping.get(t)}toModelRange(t){return new xs(this.toModelPosition(t.start),this.toModelPosition(t.end))}toViewRange(t){return new Zn(this.toViewPosition(t.start),this.toViewPosition(t.end))}toModelPosition(t){const e={viewPosition:t,mapper:this};return this.fire("viewToModelPosition",e),e.modelPosition}toViewPosition(t,e={isPhantom:!1}){const i={modelPosition:t,mapper:this,isPhantom:e.isPhantom};return this.fire("modelToViewPosition",i),i.viewPosition}markerNameToElements(t){const e=this._markerNameToElements.get(t);if(!e)return null;const i=new Set;for(const t of e)if(t.is("attributeElement"))for(const e of t.getElementsWithSameId())i.add(e);else i.add(t);return i}registerViewToModelLength(t,e){this._viewToModelLengthCallbacks.set(t,e)}findMappedViewAncestor(t){let e=t.parent;for(;!this._viewToModelMapping.has(e);)e=e.parent;return e}_toModelOffset(t,e,i){if(i!=t){return this._toModelOffset(t.parent,t.index,i)+this._toModelOffset(t,e,t)}if(t.is("text"))return e;let n=0;for(let i=0;i1?e[0]+":"+e[1]:e[0]} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Ts{constructor(t){this.conversionApi=Fn({dispatcher:this},t)}convertChanges(t,e,i){for(const e of t.getMarkersToRemove())this.convertMarkerRemove(e.name,e.range,i);for(const e of t.getChanges())"insert"==e.type?this.convertInsert(xs._createFromPositionAndShift(e.position,e.length),i):"remove"==e.type?this.convertRemove(e.position,e.length,e.name,i):this.convertAttribute(e.range,e.attributeKey,e.attributeOldValue,e.attributeNewValue,i);for(const t of this.conversionApi.mapper.flushUnboundMarkerNames()){const n=e.get(t).getRange();this.convertMarkerRemove(t,n,i),this.convertMarkerAdd(t,n,i)}for(const e of t.getMarkersToAdd())this.convertMarkerAdd(e.name,e.range,i)}convertInsert(t,e){this.conversionApi.writer=e,this.conversionApi.consumable=this._createInsertConsumable(t);for(const e of t){const t=e.item,i={item:t,range:xs._createFromPositionAndShift(e.previousPosition,e.length)};this._testAndFire("insert",i);for(const e of t.getAttributeKeys())i.attributeKey=e,i.attributeOldValue=null,i.attributeNewValue=t.getAttribute(e),this._testAndFire("attribute:"+e,i)}this._clearConversionApi()}convertRemove(t,e,i,n){this.conversionApi.writer=n,this.fire("remove:"+i,{position:t,length:e},this.conversionApi),this._clearConversionApi()}convertAttribute(t,e,i,n,o){this.conversionApi.writer=o,this.conversionApi.consumable=this._createConsumableForRange(t,"attribute:"+e);for(const o of t){const t={item:o.item,range:xs._createFromPositionAndShift(o.previousPosition,o.length),attributeKey:e,attributeOldValue:i,attributeNewValue:n};this._testAndFire("attribute:"+e,t)}this._clearConversionApi()}convertSelection(t,e,i){const n=Array.from(e.getMarkersAtPosition(t.getFirstPosition()));if(this.conversionApi.writer=i,this.conversionApi.consumable=this._createSelectionConsumable(t,n),this.fire("selection",{selection:t},this.conversionApi),t.isCollapsed){for(const e of n){const i=e.getRange();if(!Ss(t.getFirstPosition(),e,this.conversionApi.mapper))continue;const n={item:t,markerName:e.name,markerRange:i};this.conversionApi.consumable.test(t,"addMarker:"+e.name)&&this.fire("addMarker:"+e.name,n,this.conversionApi)}for(const e of t.getAttributeKeys()){const i={item:t,range:t.getFirstRange(),attributeKey:e,attributeOldValue:null,attributeNewValue:t.getAttribute(e)};this.conversionApi.consumable.test(t,"attribute:"+i.attributeKey)&&this.fire("attribute:"+i.attributeKey+":$text",i,this.conversionApi)}this._clearConversionApi()}}convertMarkerAdd(t,e,i){if(!e.root.document||"$graveyard"==e.root.rootName)return;this.conversionApi.writer=i;const n="addMarker:"+t,o=new Ps;if(o.add(e,n),this.conversionApi.consumable=o,this.fire(n,{markerName:t,markerRange:e},this.conversionApi),o.test(e,n)){this.conversionApi.consumable=this._createConsumableForRange(e,n);for(const i of e.getItems()){if(!this.conversionApi.consumable.test(i,n))continue;const o={item:i,range:xs._createOn(i),markerName:t,markerRange:e};this.fire(n,o,this.conversionApi)}this._clearConversionApi()}}convertMarkerRemove(t,e,i){e.root.document&&"$graveyard"!=e.root.rootName&&(this.conversionApi.writer=i,this.fire("removeMarker:"+t,{markerName:t,markerRange:e},this.conversionApi),this._clearConversionApi())}_createInsertConsumable(t){const e=new Ps;for(const i of t){const t=i.item;e.add(t,"insert");for(const i of t.getAttributeKeys())e.add(t,"attribute:"+i)}return e}_createConsumableForRange(t,e){const i=new Ps;for(const n of t.getItems())i.add(n,e);return i}_createSelectionConsumable(t,e){const i=new Ps;i.add(t,"selection");for(const n of e)i.add(t,"addMarker:"+n.name);for(const e of t.getAttributeKeys())i.add(t,"attribute:"+e);return i}_testAndFire(t,e){if(!this.conversionApi.consumable.test(e.item,t))return;const i=e.item.name||"$text";this.fire(t+":"+i,e,this.conversionApi)}_clearConversionApi(){delete this.conversionApi.writer,delete this.conversionApi.consumable}}function Ss(t,e,i){const n=e.getRange(),o=Array.from(t.getAncestors());return o.shift(),o.reverse(),!o.some(t=>{if(n.containsItem(t)){return!!i.toViewElement(t).getCustomProperty("addHighlight")}})} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */yi(Ts,gi);class Es{constructor(t,e,i){this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map,t&&this.setTo(t,e,i)}get anchor(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.end:t.start}return null}get focus(){if(this._ranges.length>0){const t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.start:t.end}return null}get isCollapsed(){return 1===this._ranges.length&&this._ranges[0].isCollapsed}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(t){if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(const e of this._ranges){let i=!1;for(const n of t._ranges)if(e.isEqual(n)){i=!0;break}if(!i)return!1}return!0}*getRanges(){for(const t of this._ranges)yield new xs(t.start,t.end)}getFirstRange(){let t=null;for(const e of this._ranges)t&&!e.start.isBefore(t.start)||(t=e);return t?new xs(t.start,t.end):null}getLastRange(){let t=null;for(const e of this._ranges)t&&!e.end.isAfter(t.end)||(t=e);return t?new xs(t.start,t.end):null}getFirstPosition(){const t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){const t=this.getLastRange();return t?t.end.clone():null}setTo(t,e,i){if(null===t)this._setRanges([]);else if(t instanceof Es)this._setRanges(t.getRanges(),t.isBackward);else if(t&&"function"==typeof t.getRanges)this._setRanges(t.getRanges(),t.isBackward);else if(t instanceof xs)this._setRanges([t],!!e&&!!e.backward);else if(t instanceof ks)this._setRanges([new xs(t)]);else if(t instanceof us){const n=!!i&&!!i.backward;let o;if("in"==e)o=xs._createIn(t);else if("on"==e)o=xs._createOn(t);else{if(void 0===e)throw new hi.b("model-selection-setTo-required-second-parameter: selection.setTo requires the second parameter when the first parameter is a node.",[this,t]);o=new xs(ks._createAt(t,e))}this._setRanges([o],n)}else{if(!vi(t))throw new hi.b("model-selection-setTo-not-selectable: Cannot set the selection to the given place.",[this,t]);this._setRanges(t,e&&!!e.backward)}}_setRanges(t,e=!1){const i=(t=Array.from(t)).some(e=>{if(!(e instanceof xs))throw new hi.b("model-selection-set-ranges-not-range: Selection range set to an object that is not an instance of model.Range.",[this,t]);return this._ranges.every(t=>!t.isEqual(e))});if(t.length!==this._ranges.length||i){this._removeAllRanges();for(const e of t)this._pushRange(e);this._lastRangeBackward=!!e,this.fire("change:range",{directChange:!0})}}setFocus(t,e){if(null===this.anchor)throw new hi.b("model-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.",[this,t]);const i=ks._createAt(t,e);if("same"==i.compareWith(this.focus))return;const n=this.anchor;this._ranges.length&&this._popRange(),"before"==i.compareWith(n)?(this._pushRange(new xs(i,n)),this._lastRangeBackward=!0):(this._pushRange(new xs(n,i)),this._lastRangeBackward=!1),this.fire("change:range",{directChange:!0})}getAttribute(t){return this._attrs.get(t)}getAttributes(){return this._attrs.entries()}getAttributeKeys(){return this._attrs.keys()}hasAttribute(t){return this._attrs.has(t)}removeAttribute(t){this.hasAttribute(t)&&(this._attrs.delete(t),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}setAttribute(t,e){this.getAttribute(t)!==e&&(this._attrs.set(t,e),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}getSelectedElement(){return 1!==this.rangeCount?null:this.getFirstRange().getContainedElement()}is(t){return"selection"===t||"model:selection"===t}*getSelectedBlocks(){const t=new WeakSet;for(const e of this.getRanges()){const i=Is(e.start,t);i&&Ms(i,e)&&(yield i);for(const i of e.getWalker()){const n=i.item;"elementEnd"==i.type&&Rs(n,t,e)&&(yield n)}const n=Is(e.end,t);n&&!e.end.isTouching(ks._createAt(n,0))&&Ms(n,e)&&(yield n)}}containsEntireContent(t=this.anchor.root){const e=ks._createAt(t,0),i=ks._createAt(t,"end");return e.isTouching(this.getFirstPosition())&&i.isTouching(this.getLastPosition())}_pushRange(t){this._checkRange(t),this._ranges.push(new xs(t.start,t.end))}_checkRange(t){for(let e=0;e0;)this._popRange()}_popRange(){this._ranges.pop()}}function Os(t,e){return!e.has(t)&&(e.add(t),t.root.document.model.schema.isBlock(t)&&t.parent)}function Rs(t,e,i){return Os(t,e)&&Ms(t,i)}function Is(t,e){const i=t.parent.root.document.model.schema,n=t.parent.getAncestors({parentFirst:!0,includeSelf:!0});let o=!1;const r=n.find(t=>!o&&(o=i.isLimit(t),!o&&Os(t,e)));return n.forEach(t=>e.add(t)),r}function Ms(t,e){const i=function(t){const e=t.root.document.model.schema;let i=t.parent;for(;i;){if(e.isBlock(i))return i;i=i.parent}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(t);return!i||!e.containsRange(xs._createOn(i),!0)}yi(Es,gi);class Ns extends xs{constructor(t,e){super(t,e),Vs.call(this)}detach(){this.stopListening()}is(t){return"liveRange"===t||"model:liveRange"===t||"range"==t||"model:range"===t}toRange(){return new xs(this.start,this.end)}static fromRange(t){return new Ns(t.start,t.end)}}function Vs(){this.listenTo(this.root.document.model,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&Bs.call(this,i)},{priority:"low"})}function Bs(t){const e=this.getTransformedByOperation(t),i=xs._createFromRanges(e),n=!i.isEqual(this),o=function(t,e){switch(e.type){case"insert":return t.containsPosition(e.position);case"move":case"remove":case"reinsert":case"merge":return t.containsPosition(e.sourcePosition)||t.start.isEqual(e.sourcePosition)||t.containsPosition(e.targetPosition);case"split":return t.containsPosition(e.splitPosition)||t.containsPosition(e.insertionPosition)}return!1}(this,t);let r=null;if(n){"$graveyard"==i.root.rootName&&(r="remove"==t.type?t.sourcePosition:t.deletionPosition);const e=this.toRange();this.start=i.start,this.end=i.end,this.fire("change:range",e,{deletionPosition:r})}else o&&this.fire("change:content",this.toRange(),{deletionPosition:r})}yi(Ns,gi);class Fs{constructor(t){this._selection=new Ds(t),this._selection.delegate("change:range").to(this),this._selection.delegate("change:attribute").to(this),this._selection.delegate("change:marker").to(this)}get isCollapsed(){return this._selection.isCollapsed}get anchor(){return this._selection.anchor}get focus(){return this._selection.focus}get rangeCount(){return this._selection.rangeCount}get hasOwnRange(){return this._selection.hasOwnRange}get isBackward(){return this._selection.isBackward}get isGravityOverridden(){return this._selection.isGravityOverridden}get markers(){return this._selection.markers}get _ranges(){return this._selection._ranges}getRanges(){return this._selection.getRanges()}getFirstPosition(){return this._selection.getFirstPosition()}getLastPosition(){return this._selection.getLastPosition()}getFirstRange(){return this._selection.getFirstRange()}getLastRange(){return this._selection.getLastRange()}getSelectedBlocks(){return this._selection.getSelectedBlocks()}getSelectedElement(){return this._selection.getSelectedElement()}containsEntireContent(t){return this._selection.containsEntireContent(t)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(t){return this._selection.getAttribute(t)}hasAttribute(t){return this._selection.hasAttribute(t)}refresh(){this._selection._updateMarkers(),this._selection._updateAttributes(!1)}is(t){return"selection"===t||"model:selection"==t||"documentSelection"==t||"model:documentSelection"==t}_setFocus(t,e){this._selection.setFocus(t,e)}_setTo(t,e,i){this._selection.setTo(t,e,i)}_setAttribute(t,e){this._selection.setAttribute(t,e)}_removeAttribute(t){this._selection.removeAttribute(t)}_getStoredAttributes(){return this._selection._getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(t){this._selection.restoreGravity(t)}static _getStoreAttributeKey(t){return"selection:"+t}static _isStoreAttributeKey(t){return t.startsWith("selection:")}}yi(Fs,gi);class Ds extends Es{constructor(t){super(),this.markers=new xi({idProperty:"name"}),this._model=t.model,this._document=t,this._attributePriority=new Map,this._fixGraveyardRangesData=[],this._hasChangedRange=!1,this._overriddenGravityRegister=new Set,this.listenTo(this._model,"applyOperation",(t,e)=>{const i=e[0];if(i.isDocumentOperation&&"marker"!=i.type&&"rename"!=i.type&&"noop"!=i.type){for(;this._fixGraveyardRangesData.length;){const{liveRange:t,sourcePosition:e}=this._fixGraveyardRangesData.shift();this._fixGraveyardSelection(t,e)}this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1}))}},{priority:"lowest"}),this.on("change:range",()=>{for(const t of this.getRanges())if(!this._document._validateSelectionRange(t))throw new hi.b("document-selection-wrong-position: Range from document selection starts or ends at incorrect position.",this,{range:t})}),this.listenTo(this._model.markers,"update",()=>this._updateMarkers()),this.listenTo(this._document,"change",(t,e)=>{!function(t,e){const i=t.document.differ;for(const n of i.getChanges()){if("insert"!=n.type)continue;const i=n.position.parent;n.length===i.maxOffset&&t.enqueueChange(e,t=>{const e=Array.from(i.getAttributeKeys()).filter(t=>t.startsWith("selection:"));for(const n of e)t.removeAttribute(n,i)})}}(this._model,e)})}get isCollapsed(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:super.isCollapsed}get anchor(){return super.anchor||this._document._getDefaultRange().start}get focus(){return super.focus||this._document._getDefaultRange().end}get rangeCount(){return this._ranges.length?this._ranges.length:1}get hasOwnRange(){return this._ranges.length>0}get isGravityOverridden(){return!!this._overriddenGravityRegister.size}destroy(){for(let t=0;t{this._hasChangedRange=!0,e.root==this._document.graveyard&&this._fixGraveyardRangesData.push({liveRange:e,sourcePosition:n.deletionPosition})}),e}_updateMarkers(){const t=[];let e=!1;for(const e of this._model.markers){const i=e.getRange();for(const n of this.getRanges())i.containsRange(n,!n.isCollapsed)&&t.push(e)}const i=Array.from(this.markers);for(const i of t)this.markers.has(i)||(this.markers.add(i),e=!0);for(const i of Array.from(this.markers))t.includes(i)||(this.markers.remove(i),e=!0);e&&this.fire("change:marker",{oldMarkers:i,directChange:!1})}_updateAttributes(t){const e=Vi(this._getSurroundingAttributes()),i=Vi(this.getAttributes());if(t)this._attributePriority=new Map,this._attrs=new Map;else for(const[t,e]of this._attributePriority)"low"==e&&(this._attrs.delete(t),this._attributePriority.delete(t));this._setAttributesTo(e);const n=[];for(const[t,e]of this.getAttributes())i.has(t)&&i.get(t)===e||n.push(t);for(const[t]of i)this.hasAttribute(t)||n.push(t);n.length>0&&this.fire("change:attribute",{attributeKeys:n,directChange:!1})}_setAttribute(t,e,i=!0){const n=i?"normal":"low";return("low"!=n||"normal"!=this._attributePriority.get(t))&&(super.getAttribute(t)!==e&&(this._attrs.set(t,e),this._attributePriority.set(t,n),!0))}_removeAttribute(t,e=!0){const i=e?"normal":"low";return("low"!=i||"normal"!=this._attributePriority.get(t))&&(this._attributePriority.set(t,i),!!super.hasAttribute(t)&&(this._attrs.delete(t),!0))}_setAttributesTo(t){const e=new Set;for(const[e,i]of this.getAttributes())t.get(e)!==i&&this._removeAttribute(e,!1);for(const[i,n]of t){this._setAttribute(i,n,!1)&&e.add(i)}return e}*_getStoredAttributes(){const t=this.getFirstPosition().parent;if(this.isCollapsed&&t.isEmpty)for(const e of t.getAttributeKeys())if(e.startsWith("selection:")){const i=e.substr("selection:".length);yield[i,t.getAttribute(e)]}}_getSurroundingAttributes(){const t=this.getFirstPosition(),e=this._model.schema;let i=null;if(this.isCollapsed){const e=t.textNode?t.textNode:t.nodeBefore,n=t.textNode?t.textNode:t.nodeAfter;if(this.isGravityOverridden||(i=Ls(e)),i||(i=Ls(n)),!this.isGravityOverridden&&!i){let t=e;for(;t&&!i;)t=t.previousSibling,i=Ls(t)}if(!i){let t=n;for(;t&&!i;)t=t.nextSibling,i=Ls(t)}i||(i=this._getStoredAttributes())}else{const t=this.getFirstRange();for(const n of t){if(n.item.is("element")&&e.isObject(n.item))break;if("text"==n.type){i=n.item.getAttributes();break}}}return i}_fixGraveyardSelection(t,e){const i=e.clone(),n=this._model.schema.getNearestSelectionRange(i),o=this._ranges.indexOf(t);if(this._ranges.splice(o,1),t.detach(),n&&(r=n,this._ranges.every(t=>!r.isEqual(t)))){const t=this._prepareRange(n);this._ranges.splice(o,0,t)}var r; -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */}}function Ls(t){return t instanceof gs||t instanceof fs?t.getAttributes():null}class zs{constructor(t){this._dispatchers=t}add(t){for(const e of this._dispatchers)t(e);return this}}var js=function(t){return ti(t,5)}; -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class qs extends zs{elementToElement(t){return this.add(function(t){return(t=js(t)).view=Hs(t.view,"container"),e=>{var i;e.on("insert:"+t.model,(i=t.view,(t,e,n)=>{const o=i(e.item,n.writer);if(!o)return;if(!n.consumable.consume(e.item,"insert"))return;const r=n.mapper.toViewPosition(e.range.start);n.mapper.bindElements(e.item,o),n.writer.insert(r,o)}),{priority:t.converterPriority||"normal"})}}(t))}attributeToElement(t){return this.add(function(t){let e="attribute:"+((t=js(t)).model.key?t.model.key:t.model);t.model.name&&(e+=":"+t.model.name);if(t.model.values)for(const e of t.model.values)t.view[e]=Hs(t.view[e],"attribute");else t.view=Hs(t.view,"attribute");const i=Us(t);return n=>{n.on(e,function(t){return(e,i,n)=>{const o=t(i.attributeOldValue,n.writer),r=t(i.attributeNewValue,n.writer);if(!o&&!r)return;if(!n.consumable.consume(i.item,e.name))return;const s=n.writer,a=s.document.selection;if(i.item instanceof Es||i.item instanceof Fs)s.wrap(a.getFirstRange(),r);else{let t=n.mapper.toViewRange(i.range);null!==i.attributeOldValue&&o&&(t=s.unwrap(t,o)),null!==i.attributeNewValue&&r&&s.wrap(t,r)}}}(i),{priority:t.converterPriority||"normal"})}}(t))}attributeToAttribute(t){return this.add(function(t){let e="attribute:"+((t=js(t)).model.key?t.model.key:t.model);t.model.name&&(e+=":"+t.model.name);if(t.model.values)for(const e of t.model.values)t.view[e]=$s(t.view[e]);else t.view=$s(t.view);const i=Us(t);return n=>{var o;n.on(e,(o=i,(t,e,i)=>{const n=o(e.attributeOldValue,e),r=o(e.attributeNewValue,e);if(!n&&!r)return;if(!i.consumable.consume(e.item,t.name))return;const s=i.mapper.toViewElement(e.item),a=i.writer;if(!s)throw new hi.b("conversion-attribute-to-attribute-on-text: Trying to convert text node's attribute with attribute-to-attribute converter.",[e,i]);if(null!==e.attributeOldValue&&n)if("class"==n.key){const t=Array.isArray(n.value)?n.value:[n.value];for(const e of t)a.removeClass(e,s)}else if("style"==n.key){const t=Object.keys(n.value);for(const e of t)a.removeStyle(e,s)}else a.removeAttribute(n.key,s);if(null!==e.attributeNewValue&&r)if("class"==r.key){const t=Array.isArray(r.value)?r.value:[r.value];for(const e of t)a.addClass(e,s)}else if("style"==r.key){const t=Object.keys(r.value);for(const e of t)a.setStyle(e,r.value[e],s)}else a.setAttribute(r.key,r.value,s)}),{priority:t.converterPriority||"normal"})}}(t))}markerToElement(t){return this.add(function(t){return(t=js(t)).view=Hs(t.view,"ui"),e=>{var i;e.on("addMarker:"+t.model,(i=t.view,(t,e,n)=>{e.isOpening=!0;const o=i(e,n.writer);e.isOpening=!1;const r=i(e,n.writer);if(!o||!r)return;const s=e.markerRange;if(s.isCollapsed&&!n.consumable.consume(s,t.name))return;for(const e of s)if(!n.consumable.consume(e.item,t.name))return;const a=n.mapper,c=n.writer;c.insert(a.toViewPosition(s.start),o),n.mapper.bindElementToMarker(o,e.markerName),s.isCollapsed||(c.insert(a.toViewPosition(s.end),r),n.mapper.bindElementToMarker(r,e.markerName)),t.stop()}),{priority:t.converterPriority||"normal"}),e.on("removeMarker:"+t.model,(t.view,(t,e,i)=>{const n=i.mapper.markerNameToElements(e.markerName);if(n){for(const t of n)i.mapper.unbindElementFromMarkerName(t,e.markerName),i.writer.clear(i.writer.createRangeOn(t),t);i.writer.clearClonedElementsGroup(e.markerName),t.stop()}}),{priority:t.converterPriority||"normal"})}}(t))}markerToHighlight(t){return this.add(function(t){return e=>{var i;e.on("addMarker:"+t.model,(i=t.view,(t,e,n)=>{if(!e.item)return;if(!(e.item instanceof Es||e.item instanceof Fs||e.item.is("textProxy")))return;const o=Gs(i,e,n);if(!o)return;if(!n.consumable.consume(e.item,t.name))return;const r=n.writer,s=Ws(r,o),a=r.document.selection;if(e.item instanceof Es||e.item instanceof Fs)r.wrap(a.getFirstRange(),s,a);else{const t=n.mapper.toViewRange(e.range),i=r.wrap(t,s);for(const t of i.getItems())if(t.is("attributeElement")&&t.isSimilar(s)){n.mapper.bindElementToMarker(t,e.markerName);break}}}),{priority:t.converterPriority||"normal"}),e.on("addMarker:"+t.model,function(t){return(e,i,n)=>{if(!i.item)return;if(!(i.item instanceof ps))return;const o=Gs(t,i,n);if(!o)return;if(!n.consumable.test(i.item,e.name))return;const r=n.mapper.toViewElement(i.item);if(r&&r.getCustomProperty("addHighlight")){n.consumable.consume(i.item,e.name);for(const t of xs._createIn(i.item))n.consumable.consume(t.item,e.name);r.getCustomProperty("addHighlight")(r,o,n.writer),n.mapper.bindElementToMarker(r,i.markerName)}}}(t.view),{priority:t.converterPriority||"normal"}),e.on("removeMarker:"+t.model,function(t){return(e,i,n)=>{if(i.markerRange.isCollapsed)return;const o=Gs(t,i,n);if(!o)return;const r=Ws(n.writer,o),s=n.mapper.markerNameToElements(i.markerName);if(s){for(const t of s)n.mapper.unbindElementFromMarkerName(t,i.markerName),t.is("attributeElement")?n.writer.unwrap(n.writer.createRangeOn(t),r):t.getCustomProperty("removeHighlight")(t,o.id,n.writer);n.writer.clearClonedElementsGroup(i.markerName),e.stop()}}}(t.view),{priority:t.converterPriority||"normal"})}}(t))}}function Ws(t,e){const i=t.createAttributeElement("span",e.attributes);return e.classes&&i._addClass(e.classes),e.priority&&(i._priority=e.priority),i._id=e.id,i}function Hs(t,e){return"function"==typeof t?t:(i,n)=>function(t,e,i){"string"==typeof t&&(t={name:t});let n;const o=Object.assign({},t.attributes);if("container"==i)n=e.createContainerElement(t.name,o);else if("attribute"==i){const i={priority:t.priority||ro.DEFAULT_PRIORITY};n=e.createAttributeElement(t.name,o,i)}else n=e.createUIElement(t.name,o);if(t.styles){const i=Object.keys(t.styles);for(const o of i)e.setStyle(o,t.styles[o],n)}if(t.classes){const i=t.classes;if("string"==typeof i)e.addClass(i,n);else for(const t of i)e.addClass(t,n)}return n}(t,n,e)}function Us(t){return t.model.values?(e,i)=>{const n=t.view[e];return n?n(e,i):null}:t.view}function $s(t){return"string"==typeof t?e=>({key:t,value:e}):"object"==typeof t?t.value?()=>t:e=>({key:t.key,value:e}):t}function Gs(t,e,i){const n="function"==typeof t?t(e,i):t;return n?(n.priority||(n.priority=10),n.id||(n.id=e.markerName),n):null} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Ks extends zs{elementToElement(t){return this.add(Js(t))}elementToAttribute(t){return this.add(function(t){Ys(t=js(t));const e=Xs(t,!1),i=Qs(t.view),n=i?"element:"+i:"element";return i=>{i.on(n,e,{priority:t.converterPriority||"low"})}}(t))}attributeToAttribute(t){return this.add(function(t){t=js(t);let e=null;("string"==typeof t.view||t.view.key)&&(e=function(t){"string"==typeof t.view&&(t.view={key:t.view});const e=t.view.key;let i;if("class"==e||"style"==e){i={["class"==e?"classes":"styles"]:t.view.value}}else{const n=void 0===t.view.value?/[\s\S]*/:t.view.value;i={attributes:{[e]:n}}}t.view.name&&(i.name=t.view.name);return t.view=i,e}(t));Ys(t,e);const i=Xs(t,!0);return e=>{e.on("element",i,{priority:t.converterPriority||"low"})}}(t))}elementToMarker(t){return this.add(function(t){return function(t){const e=t.model;t.model=(t,i)=>{const n="string"==typeof e?e:e(t);return i.createElement("$marker",{"data-name":n})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(t=js(t)),Js(t)}(t))}}function Js(t){const e=function(t){const e=t.view?new Bi(t.view):null;return(i,n,o)=>{let r={};if(e){const t=e.match(n.viewItem);if(!t)return;r=t.match}r.name=!0;const s=(a=t.model,c=n.viewItem,l=o.writer,a instanceof Function?a(c,l):l.createElement(a));var a,c,l;if(!s)return;if(!o.consumable.test(n.viewItem,r))return;const d=o.splitToAllowedParent(s,n.modelCursor);if(!d)return;o.writer.insert(s,d.position),o.convertChildren(n.viewItem,o.writer.createPositionAt(s,0)),o.consumable.consume(n.viewItem,r);const h=o.getSplitParts(s);n.modelRange=new xs(o.writer.createPositionBefore(s),o.writer.createPositionAfter(h[h.length-1])),d.cursorParent?n.modelCursor=o.writer.createPositionAt(d.cursorParent,0):n.modelCursor=n.modelRange.end}}(t=js(t)),i=Qs(t.view),n=i?"element:"+i:"element";return i=>{i.on(n,e,{priority:t.converterPriority||"normal"})}}function Qs(t){return"string"==typeof t?t:"object"==typeof t&&"string"==typeof t.name?t.name:null}function Ys(t,e=null){const i=null===e||(t=>t.getAttribute(e)),n="object"!=typeof t.model?t.model:t.model.key,o="object"!=typeof t.model||void 0===t.model.value?i:t.model.value;t.model={key:n,value:o}}function Xs(t,e){const i=new Bi(t.view);return(n,o,r)=>{const s=i.match(o.viewItem);if(!s)return;const a=t.model.key,c="function"==typeof t.model.value?t.model.value(o.viewItem):t.model.value;null!==c&&(!function(t,e){const i="function"==typeof t?t(e):t;if("object"==typeof i&&!Qs(i))return!1;return!i.classes&&!i.attributes&&!i.styles}(t.view,o.viewItem)?delete s.match.name:s.match.name=!0,r.consumable.test(o.viewItem,s.match)&&(o.modelRange||(o=Object.assign(o,r.convertChildren(o.viewItem,o.modelCursor))),function(t,e,i,n){let o=!1;for(const r of Array.from(t.getItems({shallow:i})))n.schema.checkAttribute(r,e.key)&&(n.writer.setAttribute(e.key,e.value,r),o=!0);return o}(o.modelRange,{key:a,value:c},e,r)&&r.consumable.consume(o.viewItem,s.match)))}}class Zs{constructor(t,e){this.model=t,this.view=new hs(e),this.mapper=new As,this.downcastDispatcher=new Ts({mapper:this.mapper});const i=this.model.document,n=i.selection,o=this.model.markers;this.listenTo(this.model,"_beforeChanges",()=>{this.view._disableRendering(!0)},{priority:"highest"}),this.listenTo(this.model,"_afterChanges",()=>{this.view._disableRendering(!1)},{priority:"lowest"}),this.listenTo(i,"change",()=>{this.view.change(t=>{this.downcastDispatcher.convertChanges(i.differ,o,t),this.downcastDispatcher.convertSelection(n,o,t)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",function(t,e){return(i,n)=>{const o=n.newSelection,r=new Es,s=[];for(const t of o.getRanges())s.push(e.toModelRange(t));r.setTo(s,{backward:o.isBackward}),r.isEqual(t.document.selection)||t.change(t=>{t.setSelection(r)})}}(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",(t,e,i)=>{if(!i.consumable.consume(e.item,"insert"))return;const n=i.writer,o=i.mapper.toViewPosition(e.range.start),r=n.createText(e.item.data);n.insert(o,r)},{priority:"lowest"}),this.downcastDispatcher.on("remove",(t,e,i)=>{const n=i.mapper.toViewPosition(e.position),o=e.position.getShiftedBy(e.length),r=i.mapper.toViewPosition(o,{isPhantom:!0}),s=i.writer.createRange(n,r),a=i.writer.remove(s.getTrimmed());for(const t of i.writer.createRangeIn(a).getItems())i.mapper.unbindViewElement(t)},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,i)=>{const n=i.writer,o=n.document.selection;for(const t of o.getRanges())t.isCollapsed&&t.end.parent.isAttached()&&i.writer.mergeAttributes(t.start);n.setSelection(null)},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,i)=>{const n=e.selection;if(n.isCollapsed)return;if(!i.consumable.consume(n,"selection"))return;const o=[];for(const t of n.getRanges()){const e=i.mapper.toViewRange(t);o.push(e)}i.writer.setSelection(o,{backward:n.isBackward})},{priority:"low"}),this.downcastDispatcher.on("selection",(t,e,i)=>{const n=e.selection;if(!n.isCollapsed)return;if(!i.consumable.consume(n,"selection"))return;const o=i.writer,r=n.getFirstPosition(),s=i.mapper.toViewPosition(r),a=o.breakAttributes(s);o.setSelection(a)},{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(t=>{if("$graveyard"==t.rootName)return null;const e=new Qn(this.view.document,t.name);return e.rootName=t.rootName,this.mapper.bindElements(t,e),e})}destroy(){this.view.destroy(),this.stopListening()}}yi(Zs,qn); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class ta{constructor(){this._commands=new Map}add(t,e){this._commands.set(t,e)}get(t){return this._commands.get(t)}execute(t,...e){const i=this.get(t);if(!i)throw new hi.b("commandcollection-command-not-found: Command does not exist.",this,{commandName:t});i.execute(...e)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(const t of this.commands())t.destroy()}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class ea{constructor(){this._consumables=new Map}add(t,e){let i;t.is("text")||t.is("documentFragment")?this._consumables.set(t,!0):(this._consumables.has(t)?i=this._consumables.get(t):(i=new ia(t),this._consumables.set(t,i)),i.add(e))}test(t,e){const i=this._consumables.get(t);return void 0===i?null:t.is("text")||t.is("documentFragment")?i:i.test(e)}consume(t,e){return!!this.test(t,e)&&(t.is("text")||t.is("documentFragment")?this._consumables.set(t,!1):this._consumables.get(t).consume(e),!0)}revert(t,e){const i=this._consumables.get(t);void 0!==i&&(t.is("text")||t.is("documentFragment")?this._consumables.set(t,!0):i.revert(e))}static consumablesFromElement(t){const e={element:t,name:!0,attributes:[],classes:[],styles:[]},i=t.getAttributeKeys();for(const t of i)"style"!=t&&"class"!=t&&e.attributes.push(t);const n=t.getClassNames();for(const t of n)e.classes.push(t);const o=t.getStyleNames();for(const t of o)e.styles.push(t);return e}static createFrom(t,e){if(e||(e=new ea(t)),t.is("text"))return e.add(t),e;t.is("element")&&e.add(t,ea.consumablesFromElement(t)),t.is("documentFragment")&&e.add(t);for(const i of t.getChildren())e=ea.createFrom(i,e);return e}}class ia{constructor(t){this.element=t,this._canConsumeName=null,this._consumables={attributes:new Map,styles:new Map,classes:new Map}}add(t){t.name&&(this._canConsumeName=!0);for(const e in this._consumables)e in t&&this._add(e,t[e])}test(t){if(t.name&&!this._canConsumeName)return this._canConsumeName;for(const e in this._consumables)if(e in t){const i=this._test(e,t[e]);if(!0!==i)return i}return!0}consume(t){t.name&&(this._canConsumeName=!1);for(const e in this._consumables)e in t&&this._consume(e,t[e])}revert(t){t.name&&(this._canConsumeName=!0);for(const e in this._consumables)e in t&&this._revert(e,t[e])}_add(t,e){const i=Vt(e)?e:[e],n=this._consumables[t];for(const e of i){if("attributes"===t&&("class"===e||"style"===e))throw new hi.b("viewconsumable-invalid-attribute: Classes and styles should be handled separately.",this);if(n.set(e,!0),"styles"===t)for(const t of this.element.document.stylesProcessor.getRelatedStyles(e))n.set(t,!0)}}_test(t,e){const i=Vt(e)?e:[e],n=this._consumables[t];for(const e of i)if("attributes"!==t||"class"!==e&&"style"!==e){const t=n.get(e);if(void 0===t)return null;if(!t)return!1}else{const t="class"==e?"classes":"styles",i=this._test(t,[...this._consumables[t].keys()]);if(!0!==i)return i}return!0}_consume(t,e){const i=Vt(e)?e:[e],n=this._consumables[t];for(const e of i)if("attributes"!==t||"class"!==e&&"style"!==e){if(n.set(e,!1),"styles"==t)for(const t of this.element.document.stylesProcessor.getRelatedStyles(e))n.set(t,!1)}else{const t="class"==e?"classes":"styles";this._consume(t,[...this._consumables[t].keys()])}}_revert(t,e){const i=Vt(e)?e:[e],n=this._consumables[t];for(const e of i)if("attributes"!==t||"class"!==e&&"style"!==e){!1===n.get(e)&&n.set(e,!0)}else{const t="class"==e?"classes":"styles";this._revert(t,[...this._consumables[t].keys()])}}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class na{constructor(){this._sourceDefinitions={},this._attributeProperties={},this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(t,e)=>{e[0]=new oa(e[0])},{priority:"highest"}),this.on("checkChild",(t,e)=>{e[0]=new oa(e[0]),e[1]=this.getDefinition(e[1])},{priority:"highest"})}register(t,e){if(this._sourceDefinitions[t])throw new hi.b("schema-cannot-register-item-twice: A single item cannot be registered twice in the schema.",this,{itemName:t});this._sourceDefinitions[t]=[Object.assign({},e)],this._clearCache()}extend(t,e){if(!this._sourceDefinitions[t])throw new hi.b("schema-cannot-extend-missing-item: Cannot extend an item which was not registered yet.",this,{itemName:t});this._sourceDefinitions[t].push(Object.assign({},e)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(t){let e;return e="string"==typeof t?t:t.is&&(t.is("text")||t.is("textProxy"))?"$text":t.name,this.getDefinitions()[e]}isRegistered(t){return!!this.getDefinition(t)}isBlock(t){const e=this.getDefinition(t);return!(!e||!e.isBlock)}isLimit(t){const e=this.getDefinition(t);return!!e&&!(!e.isLimit&&!e.isObject)}isObject(t){const e=this.getDefinition(t);return!(!e||!e.isObject)}isInline(t){const e=this.getDefinition(t);return!(!e||!e.isInline)}checkChild(t,e){return!!e&&this._checkContextMatch(e,t)}checkAttribute(t,e){const i=this.getDefinition(t.last);return!!i&&i.allowAttributes.includes(e)}checkMerge(t,e=null){if(t instanceof ks){const e=t.nodeBefore,i=t.nodeAfter;if(!(e instanceof ps))throw new hi.b("schema-check-merge-no-element-before: The node before the merge position must be an element.",this);if(!(i instanceof ps))throw new hi.b("schema-check-merge-no-element-after: The node after the merge position must be an element.",this);return this.checkMerge(e,i)}for(const i of e.getChildren())if(!this.checkChild(t,i))return!1;return!0}addChildCheck(t){this.on("checkChild",(e,[i,n])=>{if(!n)return;const o=t(i,n);"boolean"==typeof o&&(e.stop(),e.return=o)},{priority:"high"})}addAttributeCheck(t){this.on("checkAttribute",(e,[i,n])=>{const o=t(i,n);"boolean"==typeof o&&(e.stop(),e.return=o)},{priority:"high"})}setAttributeProperties(t,e){this._attributeProperties[t]=Object.assign(this.getAttributeProperties(t),e)}getAttributeProperties(t){return this._attributeProperties[t]||{}}getLimitElement(t){let e;if(t instanceof ks)e=t.parent;else{e=(t instanceof xs?[t]:Array.from(t.getRanges())).reduce((t,e)=>{const i=e.getCommonAncestor();return t?t.getCommonAncestor(i,{includeSelf:!0}):i},null)}for(;!this.isLimit(e)&&e.parent;)e=e.parent;return e}checkAttributeInSelection(t,e){if(t.isCollapsed){const i=[...t.getFirstPosition().getAncestors(),new fs("",t.getAttributes())];return this.checkAttribute(i,e)}{const i=t.getRanges();for(const t of i)for(const i of t)if(this.checkAttribute(i.item,e))return!0}return!1}*getValidRanges(t,e){t=function*(t){for(const e of t)yield*e.getMinimalFlatRanges()}(t);for(const i of t)yield*this._getValidRangesForRange(i,e)}getNearestSelectionRange(t,e="both"){if(this.checkChild(t,"$text"))return new xs(t);let i,n;const o=t.getAncestors().reverse().find(t=>this.isLimit(t))||t.root;"both"!=e&&"backward"!=e||(i=new bs({boundaries:xs._createIn(o),startPosition:t,direction:"backward"})),"both"!=e&&"forward"!=e||(n=new bs({boundaries:xs._createIn(o),startPosition:t}));for(const t of function*(t,e){let i=!1;for(;!i;){if(i=!0,t){const e=t.next();e.done||(i=!1,yield{walker:t,value:e.value})}if(e){const t=e.next();t.done||(i=!1,yield{walker:e,value:t.value})}}}(i,n)){const e=t.walker==i?"elementEnd":"elementStart",n=t.value;if(n.type==e&&this.isObject(n.item))return xs._createOn(n.item);if(this.checkChild(n.nextPosition,"$text"))return new xs(n.nextPosition)}return null}findAllowedParent(t,e){let i=t.parent;for(;i;){if(this.checkChild(i,e))return i;if(this.isLimit(i))return null;i=i.parent}return null}removeDisallowedAttributes(t,e){for(const i of t)if(i.is("text"))ma(this,i,e);else{const t=xs._createIn(i).getPositions();for(const i of t){ma(this,i.nodeBefore||i.parent,e)}}}createContext(t){return new oa(t)}_clearCache(){this._compiledDefinitions=null}_compile(){const t={},e=this._sourceDefinitions,i=Object.keys(e);for(const n of i)t[n]=ra(e[n],n);for(const e of i)sa(t,e);for(const e of i)aa(t,e);for(const e of i)ca(t,e),la(t,e);for(const e of i)da(t,e),ha(t,e);this._compiledDefinitions=t}_checkContextMatch(t,e,i=e.length-1){const n=e.getItem(i);if(t.allowIn.includes(n.name)){if(0==i)return!0;{const t=this.getDefinition(n);return this._checkContextMatch(t,e,i-1)}}return!1}*_getValidRangesForRange(t,e){let i=t.start,n=t.start;for(const o of t.getItems({shallow:!0}))o.is("element")&&(yield*this._getValidRangesForRange(xs._createIn(o),e)),this.checkAttribute(o,e)||(i.isEqual(n)||(yield new xs(i,n)),i=ks._createAfter(o)),n=ks._createAfter(o);i.isEqual(n)||(yield new xs(i,n))}}yi(na,qn);class oa{constructor(t){if(t instanceof oa)return t;"string"==typeof t?t=[t]:Array.isArray(t)||(t=t.getAncestors({includeSelf:!0})),t[0]&&"string"!=typeof t[0]&&t[0].is("documentFragment")&&t.shift(),this._items=t.map(ga)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(t){const e=new oa([t]);return e._items=[...this._items,...e._items],e}getItem(t){return this._items[t]}*getNames(){yield*this._items.map(t=>t.name)}endsWith(t){return Array.from(this.getNames()).join(" ").endsWith(t)}startsWith(t){return Array.from(this.getNames()).join(" ").startsWith(t)}}function ra(t,e){const i={name:e,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],inheritTypesFrom:[]};return function(t,e){for(const i of t){const t=Object.keys(i).filter(t=>t.startsWith("is"));for(const n of t)e[n]=i[n]}}(t,i),ua(t,i,"allowIn"),ua(t,i,"allowContentOf"),ua(t,i,"allowWhere"),ua(t,i,"allowAttributes"),ua(t,i,"allowAttributesOf"),ua(t,i,"inheritTypesFrom"),function(t,e){for(const i of t){const t=i.inheritAllFrom;t&&(e.allowContentOf.push(t),e.allowWhere.push(t),e.allowAttributesOf.push(t),e.inheritTypesFrom.push(t))}}(t,i),i}function sa(t,e){for(const i of t[e].allowContentOf)if(t[i]){fa(t,i).forEach(t=>{t.allowIn.push(e)})}delete t[e].allowContentOf}function aa(t,e){for(const i of t[e].allowWhere){const n=t[i];if(n){const i=n.allowIn;t[e].allowIn.push(...i)}}delete t[e].allowWhere}function ca(t,e){for(const i of t[e].allowAttributesOf){const n=t[i];if(n){const i=n.allowAttributes;t[e].allowAttributes.push(...i)}}delete t[e].allowAttributesOf}function la(t,e){const i=t[e];for(const e of i.inheritTypesFrom){const n=t[e];if(n){const t=Object.keys(n).filter(t=>t.startsWith("is"));for(const e of t)e in i||(i[e]=n[e])}}delete i.inheritTypesFrom}function da(t,e){const i=t[e],n=i.allowIn.filter(e=>t[e]);i.allowIn=Array.from(new Set(n))}function ha(t,e){const i=t[e];i.allowAttributes=Array.from(new Set(i.allowAttributes))}function ua(t,e,i){for(const n of t)"string"==typeof n[i]?e[i].push(n[i]):Array.isArray(n[i])&&e[i].push(...n[i])}function fa(t,e){const i=t[e];return(n=t,Object.keys(n).map(t=>n[t])).filter(t=>t.allowIn.includes(i.name));var n}function ga(t){return"string"==typeof t?{name:t,*getAttributeKeys(){},getAttribute(){}}:{name:t.is("element")?t.name:"$text",*getAttributeKeys(){yield*t.getAttributeKeys()},getAttribute:e=>t.getAttribute(e)}}function ma(t,e,i){for(const n of e.getAttributeKeys())t.checkAttribute(e,n)||i.removeAttribute(n,e)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class pa{constructor(t={}){this._splitParts=new Map,this._modelCursor=null,this.conversionApi=Object.assign({},t),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this),this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this),this.conversionApi.getSplitParts=this._getSplitParts.bind(this)}convert(t,e,i=["$root"]){this.fire("viewCleanup",t),this._modelCursor=function(t,e){let i;for(const n of new oa(t)){const t={};for(const e of n.getAttributeKeys())t[e]=n.getAttribute(e);const o=e.createElement(n.name,t);i&&e.append(o,i),i=ks._createAt(o,0)}return i} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(i,e),this.conversionApi.writer=e,this.conversionApi.consumable=ea.createFrom(t),this.conversionApi.store={};const{modelRange:n}=this._convertItem(t,this._modelCursor),o=e.createDocumentFragment();if(n){this._removeEmptyElements();for(const t of Array.from(this._modelCursor.parent.getChildren()))e.append(t,o);o.markers=function(t,e){const i=new Set,n=new Map,o=xs._createIn(t).getItems();for(const t of o)"$marker"==t.name&&i.add(t);for(const t of i){const i=t.getAttribute("data-name"),o=e.createPositionBefore(t);n.has(i)?n.get(i).end=o.clone():n.set(i,new xs(o.clone())),e.remove(t)}return n}(o,e)}return this._modelCursor=null,this._splitParts.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,o}_convertItem(t,e){const i=Object.assign({viewItem:t,modelCursor:e,modelRange:null});if(t.is("element")?this.fire("element:"+t.name,i,this.conversionApi):t.is("text")?this.fire("text",i,this.conversionApi):this.fire("documentFragment",i,this.conversionApi),i.modelRange&&!(i.modelRange instanceof xs))throw new hi.b("view-conversion-dispatcher-incorrect-result: Incorrect conversion result was dropped.",this);return{modelRange:i.modelRange,modelCursor:i.modelCursor}}_convertChildren(t,e){const i=new xs(e);let n=e;for(const e of Array.from(t.getChildren())){const t=this._convertItem(e,n);t.modelRange instanceof xs&&(i.end=t.modelRange.end,n=t.modelCursor)}return{modelRange:i,modelCursor:n}}_splitToAllowedParent(t,e){const i=this.conversionApi.schema.findAllowedParent(e,t);if(!i)return null;if(i===e.parent)return{position:e};if(this._modelCursor.parent.getAncestors().includes(i))return null;const n=this.conversionApi.writer.split(e,i),o=[];for(const t of n.range.getWalker())if("elementEnd"==t.type)o.push(t.item);else{const e=o.pop(),i=t.item;this._registerSplitPair(e,i)}return{position:n.position,cursorParent:n.range.end.parent}}_registerSplitPair(t,e){this._splitParts.has(t)||this._splitParts.set(t,[t]);const i=this._splitParts.get(t);this._splitParts.set(e,i),i.push(e)}_getSplitParts(t){let e;return e=this._splitParts.has(t)?this._splitParts.get(t):[t],e}_removeEmptyElements(){let t=!1;for(const e of this._splitParts.keys())e.isEmpty&&(this.conversionApi.writer.remove(e),this._splitParts.delete(e),t=!0);t&&this._removeEmptyElements()}}yi(pa,gi);class ba{constructor(t,e){this.model=t,this.stylesProcessor=e,this.processor,this.mapper=new As,this.downcastDispatcher=new Ts({mapper:this.mapper}),this.downcastDispatcher.on("insert:$text",(t,e,i)=>{if(!i.consumable.consume(e.item,"insert"))return;const n=i.writer,o=i.mapper.toViewPosition(e.range.start),r=n.createText(e.item.data);n.insert(o,r)},{priority:"lowest"}),this.upcastDispatcher=new pa({schema:t.schema}),this.viewDocument=new oo(e),this._viewWriter=new Ao(this.viewDocument),this.upcastDispatcher.on("text",(t,e,i)=>{if(i.schema.checkChild(e.modelCursor,"$text")&&i.consumable.consume(e.viewItem)){const t=i.writer.createText(e.viewItem.data);i.writer.insert(t,e.modelCursor),e.modelRange=xs._createFromPositionAndShift(e.modelCursor,t.offsetSize),e.modelCursor=e.modelRange.end}},{priority:"lowest"}),this.upcastDispatcher.on("element",(t,e,i)=>{if(!e.modelRange&&i.consumable.consume(e.viewItem,{name:!0})){const{modelRange:t,modelCursor:n}=i.convertChildren(e.viewItem,e.modelCursor);e.modelRange=t,e.modelCursor=n}},{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",(t,e,i)=>{if(!e.modelRange&&i.consumable.consume(e.viewItem,{name:!0})){const{modelRange:t,modelCursor:n}=i.convertChildren(e.viewItem,e.modelCursor);e.modelRange=t,e.modelCursor=n}},{priority:"lowest"}),this.decorate("init"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"})}get(t){const{rootName:e="main",trim:i="empty"}=t||{};if(!this._checkIfRootsExists([e]))throw new hi.b("datacontroller-get-non-existent-root: Attempting to get data from a non-existing root.",this);const n=this.model.document.getRoot(e);return"empty"!==i||this.model.hasContent(n,{ignoreWhitespaces:!0})?this.stringify(n):""}stringify(t){const e=this.toView(t);return this.processor.toData(e)}toView(t){const e=this.viewDocument,i=this._viewWriter;this.mapper.clearBindings();const n=xs._createIn(t),o=new xo(e);if(this.mapper.bindElements(t,o),this.downcastDispatcher.convertInsert(n,i),!t.is("documentFragment")){const e=function(t){const e=[],i=t.root.document;if(!i)return[];const n=xs._createIn(t);for(const t of i.model.markers){const i=n.getIntersection(t.getRange());i&&e.push([t.name,i])}return e} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(t);for(const[t,n]of e)this.downcastDispatcher.convertMarkerAdd(t,n,i)}return o}init(t){if(this.model.document.version)throw new hi.b("datacontroller-init-document-not-empty: Trying to set initial data to not empty document.",this);let e={};if("string"==typeof t?e.main=t:e=t,!this._checkIfRootsExists(Object.keys(e)))throw new hi.b("datacontroller-init-non-existent-root: Attempting to init data on a non-existing root.",this);return this.model.enqueueChange("transparent",t=>{for(const i of Object.keys(e)){const n=this.model.document.getRoot(i);t.insert(this.parse(e[i],n),n,0)}}),Promise.resolve()}set(t){let e={};if("string"==typeof t?e.main=t:e=t,!this._checkIfRootsExists(Object.keys(e)))throw new hi.b("datacontroller-set-non-existent-root: Attempting to set data on a non-existing root.",this);this.model.enqueueChange("transparent",t=>{t.setSelection(null),t.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(const i of Object.keys(e)){const n=this.model.document.getRoot(i);t.remove(t.createRangeIn(n)),t.insert(this.parse(e[i],n),n,0)}})}parse(t,e="$root"){const i=this.processor.toView(t);return this.toModel(i,e)}toModel(t,e="$root"){return this.model.change(i=>this.upcastDispatcher.convert(t,i,e))}addStyleProcessorRules(t){t(this.stylesProcessor)}destroy(){this.stopListening()}_checkIfRootsExists(t){for(const e of t)if(!this.model.document.getRootNames().includes(e))return!1;return!0}}yi(ba,qn);class wa{constructor(t,e){this._helpers=new Map,this._downcast=Array.isArray(t)?t:[t],this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Array.isArray(e)?e:[e],this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(t,e){const i=this._downcast.includes(e);if(!this._upcast.includes(e)&&!i)throw new hi.b("conversion-add-alias-dispatcher-not-registered: Trying to register and alias for a dispatcher that nas not been registered.",this);this._createConversionHelpers({name:t,dispatchers:[e],isDowncast:i})}for(t){if(!this._helpers.has(t))throw new hi.b("conversion-for-unknown-group: Trying to add a converter to an unknown dispatchers group.",this);return this._helpers.get(t)}elementToElement(t){this.for("downcast").elementToElement(t);for(const{model:e,view:i}of ka(t))this.for("upcast").elementToElement({model:e,view:i,converterPriority:t.converterPriority})}attributeToElement(t){this.for("downcast").attributeToElement(t);for(const{model:e,view:i}of ka(t))this.for("upcast").elementToAttribute({view:i,model:e,converterPriority:t.converterPriority})}attributeToAttribute(t){this.for("downcast").attributeToAttribute(t);for(const{model:e,view:i}of ka(t))this.for("upcast").attributeToAttribute({view:i,model:e})}_createConversionHelpers({name:t,dispatchers:e,isDowncast:i}){if(this._helpers.has(t))throw new hi.b("conversion-group-exists: Trying to register a group name that has already been registered.",this);const n=i?new qs(e):new Ks(e);this._helpers.set(t,n)}}function*ka(t){if(t.model.values)for(const e of t.model.values){const i={key:t.model.key,value:e},n=t.view[e],o=t.upcastAlso?t.upcastAlso[e]:void 0;yield*_a(i,n,o)}else yield*_a(t.model,t.view,t.upcastAlso)}function*_a(t,e,i){if(yield{model:t,view:e},i){i=Array.isArray(i)?i:[i];for(const e of i)yield{model:t,view:e}}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class va{constructor(t="default"){this.operations=[],this.type=t}get baseVersion(){for(const t of this.operations)if(null!==t.baseVersion)return t.baseVersion;return null}addOperation(t){return t.batch=this,this.operations.push(t),t}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class ya{constructor(t){this.baseVersion=t,this.isDocumentOperation=null!==this.baseVersion,this.batch=null}_validate(){}toJSON(){const t=Object.assign({},this);return t.__className=this.constructor.className,delete t.batch,delete t.isDocumentOperation,t}static get className(){return"Operation"}static fromJSON(t){return new this(t.baseVersion)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class xa{constructor(t){this.markers=new Map,this._children=new ms,t&&this._insertChild(0,t)}[Symbol.iterator](){return this.getChildren()}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return 0===this.childCount}get root(){return this}get parent(){return null}is(t){return"documentFragment"===t||"model:documentFragment"===t}getChild(t){return this._children.getNode(t)}getChildren(){return this._children[Symbol.iterator]()}getChildIndex(t){return this._children.getNodeIndex(t)}getChildStartOffset(t){return this._children.getNodeStartOffset(t)}getPath(){return[]}getNodeByPath(t){let e=this;for(const i of t)e=e.getChild(e.offsetToIndex(i));return e}offsetToIndex(t){return this._children.offsetToIndex(t)}toJSON(){const t=[];for(const e of this._children)t.push(e.toJSON());return t}static fromJSON(t){const e=[];for(const i of t)i.name?e.push(ps.fromJSON(i)):e.push(fs.fromJSON(i));return new xa(e)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,e){const i=function(t){if("string"==typeof t)return[new fs(t)];vi(t)||(t=[t]);return Array.from(t).map(t=>"string"==typeof t?new fs(t):t instanceof gs?new fs(t.data,t.getAttributes()):t)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(e);for(const t of i)null!==t.parent&&t._remove(),t.parent=this;this._children._insertNodes(t,i)}_removeChildren(t,e=1){const i=this._children._removeNodes(t,e);for(const t of i)t.parent=null;return i}}function Aa(t,e){const i=(e=Ta(e)).reduce((t,e)=>t+e.offsetSize,0),n=t.parent;Ea(t);const o=t.index;return n._insertChild(o,e),Sa(n,o+e.length),Sa(n,o),new xs(t,t.getShiftedBy(i))}function Pa(t){if(!t.isFlat)throw new hi.b("operation-utils-remove-range-not-flat: Trying to remove a range which starts and ends in different element.",this);const e=t.start.parent;Ea(t.start),Ea(t.end);const i=e._removeChildren(t.start.index,t.end.index-t.start.index);return Sa(e,t.start.index),i}function Ca(t,e){if(!t.isFlat)throw new hi.b("operation-utils-move-range-not-flat: Trying to move a range which starts and ends in different element.",this);const i=Pa(t);return Aa(e=e._getTransformedByDeletion(t.start,t.end.offset-t.start.offset),i)}function Ta(t){const e=[];t instanceof Array||(t=[t]);for(let i=0;it.maxOffset)throw new hi.b("move-operation-nodes-do-not-exist: The nodes which should be moved do not exist.",this);if(t===e&&i=i&&this.targetPosition.path[t]t._clone(!0))),e=new Va(this.position,t,this.baseVersion);return e.shouldReceiveAttributes=this.shouldReceiveAttributes,e}getReversed(){const t=this.position.root.document.graveyard,e=new ks(t,[0]);return new Na(this.position,this.nodes.maxOffset,e,this.baseVersion+1)}_validate(){const t=this.position.parent;if(!t||t.maxOffsett._clone(!0))),Aa(this.position,t)}toJSON(){const t=super.toJSON();return t.position=this.position.toJSON(),t.nodes=this.nodes.toJSON(),t}static get className(){return"InsertOperation"}static fromJSON(t,e){const i=[];for(const e of t.nodes)e.name?i.push(ps.fromJSON(e)):i.push(fs.fromJSON(e));const n=new Va(ks.fromJSON(t.position,e),i,t.baseVersion);return n.shouldReceiveAttributes=t.shouldReceiveAttributes,n}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Ba extends ya{constructor(t,e,i,n,o,r){super(r),this.name=t,this.oldRange=e?e.clone():null,this.newRange=i?i.clone():null,this.affectsData=o,this._markers=n}get type(){return"marker"}clone(){return new Ba(this.name,this.oldRange,this.newRange,this._markers,this.affectsData,this.baseVersion)}getReversed(){return new Ba(this.name,this.newRange,this.oldRange,this._markers,this.affectsData,this.baseVersion+1)}_execute(){const t=this.newRange?"_set":"_remove";this._markers[t](this.name,this.newRange,!0,this.affectsData)}toJSON(){const t=super.toJSON();return this.oldRange&&(t.oldRange=this.oldRange.toJSON()),this.newRange&&(t.newRange=this.newRange.toJSON()),delete t._markers,t}static get className(){return"MarkerOperation"}static fromJSON(t,e){return new Ba(t.name,t.oldRange?xs.fromJSON(t.oldRange,e):null,t.newRange?xs.fromJSON(t.newRange,e):null,e.model.markers,t.affectsData,t.baseVersion)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Fa extends ya{constructor(t,e,i,n){super(n),this.position=t,this.position.stickiness="toNext",this.oldName=e,this.newName=i}get type(){return"rename"}clone(){return new Fa(this.position.clone(),this.oldName,this.newName,this.baseVersion)}getReversed(){return new Fa(this.position.clone(),this.newName,this.oldName,this.baseVersion+1)}_validate(){const t=this.position.nodeAfter;if(!(t instanceof ps))throw new hi.b("rename-operation-wrong-position: Given position is invalid or node after it is not an instance of Element.",this);if(t.name!==this.oldName)throw new hi.b("rename-operation-wrong-name: Element to change has different name than operation's old name.",this)}_execute(){this.position.nodeAfter.name=this.newName}toJSON(){const t=super.toJSON();return t.position=this.position.toJSON(),t}static get className(){return"RenameOperation"}static fromJSON(t,e){return new Fa(ks.fromJSON(t.position,e),t.oldName,t.newName,t.baseVersion)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Da extends ya{constructor(t,e,i,n,o){super(o),this.root=t,this.key=e,this.oldValue=i,this.newValue=n}get type(){return null===this.oldValue?"addRootAttribute":null===this.newValue?"removeRootAttribute":"changeRootAttribute"}clone(){return new Da(this.root,this.key,this.oldValue,this.newValue,this.baseVersion)}getReversed(){return new Da(this.root,this.key,this.newValue,this.oldValue,this.baseVersion+1)}_validate(){if(this.root!=this.root.root||this.root.is("documentFragment"))throw new hi.b("rootattribute-operation-not-a-root: The element to change is not a root element.",this,{root:this.root,key:this.key});if(null!==this.oldValue&&this.root.getAttribute(this.key)!==this.oldValue)throw new hi.b("rootattribute-operation-wrong-old-value: Changed node has different attribute value than operation's old attribute value.",this,{root:this.root,key:this.key});if(null===this.oldValue&&null!==this.newValue&&this.root.hasAttribute(this.key))throw new hi.b("rootattribute-operation-attribute-exists: The attribute with given key already exists.",this,{root:this.root,key:this.key})}_execute(){null!==this.newValue?this.root._setAttribute(this.key,this.newValue):this.root._removeAttribute(this.key)}toJSON(){const t=super.toJSON();return t.root=this.root.toJSON(),t}static get className(){return"RootAttributeOperation"}static fromJSON(t,e){if(!e.getRoot(t.root))throw new hi.b("rootattribute-operation-fromjson-no-root: Cannot create RootAttributeOperation. Root with specified name does not exist.",this,{rootName:t.root});return new Da(e.getRoot(t.root),t.key,t.oldValue,t.newValue,t.baseVersion)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class La extends ya{constructor(t,e,i,n,o){super(o),this.sourcePosition=t.clone(),this.sourcePosition.stickiness="toPrevious",this.howMany=e,this.targetPosition=i.clone(),this.targetPosition.stickiness="toNext",this.graveyardPosition=n.clone()}get type(){return"merge"}get deletionPosition(){return new ks(this.sourcePosition.root,this.sourcePosition.path.slice(0,-1))}get movedRange(){const t=this.sourcePosition.getShiftedBy(Number.POSITIVE_INFINITY);return new xs(this.sourcePosition,t)}clone(){return new this.constructor(this.sourcePosition,this.howMany,this.targetPosition,this.graveyardPosition,this.baseVersion)}getReversed(){const t=this.targetPosition._getTransformedByMergeOperation(this),e=this.sourcePosition.path.slice(0,-1),i=new ks(this.sourcePosition.root,e)._getTransformedByMergeOperation(this),n=new za(t,this.howMany,this.graveyardPosition,this.baseVersion+1);return n.insertionPosition=i,n}_validate(){const t=this.sourcePosition.parent,e=this.targetPosition.parent;if(!t.parent)throw new hi.b("merge-operation-source-position-invalid: Merge source position is invalid.",this);if(!e.parent)throw new hi.b("merge-operation-target-position-invalid: Merge target position is invalid.",this);if(this.howMany!=t.maxOffset)throw new hi.b("merge-operation-how-many-invalid: Merge operation specifies wrong number of nodes to move.",this)}_execute(){const t=this.sourcePosition.parent;Ca(xs._createIn(t),this.targetPosition),Ca(xs._createOn(t),this.graveyardPosition)}toJSON(){const t=super.toJSON();return t.sourcePosition=t.sourcePosition.toJSON(),t.targetPosition=t.targetPosition.toJSON(),t.graveyardPosition=t.graveyardPosition.toJSON(),t}static get className(){return"MergeOperation"}static fromJSON(t,e){const i=ks.fromJSON(t.sourcePosition,e),n=ks.fromJSON(t.targetPosition,e),o=ks.fromJSON(t.graveyardPosition,e);return new this(i,t.howMany,n,o,t.baseVersion)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class za extends ya{constructor(t,e,i,n){super(n),this.splitPosition=t.clone(),this.splitPosition.stickiness="toNext",this.howMany=e,this.insertionPosition=za.getInsertionPosition(t),this.insertionPosition.stickiness="toNone",this.graveyardPosition=i?i.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){const t=this.insertionPosition.path.slice();return t.push(0),new ks(this.insertionPosition.root,t)}get movedRange(){const t=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new xs(this.splitPosition,t)}clone(){const t=new this.constructor(this.splitPosition,this.howMany,this.graveyardPosition,this.baseVersion);return t.insertionPosition=this.insertionPosition,t}getReversed(){const t=this.splitPosition.root.document.graveyard,e=new ks(t,[0]);return new La(this.moveTargetPosition,this.howMany,this.splitPosition,e,this.baseVersion+1)}_validate(){const t=this.splitPosition.parent,e=this.splitPosition.offset;if(!t||t.maxOffset{for(const e of t.getAttributeKeys())this.removeAttribute(e,t)};if(t instanceof xs)for(const i of t.getItems())e(i);else e(t)}move(t,e,i){if(this._assertWriterUsedCorrectly(),!(t instanceof xs))throw new hi.b("writer-move-invalid-range: Invalid range to move.",this);if(!t.isFlat)throw new hi.b("writer-move-range-not-flat: Range to move is not flat.",this);const n=ks._createAt(e,i);if(n.isEqual(t.start))return;if(this._addOperationForAffectedMarkers("move",t),!Ga(t.root,n.root))throw new hi.b("writer-move-different-document: Range is going to be moved between different documents.",this);const o=t.root.document?t.root.document.version:null,r=new Na(t.start,t.end.offset-t.start.offset,n,o);this.batch.addOperation(r),this.model.applyOperation(r)}remove(t){this._assertWriterUsedCorrectly();const e=(t instanceof xs?t:xs._createOn(t)).getMinimalFlatRanges().reverse();for(const t of e)this._addOperationForAffectedMarkers("move",t),$a(t.start,t.end.offset-t.start.offset,this.batch,this.model)}merge(t){this._assertWriterUsedCorrectly();const e=t.nodeBefore,i=t.nodeAfter;if(this._addOperationForAffectedMarkers("merge",t),!(e instanceof ps))throw new hi.b("writer-merge-no-element-before: Node before merge position must be an element.",this);if(!(i instanceof ps))throw new hi.b("writer-merge-no-element-after: Node after merge position must be an element.",this);t.root.document?this._merge(t):this._mergeDetached(t)}createPositionFromPath(t,e,i){return this.model.createPositionFromPath(t,e,i)}createPositionAt(t,e){return this.model.createPositionAt(t,e)}createPositionAfter(t){return this.model.createPositionAfter(t)}createPositionBefore(t){return this.model.createPositionBefore(t)}createRange(t,e){return this.model.createRange(t,e)}createRangeIn(t){return this.model.createRangeIn(t)}createRangeOn(t){return this.model.createRangeOn(t)}createSelection(t,e,i){return this.model.createSelection(t,e,i)}_mergeDetached(t){const e=t.nodeBefore,i=t.nodeAfter;this.move(xs._createIn(i),ks._createAt(e,"end")),this.remove(i)}_merge(t){const e=ks._createAt(t.nodeBefore,"end"),i=ks._createAt(t.nodeAfter,0),n=t.root.document.graveyard,o=new ks(n,[0]),r=t.root.document.version,s=new La(i,t.nodeAfter.maxOffset,e,o,r);this.batch.addOperation(s),this.model.applyOperation(s)}rename(t,e){if(this._assertWriterUsedCorrectly(),!(t instanceof ps))throw new hi.b("writer-rename-not-element-instance: Trying to rename an object which is not an instance of Element.",this);const i=t.root.document?t.root.document.version:null,n=new Fa(ks._createBefore(t),t.name,e,i);this.batch.addOperation(n),this.model.applyOperation(n)}split(t,e){this._assertWriterUsedCorrectly();let i,n,o=t.parent;if(!o.parent)throw new hi.b("writer-split-element-no-parent: Element with no parent can not be split.",this);if(e||(e=o.parent),!t.parent.getAncestors({includeSelf:!0}).includes(e))throw new hi.b("writer-split-invalid-limit-element: Limit element is not a position ancestor.",this);do{const e=o.root.document?o.root.document.version:null,r=o.maxOffset-t.offset,s=new za(t,r,null,e);this.batch.addOperation(s),this.model.applyOperation(s),i||n||(i=o,n=t.parent.nextSibling),o=(t=this.createPositionAfter(t.parent)).parent}while(o!==e);return{position:t,range:new xs(ks._createAt(i,"end"),ks._createAt(n,0))}}wrap(t,e){if(this._assertWriterUsedCorrectly(),!t.isFlat)throw new hi.b("writer-wrap-range-not-flat: Range to wrap is not flat.",this);const i=e instanceof ps?e:new ps(e);if(i.childCount>0)throw new hi.b("writer-wrap-element-not-empty: Element to wrap with is not empty.",this);if(null!==i.parent)throw new hi.b("writer-wrap-element-attached: Element to wrap with is already attached to tree model.",this);this.insert(i,t.start);const n=new xs(t.start.getShiftedBy(1),t.end.getShiftedBy(1));this.move(n,ks._createAt(i,0))}unwrap(t){if(this._assertWriterUsedCorrectly(),null===t.parent)throw new hi.b("writer-unwrap-element-no-parent: Trying to unwrap an element which has no parent.",this);this.move(xs._createIn(t),this.createPositionAfter(t)),this.remove(t)}addMarker(t,e){if(this._assertWriterUsedCorrectly(),!e||"boolean"!=typeof e.usingOperation)throw new hi.b("writer-addMarker-no-usingOperation: The options.usingOperation parameter is required when adding a new marker.",this);const i=e.usingOperation,n=e.range,o=void 0!==e.affectsData&&e.affectsData;if(this.model.markers.has(t))throw new hi.b("writer-addMarker-marker-exists: Marker with provided name already exists.",this);if(!n)throw new hi.b("writer-addMarker-no-range: Range parameter is required when adding a new marker.",this);return i?(Ua(this,t,null,n,o),this.model.markers.get(t)):this.model.markers._set(t,n,i,o)}updateMarker(t,e){this._assertWriterUsedCorrectly();const i="string"==typeof t?t:t.name,n=this.model.markers.get(i);if(!n)throw new hi.b("writer-updateMarker-marker-not-exists: Marker with provided name does not exists.",this);if(!e)return void this.model.markers._refresh(n);const o="boolean"==typeof e.usingOperation,r="boolean"==typeof e.affectsData,s=r?e.affectsData:n.affectsData;if(!o&&!e.range&&!r)throw new hi.b("writer-updateMarker-wrong-options: One of the options is required - provide range, usingOperations or affectsData.",this);const a=n.getRange(),c=e.range?e.range:a;o&&e.usingOperation!==n.managedUsingOperations?e.usingOperation?Ua(this,i,null,c,s):(Ua(this,i,a,null,s),this.model.markers._set(i,c,void 0,s)):n.managedUsingOperations?Ua(this,i,a,c,s):this.model.markers._set(i,c,void 0,s)}removeMarker(t){this._assertWriterUsedCorrectly();const e="string"==typeof t?t:t.name;if(!this.model.markers.has(e))throw new hi.b("writer-removeMarker-no-marker: Trying to remove marker which does not exist.",this);const i=this.model.markers.get(e);i.managedUsingOperations?Ua(this,e,i.getRange(),null,i.affectsData):this.model.markers._remove(e)}setSelection(t,e,i){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(t,e,i)}setSelectionFocus(t,e){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(t,e)}setSelectionAttribute(t,e){if(this._assertWriterUsedCorrectly(),"string"==typeof t)this._setSelectionAttribute(t,e);else for(const[e,i]of Vi(t))this._setSelectionAttribute(e,i)}removeSelectionAttribute(t){if(this._assertWriterUsedCorrectly(),"string"==typeof t)this._removeSelectionAttribute(t);else for(const e of t)this._removeSelectionAttribute(e)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(t){this.model.document.selection._restoreGravity(t)}_setSelectionAttribute(t,e){const i=this.model.document.selection;if(i.isCollapsed&&i.anchor.parent.isEmpty){const n=Fs._getStoreAttributeKey(t);this.setAttribute(n,e,i.anchor.parent)}i._setAttribute(t,e)}_removeSelectionAttribute(t){const e=this.model.document.selection;if(e.isCollapsed&&e.anchor.parent.isEmpty){const i=Fs._getStoreAttributeKey(t);this.removeAttribute(i,e.anchor.parent)}e._removeAttribute(t)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new hi.b("writer-incorrect-use: Trying to use a writer outside the change() block.",this)}_addOperationForAffectedMarkers(t,e){for(const i of this.model.markers){if(!i.managedUsingOperations)continue;const n=i.getRange();let o=!1;if("move"===t)o=e.containsPosition(n.start)||e.start.isEqual(n.start)||e.containsPosition(n.end)||e.end.isEqual(n.end);else{const t=e.nodeBefore,i=e.nodeAfter,r=n.start.parent==t&&n.start.isAtEnd,s=n.end.parent==i&&0==n.end.offset,a=n.end.nodeAfter==i,c=n.start.nodeAfter==i;o=r||s||a||c}o&&this.updateMarker(i.name,{range:n})}}}function Wa(t,e,i,n){const o=t.model,r=o.document;let s,a,c,l=n.start;for(const t of n.getWalker({shallow:!0}))c=t.item.getAttribute(e),s&&a!=c&&(a!=i&&d(),l=s),s=t.nextPosition,a=c;function d(){const n=new xs(l,s),c=n.root.document?r.version:null,d=new Ia(n,e,a,i,c);t.batch.addOperation(d),o.applyOperation(d)}s instanceof ks&&s!=l&&a!=i&&d()}function Ha(t,e,i,n){const o=t.model,r=o.document,s=n.getAttribute(e);let a,c;if(s!=i){if(n.root===n){const t=n.document?r.version:null;c=new Da(n,e,s,i,t)}else{a=new xs(ks._createBefore(n),t.createPositionAfter(n));const o=a.root.document?r.version:null;c=new Ia(a,e,s,i,o)}t.batch.addOperation(c),o.applyOperation(c)}}function Ua(t,e,i,n,o){const r=t.model,s=r.document,a=new Ba(e,i,n,r.markers,o,s.version);t.batch.addOperation(a),r.applyOperation(a)}function $a(t,e,i,n){let o;if(t.root.document){const i=n.document,r=new ks(i.graveyard,[0]);o=new Na(t,e,r,i.version)}else o=new Ma(t,e);i.addOperation(o),n.applyOperation(o)}function Ga(t,e){return t===e||t instanceof ja&&e instanceof ja} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Ka{constructor(t){this._markerCollection=t,this._changesInElement=new Map,this._elementSnapshots=new Map,this._changedMarkers=new Map,this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null}get isEmpty(){return 0==this._changesInElement.size&&0==this._changedMarkers.size}refreshItem(t){if(this._isInInsertedElement(t.parent))return;this._markRemove(t.parent,t.startOffset,t.offsetSize),this._markInsert(t.parent,t.startOffset,t.offsetSize);const e=xs._createOn(t);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getRange();this.bufferMarkerChange(t.name,e,e,t.affectsData)}this._cachedChanges=null}bufferOperation(t){switch(t.type){case"insert":if(this._isInInsertedElement(t.position.parent))return;this._markInsert(t.position.parent,t.position.offset,t.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(const e of t.range.getItems({shallow:!0}))this._isInInsertedElement(e.parent)||this._markAttribute(e);break;case"remove":case"move":case"reinsert":{if(t.sourcePosition.isEqual(t.targetPosition)||t.sourcePosition.getShiftedBy(t.howMany).isEqual(t.targetPosition))return;const e=this._isInInsertedElement(t.sourcePosition.parent),i=this._isInInsertedElement(t.targetPosition.parent);e||this._markRemove(t.sourcePosition.parent,t.sourcePosition.offset,t.howMany),i||this._markInsert(t.targetPosition.parent,t.getMovedRangeStart().offset,t.howMany);break}case"rename":{if(this._isInInsertedElement(t.position.parent))return;this._markRemove(t.position.parent,t.position.offset,1),this._markInsert(t.position.parent,t.position.offset,1);const e=xs._createFromPositionAndShift(t.position,1);for(const t of this._markerCollection.getMarkersIntersectingRange(e)){const e=t.getRange();this.bufferMarkerChange(t.name,e,e,t.affectsData)}break}case"split":{const e=t.splitPosition.parent;this._isInInsertedElement(e)||this._markRemove(e,t.splitPosition.offset,t.howMany),this._isInInsertedElement(t.insertionPosition.parent)||this._markInsert(t.insertionPosition.parent,t.insertionPosition.offset,1),t.graveyardPosition&&this._markRemove(t.graveyardPosition.parent,t.graveyardPosition.offset,1);break}case"merge":{const e=t.sourcePosition.parent;this._isInInsertedElement(e.parent)||this._markRemove(e.parent,e.startOffset,1);const i=t.graveyardPosition.parent;this._markInsert(i,t.graveyardPosition.offset,1);const n=t.targetPosition.parent;this._isInInsertedElement(n)||this._markInsert(n,t.targetPosition.offset,e.maxOffset);break}}this._cachedChanges=null}bufferMarkerChange(t,e,i,n){const o=this._changedMarkers.get(t);o?(o.newRange=i,o.affectsData=n,null==o.oldRange&&null==o.newRange&&this._changedMarkers.delete(t)):this._changedMarkers.set(t,{oldRange:e,newRange:i,affectsData:n})}getMarkersToRemove(){const t=[];for(const[e,i]of this._changedMarkers)null!=i.oldRange&&t.push({name:e,range:i.oldRange});return t}getMarkersToAdd(){const t=[];for(const[e,i]of this._changedMarkers)null!=i.newRange&&t.push({name:e,range:i.newRange});return t}getChangedMarkers(){return Array.from(this._changedMarkers).map(t=>({name:t[0],data:{oldRange:t[1].oldRange,newRange:t[1].newRange}}))}hasDataChanges(){for(const[,t]of this._changedMarkers)if(t.affectsData)return!0;return this._changesInElement.size>0}getChanges(t={includeChangesInGraveyard:!1}){if(this._cachedChanges)return t.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();const e=[];for(const t of this._changesInElement.keys()){const i=this._changesInElement.get(t).sort((t,e)=>t.offset===e.offset?t.type!=e.type?"remove"==t.type?-1:1:0:t.offsett.position.root!=e.position.root?t.position.root.rootNamei.offset){if(n>o){const t={type:"attribute",offset:o,howMany:n-o,count:this._changeCount++};this._handleChange(t,e),e.push(t)}t.nodesToHandle=i.offset-t.offset,t.howMany=t.nodesToHandle}else t.offset>=i.offset&&t.offseto?(t.nodesToHandle=n-o,t.offset=o):t.nodesToHandle=0);if("remove"==i.type&&t.offseti.offset){const o={type:"attribute",offset:i.offset,howMany:n-i.offset,count:this._changeCount++};this._handleChange(o,e),e.push(o),t.nodesToHandle=i.offset-t.offset,t.howMany=t.nodesToHandle}"attribute"==i.type&&(t.offset>=i.offset&&n<=o?(t.nodesToHandle=0,t.howMany=0,t.offset=0):t.offset<=i.offset&&n>=o&&(i.howMany=0))}}t.howMany=t.nodesToHandle,delete t.nodesToHandle}_getInsertDiff(t,e,i){return{type:"insert",position:ks._createAt(t,e),name:i,length:1,changeCount:this._changeCount++}}_getRemoveDiff(t,e,i){return{type:"remove",position:ks._createAt(t,e),name:i,length:1,changeCount:this._changeCount++}}_getAttributesDiff(t,e,i){const n=[];i=new Map(i);for(const[o,r]of e){const e=i.has(o)?i.get(o):null;e!==r&&n.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:o,attributeOldValue:r,attributeNewValue:e,changeCount:this._changeCount++}),i.delete(o)}for(const[e,o]of i)n.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:e,attributeOldValue:null,attributeNewValue:o,changeCount:this._changeCount++});return n}_isInInsertedElement(t){const e=t.parent;if(!e)return!1;const i=this._changesInElement.get(e),n=t.startOffset;if(i)for(const t of i)if("insert"==t.type&&n>=t.offset&&nn){for(let e=0;e{const i=e[0];if(i.isDocumentOperation&&i.baseVersion!==this.version)throw new hi.b("model-document-applyOperation-wrong-version: Only operations with matching versions can be applied.",this,{operation:i})},{priority:"highest"}),this.listenTo(t,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&this.differ.bufferOperation(i)},{priority:"high"}),this.listenTo(t,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&(this.version++,this.history.addOperation(i))},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(t.markers,"update",(t,e,i,n)=>{this.differ.bufferMarkerChange(e.name,i,n,e.affectsData),null===i&&e.on("change",(t,i)=>{this.differ.bufferMarkerChange(e.name,i,e.getRange(),e.affectsData)})})}get graveyard(){return this.getRoot("$graveyard")}createRoot(t="$root",e="main"){if(this.roots.get(e))throw new hi.b("model-document-createRoot-name-exists: Root with specified name already exists.",this,{name:e});const i=new ja(this,t,e);return this.roots.add(i),i}destroy(){this.selection.destroy(),this.stopListening()}getRoot(t="main"){return this.roots.get(t)}getRootNames(){return Array.from(this.roots,t=>t.rootName).filter(t=>"$graveyard"!=t)}registerPostFixer(t){this._postFixers.add(t)}toJSON(){const t=Ri(this);return t.selection="[engine.model.DocumentSelection]",t.model="[engine.model.Model]",t}_handleChangeBlock(t){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(t),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",t.batch):this.fire("change",t.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){for(const t of this.roots)if(t!==this.graveyard)return t;return this.graveyard}_getDefaultRange(){const t=this._getDefaultRoot(),e=this.model,i=e.schema,n=e.createPositionFromPath(t,[0]);return i.getNearestSelectionRange(n)||e.createRange(n)}_validateSelectionRange(t){return ic(t.start)&&ic(t.end)}_callPostFixers(t){let e=!1;do{for(const i of this._postFixers)if(this.selection.refresh(),e=i(t),e)break}while(e)}}function ic(t){const e=t.textNode;if(e){const i=e.data,n=t.offset-e.startOffset;return!Za(i,n)&&!tc(i,n)}return!0} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */yi(ec,gi);class nc{constructor(){this._markers=new Map}[Symbol.iterator](){return this._markers.values()}has(t){return this._markers.has(t)}get(t){return this._markers.get(t)||null}_set(t,e,i=!1,n=!1){const o=t instanceof oc?t.name:t,r=this._markers.get(o);if(r){const t=r.getRange();let s=!1;return t.isEqual(e)||(r._attachLiveRange(Ns.fromRange(e)),s=!0),i!=r.managedUsingOperations&&(r._managedUsingOperations=i,s=!0),"boolean"==typeof n&&n!=r.affectsData&&(r._affectsData=n,s=!0),s&&this.fire("update:"+o,r,t,e),r}const s=Ns.fromRange(e),a=new oc(o,s,i,n);return this._markers.set(o,a),this.fire("update:"+o,a,null,e),a}_remove(t){const e=t instanceof oc?t.name:t,i=this._markers.get(e);return!!i&&(this._markers.delete(e),this.fire("update:"+e,i,i.getRange(),null),this._destroyMarker(i),!0)}_refresh(t){const e=t instanceof oc?t.name:t,i=this._markers.get(e);if(!i)throw new hi.b("markercollection-refresh-marker-not-exists: Marker with provided name does not exists.",this);const n=i.getRange();this.fire("update:"+e,i,n,n,i.managedUsingOperations,i.affectsData)}*getMarkersAtPosition(t){for(const e of this)e.getRange().containsPosition(t)&&(yield e)}*getMarkersIntersectingRange(t){for(const e of this)null!==e.getRange().getIntersection(t)&&(yield e)}destroy(){for(const t of this._markers.values())this._destroyMarker(t);this._markers=null,this.stopListening()}*getMarkersGroup(t){for(const e of this._markers.values())e.name.startsWith(t+":")&&(yield e)}_destroyMarker(t){t.stopListening(),t._detachLiveRange()}}yi(nc,gi);class oc{constructor(t,e,i,n){this.name=t,this._liveRange=this._attachLiveRange(e),this._managedUsingOperations=i,this._affectsData=n}get managedUsingOperations(){if(!this._liveRange)throw new hi.b("marker-destroyed: Cannot use a destroyed marker instance.",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new hi.b("marker-destroyed: Cannot use a destroyed marker instance.",this);return this._affectsData}getStart(){if(!this._liveRange)throw new hi.b("marker-destroyed: Cannot use a destroyed marker instance.",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new hi.b("marker-destroyed: Cannot use a destroyed marker instance.",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new hi.b("marker-destroyed: Cannot use a destroyed marker instance.",this);return this._liveRange.toRange()}is(t){return"marker"===t||"model:marker"===t}_attachLiveRange(t){return this._liveRange&&this._detachLiveRange(),t.delegate("change:range").to(this),t.delegate("change:content").to(this),this._liveRange=t,t}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}}yi(oc,gi); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class rc extends ya{get type(){return"noop"}clone(){return new rc(this.baseVersion)}getReversed(){return new rc(this.baseVersion+1)}_execute(){}static get className(){return"NoOperation"}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */const sc={};sc[Ia.className]=Ia,sc[Va.className]=Va,sc[Ba.className]=Ba,sc[Na.className]=Na,sc[rc.className]=rc,sc[ya.className]=ya,sc[Fa.className]=Fa,sc[Da.className]=Da,sc[za.className]=za,sc[La.className]=La; -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class ac extends ks{constructor(t,e,i="toNone"){if(super(t,e,i),!this.root.is("rootElement"))throw new hi.b("model-liveposition-root-not-rootelement: LivePosition's root has to be an instance of RootElement.",t);cc.call(this)}detach(){this.stopListening()}is(t){return"livePosition"===t||"model:livePosition"===t||"position"==t||"model:position"===t}toPosition(){return new ks(this.root,this.path.slice(),this.stickiness)}static fromPosition(t,e){return new this(t.root,t.path.slice(),e||t.stickiness)}}function cc(){this.listenTo(this.root.document.model,"applyOperation",(t,e)=>{const i=e[0];i.isDocumentOperation&&lc.call(this,i)},{priority:"low"})}function lc(t){const e=this.getTransformedByOperation(t);if(!this.isEqual(e)){const t=this.toPosition();this.path=e.path,this.root=e.root,this.fire("change",t)}}yi(ac,gi);class dc{constructor(t,e,i){this.model=t,this.writer=e,this.position=i,this.canMergeWith=new Set([this.position.parent]),this.schema=t.schema,this._filterAttributesOf=[],this._affectedStart=null,this._affectedEnd=null}handleNodes(t,e){t=Array.from(t);for(let i=0;i{if(!i.doNotResetEntireContent&&function(t,e){const i=t.getLimitElement(e);if(!e.containsEntireContent(i))return!1;const n=e.getFirstRange();if(n.start.parent==n.end.parent)return!1;return t.checkChild(i,"paragraph")}(o,e))return void function(t,e){const i=t.model.schema.getLimitElement(e);t.remove(t.createRangeIn(i)),uc(t,t.createPositionAt(i,0),e)}(t,e);const r=n.start,s=ac.fromPosition(n.end,"toNext");n.start.isTouching(n.end)||t.remove(n),i.leaveUnmerged||(!function t(e,i,n){const o=i.parent,r=n.parent;if(o==r)return;if(e.model.schema.isLimit(o)||e.model.schema.isLimit(r))return;if(!function(t,e,i){const n=new xs(t,e);for(const t of n.getWalker())if(i.isLimit(t.item))return!1;return!0}(i,n,e.model.schema))return;i=e.createPositionAfter(o),(n=e.createPositionBefore(r)).isEqual(i)||e.insert(r,i);e.merge(i);for(;n.parent.isEmpty;){const t=n.parent;n=e.createPositionBefore(t),e.remove(t)}t(e,i,n)}(t,r,s),o.removeDisallowedAttributes(r.parent.getChildren(),t)),fc(t,e,r),!i.doNotAutoparagraph&&function(t,e){const i=t.checkChild(e,"$text"),n=t.checkChild(e,"paragraph");return!i&&n}(o,r)&&uc(t,r,e),s.detach()})}function uc(t,e,i){const n=t.createElement("paragraph");t.insert(n,e),fc(t,i,t.createPositionAt(n,0))}function fc(t,e,i){e instanceof Fs?t.setSelection(i):e.setTo(i)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function gc(t,e){if("text"==e.type)return"word"===t.unit?function(t,e){let i=t.position.textNode;if(i){let n=t.position.offset-i.startOffset;for(;!pc(i.data,n,e)&&!bc(i,n,e);){t.next();const o=e?t.position.nodeAfter:t.position.nodeBefore;if(o&&o.is("text")){const n=o.data.charAt(e?0:o.data.length-1);' ,.?!:;"-()'.includes(n)||(t.next(),i=t.position.textNode)}n=t.position.offset-i.startOffset}}return t.position}(t.walker,t.isForward):function(t,e){const i=t.position.textNode;if(i){const n=i.data;let o=t.position.offset-i.startOffset;for(;Za(n,o)||"character"==e&&tc(n,o);)t.next(),o=t.position.offset-i.startOffset}return t.position}(t.walker,t.unit,t.isForward);if(e.type==(t.isForward?"elementStart":"elementEnd")){if(t.schema.isObject(e.item))return ks._createAt(e.item,t.isForward?"after":"before");if(t.schema.checkChild(e.nextPosition,"$text"))return e.nextPosition}else{if(t.schema.isLimit(e.item))return void t.walker.skip(()=>!0);if(t.schema.checkChild(e.nextPosition,"$text"))return e.nextPosition}}function mc(t,e){const i=t.root,n=ks._createAt(i,e?"end":0);return e?new xs(t,n):new xs(n,t)}function pc(t,e,i){const n=e+(i?0:-1);return' ,.?!:;"-()'.includes(t.charAt(n))}function bc(t,e,i){return e===(i?t.endOffset:0)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function wc(t,e){const i=[];Array.from(t.getItems({direction:"backward"})).map(t=>e.createRangeOn(t)).filter(e=>(e.start.isAfter(t.start)||e.start.isEqual(t.start))&&(e.end.isBefore(t.end)||e.end.isEqual(t.end))).forEach(t=>{i.push(t.start.parent),e.remove(t)}),i.forEach(t=>{let i=t;for(;i.parent&&i.isEmpty;){const t=e.createRangeOn(i);i=i.parent,e.remove(t)}})} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function kc(t){t.document.registerPostFixer(e=>function(t,e){const i=e.document.selection,n=e.schema,o=[];let r=!1;for(const t of i.getRanges()){const e=_c(t,n);e?(o.push(e),r=!0):o.push(t)}r&&t.setSelection(function(t){const e=[];e.push(t.shift());for(const i of t){const t=e.pop();if(i.isIntersecting(t)){const n=t.start.isAfter(i.start)?i.start:t.start,o=t.end.isAfter(i.end)?t.end:i.end,r=new xs(n,o);e.push(r)}else e.push(t),e.push(i)}return e}(o),{backward:i.isBackward})}(e,t))}function _c(t,e){return t.isCollapsed?function(t,e){const i=t.start,n=e.getNearestSelectionRange(i);if(!n)return null;if(!n.isCollapsed)return n;const o=n.start;if(i.isEqual(o))return null;return new xs(o)}(t,e):function(t,e){const i=t.start,n=t.end,o=e.checkChild(i,"$text"),r=e.checkChild(n,"$text"),s=e.getLimitElement(i),a=e.getLimitElement(n);if(s===a){if(o&&r)return null;if(function(t,e,i){const n=t.nodeAfter&&!i.isLimit(t.nodeAfter)||i.checkChild(t,"$text"),o=e.nodeBefore&&!i.isLimit(e.nodeBefore)||i.checkChild(e,"$text");return n||o}(i,n,e)){const t=i.nodeAfter&&e.isObject(i.nodeAfter)?null:e.getNearestSelectionRange(i,"forward"),o=n.nodeBefore&&e.isObject(n.nodeBefore)?null:e.getNearestSelectionRange(n,"backward"),r=t?t.start:i,s=o?o.start:n;return new xs(r,s)}}const c=s&&!s.is("rootElement"),l=a&&!a.is("rootElement");if(c||l){const t=i.nodeAfter&&n.nodeBefore&&i.nodeAfter.parent===n.nodeBefore.parent,o=c&&(!t||!yc(i.nodeAfter,e)),r=l&&(!t||!yc(n.nodeBefore,e));let d=i,h=n;return o&&(d=ks._createBefore(vc(s,e))),r&&(h=ks._createAfter(vc(a,e))),new xs(d,h)}return null}(t,e)}function vc(t,e){let i=t,n=i;for(;e.isLimit(n)&&n.parent;)i=n,n=n.parent;return i}function yc(t,e){return t&&e.isObject(t)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class xc{constructor(){this.markers=new nc,this.document=new ec(this),this.schema=new na,this._pendingChanges=[],this._currentWriter=null,["insertContent","deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(t=>this.decorate(t)),this.on("applyOperation",(t,e)=>{e[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$block",{allowIn:"$root",isBlock:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0}),this.schema.register("$clipboardHolder",{allowContentOf:"$root",isLimit:!0}),this.schema.extend("$text",{allowIn:"$clipboardHolder"}),this.schema.register("$marker"),this.schema.addChildCheck((t,e)=>{if("$marker"===e.name)return!0}),kc(this)}change(t){try{return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new va,callback:t}),this._runPendingChanges()[0]):t(this._currentWriter)}catch(t){hi.b.rethrowUnexpectedError(t,this)}}enqueueChange(t,e){try{"string"==typeof t?t=new va(t):"function"==typeof t&&(e=t,t=new va),this._pendingChanges.push({batch:t,callback:e}),1==this._pendingChanges.length&&this._runPendingChanges()}catch(t){hi.b.rethrowUnexpectedError(t,this)}}applyOperation(t){t._execute()}insertContent(t,e,i){ -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -return function(t,e,i,n){return t.change(o=>{let r;r=i?i instanceof Es||i instanceof Fs?i:o.createSelection(i,n):t.document.selection,r.isCollapsed||t.deleteContent(r,{doNotAutoparagraph:!0});const s=new dc(t,o,r.anchor);let a;a=e.is("documentFragment")?e.getChildren():[e],s.handleNodes(a,{isFirst:!0,isLast:!0});const c=s.getSelectionRange();c&&(r instanceof Fs?o.setSelection(c):r.setTo(c));const l=s.getAffectedRange()||t.createRange(r.anchor);return s.destroy(),l})}(this,t,e,i)}deleteContent(t,e){hc(this,t,e)}modifySelection(t,e){!function(t,e,i={}){const n=t.schema,o="backward"!=i.direction,r=i.unit?i.unit:"character",s=e.focus,a=new bs({boundaries:mc(s,o),singleCharacters:!0,direction:o?"forward":"backward"}),c={walker:a,schema:n,isForward:o,unit:r};let l;for(;l=a.next();){if(l.done)return;const i=gc(c,l.value);if(i)return void(e instanceof Fs?t.change(t=>{t.setSelectionFocus(i)}):e.setFocus(i))}}(this,t,e)}getSelectedContent(t){return function(t,e){return t.change(t=>{const i=t.createDocumentFragment(),n=e.getFirstRange();if(!n||n.isCollapsed)return i;const o=n.start.root,r=n.start.getCommonPath(n.end),s=o.getNodeByPath(r);let a;a=n.start.parent==n.end.parent?n:t.createRange(t.createPositionAt(s,n.start.path[r.length]),t.createPositionAt(s,n.end.path[r.length]+1));const c=a.end.offset-a.start.offset;for(const e of a.getItems({shallow:!0}))e.is("textProxy")?t.appendText(e.data,e.getAttributes(),i):t.append(e._clone(!0),i);if(a!=n){const e=n._getTransformedByMove(a.start,t.createPositionAt(i,0),c)[0],o=t.createRange(t.createPositionAt(i,0),e.start);wc(t.createRange(e.end,t.createPositionAt(i,"end")),t),wc(o,t)}return i})}(this,t)}hasContent(t,e){const i=t instanceof ps?xs._createIn(t):t;if(i.isCollapsed)return!1;for(const t of this.markers.getMarkersIntersectingRange(i))if(t.affectsData)return!0;const{ignoreWhitespaces:n=!1}=e||{};for(const t of i.getItems())if(t.is("textProxy")){if(!n)return!0;if(-1!==t.data.search(/\S/))return!0}else if(this.schema.isObject(t))return!0;return!1}createPositionFromPath(t,e,i){return new ks(t,e,i)}createPositionAt(t,e){return ks._createAt(t,e)}createPositionAfter(t){return ks._createAfter(t)}createPositionBefore(t){return ks._createBefore(t)}createRange(t,e){return new xs(t,e)}createRangeIn(t){return xs._createIn(t)}createRangeOn(t){return xs._createOn(t)}createSelection(t,e,i){return new Es(t,e,i)}createBatch(t){return new va(t)}createOperationFromJSON(t){return class{static fromJSON(t,e){return sc[t.__className].fromJSON(t,e)}}.fromJSON(t,this.document)}destroy(){this.document.destroy(),this.stopListening()}_runPendingChanges(){const t=[];for(this.fire("_beforeChanges");this._pendingChanges.length;){const e=this._pendingChanges[0].batch;this._currentWriter=new qa(this,e);const i=this._pendingChanges[0].callback(this._currentWriter);t.push(i),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}return this.fire("_afterChanges"),t}}yi(xc,qn); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class Ac{constructor(){this._listener=Object.create(cr)}listenTo(t){this._listener.listenTo(t,"keydown",(t,e)=>{this._listener.fire("_keydown:"+po(e),e)})}set(t,e,i={}){const n=bo(t),o=i.priority;this._listener.listenTo(this._listener,"_keydown:"+n,(t,i)=>{e(i,()=>{i.preventDefault(),i.stopPropagation(),t.stop()}),t.return=!0},{priority:o})}press(t){return!!this._listener.fire("_keydown:"+po(t),t)}destroy(){this._listener.stopListening()}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Pc extends Ac{constructor(t){super(),this.editor=t}set(t,e,i={}){if("string"==typeof e){const t=e;e=(e,i)=>{this.editor.execute(t),i()}}super.set(t,e,i)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Cc{constructor(t={}){this._context=t.context||new Ei({language:t.language}),this._context._addEditor(this,!t.context);const e=Array.from(this.constructor.builtinPlugins||[]);this.config=new ni(t,this.constructor.defaultConfig),this.config.define("plugins",e),this.config.define(this._context._getEditorConfig()),this.plugins=new Ai(this,e,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this.commands=new ta,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.set("isReadOnly",!1),this.model=new xc;const i=new On;this.data=new ba(this.model,i),this.editing=new Zs(this.model,i),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new wa([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias("dataDowncast",this.data.downcastDispatcher),this.conversion.addAlias("editingDowncast",this.editing.downcastDispatcher),this.keystrokes=new Pc(this),this.keystrokes.listenTo(this.editing.view.document)}initPlugins(){const t=this.config,e=t.get("plugins"),i=t.get("removePlugins")||[],n=t.get("extraPlugins")||[];return this.plugins.init(e.concat(n),i)}destroy(){let t=Promise.resolve();return"initializing"==this.state&&(t=new Promise(t=>this.once("ready",t))),t.then(()=>{this.fire("destroy"),this.stopListening(),this.commands.destroy()}).then(()=>this.plugins.destroy()).then(()=>{this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy()}).then(()=>this._context._removeEditor(this))}execute(...t){try{this.commands.execute(...t)}catch(t){hi.b.rethrowUnexpectedError(t,this)}}}yi(Cc,qn);var Tc={setData(t){this.data.set(t)},getData(t){return this.data.get(t)}}; -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */var Sc={updateSourceElement(){if(!this.sourceElement)throw new hi.b("editor-missing-sourceelement: Cannot update the source element of a detached editor.",this);var t,e; -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */t=this.sourceElement,e=this.data.get(),t instanceof HTMLTextAreaElement&&(t.value=e),t.innerHTML=e}}; -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class Ec{getHtml(t){const e=document.implementation.createHTMLDocument("").createElement("div");return e.appendChild(t),e.innerHTML}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Oc{constructor(t){this._domParser=new DOMParser,this._domConverter=new nr(t,{blockFillerMode:"nbsp"}),this._htmlWriter=new Ec}toData(t){const e=this._domConverter.viewToDom(t,document);return this._htmlWriter.getHtml(e)}toView(t){const e=this._toDom(t);return this._domConverter.domToView(e)}_toDom(t){const e=this._domParser.parseFromString(t,"text/html"),i=e.createDocumentFragment(),n=e.body.childNodes;for(;n.length>0;)i.appendChild(n[0]);return i}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Rc{constructor(t){this.editor=t,this._components=new Map}*names(){for(const t of this._components.values())yield t.originalName}add(t,e){if(this.has(t))throw new hi.b("componentfactory-item-exists: The item already exists in the component factory.",this,{name:t});this._components.set(Ic(t),{callback:e,originalName:t})}create(t){if(!this.has(t))throw new hi.b("componentfactory-item-missing: The required component is not registered in the factory.",this,{name:t});return this._components.get(Ic(t)).callback(this.editor.locale)}has(t){return this._components.has(Ic(t))}}function Ic(t){return String(t).toLowerCase()} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Mc{constructor(){this.set("isFocused",!1),this.set("focusedElement",null),this._elements=new Set,this._nextEventLoopTimeout=null}add(t){if(this._elements.has(t))throw new hi.b("focusTracker-add-element-already-exist",this);this.listenTo(t,"focus",()=>this._focus(t),{useCapture:!0}),this.listenTo(t,"blur",()=>this._blur(),{useCapture:!0}),this._elements.add(t)}remove(t){t===this.focusedElement&&this._blur(t),this._elements.has(t)&&(this.stopListening(t),this._elements.delete(t))}destroy(){this.stopListening()}_focus(t){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=t,this.isFocused=!0}_blur(){clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0)}}yi(Mc,cr),yi(Mc,qn); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class Nc{constructor(t){this.editor=t,this.componentFactory=new Rc(t),this.focusTracker=new Mc,this._editableElementsMap=new Map,this.listenTo(t.editing.view.document,"layoutChanged",()=>this.update())}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy();for(const t of this._editableElementsMap.values())t.ckeditorInstance=null;this._editableElementsMap=new Map}setEditableElement(t,e){this._editableElementsMap.set(t,e),e.ckeditorInstance||(e.ckeditorInstance=this.editor)}getEditableElement(t="main"){return this._editableElementsMap.get(t)}getEditableElementsNames(){return this._editableElementsMap.keys()}get _editableElements(){return console.warn("editor-ui-deprecated-editable-elements: The EditorUI#_editableElements property has been deprecated and will be removed in the near future.",{editorUI:this}),this._editableElementsMap}}yi(Nc,gi);i(14); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */const Vc=new WeakMap;function Bc(t){const{view:e,element:i,text:n,isDirectHost:o=!0}=t,r=e.document;Vc.has(r)||(Vc.set(r,new Map),r.registerPostFixer(t=>Dc(r,t))),Vc.get(r).set(i,{text:n,isDirectHost:o}),e.change(t=>Dc(r,t))}function Fc(t,e){return!!e.hasClass("ck-placeholder")&&(t.removeClass("ck-placeholder",e),!0)}function Dc(t,e){const i=Vc.get(t);let n=!1;for(const[t,o]of i)Lc(e,t,o)&&(n=!0);return n}function Lc(t,e,i){const{text:n,isDirectHost:o}=i,r=o?e:function(t){if(1===t.childCount){const e=t.getChild(0);if(e.is("element")&&!e.is("uiElement"))return e}return null} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(e);let s=!1;return!!r&&(i.hostElement=r,r.getAttribute("data-placeholder")!==n&&(t.setAttribute("data-placeholder",n,r),s=!0),!function(t){if(!t.isAttached())return!1;const e=!Array.from(t.getChildren()).some(t=>!t.is("uiElement")),i=t.document;if(!i.isFocused&&e)return!0;const n=i.selection.anchor;return!(!e||!n||n.parent===t)}(r)?Fc(t,r)&&(s=!0):function(t,e){return!e.hasClass("ck-placeholder")&&(t.addClass("ck-placeholder",e),!0)}(t,r)&&(s=!0),s)}class zc{constructor(){this._replacedElements=[]}replace(t,e){this._replacedElements.push({element:t,newElement:e}),t.style.display="none",e&&t.parentNode.insertBefore(e,t.nextSibling)}restore(){this._replacedElements.forEach(({element:t,newElement:e})=>{t.style.display="",e&&e.remove()}),this._replacedElements=[]}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class jc extends Nc{constructor(t,e){ -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -var i;super(t),this.view=e,this._toolbarConfig=(i=t.config.get("toolbar"),Array.isArray(i)?{items:i}:i?Object.assign({items:[]},i):{items:[]}),this._elementReplacer=new zc}get element(){return this.view.element}init(t){const e=this.editor,i=this.view,n=e.editing.view,o=i.editable,r=n.document.getRoot();o.name=r.rootName,i.render();const s=o.element;this.setEditableElement(o.name,s),this.focusTracker.add(s),i.editable.bind("isFocused").to(this.focusTracker),n.attachDomRoot(s),t&&this._elementReplacer.replace(t,this.element),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const t=this.view,e=this.editor.editing.view;this._elementReplacer.restore(),e.detachDomRoot(t.editable.name),t.destroy(),super.destroy()}_initToolbar(){const t=this.editor,e=this.view,i=t.editing.view;e.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),e.stickyPanel.limiterElement=e.element,this._toolbarConfig.viewportTopOffset&&(e.stickyPanel.viewportTopOffset=this._toolbarConfig.viewportTopOffset),e.toolbar.fillFromConfig(this._toolbarConfig.items,this.componentFactory), -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -function({origin:t,originKeystrokeHandler:e,originFocusTracker:i,toolbar:n,beforeFocus:o,afterBlur:r}){i.add(n.element),e.set("Alt+F10",(t,e)=>{i.isFocused&&!n.focusTracker.isFocused&&(o&&o(),n.focus(),e())}),n.keystrokes.set("Esc",(e,i)=>{n.focusTracker.isFocused&&(t.focus(),r&&r(),i())})}({origin:i,originFocusTracker:this.focusTracker,originKeystrokeHandler:t.keystrokes,toolbar:e.toolbar})}_initPlaceholder(){const t=this.editor,e=t.editing.view,i=e.document.getRoot(),n=t.sourceElement,o=t.config.get("placeholder")||n&&"textarea"===n.tagName.toLowerCase()&&n.getAttribute("placeholder");o&&Bc({view:e,element:i,text:o,isDirectHost:!1})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class qc extends xi{constructor(t=[]){super(t,{idProperty:"viewUid"}),this.on("add",(t,e,i)=>{this._renderViewIntoCollectionParent(e,i)}),this.on("remove",(t,e)=>{e.element&&this._parentElement&&e.element.remove()}),this._parentElement=null}destroy(){this.map(t=>t.destroy())}setParent(t){this._parentElement=t;for(const t of this)this._renderViewIntoCollectionParent(t)}delegate(...t){if(!t.length||!t.every(t=>"string"==typeof t))throw new hi.b("ui-viewcollection-delegate-wrong-events: All event names must be strings.",this);return{to:e=>{for(const i of this)for(const n of t)i.delegate(n).to(e);this.on("add",(i,n)=>{for(const i of t)n.delegate(i).to(e)}),this.on("remove",(i,n)=>{for(const i of t)n.stopDelegating(i,e)})}}}_renderViewIntoCollectionParent(t,e){t.isRendered||t.render(),t.element&&this._parentElement&&this._parentElement.insertBefore(t.element,this._parentElement.children[e])}}class Wc{constructor(t){Object.assign(this,Zc(Xc(t))),this._isRendered=!1,this._revertData=null}render(){const t=this._renderNode({intoFragment:!0});return this._isRendered=!0,t}apply(t){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:t,isApplying:!0,revertData:this._revertData}),t}revert(t){if(!this._revertData)throw new hi.b("ui-template-revert-not-applied: Attempting to revert a template which has not been applied yet.",[this,t]);this._revertTemplateFromNode(t,this._revertData)}*getViews(){yield*function*t(e){if(e.children)for(const i of e.children)ol(i)?yield i:rl(i)&&(yield*t(i))}(this)}static bind(t,e){return{to:(i,n)=>new Uc({eventNameOrFunction:i,attribute:i,observable:t,emitter:e,callback:n}),if:(i,n,o)=>new $c({observable:t,emitter:e,attribute:i,valueIfTrue:n,callback:o})}}static extend(t,e){if(t._isRendered)throw new hi.b("template-extend-render: Attempting to extend a template which has already been rendered.",[this,t]);!function t(e,i){i.attributes&&(e.attributes||(e.attributes={}),il(e.attributes,i.attributes));i.eventListeners&&(e.eventListeners||(e.eventListeners={}),il(e.eventListeners,i.eventListeners));i.text&&e.text.push(...i.text);if(i.children&&i.children.length){if(e.children.length!=i.children.length)throw new hi.b("ui-template-extend-children-mismatch: The number of children in extended definition does not match.",e);let n=0;for(const o of i.children)t(e.children[n++],o)}}(t,Zc(Xc(e)))}_renderNode(t){let e;if(e=t.node?this.tag&&this.text:this.tag?this.text:!this.text,e)throw new hi.b('ui-template-wrong-syntax: Node definition must have either "tag" or "text" when rendering a new Node.',this);return this.text?this._renderText(t):this._renderElement(t)}_renderElement(t){let e=t.node;return e||(e=t.node=document.createElementNS(this.ns||"http://www.w3.org/1999/xhtml",this.tag)),this._renderAttributes(t),this._renderElementChildren(t),this._setUpListeners(t),e}_renderText(t){let e=t.node;return e?t.revertData.text=e.textContent:e=t.node=document.createTextNode(""),Gc(this.text)?this._bindToObservable({schema:this.text,updater:Jc(e),data:t}):e.textContent=this.text.join(""),e}_renderAttributes(t){let e,i,n,o;if(!this.attributes)return;const r=t.node,s=t.revertData;for(e in this.attributes)if(n=r.getAttribute(e),i=this.attributes[e],s&&(s.attributes[e]=n),o=F(i[0])&&i[0].ns?i[0].ns:null,Gc(i)){const a=o?i[0].value:i;s&&al(e)&&a.unshift(n),this._bindToObservable({schema:a,updater:Qc(r,e,o),data:t})}else"style"==e&&"string"!=typeof i[0]?this._renderStyleAttribute(i[0],t):(s&&n&&al(e)&&i.unshift(n),i=i.map(t=>t&&t.value||t).reduce((t,e)=>t.concat(e),[]).reduce(el,""),nl(i)||r.setAttributeNS(o,e,i))}_renderStyleAttribute(t,e){const i=e.node;for(const n in t){const o=t[n];Gc(o)?this._bindToObservable({schema:[o],updater:Yc(i,n),data:e}):i.style[n]=o}}_renderElementChildren(t){const e=t.node,i=t.intoFragment?document.createDocumentFragment():e,n=t.isApplying;let o=0;for(const r of this.children)if(sl(r)){if(!n){r.setParent(e);for(const t of r)i.appendChild(t.element)}}else if(ol(r))n||(r.isRendered||r.render(),i.appendChild(r.element));else if(Ko(r))i.appendChild(r);else if(n){const e={children:[],bindings:[],attributes:{}};t.revertData.children.push(e),r._renderNode({node:i.childNodes[o++],isApplying:!0,revertData:e})}else i.appendChild(r.render());t.intoFragment&&e.appendChild(i)}_setUpListeners(t){if(this.eventListeners)for(const e in this.eventListeners){const i=this.eventListeners[e].map(i=>{const[n,o]=e.split("@");return i.activateDomEventListener(n,o,t)});t.revertData&&t.revertData.bindings.push(i)}}_bindToObservable({schema:t,updater:e,data:i}){const n=i.revertData;Kc(t,e,i);const o=t.filter(t=>!nl(t)).filter(t=>t.observable).map(n=>n.activateAttributeListener(t,e,i));n&&n.bindings.push(o)}_revertTemplateFromNode(t,e){for(const t of e.bindings)for(const e of t)e();if(e.text)t.textContent=e.text;else{for(const i in e.attributes){const n=e.attributes[i];null===n?t.removeAttribute(i):t.setAttribute(i,n)}for(let i=0;iKc(t,e,i);return this.emitter.listenTo(this.observable,"change:"+this.attribute,n),()=>{this.emitter.stopListening(this.observable,"change:"+this.attribute,n)}}}class Uc extends Hc{activateDomEventListener(t,e,i){const n=(t,i)=>{e&&!i.target.matches(e)||("function"==typeof this.eventNameOrFunction?this.eventNameOrFunction(i):this.observable.fire(this.eventNameOrFunction,i))};return this.emitter.listenTo(i.node,t,n),()=>{this.emitter.stopListening(i.node,t,n)}}}class $c extends Hc{getValue(t){return!nl(super.getValue(t))&&(this.valueIfTrue||!0)}}function Gc(t){return!!t&&(t.value&&(t=t.value),Array.isArray(t)?t.some(Gc):t instanceof Hc)}function Kc(t,e,{node:i}){let n=function(t,e){return t.map(t=>t instanceof Hc?t.getValue(e):t)}(t,i);n=1==t.length&&t[0]instanceof $c?n[0]:n.reduce(el,""),nl(n)?e.remove():e.set(n)}function Jc(t){return{set(e){t.textContent=e},remove(){t.textContent=""}}}function Qc(t,e,i){return{set(n){t.setAttributeNS(i,e,n)},remove(){t.removeAttributeNS(i,e)}}}function Yc(t,e){return{set(i){t.style[e]=i},remove(){t.style[e]=null}}}function Xc(t){return ei(t,t=>{if(t&&(t instanceof Hc||rl(t)||ol(t)||sl(t)))return t})}function Zc(t){if("string"==typeof t?t=function(t){return{text:[t]}}(t):t.text&&function(t){Array.isArray(t.text)||(t.text=[t.text])}(t),t.on&&(t.eventListeners=function(t){for(const e in t)tl(t,e);return t}(t.on),delete t.on),!t.text){t.attributes&&function(t){for(const e in t)t[e].value&&(t[e].value=[].concat(t[e].value)),tl(t,e)}(t.attributes);const e=[];if(t.children)if(sl(t.children))e.push(t.children);else for(const i of t.children)rl(i)||ol(i)||Ko(i)?e.push(i):e.push(new Wc(i));t.children=e}return t}function tl(t,e){Array.isArray(t[e])||(t[e]=[t[e]])}function el(t,e){return nl(e)?t:nl(t)?e:`${t} ${e}`}function il(t,e){for(const i in e)t[i]?t[i].push(...e[i]):t[i]=e[i]}function nl(t){return!t&&0!==t}function ol(t){return t instanceof cl}function rl(t){return t instanceof Wc}function sl(t){return t instanceof qc}function al(t){return"class"==t||"style"==t}i(16); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class cl{constructor(t){this.element=null,this.isRendered=!1,this.locale=t,this.t=t&&t.t,this._viewCollections=new xi,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(e,i)=>{i.locale=t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=Wc.bind(this,this)}createCollection(t){const e=new qc(t);return this._viewCollections.add(e),e}registerChild(t){vi(t)||(t=[t]);for(const e of t)this._unboundChildren.add(e)}deregisterChild(t){vi(t)||(t=[t]);for(const e of t)this._unboundChildren.remove(e)}setTemplate(t){this.template=new Wc(t)}extendTemplate(t){Wc.extend(this.template,t)}render(){if(this.isRendered)throw new hi.b("ui-view-render-already-rendered: This View has already been rendered.",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(t=>t.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}}yi(cl,cr),yi(cl,qn);var ll=function(t){return"string"==typeof t||!Vt(t)&&p(t)&&"[object String]"==f(t)}; -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class dl extends qc{constructor(t,e=[]){super(e),this.locale=t}attachToDom(){this._bodyCollectionContainer=new Wc({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection},children:this}).render();let t=document.querySelector(".ck-body-wrapper");t||(t=function(t,e,i={},n=[]){const o=i&&i.xmlns,r=o?t.createElementNS(o,e):t.createElement(e);for(const t in i)r.setAttribute(t,i[t]);!ll(n)&&vi(n)||(n=[n]);for(let e of n)ll(e)&&(e=t.createTextNode(e)),r.appendChild(e);return r}(document,"div",{class:"ck-body-wrapper"}),document.body.appendChild(t)),t.appendChild(this._bodyCollectionContainer)}detachFromDom(){super.destroy(),this._bodyCollectionContainer&&this._bodyCollectionContainer.remove();const t=document.querySelector(".ck-body-wrapper");t&&0==t.childElementCount&&t.remove()}}i(18); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class hl extends cl{constructor(t){super(t),this.body=new dl(t)}render(){super.render(),this.body.attachToDom()}destroy(){return this.body.detachFromDom(),super.destroy()}}i(20); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class ul extends cl{constructor(t){super(t),this.set("text"),this.set("for"),this.id="ck-editor__label_"+li();const e=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:e.to("for")},children:[{text:e.to("text")}]})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class fl extends hl{constructor(t){super(t),this.top=this.createCollection(),this.main=this.createCollection(),this._voiceLabelView=this._createVoiceLabel(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-editor","ck-rounded-corners"],role:"application",dir:t.uiLanguageDirection,lang:t.uiLanguage,"aria-labelledby":this._voiceLabelView.id},children:[this._voiceLabelView,{tag:"div",attributes:{class:["ck","ck-editor__top","ck-reset_all"],role:"presentation"},children:this.top},{tag:"div",attributes:{class:["ck","ck-editor__main"],role:"presentation"},children:this.main}]})}_createVoiceLabel(){const t=this.t,e=new ul;return e.text=t("Rich Text Editor"),e.extendTemplate({attributes:{class:"ck-voice-label"}}),e}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class gl extends cl{constructor(t,e,i){super(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-content","ck-editor__editable","ck-rounded-corners"],lang:t.contentLanguage,dir:t.contentLanguageDirection}}),this.name=null,this.set("isFocused",!1),this._editableElement=i,this._hasExternalElement=!!this._editableElement,this._editingView=e}render(){super.render(),this._hasExternalElement?this.template.apply(this.element=this._editableElement):this._editableElement=this.element,this.on("change:isFocused",()=>this._updateIsFocusedClasses()),this._updateIsFocusedClasses()}destroy(){this._hasExternalElement&&this.template.revert(this._editableElement),super.destroy()}_updateIsFocusedClasses(){const t=this._editingView;function e(e){t.change(i=>{const n=t.document.getRoot(e.name);i.addClass(e.isFocused?"ck-focused":"ck-blurred",n),i.removeClass(e.isFocused?"ck-blurred":"ck-focused",n)})}t.isRenderingInProgress?function i(n){t.once("change:isRenderingInProgress",(t,o,r)=>{r?i(n):e(n)})}(this):e(this)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class ml extends gl{constructor(t,e,i){super(t,e,i),this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();const t=this._editingView,e=this.t;t.change(i=>{const n=t.document.getRoot(this.name);i.setAttribute("aria-label",e("Rich Text Editor, %0",[this.name]),n)})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function pl(t){return e=>e+t}i(22); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */const bl=pl("px");class wl extends cl{constructor(t){super(t);const e=this.bindTemplate;this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheLimiter",!1),this.set("_hasViewportTopOffset",!1),this.content=this.createCollection(),this._contentPanelPlaceholder=new Wc({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:e.to("isSticky",t=>t?"block":"none"),height:e.to("isSticky",t=>t?bl(this._panelRect.height):null)}}}).render(),this._contentPanel=new Wc({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",e.if("isSticky","ck-sticky-panel__content_sticky"),e.if("_isStickyToTheLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{width:e.to("isSticky",t=>t?bl(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:e.to("_hasViewportTopOffset",t=>t?bl(this.viewportTopOffset):null),bottom:e.to("_isStickyToTheLimiter",t=>t?bl(this.limiterBottomOffset):null),marginLeft:e.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this._contentPanel]})}render(){super.render(),this._checkIfShouldBeSticky(),this.listenTo(Zo.window,"scroll",()=>{this._checkIfShouldBeSticky()}),this.listenTo(this,"change:isActive",()=>{this._checkIfShouldBeSticky()})}_checkIfShouldBeSticky(){const t=this._panelRect=this._contentPanel.getBoundingClientRect();let e;this.limiterElement?(e=this._limiterRect=this.limiterElement.getBoundingClientRect(),this.isSticky=this.isActive&&e.top{this[e](),i()})}}get first(){return this.focusables.find(_l)||null}get last(){return this.focusables.filter(_l).slice(-1)[0]||null}get next(){return this._getFocusableItem(1)}get previous(){return this._getFocusableItem(-1)}get current(){let t=null;return null===this.focusTracker.focusedElement?null:(this.focusables.find((e,i)=>{const n=e.element===this.focusTracker.focusedElement;return n&&(t=i),n}),t)}focusFirst(){this._focus(this.first)}focusLast(){this._focus(this.last)}focusNext(){this._focus(this.next)}focusPrevious(){this._focus(this.previous)}_focus(t){t&&t.focus()}_getFocusableItem(t){const e=this.current,i=this.focusables.length;if(!i)return null;if(null===e)return this[1===t?"first":"last"];let n=(e+i+t)%i;do{const e=this.focusables.get(n);if(_l(e))return e;n=(n+i+t)%i}while(n!==e);return null}}function _l(t){return!(!t.focus||"none"==Zo.window.getComputedStyle(t.element).display)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class vl extends cl{constructor(t){super(t),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class yl{constructor(t,e){yl._observerInstance||yl._createObserver(),this._element=t,this._callback=e,yl._addElementCallback(t,e),yl._observerInstance.observe(t)}destroy(){yl._deleteElementCallback(this._element,this._callback)}static _addElementCallback(t,e){yl._elementCallbacks||(yl._elementCallbacks=new Map);let i=yl._elementCallbacks.get(t);i||(i=new Set,yl._elementCallbacks.set(t,i)),i.add(e)}static _deleteElementCallback(t,e){const i=yl._getElementCallbacks(t);i&&(i.delete(e),i.size||(yl._elementCallbacks.delete(t),yl._observerInstance.unobserve(t))),yl._elementCallbacks&&!yl._elementCallbacks.size&&(yl._observerInstance=null,yl._elementCallbacks=null)}static _getElementCallbacks(t){return yl._elementCallbacks?yl._elementCallbacks.get(t):null}static _createObserver(){let t;t="function"==typeof Zo.window.ResizeObserver?Zo.window.ResizeObserver:xl,yl._observerInstance=new t(t=>{for(const e of t){if(!e.target.offsetParent)continue;const t=yl._getElementCallbacks(e.target);if(t)for(const i of t)i(e)}})}}yl._observerInstance=null,yl._elementCallbacks=null;class xl{constructor(t){this._callback=t,this._elements=new Set,this._previousRects=new Map,this._periodicCheckTimeout=null}observe(t){this._elements.add(t),this._checkElementRectsAndExecuteCallback(),1===this._elements.size&&this._startPeriodicCheck()}unobserve(t){this._elements.delete(t),this._previousRects.delete(t),this._elements.size||this._stopPeriodicCheck()}_startPeriodicCheck(){const t=()=>{this._checkElementRectsAndExecuteCallback(),this._periodicCheckTimeout=setTimeout(t,100)};this.listenTo(Zo.window,"resize",()=>{this._checkElementRectsAndExecuteCallback()}),this._periodicCheckTimeout=setTimeout(t,100)}_stopPeriodicCheck(){clearTimeout(this._periodicCheckTimeout),this.stopListening(),this._previousRects.clear()}_checkElementRectsAndExecuteCallback(){const t=[];for(const e of this._elements)this._hasRectChanged(e)&&t.push({target:e,contentRect:this._previousRects.get(e)});t.length&&this._callback(t)}_hasRectChanged(t){if(!t.ownerDocument.body.contains(t))return!1;const e=new Xr(t),i=this._previousRects.get(t),n=!i||!i.isEqual(e);return this._previousRects.set(t,e),n}}yi(xl,cr); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class Al extends cl{constructor(t){super(t);const e=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-dropdown__panel",e.to("position",t=>"ck-dropdown__panel_"+t),e.if("isVisible","ck-dropdown__panel-visible")]},children:this.children,on:{selectstart:e.to(t=>t.preventDefault())}})}focus(){this.children.length&&this.children.first.focus()}focusLast(){if(this.children.length){const t=this.children.last;"function"==typeof t.focusLast?t.focusLast():t.focus()}}}i(24); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -function Pl({element:t,target:e,positions:i,limiter:n,fitInViewport:o}){L(e)&&(e=e()),L(n)&&(n=n());const r=function(t){return t&&t.parentNode?t.offsetParent===Zo.document.body?null:t.offsetParent:null}(t),s=new Xr(t),a=new Xr(e);let c,l;if(n||o){const t=function(t,e){const{elementRect:i,viewportRect:n}=e,o=i.getArea(),r=function(t,{targetRect:e,elementRect:i,limiterRect:n,viewportRect:o}){const r=[],s=i.getArea();for(const a of t){const[t,c]=Cl(a,e,i);let l=0,d=0;if(n)if(o){const t=n.getIntersection(o);t&&(l=t.getIntersectionArea(c))}else l=n.getIntersectionArea(c);o&&(d=o.getIntersectionArea(c));const h={positionName:t,positionRect:c,limiterIntersectArea:l,viewportIntersectArea:d};if(l===s)return[h];r.push(h)}return r}(t,e);if(n){const t=Tl(r.filter(({viewportIntersectArea:t})=>t===o),o);if(t)return t}return Tl(r,o)}(i,{targetRect:a,elementRect:s,limiterRect:n&&new Xr(n).getVisible(),viewportRect:o&&new Xr(Zo.window)});[l,c]=t||Cl(i[0],a,s)}else[l,c]=Cl(i[0],a,s);let d=Sl(c);return r&&(d=function({left:t,top:e},i){const n=Sl(new Xr(i)),o=Qr(i);return t-=n.left,e-=n.top,t+=i.scrollLeft,e+=i.scrollTop,t-=o.left,e-=o.top,{left:t,top:e}}(d,r)),{left:d.left,top:d.top,name:l}}function Cl(t,e,i){const{left:n,top:o,name:r}=t(e,i);return[r,i.clone().moveTo(n,o)]}function Tl(t,e){let i,n,o=0;for(const{positionName:r,positionRect:s,limiterIntersectArea:a,viewportIntersectArea:c}of t){if(a===e)return[r,s];const t=c**2+a**2;t>o&&(o=t,i=s,n=r)}return i?[n,i]:null}function Sl({left:t,top:e}){const{scrollX:i,scrollY:n}=Zo.window;return{left:t+i,top:e+n}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class El extends cl{constructor(t,e,i){super(t);const n=this.bindTemplate;this.buttonView=e,this.panelView=i,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class"),this.set("id"),this.set("panelPosition","auto"),this.keystrokes=new Ac,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",n.to("class"),n.if("isEnabled","ck-disabled",t=>!t)],id:n.to("id"),"aria-describedby":n.to("ariaDescribedById")},children:[e,i]}),e.extendTemplate({attributes:{class:["ck-dropdown__button"]}})}render(){super.render(),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.panelView.bind("isVisible").to(this,"isOpen"),this.on("change:isOpen",()=>{this.isOpen&&("auto"===this.panelPosition?this.panelView.position=El._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions}).name:this.panelView.position=this.panelPosition)}),this.keystrokes.listenTo(this.element);const t=(t,e)=>{this.isOpen&&(this.buttonView.focus(),this.isOpen=!1,e())};this.keystrokes.set("arrowdown",(t,e)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,e())}),this.keystrokes.set("arrowright",(t,e)=>{this.isOpen&&e()}),this.keystrokes.set("arrowleft",t),this.keystrokes.set("esc",t)}focus(){this.buttonView.focus()}get _panelPositions(){const{southEast:t,southWest:e,northEast:i,northWest:n}=El.defaultPanelPositions;return"ltr"===this.locale.uiLanguageDirection?[t,e,i,n]:[e,t,n,i]}}El.defaultPanelPositions={southEast:t=>({top:t.bottom,left:t.left,name:"se"}),southWest:(t,e)=>({top:t.bottom,left:t.left-e.width+t.width,name:"sw"}),northEast:(t,e)=>({top:t.top-e.height,left:t.left,name:"ne"}),northWest:(t,e)=>({top:t.bottom-e.height,left:t.left-e.width+t.width,name:"nw"})},El._getOptimalPosition=Pl;i(26); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Ol extends cl{constructor(){super();const t=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon"],viewBox:t.to("viewBox")}})}render(){super.render(),this._updateXMLContent(),this._colorFillPaths(),this.on("change:content",()=>{this._updateXMLContent(),this._colorFillPaths()}),this.on("change:fillColor",()=>{this._colorFillPaths()})}_updateXMLContent(){if(this.content){const t=(new DOMParser).parseFromString(this.content.trim(),"image/svg+xml").querySelector("svg"),e=t.getAttribute("viewBox");for(e&&(this.viewBox=e),this.element.innerHTML="";t.childNodes.length>0;)this.element.appendChild(t.childNodes[0])}}_colorFillPaths(){this.fillColor&&this.element.querySelectorAll(".ck-icon__fill").forEach(t=>{t.style.fill=this.fillColor})}}i(28); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Rl extends cl{constructor(t){super(t),this.set("text",""),this.set("position","s");const e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip",e.to("position",t=>"ck-tooltip_"+t),e.if("text","ck-hidden",t=>!t.trim())]},children:[{tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:e.to("text")}]}]})}}i(30); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Il extends cl{constructor(t){super(t);const e=this.bindTemplate,i=li();this.set("class"),this.set("labelStyle"),this.set("icon"),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke"),this.set("label"),this.set("tabindex",-1),this.set("tooltip"),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.tooltipView=this._createTooltipView(),this.labelView=this._createLabelView(i),this.iconView=new Ol,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this)),this.setTemplate({tag:"button",attributes:{class:["ck","ck-button",e.to("class"),e.if("isEnabled","ck-disabled",t=>!t),e.if("isVisible","ck-hidden",t=>!t),e.to("isOn",t=>t?"ck-on":"ck-off"),e.if("withText","ck-button_with-text"),e.if("withKeystroke","ck-button_with-keystroke")],type:e.to("type",t=>t||"button"),tabindex:e.to("tabindex"),"aria-labelledby":"ck-editor__aria-label_"+i,"aria-disabled":e.if("isEnabled",!0,t=>!t),"aria-pressed":e.to("isOn",t=>!!this.isToggleable&&String(t))},children:this.children,on:{mousedown:e.to(t=>{t.preventDefault()}),click:e.to(t=>{this.isEnabled?this.fire("execute"):t.preventDefault()})}})}render(){super.render(),this.icon&&(this.iconView.bind("content").to(this,"icon"),this.children.add(this.iconView)),this.children.add(this.tooltipView),this.children.add(this.labelView),this.withKeystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}_createTooltipView(){const t=new Rl;return t.bind("text").to(this,"_tooltipString"),t.bind("position").to(this,"tooltipPosition"),t}_createLabelView(t){const e=new cl,i=this.bindTemplate;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:i.to("labelStyle"),id:"ck-editor__aria-label_"+t},children:[{text:this.bindTemplate.to("label")}]}),e}_createKeystrokeView(){const t=new cl;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",t=>wo(t))}]}),t}_getTooltipString(t,e,i){return t?"string"==typeof t?t:(i&&(i=wo(i)),t instanceof Function?t(e,i):`${e}${i?` (${i})`:""}`):""}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class Ml extends Il{constructor(t){super(t),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){const t=new Ol;return t.content='',t.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),t}}i(32); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Nl extends cl{constructor(){super(),this.items=this.createCollection(),this.focusTracker=new Mc,this.keystrokes=new Ac,this._focusCycler=new kl({focusables:this.items,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"]},children:this.items})}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Vl extends cl{constructor(t){super(t),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item"]},children:this.children})}focus(){this.children.first.focus()}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Bl extends cl{constructor(t){super(t),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}}i(34); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Fl extends Il{constructor(t){super(t),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){const t=new cl;return t.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),t}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function Dl({emitter:t,activator:e,callback:i,contextElements:n}){t.listenTo(document,"mousedown",(t,{target:o})=>{if(e()){for(const t of n)if(t.contains(o))return;i()}})}i(36),i(38); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -function Ll(t,e=Ml){const i=new e(t),n=new Al(t),o=new El(t,i,n);return i.bind("isEnabled").to(o),i instanceof Ml?i.bind("isOn").to(o,"isOpen"):i.arrowView.bind("isOn").to(o,"isOpen"),function(t){(function(t){t.on("render",()=>{Dl({emitter:t,activator:()=>t.isOpen,callback:()=>{t.isOpen=!1},contextElements:[t.element]})})})(t),function(t){t.on("execute",e=>{e.source instanceof Fl||(t.isOpen=!1)})}(t),function(t){t.keystrokes.set("arrowdown",(e,i)=>{t.isOpen&&(t.panelView.focus(),i())}),t.keystrokes.set("arrowup",(e,i)=>{t.isOpen&&(t.panelView.focusLast(),i())})}(t)}(o),o}i(40); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class zl extends cl{constructor(t,e){super(t);const i=this.bindTemplate,n=this.t; -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -var o;this.options=e||{},this.set("ariaLabel",n("Editor toolbar")),this.set("maxWidth","auto"),this.items=this.createCollection(),this.focusTracker=new Mc,this.keystrokes=new Ac,this.set("class"),this.set("isCompact",!1),this.itemsView=new jl(t),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection(),this._focusCycler=new kl({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:["arrowleft","arrowup"],focusNext:["arrowright","arrowdown"]}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar",i.to("class"),i.if("isCompact","ck-toolbar_compact")],role:"toolbar","aria-label":i.to("ariaLabel"),style:{maxWidth:i.to("maxWidth")}},children:this.children,on:{mousedown:(o=this,o.bindTemplate.to(t=>{t.target===o.element&&t.preventDefault()}))}}),this._behavior=this.options.shouldGroupWhenFull?new Wl(this):new ql(this)}render(){super.render();for(const t of this.items)this.focusTracker.add(t.element);this.items.on("add",(t,e)=>{this.focusTracker.add(e.element)}),this.items.on("remove",(t,e)=>{this.focusTracker.remove(e.element)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(t,e){t.map(t=>{"|"==t?this.items.add(new vl):e.has(t)?this.items.add(e.create(t)):console.warn(Object(hi.a)("toolbarview-item-unavailable: The requested toolbar item is unavailable."),{name:t})})}}class jl extends cl{constructor(t){super(t),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}}class ql{constructor(t){const e=t.bindTemplate;t.set("isVertical",!1),t.itemsView.children.bindTo(t.items).using(t=>t),t.focusables.bindTo(t.items).using(t=>t),t.extendTemplate({attributes:{class:[e.if("isVertical","ck-toolbar_vertical")]}})}render(){}destroy(){}}class Wl{constructor(t){this.viewChildren=t.children,this.viewFocusables=t.focusables,this.viewItemsView=t.itemsView,this.viewFocusTracker=t.focusTracker,this.viewLocale=t.locale,this.ungroupedItems=t.createCollection(),this.groupedItems=t.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),this.resizeObserver=null,this.cachedPadding=null,this.shouldUpdateGroupingOnNextResize=!1,t.itemsView.children.bindTo(this.ungroupedItems).using(t=>t),this.ungroupedItems.on("add",this._updateFocusCycleableItems.bind(this)),this.ungroupedItems.on("remove",this._updateFocusCycleableItems.bind(this)),t.children.on("add",this._updateFocusCycleableItems.bind(this)),t.children.on("remove",this._updateFocusCycleableItems.bind(this)),t.items.on("add",(t,e,i)=>{i>this.ungroupedItems.length?this.groupedItems.add(e,i-this.ungroupedItems.length):this.ungroupedItems.add(e,i),this._updateGrouping()}),t.items.on("remove",(t,e,i)=>{i>this.ungroupedItems.length?this.groupedItems.remove(e):this.ungroupedItems.remove(e),this._updateGrouping()}),t.extendTemplate({attributes:{class:["ck-toolbar_grouping"]}})}render(t){this.viewElement=t.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(t)}destroy(){this.groupedItemsDropdown.destroy(),this.resizeObserver.destroy()}_updateGrouping(){if(!this.viewElement.ownerDocument.body.contains(this.viewElement))return;if(!this.viewElement.offsetParent)return void(this.shouldUpdateGroupingOnNextResize=!0);let t;for(;this._areItemsOverflowing;)this._groupLastItem(),t=!0;if(!t&&this.groupedItems.length){for(;this.groupedItems.length&&!this._areItemsOverflowing;)this._ungroupFirstItem();this._areItemsOverflowing&&this._groupLastItem()}}get _areItemsOverflowing(){if(!this.ungroupedItems.length)return!1;const t=this.viewElement,e=this.viewLocale.uiLanguageDirection,i=new Xr(t.lastChild),n=new Xr(t);if(!this.cachedPadding){const i=Zo.window.getComputedStyle(t),n="ltr"===e?"paddingRight":"paddingLeft";this.cachedPadding=Number.parseInt(i[n])}return"ltr"===e?i.right>n.right-this.cachedPadding:i.left{t&&t===e.contentRect.width&&!this.shouldUpdateGroupingOnNextResize||(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),t=e.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(t){t.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new vl),this.viewChildren.add(this.groupedItemsDropdown),this.viewFocusTracker.add(this.groupedItemsDropdown.element)),this.groupedItems.add(this.ungroupedItems.remove(this.ungroupedItems.last),0)}_ungroupFirstItem(){this.ungroupedItems.add(this.groupedItems.remove(this.groupedItems.first)),this.groupedItems.length||(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last),this.viewFocusTracker.remove(this.groupedItemsDropdown.element))}_createGroupedItemsDropdown(){const t=this.viewLocale,e=t.t,i=Ll(t);return i.class="ck-toolbar__grouped-dropdown",i.panelPosition="ltr"===t.uiLanguageDirection?"sw":"se",function(t,e){const i=t.locale,n=i.t,o=t.toolbarView=new zl(i);o.set("ariaLabel",n("Dropdown toolbar")),t.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.map(t=>o.items.add(t)),t.panelView.children.add(o),o.items.delegate("execute").to(t)}(i,[]),i.buttonView.set({label:e("Show more items"),tooltip:!0,icon:''}),i.toolbarView.items.bindTo(this.groupedItems).using(t=>t),i}_updateFocusCycleableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(t=>{this.viewFocusables.add(t)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}}i(42); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Hl extends fl{constructor(t,e,i={}){super(t),this.stickyPanel=new wl(t),this.toolbar=new zl(t,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull}),this.editable=new ml(t,e)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class Ul extends Cc{constructor(t,e){super(e),ii(t)&&(this.sourceElement=t),this.data.processor=new Oc(this.data.viewDocument),this.model.document.createRoot();const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),n=new Hl(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:i});this.ui=new jc(this,n),function(t){if(!L(t.updateSourceElement))throw new hi.b("attachtoform-missing-elementapi-interface: Editor passed to attachToForm() must implement ElementApi.",t);const e=t.sourceElement;if(e&&"textarea"===e.tagName.toLowerCase()&&e.form){let i;const n=e.form,o=()=>t.updateSourceElement();L(n.submit)&&(i=n.submit,n.submit=()=>{o(),i.apply(n)}),n.addEventListener("submit",o),t.on("destroy",()=>{n.removeEventListener("submit",o),i&&(n.submit=i)})}}(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(t,e={}){return new Promise(i=>{const n=new this(t,e);i(n.initPlugins().then(()=>n.ui.init(ii(t)?t:null)).then(()=>{if(!ii(t)&&e.initialData)throw new hi.b("editor-create-initial-data: The config.initialData option cannot be used together with initial data passed in Editor.create().",null);const i=e.initialData||function(t){return ii(t)?(e=t,e instanceof HTMLTextAreaElement?e.value:e.innerHTML):t;var e} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(t);return n.data.init(i)}).then(()=>n.fire("ready")).then(()=>n))})}}yi(Ul,Tc),yi(Ul,Sc);class $l{constructor(t){this.editor=t,this.set("isEnabled",!0),this._disableStack=new Set}forceDisabled(t){this._disableStack.add(t),1==this._disableStack.size&&(this.on("set:isEnabled",Gl,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(t){this._disableStack.delete(t),0==this._disableStack.size&&(this.off("set:isEnabled",Gl),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}}function Gl(t){t.return=!1,t.stop()} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */yi($l,qn);class Kl{constructor(t){this.files=function(t){const e=t.files?Array.from(t.files):[],i=t.items?Array.from(t.items):[];if(e.length)return e;return i.filter(t=>"file"===t.kind).map(t=>t.getAsFile())} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(t),this._native=t}get types(){return this._native.types}getData(t){return this._native.getData(t)}setData(t,e){this._native.setData(t,e)}}class Jl extends Ir{constructor(t){super(t);const e=this.document;function i(t,i){i.preventDefault();const n=i.dropRange?[i.dropRange]:Array.from(e.selection.getRanges()),o=new ai(e,"clipboardInput");e.fire(o,{dataTransfer:i.dataTransfer,targetRanges:n}),o.stop.called&&i.stopPropagation()}this.domEventType=["paste","copy","cut","drop","dragover"],this.listenTo(e,"paste",i,{priority:"low"}),this.listenTo(e,"drop",i,{priority:"low"})}onDomEvent(t){const e={dataTransfer:new Kl(t.clipboardData?t.clipboardData:t.dataTransfer)};"drop"==t.type&&(e.dropRange=function(t,e){const i=e.target.ownerDocument,n=e.clientX,o=e.clientY;let r;i.caretRangeFromPoint&&i.caretRangeFromPoint(n,o)?r=i.caretRangeFromPoint(n,o):e.rangeParent&&(r=i.createRange(),r.setStart(e.rangeParent,e.rangeOffset),r.collapse(!0));return r?t.domConverter.domRangeToView(r):t.document.selection.getFirstRange()} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(this.view,t)),this.fire(t.type,t,e)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -const Ql=["figcaption","li"]; -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class Yl extends $l{static get pluginName(){return"Clipboard"}init(){const t=this.editor,e=t.model.document,i=t.editing.view,n=i.document;function o(i,o){const r=o.dataTransfer;o.preventDefault();const s=t.data.toView(t.model.getSelectedContent(e.selection));n.fire("clipboardOutput",{dataTransfer:r,content:s,method:i.name})}this._htmlDataProcessor=new Oc(n),i.addObserver(Jl),this.listenTo(n,"clipboardInput",e=>{t.isReadOnly&&e.stop()},{priority:"highest"}),this.listenTo(n,"clipboardInput",(t,e)=>{const n=e.dataTransfer;let o="";var r; -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */n.getData("text/html")?o=function(t){return t.replace(/(\s+)<\/span>/g,(t,e)=>1==e.length?" ":e)}(n.getData("text/html")):n.getData("text/plain")&&((r=(r=n.getData("text/plain")).replace(//g,">").replace(/\n/g,"

").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  ")).indexOf("

")>-1&&(r=`

${r}

`),o=r),o=this._htmlDataProcessor.toView(o);const s=new ai(this,"inputTransformation");this.fire(s,{content:o,dataTransfer:n}),s.stop.called&&t.stop(),i.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(t,e)=>{if(!e.content.isEmpty){const i=this.editor.data,n=this.editor.model,o=i.toModel(e.content,"$clipboardHolder");if(0==o.childCount)return;n.insertContent(o),t.stop()}},{priority:"low"}),this.listenTo(n,"copy",o,{priority:"low"}),this.listenTo(n,"cut",(e,i)=>{t.isReadOnly?i.preventDefault():o(e,i)},{priority:"low"}),this.listenTo(n,"clipboardOutput",(i,n)=>{n.content.isEmpty||(n.dataTransfer.setData("text/html",this._htmlDataProcessor.toData(n.content)),n.dataTransfer.setData("text/plain",function t(e){let i="";if(e.is("text")||e.is("textProxy"))i=e.data;else if(e.is("img")&&e.hasAttribute("alt"))i=e.getAttribute("alt");else{let n=null;for(const o of e.getChildren()){const e=t(o);n&&(n.is("containerElement")||o.is("containerElement"))&&(Ql.includes(n.name)||Ql.includes(o.name)?i+="\n":i+="\n\n"),i+=e,n=o}}return i}(n.content))),"cut"==n.method&&t.model.deleteContent(e.selection)},{priority:"low"})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Xl{constructor(t){this.editor=t,this.set("value",void 0),this.set("isEnabled",!1),this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.on("execute",t=>{this.isEnabled||t.stop()},{priority:"high"}),this.listenTo(t,"change:isReadOnly",(t,e,i)=>{i?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")})}refresh(){this.isEnabled=!0}forceDisabled(t){this._disableStack.add(t),1==this._disableStack.size&&(this.on("set:isEnabled",Zl,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(t){this._disableStack.delete(t),0==this._disableStack.size&&(this.off("set:isEnabled",Zl),this.refresh())}execute(){}destroy(){this.stopListening()}}function Zl(t){t.return=!1,t.stop()} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function*td(t,e){for(const i of e)i&&t.getAttributeProperties(i[0]).copyOnEnter&&(yield i)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */yi(Xl,qn);class ed extends Xl{execute(){const t=this.editor.model,e=t.document;t.change(i=>{!function(t,e,i,n){const o=i.isCollapsed,r=i.getFirstRange(),s=r.start.parent,a=r.end.parent;if(n.isLimit(s)||n.isLimit(a))return void(o||s!=a||t.deleteContent(i));if(o){const t=td(e.model.schema,i.getAttributes());id(e,r.start),e.setSelectionAttribute(t)}else{const n=!(r.start.isAtStart&&r.end.isAtEnd),o=s==a;t.deleteContent(i,{leaveUnmerged:n}),n&&(o?id(e,i.focus):e.setSelection(a,0))}}(this.editor.model,i,e.selection,t.schema),this.fire("afterExecute",{writer:i})})}}function id(t,e){t.split(e),t.setSelection(e.parent.nextSibling,0)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class nd extends hr{constructor(t){super(t);const e=this.document;e.on("keydown",(t,i)=>{if(this.isEnabled&&i.keyCode==mo.enter){let n;e.once("enter",t=>n=t,{priority:"highest"}),e.fire("enter",new Rr(e,i.domEvent,{isSoft:i.shiftKey})),n&&n.stop.called&&t.stop()}})}observe(){}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class od extends $l{static get pluginName(){return"Enter"}init(){const t=this.editor,e=t.editing.view,i=e.document;e.addObserver(nd),t.commands.add("enter",new ed(t)),this.listenTo(i,"enter",(i,n)=>{n.preventDefault(),n.isSoft||(t.execute("enter"),e.scrollToTheSelection())},{priority:"low"})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class rd extends Xl{execute(){const t=this.editor.model,e=t.document;t.change(i=>{!function(t,e,i){const n=i.isCollapsed,o=i.getFirstRange(),r=o.start.parent,s=o.end.parent,a=r==s;if(n){const n=td(t.schema,i.getAttributes());sd(t,e,o.end),e.removeSelectionAttribute(i.getAttributeKeys()),e.setSelectionAttribute(n)}else{const n=!(o.start.isAtStart&&o.end.isAtEnd);t.deleteContent(i,{leaveUnmerged:n}),a?sd(t,e,i.focus):n&&e.setSelection(s,0)}}(t,i,e.selection),this.fire("afterExecute",{writer:i})})}refresh(){const t=this.editor.model,e=t.document;this.isEnabled=function(t,e){if(e.rangeCount>1)return!1;const i=e.anchor;if(!i||!t.checkChild(i,"softBreak"))return!1;const n=e.getFirstRange(),o=n.start.parent,r=n.end.parent;if((ad(o,t)||ad(r,t))&&o!==r)return!1;return!0}(t.schema,e.selection)}}function sd(t,e,i){const n=e.createElement("softBreak");t.insertContent(n,i),e.setSelection(n,"after")}function ad(t,e){return!t.is("rootElement")&&(e.isLimit(t)||ad(t.parent,e))} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class cd extends $l{static get pluginName(){return"ShiftEnter"}init(){const t=this.editor,e=t.model.schema,i=t.conversion,n=t.editing.view,o=n.document;e.register("softBreak",{allowWhere:"$text",isInline:!0}),i.for("upcast").elementToElement({model:"softBreak",view:"br"}),i.for("downcast").elementToElement({model:"softBreak",view:(t,e)=>e.createEmptyElement("br")}),n.addObserver(nd),t.commands.add("shiftEnter",new rd(t)),this.listenTo(o,"enter",(e,i)=>{i.preventDefault(),i.isSoft&&(t.execute("shiftEnter"),n.scrollToTheSelection())},{priority:"low"})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class ld extends Xl{execute(){const t=this.editor.model,e=t.schema.getLimitElement(t.document.selection);t.change(t=>{t.setSelection(e,"in")})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */const dd=bo("Ctrl+A");class hd extends $l{static get pluginName(){return"SelectAllEditing"}init(){const t=this.editor,e=t.editing.view.document;t.commands.add("selectAll",new ld(t)),this.listenTo(e,"keydown",(e,i)=>{po(i)===dd&&(t.execute("selectAll"),i.preventDefault())})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class ud extends $l{static get pluginName(){return"SelectAllUI"}init(){const t=this.editor;t.ui.componentFactory.add("selectAll",e=>{const i=t.commands.get("selectAll"),n=new Il(e),o=e.t;return n.set({label:o("Select all"),icon:'',keystroke:"Ctrl+A",tooltip:!0}),n.bind("isOn","isEnabled").to(i,"value","isEnabled"),this.listenTo(n,"execute",()=>{t.execute("selectAll"),t.editing.view.focus()}),n})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class fd extends $l{static get requires(){return[hd,ud]}static get pluginName(){return"SelectAll"}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class gd{constructor(t,e=20){this.model=t,this.size=0,this.limit=e,this.isLocked=!1,this._changeCallback=(t,e)=>{"transparent"!=e.type&&e!==this._batch&&this._reset(!0)},this._selectionChangeCallback=()=>{this._reset()},this.model.document.on("change",this._changeCallback),this.model.document.selection.on("change:range",this._selectionChangeCallback),this.model.document.selection.on("change:attribute",this._selectionChangeCallback)}get batch(){return this._batch||(this._batch=this.model.createBatch()),this._batch}input(t){this.size+=t,this.size>=this.limit&&this._reset(!0)}lock(){this.isLocked=!0}unlock(){this.isLocked=!1}destroy(){this.model.document.off("change",this._changeCallback),this.model.document.selection.off("change:range",this._selectionChangeCallback),this.model.document.selection.off("change:attribute",this._selectionChangeCallback)}_reset(t){this.isLocked&&!t||(this._batch=null,this.size=0)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class md extends Xl{constructor(t,e){super(t),this._buffer=new gd(t.model,e),this._batches=new WeakSet}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(t={}){const e=this.editor.model,i=e.document,n=t.text||"",o=n.length,r=t.range?e.createSelection(t.range):i.selection,s=t.resultRange;e.enqueueChange(this._buffer.batch,t=>{this._buffer.lock(),e.deleteContent(r),n&&e.insertContent(t.createText(n,i.selection.getAttributes()),r),s?t.setSelection(s):r.is("documentSelection")||t.setSelection(r),this._buffer.unlock(),this._buffer.input(o),this._batches.add(this._buffer.batch)})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function pd(t){let e=null;const i=t.model,n=t.editing.view,o=t.commands.get("input");function r(t){const r=i.document,a=n.document.isComposing,c=e&&e.isEqual(r.selection);e=null,o.isEnabled&&(function(t){if(t.ctrlKey)return!0;return bd.includes(t.keyCode)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(t)||r.selection.isCollapsed||a&&229===t.keyCode||!a&&229===t.keyCode&&c||s())}function s(){const t=o.buffer;t.lock(),i.enqueueChange(t.batch,()=>{i.deleteContent(i.document.selection)}),t.unlock()}uo.isAndroid?n.document.on("beforeinput",(t,e)=>r(e),{priority:"lowest"}):n.document.on("keydown",(t,e)=>r(e),{priority:"lowest"}),n.document.on("compositionstart",(function(){const t=i.document,e=1!==t.selection.rangeCount||t.selection.getFirstRange().isFlat;if(t.selection.isCollapsed||e)return;s()}),{priority:"lowest"}),n.document.on("compositionend",()=>{e=i.createSelection(i.document.selection)},{priority:"lowest"})}const bd=[po("arrowUp"),po("arrowRight"),po("arrowDown"),po("arrowLeft"),9,16,17,18,19,20,27,33,34,35,36,45,91,93,144,145,173,174,175,176,177,178,179,255];for(let t=112;t<=135;t++)bd.push(t);function wd(t){if(t.newChildren.length-t.oldChildren.length!=1)return;const e=function(t,e){const i=[];let n,o=0;return t.forEach(t=>{"equal"==t?(r(),o++):"insert"==t?(s("insert")?n.values.push(e[o]):(r(),n={type:"insert",index:o,values:[e[o]]}),o++):s("delete")?n.howMany++:(r(),n={type:"delete",index:o,howMany:1})}),r(),i;function r(){n&&(i.push(n),n=null)}function s(t){return n&&n.type==t}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(Uo(t.oldChildren,t.newChildren,kd),t.newChildren);if(e.length>1)return;const i=e[0];return i.values[0]&&i.values[0].is("text")?i:void 0}function kd(t,e){return t&&t.is("text")&&e&&e.is("text")?t.data===e.data:t===e} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class _d{constructor(t){this.editor=t,this.editing=this.editor.editing}handle(t,e){if(function(t){if(0==t.length)return!1;for(const e of t)if("children"===e.type&&!wd(e))return!0;return!1}(t))this._handleContainerChildrenMutations(t,e);else for(const i of t)this._handleTextMutation(i,e),this._handleTextNodeInsertion(i)}_handleContainerChildrenMutations(t,e){const i=function(t){const e=t.map(t=>t.node).reduce((t,e)=>t.getCommonAncestor(e,{includeSelf:!0}));if(!e)return;return e.getAncestors({includeSelf:!0,parentFirst:!0}).find(t=>t.is("containerElement")||t.is("rootElement"))}(t);if(!i)return;const n=this.editor.editing.view.domConverter.mapViewToDom(i),o=new nr(this.editor.editing.view.document),r=this.editor.data.toModel(o.domToView(n)).getChild(0),s=this.editor.editing.mapper.toModelElement(i);if(!s)return;const a=Array.from(r.getChildren()),c=Array.from(s.getChildren()),l=a[a.length-1],d=c[c.length-1];l&&l.is("softBreak")&&d&&!d.is("softBreak")&&a.pop();const h=this.editor.model.schema;if(!vd(a,h)||!vd(c,h))return;const u=a.map(t=>t.is("text")?t.data:"@").join("").replace(/\u00A0/g," "),f=c.map(t=>t.is("text")?t.data:"@").join("").replace(/\u00A0/g," ");if(f===u)return;const g=Uo(f,u),{firstChangeAt:m,insertions:p,deletions:b}=yd(g);let w=null;e&&(w=this.editing.mapper.toModelRange(e.getFirstRange()));const k=u.substr(m,p),_=this.editor.model.createRange(this.editor.model.createPositionAt(s,m),this.editor.model.createPositionAt(s,m+b));this.editor.execute("input",{text:k,range:_,resultRange:w})}_handleTextMutation(t,e){if("text"!=t.type)return;const i=t.newText.replace(/\u00A0/g," "),n=t.oldText.replace(/\u00A0/g," ");if(n===i)return;const o=Uo(n,i),{firstChangeAt:r,insertions:s,deletions:a}=yd(o);let c=null;e&&(c=this.editing.mapper.toModelRange(e.getFirstRange()));const l=this.editing.view.createPositionAt(t.node,r),d=this.editing.mapper.toModelPosition(l),h=this.editor.model.createRange(d,d.getShiftedBy(a)),u=i.substr(r,s);this.editor.execute("input",{text:u,range:h,resultRange:c})}_handleTextNodeInsertion(t){if("children"!=t.type)return;const e=wd(t),i=this.editing.view.createPositionAt(t.node,e.index),n=this.editing.mapper.toModelPosition(i),o=e.values[0].data;this.editor.execute("input",{text:o.replace(/\u00A0/g," "),range:this.editor.model.createRange(n)})}}function vd(t,e){return t.every(t=>e.isInline(t))}function yd(t){let e=null,i=null;for(let n=0;n{new _d(t).handle(i,n)})}(t)}isInput(t){return this.editor.commands.get("input")._batches.has(t)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Ad extends Xl{constructor(t,e){super(t),this.direction=e,this._buffer=new gd(t.model,t.config.get("typing.undoStep"))}get buffer(){return this._buffer}execute(t={}){const e=this.editor.model,i=e.document;e.enqueueChange(this._buffer.batch,n=>{this._buffer.lock();const o=n.createSelection(t.selection||i.selection),r=o.isCollapsed;if(o.isCollapsed&&e.modifySelection(o,{direction:this.direction,unit:t.unit}),this._shouldEntireContentBeReplacedWithParagraph(t.sequence||1))return void this._replaceEntireContentWithParagraph(n);if(o.isCollapsed)return;let s=0;o.getFirstRange().getMinimalFlatRanges().forEach(t=>{s+=eo(t.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),e.deleteContent(o,{doNotResetEntireContent:r,direction:this.direction}),this._buffer.input(s),n.setSelection(o),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(t){if(t>1)return!1;const e=this.editor.model,i=e.document.selection,n=e.schema.getLimitElement(i);if(!(i.isCollapsed&&i.containsEntireContent(n)))return!1;if(!e.schema.checkChild(n,"paragraph"))return!1;const o=n.getChild(0);return!o||"paragraph"!==o.name}_replaceEntireContentWithParagraph(t){const e=this.editor.model,i=e.document.selection,n=e.schema.getLimitElement(i),o=t.createElement("paragraph");t.remove(t.createRangeIn(n)),t.insert(o,n),t.setSelection(o,0)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Pd extends hr{constructor(t){super(t);const e=t.document;let i=0;function n(t,i,n){let o;e.once("delete",t=>o=t,{priority:Number.POSITIVE_INFINITY}),e.fire("delete",new Rr(e,i,n)),o&&o.stop.called&&t.stop()}e.on("keyup",(t,e)=>{e.keyCode!=mo.delete&&e.keyCode!=mo.backspace||(i=0)}),e.on("keydown",(t,e)=>{const o={};if(e.keyCode==mo.delete)o.direction="forward",o.unit="character";else{if(e.keyCode!=mo.backspace)return;o.direction="backward",o.unit="codePoint"}const r=uo.isMac?e.altKey:e.ctrlKey;o.unit=r?"word":o.unit,o.sequence=++i,n(t,e.domEvent,o)}),uo.isAndroid&&e.on("beforeinput",(e,i)=>{if("deleteContentBackward"!=i.domEvent.inputType)return;const o={unit:"codepoint",direction:"backward",sequence:1},r=i.domTarget.ownerDocument.defaultView.getSelection();r.anchorNode==r.focusNode&&r.anchorOffset+1!=r.focusOffset&&(o.selectionToRemove=t.domConverter.domSelectionToView(r)),n(e,i.domEvent,o)})}observe(){}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Cd extends $l{static get pluginName(){return"Delete"}init(){const t=this.editor,e=t.editing.view,i=e.document;if(e.addObserver(Pd),t.commands.add("forwardDelete",new Ad(t,"forward")),t.commands.add("delete",new Ad(t,"backward")),this.listenTo(i,"delete",(i,n)=>{const o={unit:n.unit,sequence:n.sequence};if(n.selectionToRemove){const e=t.model.createSelection(),i=[];for(const e of n.selectionToRemove.getRanges())i.push(t.editing.mapper.toModelRange(e));e.setTo(i),o.selection=e}t.execute("forward"==n.direction?"forwardDelete":"delete",o),n.preventDefault(),e.scrollToTheSelection()}),uo.isAndroid){let t=null;this.listenTo(i,"delete",(e,i)=>{const n=i.domTarget.ownerDocument.defaultView.getSelection();t={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}},{priority:"lowest"}),this.listenTo(i,"keyup",(e,i)=>{if(t){const e=i.domTarget.ownerDocument.defaultView.getSelection();e.collapse(t.anchorNode,t.anchorOffset),e.extend(t.focusNode,t.focusOffset),t=null}})}}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Td extends $l{static get requires(){return[xd,Cd]}static get pluginName(){return"Typing"}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */const Sd=new Map;function Ed(t,e,i){let n=Sd.get(t);n||(n=new Map,Sd.set(t,n)),n.set(e,i)}function Od(t){return[t]}function Rd(t,e,i={}){const n=function(t,e){const i=Sd.get(t);return i&&i.has(e)?i.get(e):Od}(t.constructor,e.constructor);try{return n(t=t.clone(),e,i)}catch(t){throw t}}function Id(t,e,i){t=t.slice(),e=e.slice();const n=new Md(i.document,i.useRelations,i.forceWeakRemove);n.setOriginalOperations(t),n.setOriginalOperations(e);const o=n.originalOperations;if(0==t.length||0==e.length)return{operationsA:t,operationsB:e,originalOperations:o};const r=new WeakMap;for(const e of t)r.set(e,0);const s={nextBaseVersionA:t[t.length-1].baseVersion+1,nextBaseVersionB:e[e.length-1].baseVersion+1,originalOperationsACount:t.length,originalOperationsBCount:e.length};let a=0;for(;a{if(t.key===e.key&&t.range.start.hasSameParentAs(e.range.start)){const n=t.range.getDifference(e.range).map(e=>new Ia(e,t.key,t.oldValue,t.newValue,0)),o=t.range.getIntersection(e.range);return o&&i.aIsStrong&&n.push(new Ia(o,e.key,e.newValue,t.newValue,0)),0==n.length?[new rc(0)]:n}return[t]}),Ed(Ia,Va,(t,e)=>{if(t.range.start.hasSameParentAs(e.position)&&t.range.containsPosition(e.position)){const i=t.range._getTransformedByInsertion(e.position,e.howMany,!e.shouldReceiveAttributes).map(e=>new Ia(e,t.key,t.oldValue,t.newValue,t.baseVersion));if(e.shouldReceiveAttributes){const n=Bd(e,t.key,t.oldValue);n&&i.unshift(n)}return i}return t.range=t.range._getTransformedByInsertion(e.position,e.howMany,!1)[0],[t]}),Ed(Ia,La,(t,e)=>{const i=[];t.range.start.hasSameParentAs(e.deletionPosition)&&(t.range.containsPosition(e.deletionPosition)||t.range.start.isEqual(e.deletionPosition))&&i.push(xs._createFromPositionAndShift(e.graveyardPosition,1));const n=t.range._getTransformedByMergeOperation(e);return n.isCollapsed||i.push(n),i.map(e=>new Ia(e,t.key,t.oldValue,t.newValue,t.baseVersion))}),Ed(Ia,Na,(t,e)=>function(t,e){const i=xs._createFromPositionAndShift(e.sourcePosition,e.howMany);let n=null,o=[];i.containsRange(t,!0)?n=t:t.start.hasSameParentAs(i.start)?(o=t.getDifference(i),n=t.getIntersection(i)):o=[t];const r=[];for(let t of o){t=t._getTransformedByDeletion(e.sourcePosition,e.howMany);const i=e.getMovedRangeStart(),n=t.start.hasSameParentAs(i);t=t._getTransformedByInsertion(i,e.howMany,n),r.push(...t)}n&&r.push(n._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany,!1)[0]);return r}(t.range,e).map(e=>new Ia(e,t.key,t.oldValue,t.newValue,t.baseVersion))),Ed(Ia,za,(t,e)=>{if(t.range.end.isEqual(e.insertionPosition))return e.graveyardPosition||t.range.end.offset++,[t];if(t.range.start.hasSameParentAs(e.splitPosition)&&t.range.containsPosition(e.splitPosition)){const i=t.clone();return i.range=new xs(e.moveTargetPosition.clone(),t.range.end._getCombined(e.splitPosition,e.moveTargetPosition)),t.range.end=e.splitPosition.clone(),t.range.end.stickiness="toPrevious",[t,i]}return t.range=t.range._getTransformedBySplitOperation(e),[t]}),Ed(Va,Ia,(t,e)=>{const i=[t];if(t.shouldReceiveAttributes&&t.position.hasSameParentAs(e.range.start)&&e.range.containsPosition(t.position)){const n=Bd(t,e.key,e.newValue);n&&i.push(n)}return i}),Ed(Va,Va,(t,e,i)=>(t.position.isEqual(e.position)&&i.aIsStrong||(t.position=t.position._getTransformedByInsertOperation(e)),[t])),Ed(Va,Na,(t,e)=>(t.position=t.position._getTransformedByMoveOperation(e),[t])),Ed(Va,za,(t,e)=>(t.position=t.position._getTransformedBySplitOperation(e),[t])),Ed(Va,La,(t,e)=>(t.position=t.position._getTransformedByMergeOperation(e),[t])),Ed(Ba,Va,(t,e)=>(t.oldRange&&(t.oldRange=t.oldRange._getTransformedByInsertOperation(e)[0]),t.newRange&&(t.newRange=t.newRange._getTransformedByInsertOperation(e)[0]),[t])),Ed(Ba,Ba,(t,e,i)=>{if(t.name==e.name){if(!i.aIsStrong)return[new rc(0)];t.oldRange=e.newRange?e.newRange.clone():null}return[t]}),Ed(Ba,La,(t,e)=>(t.oldRange&&(t.oldRange=t.oldRange._getTransformedByMergeOperation(e)),t.newRange&&(t.newRange=t.newRange._getTransformedByMergeOperation(e)),[t])),Ed(Ba,Na,(t,e,i)=>{if(t.oldRange&&(t.oldRange=xs._createFromRanges(t.oldRange._getTransformedByMoveOperation(e))),t.newRange){if(i.abRelation){const n=xs._createFromRanges(t.newRange._getTransformedByMoveOperation(e));if("left"==i.abRelation.side&&e.targetPosition.isEqual(t.newRange.start))return t.newRange.start.path=i.abRelation.path,t.newRange.end=n.end,[t];if("right"==i.abRelation.side&&e.targetPosition.isEqual(t.newRange.end))return t.newRange.start=n.start,t.newRange.end.path=i.abRelation.path,[t]}t.newRange=xs._createFromRanges(t.newRange._getTransformedByMoveOperation(e))}return[t]}),Ed(Ba,za,(t,e,i)=>{if(t.oldRange&&(t.oldRange=t.oldRange._getTransformedBySplitOperation(e)),t.newRange){if(i.abRelation){const n=t.newRange._getTransformedBySplitOperation(e);return t.newRange.start.isEqual(e.splitPosition)&&i.abRelation.wasStartBeforeMergedElement?t.newRange.start=ks._createAt(e.insertionPosition):t.newRange.start.isEqual(e.splitPosition)&&!i.abRelation.wasInLeftElement&&(t.newRange.start=ks._createAt(e.moveTargetPosition)),t.newRange.end.isEqual(e.splitPosition)&&i.abRelation.wasInRightElement?t.newRange.end=ks._createAt(e.moveTargetPosition):t.newRange.end.isEqual(e.splitPosition)&&i.abRelation.wasEndBeforeMergedElement?t.newRange.end=ks._createAt(e.insertionPosition):t.newRange.end=n.end,[t]}t.newRange=t.newRange._getTransformedBySplitOperation(e)}return[t]}),Ed(La,Va,(t,e)=>(t.sourcePosition.hasSameParentAs(e.position)&&(t.howMany+=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByInsertOperation(e),t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e),[t])),Ed(La,La,(t,e,i)=>{if(t.sourcePosition.isEqual(e.sourcePosition)&&t.targetPosition.isEqual(e.targetPosition)){if(i.bWasUndone){const i=e.graveyardPosition.path.slice();return i.push(0),t.sourcePosition=new ks(e.graveyardPosition.root,i),t.howMany=0,[t]}return[new rc(0)]}if(t.sourcePosition.isEqual(e.sourcePosition)&&!t.targetPosition.isEqual(e.targetPosition)&&!i.bWasUndone&&"splitAtSource"!=i.abRelation){const n="$graveyard"==t.targetPosition.root.rootName,o="$graveyard"==e.targetPosition.root.rootName,r=n&&!o;if(o&&!n||!r&&i.aIsStrong){const i=e.targetPosition._getTransformedByMergeOperation(e),n=t.targetPosition._getTransformedByMergeOperation(e);return[new Na(i,t.howMany,n,0)]}return[new rc(0)]}return t.sourcePosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByMergeOperation(e),t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),t.graveyardPosition.isEqual(e.graveyardPosition)&&i.aIsStrong||(t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)),[t]}),Ed(La,Na,(t,e,i)=>{const n=xs._createFromPositionAndShift(e.sourcePosition,e.howMany);return"remove"==e.type&&!i.bWasUndone&&!i.forceWeakRemove&&t.deletionPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(t.sourcePosition)?[new rc(0)]:(t.sourcePosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.sourcePosition.hasSameParentAs(e.sourcePosition)&&(t.howMany-=e.howMany),t.sourcePosition=t.sourcePosition._getTransformedByMoveOperation(e),t.targetPosition=t.targetPosition._getTransformedByMoveOperation(e),t.graveyardPosition.isEqual(e.targetPosition)||(t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e)),[t])}),Ed(La,za,(t,e,i)=>{if(e.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedByDeletion(e.graveyardPosition,1),t.deletionPosition.isEqual(e.graveyardPosition)&&(t.howMany=e.howMany)),t.targetPosition.isEqual(e.splitPosition)){const n=0!=e.howMany,o=e.graveyardPosition&&t.deletionPosition.isEqual(e.graveyardPosition);if(n||o||"mergeTargetNotMoved"==i.abRelation)return t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e),[t]}if(t.sourcePosition.isEqual(e.splitPosition)){if("mergeSourceNotMoved"==i.abRelation)return t.howMany=0,t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t];if("mergeSameElement"==i.abRelation||t.sourcePosition.offset>0)return t.sourcePosition=e.moveTargetPosition.clone(),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t]}return t.sourcePosition.hasSameParentAs(e.splitPosition)&&(t.howMany=e.splitPosition.offset),t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t]}),Ed(Na,Va,(t,e)=>{const i=xs._createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByInsertOperation(e,!1)[0];return t.sourcePosition=i.start,t.howMany=i.end.offset-i.start.offset,t.targetPosition.isEqual(e.position)||(t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e)),[t]}),Ed(Na,Na,(t,e,i)=>{const n=xs._createFromPositionAndShift(t.sourcePosition,t.howMany),o=xs._createFromPositionAndShift(e.sourcePosition,e.howMany);let r,s=i.aIsStrong,a=!i.aIsStrong;if("insertBefore"==i.abRelation||"insertAfter"==i.baRelation?a=!0:"insertAfter"!=i.abRelation&&"insertBefore"!=i.baRelation||(a=!1),r=t.targetPosition.isEqual(e.targetPosition)&&a?t.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany):t.targetPosition._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Fd(t,e)&&Fd(e,t))return[e.getReversed()];if(n.containsPosition(e.targetPosition)&&n.containsRange(o,!0))return n.start=n.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),n.end=n.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Dd([n],r);if(o.containsPosition(t.targetPosition)&&o.containsRange(n,!0))return n.start=n.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),n.end=n.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),Dd([n],r);const c=Oi(t.sourcePosition.getParentPath(),e.sourcePosition.getParentPath());if("prefix"==c||"extension"==c)return n.start=n.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),n.end=n.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Dd([n],r);"remove"!=t.type||"remove"==e.type||i.aWasUndone||i.forceWeakRemove?"remove"==t.type||"remove"!=e.type||i.bWasUndone||i.forceWeakRemove||(s=!1):s=!0;const l=[],d=n.getDifference(o);for(const t of d){t.start=t.start._getTransformedByDeletion(e.sourcePosition,e.howMany),t.end=t.end._getTransformedByDeletion(e.sourcePosition,e.howMany);const i="same"==Oi(t.start.getParentPath(),e.getMovedRangeStart().getParentPath()),n=t._getTransformedByInsertion(e.getMovedRangeStart(),e.howMany,i);l.push(...n)}const h=n.getIntersection(o);return null!==h&&s&&(h.start=h.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),h.end=h.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),0===l.length?l.push(h):1==l.length?o.start.isBefore(n.start)||o.start.isEqual(n.start)?l.unshift(h):l.push(h):l.splice(1,0,h)),0===l.length?[new rc(t.baseVersion)]:Dd(l,r)}),Ed(Na,za,(t,e,i)=>{let n=t.targetPosition.clone();t.targetPosition.isEqual(e.insertionPosition)&&e.graveyardPosition&&"moveTargetAfter"!=i.abRelation||(n=t.targetPosition._getTransformedBySplitOperation(e));const o=xs._createFromPositionAndShift(t.sourcePosition,t.howMany);if(o.end.isEqual(e.insertionPosition))return e.graveyardPosition||t.howMany++,t.targetPosition=n,[t];if(o.start.hasSameParentAs(e.splitPosition)&&o.containsPosition(e.splitPosition)){let t=new xs(e.splitPosition,o.end);return t=t._getTransformedBySplitOperation(e),Dd([new xs(o.start,e.splitPosition),t],n)}t.targetPosition.isEqual(e.splitPosition)&&"insertAtSource"==i.abRelation&&(n=e.moveTargetPosition),t.targetPosition.isEqual(e.insertionPosition)&&"insertBetween"==i.abRelation&&(n=t.targetPosition);const r=[o._getTransformedBySplitOperation(e)];if(e.graveyardPosition){const n=o.start.isEqual(e.graveyardPosition)||o.containsPosition(e.graveyardPosition);t.howMany>1&&n&&!i.aWasUndone&&r.push(xs._createFromPositionAndShift(e.insertionPosition,1))}return Dd(r,n)}),Ed(Na,La,(t,e,i)=>{const n=xs._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.deletionPosition.hasSameParentAs(t.sourcePosition)&&n.containsPosition(e.sourcePosition))if("remove"!=t.type||i.forceWeakRemove){if(1==t.howMany)return i.bWasUndone?(t.sourcePosition=e.graveyardPosition.clone(),t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t]):[new rc(0)]}else if(!i.aWasUndone){const i=[];let n=e.graveyardPosition.clone(),o=e.targetPosition._getTransformedByMergeOperation(e);t.howMany>1&&(i.push(new Na(t.sourcePosition,t.howMany-1,t.targetPosition,0)),n=n._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany-1),o=o._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany-1));const r=e.deletionPosition._getCombined(t.sourcePosition,t.targetPosition),s=new Na(n,1,r,0),a=s.getMovedRangeStart().path.slice();a.push(0);const c=new ks(s.targetPosition.root,a);o=o._getTransformedByMove(n,r,1);const l=new Na(o,e.howMany,c,0);return i.push(s),i.push(l),i}const o=xs._createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByMergeOperation(e);return t.sourcePosition=o.start,t.howMany=o.end.offset-o.start.offset,t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t]}),Ed(Fa,Va,(t,e)=>(t.position=t.position._getTransformedByInsertOperation(e),[t])),Ed(Fa,La,(t,e)=>t.position.isEqual(e.deletionPosition)?(t.position=e.graveyardPosition.clone(),t.position.stickiness="toNext",[t]):(t.position=t.position._getTransformedByMergeOperation(e),[t])),Ed(Fa,Na,(t,e)=>(t.position=t.position._getTransformedByMoveOperation(e),[t])),Ed(Fa,Fa,(t,e,i)=>{if(t.position.isEqual(e.position)){if(!i.aIsStrong)return[new rc(0)];t.oldName=e.newName}return[t]}),Ed(Fa,za,(t,e)=>{if("same"==Oi(t.position.path,e.splitPosition.getParentPath())&&!e.graveyardPosition){const e=new Fa(t.position.getShiftedBy(1),t.oldName,t.newName,0);return[t,e]}return t.position=t.position._getTransformedBySplitOperation(e),[t]}),Ed(Da,Da,(t,e,i)=>{if(t.root===e.root&&t.key===e.key){if(!i.aIsStrong||t.newValue===e.newValue)return[new rc(0)];t.oldValue=e.newValue}return[t]}),Ed(za,Va,(t,e)=>(t.splitPosition.hasSameParentAs(e.position)&&t.splitPosition.offset{if(!t.graveyardPosition&&!i.bWasUndone&&t.splitPosition.hasSameParentAs(e.sourcePosition)){const i=e.graveyardPosition.path.slice();i.push(0);const n=new ks(e.graveyardPosition.root,i),o=za.getInsertionPosition(new ks(e.graveyardPosition.root,i)),r=new za(n,0,null,0);return r.insertionPosition=o,t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e),t.insertionPosition=za.getInsertionPosition(t.splitPosition),t.graveyardPosition=r.insertionPosition.clone(),t.graveyardPosition.stickiness="toNext",[r,t]}return t.splitPosition.hasSameParentAs(e.deletionPosition)&&!t.splitPosition.isAfter(e.deletionPosition)&&t.howMany--,t.splitPosition.hasSameParentAs(e.targetPosition)&&(t.howMany+=e.howMany),t.splitPosition=t.splitPosition._getTransformedByMergeOperation(e),t.insertionPosition=za.getInsertionPosition(t.splitPosition),t.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedByMergeOperation(e)),[t]}),Ed(za,Na,(t,e,i)=>{const n=xs._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.graveyardPosition){const o=n.start.isEqual(t.graveyardPosition)||n.containsPosition(t.graveyardPosition);if(!i.bWasUndone&&o){const i=t.splitPosition._getTransformedByMoveOperation(e),n=t.graveyardPosition._getTransformedByMoveOperation(e),o=n.path.slice();o.push(0);const r=new ks(n.root,o);return[new Na(i,t.howMany,r,0)]}t.graveyardPosition=t.graveyardPosition._getTransformedByMoveOperation(e)}if(t.splitPosition.hasSameParentAs(e.sourcePosition)&&n.containsPosition(t.splitPosition)){const i=e.howMany-(t.splitPosition.offset-e.sourcePosition.offset);return t.howMany-=i,t.splitPosition.hasSameParentAs(e.targetPosition)&&t.splitPosition.offset{if(t.splitPosition.isEqual(e.splitPosition)){if(!t.graveyardPosition&&!e.graveyardPosition)return[new rc(0)];if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition))return[new rc(0)];if("splitBefore"==i.abRelation)return t.howMany=0,t.graveyardPosition=t.graveyardPosition._getTransformedBySplitOperation(e),[t]}if(t.graveyardPosition&&e.graveyardPosition&&t.graveyardPosition.isEqual(e.graveyardPosition)){const n="$graveyard"==t.splitPosition.root.rootName,o="$graveyard"==e.splitPosition.root.rootName,r=n&&!o;if(o&&!n||!r&&i.aIsStrong){const i=[];return e.howMany&&i.push(new Na(e.moveTargetPosition,e.howMany,e.splitPosition,0)),t.howMany&&i.push(new Na(t.splitPosition,t.howMany,t.moveTargetPosition,0)),i}return[new rc(0)]}if(t.graveyardPosition&&(t.graveyardPosition=t.graveyardPosition._getTransformedBySplitOperation(e)),t.splitPosition.isEqual(e.insertionPosition)&&"splitBefore"==i.abRelation)return t.howMany++,[t];if(e.splitPosition.isEqual(t.insertionPosition)&&"splitBefore"==i.baRelation){const i=e.insertionPosition.path.slice();i.push(0);const n=new ks(e.insertionPosition.root,i);return[t,new Na(t.insertionPosition,1,n,0)]}return t.splitPosition.hasSameParentAs(e.splitPosition)&&t.splitPosition.offset0}addBatch(t){const e=this.editor.model.document.selection,i={ranges:e.hasOwnRange?Array.from(e.getRanges()):[],isBackward:e.isBackward};this._stack.push({batch:t,selection:i}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(t,e,i){const n=this.editor.model,o=n.document,r=[];for(const e of t){const t=zd(e,i).find(t=>t.start.root!=o.graveyard);t&&r.push(t)}r.length&&n.change(t=>{t.setSelection(r,{backward:e})})}_undo(t,e){const i=this.editor.model,n=i.document;this._createdBatches.add(e);const o=t.operations.slice().filter(t=>t.isDocumentOperation);o.reverse();for(const t of o){const o=t.baseVersion+1,r=Array.from(n.history.getOperations(o)),s=Id([t.getReversed()],r,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(const o of s)e.addOperation(o),i.applyOperation(o),n.history.setOperationAsUndone(t,o)}}}function zd(t,e){const i=t.getTransformedByOperations(e);i.sort((t,e)=>t.start.isBefore(e.start)?-1:1);for(let t=1;te.batch==t):this._stack.length-1,i=this._stack.splice(e,1)[0],n=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(n,()=>{this._undo(i.batch,n);const t=this.editor.model.document.history.getOperations(i.batch.baseVersion);this._restoreSelection(i.selection.ranges,i.selection.isBackward,t),this.fire("revert",i.batch,n)}),this.refresh()}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class qd extends Ld{execute(){const t=this._stack.pop(),e=this.editor.model.createBatch("transparent");this.editor.model.enqueueChange(e,()=>{const i=t.batch.operations[t.batch.operations.length-1].baseVersion+1,n=this.editor.model.document.history.getOperations(i);this._restoreSelection(t.selection.ranges,t.selection.isBackward,n),this._undo(t.batch,e)}),this.refresh()}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Wd extends $l{static get pluginName(){return"UndoEditing"}constructor(t){super(t),this._batchRegistry=new WeakSet}init(){const t=this.editor;this._undoCommand=new jd(t),this._redoCommand=new qd(t),t.commands.add("undo",this._undoCommand),t.commands.add("redo",this._redoCommand),this.listenTo(t.model,"applyOperation",(t,e)=>{const i=e[0];if(!i.isDocumentOperation)return;const n=i.batch,o=this._redoCommand._createdBatches.has(n),r=this._undoCommand._createdBatches.has(n);this._batchRegistry.has(n)||"transparent"==n.type&&!o&&!r||(o?this._undoCommand.addBatch(n):r||(this._undoCommand.addBatch(n),this._redoCommand.clearStack()),this._batchRegistry.add(n))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(t,e,i)=>{this._redoCommand.addBatch(i)}),t.keystrokes.set("CTRL+Z","undo"),t.keystrokes.set("CTRL+Y","redo"),t.keystrokes.set("CTRL+SHIFT+Z","redo")}}var Hd='',Ud=''; -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class $d extends $l{init(){const t=this.editor,e=t.locale,i=t.t,n="ltr"==e.uiLanguageDirection?Hd:Ud,o="ltr"==e.uiLanguageDirection?Ud:Hd;this._addButton("undo",i("Undo"),"CTRL+Z",n),this._addButton("redo",i("Redo"),"CTRL+Y",o)}_addButton(t,e,i,n){const o=this.editor;o.ui.componentFactory.add(t,r=>{const s=o.commands.get(t),a=new Il(r);return a.set({label:e,icon:n,keystroke:i,tooltip:!0}),a.bind("isEnabled").to(s,"isEnabled"),this.listenTo(a,"execute",()=>{o.execute(t),o.editing.view.focus()}),a})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Gd extends $l{static get requires(){return[Wd,$d]}static get pluginName(){return"Undo"}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class Kd{constructor(t){this.context=t}destroy(){this.stopListening()}static get isContextPlugin(){return!0}}yi(Kd,qn); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class Jd extends Kd{static get pluginName(){return"PendingActions"}init(){this.set("hasAny",!1),this._actions=new xi({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(t){if("string"!=typeof t)throw new hi.b("pendingactions-add-invalid-message: The message must be a string.",this);const e=Object.create(qn);return e.set("message",t),this._actions.add(e),this.hasAny=!0,e}remove(t){this._actions.remove(t),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Qd{constructor(){const t=new window.FileReader;this._reader=t,this._data=void 0,this.set("loaded",0),t.onprogress=t=>{this.loaded=t.loaded}}get error(){return this._reader.error}get data(){return this._data}read(t){const e=this._reader;return this.total=t.size,new Promise((i,n)=>{e.onload=()=>{const t=e.result;this._data=t,i(t)},e.onerror=()=>{n("error")},e.onabort=()=>{n("aborted")},this._reader.readAsDataURL(t)})}abort(){this._reader.abort()}}yi(Qd,qn); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class Yd extends $l{static get pluginName(){return"FileRepository"}static get requires(){return[Jd]}init(){this.loaders=new xi,this.loaders.on("add",()=>this._updatePendingAction()),this.loaders.on("remove",()=>this._updatePendingAction()),this._loadersMap=new Map,this._pendingAction=null,this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(t,e)=>e?t/e*100:0)}getLoader(t){return this._loadersMap.get(t)||null}createLoader(t){if(!this.createUploadAdapter)return console.warn(Object(hi.a)("filerepository-no-upload-adapter: Upload adapter is not defined.")),null;const e=new Xd(Promise.resolve(t),this.createUploadAdapter);return this.loaders.add(e),this._loadersMap.set(t,e),t instanceof Promise&&e.file.then(t=>{this._loadersMap.set(t,e)}).catch(()=>{}),e.on("change:uploaded",()=>{let t=0;for(const e of this.loaders)t+=e.uploaded;this.uploaded=t}),e.on("change:uploadTotal",()=>{let t=0;for(const e of this.loaders)e.uploadTotal&&(t+=e.uploadTotal);this.uploadTotal=t}),e}destroyLoader(t){const e=t instanceof Xd?t:this.getLoader(t);e._destroy(),this.loaders.remove(e),this._loadersMap.forEach((t,i)=>{t===e&&this._loadersMap.delete(i)})}_updatePendingAction(){const t=this.editor.plugins.get(Jd);if(this.loaders.length){if(!this._pendingAction){const e=this.editor.t,i=t=>`${e("Upload in progress")} ${parseInt(t)}%.`;this._pendingAction=t.add(i(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",i)}}else t.remove(this._pendingAction),this._pendingAction=null}}yi(Yd,qn);class Xd{constructor(t,e){this.id=li(),this._filePromiseWrapper=this._createFilePromiseWrapper(t),this._adapter=e(this),this._reader=new Qd,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(t,e)=>e?t/e*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(t=>this._filePromiseWrapper?t:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if("idle"!=this.status)throw new hi.b("filerepository-read-wrong-status: You cannot call read if the status is different than idle.",this);return this.status="reading",this.file.then(t=>this._reader.read(t)).then(t=>{if("reading"!==this.status)throw this.status;return this.status="idle",t}).catch(t=>{if("aborted"===t)throw this.status="aborted","aborted";throw this.status="error",this._reader.error?this._reader.error:t})}upload(){if("idle"!=this.status)throw new hi.b("filerepository-upload-wrong-status: You cannot call upload if the status is different than idle.",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(t=>(this.uploadResponse=t,this.status="idle",t)).catch(t=>{if("aborted"===this.status)throw"aborted";throw this.status="error",t})}abort(){const t=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?"reading"==t?this._reader.abort():"uploading"==t&&this._adapter.abort&&this._adapter.abort():(this._filePromiseWrapper.promise.catch(()=>{}),this._filePromiseWrapper.rejecter("aborted")),this._destroy()}_destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.uploadResponse=void 0}_createFilePromiseWrapper(t){const e={};return e.promise=new Promise((i,n)=>{e.rejecter=n,e.isFulfilled=!1,t.then(t=>{e.isFulfilled=!0,i(t)}).catch(t=>{e.isFulfilled=!0,n(t)})}),e}}yi(Xd,qn);function Zd(){let t=function(t){t=t.toLowerCase();const e=document.cookie.split(";");for(const i of e){const e=i.split("=");if(decodeURIComponent(e[0].trim().toLowerCase())===t)return decodeURIComponent(e[1])}return null}("ckCsrfToken");var e,i;return t&&40==t.length||(t=function(t){let e="";const i=new Uint8Array(t);window.crypto.getRandomValues(i);for(let t=0;t.5?n.toUpperCase():n}return e} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(40),e="ckCsrfToken",i=t,document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(i)+";path=/"),t}class th{constructor(t,e,i){this.loader=t,this.url=e,this.t=i}upload(){return this.loader.file.then(t=>new Promise((e,i)=>{this._initRequest(),this._initListeners(e,i,t),this._sendRequest(t)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const t=this.xhr=new XMLHttpRequest;t.open("POST",this.url,!0),t.responseType="json"}_initListeners(t,e,i){const n=this.xhr,o=this.loader,r=(0,this.t)("Cannot upload file:")+` ${i.name}.`;n.addEventListener("error",()=>e(r)),n.addEventListener("abort",()=>e()),n.addEventListener("load",()=>{const i=n.response;if(!i||!i.uploaded)return e(i&&i.error&&i.error.message?i.error.message:r);t({default:i.url})}),n.upload&&n.upload.addEventListener("progress",t=>{t.lengthComputable&&(o.uploadTotal=t.total,o.uploaded=t.loaded)})}_sendRequest(t){const e=new FormData;e.append("upload",t),e.append("ckCsrfToken",Zd()),this.xhr.send(e)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class eh{static get pluginName(){return"BlockAutoformatEditing"}constructor(t,e,i){let n,o=null;"function"==typeof i?n=i:(o=t.commands.get(i),n=()=>{t.execute(i)}),t.model.document.on("change",(i,r)=>{if(o&&!o.isEnabled)return;if("transparent"==r.type)return;const s=Array.from(t.model.document.differ.getChanges()),a=s[0];if(1!=s.length||"insert"!==a.type||"$text"!=a.name||1!=a.length)return;const c=a.position.parent;if(!c.is("paragraph")||1!==c.childCount)return;const l=e.exec(c.getChild(0).data);l&&t.model.enqueueChange(t=>{const e=t.createPositionAt(c,0),i=t.createPositionAt(c,l[0].length),o=new Ns(e,i);!1!==n({match:l})&&t.remove(o),o.detach()})})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class ih{static get pluginName(){return"InlineAutoformatEditing"}constructor(t,e,i){let n,o,r,s;e instanceof RegExp?n=e:r=e,"string"==typeof i?o=i:s=i,r=r||(t=>{let e;const i=[],o=[];for(;null!==(e=n.exec(t))&&!(e&&e.length<4);){let{index:t,1:n,2:r,3:s}=e;const a=n+r+s;t+=e[0].length-a.length;const c=[t,t+n.length],l=[t+n.length+r.length,t+n.length+r.length+s.length];i.push(c),i.push(l),o.push([t+n.length,t+n.length+r.length])}return{remove:i,format:o}}),s=s||((e,i)=>{const n=t.model.schema.getValidRanges(i,o);for(const t of n)e.setAttribute(o,!0,t);e.removeSelectionAttribute(o)}),t.model.document.on("change",(e,i)=>{if("transparent"==i.type)return;const n=t.model,o=n.document.selection;if(!o.isCollapsed)return;const a=Array.from(n.document.differ.getChanges()),c=a[0];if(1!=a.length||"insert"!==c.type||"$text"!=c.name||1!=c.length)return;const l=o.focus,d=l.parent,{text:h,range:u}=function(t,e){let i=t.start;return{text:Array.from(t.getItems()).reduce((t,n)=>n.is("text")||n.is("textProxy")?t+n.data:(i=e.createPositionAfter(n),""),""),range:e.createRange(i,t.end)}}(n.createRange(n.createPositionAt(d,0),l),n),f=r(h),g=nh(u.start,f.format,n),m=nh(u.start,f.remove,n);g.length&&m.length&&n.enqueueChange(t=>{if(!1!==s(t,g))for(const e of m.reverse())t.remove(e)})})}}function nh(t,e,i){return e.filter(t=>void 0!==t[0]&&void 0!==t[1]).map(e=>i.createRange(t.getShiftedBy(e[0]),t.getShiftedBy(e[1])))} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function oh(t,e){return(i,n)=>{if(!t.commands.get(e).isEnabled)return!1;const o=t.model.schema.getValidRanges(n,e);for(const t of o)i.setAttribute(e,!0,t);i.removeSelectionAttribute(e)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class rh extends Xl{constructor(t,e){super(t),this.attributeKey=e}refresh(){const t=this.editor.model,e=t.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey)}execute(t={}){const e=this.editor.model,i=e.document.selection,n=void 0===t.forceValue?!this.value:t.forceValue;e.change(t=>{if(i.isCollapsed)n?t.setSelectionAttribute(this.attributeKey,!0):t.removeSelectionAttribute(this.attributeKey);else{const o=e.schema.getValidRanges(i.getRanges(),this.attributeKey);for(const e of o)n?t.setAttribute(this.attributeKey,n,e):t.removeAttribute(this.attributeKey,e)}})}_getValueFromFirstAllowedNode(){const t=this.editor.model,e=t.schema,i=t.document.selection;if(i.isCollapsed)return i.hasAttribute(this.attributeKey);for(const t of i.getRanges())for(const i of t.getItems())if(e.checkAttribute(i,this.attributeKey))return i.hasAttribute(this.attributeKey);return!1}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class sh extends $l{static get pluginName(){return"BoldEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"bold"}),t.model.schema.setAttributeProperties("bold",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"bold",view:"strong",upcastAlso:["b",t=>{const e=t.getStyle("font-weight");return e?"bold"==e||Number(e)>=600?{name:!0,styles:["font-weight"]}:void 0:null}]}),t.commands.add("bold",new rh(t,"bold")),t.keystrokes.set("CTRL+B","bold")}}class ah extends $l{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("bold",i=>{const n=t.commands.get("bold"),o=new Il(i);return o.set({label:e("Bold"),icon:'',keystroke:"CTRL+B",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("bold"),t.editing.view.focus()}),o})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class ch extends $l{static get pluginName(){return"ItalicEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"italic"}),t.model.schema.setAttributeProperties("italic",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"italic",view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),t.commands.add("italic",new rh(t,"italic")),t.keystrokes.set("CTRL+I","italic")}}class lh extends $l{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("italic",i=>{const n=t.commands.get("italic"),o=new Il(i);return o.set({label:e("Italic"),icon:'',keystroke:"CTRL+I",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("italic"),t.editing.view.focus()}),o})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class dh extends $l{static get pluginName(){return"UnderlineEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"underline"}),t.model.schema.setAttributeProperties("underline",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"underline",view:"u",upcastAlso:{styles:{"text-decoration":"underline"}}}),t.commands.add("underline",new rh(t,"underline")),t.keystrokes.set("CTRL+U","underline")}}class hh extends $l{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("underline",i=>{const n=t.commands.get("underline"),o=new Il(i);return o.set({label:e("Underline"),icon:'',keystroke:"CTRL+U",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("underline"),t.editing.view.focus()}),o})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class uh extends $l{static get pluginName(){return"StrikethroughEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"strikethrough"}),t.model.schema.setAttributeProperties("strikethrough",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"strikethrough",view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),t.commands.add("strikethrough",new rh(t,"strikethrough")),t.keystrokes.set("CTRL+SHIFT+X","strikethrough")}}class fh extends $l{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("strikethrough",i=>{const n=t.commands.get("strikethrough"),o=new Il(i);return o.set({label:e("Strikethrough"),icon:'',keystroke:"CTRL+SHIFT+X",tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("strikethrough"),t.editing.view.focus()}),o})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class gh extends $l{static get pluginName(){return"CodeEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"code"}),t.model.schema.setAttributeProperties("code",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"code",view:"code",upcastAlso:{styles:{"word-wrap":"break-word"}}}),t.commands.add("code",new rh(t,"code"))}}i(11);class mh extends $l{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("code",i=>{const n=t.commands.get("code"),o=new Il(i);return o.set({label:e("Code"),icon:'',tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("code"),t.editing.view.focus()}),o})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class ph extends $l{static get pluginName(){return"SubscriptEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"subscript"}),t.model.schema.setAttributeProperties("subscript",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"subscript",view:"sub",upcastAlso:[{styles:{"vertical-align":"sub"}}]}),t.commands.add("subscript",new rh(t,"subscript"))}}class bh extends $l{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("subscript",i=>{const n=t.commands.get("subscript"),o=new Il(i);return o.set({label:e("Subscript"),icon:'',tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("subscript"),t.editing.view.focus()}),o})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class wh extends $l{static get pluginName(){return"SuperscriptEditing"}init(){const t=this.editor;t.model.schema.extend("$text",{allowAttributes:"superscript"}),t.model.schema.setAttributeProperties("superscript",{isFormatting:!0,copyOnEnter:!0}),t.conversion.attributeToElement({model:"superscript",view:"sup",upcastAlso:[{styles:{"vertical-align":"super"}}]}),t.commands.add("superscript",new rh(t,"superscript"))}}class kh extends $l{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("superscript",i=>{const n=t.commands.get("superscript"),o=new Il(i);return o.set({label:e("Superscript"),icon:'',tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("superscript"),t.editing.view.focus()}),o})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class _h extends Xl{constructor(t){super(t),this._childCommands=[]}refresh(){}execute(...t){this._getFirstEnabledCommand().execute(t)}registerChildCommand(t){this._childCommands.push(t),t.on("change:isEnabled",()=>this._checkEnabled()),this._checkEnabled()}_checkEnabled(){this.isEnabled=!!this._getFirstEnabledCommand()}_getFirstEnabledCommand(){return this._childCommands.find(t=>t.isEnabled)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class vh extends $l{static get pluginName(){return"IndentEditing"}init(){const t=this.editor;t.commands.add("indent",new _h(t)),t.commands.add("outdent",new _h(t))}}var yh='',xh=''; -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class Ah extends $l{static get pluginName(){return"IndentUI"}init(){const t=this.editor,e=t.locale,i=t.t,n="ltr"==e.uiLanguageDirection?yh:xh,o="ltr"==e.uiLanguageDirection?xh:yh;this._defineButton("indent",i("Increase indent"),n),this._defineButton("outdent",i("Decrease indent"),o)}_defineButton(t,e,i){const n=this.editor;n.ui.componentFactory.add(t,o=>{const r=n.commands.get(t),s=new Il(o);return s.set({label:e,icon:i,tooltip:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),this.listenTo(s,"execute",()=>{n.execute(t),n.editing.view.focus()}),s})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -function Ph(t){const e=t.next();return e.done?null:e.value} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Ch extends Xl{constructor(t,e){super(t),this._indentBehavior=e}refresh(){const t=this.editor.model,e=Ph(t.document.selection.getSelectedBlocks());e&&t.schema.checkAttribute(e,"blockIndent")?this.isEnabled=this._indentBehavior.checkEnabled(e.getAttribute("blockIndent")):this.isEnabled=!1}execute(){const t=this.editor.model,e=function(t){const e=t.document.selection,i=t.schema;return Array.from(e.getSelectedBlocks()).filter(t=>i.checkAttribute(t,"blockIndent"))} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(t);t.change(t=>{for(const i of e){const e=i.getAttribute("blockIndent"),n=this._indentBehavior.getNextIndent(e);n?t.setAttribute("blockIndent",n,i):t.removeAttribute("blockIndent",i)}})}}class Th{constructor(t){this.isForward="forward"===t.direction,this.offset=t.offset,this.unit=t.unit}checkEnabled(t){const e=parseFloat(t||0);return this.isForward||e>0}getNextIndent(t){const e=parseFloat(t||0);if(!(!t||t.endsWith(this.unit)))return this.isForward?this.offset+this.unit:void 0;const i=e+(this.isForward?this.offset:-this.offset);return i>0?i+this.unit:void 0}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Sh{constructor(t){this.isForward="forward"===t.direction,this.classes=t.classes}checkEnabled(t){const e=this.classes.indexOf(t);return this.isForward?e=0}getNextIndent(t){const e=this.classes.indexOf(t),i=this.isForward?1:-1;return this.classes[e+i]}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */new Set(["black","silver","gray","white","maroon","red","purple","fuchsia","green","lime","olive","yellow","navy","blue","teal","aqua","orange","aliceblue","antiquewhite","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","gainsboro","ghostwhite","gold","goldenrod","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","limegreen","linen","magenta","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","oldlace","olivedrab","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","thistle","tomato","turquoise","violet","wheat","whitesmoke","yellowgreen","rebeccapurple","currentcolor","transparent"]);function Eh(t=""){if(""===t)return{top:void 0,right:void 0,bottom:void 0,left:void 0};const e=t.replace(/, /g,",").split(" ").map(t=>t.replace(/,/g,", "));const i=e[0],n=e[2]||i,o=e[1]||i;return{top:i,bottom:n,right:o,left:e[3]||o}}function Oh({top:t,right:e,bottom:i,left:n}){const o=[];return n!==e?o.push(t,e,i,n):i!==t?o.push(t,e,i):e!==t?o.push(t,e):o.push(t),o.join(" ")} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -function Rh(t){var e,i;t.setNormalizer("margin",(e="margin",t=>({path:e,value:Eh(t)}))),t.setNormalizer("margin-top",t=>({path:"margin.top",value:t})),t.setNormalizer("margin-right",t=>({path:"margin.right",value:t})),t.setNormalizer("margin-bottom",t=>({path:"margin.bottom",value:t})),t.setNormalizer("margin-left",t=>({path:"margin.left",value:t})),t.setReducer("margin",(i="margin",t=>{const{top:e,right:n,bottom:o,left:r}=t,s=[];return[e,n,r,o].every(t=>!!t)?s.push([i,Oh(t)]):(e&&s.push([i+"-top",e]),n&&s.push([i+"-right",n]),o&&s.push([i+"-bottom",o]),r&&s.push([i+"-left",r])),s})),t.setStyleRelation("margin",["margin-top","margin-right","margin-bottom","margin-left"])} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class Ih{constructor(){this._stack=[]}add(t,e){const i=this._stack,n=i[0];this._insertDescriptor(t);const o=i[0];n===o||Mh(n,o)||this.fire("change:top",{oldDescriptor:n,newDescriptor:o,writer:e})}remove(t,e){const i=this._stack,n=i[0];this._removeDescriptor(t);const o=i[0];n===o||Mh(n,o)||this.fire("change:top",{oldDescriptor:n,newDescriptor:o,writer:e})}_insertDescriptor(t){const e=this._stack,i=e.findIndex(e=>e.id===t.id);if(Mh(t,e[i]))return;i>-1&&e.splice(i,1);let n=0;for(;e[n]&&Nh(e[n],t);)n++;e.splice(n,0,t)}_removeDescriptor(t){const e=this._stack,i=e.findIndex(e=>e.id===t);i>-1&&e.splice(i,1)}}function Mh(t,e){return t&&e&&t.priority==e.priority&&Vh(t.classes)==Vh(e.classes)}function Nh(t,e){return t.priority>e.priority||!(t.priorityVh(e.classes)}function Vh(t){return Array.isArray(t)?t.sort().join(","):t}yi(Ih,gi);function Bh(t){return!!t.is("element")&&!!t.getCustomProperty("widget")}function Fh(t,e,i={}){return e.setAttribute("contenteditable","false",t),e.addClass("ck-widget",t),e.setCustomProperty("widget",!0,t),t.getFillerOffset=zh,i.label&&function(t,e,i){i.setCustomProperty("widgetLabel",e,t)}(t,i.label,e),i.hasSelectionHandle&&function(t,e){const i=e.createUIElement("div",{class:"ck ck-widget__selection-handle"},(function(t){const e=this.toDomElement(t),i=new Ol;return i.set("content",''),i.render(),e.appendChild(i.element),e}));e.insert(e.createPositionAt(t,0),i),e.addClass(["ck-widget_with-selection-handle"],t)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(t,e),function(t,e,i,n){const o=new Ih;o.on("change:top",(e,o)=>{o.oldDescriptor&&n(t,o.oldDescriptor,o.writer),o.newDescriptor&&i(t,o.newDescriptor,o.writer)}),e.setCustomProperty("addHighlight",(t,e,i)=>o.add(e,i),t),e.setCustomProperty("removeHighlight",(t,e,i)=>o.remove(e,i),t)}(t,e,(t,e,i)=>i.addClass(n(e.classes),t),(t,e,i)=>i.removeClass(n(e.classes),t)),t;function n(t){return Array.isArray(t)?t:[t]}}function Dh(t){const e=t.getCustomProperty("widgetLabel");return e?"function"==typeof e?e():e:""}function Lh(t,e){const i=t.getSelectedElement();if(i&&e.schema.isBlock(i))return e.createPositionAfter(i);const n=t.getSelectedBlocks().next().value;if(n){if(n.isEmpty)return e.createPositionAt(n,0);const i=e.createPositionAfter(n);return t.focus.isTouching(i)?i:e.createPositionBefore(n)}return t.focus}function zh(){return null}class jh extends Xl{refresh(){this.isEnabled=function(t){const e=t.schema,i=t.document.selection;return function(t,e,i){const n=function(t,e){const i=Lh(t,e).parent;if(i.isEmpty&&!i.is("$root"))return i.parent;return i}(t,i);return e.checkChild(n,"horizontalLine")}(i,e,t)&&!function(t,e){const i=t.getSelectedElement();return i&&e.isObject(i)}(i,e)}(this.editor.model)}execute(){const t=this.editor.model;t.change(e=>{const i=e.createElement("horizontalLine");t.insertContent(i);let n=i.nextSibling;!(n&&t.schema.checkChild(n,"$text"))&&t.schema.checkChild(i.parent,"paragraph")&&(n=e.createElement("paragraph"),t.insertContent(n,e.createPositionAfter(i))),n&&e.setSelection(n,0)})}}i(45); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class qh extends $l{static get pluginName(){return"HorizontalLineEditing"}init(){const t=this.editor,e=t.model.schema,i=t.t,n=t.conversion;e.register("horizontalLine",{isObject:!0,allowWhere:"$block"}),n.for("dataDowncast").elementToElement({model:"horizontalLine",view:(t,e)=>e.createEmptyElement("hr")}),n.for("editingDowncast").elementToElement({model:"horizontalLine",view:(t,e)=>{const n=i("Horizontal line"),o=e.createContainerElement("div"),r=e.createEmptyElement("hr");return e.addClass("ck-horizontal-line",o),e.setCustomProperty("hr",!0,o),e.insert(e.createPositionAt(o,0),r),function(t,e,i){return e.setCustomProperty("horizontalLine",!0,t),Fh(t,e,{label:i})}(o,e,n)}}),n.for("upcast").elementToElement({view:"hr",model:"horizontalLine"}),t.commands.add("horizontalLine",new jh(t))}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class Wh extends $l{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("horizontalLine",i=>{const n=t.commands.get("horizontalLine"),o=new Il(i);return o.set({label:e("Horizontal line"),icon:'',tooltip:!0}),o.bind("isEnabled").to(n,"isEnabled"),this.listenTo(o,"execute",()=>{t.execute("horizontalLine"),t.editing.view.focus()}),o})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class Hh extends Xl{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(t={}){const e=this.editor.model,i=e.schema,n=e.document.selection,o=Array.from(n.getSelectedBlocks()),r=void 0===t.forceValue?!this.value:t.forceValue;e.change(t=>{if(r){const e=o.filter(t=>Uh(t)||Gh(i,t));this._applyQuote(t,e)}else this._removeQuote(t,o.filter(Uh))})}_getValue(){const t=Ph(this.editor.model.document.selection.getSelectedBlocks());return!(!t||!Uh(t))}_checkEnabled(){if(this.value)return!0;const t=this.editor.model.document.selection,e=this.editor.model.schema,i=Ph(t.getSelectedBlocks());return!!i&&Gh(e,i)}_removeQuote(t,e){$h(t,e).reverse().forEach(e=>{if(e.start.isAtStart&&e.end.isAtEnd)return void t.unwrap(e.start.parent);if(e.start.isAtStart){const i=t.createPositionBefore(e.start.parent);return void t.move(e,i)}e.end.isAtEnd||t.split(e.end);const i=t.createPositionAfter(e.end.parent);t.move(e,i)})}_applyQuote(t,e){const i=[];$h(t,e).reverse().forEach(e=>{let n=Uh(e.start);n||(n=t.createElement("blockQuote"),t.wrap(e,n)),i.push(n)}),i.reverse().reduce((e,i)=>e.nextSibling==i?(t.merge(t.createPositionAfter(e)),e):i)}}function Uh(t){return"blockQuote"==t.parent.name?t.parent:null}function $h(t,e){let i,n=0;const o=[];for(;n{if(t.endsWith("blockQuote")&&"blockQuote"==e.name)return!1}),t.conversion.elementToElement({model:"blockQuote",view:"blockquote"}),t.model.document.registerPostFixer(i=>{const n=t.model.document.differ.getChanges();for(const t of n)if("insert"==t.type){const n=t.position.nodeAfter;if(!n)continue;if(n.is("blockQuote")&&n.isEmpty)return i.remove(n),!0;if(n.is("blockQuote")&&!e.checkChild(t.position,n))return i.unwrap(n),!0;if(n.is("element")){const t=i.createRangeIn(n);for(const n of t.getItems())if(n.is("blockQuote")&&!e.checkChild(i.createPositionBefore(n),n))return i.unwrap(n),!0}}else if("remove"==t.type){const e=t.position.parent;if(e.is("blockQuote")&&e.isEmpty)return i.remove(e),!0}return!1})}afterInit(){const t=this.editor.commands.get("blockQuote");this.listenTo(this.editor.editing.view.document,"enter",(e,i)=>{const n=this.editor.model.document,o=n.selection.getLastPosition().parent;n.selection.isCollapsed&&o.isEmpty&&t.value&&(this.editor.execute("blockQuote"),this.editor.editing.view.scrollToTheSelection(),i.preventDefault(),e.stop())})}}i(47); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class Jh extends $l{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("blockQuote",i=>{const n=t.commands.get("blockQuote"),o=new Il(i);return o.set({label:e("Block quote"),icon:'',tooltip:!0,isToggleable:!0}),o.bind("isOn","isEnabled").to(n,"value","isEnabled"),this.listenTo(o,"execute",()=>{t.execute("blockQuote"),t.editing.view.focus()}),o})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class Qh extends Xl{refresh(){const t=this.editor.model,e=Ph(t.document.selection.getSelectedBlocks());this.value=!!e&&e.is("paragraph"),this.isEnabled=!!e&&Yh(e,t.schema)}execute(t={}){const e=this.editor.model,i=e.document;e.change(n=>{const o=(t.selection||i.selection).getSelectedBlocks();for(const t of o)!t.is("paragraph")&&Yh(t,e.schema)&&n.rename(t,"paragraph")})}}function Yh(t,e){return e.checkChild(t.parent,"paragraph")&&!e.isObject(t)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Xh extends $l{static get pluginName(){return"Paragraph"}init(){const t=this.editor,e=t.model,i=t.data;t.commands.add("paragraph",new Qh(t)),e.schema.register("paragraph",{inheritAllFrom:"$block"}),t.conversion.elementToElement({model:"paragraph",view:"p"}),t.conversion.for("upcast").elementToElement({model:(t,e)=>Xh.paragraphLikeElements.has(t.name)?t.isEmpty?null:e.createElement("paragraph"):null,converterPriority:"low"}),i.upcastDispatcher.on("element",(t,e,i)=>{i.consumable.test(e.viewItem,{name:e.viewItem.name})&&tu(e.viewItem,e.modelCursor,i.schema)&&Object.assign(e,Zh(e.viewItem,e.modelCursor,i))},{priority:"low"}),i.upcastDispatcher.on("text",(t,e,i)=>{e.modelRange||tu(e.viewItem,e.modelCursor,i.schema)&&Object.assign(e,Zh(e.viewItem,e.modelCursor,i))},{priority:"lowest"}),e.document.registerPostFixer(t=>this._autoparagraphEmptyRoots(t)),t.data.on("ready",()=>{e.enqueueChange("transparent",t=>this._autoparagraphEmptyRoots(t))},{priority:"lowest"})}_autoparagraphEmptyRoots(t){const e=this.editor.model;for(const i of e.document.getRootNames()){const n=e.document.getRoot(i);if(n.isEmpty&&"$graveyard"!=n.rootName&&e.schema.checkChild(n,"paragraph"))return t.insertElement("paragraph",n),!0}}}function Zh(t,e,i){const n=i.writer.createElement("paragraph");return i.writer.insert(n,e),i.convertItem(t,i.writer.createPositionAt(n,0))}function tu(t,e,i){const n=i.createContext(e);return!!i.checkChild(n,"paragraph")&&!!i.checkChild(n.push("paragraph"),t)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */Xh.paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td"]);class eu extends Xl{constructor(t,e){super(t),this.modelElements=e}refresh(){const t=Ph(this.editor.model.document.selection.getSelectedBlocks());this.value=!!t&&this.modelElements.includes(t.name)&&t.name,this.isEnabled=!!t&&this.modelElements.some(e=>iu(t,e,this.editor.model.schema))}execute(t){const e=this.editor.model,i=e.document,n=t.value;e.change(t=>{const o=Array.from(i.selection.getSelectedBlocks()).filter(t=>iu(t,n,e.schema));for(const e of o)e.is(n)||t.rename(e,n)})}}function iu(t,e,i){return i.checkChild(t.parent,e)&&!i.isObject(t)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class nu extends $l{static get pluginName(){return"HeadingEditing"}constructor(t){super(t),t.config.define("heading",{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h2",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h3",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h4",title:"Heading 3",class:"ck-heading_heading3"}]})}static get requires(){return[Xh]}init(){const t=this.editor,e=t.config.get("heading.options"),i=[];for(const n of e)"paragraph"!==n.model&&(t.model.schema.register(n.model,{inheritAllFrom:"$block"}),t.conversion.elementToElement(n),i.push(n.model));this._addDefaultH1Conversion(t),t.commands.add("heading",new eu(t,i))}afterInit(){const t=this.editor,e=t.commands.get("enter"),i=t.config.get("heading.options");e&&this.listenTo(e,"afterExecute",(e,n)=>{const o=t.model.document.selection.getFirstPosition().parent;i.some(t=>o.is(t.model))&&!o.is("paragraph")&&0===o.childCount&&n.writer.rename(o,"paragraph")})}_addDefaultH1Conversion(t){t.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:di.get("low")+1})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class ou{constructor(t,e){e&&Fn(this,e),t&&this.set(t)}}yi(ou,qn);i(12); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class ru extends $l{init(){const t=this.editor,e=t.t,i= -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -function(t){const e=t.t,i={Paragraph:e("Paragraph"),"Heading 1":e("Heading 1"),"Heading 2":e("Heading 2"),"Heading 3":e("Heading 3"),"Heading 4":e("Heading 4"),"Heading 5":e("Heading 5"),"Heading 6":e("Heading 6")};return t.config.get("heading.options").map(t=>{const e=i[t.title];return e&&e!=t.title&&(t.title=e),t})}(t),n=e("Choose heading"),o=e("Heading");t.ui.componentFactory.add("heading",e=>{const r={},s=new xi,a=t.commands.get("heading"),c=t.commands.get("paragraph"),l=[a];for(const t of i){const e={type:"button",model:new ou({label:t.title,class:t.class,withText:!0})};"paragraph"===t.model?(e.model.bind("isOn").to(c,"value"),e.model.set("commandName","paragraph"),l.push(c)):(e.model.bind("isOn").to(a,"value",e=>e===t.model),e.model.set({commandName:"heading",commandValue:t.model})),s.add(e),r[t.model]=t.title}const d=Ll(e);return function(t,e){const i=t.locale,n=t.listView=new Nl(i);n.items.bindTo(e).using(({type:t,model:e})=>{if("separator"===t)return new Bl(i);if("button"===t||"switchbutton"===t){const n=new Vl(i);let o;return o="button"===t?new Il(i):new Fl(i),o.bind(...Object.keys(e)).to(e),o.delegate("execute").to(n),n.children.add(o),n}}),t.panelView.children.add(n),n.items.delegate("execute").to(t)}(d,s),d.buttonView.set({isOn:!1,withText:!0,tooltip:o}),d.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),d.bind("isEnabled").toMany(l,"isEnabled",(...t)=>t.some(t=>t)),d.buttonView.bind("label").to(a,"value",c,"value",(t,e)=>{const i=t||e&&"paragraph";return r[i]?r[i]:n}),this.listenTo(d,"execute",e=>{t.execute(e.source.commandName,e.source.commandValue?{value:e.source.commandValue}:void 0),t.editing.view.focus()}),d})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class su extends hr{observe(t){this.listenTo(t,"load",(t,e)=>{"IMG"==e.target.tagName&&this._fireEvents(e)},{useCapture:!0})}_fireEvents(t){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",t))}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function au(t){const e=t.getSelectedElement();return e&&function(t){return!!t.getCustomProperty("image")&&Bh(t)}(e)?e:null}function cu(t){return!!t&&t.is("image")}function lu(t,e,i={}){const n=t.createElement("image",i),o=Lh(e.document.selection,e);e.insertContent(n,o),n.parent&&t.setSelection(n,"on")}function du(t){const e=t.schema,i=t.document.selection;return function(t,e,i){const n=function(t,e){const i=Lh(t,e).parent;if(i.isEmpty&&!i.is("$root"))return i.parent;return i} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(t,i);return e.checkChild(n,"image")}(i,e,t)&&!function(t,e){const i=t.getSelectedElement();return i&&e.isObject(i)}(i,e)&&function(t){return[...t.focus.getAncestors()].every(t=>!t.is("image"))}(i)}function hu(t){return Array.from(t.getChildren()).find(t=>t.is("img"))}function uu(t){return i=>{i.on(`attribute:${t}:image`,e)};function e(t,e,i){if(!i.consumable.consume(e.item,t.name))return;const n=i.writer,o=hu(i.mapper.toViewElement(e.item));null!==e.attributeNewValue?n.setAttribute(e.attributeKey,e.attributeNewValue,o):n.removeAttribute(e.attributeKey,o)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class fu extends Xl{refresh(){this.isEnabled=du(this.editor.model)}execute(t){const e=this.editor.model;e.change(i=>{const n=Array.isArray(t.source)?t.source:[t.source];for(const t of n)lu(i,e,{src:t})})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class gu extends $l{static get pluginName(){return"ImageEditing"}init(){const t=this.editor,e=t.model.schema,i=t.t,n=t.conversion;t.editing.view.addObserver(su),e.register("image",{isObject:!0,isBlock:!0,allowWhere:"$block",allowAttributes:["alt","src","srcset"]}),n.for("dataDowncast").elementToElement({model:"image",view:(t,e)=>mu(e)}),n.for("editingDowncast").elementToElement({model:"image",view:(t,e)=>{return n=mu(e),o=e,r=i("image widget"),o.setCustomProperty("image",!0,n),Fh(n,o,{label:function(){const t=hu(n).getAttribute("alt");return t?`${t} ${r}`:r}});var n,o,r}}),n.for("downcast").add(uu("src")).add(uu("alt")).add(function(){return e=>{e.on("attribute:srcset:image",t)};function t(t,e,i){if(!i.consumable.consume(e.item,t.name))return;const n=i.writer,o=hu(i.mapper.toViewElement(e.item));if(null===e.attributeNewValue){const t=e.attributeOldValue;t.data&&(n.removeAttribute("srcset",o),n.removeAttribute("sizes",o),t.width&&n.removeAttribute("width",o))}else{const t=e.attributeNewValue;t.data&&(n.setAttribute("srcset",t.data,o),n.setAttribute("sizes","100vw",o),t.width&&n.setAttribute("width",t.width,o))}}}()),n.for("upcast").elementToElement({view:{name:"img",attributes:{src:!0}},model:(t,e)=>e.createElement("image",{src:t.getAttribute("src")})}).attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:{key:"srcset",value:t=>{const e={data:t.getAttribute("srcset")};return t.hasAttribute("width")&&(e.width=t.getAttribute("width")),e}}}).add(function(){return e=>{e.on("element:figure",t)};function t(t,e,i){if(!i.consumable.test(e.viewItem,{name:!0,classes:"image"}))return;const n=hu(e.viewItem);if(!n||!n.hasAttribute("src")||!i.consumable.test(n,{name:!0}))return;const o=i.convertItem(n,e.modelCursor),r=Ph(o.modelRange.getItems());r&&(i.convertChildren(e.viewItem,i.writer.createPositionAt(r,0)),e.modelRange=o.modelRange,e.modelCursor=o.modelCursor)}}()),t.commands.add("imageInsert",new fu(t))}}function mu(t){const e=t.createEmptyElement("img"),i=t.createContainerElement("figure",{class:"image"});return t.insert(t.createPositionAt(i,0),e),i} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class pu extends Ir{constructor(t){super(t),this.domEventType="mousedown"}onDomEvent(t){this.fire(t.type,t)}}i(50); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class bu extends $l{static get pluginName(){return"Widget"}init(){const t=this.editor.editing.view,e=t.document;this._previouslySelected=new Set,this.editor.editing.downcastDispatcher.on("selection",(t,e,i)=>{this._clearPreviouslySelectedWidgets(i.writer);const n=i.writer,o=n.document.selection,r=o.getSelectedElement();let s=null;for(const t of o.getRanges())for(const e of t){const t=e.item;Bh(t)&&!wu(t,s)&&(n.addClass("ck-widget_selected",t),this._previouslySelected.add(t),s=t,t==r&&n.setSelection(o.getRanges(),{fake:!0,label:Dh(r)}))}},{priority:"low"}),t.addObserver(pu),this.listenTo(e,"mousedown",(...t)=>this._onMousedown(...t)),this.listenTo(e,"keydown",(...t)=>this._onKeydown(...t),{priority:"high"}),this.listenTo(e,"delete",(t,e)=>{this._handleDelete("forward"==e.direction)&&(e.preventDefault(),t.stop())},{priority:"high"})}_onMousedown(t,e){const i=this.editor,n=i.editing.view,o=n.document;let r=e.target;if(function(t){for(;t;){if(t.is("editableElement")&&!t.is("rootElement"))return!0;if(Bh(t))return!1;t=t.parent}return!1}(r)){if(uo.isSafari&&e.domEvent.detail>=3){const t=i.editing.mapper.toModelElement(r);this.editor.model.change(i=>{e.preventDefault(),i.setSelection(t,"in")})}return}if(!Bh(r)&&(r=r.findAncestor(Bh),!r))return;e.preventDefault(),o.isFocused||n.focus();const s=i.editing.mapper.toModelElement(r);this._setSelectionOverElement(s)}_onKeydown(t,e){const i=e.keyCode,n="ltr"===this.editor.locale.contentLanguageDirection,o=i==mo.arrowdown||i==mo[n?"arrowright":"arrowleft"];let r=!1;!function(t){return t==mo.arrowright||t==mo.arrowleft||t==mo.arrowup||t==mo.arrowdown}(i)?i===mo.enter&&(r=this._handleEnterKey(e.shiftKey)):r=this._handleArrowKeys(o),r&&(e.preventDefault(),t.stop())}_handleDelete(t){if(this.editor.isReadOnly)return;const e=this.editor.model.document.selection;if(!e.isCollapsed)return;const i=this._getObjectElementNextToSelection(t);return i?(this.editor.model.change(t=>{let n=e.anchor.parent;for(;n.isEmpty;){const e=n;n=e.parent,t.remove(e)}this._setSelectionOverElement(i)}),!0):void 0}_handleArrowKeys(t){const e=this.editor.model,i=e.schema,n=e.document.selection,o=n.getSelectedElement();if(o&&i.isObject(o)){const o=t?n.getLastPosition():n.getFirstPosition(),r=i.getNearestSelectionRange(o,t?"forward":"backward");return r&&e.change(t=>{t.setSelection(r)}),!0}if(!n.isCollapsed)return;const r=this._getObjectElementNextToSelection(t);return r&&i.isObject(r)?(this._setSelectionOverElement(r),!0):void 0}_handleEnterKey(t){const e=this.editor.model,i=e.document.selection.getSelectedElement();if(n=i,o=e.schema,n&&o.isObject(n)&&!o.isInline(n))return e.change(n=>{let o=n.createPositionAt(i,t?"before":"after");const r=n.createElement("paragraph");if(e.schema.isBlock(i.parent)){const t=e.schema.findAllowedParent(o,r);o=n.split(o,t).position}n.insert(r,o),n.setSelection(r,"in")}),!0;var n,o; -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */}_setSelectionOverElement(t){this.editor.model.change(e=>{e.setSelection(e.createRangeOn(t))})}_getObjectElementNextToSelection(t){const e=this.editor.model,i=e.schema,n=e.document.selection,o=e.createSelection(n);e.modifySelection(o,{direction:t?"forward":"backward"});const r=t?o.focus.nodeBefore:o.focus.nodeAfter;return r&&i.isObject(r)?r:null}_clearPreviouslySelectedWidgets(t){for(const e of this._previouslySelected)t.removeClass("ck-widget_selected",e);this._previouslySelected.clear()}}function wu(t,e){return!!e&&Array.from(t.getAncestors()).includes(e)}class ku extends Xl{refresh(){const t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=cu(t),cu(t)&&t.hasAttribute("alt")?this.value=t.getAttribute("alt"):this.value=!1}execute(t){const e=this.editor.model,i=e.document.selection.getSelectedElement();e.change(e=>{e.setAttribute("alt",t.newValue,i)})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class _u extends $l{static get pluginName(){return"ImageTextAlternativeEditing"}init(){this.editor.commands.add("imageTextAlternative",new ku(this.editor))}}i(52); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class vu extends cl{constructor(t,e){super(t);const i="ck-labeled-field-view-"+li(),n="ck-labeled-field-view-status-"+li();this.fieldView=e(this,i,n),this.set("label"),this.set("isEnabled",!0),this.set("errorText",null),this.set("infoText",null),this.set("class"),this.labelView=this._createLabelView(i),this.statusView=this._createStatusView(n),this.bind("_statusText").to(this,"errorText",this,"infoText",(t,e)=>t||e);const o=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",o.to("class"),o.if("isEnabled","ck-disabled",t=>!t)]},children:[this.labelView,this.fieldView,this.statusView]})}_createLabelView(t){const e=new ul(this.locale);return e.for=t,e.bind("text").to(this,"label"),e}_createStatusView(t){const e=new cl(this.locale),i=this.bindTemplate;return e.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view__status",i.if("errorText","ck-labeled-field-view__status_error"),i.if("_statusText","ck-hidden",t=>!t)],id:t,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]}),e}focus(){this.fieldView.focus()}}i(54); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class yu extends cl{constructor(t){super(t),this.set("value"),this.set("id"),this.set("placeholder"),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById");const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{type:"text",class:["ck","ck-input","ck-input-text",e.if("hasError","ck-error")],id:e.to("id"),placeholder:e.to("placeholder"),readonly:e.to("isReadOnly"),"aria-invalid":e.if("hasError",!0),"aria-describedby":e.to("ariaDescribedById")},on:{input:e.to("input")}})}render(){super.render();const t=t=>{this.element.value=t||0===t?t:""};t(this.value),this.on("change:value",(e,i,n)=>{t(n)})}select(){this.element.select()}focus(){this.element.focus()}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function xu(t,e,i){const n=new yu(t.locale);return n.set({id:e,ariaDescribedById:i}),n.bind("isReadOnly").to(t,"isEnabled",t=>!t),n.bind("hasError").to(t,"errorText",t=>!!t),n.on("input",()=>{t.errorText=null}),n} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -function Au({view:t}){t.listenTo(t.element,"submit",(e,i)=>{i.preventDefault(),t.fire("submit")},{useCapture:!0})}var Pu='',Cu='';i(56); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class Tu extends cl{constructor(t){super(t);const e=this.locale.t;this.focusTracker=new Mc,this.keystrokes=new Ac,this.labeledInput=this._createLabeledInputView(),this.saveButtonView=this._createButton(e("Save"),Pu,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(e("Cancel"),Cu,"ck-button-cancel","cancel"),this._focusables=new qc,this._focusCycler=new kl({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-text-alternative-form"],tabindex:"-1"},children:[this.labeledInput,this.saveButtonView,this.cancelButtonView]})}render(){super.render(),this.keystrokes.listenTo(this.element),Au({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)})}_createButton(t,e,i,n){const o=new Il(this.locale);return o.set({label:t,icon:e,tooltip:!0}),o.extendTemplate({attributes:{class:i}}),n&&o.delegate("execute").to(this,n),o}_createLabeledInputView(){const t=this.locale.t,e=new vu(this.locale,xu);return e.label=t("Text alternative"),e.fieldView.placeholder=t("Text alternative"),e}}i(58); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md. - */const Su=pl("px"),Eu=Zo.document.body;class Ou extends cl{constructor(t){super(t);const e=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("position","arrow_nw"),this.set("isVisible",!1),this.set("withArrow",!0),this.set("class"),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",e.to("position",t=>"ck-balloon-panel_"+t),e.if("isVisible","ck-balloon-panel_visible"),e.if("withArrow","ck-balloon-panel_with-arrow"),e.to("class")],style:{top:e.to("top",Su),left:e.to("left",Su)}},children:this.content})}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(t){this.show();const e=Ou.defaultPositions,i=Object.assign({},{element:this.element,positions:[e.southArrowNorth,e.southArrowNorthMiddleWest,e.southArrowNorthMiddleEast,e.southArrowNorthWest,e.southArrowNorthEast,e.northArrowSouth,e.northArrowSouthMiddleWest,e.northArrowSouthMiddleEast,e.northArrowSouthWest,e.northArrowSouthEast],limiter:Eu,fitInViewport:!0},t),n=Ou._getOptimalPosition(i),o=parseInt(n.left),r=parseInt(n.top),s=n.name;Object.assign(this,{top:r,left:o,position:s})}pin(t){this.unpin(),this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(t):this._stopPinning()},this._startPinning(t),this.listenTo(this,"change:isVisible",this._pinWhenIsVisibleCallback)}unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,"change:isVisible",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide())}_startPinning(t){this.attachTo(t);const e=Ru(t.target),i=t.limiter?Ru(t.limiter):Eu;this.listenTo(Zo.document,"scroll",(n,o)=>{const r=o.target,s=e&&r.contains(e),a=i&&r.contains(i);!s&&!a&&e&&i||this.attachTo(t)},{useCapture:!0}),this.listenTo(Zo.window,"resize",()=>{this.attachTo(t)})}_stopPinning(){this.stopListening(Zo.document,"scroll"),this.stopListening(Zo.window,"resize")}}function Ru(t){return ii(t)?t:Jr(t)?t.commonAncestorContainer:"function"==typeof t?Ru(t()):null}function Iu(t,e){return t.top-e.height-Ou.arrowVerticalOffset}function Mu(t){return t.bottom+Ou.arrowVerticalOffset}Ou.arrowHorizontalOffset=25,Ou.arrowVerticalOffset=10,Ou._getOptimalPosition=Pl,Ou.defaultPositions={northWestArrowSouthWest:(t,e)=>({top:Iu(t,e),left:t.left-Ou.arrowHorizontalOffset,name:"arrow_sw"}),northWestArrowSouthMiddleWest:(t,e)=>({top:Iu(t,e),left:t.left-.25*e.width-Ou.arrowHorizontalOffset,name:"arrow_smw"}),northWestArrowSouth:(t,e)=>({top:Iu(t,e),left:t.left-e.width/2,name:"arrow_s"}),northWestArrowSouthMiddleEast:(t,e)=>({top:Iu(t,e),left:t.left-.75*e.width+Ou.arrowHorizontalOffset,name:"arrow_sme"}),northWestArrowSouthEast:(t,e)=>({top:Iu(t,e),left:t.left-e.width+Ou.arrowHorizontalOffset,name:"arrow_se"}),northArrowSouthWest:(t,e)=>({top:Iu(t,e),left:t.left+t.width/2-Ou.arrowHorizontalOffset,name:"arrow_sw"}),northArrowSouthMiddleWest:(t,e)=>({top:Iu(t,e),left:t.left+t.width/2-.25*e.width-Ou.arrowHorizontalOffset,name:"arrow_smw"}),northArrowSouth:(t,e)=>({top:Iu(t,e),left:t.left+t.width/2-e.width/2,name:"arrow_s"}),northArrowSouthMiddleEast:(t,e)=>({top:Iu(t,e),left:t.left+t.width/2-.75*e.width+Ou.arrowHorizontalOffset,name:"arrow_sme"}),northArrowSouthEast:(t,e)=>({top:Iu(t,e),left:t.left+t.width/2-e.width+Ou.arrowHorizontalOffset,name:"arrow_se"}),northEastArrowSouthWest:(t,e)=>({top:Iu(t,e),left:t.right-Ou.arrowHorizontalOffset,name:"arrow_sw"}),northEastArrowSouthMiddleWest:(t,e)=>({top:Iu(t,e),left:t.right-.25*e.width-Ou.arrowHorizontalOffset,name:"arrow_smw"}),northEastArrowSouth:(t,e)=>({top:Iu(t,e),left:t.right-e.width/2,name:"arrow_s"}),northEastArrowSouthMiddleEast:(t,e)=>({top:Iu(t,e),left:t.right-.75*e.width+Ou.arrowHorizontalOffset,name:"arrow_sme"}),northEastArrowSouthEast:(t,e)=>({top:Iu(t,e),left:t.right-e.width+Ou.arrowHorizontalOffset,name:"arrow_se"}),southWestArrowNorthWest:(t,e)=>({top:Mu(t),left:t.left-Ou.arrowHorizontalOffset,name:"arrow_nw"}),southWestArrowNorthMiddleWest:(t,e)=>({top:Mu(t),left:t.left-.25*e.width-Ou.arrowHorizontalOffset,name:"arrow_nmw"}),southWestArrowNorth:(t,e)=>({top:Mu(t),left:t.left-e.width/2,name:"arrow_n"}),southWestArrowNorthMiddleEast:(t,e)=>({top:Mu(t),left:t.left-.75*e.width+Ou.arrowHorizontalOffset,name:"arrow_nme"}),southWestArrowNorthEast:(t,e)=>({top:Mu(t),left:t.left-e.width+Ou.arrowHorizontalOffset,name:"arrow_ne"}),southArrowNorthWest:(t,e)=>({top:Mu(t),left:t.left+t.width/2-Ou.arrowHorizontalOffset,name:"arrow_nw"}),southArrowNorthMiddleWest:(t,e)=>({top:Mu(t),left:t.left+t.width/2-.25*e.width-Ou.arrowHorizontalOffset,name:"arrow_nmw"}),southArrowNorth:(t,e)=>({top:Mu(t),left:t.left+t.width/2-e.width/2,name:"arrow_n"}),southArrowNorthMiddleEast:(t,e)=>({top:Mu(t),left:t.left+t.width/2-.75*e.width+Ou.arrowHorizontalOffset,name:"arrow_nme"}),southArrowNorthEast:(t,e)=>({top:Mu(t),left:t.left+t.width/2-e.width+Ou.arrowHorizontalOffset,name:"arrow_ne"}),southEastArrowNorthWest:(t,e)=>({top:Mu(t),left:t.right-Ou.arrowHorizontalOffset,name:"arrow_nw"}),southEastArrowNorthMiddleWest:(t,e)=>({top:Mu(t),left:t.right-.25*e.width-Ou.arrowHorizontalOffset,name:"arrow_nmw"}),southEastArrowNorth:(t,e)=>({top:Mu(t),left:t.right-e.width/2,name:"arrow_n"}),southEastArrowNorthMiddleEast:(t,e)=>({top:Mu(t),left:t.right-.75*e.width+Ou.arrowHorizontalOffset,name:"arrow_nme"}),southEastArrowNorthEast:(t,e)=>({top:Mu(t),left:t.right-e.width+Ou.arrowHorizontalOffset,name:"arrow_ne"})};i(60),i(62); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -const Nu=pl("px");class Vu extends $l{static get pluginName(){return"ContextualBalloon"}constructor(t){super(t),this.positionLimiter=()=>{const t=this.editor.editing.view,e=t.document.selection.editableElement;return e?t.domConverter.mapViewToDom(e.root):null},this.set("visibleView",null),this.view=new Ou(t.locale),t.ui.view.body.add(this.view),t.ui.focusTracker.add(this.view.element),this._viewToStack=new Map,this._idToStack=new Map,this.set("_numberOfStacks",0),this.set("_singleViewMode",!1),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}hasView(t){return Array.from(this._viewToStack.keys()).includes(t)}add(t){if(this.hasView(t.view))throw new hi.b("contextualballoon-add-view-exist: Cannot add configuration of the same view twice.",[this,t]);const e=t.stackId||"main";if(!this._idToStack.has(e))return this._idToStack.set(e,new Map([[t.view,t]])),this._viewToStack.set(t.view,this._idToStack.get(e)),this._numberOfStacks=this._idToStack.size,void(this._visibleStack&&!t.singleViewMode||this.showStack(e));const i=this._idToStack.get(e);t.singleViewMode&&this.showStack(e),i.set(t.view,t),this._viewToStack.set(t.view,i),i===this._visibleStack&&this._showView(t)}remove(t){if(!this.hasView(t))throw new hi.b("contextualballoon-remove-view-not-exist: Cannot remove the configuration of a non-existent view.",[this,t]);const e=this._viewToStack.get(t);this._singleViewMode&&this.visibleView===t&&(this._singleViewMode=!1),this.visibleView===t&&(1===e.size?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(e.values())[e.size-2])),1===e.size?(this._idToStack.delete(this._getStackId(e)),this._numberOfStacks=this._idToStack.size):e.delete(t),this._viewToStack.delete(t)}updatePosition(t){t&&(this._visibleStack.get(this.visibleView).position=t),this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition()}showStack(t){this.visibleStack=t;const e=this._idToStack.get(t);if(!e)throw new hi.b("contextualballoon-showstack-stack-not-exist: Cannot show a stack that does not exist.",this);this._visibleStack!==e&&this._showView(Array.from(e.values()).pop())}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(t){return Array.from(this._idToStack.entries()).find(e=>e[1]===t)[0]}_showNextStack(){const t=Array.from(this._idToStack.values());let e=t.indexOf(this._visibleStack)+1;t[e]||(e=0),this.showStack(this._getStackId(t[e]))}_showPrevStack(){const t=Array.from(this._idToStack.values());let e=t.indexOf(this._visibleStack)-1;t[e]||(e=t.length-1),this.showStack(this._getStackId(t[e]))}_createRotatorView(){const t=new Bu(this.editor.locale),e=this.editor.locale.t;return this.view.content.add(t),t.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(t,e)=>!e&&t>1),t.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),t.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(t,i)=>{if(i<2)return"";const n=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return e("%0 of %1",[n,i])}),t.buttonNextView.on("execute",()=>{t.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),t.buttonPrevView.on("execute",()=>{t.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),t}_createFakePanelsView(){const t=new Fu(this.editor.locale,this.view);return t.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(t,e)=>!e&&t>=2?Math.min(t-1,2):0),t.listenTo(this.view,"change:top",()=>t.updatePosition()),t.listenTo(this.view,"change:left",()=>t.updatePosition()),this.editor.ui.view.body.add(t),t}_showView({view:t,balloonClassName:e="",withArrow:i=!0,singleViewMode:n=!1}){this.view.class=e,this.view.withArrow=i,this._rotatorView.showView(t),this.visibleView=t,this.view.pin(this._getBalloonPosition()),this._fakePanelsView.updatePosition(),n&&(this._singleViewMode=!0)}_getBalloonPosition(){let t=Array.from(this._visibleStack.values()).pop().position;return t&&!t.limiter&&(t=Object.assign({},t,{limiter:this.positionLimiter})),t}}class Bu extends cl{constructor(t){super(t);const e=t.t,i=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new Mc,this.buttonPrevView=this._createButtonView(e("Previous"),''),this.buttonNextView=this._createButtonView(e("Next"),''),this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-rotator"],"z-index":"-1"},children:[{tag:"div",attributes:{class:["ck-balloon-rotator__navigation",i.to("isNavigationVisible",t=>t?"":"ck-hidden")]},children:[this.buttonPrevView,{tag:"span",attributes:{class:["ck-balloon-rotator__counter"]},children:[{text:i.to("counter")}]},this.buttonNextView]},{tag:"div",attributes:{class:"ck-balloon-rotator__content"},children:this.content}]})}render(){super.render(),this.focusTracker.add(this.element)}showView(t){this.hideView(),this.content.add(t)}hideView(){this.content.clear()}_createButtonView(t,e){const i=new Il(this.locale);return i.set({label:t,icon:e,tooltip:!0}),i}}class Fu extends cl{constructor(t,e){super(t);const i=this.bindTemplate;this.set("top",0),this.set("left",0),this.set("height",0),this.set("width",0),this.set("numberOfPanels",0),this.content=this.createCollection(),this._balloonPanelView=e,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",t=>t?"":"ck-hidden")],style:{top:i.to("top",Nu),left:i.to("left",Nu),width:i.to("width",Nu),height:i.to("height",Nu)}},children:this.content}),this.on("change:numberOfPanels",(t,e,i,n)=>{i>n?this._addPanels(i-n):this._removePanels(n-i),this.updatePosition()})}_addPanels(t){for(;t--;){const t=new cl;t.setTemplate({tag:"div"}),this.content.add(t),this.registerChild(t)}}_removePanels(t){for(;t--;){const t=this.content.last;this.content.remove(t),this.deregisterChild(t),t.destroy()}}updatePosition(){if(this.numberOfPanels){const{top:t,left:e}=this._balloonPanelView,{width:i,height:n}=new Xr(this._balloonPanelView.element);Object.assign(this,{top:t,left:e,width:i,height:n})}}}function Du(t){const e=t.editing.view,i=Ou.defaultPositions;return{target:e.domConverter.viewToDom(e.document.selection.getSelectedElement()),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast]}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Lu extends $l{static get requires(){return[Vu]}static get pluginName(){return"ImageTextAlternativeUI"}init(){this._createButton(),this._createForm()}destroy(){super.destroy(),this._form.destroy()}_createButton(){const t=this.editor,e=t.t;t.ui.componentFactory.add("imageTextAlternative",i=>{const n=t.commands.get("imageTextAlternative"),o=new Il(i);return o.set({label:e("Change image text alternative"),icon:'',tooltip:!0}),o.bind("isEnabled").to(n,"isEnabled"),this.listenTo(o,"execute",()=>{this._showForm()}),o})}_createForm(){const t=this.editor,e=t.editing.view.document;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new Tu(t.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{t.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this._form.keystrokes.set("Esc",(t,e)=>{this._hideForm(!0),e()}),this.listenTo(t.ui,"update",()=>{au(e.selection)?this._isVisible&& -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -function(t){const e=t.plugins.get("ContextualBalloon");if(au(t.editing.view.document.selection)){const i=Du(t);e.updatePosition(i)}}(t):this._hideForm(!0)}),Dl({emitter:this._form,activator:()=>this._isVisible,contextElements:[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;const t=this.editor,e=t.commands.get("imageTextAlternative"),i=this._form.labeledInput;this._isInBalloon||this._balloon.add({view:this._form,position:Du(t)}),i.fieldView.value=i.fieldView.element.value=e.value||"",this._form.labeledInput.fieldView.select()}_hideForm(t){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),t&&this.editor.editing.view.focus())}get _isVisible(){return this._balloon.visibleView===this._form}get _isInBalloon(){return this._balloon.hasView(this._form)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class zu extends $l{static get requires(){return[_u,Lu]}static get pluginName(){return"ImageTextAlternative"}}i(64); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function ju(t){for(const e of t.getChildren())if(e&&e.is("caption"))return e;return null}function qu(t){const e=t.parent;return"figcaption"==t.name&&e&&"figure"==e.name&&e.hasClass("image")?{name:!0}:null} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Wu extends $l{static get pluginName(){return"ImageCaptionEditing"}init(){const t=this.editor,e=t.editing.view,i=t.model.schema,n=t.data,o=t.editing,r=t.t;i.register("caption",{allowIn:"image",allowContentOf:"$block",isLimit:!0}),t.model.document.registerPostFixer(t=>this._insertMissingModelCaptionElement(t)),t.conversion.for("upcast").elementToElement({view:qu,model:"caption"});n.downcastDispatcher.on("insert:caption",Hu(t=>t.createContainerElement("figcaption"),!1));const s= -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -function(t,e){return i=>{const n=i.createEditableElement("figcaption");return i.setCustomProperty("imageCaption",!0,n),Bc({view:t,element:n,text:e}),function(t,e){return e.addClass(["ck-editor__editable","ck-editor__nested-editable"],t),e.setAttribute("contenteditable",t.isReadOnly?"false":"true",t),t.on("change:isReadOnly",(i,n,o)=>{e.setAttribute("contenteditable",o?"false":"true",t)}),t.on("change:isFocused",(i,n,o)=>{o?e.addClass("ck-editor__nested-editable_focused",t):e.removeClass("ck-editor__nested-editable_focused",t)}),t}(n,i)}}(e,r("Enter image caption"));o.downcastDispatcher.on("insert:caption",Hu(s)),o.downcastDispatcher.on("insert",this._fixCaptionVisibility(t=>t.item),{priority:"high"}),o.downcastDispatcher.on("remove",this._fixCaptionVisibility(t=>t.position.parent),{priority:"high"}),e.document.registerPostFixer(t=>this._updateCaptionVisibility(t))}_updateCaptionVisibility(t){const e=this.editor.editing.mapper,i=this._lastSelectedCaption;let n;const o=this.editor.model.document.selection,r=o.getSelectedElement();if(r&&r.is("image")){const t=ju(r);n=e.toViewElement(t)}const s=Uu(o.getFirstPosition().parent);if(s&&(n=e.toViewElement(s)),n)return i?(i===n||($u(i,t),this._lastSelectedCaption=n),Gu(n,t)):(this._lastSelectedCaption=n,Gu(n,t));if(i){const e=$u(i,t);return this._lastSelectedCaption=null,e}return!1}_fixCaptionVisibility(t){return(e,i,n)=>{const o=Uu(t(i)),r=this.editor.editing.mapper,s=n.writer;if(o){const t=r.toViewElement(o);t&&(o.childCount?s.removeClass("ck-hidden",t):s.addClass("ck-hidden",t))}}}_insertMissingModelCaptionElement(t){const e=this.editor.model,i=e.document.differ.getChanges(),n=[];for(const t of i)if("insert"==t.type&&"$text"!=t.name){const i=t.position.nodeAfter;if(i.is("image")&&!ju(i)&&n.push(i),!i.is("image")&&i.childCount)for(const t of e.createRangeIn(i).getItems())t.is("image")&&!ju(t)&&n.push(t)}for(const e of n)t.appendElement("caption",e);return!!n.length}}function Hu(t,e=!0){return(i,n,o)=>{const r=n.item;if((r.childCount||e)&&cu(r.parent)){if(!o.consumable.consume(n.item,"insert"))return;const e=o.mapper.toViewElement(n.range.start.parent),i=t(o.writer),s=o.writer;r.childCount||s.addClass("ck-hidden",i),function(t,e,i,n){const o=n.writer.createPositionAt(i,"end");n.writer.insert(o,t),n.mapper.bindElements(e,t)}(i,n.item,e,o)}}}function Uu(t){const e=t.getAncestors({includeSelf:!0}).find(t=>"caption"==t.name);return e&&e.parent&&"image"==e.parent.name?e:null}function $u(t,e){return!t.childCount&&!t.hasClass("ck-hidden")&&(e.addClass("ck-hidden",t),!0)}function Gu(t,e){return!!t.hasClass("ck-hidden")&&(e.removeClass("ck-hidden",t),!0)}i(66); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class Ku extends Xl{constructor(t,e){super(t),this.defaultStyle=!1,this.styles=e.reduce((t,e)=>(t[e.name]=e,e.isDefault&&(this.defaultStyle=e.name),t),{})}refresh(){const t=this.editor.model.document.selection.getSelectedElement();if(this.isEnabled=cu(t),t)if(t.hasAttribute("imageStyle")){const e=t.getAttribute("imageStyle");this.value=!!this.styles[e]&&e}else this.value=this.defaultStyle;else this.value=!1}execute(t){const e=t.value,i=this.editor.model,n=i.document.selection.getSelectedElement();i.change(t=>{this.styles[e].isDefault?t.removeAttribute("imageStyle",n):t.setAttribute("imageStyle",e,n)})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function Ju(t,e){for(const i of e)if(i.name===t)return i}var Qu='',Yu='',Xu='',Zu=''; -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -const tf={full:{name:"full",title:"Full size image",icon:Qu,isDefault:!0},side:{name:"side",title:"Side image",icon:Zu,className:"image-style-side"},alignLeft:{name:"alignLeft",title:"Left aligned image",icon:Yu,className:"image-style-align-left"},alignCenter:{name:"alignCenter",title:"Centered image",icon:Xu,className:"image-style-align-center"},alignRight:{name:"alignRight",title:"Right aligned image",icon:Zu,className:"image-style-align-right"}},ef={full:Qu,left:Yu,right:Zu,center:Xu};function nf(t=[]){return t.map(of)}function of(t){if("string"==typeof t){const e=t;tf[e]?t=Object.assign({},tf[e]):(console.warn(Object(hi.a)("image-style-not-found: There is no such image style of given name."),{name:e}),t={name:e})}else if(tf[t.name]){const e=tf[t.name],i=Object.assign({},t);for(const n in e)t.hasOwnProperty(n)||(i[n]=e[n]);t=i}return"string"==typeof t.icon&&ef[t.icon]&&(t.icon=ef[t.icon]),t} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class rf extends $l{static get pluginName(){return"ImageStyleEditing"}init(){const t=this.editor,e=t.model.schema,i=t.data,n=t.editing;t.config.define("image.styles",["full","side"]);const o=nf(t.config.get("image.styles"));e.extend("image",{allowAttributes:"imageStyle"});const r=function(t){return(e,i,n)=>{if(!n.consumable.consume(i.item,e.name))return;const o=Ju(i.attributeNewValue,t),r=Ju(i.attributeOldValue,t),s=n.mapper.toViewElement(i.item),a=n.writer;r&&a.removeClass(r.className,s),o&&a.addClass(o.className,s)}}(o);n.downcastDispatcher.on("attribute:imageStyle:image",r),i.downcastDispatcher.on("attribute:imageStyle:image",r),i.upcastDispatcher.on("element:figure",function(t){const e=t.filter(t=>!t.isDefault);return(t,i,n)=>{if(!i.modelRange)return;const o=i.viewItem,r=Ph(i.modelRange.getItems());if(n.schema.checkAttribute(r,"imageStyle"))for(const t of e)n.consumable.consume(o,{classes:t.className})&&n.writer.setAttribute("imageStyle",t.name,r)}}(o),{priority:"low"}),t.commands.add("imageStyle",new Ku(t,o))}}i(68); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class sf extends $l{static get pluginName(){return"ImageStyleUI"}get localizedDefaultStylesTitles(){const t=this.editor.t;return{"Full size image":t("Full size image"),"Side image":t("Side image"),"Left aligned image":t("Left aligned image"),"Centered image":t("Centered image"),"Right aligned image":t("Right aligned image")}}init(){const t=function(t,e){for(const i of t)e[i.title]&&(i.title=e[i.title]);return t} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(nf(this.editor.config.get("image.styles")),this.localizedDefaultStylesTitles);for(const e of t)this._createButton(e)}_createButton(t){const e=this.editor,i="imageStyle:"+t.name;e.ui.componentFactory.add(i,i=>{const n=e.commands.get("imageStyle"),o=new Il(i);return o.set({label:t.title,icon:t.icon,tooltip:!0,isToggleable:!0}),o.bind("isEnabled").to(n,"isEnabled"),o.bind("isOn").to(n,"value",e=>e===t.name),this.listenTo(o,"execute",()=>{e.execute("imageStyle",{value:t.name}),e.editing.view.focus()}),o})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class af extends $l{static get requires(){return[Vu]}static get pluginName(){return"WidgetToolbarRepository"}init(){const t=this.editor;if(t.plugins.has("BalloonToolbar")){const e=t.plugins.get("BalloonToolbar");this.listenTo(e,"show",e=>{(function(t){const e=t.getSelectedElement();return!(!e||!Bh(e))} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */)(t.editing.view.document.selection)&&e.stop()},{priority:"high"})}this._toolbarDefinitions=new Map,this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(t.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(t.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(const t of this._toolbarDefinitions.values())t.view.destroy()}register(t,{ariaLabel:e,items:i,getRelatedElement:n,balloonClassName:o="ck-toolbar-container"}){const r=this.editor,s=r.t,a=new zl(r.locale);if(a.ariaLabel=e||s("Widget toolbar"),this._toolbarDefinitions.has(t))throw new hi.b("widget-toolbar-duplicated: Toolbar with the given id was already added.",this,{toolbarId:t});a.fillFromConfig(i,r.ui.componentFactory),this._toolbarDefinitions.set(t,{view:a,getRelatedElement:n,balloonClassName:o})}_updateToolbarsVisibility(){let t=0,e=null,i=null;for(const n of this._toolbarDefinitions.values()){const o=n.getRelatedElement(this.editor.editing.view.document.selection);if(this.isEnabled&&o)if(this.editor.ui.focusTracker.isFocused){const r=o.getAncestors().length;r>t&&(t=r,e=o,i=n)}else this._isToolbarVisible(n)&&this._hideToolbar(n);else this._isToolbarInBalloon(n)&&this._hideToolbar(n)}i&&this._showToolbar(i,e)}_hideToolbar(t){this._balloon.remove(t.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(t,e){this._isToolbarVisible(t)?cf(this.editor,e):this._isToolbarInBalloon(t)||(this._balloon.add({view:t.view,position:lf(this.editor,e),balloonClassName:t.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(const t of this._toolbarDefinitions.values())if(this._isToolbarVisible(t)){const e=t.getRelatedElement(this.editor.editing.view.document.selection);cf(this.editor,e)}}))}_isToolbarVisible(t){return this._balloon.visibleView===t.view}_isToolbarInBalloon(t){return this._balloon.hasView(t.view)}}function cf(t,e){const i=t.plugins.get("ContextualBalloon"),n=lf(t,e);i.updatePosition(n)}function lf(t,e){const i=t.editing.view,n=Ou.defaultPositions;return{target:i.domConverter.mapViewToDom(e),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class df extends cl{constructor(t){super(t),this.buttonView=new Il(t),this._fileInputView=new hf(t),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.setTemplate({tag:"span",attributes:{class:"ck-file-dialog-button"},children:[this.buttonView,this._fileInputView]}),this.buttonView.on("execute",()=>{this._fileInputView.open()})}focus(){this.buttonView.focus()}}class hf extends cl{constructor(t){super(t),this.set("acceptedType"),this.set("allowMultipleFiles",!1);const e=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:e.to("acceptedType"),multiple:e.to("allowMultipleFiles")},on:{change:e.to(()=>{this.element&&this.element.files&&this.element.files.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -function uf(t){const e=t.map(t=>t.replace("+","\\+"));return new RegExp(`^image\\/(${e.join("|")})$`)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class ff extends $l{init(){const t=this.editor,e=t.t;t.ui.componentFactory.add("imageUpload",i=>{const n=new df(i),o=t.commands.get("imageUpload"),r=t.config.get("image.upload.types"),s=uf(r);return n.set({acceptedType:r.map(t=>"image/"+t).join(","),allowMultipleFiles:!0}),n.buttonView.set({label:e("Insert image"),icon:'',tooltip:!0}),n.buttonView.bind("isEnabled").to(o),n.on("done",(e,i)=>{const n=Array.from(i).filter(t=>s.test(t.type));n.length&&t.execute("imageUpload",{file:n})}),n})}}i(70),i(72),i(74); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class gf extends $l{constructor(t){super(t),this.placeholder="data:image/svg+xml;utf8,"+encodeURIComponent('')}init(){this.editor.editing.downcastDispatcher.on("attribute:uploadStatus:image",(...t)=>this.uploadStatusChange(...t))}uploadStatusChange(t,e,i){const n=this.editor,o=e.item,r=o.getAttribute("uploadId");if(!i.consumable.consume(e.item,t.name))return;const s=n.plugins.get(Yd),a=r?e.attributeNewValue:null,c=this.placeholder,l=n.editing.mapper.toViewElement(o),d=i.writer;if("reading"==a)return mf(l,d),void pf(c,l,d);if("uploading"==a){const t=s.loaders.get(r);return mf(l,d),void(t?(bf(l,d),function(t,e,i,n){const o=function(t){const e=t.createUIElement("div",{class:"ck-progress-bar"});return t.setCustomProperty("progressBar",!0,e),e}(e);e.insert(e.createPositionAt(t,"end"),o),i.on("change:uploadedPercent",(t,e,i)=>{n.change(t=>{t.setStyle("width",i+"%",o)})})}(l,d,t,n.editing.view),function(t,e,i){if(i.data){const n=hu(t);e.setAttribute("src",i.data,n)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(l,d,t)):pf(c,l,d))}"complete"==a&&s.loaders.get(r)&&function(t,e,i){const n=e.createUIElement("div",{class:"ck-image-upload-complete-icon"});e.insert(e.createPositionAt(t,"end"),n),setTimeout(()=>{i.change(t=>t.remove(t.createRangeOn(n)))},3e3)}(l,d,n.editing.view),function(t,e){kf(t,e,"progressBar")}(l,d),bf(l,d),function(t,e){e.removeClass("ck-appear",t)}(l,d)}}function mf(t,e){t.hasClass("ck-appear")||e.addClass("ck-appear",t)}function pf(t,e,i){e.hasClass("ck-image-upload-placeholder")||i.addClass("ck-image-upload-placeholder",e);const n=hu(e);n.getAttribute("src")!==t&&i.setAttribute("src",t,n),wf(e,"placeholder")||i.insert(i.createPositionAfter(n),function(t){const e=t.createUIElement("div",{class:"ck-upload-placeholder-loader"});return t.setCustomProperty("placeholder",!0,e),e}(i))}function bf(t,e){t.hasClass("ck-image-upload-placeholder")&&e.removeClass("ck-image-upload-placeholder",t),kf(t,e,"placeholder")}function wf(t,e){for(const i of t.getChildren())if(i.getCustomProperty(e))return i}function kf(t,e,i){const n=wf(t,i);n&&e.remove(e.createRangeOn(n))}class _f extends Kd{static get pluginName(){return"Notification"}init(){this.on("show:warning",(t,e)=>{window.alert(e.message)},{priority:"lowest"})}showSuccess(t,e={}){this._showNotification({message:t,type:"success",namespace:e.namespace,title:e.title})}showInfo(t,e={}){this._showNotification({message:t,type:"info",namespace:e.namespace,title:e.title})}showWarning(t,e={}){this._showNotification({message:t,type:"warning",namespace:e.namespace,title:e.title})}_showNotification(t){const e="show:"+t.type+(t.namespace?":"+t.namespace:"");this.fire(e,{message:t.message,type:t.type,title:t.title||""})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class vf{constructor(t){this.document=t}createDocumentFragment(t){return new xo(this.document,t)}createElement(t,e,i){return new Mn(this.document,t,e,i)}createText(t){return new Mi(this.document,t)}clone(t,e=!1){return t._clone(e)}appendChild(t,e){return e._appendChild(t)}insertChild(t,e,i){return i._insertChild(t,e)}removeChildren(t,e,i){return i._removeChildren(t,e)}remove(t){const e=t.parent;return e?this.removeChildren(e.getChildIndex(t),1,e):[]}replace(t,e){const i=t.parent;if(i){const n=i.getChildIndex(t);return this.removeChildren(n,1,i),this.insertChild(n,e,i),!0}return!1}unwrapElement(t){const e=t.parent;if(e){const i=e.getChildIndex(t);this.remove(t),this.insertChild(i,t.getChildren(),e)}}rename(t,e){const i=new Mn(this.document,t,e.getAttributes(),e.getChildren());return this.replace(e,i)?i:null}setAttribute(t,e,i){i._setAttribute(t,e)}removeAttribute(t,e){e._removeAttribute(t)}addClass(t,e){e._addClass(t)}removeClass(t,e){e._removeClass(t)}setStyle(t,e,i){y(t)&&void 0===i&&(i=e),i._setStyle(t,e)}removeStyle(t,e){e._removeStyle(t)}setCustomProperty(t,e,i){i._setCustomProperty(t,e)}removeCustomProperty(t,e){return e._removeCustomProperty(t)}createPositionAt(t,e){return Xn._createAt(t,e)}createPositionAfter(t){return Xn._createAfter(t)}createPositionBefore(t){return Xn._createBefore(t)}createRange(t,e){return new Zn(t,e)}createRangeOn(t){return Zn._createOn(t)}createRangeIn(t){return Zn._createIn(t)}createSelection(t,e,i){return new io(t,e,i)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class yf extends Xl{refresh(){this.isEnabled=du(this.editor.model)}execute(t){const e=this.editor,i=e.model,n=e.plugins.get(Yd);i.change(e=>{const o=Array.isArray(t.file)?t.file:[t.file];for(const t of o)xf(e,i,n,t)})}}function xf(t,e,i,n){const o=i.createLoader(n);o&&lu(t,e,{uploadId:o.id})} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Af extends $l{static get requires(){return[Yd,_f,Yl]}static get pluginName(){return"ImageUploadEditing"}constructor(t){super(t),t.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}})}init(){const t=this.editor,e=t.model.document,i=t.model.schema,n=t.conversion,o=t.plugins.get(Yd),r=uf(t.config.get("image.upload.types"));i.extend("image",{allowAttributes:["uploadId","uploadStatus"]}),t.commands.add("imageUpload",new yf(t)),n.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}),this.listenTo(t.editing.view.document,"clipboardInput",(e,i)=>{if(n=i.dataTransfer,Array.from(n.types).includes("text/html")&&""!==n.getData("text/html"))return;var n;const o=Array.from(i.dataTransfer.files).filter(t=>!!t&&r.test(t.type)),s=i.targetRanges.map(e=>t.editing.mapper.toModelRange(e));t.model.change(i=>{i.setSelection(s),o.length&&(e.stop(),t.model.enqueueChange("default",()=>{t.execute("imageUpload",{file:o})}))})}),this.listenTo(t.plugins.get(Yl),"inputTransformation",(e,i)=>{const n=Array.from(t.editing.view.createRangeIn(i.content)).filter(t=>{return!(!(e=t.item).is("element","img")||!e.getAttribute("src"))&&(e.getAttribute("src").match(/^data:image\/\w+;base64,/g)||e.getAttribute("src").match(/^blob:/g))&&!t.item.getAttribute("uploadProcessed");var e}).map(t=>{return{promise:(e=t.item,new Promise((t,i)=>{const n=e.getAttribute("src");fetch(n).then(t=>t.blob()).then(e=>{const i=function(t,e){return t.type?t.type:e.match(/data:(image\/\w+);base64/)?e.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}(e,n),o=i.replace("image/",""),r=new File([e],"image."+o,{type:i});t(r)}).catch(i)})),imageElement:t.item};var e});if(!n.length)return;const r=new vf(t.editing.view.document);for(const t of n){r.setAttribute("uploadProcessed",!0,t.imageElement);const e=o.createLoader(t.promise);e&&(r.setAttribute("src","",t.imageElement),r.setAttribute("uploadId",e.id,t.imageElement))}}),t.editing.view.document.on("dragover",(t,e)=>{e.preventDefault()}),e.on("change",()=>{const i=e.differ.getChanges({includeChangesInGraveyard:!0});for(const e of i)if("insert"==e.type&&"$text"!=e.name){const i=e.position.nodeAfter,n="$graveyard"==e.position.root.rootName;for(const e of Pf(t,i)){const t=e.getAttribute("uploadId");if(!t)continue;const i=o.loaders.get(t);i&&(n?i.abort():"idle"==i.status&&this._readAndUpload(i,e))}}})}_readAndUpload(t,e){const i=this.editor,n=i.model,o=i.locale.t,r=i.plugins.get(Yd),s=i.plugins.get(_f);return n.enqueueChange("transparent",t=>{t.setAttribute("uploadStatus","reading",e)}),t.read().then(()=>{const o=t.upload();if(uo.isSafari){const t=hu(i.editing.mapper.toViewElement(e));i.editing.view.once("render",()=>{if(!t.parent)return;const e=i.editing.view.domConverter.mapViewToDom(t.parent);if(!e)return;const n=e.style.display;e.style.display="none",e._ckHack=e.offsetHeight,e.style.display=n})}return n.enqueueChange("transparent",t=>{t.setAttribute("uploadStatus","uploading",e)}),o}).then(t=>{n.enqueueChange("transparent",i=>{i.setAttributes({uploadStatus:"complete",src:t.default},e),this._parseAndSetSrcsetAttributeOnImage(t,e,i)}),a()}).catch(i=>{if("error"!==t.status&&"aborted"!==t.status)throw i;"error"==t.status&&i&&s.showWarning(i,{title:o("Upload failed"),namespace:"upload"}),a(),n.enqueueChange("transparent",t=>{t.remove(e)})});function a(){n.enqueueChange("transparent",t=>{t.removeAttribute("uploadId",e),t.removeAttribute("uploadStatus",e)}),r.destroyLoader(t)}}_parseAndSetSrcsetAttributeOnImage(t,e,i){let n=0;const o=Object.keys(t).filter(t=>{const e=parseInt(t,10);if(!isNaN(e))return n=Math.max(n,e),!0}).map(e=>`${t[e]} ${e}w`).join(", ");""!=o&&i.setAttribute("srcset",{data:o,width:n},e)}}function Pf(t,e){return Array.from(t.model.createRangeOn(e)).filter(t=>t.item.is("image")).map(t=>t.item)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -function Cf(t,e,i){return i.createRange(Tf(t,e,!0,i),Tf(t,e,!1,i))}function Tf(t,e,i,n){let o=t.textNode||(i?t.nodeBefore:t.nodeAfter),r=null;for(;o&&o.getAttribute("linkHref")==e;)r=o,o=i?o.previousSibling:o.nextSibling;return r?n.createPositionAt(r,i?"before":"after"):t} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Sf extends Xl{constructor(t){super(t),this.manualDecorators=new xi}restoreManualDecoratorStates(){for(const t of this.manualDecorators)t.value=this._getDecoratorStateFromModel(t.id)}refresh(){const t=this.editor.model,e=t.document;this.value=e.selection.getAttribute("linkHref");for(const t of this.manualDecorators)t.value=this._getDecoratorStateFromModel(t.id);this.isEnabled=t.schema.checkAttributeInSelection(e.selection,"linkHref")}execute(t,e={}){const i=this.editor.model,n=i.document.selection,o=[],r=[];for(const t in e)e[t]?o.push(t):r.push(t);i.change(e=>{if(n.isCollapsed){const s=n.getFirstPosition();if(n.hasAttribute("linkHref")){const a=Cf(s,n.getAttribute("linkHref"),i);e.setAttribute("linkHref",t,a),o.forEach(t=>{e.setAttribute(t,!0,a)}),r.forEach(t=>{e.removeAttribute(t,a)}),e.setSelection(a)}else if(""!==t){const r=Vi(n.getAttributes());r.set("linkHref",t),o.forEach(t=>{r.set(t,!0)});const a=e.createText(t,r);i.insertContent(a,s),e.setSelection(e.createRangeOn(a))}}else{const s=i.schema.getValidRanges(n.getRanges(),"linkHref");for(const i of s)e.setAttribute("linkHref",t,i),o.forEach(t=>{e.setAttribute(t,!0,i)}),r.forEach(t=>{e.removeAttribute(t,i)})}})}_getDecoratorStateFromModel(t){return this.editor.model.document.selection.getAttribute(t)}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Ef extends Xl{refresh(){this.isEnabled=this.editor.model.document.selection.hasAttribute("linkHref")}execute(){const t=this.editor,e=this.editor.model,i=e.document.selection,n=t.commands.get("link");e.change(t=>{const o=i.isCollapsed?[Cf(i.getFirstPosition(),i.getAttribute("linkHref"),e)]:i.getRanges();for(const e of o)if(t.removeAttribute("linkHref",e),n)for(const i of n.manualDecorators)t.removeAttribute(i.id,e)})}}var Of=function(t,e,i){var n=t.length;return i=void 0===i?n:i,!e&&i>=n?t:nn(t,e,i)},Rf=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var If=function(t){return Rf.test(t)};var Mf=function(t){return t.split("")},Nf="[\\ud800-\\udfff]",Vf="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Bf="\\ud83c[\\udffb-\\udfff]",Ff="[^\\ud800-\\udfff]",Df="(?:\\ud83c[\\udde6-\\uddff]){2}",Lf="[\\ud800-\\udbff][\\udc00-\\udfff]",zf="(?:"+Vf+"|"+Bf+")"+"?",jf="[\\ufe0e\\ufe0f]?"+zf+("(?:\\u200d(?:"+[Ff,Df,Lf].join("|")+")[\\ufe0e\\ufe0f]?"+zf+")*"),qf="(?:"+[Ff+Vf+"?",Vf,Df,Lf,Nf].join("|")+")",Wf=RegExp(Bf+"(?="+Bf+")|"+qf+jf,"g");var Hf=function(t){return t.match(Wf)||[]};var Uf=function(t){return If(t)?Hf(t):Mf(t)};var $f=function(t){return function(e){e=Yi(e);var i=If(e)?Uf(e):void 0,n=i?i[0]:e.charAt(0),o=i?Of(i,1).join(""):e.slice(1);return n[t]()+o}}("toUpperCase"); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -const Gf=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,Kf=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;function Jf(t,e){const i=e.createAttributeElement("a",{href:t},{priority:5});return e.setCustomProperty("link",!0,i),i}function Qf(t){return function(t){return t.replace(Gf,"").match(Kf)}(t=String(t))?t:"#"} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md. - */ -class Yf{constructor(){this._definitions=new Set}get length(){return this._definitions.size}add(t){Array.isArray(t)?t.forEach(t=>this._definitions.add(t)):this._definitions.add(t)}getDispatcher(){return t=>{t.on("attribute:linkHref",(t,e,i)=>{if(!i.consumable.test(e.item,"attribute:linkHref"))return;const n=i.writer,o=n.document.selection;for(const t of this._definitions){const r=n.createAttributeElement("a",t.attributes,{priority:5});n.setCustomProperty("link",!0,r),t.callback(e.attributeNewValue)?e.item.is("selection")?n.wrap(o.getFirstRange(),r):n.wrap(i.mapper.toViewRange(e.range),r):n.unwrap(i.mapper.toViewRange(e.range),r)}},{priority:"high"})}}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Xf{constructor({id:t,label:e,attributes:i,defaultValue:n}){this.id=t,this.set("value"),this.defaultValue=n,this.label=e,this.attributes=i}}yi(Xf,qn);class Zf{constructor(t,e,i){this.model=t,this.attribute=i,this._modelSelection=t.document.selection,this._overrideUid=null,this._isNextGravityRestorationSkipped=!1,e.listenTo(this._modelSelection,"change:range",(t,e)=>{this._isNextGravityRestorationSkipped?this._isNextGravityRestorationSkipped=!1:this._isGravityOverridden&&(!e.directChange&&tg(this._modelSelection.getFirstPosition(),i)||this._restoreGravity())})}handleForwardMovement(t,e){const i=this.attribute;if(!(this._isGravityOverridden||t.isAtStart&&this._hasSelectionAttribute))return ng(t,i)&&this._hasSelectionAttribute?(this._preventCaretMovement(e),this._removeSelectionAttribute(),!0):eg(t,i)||ig(t,i)&&this._hasSelectionAttribute?(this._preventCaretMovement(e),this._overrideGravity(),!0):void 0}handleBackwardMovement(t,e){const i=this.attribute;return this._isGravityOverridden?ng(t,i)&&this._hasSelectionAttribute?(this._preventCaretMovement(e),this._restoreGravity(),this._removeSelectionAttribute(),!0):(this._preventCaretMovement(e),this._restoreGravity(),t.isAtStart&&this._removeSelectionAttribute(),!0):ng(t,i)&&!this._hasSelectionAttribute?(this._preventCaretMovement(e),this._setSelectionAttributeFromTheNodeBefore(t),!0):t.isAtEnd&&ig(t,i)?this._hasSelectionAttribute?void(og(t,i)&&(this._skipNextAutomaticGravityRestoration(),this._overrideGravity())):(this._preventCaretMovement(e),this._setSelectionAttributeFromTheNodeBefore(t),!0):t.isAtStart?this._hasSelectionAttribute?(this._removeSelectionAttribute(),this._preventCaretMovement(e),!0):void 0:void(og(t,i)&&(this._skipNextAutomaticGravityRestoration(),this._overrideGravity()))}get _isGravityOverridden(){return!!this._overrideUid}get _hasSelectionAttribute(){return this._modelSelection.hasAttribute(this.attribute)}_overrideGravity(){this._overrideUid=this.model.change(t=>t.overrideSelectionGravity())}_restoreGravity(){this.model.change(t=>{t.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}_preventCaretMovement(t){t.preventDefault()}_removeSelectionAttribute(){this.model.change(t=>{t.removeSelectionAttribute(this.attribute)})}_setSelectionAttributeFromTheNodeBefore(t){const e=this.attribute;this.model.change(i=>{i.setSelectionAttribute(this.attribute,t.nodeBefore.getAttribute(e))})}_skipNextAutomaticGravityRestoration(){this._isNextGravityRestorationSkipped=!0}}function tg(t,e){return eg(t,e)||ig(t,e)}function eg(t,e){const{nodeBefore:i,nodeAfter:n}=t,o=!!i&&i.hasAttribute(e);return!!n&&n.hasAttribute(e)&&(!o||i.getAttribute(e)!==n.getAttribute(e))}function ig(t,e){const{nodeBefore:i,nodeAfter:n}=t,o=!!i&&i.hasAttribute(e),r=!!n&&n.hasAttribute(e);return o&&(!r||i.getAttribute(e)!==n.getAttribute(e))}function ng(t,e){const{nodeBefore:i,nodeAfter:n}=t,o=!!i&&i.hasAttribute(e);if(!!n&&n.hasAttribute(e)&&o)return n.getAttribute(e)!==i.getAttribute(e)}function og(t,e){return tg(t.getShiftedBy(-1),e)}i(76); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */const rg=/^(https?:)?\/\//;class sg extends $l{static get pluginName(){return"LinkEditing"}constructor(t){super(t),t.config.define("link",{addTargetToExternalLinks:!1})}init(){const t=this.editor,e=t.locale;t.model.schema.extend("$text",{allowAttributes:"linkHref"}),t.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:Jf}),t.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(t,e)=>Jf(Qf(t),e)}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:t=>t.getAttribute("href")}}),t.commands.add("link",new Sf(t)),t.commands.add("unlink",new Ef(t));const i=function(t,e){const i={"Open in a new tab":t("Open in a new tab"),Downloadable:t("Downloadable")};return e.forEach(t=>(t.label&&i[t.label]&&(t.label=i[t.label]),t)),e}(t.t,function(t){const e=[];if(t)for(const[i,n]of Object.entries(t)){const t=Object.assign({},n,{id:"link"+$f(i)});e.push(t)}return e}(t.config.get("link.decorators")));this._enableAutomaticDecorators(i.filter(t=>"automatic"===t.mode)),this._enableManualDecorators(i.filter(t=>"manual"===t.mode)), -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -function({view:t,model:e,emitter:i,attribute:n,locale:o}){const r=new Zf(e,i,n),s=e.document.selection;i.listenTo(t.document,"keydown",(t,e)=>{if(!s.isCollapsed)return;if(e.shiftKey||e.altKey||e.ctrlKey)return;const i=e.keyCode==mo.arrowright,n=e.keyCode==mo.arrowleft;if(!i&&!n)return;const a=s.getFirstPosition(),c=o.contentLanguageDirection;let l;l="ltr"===c&&i||"rtl"===c&&n?r.handleForwardMovement(a,e):r.handleBackwardMovement(a,e),l&&t.stop()},{priority:di.get("high")+1})}({view:t.editing.view,model:t.model,emitter:this,attribute:"linkHref",locale:e}),this._setupLinkHighlight(),this._enableInsertContentSelectionAttributesFixer()}_enableAutomaticDecorators(t){const e=this.editor,i=new Yf;e.config.get("link.addTargetToExternalLinks")&&i.add({id:"linkIsExternal",mode:"automatic",callback:t=>rg.test(t),attributes:{target:"_blank",rel:"noopener noreferrer"}}),i.add(t),i.length&&e.conversion.for("downcast").add(i.getDispatcher())}_enableManualDecorators(t){if(!t.length)return;const e=this.editor,i=e.commands.get("link").manualDecorators;t.forEach(t=>{e.model.schema.extend("$text",{allowAttributes:t.id}),i.add(new Xf(t)),e.conversion.for("downcast").attributeToElement({model:t.id,view:(e,n)=>{if(e){const e=i.get(t.id).attributes,o=n.createAttributeElement("a",e,{priority:5});return n.setCustomProperty("link",!0,o),o}}}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:i.get(t.id).attributes},model:{key:t.id}})})}_setupLinkHighlight(){const t=this.editor,e=t.editing.view,i=new Set;e.document.registerPostFixer(e=>{const n=t.model.document.selection;let o=!1;if(n.hasAttribute("linkHref")){const r=Cf(n.getFirstPosition(),n.getAttribute("linkHref"),t.model),s=t.editing.mapper.toViewRange(r);for(const t of s.getItems())t.is("a")&&!t.hasClass("ck-link_selected")&&(e.addClass("ck-link_selected",t),i.add(t),o=!0)}return o}),t.conversion.for("editingDowncast").add(t=>{function n(){e.change(t=>{for(const e of i.values())t.removeClass("ck-link_selected",e),i.delete(e)})}t.on("insert",n,{priority:"highest"}),t.on("remove",n,{priority:"highest"}),t.on("attribute",n,{priority:"highest"}),t.on("selection",n,{priority:"highest"})})}_enableInsertContentSelectionAttributesFixer(){const t=this.editor.model,e=t.document.selection;t.on("insertContent",()=>{const i=e.anchor.nodeBefore,n=e.anchor.nodeAfter;e.hasAttribute("linkHref")&&i&&i.hasAttribute("linkHref")&&(n&&n.hasAttribute("linkHref")||t.change(e=>{[...t.document.selection.getAttributeKeys()].filter(t=>t.startsWith("link")).forEach(t=>e.removeSelectionAttribute(t))}))},{priority:"low"})}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class ag extends Ir{constructor(t){super(t),this.domEventType="click"}onDomEvent(t){this.fire(t.type,t)}}i(78); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class cg extends cl{constructor(t,e){super(t);const i=t.t;this.focusTracker=new Mc,this.keystrokes=new Ac,this.urlInputView=this._createUrlInput(),this.saveButtonView=this._createButton(i("Save"),Pu,"ck-button-save"),this.saveButtonView.type="submit",this.cancelButtonView=this._createButton(i("Cancel"),Cu,"ck-button-cancel","cancel"),this._manualDecoratorSwitches=this._createManualDecoratorSwitches(e),this.children=this._createFormChildren(e.manualDecorators),this._focusables=new qc,this._focusCycler=new kl({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});const n=["ck","ck-link-form"];e.manualDecorators.length&&n.push("ck-link-form_layout-vertical"),this.setTemplate({tag:"form",attributes:{class:n,tabindex:"-1"},children:this.children})}getDecoratorSwitchesState(){return Array.from(this._manualDecoratorSwitches).reduce((t,e)=>(t[e.name]=e.isOn,t),{})}render(){super.render(),Au({view:this}),[this.urlInputView,...this._manualDecoratorSwitches,this.saveButtonView,this.cancelButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createUrlInput(){const t=this.locale.t,e=new vu(this.locale,xu);return e.label=t("Link URL"),e.fieldView.placeholder="https://example.com",e}_createButton(t,e,i,n){const o=new Il(this.locale);return o.set({label:t,icon:e,tooltip:!0}),o.extendTemplate({attributes:{class:i}}),n&&o.delegate("execute").to(this,n),o}_createManualDecoratorSwitches(t){const e=this.createCollection();for(const i of t.manualDecorators){const n=new Fl(this.locale);n.set({name:i.id,label:i.label,withText:!0}),n.bind("isOn").toMany([i,t],"value",(t,e)=>void 0===e&&void 0===t?i.defaultValue:t),n.on("execute",()=>{i.set("value",!n.isOn)}),e.add(n)}return e}_createFormChildren(t){const e=this.createCollection();if(e.add(this.urlInputView),t.length){const t=new cl;t.setTemplate({tag:"ul",children:this._manualDecoratorSwitches.map(t=>({tag:"li",children:[t],attributes:{class:["ck","ck-list__item"]}})),attributes:{class:["ck","ck-reset","ck-list"]}}),e.add(t)}return e.add(this.saveButtonView),e.add(this.cancelButtonView),e}}i(80); -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class lg extends cl{constructor(t){super(t);const e=t.t;this.focusTracker=new Mc,this.keystrokes=new Ac,this.previewButtonView=this._createPreviewButton(),this.unlinkButtonView=this._createButton(e("Unlink"),'',"unlink"),this.editButtonView=this._createButton(e("Edit link"),'',"edit"),this.set("href"),this._focusables=new qc,this._focusCycler=new kl({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-actions"],tabindex:"-1"},children:[this.previewButtonView,this.editButtonView,this.unlinkButtonView]})}render(){super.render(),[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(t=>{this._focusables.add(t),this.focusTracker.add(t.element)}),this.keystrokes.listenTo(this.element)}focus(){this._focusCycler.focusFirst()}_createButton(t,e,i){const n=new Il(this.locale);return n.set({label:t,icon:e,tooltip:!0}),n.delegate("execute").to(this,i),n}_createPreviewButton(){const t=new Il(this.locale),e=this.bindTemplate,i=this.t;return t.set({withText:!0,tooltip:i("Open link in new tab")}),t.extendTemplate({attributes:{class:["ck","ck-link-actions__preview"],href:e.to("href",t=>t&&Qf(t)),target:"_blank",rel:"noopener noreferrer"}}),t.bind("label").to(this,"href",t=>t||i("This link has no URL")),t.bind("isEnabled").to(this,"href",t=>!!t),t.template.tag="a",t.template.eventListeners={},t}}class dg extends $l{static get requires(){return[Vu]}static get pluginName(){return"LinkUI"}init(){const t=this.editor;t.editing.view.addObserver(ag),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=t.plugins.get(Vu),this._createToolbarLinkButton(),this._enableUserBalloonInteractions()}destroy(){super.destroy(),this.formView.destroy()}_createActionsView(){const t=this.editor,e=new lg(t.locale),i=t.commands.get("link"),n=t.commands.get("unlink");return e.bind("href").to(i,"value"),e.editButtonView.bind("isEnabled").to(i),e.unlinkButtonView.bind("isEnabled").to(n),this.listenTo(e,"edit",()=>{this._addFormView()}),this.listenTo(e,"unlink",()=>{t.execute("unlink"),this._hideUI()}),e.keystrokes.set("Esc",(t,e)=>{this._hideUI(),e()}),e.keystrokes.set("Ctrl+K",(t,e)=>{this._addFormView(),e()}),e}_createFormView(){const t=this.editor,e=t.commands.get("link"),i=new cg(t.locale,e);return i.urlInputView.fieldView.bind("value").to(e,"value"),i.urlInputView.bind("isReadOnly").to(e,"isEnabled",t=>!t),i.saveButtonView.bind("isEnabled").to(e),this.listenTo(i,"submit",()=>{t.execute("link",i.urlInputView.fieldView.element.value,i.getDecoratorSwitchesState()),this._closeFormView()}),this.listenTo(i,"cancel",()=>{this._closeFormView()}),i.keystrokes.set("Esc",(t,e)=>{this._closeFormView(),e()}),i}_createToolbarLinkButton(){const t=this.editor,e=t.commands.get("link"),i=t.t;t.keystrokes.set("Ctrl+K",(t,e)=>{e(),this._showUI(!0)}),t.ui.componentFactory.add("link",t=>{const n=new Il(t);return n.isEnabled=!0,n.label=i("Link"),n.icon='',n.keystroke="Ctrl+K",n.tooltip=!0,n.isToggleable=!0,n.bind("isEnabled").to(e,"isEnabled"),n.bind("isOn").to(e,"value",t=>!!t),this.listenTo(n,"execute",()=>this._showUI(!0)),n})}_enableUserBalloonInteractions(){const t=this.editor.editing.view.document;this.listenTo(t,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),this.editor.keystrokes.set("Tab",(t,e)=>{this._areActionsVisible&&!this.actionsView.focusTracker.isFocused&&(this.actionsView.focus(),e())},{priority:"high"}),this.editor.keystrokes.set("Esc",(t,e)=>{this._isUIVisible&&(this._hideUI(),e())}),Dl({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:[this._balloon.view.element],callback:()=>this._hideUI()})}_addActionsView(){this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()})}_addFormView(){if(this._isFormInPanel)return;const t=this.editor.commands.get("link");this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.urlInputView.fieldView.element.value=t.value||""}_closeFormView(){const t=this.editor.commands.get("link");t.restoreManualDecoratorStates(),void 0!==t.value?this._removeFormView():this._hideUI()}_removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus())}_showUI(t=!1){this._getSelectedLinkElement()?(this._areActionsVisible?this._addFormView():this._addActionsView(),t&&this._balloon.showStack("main")):(this._addActionsView(),t&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(){if(!this._isUIInPanel)return;const t=this.editor;this.stopListening(t.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),t.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView)}_startUpdatingUI(){const t=this.editor,e=t.editing.view.document;let i=this._getSelectedLinkElement(),n=r();const o=()=>{const t=this._getSelectedLinkElement(),e=r();i&&!t||!i&&e!==n?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),i=t,n=e};function r(){return e.selection.focus.getAncestors().reverse().find(t=>t.is("element"))}this.listenTo(t.ui,"update",o),this.listenTo(this._balloon,"change:visibleView",o)}get _isFormInPanel(){return this._balloon.hasView(this.formView)}get _areActionsInPanel(){return this._balloon.hasView(this.actionsView)}get _areActionsVisible(){return this._balloon.visibleView===this.actionsView}get _isUIInPanel(){return this._isFormInPanel||this._areActionsInPanel}get _isUIVisible(){return this._balloon.visibleView==this.formView||this._areActionsVisible}_getBalloonPositionData(){const t=this.editor.editing.view,e=t.document,i=this._getSelectedLinkElement();return{target:i?t.domConverter.mapViewToDom(i):t.domConverter.viewRangeToDom(e.selection.getFirstRange())}}_getSelectedLinkElement(){const t=this.editor.editing.view,e=t.document.selection;if(e.isCollapsed)return hg(e.getFirstPosition());{const i=e.getFirstRange().getTrimmed(),n=hg(i.start),o=hg(i.end);return n&&n==o&&t.createRangeIn(n).getTrimmed().isEqual(i)?n:null}}}function hg(t){return t.getAncestors().find(t=>{return(e=t).is("attributeElement")&&!!e.getCustomProperty("link");var e})} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class ug extends Xl{constructor(t,e){super(t),this.type=e}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=t.document,i=Array.from(e.selection.getSelectedBlocks()).filter(e=>gg(e,t.schema)),n=!0===this.value;t.change(t=>{if(n){let e=i[i.length-1].nextSibling,n=Number.POSITIVE_INFINITY,o=[];for(;e&&"listItem"==e.name&&0!==e.getAttribute("listIndent");){const t=e.getAttribute("listIndent");t=i;)r>o.getAttribute("listIndent")&&(r=o.getAttribute("listIndent")),o.getAttribute("listIndent")==r&&t[e?"unshift":"push"](o),o=o[e?"previousSibling":"nextSibling"]}}function gg(t,e){return e.checkChild(t.parent,"listItem")&&!e.isObject(t)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class mg extends Xl{constructor(t,e){super(t),this._indentBy="forward"==e?1:-1}refresh(){this.isEnabled=this._checkEnabled()}execute(){const t=this.editor.model,e=t.document;let i=Array.from(e.selection.getSelectedBlocks());t.change(t=>{const e=i[i.length-1];let n=e.nextSibling;for(;n&&"listItem"==n.name&&n.getAttribute("listIndent")>e.getAttribute("listIndent");)i.push(n),n=n.nextSibling;this._indentBy<0&&(i=i.reverse());for(const e of i){const i=e.getAttribute("listIndent")+this._indentBy;i<0?t.rename(e,"paragraph"):t.setAttribute("listIndent",i,e)}})}_checkEnabled(){const t=Ph(this.editor.model.document.selection.getSelectedBlocks());if(!t||!t.is("listItem"))return!1;if(this._indentBy>0){const e=t.getAttribute("listIndent"),i=t.getAttribute("listType");let n=t.previousSibling;for(;n&&n.is("listItem")&&n.getAttribute("listIndent")>=e;){if(n.getAttribute("listIndent")==e)return n.getAttribute("listType")==i;n=n.previousSibling}return!1}return!0}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function pg(t,e){const i=e.mapper,n=e.writer,o="numbered"==t.getAttribute("listType")?"ol":"ul",r=function(t){const e=t.createContainerElement("li");return e.getFillerOffset=yg,e}(n),s=n.createContainerElement(o,null);return n.insert(n.createPositionAt(s,0),r),i.bindElements(t,r),r}function bg(t,e,i,n){const o=e.parent,r=i.mapper,s=i.writer;let a=r.toViewPosition(n.createPositionBefore(t));const c=_g(t.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:t.getAttribute("listIndent")}),l=t.previousSibling;if(c&&c.getAttribute("listIndent")==t.getAttribute("listIndent")){const t=r.toViewElement(c);a=s.breakContainer(s.createPositionAfter(t))}else a=l&&"listItem"==l.name?r.toViewPosition(n.createPositionAt(l,"end")):r.toViewPosition(n.createPositionBefore(t));if(a=kg(a),s.insert(a,o),l&&"listItem"==l.name){const t=r.toViewElement(l),i=s.createRange(s.createPositionAt(t,0),a).getWalker({ignoreElementEnd:!0});for(const t of i)if(t.item.is("li")){const n=s.breakContainer(s.createPositionBefore(t.item)),o=t.item.parent,r=s.createPositionAt(e,"end");wg(s,r.nodeBefore,r.nodeAfter),s.move(s.createRangeOn(o),r),i.position=n}}else{const i=o.nextSibling;if(i&&(i.is("ul")||i.is("ol"))){let n=null;for(const e of i.getChildren()){const i=r.toModelElement(e);if(!(i&&i.getAttribute("listIndent")>t.getAttribute("listIndent")))break;n=e}n&&(s.breakContainer(s.createPositionAfter(n)),s.move(s.createRangeOn(n.parent),s.createPositionAt(e,"end")))}}wg(s,o,o.nextSibling),wg(s,o.previousSibling,o)}function wg(t,e,i){return!e||!i||"ul"!=e.name&&"ol"!=e.name||e.name!=i.name||e.getAttribute("class")!==i.getAttribute("class")?null:t.mergeContainers(t.createPositionAfter(e))}function kg(t){return t.getLastMatchingPosition(t=>t.item.is("uiElement"))}function _g(t,e){const i=!!e.sameIndent,n=!!e.smallerIndent,o=e.listIndent;let r=t;for(;r&&"listItem"==r.name;){const t=r.getAttribute("listIndent");if(i&&o==t||n&&o>t)return r;r=r.previousSibling}return null}function vg(t,e,i,n){t.ui.componentFactory.add(e,o=>{const r=t.commands.get(e),s=new Il(o);return s.set({label:i,icon:n,tooltip:!0,isToggleable:!0}),s.bind("isOn","isEnabled").to(r,"value","isEnabled"),s.on("execute",()=>{t.execute(e),t.editing.view.focus()}),s})}function yg(){const t=!this.isEmpty&&("ul"==this.getChild(0).name||"ol"==this.getChild(0).name);return this.isEmpty||t?0:Bn.call(this)} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */function xg(t){return(e,i,n)=>{const o=n.consumable;if(!o.test(i.item,"insert")||!o.test(i.item,"attribute:listType")||!o.test(i.item,"attribute:listIndent"))return;o.consume(i.item,"insert"),o.consume(i.item,"attribute:listType"),o.consume(i.item,"attribute:listIndent");const r=i.item;bg(r,pg(r,n),n,t)}}function Ag(t,e,i){if(!i.consumable.consume(e.item,"attribute:listType"))return;const n=i.mapper.toViewElement(e.item),o=i.writer;o.breakContainer(o.createPositionBefore(n)),o.breakContainer(o.createPositionAfter(n));const r=n.parent,s="numbered"==e.attributeNewValue?"ol":"ul";o.rename(s,r)}function Pg(t,e,i){const n=i.mapper.toViewElement(e.item).parent,o=i.writer;wg(o,n,n.nextSibling),wg(o,n.previousSibling,n);for(const t of e.item.getChildren())i.consumable.consume(t,"insert")}function Cg(t,e,i){if("listItem"!=e.item.name){let t=i.mapper.toViewPosition(e.range.start);const n=i.writer,o=[];for(;("ul"==t.parent.name||"ol"==t.parent.name)&&(t=n.breakContainer(t),"li"==t.parent.name);){const e=t,i=n.createPositionAt(t.parent,"end");if(!e.isEqual(i)){const t=n.remove(n.createRange(e,i));o.push(t)}t=n.createPositionAfter(t.parent)}if(o.length>0){for(let e=0;e0){const e=wg(n,i,i.nextSibling);e&&e.parent==i&&t.offset--}}wg(n,t.nodeBefore,t.nodeAfter)}}}function Tg(t,e,i){const n=i.mapper.toViewPosition(e.position),o=n.nodeBefore,r=n.nodeAfter;wg(i.writer,o,r)}function Sg(t,e,i){if(i.consumable.consume(e.viewItem,{name:!0})){const t=i.writer,n=t.createElement("listItem"),o=function(t){let e=0,i=t.parent;for(;i;){if(i.is("li"))e++;else{const t=i.previousSibling;t&&t.is("li")&&e++}i=i.parent}return e} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */(e.viewItem);t.setAttribute("listIndent",o,n);const r=e.viewItem.parent&&"ol"==e.viewItem.parent.name?"numbered":"bulleted";t.setAttribute("listType",r,n);const s=i.splitToAllowedParent(n,e.modelCursor);if(!s)return;t.insert(n,s.position);const a=function(t,e,i){const{writer:n,schema:o}=i;let r=n.createPositionAfter(t);for(const s of e)if("ul"==s.name||"ol"==s.name)r=i.convertItem(s,r).modelCursor;else{const e=i.convertItem(s,n.createPositionAt(t,"end")),a=e.modelRange.start.nodeAfter;a&&a.is("element")&&!o.checkChild(t,a.name)&&(t=e.modelCursor.parent.is("listItem")?e.modelCursor.parent:Mg(e.modelCursor),r=n.createPositionAfter(t))}return r}(n,e.viewItem.getChildren(),i);e.modelRange=t.createRange(e.modelCursor,a),s.cursorParent?e.modelCursor=t.createPositionAt(s.cursorParent,0):e.modelCursor=e.modelRange.end}}function Eg(t,e,i){if(i.consumable.test(e.viewItem,{name:!0})){const t=Array.from(e.viewItem.getChildren());for(const e of t){!(e.is("li")||Vg(e))&&e._remove()}}}function Og(t,e,i){if(i.consumable.test(e.viewItem,{name:!0})){if(0===e.viewItem.childCount)return;const t=[...e.viewItem.getChildren()];let i=!1,n=!0;for(const e of t)i&&!Vg(e)&&e._remove(),e.is("text")?(n&&(e._data=e.data.replace(/^\s+/,"")),e.nextSibling&&!Vg(e.nextSibling)||(e._data=e.data.replace(/\s+$/,""))):Vg(e)&&(i=!0),n=!1}}function Rg(t){return(e,i)=>{if(i.isPhantom)return;const n=i.modelPosition.nodeBefore;if(n&&n.is("listItem")){const e=i.mapper.toViewElement(n),o=e.getAncestors().find(Vg),r=t.createPositionAt(e,0).getWalker();for(const t of r){if("elementStart"==t.type&&t.item.is("li")){i.viewPosition=t.previousPosition;break}if("elementEnd"==t.type&&t.item==o){i.viewPosition=t.nextPosition;break}}}}}function Ig(t,[e,i]){let n,o=e.is("documentFragment")?e.getChild(0):e;if(n=i?this.createSelection(i):this.document.selection,o&&o.is("listItem")){const t=n.getFirstPosition();let e=null;if(t.parent.is("listItem")?e=t.parent:t.nodeBefore&&t.nodeBefore.is("listItem")&&(e=t.nodeBefore),e){const t=e.getAttribute("listIndent");if(t>0)for(;o&&o.is("listItem");)o._setAttribute("listIndent",o.getAttribute("listIndent")+t),o=o.nextSibling}}}function Mg(t){const e=new bs({startPosition:t});let i;do{i=e.next()}while(!i.value.item.is("listItem"));return i.value.item}function Ng(t,e,i,n,o,r){const s=_g(e.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:t,foo:"b"}),a=o.mapper,c=o.writer,l=s?s.getAttribute("listIndent"):null;let d;if(s)if(l==t){const t=a.toViewElement(s).parent;d=c.createPositionAfter(t)}else{const t=r.createPositionAt(s,"end");d=a.toViewPosition(t)}else d=i;d=kg(d);for(const t of[...n.getChildren()])Vg(t)&&(d=c.move(c.createRangeOn(t),d).end,wg(c,t,t.nextSibling),wg(c,t.previousSibling,t))}function Vg(t){return t.is("ol")||t.is("ul")}class Bg extends $l{static get pluginName(){return"ListEditing"}static get requires(){return[Xh]}init(){const t=this.editor;t.model.schema.register("listItem",{inheritAllFrom:"$block",allowAttributes:["listType","listIndent"]});const e=t.data,i=t.editing;var n;t.model.document.registerPostFixer(e=>function(t,e){const i=t.document.differ.getChanges(),n=new Map;let o=!1;for(const n of i)if("insert"==n.type&&"listItem"==n.name)r(n.position);else if("insert"==n.type&&"listItem"!=n.name){if("$text"!=n.name){const i=n.position.nodeAfter;i.hasAttribute("listIndent")&&(e.removeAttribute("listIndent",i),o=!0),i.hasAttribute("listType")&&(e.removeAttribute("listType",i),o=!0);for(const e of Array.from(t.createRangeIn(i)).filter(t=>t.item.is("listItem")))r(e.previousPosition)}r(n.position.getShiftedBy(n.length))}else"remove"==n.type&&"listItem"==n.name?r(n.position):("attribute"==n.type&&"listIndent"==n.attributeKey||"attribute"==n.type&&"listType"==n.attributeKey)&&r(n.range.start);for(const t of n.values())s(t),a(t);return o;function r(t){const e=t.nodeBefore;if(e&&e.is("listItem")){let t=e;if(n.has(t))return;for(let e=t.previousSibling;e&&e.is("listItem");e=t.previousSibling)if(t=e,n.has(t))return;n.set(e,t)}else{const e=t.nodeAfter;e&&e.is("listItem")&&n.set(e,e)}}function s(t){let i=0,n=null;for(;t&&t.is("listItem");){const r=t.getAttribute("listIndent");if(r>i){let s;null===n?(n=r-i,s=i):(n>r&&(n=r),s=r-n),e.setAttribute("listIndent",s,t),o=!0}else n=null,i=t.getAttribute("listIndent")+1;t=t.nextSibling}}function a(t){let i=[],n=null;for(;t&&t.is("listItem");){const r=t.getAttribute("listIndent");if(n&&n.getAttribute("listIndent")>r&&(i=i.slice(0,r+1)),0!=r)if(i[r]){const n=i[r];t.getAttribute("listType")!=n&&(e.setAttribute("listType",n,t),o=!0)}else i[r]=t.getAttribute("listType");n=t,t=t.nextSibling}}}(t.model,e)),i.mapper.registerViewToModelLength("li",Fg),e.mapper.registerViewToModelLength("li",Fg),i.mapper.on("modelToViewPosition",Rg(i.view)),i.mapper.on("viewToModelPosition",(n=t.model,(t,e)=>{const i=e.viewPosition,o=i.parent,r=e.mapper;if("ul"==o.name||"ol"==o.name){if(i.isAtEnd){const t=r.toModelElement(i.nodeBefore),o=r.getModelLength(i.nodeBefore);e.modelPosition=n.createPositionBefore(t).getShiftedBy(o)}else{const t=r.toModelElement(i.nodeAfter);e.modelPosition=n.createPositionBefore(t)}t.stop()}else if("li"==o.name&&i.nodeBefore&&("ul"==i.nodeBefore.name||"ol"==i.nodeBefore.name)){const s=r.toModelElement(o);let a=1,c=i.nodeBefore;for(;c&&Vg(c);)a+=r.getModelLength(c),c=c.previousSibling;e.modelPosition=n.createPositionBefore(s).getShiftedBy(a),t.stop()}})),e.mapper.on("modelToViewPosition",Rg(i.view)),t.conversion.for("editingDowncast").add(e=>{e.on("insert",Cg,{priority:"high"}),e.on("insert:listItem",xg(t.model)),e.on("attribute:listType:listItem",Ag,{priority:"high"}),e.on("attribute:listType:listItem",Pg,{priority:"low"}),e.on("attribute:listIndent:listItem",function(t){return(e,i,n)=>{if(!n.consumable.consume(i.item,"attribute:listIndent"))return;const o=n.mapper.toViewElement(i.item),r=n.writer;r.breakContainer(r.createPositionBefore(o)),r.breakContainer(r.createPositionAfter(o));const s=o.parent,a=s.previousSibling,c=r.createRangeOn(s);r.remove(c),a&&a.nextSibling&&wg(r,a,a.nextSibling),Ng(i.attributeOldValue+1,i.range.start,c.start,o,n,t),bg(i.item,o,n,t);for(const t of i.item.getChildren())n.consumable.consume(t,"insert")}}(t.model)),e.on("remove:listItem",function(t){return(e,i,n)=>{const o=n.mapper.toViewPosition(i.position).getLastMatchingPosition(t=>!t.item.is("li")).nodeAfter,r=n.writer;r.breakContainer(r.createPositionBefore(o)),r.breakContainer(r.createPositionAfter(o));const s=o.parent,a=s.previousSibling,c=r.createRangeOn(s),l=r.remove(c);a&&a.nextSibling&&wg(r,a,a.nextSibling),Ng(n.mapper.toModelElement(o).getAttribute("listIndent")+1,i.position,c.start,o,n,t);for(const t of r.createRangeIn(l).getItems())n.mapper.unbindViewElement(t);e.stop()}}(t.model)),e.on("remove",Tg,{priority:"low"})}),t.conversion.for("dataDowncast").add(e=>{e.on("insert",Cg,{priority:"high"}),e.on("insert:listItem",xg(t.model))}),t.conversion.for("upcast").add(t=>{t.on("element:ul",Eg,{priority:"high"}),t.on("element:ol",Eg,{priority:"high"}),t.on("element:li",Og,{priority:"high"}),t.on("element:li",Sg)}),t.model.on("insertContent",Ig,{priority:"high"}),t.commands.add("numberedList",new ug(t,"numbered")),t.commands.add("bulletedList",new ug(t,"bulleted")),t.commands.add("indentList",new mg(t,"forward")),t.commands.add("outdentList",new mg(t,"backward"));const o=i.view.document;this.listenTo(o,"enter",(t,e)=>{const i=this.editor.model.document,n=i.selection.getLastPosition().parent;i.selection.isCollapsed&&"listItem"==n.name&&n.isEmpty&&(this.editor.execute("outdentList"),e.preventDefault(),t.stop())}),this.listenTo(o,"delete",(t,e)=>{if("backward"!==e.direction)return;const i=this.editor.model.document.selection;if(!i.isCollapsed)return;const n=i.getFirstPosition();if(!n.isAtStart)return;const o=n.parent;"listItem"===o.name&&(o.previousSibling&&"listItem"===o.previousSibling.name||(this.editor.execute("outdentList"),e.preventDefault(),t.stop()))},{priority:"high"});const r=t=>(e,i)=>{this.editor.commands.get(t).isEnabled&&(this.editor.execute(t),i())};t.keystrokes.set("Tab",r("indentList")),t.keystrokes.set("Shift+Tab",r("outdentList"))}afterInit(){const t=this.editor.commands,e=t.get("indent"),i=t.get("outdent");e&&e.registerChildCommand(t.get("indentList")),i&&i.registerChildCommand(t.get("outdentList"))}}function Fg(t){let e=1;for(const i of t.getChildren())if("ul"==i.name||"ol"==i.name)for(const t of i.getChildren())e+=Fg(t);return e} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */ -class Dg extends $l{init(){const t=this.editor.t;vg(this.editor,"numberedList",t("Numbered List"),''),vg(this.editor,"bulletedList",t("Bulleted List"),'')}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */class Lg{constructor(t,e){this.loader=t,this.options=e}upload(){return this.loader.file.then(t=>new Promise((e,i)=>{this._initRequest(),this._initListeners(e,i,t),this._sendRequest(t)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){const t=this.xhr=new XMLHttpRequest;t.open("POST",this.options.uploadUrl,!0),t.responseType="json"}_initListeners(t,e,i){const n=this.xhr,o=this.loader,r=`Couldn't upload file: ${i.name}.`;n.addEventListener("error",()=>e(r)),n.addEventListener("abort",()=>e()),n.addEventListener("load",()=>{const i=n.response;if(!i||i.error)return e(i&&i.error&&i.error.message?i.error.message:r);t(i.url?{default:i.url}:i.urls)}),n.upload&&n.upload.addEventListener("progress",t=>{t.lengthComputable&&(o.uploadTotal=t.total,o.uploaded=t.loaded)})}_sendRequest(t){const e=this.options.headers||{};for(const t of Object.keys(e))this.xhr.setRequestHeader(t,e[t]);const i=new FormData;i.append("upload",t),this.xhr.send(i)}}class zg extends Ul{}zg.builtinPlugins=[class extends $l{static get requires(){return[Yl,od,fd,cd,Td,Gd]}static get pluginName(){return"Essentials"}},class extends $l{static get requires(){return[Yd]}static get pluginName(){return"CKFinderUploadAdapter"}init(){const t=this.editor.config.get("ckfinder.uploadUrl");t&&(this.editor.plugins.get(Yd).createUploadAdapter=e=>new th(e,t,this.editor.t))}},class extends $l{static get pluginName(){return"Autoformat"}afterInit(){this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats(),this._addCodeBlockAutoformats()}_addListAutoformats(){const t=this.editor.commands;t.get("bulletedList")&&new eh(this.editor,/^[*-]\s$/,"bulletedList"),t.get("numberedList")&&new eh(this.editor,/^1[.|)]\s$/,"numberedList")}_addBasicStylesAutoformats(){const t=this.editor.commands;if(t.get("bold")){const t=oh(this.editor,"bold");new ih(this.editor,/(\*\*)([^*]+)(\*\*)$/g,t),new ih(this.editor,/(__)([^_]+)(__)$/g,t)}if(t.get("italic")){const t=oh(this.editor,"italic");new ih(this.editor,/(?:^|[^*])(\*)([^*_]+)(\*)$/g,t),new ih(this.editor,/(?:^|[^_])(_)([^_]+)(_)$/g,t)}if(t.get("code")){const t=oh(this.editor,"code");new ih(this.editor,/(`)([^`]+)(`)$/g,t)}if(t.get("strikethrough")){const t=oh(this.editor,"strikethrough");new ih(this.editor,/(~~)([^~]+)(~~)$/g,t)}}_addHeadingAutoformats(){const t=this.editor.commands.get("heading");t&&t.modelElements.filter(t=>t.match(/^heading[1-6]$/)).forEach(e=>{const i=e[7],n=new RegExp(`^(#{${i}})\\s$`);new eh(this.editor,n,()=>{if(!t.isEnabled)return!1;this.editor.execute("heading",{value:e})})})}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&new eh(this.editor,/^>\s$/,"blockQuote")}_addCodeBlockAutoformats(){this.editor.commands.get("codeBlock")&&new eh(this.editor,/^```$/,"codeBlock")}},class extends $l{static get requires(){return[sh,ah]}static get pluginName(){return"Bold"}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */,class extends $l{static get requires(){return[ch,lh]}static get pluginName(){return"Italic"}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */,class extends $l{static get requires(){return[dh,hh]}static get pluginName(){return"Underline"}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */,class extends $l{static get requires(){return[uh,fh]}static get pluginName(){return"Strikethrough"}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */,class extends $l{static get requires(){return[gh,mh]}static get pluginName(){return"Code"}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */,class extends $l{static get requires(){return[ph,bh]}static get pluginName(){return"Subscript"}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */,class extends $l{static get requires(){return[wh,kh]}static get pluginName(){return"Superscript"}},class extends $l{static get pluginName(){return"Indent"}static get requires(){return[vh,Ah]}},class extends $l{constructor(t){super(t),t.config.define("indentBlock",{offset:40,unit:"px"})}static get pluginName(){return"IndentBlock"}init(){const t=this.editor,e=t.config.get("indentBlock"),i=!e.classes||!e.classes.length,n=Object.assign({direction:"forward"},e),o=Object.assign({direction:"backward"},e);i?(t.data.addStyleProcessorRules(Rh),this._setupConversionUsingOffset(t.conversion),t.commands.add("indentBlock",new Ch(t,new Th(n))),t.commands.add("outdentBlock",new Ch(t,new Th(o)))):(this._setupConversionUsingClasses(e.classes),t.commands.add("indentBlock",new Ch(t,new Sh(n))),t.commands.add("outdentBlock",new Ch(t,new Sh(o))))}afterInit(){const t=this.editor,e=t.model.schema,i=t.commands.get("indent"),n=t.commands.get("outdent");["paragraph","heading1","heading2","heading3","heading4","heading5","heading6"].forEach(t=>{e.isRegistered(t)&&e.extend(t,{allowAttributes:"blockIndent"})}),i.registerChildCommand(t.commands.get("indentBlock")),n.registerChildCommand(t.commands.get("outdentBlock"))}_setupConversionUsingOffset(){const t=this.editor.conversion,e="rtl"===this.editor.locale.contentLanguageDirection?"margin-right":"margin-left";t.for("upcast").attributeToAttribute({view:{styles:{[e]:/[\s\S]+/}},model:{key:"blockIndent",value:t=>t.getStyle(e)}}),t.for("downcast").attributeToAttribute({model:"blockIndent",view:t=>({key:"style",value:{[e]:t}})})}_setupConversionUsingClasses(t){const e={model:{key:"blockIndent",values:[]},view:{}};for(const i of t)e.model.values.push(i),e.view[i]={key:"class",value:[i]};this.editor.conversion.attributeToAttribute(e)}},class extends $l{static get requires(){return[qh,Wh]}static get pluginName(){return"HorizontalLine"}},class extends $l{static get requires(){return[Kh,Jh]}static get pluginName(){return"BlockQuote"}},class extends $l{static get requires(){return[nu,ru]}static get pluginName(){return"Heading"}},class extends $l{static get requires(){return[gu,bu,zu]}static get pluginName(){return"Image"}},class extends $l{static get requires(){return[Wu]}static get pluginName(){return"ImageCaption"}},class extends $l{static get requires(){return[rf,sf]}static get pluginName(){return"ImageStyle"}},class extends $l{static get requires(){return[af]}static get pluginName(){return"ImageToolbar"}afterInit(){const t=this.editor,e=t.t;t.plugins.get(af).register("image",{ariaLabel:e("Image toolbar"),items:t.config.get("image.toolbar")||[],getRelatedElement:au})}},class extends $l{static get pluginName(){return"ImageUpload"}static get requires(){return[Af,ff,gf]}},class extends $l{static get requires(){return[sg,dg]}static get pluginName(){return"Link"}},class extends $l{static get requires(){return[Bg,Dg]}static get pluginName(){return"List"}} -/** - * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license - */,Xh,class extends $l{static get requires(){return[Yd]}static get pluginName(){return"SimpleUploadAdapter"}init(){const t=this.editor.config.get("simpleUpload");t&&(t.uploadUrl?this.editor.plugins.get(Yd).createUploadAdapter=e=>new Lg(e,t):console.warn(Object(hi.a)('simple-upload-adapter-missing-uploadUrl: Missing the "uploadUrl" property in the "simpleUpload" editor configuration.')))}}],window.ClassicEditor=zg}]); \ No newline at end of file +/******/ (() => { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ "./ckanext/showcase/assets/src/ckeditor.js": +/*!*************************************************!*\ + !*** ./ckanext/showcase/assets/src/ckeditor.js ***! + \*************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ClassicEditor)\n/* harmony export */ });\n/* harmony import */ var _ckeditor_ckeditor5_editor_classic_src_classiceditor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-editor-classic/src/classiceditor */ \"./node_modules/@ckeditor/ckeditor5-editor-classic/src/classiceditor.js\");\n/* harmony import */ var _ckeditor_ckeditor5_essentials_src_essentials__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-essentials/src/essentials */ \"./node_modules/@ckeditor/ckeditor5-essentials/src/essentials.js\");\n/* harmony import */ var _ckeditor_ckeditor5_autoformat_src_autoformat__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-autoformat/src/autoformat */ \"./node_modules/@ckeditor/ckeditor5-autoformat/src/autoformat.js\");\n/* harmony import */ var _ckeditor_ckeditor5_adapter_ckfinder_src_uploadadapter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter */ \"./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter.js\");\n/* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_bold__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/bold */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold.js\");\n/* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_italic__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/italic */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic.js\");\n/* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_underline__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/underline */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline.js\");\n/* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_strikethrough__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/strikethrough */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough.js\");\n/* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_code__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/code */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/code.js\");\n/* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_subscript__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/subscript */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript.js\");\n/* harmony import */ var _ckeditor_ckeditor5_basic_styles_src_superscript__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @ckeditor/ckeditor5-basic-styles/src/superscript */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript.js\");\n/* harmony import */ var _ckeditor_ckeditor5_indent_src_indent__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @ckeditor/ckeditor5-indent/src/indent */ \"./node_modules/@ckeditor/ckeditor5-indent/src/indent.js\");\n/* harmony import */ var _ckeditor_ckeditor5_indent_src_indentblock__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @ckeditor/ckeditor5-indent/src/indentblock */ \"./node_modules/@ckeditor/ckeditor5-indent/src/indentblock.js\");\n/* harmony import */ var _ckeditor_ckeditor5_horizontal_line_src_horizontalline__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @ckeditor/ckeditor5-horizontal-line/src/horizontalline */ \"./node_modules/@ckeditor/ckeditor5-horizontal-line/src/horizontalline.js\");\n/* harmony import */ var _ckeditor_ckeditor5_block_quote_src_blockquote__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @ckeditor/ckeditor5-block-quote/src/blockquote */ \"./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquote.js\");\n/* harmony import */ var _ckeditor_ckeditor5_heading_src_heading__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @ckeditor/ckeditor5-heading/src/heading */ \"./node_modules/@ckeditor/ckeditor5-heading/src/heading.js\");\n/* harmony import */ var _ckeditor_ckeditor5_image_src_image__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/image */ \"./node_modules/@ckeditor/ckeditor5-image/src/image.js\");\n/* harmony import */ var _ckeditor_ckeditor5_image_src_imagecaption__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imagecaption */ \"./node_modules/@ckeditor/ckeditor5-image/src/imagecaption.js\");\n/* harmony import */ var _ckeditor_ckeditor5_image_src_imagestyle__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imagestyle */ \"./node_modules/@ckeditor/ckeditor5-image/src/imagestyle.js\");\n/* harmony import */ var _ckeditor_ckeditor5_image_src_imagetoolbar__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imagetoolbar */ \"./node_modules/@ckeditor/ckeditor5-image/src/imagetoolbar.js\");\n/* harmony import */ var _ckeditor_ckeditor5_image_src_imageupload__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @ckeditor/ckeditor5-image/src/imageupload */ \"./node_modules/@ckeditor/ckeditor5-image/src/imageupload.js\");\n/* harmony import */ var _ckeditor_ckeditor5_link_src_link__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @ckeditor/ckeditor5-link/src/link */ \"./node_modules/@ckeditor/ckeditor5-link/src/link.js\");\n/* harmony import */ var _ckeditor_ckeditor5_list_src_list__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @ckeditor/ckeditor5-list/src/list */ \"./node_modules/@ckeditor/ckeditor5-list/src/list.js\");\n/* harmony import */ var _ckeditor_ckeditor5_paragraph_src_paragraph__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @ckeditor/ckeditor5-paragraph/src/paragraph */ \"./node_modules/@ckeditor/ckeditor5-paragraph/src/paragraph.js\");\n/* harmony import */ var _ckeditor_ckeditor5_upload_src_adapters_simpleuploadadapter__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @ckeditor/ckeditor5-upload/src/adapters/simpleuploadadapter */ \"./node_modules/@ckeditor/ckeditor5-upload/src/adapters/simpleuploadadapter.js\");\n\n\n\n\n\n// ckeditor5-basic-styles\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nclass ClassicEditor extends _ckeditor_ckeditor5_editor_classic_src_classiceditor__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {}\n\nClassicEditor.builtinPlugins = [\n _ckeditor_ckeditor5_essentials_src_essentials__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n _ckeditor_ckeditor5_adapter_ckfinder_src_uploadadapter__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n _ckeditor_ckeditor5_autoformat_src_autoformat__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n _ckeditor_ckeditor5_basic_styles_src_bold__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n _ckeditor_ckeditor5_basic_styles_src_italic__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n _ckeditor_ckeditor5_basic_styles_src_underline__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n _ckeditor_ckeditor5_basic_styles_src_strikethrough__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n _ckeditor_ckeditor5_basic_styles_src_code__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n _ckeditor_ckeditor5_basic_styles_src_subscript__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n _ckeditor_ckeditor5_basic_styles_src_superscript__WEBPACK_IMPORTED_MODULE_10__[\"default\"],\n _ckeditor_ckeditor5_indent_src_indent__WEBPACK_IMPORTED_MODULE_11__[\"default\"],\n _ckeditor_ckeditor5_indent_src_indentblock__WEBPACK_IMPORTED_MODULE_12__[\"default\"],\n _ckeditor_ckeditor5_horizontal_line_src_horizontalline__WEBPACK_IMPORTED_MODULE_13__[\"default\"],\n _ckeditor_ckeditor5_block_quote_src_blockquote__WEBPACK_IMPORTED_MODULE_14__[\"default\"],\n _ckeditor_ckeditor5_heading_src_heading__WEBPACK_IMPORTED_MODULE_15__[\"default\"],\n _ckeditor_ckeditor5_image_src_image__WEBPACK_IMPORTED_MODULE_16__[\"default\"],\n _ckeditor_ckeditor5_image_src_imagecaption__WEBPACK_IMPORTED_MODULE_17__[\"default\"],\n _ckeditor_ckeditor5_image_src_imagestyle__WEBPACK_IMPORTED_MODULE_18__[\"default\"],\n _ckeditor_ckeditor5_image_src_imagetoolbar__WEBPACK_IMPORTED_MODULE_19__[\"default\"],\n _ckeditor_ckeditor5_image_src_imageupload__WEBPACK_IMPORTED_MODULE_20__[\"default\"],\n _ckeditor_ckeditor5_link_src_link__WEBPACK_IMPORTED_MODULE_21__[\"default\"],\n _ckeditor_ckeditor5_list_src_list__WEBPACK_IMPORTED_MODULE_22__[\"default\"],\n _ckeditor_ckeditor5_paragraph_src_paragraph__WEBPACK_IMPORTED_MODULE_23__[\"default\"],\n _ckeditor_ckeditor5_upload_src_adapters_simpleuploadadapter__WEBPACK_IMPORTED_MODULE_24__[\"default\"]\n];\n\nwindow.ClassicEditor=ClassicEditor;\n\n\n//# sourceURL=webpack:///./ckanext/showcase/assets/src/ckeditor.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter.js ***! + \********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ CKFinderUploadAdapter)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/upload */ \"./node_modules/ckeditor5/src/upload.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ \"./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/utils.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* globals XMLHttpRequest, FormData */\n/**\n * @module adapter-ckfinder/uploadadapter\n */\n\n\n\n/**\n * A plugin that enables file uploads in CKEditor 5 using the CKFinder server–side connector.\n *\n * See the {@glink features/images/image-upload/ckfinder \"CKFinder file manager integration\" guide} to learn how to configure\n * and use this feature as well as find out more about the full integration with the file manager\n * provided by the {@link module:ckfinder/ckfinder~CKFinder} plugin.\n *\n * Check out the {@glink features/images/image-upload/image-upload comprehensive \"Image upload overview\"} to learn about\n * other ways to upload images into CKEditor 5.\n */\nclass CKFinderUploadAdapter extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__.FileRepository];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'CKFinderUploadAdapter';\n }\n /**\n * @inheritDoc\n */\n init() {\n const url = this.editor.config.get('ckfinder.uploadUrl');\n if (!url) {\n return;\n }\n // Register CKFinderAdapter\n this.editor.plugins.get(ckeditor5_src_upload__WEBPACK_IMPORTED_MODULE_1__.FileRepository).createUploadAdapter = loader => new UploadAdapter(loader, url, this.editor.t);\n }\n}\n/**\n * Upload adapter for CKFinder.\n */\nclass UploadAdapter {\n /**\n * Creates a new adapter instance.\n */\n constructor(loader, url, t) {\n this.loader = loader;\n this.url = url;\n this.t = t;\n }\n /**\n * Starts the upload process.\n *\n * @see module:upload/filerepository~UploadAdapter#upload\n */\n upload() {\n return this.loader.file.then(file => {\n return new Promise((resolve, reject) => {\n this._initRequest();\n this._initListeners(resolve, reject, file);\n this._sendRequest(file);\n });\n });\n }\n /**\n * Aborts the upload process.\n *\n * @see module:upload/filerepository~UploadAdapter#abort\n */\n abort() {\n if (this.xhr) {\n this.xhr.abort();\n }\n }\n /**\n * Initializes the XMLHttpRequest object.\n */\n _initRequest() {\n const xhr = this.xhr = new XMLHttpRequest();\n xhr.open('POST', this.url, true);\n xhr.responseType = 'json';\n }\n /**\n * Initializes XMLHttpRequest listeners.\n *\n * @param resolve Callback function to be called when the request is successful.\n * @param reject Callback function to be called when the request cannot be completed.\n * @param file File instance to be uploaded.\n */\n _initListeners(resolve, reject, file) {\n const xhr = this.xhr;\n const loader = this.loader;\n const t = this.t;\n const genericError = t('Cannot upload file:') + ` ${file.name}.`;\n xhr.addEventListener('error', () => reject(genericError));\n xhr.addEventListener('abort', () => reject());\n xhr.addEventListener('load', () => {\n const response = xhr.response;\n if (!response || !response.uploaded) {\n return reject(response && response.error && response.error.message ? response.error.message : genericError);\n }\n resolve({\n default: response.url\n });\n });\n // Upload progress when it's supported.\n /* istanbul ignore else */\n if (xhr.upload) {\n xhr.upload.addEventListener('progress', evt => {\n if (evt.lengthComputable) {\n loader.uploadTotal = evt.total;\n loader.uploaded = evt.loaded;\n }\n });\n }\n }\n /**\n * Prepares the data and sends the request.\n *\n * @param file File instance to be uploaded.\n */\n _sendRequest(file) {\n // Prepare form data.\n const data = new FormData();\n data.append('upload', file);\n data.append('ckCsrfToken', (0,_utils__WEBPACK_IMPORTED_MODULE_2__.getCsrfToken)());\n // Send request.\n this.xhr.send(data);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/utils.js": +/*!************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/utils.js ***! + \************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"getCookie\": () => (/* binding */ getCookie),\n/* harmony export */ \"getCsrfToken\": () => (/* binding */ getCsrfToken),\n/* harmony export */ \"setCookie\": () => (/* binding */ setCookie)\n/* harmony export */ });\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/* globals window, document */\n/**\n * @module adapter-ckfinder/utils\n */\nconst TOKEN_COOKIE_NAME = 'ckCsrfToken';\nconst TOKEN_LENGTH = 40;\nconst tokenCharset = 'abcdefghijklmnopqrstuvwxyz0123456789';\n/**\n * Returns the CSRF token value. The value is a hash stored in `document.cookie`\n * under the `ckCsrfToken` key. The CSRF token can be used to secure the communication\n * between the web browser and the CKFinder server.\n */\nfunction getCsrfToken() {\n let token = getCookie(TOKEN_COOKIE_NAME);\n if (!token || token.length != TOKEN_LENGTH) {\n token = generateToken(TOKEN_LENGTH);\n setCookie(TOKEN_COOKIE_NAME, token);\n }\n return token;\n}\n/**\n * Returns the value of the cookie with a given name or `null` if the cookie is not found.\n */\nfunction getCookie(name) {\n name = name.toLowerCase();\n const parts = document.cookie.split(';');\n for (const part of parts) {\n const pair = part.split('=');\n const key = decodeURIComponent(pair[0].trim().toLowerCase());\n if (key === name) {\n return decodeURIComponent(pair[1]);\n }\n }\n return null;\n}\n/**\n * Sets the value of the cookie with a given name.\n */\nfunction setCookie(name, value) {\n document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + ';path=/';\n}\n/**\n * Generates the CSRF token with the given length.\n */\nfunction generateToken(length) {\n let result = '';\n const randValues = new Uint8Array(length);\n window.crypto.getRandomValues(randValues);\n for (let j = 0; j < randValues.length; j++) {\n const character = tokenCharset.charAt(randValues[j] % tokenCharset.length);\n result += Math.random() > 0.5 ? character.toUpperCase() : character;\n }\n return result;\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-adapter-ckfinder/src/utils.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-autoformat/src/autoformat.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-autoformat/src/autoformat.js ***! + \***********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Autoformat)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/typing */ \"./node_modules/ckeditor5/src/typing.js\");\n/* harmony import */ var _blockautoformatediting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./blockautoformatediting */ \"./node_modules/@ckeditor/ckeditor5-autoformat/src/blockautoformatediting.js\");\n/* harmony import */ var _inlineautoformatediting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./inlineautoformatediting */ \"./node_modules/@ckeditor/ckeditor5-autoformat/src/inlineautoformatediting.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n\n\n\n/**\n * Enables a set of predefined autoformatting actions.\n *\n * For a detailed overview, check the {@glink features/autoformat Autoformatting feature documentation}\n * and the {@glink api/autoformat package page}.\n */\nclass Autoformat extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritdoc\n */\n static get requires() {\n return [ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__.Delete];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Autoformat';\n }\n /**\n * @inheritDoc\n */\n afterInit() {\n this._addListAutoformats();\n this._addBasicStylesAutoformats();\n this._addHeadingAutoformats();\n this._addBlockQuoteAutoformats();\n this._addCodeBlockAutoformats();\n this._addHorizontalLineAutoformats();\n }\n /**\n * Adds autoformatting related to the {@link module:list/list~List}.\n *\n * When typed:\n * - `* ` or `- ` – A paragraph will be changed to a bulleted list.\n * - `1. ` or `1) ` – A paragraph will be changed to a numbered list (\"1\" can be any digit or a list of digits).\n * - `[] ` or `[ ] ` – A paragraph will be changed to a to-do list.\n * - `[x] ` or `[ x ] ` – A paragraph will be changed to a checked to-do list.\n */\n _addListAutoformats() {\n const commands = this.editor.commands;\n if (commands.get('bulletedList')) {\n (0,_blockautoformatediting__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.editor, this, /^[*-]\\s$/, 'bulletedList');\n }\n if (commands.get('numberedList')) {\n (0,_blockautoformatediting__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.editor, this, /^1[.|)]\\s$/, 'numberedList');\n }\n if (commands.get('todoList')) {\n (0,_blockautoformatediting__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.editor, this, /^\\[\\s?\\]\\s$/, 'todoList');\n }\n if (commands.get('checkTodoList')) {\n (0,_blockautoformatediting__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.editor, this, /^\\[\\s?x\\s?\\]\\s$/, () => {\n this.editor.execute('todoList');\n this.editor.execute('checkTodoList');\n });\n }\n }\n /**\n * Adds autoformatting related to the {@link module:basic-styles/bold~Bold},\n * {@link module:basic-styles/italic~Italic}, {@link module:basic-styles/code~Code}\n * and {@link module:basic-styles/strikethrough~Strikethrough}\n *\n * When typed:\n * - `**foobar**` – `**` characters are removed and `foobar` is set to bold,\n * - `__foobar__` – `__` characters are removed and `foobar` is set to bold,\n * - `*foobar*` – `*` characters are removed and `foobar` is set to italic,\n * - `_foobar_` – `_` characters are removed and `foobar` is set to italic,\n * - ``` `foobar` – ``` ` ``` characters are removed and `foobar` is set to code,\n * - `~~foobar~~` – `~~` characters are removed and `foobar` is set to strikethrough.\n */\n _addBasicStylesAutoformats() {\n const commands = this.editor.commands;\n if (commands.get('bold')) {\n const boldCallback = getCallbackFunctionForInlineAutoformat(this.editor, 'bold');\n (0,_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.editor, this, /(?:^|\\s)(\\*\\*)([^*]+)(\\*\\*)$/g, boldCallback);\n (0,_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.editor, this, /(?:^|\\s)(__)([^_]+)(__)$/g, boldCallback);\n }\n if (commands.get('italic')) {\n const italicCallback = getCallbackFunctionForInlineAutoformat(this.editor, 'italic');\n // The italic autoformatter cannot be triggered by the bold markers, so we need to check the\n // text before the pattern (e.g. `(?:^|[^\\*])`).\n (0,_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.editor, this, /(?:^|\\s)(\\*)([^*_]+)(\\*)$/g, italicCallback);\n (0,_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.editor, this, /(?:^|\\s)(_)([^_]+)(_)$/g, italicCallback);\n }\n if (commands.get('code')) {\n const codeCallback = getCallbackFunctionForInlineAutoformat(this.editor, 'code');\n (0,_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.editor, this, /(`)([^`]+)(`)$/g, codeCallback);\n }\n if (commands.get('strikethrough')) {\n const strikethroughCallback = getCallbackFunctionForInlineAutoformat(this.editor, 'strikethrough');\n (0,_inlineautoformatediting__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.editor, this, /(~~)([^~]+)(~~)$/g, strikethroughCallback);\n }\n }\n /**\n * Adds autoformatting related to {@link module:heading/heading~Heading}.\n *\n * It is using a number at the end of the command name to associate it with the proper trigger:\n *\n * * `heading` with value `heading1` will be executed when typing `#`,\n * * `heading` with value `heading2` will be executed when typing `##`,\n * * ... up to `heading6` and `######`.\n */\n _addHeadingAutoformats() {\n const command = this.editor.commands.get('heading');\n if (command) {\n command.modelElements\n .filter(name => name.match(/^heading[1-6]$/))\n .forEach(modelName => {\n const level = modelName[7];\n const pattern = new RegExp(`^(#{${level}})\\\\s$`);\n (0,_blockautoformatediting__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.editor, this, pattern, () => {\n // Should only be active if command is enabled and heading style associated with pattern is inactive.\n if (!command.isEnabled || command.value === modelName) {\n return false;\n }\n this.editor.execute('heading', { value: modelName });\n });\n });\n }\n }\n /**\n * Adds autoformatting related to {@link module:block-quote/blockquote~BlockQuote}.\n *\n * When typed:\n * * `> ` – A paragraph will be changed to a block quote.\n */\n _addBlockQuoteAutoformats() {\n if (this.editor.commands.get('blockQuote')) {\n (0,_blockautoformatediting__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.editor, this, /^>\\s$/, 'blockQuote');\n }\n }\n /**\n * Adds autoformatting related to {@link module:code-block/codeblock~CodeBlock}.\n *\n * When typed:\n * - `` ``` `` – A paragraph will be changed to a code block.\n */\n _addCodeBlockAutoformats() {\n const editor = this.editor;\n const selection = editor.model.document.selection;\n if (editor.commands.get('codeBlock')) {\n (0,_blockautoformatediting__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(editor, this, /^```$/, () => {\n if (selection.getFirstPosition().parent.is('element', 'listItem')) {\n return false;\n }\n this.editor.execute('codeBlock', {\n usePreviousLanguageChoice: true\n });\n });\n }\n }\n /**\n * Adds autoformatting related to {@link module:horizontal-line/horizontalline~HorizontalLine}.\n *\n * When typed:\n * - `` --- `` – Will be replaced with a horizontal line.\n */\n _addHorizontalLineAutoformats() {\n if (this.editor.commands.get('horizontalLine')) {\n (0,_blockautoformatediting__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.editor, this, /^---$/, 'horizontalLine');\n }\n }\n}\n/**\n * Helper function for getting `inlineAutoformatEditing` callbacks that checks if command is enabled.\n */\nfunction getCallbackFunctionForInlineAutoformat(editor, attributeKey) {\n return (writer, rangesToFormat) => {\n const command = editor.commands.get(attributeKey);\n if (!command.isEnabled) {\n return false;\n }\n const validRanges = editor.model.schema.getValidRanges(rangesToFormat, attributeKey);\n for (const range of validRanges) {\n writer.setAttribute(attributeKey, true, range);\n }\n // After applying attribute to the text, remove given attribute from the selection.\n // This way user is able to type a text without attribute used by auto formatter.\n writer.removeSelectionAttribute(attributeKey);\n };\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-autoformat/src/autoformat.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-autoformat/src/blockautoformatediting.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-autoformat/src/blockautoformatediting.js ***! + \***********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ blockAutoformatEditing)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/engine */ \"./node_modules/ckeditor5/src/engine.js\");\n/* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ \"./node_modules/ckeditor5/src/utils.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n\n/**\n * The block autoformatting engine. It allows to format various block patterns. For example,\n * it can be configured to turn a paragraph starting with `*` and followed by a space into a list item.\n *\n * The autoformatting operation is integrated with the undo manager,\n * so the autoformatting step can be undone if the user's intention was not to format the text.\n *\n * See the {@link module:autoformat/blockautoformatediting~blockAutoformatEditing `blockAutoformatEditing`} documentation\n * to learn how to create custom block autoformatters. You can also use\n * the {@link module:autoformat/autoformat~Autoformat} feature which enables a set of default autoformatters\n * (lists, headings, bold and italic).\n *\n * @module autoformat/blockautoformatediting\n */\n/**\n * Creates a listener triggered on {@link module:engine/model/document~Document#event:change:data `change:data`} event in the document.\n * Calls the callback when inserted text matches the regular expression or the command name\n * if provided instead of the callback.\n *\n * Examples of usage:\n *\n * To convert a paragraph to heading 1 when `- ` is typed, using just the command name:\n *\n * ```ts\n * blockAutoformatEditing( editor, plugin, /^\\- $/, 'heading1' );\n * ```\n *\n * To convert a paragraph to heading 1 when `- ` is typed, using just the callback:\n *\n * ```ts\n * blockAutoformatEditing( editor, plugin, /^\\- $/, ( context ) => {\n * \tconst { match } = context;\n * \tconst headingLevel = match[ 1 ].length;\n *\n * \teditor.execute( 'heading', {\n * \t\tformatId: `heading${ headingLevel }`\n * \t} );\n * } );\n * ```\n *\n * @param editor The editor instance.\n * @param plugin The autoformat plugin instance.\n * @param pattern The regular expression to execute on just inserted text. The regular expression is tested against the text\n * from the beginning until the caret position.\n * @param callbackOrCommand The callback to execute or the command to run when the text is matched.\n * In case of providing the callback, it receives the following parameter:\n * * {Object} match RegExp.exec() result of matching the pattern to inserted text.\n */\nfunction blockAutoformatEditing(editor, plugin, pattern, callbackOrCommand) {\n let callback;\n let command = null;\n if (typeof callbackOrCommand == 'function') {\n callback = callbackOrCommand;\n }\n else {\n // We assume that the actual command name was provided.\n command = editor.commands.get(callbackOrCommand);\n callback = () => {\n editor.execute(callbackOrCommand);\n };\n }\n editor.model.document.on('change:data', (evt, batch) => {\n if (command && !command.isEnabled || !plugin.isEnabled) {\n return;\n }\n const range = (0,ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__.first)(editor.model.document.selection.getRanges());\n if (!range.isCollapsed) {\n return;\n }\n if (batch.isUndo || !batch.isLocal) {\n return;\n }\n const changes = Array.from(editor.model.document.differ.getChanges());\n const entry = changes[0];\n // Typing is represented by only a single change.\n if (changes.length != 1 || entry.type !== 'insert' || entry.name != '$text' || entry.length != 1) {\n return;\n }\n const blockToFormat = entry.position.parent;\n // Block formatting should be disabled in codeBlocks (#5800).\n if (blockToFormat.is('element', 'codeBlock')) {\n return;\n }\n // Only list commands and custom callbacks can be applied inside a list.\n if (blockToFormat.is('element', 'listItem') &&\n typeof callbackOrCommand !== 'function' &&\n !['numberedList', 'bulletedList', 'todoList'].includes(callbackOrCommand)) {\n return;\n }\n // In case a command is bound, do not re-execute it over an existing block style which would result with a style removal.\n // Instead just drop processing so that autoformat trigger text is not lost. E.g. writing \"# \" in a level 1 heading.\n if (command && command.value === true) {\n return;\n }\n const firstNode = blockToFormat.getChild(0);\n const firstNodeRange = editor.model.createRangeOn(firstNode);\n // Range is only expected to be within or at the very end of the first text node.\n if (!firstNodeRange.containsRange(range) && !range.end.isEqual(firstNodeRange.end)) {\n return;\n }\n const match = pattern.exec(firstNode.data.substr(0, range.end.offset));\n // ...and this text node's data match the pattern.\n if (!match) {\n return;\n }\n // Use enqueueChange to create new batch to separate typing batch from the auto-format changes.\n editor.model.enqueueChange(writer => {\n // Matched range.\n const start = writer.createPositionAt(blockToFormat, 0);\n const end = writer.createPositionAt(blockToFormat, match[0].length);\n const range = new ckeditor5_src_engine__WEBPACK_IMPORTED_MODULE_0__.LiveRange(start, end);\n const wasChanged = callback({ match });\n // Remove matched text.\n if (wasChanged !== false) {\n writer.remove(range);\n const selectionRange = editor.model.document.selection.getFirstRange();\n const blockRange = writer.createRangeIn(blockToFormat);\n // If the block is empty and the document selection has been moved when\n // applying formatting (e.g. is now in newly created block).\n if (blockToFormat.isEmpty && !blockRange.isEqual(selectionRange) && !blockRange.containsRange(selectionRange, true)) {\n writer.remove(blockToFormat);\n }\n }\n range.detach();\n editor.model.enqueueChange(() => {\n editor.plugins.get('Delete').requestUndoOnBackspace();\n });\n });\n });\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-autoformat/src/blockautoformatediting.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-autoformat/src/inlineautoformatediting.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-autoformat/src/inlineautoformatediting.js ***! + \************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ inlineAutoformatEditing)\n/* harmony export */ });\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * Enables autoformatting mechanism for a given {@link module:core/editor/editor~Editor}.\n *\n * It formats the matched text by applying the given model attribute or by running the provided formatting callback.\n * On every {@link module:engine/model/document~Document#event:change:data data change} in the model document\n * the autoformatting engine checks the text on the left of the selection\n * and executes the provided action if the text matches given criteria (regular expression or callback).\n *\n * @param editor The editor instance.\n * @param plugin The autoformat plugin instance.\n * @param testRegexpOrCallback The regular expression or callback to execute on text.\n * Provided regular expression *must* have three capture groups. The first and the third capture group\n * should match opening and closing delimiters. The second capture group should match the text to format.\n *\n * ```ts\n * // Matches the `**bold text**` pattern.\n * // There are three capturing groups:\n * // - The first to match the starting `**` delimiter.\n * // - The second to match the text to format.\n * // - The third to match the ending `**` delimiter.\n * inlineAutoformatEditing( editor, plugin, /(\\*\\*)([^\\*]+?)(\\*\\*)$/g, formatCallback );\n * ```\n *\n * When a function is provided instead of the regular expression, it will be executed with the text to match as a parameter.\n * The function should return proper \"ranges\" to delete and format.\n *\n * ```ts\n * {\n * \tremove: [\n * \t\t[ 0, 1 ],\t// Remove the first letter from the given text.\n * \t\t[ 5, 6 ]\t// Remove the 6th letter from the given text.\n * \t],\n * \tformat: [\n * \t\t[ 1, 5 ]\t// Format all letters from 2nd to 5th.\n * \t]\n * }\n * ```\n *\n * @param formatCallback A callback to apply actual formatting.\n * It should return `false` if changes should not be applied (e.g. if a command is disabled).\n *\n * ```ts\n * inlineAutoformatEditing( editor, plugin, /(\\*\\*)([^\\*]+?)(\\*\\*)$/g, ( writer, rangesToFormat ) => {\n * \tconst command = editor.commands.get( 'bold' );\n *\n * \tif ( !command.isEnabled ) {\n * \t\treturn false;\n * \t}\n *\n * \tconst validRanges = editor.model.schema.getValidRanges( rangesToFormat, 'bold' );\n *\n * \tfor ( let range of validRanges ) {\n * \t\twriter.setAttribute( 'bold', true, range );\n * \t}\n * } );\n * ```\n */\nfunction inlineAutoformatEditing(editor, plugin, testRegexpOrCallback, formatCallback) {\n let regExp;\n let testCallback;\n if (testRegexpOrCallback instanceof RegExp) {\n regExp = testRegexpOrCallback;\n }\n else {\n testCallback = testRegexpOrCallback;\n }\n // A test callback run on changed text.\n testCallback = testCallback || (text => {\n let result;\n const remove = [];\n const format = [];\n while ((result = regExp.exec(text)) !== null) {\n // There should be full match and 3 capture groups.\n if (result && result.length < 4) {\n break;\n }\n let { index, '1': leftDel, '2': content, '3': rightDel } = result;\n // Real matched string - there might be some non-capturing groups so we need to recalculate starting index.\n const found = leftDel + content + rightDel;\n index += result[0].length - found.length;\n // Start and End offsets of delimiters to remove.\n const delStart = [\n index,\n index + leftDel.length\n ];\n const delEnd = [\n index + leftDel.length + content.length,\n index + leftDel.length + content.length + rightDel.length\n ];\n remove.push(delStart);\n remove.push(delEnd);\n format.push([index + leftDel.length, index + leftDel.length + content.length]);\n }\n return {\n remove,\n format\n };\n });\n editor.model.document.on('change:data', (evt, batch) => {\n if (batch.isUndo || !batch.isLocal || !plugin.isEnabled) {\n return;\n }\n const model = editor.model;\n const selection = model.document.selection;\n // Do nothing if selection is not collapsed.\n if (!selection.isCollapsed) {\n return;\n }\n const changes = Array.from(model.document.differ.getChanges());\n const entry = changes[0];\n // Typing is represented by only a single change.\n if (changes.length != 1 || entry.type !== 'insert' || entry.name != '$text' || entry.length != 1) {\n return;\n }\n const focus = selection.focus;\n const block = focus.parent;\n const { text, range } = getTextAfterCode(model.createRange(model.createPositionAt(block, 0), focus), model);\n const testOutput = testCallback(text);\n const rangesToFormat = testOutputToRanges(range.start, testOutput.format, model);\n const rangesToRemove = testOutputToRanges(range.start, testOutput.remove, model);\n if (!(rangesToFormat.length && rangesToRemove.length)) {\n return;\n }\n // Use enqueueChange to create new batch to separate typing batch from the auto-format changes.\n model.enqueueChange(writer => {\n // Apply format.\n const hasChanged = formatCallback(writer, rangesToFormat);\n // Strict check on `false` to have backward compatibility (when callbacks were returning `undefined`).\n if (hasChanged === false) {\n return;\n }\n // Remove delimiters - use reversed order to not mix the offsets while removing.\n for (const range of rangesToRemove.reverse()) {\n writer.remove(range);\n }\n model.enqueueChange(() => {\n editor.plugins.get('Delete').requestUndoOnBackspace();\n });\n });\n });\n}\n/**\n * Converts output of the test function provided to the inlineAutoformatEditing and converts it to the model ranges\n * inside provided block.\n */\nfunction testOutputToRanges(start, arrays, model) {\n return arrays\n .filter(array => (array[0] !== undefined && array[1] !== undefined))\n .map(array => {\n return model.createRange(start.getShiftedBy(array[0]), start.getShiftedBy(array[1]));\n });\n}\n/**\n * Returns the last text line after the last code element from the given range.\n * It is similar to {@link module:typing/utils/getlasttextline.getLastTextLine `getLastTextLine()`},\n * but it ignores any text before the last `code`.\n */\nfunction getTextAfterCode(range, model) {\n let start = range.start;\n const text = Array.from(range.getItems()).reduce((rangeText, node) => {\n // Trim text to a last occurrence of an inline element and update range start.\n if (!(node.is('$text') || node.is('$textProxy')) || node.getAttribute('code')) {\n start = model.createPositionAfter(node);\n return '';\n }\n return rangeText + node.data;\n }, '');\n return { text, range: model.createRange(start, range.end) };\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-autoformat/src/inlineautoformatediting.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ AttributeCommand)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/attributecommand\n */\n\n/**\n * An extension of the base {@link module:core/command~Command} class, which provides utilities for a command\n * that toggles a single attribute on a text or an element.\n *\n * `AttributeCommand` uses {@link module:engine/model/document~Document#selection}\n * to decide which nodes (if any) should be changed, and applies or removes the attribute from them.\n *\n * The command checks the {@link module:engine/model/model~Model#schema} to decide if it can be enabled\n * for the current selection and to which nodes the attribute can be applied.\n */\nclass AttributeCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Command {\n /**\n * @param attributeKey Attribute that will be set by the command.\n */\n constructor(editor, attributeKey) {\n super(editor);\n this.attributeKey = attributeKey;\n }\n /**\n * Updates the command's {@link #value} and {@link #isEnabled} based on the current selection.\n */\n refresh() {\n const model = this.editor.model;\n const doc = model.document;\n this.value = this._getValueFromFirstAllowedNode();\n this.isEnabled = model.schema.checkAttributeInSelection(doc.selection, this.attributeKey);\n }\n /**\n * Executes the command — applies the attribute to the selection or removes it from the selection.\n *\n * If the command is active (`value == true`), it will remove attributes. Otherwise, it will set attributes.\n *\n * The execution result differs, depending on the {@link module:engine/model/document~Document#selection}:\n *\n * * If the selection is on a range, the command applies the attribute to all nodes in that range\n * (if they are allowed to have this attribute by the {@link module:engine/model/schema~Schema schema}).\n * * If the selection is collapsed in a non-empty node, the command applies the attribute to the\n * {@link module:engine/model/document~Document#selection} itself (note that typed characters copy attributes from the selection).\n * * If the selection is collapsed in an empty node, the command applies the attribute to the parent node of the selection (note\n * that the selection inherits all attributes from a node if it is in an empty node).\n *\n * @fires execute\n * @param options Command options.\n * @param options.forceValue If set, it will force the command behavior. If `true`,\n * the command will apply the attribute, otherwise the command will remove the attribute.\n * If not set, the command will look for its current value to decide what it should do.\n */\n execute(options = {}) {\n const model = this.editor.model;\n const doc = model.document;\n const selection = doc.selection;\n const value = (options.forceValue === undefined) ? !this.value : options.forceValue;\n model.change(writer => {\n if (selection.isCollapsed) {\n if (value) {\n writer.setSelectionAttribute(this.attributeKey, true);\n }\n else {\n writer.removeSelectionAttribute(this.attributeKey);\n }\n }\n else {\n const ranges = model.schema.getValidRanges(selection.getRanges(), this.attributeKey);\n for (const range of ranges) {\n if (value) {\n writer.setAttribute(this.attributeKey, value, range);\n }\n else {\n writer.removeAttribute(this.attributeKey, range);\n }\n }\n }\n });\n }\n /**\n * Checks the attribute value of the first node in the selection that allows the attribute.\n * For the collapsed selection returns the selection attribute.\n *\n * @returns The attribute value.\n */\n _getValueFromFirstAllowedNode() {\n const model = this.editor.model;\n const schema = model.schema;\n const selection = model.document.selection;\n if (selection.isCollapsed) {\n return selection.hasAttribute(this.attributeKey);\n }\n for (const range of selection.getRanges()) {\n for (const item of range.getItems()) {\n if (schema.checkAttribute(item, this.attributeKey)) {\n return item.hasAttribute(this.attributeKey);\n }\n }\n }\n return false;\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Bold)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var _bold_boldediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bold/boldediting */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldediting.js\");\n/* harmony import */ var _bold_boldui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bold/boldui */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldui.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/bold\n */\n\n\n\n/**\n * The bold feature.\n *\n * For a detailed overview check the {@glink features/basic-styles Basic styles feature documentation}\n * and the {@glink api/basic-styles package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:basic-styles/bold/boldediting~BoldEditing bold editing feature}\n * and {@link module:basic-styles/bold/boldui~BoldUI bold UI feature}.\n */\nclass Bold extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [_bold_boldediting__WEBPACK_IMPORTED_MODULE_1__[\"default\"], _bold_boldui__WEBPACK_IMPORTED_MODULE_2__[\"default\"]];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Bold';\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldediting.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldediting.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ BoldEditing)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/bold/boldediting\n */\n\n\nconst BOLD = 'bold';\n/**\n * The bold editing feature.\n *\n * It registers the `'bold'` command and introduces the `bold` attribute in the model which renders to the view\n * as a `` element.\n */\nclass BoldEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'BoldEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Allow bold attribute on text nodes.\n editor.model.schema.extend('$text', { allowAttributes: BOLD });\n editor.model.schema.setAttributeProperties(BOLD, {\n isFormatting: true,\n copyOnEnter: true\n });\n // Build converter from model to view for data and editing pipelines.\n editor.conversion.attributeToElement({\n model: BOLD,\n view: 'strong',\n upcastAlso: [\n 'b',\n viewElement => {\n const fontWeight = viewElement.getStyle('font-weight');\n if (!fontWeight) {\n return null;\n }\n // Value of the `font-weight` attribute can be defined as a string or a number.\n if (fontWeight == 'bold' || Number(fontWeight) >= 600) {\n return {\n name: true,\n styles: ['font-weight']\n };\n }\n return null;\n }\n ]\n });\n // Create bold command.\n editor.commands.add(BOLD, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__[\"default\"](editor, BOLD));\n // Set the Ctrl+B keystroke.\n editor.keystrokes.set('CTRL+B', BOLD);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldediting.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldui.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldui.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ BoldUI)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ \"./node_modules/ckeditor5/src/ui.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/bold/boldui\n */\n\n\nconst BOLD = 'bold';\n/**\n * The bold UI feature. It introduces the Bold button.\n */\nclass BoldUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'BoldUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n // Add bold button to feature components.\n editor.ui.componentFactory.add(BOLD, locale => {\n const command = editor.commands.get(BOLD);\n const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__.ButtonView(locale);\n view.set({\n label: t('Bold'),\n icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.icons.bold,\n keystroke: 'CTRL+B',\n tooltip: true,\n isToggleable: true\n });\n view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n // Execute command.\n this.listenTo(view, 'execute', () => {\n editor.execute(BOLD);\n editor.editing.view.focus();\n });\n return view;\n });\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-basic-styles/src/bold/boldui.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/code.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/code.js ***! + \*******************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Code)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var _code_codeediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./code/codeediting */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/code/codeediting.js\");\n/* harmony import */ var _code_codeui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./code/codeui */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/code/codeui.js\");\n/* harmony import */ var _theme_code_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme/code.css */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/theme/code.css\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/code\n */\n\n\n\n\n/**\n * The code feature.\n *\n * For a detailed overview check the {@glink features/basic-styles Basic styles feature documentation}\n * and the {@glink api/basic-styles package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:basic-styles/code/codeediting~CodeEditing code editing feature}\n * and {@link module:basic-styles/code/codeui~CodeUI code UI feature}.\n */\nclass Code extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [_code_codeediting__WEBPACK_IMPORTED_MODULE_1__[\"default\"], _code_codeui__WEBPACK_IMPORTED_MODULE_2__[\"default\"]];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Code';\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-basic-styles/src/code.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/code/codeediting.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/code/codeediting.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ CodeEditing)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/typing */ \"./node_modules/ckeditor5/src/typing.js\");\n/* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../attributecommand */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/code/codeediting\n */\n\n\n\nconst CODE = 'code';\nconst HIGHLIGHT_CLASS = 'ck-code_selected';\n/**\n * The code editing feature.\n *\n * It registers the `'code'` command and introduces the `code` attribute in the model which renders to the view\n * as a `` element.\n */\nclass CodeEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'CodeEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__.TwoStepCaretMovement];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Allow code attribute on text nodes.\n editor.model.schema.extend('$text', { allowAttributes: CODE });\n editor.model.schema.setAttributeProperties(CODE, {\n isFormatting: true,\n copyOnEnter: false\n });\n editor.conversion.attributeToElement({\n model: CODE,\n view: 'code',\n upcastAlso: {\n styles: {\n 'word-wrap': 'break-word'\n }\n }\n });\n // Create code command.\n editor.commands.add(CODE, new _attributecommand__WEBPACK_IMPORTED_MODULE_2__[\"default\"](editor, CODE));\n // Enable two-step caret movement for `code` attribute.\n editor.plugins.get(ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__.TwoStepCaretMovement).registerAttribute(CODE);\n // Setup highlight over selected element.\n (0,ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_1__.inlineHighlight)(editor, CODE, 'code', HIGHLIGHT_CLASS);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-basic-styles/src/code/codeediting.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/code/codeui.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/code/codeui.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ CodeUI)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ \"./node_modules/ckeditor5/src/ui.js\");\n/* harmony import */ var _theme_icons_code_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/code.svg */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/code.svg\");\n/* harmony import */ var _theme_code_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../theme/code.css */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/theme/code.css\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/code/codeui\n */\n\n\n\n\nconst CODE = 'code';\n/**\n * The code UI feature. It introduces the Code button.\n */\nclass CodeUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'CodeUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n // Add code button to feature components.\n editor.ui.componentFactory.add(CODE, locale => {\n const command = editor.commands.get(CODE);\n const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__.ButtonView(locale);\n view.set({\n label: t('Code'),\n icon: _theme_icons_code_svg__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n tooltip: true,\n isToggleable: true\n });\n view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n // Execute command.\n this.listenTo(view, 'execute', () => {\n editor.execute(CODE);\n editor.editing.view.focus();\n });\n return view;\n });\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-basic-styles/src/code/codeui.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Italic)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var _italic_italicediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./italic/italicediting */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicediting.js\");\n/* harmony import */ var _italic_italicui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./italic/italicui */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicui.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/italic\n */\n\n\n\n/**\n * The italic feature.\n *\n * For a detailed overview check the {@glink features/basic-styles Basic styles feature documentation}\n * and the {@glink api/basic-styles package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:basic-styles/italic/italicediting~ItalicEditing} and\n * {@link module:basic-styles/italic/italicui~ItalicUI} plugins.\n */\nclass Italic extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [_italic_italicediting__WEBPACK_IMPORTED_MODULE_1__[\"default\"], _italic_italicui__WEBPACK_IMPORTED_MODULE_2__[\"default\"]];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Italic';\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicediting.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicediting.js ***! + \***********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ItalicEditing)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/italic/italicediting\n */\n\n\nconst ITALIC = 'italic';\n/**\n * The italic editing feature.\n *\n * It registers the `'italic'` command, the Ctrl+I keystroke and introduces the `italic` attribute in the model\n * which renders to the view as an `` element.\n */\nclass ItalicEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ItalicEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Allow italic attribute on text nodes.\n editor.model.schema.extend('$text', { allowAttributes: ITALIC });\n editor.model.schema.setAttributeProperties(ITALIC, {\n isFormatting: true,\n copyOnEnter: true\n });\n editor.conversion.attributeToElement({\n model: ITALIC,\n view: 'i',\n upcastAlso: [\n 'em',\n {\n styles: {\n 'font-style': 'italic'\n }\n }\n ]\n });\n // Create italic command.\n editor.commands.add(ITALIC, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__[\"default\"](editor, ITALIC));\n // Set the Ctrl+I keystroke.\n editor.keystrokes.set('CTRL+I', ITALIC);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicediting.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicui.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicui.js ***! + \******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ItalicUI)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ \"./node_modules/ckeditor5/src/ui.js\");\n/* harmony import */ var _theme_icons_italic_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/italic.svg */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/italic.svg\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/italic/italicui\n */\n\n\n\nconst ITALIC = 'italic';\n/**\n * The italic UI feature. It introduces the Italic button.\n */\nclass ItalicUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ItalicUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n // Add bold button to feature components.\n editor.ui.componentFactory.add(ITALIC, locale => {\n const command = editor.commands.get(ITALIC);\n const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__.ButtonView(locale);\n view.set({\n label: t('Italic'),\n icon: _theme_icons_italic_svg__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n keystroke: 'CTRL+I',\n tooltip: true,\n isToggleable: true\n });\n view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n // Execute command.\n this.listenTo(view, 'execute', () => {\n editor.execute(ITALIC);\n editor.editing.view.focus();\n });\n return view;\n });\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-basic-styles/src/italic/italicui.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough.js ***! + \****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Strikethrough)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var _strikethrough_strikethroughediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./strikethrough/strikethroughediting */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughediting.js\");\n/* harmony import */ var _strikethrough_strikethroughui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./strikethrough/strikethroughui */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughui.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/strikethrough\n */\n\n\n\n/**\n * The strikethrough feature.\n *\n * For a detailed overview check the {@glink features/basic-styles Basic styles feature documentation}\n * and the {@glink api/basic-styles package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:basic-styles/strikethrough/strikethroughediting~StrikethroughEditing} and\n * {@link module:basic-styles/strikethrough/strikethroughui~StrikethroughUI} plugins.\n */\nclass Strikethrough extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [_strikethrough_strikethroughediting__WEBPACK_IMPORTED_MODULE_1__[\"default\"], _strikethrough_strikethroughui__WEBPACK_IMPORTED_MODULE_2__[\"default\"]];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Strikethrough';\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughediting.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughediting.js ***! + \*************************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ StrikethroughEditing)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/strikethrough/strikethroughediting\n */\n\n\nconst STRIKETHROUGH = 'strikethrough';\n/**\n * The strikethrough editing feature.\n *\n * It registers the `'strikethrough'` command, the Ctrl+Shift+X keystroke and introduces the\n * `strikethroughsthrough` attribute in the model which renders to the view\n * as a `` element.\n */\nclass StrikethroughEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'StrikethroughEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Allow strikethrough attribute on text nodes.\n editor.model.schema.extend('$text', { allowAttributes: STRIKETHROUGH });\n editor.model.schema.setAttributeProperties(STRIKETHROUGH, {\n isFormatting: true,\n copyOnEnter: true\n });\n editor.conversion.attributeToElement({\n model: STRIKETHROUGH,\n view: 's',\n upcastAlso: [\n 'del',\n 'strike',\n {\n styles: {\n 'text-decoration': 'line-through'\n }\n }\n ]\n });\n // Create strikethrough command.\n editor.commands.add(STRIKETHROUGH, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__[\"default\"](editor, STRIKETHROUGH));\n // Set the Ctrl+Shift+X keystroke.\n editor.keystrokes.set('CTRL+SHIFT+X', 'strikethrough');\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughediting.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughui.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughui.js ***! + \********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ StrikethroughUI)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ \"./node_modules/ckeditor5/src/ui.js\");\n/* harmony import */ var _theme_icons_strikethrough_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/strikethrough.svg */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/strikethrough.svg\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/strikethrough/strikethroughui\n */\n\n\n\nconst STRIKETHROUGH = 'strikethrough';\n/**\n * The strikethrough UI feature. It introduces the Strikethrough button.\n */\nclass StrikethroughUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'StrikethroughUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n // Add strikethrough button to feature components.\n editor.ui.componentFactory.add(STRIKETHROUGH, locale => {\n const command = editor.commands.get(STRIKETHROUGH);\n const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__.ButtonView(locale);\n view.set({\n label: t('Strikethrough'),\n icon: _theme_icons_strikethrough_svg__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n keystroke: 'CTRL+SHIFT+X',\n tooltip: true,\n isToggleable: true\n });\n view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n // Execute command.\n this.listenTo(view, 'execute', () => {\n editor.execute(STRIKETHROUGH);\n editor.editing.view.focus();\n });\n return view;\n });\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-basic-styles/src/strikethrough/strikethroughui.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript.js": +/*!************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript.js ***! + \************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Subscript)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var _subscript_subscriptediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./subscript/subscriptediting */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptediting.js\");\n/* harmony import */ var _subscript_subscriptui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./subscript/subscriptui */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptui.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/subscript\n */\n\n\n\n/**\n * The subscript feature.\n *\n * It loads the {@link module:basic-styles/subscript/subscriptediting~SubscriptEditing} and\n * {@link module:basic-styles/subscript/subscriptui~SubscriptUI} plugins.\n */\nclass Subscript extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [_subscript_subscriptediting__WEBPACK_IMPORTED_MODULE_1__[\"default\"], _subscript_subscriptui__WEBPACK_IMPORTED_MODULE_2__[\"default\"]];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Subscript';\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptediting.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptediting.js ***! + \*****************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ SubscriptEditing)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/subscript/subscriptediting\n */\n\n\nconst SUBSCRIPT = 'subscript';\n/**\n * The subscript editing feature.\n *\n * It registers the `sub` command and introduces the `sub` attribute in the model which renders to the view\n * as a `` element.\n */\nclass SubscriptEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'SubscriptEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Allow sub attribute on text nodes.\n editor.model.schema.extend('$text', { allowAttributes: SUBSCRIPT });\n editor.model.schema.setAttributeProperties(SUBSCRIPT, {\n isFormatting: true,\n copyOnEnter: true\n });\n // Build converter from model to view for data and editing pipelines.\n editor.conversion.attributeToElement({\n model: SUBSCRIPT,\n view: 'sub',\n upcastAlso: [\n {\n styles: {\n 'vertical-align': 'sub'\n }\n }\n ]\n });\n // Create sub command.\n editor.commands.add(SUBSCRIPT, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__[\"default\"](editor, SUBSCRIPT));\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptediting.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptui.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptui.js ***! + \************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ SubscriptUI)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ \"./node_modules/ckeditor5/src/ui.js\");\n/* harmony import */ var _theme_icons_subscript_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/subscript.svg */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/subscript.svg\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/subscript/subscriptui\n */\n\n\n\nconst SUBSCRIPT = 'subscript';\n/**\n * The subscript UI feature. It introduces the Subscript button.\n */\nclass SubscriptUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'SubscriptUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n // Add subscript button to feature components.\n editor.ui.componentFactory.add(SUBSCRIPT, locale => {\n const command = editor.commands.get(SUBSCRIPT);\n const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__.ButtonView(locale);\n view.set({\n label: t('Subscript'),\n icon: _theme_icons_subscript_svg__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n tooltip: true,\n isToggleable: true\n });\n view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n // Execute command.\n this.listenTo(view, 'execute', () => {\n editor.execute(SUBSCRIPT);\n editor.editing.view.focus();\n });\n return view;\n });\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-basic-styles/src/subscript/subscriptui.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Superscript)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var _superscript_superscriptediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./superscript/superscriptediting */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptediting.js\");\n/* harmony import */ var _superscript_superscriptui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./superscript/superscriptui */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptui.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/superscript\n */\n\n\n\n/**\n * The superscript feature.\n *\n * It loads the {@link module:basic-styles/superscript/superscriptediting~SuperscriptEditing} and\n * {@link module:basic-styles/superscript/superscriptui~SuperscriptUI} plugins.\n */\nclass Superscript extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [_superscript_superscriptediting__WEBPACK_IMPORTED_MODULE_1__[\"default\"], _superscript_superscriptui__WEBPACK_IMPORTED_MODULE_2__[\"default\"]];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Superscript';\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptediting.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptediting.js ***! + \*********************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ SuperscriptEditing)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/superscript/superscriptediting\n */\n\n\nconst SUPERSCRIPT = 'superscript';\n/**\n * The superscript editing feature.\n *\n * It registers the `super` command and introduces the `super` attribute in the model which renders to the view\n * as a `` element.\n */\nclass SuperscriptEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'SuperscriptEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Allow super attribute on text nodes.\n editor.model.schema.extend('$text', { allowAttributes: SUPERSCRIPT });\n editor.model.schema.setAttributeProperties(SUPERSCRIPT, {\n isFormatting: true,\n copyOnEnter: true\n });\n // Build converter from model to view for data and editing pipelines.\n editor.conversion.attributeToElement({\n model: SUPERSCRIPT,\n view: 'sup',\n upcastAlso: [\n {\n styles: {\n 'vertical-align': 'super'\n }\n }\n ]\n });\n // Create super command.\n editor.commands.add(SUPERSCRIPT, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__[\"default\"](editor, SUPERSCRIPT));\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptediting.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptui.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptui.js ***! + \****************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ SuperscriptUI)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ \"./node_modules/ckeditor5/src/ui.js\");\n/* harmony import */ var _theme_icons_superscript_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/superscript.svg */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/superscript.svg\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/superscript/superscriptui\n */\n\n\n\nconst SUPERSCRIPT = 'superscript';\n/**\n * The superscript UI feature. It introduces the Superscript button.\n */\nclass SuperscriptUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'SuperscriptUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n // Add superscript button to feature components.\n editor.ui.componentFactory.add(SUPERSCRIPT, locale => {\n const command = editor.commands.get(SUPERSCRIPT);\n const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__.ButtonView(locale);\n view.set({\n label: t('Superscript'),\n icon: _theme_icons_superscript_svg__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n tooltip: true,\n isToggleable: true\n });\n view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n // Execute command.\n this.listenTo(view, 'execute', () => {\n editor.execute(SUPERSCRIPT);\n editor.editing.view.focus();\n });\n return view;\n });\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-basic-styles/src/superscript/superscriptui.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline.js": +/*!************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline.js ***! + \************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Underline)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var _underline_underlineediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./underline/underlineediting */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineediting.js\");\n/* harmony import */ var _underline_underlineui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./underline/underlineui */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineui.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/underline\n */\n\n\n\n/**\n * The underline feature.\n *\n * For a detailed overview check the {@glink features/basic-styles Basic styles feature documentation}\n * and the {@glink api/basic-styles package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:basic-styles/underline/underlineediting~UnderlineEditing} and\n * {@link module:basic-styles/underline/underlineui~UnderlineUI} plugins.\n */\nclass Underline extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [_underline_underlineediting__WEBPACK_IMPORTED_MODULE_1__[\"default\"], _underline_underlineui__WEBPACK_IMPORTED_MODULE_2__[\"default\"]];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Underline';\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineediting.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineediting.js ***! + \*****************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ UnderlineEditing)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var _attributecommand__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../attributecommand */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/src/attributecommand.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/underline/underlineediting\n */\n\n\nconst UNDERLINE = 'underline';\n/**\n * The underline editing feature.\n *\n * It registers the `'underline'` command, the Ctrl+U keystroke\n * and introduces the `underline` attribute in the model which renders to the view as an `` element.\n */\nclass UnderlineEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'UnderlineEditing';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n // Allow strikethrough attribute on text nodes.\n editor.model.schema.extend('$text', { allowAttributes: UNDERLINE });\n editor.model.schema.setAttributeProperties(UNDERLINE, {\n isFormatting: true,\n copyOnEnter: true\n });\n editor.conversion.attributeToElement({\n model: UNDERLINE,\n view: 'u',\n upcastAlso: {\n styles: {\n 'text-decoration': 'underline'\n }\n }\n });\n // Create underline command.\n editor.commands.add(UNDERLINE, new _attributecommand__WEBPACK_IMPORTED_MODULE_1__[\"default\"](editor, UNDERLINE));\n // Set the Ctrl+U keystroke.\n editor.keystrokes.set('CTRL+U', 'underline');\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineediting.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineui.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineui.js ***! + \************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ UnderlineUI)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ \"./node_modules/ckeditor5/src/ui.js\");\n/* harmony import */ var _theme_icons_underline_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../theme/icons/underline.svg */ \"./node_modules/@ckeditor/ckeditor5-basic-styles/theme/icons/underline.svg\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module basic-styles/underline/underlineui\n */\n\n\n\nconst UNDERLINE = 'underline';\n/**\n * The underline UI feature. It introduces the Underline button.\n */\nclass UnderlineUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'UnderlineUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n // Add bold button to feature components.\n editor.ui.componentFactory.add(UNDERLINE, locale => {\n const command = editor.commands.get(UNDERLINE);\n const view = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__.ButtonView(locale);\n view.set({\n label: t('Underline'),\n icon: _theme_icons_underline_svg__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n keystroke: 'CTRL+U',\n tooltip: true,\n isToggleable: true\n });\n view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n // Execute command.\n this.listenTo(view, 'execute', () => {\n editor.execute(UNDERLINE);\n editor.editing.view.focus();\n });\n return view;\n });\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-basic-styles/src/underline/underlineui.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquote.js": +/*!************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquote.js ***! + \************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ BlockQuote)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var _blockquoteediting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./blockquoteediting */ \"./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteediting.js\");\n/* harmony import */ var _blockquoteui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./blockquoteui */ \"./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteui.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module block-quote/blockquote\n */\n\n\n\n/**\n * The block quote plugin.\n *\n * For more information about this feature check the {@glink api/block-quote package page}.\n *\n * This is a \"glue\" plugin which loads the {@link module:block-quote/blockquoteediting~BlockQuoteEditing block quote editing feature}\n * and {@link module:block-quote/blockquoteui~BlockQuoteUI block quote UI feature}.\n *\n * @extends module:core/plugin~Plugin\n */\nclass BlockQuote extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get requires() {\n return [_blockquoteediting__WEBPACK_IMPORTED_MODULE_1__[\"default\"], _blockquoteui__WEBPACK_IMPORTED_MODULE_2__[\"default\"]];\n }\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'BlockQuote';\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquote.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquotecommand.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquotecommand.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ BlockQuoteCommand)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/utils */ \"./node_modules/ckeditor5/src/utils.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module block-quote/blockquotecommand\n */\n\n\n/**\n * The block quote command plugin.\n *\n * @extends module:core/command~Command\n */\nclass BlockQuoteCommand extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Command {\n /**\n * @inheritDoc\n */\n refresh() {\n this.value = this._getValue();\n this.isEnabled = this._checkEnabled();\n }\n /**\n * Executes the command. When the command {@link #value is on}, all top-most block quotes within\n * the selection will be removed. If it is off, all selected blocks will be wrapped with\n * a block quote.\n *\n * @fires execute\n * @param options Command options.\n * @param options.forceValue If set, it will force the command behavior. If `true`, the command will apply a block quote,\n * otherwise the command will remove the block quote. If not set, the command will act basing on its current value.\n */\n execute(options = {}) {\n const model = this.editor.model;\n const schema = model.schema;\n const selection = model.document.selection;\n const blocks = Array.from(selection.getSelectedBlocks());\n const value = (options.forceValue === undefined) ? !this.value : options.forceValue;\n model.change(writer => {\n if (!value) {\n this._removeQuote(writer, blocks.filter(findQuote));\n }\n else {\n const blocksToQuote = blocks.filter(block => {\n // Already quoted blocks needs to be considered while quoting too\n // in order to reuse their elements.\n return findQuote(block) || checkCanBeQuoted(schema, block);\n });\n this._applyQuote(writer, blocksToQuote);\n }\n });\n }\n /**\n * Checks the command's {@link #value}.\n */\n _getValue() {\n const selection = this.editor.model.document.selection;\n const firstBlock = (0,ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__.first)(selection.getSelectedBlocks());\n // In the current implementation, the block quote must be an immediate parent of a block element.\n return !!(firstBlock && findQuote(firstBlock));\n }\n /**\n * Checks whether the command can be enabled in the current context.\n *\n * @returns Whether the command should be enabled.\n */\n _checkEnabled() {\n if (this.value) {\n return true;\n }\n const selection = this.editor.model.document.selection;\n const schema = this.editor.model.schema;\n const firstBlock = (0,ckeditor5_src_utils__WEBPACK_IMPORTED_MODULE_1__.first)(selection.getSelectedBlocks());\n if (!firstBlock) {\n return false;\n }\n return checkCanBeQuoted(schema, firstBlock);\n }\n /**\n * Removes the quote from given blocks.\n *\n * If blocks which are supposed to be \"unquoted\" are in the middle of a quote,\n * start it or end it, then the quote will be split (if needed) and the blocks\n * will be moved out of it, so other quoted blocks remained quoted.\n */\n _removeQuote(writer, blocks) {\n // Unquote all groups of block. Iterate in the reverse order to not break following ranges.\n getRangesOfBlockGroups(writer, blocks).reverse().forEach(groupRange => {\n if (groupRange.start.isAtStart && groupRange.end.isAtEnd) {\n writer.unwrap(groupRange.start.parent);\n return;\n }\n // The group of blocks are at the beginning of an so let's move them left (out of the ).\n if (groupRange.start.isAtStart) {\n const positionBefore = writer.createPositionBefore(groupRange.start.parent);\n writer.move(groupRange, positionBefore);\n return;\n }\n // The blocks are in the middle of an so we need to split the after the last block\n // so we move the items there.\n if (!groupRange.end.isAtEnd) {\n writer.split(groupRange.end);\n }\n // Now we are sure that groupRange.end.isAtEnd is true, so let's move the blocks right.\n const positionAfter = writer.createPositionAfter(groupRange.end.parent);\n writer.move(groupRange, positionAfter);\n });\n }\n /**\n * Applies the quote to given blocks.\n */\n _applyQuote(writer, blocks) {\n const quotesToMerge = [];\n // Quote all groups of block. Iterate in the reverse order to not break following ranges.\n getRangesOfBlockGroups(writer, blocks).reverse().forEach(groupRange => {\n let quote = findQuote(groupRange.start);\n if (!quote) {\n quote = writer.createElement('blockQuote');\n writer.wrap(groupRange, quote);\n }\n quotesToMerge.push(quote);\n });\n // Merge subsequent elements. Reverse the order again because this time we want to go through\n // the elements in the source order (due to how merge works – it moves the right element's content\n // to the first element and removes the right one. Since we may need to merge a couple of subsequent `` elements\n // we want to keep the reference to the first (furthest left) one.\n quotesToMerge.reverse().reduce((currentQuote, nextQuote) => {\n if (currentQuote.nextSibling == nextQuote) {\n writer.merge(writer.createPositionAfter(currentQuote));\n return currentQuote;\n }\n return nextQuote;\n });\n }\n}\nfunction findQuote(elementOrPosition) {\n return elementOrPosition.parent.name == 'blockQuote' ? elementOrPosition.parent : null;\n}\n/**\n * Returns a minimal array of ranges containing groups of subsequent blocks.\n *\n * content: abcdefgh\n * blocks: [ a, b, d, f, g, h ]\n * output ranges: [ab]c[d]e[fgh]\n */\nfunction getRangesOfBlockGroups(writer, blocks) {\n let startPosition;\n let i = 0;\n const ranges = [];\n while (i < blocks.length) {\n const block = blocks[i];\n const nextBlock = blocks[i + 1];\n if (!startPosition) {\n startPosition = writer.createPositionBefore(block);\n }\n if (!nextBlock || block.nextSibling != nextBlock) {\n ranges.push(writer.createRange(startPosition, writer.createPositionAfter(block)));\n startPosition = null;\n }\n i++;\n }\n return ranges;\n}\n/**\n * Checks whether can wrap the block.\n */\nfunction checkCanBeQuoted(schema, block) {\n // TMP will be replaced with schema.checkWrap().\n const isBQAllowed = schema.checkChild(block.parent, 'blockQuote');\n const isBlockAllowedInBQ = schema.checkChild(['$root', 'blockQuote'], block);\n return isBQAllowed && isBlockAllowedInBQ;\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquotecommand.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteediting.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteediting.js ***! + \*******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ BlockQuoteEditing)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var ckeditor5_src_enter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/enter */ \"./node_modules/ckeditor5/src/enter.js\");\n/* harmony import */ var ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ckeditor5/src/typing */ \"./node_modules/ckeditor5/src/typing.js\");\n/* harmony import */ var _blockquotecommand__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./blockquotecommand */ \"./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquotecommand.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module block-quote/blockquoteediting\n */\n\n\n\n\n/**\n * The block quote editing.\n *\n * Introduces the `'blockQuote'` command and the `'blockQuote'` model element.\n *\n * @extends module:core/plugin~Plugin\n */\nclass BlockQuoteEditing extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'BlockQuoteEditing';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [ckeditor5_src_enter__WEBPACK_IMPORTED_MODULE_1__.Enter, ckeditor5_src_typing__WEBPACK_IMPORTED_MODULE_2__.Delete];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const schema = editor.model.schema;\n editor.commands.add('blockQuote', new _blockquotecommand__WEBPACK_IMPORTED_MODULE_3__[\"default\"](editor));\n schema.register('blockQuote', {\n inheritAllFrom: '$container'\n });\n editor.conversion.elementToElement({ model: 'blockQuote', view: 'blockquote' });\n // Postfixer which cleans incorrect model states connected with block quotes.\n editor.model.document.registerPostFixer(writer => {\n const changes = editor.model.document.differ.getChanges();\n for (const entry of changes) {\n if (entry.type == 'insert') {\n const element = entry.position.nodeAfter;\n if (!element) {\n // We are inside a text node.\n continue;\n }\n if (element.is('element', 'blockQuote') && element.isEmpty) {\n // Added an empty blockQuote - remove it.\n writer.remove(element);\n return true;\n }\n else if (element.is('element', 'blockQuote') && !schema.checkChild(entry.position, element)) {\n // Added a blockQuote in incorrect place. Unwrap it so the content inside is not lost.\n writer.unwrap(element);\n return true;\n }\n else if (element.is('element')) {\n // Just added an element. Check that all children meet the scheme rules.\n const range = writer.createRangeIn(element);\n for (const child of range.getItems()) {\n if (child.is('element', 'blockQuote') &&\n !schema.checkChild(writer.createPositionBefore(child), child)) {\n writer.unwrap(child);\n return true;\n }\n }\n }\n }\n else if (entry.type == 'remove') {\n const parent = entry.position.parent;\n if (parent.is('element', 'blockQuote') && parent.isEmpty) {\n // Something got removed and now blockQuote is empty. Remove the blockQuote as well.\n writer.remove(parent);\n return true;\n }\n }\n }\n return false;\n });\n const viewDocument = this.editor.editing.view.document;\n const selection = editor.model.document.selection;\n const blockQuoteCommand = editor.commands.get('blockQuote');\n // Overwrite default Enter key behavior.\n // If Enter key is pressed with selection collapsed in empty block inside a quote, break the quote.\n this.listenTo(viewDocument, 'enter', (evt, data) => {\n if (!selection.isCollapsed || !blockQuoteCommand.value) {\n return;\n }\n const positionParent = selection.getLastPosition().parent;\n if (positionParent.isEmpty) {\n editor.execute('blockQuote');\n editor.editing.view.scrollToTheSelection();\n data.preventDefault();\n evt.stop();\n }\n }, { context: 'blockquote' });\n // Overwrite default Backspace key behavior.\n // If Backspace key is pressed with selection collapsed in first empty block inside a quote, break the quote.\n this.listenTo(viewDocument, 'delete', (evt, data) => {\n if (data.direction != 'backward' || !selection.isCollapsed || !blockQuoteCommand.value) {\n return;\n }\n const positionParent = selection.getLastPosition().parent;\n if (positionParent.isEmpty && !positionParent.previousSibling) {\n editor.execute('blockQuote');\n editor.editing.view.scrollToTheSelection();\n data.preventDefault();\n evt.stop();\n }\n }, { context: 'blockquote' });\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteediting.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteui.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteui.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ BlockQuoteUI)\n/* harmony export */ });\n/* harmony import */ var ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ckeditor5/src/core */ \"./node_modules/ckeditor5/src/core.js\");\n/* harmony import */ var ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ckeditor5/src/ui */ \"./node_modules/ckeditor5/src/ui.js\");\n/* harmony import */ var _theme_blockquote_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme/blockquote.css */ \"./node_modules/@ckeditor/ckeditor5-block-quote/theme/blockquote.css\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module block-quote/blockquoteui\n */\n\n\n\n/**\n * The block quote UI plugin.\n *\n * It introduces the `'blockQuote'` button.\n *\n * @extends module:core/plugin~Plugin\n */\nclass BlockQuoteUI extends ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'BlockQuoteUI';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const t = editor.t;\n editor.ui.componentFactory.add('blockQuote', locale => {\n const command = editor.commands.get('blockQuote');\n const buttonView = new ckeditor5_src_ui__WEBPACK_IMPORTED_MODULE_1__.ButtonView(locale);\n buttonView.set({\n label: t('Block quote'),\n icon: ckeditor5_src_core__WEBPACK_IMPORTED_MODULE_0__.icons.quote,\n tooltip: true,\n isToggleable: true\n });\n // Bind button model to command.\n buttonView.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');\n // Execute command.\n this.listenTo(buttonView, 'execute', () => {\n editor.execute('blockQuote');\n editor.editing.view.focus();\n });\n return buttonView;\n });\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-block-quote/src/blockquoteui.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboard.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboard.js ***! + \*********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Clipboard)\n/* harmony export */ });\n/* harmony import */ var _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core */ \"./node_modules/@ckeditor/ckeditor5-core/src/index.js\");\n/* harmony import */ var _clipboardpipeline__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clipboardpipeline */ \"./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js\");\n/* harmony import */ var _dragdrop__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dragdrop */ \"./node_modules/@ckeditor/ckeditor5-clipboard/src/dragdrop.js\");\n/* harmony import */ var _pasteplaintext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./pasteplaintext */ \"./node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/clipboard\n */\n\n\n\n\n/**\n * The clipboard feature.\n *\n * Read more about the clipboard integration in the {@glink framework/guides/deep-dive/clipboard clipboard deep-dive guide}.\n *\n * This is a \"glue\" plugin which loads the following plugins:\n * * {@link module:clipboard/clipboardpipeline~ClipboardPipeline}\n * * {@link module:clipboard/dragdrop~DragDrop}\n * * {@link module:clipboard/pasteplaintext~PastePlainText}\n */\nclass Clipboard extends _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'Clipboard';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [_clipboardpipeline__WEBPACK_IMPORTED_MODULE_1__[\"default\"], _dragdrop__WEBPACK_IMPORTED_MODULE_2__[\"default\"], _pasteplaintext__WEBPACK_IMPORTED_MODULE_3__[\"default\"]];\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboard.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js ***! + \*****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ClipboardObserver)\n/* harmony export */ });\n/* harmony import */ var _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils */ \"./node_modules/@ckeditor/ckeditor5-utils/src/index.js\");\n/* harmony import */ var _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine */ \"./node_modules/@ckeditor/ckeditor5-engine/src/index.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/clipboardobserver\n */\n\n\n/**\n * Clipboard events observer.\n *\n * Fires the following events:\n *\n * * {@link module:engine/view/document~Document#event:clipboardInput},\n * * {@link module:engine/view/document~Document#event:paste},\n * * {@link module:engine/view/document~Document#event:copy},\n * * {@link module:engine/view/document~Document#event:cut},\n * * {@link module:engine/view/document~Document#event:drop},\n * * {@link module:engine/view/document~Document#event:dragover},\n * * {@link module:engine/view/document~Document#event:dragging},\n * * {@link module:engine/view/document~Document#event:dragstart},\n * * {@link module:engine/view/document~Document#event:dragend},\n * * {@link module:engine/view/document~Document#event:dragenter},\n * * {@link module:engine/view/document~Document#event:dragleave}.\n *\n * **Note**: This observer is not available by default (ckeditor5-engine does not add it on its own).\n * To make it available, it needs to be added to {@link module:engine/view/document~Document} by using\n * the {@link module:engine/view/view~View#addObserver `View#addObserver()`} method. Alternatively, you can load the\n * {@link module:clipboard/clipboard~Clipboard} plugin which adds this observer automatically (because it uses it).\n */\nclass ClipboardObserver extends _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_1__.DomEventObserver {\n constructor(view) {\n super(view);\n const viewDocument = this.document;\n this.domEventType = ['paste', 'copy', 'cut', 'drop', 'dragover', 'dragstart', 'dragend', 'dragenter', 'dragleave'];\n this.listenTo(viewDocument, 'paste', handleInput('clipboardInput'), { priority: 'low' });\n this.listenTo(viewDocument, 'drop', handleInput('clipboardInput'), { priority: 'low' });\n this.listenTo(viewDocument, 'dragover', handleInput('dragging'), { priority: 'low' });\n function handleInput(type) {\n return (evt, data) => {\n data.preventDefault();\n const targetRanges = data.dropRange ? [data.dropRange] : null;\n const eventInfo = new _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__.EventInfo(viewDocument, type);\n viewDocument.fire(eventInfo, {\n dataTransfer: data.dataTransfer,\n method: evt.name,\n targetRanges,\n target: data.target\n });\n // If CKEditor handled the input, do not bubble the original event any further.\n // This helps external integrations recognize that fact and act accordingly.\n // https://github.com/ckeditor/ckeditor5-upload/issues/92\n if (eventInfo.stop.called) {\n data.stopPropagation();\n }\n };\n }\n }\n onDomEvent(domEvent) {\n const nativeDataTransfer = 'clipboardData' in domEvent ? domEvent.clipboardData : domEvent.dataTransfer;\n const cacheFiles = domEvent.type == 'drop' || domEvent.type == 'paste';\n const evtData = {\n dataTransfer: new _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_1__.DataTransfer(nativeDataTransfer, { cacheFiles })\n };\n if (domEvent.type == 'drop' || domEvent.type == 'dragover') {\n evtData.dropRange = getDropViewRange(this.view, domEvent);\n }\n this.fire(domEvent.type, domEvent, evtData);\n }\n}\nfunction getDropViewRange(view, domEvent) {\n const domDoc = domEvent.target.ownerDocument;\n const x = domEvent.clientX;\n const y = domEvent.clientY;\n let domRange;\n // Webkit & Blink.\n if (domDoc.caretRangeFromPoint && domDoc.caretRangeFromPoint(x, y)) {\n domRange = domDoc.caretRangeFromPoint(x, y);\n }\n // FF.\n else if (domEvent.rangeParent) {\n domRange = domDoc.createRange();\n domRange.setStart(domEvent.rangeParent, domEvent.rangeOffset);\n domRange.collapse(true);\n }\n if (domRange) {\n return view.domConverter.domRangeToView(domRange);\n }\n return null;\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js ***! + \*****************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ClipboardPipeline)\n/* harmony export */ });\n/* harmony import */ var _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core */ \"./node_modules/@ckeditor/ckeditor5-core/src/index.js\");\n/* harmony import */ var _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils */ \"./node_modules/@ckeditor/ckeditor5-utils/src/index.js\");\n/* harmony import */ var _clipboardobserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clipboardobserver */ \"./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js\");\n/* harmony import */ var _utils_plaintexttohtml__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/plaintexttohtml */ \"./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/plaintexttohtml.js\");\n/* harmony import */ var _utils_normalizeclipboarddata__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/normalizeclipboarddata */ \"./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/normalizeclipboarddata.js\");\n/* harmony import */ var _utils_viewtoplaintext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/viewtoplaintext */ \"./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/viewtoplaintext.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/clipboardpipeline\n */\n\n\n\n\n\n\n// Input pipeline events overview:\n//\n// ┌──────────────────────┐ ┌──────────────────────┐\n// │ view.Document │ │ view.Document │\n// │ paste │ │ drop │\n// └───────────┬──────────┘ └───────────┬──────────┘\n// │ │\n// └────────────────┌────────────────┘\n// │\n// ┌─────────V────────┐\n// │ view.Document │ Retrieves text/html or text/plain from data.dataTransfer\n// │ clipboardInput │ and processes it to view.DocumentFragment.\n// └─────────┬────────┘\n// │\n// ┌───────────V───────────┐\n// │ ClipboardPipeline │ Converts view.DocumentFragment to model.DocumentFragment.\n// │ inputTransformation │\n// └───────────┬───────────┘\n// │\n// ┌──────────V──────────┐\n// │ ClipboardPipeline │ Calls model.insertContent().\n// │ contentInsertion │\n// └─────────────────────┘\n//\n//\n// Output pipeline events overview:\n//\n// ┌──────────────────────┐ ┌──────────────────────┐\n// │ view.Document │ │ view.Document │ Retrieves the selected model.DocumentFragment\n// │ copy │ │ cut │ and converts it to view.DocumentFragment.\n// └───────────┬──────────┘ └───────────┬──────────┘\n// │ │\n// └────────────────┌────────────────┘\n// │\n// ┌─────────V────────┐\n// │ view.Document │ Processes view.DocumentFragment to text/html and text/plain\n// │ clipboardOutput │ and stores the results in data.dataTransfer.\n// └──────────────────┘\n//\n/**\n * The clipboard pipeline feature. It is responsible for intercepting the `paste` and `drop` events and\n * passing the pasted content through a series of events in order to insert it into the editor's content.\n * It also handles the `cut` and `copy` events to fill the native clipboard with the serialized editor's data.\n *\n * # Input pipeline\n *\n * The behavior of the default handlers (all at a `low` priority):\n *\n * ## Event: `paste` or `drop`\n *\n * 1. Translates the event data.\n * 2. Fires the {@link module:engine/view/document~Document#event:clipboardInput `view.Document#clipboardInput`} event.\n *\n * ## Event: `view.Document#clipboardInput`\n *\n * 1. If the `data.content` event field is already set (by some listener on a higher priority), it takes this content and fires the event\n * from the last point.\n * 2. Otherwise, it retrieves `text/html` or `text/plain` from `data.dataTransfer`.\n * 3. Normalizes the raw data by applying simple filters on string data.\n * 4. Processes the raw data to {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`} with the\n * {@link module:engine/controller/datacontroller~DataController#htmlProcessor `DataController#htmlProcessor`}.\n * 5. Fires the {@link module:clipboard/clipboardpipeline~ClipboardPipeline#event:inputTransformation\n * `ClipboardPipeline#inputTransformation`} event with the view document fragment in the `data.content` event field.\n *\n * ## Event: `ClipboardPipeline#inputTransformation`\n *\n * 1. Converts {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`} from the `data.content` field to\n * {@link module:engine/model/documentfragment~DocumentFragment `model.DocumentFragment`}.\n * 2. Fires the {@link module:clipboard/clipboardpipeline~ClipboardPipeline#event:contentInsertion `ClipboardPipeline#contentInsertion`}\n * event with the model document fragment in the `data.content` event field.\n * **Note**: The `ClipboardPipeline#contentInsertion` event is fired within a model change block to allow other handlers\n * to run in the same block without post-fixers called in between (i.e., the selection post-fixer).\n *\n * ## Event: `ClipboardPipeline#contentInsertion`\n *\n * 1. Calls {@link module:engine/model/model~Model#insertContent `model.insertContent()`} to insert `data.content`\n * at the current selection position.\n *\n * # Output pipeline\n *\n * The behavior of the default handlers (all at a `low` priority):\n *\n * ## Event: `copy`, `cut` or `dragstart`\n *\n * 1. Retrieves the selected {@link module:engine/model/documentfragment~DocumentFragment `model.DocumentFragment`} by calling\n * {@link module:engine/model/model~Model#getSelectedContent `model#getSelectedContent()`}.\n * 2. Converts the model document fragment to {@link module:engine/view/documentfragment~DocumentFragment `view.DocumentFragment`}.\n * 3. Fires the {@link module:engine/view/document~Document#event:clipboardOutput `view.Document#clipboardOutput`} event\n * with the view document fragment in the `data.content` event field.\n *\n * ## Event: `view.Document#clipboardOutput`\n *\n * 1. Processes `data.content` to HTML and plain text with the\n * {@link module:engine/controller/datacontroller~DataController#htmlProcessor `DataController#htmlProcessor`}.\n * 2. Updates the `data.dataTransfer` data for `text/html` and `text/plain` with the processed data.\n * 3. For the `cut` method, calls {@link module:engine/model/model~Model#deleteContent `model.deleteContent()`}\n * on the current selection.\n *\n * Read more about the clipboard integration in the {@glink framework/guides/deep-dive/clipboard clipboard deep-dive guide}.\n */\nclass ClipboardPipeline extends _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'ClipboardPipeline';\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const view = editor.editing.view;\n view.addObserver(_clipboardobserver__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n this._setupPasteDrop();\n this._setupCopyCut();\n }\n /**\n * The clipboard paste pipeline.\n */\n _setupPasteDrop() {\n const editor = this.editor;\n const model = editor.model;\n const view = editor.editing.view;\n const viewDocument = view.document;\n // Pasting and dropping is disabled when editor is in the read-only mode.\n // See: https://github.com/ckeditor/ckeditor5-clipboard/issues/26.\n this.listenTo(viewDocument, 'clipboardInput', evt => {\n if (editor.isReadOnly) {\n evt.stop();\n }\n }, { priority: 'highest' });\n this.listenTo(viewDocument, 'clipboardInput', (evt, data) => {\n const dataTransfer = data.dataTransfer;\n let content;\n // Some feature could already inject content in the higher priority event handler (i.e., codeBlock).\n if (data.content) {\n content = data.content;\n }\n else {\n let contentData = '';\n if (dataTransfer.getData('text/html')) {\n contentData = (0,_utils_normalizeclipboarddata__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(dataTransfer.getData('text/html'));\n }\n else if (dataTransfer.getData('text/plain')) {\n contentData = (0,_utils_plaintexttohtml__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(dataTransfer.getData('text/plain'));\n }\n content = this.editor.data.htmlProcessor.toView(contentData);\n }\n const eventInfo = new _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_1__.EventInfo(this, 'inputTransformation');\n this.fire(eventInfo, {\n content,\n dataTransfer,\n targetRanges: data.targetRanges,\n method: data.method\n });\n // If CKEditor handled the input, do not bubble the original event any further.\n // This helps external integrations recognize this fact and act accordingly.\n // https://github.com/ckeditor/ckeditor5-upload/issues/92\n if (eventInfo.stop.called) {\n evt.stop();\n }\n view.scrollToTheSelection();\n }, { priority: 'low' });\n this.listenTo(this, 'inputTransformation', (evt, data) => {\n if (data.content.isEmpty) {\n return;\n }\n const dataController = this.editor.data;\n // Convert the pasted content into a model document fragment.\n // The conversion is contextual, but in this case an \"all allowed\" context is needed\n // and for that we use the $clipboardHolder item.\n const modelFragment = dataController.toModel(data.content, '$clipboardHolder');\n if (modelFragment.childCount == 0) {\n return;\n }\n evt.stop();\n // Fire content insertion event in a single change block to allow other handlers to run in the same block\n // without post-fixers called in between (i.e., the selection post-fixer).\n model.change(() => {\n this.fire('contentInsertion', {\n content: modelFragment,\n method: data.method,\n dataTransfer: data.dataTransfer,\n targetRanges: data.targetRanges\n });\n });\n }, { priority: 'low' });\n this.listenTo(this, 'contentInsertion', (evt, data) => {\n data.resultRange = model.insertContent(data.content);\n }, { priority: 'low' });\n }\n /**\n * The clipboard copy/cut pipeline.\n */\n _setupCopyCut() {\n const editor = this.editor;\n const modelDocument = editor.model.document;\n const view = editor.editing.view;\n const viewDocument = view.document;\n const onCopyCut = (evt, data) => {\n const dataTransfer = data.dataTransfer;\n data.preventDefault();\n const content = editor.data.toView(editor.model.getSelectedContent(modelDocument.selection));\n viewDocument.fire('clipboardOutput', {\n dataTransfer,\n content,\n method: evt.name\n });\n };\n this.listenTo(viewDocument, 'copy', onCopyCut, { priority: 'low' });\n this.listenTo(viewDocument, 'cut', (evt, data) => {\n // Cutting is disabled when editor is in the read-only mode.\n // See: https://github.com/ckeditor/ckeditor5-clipboard/issues/26.\n if (editor.isReadOnly) {\n data.preventDefault();\n }\n else {\n onCopyCut(evt, data);\n }\n }, { priority: 'low' });\n this.listenTo(viewDocument, 'clipboardOutput', (evt, data) => {\n if (!data.content.isEmpty) {\n data.dataTransfer.setData('text/html', this.editor.data.htmlProcessor.toData(data.content));\n data.dataTransfer.setData('text/plain', (0,_utils_viewtoplaintext__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(data.content));\n }\n if (data.method == 'cut') {\n editor.model.deleteContent(modelDocument.selection);\n }\n }, { priority: 'low' });\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/dragdrop.js": +/*!********************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/dragdrop.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ DragDrop)\n/* harmony export */ });\n/* harmony import */ var _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core */ \"./node_modules/@ckeditor/ckeditor5-core/src/index.js\");\n/* harmony import */ var _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine */ \"./node_modules/@ckeditor/ckeditor5-engine/src/index.js\");\n/* harmony import */ var _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @ckeditor/ckeditor5-widget */ \"./node_modules/@ckeditor/ckeditor5-widget/src/index.js\");\n/* harmony import */ var _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils */ \"./node_modules/@ckeditor/ckeditor5-utils/src/index.js\");\n/* harmony import */ var _clipboardpipeline__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./clipboardpipeline */ \"./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js\");\n/* harmony import */ var _clipboardobserver__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./clipboardobserver */ \"./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js\");\n/* harmony import */ var lodash_es__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! lodash-es */ \"./node_modules/lodash-es/throttle.js\");\n/* harmony import */ var _theme_clipboard_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../theme/clipboard.css */ \"./node_modules/@ckeditor/ckeditor5-clipboard/theme/clipboard.css\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/dragdrop\n */\n/* globals setTimeout, clearTimeout */\n\n\n\n\n\n\n\n\n// Drag and drop events overview:\n//\n// ┌──────────────────┐\n// │ mousedown │ Sets the draggable attribute.\n// └─────────┬────────┘\n// │\n// └─────────────────────┐\n// │ │\n// │ ┌─────────V────────┐\n// │ │ mouseup │ Dragging did not start, removes the draggable attribute.\n// │ └──────────────────┘\n// │\n// ┌─────────V────────┐ Retrieves the selected model.DocumentFragment\n// │ dragstart │ and converts it to view.DocumentFragment.\n// └─────────┬────────┘\n// │\n// ┌─────────V────────┐ Processes view.DocumentFragment to text/html and text/plain\n// │ clipboardOutput │ and stores the results in data.dataTransfer.\n// └─────────┬────────┘\n// │\n// │ DOM dragover\n// ┌────────────┐\n// │ │\n// ┌─────────V────────┐ │\n// │ dragging │ │ Updates the drop target marker.\n// └─────────┬────────┘ │\n// │ │\n// ┌─────────────└────────────┘\n// │ │ │\n// │ ┌─────────V────────┐ │\n// │ │ dragleave │ │ Removes the drop target marker.\n// │ └─────────┬────────┘ │\n// │ │ │\n// ┌───│─────────────┘ │\n// │ │ │ │\n// │ │ ┌─────────V────────┐ │\n// │ │ │ dragenter │ │ Focuses the editor view.\n// │ │ └─────────┬────────┘ │\n// │ │ │ │\n// │ │ └────────────┘\n// │ │\n// │ └─────────────┐\n// │ │ │\n// │ │ ┌─────────V────────┐\n// └───┐ │ drop │ (The default handler of the clipboard pipeline).\n// │ └─────────┬────────┘\n// │ │\n// │ ┌─────────V────────┐ Resolves the final data.targetRanges.\n// │ │ clipboardInput │ Aborts if dropping on dragged content.\n// │ └─────────┬────────┘\n// │ │\n// │ ┌─────────V────────┐\n// │ │ clipboardInput │ (The default handler of the clipboard pipeline).\n// │ └─────────┬────────┘\n// │ │\n// │ ┌───────────V───────────┐\n// │ │ inputTransformation │ (The default handler of the clipboard pipeline).\n// │ └───────────┬───────────┘\n// │ │\n// │ ┌──────────V──────────┐\n// │ │ contentInsertion │ Updates the document selection to drop range.\n// │ └──────────┬──────────┘\n// │ │\n// │ ┌──────────V──────────┐\n// │ │ contentInsertion │ (The default handler of the clipboard pipeline).\n// │ └──────────┬──────────┘\n// │ │\n// │ ┌──────────V──────────┐\n// │ │ contentInsertion │ Removes the content from the original range if the insertion was successful.\n// │ └──────────┬──────────┘\n// │ │\n// └─────────────┐\n// │\n// ┌─────────V────────┐\n// │ dragend │ Removes the drop marker and cleans the state.\n// └──────────────────┘\n//\n/**\n * The drag and drop feature. It works on top of the {@link module:clipboard/clipboardpipeline~ClipboardPipeline}.\n *\n * Read more about the clipboard integration in the {@glink framework/guides/deep-dive/clipboard clipboard deep-dive guide}.\n */\nclass DragDrop extends _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'DragDrop';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [_clipboardpipeline__WEBPACK_IMPORTED_MODULE_4__[\"default\"], _ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_2__.Widget];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const view = editor.editing.view;\n this._draggedRange = null;\n this._draggingUid = '';\n this._draggableElement = null;\n this._updateDropMarkerThrottled = (0,lodash_es__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(targetRange => this._updateDropMarker(targetRange), 40);\n this._removeDropMarkerDelayed = delay(() => this._removeDropMarker(), 40);\n this._clearDraggableAttributesDelayed = delay(() => this._clearDraggableAttributes(), 40);\n view.addObserver(_clipboardobserver__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\n view.addObserver(_ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_1__.MouseObserver);\n this._setupDragging();\n this._setupContentInsertionIntegration();\n this._setupClipboardInputIntegration();\n this._setupDropMarker();\n this._setupDraggableAttributeHandling();\n this.listenTo(editor, 'change:isReadOnly', (evt, name, isReadOnly) => {\n if (isReadOnly) {\n this.forceDisabled('readOnlyMode');\n }\n else {\n this.clearForceDisabled('readOnlyMode');\n }\n });\n this.on('change:isEnabled', (evt, name, isEnabled) => {\n if (!isEnabled) {\n this._finalizeDragging(false);\n }\n });\n if (_ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_3__.env.isAndroid) {\n this.forceDisabled('noAndroidSupport');\n }\n }\n /**\n * @inheritDoc\n */\n destroy() {\n if (this._draggedRange) {\n this._draggedRange.detach();\n this._draggedRange = null;\n }\n this._updateDropMarkerThrottled.cancel();\n this._removeDropMarkerDelayed.cancel();\n this._clearDraggableAttributesDelayed.cancel();\n return super.destroy();\n }\n /**\n * Drag and drop events handling.\n */\n _setupDragging() {\n const editor = this.editor;\n const model = editor.model;\n const modelDocument = model.document;\n const view = editor.editing.view;\n const viewDocument = view.document;\n // The handler for the drag start; it is responsible for setting data transfer object.\n this.listenTo(viewDocument, 'dragstart', (evt, data) => {\n const selection = modelDocument.selection;\n // Don't drag the editable element itself.\n if (data.target && data.target.is('editableElement')) {\n data.preventDefault();\n return;\n }\n // TODO we could clone this node somewhere and style it to match editing view but without handles,\n // selection outline, WTA buttons, etc.\n // data.dataTransfer._native.setDragImage( data.domTarget, 0, 0 );\n // Check if this is dragstart over the widget (but not a nested editable).\n const draggableWidget = data.target ? findDraggableWidget(data.target) : null;\n if (draggableWidget) {\n const modelElement = editor.editing.mapper.toModelElement(draggableWidget);\n this._draggedRange = _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_1__.LiveRange.fromRange(model.createRangeOn(modelElement));\n // Disable toolbars so they won't obscure the drop area.\n if (editor.plugins.has('WidgetToolbarRepository')) {\n editor.plugins.get('WidgetToolbarRepository').forceDisabled('dragDrop');\n }\n }\n // If this was not a widget we should check if we need to drag some text content.\n else if (!viewDocument.selection.isCollapsed) {\n const selectedElement = viewDocument.selection.getSelectedElement();\n if (!selectedElement || !(0,_ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_2__.isWidget)(selectedElement)) {\n this._draggedRange = _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_1__.LiveRange.fromRange(selection.getFirstRange());\n }\n }\n if (!this._draggedRange) {\n data.preventDefault();\n return;\n }\n this._draggingUid = (0,_ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_3__.uid)();\n data.dataTransfer.effectAllowed = this.isEnabled ? 'copyMove' : 'copy';\n data.dataTransfer.setData('application/ckeditor5-dragging-uid', this._draggingUid);\n const draggedSelection = model.createSelection(this._draggedRange.toRange());\n const content = editor.data.toView(model.getSelectedContent(draggedSelection));\n viewDocument.fire('clipboardOutput', {\n dataTransfer: data.dataTransfer,\n content,\n method: 'dragstart'\n });\n if (!this.isEnabled) {\n this._draggedRange.detach();\n this._draggedRange = null;\n this._draggingUid = '';\n }\n }, { priority: 'low' });\n // The handler for finalizing drag and drop. It should always be triggered after dragging completes\n // even if it was completed in a different application.\n // Note: This is not fired if source text node got removed while downcasting a marker.\n this.listenTo(viewDocument, 'dragend', (evt, data) => {\n this._finalizeDragging(!data.dataTransfer.isCanceled && data.dataTransfer.dropEffect == 'move');\n }, { priority: 'low' });\n // Dragging over the editable.\n this.listenTo(viewDocument, 'dragenter', () => {\n if (!this.isEnabled) {\n return;\n }\n view.focus();\n });\n // Dragging out of the editable.\n this.listenTo(viewDocument, 'dragleave', () => {\n // We do not know if the mouse left the editor or just some element in it, so let us wait a few milliseconds\n // to check if 'dragover' is not fired.\n this._removeDropMarkerDelayed();\n });\n // Handler for moving dragged content over the target area.\n this.listenTo(viewDocument, 'dragging', (evt, data) => {\n if (!this.isEnabled) {\n data.dataTransfer.dropEffect = 'none';\n return;\n }\n this._removeDropMarkerDelayed.cancel();\n const targetRange = findDropTargetRange(editor, data.targetRanges, data.target);\n // If this is content being dragged from another editor, moving out of current editor instance\n // is not possible until 'dragend' event case will be fixed.\n if (!this._draggedRange) {\n data.dataTransfer.dropEffect = 'copy';\n }\n // In Firefox it is already set and effect allowed remains the same as originally set.\n if (!_ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_3__.env.isGecko) {\n if (data.dataTransfer.effectAllowed == 'copy') {\n data.dataTransfer.dropEffect = 'copy';\n }\n else if (['all', 'copyMove'].includes(data.dataTransfer.effectAllowed)) {\n data.dataTransfer.dropEffect = 'move';\n }\n }\n /* istanbul ignore else */\n if (targetRange) {\n this._updateDropMarkerThrottled(targetRange);\n }\n }, { priority: 'low' });\n }\n /**\n * Integration with the `clipboardInput` event.\n */\n _setupClipboardInputIntegration() {\n const editor = this.editor;\n const view = editor.editing.view;\n const viewDocument = view.document;\n // Update the event target ranges and abort dropping if dropping over itself.\n this.listenTo(viewDocument, 'clipboardInput', (evt, data) => {\n if (data.method != 'drop') {\n return;\n }\n const targetRange = findDropTargetRange(editor, data.targetRanges, data.target);\n // The dragging markers must be removed after searching for the target range because sometimes\n // the target lands on the marker itself.\n this._removeDropMarker();\n /* istanbul ignore if */\n if (!targetRange) {\n this._finalizeDragging(false);\n evt.stop();\n return;\n }\n // Since we cannot rely on the drag end event, we must check if the local drag range is from the current drag and drop\n // or it is from some previous not cleared one.\n if (this._draggedRange && this._draggingUid != data.dataTransfer.getData('application/ckeditor5-dragging-uid')) {\n this._draggedRange.detach();\n this._draggedRange = null;\n this._draggingUid = '';\n }\n // Do not do anything if some content was dragged within the same document to the same position.\n const isMove = getFinalDropEffect(data.dataTransfer) == 'move';\n if (isMove && this._draggedRange && this._draggedRange.containsRange(targetRange, true)) {\n this._finalizeDragging(false);\n evt.stop();\n return;\n }\n // Override the target ranges with the one adjusted to the best one for a drop.\n data.targetRanges = [editor.editing.mapper.toViewRange(targetRange)];\n }, { priority: 'high' });\n }\n /**\n * Integration with the `contentInsertion` event of the clipboard pipeline.\n */\n _setupContentInsertionIntegration() {\n const clipboardPipeline = this.editor.plugins.get(_clipboardpipeline__WEBPACK_IMPORTED_MODULE_4__[\"default\"]);\n clipboardPipeline.on('contentInsertion', (evt, data) => {\n if (!this.isEnabled || data.method !== 'drop') {\n return;\n }\n // Update the selection to the target range in the same change block to avoid selection post-fixing\n // and to be able to clone text attributes for plain text dropping.\n const ranges = data.targetRanges.map(viewRange => this.editor.editing.mapper.toModelRange(viewRange));\n this.editor.model.change(writer => writer.setSelection(ranges));\n }, { priority: 'high' });\n clipboardPipeline.on('contentInsertion', (evt, data) => {\n if (!this.isEnabled || data.method !== 'drop') {\n return;\n }\n // Remove dragged range content, remove markers, clean after dragging.\n const isMove = getFinalDropEffect(data.dataTransfer) == 'move';\n // Whether any content was inserted (insertion might fail if the schema is disallowing some elements\n // (for example an image caption allows only the content of a block but not blocks themselves.\n // Some integrations might not return valid range (i.e., table pasting).\n const isSuccess = !data.resultRange || !data.resultRange.isCollapsed;\n this._finalizeDragging(isSuccess && isMove);\n }, { priority: 'lowest' });\n }\n /**\n * Adds listeners that add the `draggable` attribute to the elements while the mouse button is down so the dragging could start.\n */\n _setupDraggableAttributeHandling() {\n const editor = this.editor;\n const view = editor.editing.view;\n const viewDocument = view.document;\n // Add the 'draggable' attribute to the widget while pressing the selection handle.\n // This is required for widgets to be draggable. In Chrome it will enable dragging text nodes.\n this.listenTo(viewDocument, 'mousedown', (evt, data) => {\n // The lack of data can be caused by editor tests firing fake mouse events. This should not occur\n // in real-life scenarios but this greatly simplifies editor tests that would otherwise fail a lot.\n if (_ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_3__.env.isAndroid || !data) {\n return;\n }\n this._clearDraggableAttributesDelayed.cancel();\n // Check if this is a mousedown over the widget (but not a nested editable).\n let draggableElement = findDraggableWidget(data.target);\n // Note: There is a limitation that if more than a widget is selected (a widget and some text)\n // and dragging starts on the widget, then only the widget is dragged.\n // If this was not a widget then we should check if we need to drag some text content.\n // In Chrome set a 'draggable' attribute on closest editable to allow immediate dragging of the selected text range.\n // In Firefox this is not needed. In Safari it makes the whole editable draggable (not just textual content).\n // Disabled in read-only mode because draggable=\"true\" + contenteditable=\"false\" results\n // in not firing selectionchange event ever, which makes the selection stuck in read-only mode.\n if (_ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_3__.env.isBlink && !editor.isReadOnly && !draggableElement && !viewDocument.selection.isCollapsed) {\n const selectedElement = viewDocument.selection.getSelectedElement();\n if (!selectedElement || !(0,_ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_2__.isWidget)(selectedElement)) {\n draggableElement = viewDocument.selection.editableElement;\n }\n }\n if (draggableElement) {\n view.change(writer => {\n writer.setAttribute('draggable', 'true', draggableElement);\n });\n // Keep the reference to the model element in case the view element gets removed while dragging.\n this._draggableElement = editor.editing.mapper.toModelElement(draggableElement);\n }\n });\n // Remove the draggable attribute in case no dragging started (only mousedown + mouseup).\n this.listenTo(viewDocument, 'mouseup', () => {\n if (!_ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_3__.env.isAndroid) {\n this._clearDraggableAttributesDelayed();\n }\n });\n }\n /**\n * Removes the `draggable` attribute from the element that was used for dragging.\n */\n _clearDraggableAttributes() {\n const editing = this.editor.editing;\n editing.view.change(writer => {\n // Remove 'draggable' attribute.\n if (this._draggableElement && this._draggableElement.root.rootName != '$graveyard') {\n writer.removeAttribute('draggable', editing.mapper.toViewElement(this._draggableElement));\n }\n this._draggableElement = null;\n });\n }\n /**\n * Creates downcast conversion for the drop target marker.\n */\n _setupDropMarker() {\n const editor = this.editor;\n // Drop marker conversion for hovering over widgets.\n editor.conversion.for('editingDowncast').markerToHighlight({\n model: 'drop-target',\n view: {\n classes: ['ck-clipboard-drop-target-range']\n }\n });\n // Drop marker conversion for in text drop target.\n editor.conversion.for('editingDowncast').markerToElement({\n model: 'drop-target',\n view: (data, { writer }) => {\n const inText = editor.model.schema.checkChild(data.markerRange.start, '$text');\n if (!inText) {\n return;\n }\n return writer.createUIElement('span', { class: 'ck ck-clipboard-drop-target-position' }, function (domDocument) {\n const domElement = this.toDomElement(domDocument);\n // Using word joiner to make this marker as high as text and also making text not break on marker.\n domElement.append('\\u2060', domDocument.createElement('span'), '\\u2060');\n return domElement;\n });\n }\n });\n }\n /**\n * Updates the drop target marker to the provided range.\n *\n * @param targetRange The range to set the marker to.\n */\n _updateDropMarker(targetRange) {\n const editor = this.editor;\n const markers = editor.model.markers;\n editor.model.change(writer => {\n if (markers.has('drop-target')) {\n if (!markers.get('drop-target').getRange().isEqual(targetRange)) {\n writer.updateMarker('drop-target', { range: targetRange });\n }\n }\n else {\n writer.addMarker('drop-target', {\n range: targetRange,\n usingOperation: false,\n affectsData: false\n });\n }\n });\n }\n /**\n * Removes the drop target marker.\n */\n _removeDropMarker() {\n const model = this.editor.model;\n this._removeDropMarkerDelayed.cancel();\n this._updateDropMarkerThrottled.cancel();\n if (model.markers.has('drop-target')) {\n model.change(writer => {\n writer.removeMarker('drop-target');\n });\n }\n }\n /**\n * Deletes the dragged content from its original range and clears the dragging state.\n *\n * @param moved Whether the move succeeded.\n */\n _finalizeDragging(moved) {\n const editor = this.editor;\n const model = editor.model;\n this._removeDropMarker();\n this._clearDraggableAttributes();\n if (editor.plugins.has('WidgetToolbarRepository')) {\n editor.plugins.get('WidgetToolbarRepository').clearForceDisabled('dragDrop');\n }\n this._draggingUid = '';\n if (!this._draggedRange) {\n return;\n }\n // Delete moved content.\n if (moved && this.isEnabled) {\n model.deleteContent(model.createSelection(this._draggedRange), { doNotAutoparagraph: true });\n }\n this._draggedRange.detach();\n this._draggedRange = null;\n }\n}\n/**\n * Returns fixed selection range for given position and target element.\n */\nfunction findDropTargetRange(editor, targetViewRanges, targetViewElement) {\n const model = editor.model;\n const mapper = editor.editing.mapper;\n let range = null;\n const targetViewPosition = targetViewRanges ? targetViewRanges[0].start : null;\n // A UIElement is not a valid drop element, use parent (this could be a drop marker or any other UIElement).\n if (targetViewElement.is('uiElement')) {\n targetViewElement = targetViewElement.parent;\n }\n // Quick win if the target is a widget (but not a nested editable).\n range = findDropTargetRangeOnWidget(editor, targetViewElement);\n if (range) {\n return range;\n }\n // The easiest part is over, now we need to move to the model space.\n // Find target model element and position.\n const targetModelElement = getClosestMappedModelElement(editor, targetViewElement);\n const targetModelPosition = targetViewPosition ? mapper.toModelPosition(targetViewPosition) : null;\n // There is no target position while hovering over an empty table cell.\n // In Safari, target position can be empty while hovering over a widget (e.g., a page-break).\n // Find the drop position inside the element.\n if (!targetModelPosition) {\n return findDropTargetRangeInElement(editor, targetModelElement);\n }\n // Check if target position is between blocks and adjust drop position to the next object.\n // This is because while hovering over a root element next to a widget the target position can jump in crazy places.\n range = findDropTargetRangeBetweenBlocks(editor, targetModelPosition, targetModelElement);\n if (range) {\n return range;\n }\n // Try fixing selection position.\n // In Firefox, the target position lands before widgets but in other browsers it tends to land after a widget.\n range = model.schema.getNearestSelectionRange(targetModelPosition, _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_3__.env.isGecko ? 'forward' : 'backward');\n if (range) {\n return range;\n }\n // There is no valid selection position inside the current limit element so find a closest object ancestor.\n // This happens if the model position lands directly in the element itself (view target element was a `
`\n // so a nested editable, but view target position was directly in the `
` element).\n return findDropTargetRangeOnAncestorObject(editor, targetModelPosition.parent);\n}\n/**\n * Returns fixed selection range for a given position and a target element if it is over the widget but not over its nested editable.\n */\nfunction findDropTargetRangeOnWidget(editor, targetViewElement) {\n const model = editor.model;\n const mapper = editor.editing.mapper;\n // Quick win if the target is a widget.\n if ((0,_ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_2__.isWidget)(targetViewElement)) {\n return model.createRangeOn(mapper.toModelElement(targetViewElement));\n }\n // Check if we are deeper over a widget (but not over a nested editable).\n if (!targetViewElement.is('editableElement')) {\n // Find a closest ancestor that is either a widget or an editable element...\n const ancestor = targetViewElement.findAncestor(node => (0,_ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_2__.isWidget)(node) || node.is('editableElement'));\n // ...and if the widget was closer then it is a drop target.\n if ((0,_ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_2__.isWidget)(ancestor)) {\n return model.createRangeOn(mapper.toModelElement(ancestor));\n }\n }\n return null;\n}\n/**\n * Returns fixed selection range inside a model element.\n */\nfunction findDropTargetRangeInElement(editor, targetModelElement) {\n const model = editor.model;\n const schema = model.schema;\n const positionAtElementStart = model.createPositionAt(targetModelElement, 0);\n return schema.getNearestSelectionRange(positionAtElementStart, 'forward');\n}\n/**\n * Returns fixed selection range for a given position and a target element if the drop is between blocks.\n */\nfunction findDropTargetRangeBetweenBlocks(editor, targetModelPosition, targetModelElement) {\n const model = editor.model;\n // Check if target is between blocks.\n if (!model.schema.checkChild(targetModelElement, '$block')) {\n return null;\n }\n // Find position between blocks.\n const positionAtElementStart = model.createPositionAt(targetModelElement, 0);\n // Get the common part of the path (inside the target element and the target position).\n const commonPath = targetModelPosition.path.slice(0, positionAtElementStart.path.length);\n // Position between the blocks.\n const betweenBlocksPosition = model.createPositionFromPath(targetModelPosition.root, commonPath);\n const nodeAfter = betweenBlocksPosition.nodeAfter;\n // Adjust drop position to the next object.\n // This is because while hovering over a root element next to a widget the target position can jump in crazy places.\n if (nodeAfter && model.schema.isObject(nodeAfter)) {\n return model.createRangeOn(nodeAfter);\n }\n return null;\n}\n/**\n * Returns a selection range on the ancestor object.\n */\nfunction findDropTargetRangeOnAncestorObject(editor, element) {\n const model = editor.model;\n let currentElement = element;\n while (currentElement) {\n if (model.schema.isObject(currentElement)) {\n return model.createRangeOn(currentElement);\n }\n currentElement = currentElement.parent;\n }\n /* istanbul ignore next */\n return null;\n}\n/**\n * Returns the closest model element for the specified view element.\n */\nfunction getClosestMappedModelElement(editor, element) {\n const mapper = editor.editing.mapper;\n const view = editor.editing.view;\n const targetModelElement = mapper.toModelElement(element);\n if (targetModelElement) {\n return targetModelElement;\n }\n // Find mapped ancestor if the target is inside not mapped element (for example inline code element).\n const viewPosition = view.createPositionBefore(element);\n const viewElement = mapper.findMappedViewAncestor(viewPosition);\n return mapper.toModelElement(viewElement);\n}\n/**\n * Returns the drop effect that should be a result of dragging the content.\n * This function is handling a quirk when checking the effect in the 'drop' DOM event.\n */\nfunction getFinalDropEffect(dataTransfer) {\n if (_ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_3__.env.isGecko) {\n return dataTransfer.dropEffect;\n }\n return ['all', 'copyMove'].includes(dataTransfer.effectAllowed) ? 'move' : 'copy';\n}\n/**\n * Returns a function wrapper that will trigger a function after a specified wait time.\n * The timeout can be canceled by calling the cancel function on the returned wrapped function.\n * @param func The function to wrap.\n * @param wait The timeout in ms.\n */\nfunction delay(func, wait) {\n let timer;\n function delayed(...args) {\n delayed.cancel();\n timer = setTimeout(() => func(...args), wait);\n }\n delayed.cancel = () => {\n clearTimeout(timer);\n };\n return delayed;\n}\n/**\n * Returns a widget element that should be dragged.\n */\nfunction findDraggableWidget(target) {\n // This is directly an editable so not a widget for sure.\n if (target.is('editableElement')) {\n return null;\n }\n // TODO: Let's have a isWidgetSelectionHandleDomElement() helper in ckeditor5-widget utils.\n if (target.hasClass('ck-widget__selection-handle')) {\n return target.findAncestor(_ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_2__.isWidget);\n }\n // Direct hit on a widget.\n if ((0,_ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_2__.isWidget)(target)) {\n return target;\n }\n // Find closest ancestor that is either a widget or an editable element...\n const ancestor = target.findAncestor(node => (0,_ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_2__.isWidget)(node) || node.is('editableElement'));\n // ...and if closer was the widget then enable dragging it.\n if ((0,_ckeditor_ckeditor5_widget__WEBPACK_IMPORTED_MODULE_2__.isWidget)(ancestor)) {\n return ancestor;\n }\n return null;\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-clipboard/src/dragdrop.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/index.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/index.js ***! + \*****************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Clipboard\": () => (/* reexport safe */ _clipboard__WEBPACK_IMPORTED_MODULE_0__[\"default\"]),\n/* harmony export */ \"ClipboardPipeline\": () => (/* reexport safe */ _clipboardpipeline__WEBPACK_IMPORTED_MODULE_1__[\"default\"]),\n/* harmony export */ \"DragDrop\": () => (/* reexport safe */ _dragdrop__WEBPACK_IMPORTED_MODULE_2__[\"default\"]),\n/* harmony export */ \"PastePlainText\": () => (/* reexport safe */ _pasteplaintext__WEBPACK_IMPORTED_MODULE_3__[\"default\"])\n/* harmony export */ });\n/* harmony import */ var _clipboard__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./clipboard */ \"./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboard.js\");\n/* harmony import */ var _clipboardpipeline__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clipboardpipeline */ \"./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js\");\n/* harmony import */ var _dragdrop__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dragdrop */ \"./node_modules/@ckeditor/ckeditor5-clipboard/src/dragdrop.js\");\n/* harmony import */ var _pasteplaintext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./pasteplaintext */ \"./node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard\n */\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-clipboard/src/index.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.js ***! + \**************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ PastePlainText)\n/* harmony export */ });\n/* harmony import */ var _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-core */ \"./node_modules/@ckeditor/ckeditor5-core/src/index.js\");\n/* harmony import */ var _clipboardobserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clipboardobserver */ \"./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardobserver.js\");\n/* harmony import */ var _clipboardpipeline__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./clipboardpipeline */ \"./node_modules/@ckeditor/ckeditor5-clipboard/src/clipboardpipeline.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/pasteplaintext\n */\n\n\n\n/**\n * The plugin detects the user's intention to paste plain text.\n *\n * For example, it detects the Ctrl/Cmd + Shift + V keystroke.\n */\nclass PastePlainText extends _ckeditor_ckeditor5_core__WEBPACK_IMPORTED_MODULE_0__.Plugin {\n /**\n * @inheritDoc\n */\n static get pluginName() {\n return 'PastePlainText';\n }\n /**\n * @inheritDoc\n */\n static get requires() {\n return [_clipboardpipeline__WEBPACK_IMPORTED_MODULE_2__[\"default\"]];\n }\n /**\n * @inheritDoc\n */\n init() {\n const editor = this.editor;\n const model = editor.model;\n const view = editor.editing.view;\n const viewDocument = view.document;\n const selection = model.document.selection;\n let shiftPressed = false;\n view.addObserver(_clipboardobserver__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n this.listenTo(viewDocument, 'keydown', (evt, data) => {\n shiftPressed = data.shiftKey;\n });\n editor.plugins.get(_clipboardpipeline__WEBPACK_IMPORTED_MODULE_2__[\"default\"]).on('contentInsertion', (evt, data) => {\n // Plain text can be determined based on the event flag (#7799) or auto-detection (#1006). If detected,\n // preserve selection attributes on pasted items.\n if (!shiftPressed && !isPlainTextFragment(data.content, model.schema)) {\n return;\n }\n model.change(writer => {\n // Formatting attributes should be preserved.\n const textAttributes = Array.from(selection.getAttributes())\n .filter(([key]) => model.schema.getAttributeProperties(key).isFormatting);\n if (!selection.isCollapsed) {\n model.deleteContent(selection, { doNotAutoparagraph: true });\n }\n // Also preserve other attributes if they survived the content deletion (because they were not fully selected).\n // For example linkHref is not a formatting attribute but it should be preserved if pasted text was in the middle\n // of a link.\n textAttributes.push(...selection.getAttributes());\n const range = writer.createRangeIn(data.content);\n for (const item of range.getItems()) {\n if (item.is('$textProxy')) {\n writer.setAttributes(textAttributes, item);\n }\n }\n });\n });\n }\n}\n/**\n * Returns true if specified `documentFragment` represents a plain text.\n */\nfunction isPlainTextFragment(documentFragment, schema) {\n if (documentFragment.childCount > 1) {\n return false;\n }\n const child = documentFragment.getChild(0);\n if (schema.isObject(child)) {\n return false;\n }\n return Array.from(child.getAttributeKeys()).length == 0;\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-clipboard/src/pasteplaintext.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/normalizeclipboarddata.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/normalizeclipboarddata.js ***! + \****************************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ normalizeClipboardData)\n/* harmony export */ });\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/utils/normalizeclipboarddata\n */\n/**\n * Removes some popular browser quirks out of the clipboard data (HTML).\n * Removes all HTML comments. These are considered an internal thing and it makes little sense if they leak into the editor data.\n *\n * @param data The HTML data to normalize.\n * @returns Normalized HTML.\n */\nfunction normalizeClipboardData(data) {\n return data\n .replace(/(\\s+)<\\/span>/g, (fullMatch, spaces) => {\n // Handle the most popular and problematic case when even a single space becomes an nbsp;.\n // Decode those to normal spaces. Read more in https://github.com/ckeditor/ckeditor5-clipboard/issues/2.\n if (spaces.length == 1) {\n return ' ';\n }\n return spaces;\n })\n // Remove all HTML comments.\n .replace(//g, '');\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/normalizeclipboarddata.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/plaintexttohtml.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/plaintexttohtml.js ***! + \*********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ plainTextToHtml)\n/* harmony export */ });\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module clipboard/utils/plaintexttohtml\n */\n/**\n * Converts plain text to its HTML-ized version.\n *\n * @param text The plain text to convert.\n * @returns HTML generated from the plain text.\n */\nfunction plainTextToHtml(text) {\n text = text\n // Encode <>.\n .replace(//g, '>')\n // Creates a paragraph for each double line break.\n .replace(/\\r?\\n\\r?\\n/g, '

')\n // Creates a line break for each single line break.\n .replace(/\\r?\\n/g, '
')\n // Replace tabs with four spaces.\n .replace(/\\t/g, '    ')\n // Preserve trailing spaces (only the first and last one – the rest is handled below).\n .replace(/^\\s/, ' ')\n .replace(/\\s$/, ' ')\n // Preserve other subsequent spaces now.\n .replace(/\\s\\s/g, '  ');\n if (text.includes('

') || text.includes('
')) {\n // If we created paragraphs above, add the trailing ones.\n text = `

${text}

`;\n }\n // TODO:\n // * What about '\\nfoo' vs ' foo'?\n return text;\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/plaintexttohtml.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/viewtoplaintext.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/viewtoplaintext.js ***! + \*********************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ viewToPlainText)\n/* harmony export */ });\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n// Elements which should not have empty-line padding.\n// Most `view.ContainerElement` want to be separate by new-line, but some are creating one structure\n// together (like `
  • `) so it is better to separate them by only one \"\\n\".\nconst smallPaddingElements = ['figcaption', 'li'];\n/**\n * Converts {@link module:engine/view/item~Item view item} and all of its children to plain text.\n *\n * @param viewItem View item to convert.\n * @returns Plain text representation of `viewItem`.\n */\nfunction viewToPlainText(viewItem) {\n let text = '';\n if (viewItem.is('$text') || viewItem.is('$textProxy')) {\n // If item is `Text` or `TextProxy` simple take its text data.\n text = viewItem.data;\n }\n else if (viewItem.is('element', 'img') && viewItem.hasAttribute('alt')) {\n // Special case for images - use alt attribute if it is provided.\n text = viewItem.getAttribute('alt');\n }\n else if (viewItem.is('element', 'br')) {\n // A soft break should be converted into a single line break (#8045).\n text = '\\n';\n }\n else {\n // Other elements are document fragments, attribute elements or container elements.\n // They don't have their own text value, so convert their children.\n let prev = null;\n for (const child of viewItem.getChildren()) {\n const childText = viewToPlainText(child);\n // Separate container element children with one or more new-line characters.\n if (prev && (prev.is('containerElement') || child.is('containerElement'))) {\n if (smallPaddingElements.includes(prev.name) ||\n smallPaddingElements.includes(child.name)) {\n text += '\\n';\n }\n else {\n text += '\\n\\n';\n }\n }\n text += childText;\n prev = child;\n }\n }\n return text;\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-clipboard/src/utils/viewtoplaintext.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-core/src/command.js": +/*!**************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-core/src/command.js ***! + \**************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Command)\n/* harmony export */ });\n/* harmony import */ var _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils */ \"./node_modules/@ckeditor/ckeditor5-utils/src/index.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/command\n */\n\n/**\n * Base class for the CKEditor commands.\n *\n * Commands are the main way to manipulate the editor contents and state. They are mostly used by UI elements (or by other\n * commands) to make changes in the model. Commands are available in every part of the code that has access to\n * the {@link module:core/editor/editor~Editor editor} instance.\n *\n * Instances of registered commands can be retrieved from {@link module:core/editor/editor~Editor#commands `editor.commands`}.\n * The easiest way to execute a command is through {@link module:core/editor/editor~Editor#execute `editor.execute()`}.\n *\n * By default, commands are disabled when the editor is in the {@link module:core/editor/editor~Editor#isReadOnly read-only} mode\n * but commands with the {@link module:core/command~Command#affectsData `affectsData`} flag set to `false` will not be disabled.\n *\n * @mixes module:utils/observablemixin~ObservableMixin\n */\nclass Command extends (0,_ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__.ObservableMixin)() {\n /**\n * Creates a new `Command` instance.\n *\n * @param {module:core/editor/editor~Editor} editor The editor on which this command will be used.\n */\n constructor(editor) {\n super();\n /**\n * The editor on which this command will be used.\n *\n * @readonly\n * @member {module:core/editor/editor~Editor}\n */\n this.editor = editor;\n /**\n * The value of the command. A given command class should define what it represents for it.\n *\n * For example, the `'bold'` command's value indicates whether the selection starts in a bolded text.\n * And the value of the `'link'` command may be an object with link details.\n *\n * It is possible for a command to have no value (e.g. for stateless actions such as `'uploadImage'`).\n *\n * A given command class should control this value by overriding the {@link #refresh `refresh()`} method.\n *\n * @observable\n * @readonly\n * @member #value\n */\n this.set('value', undefined);\n /**\n * Flag indicating whether a command is enabled or disabled.\n * A disabled command will do nothing when executed.\n *\n * A given command class should control this value by overriding the {@link #refresh `refresh()`} method.\n *\n * It is possible to disable a command \"from outside\". For instance, in your integration you may want to disable\n * a certain set of commands for the time being. To do that, you can use the fact that `isEnabled` is observable\n * and it fires the `set:isEnabled` event every time anyone tries to modify its value:\n *\n *\t\tfunction disableCommand( cmd ) {\n *\t\t\tcmd.on( 'set:isEnabled', forceDisable, { priority: 'highest' } );\n *\n *\t\t\tcmd.isEnabled = false;\n *\n *\t\t\t// Make it possible to enable the command again.\n *\t\t\treturn () => {\n *\t\t\t\tcmd.off( 'set:isEnabled', forceDisable );\n *\t\t\t\tcmd.refresh();\n *\t\t\t};\n *\n *\t\t\tfunction forceDisable( evt ) {\n *\t\t\t\tevt.return = false;\n *\t\t\t\tevt.stop();\n *\t\t\t}\n *\t\t}\n *\n *\t\t// Usage:\n *\n *\t\t// Disabling the command.\n *\t\tconst enableBold = disableCommand( editor.commands.get( 'bold' ) );\n *\n *\t\t// Enabling the command again.\n *\t\tenableBold();\n *\n * @observable\n * @readonly\n * @member {Boolean} #isEnabled\n */\n this.set('isEnabled', false);\n /**\n * A flag indicating whether a command execution changes the editor data or not.\n *\n * Commands with `affectsData` set to `false` will not be automatically disabled in\n * the {@link module:core/editor/editor~Editor#isReadOnly read-only mode} and\n * {@glink features/read-only#related-features other editor modes} with restricted user write permissions.\n *\n * **Note:** You do not have to set it for your every command. It is `true` by default.\n *\n * @readonly\n * @default true\n * @member {Boolean} #affectsData\n */\n this._affectsData = true;\n /**\n * Holds identifiers for {@link #forceDisabled} mechanism.\n *\n * @type {Set.}\n * @private\n */\n this._disableStack = new Set();\n this.decorate('execute');\n // By default every command is refreshed when changes are applied to the model.\n this.listenTo(this.editor.model.document, 'change', () => {\n this.refresh();\n });\n this.on('execute', evt => {\n if (!this.isEnabled) {\n evt.stop();\n }\n }, { priority: 'high' });\n // By default commands are disabled when the editor is in read-only mode.\n this.listenTo(editor, 'change:isReadOnly', (evt, name, value) => {\n if (value && this.affectsData) {\n this.forceDisabled('readOnlyMode');\n }\n else {\n this.clearForceDisabled('readOnlyMode');\n }\n });\n }\n get affectsData() {\n return this._affectsData;\n }\n set affectsData(affectsData) {\n this._affectsData = affectsData;\n }\n /**\n * Refreshes the command. The command should update its {@link #isEnabled} and {@link #value} properties\n * in this method.\n *\n * This method is automatically called when\n * {@link module:engine/model/document~Document#event:change any changes are applied to the document}.\n */\n refresh() {\n this.isEnabled = true;\n }\n /**\n * Disables the command.\n *\n * Command may be disabled by multiple features or algorithms (at once). When disabling a command, unique id should be passed\n * (e.g. the feature name). The same identifier should be used when {@link #clearForceDisabled enabling back} the command.\n * The command becomes enabled only after all features {@link #clearForceDisabled enabled it back}.\n *\n * Disabling and enabling a command:\n *\n *\t\tcommand.isEnabled; // -> true\n *\t\tcommand.forceDisabled( 'MyFeature' );\n *\t\tcommand.isEnabled; // -> false\n *\t\tcommand.clearForceDisabled( 'MyFeature' );\n *\t\tcommand.isEnabled; // -> true\n *\n * Command disabled by multiple features:\n *\n *\t\tcommand.forceDisabled( 'MyFeature' );\n *\t\tcommand.forceDisabled( 'OtherFeature' );\n *\t\tcommand.clearForceDisabled( 'MyFeature' );\n *\t\tcommand.isEnabled; // -> false\n *\t\tcommand.clearForceDisabled( 'OtherFeature' );\n *\t\tcommand.isEnabled; // -> true\n *\n * Multiple disabling with the same identifier is redundant:\n *\n *\t\tcommand.forceDisabled( 'MyFeature' );\n *\t\tcommand.forceDisabled( 'MyFeature' );\n *\t\tcommand.clearForceDisabled( 'MyFeature' );\n *\t\tcommand.isEnabled; // -> true\n *\n * **Note:** some commands or algorithms may have more complex logic when it comes to enabling or disabling certain commands,\n * so the command might be still disabled after {@link #clearForceDisabled} was used.\n *\n * @param {String} id Unique identifier for disabling. Use the same id when {@link #clearForceDisabled enabling back} the command.\n */\n forceDisabled(id) {\n this._disableStack.add(id);\n if (this._disableStack.size == 1) {\n this.on('set:isEnabled', forceDisable, { priority: 'highest' });\n this.isEnabled = false;\n }\n }\n /**\n * Clears forced disable previously set through {@link #forceDisabled}. See {@link #forceDisabled}.\n *\n * @param {String} id Unique identifier, equal to the one passed in {@link #forceDisabled} call.\n */\n clearForceDisabled(id) {\n this._disableStack.delete(id);\n if (this._disableStack.size == 0) {\n this.off('set:isEnabled', forceDisable);\n this.refresh();\n }\n }\n /**\n * Executes the command.\n *\n * A command may accept parameters. They will be passed from {@link module:core/editor/editor~Editor#execute `editor.execute()`}\n * to the command.\n *\n * The `execute()` method will automatically abort when the command is disabled ({@link #isEnabled} is `false`).\n * This behavior is implemented by a high priority listener to the {@link #event:execute} event.\n *\n * In order to see how to disable a command from \"outside\" see the {@link #isEnabled} documentation.\n *\n * This method may return a value, which would be forwarded all the way down to the\n * {@link module:core/editor/editor~Editor#execute `editor.execute()`}.\n *\n * @fires execute\n */\n execute(...args) { return undefined; }\n /**\n * Destroys the command.\n */\n destroy() {\n this.stopListening();\n }\n}\n// Helper function that forces command to be disabled.\nfunction forceDisable(evt) {\n evt.return = false;\n evt.stop();\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-core/src/command.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-core/src/commandcollection.js": +/*!************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-core/src/commandcollection.js ***! + \************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ CommandCollection)\n/* harmony export */ });\n/* harmony import */ var _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils */ \"./node_modules/@ckeditor/ckeditor5-utils/src/index.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/commandcollection\n */\n\n/**\n * Collection of commands. Its instance is available in {@link module:core/editor/editor~Editor#commands `editor.commands`}.\n */\nclass CommandCollection {\n /**\n * Creates collection instance.\n */\n constructor() {\n /**\n * Command map.\n *\n * @private\n * @member {Map}\n */\n this._commands = new Map();\n }\n /**\n * Registers a new command.\n *\n * @param {String} commandName The name of the command.\n * @param {module:core/command~Command} command\n */\n add(commandName, command) {\n this._commands.set(commandName, command);\n }\n /**\n * Retrieves a command from the collection.\n *\n * @param {String} commandName The name of the command.\n * @returns {module:core/command~Command}\n */\n get(commandName) {\n return this._commands.get(commandName);\n }\n /**\n * Executes a command.\n *\n * @param {String} commandName The name of the command.\n * @param {*} [...commandParams] Command parameters.\n * @returns {*} The value returned by the {@link module:core/command~Command#execute `command.execute()`}.\n */\n execute(commandName, ...args) {\n const command = this.get(commandName);\n if (!command) {\n /**\n * Command does not exist.\n *\n * @error commandcollection-command-not-found\n * @param {String} commandName Name of the command.\n */\n throw new _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__.CKEditorError('commandcollection-command-not-found', this, { commandName });\n }\n return command.execute(...args);\n }\n /**\n * Returns iterator of command names.\n *\n * @returns {Iterable.}\n */\n *names() {\n yield* this._commands.keys();\n }\n /**\n * Returns iterator of command instances.\n *\n * @returns {Iterable.}\n */\n *commands() {\n yield* this._commands.values();\n }\n /**\n * Iterable interface.\n *\n * Returns `[ commandName, commandInstance ]` pairs.\n *\n * @returns {Iterator.}\n */\n [Symbol.iterator]() {\n return this._commands[Symbol.iterator]();\n }\n /**\n * Destroys all collection commands.\n */\n destroy() {\n for (const command of this.commands()) {\n command.destroy();\n }\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-core/src/commandcollection.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-core/src/context.js": +/*!**************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-core/src/context.js ***! + \**************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Context)\n/* harmony export */ });\n/* harmony import */ var _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils */ \"./node_modules/@ckeditor/ckeditor5-utils/src/index.js\");\n/* harmony import */ var _plugincollection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./plugincollection */ \"./node_modules/@ckeditor/ckeditor5-core/src/plugincollection.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/context\n */\n\n\n/**\n * Provides a common, higher-level environment for solutions that use multiple {@link module:core/editor/editor~Editor editors}\n * or plugins that work outside the editor. Use it instead of {@link module:core/editor/editor~Editor.create `Editor.create()`}\n * in advanced application integrations.\n *\n * All configuration options passed to a context will be used as default options for the editor instances initialized in that context.\n *\n * {@link module:core/contextplugin~ContextPlugin Context plugins} passed to a context instance will be shared among all\n * editor instances initialized in this context. These will be the same plugin instances for all the editors.\n *\n * **Note:** The context can only be initialized with {@link module:core/contextplugin~ContextPlugin context plugins}\n * (e.g. [comments](https://ckeditor.com/collaboration/comments/)). Regular {@link module:core/plugin~Plugin plugins} require an\n * editor instance to work and cannot be added to a context.\n *\n * **Note:** You can add a context plugin to an editor instance, though.\n *\n * If you are using multiple editor instances on one page and use any context plugins, create a context to share the configuration and\n * plugins among these editors. Some plugins will use the information about all existing editors to better integrate between them.\n *\n * If you are using plugins that do not require an editor to work (e.g. [comments](https://ckeditor.com/collaboration/comments/)),\n * enable and configure them using the context.\n *\n * If you are using only a single editor on each page, use {@link module:core/editor/editor~Editor.create `Editor.create()`} instead.\n * In such a case, a context instance will be created by the editor instance in a transparent way.\n *\n * See {@link module:core/context~Context.create `Context.create()`} for usage examples.\n */\nclass Context {\n /**\n * Creates a context instance with a given configuration.\n *\n * Usually not to be used directly. See the static {@link module:core/context~Context.create `create()`} method.\n *\n * @param {Object} [config={}] The context configuration.\n */\n constructor(config) {\n /**\n * Stores all the configurations specific to this context instance.\n *\n * @readonly\n * @type {module:utils/config~Config}\n */\n this.config = new _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__.Config(config, this.constructor.defaultConfig);\n const availablePlugins = this.constructor.builtinPlugins;\n this.config.define('plugins', availablePlugins);\n /**\n * The plugins loaded and in use by this context instance.\n *\n * @readonly\n * @type {module:core/plugincollection~PluginCollection}\n */\n this.plugins = new _plugincollection__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this, availablePlugins);\n const languageConfig = this.config.get('language') || {};\n /**\n * @readonly\n * @type {module:utils/locale~Locale}\n */\n this.locale = new _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__.Locale({\n uiLanguage: typeof languageConfig === 'string' ? languageConfig : languageConfig.ui,\n contentLanguage: this.config.get('language.content')\n });\n /**\n * Shorthand for {@link module:utils/locale~Locale#t}.\n *\n * @see module:utils/locale~Locale#t\n * @method #t\n */\n this.t = this.locale.t;\n /**\n * A list of editors that this context instance is injected to.\n *\n * @readonly\n * @type {module:utils/collection~Collection}\n */\n this.editors = new _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__.Collection();\n /**\n * Reference to the editor which created the context.\n * Null when the context was created outside of the editor.\n *\n * It is used to destroy the context when removing the editor that has created the context.\n *\n * @private\n * @type {module:core/editor/editor~Editor|null}\n */\n this._contextOwner = null;\n }\n /**\n * Loads and initializes plugins specified in the configuration.\n *\n * @returns {Promise.} A promise which resolves\n * once the initialization is completed, providing an array of loaded plugins.\n */\n initPlugins() {\n const plugins = this.config.get('plugins') || [];\n const substitutePlugins = this.config.get('substitutePlugins') || [];\n // Plugins for substitution should be checked as well.\n for (const Plugin of plugins.concat(substitutePlugins)) {\n if (typeof Plugin != 'function') {\n /**\n * Only a constructor function is allowed as a {@link module:core/contextplugin~ContextPlugin context plugin}.\n *\n * @error context-initplugins-constructor-only\n */\n throw new _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__.CKEditorError('context-initplugins-constructor-only', null, { Plugin });\n }\n if (Plugin.isContextPlugin !== true) {\n /**\n * Only a plugin marked as a {@link module:core/contextplugin~ContextPlugin.isContextPlugin context plugin}\n * is allowed to be used with a context.\n *\n * @error context-initplugins-invalid-plugin\n */\n throw new _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__.CKEditorError('context-initplugins-invalid-plugin', null, { Plugin });\n }\n }\n return this.plugins.init(plugins, [], substitutePlugins);\n }\n /**\n * Destroys the context instance and all editors used with the context,\n * releasing all resources used by the context.\n *\n * @returns {Promise} A promise that resolves once the context instance is fully destroyed.\n */\n destroy() {\n return Promise.all(Array.from(this.editors, editor => editor.destroy()))\n .then(() => this.plugins.destroy());\n }\n /**\n * Adds a reference to the editor which is used with this context.\n *\n * When the given editor has created the context, the reference to this editor will be stored\n * as a {@link ~Context#_contextOwner}.\n *\n * This method should only be used by the editor.\n *\n * @protected\n * @param {module:core/editor/editor~Editor} editor\n * @param {Boolean} isContextOwner Stores the given editor as a context owner.\n */\n _addEditor(editor, isContextOwner) {\n if (this._contextOwner) {\n /**\n * Cannot add multiple editors to the context which is created by the editor.\n *\n * @error context-addeditor-private-context\n */\n throw new _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__.CKEditorError('context-addeditor-private-context');\n }\n this.editors.add(editor);\n if (isContextOwner) {\n this._contextOwner = editor;\n }\n }\n /**\n * Removes a reference to the editor which was used with this context.\n * When the context was created by the given editor, the context will be destroyed.\n *\n * This method should only be used by the editor.\n *\n * @protected\n * @param {module:core/editor/editor~Editor} editor\n * @return {Promise} A promise that resolves once the editor is removed from the context or when the context was destroyed.\n */\n _removeEditor(editor) {\n if (this.editors.has(editor)) {\n this.editors.remove(editor);\n }\n if (this._contextOwner === editor) {\n return this.destroy();\n }\n return Promise.resolve();\n }\n /**\n * Returns the context configuration which will be copied to the editors created using this context.\n *\n * The configuration returned by this method has the plugins configuration removed — plugins are shared with all editors\n * through another mechanism.\n *\n * This method should only be used by the editor.\n *\n * @protected\n * @returns {Object} Configuration as a plain object.\n */\n _getEditorConfig() {\n const result = {};\n for (const name of this.config.names()) {\n if (!['plugins', 'removePlugins', 'extraPlugins'].includes(name)) {\n result[name] = this.config.get(name);\n }\n }\n return result;\n }\n /**\n * Creates and initializes a new context instance.\n *\n *\t\tconst commonConfig = { ... }; // Configuration for all the plugins and editors.\n *\t\tconst editorPlugins = [ ... ]; // Regular plugins here.\n *\n *\t\tContext\n *\t\t\t.create( {\n *\t\t\t\t// Only context plugins here.\n *\t\t\t\tplugins: [ ... ],\n *\n *\t\t\t\t// Configure the language for all the editors (it cannot be overwritten).\n *\t\t\t\tlanguage: { ... },\n *\n *\t\t\t\t// Configuration for context plugins.\n *\t\t\t\tcomments: { ... },\n *\t\t\t\t...\n *\n *\t\t\t\t// Default configuration for editor plugins.\n *\t\t\t\ttoolbar: { ... },\n *\t\t\t\timage: { ... },\n *\t\t\t\t...\n *\t\t\t} )\n *\t\t\t.then( context => {\n *\t\t\t\tconst promises = [];\n *\n *\t\t\t\tpromises.push( ClassicEditor.create(\n *\t\t\t\t\tdocument.getElementById( 'editor1' ),\n *\t\t\t\t\t{\n *\t\t\t\t\t\teditorPlugins,\n *\t\t\t\t\t\tcontext\n *\t\t\t\t\t}\n *\t\t\t\t) );\n *\n *\t\t\t\tpromises.push( ClassicEditor.create(\n *\t\t\t\t\tdocument.getElementById( 'editor2' ),\n *\t\t\t\t\t{\n *\t\t\t\t\t\teditorPlugins,\n *\t\t\t\t\t\tcontext,\n *\t\t\t\t\t\ttoolbar: { ... } // You can overwrite the configuration of the context.\n *\t\t\t\t\t}\n *\t\t\t\t) );\n *\n *\t\t\t\treturn Promise.all( promises );\n *\t\t\t} );\n *\n * @param {Object} [config] The context configuration.\n * @returns {Promise} A promise resolved once the context is ready. The promise resolves with the created context instance.\n */\n static create(config) {\n return new Promise(resolve => {\n const context = new this(config);\n resolve(context.initPlugins().then(() => context));\n });\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-core/src/context.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js": +/*!********************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ContextPlugin)\n/* harmony export */ });\n/* harmony import */ var _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils */ \"./node_modules/@ckeditor/ckeditor5-utils/src/index.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/contextplugin\n */\n\n/**\n * The base class for {@link module:core/context~Context} plugin classes.\n *\n * A context plugin can either be initialized for an {@link module:core/editor/editor~Editor editor} or for\n * a {@link module:core/context~Context context}. In other words, it can either\n * work within one editor instance or with one or more editor instances that use a single context.\n * It is the context plugin's role to implement handling for both modes.\n *\n * There are a few rules for interaction between the editor plugins and context plugins:\n *\n * * A context plugin can require another context plugin.\n * * An {@link module:core/plugin~Plugin editor plugin} can require a context plugin.\n * * A context plugin MUST NOT require an {@link module:core/plugin~Plugin editor plugin}.\n *\n * @implements module:core/plugin~PluginInterface\n * @mixes module:utils/observablemixin~ObservableMixin\n */\nclass ContextPlugin extends (0,_ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__.ObservableMixin)() {\n /**\n * Creates a new plugin instance.\n *\n * @param {module:core/context~Context|module:core/editor/editor~Editor} context\n */\n constructor(context) {\n super();\n /**\n * The context instance.\n *\n * @readonly\n * @type {module:core/context~Context|module:core/editor/editor~Editor}\n */\n this.context = context;\n }\n /**\n * @inheritDoc\n */\n destroy() {\n this.stopListening();\n }\n /**\n * @inheritDoc\n */\n static get isContextPlugin() {\n return true;\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-core/src/contextplugin.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-core/src/editingkeystrokehandler.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-core/src/editingkeystrokehandler.js ***! + \******************************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ EditingKeystrokeHandler)\n/* harmony export */ });\n/* harmony import */ var _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils */ \"./node_modules/@ckeditor/ckeditor5-utils/src/index.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/editingkeystrokehandler\n */\n\n/**\n * A keystroke handler for editor editing. Its instance is available\n * in {@link module:core/editor/editor~Editor#keystrokes} so plugins\n * can register their keystrokes.\n *\n * E.g. an undo plugin would do this:\n *\n *\t\teditor.keystrokes.set( 'Ctrl+Z', 'undo' );\n *\t\teditor.keystrokes.set( 'Ctrl+Shift+Z', 'redo' );\n *\t\teditor.keystrokes.set( 'Ctrl+Y', 'redo' );\n *\n * @extends module:utils/keystrokehandler~KeystrokeHandler\n */\nclass EditingKeystrokeHandler extends _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__.KeystrokeHandler {\n /**\n * Creates an instance of the keystroke handler.\n *\n * @param {module:core/editor/editor~Editor} editor\n */\n constructor(editor) {\n super();\n /**\n * The editor instance.\n *\n * @readonly\n * @member {module:core/editor/editor~Editor}\n */\n this.editor = editor;\n }\n /**\n * Registers a handler for the specified keystroke.\n *\n * The handler can be specified as a command name or a callback.\n *\n * @param {String|Array.} keystroke Keystroke defined in a format accepted by\n * the {@link module:utils/keyboard~parseKeystroke} function.\n * @param {Function|String} callback If a string is passed, then the keystroke will\n * {@link module:core/editor/editor~Editor#execute execute a command}.\n * If a function, then it will be called with the\n * {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and\n * a `cancel()` helper to both `preventDefault()` and `stopPropagation()` of the event.\n * @param {Object} [options={}] Additional options.\n * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of the keystroke\n * callback. The higher the priority value the sooner the callback will be executed. Keystrokes having the same priority\n * are called in the order they were added.\n */\n set(keystroke, callback, options = {}) {\n if (typeof callback == 'string') {\n const commandName = callback;\n callback = (evtData, cancel) => {\n this.editor.execute(commandName);\n cancel();\n };\n }\n super.set(keystroke, callback, options);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@ckeditor/ckeditor5-core/src/editingkeystrokehandler.js?"); + +/***/ }), + +/***/ "./node_modules/@ckeditor/ckeditor5-core/src/editor/editor.js": +/*!********************************************************************!*\ + !*** ./node_modules/@ckeditor/ckeditor5-core/src/editor/editor.js ***! + \********************************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Editor)\n/* harmony export */ });\n/* harmony import */ var _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @ckeditor/ckeditor5-utils */ \"./node_modules/@ckeditor/ckeditor5-utils/src/index.js\");\n/* harmony import */ var _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ckeditor/ckeditor5-engine */ \"./node_modules/@ckeditor/ckeditor5-engine/src/index.js\");\n/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../context */ \"./node_modules/@ckeditor/ckeditor5-core/src/context.js\");\n/* harmony import */ var _plugincollection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../plugincollection */ \"./node_modules/@ckeditor/ckeditor5-core/src/plugincollection.js\");\n/* harmony import */ var _commandcollection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../commandcollection */ \"./node_modules/@ckeditor/ckeditor5-core/src/commandcollection.js\");\n/* harmony import */ var _editingkeystrokehandler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../editingkeystrokehandler */ \"./node_modules/@ckeditor/ckeditor5-core/src/editingkeystrokehandler.js\");\n/**\n * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n/**\n * @module core/editor/editor\n */\n\n\n\n\n\n\n/**\n * The class representing a basic, generic editor.\n *\n * Check out the list of its subclasses to learn about specific editor implementations.\n *\n * All editor implementations (like {@link module:editor-classic/classiceditor~ClassicEditor} or\n * {@link module:editor-inline/inlineeditor~InlineEditor}) should extend this class. They can add their\n * own methods and properties.\n *\n * When you are implementing a plugin, this editor represents the API\n * which your plugin can expect to get when using its {@link module:core/plugin~Plugin#editor} property.\n *\n * This API should be sufficient in order to implement the \"editing\" part of your feature\n * (schema definition, conversion, commands, keystrokes, etc.).\n * It does not define the editor UI, which is available only if\n * the specific editor implements also the {@link module:core/editor/editorwithui~EditorWithUI} interface\n * (as most editor implementations do).\n *\n * @abstract\n * @mixes module:utils/observablemixin~ObservableMixin\n */\nclass Editor extends (0,_ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__.ObservableMixin)() {\n /**\n * Creates a new instance of the editor class.\n *\n * Usually, not to be used directly. See the static {@link module:core/editor/editor~Editor.create `create()`} method.\n *\n * @param {Object} [config={}] The editor configuration.\n */\n constructor(config = {}) {\n super();\n const constructor = this.constructor;\n // Prefer the language passed as the argument to the constructor instead of the constructor's `defaultConfig`, if both are set.\n const language = config.language || (constructor.defaultConfig && constructor.defaultConfig.language);\n /**\n * The editor context.\n * When it is not provided through the configuration, the editor creates it.\n *\n * @protected\n * @type {module:core/context~Context}\n */\n this._context = config.context || new _context__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({ language });\n this._context._addEditor(this, !config.context);\n // Clone the plugins to make sure that the plugin array will not be shared\n // between editors and make the watchdog feature work correctly.\n const availablePlugins = Array.from(constructor.builtinPlugins || []);\n /**\n * Stores all configurations specific to this editor instance.\n *\n *\t\teditor.config.get( 'image.toolbar' );\n *\t\t// -> [ 'imageStyle:block', 'imageStyle:side', '|', 'toggleImageCaption', 'imageTextAlternative' ]\n *\n * @readonly\n * @member {module:utils/config~Config}\n */\n this.config = new _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__.Config(config, constructor.defaultConfig);\n this.config.define('plugins', availablePlugins);\n this.config.define(this._context._getEditorConfig());\n /**\n * The plugins loaded and in use by this editor instance.\n *\n *\t\teditor.plugins.get( 'ClipboardPipeline' ); // -> An instance of the clipboard pipeline plugin.\n *\n * @readonly\n * @member {module:core/plugincollection~PluginCollection}\n */\n this.plugins = new _plugincollection__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this, availablePlugins, this._context.plugins);\n /**\n * The locale instance.\n *\n * @readonly\n * @type {module:utils/locale~Locale}\n */\n this.locale = this._context.locale;\n /**\n * Shorthand for {@link module:utils/locale~Locale#t}.\n *\n * @see module:utils/locale~Locale#t\n * @method #t\n */\n this.t = this.locale.t;\n /**\n * A set of lock IDs for the {@link #isReadOnly} getter.\n *\n * @private\n * @type {Set.}\n */\n this._readOnlyLocks = new Set();\n /**\n * Commands registered to the editor.\n *\n * Use the shorthand {@link #execute `editor.execute()`} method to execute commands:\n *\n *\t\t// Execute the bold command:\n *\t\teditor.execute( 'bold' );\n *\n *\t\t// Check the state of the bold command:\n *\t\teditor.commands.get( 'bold' ).value;\n *\n * @readonly\n * @member {module:core/commandcollection~CommandCollection}\n */\n this.commands = new _commandcollection__WEBPACK_IMPORTED_MODULE_4__[\"default\"]();\n /**\n * Indicates the editor life-cycle state.\n *\n * The editor is in one of the following states:\n *\n * * `initializing` – During the editor initialization (before\n * {@link module:core/editor/editor~Editor.create `Editor.create()`}) finished its job.\n * * `ready` – After the promise returned by the {@link module:core/editor/editor~Editor.create `Editor.create()`}\n * method is resolved.\n * * `destroyed` – Once the {@link #destroy `editor.destroy()`} method was called.\n *\n * @observable\n * @member {'initializing'|'ready'|'destroyed'} #state\n */\n this.set('state', 'initializing');\n this.once('ready', () => (this.state = 'ready'), { priority: 'high' });\n this.once('destroy', () => (this.state = 'destroyed'), { priority: 'high' });\n /**\n * The editor's model.\n *\n * The central point of the editor's abstract data model.\n *\n * @readonly\n * @member {module:engine/model/model~Model}\n */\n this.model = new _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_1__.Model();\n const stylesProcessor = new _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_1__.StylesProcessor();\n /**\n * The {@link module:engine/controller/datacontroller~DataController data controller}.\n * Used e.g. for setting and retrieving the editor data.\n *\n * @readonly\n * @member {module:engine/controller/datacontroller~DataController}\n */\n this.data = new _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_1__.DataController(this.model, stylesProcessor);\n /**\n * The {@link module:engine/controller/editingcontroller~EditingController editing controller}.\n * Controls user input and rendering the content for editing.\n *\n * @readonly\n * @member {module:engine/controller/editingcontroller~EditingController}\n */\n this.editing = new _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_1__.EditingController(this.model, stylesProcessor);\n this.editing.view.document.bind('isReadOnly').to(this);\n /**\n * Conversion manager through which you can register model-to-view and view-to-model converters.\n *\n * See the {@link module:engine/conversion/conversion~Conversion} documentation to learn how to add converters.\n *\n * @readonly\n * @member {module:engine/conversion/conversion~Conversion}\n */\n this.conversion = new _ckeditor_ckeditor5_engine__WEBPACK_IMPORTED_MODULE_1__.Conversion([this.editing.downcastDispatcher, this.data.downcastDispatcher], this.data.upcastDispatcher);\n this.conversion.addAlias('dataDowncast', this.data.downcastDispatcher);\n this.conversion.addAlias('editingDowncast', this.editing.downcastDispatcher);\n /**\n * An instance of the {@link module:core/editingkeystrokehandler~EditingKeystrokeHandler}.\n *\n * It allows setting simple keystrokes:\n *\n *\t\t// Execute the bold command on Ctrl+E:\n *\t\teditor.keystrokes.set( 'Ctrl+E', 'bold' );\n *\n *\t\t// Execute your own callback:\n *\t\teditor.keystrokes.set( 'Ctrl+E', ( data, cancel ) => {\n *\t\t\tconsole.log( data.keyCode );\n *\n *\t\t\t// Prevent the default (native) action and stop the underlying keydown event\n *\t\t\t// so no other editor feature will interfere.\n *\t\t\tcancel();\n *\t\t} );\n *\n * Note: Certain typing-oriented keystrokes (like Backspace or Enter) are handled\n * by a low-level mechanism and trying to listen to them via the keystroke handler will not work reliably.\n * To handle these specific keystrokes, see the events fired by the\n * {@link module:engine/view/document~Document editing view document} (`editor.editing.view.document`).\n *\n * @readonly\n * @member {module:core/editingkeystrokehandler~EditingKeystrokeHandler}\n */\n this.keystrokes = new _editingkeystrokehandler__WEBPACK_IMPORTED_MODULE_5__[\"default\"](this);\n this.keystrokes.listenTo(this.editing.view.document);\n }\n /**\n * Defines whether the editor is in the read-only mode.\n *\n * In read-only mode the editor {@link #commands commands} are disabled so it is not possible\n * to modify the document by using them. Also, the editable element(s) become non-editable.\n *\n * In order to make the editor read-only, you need to call the {@link #enableReadOnlyMode} method:\n *\n *\t\teditor.enableReadOnlyMode( 'feature-id' );\n *\n * Later, to turn off the read-only mode, call {@link #disableReadOnlyMode}:\n *\n * \t\teditor.disableReadOnlyMode( 'feature-id' );\n *\n * @readonly\n * @observable\n * @member {Boolean} #isReadOnly\n */\n get isReadOnly() {\n return this._readOnlyLocks.size > 0;\n }\n set isReadOnly(value) {\n /**\n * The {@link #isReadOnly Editor#isReadOnly} property is read-only since version `34.0.0` and can be set only using\n * {@link #enableReadOnlyMode `Editor#enableReadOnlyMode( lockId )`} and\n * {@link #disableReadOnlyMode `Editor#disableReadOnlyMode( lockId )`}.\n *\n * Usage before version `34.0.0`:\n *\n *\t\teditor.isReadOnly = true;\n * \t\teditor.isReadOnly = false;\n *\n * Usage since version `34.0.0`:\n *\n *\t\teditor.enableReadOnlyMode( 'my-feature-id' );\n * \t\teditor.disableReadOnlyMode( 'my-feature-id' );\n *\n * @error editor-isreadonly-has-no-setter\n */\n throw new _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__.CKEditorError('editor-isreadonly-has-no-setter');\n }\n /**\n * Turns on the read-only mode in the editor.\n *\n * Editor can be switched to or out of the read-only mode by many features, under various circumstances. The editor supports locking\n * mechanism for the read-only mode. It enables easy control over the read-only mode when many features wants to turn it on or off at\n * the same time, without conflicting with each other. It guarantees that you will not make the editor editable accidentally (which\n * could lead to errors).\n *\n * Each read-only mode request is identified by a unique id (also called \"lock\"). If multiple plugins requested to turn on the\n * read-only mode, then, the editor will become editable only after all these plugins turn the read-only mode off (using the same ids).\n *\n * Note, that you cannot force the editor to disable the read-only mode if other plugins set it.\n *\n * After the first `enableReadOnlyMode()` call, the {@link #isReadOnly `isReadOnly` property} will be set to `true`:\n *\n *\t\teditor.isReadOnly; // `false`.\n * \t\teditor.enableReadOnlyMode( 'my-feature-id' );\n * \t\teditor.isReadOnly; // `true`.\n *\n * You can turn off the read-only mode (\"clear the lock\") using the {@link #disableReadOnlyMode `disableReadOnlyMode()`} method:\n *\n * \t\teditor.enableReadOnlyMode( 'my-feature-id' );\n * \t\t// ...\n * \t\teditor.disableReadOnlyMode( 'my-feature-id' );\n * \t\teditor.isReadOnly; // `false`.\n *\n * All \"locks\" need to be removed to enable editing:\n *\n * \t\teditor.enableReadOnlyMode( 'my-feature-id' );\n * \t\teditor.enableReadOnlyMode( 'my-other-feature-id' );\n * \t\t// ...\n * \t\teditor.disableReadOnlyMode( 'my-feature-id' );\n * \t\teditor.isReadOnly; // `true`.\n * \t\teditor.disableReadOnlyMode( 'my-other-feature-id' );\n * \t\teditor.isReadOnly; // `false`.\n *\n * @param {String|Symbol} lockId A unique ID for setting the editor to the read-only state.\n */\n enableReadOnlyMode(lockId) {\n if (typeof lockId !== 'string' && typeof lockId !== 'symbol') {\n /**\n * The lock ID is missing or it is not a string or symbol.\n *\n * @error editor-read-only-lock-id-invalid\n */\n throw new _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__.CKEditorError('editor-read-only-lock-id-invalid', null, { lockId });\n }\n if (this._readOnlyLocks.has(lockId)) {\n return;\n }\n this._readOnlyLocks.add(lockId);\n if (this._readOnlyLocks.size === 1) {\n // Manually fire the `change:isReadOnly` event as only getter is provided.\n this.fire('change:isReadOnly', 'isReadOnly', true, false);\n }\n }\n /**\n * Removes the read-only lock from the editor with given lock ID.\n *\n * When no lock is present on the editor anymore, then the {@link #isReadOnly `isReadOnly` property} will be set to `false`.\n *\n * @param {String|Symbol} lockId The lock ID for setting the editor to the read-only state.\n */\n disableReadOnlyMode(lockId) {\n if (typeof lockId !== 'string' && typeof lockId !== 'symbol') {\n throw new _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__.CKEditorError('editor-read-only-lock-id-invalid', null, { lockId });\n }\n if (!this._readOnlyLocks.has(lockId)) {\n return;\n }\n this._readOnlyLocks.delete(lockId);\n if (this._readOnlyLocks.size === 0) {\n // Manually fire the `change:isReadOnly` event as only getter is provided.\n this.fire('change:isReadOnly', 'isReadOnly', false, true);\n }\n }\n /**\n * Loads and initializes plugins specified in the configuration.\n *\n * @returns {Promise.} A promise which resolves\n * once the initialization is completed, providing an array of loaded plugins.\n */\n initPlugins() {\n const config = this.config;\n const plugins = config.get('plugins');\n const removePlugins = config.get('removePlugins') || [];\n const extraPlugins = config.get('extraPlugins') || [];\n const substitutePlugins = config.get('substitutePlugins') || [];\n return this.plugins.init(plugins.concat(extraPlugins), removePlugins, substitutePlugins);\n }\n /**\n * Destroys the editor instance, releasing all resources used by it.\n *\n * **Note** The editor cannot be destroyed during the initialization phase so if it is called\n * while the editor {@link #state is being initialized}, it will wait for the editor initialization before destroying it.\n *\n * @fires destroy\n * @returns {Promise} A promise that resolves once the editor instance is fully destroyed.\n */\n destroy() {\n let readyPromise = Promise.resolve();\n if (this.state == 'initializing') {\n readyPromise = new Promise(resolve => this.once('ready', resolve));\n }\n return readyPromise\n .then(() => {\n this.fire('destroy');\n this.stopListening();\n this.commands.destroy();\n })\n .then(() => this.plugins.destroy())\n .then(() => {\n this.model.destroy();\n this.data.destroy();\n this.editing.destroy();\n this.keystrokes.destroy();\n })\n // Remove the editor from the context.\n // When the context was created by this editor, the context will be destroyed.\n .then(() => this._context._removeEditor(this));\n }\n /**\n * Executes the specified command with given parameters.\n *\n * Shorthand for:\n *\n *\t\teditor.commands.get( commandName ).execute( ... );\n *\n * @param {String} commandName The name of the command to execute.\n * @param {*} [...commandParams] Command parameters.\n * @returns {*} The value returned by the {@link module:core/commandcollection~CommandCollection#execute `commands.execute()`}.\n */\n execute(commandName, ...args) {\n try {\n return this.commands.execute(commandName, ...args);\n }\n catch (err) {\n // @if CK_DEBUG // throw err;\n /* istanbul ignore next */\n _ckeditor_ckeditor5_utils__WEBPACK_IMPORTED_MODULE_0__.CKEditorError.rethrowUnexpectedError(err, this);\n }\n }\n /**\n * Focuses the editor.\n *\n * **Note** To explicitly focus the editing area of the editor, use the\n * {@link module:engine/view/view~View#focus `editor.editing.view.focus()`} method of the editing view.\n *\n * Check out the {@glink framework/guides/deep-dive/ui/focus-tracking#focus-in-the-editor-ui Focus in the editor UI} section\n * of the {@glink framework/guides/deep-dive/ui/focus-tracking Deep dive into focus tracking} guide to learn more.\n */\n focus() {\n this.editing.view.focus();\n }\n}\n/**\n * This error is thrown when trying to pass a `