diff --git a/app/components/admin/text_transform_actions/sandbox_component.html.erb b/app/components/admin/text_transform_actions/sandbox_component.html.erb new file mode 100644 index 000000000000..5c4c7423f18d --- /dev/null +++ b/app/components/admin/text_transform_actions/sandbox_component.html.erb @@ -0,0 +1,138 @@ +<%#-- copyright +OpenProject is an open source project management software. +Copyright (C) the OpenProject GmbH + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License version 3. + +OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +Copyright (C) 2006-2013 Jean-Philippe Lang +Copyright (C) 2010-2013 the ChiliProject Team + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +See COPYRIGHT and LICENSE files for more details. + +++#%> + +<%= + render(Primer::Beta::BorderBox.new(mt: 5, data: controller_data, test_selector: "ai-text-transform-sandbox")) do |box| + box.with_header do |header| + header.with_title(tag: :h2) { label(:title) } + end + + box.with_body do + flex_layout(direction: :column) do |layout| + layout.with_row(mb: 3) do + render(Primer::Beta::Text.new(tag: :p, color: :muted)) { label(:description) } + end + + layout.with_row(mb: 3) do + helpers.primer_form_with(url: "#", method: :post, data: form_data) do |f| + render(Admin::TextTransformActions::SandboxForm.new(f, types:)) + end + end + + layout.with_row(mb: 3) do + flex_layout(align_items: :center) do |controls| + controls.with_column(mr: 2) do + render( + Primer::Beta::Button.new( + scheme: :primary, + type: :button, + data: target(:execute).merge(action: "ai-text-transform-sandbox#execute") + ) + ) { label(:execute) } + end + controls.with_column(mr: 3) do + render( + Primer::Beta::Button.new( + scheme: :danger, + type: :button, + disabled: true, + data: target(:cancel).merge(action: "ai-text-transform-sandbox#cancel") + ) + ) { label(:cancel) } + end + controls.with_column(mr: 2, hidden: true, data: target(:spinner)) do + render(Primer::Beta::Spinner.new(size: :small)) + end + controls.with_column(mr: 2) do + render(Primer::Beta::Label.new(scheme: :secondary, data: target(:status))) { label(:status_idle) } + end + controls.with_column do + render(Primer::Beta::Text.new(tag: :span, font_family: :mono, color: :muted, data: target(:timer))) { "" } + end + end + end + + layout.with_row(mb: 3) do + render(Primer::Box.new(border: true, border_radius: 2, p: 3, bg: :subtle)) do + content_tag( + :pre, + "", + class: "text-mono f5", + style: "white-space: pre-wrap; margin: 0; min-height: 6rem;", + data: target(:output) + ) + end + end + + layout.with_row do + render(Primer::Alpha::Dialog.new(id: DIALOG_ID, title: label(:details_title), size: :xlarge)) do |dialog| + dialog.with_show_button(scheme: :default) { label(:details) } + dialog.with_header(variant: :large) + dialog.with_body do + flex_layout(direction: :column) do |details| + details.with_row(mb: 3) do + render(Primer::Beta::Heading.new(tag: :h3, font_size: 5, mb: 2)) { label(:run_section) } + end + details.with_row(mb: 4) do + content_tag(:dl, "", class: "text-mono f6", data: target(:runMeta)) + end + details.with_row(mb: 3) do + render(Primer::Beta::Heading.new(tag: :h3, font_size: 5, mb: 2)) { label(:system_prompt_section) } + end + details.with_row(mb: 4) do + render(Primer::Box.new(border: true, border_radius: 2, p: 3, bg: :subtle)) do + content_tag(:pre, "", class: "text-mono f6", style: "white-space: pre-wrap; margin: 0;", data: target(:systemPrompt)) + end + end + details.with_row(mb: 3) do + render(Primer::Beta::Heading.new(tag: :h3, font_size: 5, mb: 2)) { label(:events_section) } + end + details.with_row do + content_tag(:table, class: "text-mono f6 width-full") do + concat( + content_tag(:thead) do + content_tag(:tr) do + safe_join(%i[event_seq event_kind event_payload event_time].map { |key| content_tag(:th, label(key), class: "text-left p-2 border-bottom") }) + end + end + ) + concat(content_tag(:tbody, "", data: target(:eventsBody))) + end + end + end + end + dialog.with_footer(show_divider: true) do + render(Primer::Beta::Button.new(data: { close_dialog_id: DIALOG_ID })) { I18n.t(:button_close) } + end + end + end + end + end + end +%> diff --git a/app/components/admin/text_transform_actions/sandbox_component.rb b/app/components/admin/text_transform_actions/sandbox_component.rb new file mode 100644 index 000000000000..e427870dde3b --- /dev/null +++ b/app/components/admin/text_transform_actions/sandbox_component.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Admin + module TextTransformActions + # Prototype only: lets an administrator run the action against arbitrary text + # through the execute API and watch the run being polled. + class SandboxComponent < ApplicationComponent + include OpPrimer::ComponentHelpers + include API::V3::Utilities::PathHelper + + DIALOG_ID = "ai-text-transform-sandbox-details" + + alias action model + + private + + def controller_data + { + controller: "ai-text-transform-sandbox", + ai_text_transform_sandbox_url_value: api_v3_paths.ai_text_transform_runs, + ai_text_transform_sandbox_action_id_value: action.id + } + end + + def form_data + { + controller: "show-when-value-selected", + action: "submit->ai-text-transform-sandbox#submit" + } + end + + def target(name) + { ai_text_transform_sandbox_target: name } + end + + def label(key) + I18n.t("admin.text_transform_actions.sandbox.#{key}") + end + + def types + Type.order(:position) + end + end + end +end diff --git a/app/components/ai/text_transforms/result_pane_component.html.erb b/app/components/ai/text_transforms/result_pane_component.html.erb index 605cbd03731f..e31cef43856a 100644 --- a/app/components/ai/text_transforms/result_pane_component.html.erb +++ b/app/components/ai/text_transforms/result_pane_component.html.erb @@ -26,13 +26,15 @@ See COPYRIGHT and LICENSE files for more details. ++#%> -<%= component_wrapper(data: { test_selector: "ai-text-transform-result" }) do %> +<%= component_wrapper(data: wrapper_data) do %> <%= render( Primer::BaseComponent.new( tag: :div, role: :dialog, aria: { label: label(:title) }, + tabindex: -1, + data: target(:pane), position: :fixed, display: :flex, direction: :column, @@ -42,11 +44,11 @@ See COPYRIGHT and LICENSE files for more details. safe_join( [ render(Primer::Beta::BorderBox.new(flex: 1, overflow: :hidden, display: :flex, direction: :column, box_shadow: :extra_large)) do |box| - box.with_header(classes: "op-ai-result-pane--handle") do + box.with_header(classes: "op-ai-result-pane--handle", data: action(beginDrag: :pointerdown)) do flex_layout(align_items: :center, justify_content: :space_between) do |header| header.with_column { render(Title.new(pane:)) } header.with_column do - render(Primer::Beta::CloseButton.new("aria-label": label(:close))) + render(Primer::Beta::CloseButton.new("aria-label": label(:close), data: action(close: :click))) end end end @@ -58,7 +60,7 @@ See COPYRIGHT and LICENSE files for more details. Primer::BaseComponent.new( tag: :span, classes: "op-ai-result-pane--resize op-ai-result-pane--resize_#{edge}", - data: { edge: }, + data: { edge:, **action(beginResize: :pointerdown) }, "aria-hidden": true ) ) do diff --git a/app/components/ai/text_transforms/result_pane_component.rb b/app/components/ai/text_transforms/result_pane_component.rb index ffc6b9003448..3e1d0e0bf2ff 100644 --- a/app/components/ai/text_transforms/result_pane_component.rb +++ b/app/components/ai/text_transforms/result_pane_component.rb @@ -49,6 +49,15 @@ def initialize(pane:) private attr_reader :pane + + def wrapper_data + { + test_selector: "ai-text-transform-result", + controller: "ai-text-transform-pane", + ai_text_transform_pane_close_form_value: CLOSE_FORM_ID, + **action(close: "keydown.esc", keepInViewport: "resize@window") + } + end end end end diff --git a/app/components/ai/text_transforms/result_pane_component.sass b/app/components/ai/text_transforms/result_pane_component.sass index 204ed7cd2a1a..0fa138a86c9d 100644 --- a/app/components/ai/text_transforms/result_pane_component.sass +++ b/app/components/ai/text_transforms/result_pane_component.sass @@ -11,6 +11,7 @@ &--grip cursor: grab user-select: none + touch-action: none &--grip display: inline-flex @@ -23,6 +24,7 @@ position: absolute display: flex line-height: 0 + touch-action: none &_left, &_right diff --git a/app/components/ai/text_transforms/result_pane_component/body.html.erb b/app/components/ai/text_transforms/result_pane_component/body.html.erb index 4f2f850f7e69..71a651ca1332 100644 --- a/app/components/ai/text_transforms/result_pane_component/body.html.erb +++ b/app/components/ai/text_transforms/result_pane_component/body.html.erb @@ -35,9 +35,9 @@ See COPYRIGHT and LICENSE files for more details. end end if done? - body.with_row(mb: 3, hidden: true, test_selector: "ai-text-transform-pane-apply-failed") do + body.with_row(mb: 3, hidden: true, test_selector: "ai-text-transform-pane-apply-failed", data: target(:applyFailed)) do render(Primer::Alpha::Banner.new(scheme: :danger)) do - render(Primer::Beta::Text.new(tag: :span)) { "" } + render(Primer::Beta::Text.new(tag: :span, data: target(:applyFailedMessage))) { "" } end end end @@ -47,7 +47,7 @@ See COPYRIGHT and LICENSE files for more details. end end if done? - body.with_row { content_tag(:template, pane.text) } + body.with_row { content_tag(:template, pane.text, data: target(:raw)) } end end %> diff --git a/app/components/ai/text_transforms/result_pane_component/body.rb b/app/components/ai/text_transforms/result_pane_component/body.rb index 4d4ba833352f..2304b3758ca1 100644 --- a/app/components/ai/text_transforms/result_pane_component/body.rb +++ b/app/components/ai/text_transforms/result_pane_component/body.rb @@ -56,7 +56,7 @@ def done? end def output - helpers.format_text(pane.text, object: pane.work_package) + helpers.format_text(pane.text, object: pane.work_package, project: pane.project) end end end diff --git a/app/components/ai/text_transforms/result_pane_component/footer.html.erb b/app/components/ai/text_transforms/result_pane_component/footer.html.erb index 9b81049170f5..ded026c2c1cf 100644 --- a/app/components/ai/text_transforms/result_pane_component/footer.html.erb +++ b/app/components/ai/text_transforms/result_pane_component/footer.html.erb @@ -27,9 +27,13 @@ See COPYRIGHT and LICENSE files for more details. ++#%> <%= component_wrapper do %> + <%= content_tag(:span, nil, hidden: true, data: state_data) %> + <%= form(id: CLOSE_FORM_ID, url: helpers.ai_text_transform_pane_path(pane.uuid), method: :delete) %> + <%= form(id: APPLY_FORM_ID, url: helpers.apply_ai_text_transform_pane_path(pane.uuid), method: :post) if state == "done" %> + <%= form(id: RETRY_FORM_ID, url: helpers.ai_text_transform_panes_path, method: :post, fields: form_params.merge(retry_of: pane.uuid)) if retryable? %> <%= flex_layout(align_items: :center, classes: "op-ai-result-pane--footer") do |bar| - bar.with_column(mr: 2, classes: "op-ai-result-pane--grip") do + bar.with_column(mr: 2, classes: "op-ai-result-pane--grip", data: action(beginDrag: :pointerdown)) do render(Primer::Beta::Octicon.new(icon: :grabber, color: :muted)) end bar.with_column(flex: 1) do @@ -40,30 +44,30 @@ See COPYRIGHT and LICENSE files for more details. render(Primer::Beta::Text.new(color: :muted)) { label(:generating) } end footer.with_column do - render(Primer::Beta::Button.new) { label(:cancel) } + render(Primer::Beta::Button.new(data: action(close: :click))) { label(:cancel) } end end when "done" flex_layout(align_items: :center) do |footer| footer.with_column(flex: 1) do - render(Primer::Beta::Button.new(scheme: :invisible)) { label(:copy) } + render(Primer::Beta::ClipboardCopyButton.new(scheme: :invisible, value: pane.text, "aria-label": label(:copy))) end footer.with_column(mr: 2) do - render(Primer::Beta::Button.new) { label(:discard) } + render(Primer::Beta::Button.new(data: action(close: :click))) { label(:discard) } end footer.with_column do - render(Primer::Beta::Button.new(scheme: :primary)) { label(:replace) } + render(Primer::Beta::Button.new(scheme: :primary, type: :submit, form: APPLY_FORM_ID)) { label(:replace) } end end else flex_layout(align_items: :center, justify_content: :flex_end) do |footer| if pane.run footer.with_column(mr: 2) do - render(Primer::Beta::Button.new) { label(:try_again) } + render(Primer::Beta::Button.new(type: :submit, form: RETRY_FORM_ID)) { label(:try_again) } end end footer.with_column do - render(Primer::Beta::Button.new) { label(:close) } + render(Primer::Beta::Button.new(data: action(close: :click))) { label(:close) } end end end diff --git a/app/components/ai/text_transforms/result_pane_component/footer.rb b/app/components/ai/text_transforms/result_pane_component/footer.rb index 1234588044f9..9911768bac3c 100644 --- a/app/components/ai/text_transforms/result_pane_component/footer.rb +++ b/app/components/ai/text_transforms/result_pane_component/footer.rb @@ -30,7 +30,37 @@ module AI module TextTransforms class ResultPaneComponent + # Demo glue (AI-126 demo branch, until AI-175 adds its component part): the forms the + # footer buttons submit and the state element the pane controller polls with. class Footer < Section + private + + def state_data + { + controller: "ai-text-transform-pane-run", + ai_text_transform_pane_run_state_value: state, + ai_text_transform_pane_run_run_value: pane.uuid, + ai_text_transform_pane_run_seq_value: pane.last_seq, + ai_text_transform_pane_run_request_id_value: pane.request_id, + ai_text_transform_pane_run_poll_url_value: helpers.ai_text_transform_pane_path(pane.uuid, form_params), + ai_text_transform_pane_run_editor_gone_value: label(:editor_gone), + ai_text_transform_pane_run_selection_gone_value: label(:selection_gone) + } + end + + def form_params + { request_id: pane.request_id, scope: pane.scope }.merge(pane.context_ids).compact + end + + def retryable? + pane.run && %w[failed stopped].include?(state) + end + + def form(id:, url:, method:, fields: form_params) + helpers.form_with(url:, method:, id:, data: { turbo_stream: true }) do + safe_join(fields.map { |name, value| helpers.hidden_field_tag(name, value, id: nil) }) + end + end end end end diff --git a/app/components/ai/text_transforms/result_pane_helpers.rb b/app/components/ai/text_transforms/result_pane_helpers.rb index 2fe14ff6770c..c8c150ae02f2 100644 --- a/app/components/ai/text_transforms/result_pane_helpers.rb +++ b/app/components/ai/text_transforms/result_pane_helpers.rb @@ -39,6 +39,14 @@ module ResultPaneHelpers def label(key) I18n.t("ai.text_transform.pane.#{key}") end + + def target(name) + { ai_text_transform_pane_target: name } + end + + def action(**events_by_name) + { action: events_by_name.map { |name, event| "#{event}->ai-text-transform-pane##{name}" }.join(" ") } + end end end end diff --git a/app/components/ai/text_transforms/result_pane_state.rb b/app/components/ai/text_transforms/result_pane_state.rb index 7706018c5314..86fff337a932 100644 --- a/app/components/ai/text_transforms/result_pane_state.rb +++ b/app/components/ai/text_transforms/result_pane_state.rb @@ -30,17 +30,18 @@ module AI module TextTransforms class ResultPaneState - attr_reader :run, :scope, :request_id, :work_package, :context_ids, :rejection + attr_reader :run, :scope, :request_id, :work_package, :project, :context_ids, :rejection def self.rejected(message:, label:, scope:, request_id:, context_ids: {}) new(run: nil, scope:, request_id:, label:, context_ids:, rejection: message) end - def initialize(run:, scope:, request_id:, work_package: nil, context_ids: {}, label: nil, rejection: nil) + def initialize(run:, scope:, request_id:, work_package: nil, project: nil, context_ids: {}, label: nil, rejection: nil) @run = run @scope = scope @request_id = request_id @work_package = work_package + @project = project @context_ids = context_ids @label = label @rejection = rejection diff --git a/app/contracts/ai/text_transforms/pane_params_contract.rb b/app/contracts/ai/text_transforms/pane_params_contract.rb new file mode 100644 index 000000000000..b037a828a4ad --- /dev/null +++ b/app/contracts/ai/text_transforms/pane_params_contract.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module AI + module TextTransforms + class PaneParamsContract < DryApplicationContract + SCOPES = %w[document selection].freeze + CONTEXT_KEYS = %i[work_package_id project_id type_id].freeze + + params do + required(:request_id).filled(:string, :uuid_v4?) + required(:scope).filled(:string, included_in?: SCOPES) + optional(:work_package_id).maybe(:integer, gt?: 0) + optional(:project_id).maybe(:integer, gt?: 0) + optional(:type_id).maybe(:integer, gt?: 0) + optional(:after).maybe(:integer, gteq?: 0) + optional(:action_id).maybe(:integer, gt?: 0) + optional(:input).maybe(:string) + optional(:retry_of).maybe(:string, :uuid_v4?) + end + + rule(:project_id) do + key.failure(:with_work_package) if value && values[:work_package_id] + end + + rule(:type_id) do + key.failure(:without_project) if value.nil? != values[:project_id].nil? + end + + def self.keys + schema.key_map.map { |key| key.name.to_sym } + end + end + end +end diff --git a/app/controllers/admin/text_transform_actions/sandbox_controller.rb b/app/controllers/admin/text_transform_actions/sandbox_controller.rb new file mode 100644 index 000000000000..2ef6cfb547ff --- /dev/null +++ b/app/controllers/admin/text_transform_actions/sandbox_controller.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Admin + module TextTransformActions + # Prototype only: serves the searchable item lists for the sandbox's + # work package and project pickers. + class SandboxController < ::ApplicationController + include AI::TextTransformActionsFeature + + LIMIT = 20 + + before_action :require_admin + before_action :require_ai_text_transform_actions_feature + + def work_packages + items = work_package_scope.order(updated_at: :desc).limit(LIMIT).map do |work_package| + [work_package.id, work_package_label(work_package)] + end + render_items(items) + end + + def projects + scope = Project.visible(current_user).active + scope = scope.where("projects.name ILIKE ?", "%#{sanitize_sql_like(query)}%") if query.present? + items = scope.order(:name).limit(LIMIT).map { |project| [project.id, project.name] } + render_items(items) + end + + private + + def work_package_scope + scope = WorkPackage.visible(current_user).includes(:project, :type) + return scope if query.blank? + + matching = scope.where("work_packages.subject ILIKE ?", "%#{sanitize_sql_like(query)}%") + query.match?(/\A\d+\z/) ? matching.or(scope.where(id: query.to_i)) : matching + end + + def work_package_label(work_package) + "##{work_package.id} #{work_package.subject} (#{work_package.project.name}, #{work_package.type.name})" + end + + def query + @query ||= params[:q].to_s.strip + end + + def sanitize_sql_like(value) + ActiveRecord::Base.sanitize_sql_like(value) + end + + def render_items(items) + list = Primer::Alpha::SelectPanel::ItemList.new + items.each do |value, label| + list.with_item(label:, content_arguments: { data: { value: } }) + end + render html: list.render_in(view_context), layout: false + end + end + end +end diff --git a/app/controllers/admin/text_transform_actions_controller.rb b/app/controllers/admin/text_transform_actions_controller.rb index c73de25367e4..57199362517b 100644 --- a/app/controllers/admin/text_transform_actions_controller.rb +++ b/app/controllers/admin/text_transform_actions_controller.rb @@ -82,10 +82,7 @@ def update end end - result.on_success do - flash[:notice] = t(:notice_successful_update) - redirect_to action: :index - end + result.on_success { respond_to_successful_update } end def deletion_dialog @@ -147,6 +144,18 @@ def toggle_setting private + def respond_to_successful_update + if params.key?(:save_and_stay) + render_success_flash_message_via_turbo_stream(message: t(:notice_successful_update)) + stream_form_component do |format| + format.html { redirect_to action: :edit } + end + else + flash[:notice] = t(:notice_successful_update) + redirect_to action: :index + end + end + def find_text_transform_action @text_transform_action = AI::TextTransformAction.find(params.expect(:id)) end diff --git a/app/controllers/ai/text_transform_panes_controller.rb b/app/controllers/ai/text_transform_panes_controller.rb new file mode 100644 index 000000000000..93524ab8b119 --- /dev/null +++ b/app/controllers/ai/text_transform_panes_controller.rb @@ -0,0 +1,171 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module AI + class TextTransformPanesController < ApplicationController + include OpTurbo::ComponentStream + include AI::TextTransformActionsFeature + + APPLY_EVENT = "op-dispatched:ai-text-transform:apply" + CLOSED_EVENT = "op-dispatched:ai-text-transform:closed" + + before_action :require_login + before_action :require_ai_text_transform_actions_feature + authorization_checked! :create, :show, :destroy, :apply, :cancel + before_action :validate_pane_params, except: :cancel + before_action :find_run, only: %i[show apply cancel] + before_action :resolve_context, only: :create + + def show + return head(:no_content) unless run.terminal? || new_events? + + run.cancelled? ? close_pane : update_sections + respond_with_turbo_streams unless performed? + end + + def create + append_pane(start_run) + + respond_with_turbo_streams + end + + def destroy + open_run = own_runs.find_by(uuid: params[:uuid]) + request_cancel(open_run) if open_run + close_pane + + respond_with_turbo_streams + end + + def apply + return head(:unprocessable_entity) unless run.succeeded? + + dispatch_event_via_turbo_stream(APPLY_EVENT, detail: { requestId: pane_params[:request_id], + scope: pane_params[:scope], + text: pane_for(run).text }) + + respond_with_turbo_streams + end + + def cancel + request_cancel(run) + + head :no_content + end + + private + + attr_reader :pane_params, :context, :run + + def own_runs + AI::TextTransformRun.where(user: current_user) + end + + def find_run + @run = own_runs.find_by!(uuid: params.expect(:uuid)) + end + + def new_events? + run.events_after(pane_params[:after]).exists? + end + + def request_cancel(cancellable) + cancellable.update!(cancel_requested: true) unless cancellable.terminal? + end + + def validate_pane_params + @pane_params = AI::TextTransforms::PaneParamsContract.new.call(params.permit(*AI::TextTransforms::PaneParamsContract.keys).to_h) + head :bad_request if pane_params.failure? + end + + def context_ids + pane_params.to_h.slice(*AI::TextTransforms::PaneParamsContract::CONTEXT_KEYS).compact + end + + def resolve_context + call = AI::TextTransforms::ResolveContext.new(user: current_user).call(**context_ids) + return @context = call.result if call.success? + + call.errors.any? { |error| error.type == :error_not_found } ? render_404 : render_403 + end + + def start_run + action, content = run_source + # Demo only (AI-100 demo branch): ?ai_demo_fault= makes the run end blocked or failed. + demo_fault = params.fetch(:demo_fault, nil).presence_in(AI::TextTransforms::DemoFaultGateway::FAULTS) + call = AI::TextTransforms::CreateRun.new(user: current_user, action:, context:, content:, demo_fault:).call + call.success? ? pane_for(call.result) : rejected_pane(call.errors, action) + end + + def run_source + retry_of = pane_params[:retry_of] + return [AI::TextTransformAction.find_by(id: pane_params[:action_id]), pane_params[:input].to_s] unless retry_of + + retried = own_runs.failed.find_by!(uuid: retry_of) + [retried.action, retried.input] + end + + def pane_for(pane_run) + AI::TextTransforms::ResultPaneState.new(run: pane_run, scope: pane_params[:scope], request_id: pane_params[:request_id], + work_package: context&.work_package, project: context&.project, context_ids:) + end + + def rejected_pane(errors, action) + AI::TextTransforms::ResultPaneState.rejected(message: errors.full_messages.first, + label: action&.label.to_s, + scope: pane_params[:scope], + request_id: pane_params[:request_id], + context_ids:) + end + + def append_pane(pane) + turbo_streams << lambda { + OpTurbo::StreamComponent + .new(action: :append, target: nil, targets: "body", + template: AI::TextTransforms::ResultPaneComponent.new(pane:).render_in(view_context)) + .render_in(view_context) + } + end + + def update_sections + resolve_context + return if performed? + + pane = pane_for(run) + [AI::TextTransforms::ResultPaneComponent::Body, AI::TextTransforms::ResultPaneComponent::Footer].each do |section| + update_via_turbo_stream(component: section.new(pane:)) + end + end + + def close_pane + remove_via_turbo_stream(component: AI::TextTransforms::ResultPaneComponent.new(pane: nil)) + dispatch_event_via_turbo_stream(CLOSED_EVENT, detail: { requestId: pane_params[:request_id] }) + end + end +end diff --git a/app/forms/admin/text_transform_actions/sandbox_form.rb b/app/forms/admin/text_transform_actions/sandbox_form.rb new file mode 100644 index 000000000000..c2f077bb6fbf --- /dev/null +++ b/app/forms/admin/text_transform_actions/sandbox_form.rb @@ -0,0 +1,151 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module Admin + module TextTransformActions + class SandboxForm < ApplicationForm + MODE_TARGET_NAME = "sandbox_context_mode" + MODES = %w[none work_package new_work_package].freeze + WORK_PACKAGE_PANEL_ID = "ai-text-transform-sandbox-work-package" + PROJECT_PANEL_ID = "ai-text-transform-sandbox-project" + + form do |f| + f.text_area( + name: :content, + label: label(:content_label), + caption: label(:content_caption), + rows: 10, + full_width: true, + data: target(:content) + ) + + f.select_list( + name: :context_mode, + label: label(:context_label), + caption: label(:context_caption), + include_blank: false, + data: target(:contextMode).merge(show_when_value_selected_target: "cause", target_name: MODE_TARGET_NAME) + ) do |select| + MODES.each { |mode| select.option(value: mode, label: label(:"context_#{mode}")) } + end + + f.group(hidden: true, data: effect_for("work_package")) do |group| + group.html_content { work_package_control } + end + + f.group(hidden: true, data: effect_for("new_work_package")) do |group| + group.html_content { project_control } + + group.select_list( + name: :type_id, + label: label(:type_label), + caption: label(:type_caption), + include_blank: true, + data: target(:typeId) + ) do |select| + @types.each { |type| select.option(value: type.id, label: type.name) } + end + end + end + + def initialize(types:) + super() + @types = types + end + + private + + def work_package_control + form_control(label(:work_package_label), label(:work_package_caption)) do |input_arguments| + work_package_panel(input_arguments) + end + end + + def project_control + form_control(label(:project_label), label(:new_work_package_caption)) do |input_arguments| + project_panel(input_arguments) + end + end + + def form_control(label, caption, &) + render(Primer::Alpha::FormControl.new(label:, caption:)) do |control| + control.with_input(&) + end + end + + def work_package_panel(input_arguments) + remote_panel(input_arguments, + id: WORK_PACKAGE_PANEL_ID, + name: :work_package_id, + src: url_helpers.sandbox_work_packages_admin_text_transform_actions_path, + title: label(:select_work_package)) + end + + def project_panel(input_arguments) + remote_panel(input_arguments, + id: PROJECT_PANEL_ID, + name: :project_id, + src: url_helpers.sandbox_projects_admin_text_transform_actions_path, + title: label(:select_project)) + end + + def remote_panel(input_arguments, id:, name:, src:, title:) + render( + Primer::Alpha::SelectPanel.new( + id:, + select_variant: :single, + fetch_strategy: :remote, + src:, + title:, + dynamic_label: true, + form_arguments: { builder: @builder, name: } + ) + ) do |panel| + panel.with_show_button(scheme: :secondary, aria: { describedby: input_arguments.dig(:aria, :describedby) }) do |button| + button.with_trailing_action_icon(icon: :"triangle-down") + title + end + end + end + + def label(key) + I18n.t("admin.text_transform_actions.sandbox.#{key}") + end + + def target(name) + { ai_text_transform_sandbox_target: name } + end + + def effect_for(mode) + { show_when_value_selected_target: "effect", target_name: MODE_TARGET_NAME, value: mode } + end + end + end +end diff --git a/app/forms/ai/text_transform_actions/form.rb b/app/forms/ai/text_transform_actions/form.rb index 7d7e7fe7f2fe..238bc2009991 100644 --- a/app/forms/ai/text_transform_actions/form.rb +++ b/app/forms/ai/text_transform_actions/form.rb @@ -109,6 +109,20 @@ class Form < ApplicationForm label: model.persisted? ? I18n.t(:button_save) : I18n.t(:button_create), scheme: :primary ) + + if model.persisted? + f.separator + f.html_content do + render(Primer::Beta::Text.new(tag: :p, color: :muted, font_weight: :bold, mb: 2)) do + I18n.t("admin.text_transform_actions.form.prototype_only") + end + end + f.submit( + name: :save_and_stay, + label: I18n.t("admin.text_transform_actions.form.save_and_stay"), + scheme: :default + ) + end end private diff --git a/app/services/ai/text_transforms/create_run.rb b/app/services/ai/text_transforms/create_run.rb index bb12968ab7eb..059ef2963f1b 100644 --- a/app/services/ai/text_transforms/create_run.rb +++ b/app/services/ai/text_transforms/create_run.rb @@ -30,12 +30,13 @@ module AI module TextTransforms class CreateRun - def initialize(user:, action:, context:, content:, availability: Availability.new) + def initialize(user:, action:, context:, content:, availability: Availability.new, demo_fault: nil) @user = user @action = action @context = context @content = content @availability = availability + @demo_fault = demo_fault end def call @@ -49,7 +50,7 @@ def call private - attr_reader :user, :action, :context, :content, :availability + attr_reader :user, :action, :context, :content, :availability, :demo_fault def unavailable(run) run.errors.add(:base, :not_available, reason: unavailable_reason) @@ -67,7 +68,7 @@ def build_run def system_prompt return "" if action.nil? - Prompt.build(action:, context:, content:).system + DemoFaultGateway.mark(Prompt.build(action:, context:, content:).system, demo_fault) end end end diff --git a/app/services/ai/text_transforms/demo_fault_gateway.rb b/app/services/ai/text_transforms/demo_fault_gateway.rb new file mode 100644 index 000000000000..18299c6a4d28 --- /dev/null +++ b/app/services/ai/text_transforms/demo_fault_gateway.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module AI + module TextTransforms + # Demo only (AI-126): lets the result popover show its "stopped" and "failed" + # states on demand. The real signal of a guardrail that blocks a stream is + # unknown, so it is simulated on top of the real gateway. + class DemoFaultGateway < Gateway + FAULTS = %w[blocked failed].freeze + MARKER = /\n\n\[\[demo-fault:(#{FAULTS.join('|')})\]\]\z/ + BLOCK_AFTER = 2 + + def self.mark(system_prompt, fault) + FAULTS.include?(fault) ? "#{system_prompt}\n\n[[demo-fault:#{fault}]]" : system_prompt + end + + def initialize(gateway) + super() + @gateway = gateway + end + + delegate :readiness, to: :gateway + + def stream(system:, user:, timeout:, &) + fault = system[MARKER, 1] + system = system.sub(MARKER, "") + raise Errors::ConnectionFailed, "demo fault" if fault == "failed" + return gateway.stream(system:, user:, timeout:, &) unless fault == "blocked" + + stream_until_blocked(system:, user:, timeout:, &) + end + + private + + attr_reader :gateway + + def stream_until_blocked(system:, user:, timeout:) + started = Process.clock_gettime(Process::CLOCK_MONOTONIC) + + gateway.stream(system:, user:, timeout:) do |delta| + raise Errors::Blocked, "demo fault" if Process.clock_gettime(Process::CLOCK_MONOTONIC) - started > BLOCK_AFTER + + yield delta + end + + raise Errors::Blocked, "demo fault" + end + end + end +end diff --git a/app/services/ai/text_transforms/errors.rb b/app/services/ai/text_transforms/errors.rb index ad3c58afa4df..3843805bbb35 100644 --- a/app/services/ai/text_transforms/errors.rb +++ b/app/services/ai/text_transforms/errors.rb @@ -49,6 +49,11 @@ class TimedOut < Error class Upstream < Error REASON = :upstream_error end + + # Demo only (AI-126): a guardrail stopped the stream, the partial text must not be used. + class Blocked < Error + REASON = :blocked + end end end end diff --git a/app/services/ai/text_transforms/gateway.rb b/app/services/ai/text_transforms/gateway.rb index aed0b948e995..4e4b94d18432 100644 --- a/app/services/ai/text_transforms/gateway.rb +++ b/app/services/ai/text_transforms/gateway.rb @@ -34,7 +34,7 @@ class Gateway def ready? = ready end - def self.build = NullGateway.new + def self.build = DemoFaultGateway.new(LlmGateway.new) end end end diff --git a/app/services/ai/text_transforms/llm_gateway.rb b/app/services/ai/text_transforms/llm_gateway.rb new file mode 100644 index 000000000000..1c099e09aea3 --- /dev/null +++ b/app/services/ai/text_transforms/llm_gateway.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +module AI + module TextTransforms + class LlmGateway < Gateway + FEATURE = :description_assistant + + def readiness + resolution = Llm::Runtime.for(FEATURE) + return Readiness.new(true, nil) if resolution.ready? + + Readiness.new(false, resolution.status) + rescue OpenProject::Llm::UnknownFeature + Readiness.new(false, :feature_unregistered) + end + + def stream(system:, user:, timeout:, &) + @raised_by_caller = nil + response = chat(system, timeout).ask(user) { |chunk| forward(chunk, &) } + response.content.to_s + rescue StandardError => e + # Llm::Errors.wrap turns whatever the block raises into an Llm::Errors::Error, + # so the caller's own signal (cancellation, exceeded budget) is restored here. + raise @raised_by_caller if @raised_by_caller + + raise translate(e) + end + + private + + def chat(system, timeout) + Llm::Runtime.for(FEATURE).chat(timeout:, max_retries: 0).with_instructions(system) + end + + # Reasoning models stream minutes of chunks without content. They are passed + # on as empty deltas so the caller can check cancellation and its budget. + def forward(chunk) + yield chunk.content.to_s + rescue Cancelled, Errors::Error => e + @raised_by_caller = e + raise + end + + def translate(error) + Rails.logger.info { "AI text transform gateway failed: #{error.class}" } + + case error + when Llm::Errors::TimeoutError + Errors::TimedOut.new(error.class.name) + when Llm::Errors::ConnectionError + Errors::ConnectionFailed.new(error.class.name) + when Llm::Errors::NotReady, Llm::Errors::ConfigurationError + Errors::NotAvailable.new(error.class.name) + else + Errors::Upstream.new(error.class.name) + end + end + end + end +end diff --git a/app/views/admin/text_transform_actions/edit.html.erb b/app/views/admin/text_transform_actions/edit.html.erb index 7da0d3f1912c..aead5a9b07d1 100644 --- a/app/views/admin/text_transform_actions/edit.html.erb +++ b/app/views/admin/text_transform_actions/edit.html.erb @@ -41,3 +41,5 @@ See COPYRIGHT and LICENSE files for more details. %> <%= render(Admin::TextTransformActions::FormComponent.new(@text_transform_action)) %> + +<%= render(Admin::TextTransformActions::SandboxComponent.new(@text_transform_action)) %> diff --git a/app/views/custom_styles/_primer_color_mapping.erb b/app/views/custom_styles/_primer_color_mapping.erb index ca461fcd0cf1..dce6d3f57c95 100644 --- a/app/views/custom_styles/_primer_color_mapping.erb +++ b/app/views/custom_styles/_primer_color_mapping.erb @@ -37,6 +37,7 @@ --ck-color-list-background: var(--overlay-bgColor); --ck-color-base-border: var(--borderColor-default); --ck-color-button-default-hover-background: var(--button-default-bgColor-hover); + --ck-color-split-button-hover-background: var(--button-default-bgColor-hover); --ck-color-toolbar-background: var(--body-background); --ck-color-text: var(--body-font-color); --ck-content-font-color: var(--body-font-color); diff --git a/config/locales/en.yml b/config/locales/en.yml index 330d6726069c..ebb98d99786e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2200,6 +2200,8 @@ en: form: injects_type_template_caption: "If checked, the description template of the work package type is automatically added to the prompt. The prompt should contain instructions on what to do with the template." label_caption: "This is the name that will be visible to users in the editor." + prototype_only: "Prototype-only UI below:" + save_and_stay: "Save and stay" select_types: "Select types" types_caption: "Add work package types for which this action should be available. All available variants will automatically be included." usage_scope_caption: "You can limit where this action is visible: everywhere (including comments, wikis and custom fields), for all work package types or for certain work package types." @@ -2223,6 +2225,36 @@ en: scope_specific_work_package_types: one: "%{count} work package type" other: "%{count} work package types" + sandbox: + cancel: "Cancel" + content_caption: "The markdown the editor would send. Nothing is saved anywhere; the run and its events are removed after the retention period." + content_label: "Text to transform" + context_caption: "Without a context only actions scoped \"everywhere\" run. Actions scoped to work package types need a type, and actions that inject the type template need the template of the type variant, which comes from the work package or from the project and type of a new work package." + context_label: "Context" + context_new_work_package: "New work package (project and type)" + context_none: "No context" + context_work_package: "Existing work package" + description: "Prototype: runs this action against the text below through the execute API and polls the run until it finishes, exactly like the editor will." + details: "Run details" + details_title: "Run details" + event_kind: "Kind" + event_payload: "Payload" + event_seq: "Seq" + event_time: "Received" + events_section: "Events, as polled" + execute: "Execute" + new_work_package_caption: "Mirrors the create form: the project decides which variant of the type applies, and the assistant checks the add permission in the project." + project_label: "Project" + run_section: "Run" + select_project: "Select project" + select_work_package: "Select work package" + status_idle: "idle" + system_prompt_section: "System prompt stored for this run" + title: "Sandbox" + type_caption: "Type to search; the 20 best matches are listed. Only types enabled in the chosen project are accepted." + type_label: "Type" + work_package_caption: "Type an id or part of the subject; the 20 most recently updated matches are listed. The work package's project and type decide scope and template, and the assistant checks the edit permission on it." + work_package_label: "Work package" usage_scopes: all_work_package_types: "All work package types" everywhere: "Everywhere" @@ -2277,6 +2309,7 @@ en: ai: text_transform: errors: + blocked: "The response was blocked before it finished." connection_failed: "The AI service could not be reached." not_available: "The AI assistant is not available." timeout: "The AI service did not respond in time." @@ -2284,7 +2317,6 @@ en: pane: cancel: "Cancel" close: "Close" - copied: "Copied" copy: "Copy" discard: "Discard" editor_gone: "The editor is no longer open, so the text cannot be replaced. You can still copy it." @@ -5542,6 +5574,7 @@ en: filled?: "must be filled." format?: "is in invalid format." greater_or_equal_zero: "must be greater or equal to 0." + gt?: "must be greater than %{num}." gteq?: "must be greater than or equal to %{num}." hash?: "must be a hash." included_in?: @@ -5562,13 +5595,18 @@ en: not_unique: "must be unique within the same hierarchy level." parent: not_descendant: "must be a descendant of the hierarchy root." + project_id: + with_work_package: "must not be combined with a work package." short: not_unique: "must be unique within the same hierarchy level." + type_id: + without_project: "must be given together with a project." str?: "must be a string." time?: "must be a time." type?: "must be %{type}." unexpected_key: "is not allowed." uri?: "is not a valid URI." + uuid_v4?: "must be a UUID (version 4)." or: "or" rules: blueprint: "Pattern blueprint" diff --git a/config/locales/js-en.yml b/config/locales/js-en.yml index a031761e4357..2c5e70227f8d 100644 --- a/config/locales/js-en.yml +++ b/config/locales/js-en.yml @@ -228,6 +228,8 @@ en: description_select_work_package: "Select work package #%{id}" description_subwork_package: "Child of work package #%{id}" editor: + ai_actions: + caption: "Assistant" ckeditor_error: "An error occurred within CKEditor" ckeditor_error_reload: "The editor stopped working. Your text is still here, but you cannot change it. Copy any text you want to keep, then reload the page." error_saving_failed: "Saving the document failed with the following error: %{error}" diff --git a/config/routes.rb b/config/routes.rb index ff99c2ee0e4d..6f798b0e593a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -494,6 +494,15 @@ end end + namespace :ai do + resources :text_transform_panes, only: %i[create show destroy], param: :uuid do + member do + post :apply + post :cancel + end + end + end + namespace :projects do resource :menu, only: %i[show] resource :filters, only: %i[show] diff --git a/db/migrate/20260925140000_drop_legacy_demo_llm_tables.rb b/db/migrate/20260925140000_drop_legacy_demo_llm_tables.rb new file mode 100644 index 000000000000..0afec8ea746c --- /dev/null +++ b/db/migrate/20260925140000_drop_legacy_demo_llm_tables.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +#-- copyright +# OpenProject is an open source project management software. +# Copyright (C) the OpenProject GmbH +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License version 3. +# +# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +# Copyright (C) 2006-2013 Jean-Philippe Lang +# Copyright (C) 2010-2013 the ChiliProject Team +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# See COPYRIGHT and LICENSE files for more details. +#++ + +# Demo only (AI-100 PullPreview, never merged): the AI-3 stack renumbered its migrations when +# it landed on dev. Databases built from the earlier stack still hold the LLM tables under the +# old versions, so the new create_table migrations would fail. This drops those leftovers once. +class DropLegacyDemoLlmTables < ActiveRecord::Migration[8.1] + LEGACY_VERSIONS = %w[ + 20260811090000 20260811140000 20260811140100 20260812090000 + 20260813090000 20260813100000 20260908090000 + ].freeze + + def up + return unless legacy_schema? + + %i[llm_models llm_feature_bindings llm_capability_verdicts llm_connections].each do |table| + drop_table table, if_exists: true, force: :cascade + end + + execute "DELETE FROM schema_migrations WHERE version IN (#{LEGACY_VERSIONS.map { |v| quote(v) }.join(', ')})" + end + + def down + # Nothing to restore: the legacy tables belonged to a superseded version of the AI-3 stack. + end + + private + + def legacy_schema? + select_value("SELECT 1 FROM schema_migrations WHERE version = '20260811090000'").present? + end +end diff --git a/frontend/src/app/core/ai-actions/ai-actions.service.run.spec.ts b/frontend/src/app/core/ai-actions/ai-actions.service.run.spec.ts new file mode 100644 index 000000000000..080a2f9459be --- /dev/null +++ b/frontend/src/app/core/ai-actions/ai-actions.service.run.spec.ts @@ -0,0 +1,233 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// See COPYRIGHT and LICENSE files for more details. +//++ + +import { TestBed } from '@angular/core/testing'; +import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { provideHttpClient, withInterceptorsFromDi, withXhr } from '@angular/common/http'; +import { AI_SELECTION_MARKER, AiActionsService } from 'core-app/core/ai-actions/ai-actions.service'; +import { TurboRequestsService } from 'core-app/core/turbo/turbo-requests.service'; +import { ModelWriter } from 'core-app/core/ai-actions/editor-content'; +import { + AI_TEXT_TRANSFORM_APPLIED_EVENT, + AI_TEXT_TRANSFORM_APPLY_EVENT, + AI_TEXT_TRANSFORM_CLOSED_EVENT, + AiTextTransformAppliedDetail, +} from 'core-app/core/ai-actions/ai-text-transform-events'; + +const existingWorkPackage = { + id: '123', + _type: 'WorkPackage', + $links: { + type: { href: '/api/v3/types/45' }, + project: { href: '/api/v3/projects/7' }, + }, +}; + +const newWorkPackage = { ...existingWorkPackage, id: 'new' }; + +class FakeEditor { + content = '# Old text'; + + selectedMarkdown = ''; + + markers = new Map(); + + inserted:{ text:string, range:string }|null = null; + + data = { + parse: (markdown:string) => markdown, + stringify: () => this.selectedMarkdown, + }; + + model = { + document: { + getRoot: () => 'root', + selection: { + get isCollapsed() { return false; }, + getFirstRange: () => 'selection-range', + }, + }, + markers: { get: (name:string) => (this.markers.has(name) ? { getRange: () => this.markers.get(name) } : null) }, + createRangeIn: (root:string) => `range-in-${root}`, + getSelectedContent: () => 'selected-fragment', + change: (callback:(writer:ModelWriter) => void) => callback({ + addMarker: (name:string, { range }:{ range:unknown }) => { this.markers.set(name, range as string); }, + removeMarker: (name:string) => { this.markers.delete(name); }, + }), + insertContent: (text:string, range:string) => { this.inserted = { text, range }; }, + }; + + field = 'description'; + + config = { get: (name:string) => (name === 'openProject.context.field' ? this.field : undefined) }; + + getData():string { return this.content; } +} + +const fixGrammar = { id: 1, label: 'Fix grammar', position: 1, injectsTypeTemplate: false }; +const sortIntoTemplate = { id: 3, label: 'Sort into template', position: 3, injectsTypeTemplate: true }; + +// Demo only (AI-126 demo branch): the run part of the service until AI-176. +describe('AiActionsService run (demo)', () => { + let service:AiActionsService; + let httpMock:HttpTestingController; + let editor:FakeEditor; + let paneRequests:{ url:string, body:FormData }[]; + let applied:AiTextTransformAppliedDetail[]; + + const onApplied = (event:Event) => { applied.push((event as CustomEvent).detail); }; + + beforeEach(() => { + paneRequests = []; + applied = []; + const turboRequestsStub = { + request: (url:string, init:RequestInit) => { + paneRequests.push({ url, body: init.body as FormData }); + return Promise.resolve({ html: '', headers: new Headers() }); + }, + }; + + TestBed.configureTestingModule({ + providers: [ + AiActionsService, + { provide: TurboRequestsService, useValue: turboRequestsStub }, + provideHttpClient(withXhr(), withInterceptorsFromDi()), + provideHttpClientTesting(), + ], + }); + + service = TestBed.inject(AiActionsService); + httpMock = TestBed.inject(HttpTestingController); + editor = new FakeEditor(); + window.addEventListener(AI_TEXT_TRANSFORM_APPLIED_EVENT, onApplied); + }); + + afterEach(() => { + httpMock.verify(); + window.removeEventListener(AI_TEXT_TRANSFORM_APPLIED_EVENT, onApplied); + }); + + const lastRequestId = () => paneRequests[paneRequests.length - 1].body.get('request_id') as string; + + const dispatch = (name:string, detail:unknown) => document.dispatchEvent(new CustomEvent(name, { detail })); + + describe('run', () => { + it('requests the result pane for the whole description without a selection', async () => { + await service.run(fixGrammar, editor, existingWorkPackage); + + const [{ url, body }] = paneRequests; + expect(url).toBe('/ai/text_transform_panes'); + expect(body.get('action_id')).toBe('1'); + expect(body.get('scope')).toBe('document'); + expect(body.get('input')).toBe('# Old text'); + expect(body.get('work_package_id')).toBe('123'); + expect(body.get('request_id')).toMatch(/^[0-9a-f-]{36}$/); + }); + + it('sends only the selected text and marks its range', async () => { + editor.selectedMarkdown = 'selected **text**'; + + await service.run(fixGrammar, editor, existingWorkPackage); + + expect(paneRequests[0].body.get('scope')).toBe('selection'); + expect(paneRequests[0].body.get('input')).toBe('selected **text**'); + expect(editor.markers.get(AI_SELECTION_MARKER)).toBe('selection-range'); + }); + + it('runs actions that inject the type template on the whole description', async () => { + editor.selectedMarkdown = 'selected text'; + + await service.run(sortIntoTemplate, editor, newWorkPackage); + + const { body } = paneRequests[0]; + expect(body.get('scope')).toBe('document'); + expect(body.get('project_id')).toBe('7'); + expect(body.get('type_id')).toBe('45'); + expect(editor.markers.size).toBe(0); + }); + + it('runs without context outside the work package description', async () => { + editor.field = 'journal[notes]'; + + await service.run(fixGrammar, editor, existingWorkPackage); + + const { body } = paneRequests[0]; + expect(body.get('work_package_id')).toBeNull(); + expect(body.get('scope')).toBe('document'); + }); + }); + + describe('applying the result', () => { + it('replaces the whole description and reports success', async () => { + await service.run(fixGrammar, editor, existingWorkPackage); + + dispatch(AI_TEXT_TRANSFORM_APPLY_EVENT, { requestId: lastRequestId(), scope: 'document', text: 'New text' }); + + expect(editor.inserted).toEqual({ text: 'New text', range: 'range-in-root' }); + expect(applied).toEqual([{ requestId: lastRequestId(), ok: true }]); + }); + + it('replaces only the marked selection', async () => { + editor.selectedMarkdown = 'old part'; + await service.run(fixGrammar, editor, existingWorkPackage); + + dispatch(AI_TEXT_TRANSFORM_APPLY_EVENT, { requestId: lastRequestId(), scope: 'selection', text: 'new part' }); + + expect(editor.inserted).toEqual({ text: 'new part', range: 'selection-range' }); + expect(editor.markers.size).toBe(0); + }); + + it('reports a failure when the selection is gone', async () => { + editor.selectedMarkdown = 'old part'; + await service.run(fixGrammar, editor, existingWorkPackage); + editor.markers.clear(); + + dispatch(AI_TEXT_TRANSFORM_APPLY_EVENT, { requestId: lastRequestId(), scope: 'selection', text: 'new part' }); + + expect(editor.inserted).toBeNull(); + expect(applied).toEqual([{ requestId: lastRequestId(), ok: false }]); + }); + + it('ignores results for requests it did not start', async () => { + await service.run(fixGrammar, editor, existingWorkPackage); + + dispatch(AI_TEXT_TRANSFORM_APPLY_EVENT, { requestId: crypto.randomUUID(), scope: 'document', text: 'Injected' }); + + expect(editor.inserted).toBeNull(); + expect(applied).toEqual([]); + }); + + it('clears the selection marker when the pane closes', async () => { + editor.selectedMarkdown = 'old part'; + await service.run(fixGrammar, editor, existingWorkPackage); + + dispatch(AI_TEXT_TRANSFORM_CLOSED_EVENT, { requestId: lastRequestId() }); + + expect(editor.markers.size).toBe(0); + }); + }); +}); diff --git a/frontend/src/app/core/ai-actions/ai-actions.service.spec.ts b/frontend/src/app/core/ai-actions/ai-actions.service.spec.ts new file mode 100644 index 000000000000..4a0c7e8d7794 --- /dev/null +++ b/frontend/src/app/core/ai-actions/ai-actions.service.spec.ts @@ -0,0 +1,193 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// See COPYRIGHT and LICENSE files for more details. +//++ + +import { vi } from 'vitest'; +import { TestBed } from '@angular/core/testing'; +import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { provideHttpClient, withInterceptorsFromDi, withXhr } from '@angular/common/http'; +import { AiActionsService } from 'core-app/core/ai-actions/ai-actions.service'; +import { TurboRequestsService } from 'core-app/core/turbo/turbo-requests.service'; + +const halCollection = (elements:unknown[]) => ({ + _type: 'Collection', + total: elements.length, + count: elements.length, + _embedded: { elements }, +}); + +const halAction = (id:number, label:string, position:number) => ({ + _type: 'AITextTransformAction', + id, + label, + position, + injectsTypeTemplate: false, + _links: { self: { href: `/api/v3/ai_text_transform_actions/${id}`, title: label } }, +}); + +const existingWorkPackage = { + id: '123', + _type: 'WorkPackage', + $links: { + type: { href: '/api/v3/types/45' }, + project: { href: '/api/v3/projects/7' }, + }, +}; + +const newWorkPackage = { ...existingWorkPackage, id: 'new' }; + +const fixGrammar = { id: 1, label: 'Fix grammar', position: 1, injectsTypeTemplate: false }; +const makeConcise = { id: 2, label: 'Make concise', position: 2, injectsTypeTemplate: false }; + +describe('AiActionsService', () => { + let service:AiActionsService; + let httpMock:HttpTestingController; + + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ + AiActionsService, + // Demo only (AI-126 demo branch): the demo run needs Turbo requests. + { provide: TurboRequestsService, useValue: { request: () => Promise.resolve({ html: '', headers: new Headers() }) } }, + provideHttpClient(withXhr(), withInterceptorsFromDi()), + provideHttpClientTesting(), + ], + }); + + service = TestBed.inject(AiActionsService); + httpMock = TestBed.inject(HttpTestingController); + }); + + afterEach(() => httpMock.verify()); + + describe('actionsFor', () => { + it('lists the actions of an existing work package ordered by position', async () => { + const promise = service.actionsFor(existingWorkPackage, 'description'); + + const request = httpMock.expectOne('/api/v3/work_packages/123/ai_text_transform_actions'); + expect(request.request.method).toBe('GET'); + request.flush(halCollection([ + halAction(2, 'Summarize', 2), + halAction(1, 'Fix grammar', 1), + ])); + + const actions = await promise; + expect(actions.map((action) => action.label)).toEqual(['Fix grammar', 'Summarize']); + expect(actions[0]).toEqual(fixGrammar); + }); + + it('lists the actions of a new work package through its project and type', async () => { + const promise = service.actionsFor(newWorkPackage, 'description'); + + httpMock + .expectOne('/api/v3/projects/7/ai_text_transform_actions?typeId=45') + .flush(halCollection([halAction(3, 'Sort into template', 1)])); + + expect((await promise).map((action) => action.id)).toEqual([3]); + }); + + it('resolves to no actions for a new work package without project or type', async () => { + const actions = await service.actionsFor({ id: 'new', _type: 'WorkPackage', $links: {} }, 'description'); + + expect(actions).toEqual([]); + httpMock.expectNone(() => true); + }); + + it.each([ + ['a work package comment', existingWorkPackage, 'journal[notes]'], + ['another resource', { id: '5', _type: 'Meeting' }, 'description'], + ['an editor without resource', undefined, 'content'], + ['an editor without field', existingWorkPackage, undefined], + ])('lists the actions offered everywhere for %s', async (_, resource, field) => { + const promise = service.actionsFor(resource, field); + + httpMock + .expectOne('/api/v3/ai_text_transform_actions') + .flush(halCollection([halAction(2, 'Summarize', 2), halAction(1, 'Fix grammar', 1)])); + + expect((await promise).map((action) => action.id)).toEqual([1, 2]); + }); + + it('resolves to no actions when the request fails', async () => { + const promise = service.actionsFor(existingWorkPackage, 'description'); + + httpMock + .expectOne('/api/v3/work_packages/123/ai_text_transform_actions') + .flush({ message: 'nope' }, { status: 403, statusText: 'Forbidden' }); + + expect(await promise).toEqual([]); + }); + + it('resolves to no actions when the request for the actions offered everywhere fails', async () => { + const promise = service.actionsFor(undefined, undefined); + + httpMock + .expectOne('/api/v3/ai_text_transform_actions') + .flush({ message: 'nope' }, { status: 401, statusText: 'Unauthorized' }); + + expect(await promise).toEqual([]); + }); + }); + + describe('defaultAction', () => { + const storageKey = 'openproject.ai_actions.last_action_id'; + + beforeEach(() => window.localStorage.removeItem(storageKey)); + afterEach(() => { + vi.restoreAllMocks(); + window.localStorage.removeItem(storageKey); + }); + + it('is the first action while none was run yet', () => { + expect(service.defaultAction([fixGrammar, makeConcise])).toBe(fixGrammar); + }); + + it('is the action that was run last', async () => { + await service.run(makeConcise); + + expect(service.defaultAction([fixGrammar, makeConcise])).toBe(makeConcise); + expect(window.localStorage.getItem(storageKey)).toBe('2'); + }); + + it('remembers the last action across page loads', () => { + window.localStorage.setItem(storageKey, '2'); + + expect(service.defaultAction([fixGrammar, makeConcise])).toBe(makeConcise); + }); + + it('falls back to the first action when the last one is not offered', () => { + window.localStorage.setItem(storageKey, '99'); + + expect(service.defaultAction([fixGrammar, makeConcise])).toBe(fixGrammar); + }); + + it('is the first action when the browser storage is unavailable', () => { + vi.spyOn(Storage.prototype, 'getItem').mockImplementation(() => { throw new Error('blocked'); }); + + expect(service.defaultAction([fixGrammar, makeConcise])).toBe(fixGrammar); + }); + }); +}); diff --git a/frontend/src/app/core/ai-actions/ai-actions.service.ts b/frontend/src/app/core/ai-actions/ai-actions.service.ts new file mode 100644 index 000000000000..c7c1db33f4ff --- /dev/null +++ b/frontend/src/app/core/ai-actions/ai-actions.service.ts @@ -0,0 +1,292 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// See COPYRIGHT and LICENSE files for more details. +//++ + +import { inject, Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { firstValueFrom } from 'rxjs'; +import { PathHelperService } from 'core-app/core/path-helper/path-helper.service'; +import { IHALCollection } from 'core-app/core/apiv3/types/hal-collection.type'; +import idFromLink from 'core-app/features/hal/helpers/id-from-link'; +import { TurboRequestsService } from 'core-app/core/turbo/turbo-requests.service'; +import { IEditorWithContent } from 'core-app/core/ai-actions/editor-content'; +import { + AI_TEXT_TRANSFORM_APPLIED_EVENT, + AI_TEXT_TRANSFORM_APPLY_EVENT, + AI_TEXT_TRANSFORM_CLOSED_EVENT, + AiTextTransformApplyDetail, + AiTextTransformAppliedDetail, + AiTextTransformScope, +} from 'core-app/core/ai-actions/ai-text-transform-events'; + +export interface IAiTextTransformAction { + id:number; + label:string; + position:number; + injectsTypeTemplate:boolean; +} + +interface IEditorContextResource { + id?:string|null; + _type?:string; + $links?:{ + type?:{ href?:string }; + project?:{ href?:string }; + }; +} + +interface IPendingRequest { + editor:IEditorWithContent; + scope:AiTextTransformScope; +} + +export const AI_SELECTION_MARKER = 'ai-text-transform:selection'; +const LAST_ACTION_STORAGE_KEY = 'openproject.ai_actions.last_action_id'; +// Demo only: ?ai_demo_fault=blocked or =failed in the page URL makes the next runs end that way. +const DEMO_FAULT_PARAM = 'ai_demo_fault'; + +/** + * Counterpart of the CKEditor Assistant button, which only renders the list and reports the chosen + * action. Availability is decided server-side; an empty list keeps the button hidden. + * + * Demo (AI-126 demo branch, until AI-176): run requests the server-rendered result pane through + * Turbo and applies the text the pane hands back to the editor model. + */ +@Injectable({ providedIn: 'root' }) +export class AiActionsService { + private http = inject(HttpClient); + + private pathHelper = inject(PathHelperService); + + private turboRequests = inject(TurboRequestsService); + + private pending = new Map(); + + constructor() { + document.addEventListener(AI_TEXT_TRANSFORM_APPLY_EVENT, (event) => { + this.apply((event as CustomEvent).detail); + }); + document.addEventListener(AI_TEXT_TRANSFORM_CLOSED_EVENT, (event) => { + this.closed((event as CustomEvent<{ requestId:string }>).detail.requestId); + }); + } + + async actionsFor(resource:IEditorContextResource|undefined, field:string|undefined):Promise { + const path = this.listPath(resource, field); + + if (path === null) { + return []; + } + + try { + const collection = await firstValueFrom(this.http.get>(path)); + return collection._embedded.elements + .map(({ id, label, position, injectsTypeTemplate }) => ({ id, label, position, injectsTypeTemplate })) + .sort((a, b) => a.position - b.position); + } catch { + return []; + } + } + + defaultAction(actions:IAiTextTransformAction[]):IAiTextTransformAction|undefined { + const lastActionId = this.lastActionId(); + + return actions.find((action) => action.id === lastActionId) ?? actions[0]; + } + + async run(action:IAiTextTransformAction, editor?:IEditorWithContent, resource?:IEditorContextResource):Promise { + this.rememberAction(action); + if (!editor) { + return; + } + + this.forgetRequestsOf(editor); + + // An action that injects the type template describes the whole description, + // so it always runs on the document, even with text selected. + const selection = action.injectsTypeTemplate ? null : this.markSelection(editor); + const scope:AiTextTransformScope = selection === null ? 'document' : 'selection'; + const requestId = crypto.randomUUID(); + this.pending.set(requestId, { editor, scope }); + + await this.turboRequests.request(`${this.pathHelper.staticBase}/ai/text_transform_panes`, { + method: 'POST', + body: this.paneRequest({ + request_id: requestId, + action_id: String(action.id), + scope, + input: selection ?? editor.getData(), + ...this.paneContext(resource, this.fieldOf(editor)), + }), + headers: { Accept: 'text/vnd.turbo-stream.html' }, + credentials: 'same-origin', + }); + } + + // Only results for requests started here are applied: the apply event comes from a turbo + // stream, and an injected stream must not be able to write into the editor. + private apply({ requestId, text }:AiTextTransformApplyDetail):void { + const request = this.pending.get(requestId); + if (!request) { + return; + } + + const { editor, scope } = request; + const marker = editor.model.markers.get(AI_SELECTION_MARKER); + const ok = scope === 'document' || marker !== null; + + if (ok) { + // insertContent keeps the undo history, unlike setData. + editor.model.change((writer) => { + const range = marker && scope === 'selection' + ? marker.getRange() + : editor.model.createRangeIn(editor.model.document.getRoot()); + editor.model.insertContent(editor.data.parse(text), range); + if (marker) { + writer.removeMarker(AI_SELECTION_MARKER); + } + }); + this.pending.delete(requestId); + } + + const detail:AiTextTransformAppliedDetail = { requestId, ok }; + window.dispatchEvent(new CustomEvent(AI_TEXT_TRANSFORM_APPLIED_EVENT, { detail })); + } + + private closed(requestId:string):void { + const request = this.pending.get(requestId); + if (request) { + this.pending.delete(requestId); + this.clearMarker(request.editor); + } + } + + private forgetRequestsOf(editor:IEditorWithContent):void { + this.pending.forEach((request, requestId) => { + if (request.editor === editor) { + this.pending.delete(requestId); + } + }); + } + + private markSelection(editor:IEditorWithContent):string|null { + this.clearMarker(editor); + const { selection } = editor.model.document; + if (selection.isCollapsed) { + return null; + } + + const markdown = editor.data.stringify(editor.model.getSelectedContent(selection)); + if (markdown.trim() === '') { + return null; + } + + editor.model.change((writer) => { + writer.addMarker(AI_SELECTION_MARKER, { range: selection.getFirstRange(), usingOperation: false }); + }); + return markdown; + } + + private clearMarker(editor:IEditorWithContent):void { + if (editor.model.markers.get(AI_SELECTION_MARKER)) { + editor.model.change((writer) => writer.removeMarker(AI_SELECTION_MARKER)); + } + } + + private paneRequest(fields:Record):FormData { + const body = new FormData(); + Object.entries(fields).forEach(([key, value]) => body.set(key, value)); + + const demoFault = new URLSearchParams(window.location.search).get(DEMO_FAULT_PARAM); + if (demoFault) { + body.set('demo_fault', demoFault); + } + return body; + } + + // The work package description runs with its context; every other editor runs without one. + private paneContext(resource:IEditorContextResource|undefined, field:string|undefined):Record { + if (resource?._type !== 'WorkPackage' || field !== 'description') { + return {}; + } + + if (resource.id && resource.id !== 'new') { + return { work_package_id: resource.id }; + } + + const projectId = this.linkedId(resource.$links?.project?.href); + const typeId = this.linkedId(resource.$links?.type?.href); + return projectId && typeId ? { project_id: projectId, type_id: typeId } : {}; + } + + // Only the field: config.get deep-clones its value, and the context's HAL resource cannot be cloned. + private fieldOf(editor:IEditorWithContent):string|undefined { + return editor.config?.get('openProject.context.field') as string|undefined; + } + + private rememberAction(action:IAiTextTransformAction):void { + this.withStorage((storage) => storage.setItem(LAST_ACTION_STORAGE_KEY, String(action.id))); + } + + private lastActionId():number|null { + const stored = this.withStorage((storage) => storage.getItem(LAST_ACTION_STORAGE_KEY)); + + return stored == null ? null : Number(stored); + } + + private withStorage(access:(storage:Storage) => T):T|null { + try { + return access(window.localStorage); + } catch { + return null; + } + } + + private listPath(resource:IEditorContextResource|undefined, field:string|undefined):string|null { + if (resource?._type === 'WorkPackage' && field === 'description') { + return this.workPackageListPath(resource); + } + + return this.pathHelper.api.v3.aiTextTransformActions(); + } + + private workPackageListPath(workPackage:IEditorContextResource):string|null { + const paths = this.pathHelper.api.v3; + + if (workPackage.id && workPackage.id !== 'new') { + return paths.aiTextTransformActionsByWorkPackage(workPackage.id); + } + + const projectId = this.linkedId(workPackage.$links?.project?.href); + const typeId = this.linkedId(workPackage.$links?.type?.href); + + return projectId && typeId ? paths.aiTextTransformActionsByProject(projectId, typeId) : null; + } + + private linkedId(href:string|undefined):string|null { + return href ? idFromLink(href) : null; + } +} diff --git a/frontend/src/app/core/ai-actions/ai-text-transform-events.ts b/frontend/src/app/core/ai-actions/ai-text-transform-events.ts new file mode 100644 index 000000000000..932ea8b6b9c6 --- /dev/null +++ b/frontend/src/app/core/ai-actions/ai-text-transform-events.ts @@ -0,0 +1,44 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// See COPYRIGHT and LICENSE files for more details. +//++ + +export type AiTextTransformScope = 'document'|'selection'; + +export interface AiTextTransformApplyDetail { + requestId:string; + scope:AiTextTransformScope; + text:string; +} + +export interface AiTextTransformAppliedDetail { + requestId:string; + ok:boolean; +} + +export const AI_TEXT_TRANSFORM_APPLIED_EVENT = 'op:ai-text-transform:applied'; +// Dispatched by the server through the dispatchEvent turbo stream action. +export const AI_TEXT_TRANSFORM_APPLY_EVENT = 'op-dispatched:ai-text-transform:apply'; +export const AI_TEXT_TRANSFORM_CLOSED_EVENT = 'op-dispatched:ai-text-transform:closed'; diff --git a/frontend/src/app/core/ai-actions/editor-content.ts b/frontend/src/app/core/ai-actions/editor-content.ts new file mode 100644 index 000000000000..cf800f6d5cc9 --- /dev/null +++ b/frontend/src/app/core/ai-actions/editor-content.ts @@ -0,0 +1,56 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// See COPYRIGHT and LICENSE files for more details. +//++ + +export type ModelElement = unknown; +export type ModelRange = unknown; + +export interface ModelWriter { + addMarker(name:string, options:{ range:ModelRange; usingOperation:boolean }):void; + removeMarker(name:string):void; +} + +export interface ModelSelection { + isCollapsed:boolean; + getFirstRange():ModelRange; +} + +export interface IEditorWithContent { + getData():string; + config?:{ get(name:string):unknown }; + data:{ + parse(markdown:string):unknown; + stringify(fragment:unknown):string; + }; + model:{ + document:{ getRoot():ModelElement; selection:ModelSelection }; + markers:{ get(name:string):{ getRange():ModelRange }|null }; + createRangeIn(element:ModelElement):ModelRange; + getSelectedContent(selection:ModelSelection):unknown; + change(callback:(writer:ModelWriter) => void):void; + insertContent(content:unknown, selectable:ModelRange):void; + }; +} diff --git a/frontend/src/app/features/plugins/plugin-context.ts b/frontend/src/app/features/plugins/plugin-context.ts index e4d1147e90a5..15a027d2a62e 100644 --- a/frontend/src/app/features/plugins/plugin-context.ts +++ b/frontend/src/app/features/plugins/plugin-context.ts @@ -59,6 +59,7 @@ import { TimezoneService } from 'core-app/core/datetime/timezone.service'; import { TurboRequestsService } from 'core-app/core/turbo/turbo-requests.service'; import { CurrentProjectService } from 'core-app/core/current-project/current-project.service'; import { HalEventsService } from '../hal/services/hal-events.service'; +import { AiActionsService } from 'core-app/core/ai-actions/ai-actions.service'; /** * Plugin context bridge for plugins outside the CLI compiler context * in order to access services and parts of the core application @@ -96,6 +97,7 @@ export class OpenProjectPluginContext { http: this.injector.get(HttpClient), turboRequests: this.injector.get(TurboRequestsService), currentProject: this.injector.get(CurrentProjectService), + aiActions: this.injector.get(AiActionsService), }; public readonly helpers = { diff --git a/frontend/src/global_styles/content/editor/_ckeditor.sass b/frontend/src/global_styles/content/editor/_ckeditor.sass index 1f9867beedf1..958be399a4fe 100644 --- a/frontend/src/global_styles/content/editor/_ckeditor.sass +++ b/frontend/src/global_styles/content/editor/_ckeditor.sass @@ -102,6 +102,11 @@ opce-ckeditor-augmented-textarea .op-ckeditor--attachments max-width: 100% flex-wrap: wrap +.ck.ck-toolbar > .op-ai-actions .ck-splitbutton__action > .ck-button__label + max-width: 12em + overflow: hidden + text-overflow: ellipsis + // Mentions autocomplete .ck-list__item .mention-list-item display: block diff --git a/frontend/src/stimulus/controllers/dynamic/ai-text-transform-pane-run.controller.ts b/frontend/src/stimulus/controllers/dynamic/ai-text-transform-pane-run.controller.ts new file mode 100644 index 000000000000..f96a06a6b952 --- /dev/null +++ b/frontend/src/stimulus/controllers/dynamic/ai-text-transform-pane-run.controller.ts @@ -0,0 +1,192 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// See COPYRIGHT and LICENSE files for more details. +//++ + +import { Controller } from '@hotwired/stimulus'; +import type { TurboRequestsService } from 'core-app/core/turbo/turbo-requests.service'; +import { useAngularServices, type PickedServices, type ServiceKey } from 'core-stimulus/mixins/use-angular-services'; +import { + AI_TEXT_TRANSFORM_APPLIED_EVENT, + AI_TEXT_TRANSFORM_APPLY_EVENT, + AiTextTransformAppliedDetail, + AiTextTransformApplyDetail, +} from 'core-app/core/ai-actions/ai-text-transform-events'; + +const POLL_MIN = 400; +const POLL_MAX = 1000; +const POLL_HIDDEN = 5000; +const APPLY_TIMEOUT = 300; +const PANE_SELECTOR = '[data-controller~="ai-text-transform-pane"]'; + +const pollDelays = new Map(); + +/** + * Demo glue (AI-126 demo branch, until AI-176): sits on the pane footer's state element, which the + * server replaces on every poll that brings news. It polls while the run is generating, waits for + * the editor's answer after Replace, and cancels the run when the pane disappears while generating. + */ +export default class AiTextTransformPaneRunController extends Controller { + static services:ServiceKey[] = ['turboRequests']; + + static values = { + state: String, + run: String, + seq: Number, + requestId: String, + pollUrl: String, + editorGone: String, + selectionGone: String, + }; + + declare readonly stateValue:string; + declare readonly runValue:string; + declare readonly seqValue:number; + declare readonly requestIdValue:string; + declare readonly pollUrlValue:string; + declare readonly editorGoneValue:string; + declare readonly selectionGoneValue:string; + declare services:Promise>; + declare turboRequests:TurboRequestsService; + + private pollTimer:ReturnType|null = null; + private applyTimer:ReturnType|null = null; + private answered = false; + + private readonly onApply = (event:Event) => this.awaitApplied((event as CustomEvent).detail); + private readonly onApplied = (event:Event) => this.applied((event as CustomEvent).detail); + + initialize():void { + useAngularServices(this); + } + + connect():void { + document.addEventListener(AI_TEXT_TRANSFORM_APPLY_EVENT, this.onApply); + window.addEventListener(AI_TEXT_TRANSFORM_APPLIED_EVENT, this.onApplied); + if (this.stateValue === 'generating') { + this.schedulePoll(pollDelays.get(this.runValue) ?? POLL_MIN); + } else { + pollDelays.delete(this.runValue); + } + } + + disconnect():void { + document.removeEventListener(AI_TEXT_TRANSFORM_APPLY_EVENT, this.onApply); + window.removeEventListener(AI_TEXT_TRANSFORM_APPLIED_EVENT, this.onApplied); + this.clearTimers(); + this.cancelIfAbandoned(); + } + + private schedulePoll(delay:number):void { + this.pollTimer = setTimeout(() => { void this.poll(delay); }, document.hidden ? POLL_HIDDEN : delay); + } + + private async poll(delay:number):Promise { + this.pollTimer = null; + const url = new URL(this.pollUrlValue, window.location.origin); + url.searchParams.set('after', String(this.seqValue)); + const { turboRequests } = await this.services; + + try { + const { html } = await turboRequests.request( + url.toString(), + { method: 'GET', headers: { Accept: 'text/vnd.turbo-stream.html' }, credentials: 'same-origin' }, + true, + ); + pollDelays.set(this.runValue, html.trim() === '' ? Math.min(POLL_MAX, delay * 1.5) : POLL_MIN); + } catch { + return; + } + + // Without news the footer stays and this controller keeps polling; with news a new one takes over. + if (this.element.isConnected) { + this.schedulePoll(pollDelays.get(this.runValue) ?? POLL_MAX); + } + } + + // A pane replaced by a new start or left with the page while generating stops its run. + private cancelIfAbandoned():void { + if (this.stateValue !== 'generating') { + return; + } + + const stillShown = document.querySelector(`[data-ai-text-transform-pane-run-run-value="${this.runValue}"]`); + if (stillShown) { + return; + } + + const url = new URL(this.pollUrlValue, window.location.origin); + void fetch(`${url.pathname}/cancel`, { + method: 'POST', + credentials: 'same-origin', + keepalive: true, + headers: { 'X-CSRF-Token': document.querySelector('meta[name="csrf-token"]')?.content ?? '' }, + }); + } + + // Whoever owns the editor answers the apply event right away; without an answer the editor is gone. + private awaitApplied(detail:AiTextTransformApplyDetail):void { + if (detail.requestId !== this.requestIdValue || this.answered) { + return; + } + + this.applyTimer = setTimeout(() => this.showApplyFailure(this.editorGoneValue), APPLY_TIMEOUT); + } + + private applied(detail:AiTextTransformAppliedDetail):void { + if (detail.requestId !== this.requestIdValue) { + return; + } + + this.answered = true; + this.clearTimers(); + if (detail.ok) { + this.element.closest(PANE_SELECTOR)?.remove(); + } else { + this.showApplyFailure(this.selectionGoneValue); + } + } + + private showApplyFailure(message:string):void { + const pane = this.element.closest(PANE_SELECTOR); + const banner = pane?.querySelector('[data-ai-text-transform-pane-target="applyFailed"]'); + const text = pane?.querySelector('[data-ai-text-transform-pane-target="applyFailedMessage"]'); + if (banner && text) { + text.textContent = message; + banner.hidden = false; + } + } + + private clearTimers():void { + if (this.pollTimer !== null) { + clearTimeout(this.pollTimer); + this.pollTimer = null; + } + if (this.applyTimer !== null) { + clearTimeout(this.applyTimer); + this.applyTimer = null; + } + } +} diff --git a/frontend/src/stimulus/controllers/dynamic/ai-text-transform-pane.controller.spec.ts b/frontend/src/stimulus/controllers/dynamic/ai-text-transform-pane.controller.spec.ts new file mode 100644 index 000000000000..c6be6c9cb7e5 --- /dev/null +++ b/frontend/src/stimulus/controllers/dynamic/ai-text-transform-pane.controller.spec.ts @@ -0,0 +1,242 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// See COPYRIGHT and LICENSE files for more details. +//++ + +import { fireEvent } from '@testing-library/dom'; +import AiTextTransformPaneController from './ai-text-transform-pane.controller'; +import { setupStimulusTest, type StimulusTestContext } from 'core-stimulus/test-helpers'; + +describe('AiTextTransformPaneController', () => { + let ctx:StimulusTestContext; + + const CLOSE_FORM_ID = 'ai-text-transform-pane-close'; + const action = (event:string, name:string) => `data-action="${event}->ai-text-transform-pane#${name}"`; + + const HTML = ` +
+
+
+ Link + +
+
+ +
+ + +
+
`; + + const wrapper = () => ctx.container.querySelector('[data-controller="ai-text-transform-pane"]'); + const pane = () => ctx.screen.getByRole('dialog', { name: 'AI result' }); + const closeButton = () => ctx.screen.getByRole('button', { name: 'Close' }); + const link = () => ctx.screen.getByRole('link', { name: 'Link' }); + const rect = () => pane().getBoundingClientRect().toJSON() as DOMRect; + const byTestId = (id:string) => ctx.screen.getByTestId(id); + + function dragBy(handle:HTMLElement, dx:number, dy:number, button = 0):void { + const start = handle.getBoundingClientRect(); + const end = { clientX: start.left + dx, clientY: start.top + dy }; + fireEvent.pointerDown(handle, { clientX: start.left, clientY: start.top, button }); + fireEvent.pointerMove(window, end); + fireEvent.pointerUp(window, end); + } + + function pressEscape():void { + fireEvent.keyDown(pane(), { key: 'Escape' }); + } + + beforeEach(async () => { + ctx = await setupStimulusTest({ controllers: { 'ai-text-transform-pane': AiTextTransformPaneController } }); + await ctx.mount(HTML); + }); + + afterEach(() => { + vi.restoreAllMocks(); + // Unpinning before the controller disconnects keeps the remembered geometry from leaking into the next test. + ctx.container.querySelector('[data-ai-text-transform-pane-target="pane"]')?.removeAttribute('style'); + ctx.dispose(); + }); + + it('focuses the pane on connect', () => { + expect(pane()).toHaveFocus(); + }); + + describe('dragging', () => { + it('moves the pane by the header and pins it with left and top', () => { + const before = rect(); + dragBy(byTestId('header'), -20, 30); + + expect(pane()).toHaveStyle({ left: `${before.left - 20}px`, top: `${before.top + 30}px` }); + expect(pane().style.right).toBe('auto'); + expect(pane().style.bottom).toBe('auto'); + }); + + it('moves the pane by the footer grip', () => { + const before = rect(); + dragBy(byTestId('grip'), -10, 10); + + expect(rect().left).toBe(before.left - 10); + expect(rect().top).toBe(before.top + 10); + }); + + it('does not start a drag on interactive elements in the header', () => { + const before = rect(); + dragBy(closeButton(), -20, 30); + dragBy(link(), -20, 30); + + expect(rect()).toEqual(before); + }); + + it('does not start a drag with a secondary button', () => { + const before = rect(); + dragBy(byTestId('header'), -20, 30, 2); + + expect(rect()).toEqual(before); + }); + + it('keeps the pane inside the viewport', () => { + dragBy(byTestId('header'), -5000, -5000); + expect(pane()).toHaveStyle({ left: '8px', top: '8px' }); + + dragBy(byTestId('header'), 5000, 5000); + expect(rect().right).toBe(window.innerWidth - 8); + expect(rect().bottom).toBe(window.innerHeight - 8); + }); + + it('stops following the pointer after pointerup', () => { + dragBy(byTestId('header'), -20, 30); + const after = rect(); + fireEvent.pointerMove(window, { clientX: 0, clientY: 0 }); + + expect(rect()).toEqual(after); + }); + + it('stops following the pointer after pointercancel', () => { + const header = byTestId('header'); + const start = header.getBoundingClientRect(); + const before = rect(); + fireEvent.pointerDown(header, { clientX: start.left, clientY: start.top }); + fireEvent.pointerCancel(window, { clientX: start.left, clientY: start.top }); + fireEvent.pointerMove(window, { clientX: start.left - 20, clientY: start.top + 30 }); + + expect(rect()).toEqual(before); + }); + }); + + describe('resizing', () => { + it('clamps the bottom-right handle to the minimum size and the viewport', () => { + const handle = byTestId('resize-bottom-right'); + dragBy(handle, -5000, -5000); + expect(rect().width).toBe(320); + expect(rect().height).toBe(240); + + dragBy(handle, 5000, 5000); + expect(rect().right).toBe(window.innerWidth - 8); + expect(rect().bottom).toBe(window.innerHeight - 8); + }); + + it('moves only the left edge with the left handle', () => { + const before = rect(); + dragBy(byTestId('resize-left'), -30, 0); + + expect(rect().left).toBe(before.left - 30); + expect(rect().width).toBe(before.width + 30); + expect(rect().right).toBe(before.right); + expect(rect().height).toBe(before.height); + }); + + it('keeps the right edge when the left handle grows past the stylesheet max-width', () => { + const before = rect(); + dragBy(byTestId('resize-left'), -5000, 0); + + expect(rect().left).toBe(8); + expect(rect().right).toBe(before.right); + }); + }); + + describe('geometry', () => { + it('is restored when the pane is replaced', async () => { + dragBy(byTestId('header'), -20, 30); + dragBy(byTestId('resize-bottom-right'), -10, 10); + const geometry = rect(); + + wrapper()!.remove(); + await ctx.mount(HTML); + + expect(rect()).toEqual(geometry); + }); + + it('is brought back into the viewport when restored', async () => { + dragBy(byTestId('header'), -20, 30); + pane().style.left = '5000px'; + + wrapper()!.remove(); + await ctx.mount(HTML); + + expect(rect().right).toBe(window.innerWidth - 8); + }); + + it('is brought back into the viewport when the window resizes', () => { + dragBy(byTestId('header'), -20, 30); + pane().style.left = '5000px'; + + fireEvent.resize(window); + + expect(rect().right).toBe(window.innerWidth - 8); + }); + }); + + describe('closing', () => { + it('submits the close form on Escape when it exists', () => { + ctx.appendHTML(`
`); + const form = document.getElementById(CLOSE_FORM_ID) as HTMLFormElement; + const submit = vi.spyOn(form, 'requestSubmit').mockImplementation(() => undefined); + + pressEscape(); + + expect(submit).toHaveBeenCalled(); + expect(pane()).toBeInTheDocument(); + }); + + it('removes the pane on Escape without a close form', () => { + const removedPane = pane(); + pressEscape(); + + expect(removedPane).not.toBeInTheDocument(); + }); + + it('removes the pane with the header close button', () => { + const removedPane = pane(); + fireEvent.click(closeButton()); + + expect(removedPane).not.toBeInTheDocument(); + }); + }); +}); diff --git a/frontend/src/stimulus/controllers/dynamic/ai-text-transform-pane.controller.ts b/frontend/src/stimulus/controllers/dynamic/ai-text-transform-pane.controller.ts new file mode 100644 index 000000000000..d33f185353dc --- /dev/null +++ b/frontend/src/stimulus/controllers/dynamic/ai-text-transform-pane.controller.ts @@ -0,0 +1,195 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// See COPYRIGHT and LICENSE files for more details. +//++ + +import { Controller } from '@hotwired/stimulus'; +import { closestDragBlockingElement } from 'core-stimulus/helpers/interactive-element-helper'; + +const EDGE_MARGIN = 8; +const MIN_WIDTH = 320; +const MIN_HEIGHT = 240; +const GEOMETRY_PROPERTIES = ['left', 'top', 'right', 'bottom', 'width', 'height', 'maxWidth', 'maxHeight'] as const; + +type Geometry = Partial>; + +interface ResizeStart { + x:number; + y:number; + left:number; + top:number; + width:number; + height:number; + edge:string; +} + +// A new run replaces the whole pane element, so the place the user moved it to outlives the controller. +let rememberedGeometry:Geometry|null = null; + +const clamp = (value:number, min:number, max:number) => Math.min(Math.max(min, value), max); + +export default class AiTextTransformPaneController extends Controller { + static targets = ['pane']; + + static values = { + closeForm: String, + }; + + declare readonly paneTarget:HTMLElement; + declare readonly closeFormValue:string; + + private dragOffset:{ x:number; y:number }|null = null; + private resizeStart:ResizeStart|null = null; + private pointerListeners:AbortController|null = null; + + connect():void { + if (rememberedGeometry) { + Object.assign(this.paneTarget.style, rememberedGeometry); + this.keepInViewport(); + } + this.paneTarget.focus({ preventScroll: true }); + } + + disconnect():void { + this.endPointerAction(); + rememberedGeometry = this.pinned ? this.geometry() : null; + } + + beginDrag(event:PointerEvent):void { + if (event.button !== 0 || closestDragBlockingElement(event.target as Element, event.currentTarget as Element)) { + return; + } + + const rect = this.paneTarget.getBoundingClientRect(); + this.dragOffset = { x: event.clientX - rect.left, y: event.clientY - rect.top }; + this.listen((move) => this.drag(move)); + event.preventDefault(); + } + + // Resizing pins the pane to explicit coordinates first, so a right or bottom handle + // grows it in place and a left handle moves the left edge only. + beginResize(event:PointerEvent):void { + if (event.button !== 0) { + return; + } + + const rect = this.paneTarget.getBoundingClientRect(); + this.resizeStart = { + x: event.clientX, + y: event.clientY, + left: rect.left, + top: rect.top, + width: rect.width, + height: rect.height, + edge: (event.currentTarget as HTMLElement).dataset.edge ?? 'bottom-right', + }; + this.pin(rect.left, rect.top); + this.listen((move) => this.resize(move)); + event.preventDefault(); + } + + keepInViewport():void { + if (this.pinned) { + const rect = this.paneTarget.getBoundingClientRect(); + this.pinInViewport(rect.left, rect.top); + } + } + + close():void { + const form = document.getElementById(this.closeFormValue); + if (form instanceof HTMLFormElement) { + form.requestSubmit(); + } else { + this.element.remove(); + } + } + + private get pinned():boolean { + return this.paneTarget.style.left !== ''; + } + + private drag(event:PointerEvent):void { + if (this.dragOffset) { + this.pinInViewport(event.clientX - this.dragOffset.x, event.clientY - this.dragOffset.y); + } + } + + private resize(event:PointerEvent):void { + if (!this.resizeStart) { + return; + } + + const { x, y, left, top, width, height, edge } = this.resizeStart; + const { style } = this.paneTarget; + style.maxWidth = 'none'; + + if (edge.endsWith('left')) { + const newWidth = clamp(width - (event.clientX - x), MIN_WIDTH, left + width - EDGE_MARGIN); + this.pin(left + width - newWidth, top); + style.width = `${newWidth}px`; + } else { + style.width = `${clamp(width + (event.clientX - x), MIN_WIDTH, window.innerWidth - left - EDGE_MARGIN)}px`; + } + + if (edge.startsWith('bottom')) { + style.height = `${clamp(height + (event.clientY - y), MIN_HEIGHT, window.innerHeight - top - EDGE_MARGIN)}px`; + style.maxHeight = 'none'; + } + } + + private pinInViewport(left:number, top:number):void { + const { width, height } = this.paneTarget.getBoundingClientRect(); + const maxLeft = Math.max(EDGE_MARGIN, window.innerWidth - width - EDGE_MARGIN); + const maxTop = Math.max(EDGE_MARGIN, window.innerHeight - height - EDGE_MARGIN); + + this.pin(clamp(left, EDGE_MARGIN, maxLeft), clamp(top, EDGE_MARGIN, maxTop)); + } + + private pin(left:number, top:number):void { + Object.assign(this.paneTarget.style, { left: `${left}px`, top: `${top}px`, right: 'auto', bottom: 'auto' }); + } + + private geometry():Geometry { + const { style } = this.paneTarget; + return Object.fromEntries(GEOMETRY_PROPERTIES.map((property) => [property, style[property]])); + } + + private listen(onMove:(event:PointerEvent) => void):void { + this.pointerListeners = new AbortController(); + const { signal } = this.pointerListeners; + const end = () => this.endPointerAction(); + + window.addEventListener('pointermove', onMove, { signal }); + window.addEventListener('pointerup', end, { signal }); + window.addEventListener('pointercancel', end, { signal }); + } + + private endPointerAction():void { + this.pointerListeners?.abort(); + this.pointerListeners = null; + this.dragOffset = null; + this.resizeStart = null; + } +} diff --git a/frontend/src/stimulus/controllers/dynamic/ai-text-transform-sandbox.controller.ts b/frontend/src/stimulus/controllers/dynamic/ai-text-transform-sandbox.controller.ts new file mode 100644 index 000000000000..9a09aaa4d656 --- /dev/null +++ b/frontend/src/stimulus/controllers/dynamic/ai-text-transform-sandbox.controller.ts @@ -0,0 +1,264 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// See COPYRIGHT and LICENSE files for more details. +//++ + +import { Controller } from '@hotwired/stimulus'; +import { + AI_TEXT_TRANSFORM_TERMINAL_STATUSES, + AiTextTransformRun, + AiTextTransformRunClient, + AiTextTransformRunEvent, +} from 'core-stimulus/helpers/ai-text-transform-run'; + +const TIMER_TICK = 100; +const LABEL_SCHEMES:Record = { + idle: 'Label--secondary', + creating: 'Label--secondary', + queued: 'Label--secondary', + running: 'Label--accent', + succeeded: 'Label--success', + failed: 'Label--danger', + cancelled: 'Label--attention', + error: 'Label--danger', +}; + +/** + * Prototype sandbox for the description assistant: posts the textarea content + * against the execute API and shows the run as the shared run client polls it. + */ +export default class AiTextTransformSandboxController extends Controller { + static targets = [ + 'content', 'contextMode', 'typeId', + 'execute', 'cancel', 'spinner', 'status', 'timer', 'output', + 'runMeta', 'systemPrompt', 'eventsBody', + ]; + + static values = { url: String, actionId: Number }; + + declare readonly contentTarget:HTMLTextAreaElement; + declare readonly contextModeTarget:HTMLSelectElement; + declare readonly typeIdTarget:HTMLSelectElement; + declare readonly executeTarget:HTMLButtonElement; + declare readonly cancelTarget:HTMLButtonElement; + declare readonly spinnerTarget:HTMLElement; + declare readonly statusTarget:HTMLElement; + declare readonly timerTarget:HTMLElement; + declare readonly outputTarget:HTMLElement; + declare readonly runMetaTarget:HTMLElement; + declare readonly systemPromptTarget:HTMLElement; + declare readonly eventsBodyTarget:HTMLElement; + declare readonly urlValue:string; + declare readonly actionIdValue:number; + + private client:AiTextTransformRunClient|null = null; + private runId:string|null = null; + private tickTimer:ReturnType|null = null; + private startedAt = 0; + private finishedAt:number|null = null; + private text = ''; + + disconnect():void { + this.client?.dispose(); + this.stopTimer(); + } + + submit(event:Event):void { + event.preventDefault(); + void this.execute(); + } + + async execute():Promise { + this.reset(); + this.setStatus('creating'); + this.startTimer(); + + this.client = new AiTextTransformRunClient(this.urlValue, { + onRun: (run) => this.apply(run), + onRequestFailed: (status, body) => this.requestFailed(status, body), + }); + await this.client.start(this.body()); + } + + async cancel():Promise { + this.cancelTarget.disabled = true; + await this.client?.cancel(); + } + + private body() { + const body:Record = { + actionId: this.actionIdValue, + content: this.contentTarget.value, + }; + + switch (this.contextModeTarget.value) { + case 'work_package': + if (this.hiddenValue('work_package_id')) { + body.workPackageId = Number(this.hiddenValue('work_package_id')); + } + break; + case 'new_work_package': + if (this.hiddenValue('project_id') || this.typeIdTarget.value) { + body.projectId = Number(this.hiddenValue('project_id')); + body.typeId = Number(this.typeIdTarget.value); + } + break; + default: + break; + } + return body; + } + + private hiddenValue(name:string):string { + const input = this.element.querySelector(`input[type="hidden"][name="${name}"]`); + return input?.value ?? ''; + } + + private requestFailed(status:number, body:string):void { + this.setStatus('error'); + this.outputTarget.textContent = `HTTP ${status}\n\n${body}`; + this.finish(); + } + + private apply(run:AiTextTransformRun):void { + if (this.runId === null) { + this.runId = run.id; + this.cancelTarget.disabled = run._links.cancel === undefined; + this.systemPromptTarget.textContent = run.systemPrompt ?? ''; + } + + this.setStatus(run.status); + run.events.forEach((event) => { + this.appendEventRow(event); + switch (event.kind) { + case 'text_delta': + this.text += event.payload.delta ?? ''; + this.outputTarget.textContent = this.text; + break; + case 'completed': + this.text = event.payload.text ?? ''; + this.outputTarget.textContent = this.text; + break; + case 'error': + this.outputTarget.textContent = `${this.text}\n\n[${event.payload.reason ?? 'error'}] ${event.payload.message ?? ''}`; + break; + default: + break; + } + }); + + if (AI_TEXT_TRANSFORM_TERMINAL_STATUSES.includes(run.status)) { + this.finish(); + } + this.renderRunMeta(run.status); + } + + private finish():void { + this.stopTimer(); + this.finishedAt ??= performance.now(); + this.renderTimer(); + this.cancelTarget.disabled = true; + this.executeTarget.disabled = false; + this.spinnerTarget.hidden = true; + } + + private reset():void { + this.client?.dispose(); + this.client = null; + this.stopTimer(); + this.runId = null; + this.text = ''; + this.finishedAt = null; + this.outputTarget.textContent = ''; + this.systemPromptTarget.textContent = ''; + this.runMetaTarget.textContent = ''; + this.eventsBodyTarget.textContent = ''; + this.timerTarget.textContent = ''; + this.executeTarget.disabled = true; + this.cancelTarget.disabled = true; + this.spinnerTarget.hidden = false; + } + + private startTimer():void { + this.startedAt = performance.now(); + this.tickTimer = setInterval(() => this.renderTimer(), TIMER_TICK); + this.renderTimer(); + } + + private stopTimer():void { + if (this.tickTimer !== null) { + clearInterval(this.tickTimer); + this.tickTimer = null; + } + } + + private renderTimer():void { + const end = this.finishedAt ?? performance.now(); + const seconds = ((end - this.startedAt) / 1000).toFixed(1); + this.timerTarget.textContent = this.finishedAt === null ? `${seconds} s` : `${seconds} s total`; + } + + private setStatus(status:string):void { + this.statusTarget.textContent = status; + Object.values(LABEL_SCHEMES).forEach((cls) => this.statusTarget.classList.remove(cls)); + this.statusTarget.classList.add(LABEL_SCHEMES[status] ?? 'Label--secondary'); + } + + private renderRunMeta(status:string):void { + const rows:[string, string][] = [ + ['Run', this.runId ?? ''], + ['Status', status], + ['Events', String(this.client?.highestSeq ?? 0)], + ['Elapsed', this.timerTarget.textContent ?? ''], + ]; + this.runMetaTarget.textContent = ''; + rows.forEach(([term, value]) => { + const dt = document.createElement('dt'); + dt.textContent = term; + dt.className = 'text-bold'; + const dd = document.createElement('dd'); + dd.textContent = value; + dd.className = 'mb-2'; + this.runMetaTarget.append(dt, dd); + }); + } + + private appendEventRow(event:AiTextTransformRunEvent):void { + const row = document.createElement('tr'); + const cells = [ + String(event.seq), + event.kind, + JSON.stringify(event.payload), + new Date().toISOString().slice(11, 23), + ]; + cells.forEach((value, index) => { + const cell = document.createElement('td'); + cell.textContent = value; + cell.className = index === 2 ? 'p-2 border-bottom wb-break-all' : 'p-2 border-bottom no-wrap'; + row.append(cell); + }); + this.eventsBodyTarget.append(row); + } +} diff --git a/frontend/src/stimulus/helpers/ai-text-transform-run.ts b/frontend/src/stimulus/helpers/ai-text-transform-run.ts new file mode 100644 index 000000000000..788ea227c710 --- /dev/null +++ b/frontend/src/stimulus/helpers/ai-text-transform-run.ts @@ -0,0 +1,187 @@ +//-- copyright +// OpenProject is an open source project management software. +// Copyright (C) the OpenProject GmbH +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License version 3. +// +// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: +// Copyright (C) 2006-2013 Jean-Philippe Lang +// Copyright (C) 2010-2013 the ChiliProject Team +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// See COPYRIGHT and LICENSE files for more details. +//++ + +export interface AiTextTransformRunEvent { + seq:number; + kind:'status'|'text_delta'|'completed'|'error'; + payload:{ status?:string; delta?:string; text?:string; message?:string; reason?:string }; +} + +export interface AiTextTransformRun { + id:string; + status:string; + systemPrompt?:string; + events:AiTextTransformRunEvent[]; + _links:{ self:{ href:string }; cancel?:{ href:string } }; +} + +export interface AiTextTransformRunCallbacks { + // Called for the create response and for every poll that was not superseded. + onRun:(run:AiTextTransformRun) => void; + // Called when creating or polling fails on the HTTP level. The client stops afterwards. + onRequestFailed:(status:number, body:string) => void; +} + +export const AI_TEXT_TRANSFORM_TERMINAL_STATUSES = ['succeeded', 'failed', 'cancelled']; + +const MIN_DELAY = 400; +const MAX_DELAY = 1000; +const DELAY_STEP = 150; + +/** + * Client for one AI text transform run (API v3, AI-136): creates the run and polls its + * event log with a cursor. Polling backs off from 400 ms to 1 s, keeps one request in + * flight, ignores responses for an outdated cursor, pauses while the tab is hidden and + * never resumes after a terminal status. + */ +export class AiTextTransformRunClient { + private runUrl:string|null = null; + private cancelUrl:string|null = null; + private cursor = 0; + private delay = MIN_DELAY; + private pollTimer:ReturnType|null = null; + private inFlight = false; + private finished = false; + private readonly onVisibilityChange = () => { this.handleVisibilityChange(); }; + + constructor( + private readonly createUrl:string, + private readonly callbacks:AiTextTransformRunCallbacks, + ) { + document.addEventListener('visibilitychange', this.onVisibilityChange); + } + + get running():boolean { + return this.runUrl !== null && !this.finished; + } + + get highestSeq():number { + return this.cursor; + } + + async start(body:Record):Promise { + const response = await this.request(this.createUrl, 'POST', JSON.stringify(body)); + if (!response.ok) { + this.finished = true; + this.callbacks.onRequestFailed(response.status, await response.text()); + return; + } + + const run = await response.json() as AiTextTransformRun; + this.runUrl = run._links.self.href; + this.cancelUrl = run._links.cancel?.href ?? null; + this.apply(run); + } + + async cancel():Promise { + if (this.cancelUrl && !this.finished) { + await this.request(this.cancelUrl, 'POST'); + } + } + + dispose():void { + document.removeEventListener('visibilitychange', this.onVisibilityChange); + this.finished = true; + this.clearTimer(); + } + + private apply(run:AiTextTransformRun):void { + run.events.forEach((event) => { this.cursor = Math.max(this.cursor, event.seq); }); + if (AI_TEXT_TRANSFORM_TERMINAL_STATUSES.includes(run.status)) { + this.finished = true; + this.clearTimer(); + } + + this.callbacks.onRun(run); + + if (!this.finished) { + this.schedule(); + } + } + + private schedule():void { + this.clearTimer(); + this.pollTimer = setTimeout(() => { void this.poll(); }, this.delay); + this.delay = Math.min(MAX_DELAY, this.delay + DELAY_STEP); + } + + private async poll():Promise { + this.pollTimer = null; + if (!this.runUrl || this.inFlight || this.finished) { + return; + } + if (document.hidden) { + return; + } + + this.inFlight = true; + const requestedCursor = this.cursor; + try { + const response = await this.request(`${this.runUrl}?after=${requestedCursor}`, 'GET'); + if (this.finished) { + return; + } + if (!response.ok) { + this.finished = true; + this.callbacks.onRequestFailed(response.status, await response.text()); + return; + } + if (requestedCursor !== this.cursor) { + return; + } + this.apply(await response.json() as AiTextTransformRun); + } finally { + this.inFlight = false; + } + } + + private handleVisibilityChange():void { + if (!document.hidden && this.running && this.pollTimer === null && !this.inFlight) { + this.schedule(); + } + } + + private clearTimer():void { + if (this.pollTimer !== null) { + clearTimeout(this.pollTimer); + this.pollTimer = null; + } + } + + private request(url:string, method:'GET'|'POST', body?:string):Promise { + return fetch(url, { + method, + body, + credentials: 'same-origin', + headers: { + Accept: 'application/hal+json', + 'Content-Type': 'application/json', + 'X-Requested-With': 'XMLHttpRequest', + }, + }); + } +} diff --git a/frontend/src/vendor/ckeditor/ckeditor.js b/frontend/src/vendor/ckeditor/ckeditor.js index 2cf5122a2fd9..21cbd792d3d3 100644 --- a/frontend/src/vendor/ckeditor/ckeditor.js +++ b/frontend/src/vendor/ckeditor/ckeditor.js @@ -2,7 +2,7 @@ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. */ -var xk=Object.create;var ou=Object.defineProperty;var Tk=Object.getOwnPropertyDescriptor;var Ek=Object.getOwnPropertyNames;var Ak=Object.getPrototypeOf,Ik=Object.prototype.hasOwnProperty;var Wm=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(i){throw t=0,i}},ya=(e,t)=>{for(var i in t)ou(e,i,{get:t[i],enumerable:!0})},Sk=(e,t,i,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ek(t))!Ik.call(e,n)&&n!==i&&ou(e,n,{get:()=>t[n],enumerable:!(o=Tk(t,n))||o.enumerable});return e};var Um=(e,t,i)=>(i=e!=null?xk(Ak(e)):{},Sk(t||!e||!e.__esModule?ou(i,"default",{value:e,enumerable:!0}):i,e));var jv=Wm((Ene,$v)=>{var Sm=!0,Uv=!1,qv=!1;$v.exports=function(e,t){t&&(Sm=!t.enabled,Uv=!!t.label,qv=!!t.labelAfter),e.core.ruler.after("inline","github-task-lists",function(i){for(var o=i.tokens,n=2;n=0;o--)if(e[o].level===i)return o;return-1}function LO(e,t){return NO(e[t])&&zO(e[t-1])&&HO(e[t-2])&&WO(e[t])}function MO(e,t){if(e.children.unshift(BO(e,t)),e.children[1].content=e.children[1].content.slice(3),e.content=e.content.slice(3),Uv)if(qv){e.children.pop();var i="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);e.children[0].content=e.children[0].content.slice(0,-1)+' id="'+i+'">',e.children.push(FO(e.content,i,t))}else e.children.unshift(OO(t)),e.children.push(DO(t))}function BO(e,t){var i=new t("html_inline","",0),o=Sm?' disabled="" ':"";return e.content.indexOf("[ ] ")===0?i.content='':(e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0)&&(i.content=''),i}function OO(e){var t=new e("html_inline","",0);return t.content="",t}function FO(e,t,i){var o=new i("html_inline","",0);return o.content='",o.attrs=[{for:t}],o}function NO(e){return e.type==="inline"}function zO(e){return e.type==="paragraph_open"}function HO(e){return e.type==="list_item_open"}function WO(e){return e.content.indexOf("[ ] ")===0||e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0}});var ck=Wm((Wse,Qc)=>{var Lm=(function(){var e=String.fromCharCode,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",o={};function n(r,a){if(!o[r]){o[r]={};for(var l=0;l>>8,l[c*2+1]=d%256}return l},decompressFromUint8Array:function(r){if(r==null)return s.decompress(r);for(var a=new Array(r.length/2),l=0,c=a.length;l>1}else{for(u=1,c=0;c>1}b--,b==0&&(b=Math.pow(2,v),v++),delete h[g]}else for(u=d[g],c=0;c>1;b--,b==0&&(b=Math.pow(2,v),v++),d[m]=k++,g=String(f)}if(g!==""){if(Object.prototype.hasOwnProperty.call(h,g)){if(g.charCodeAt(0)<256){for(c=0;c>1}else{for(u=1,c=0;c>1}b--,b==0&&(b=Math.pow(2,v),v++),delete h[g]}else for(u=d[g],c=0;c>1;b--,b==0&&(b=Math.pow(2,v),v++)}for(u=2,c=0;c>1;for(;;)if(C=C<<1,w==a-1){_.push(l(C));break}else w++;return _.join("")},decompress:function(r){return r==null?"":r==""?null:s._decompress(r.length,32768,function(a){return r.charCodeAt(a)})},_decompress:function(r,a,l){var c=[],u,d=4,h=4,f=3,m="",g=[],b,k,v,_,C,w,E,x={val:l(0),position:a,index:1};for(b=0;b<3;b+=1)c[b]=b;for(v=0,C=Math.pow(2,2),w=1;w!=C;)_=x.val&x.position,x.position>>=1,x.position==0&&(x.position=a,x.val=l(x.index++)),v|=(_>0?1:0)*w,w<<=1;switch(u=v){case 0:for(v=0,C=Math.pow(2,8),w=1;w!=C;)_=x.val&x.position,x.position>>=1,x.position==0&&(x.position=a,x.val=l(x.index++)),v|=(_>0?1:0)*w,w<<=1;E=e(v);break;case 1:for(v=0,C=Math.pow(2,16),w=1;w!=C;)_=x.val&x.position,x.position>>=1,x.position==0&&(x.position=a,x.val=l(x.index++)),v|=(_>0?1:0)*w,w<<=1;E=e(v);break;case 2:return""}for(c[3]=E,k=E,g.push(E);;){if(x.index>r)return"";for(v=0,C=Math.pow(2,f),w=1;w!=C;)_=x.val&x.position,x.position>>=1,x.position==0&&(x.position=a,x.val=l(x.index++)),v|=(_>0?1:0)*w,w<<=1;switch(E=v){case 0:for(v=0,C=Math.pow(2,8),w=1;w!=C;)_=x.val&x.position,x.position>>=1,x.position==0&&(x.position=a,x.val=l(x.index++)),v|=(_>0?1:0)*w,w<<=1;c[h++]=e(v),E=h-1,d--;break;case 1:for(v=0,C=Math.pow(2,16),w=1;w!=C;)_=x.val&x.position,x.position>>=1,x.position==0&&(x.position=a,x.val=l(x.index++)),v|=(_>0?1:0)*w,w<<=1;c[h++]=e(v),E=h-1,d--;break;case 2:return g.join("")}if(d==0&&(d=Math.pow(2,f),f++),c[E])m=c[E];else if(E===h)m=k+k.charAt(0);else return null;g.push(m),c[h++]=k+m.charAt(0),d--,k=m,d==0&&(d=Math.pow(2,f),f++)}}};return s})();typeof define=="function"&&define.amd?define(function(){return Lm}):typeof Qc<"u"&&Qc!=null?Qc.exports=Lm:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return Lm})});function qm(e){return Array.isArray(e)}function Ee(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!=="[object Object]"){let i=e[Symbol.toStringTag];return i==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${i}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Ft(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function _a(){}function ao(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Xe(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var Zo="[object RegExp]",Ri="[object String]",Vi="[object Number]",Li="[object Boolean]",Qo="[object Arguments]",Yo="[object Symbol]",Xo="[object Date]",en="[object Map]",tn="[object Set]",on="[object Array]",$m="[object Function]",nn="[object ArrayBuffer]",Mi="[object Object]",jm="[object Error]",sn="[object DataView]",rn="[object Uint8Array]",an="[object Uint8ClampedArray]",ln="[object Uint16Array]",cn="[object Uint32Array]",Km="[object BigUint64Array]",un="[object Int8Array]",dn="[object Int16Array]",hn="[object Int32Array]",Gm="[object BigInt64Array]",fn="[object Float32Array]",mn="[object Float64Array]";var nu=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function At(e){return typeof nu.Buffer<"u"&&nu.Buffer.isBuffer(e)}function su(e){if(!e||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)==="[object Object]":!1}function va(e,t,i){return Cs(e,t,void 0,void 0,void 0,void 0,i)}function Cs(e,t,i,o,n,s,r){let a=r(e,t,i,o,n,s);if(a!==void 0)return a;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return e===t;case"number":return e===t||Object.is(e,t);case"function":return e===t;case"object":return xs(e,t,s,r)}return xs(e,t,s,r)}function xs(e,t,i,o){if(Object.is(e,t))return!0;let n=Xe(e),s=Xe(t);if(n==="[object Arguments]"&&(n=Mi),s==="[object Arguments]"&&(s=Mi),n!==s)return!1;switch(n){case Ri:return e.toString()===t.toString();case Vi:return Ft(e.valueOf(),t.valueOf());case Li:case Xo:case Yo:return Object.is(e.valueOf(),t.valueOf());case Zo:return e.source===t.source&&e.flags===t.flags;case $m:return e===t}i=i??new Map;let r=i.get(e),a=i.get(t);if(r!=null&&a!=null)return r===t;i.set(e,t),i.set(t,e);try{switch(n){case en:if(e.size!==t.size)return!1;for(let[l,c]of e.entries())if(!t.has(l)||!Cs(c,t.get(l),l,e,t,i,o))return!1;return!0;case tn:{if(e.size!==t.size)return!1;let l=Array.from(e.values()),c=Array.from(t.values());for(let u=0;uCs(d,f,void 0,e,t,i,o));if(h===-1)return!1;c.splice(h,1)}return!0}case on:case rn:case an:case ln:case cn:case Km:case un:case dn:case hn:case Gm:case fn:case mn:if(At(e)!==At(t)||e.length!==t.length)return!1;for(let l=0;l=0}function gn(e){return e!=null&&typeof e!="function"&&Jm(e.length)}function pn(e){return typeof e=="symbol"||e instanceof Symbol}function ka(e){return e==null?"":Zm(e)}function Zm(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(Zm).join(",");if(pn(e))return e.toString();let t=e+"";return t==="0"&&Object.is(Number(e),-0)?"-0":t}function Nt(e){return typeof e=="string"||typeof e=="symbol"?e:Object.is(e?.valueOf?.(),-0)?"-0":String(e)}function bn(e){if(Array.isArray(e))return e.map(Nt);if(typeof e=="symbol")return[e];e=ka(e);let t=[],i=e.length;if(i===0)return t;let o=0,n="",s="",r=!1,a=!1,l=/^-?\d+(?:\.\d+)?$/;for(e.charCodeAt(0)===46&&t.push("");o{}):ru(e,t,function o(n,s,r,a,l,c){let u=i(n,s,r,a,l,c);return u!==void 0?!!u:ru(n,s,o,c,!1)},new Map,!0)}function ru(e,t,i,o,n=!1){if(t===e)return!0;switch(typeof t){case"object":return Vk(e,t,i,o,n);case"function":return Object.keys(t).length>0?ru(e,{...t},i,o,n):Ft(e,t);default:return ae(e)?n?typeof t=="string"?t==="":!0:Ft(e,t):Ft(e,t)}}function Vk(e,t,i,o,n=!1){if(t==null)return!0;if(Array.isArray(t))return Ym(e,t,i,o);if(t instanceof Map)return Lk(e,t,i,o);if(t instanceof Set)return Mk(e,t,i,o);let s=Object.keys(t);if(e==null)return n&&s.length===0;if(n)zt(e)&&(e=Object(e));else{let r=Xe(e);if(r!=="[object Object]"&&r!=="[object Arguments]")return!1}if(s.length===0)return!0;if(o?.has(t))return o.get(t)===e;o?.set(t,e);try{for(let r=0;r{})}function yn(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Xm(e,t){return Oi(e,void 0,e,new Map,t)}function Oi(e,t,i,o=new Map,n=void 0){let s=n?.(e,t,i,o);if(s!==void 0)return s;if(zt(e))return e;if(o.has(e))return o.get(e);if(Array.isArray(e)){let r=new Array(e.length);o.set(e,r);for(let a=0;axa(t,e)}function lo(e,t){return Xm(e,(i,o,n,s)=>{let r=t?.(i,o,n,s);if(r!==void 0)return r;if(typeof e=="object"){if(Xe(e)==="[object Object]"&&typeof e.constructor!="function"){let a={};return s.set(e,a),gt(a,e,n,s),a}switch(Object.prototype.toString.call(e)){case Vi:case Ri:case Li:{let a=new e.constructor(e?.valueOf());return gt(a,e),a}case Qo:{let a={};return gt(a,e),a.length=e.length,a[Symbol.iterator]=e[Symbol.iterator],a}default:return}}})}function Ae(e){return lo(e)}function co(e){return e!==null&&typeof e=="object"&&Xe(e)==="[object Arguments]"}var Ok=/^(?:0|[1-9]\d*)$/;function Ta(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e{let o=e[t];(!(Object.hasOwn(e,t)&&Ft(o,i))||i===void 0&&!(t in e))&&(e[t]=i)};function h0(e){return e==="__proto__"||e==="constructor"||e==="prototype"}function f0(e,t,i,o){if(e==null&&!ae(e))return e;let n;c0(t,e)?n=[t]:Array.isArray(t)?n=t:n=bn(t);let s=i(Ge(e,n)),r=e;for(let a=0;ai,()=>{})}function m0(e,t,{signal:i,edges:o}={}){let n,s=null,r=o!=null&&o.includes("leading"),a=o==null||o.includes("trailing"),l=()=>{s!==null&&(e.apply(n,s),n=void 0,s=null)},c=()=>{a&&l(),f()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,c()},t)},h=()=>{u!==null&&(clearTimeout(u),u=null)},f=()=>{h(),n=void 0,s=null},m=()=>{l()},g=function(...b){if(i?.aborted)return;n=this,s=b;let k=u==null;d(),r&&k&&l()};return g.schedule=d,g.cancel=f,g.flush=m,i?.addEventListener("abort",f,{once:!0}),g}function ye(e,t=0,i={}){typeof i!="object"&&(i={});let{leading:o=!1,trailing:n=!0,maxWait:s}=i,r=Array(2);o&&(r[0]="leading"),n&&(r[1]="trailing");let a,l=null,c=m0(function(...h){a=e.apply(this,h),l=null},t,{edges:r}),u=function(...h){return s!=null&&(l===null&&(l=Date.now()),Date.now()-l>=s)?((o||n)&&(a=e.apply(this,h)),l=Date.now(),c.cancel(),c.schedule(),a):(c.apply(this,h),a)},d=()=>(c.flush(),a);return u.cancel=c.cancel,u.flush=d,u}function ai(e,t=0,i={}){let{leading:o=!0,trailing:n=!0}=i;return ye(e,t,{leading:o,maxWait:t,trailing:n})}function g0(e){if(e==null)return[];switch(typeof e){case"object":case"function":return gn(e)?zk(e):Ia(e)?Nk(e):Sa(e);default:return Sa(Object(e))}}function Sa(e){let t=[];for(let i in e)t.push(i);return t}function Nk(e){return Sa(e).filter(t=>t!=="constructor")}function zk(e){let t=u0(e.length,n=>`${n}`),i=new Set(t);At(e)&&(i.add("offset"),i.add("parent")),Ht(e)&&(i.add("buffer"),i.add("byteLength"),i.add("byteOffset"));let o=Sa(e).filter(n=>!i.has(n));return Array.isArray(e)?[...t,...o]:[...t.filter(n=>Object.hasOwn(e,n)),...o]}function Es(e,...t){for(let i=0;i0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(o.index=e.index,o.input=e.input),o}if(Ht(e)){let o=e,n=o.constructor;return new n(o.buffer,o.byteOffset,o.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){let o=e,n=o.buffer,s=o.byteOffset,r=o.byteLength,a=new ArrayBuffer(r),l=new Uint8Array(n,s,r);return new Uint8Array(a).set(l),new DataView(a)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){let o=e.constructor,n=new o(e.valueOf());return t==="[object String]"?qk(n,e):lu(n,e),n}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){let o=e,n=new RegExp(o.source,o.flags);return n.lastIndex=o.lastIndex,n}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){let o=e,n=new Map;return o.forEach((s,r)=>{n.set(r,s)}),n}if(t==="[object Set]"){let o=e,n=new Set;return o.forEach(s=>{n.add(s)}),n}if(t==="[object Arguments]"){let o=e,n={};return lu(n,o),n.length=o.length,n[Symbol.iterator]=o[Symbol.iterator],n}let i={};return $k(i,e),lu(i,e),Uk(i,e),i}function Wk(e){switch(Xe(e)){case Qo:case on:case nn:case sn:case Li:case Xo:case fn:case mn:case un:case dn:case hn:case en:case Vi:case Mi:case Zo:case tn:case Ri:case Yo:case rn:case an:case ln:case cn:return!0;default:return!1}}function lu(e,t){for(let i in t)Object.hasOwn(t,i)&&(e[i]=t[i])}function Uk(e,t){let i=Object.getOwnPropertySymbols(t);for(let o=0;o=i)&&(e[o]=t[o])}function $k(e,t){let i=Object.getPrototypeOf(t);i!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,i)}function p0(e,t){let i={},o=Object.keys(e);for(let n=0;ni!=="constructor").length===0:t.length===0}return!0}function hu(e,t){if(!Number.isInteger(e)||e<0)throw new Error("n must be a non-negative integer.");let i=0;return(...o)=>{if(++i>=e)return t(...o)}}function Is(e,t,i){return typeof i!="function"&&(i=()=>{}),va(e,t,(...o)=>{let n=i(...o);if(n!==void 0)return!!n;if(e instanceof Map&&t instanceof Map)return Is(Array.from(e),Array.from(t),hu(2,i));if(e instanceof Set&&t instanceof Set)return Is(Array.from(e),Array.from(t),hu(2,i))})}function y0(e){return e.substring(0,1).toUpperCase()+e.substring(1)}function fu(e){return y0(ka(e))}/** +var Ek=Object.create;var su=Object.defineProperty;var Ak=Object.getOwnPropertyDescriptor;var Ik=Object.getOwnPropertyNames;var Sk=Object.getPrototypeOf,Pk=Object.prototype.hasOwnProperty;var qm=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(i){throw t=0,i}},_a=(e,t)=>{for(var i in t)su(e,i,{get:t[i],enumerable:!0})},Rk=(e,t,i,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Ik(t))!Pk.call(e,n)&&n!==i&&su(e,n,{get:()=>t[n],enumerable:!(o=Ak(t,n))||o.enumerable});return e};var $m=(e,t,i)=>(i=e!=null?Ek(Sk(e)):{},Rk(t||!e||!e.__esModule?su(i,"default",{value:e,enumerable:!0}):i,e));var Gv=qm((Dne,Kv)=>{var Rm=!0,$v=!1,jv=!1;Kv.exports=function(e,t){t&&(Rm=!t.enabled,$v=!!t.label,jv=!!t.labelAfter),e.core.ruler.after("inline","github-task-lists",function(i){for(var o=i.tokens,n=2;n=0;o--)if(e[o].level===i)return o;return-1}function DO(e,t){return UO(e[t])&&qO(e[t-1])&&$O(e[t-2])&&jO(e[t])}function FO(e,t){if(e.children.unshift(NO(e,t)),e.children[1].content=e.children[1].content.slice(3),e.content=e.content.slice(3),$v)if(jv){e.children.pop();var i="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);e.children[0].content=e.children[0].content.slice(0,-1)+' id="'+i+'">',e.children.push(WO(e.content,i,t))}else e.children.unshift(zO(t)),e.children.push(HO(t))}function NO(e,t){var i=new t("html_inline","",0),o=Rm?' disabled="" ':"";return e.content.indexOf("[ ] ")===0?i.content='':(e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0)&&(i.content=''),i}function zO(e){var t=new e("html_inline","",0);return t.content="",t}function WO(e,t,i){var o=new i("html_inline","",0);return o.content='",o.attrs=[{for:t}],o}function UO(e){return e.type==="inline"}function qO(e){return e.type==="paragraph_open"}function $O(e){return e.type==="list_item_open"}function jO(e){return e.content.indexOf("[ ] ")===0||e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0}});var dk=qm((Xse,Xc)=>{var Bm=(function(){var e=String.fromCharCode,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",o={};function n(r,a){if(!o[r]){o[r]={};for(var l=0;l>>8,l[c*2+1]=d%256}return l},decompressFromUint8Array:function(r){if(r==null)return s.decompress(r);for(var a=new Array(r.length/2),l=0,c=a.length;l>1}else{for(u=1,c=0;c>1}b--,b==0&&(b=Math.pow(2,v),v++),delete h[g]}else for(u=d[g],c=0;c>1;b--,b==0&&(b=Math.pow(2,v),v++),d[m]=k++,g=String(f)}if(g!==""){if(Object.prototype.hasOwnProperty.call(h,g)){if(g.charCodeAt(0)<256){for(c=0;c>1}else{for(u=1,c=0;c>1}b--,b==0&&(b=Math.pow(2,v),v++),delete h[g]}else for(u=d[g],c=0;c>1;b--,b==0&&(b=Math.pow(2,v),v++)}for(u=2,c=0;c>1;for(;;)if(C=C<<1,y==a-1){_.push(l(C));break}else y++;return _.join("")},decompress:function(r){return r==null?"":r==""?null:s._decompress(r.length,32768,function(a){return r.charCodeAt(a)})},_decompress:function(r,a,l){var c=[],u,d=4,h=4,f=3,m="",g=[],b,k,v,_,C,y,E,x={val:l(0),position:a,index:1};for(b=0;b<3;b+=1)c[b]=b;for(v=0,C=Math.pow(2,2),y=1;y!=C;)_=x.val&x.position,x.position>>=1,x.position==0&&(x.position=a,x.val=l(x.index++)),v|=(_>0?1:0)*y,y<<=1;switch(u=v){case 0:for(v=0,C=Math.pow(2,8),y=1;y!=C;)_=x.val&x.position,x.position>>=1,x.position==0&&(x.position=a,x.val=l(x.index++)),v|=(_>0?1:0)*y,y<<=1;E=e(v);break;case 1:for(v=0,C=Math.pow(2,16),y=1;y!=C;)_=x.val&x.position,x.position>>=1,x.position==0&&(x.position=a,x.val=l(x.index++)),v|=(_>0?1:0)*y,y<<=1;E=e(v);break;case 2:return""}for(c[3]=E,k=E,g.push(E);;){if(x.index>r)return"";for(v=0,C=Math.pow(2,f),y=1;y!=C;)_=x.val&x.position,x.position>>=1,x.position==0&&(x.position=a,x.val=l(x.index++)),v|=(_>0?1:0)*y,y<<=1;switch(E=v){case 0:for(v=0,C=Math.pow(2,8),y=1;y!=C;)_=x.val&x.position,x.position>>=1,x.position==0&&(x.position=a,x.val=l(x.index++)),v|=(_>0?1:0)*y,y<<=1;c[h++]=e(v),E=h-1,d--;break;case 1:for(v=0,C=Math.pow(2,16),y=1;y!=C;)_=x.val&x.position,x.position>>=1,x.position==0&&(x.position=a,x.val=l(x.index++)),v|=(_>0?1:0)*y,y<<=1;c[h++]=e(v),E=h-1,d--;break;case 2:return g.join("")}if(d==0&&(d=Math.pow(2,f),f++),c[E])m=c[E];else if(E===h)m=k+k.charAt(0);else return null;g.push(m),c[h++]=k+m.charAt(0),d--,k=m,d==0&&(d=Math.pow(2,f),f++)}}};return s})();typeof define=="function"&&define.amd?define(function(){return Bm}):typeof Xc<"u"&&Xc!=null?Xc.exports=Bm:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return Bm})});function jm(e){return Array.isArray(e)}function Ie(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!=="[object Object]"){let i=e[Symbol.toStringTag];return i==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${i}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function zt(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function va(){}function lo(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Xe(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var Zo="[object RegExp]",Li="[object String]",Mi="[object Number]",Bi="[object Boolean]",Qo="[object Arguments]",Yo="[object Symbol]",Xo="[object Date]",en="[object Map]",tn="[object Set]",on="[object Array]",Km="[object Function]",nn="[object ArrayBuffer]",Oi="[object Object]",Gm="[object Error]",sn="[object DataView]",rn="[object Uint8Array]",an="[object Uint8ClampedArray]",ln="[object Uint16Array]",cn="[object Uint32Array]",Jm="[object BigUint64Array]",un="[object Int8Array]",dn="[object Int16Array]",hn="[object Int32Array]",Zm="[object BigInt64Array]",fn="[object Float32Array]",mn="[object Float64Array]";var ru=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function It(e){return typeof ru.Buffer<"u"&&ru.Buffer.isBuffer(e)}function au(e){if(!e||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)==="[object Object]":!1}function ka(e,t,i){return Cs(e,t,void 0,void 0,void 0,void 0,i)}function Cs(e,t,i,o,n,s,r){let a=r(e,t,i,o,n,s);if(a!==void 0)return a;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return e===t;case"number":return e===t||Object.is(e,t);case"function":return e===t;case"object":return xs(e,t,s,r)}return xs(e,t,s,r)}function xs(e,t,i,o){if(Object.is(e,t))return!0;let n=Xe(e),s=Xe(t);if(n==="[object Arguments]"&&(n=Oi),s==="[object Arguments]"&&(s=Oi),n!==s)return!1;switch(n){case Li:return e.toString()===t.toString();case Mi:return zt(e.valueOf(),t.valueOf());case Bi:case Xo:case Yo:return Object.is(e.valueOf(),t.valueOf());case Zo:return e.source===t.source&&e.flags===t.flags;case Km:return e===t}i=i??new Map;let r=i.get(e),a=i.get(t);if(r!=null&&a!=null)return r===t;i.set(e,t),i.set(t,e);try{switch(n){case en:if(e.size!==t.size)return!1;for(let[l,c]of e.entries())if(!t.has(l)||!Cs(c,t.get(l),l,e,t,i,o))return!1;return!0;case tn:{if(e.size!==t.size)return!1;let l=Array.from(e.values()),c=Array.from(t.values());for(let u=0;uCs(d,f,void 0,e,t,i,o));if(h===-1)return!1;c.splice(h,1)}return!0}case on:case rn:case an:case ln:case cn:case Jm:case un:case dn:case hn:case Zm:case fn:case mn:if(It(e)!==It(t)||e.length!==t.length)return!1;for(let l=0;l=0}function gn(e){return e!=null&&typeof e!="function"&&Qm(e.length)}function pn(e){return typeof e=="symbol"||e instanceof Symbol}function Ca(e){return e==null?"":Ym(e)}function Ym(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(Ym).join(",");if(pn(e))return e.toString();let t=e+"";return t==="0"&&Object.is(Number(e),-0)?"-0":t}function Ht(e){return typeof e=="string"||typeof e=="symbol"?e:Object.is(e?.valueOf?.(),-0)?"-0":String(e)}function bn(e){if(Array.isArray(e))return e.map(Ht);if(typeof e=="symbol")return[e];e=Ca(e);let t=[],i=e.length;if(i===0)return t;let o=0,n="",s="",r=!1,a=!1,l=/^-?\d+(?:\.\d+)?$/;for(e.charCodeAt(0)===46&&t.push("");o{}):lu(e,t,function o(n,s,r,a,l,c){let u=i(n,s,r,a,l,c);return u!==void 0?!!u:lu(n,s,o,c,!1)},new Map,!0)}function lu(e,t,i,o,n=!1){if(t===e)return!0;switch(typeof t){case"object":return Mk(e,t,i,o,n);case"function":return Object.keys(t).length>0?lu(e,{...t},i,o,n):zt(e,t);default:return ae(e)?n?typeof t=="string"?t==="":!0:zt(e,t):zt(e,t)}}function Mk(e,t,i,o,n=!1){if(t==null)return!0;if(Array.isArray(t))return e0(e,t,i,o);if(t instanceof Map)return Bk(e,t,i,o);if(t instanceof Set)return Ok(e,t,i,o);let s=Object.keys(t);if(e==null)return n&&s.length===0;if(n)Wt(e)&&(e=Object(e));else{let r=Xe(e);if(r!=="[object Object]"&&r!=="[object Arguments]")return!1}if(s.length===0)return!0;if(o?.has(t))return o.get(t)===e;o?.set(t,e);try{for(let r=0;r{})}function yn(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function t0(e,t){return Fi(e,void 0,e,new Map,t)}function Fi(e,t,i,o=new Map,n=void 0){let s=n?.(e,t,i,o);if(s!==void 0)return s;if(Wt(e))return e;if(o.has(e))return o.get(e);if(Array.isArray(e)){let r=new Array(e.length);o.set(e,r);for(let a=0;aTa(t,e)}function co(e,t){return t0(e,(i,o,n,s)=>{let r=t?.(i,o,n,s);if(r!==void 0)return r;if(typeof e=="object"){if(Xe(e)==="[object Object]"&&typeof e.constructor!="function"){let a={};return s.set(e,a),pt(a,e,n,s),a}switch(Object.prototype.toString.call(e)){case Mi:case Li:case Bi:{let a=new e.constructor(e?.valueOf());return pt(a,e),a}case Qo:{let a={};return pt(a,e),a.length=e.length,a[Symbol.iterator]=e[Symbol.iterator],a}default:return}}})}function Se(e){return co(e)}function uo(e){return e!==null&&typeof e=="object"&&Xe(e)==="[object Arguments]"}var Fk=/^(?:0|[1-9]\d*)$/;function Ea(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e{let o=e[t];(!(Object.hasOwn(e,t)&&zt(o,i))||i===void 0&&!(t in e))&&(e[t]=i)};function m0(e){return e==="__proto__"||e==="constructor"||e==="prototype"}function g0(e,t,i,o){if(e==null&&!ae(e))return e;let n;d0(t,e)?n=[t]:Array.isArray(t)?n=t:n=bn(t);let s=i(Ge(e,n)),r=e;for(let a=0;ai,()=>{})}function p0(e,t,{signal:i,edges:o}={}){let n,s=null,r=o!=null&&o.includes("leading"),a=o==null||o.includes("trailing"),l=()=>{s!==null&&(e.apply(n,s),n=void 0,s=null)},c=()=>{a&&l(),f()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,c()},t)},h=()=>{u!==null&&(clearTimeout(u),u=null)},f=()=>{h(),n=void 0,s=null},m=()=>{l()},g=function(...b){if(i?.aborted)return;n=this,s=b;let k=u==null;d(),r&&k&&l()};return g.schedule=d,g.cancel=f,g.flush=m,i?.addEventListener("abort",f,{once:!0}),g}function ve(e,t=0,i={}){typeof i!="object"&&(i={});let{leading:o=!1,trailing:n=!0,maxWait:s}=i,r=Array(2);o&&(r[0]="leading"),n&&(r[1]="trailing");let a,l=null,c=p0(function(...h){a=e.apply(this,h),l=null},t,{edges:r}),u=function(...h){return s!=null&&(l===null&&(l=Date.now()),Date.now()-l>=s)?((o||n)&&(a=e.apply(this,h)),l=Date.now(),c.cancel(),c.schedule(),a):(c.apply(this,h),a)},d=()=>(c.flush(),a);return u.cancel=c.cancel,u.flush=d,u}function ci(e,t=0,i={}){let{leading:o=!0,trailing:n=!0}=i;return ve(e,t,{leading:o,maxWait:t,trailing:n})}function b0(e){if(e==null)return[];switch(typeof e){case"object":case"function":return gn(e)?Wk(e):Sa(e)?Hk(e):Pa(e);default:return Pa(Object(e))}}function Pa(e){let t=[];for(let i in e)t.push(i);return t}function Hk(e){return Pa(e).filter(t=>t!=="constructor")}function Wk(e){let t=h0(e.length,n=>`${n}`),i=new Set(t);It(e)&&(i.add("offset"),i.add("parent")),Ut(e)&&(i.add("buffer"),i.add("byteLength"),i.add("byteOffset"));let o=Pa(e).filter(n=>!i.has(n));return Array.isArray(e)?[...t,...o]:[...t.filter(n=>Object.hasOwn(e,n)),...o]}function Es(e,...t){for(let i=0;i0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(o.index=e.index,o.input=e.input),o}if(Ut(e)){let o=e,n=o.constructor;return new n(o.buffer,o.byteOffset,o.length)}if(t==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(t==="[object DataView]"){let o=e,n=o.buffer,s=o.byteOffset,r=o.byteLength,a=new ArrayBuffer(r),l=new Uint8Array(n,s,r);return new Uint8Array(a).set(l),new DataView(a)}if(t==="[object Boolean]"||t==="[object Number]"||t==="[object String]"){let o=e.constructor,n=new o(e.valueOf());return t==="[object String]"?jk(n,e):uu(n,e),n}if(t==="[object Date]")return new Date(Number(e));if(t==="[object RegExp]"){let o=e,n=new RegExp(o.source,o.flags);return n.lastIndex=o.lastIndex,n}if(t==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(t==="[object Map]"){let o=e,n=new Map;return o.forEach((s,r)=>{n.set(r,s)}),n}if(t==="[object Set]"){let o=e,n=new Set;return o.forEach(s=>{n.add(s)}),n}if(t==="[object Arguments]"){let o=e,n={};return uu(n,o),n.length=o.length,n[Symbol.iterator]=o[Symbol.iterator],n}let i={};return Kk(i,e),uu(i,e),$k(i,e),i}function qk(e){switch(Xe(e)){case Qo:case on:case nn:case sn:case Bi:case Xo:case fn:case mn:case un:case dn:case hn:case en:case Mi:case Oi:case Zo:case tn:case Li:case Yo:case rn:case an:case ln:case cn:return!0;default:return!1}}function uu(e,t){for(let i in t)Object.hasOwn(t,i)&&(e[i]=t[i])}function $k(e,t){let i=Object.getOwnPropertySymbols(t);for(let o=0;o=i)&&(e[o]=t[o])}function Kk(e,t){let i=Object.getPrototypeOf(t);i!==null&&typeof t.constructor=="function"&&Object.setPrototypeOf(e,i)}function w0(e,t){let i={},o=Object.keys(e);for(let n=0;ni!=="constructor").length===0:t.length===0}return!0}function mu(e,t){if(!Number.isInteger(e)||e<0)throw new Error("n must be a non-negative integer.");let i=0;return(...o)=>{if(++i>=e)return t(...o)}}function Is(e,t,i){return typeof i!="function"&&(i=()=>{}),ka(e,t,(...o)=>{let n=i(...o);if(n!==void 0)return!!n;if(e instanceof Map&&t instanceof Map)return Is(Array.from(e),Array.from(t),mu(2,i));if(e instanceof Set&&t instanceof Set)return Is(Array.from(e),Array.from(t),mu(2,i))})}function v0(e){return e.substring(0,1).toUpperCase()+e.substring(1)}function gu(e){return v0(Ca(e))}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -11,13 +11,13 @@ var xk=Object.create;var ou=Object.defineProperty;var Tk=Object.getOwnPropertyDe */var S;try{S={window,document}}catch{/* v8 ignore start -- @preserve */S={window:{},document:{}}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function jk(){try{return navigator.userAgent.toLowerCase()}catch{return""}}var fo=jk(),V={isMac:N0(fo),isWindows:Kk(fo),isGecko:Gk(fo),isSafari:Jk(fo),isiOS:Zk(fo),isAndroid:Qk(fo),isBlink:Yk(fo),get isMediaForcedColors(){return e3()},get isMotionReduced(){return t3()},features:{isRegExpUnicodePropertySupported:Xk()}};function N0(e){return e.indexOf("macintosh")>-1}function Kk(e){return e.indexOf("windows")>-1}function Gk(e){return!!e.match(/gecko\/\d+/)}function Jk(e){return e.indexOf(" applewebkit/")>-1&&e.indexOf("chrome")===-1}function Zk(e){return!!e.match(/iphone|ipad/i)||N0(e)&&navigator.maxTouchPoints>0}function Qk(e){return e.indexOf("android")>-1}function Yk(e){return e.indexOf("chrome/")>-1&&e.indexOf("edge/")<0}function Xk(){let e=!1;try{e="\u0107".search(new RegExp("[\\p{L}]","u"))===0}catch{}return e}function e3(){return S.window.matchMedia?S.window.matchMedia("(forced-colors: active)").matches:!1}function t3(){return S.window.matchMedia?S.window.matchMedia("(prefers-reduced-motion)").matches:!1}/** +*/function Gk(){try{return navigator.userAgent.toLowerCase()}catch{return""}}var mo=Gk(),V={isMac:H0(mo),isWindows:Jk(mo),isGecko:Zk(mo),isSafari:Qk(mo),isiOS:Yk(mo),isAndroid:Xk(mo),isBlink:e3(mo),get isMediaForcedColors(){return i3()},get isMotionReduced(){return o3()},features:{isRegExpUnicodePropertySupported:t3()}};function H0(e){return e.indexOf("macintosh")>-1}function Jk(e){return e.indexOf("windows")>-1}function Zk(e){return!!e.match(/gecko\/\d+/)}function Qk(e){return e.indexOf(" applewebkit/")>-1&&e.indexOf("chrome")===-1}function Yk(e){return!!e.match(/iphone|ipad/i)||H0(e)&&navigator.maxTouchPoints>0}function Xk(e){return e.indexOf("android")>-1}function e3(e){return e.indexOf("chrome/")>-1&&e.indexOf("edge/")<0}function t3(){let e=!1;try{e="\u0107".search(new RegExp("[\\p{L}]","u"))===0}catch{}return e}function i3(){return S.window.matchMedia?S.window.matchMedia("(forced-colors: active)").matches:!1}function o3(){return S.window.matchMedia?S.window.matchMedia("(prefers-reduced-motion)").matches:!1}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Cu(e,t,i,o){i=i||function(a,l){return a===l};let n=Array.isArray(e)?e:Array.prototype.slice.call(e),s=Array.isArray(t)?t:Array.prototype.slice.call(t),r=i3(n,s,i);return o?n3(r,s.length):o3(s,r)}function i3(e,t,i){let o=_0(e,t,i);if(o===-1)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};let n=_0(v0(e,o),v0(t,o),i);return{firstIndex:o,lastIndexOld:e.length-n,lastIndexNew:t.length-n}}function _0(e,t,i){for(let o=0;o0&&i.push({index:o,type:"insert",values:e.slice(o,s)}),n-o>0&&i.push({index:o+(s-o),type:"delete",howMany:n-o}),i}function n3(e,t){let{firstIndex:i,lastIndexOld:o,lastIndexNew:n}=e;if(i===-1)return Array(t).fill("equal");let s=[];return i>0&&(s=s.concat(Array(i).fill("equal"))),n-i>0&&(s=s.concat(Array(n-i).fill("insert"))),o-i>0&&(s=s.concat(Array(o-i).fill("delete"))),n0&&i.push({index:o,type:"insert",values:e.slice(o,s)}),n-o>0&&i.push({index:o+(s-o),type:"delete",howMany:n-o}),i}function r3(e,t){let{firstIndex:i,lastIndexOld:o,lastIndexNew:n}=e;if(i===-1)return Array(t).fill("equal");let s=[];return i>0&&(s=s.concat(Array(i).fill("equal"))),n-i>0&&(s=s.concat(Array(n-i).fill("insert"))),o-i>0&&(s=s.concat(Array(o-i).fill("delete"))),n200||n>200||o+n>300)return Ni.fastDiff(e,t,i,!0);let s,r;if(nk?-1:1;u[g+v]&&(u[g]=u[g+v].slice(0)),u[g]||(u[g]=[]),u[g].push(b>k?s:r);let _=Math.max(b,k),C=_-g;for(;Cc;m--)d[m]=h(m);d[c]=h(c),f++}while(d[c]!==l);return u[c].slice(1)};Ni.fastDiff=Cu;/** +*/var Hi=function(e,t,i){i=i||function(g,b){return g===b};let o=e.length,n=t.length;if(o>200||n>200||o+n>300)return Hi.fastDiff(e,t,i,!0);let s,r;if(nk?-1:1;u[g+v]&&(u[g]=u[g+v].slice(0)),u[g]||(u[g]=[]),u[g].push(b>k?s:r);let _=Math.max(b,k),C=_-g;for(;Cc;m--)d[m]=h(m);d[c]=h(c),f++}while(d[c]!==l);return u[c].slice(1)};Hi.fastDiff=Tu;/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -26,10 +26,10 @@ var xk=Object.create;var ou=Object.defineProperty;var Tk=Object.getOwnPropertyDe *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function k0(){return function e(){e.called=!0}}/** +*/function x0(){return function e(){e.called=!0}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var pt=class{source;name;path;stop;off;return;constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=k0(),this.off=k0()}};/** +*/var bt=class{source;name;path;stop;off;return;constructor(e,t){this.source=e,this.name=t,this.path=[],this.stop=x0(),this.off=x0()}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */var qe=new Array(256).fill("").map((e,t)=>("0"+t.toString(16)).slice(-2));function ne(){let[e,t,i,o]=crypto.getRandomValues(new Uint32Array(4));return"e"+qe[e>>0&255]+qe[e>>8&255]+qe[e>>16&255]+qe[e>>24&255]+qe[t>>0&255]+qe[t>>8&255]+qe[t>>16&255]+qe[t>>24&255]+qe[i>>0&255]+qe[i>>8&255]+qe[i>>16&255]+qe[i>>24&255]+qe[o>>0&255]+qe[o>>8&255]+qe[o>>16&255]+qe[o>>24&255]}/** @@ -38,27 +38,27 @@ var xk=Object.create;var ou=Object.defineProperty;var Tk=Object.getOwnPropertyDe */var le={get(e="normal"){return typeof e!="number"?this[e]||this.normal:e},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Ba(e,t){let i=le.get(t.priority),o=0,n=e.length;for(;o>1;le.get(e[s].priority)>1;le.get(e[s].priority){if(typeof c=="object"&&c!==null){if(o.has(c))return`[object ${c.constructor.name}]`;o.add(c)}return c})}`:"",r=W0(e),a=i?` -Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let i=W0(e);return t?[e,t,i]:[e,i]}/** +*/var a3="https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html",p=class W0 extends Error{context;data;constructor(t,i,o,n){super(l3(t,o,n)),this.name="CKEditorError",this.context=i,this.data=o,n&&(this.stack=n.stack)}is(t){return t==="CKEditorError"}static rethrowUnexpectedError(t,i){throw t.is&&t.is("CKEditorError")?t:new W0("unexpected-error",i,void 0,t)}};function D(e,t){console.warn(...$0(e,t))}function U0(e,t){console.error(...$0(e,t))}function q0(e){return` +Read more: ${a3}#error-${e}`}function l3(e,t,i){let o=new WeakSet,s=t?` ${JSON.stringify(t,(l,c)=>{if(typeof c=="object"&&c!==null){if(o.has(c))return`[object ${c.constructor.name}]`;o.add(c)}return c})}`:"",r=q0(e),a=i?` +Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function $0(e,t){let i=q0(e);return t?[e,t,i]:[e,i]}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var a3="49.0.0",q0=new Date(2026,5,2);/* v8 ignore next -- @preserve */if(globalThis.CKEDITOR_VERSION)throw new p("ckeditor-duplicated-modules",null);globalThis.CKEDITOR_VERSION=a3;/** +*/var c3="49.0.0",j0=new Date(2026,5,2);/* v8 ignore next -- @preserve */if(globalThis.CKEDITOR_VERSION)throw new p("ckeditor-duplicated-modules",null);globalThis.CKEDITOR_VERSION=c3;/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var vn=Symbol("listeningTo"),_u=Symbol("emitterId"),li=Symbol("delegations"),l3=q(Object);function q(e){if(!e)return l3;class t extends e{on(o,n,s){this.listenTo(this,o,n,s)}once(o,n,s){let r=!1,a=(l,...c)=>{r||(r=!0,l.off(),n.call(this,l,...c))};this.listenTo(this,o,a,s)}off(o,n){this.stopListening(this,o,n)}listenTo(o,n,s,r={}){let a,l;this[vn]||(this[vn]={});let c=this[vn];mu(o)||$0(o);let u=mu(o);(a=c[u])||(a=c[u]={emitter:o,callbacks:{}}),(l=a.callbacks[n])||(l=a.callbacks[n]=[]),l.push(s),f3(this,o,n,s,r)}stopListening(o,n,s){let r=this[vn],a=o&&mu(o),l=r&&a?r[a]:void 0,c=l&&n?l.callbacks[n]:void 0;if(!(!r||o&&!l||n&&!c))if(s)gu(this,o,n,s),c.indexOf(s)!==-1&&(c.length===1?delete l.callbacks[n]:gu(this,o,n,s));else if(c){for(;s=c.pop();)gu(this,o,n,s);delete l.callbacks[n]}else if(l){for(n in l.callbacks)this.stopListening(o,n);delete r[a]}else{for(a in r)this.stopListening(r[a].emitter);delete this[vn]}}fire(o,...n){try{let s=o instanceof pt?o:new pt(this,o),r=s.name,a=h3(this,r);if(s.path.push(this),a){a=a.slice();for(let c=0;c{this[li]||(this[li]=new Map),o.forEach(r=>{let a=this[li].get(r);a?a.set(n,s):this[li].set(r,new Map([[n,s]]))})}}}stopDelegating(o,n){if(this[li])if(!o)this[li].clear();else if(!n)this[li].delete(o);else{let s=this[li].get(o);s&&s.delete(n)}}_addEventListener(o,n,s){d3(this,o);let r=vu(this,o),a={callback:n,priority:le.get(s.priority)};for(let l of r)Ba(l,a)}_removeEventListener(o,n){let s=vu(this,o);for(let r of s)for(let a=0;a-1?o.substring(0,r):""}if(o!==""){for(let r of s)r.callbacks=i[o].callbacks.slice();i[o].childEvents.push(n)}}function vu(e,t){let i=j0(e)[t];if(!i)return[];let o=[i.callbacks];for(let n=0;n-1?i.substring(0,n):""}while(i);return null}function C0(e,t,i){for(let[o,n]of e){n?typeof n=="function"&&(n=n(t.name)):n=t.name;let s=new pt(t.source,n);s.path=[...t.path],o.fire(s,...i)}}function f3(e,t,i,o,n){t._addEventListener?t._addEventListener(i,o,n):e._addEventListener.call(t,i,o,n)}function gu(e,t,i,o){t._removeEventListener?t._removeEventListener(i,o):e._removeEventListener.call(t,i,o)}/** +*/var vn=Symbol("listeningTo"),ku=Symbol("emitterId"),ui=Symbol("delegations"),u3=q(Object);function q(e){if(!e)return u3;class t extends e{on(o,n,s){this.listenTo(this,o,n,s)}once(o,n,s){let r=!1,a=(l,...c)=>{r||(r=!0,l.off(),n.call(this,l,...c))};this.listenTo(this,o,a,s)}off(o,n){this.stopListening(this,o,n)}listenTo(o,n,s,r={}){let a,l;this[vn]||(this[vn]={});let c=this[vn];pu(o)||K0(o);let u=pu(o);(a=c[u])||(a=c[u]={emitter:o,callbacks:{}}),(l=a.callbacks[n])||(l=a.callbacks[n]=[]),l.push(s),g3(this,o,n,s,r)}stopListening(o,n,s){let r=this[vn],a=o&&pu(o),l=r&&a?r[a]:void 0,c=l&&n?l.callbacks[n]:void 0;if(!(!r||o&&!l||n&&!c))if(s)bu(this,o,n,s),c.indexOf(s)!==-1&&(c.length===1?delete l.callbacks[n]:bu(this,o,n,s));else if(c){for(;s=c.pop();)bu(this,o,n,s);delete l.callbacks[n]}else if(l){for(n in l.callbacks)this.stopListening(o,n);delete r[a]}else{for(a in r)this.stopListening(r[a].emitter);delete this[vn]}}fire(o,...n){try{let s=o instanceof bt?o:new bt(this,o),r=s.name,a=m3(this,r);if(s.path.push(this),a){a=a.slice();for(let c=0;c{this[ui]||(this[ui]=new Map),o.forEach(r=>{let a=this[ui].get(r);a?a.set(n,s):this[ui].set(r,new Map([[n,s]]))})}}}stopDelegating(o,n){if(this[ui])if(!o)this[ui].clear();else if(!n)this[ui].delete(o);else{let s=this[ui].get(o);s&&s.delete(n)}}_addEventListener(o,n,s){f3(this,o);let r=Cu(this,o),a={callback:n,priority:le.get(s.priority)};for(let l of r)Oa(l,a)}_removeEventListener(o,n){let s=Cu(this,o);for(let r of s)for(let a=0;a-1?o.substring(0,r):""}if(o!==""){for(let r of s)r.callbacks=i[o].callbacks.slice();i[o].childEvents.push(n)}}function Cu(e,t){let i=G0(e)[t];if(!i)return[];let o=[i.callbacks];for(let n=0;n-1?i.substring(0,n):""}while(i);return null}function T0(e,t,i){for(let[o,n]of e){n?typeof n=="function"&&(n=n(t.name)):n=t.name;let s=new bt(t.source,n);s.path=[...t.path],o.fire(s,...i)}}function g3(e,t,i,o,n){t._addEventListener?t._addEventListener(i,o,n):e._addEventListener.call(t,i,o,n)}function bu(e,t,i,o){t._removeEventListener?t._removeEventListener(i,o):e._removeEventListener.call(t,i,o)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Ss=Symbol("observableProperties"),Rs=Symbol("boundObservables"),Ps=Symbol("boundProperties"),mo=Symbol("decoratedMethods"),x0=Symbol("decoratedOriginal"),m3=W(q());function W(e){if(!e)return m3;class t extends e{set(o,n){if(ae(o)){Object.keys(o).forEach(r=>{this.set(r,o[r])},this);return}pu(this);let s=this[Ss];if(o in this&&!s.has(o))throw new p("observable-set-cannot-override",this);Object.defineProperty(this,o,{enumerable:!0,configurable:!0,get(){return s.get(o)},set(r){let a=s.get(o),l=this.fire(`set:${o}`,o,r,a);l===void 0&&(l=r),(a!==l||!s.has(o))&&(s.set(o,l),this.fire(`change:${o}`,o,l,a))}}),this[o]=n}bind(...o){if(!o.length||!T0(o))throw new p("observable-bind-wrong-properties",this);if(new Set(o).size!==o.length)throw new p("observable-bind-duplicate-properties",this);pu(this);let n=this[Ps];o.forEach(r=>{if(n.has(r))throw new p("observable-bind-rebind",this)});let s=new Map;return o.forEach(r=>{let a={property:r,to:[]};n.set(r,a),s.set(r,a)}),{to:g3,toMany:p3,_observable:this,_bindProperties:o,_to:[],_bindings:s}}unbind(...o){if(!this[Ss])return;let n=this[Ps],s=this[Rs];if(o.length){if(!T0(o))throw new p("observable-unbind-wrong-properties",this);o.forEach(r=>{let a=n.get(r);a&&(a.to.forEach(([l,c])=>{let u=s.get(l),d=u[c];d.delete(a),d.size||delete u[c],Object.keys(u).length||(s.delete(l),this.stopListening(l,"change"))}),n.delete(r))})}else s.forEach((r,a)=>{this.stopListening(a,"change")}),s.clear(),n.clear()}decorate(o){pu(this);let n=this[o];if(!n)throw new p("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:o});this.on(o,(s,r)=>{s.return=n.apply(this,r)}),this[o]=function(...s){return this.fire(o,s)},this[o][x0]=n,this[mo]||(this[mo]=[]),this[mo].push(o)}stopListening(o,n,s){if(!o&&this[mo]){for(let r of this[mo])this[r]=this[r][x0];delete this[mo]}super.stopListening(o,n,s)}[Ss];[mo];[Ps];[Rs]}return t}function pu(e){e[Ss]||(Object.defineProperty(e,Ss,{value:new Map}),Object.defineProperty(e,Rs,{value:new Map}),Object.defineProperty(e,Ps,{value:new Map}))}function g3(...e){let t=w3(...e),i=Array.from(this._bindings.keys()),o=i.length;if(!t.callback&&t.to.length>1)throw new p("observable-bind-to-no-callback",this);if(o>1&&t.callback)throw new p("observable-bind-to-extra-callback",this);t.to.forEach(n=>{if(n.properties.length&&n.properties.length!==o)throw new p("observable-bind-to-properties-length",this);n.properties.length||(n.properties=this._bindProperties)}),this._to=t.to,t.callback&&(this._bindings.get(i[0]).callback=t.callback),v3(this._observable,this._to),_3(this),this._bindProperties.forEach(n=>{K0(this._observable,n)})}function p3(e,t,i){if(this._bindings.size>1)throw new p("observable-bind-to-many-not-one-binding",this);this.to(...b3(e,t),i)}function b3(e,t){let i=e.map(o=>[o,t]);return Array.prototype.concat.apply([],i)}function T0(e){return e.every(t=>typeof t=="string")}function w3(...e){if(!e.length)throw new p("observable-bind-to-parse-error",null);let t={to:[]},i;return typeof e[e.length-1]=="function"&&(t.callback=e.pop()),e.forEach(o=>{if(typeof o=="string")i.properties.push(o);else if(typeof o=="object")i={observable:o,properties:[]},t.to.push(i);else throw new p("observable-bind-to-parse-error",null)}),t}function y3(e,t,i,o){let n=e[Rs],s=n.get(i),r=s||{};r[o]||(r[o]=new Set),r[o].add(t),s||n.set(i,r)}function _3(e){let t;e._bindings.forEach((i,o)=>{e._to.forEach(n=>{t=n.properties[i.callback?0:e._bindProperties.indexOf(o)],i.to.push([n.observable,t]),y3(e._observable,i,n.observable,t)})})}function K0(e,t){let i=e[Ps].get(t),o;i.callback?o=i.callback.apply(e,i.to.map(n=>n[0][n[1]])):(o=i.to[0],o=o[0][o[1]]),Object.prototype.hasOwnProperty.call(e,t)?e[t]=o:e.set(t,o)}function v3(e,t){t.forEach(i=>{let o=e[Rs],n;o.get(i.observable)||e.listenTo(i.observable,"change",(s,r)=>{n=o.get(i.observable)[r],n&&n.forEach(a=>{K0(e,a.property)})})})}/** +*/var Ss=Symbol("observableProperties"),Rs=Symbol("boundObservables"),Ps=Symbol("boundProperties"),go=Symbol("decoratedMethods"),E0=Symbol("decoratedOriginal"),p3=W(q());function W(e){if(!e)return p3;class t extends e{set(o,n){if(ae(o)){Object.keys(o).forEach(r=>{this.set(r,o[r])},this);return}wu(this);let s=this[Ss];if(o in this&&!s.has(o))throw new p("observable-set-cannot-override",this);Object.defineProperty(this,o,{enumerable:!0,configurable:!0,get(){return s.get(o)},set(r){let a=s.get(o),l=this.fire(`set:${o}`,o,r,a);l===void 0&&(l=r),(a!==l||!s.has(o))&&(s.set(o,l),this.fire(`change:${o}`,o,l,a))}}),this[o]=n}bind(...o){if(!o.length||!A0(o))throw new p("observable-bind-wrong-properties",this);if(new Set(o).size!==o.length)throw new p("observable-bind-duplicate-properties",this);wu(this);let n=this[Ps];o.forEach(r=>{if(n.has(r))throw new p("observable-bind-rebind",this)});let s=new Map;return o.forEach(r=>{let a={property:r,to:[]};n.set(r,a),s.set(r,a)}),{to:b3,toMany:w3,_observable:this,_bindProperties:o,_to:[],_bindings:s}}unbind(...o){if(!this[Ss])return;let n=this[Ps],s=this[Rs];if(o.length){if(!A0(o))throw new p("observable-unbind-wrong-properties",this);o.forEach(r=>{let a=n.get(r);a&&(a.to.forEach(([l,c])=>{let u=s.get(l),d=u[c];d.delete(a),d.size||delete u[c],Object.keys(u).length||(s.delete(l),this.stopListening(l,"change"))}),n.delete(r))})}else s.forEach((r,a)=>{this.stopListening(a,"change")}),s.clear(),n.clear()}decorate(o){wu(this);let n=this[o];if(!n)throw new p("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:o});this.on(o,(s,r)=>{s.return=n.apply(this,r)}),this[o]=function(...s){return this.fire(o,s)},this[o][E0]=n,this[go]||(this[go]=[]),this[go].push(o)}stopListening(o,n,s){if(!o&&this[go]){for(let r of this[go])this[r]=this[r][E0];delete this[go]}super.stopListening(o,n,s)}[Ss];[go];[Ps];[Rs]}return t}function wu(e){e[Ss]||(Object.defineProperty(e,Ss,{value:new Map}),Object.defineProperty(e,Rs,{value:new Map}),Object.defineProperty(e,Ps,{value:new Map}))}function b3(...e){let t=_3(...e),i=Array.from(this._bindings.keys()),o=i.length;if(!t.callback&&t.to.length>1)throw new p("observable-bind-to-no-callback",this);if(o>1&&t.callback)throw new p("observable-bind-to-extra-callback",this);t.to.forEach(n=>{if(n.properties.length&&n.properties.length!==o)throw new p("observable-bind-to-properties-length",this);n.properties.length||(n.properties=this._bindProperties)}),this._to=t.to,t.callback&&(this._bindings.get(i[0]).callback=t.callback),C3(this._observable,this._to),k3(this),this._bindProperties.forEach(n=>{J0(this._observable,n)})}function w3(e,t,i){if(this._bindings.size>1)throw new p("observable-bind-to-many-not-one-binding",this);this.to(...y3(e,t),i)}function y3(e,t){let i=e.map(o=>[o,t]);return Array.prototype.concat.apply([],i)}function A0(e){return e.every(t=>typeof t=="string")}function _3(...e){if(!e.length)throw new p("observable-bind-to-parse-error",null);let t={to:[]},i;return typeof e[e.length-1]=="function"&&(t.callback=e.pop()),e.forEach(o=>{if(typeof o=="string")i.properties.push(o);else if(typeof o=="object")i={observable:o,properties:[]},t.to.push(i);else throw new p("observable-bind-to-parse-error",null)}),t}function v3(e,t,i,o){let n=e[Rs],s=n.get(i),r=s||{};r[o]||(r[o]=new Set),r[o].add(t),s||n.set(i,r)}function k3(e){let t;e._bindings.forEach((i,o)=>{e._to.forEach(n=>{t=n.properties[i.callback?0:e._bindProperties.indexOf(o)],i.to.push([n.observable,t]),v3(e._observable,i,n.observable,t)})})}function J0(e,t){let i=e[Ps].get(t),o;i.callback?o=i.callback.apply(e,i.to.map(n=>n[0][n[1]])):(o=i.to[0],o=o[0][o[1]]),Object.prototype.hasOwnProperty.call(e,t)?e[t]=o:e.set(t,o)}function C3(e,t){t.forEach(i=>{let o=e[Rs],n;o.get(i.observable)||e.listenTo(i.observable,"change",(s,r)=>{n=o.get(i.observable)[r],n&&n.forEach(a=>{J0(e,a.property)})})})}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */function st(e){if(!e)return!1;let t=e.ownerDocument?.defaultView;return e instanceof(t?t.ShadowRoot:ShadowRoot)}function Vs(e){return st(e)&&e.synthetic!==!0}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function _e(e){return st(e)?e.host:e.parentNode}/** +*/function ke(e){return st(e)?e.host:e.parentNode}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -70,172 +70,172 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let */function Ls(e){let t=0;for(let i of e)t++;return t}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function ve(e,t){let i=Math.min(e.length,t.length);for(let o=0;o{this._setToTarget(e,o,t[o],i)})}};function E0(e){return lo(e,k3)}function k3(e){return et(e)||typeof e=="function"?e:void 0}/** +*/var Eu=class{_config;constructor(e,t){this._config=Object.create(null),t&&this.define(I0(t)),e&&this._setObjectToTarget(this._config,e)}set(e,t){this._setToTarget(this._config,e,t)}define(e,t){this._setToTarget(this._config,e,t,!0)}get(e){return this._getFromSource(this._config,e)}*names(){for(let e of Object.keys(this._config))yield e}_setToTarget(e,t,i,o=!1){if(Ie(t)){this._setObjectToTarget(e,t,o);return}let n=t.split(".");t=n.pop();for(let s of n)Ie(e[s])||(e[s]=Object.create(null)),e=e[s];if(Ie(i)){Ie(e[t])||(e[t]=Object.create(null)),e=e[t],this._setObjectToTarget(e,i,o);return}o&&typeof e[t]<"u"||(e[t]=i)}_getFromSource(e,t){let i=t.split(".");t=i.pop();for(let o of i){if(!Ie(e[o])){e=null;break}e=e[o]}return e?I0(e[t]):void 0}_setObjectToTarget(e,t,i){Object.keys(t).forEach(o=>{this._setToTarget(e,o,t[o],i)})}};function I0(e){return co(e,x3)}function x3(e){return et(e)||typeof e=="function"?e:void 0}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Ut(e){if(e){if(e.defaultView)return e instanceof e.defaultView.Document;if(e.ownerDocument&&e.ownerDocument.defaultView)return e instanceof e.ownerDocument.defaultView.Node}return!1}/** +*/function $t(e){if(e){if(e.defaultView)return e instanceof e.defaultView.Document;if(e.ownerDocument&&e.ownerDocument.defaultView)return e instanceof e.ownerDocument.defaultView.Node}return!1}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Ma(e){let t=Object.prototype.toString.apply(e);return t=="[object Window]"||t=="[object global]"}/** +*/function Ba(e){let t=Object.prototype.toString.apply(e);return t=="[object Window]"||t=="[object global]"}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var C3=pe(q()),x3=q();function pe(e){if(!e)return C3;class t extends e{listenTo(o,n,s,r={}){if(Ut(o)||Ma(o)||o instanceof S.window.EventTarget){if(st(o)&&!Vs(o))return;let a={capture:!!r.useCapture,passive:!!r.usePassive},l=this._getProxyEmitter(o,a)||new T3(o,a);this.listenTo(l,n,s,r)}else super.listenTo(o,n,s,r)}stopListening(o,n,s){if(Ut(o)||Ma(o)||o instanceof S.window.EventTarget){let r=this._getAllProxyEmitters(o);for(let a of r)this.stopListening(a,n,s)}else super.stopListening(o,n,s)}_getProxyEmitter(o,n){return c3(this,G0(o,n))}_getAllProxyEmitters(o){return[{capture:!1,passive:!1},{capture:!1,passive:!0},{capture:!0,passive:!1},{capture:!0,passive:!0}].map(n=>this._getProxyEmitter(o,n)).filter(n=>!!n)}}return t}var T3=class extends x3{_domNode;_options;constructor(e,t){super(),$0(this,G0(e,t)),this._domNode=e,this._options=t}_domListeners;attach(e){if(this._domListeners&&this._domListeners[e])return;let t=this._createDomListener(e);this._domNode.addEventListener(e,t,this._options),this._domListeners||(this._domListeners={}),this._domListeners[e]=t}detach(e){let t;this._domListeners[e]&&(!(t=this._events[e])||!t.callbacks.length)&&this._domListeners[e].removeListener()}_addEventListener(e,t,i){this.attach(e),q().prototype._addEventListener.call(this,e,t,i)}_removeEventListener(e,t){q().prototype._removeEventListener.call(this,e,t),this.detach(e)}_createDomListener(e){let t=i=>{this.fire(e,i)};return t.removeListener=()=>{this._domNode.removeEventListener(e,t,this._options),delete this._domListeners[e]},t}};function E3(e){return e["data-ck-expando"]||(e["data-ck-expando"]=ne())}function G0(e,t){let i=E3(e);for(let o of Object.keys(t).sort())t[o]&&(i+="-"+o);return i}/** +*/var T3=be(q()),E3=q();function be(e){if(!e)return T3;class t extends e{listenTo(o,n,s,r={}){if($t(o)||Ba(o)||o instanceof S.window.EventTarget){if(st(o)&&!Vs(o))return;let a={capture:!!r.useCapture,passive:!!r.usePassive},l=this._getProxyEmitter(o,a)||new A3(o,a);this.listenTo(l,n,s,r)}else super.listenTo(o,n,s,r)}stopListening(o,n,s){if($t(o)||Ba(o)||o instanceof S.window.EventTarget){let r=this._getAllProxyEmitters(o);for(let a of r)this.stopListening(a,n,s)}else super.stopListening(o,n,s)}_getProxyEmitter(o,n){return d3(this,Z0(o,n))}_getAllProxyEmitters(o){return[{capture:!1,passive:!1},{capture:!1,passive:!0},{capture:!0,passive:!1},{capture:!0,passive:!0}].map(n=>this._getProxyEmitter(o,n)).filter(n=>!!n)}}return t}var A3=class extends E3{_domNode;_options;constructor(e,t){super(),K0(this,Z0(e,t)),this._domNode=e,this._options=t}_domListeners;attach(e){if(this._domListeners&&this._domListeners[e])return;let t=this._createDomListener(e);this._domNode.addEventListener(e,t,this._options),this._domListeners||(this._domListeners={}),this._domListeners[e]=t}detach(e){let t;this._domListeners[e]&&(!(t=this._events[e])||!t.callbacks.length)&&this._domListeners[e].removeListener()}_addEventListener(e,t,i){this.attach(e),q().prototype._addEventListener.call(this,e,t,i)}_removeEventListener(e,t){q().prototype._removeEventListener.call(this,e,t),this.detach(e)}_createDomListener(e){let t=i=>{this.fire(e,i)};return t.removeListener=()=>{this._domNode.removeEventListener(e,t,this._options),delete this._domListeners[e]},t}};function I3(e){return e["data-ck-expando"]||(e["data-ck-expando"]=ne())}function Z0(e,t){let i=I3(e);for(let o of Object.keys(t).sort())t[o]&&(i+="-"+o);return i}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */function Fe(e){let t=e.parentNode;return st(t)?t.host:e.parentElement}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function ci(e){return e.assignedSlot||Fe(e)}/** +*/function di(e){return e.assignedSlot||Fe(e)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function J0(e){let t=ci(e);if(!t)return null;for(;t.tagName!="BODY";){let i=t.style.overflowY||S.window.getComputedStyle(t).overflowY;if(i==="auto"||i==="scroll")break;if(t=ci(t),!t)return null}return t}/** +*/function Q0(e){let t=di(e);if(!t)return null;for(;t.tagName!="BODY";){let i=t.style.overflowY||S.window.getComputedStyle(t).overflowY;if(i==="auto"||i==="scroll")break;if(t=di(t),!t)return null}return t}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Z0(e){return e.assignedSlot||_e(e)}/** +*/function Y0(e){return e.assignedSlot||ke(e)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function rt(e,t){let i=t;for(;i;){if(i===e)return!0;i=Z0(i)}return!1}/** +*/function rt(e,t){let i=t;for(;i;){if(i===e)return!0;i=Y0(i)}return!1}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Q0(e){let t=[],i=e;for(;i&&i.nodeType!=Node.DOCUMENT_NODE;)t.unshift(i),i=i.parentNode;return t}/** +*/function X0(e){let t=[],i=e;for(;i&&i.nodeType!=Node.DOCUMENT_NODE;)t.unshift(i),i=i.parentNode;return t}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Y0(e){return e instanceof HTMLTextAreaElement?e.value:e.innerHTML}/** +*/function eg(e){return e instanceof HTMLTextAreaElement?e.value:e.innerHTML}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Tu(e){let t=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}/** +*/function Au(e){let t=e.ownerDocument.defaultView.getComputedStyle(e);return{top:parseInt(t.borderTopWidth,10),right:parseInt(t.borderRightWidth,10),bottom:parseInt(t.borderBottomWidth,10),left:parseInt(t.borderLeftWidth,10)}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Oa(e){if(!e.target)return null;let t=e.target,i=t.ownerDocument,o=e.clientX,n=e.clientY,s=null;if(i.caretPositionFromPoint){let r=t.getRootNode(),a=Vs(r)?[r]:[],l=i.caretPositionFromPoint(o,n,{shadowRoots:a});if(l){let c=l.offsetNode,u=c.nodeType===Node.TEXT_NODE?c.data.length:c.childNodes.length,d=Math.min(l.offset,u);s=i.createRange(),s.setStart(c,d),s.collapse(!0)}}else i.caretRangeFromPoint&&i.caretRangeFromPoint(o,n)?s=i.caretRangeFromPoint(o,n):e.rangeParent&&(s=i.createRange(),s.setStart(e.rangeParent,e.rangeOffset),s.collapse(!0));return s}/** +*/function Da(e){if(!e.target)return null;let t=e.target,i=t.ownerDocument,o=e.clientX,n=e.clientY,s=null;if(i.caretPositionFromPoint){let r=t.getRootNode(),a=Vs(r)?[r]:[],l=i.caretPositionFromPoint(o,n,{shadowRoots:a});if(l){let c=l.offsetNode,u=c.nodeType===Node.TEXT_NODE?c.data.length:c.childNodes.length,d=Math.min(l.offset,u);s=i.createRange(),s.setStart(c,d),s.collapse(!0)}}else i.caretRangeFromPoint&&i.caretRangeFromPoint(o,n)?s=i.caretRangeFromPoint(o,n):e.rangeParent&&(s=i.createRange(),s.setStart(e.rangeParent,e.rangeOffset),s.collapse(!0));return s}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function X0(e,t,i=[]){let o=S.document,[n]=i;if(n&&"elementFromPoint"in n)for(let s of i){let r=s.elementFromPoint(e,t);if(r&&r.getRootNode()===s)return r}else if(n&&o.caretPositionFromPoint){let s=i.filter(Vs),r=o.caretPositionFromPoint(e,t,{shadowRoots:s}),a=r&&r.offsetNode,l=a&&a.nodeType===Node.TEXT_NODE?Fe(a):a;if(A3(l)&&s.includes(l.getRootNode()))return l}return o.elementFromPoint(e,t)}function A3(e){return et(e)}/** +*/function tg(e,t,i=[]){let o=S.document,[n]=i;if(n&&"elementFromPoint"in n)for(let s of i){let r=s.elementFromPoint(e,t);if(r&&r.getRootNode()===s)return r}else if(n&&o.caretPositionFromPoint){let s=i.filter(Vs),r=o.caretPositionFromPoint(e,t,{shadowRoots:s}),a=r&&r.offsetNode,l=a&&a.nodeType===Node.TEXT_NODE?Fe(a):a;if(S3(l)&&s.includes(l.getRootNode()))return l}return o.elementFromPoint(e,t)}function S3(e){return et(e)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Eu(e){if(!e||!e.isConnected)return null;let t=e.offsetParent;if(!t)return null;let i=I3(e,t);if(!i)return t===t.ownerDocument.body&&!bu(t)?null:t;let o=i;for(;o.localName==="slot"&&!bu(o);)o=ci(o);return bu(o)?o:Eu(o)}function I3(e,t){let i=e;for(;i&&i!==t;){if(i.assignedSlot)return i.assignedSlot;i=Fe(i)}return null}var S3=/\b(?:layout|paint|strict|content)\b/,P3=/\b(?:transform|perspective|filter|contain)\b/;function bu(e){let t=e.ownerDocument.defaultView.getComputedStyle(e);return t.display==="contents"?!1:t.position!=="static"?!0:Di(t.transform,"none")||Di(t.translate,"none")||Di(t.rotate,"none")||Di(t.scale,"none")||Di(t.perspective,"none")||Di(t.filter,"none")||Di(t.backdropFilter,"none")||Di(t.contentVisibility,"visible")||S3.test(t.contain)||P3.test(t.willChange)}function Di(e,t){return!!e&&e!==t}/** +*/function Iu(e){if(!e||!e.isConnected)return null;let t=e.offsetParent;if(!t)return null;let i=P3(e,t);if(!i)return t===t.ownerDocument.body&&!yu(t)?null:t;let o=i;for(;o.localName==="slot"&&!yu(o);)o=di(o);return yu(o)?o:Iu(o)}function P3(e,t){let i=e;for(;i&&i!==t;){if(i.assignedSlot)return i.assignedSlot;i=Fe(i)}return null}var R3=/\b(?:layout|paint|strict|content)\b/,V3=/\b(?:transform|perspective|filter|contain)\b/;function yu(e){let t=e.ownerDocument.defaultView.getComputedStyle(e);return t.display==="contents"?!1:t.position!=="static"?!0:Ni(t.transform,"none")||Ni(t.translate,"none")||Ni(t.rotate,"none")||Ni(t.scale,"none")||Ni(t.perspective,"none")||Ni(t.filter,"none")||Ni(t.backdropFilter,"none")||Ni(t.contentVisibility,"visible")||R3.test(t.contain)||V3.test(t.willChange)}function Ni(e,t){return!!e&&e!==t}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function zi(e){return e.getRootNode().activeElement??null}/** +*/function Wi(e){return e.getRootNode().activeElement??null}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Au(e){let t=[],i=e;for(;i;)st(i)&&t.push(i),i=Z0(i);return t}/** +*/function Su(e){let t=[],i=e;for(;i;)st(i)&&t.push(i),i=Y0(i);return t}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function eg(e){if(!e.isConnected)return null;let t=e.getRootNode();return Vs(t)?t:e.ownerDocument.body}/** +*/function ig(e){if(!e.isConnected)return null;let t=e.getRootNode();return Vs(t)?t:e.ownerDocument.body}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var A0=new WeakMap;function tg(e,t){let i=A0.get(e)||new Set;if(A0.set(e,i),i.has(t))return;i.add(t);let o=new e.defaultView.CSSStyleSheet;o.replaceSync(t),e.adoptedStyleSheets.push(o)}/** +*/var S0=new WeakMap;function og(e,t){let i=S0.get(e)||new Set;if(S0.set(e,i),i.has(t))return;i.add(t);let o=new e.defaultView.CSSStyleSheet;o.replaceSync(t),e.adoptedStyleSheets.push(o)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */function j(e){return Array.isArray(e)?e:[e]}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Iu(e){if(e.isCollapsed)return!1;if("direction"in e&&e.direction!="none")return e.direction=="backward";let t=e.anchorNode.ownerDocument.createRange();try{t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset)}catch{return!1}let i=t.collapsed;return t.detach(),i}/** +*/function Pu(e){if(e.isCollapsed)return!1;if("direction"in e&&e.direction!="none")return e.direction=="backward";let t=e.anchorNode.ownerDocument.createRange();try{t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset)}catch{return!1}let i=t.collapsed;return t.detach(),i}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function go(e){return e&&e.nodeType===Node.COMMENT_NODE}/** +*/function po(e){return e&&e.nodeType===Node.COMMENT_NODE}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */function Y(e){return Object.prototype.toString.call(e)=="[object Text]"}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function $t(e){let t=j(e);if(!t.length)return null;let i=new Set;for(let o of t){let n=o.getRootNode();Vs(n)&&i.add(n)}if(i.size){let[o]=i,n=o.ownerDocument.defaultView;if(!n)return null;let s=n.getSelection();if(s&&typeof s.getComposedRanges=="function")return new R3(s,Array.from(i));for(let r of i){let a=r;if(typeof a.getSelection=="function"){let l=a.getSelection();if(l?.anchorNode)return l}}return s}for(let o of t){if(!o.isConnected)continue;let n=o.ownerDocument?.defaultView;if(n)return n.getSelection()}return null}var R3=class ku{_domSelection;_shadowRoots;static _useLegacyComposedRanges=!1;constructor(t,i){this._domSelection=t,this._shadowRoots=i}get rangeCount(){return this._getRanges().length}get isCollapsed(){let t=this._getRanges();return!t.length||t[0].collapsed}get anchorNode(){return this._getEndpoint("anchor").node}get anchorOffset(){return this._getEndpoint("anchor").offset}get focusNode(){return this._getEndpoint("focus").node}get focusOffset(){return this._getEndpoint("focus").offset}get direction(){let t=this._getRanges();return t.length?this._getDirection(t[0].startContainer.getRootNode()):"none"}getRangeAt(t){let i=this._getRanges()[t];if(!i)throw new DOMException(`Index ${t} is out of range.`,"IndexSizeError");let o=this._shadowRoots[0].ownerDocument.createRange();return o.setStart(i.startContainer,i.startOffset),o.setEnd(i.endContainer,i.endOffset),o}removeAllRanges(){this._domSelection.removeAllRanges()}addRange(t){this._domSelection.addRange(t)}collapse(t,i){this._domSelection.collapse(t,i)}extend(t,i){this._domSelection.extend(t,i)}setBaseAndExtent(t,i,o,n){this._domSelection.setBaseAndExtent(t,i,o,n)}_getRanges(){let t=this._shadowRoots[0].ownerDocument;return this._getComposedRanges().filter(i=>{let o=i.startContainer.getRootNode();return o!=i.endContainer.getRootNode()||o!=t&&!this._shadowRoots.includes(o)?!1:I0(i.startContainer,i.startOffset)&&I0(i.endContainer,i.endOffset)})}_getComposedRanges(){let t=this._domSelection,i=this._shadowRoots;if(ku._useLegacyComposedRanges)return t.getComposedRanges(...i);try{return t.getComposedRanges({shadowRoots:i})}catch{return ku._useLegacyComposedRanges=!0,t.getComposedRanges(...i)}}_getDirection(t){let i=t.getSelection?.();if(i){if(i.direction&&i.direction!="none")return i.direction;if(i.anchorNode)return Iu(i)?"backward":"forward"}return this._domSelection.direction??"forward"}_getEndpoint(t){let i=this._getRanges();if(!i.length)return{node:null,offset:0};let o=i[0],n=this._getDirection(o.startContainer.getRootNode())=="backward";return(t=="anchor"?!n:n)?{node:o.startContainer,offset:o.startOffset}:{node:o.endContainer,offset:o.endOffset}}};function I0(e,t){return t<=(Y(e)||go(e)?e.length:e.childNodes.length)}/** +*/function Kt(e){let t=j(e);if(!t.length)return null;let i=new Set;for(let o of t){let n=o.getRootNode();Vs(n)&&i.add(n)}if(i.size){let[o]=i,n=o.ownerDocument.defaultView;if(!n)return null;let s=n.getSelection();if(s&&typeof s.getComposedRanges=="function")return new L3(s,Array.from(i));for(let r of i){let a=r;if(typeof a.getSelection=="function"){let l=a.getSelection();if(l?.anchorNode)return l}}return s}for(let o of t){if(!o.isConnected)continue;let n=o.ownerDocument?.defaultView;if(n)return n.getSelection()}return null}var L3=class xu{_domSelection;_shadowRoots;static _useLegacyComposedRanges=!1;constructor(t,i){this._domSelection=t,this._shadowRoots=i}get rangeCount(){return this._getRanges().length}get isCollapsed(){let t=this._getRanges();return!t.length||t[0].collapsed}get anchorNode(){return this._getEndpoint("anchor").node}get anchorOffset(){return this._getEndpoint("anchor").offset}get focusNode(){return this._getEndpoint("focus").node}get focusOffset(){return this._getEndpoint("focus").offset}get direction(){let t=this._getRanges();return t.length?this._getDirection(t[0].startContainer.getRootNode()):"none"}getRangeAt(t){let i=this._getRanges()[t];if(!i)throw new DOMException(`Index ${t} is out of range.`,"IndexSizeError");let o=this._shadowRoots[0].ownerDocument.createRange();return o.setStart(i.startContainer,i.startOffset),o.setEnd(i.endContainer,i.endOffset),o}removeAllRanges(){this._domSelection.removeAllRanges()}addRange(t){this._domSelection.addRange(t)}collapse(t,i){this._domSelection.collapse(t,i)}extend(t,i){this._domSelection.extend(t,i)}setBaseAndExtent(t,i,o,n){this._domSelection.setBaseAndExtent(t,i,o,n)}_getRanges(){let t=this._shadowRoots[0].ownerDocument;return this._getComposedRanges().filter(i=>{let o=i.startContainer.getRootNode();return o!=i.endContainer.getRootNode()||o!=t&&!this._shadowRoots.includes(o)?!1:P0(i.startContainer,i.startOffset)&&P0(i.endContainer,i.endOffset)})}_getComposedRanges(){let t=this._domSelection,i=this._shadowRoots;if(xu._useLegacyComposedRanges)return t.getComposedRanges(...i);try{return t.getComposedRanges({shadowRoots:i})}catch{return xu._useLegacyComposedRanges=!0,t.getComposedRanges(...i)}}_getDirection(t){let i=t.getSelection?.();if(i){if(i.direction&&i.direction!="none")return i.direction;if(i.anchorNode)return Pu(i)?"backward":"forward"}return this._domSelection.direction??"forward"}_getEndpoint(t){let i=this._getRanges();if(!i.length)return{node:null,offset:0};let o=i[0],n=this._getDirection(o.startContainer.getRootNode())=="backward";return(t=="anchor"?!n:n)?{node:o.startContainer,offset:o.startOffset}:{node:o.endContainer,offset:o.endOffset}}};function P0(e,t){return t<=(Y(e)||po(e)?e.length:e.childNodes.length)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */function kn(e){return Object.prototype.toString.apply(e)=="[object Range]"}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var ig=["top","right","bottom","left","width","height"],V3=new Set(["relative","absolute","fixed","sticky"]),F=class Wt{top;right;bottom;left;width;height;_source;constructor(t){let i=kn(t);if(Object.defineProperty(this,"_source",{value:t._source||t,writable:!0,enumerable:!1}),La(t)||i)if(i){let o=Wt.getDomRangeRects(t);Ra(this,Wt.getBoundingRect(o))}else Ra(this,t.getBoundingClientRect());else if(Ma(t)){let{innerWidth:o,innerHeight:n}=t;Ra(this,{top:0,right:o,bottom:n,left:0,width:o,height:n})}else Ra(this,t)}clone(){return new Wt(this)}moveTo(t,i){return this.top=i,this.right=t+this.width,this.bottom=i+this.height,this.left=t,this}moveBy(t,i){return this.top+=i,this.right+=t,this.left+=t,this.bottom+=i,this}getIntersection(t){let i={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),width:0,height:0};if(i.width=i.right-i.left,i.height=i.bottom-i.top,i.width<0||i.height<0)return null;{let o=new Wt(i);return o._source=this._source,o}}getIntersectionArea(t){let i=this.getIntersection(t);return i?i.getArea():0}getArea(){return this.width*this.height}getVisible(){let t=this._source,i=this.clone();if(S0(t))return i;let o=t,n=null;if(La(t))n=ci(t);else if(kn(t)){let r=t.commonAncestorContainer;n=st(r)?r.host:r}let s;for(;n&&!S0(n);){let r=L3(n)==="visible";if(P0(o)&&(s=o),r||s&&og(s)==="absolute"&&!P0(n)){o=n,n=ci(n);continue}let a=new Wt(n),l=i.getIntersection(a);if(l)l.getArea(){let o=new Wt(i);return o._source=t,o})}static getBoundingRect(t){let i={left:Number.POSITIVE_INFINITY,top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,width:0,height:0},o=0;for(let n of t)o++,i.left=Math.min(i.left,n.left),i.top=Math.min(i.top,n.top),i.right=Math.max(i.right,n.right),i.bottom=Math.max(i.bottom,n.bottom);return o==0?null:(i.width=i.right-i.left,i.height=i.bottom-i.top,new Wt(i))}};function Ra(e,t){for(let i of ig)e[i]=t[i]}function S0(e){return La(e)?e===e.ownerDocument.body:!1}function La(e){return e!==null&&typeof e=="object"&&e.nodeType===1&&typeof e.getBoundingClientRect=="function"}function og(e){return e.ownerDocument.defaultView.getComputedStyle(e).position}function L3(e){return e instanceof HTMLElement?e.ownerDocument.defaultView.getComputedStyle(e).overflow:"visible"}function P0(e){return e instanceof HTMLElement&&V3.has(og(e))}function M3(e,t){let i=new F(t),o=Tu(t),n=0,s=0;n-=i.left,s-=i.top,n+=t.scrollLeft,s+=t.scrollTop,n-=o.left,s-=o.top,e.moveBy(n,s)}/** +*/var ng=["top","right","bottom","left","width","height"],M3=new Set(["relative","absolute","fixed","sticky"]),F=class qt{top;right;bottom;left;width;height;_source;constructor(t){let i=kn(t);if(Object.defineProperty(this,"_source",{value:t._source||t,writable:!0,enumerable:!1}),Ma(t)||i)if(i){let o=qt.getDomRangeRects(t);Va(this,qt.getBoundingRect(o))}else Va(this,t.getBoundingClientRect());else if(Ba(t)){let{innerWidth:o,innerHeight:n}=t;Va(this,{top:0,right:o,bottom:n,left:0,width:o,height:n})}else Va(this,t)}clone(){return new qt(this)}moveTo(t,i){return this.top=i,this.right=t+this.width,this.bottom=i+this.height,this.left=t,this}moveBy(t,i){return this.top+=i,this.right+=t,this.left+=t,this.bottom+=i,this}getIntersection(t){let i={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),width:0,height:0};if(i.width=i.right-i.left,i.height=i.bottom-i.top,i.width<0||i.height<0)return null;{let o=new qt(i);return o._source=this._source,o}}getIntersectionArea(t){let i=this.getIntersection(t);return i?i.getArea():0}getArea(){return this.width*this.height}getVisible(){let t=this._source,i=this.clone();if(R0(t))return i;let o=t,n=null;if(Ma(t))n=di(t);else if(kn(t)){let r=t.commonAncestorContainer;n=st(r)?r.host:r}let s;for(;n&&!R0(n);){let r=B3(n)==="visible";if(V0(o)&&(s=o),r||s&&sg(s)==="absolute"&&!V0(n)){o=n,n=di(n);continue}let a=new qt(n),l=i.getIntersection(a);if(l)l.getArea(){let o=new qt(i);return o._source=t,o})}static getBoundingRect(t){let i={left:Number.POSITIVE_INFINITY,top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,width:0,height:0},o=0;for(let n of t)o++,i.left=Math.min(i.left,n.left),i.top=Math.min(i.top,n.top),i.right=Math.max(i.right,n.right),i.bottom=Math.max(i.bottom,n.bottom);return o==0?null:(i.width=i.right-i.left,i.height=i.bottom-i.top,new qt(i))}};function Va(e,t){for(let i of ng)e[i]=t[i]}function R0(e){return Ma(e)?e===e.ownerDocument.body:!1}function Ma(e){return e!==null&&typeof e=="object"&&e.nodeType===1&&typeof e.getBoundingClientRect=="function"}function sg(e){return e.ownerDocument.defaultView.getComputedStyle(e).position}function B3(e){return e instanceof HTMLElement?e.ownerDocument.defaultView.getComputedStyle(e).overflow:"visible"}function V0(e){return e instanceof HTMLElement&&M3.has(sg(e))}function O3(e,t){let i=new F(t),o=Au(t),n=0,s=0;n-=i.left,s-=i.top,n+=t.scrollLeft,s+=t.scrollTop,n-=o.left,s-=o.top,e.moveBy(n,s)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Ms=class ge{_element;_callback;static _observerInstance=null;static _elementCallbacks=null;constructor(t,i){ge._observerInstance||ge._createObserver(),this._element=t,this._callback=i,ge._addElementCallback(t,i),ge._observerInstance.observe(t)}get element(){return this._element}destroy(){ge._deleteElementCallback(this._element,this._callback)}static _addElementCallback(t,i){ge._elementCallbacks||(ge._elementCallbacks=new Map);let o=ge._elementCallbacks.get(t);o||(o=new Set,ge._elementCallbacks.set(t,o)),o.add(i)}static _deleteElementCallback(t,i){let o=ge._getElementCallbacks(t);o&&(o.delete(i),o.size||(ge._elementCallbacks.delete(t),ge._observerInstance.unobserve(t))),ge._elementCallbacks&&!ge._elementCallbacks.size&&(ge._observerInstance=null,ge._elementCallbacks=null)}static _getElementCallbacks(t){return ge._elementCallbacks?ge._elementCallbacks.get(t):null}static _createObserver(){ge._observerInstance=new S.window.ResizeObserver(t=>{for(let i of t){let o=ge._getElementCallbacks(i.target);if(o)for(let n of o)n(i)}})}};/** +*/var Ms=class pe{_element;_callback;static _observerInstance=null;static _elementCallbacks=null;constructor(t,i){pe._observerInstance||pe._createObserver(),this._element=t,this._callback=i,pe._addElementCallback(t,i),pe._observerInstance.observe(t)}get element(){return this._element}destroy(){pe._deleteElementCallback(this._element,this._callback)}static _addElementCallback(t,i){pe._elementCallbacks||(pe._elementCallbacks=new Map);let o=pe._elementCallbacks.get(t);o||(o=new Set,pe._elementCallbacks.set(t,o)),o.add(i)}static _deleteElementCallback(t,i){let o=pe._getElementCallbacks(t);o&&(o.delete(i),o.size||(pe._elementCallbacks.delete(t),pe._observerInstance.unobserve(t))),pe._elementCallbacks&&!pe._elementCallbacks.size&&(pe._observerInstance=null,pe._elementCallbacks=null)}static _getElementCallbacks(t){return pe._elementCallbacks?pe._elementCallbacks.get(t):null}static _createObserver(){pe._observerInstance=new S.window.ResizeObserver(t=>{for(let i of t){let o=pe._getElementCallbacks(i.target);if(o)for(let n of o)n(i)}})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var B3="ckeditor5",wu={createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e},Fi,Va;function at(e){return Fi||(Fi=ng()),Fi.createHTML(e)}function Su(){if(Va===void 0)try{S.document.createElement("div").innerHTML="",Va=!1}catch{Va=typeof S.document.createElement=="function"}return Va}function Da(e,t,i){let o=S.window.trustedTypes;if(!o||typeof o.getAttributeType!="function")return i;switch(Fi||(Fi=ng()),o.getAttributeType(e.localName,t,e.namespaceURI)){case"TrustedHTML":return Fi.createHTML(i);case"TrustedScript":return Fi.createScript(i);case"TrustedScriptURL":return Fi.createScriptURL(i);default:return i}}function ng(){let e=S.window.trustedTypes;if(e)try{return e.createPolicy(B3,wu)}catch{if(!Su())return wu;D("trusted-types-policy-creation-failed")}return wu}/** +*/var D3="ckeditor5",_u={createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e},zi,La;function at(e){return zi||(zi=rg()),zi.createHTML(e)}function Ru(){if(La===void 0)try{S.document.createElement("div").innerHTML="",La=!1}catch{La=typeof S.document.createElement=="function"}return La}function Fa(e,t,i){let o=S.window.trustedTypes;if(!o||typeof o.getAttributeType!="function")return i;switch(zi||(zi=rg()),o.getAttributeType(e.localName,t,e.namespaceURI)){case"TrustedHTML":return zi.createHTML(i);case"TrustedScript":return zi.createScript(i);case"TrustedScriptURL":return zi.createScriptURL(i);default:return i}}function rg(){let e=S.window.trustedTypes;if(e)try{return e.createPolicy(D3,_u)}catch{if(!Ru())return _u;D("trusted-types-policy-creation-failed")}return _u}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Pu(e,t){e instanceof HTMLTextAreaElement&&(e.value=t),e.innerHTML=at(t)}/** +*/function Vu(e,t){e instanceof HTMLTextAreaElement&&(e.value=t),e.innerHTML=at(t)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function po(e){return t=>t+e}/** +*/function bo(e){return t=>t+e}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function bo(e){let t=0;for(;e.previousSibling;)e=e.previousSibling,t++;return t}/** +*/function wo(e){let t=0;for(;e.previousSibling;)e=e.previousSibling,t++;return t}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Ru(e,t,i){e.insertBefore(i,e.childNodes[t]||null)}/** +*/function Lu(e,t,i){e.insertBefore(i,e.childNodes[t]||null)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Vu(e,t){if(!e)return!1;for(let i of t)if(i.host===e)return!0;return!1}/** +*/function Mu(e,t){if(!e)return!1;for(let i of t)if(i.host===e)return!0;return!1}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var O3=q(),Lu=class extends O3{_rootsByNode=new Map;getShadowRoots(){let e=new Set;for(let t of this._rootsByNode.values())for(let i of t)e.add(i);return e}registerNode(e){if(this._rootsByNode.has(e))return;let t=this.getShadowRoots();this._rootsByNode.set(e,R0(e)),this._fireRootChanges(t)}unregisterNode(e){if(!this._rootsByNode.has(e))return;let t=this.getShadowRoots();this._rootsByNode.delete(e),this._fireRootChanges(t)}refresh(){let e=this.getShadowRoots();for(let t of this._rootsByNode.keys())this._rootsByNode.set(t,R0(t));this._fireRootChanges(e)}destroy(){let e=this.getShadowRoots();this._rootsByNode.clear(),this._fireRootChanges(e)}_fireRootChanges(e){let t=this.getShadowRoots();for(let i of e)t.has(i)||this.fire("remove",i);for(let i of t)e.has(i)||this.fire("add",i)}};function R0(e){return e.isConnected?Au(e):[]}/** +*/var F3=q(),Bu=class extends F3{_rootsByNode=new Map;getShadowRoots(){let e=new Set;for(let t of this._rootsByNode.values())for(let i of t)e.add(i);return e}registerNode(e){if(this._rootsByNode.has(e))return;let t=this.getShadowRoots();this._rootsByNode.set(e,L0(e)),this._fireRootChanges(t)}unregisterNode(e){if(!this._rootsByNode.has(e))return;let t=this.getShadowRoots();this._rootsByNode.delete(e),this._fireRootChanges(t)}refresh(){let e=this.getShadowRoots();for(let t of this._rootsByNode.keys())this._rootsByNode.set(t,L0(t));this._fireRootChanges(e)}destroy(){let e=this.getShadowRoots();this._rootsByNode.clear(),this._fireRootChanges(e)}_fireRootChanges(e){let t=this.getShadowRoots();for(let i of e)t.has(i)||this.fire("remove",i);for(let i of t)e.has(i)||this.fire("add",i)}};function L0(e){return e.isConnected?Su(e):[]}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function sg(e){try{S.document.createAttribute(e)}catch{return!1}return!0}/** +*/function ag(e){try{S.document.createAttribute(e)}catch{return!1}return!0}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function jt(e){return e?Y(e)?jt(Fe(e)):e.getClientRects?!!e.getClientRects().length:!1:!1}/** +*/function Gt(e){return e?Y(e)?Gt(Fe(e)):e.getClientRects?!!e.getClientRects().length:!1:!1}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Fa({element:e,target:t,positions:i,limiter:o,fitInViewport:n,viewportOffsetConfig:s}){As(t)&&(t=t()),As(o)&&(o=o());let r=Eu(e),a=Mu(s),l=new F(e),c=V0(t,a),u;if(!c||!a.getIntersection(c))return null;let d={targetRect:c,elementRect:l,positionedElementAncestor:r,viewportRect:a};if(!o&&!n)u=new rg(i[0],d);else{if(o){let h=V0(o,a);h&&(d.limiterRect=h)}u=D3(i,d)}return u}function V0(e,t){let i=new F(e).getVisible();return i?i.getIntersection(t):null}function Mu(e){e=Object.assign({top:0,bottom:0,left:0,right:0},e);let t=new F(S.window);return t.top+=e.top,t.height-=e.top,t.bottom-=e.bottom,t.height-=e.bottom,t.left+=e.left,t.right-=e.right,t.width-=e.left+e.right,t}function D3(e,t){let{elementRect:i}=t,o=i.getArea(),n=e.map(a=>new rg(a,t)).filter(a=>!!a.name),s=0,r=null;for(let a of n){let{limiterIntersectionArea:l,viewportIntersectionArea:c}=a;if(l===o)return a;let u=c**2+l**2;u>s&&(s=u,r=a)}return r}var rg=class{name;config;_positioningFunctionCoordinates;_options;_cachedRect;_cachedAbsoluteRect;constructor(e,t){let i=e(t.targetRect,t.elementRect,t.viewportRect,t.limiterRect);if(!i)return;let{left:o,top:n,name:s,config:r}=i;this.name=s,this.config=r,this._positioningFunctionCoordinates={left:o,top:n},this._options=t}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get limiterIntersectionArea(){let e=this._options.limiterRect;return e?e.getIntersectionArea(this._rect):0}get viewportIntersectionArea(){return this._options.viewportRect.getIntersectionArea(this._rect)}get _rect(){return this._cachedRect?this._cachedRect:(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCoordinates.left,this._positioningFunctionCoordinates.top),this._cachedRect)}get _absoluteRect(){return this._cachedAbsoluteRect?this._cachedAbsoluteRect:(this._cachedAbsoluteRect=this._rect.toAbsoluteRect(),this._cachedAbsoluteRect)}};/** +*/function Na({element:e,target:t,positions:i,limiter:o,fitInViewport:n,viewportOffsetConfig:s}){As(t)&&(t=t()),As(o)&&(o=o());let r=Iu(e),a=Ou(s),l=new F(e),c=M0(t,a),u;if(!c||!a.getIntersection(c))return null;let d={targetRect:c,elementRect:l,positionedElementAncestor:r,viewportRect:a};if(!o&&!n)u=new lg(i[0],d);else{if(o){let h=M0(o,a);h&&(d.limiterRect=h)}u=N3(i,d)}return u}function M0(e,t){let i=new F(e).getVisible();return i?i.getIntersection(t):null}function Ou(e){e=Object.assign({top:0,bottom:0,left:0,right:0},e);let t=new F(S.window);return t.top+=e.top,t.height-=e.top,t.bottom-=e.bottom,t.height-=e.bottom,t.left+=e.left,t.right-=e.right,t.width-=e.left+e.right,t}function N3(e,t){let{elementRect:i}=t,o=i.getArea(),n=e.map(a=>new lg(a,t)).filter(a=>!!a.name),s=0,r=null;for(let a of n){let{limiterIntersectionArea:l,viewportIntersectionArea:c}=a;if(l===o)return a;let u=c**2+l**2;u>s&&(s=u,r=a)}return r}var lg=class{name;config;_positioningFunctionCoordinates;_options;_cachedRect;_cachedAbsoluteRect;constructor(e,t){let i=e(t.targetRect,t.elementRect,t.viewportRect,t.limiterRect);if(!i)return;let{left:o,top:n,name:s,config:r}=i;this.name=s,this.config=r,this._positioningFunctionCoordinates={left:o,top:n},this._options=t}get left(){return this._absoluteRect.left}get top(){return this._absoluteRect.top}get limiterIntersectionArea(){let e=this._options.limiterRect;return e?e.getIntersectionArea(this._rect):0}get viewportIntersectionArea(){return this._options.viewportRect.getIntersectionArea(this._rect)}get _rect(){return this._cachedRect?this._cachedRect:(this._cachedRect=this._options.elementRect.clone().moveTo(this._positioningFunctionCoordinates.left,this._positioningFunctionCoordinates.top),this._cachedRect)}get _absoluteRect(){return this._cachedAbsoluteRect?this._cachedAbsoluteRect:(this._cachedAbsoluteRect=this._rect.toAbsoluteRect(),this._cachedAbsoluteRect)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Bu(e){let t=_e(e);t&&t.removeChild(e)}/** +*/function Du(e){let t=ke(e);t&&t.removeChild(e)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function ag(){let e=S.window.visualViewport;return!e||!(V.isiOS||V.isSafari)?{left:0,top:0}:{left:Math.max(Math.round(e.offsetLeft),0),top:Math.max(Math.round(e.offsetTop),0)}}/** +*/function cg(){let e=S.window.visualViewport;return!e||!(V.isiOS||V.isSafari)?{left:0,top:0}:{left:Math.max(Math.round(e.offsetLeft),0),top:Math.max(Math.round(e.offsetTop),0)}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function lg({target:e,viewportOffset:t=0,ancestorOffset:i=0,alignToTop:o,forceScroll:n}){let s=Ou(e),r=s,a=null;for(t=z3(t);r;){let l;r==s?l=L0(e):l=L0(a),N3({parent:l,getRect:()=>yu(e,r),alignToTop:o,ancestorOffset:i,forceScroll:n});let c=yu(e,r),u=yu(l,r);if(c.height>u.height){let d=c.getIntersection(u);d&&(c=d)}if(F3({window:r,rect:c,viewportOffset:t,alignToTop:o,forceScroll:n}),r.parent!=r){if(a=r.frameElement,r=r.parent,!a)return}else r=null}}function F3({window:e,rect:t,alignToTop:i,forceScroll:o,viewportOffset:n}){let s=t.clone().moveBy(0,n.bottom),r=t.clone().moveBy(0,-n.top),a=new F(e).excludeScrollbarsAndBorders(),l=[r,s],c=i&&o,u=l.every(g=>a.contains(g)),{scrollX:d,scrollY:h}=e,f=d,m=h;c?h-=a.top-t.top+n.top:u||(ug(r,a)?h-=a.top-t.top+n.top:cg(s,a)&&(i?h+=t.top-a.top-n.top:h+=t.bottom-a.bottom+n.bottom)),u||(dg(t,a)?d-=a.left-t.left+n.left:hg(t,a)&&(d+=t.right-a.right+n.right)),(d!=f||h!==m)&&e.scrollTo(d,h)}function N3({parent:e,getRect:t,alignToTop:i,forceScroll:o,ancestorOffset:n=0,limiterElement:s}){let r=Ou(e),a=i&&o,l,c,u,d=s||r.document.body,h=e;for(;h&&h!=d;)c=t(),l=new F(h).excludeScrollbarsAndBorders(),u=l.contains(c),a?h.scrollTop-=l.top-c.top+n:u||(ug(c,l)?h.scrollTop-=l.top-c.top+n:cg(c,l)&&(i?h.scrollTop+=c.top-l.top-n:h.scrollTop+=c.bottom-l.bottom+n)),u||(dg(c,l)?h.scrollLeft-=l.left-c.left+n:hg(c,l)&&(h.scrollLeft+=c.right-l.right+n)),h=ci(h)}function cg(e,t){return e.bottom>t.bottom}function ug(e,t){return e.topt.right}function Ou(e){return kn(e)?e.startContainer.ownerDocument.defaultView:e.ownerDocument.defaultView}function L0(e){if(kn(e)){let t=e.commonAncestorContainer;return st(t)?t.host:(Y(t)&&(t=ci(t)),t)}else return ci(e)}function yu(e,t){let i=Ou(e),o=new F(e);if(i===t)return o;{let n=i;for(;n!=t;){let s=n.frameElement,r=new F(s).excludeScrollbarsAndBorders();o.moveBy(r.left,r.top),n=n.parent}}return o}function z3(e){return typeof e=="number"?{top:e,bottom:e,left:e,right:e}:e}/** +*/function ug({target:e,viewportOffset:t=0,ancestorOffset:i=0,alignToTop:o,forceScroll:n}){let s=Fu(e),r=s,a=null;for(t=W3(t);r;){let l;r==s?l=B0(e):l=B0(a),H3({parent:l,getRect:()=>vu(e,r),alignToTop:o,ancestorOffset:i,forceScroll:n});let c=vu(e,r),u=vu(l,r);if(c.height>u.height){let d=c.getIntersection(u);d&&(c=d)}if(z3({window:r,rect:c,viewportOffset:t,alignToTop:o,forceScroll:n}),r.parent!=r){if(a=r.frameElement,r=r.parent,!a)return}else r=null}}function z3({window:e,rect:t,alignToTop:i,forceScroll:o,viewportOffset:n}){let s=t.clone().moveBy(0,n.bottom),r=t.clone().moveBy(0,-n.top),a=new F(e).excludeScrollbarsAndBorders(),l=[r,s],c=i&&o,u=l.every(g=>a.contains(g)),{scrollX:d,scrollY:h}=e,f=d,m=h;c?h-=a.top-t.top+n.top:u||(hg(r,a)?h-=a.top-t.top+n.top:dg(s,a)&&(i?h+=t.top-a.top-n.top:h+=t.bottom-a.bottom+n.bottom)),u||(fg(t,a)?d-=a.left-t.left+n.left:mg(t,a)&&(d+=t.right-a.right+n.right)),(d!=f||h!==m)&&e.scrollTo(d,h)}function H3({parent:e,getRect:t,alignToTop:i,forceScroll:o,ancestorOffset:n=0,limiterElement:s}){let r=Fu(e),a=i&&o,l,c,u,d=s||r.document.body,h=e;for(;h&&h!=d;)c=t(),l=new F(h).excludeScrollbarsAndBorders(),u=l.contains(c),a?h.scrollTop-=l.top-c.top+n:u||(hg(c,l)?h.scrollTop-=l.top-c.top+n:dg(c,l)&&(i?h.scrollTop+=c.top-l.top-n:h.scrollTop+=c.bottom-l.bottom+n)),u||(fg(c,l)?h.scrollLeft-=l.left-c.left+n:mg(c,l)&&(h.scrollLeft+=c.right-l.right+n)),h=di(h)}function dg(e,t){return e.bottom>t.bottom}function hg(e,t){return e.topt.right}function Fu(e){return kn(e)?e.startContainer.ownerDocument.defaultView:e.ownerDocument.defaultView}function B0(e){if(kn(e)){let t=e.commonAncestorContainer;return st(t)?t.host:(Y(t)&&(t=di(t)),t)}else return di(e)}function vu(e,t){let i=Fu(e),o=new F(e);if(i===t)return o;{let n=i;for(;n!=t;){let s=n.frameElement,r=new F(s).excludeScrollbarsAndBorders();o.moveBy(r.left,r.top),n=n.parent}}return o}function W3(e){return typeof e=="number"?{top:e,bottom:e,left:e,right:e}:e}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var H3={ctrl:"\u2303",cmd:"\u2318",alt:"\u2325",shift:"\u21E7"},W3={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},M0={37:"\u2190",38:"\u2191",39:"\u2192",40:"\u2193",9:"\u21E5",33:"Page Up",34:"Page Down"},O=$3(),U3=Object.fromEntries(Object.entries(O).map(([e,t])=>{let i;return t in M0?i=M0[t]:i=e.charAt(0).toUpperCase()+e.slice(1),[t,i]}));function qt(e){let t;if(typeof e=="string"){if(t=O[e.toLowerCase()],!t)throw new p("keyboard-unknown-key",null,{key:e})}else t=e.keyCode+(e.altKey?O.alt:0)+(e.ctrlKey?O.ctrl:0)+(e.shiftKey?O.shift:0)+(e.metaKey?O.cmd:0);return t}function Cn(e){return typeof e=="string"&&(e=j3(e)),e.map(t=>typeof t=="string"?q3(t):t).reduce((t,i)=>i+t,0)}function Bs(e,t){let i=Cn(e),o=t?t==="Mac":V.isMac||V.isiOS;return Object.entries(o?H3:W3).reduce((n,[s,r])=>((i&O[s])!=0&&(i&=~O[s],n+=r),n),"")+(i?U3[i]:"")}function fg(e){return e==O.arrowright||e==O.arrowleft||e==O.arrowup||e==O.arrowdown}function wo(e,t){let i=t==="ltr";switch(e){case O.arrowleft:return i?"left":"right";case O.arrowright:return i?"right":"left";case O.arrowup:return"up";case O.arrowdown:return"down"}}function q3(e){if(e.endsWith("!"))return qt(e.slice(0,-1));let t=qt(e);return(V.isMac||V.isiOS)&&t==O.ctrl?O.cmd:t}function mg(e,t){let i=wo(e,t);return i==="down"||i==="right"}function $3(){let e={pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let t=65;t<=90;t++){let i=String.fromCharCode(t);e[i.toLowerCase()]=t}for(let t=48;t<=57;t++)e[t-48]=t;for(let t=112;t<=123;t++)e["f"+(t-111)]=t;return Object.assign(e,{"'":222,",":108,"-":109,".":110,"/":111,";":186,"=":187,"[":219,"\\":220,"]":221,"`":223}),e}function j3(e){return e.split("+").map(t=>t.trim())}/** +*/var U3={ctrl:"\u2303",cmd:"\u2318",alt:"\u2325",shift:"\u21E7"},q3={ctrl:"Ctrl+",alt:"Alt+",shift:"Shift+"},O0={37:"\u2190",38:"\u2191",39:"\u2192",40:"\u2193",9:"\u21E5",33:"Page Up",34:"Page Down"},O=K3(),$3=Object.fromEntries(Object.entries(O).map(([e,t])=>{let i;return t in O0?i=O0[t]:i=e.charAt(0).toUpperCase()+e.slice(1),[t,i]}));function jt(e){let t;if(typeof e=="string"){if(t=O[e.toLowerCase()],!t)throw new p("keyboard-unknown-key",null,{key:e})}else t=e.keyCode+(e.altKey?O.alt:0)+(e.ctrlKey?O.ctrl:0)+(e.shiftKey?O.shift:0)+(e.metaKey?O.cmd:0);return t}function Cn(e){return typeof e=="string"&&(e=G3(e)),e.map(t=>typeof t=="string"?j3(t):t).reduce((t,i)=>i+t,0)}function Bs(e,t){let i=Cn(e),o=t?t==="Mac":V.isMac||V.isiOS;return Object.entries(o?U3:q3).reduce((n,[s,r])=>((i&O[s])!=0&&(i&=~O[s],n+=r),n),"")+(i?$3[i]:"")}function gg(e){return e==O.arrowright||e==O.arrowleft||e==O.arrowup||e==O.arrowdown}function yo(e,t){let i=t==="ltr";switch(e){case O.arrowleft:return i?"left":"right";case O.arrowright:return i?"right":"left";case O.arrowup:return"up";case O.arrowdown:return"down"}}function j3(e){if(e.endsWith("!"))return jt(e.slice(0,-1));let t=jt(e);return(V.isMac||V.isiOS)&&t==O.ctrl?O.cmd:t}function pg(e,t){let i=yo(e,t);return i==="down"||i==="right"}function K3(){let e={pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let t=65;t<=90;t++){let i=String.fromCharCode(t);e[i.toLowerCase()]=t}for(let t=48;t<=57;t++)e[t-48]=t;for(let t=112;t<=123;t++)e["f"+(t-111)]=t;return Object.assign(e,{"'":222,",":108,"-":109,".":110,"/":111,";":186,"=":187,"[":219,"\\":220,"]":221,"`":223}),e}function G3(e){return e.split("+").map(t=>t.trim())}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var K3=["ar","ara","dv","div","fa","per","fas","he","heb","ku","kur","ug","uig","ur","urd"];function B0(e){return K3.includes(e)?"rtl":"ltr"}/** +*/var J3=["ar","ara","dv","div","fa","per","fas","he","heb","ku","kur","ug","uig","ur","urd"];function D0(e){return J3.includes(e)?"rtl":"ltr"}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*//* v8 ignore else -- @preserve */S.window.CKEDITOR_TRANSLATIONS||(S.window.CKEDITOR_TRANSLATIONS={});function G3(e,t,i=1,o){if(typeof i!="number")throw new p("translation-service-quantity-not-a-number",null,{quantity:i});let n=o||S.window.CKEDITOR_TRANSLATIONS,s=Q3(n);s===1&&(e=Object.keys(n)[0]);let r=t.id||t.string;if(s===0||!Z3(e,r,n))return i!==1?t.plural:t.string;let a=n[e].dictionary,l=n[e].getPluralForm||(u=>u===1?0:1),c=a[r];return typeof c=="string"?c:c[Number(l(i))]}function J3(e){return Array.isArray(e)?e.reduce((t,i)=>_n(t,i),{}):e}function Z3(e,t,i){return!!i[e]&&!!i[e].dictionary[t]}function Q3(e){return Object.keys(e).length}/** +*//* v8 ignore else -- @preserve */S.window.CKEDITOR_TRANSLATIONS||(S.window.CKEDITOR_TRANSLATIONS={});function Z3(e,t,i=1,o){if(typeof i!="number")throw new p("translation-service-quantity-not-a-number",null,{quantity:i});let n=o||S.window.CKEDITOR_TRANSLATIONS,s=X3(n);s===1&&(e=Object.keys(n)[0]);let r=t.id||t.string;if(s===0||!Y3(e,r,n))return i!==1?t.plural:t.string;let a=n[e].dictionary,l=n[e].getPluralForm||(u=>u===1?0:1),c=a[r];return typeof c=="string"?c:c[Number(l(i))]}function Q3(e){return Array.isArray(e)?e.reduce((t,i)=>_n(t,i),{}):e}function Y3(e,t,i){return!!i[e]&&!!i[e].dictionary[t]}function X3(e){return Object.keys(e).length}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var gg=class{uiLanguage;uiLanguageDirection;contentLanguage;contentLanguageDirection;t;translations;constructor({uiLanguage:e="en",contentLanguage:t,translations:i}={}){this.uiLanguage=e,this.contentLanguage=t||this.uiLanguage,this.uiLanguageDirection=B0(this.uiLanguage),this.contentLanguageDirection=B0(this.contentLanguage),this.translations=J3(i),this.t=(o,n)=>this._t(o,n)}_t(e,t=[]){t=j(t),typeof e=="string"&&(e={string:e});let i=e.plural?t[0]:1;return Y3(G3(this.uiLanguage,e,i,this.translations),t)}};function Y3(e,t){return e.replace(/%(\d+)/g,(i,o)=>othis._t(o,n)}_t(e,t=[]){t=j(t),typeof e=="string"&&(e={string:e});let i=e.plural?t[0]:1;return e4(Z3(this.uiLanguage,e,i,this.translations),t)}};function e4(e,t){return e.replace(/%(\d+)/g,(i,o)=>othis._items.length||t<0)throw new p("collection-add-item-invalid-index",this);let i=0;for(let o of e){let n=this._getItemIdBeforeAdding(o),s=t+i;this._items.splice(s,0,o),this._itemMap.set(n,o),this.fire("add",o,s),i++}return this.fire("change",{added:e,removed:[],index:t}),this}get(e){let t;if(typeof e=="string")t=this._itemMap.get(e);else if(typeof e=="number")t=this._items[e];else throw new p("collection-get-invalid-arg",this);return t||null}has(e){if(typeof e=="string")return this._itemMap.has(e);{let t=e[this._idProperty];return t&&this._itemMap.has(t)}}getIndex(e){let t;return typeof e=="string"?t=this._itemMap.get(e):t=e,t?this._items.indexOf(t):-1}remove(e){let[t,i]=this._remove(e);return this.fire("change",{added:[],removed:[t],index:i}),t}map(e,t){return this._items.map(e,t)}forEach(e,t){this._items.forEach(e,t)}find(e,t){return this._items.find(e,t)}filter(e,t){return this._items.filter(e,t)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);let e=Array.from(this._items);for(;this.length;)this._remove(0);this.fire("change",{added:[],removed:e,index:0})}bindTo(e){if(this._bindToCollection)throw new p("collection-bind-to-rebind",this);return this._bindToCollection=e,{as:t=>{this._setUpBindToBinding(i=>new t(i))},using:t=>{typeof t=="function"?this._setUpBindToBinding(t):this._setUpBindToBinding(i=>i[t])}}}_setUpBindToBinding(e){let t=this._bindToCollection,i=(o,n,s)=>{let r=t._bindToCollection==this,a=t._bindToInternalToExternalMap.get(n);if(r&&a)this._bindToExternalToInternalMap.set(n,a),this._bindToInternalToExternalMap.set(a,n);else{let l=e(n);if(!l){this._skippedIndexesFromExternal.push(s);return}let c=s;for(let u of this._skippedIndexesFromExternal)s>u&&c--;for(let u of t._skippedIndexesFromExternal)c>=u&&c++;this._bindToExternalToInternalMap.set(n,l),this._bindToInternalToExternalMap.set(l,n),this.add(l,c);for(let u=0;u{let r=this._bindToExternalToInternalMap.get(n);r&&this.remove(r),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((a,l)=>(sl&&a.push(l),a),[])})}_getItemIdBeforeAdding(e){let t=this._idProperty,i;if(t in e){if(i=e[t],typeof i!="string")throw new p("collection-add-invalid-id",this);if(this.get(i))throw new p("collection-add-item-already-exists",this)}else e[t]=i=ne();return i}_remove(e){let t,i,o,n,s=this._idProperty;if(typeof e=="string"?(i=e,o=this._itemMap.get(i),n=!o,o&&(t=this._items.indexOf(o))):typeof e=="number"?(t=e,o=this._items[t],n=!o,o&&(i=o[s])):(o=e,i=o[s],t=this._items.indexOf(o),n=t==-1||!this._itemMap.get(i)),n)throw new p("collection-remove-404",this);this._items.splice(t,1),this._itemMap.delete(i);let r=this._bindToInternalToExternalMap.get(o);return this._bindToInternalToExternalMap.delete(o),this._bindToExternalToInternalMap.delete(r),this.fire("remove",o,t),[o,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}};/** +*/var t4=q(),G=class extends t4{_items;_itemMap;_idProperty;_bindToCollection;_bindToExternalToInternalMap;_bindToInternalToExternalMap;_skippedIndexesFromExternal;constructor(e={},t={}){super();let i=Je(e);if(i||(t=e),this._items=[],this._itemMap=new Map,this._idProperty=t.idProperty||"id",this._bindToExternalToInternalMap=new WeakMap,this._bindToInternalToExternalMap=new WeakMap,this._skippedIndexesFromExternal=[],i)for(let o of e)this._items.push(o),this._itemMap.set(this._getItemIdBeforeAdding(o),o)}get length(){return this._items.length}get first(){return this._items[0]||null}get last(){return this._items[this.length-1]||null}add(e,t){return this.addMany([e],t)}addMany(e,t){if(t===void 0)t=this._items.length;else if(t>this._items.length||t<0)throw new p("collection-add-item-invalid-index",this);let i=0;for(let o of e){let n=this._getItemIdBeforeAdding(o),s=t+i;this._items.splice(s,0,o),this._itemMap.set(n,o),this.fire("add",o,s),i++}return this.fire("change",{added:e,removed:[],index:t}),this}get(e){let t;if(typeof e=="string")t=this._itemMap.get(e);else if(typeof e=="number")t=this._items[e];else throw new p("collection-get-invalid-arg",this);return t||null}has(e){if(typeof e=="string")return this._itemMap.has(e);{let t=e[this._idProperty];return t&&this._itemMap.has(t)}}getIndex(e){let t;return typeof e=="string"?t=this._itemMap.get(e):t=e,t?this._items.indexOf(t):-1}remove(e){let[t,i]=this._remove(e);return this.fire("change",{added:[],removed:[t],index:i}),t}map(e,t){return this._items.map(e,t)}forEach(e,t){this._items.forEach(e,t)}find(e,t){return this._items.find(e,t)}filter(e,t){return this._items.filter(e,t)}clear(){this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);let e=Array.from(this._items);for(;this.length;)this._remove(0);this.fire("change",{added:[],removed:e,index:0})}bindTo(e){if(this._bindToCollection)throw new p("collection-bind-to-rebind",this);return this._bindToCollection=e,{as:t=>{this._setUpBindToBinding(i=>new t(i))},using:t=>{typeof t=="function"?this._setUpBindToBinding(t):this._setUpBindToBinding(i=>i[t])}}}_setUpBindToBinding(e){let t=this._bindToCollection,i=(o,n,s)=>{let r=t._bindToCollection==this,a=t._bindToInternalToExternalMap.get(n);if(r&&a)this._bindToExternalToInternalMap.set(n,a),this._bindToInternalToExternalMap.set(a,n);else{let l=e(n);if(!l){this._skippedIndexesFromExternal.push(s);return}let c=s;for(let u of this._skippedIndexesFromExternal)s>u&&c--;for(let u of t._skippedIndexesFromExternal)c>=u&&c++;this._bindToExternalToInternalMap.set(n,l),this._bindToInternalToExternalMap.set(l,n),this.add(l,c);for(let u=0;u{let r=this._bindToExternalToInternalMap.get(n);r&&this.remove(r),this._skippedIndexesFromExternal=this._skippedIndexesFromExternal.reduce((a,l)=>(sl&&a.push(l),a),[])})}_getItemIdBeforeAdding(e){let t=this._idProperty,i;if(t in e){if(i=e[t],typeof i!="string")throw new p("collection-add-invalid-id",this);if(this.get(i))throw new p("collection-add-item-already-exists",this)}else e[t]=i=ne();return i}_remove(e){let t,i,o,n,s=this._idProperty;if(typeof e=="string"?(i=e,o=this._itemMap.get(i),n=!o,o&&(t=this._items.indexOf(o))):typeof e=="number"?(t=e,o=this._items[t],n=!o,o&&(i=o[s])):(o=e,i=o[s],t=this._items.indexOf(o),n=t==-1||!this._itemMap.get(i)),n)throw new p("collection-remove-404",this);this._items.splice(t,1),this._itemMap.delete(i);let r=this._bindToInternalToExternalMap.get(o);return this._bindToInternalToExternalMap.delete(o),this._bindToExternalToInternalMap.delete(r),this.fire("remove",o,t),[o,t]}[Symbol.iterator](){return this._items[Symbol.iterator]()}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function G(e){let t=e.next();return t.done?null:t.value}/** +*/function J(e){let t=e.next();return t.done?null:t.value}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var e4=pe(W()),Q=class extends e4{_elements=new Set;_externalViews=new Set;_blurTimeout=null;constructor(){super(),this.set("isFocused",!1),this.set("focusedElement",null)}get elements(){return Array.from(this._elements.values())}get externalViews(){return Array.from(this._externalViews.values())}add(e){if(D0(e))this._addElement(e);else if(O0(e))this._addView(e);else{if(!e.element)throw new p("focustracker-add-view-missing-element",{focusTracker:this,view:e});this._addElement(e.element)}}remove(e){D0(e)?this._removeElement(e):O0(e)?this._removeView(e):this._removeElement(e.element)}_addElement(e){if(this._elements.has(e))throw new p("focustracker-add-element-already-exist",this);this.listenTo(e,"focus",()=>{let t=this.externalViews.find(i=>t4(e,i));t?this._focus(t.element):this._focus(e)},{useCapture:!0}),this.listenTo(e,"blur",()=>{this._blur()},{useCapture:!0}),this._elements.add(e)}_removeElement(e){this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e)),e===this.focusedElement&&this._blur()}_addView(e){e.element&&this._addElement(e.element),this.listenTo(e.focusTracker,"change:focusedElement",()=>{e.focusTracker.focusedElement?e.element&&this._focus(e.element):this._blur()}),this._externalViews.add(e)}_removeView(e){e.element&&this._removeElement(e.element),this.stopListening(e.focusTracker),this._externalViews.delete(e)}destroy(){this.stopListening(),this._elements.clear(),this._externalViews.clear(),this.isFocused=!1,this.focusedElement=null}_focus(e){this._clearBlurTimeout(),this.focusedElement=e,this.isFocused=!0}_blur(){this.elements.find(e=>e.contains(zi(e)))||this.externalViews.find(e=>e.focusTracker.isFocused&&!e.focusTracker._blurTimeout)||(this._clearBlurTimeout(),this._blurTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0))}_clearBlurTimeout(){clearTimeout(this._blurTimeout),this._blurTimeout=null}};function O0(e){return"focusTracker"in e&&e.focusTracker instanceof Q}function D0(e){return et(e)}function t4(e,t){return F0(e,t)?!0:!!t.focusTracker.externalViews.find(i=>F0(e,i))}function F0(e,t){return!!t.element&&t.element.contains(zi(t.element))&&e.contains(t.element)}/** +*/var i4=be(W()),Q=class extends i4{_elements=new Set;_externalViews=new Set;_blurTimeout=null;constructor(){super(),this.set("isFocused",!1),this.set("focusedElement",null)}get elements(){return Array.from(this._elements.values())}get externalViews(){return Array.from(this._externalViews.values())}add(e){if(N0(e))this._addElement(e);else if(F0(e))this._addView(e);else{if(!e.element)throw new p("focustracker-add-view-missing-element",{focusTracker:this,view:e});this._addElement(e.element)}}remove(e){N0(e)?this._removeElement(e):F0(e)?this._removeView(e):this._removeElement(e.element)}_addElement(e){if(this._elements.has(e))throw new p("focustracker-add-element-already-exist",this);this.listenTo(e,"focus",()=>{let t=this.externalViews.find(i=>o4(e,i));t?this._focus(t.element):this._focus(e)},{useCapture:!0}),this.listenTo(e,"blur",()=>{this._blur()},{useCapture:!0}),this._elements.add(e)}_removeElement(e){this._elements.has(e)&&(this.stopListening(e),this._elements.delete(e)),e===this.focusedElement&&this._blur()}_addView(e){e.element&&this._addElement(e.element),this.listenTo(e.focusTracker,"change:focusedElement",()=>{e.focusTracker.focusedElement?e.element&&this._focus(e.element):this._blur()}),this._externalViews.add(e)}_removeView(e){e.element&&this._removeElement(e.element),this.stopListening(e.focusTracker),this._externalViews.delete(e)}destroy(){this.stopListening(),this._elements.clear(),this._externalViews.clear(),this.isFocused=!1,this.focusedElement=null}_focus(e){this._clearBlurTimeout(),this.focusedElement=e,this.isFocused=!0}_blur(){this.elements.find(e=>e.contains(Wi(e)))||this.externalViews.find(e=>e.focusTracker.isFocused&&!e.focusTracker._blurTimeout)||(this._clearBlurTimeout(),this._blurTimeout=setTimeout(()=>{this.focusedElement=null,this.isFocused=!1},0))}_clearBlurTimeout(){clearTimeout(this._blurTimeout),this._blurTimeout=null}};function F0(e){return"focusTracker"in e&&e.focusTracker instanceof Q}function N0(e){return et(e)}function o4(e,t){return z0(e,t)?!0:!!t.focusTracker.externalViews.find(i=>z0(e,i))}function z0(e,t){return!!t.element&&t.element.contains(Wi(t.element))&&e.contains(t.element)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var X=class{_listener;constructor(){this._listener=new(pe())}listenTo(e){this._listener.listenTo(e,"keydown",(t,i)=>{this._listener.fire("_keydown:"+qt(i),i)})}set(e,t,i={}){let o=Cn(e),n=i.priority;this._listener.listenTo(this._listener,"_keydown:"+o,(s,r)=>{i.filter&&!i.filter(r)||(t(r,()=>{r.preventDefault(),r.stopPropagation(),s.stop()}),s.return=!0)},{priority:n})}press(e){return!!this._listener.fire("_keydown:"+qt(e),e)}stopListening(e){this._listener.stopListening(e)}destroy(){this.stopListening()}};/** +*/var X=class{_listener;constructor(){this._listener=new(be())}listenTo(e){this._listener.listenTo(e,"keydown",(t,i)=>{this._listener.fire("_keydown:"+jt(i),i)})}set(e,t,i={}){let o=Cn(e),n=i.priority;this._listener.listenTo(this._listener,"_keydown:"+o,(s,r)=>{i.filter&&!i.filter(r)||(t(r,()=>{r.preventDefault(),r.stopPropagation(),s.stop()}),s.return=!0)},{priority:n})}press(e){return!!this._listener.fire("_keydown:"+jt(e),e)}stopListening(e){this._listener.stopListening(e)}destroy(){this.stopListening()}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function i4(e){let t=new Map;for(let i in e)t.set(i,e[i]);return t}/** +*/function n4(e){let t=new Map;for(let i in e)t.set(i,e[i]);return t}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function lt(e){return Je(e)?new Map(e):i4(e)}/** +*/function lt(e){return Je(e)?new Map(e):n4(e)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -247,16 +247,16 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Du(e,t,i){let o=e.length,n=t.length;for(let s=o-1;s>=i;s--)e[s+n]=e[s];for(let s=0;s=i;s--)e[s+n]=e[s];for(let s=0;se(...n),t)}return o.cancel=()=>{clearTimeout(i)},o}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Na(e){try{if(!e.startsWith("ey"))return null;let t=atob(e.replace(/-/g,"+").replace(/_/g,"/"));return JSON.parse(t)}catch{return null}}/** +*/function za(e){try{if(!e.startsWith("ey"))return null;let t=atob(e.replace(/-/g,"+").replace(/_/g,"/"));return JSON.parse(t)}catch{return null}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function o4(){let e=[];for(let t=0;t<256;t++){let i=t;for(let o=0;o<8;o++)i&1?i=3988292384^i>>>1:i=i>>>1;e[t]=i}return e}function pg(e){let t=Array.isArray(e)?e:[e],i=o4(),o=-1,n=t.map(s=>Array.isArray(s)?s.join(""):String(s)).join("");for(let s=0;s>>8^i[(o^r)&255]}return o=(o^-1)>>>0,o.toString(16).padStart(8,"0")}/** +*/function s4(){let e=[];for(let t=0;t<256;t++){let i=t;for(let o=0;o<8;o++)i&1?i=3988292384^i>>>1:i=i>>>1;e[t]=i}return e}function wg(e){let t=Array.isArray(e)?e:[e],i=s4(),o=-1,n=t.map(s=>Array.isArray(s)?s.join(""):String(s)).join("");for(let s=0;s>>8^i[(o^r)&255]}return o=(o^-1)>>>0,o.toString(16).padStart(8,"0")}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -265,16 +265,16 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function n4(e){return!!e&&e.length==1&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(e)}function s4(e){return!!e&&e.length==1&&/[\ud800-\udbff]/.test(e)}function r4(e){return!!e&&e.length==1&&/[\udc00-\udfff]/.test(e)}function Ds(e,t){return s4(e.charAt(t-1))&&r4(e.charAt(t))}function Fs(e,t){return n4(e.charAt(t))}var a4=l4();function za(e,t){let i=String(e).matchAll(a4);return Array.from(i).some(o=>o.indexn.source).join("|")+")",o=`${t}|${i}(?:\u200D${i})*`;return new RegExp(o,"ug")}/** +*/function r4(e){return!!e&&e.length==1&&/[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/.test(e)}function a4(e){return!!e&&e.length==1&&/[\ud800-\udbff]/.test(e)}function l4(e){return!!e&&e.length==1&&/[\udc00-\udfff]/.test(e)}function Ds(e,t){return a4(e.charAt(t-1))&&l4(e.charAt(t))}function Fs(e,t){return r4(e.charAt(t))}var c4=u4();function Ha(e,t){let i=String(e).matchAll(c4);return Array.from(i).some(o=>o.indexn.source).join("|")+")",o=`${t}|${i}(?:\u200D${i})*`;return new RegExp(o,"ug")}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Fu(e){if(!e)return null;let t=c4(e);return t?Na(t):null}function c4(e){let t=e.split(".");return t.length!=3?null:t[1]}/** +*/function zu(e){if(!e)return null;let t=d4(e);return t?za(t):null}function d4(e){let t=e.split(".");return t.length!=3?null:t[1]}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function bg(e,t){return(e.removeFeatures||[]).includes(t)}/** +*/function yg(e,t){return(e.removeFeatures||[]).includes(t)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Nu(e){if(!e)return null;let[,t,i]=e.trim().match(/([.,\d]+)(%|px)$/)||[],o=Number.parseFloat(t);return Number.isNaN(o)?null:{value:o,unit:i}}function zu(e,t,i){return i==="px"?{value:t.value,unit:"px"}:{value:t.value/e*100,unit:"%"}}/** +*/function Hu(e){if(!e)return null;let[,t,i]=e.trim().match(/([.,\d]+)(%|px)$/)||[],o=Number.parseFloat(t);return Number.isNaN(o)?null:{value:o,unit:i}}function Wu(e,t,i){return i==="px"?{value:t.value,unit:"px"}:{value:t.value/e*100,unit:"%"}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -283,219 +283,219 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Ns=new WeakMap,wg=!1;function Ln({view:e,element:t,text:i,isDirectHost:o=!0,keepOnFocus:n=!1}){let s=e.document;Ns.has(s)||(Ns.set(s,new Map),s.registerPostFixer(a=>Hu(Ns.get(s),a)),s.on("change:isComposing",()=>{e.change(a=>Hu(Ns.get(s),a))},{priority:"high"})),t.is("editableElement")&&t.on("change:placeholder",(a,l,c)=>r(c)),t.placeholder?r(t.placeholder):i&&r(i),i&&h4();function r(a){let l={text:a,isDirectHost:o,keepOnFocus:n,hostElement:o?t:null};Ns.get(s).set(t,l),e.change(c=>Hu([[t,l]],c))}}function sp(e,t){return t.hasClass("ck-placeholder")?!1:(e.addClass("ck-placeholder",t),!0)}function hd(e,t){return t.hasClass("ck-placeholder")?(e.removeClass("ck-placeholder",t),!0):!1}function rp(e,t){if(!e.isAttached()||u4(e))return!1;let i=e.document,o=i.selection.anchor;return i.isComposing&&o&&o.parent===e?!1:t||!i.isFocused?!0:!!o&&o.parent!==e}function u4(e){for(let t of e.getChildren())if(!t.is("uiElement"))return!0;return!1}function Hu(e,t){let i=[],o=!1;for(let[n,s]of e)s.isDirectHost&&(i.push(n),yg(t,n,s)&&(o=!0));for(let[n,s]of e){if(s.isDirectHost)continue;let r=d4(n);r!==s.hostElement&&s.hostElement&&(t.removeAttribute("data-placeholder",s.hostElement),hd(t,s.hostElement),s.hostElement=null,o=!0),r&&(i.includes(r)||(s.hostElement=r,yg(t,n,s)&&(o=!0)))}return o}function yg(e,t,i){let{text:o,isDirectHost:n,hostElement:s}=i,r=!1;return s.getAttribute("data-placeholder")!==o&&(e.setAttribute("data-placeholder",o,s),r=!0),(n||t.childCount==1)&&rp(s,i.keepOnFocus)?sp(e,s)&&(r=!0):hd(e,s)&&(r=!0),r}function d4(e){if(e.childCount){let t=e.getChild(0);if(t.is("element")&&!t.is("uiElement")&&!t.is("attributeElement"))return t}return null}function h4(){wg||D("enableViewPlaceholder-deprecated-text-option"),wg=!0}/** +*/var Ns=new WeakMap,_g=!1;function Ln({view:e,element:t,text:i,isDirectHost:o=!0,keepOnFocus:n=!1}){let s=e.document;Ns.has(s)||(Ns.set(s,new Map),s.registerPostFixer(a=>Uu(Ns.get(s),a)),s.on("change:isComposing",()=>{e.change(a=>Uu(Ns.get(s),a))},{priority:"high"})),t.is("editableElement")&&t.on("change:placeholder",(a,l,c)=>r(c)),t.placeholder?r(t.placeholder):i&&r(i),i&&m4();function r(a){let l={text:a,isDirectHost:o,keepOnFocus:n,hostElement:o?t:null};Ns.get(s).set(t,l),e.change(c=>Uu([[t,l]],c))}}function ap(e,t){return t.hasClass("ck-placeholder")?!1:(e.addClass("ck-placeholder",t),!0)}function md(e,t){return t.hasClass("ck-placeholder")?(e.removeClass("ck-placeholder",t),!0):!1}function lp(e,t){if(!e.isAttached()||h4(e))return!1;let i=e.document,o=i.selection.anchor;return i.isComposing&&o&&o.parent===e?!1:t||!i.isFocused?!0:!!o&&o.parent!==e}function h4(e){for(let t of e.getChildren())if(!t.is("uiElement"))return!0;return!1}function Uu(e,t){let i=[],o=!1;for(let[n,s]of e)s.isDirectHost&&(i.push(n),vg(t,n,s)&&(o=!0));for(let[n,s]of e){if(s.isDirectHost)continue;let r=f4(n);r!==s.hostElement&&s.hostElement&&(t.removeAttribute("data-placeholder",s.hostElement),md(t,s.hostElement),s.hostElement=null,o=!0),r&&(i.includes(r)||(s.hostElement=r,vg(t,n,s)&&(o=!0)))}return o}function vg(e,t,i){let{text:o,isDirectHost:n,hostElement:s}=i,r=!1;return s.getAttribute("data-placeholder")!==o&&(e.setAttribute("data-placeholder",o,s),r=!0),(n||t.childCount==1)&&lp(s,i.keepOnFocus)?ap(e,s)&&(r=!0):md(e,s)&&(r=!0),r}function f4(e){if(e.childCount){let t=e.getChild(0);if(t.is("element")&&!t.is("uiElement")&&!t.is("attributeElement"))return t}return null}function m4(){_g||D("enableViewPlaceholder-deprecated-text-option"),_g=!0}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Co=class{is(){throw new Error("is() method is abstract")}};/** +*/var xo=class{is(){throw new Error("is() method is abstract")}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var f4=q(Co),xo=class extends f4{document;parent;constructor(e){super(),this.document=e,this.parent=null}get index(){let e;if(!this.parent)return null;if((e=this.parent.getChildIndex(this))==-1)throw new p("view-node-not-found-in-parent",this);return e}get nextSibling(){let e=this.index;return e!==null&&this.parent.getChild(e+1)||null}get previousSibling(){let e=this.index;return e!==null&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.root.is("rootElement")}getPath(){let e=[],t=this;for(;t.parent;)e.unshift(t.index),t=t.parent;return e}getAncestors(e={}){let t=[],i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}getCommonAncestor(e,t={}){let i=this.getAncestors(t),o=e.getAncestors(t),n=0;for(;i[n]==o[n]&&i[n];)n++;return n===0?null:i[n-1]}isBefore(e){if(this==e||this.root!==e.root)return!1;let t=this.getPath(),i=e.getPath(),o=ve(t,i);switch(o){case"prefix":return!0;case"extension":return!1;default:return t[o]e.data.length)throw new p("view-textproxy-wrong-offsetintext",this);if(i<0||t+i>e.data.length)throw new p("view-textproxy-wrong-length",this);this.data=e.data.substring(t,t+i),this.offsetInText=t}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}getAncestors(e={}){let t=[],i=e.includeSelf?this.textNode:this.parent;for(;i!==null;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}};hi.prototype.is=function(e){return e==="$textProxy"||e==="view:$textProxy"||e==="textProxy"||e==="view:textProxy"};/** +*/var mi=class extends xo{textNode;data;offsetInText;constructor(e,t,i){if(super(),this.textNode=e,t<0||t>e.data.length)throw new p("view-textproxy-wrong-offsetintext",this);if(i<0||t+i>e.data.length)throw new p("view-textproxy-wrong-length",this);this.data=e.data.substring(t,t+i),this.offsetInText=t}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}getAncestors(e={}){let t=[],i=e.includeSelf?this.textNode:this.parent;for(;i!==null;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}};mi.prototype.is=function(e){return e==="$textProxy"||e==="view:$textProxy"||e==="textProxy"||e==="view:textProxy"};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var m4=class ed{_consumables=new Map;add(t,i){let o;if(t.is("$text")||t.is("documentFragment")){this._consumables.set(t,!0);return}this._consumables.has(t)?o=this._consumables.get(t):(o=new g4(t),this._consumables.set(t,o)),o.add(i?$s(i):t._getConsumables())}test(t,i){let o=this._consumables.get(t);return o===void 0?null:t.is("$text")||t.is("documentFragment")?o:o.test($s(i))}consume(t,i){if(t.is("$text")||t.is("documentFragment"))return this.test(t,i)?(this._consumables.set(t,!1),!0):!1;let o=this._consumables.get(t);return o===void 0?!1:o.consume($s(i))}revert(t,i){let o=this._consumables.get(t);o!==void 0&&(t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!0):o.revert($s(i)))}static createFrom(t,i){if(i||(i=new ed),t.is("$text"))i.add(t);else if(t.is("element")||t.is("documentFragment")){i.add(t);for(let o of t.getChildren())ed.createFrom(o,i)}return i}},g4=class{element;_canConsumeName=null;_attributes=new Map;constructor(e){this.element=e}add(e){e.name&&(this._canConsumeName=!0);for(let[t,i]of e.attributes)if(i){let o=this._attributes.get(t);(!o||typeof o=="boolean")&&(o=new Map,this._attributes.set(t,o)),o.set(i,!0)}else{if(t=="style"||t=="class")throw new p("viewconsumable-invalid-attribute",this);this._attributes.set(t,!0)}}test(e){if(e.name&&!this._canConsumeName)return this._canConsumeName;for(let[t,i]of e.attributes){let o=this._attributes.get(t);if(o===void 0)return null;if(o===!1)return!1;if(o!==!0){if(i){let n=o.get(i);if(n===void 0)return null;if(!n)return!1}else for(let n of o.values())if(!n)return!1}}return!0}consume(e){if(!this.test(e))return!1;e.name&&(this._canConsumeName=!1);for(let[t,i]of e.attributes){let o=this._attributes.get(t);if(typeof o=="boolean")for(let[n]of this.element._getConsumables(t,i).attributes)this._attributes.set(n,!1);else if(i)for(let[,n]of this.element._getConsumables(t,i).attributes)o.set(n,!1);else for(let n of o.keys())o.set(n,!1)}return!0}revert(e){e.name&&(this._canConsumeName=!0);for(let[t,i]of e.attributes){let o=this._attributes.get(t);if(o===!1){this._attributes.set(t,!0);continue}if(!(o===void 0||o===!0))if(i)o.get(i)===!1&&o.set(i,!0);else for(let n of o.keys())o.set(n,!0)}}};function $s(e){let t=[];return"attributes"in e&&e.attributes&&Wu(t,e.attributes),"classes"in e&&e.classes&&Wu(t,e.classes,"class"),"styles"in e&&e.styles&&Wu(t,e.styles,"style"),{name:e.name||!1,attributes:t}}function Wu(e,t,i){if(typeof t=="string"){e.push(i?[i,t]:[t]);return}for(let o of t)Array.isArray(o)?e.push(o):e.push(i?[i,o]:[o])}/** +*/var p4=class id{_consumables=new Map;add(t,i){let o;if(t.is("$text")||t.is("documentFragment")){this._consumables.set(t,!0);return}this._consumables.has(t)?o=this._consumables.get(t):(o=new b4(t),this._consumables.set(t,o)),o.add(i?$s(i):t._getConsumables())}test(t,i){let o=this._consumables.get(t);return o===void 0?null:t.is("$text")||t.is("documentFragment")?o:o.test($s(i))}consume(t,i){if(t.is("$text")||t.is("documentFragment"))return this.test(t,i)?(this._consumables.set(t,!1),!0):!1;let o=this._consumables.get(t);return o===void 0?!1:o.consume($s(i))}revert(t,i){let o=this._consumables.get(t);o!==void 0&&(t.is("$text")||t.is("documentFragment")?this._consumables.set(t,!0):o.revert($s(i)))}static createFrom(t,i){if(i||(i=new id),t.is("$text"))i.add(t);else if(t.is("element")||t.is("documentFragment")){i.add(t);for(let o of t.getChildren())id.createFrom(o,i)}return i}},b4=class{element;_canConsumeName=null;_attributes=new Map;constructor(e){this.element=e}add(e){e.name&&(this._canConsumeName=!0);for(let[t,i]of e.attributes)if(i){let o=this._attributes.get(t);(!o||typeof o=="boolean")&&(o=new Map,this._attributes.set(t,o)),o.set(i,!0)}else{if(t=="style"||t=="class")throw new p("viewconsumable-invalid-attribute",this);this._attributes.set(t,!0)}}test(e){if(e.name&&!this._canConsumeName)return this._canConsumeName;for(let[t,i]of e.attributes){let o=this._attributes.get(t);if(o===void 0)return null;if(o===!1)return!1;if(o!==!0){if(i){let n=o.get(i);if(n===void 0)return null;if(!n)return!1}else for(let n of o.values())if(!n)return!1}}return!0}consume(e){if(!this.test(e))return!1;e.name&&(this._canConsumeName=!1);for(let[t,i]of e.attributes){let o=this._attributes.get(t);if(typeof o=="boolean")for(let[n]of this.element._getConsumables(t,i).attributes)this._attributes.set(n,!1);else if(i)for(let[,n]of this.element._getConsumables(t,i).attributes)o.set(n,!1);else for(let n of o.keys())o.set(n,!1)}return!0}revert(e){e.name&&(this._canConsumeName=!0);for(let[t,i]of e.attributes){let o=this._attributes.get(t);if(o===!1){this._attributes.set(t,!0);continue}if(!(o===void 0||o===!0))if(i)o.get(i)===!1&&o.set(i,!0);else for(let n of o.keys())o.set(n,!0)}}};function $s(e){let t=[];return"attributes"in e&&e.attributes&&qu(t,e.attributes),"classes"in e&&e.classes&&qu(t,e.classes,"class"),"styles"in e&&e.styles&&qu(t,e.styles,"style"),{name:e.name||!1,attributes:t}}function qu(e,t,i){if(typeof t=="string"){e.push(i?[i,t]:[t]);return}for(let o of t)Array.isArray(o)?e.push(o):e.push(i?[i,o]:[o])}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var We=class{_patterns=[];constructor(...e){this.add(...e)}add(...e){for(let t of e)(typeof t=="string"||t instanceof RegExp)&&(t={name:t}),this._patterns.push(t)}match(...e){for(let t of e)for(let i of this._patterns){let o=this._isElementMatching(t,i);if(o)return{element:t,pattern:i,match:o}}return null}matchAll(...e){let t=[];for(let i of e)for(let o of this._patterns){let n=this._isElementMatching(i,o);n&&t.push({element:i,pattern:o,match:n})}return t.length>0?t:null}getElementName(){if(this._patterns.length!==1)return null;let e=this._patterns[0],t=e.name;return typeof e!="function"&&t&&!(t instanceof RegExp)?t:null}_isElementMatching(e,t){if(typeof t=="function"){let n=t(e);return!n||typeof n!="object"?n:$s(n)}let i={};if(t.name&&(i.name=p4(t.name,e.name),!i.name))return null;let o=[];return t.attributes&&!b4(t.attributes,e,o)||t.classes&&!w4(t.classes,e,o)||t.styles&&!y4(t.styles,e,o)?null:(o.length&&(i.attributes=o),i)}};function il(e,t){return e===!0||e===t||e instanceof RegExp&&!!String(t).match(e)}function p4(e,t){return e instanceof RegExp?!!t.match(e):e===t}function fd(e,t){if(Array.isArray(e))return e.map(o=>typeof o!="object"||o instanceof RegExp?t?[t,o,!0]:[o,!0]:((o.key===void 0||o.value===void 0)&&D("matcher-pattern-missing-key-or-value",o),t?[t,o.key,o.value]:[o.key,o.value]));if(typeof e!="object"||e instanceof RegExp)return[t?[t,e,!0]:[e,!0]];let i=[];for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&i.push(t?[t,o,e[o]]:[o,e[o]]);return i}function b4(e,t,i){let o;return typeof e=="object"&&!(e instanceof RegExp)&&!Array.isArray(e)?(e.style!==void 0&&D("matcher-pattern-deprecated-attributes-style-key",e),e.class!==void 0&&D("matcher-pattern-deprecated-attributes-class-key",e)):o=["class","style"],t._collectAttributesMatch(fd(e),i,o)}function w4(e,t,i){return t._collectAttributesMatch(fd(e,"class"),i)}function y4(e,t,i){return t._collectAttributesMatch(fd(e,"style"),i)}/** +*/var We=class{_patterns=[];constructor(...e){this.add(...e)}add(...e){for(let t of e)(typeof t=="string"||t instanceof RegExp)&&(t={name:t}),this._patterns.push(t)}match(...e){for(let t of e)for(let i of this._patterns){let o=this._isElementMatching(t,i);if(o)return{element:t,pattern:i,match:o}}return null}matchAll(...e){let t=[];for(let i of e)for(let o of this._patterns){let n=this._isElementMatching(i,o);n&&t.push({element:i,pattern:o,match:n})}return t.length>0?t:null}getElementName(){if(this._patterns.length!==1)return null;let e=this._patterns[0],t=e.name;return typeof e!="function"&&t&&!(t instanceof RegExp)?t:null}_isElementMatching(e,t){if(typeof t=="function"){let n=t(e);return!n||typeof n!="object"?n:$s(n)}let i={};if(t.name&&(i.name=w4(t.name,e.name),!i.name))return null;let o=[];return t.attributes&&!y4(t.attributes,e,o)||t.classes&&!_4(t.classes,e,o)||t.styles&&!v4(t.styles,e,o)?null:(o.length&&(i.attributes=o),i)}};function ol(e,t){return e===!0||e===t||e instanceof RegExp&&!!String(t).match(e)}function w4(e,t){return e instanceof RegExp?!!t.match(e):e===t}function gd(e,t){if(Array.isArray(e))return e.map(o=>typeof o!="object"||o instanceof RegExp?t?[t,o,!0]:[o,!0]:((o.key===void 0||o.value===void 0)&&D("matcher-pattern-missing-key-or-value",o),t?[t,o.key,o.value]:[o.key,o.value]));if(typeof e!="object"||e instanceof RegExp)return[t?[t,e,!0]:[e,!0]];let i=[];for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&i.push(t?[t,o,e[o]]:[o,e[o]]);return i}function y4(e,t,i){let o;return typeof e=="object"&&!(e instanceof RegExp)&&!Array.isArray(e)?(e.style!==void 0&&D("matcher-pattern-deprecated-attributes-style-key",e),e.class!==void 0&&D("matcher-pattern-deprecated-attributes-class-key",e)):o=["class","style"],t._collectAttributesMatch(gd(e),i,o)}function _4(e,t,i){return t._collectAttributesMatch(gd(e,"class"),i)}function v4(e,t,i){return t._collectAttributesMatch(gd(e,"style"),i)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Ks=class{_styles;_cachedStyleNames=null;_cachedExpandedStyleNames=null;_styleProcessor;constructor(e){this._styles={},this._styleProcessor=e}get isEmpty(){return!Object.entries(this._styles).length}get size(){return this.isEmpty?0:this.getStyleNames().length}setTo(e){this.clear();let t=_4(e);for(let[i,o]of t)this._styleProcessor.toNormalizedForm(i,o,this._styles);return this}has(e){if(this.isEmpty)return!1;let t=this._styleProcessor.getReducedForm(e,this._styles).find(([i])=>i===e);return Array.isArray(t)}set(e,t){if(this._cachedStyleNames=null,this._cachedExpandedStyleNames=null,ae(e))for(let[i,o]of Object.entries(e))this._styleProcessor.toNormalizedForm(i,o,this._styles);else this._styleProcessor.toNormalizedForm(e,t,this._styles)}remove(e){let t={};for(let i of j(e)){let o=td(i),n=Ge(this._styles,o);if(n)Ga(t,o,n);else{let s=this.getAsString(i);s!==void 0&&this._styleProcessor.toNormalizedForm(i,s,t)}}Object.keys(t).length&&(lp(this._styles,t),this._cachedStyleNames=null,this._cachedExpandedStyleNames=null)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){return this.isEmpty?"":this.getStylesEntries().map(e=>e.join(":")).sort().join(";")+";"}getAsString(e){if(this.isEmpty)return;if(this._styles[e]&&!ae(this._styles[e]))return this._styles[e];let t=this._styleProcessor.getReducedForm(e,this._styles).find(([i])=>i===e);if(Array.isArray(t))return t[1]}getStyleNames(e=!1){return this.isEmpty?[]:e?(this._cachedExpandedStyleNames||=this._styleProcessor.getStyleNames(this._styles),this._cachedExpandedStyleNames):(this._cachedStyleNames||=this.getStylesEntries().map(([t])=>t),this._cachedStyleNames)}keys(){return this.getStyleNames()}clear(){this._styles={},this._cachedStyleNames=null,this._cachedExpandedStyleNames=null}isSimilar(e){if(this.size!==e.size)return!1;for(let t of this.getStyleNames())if(!e.has(t)||e.getAsString(t)!==this.getAsString(t))return!1;return!0}getStylesEntries(){let e=[],t=Object.keys(this._styles);for(let i of t)e.push(...this._styleProcessor.getReducedForm(i,this._styles));return e}_clone(){let e=new this.constructor(this._styleProcessor);return e.set(this.getNormalized()),e}_getTokensMatch(e,t){let i=[];for(let o of this.getStyleNames(!0))if(il(e,o)){if(t===!0){i.push(o);continue}let n=this.getAsString(o);il(t,n)&&i.push(o)}return i.length?i:void 0}_getConsumables(e){let t=[];if(e){t.push(e);for(let i of this._styleProcessor.getRelatedStyles(e))t.push(i)}else for(let i of this.getStyleNames()){for(let o of this._styleProcessor.getRelatedStyles(i))t.push(o);t.push(i)}return t}_canMergeFrom(e){for(let t of e.getStyleNames())if(this.has(t)&&this.getAsString(t)!==e.getAsString(t))return!1;return!0}_mergeFrom(e){for(let t of e.getStyleNames())this.has(t)||this.set(t,e.getAsString(t))}_isMatching(e){for(let t of e.getStyleNames())if(!this.has(t)||this.getAsString(t)!==e.getAsString(t))return!1;return!0}},ap=class{_normalizers;_extractors;_reducers;_consumables;constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(e,t,i){if(ae(t)){Ga(i,td(e),t);return}if(this._normalizers.has(e)){let{path:o,value:n}=this._normalizers.get(e)(t);Ga(i,o,n)}else Ga(i,e,t)}getNormalized(e,t){if(!e)return _n({},t);if(t[e]!==void 0)return t[e];if(this._extractors.has(e)){let i=this._extractors.get(e);if(typeof i=="string")return Ge(t,i);let o=i(e,t);if(o)return o}return Ge(t,td(e))}getReducedForm(e,t){let i=this.getNormalized(e,t);return i===void 0?[]:this._reducers.has(e)?this._reducers.get(e)(i):[[e,i]]}getStyleNames(e){let t=new Set;for(let i of this._consumables.keys()){let o=this.getNormalized(i,e);o&&(typeof o!="object"||Object.keys(o).length)&&t.add(i)}for(let i of Object.keys(e))t.add(i);return Array.from(t)}getRelatedStyles(e){return this._consumables.get(e)||[]}setNormalizer(e,t){this._normalizers.set(e,t)}setExtractor(e,t){this._extractors.set(e,t)}setReducer(e,t){this._reducers.set(e,t)}setStyleRelation(e,t){this._mapStyleNames(e,t);for(let i of t)this._mapStyleNames(i,[e])}_mapStyleNames(e,t){this._consumables.has(e)||this._consumables.set(e,[]),this._consumables.get(e).push(...t)}};function _4(e){let t=null,i=0,o=0,n=null,s=new Map;if(e==="")return s;e.charAt(e.length-1)!=";"&&(e=e+";");for(let r=0;ri===e);return Array.isArray(t)}set(e,t){if(this._cachedStyleNames=null,this._cachedExpandedStyleNames=null,ae(e))for(let[i,o]of Object.entries(e))this._styleProcessor.toNormalizedForm(i,o,this._styles);else this._styleProcessor.toNormalizedForm(e,t,this._styles)}remove(e){let t={};for(let i of j(e)){let o=od(i),n=Ge(this._styles,o);if(n)Ja(t,o,n);else{let s=this.getAsString(i);s!==void 0&&this._styleProcessor.toNormalizedForm(i,s,t)}}Object.keys(t).length&&(up(this._styles,t),this._cachedStyleNames=null,this._cachedExpandedStyleNames=null)}getNormalized(e){return this._styleProcessor.getNormalized(e,this._styles)}toString(){return this.isEmpty?"":this.getStylesEntries().map(e=>e.join(":")).sort().join(";")+";"}getAsString(e){if(this.isEmpty)return;if(this._styles[e]&&!ae(this._styles[e]))return this._styles[e];let t=this._styleProcessor.getReducedForm(e,this._styles).find(([i])=>i===e);if(Array.isArray(t))return t[1]}getStyleNames(e=!1){return this.isEmpty?[]:e?(this._cachedExpandedStyleNames||=this._styleProcessor.getStyleNames(this._styles),this._cachedExpandedStyleNames):(this._cachedStyleNames||=this.getStylesEntries().map(([t])=>t),this._cachedStyleNames)}keys(){return this.getStyleNames()}clear(){this._styles={},this._cachedStyleNames=null,this._cachedExpandedStyleNames=null}isSimilar(e){if(this.size!==e.size)return!1;for(let t of this.getStyleNames())if(!e.has(t)||e.getAsString(t)!==this.getAsString(t))return!1;return!0}getStylesEntries(){let e=[],t=Object.keys(this._styles);for(let i of t)e.push(...this._styleProcessor.getReducedForm(i,this._styles));return e}_clone(){let e=new this.constructor(this._styleProcessor);return e.set(this.getNormalized()),e}_getTokensMatch(e,t){let i=[];for(let o of this.getStyleNames(!0))if(ol(e,o)){if(t===!0){i.push(o);continue}let n=this.getAsString(o);ol(t,n)&&i.push(o)}return i.length?i:void 0}_getConsumables(e){let t=[];if(e){t.push(e);for(let i of this._styleProcessor.getRelatedStyles(e))t.push(i)}else for(let i of this.getStyleNames()){for(let o of this._styleProcessor.getRelatedStyles(i))t.push(o);t.push(i)}return t}_canMergeFrom(e){for(let t of e.getStyleNames())if(this.has(t)&&this.getAsString(t)!==e.getAsString(t))return!1;return!0}_mergeFrom(e){for(let t of e.getStyleNames())this.has(t)||this.set(t,e.getAsString(t))}_isMatching(e){for(let t of e.getStyleNames())if(!this.has(t)||this.getAsString(t)!==e.getAsString(t))return!1;return!0}},cp=class{_normalizers;_extractors;_reducers;_consumables;constructor(){this._normalizers=new Map,this._extractors=new Map,this._reducers=new Map,this._consumables=new Map}toNormalizedForm(e,t,i){if(ae(t)){Ja(i,od(e),t);return}if(this._normalizers.has(e)){let{path:o,value:n}=this._normalizers.get(e)(t);Ja(i,o,n)}else Ja(i,e,t)}getNormalized(e,t){if(!e)return _n({},t);if(t[e]!==void 0)return t[e];if(this._extractors.has(e)){let i=this._extractors.get(e);if(typeof i=="string")return Ge(t,i);let o=i(e,t);if(o)return o}return Ge(t,od(e))}getReducedForm(e,t){let i=this.getNormalized(e,t);return i===void 0?[]:this._reducers.has(e)?this._reducers.get(e)(i):[[e,i]]}getStyleNames(e){let t=new Set;for(let i of this._consumables.keys()){let o=this.getNormalized(i,e);o&&(typeof o!="object"||Object.keys(o).length)&&t.add(i)}for(let i of Object.keys(e))t.add(i);return Array.from(t)}getRelatedStyles(e){return this._consumables.get(e)||[]}setNormalizer(e,t){this._normalizers.set(e,t)}setExtractor(e,t){this._extractors.set(e,t)}setReducer(e,t){this._reducers.set(e,t)}setStyleRelation(e,t){this._mapStyleNames(e,t);for(let i of t)this._mapStyleNames(i,[e])}_mapStyleNames(e,t){this._consumables.has(e)||this._consumables.set(e,[]),this._consumables.get(e).push(...t)}};function k4(e){let t=null,i=0,o=0,n=null,s=new Map;if(e==="")return s;e.charAt(e.length-1)!=";"&&(e=e+";");for(let r=0;rn!="style"&&n!="class").map(n=>`${n[0]}="${n[1]}"`).sort().join(" ");return this.name+(t==""?"":` class="${t}"`)+(i?` style="${i}"`:"")+(o==""?"":` ${o}`)}shouldRenderUnsafeAttribute(t){return this._unsafeAttributesToRender.includes(t)}toJSON(){let t=super.toJSON();if(t.name=this.name,t.type="Element",this._attrs.size&&(t.attributes=Object.fromEntries(this.getAttributes())),this._children.length>0){t.children=[];for(let i of this._children)t.children.push(i.toJSON())}return t}_clone(t=!1){let i=[];if(t)for(let n of this.getChildren())i.push(n._clone(t));let o=new this.constructor(this.document,this.name,this._attrs,i);return o._customProperties=new Map(this._customProperties),o.getFillerOffset=this.getFillerOffset,o._unsafeAttributesToRender=this._unsafeAttributesToRender,o}_appendChild(t){return this._insertChild(this.childCount,t)}_insertChild(t,i){this._fireChange("children",this,{index:t});let o=0,n=v4(this.document,i);for(let s of n)s.parent!==null&&s._remove(),s.parent=this,s.document=this.document,this._children.splice(t,0,s),t++,o++;return o}_removeChildren(t,i=1){this._fireChange("children",this,{index:t});for(let o=t;on!="style"&&n!="class").map(n=>`${n[0]}="${n[1]}"`).sort().join(" ");return this.name+(t==""?"":` class="${t}"`)+(i?` style="${i}"`:"")+(o==""?"":` ${o}`)}shouldRenderUnsafeAttribute(t){return this._unsafeAttributesToRender.includes(t)}toJSON(){let t=super.toJSON();if(t.name=this.name,t.type="Element",this._attrs.size&&(t.attributes=Object.fromEntries(this.getAttributes())),this._children.length>0){t.children=[];for(let i of this._children)t.children.push(i.toJSON())}return t}_clone(t=!1){let i=[];if(t)for(let n of this.getChildren())i.push(n._clone(t));let o=new this.constructor(this.document,this.name,this._attrs,i);return o._customProperties=new Map(this._customProperties),o.getFillerOffset=this.getFillerOffset,o._unsafeAttributesToRender=this._unsafeAttributesToRender,o}_appendChild(t){return this._insertChild(this.childCount,t)}_insertChild(t,i){this._fireChange("children",this,{index:t});let o=0,n=C4(this.document,i);for(let s of n)s.parent!==null&&s._remove(),s.parent=this,s.document=this.document,this._children.splice(t,0,s),t++,o++;return o}_removeChildren(t,i=1){this._fireChange("children",this,{index:t});for(let o=t;on&&e.selection.editableElement==this),this.listenTo(e.selection,"change",()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this})}destroy(){this.stopListening()}toJSON(){let e=super.toJSON();return e.type="EditableElement",e.isReadOnly=this.isReadOnly,e.isFocused=this.isFocused,e}};nl.prototype.is=function(e,t){return t?t===this.name&&(e==="editableElement"||e==="view:editableElement"||e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"):e==="editableElement"||e==="view:editableElement"||e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"};/** +*/var x4=W(Xs),sl=class extends x4{constructor(e,t,i,o){super(e,t,i,o),this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("placeholder",void 0),this.bind("isReadOnly").to(e),this.bind("isFocused").to(e,"isFocused",n=>n&&e.selection.editableElement==this),this.listenTo(e.selection,"change",()=>{this.isFocused=e.isFocused&&e.selection.editableElement==this})}destroy(){this.stopListening()}toJSON(){let e=super.toJSON();return e.type="EditableElement",e.isReadOnly=this.isReadOnly,e.isFocused=this.isFocused,e}};sl.prototype.is=function(e,t){return t?t===this.name&&(e==="editableElement"||e==="view:editableElement"||e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"):e==="editableElement"||e==="view:editableElement"||e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var _g=Symbol("rootName"),dp=class extends nl{constructor(e,t){super(e,t),this.rootName="main"}get rootName(){return this.getCustomProperty(_g)}set rootName(e){this._setCustomProperty(_g,e)}toJSON(){return this.rootName}set _name(e){this.name=e}};dp.prototype.is=function(e,t){return t?t===this.name&&(e==="rootElement"||e==="view:rootElement"||e==="editableElement"||e==="view:editableElement"||e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"):e==="rootElement"||e==="view:rootElement"||e==="editableElement"||e==="view:editableElement"||e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"};/** +*/var kg=Symbol("rootName"),fp=class extends sl{constructor(e,t){super(e,t),this.rootName="main"}get rootName(){return this.getCustomProperty(kg)}set rootName(e){this._setCustomProperty(kg,e)}toJSON(){return this.rootName}set _name(e){this.name=e}};fp.prototype.is=function(e,t){return t?t===this.name&&(e==="rootElement"||e==="view:rootElement"||e==="editableElement"||e==="view:editableElement"||e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"):e==="rootElement"||e==="view:rootElement"||e==="editableElement"||e==="view:editableElement"||e==="containerElement"||e==="view:containerElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var _o=class{direction;boundaries;singleCharacters;shallow;ignoreElementEnd;_position;_boundaryStartParent;_boundaryEndParent;constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new p("view-tree-walker-no-start-position",null);if(e.direction&&e.direction!="forward"&&e.direction!="backward")throw new p("view-tree-walker-unknown-direction",e.startPosition,{direction:e.direction});this.boundaries=e.boundaries||null,e.startPosition?this._position=P._createAt(e.startPosition):this._position=P._createAt(e.boundaries[e.direction=="backward"?"end":"start"]),this.direction=e.direction||"forward",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}get position(){return this._position}skip(e){let t,i;do i=this.position,t=this.next();while(!t.done&&e(t.value));t.done||(this._position=i)}jumpTo(e){this._boundaryStartParent&&e.isBefore(this.boundaries.start)?e=this.boundaries.start:this._boundaryEndParent&&e.isAfter(this.boundaries.end)&&(e=this.boundaries.end),this._position=e.clone()}next(){return this.direction=="forward"?this._next():this._previous()}_next(){let e=this.position.clone(),t=this.position,i=e.parent;if(i.parent===null&&e.offset===i.childCount)return{done:!0,value:void 0};if(i===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0,value:void 0};let o;if(i&&i.is("view:$text")){if(e.isAtEnd)return this._position=P._createAfter(i),this._next();o=i.data[e.offset]}else o=i.getChild(e.offset);if(typeof o=="string"){let n;this.singleCharacters?n=1:n=(i===this._boundaryEndParent?this.boundaries.end.offset:i.data.length)-e.offset;let s=new hi(i,e.offset,n);return e.offset+=n,this._position=e,this._formatReturnValue("text",s,t,e,n)}if(o&&o.is("view:element")){if(!this.shallow)e=new P(o,0);else{if(this.boundaries&&this.boundaries.end.isBefore(e))return{done:!0,value:void 0};e.offset++}return this._position=e,this._formatReturnValue("elementStart",o,t,e,1)}if(o&&o.is("view:$text")){if(this.singleCharacters)return e=new P(o,0),this._position=e,this._next();let n=o.data.length,s;return o==this._boundaryEndParent?(n=this.boundaries.end.offset,s=new hi(o,0,n),e=P._createAfter(s)):(s=new hi(o,0,o.data.length),e.offset++),this._position=e,this._formatReturnValue("text",s,t,e,n)}return e=P._createAfter(i),this._position=e,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",i,t,e)}_previous(){let e=this.position.clone(),t=this.position,i=e.parent;if(i.parent===null&&e.offset===0)return{done:!0,value:void 0};if(i==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0,value:void 0};let o;if(i.is("view:$text")){if(e.isAtStart)return this._position=P._createBefore(i),this._previous();o=i.data[e.offset-1]}else o=i.getChild(e.offset-1);if(typeof o=="string"){let n;if(this.singleCharacters)n=1;else{let r=i===this._boundaryStartParent?this.boundaries.start.offset:0;n=e.offset-r}e.offset-=n;let s=new hi(i,e.offset,n);return this._position=e,this._formatReturnValue("text",s,t,e,n)}if(o&&o.is("view:element"))return this.shallow?(e.offset--,this._position=e,this._formatReturnValue("elementStart",o,t,e,1)):(e=new P(o,o.childCount),this._position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",o,t,e));if(o&&o.is("view:$text")){if(this.singleCharacters)return e=new P(o,o.data.length),this._position=e,this._previous();let n=o.data.length,s;if(o==this._boundaryStartParent){let r=this.boundaries.start.offset;s=new hi(o,r,o.data.length-r),n=s.data.length,e=P._createBefore(s)}else s=new hi(o,0,o.data.length),e.offset--;return this._position=e,this._formatReturnValue("text",s,t,e,n)}return e=P._createBefore(i),this._position=e,this._formatReturnValue("elementStart",i,t,e,1)}_formatReturnValue(e,t,i,o,n){return t.is("view:$textProxy")&&(t.offsetInText+t.data.length==t.textNode.data.length&&(this.direction=="forward"&&!(this.boundaries&&this.boundaries.end.isEqual(this.position))?(o=P._createAfter(t.textNode),this._position=o):i=P._createAfter(t.textNode)),t.offsetInText===0&&(this.direction=="backward"&&!(this.boundaries&&this.boundaries.start.isEqual(this.position))?(o=P._createBefore(t.textNode),this._position=o):i=P._createBefore(t.textNode))),{done:!1,value:{type:e,item:t,previousPosition:i,nextPosition:o,length:n}}}};/** +*/var vo=class{direction;boundaries;singleCharacters;shallow;ignoreElementEnd;_position;_boundaryStartParent;_boundaryEndParent;constructor(e={}){if(!e.boundaries&&!e.startPosition)throw new p("view-tree-walker-no-start-position",null);if(e.direction&&e.direction!="forward"&&e.direction!="backward")throw new p("view-tree-walker-unknown-direction",e.startPosition,{direction:e.direction});this.boundaries=e.boundaries||null,e.startPosition?this._position=P._createAt(e.startPosition):this._position=P._createAt(e.boundaries[e.direction=="backward"?"end":"start"]),this.direction=e.direction||"forward",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null}[Symbol.iterator](){return this}get position(){return this._position}skip(e){let t,i;do i=this.position,t=this.next();while(!t.done&&e(t.value));t.done||(this._position=i)}jumpTo(e){this._boundaryStartParent&&e.isBefore(this.boundaries.start)?e=this.boundaries.start:this._boundaryEndParent&&e.isAfter(this.boundaries.end)&&(e=this.boundaries.end),this._position=e.clone()}next(){return this.direction=="forward"?this._next():this._previous()}_next(){let e=this.position.clone(),t=this.position,i=e.parent;if(i.parent===null&&e.offset===i.childCount)return{done:!0,value:void 0};if(i===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0,value:void 0};let o;if(i&&i.is("view:$text")){if(e.isAtEnd)return this._position=P._createAfter(i),this._next();o=i.data[e.offset]}else o=i.getChild(e.offset);if(typeof o=="string"){let n;this.singleCharacters?n=1:n=(i===this._boundaryEndParent?this.boundaries.end.offset:i.data.length)-e.offset;let s=new mi(i,e.offset,n);return e.offset+=n,this._position=e,this._formatReturnValue("text",s,t,e,n)}if(o&&o.is("view:element")){if(!this.shallow)e=new P(o,0);else{if(this.boundaries&&this.boundaries.end.isBefore(e))return{done:!0,value:void 0};e.offset++}return this._position=e,this._formatReturnValue("elementStart",o,t,e,1)}if(o&&o.is("view:$text")){if(this.singleCharacters)return e=new P(o,0),this._position=e,this._next();let n=o.data.length,s;return o==this._boundaryEndParent?(n=this.boundaries.end.offset,s=new mi(o,0,n),e=P._createAfter(s)):(s=new mi(o,0,o.data.length),e.offset++),this._position=e,this._formatReturnValue("text",s,t,e,n)}return e=P._createAfter(i),this._position=e,this.ignoreElementEnd?this._next():this._formatReturnValue("elementEnd",i,t,e)}_previous(){let e=this.position.clone(),t=this.position,i=e.parent;if(i.parent===null&&e.offset===0)return{done:!0,value:void 0};if(i==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0,value:void 0};let o;if(i.is("view:$text")){if(e.isAtStart)return this._position=P._createBefore(i),this._previous();o=i.data[e.offset-1]}else o=i.getChild(e.offset-1);if(typeof o=="string"){let n;if(this.singleCharacters)n=1;else{let r=i===this._boundaryStartParent?this.boundaries.start.offset:0;n=e.offset-r}e.offset-=n;let s=new mi(i,e.offset,n);return this._position=e,this._formatReturnValue("text",s,t,e,n)}if(o&&o.is("view:element"))return this.shallow?(e.offset--,this._position=e,this._formatReturnValue("elementStart",o,t,e,1)):(e=new P(o,o.childCount),this._position=e,this.ignoreElementEnd?this._previous():this._formatReturnValue("elementEnd",o,t,e));if(o&&o.is("view:$text")){if(this.singleCharacters)return e=new P(o,o.data.length),this._position=e,this._previous();let n=o.data.length,s;if(o==this._boundaryStartParent){let r=this.boundaries.start.offset;s=new mi(o,r,o.data.length-r),n=s.data.length,e=P._createBefore(s)}else s=new mi(o,0,o.data.length),e.offset--;return this._position=e,this._formatReturnValue("text",s,t,e,n)}return e=P._createBefore(i),this._position=e,this._formatReturnValue("elementStart",i,t,e,1)}_formatReturnValue(e,t,i,o,n){return t.is("view:$textProxy")&&(t.offsetInText+t.data.length==t.textNode.data.length&&(this.direction=="forward"&&!(this.boundaries&&this.boundaries.end.isEqual(this.position))?(o=P._createAfter(t.textNode),this._position=o):i=P._createAfter(t.textNode)),t.offsetInText===0&&(this.direction=="backward"&&!(this.boundaries&&this.boundaries.start.isEqual(this.position))?(o=P._createBefore(t.textNode),this._position=o):i=P._createBefore(t.textNode))),{done:!1,value:{type:e,item:t,previousPosition:i,nextPosition:o,length:n}}}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var P=class ui extends Co{parent;offset;constructor(t,i){super(),this.parent=t,this.offset=i}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 this.offset===0}get isAtEnd(){let 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 nl);)if(t.parent)t=t.parent;else return null;return t}getShiftedBy(t){let i=ui._createAt(this),o=i.offset+t;return i.offset=o<0?0:o,i}getLastMatchingPosition(t,i={}){i.startPosition=this;let o=new _o(i);return o.skip(t),o.position}getAncestors(){return this.parent.is("documentFragment")?[this.parent]:this.parent.getAncestors({includeSelf:!0})}getCommonAncestor(t){let i=this.getAncestors(),o=t.getAncestors(),n=0;for(;i[n]==o[n]&&i[n];)n++;return n===0?null:i[n-1]}isEqual(t){return this.parent==t.parent&&this.offset==t.offset}isBefore(t){return this.compareWith(t)=="before"}isAfter(t){return this.compareWith(t)=="after"}compareWith(t){if(this.root!==t.root)return"different";if(this.isEqual(t))return"same";let i=this.parent.is("node")?this.parent.getPath():[],o=t.parent.is("node")?t.parent.getPath():[];i.push(this.offset),o.push(t.offset);let n=ve(i,o);switch(n){case"prefix":return"before";case"extension":return"after";default:return i[n]0?new this(o,n):new this(n,o)}static _createIn(t){return this._createFromParentsAndOffsets(t,0,t,t.childCount)}static _createOn(t){let i=t.is("$textProxy")?t.offsetSize:1;return this._createFromPositionAndShift(P._createBefore(t),i)}};N.prototype.is=function(e){return e==="range"||e==="view:range"};function Ha(e){return!!(e.item.is("attributeElement")||e.item.is("uiElement"))}/** +*/var N=class Ui extends xo{start;end;constructor(t,i=null){super(),this.start=t.clone(),this.end=i?i.clone():t.clone()}*[Symbol.iterator](){yield*new vo({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){return this.start.parent===this.end.parent}get root(){return this.start.root}getEnlarged(){let t=this.start.getLastMatchingPosition(Wa,{direction:"backward"}),i=this.end.getLastMatchingPosition(Wa);return t.parent.is("$text")&&t.isAtStart&&(t=P._createBefore(t.parent)),i.parent.is("$text")&&i.isAtEnd&&(i=P._createAfter(i.parent)),new Ui(t,i)}getTrimmed(){let t=this.start.getLastMatchingPosition(Wa);if(t.isAfter(this.end)||t.isEqual(this.end))return new Ui(t,t);let i=this.end.getLastMatchingPosition(Wa,{direction:"backward"}),o=t.nodeAfter,n=i.nodeBefore;return o&&o.is("$text")&&(t=new P(o,0)),n&&n.is("$text")&&(i=new P(n,n.data.length)),new Ui(t,i)}isEqual(t){return this==t||this.start.isEqual(t.start)&&this.end.isEqual(t.end)}containsPosition(t){return t.isAfter(this.start)&&t.isBefore(this.end)}containsRange(t,i=!1){t.isCollapsed&&(i=!1);let o=this.containsPosition(t.start)||i&&this.start.isEqual(t.start),n=this.containsPosition(t.end)||i&&this.end.isEqual(t.end);return o&&n}getDifference(t){let i=[];return this.isIntersecting(t)?(this.containsPosition(t.start)&&i.push(new Ui(this.start,t.start)),this.containsPosition(t.end)&&i.push(new Ui(t.end,this.end))):i.push(this.clone()),i}getIntersection(t){if(this.isIntersecting(t)){let i=this.start,o=this.end;return this.containsPosition(t.start)&&(i=t.start),this.containsPosition(t.end)&&(o=t.end),new Ui(i,o)}return null}getWalker(t={}){return t.boundaries=this,new vo(t)}getCommonAncestor(){return this.start.getCommonAncestor(this.end)}getContainedElement(){if(this.isCollapsed)return null;let t=this.start.nodeAfter,i=this.end.nodeBefore;return this.start.parent.is("$text")&&this.start.isAtEnd&&this.start.parent.nextSibling&&(t=this.start.parent.nextSibling),this.end.parent.is("$text")&&this.end.isAtStart&&this.end.parent.previousSibling&&(i=this.end.parent.previousSibling),t&&t.is("element")&&t===i?t:null}clone(){return new Ui(this.start,this.end)}*getItems(t={}){t.boundaries=this,t.ignoreElementEnd=!0;let i=new vo(t);for(let o of i)yield o.item}*getPositions(t={}){t.boundaries=this;let i=new vo(t);yield i.position;for(let o of i)yield o.nextPosition}isIntersecting(t){return this.start.isBefore(t.end)&&this.end.isAfter(t.start)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}static _createFromParentsAndOffsets(t,i,o,n){return new this(new P(t,i),new P(o,n))}static _createFromPositionAndShift(t,i){let o=t,n=t.getShiftedBy(i);return i>0?new this(o,n):new this(n,o)}static _createIn(t){return this._createFromParentsAndOffsets(t,0,t,t.childCount)}static _createOn(t){let i=t.is("$textProxy")?t.offsetSize:1;return this._createFromPositionAndShift(P._createBefore(t),i)}};N.prototype.is=function(e){return e==="range"||e==="view:range"};function Wa(e){return!!(e.item.is("attributeElement")||e.item.is("uiElement"))}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var C4=q(Co),fi=class hp extends C4{_ranges;_lastRangeBackward;_isFake;_fakeSelectionLabel;constructor(...t){super(),this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",t.length&&this.setTo(...t)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;let t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.end:t.start).clone()}get focus(){if(!this._ranges.length)return null;let t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.start:t.end).clone()}get isCollapsed(){return this.rangeCount===1&&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(let t of this._ranges)yield t.clone()}getFirstRange(){let t=null;for(let i of this._ranges)(!t||i.start.isBefore(t.start))&&(t=i);return t?t.clone():null}getLastRange(){let t=null;for(let i of this._ranges)(!t||i.end.isAfter(t.end))&&(t=i);return t?t.clone():null}getFirstPosition(){let t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){let t=this.getLastRange();return t?t.end.clone():null}isEqual(t){if(this.isFake!=t.isFake||this.isFake&&this.fakeSelectionLabel!=t.fakeSelectionLabel||this.rangeCount!=t.rangeCount)return!1;if(this.rangeCount===0)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(let i of this._ranges){let o=!1;for(let n of t._ranges)if(i.isEqual(n)){o=!0;break}if(!o)return!1}return!0}isSimilar(t){if(this.isBackward!=t.isBackward)return!1;let i=Ls(this.getRanges());if(i!=Ls(t.getRanges()))return!1;if(i==0)return!0;for(let o of this.getRanges()){o=o.getTrimmed();let n=!1;for(let s of t.getRanges())if(s=s.getTrimmed(),o.start.isEqual(s.start)&&o.end.isEqual(s.end)){n=!0;break}if(!n)return!1}return!0}getSelectedElement(){return this.rangeCount!==1?null:this.getFirstRange().getContainedElement()}setTo(...t){let[i,o,n]=t;if(typeof o=="object"&&(n=o,o=void 0),i===null)this._setRanges([]),this._setFakeOptions(n);else if(i instanceof hp||i instanceof md)this._setRanges(i.getRanges(),i.isBackward),this._setFakeOptions({fake:i.isFake,label:i.fakeSelectionLabel});else if(i instanceof N)this._setRanges([i],n&&n.backward),this._setFakeOptions(n);else if(i instanceof P)this._setRanges([new N(i)]),this._setFakeOptions(n);else if(i instanceof xo){let s=!!n&&!!n.backward,r;if(o===void 0)throw new p("view-selection-setto-required-second-parameter",this);o=="in"?r=N._createIn(i):o=="on"?r=N._createOn(i):r=new N(P._createAt(i,o)),this._setRanges([r],s),this._setFakeOptions(n)}else if(Je(i))this._setRanges(i,n&&n.backward),this._setFakeOptions(n);else throw new p("view-selection-setto-not-selectable",this);this.fire("change")}setFocus(t,i){if(this.anchor===null)throw new p("view-selection-setfocus-no-ranges",this);let o=P._createAt(t,i);if(o.compareWith(this.focus)=="same")return;let n=this.anchor;this._ranges.pop(),o.compareWith(n)=="before"?this._addRange(new N(o,n),!0):this._addRange(new N(n,o)),this.fire("change")}toJSON(){let t={ranges:Array.from(this.getRanges()).map(i=>i.toJSON())};return this.isBackward&&(t.isBackward=!0),this.isFake&&(t.isFake=!0),t}_setRanges(t,i=!1){t=Array.from(t),this._ranges=[];for(let o of t)this._addRange(o);this._lastRangeBackward=!!i}_setFakeOptions(t={}){this._isFake=!!t.fake,this._fakeSelectionLabel=t.fake&&t.label||""}_addRange(t,i=!1){if(!(t instanceof N))throw new p("view-selection-add-range-not-range",this);this._pushRange(t),this._lastRangeBackward=!!i}_pushRange(t){for(let i of this._ranges)if(t.isIntersecting(i))throw new p("view-selection-range-intersects",this,{addedRange:t,intersectingRange:i});this._ranges.push(new N(t.start,t.end))}};fi.prototype.is=function(e){return e==="selection"||e==="view:selection"};/** +*/var T4=q(xo),gi=class mp extends T4{_ranges;_lastRangeBackward;_isFake;_fakeSelectionLabel;constructor(...t){super(),this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel="",t.length&&this.setTo(...t)}get isFake(){return this._isFake}get fakeSelectionLabel(){return this._fakeSelectionLabel}get anchor(){if(!this._ranges.length)return null;let t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.end:t.start).clone()}get focus(){if(!this._ranges.length)return null;let t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.start:t.end).clone()}get isCollapsed(){return this.rangeCount===1&&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(let t of this._ranges)yield t.clone()}getFirstRange(){let t=null;for(let i of this._ranges)(!t||i.start.isBefore(t.start))&&(t=i);return t?t.clone():null}getLastRange(){let t=null;for(let i of this._ranges)(!t||i.end.isAfter(t.end))&&(t=i);return t?t.clone():null}getFirstPosition(){let t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){let t=this.getLastRange();return t?t.end.clone():null}isEqual(t){if(this.isFake!=t.isFake||this.isFake&&this.fakeSelectionLabel!=t.fakeSelectionLabel||this.rangeCount!=t.rangeCount)return!1;if(this.rangeCount===0)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(let i of this._ranges){let o=!1;for(let n of t._ranges)if(i.isEqual(n)){o=!0;break}if(!o)return!1}return!0}isSimilar(t){if(this.isBackward!=t.isBackward)return!1;let i=Ls(this.getRanges());if(i!=Ls(t.getRanges()))return!1;if(i==0)return!0;for(let o of this.getRanges()){o=o.getTrimmed();let n=!1;for(let s of t.getRanges())if(s=s.getTrimmed(),o.start.isEqual(s.start)&&o.end.isEqual(s.end)){n=!0;break}if(!n)return!1}return!0}getSelectedElement(){return this.rangeCount!==1?null:this.getFirstRange().getContainedElement()}setTo(...t){let[i,o,n]=t;if(typeof o=="object"&&(n=o,o=void 0),i===null)this._setRanges([]),this._setFakeOptions(n);else if(i instanceof mp||i instanceof pd)this._setRanges(i.getRanges(),i.isBackward),this._setFakeOptions({fake:i.isFake,label:i.fakeSelectionLabel});else if(i instanceof N)this._setRanges([i],n&&n.backward),this._setFakeOptions(n);else if(i instanceof P)this._setRanges([new N(i)]),this._setFakeOptions(n);else if(i instanceof To){let s=!!n&&!!n.backward,r;if(o===void 0)throw new p("view-selection-setto-required-second-parameter",this);o=="in"?r=N._createIn(i):o=="on"?r=N._createOn(i):r=new N(P._createAt(i,o)),this._setRanges([r],s),this._setFakeOptions(n)}else if(Je(i))this._setRanges(i,n&&n.backward),this._setFakeOptions(n);else throw new p("view-selection-setto-not-selectable",this);this.fire("change")}setFocus(t,i){if(this.anchor===null)throw new p("view-selection-setfocus-no-ranges",this);let o=P._createAt(t,i);if(o.compareWith(this.focus)=="same")return;let n=this.anchor;this._ranges.pop(),o.compareWith(n)=="before"?this._addRange(new N(o,n),!0):this._addRange(new N(n,o)),this.fire("change")}toJSON(){let t={ranges:Array.from(this.getRanges()).map(i=>i.toJSON())};return this.isBackward&&(t.isBackward=!0),this.isFake&&(t.isFake=!0),t}_setRanges(t,i=!1){t=Array.from(t),this._ranges=[];for(let o of t)this._addRange(o);this._lastRangeBackward=!!i}_setFakeOptions(t={}){this._isFake=!!t.fake,this._fakeSelectionLabel=t.fake&&t.label||""}_addRange(t,i=!1){if(!(t instanceof N))throw new p("view-selection-add-range-not-range",this);this._pushRange(t),this._lastRangeBackward=!!i}_pushRange(t){for(let i of this._ranges)if(t.isIntersecting(i))throw new p("view-selection-range-intersects",this,{addedRange:t,intersectingRange:i});this._ranges.push(new N(t.start,t.end))}};gi.prototype.is=function(e){return e==="selection"||e==="view:selection"};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var x4=q(Co),md=class extends x4{_selection;constructor(...e){super(),this._selection=new fi,this._selection.delegate("change").to(this),e.length&&this._selection.setTo(...e)}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(e){return this._selection.isEqual(e)}isSimilar(e){return this._selection.isSimilar(e)}toJSON(){return this._selection.toJSON()}_setTo(...e){this._selection.setTo(...e)}_setFocus(e,t){this._selection.setFocus(e,t)}};md.prototype.is=function(e){return e==="selection"||e=="documentSelection"||e=="view:selection"||e=="view:documentSelection"};/** +*/var E4=q(xo),pd=class extends E4{_selection;constructor(...e){super(),this._selection=new gi,this._selection.delegate("change").to(this),e.length&&this._selection.setTo(...e)}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(e){return this._selection.isEqual(e)}isSimilar(e){return this._selection.isSimilar(e)}toJSON(){return this._selection.toJSON()}_setTo(...e){this._selection.setTo(...e)}_setFocus(e,t){this._selection.setFocus(e,t)}};pd.prototype.is=function(e){return e==="selection"||e=="documentSelection"||e=="view:selection"||e=="view:documentSelection"};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var gi=class extends pt{startRange;_eventPhase;_currentTarget;constructor(e,t,i){super(e,t),this.startRange=i,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}};/** +*/var bi=class extends bt{startRange;_eventPhase;_currentTarget;constructor(e,t,i){super(e,t),this.startRange=i,this._eventPhase="none",this._currentTarget=null}get eventPhase(){return this._eventPhase}get currentTarget(){return this._currentTarget}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var qu=Symbol("bubblingEmitter"),$u=Symbol("bubblingCallbacks"),ju=Symbol("bubblingContexts");function T4(e){class t extends e{fire(o,...n){try{let s=o instanceof pt?o:new pt(this,o),r=Ku(this),a=kg(this);if(Hs(s,"capturing",this),Wa(r,"$capture",s,...n))return s.return;let l=s.startRange||this.selection.getFirstRange(),c=l?l.getContainedElement():null,u=c?A4(a,c):!1,d=c||I4(l);if(Hs(s,"atTarget",d),!u){if(Wa(r,"$text",s,...n))return s.return;Hs(s,"bubbling",d)}for(;d;){if(d.is("element")&&Wa(r,d,s,...n))return s.return;d=d.parent,Hs(s,"bubbling",d)}return Hs(s,"bubbling",this),Wa(r,"$document",s,...n),s.return}catch(s){p.rethrowUnexpectedError(s,this)}}_addEventListener(o,n,s){let r=j(s.context||"$document"),a=Ku(this),l=vg(this);for(let u of r)typeof u=="function"&&kg(this).add(u);let c=E4(this,r,n);l.set(n,c),this.listenTo(a,o,c,s)}_removeEventListener(o,n){let s=Ku(this),r=vg(this),a=r.get(n);a&&(r.delete(n),this.stopListening(s,o,a))}}return t}function Hs(e,t,i){e instanceof gi&&(e._eventPhase=t,e._currentTarget=i)}function Wa(e,t,i,...o){return e.fire(i,{currentTarget:t,eventArgs:o}),!!i.stop.called}function E4(e,t,i){return function(o,n){let{currentTarget:s,eventArgs:r}=n;if(typeof s=="string"){t.includes(s)&&i.call(e,o,...r);return}if(s.is("rootElement")&&t.includes("$root")){i.call(e,o,...r);return}if(t.includes(s.name)){i.call(e,o,...r);return}for(let a of t)if(typeof a=="function"&&a(s)){i.call(e,o,...r);return}}}function Ku(e){return e[qu]||(e[qu]=new(q())),e[qu]}function vg(e){return e[$u]||(e[$u]=new Map),e[$u]}function kg(e){return e[ju]||(e[ju]=new Set),e[ju]}function A4(e,t){for(let i of e)if(i(t))return!0;return!1}function I4(e){if(!e)return null;let t=e.start.parent,i=e.end.parent,o=t.getPath(),n=i.getPath();return o.length>n.length?t:i}/** +*/var ju=Symbol("bubblingEmitter"),Ku=Symbol("bubblingCallbacks"),Gu=Symbol("bubblingContexts");function A4(e){class t extends e{fire(o,...n){try{let s=o instanceof bt?o:new bt(this,o),r=Ju(this),a=xg(this);if(Hs(s,"capturing",this),Ua(r,"$capture",s,...n))return s.return;let l=s.startRange||this.selection.getFirstRange(),c=l?l.getContainedElement():null,u=c?S4(a,c):!1,d=c||P4(l);if(Hs(s,"atTarget",d),!u){if(Ua(r,"$text",s,...n))return s.return;Hs(s,"bubbling",d)}for(;d;){if(d.is("element")&&Ua(r,d,s,...n))return s.return;d=d.parent,Hs(s,"bubbling",d)}return Hs(s,"bubbling",this),Ua(r,"$document",s,...n),s.return}catch(s){p.rethrowUnexpectedError(s,this)}}_addEventListener(o,n,s){let r=j(s.context||"$document"),a=Ju(this),l=Cg(this);for(let u of r)typeof u=="function"&&xg(this).add(u);let c=I4(this,r,n);l.set(n,c),this.listenTo(a,o,c,s)}_removeEventListener(o,n){let s=Ju(this),r=Cg(this),a=r.get(n);a&&(r.delete(n),this.stopListening(s,o,a))}}return t}function Hs(e,t,i){e instanceof bi&&(e._eventPhase=t,e._currentTarget=i)}function Ua(e,t,i,...o){return e.fire(i,{currentTarget:t,eventArgs:o}),!!i.stop.called}function I4(e,t,i){return function(o,n){let{currentTarget:s,eventArgs:r}=n;if(typeof s=="string"){t.includes(s)&&i.call(e,o,...r);return}if(s.is("rootElement")&&t.includes("$root")){i.call(e,o,...r);return}if(t.includes(s.name)){i.call(e,o,...r);return}for(let a of t)if(typeof a=="function"&&a(s)){i.call(e,o,...r);return}}}function Ju(e){return e[ju]||(e[ju]=new(q())),e[ju]}function Cg(e){return e[Ku]||(e[Ku]=new Map),e[Ku]}function xg(e){return e[Gu]||(e[Gu]=new Set),e[Gu]}function S4(e,t){for(let i of e)if(i(t))return!0;return!1}function P4(e){if(!e)return null;let t=e.start.parent,i=e.end.parent,o=t.getPath(),n=i.getPath();return o.length>n.length?t:i}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var S4=T4(W()),ar=class extends S4{selection;roots;stylesProcessor;_postFixers=new Set;constructor(e){super(),this.selection=new md,this.roots=new J({idProperty:"rootName"}),this.stylesProcessor=e,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1)}getRoot(e="main"){return this.roots.get(e)}getRoots(){return Array.from(this.roots)}registerPostFixer(e){this._postFixers.add(e)}destroy(){this.roots.forEach(e=>e.destroy()),this.stopListening()}_callPostFixers(e){let t=!1;do for(let i of this._postFixers)if(t=i(e),t)break;while(t)}};/** +*/var R4=A4(W()),ar=class extends R4{selection;roots;stylesProcessor;_postFixers=new Set;constructor(e){super(),this.selection=new pd,this.roots=new G({idProperty:"rootName"}),this.stylesProcessor=e,this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1)}getRoot(e="main"){return this.roots.get(e)}getRoots(){return Array.from(this.roots)}registerPostFixer(e){this._postFixers.add(e)}destroy(){this.roots.forEach(e=>e.destroy()),this.stopListening()}_callPostFixers(e){let t=!1;do for(let i of this._postFixers)if(t=i(e),t)break;while(t)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Cg=10,Pn=class extends mi{static DEFAULT_PRIORITY=Cg;_priority=Cg;_id=null;_clonesGroup=null;constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=P4}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(this.id===null)throw new p("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}isSimilar(e){return this.id!==null||e.id!==null?this.id===e.id:super.isSimilar(e)&&this.priority==e.priority}toJSON(){let e=super.toJSON();return e.type="AttributeElement",e}_clone(e=!1){let t=super._clone(e);return t._priority=this._priority,t._id=this._id,t}_canMergeAttributesFrom(e){return this.id!==null||e.id!==null||this.priority!==e.priority?!1:super._canMergeAttributesFrom(e)}_canSubtractAttributesOf(e){return this.id!==null||e.id!==null||this.priority!==e.priority?!1:super._canSubtractAttributesOf(e)}};Pn.prototype.is=function(e,t){return t?t===this.name&&(e==="attributeElement"||e==="view:attributeElement"||e==="element"||e==="view:element"):e==="attributeElement"||e==="view:attributeElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"};function P4(){if(Gu(this))return null;let e=this.parent;for(;e&&e.is("attributeElement");){if(Gu(e)>1)return null;e=e.parent}return!e||Gu(e)>1?null:this.childCount}function Gu(e){return Array.from(e.getChildren()).filter(t=>!t.is("uiElement")).length}/** +*/var Tg=10,Pn=class extends pi{static DEFAULT_PRIORITY=Tg;_priority=Tg;_id=null;_clonesGroup=null;constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=V4}get priority(){return this._priority}get id(){return this._id}getElementsWithSameId(){if(this.id===null)throw new p("attribute-element-get-elements-with-same-id-no-id",this);return new Set(this._clonesGroup)}isSimilar(e){return this.id!==null||e.id!==null?this.id===e.id:super.isSimilar(e)&&this.priority==e.priority}toJSON(){let e=super.toJSON();return e.type="AttributeElement",e}_clone(e=!1){let t=super._clone(e);return t._priority=this._priority,t._id=this._id,t}_canMergeAttributesFrom(e){return this.id!==null||e.id!==null||this.priority!==e.priority?!1:super._canMergeAttributesFrom(e)}_canSubtractAttributesOf(e){return this.id!==null||e.id!==null||this.priority!==e.priority?!1:super._canSubtractAttributesOf(e)}};Pn.prototype.is=function(e,t){return t?t===this.name&&(e==="attributeElement"||e==="view:attributeElement"||e==="element"||e==="view:element"):e==="attributeElement"||e==="view:attributeElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"};function V4(){if(Zu(this))return null;let e=this.parent;for(;e&&e.is("attributeElement");){if(Zu(e)>1)return null;e=e.parent}return!e||Zu(e)>1?null:this.childCount}function Zu(e){return Array.from(e.getChildren()).filter(t=>!t.is("uiElement")).length}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var gd=class extends mi{constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=R4}toJSON(){let e=super.toJSON();return e.type="EmptyElement",e}_insertChild(e,t){if(t&&(t instanceof xo||Array.from(t).length>0))throw new p("view-emptyelement-cannot-add",[this,t]);return 0}};gd.prototype.is=function(e,t){return t?t===this.name&&(e==="emptyElement"||e==="view:emptyElement"||e==="element"||e==="view:element"):e==="emptyElement"||e==="view:emptyElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"};function R4(){return null}/** +*/var bd=class extends pi{constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=L4}toJSON(){let e=super.toJSON();return e.type="EmptyElement",e}_insertChild(e,t){if(t&&(t instanceof To||Array.from(t).length>0))throw new p("view-emptyelement-cannot-add",[this,t]);return 0}};bd.prototype.is=function(e,t){return t?t===this.name&&(e==="emptyElement"||e==="view:emptyElement"||e==="element"||e==="view:element"):e==="emptyElement"||e==="view:emptyElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"};function L4(){return null}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var sl=class extends mi{constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=L4}_insertChild(e,t){if(t&&(t instanceof xo||Array.from(t).length>0))throw new p("view-uielement-cannot-add",[this,t]);return 0}render(e,t){return this.toDomElement(e)}toDomElement(e){let t=e.createElement(this.name);for(let i of this.getAttributeKeys())t.setAttribute(i,Da(t,i,this.getAttribute(i)));return t}toJSON(){let e=super.toJSON();return e.type="UIElement",e}};sl.prototype.is=function(e,t){return t?t===this.name&&(e==="uiElement"||e==="view:uiElement"||e==="element"||e==="view:element"):e==="uiElement"||e==="view:uiElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"};function V4(e){e.document.on("arrowKey",(t,i)=>M4(t,i,e.domConverter),{priority:"low"})}function L4(){return null}function M4(e,t,i){if(t.keyCode==O.arrowright){let o=$t(t.domTarget);if(!o)return;let n=o.rangeCount==1&&o.getRangeAt(0).collapsed;if(n||t.shiftKey){let s=o.focusNode,r=o.focusOffset,a=i.domPositionToView(s,r);if(a===null)return;let l=!1,c=a.getLastMatchingPosition(u=>(u.item.is("uiElement")&&(l=!0),!!(u.item.is("uiElement")||u.item.is("attributeElement"))));if(l){let u=i.viewPositionToDom(c);n?o.collapse(u.parent,u.offset):o.extend(u.parent,u.offset)}}}}/** +*/var rl=class extends pi{constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=B4}_insertChild(e,t){if(t&&(t instanceof To||Array.from(t).length>0))throw new p("view-uielement-cannot-add",[this,t]);return 0}render(e,t){return this.toDomElement(e)}toDomElement(e){let t=e.createElement(this.name);for(let i of this.getAttributeKeys())t.setAttribute(i,Fa(t,i,this.getAttribute(i)));return t}toJSON(){let e=super.toJSON();return e.type="UIElement",e}};rl.prototype.is=function(e,t){return t?t===this.name&&(e==="uiElement"||e==="view:uiElement"||e==="element"||e==="view:element"):e==="uiElement"||e==="view:uiElement"||e==="element"||e==="view:element"||e==="node"||e==="view:node"};function M4(e){e.document.on("arrowKey",(t,i)=>O4(t,i,e.domConverter),{priority:"low"})}function B4(){return null}function O4(e,t,i){if(t.keyCode==O.arrowright){let o=Kt(t.domTarget);if(!o)return;let n=o.rangeCount==1&&o.getRangeAt(0).collapsed;if(n||t.shiftKey){let s=o.focusNode,r=o.focusOffset,a=i.domPositionToView(s,r);if(a===null)return;let l=!1,c=a.getLastMatchingPosition(u=>(u.item.is("uiElement")&&(l=!0),!!(u.item.is("uiElement")||u.item.is("attributeElement"))));if(l){let u=i.viewPositionToDom(c);n?o.collapse(u.parent,u.offset):o.extend(u.parent,u.offset)}}}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var pd=class extends mi{constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=B4}toJSON(){let e=super.toJSON();return e.type="RawElement",e}_insertChild(e,t){if(t&&(t instanceof xo||Array.from(t).length>0))throw new p("view-rawelement-cannot-add",[this,t]);return 0}render(e,t){}};pd.prototype.is=function(e,t){return t?t===this.name&&(e==="rawElement"||e==="view:rawElement"||e==="element"||e==="view:element"):e==="rawElement"||e==="view:rawElement"||e===this.name||e==="view:"+this.name||e==="element"||e==="view:element"||e==="node"||e==="view:node"};function B4(){return null}/** +*/var wd=class extends pi{constructor(e,t,i,o){super(e,t,i,o),this.getFillerOffset=D4}toJSON(){let e=super.toJSON();return e.type="RawElement",e}_insertChild(e,t){if(t&&(t instanceof To||Array.from(t).length>0))throw new p("view-rawelement-cannot-add",[this,t]);return 0}render(e,t){}};wd.prototype.is=function(e,t){return t?t===this.name&&(e==="rawElement"||e==="view:rawElement"||e==="element"||e==="view:element"):e==="rawElement"||e==="view:rawElement"||e===this.name||e==="view:"+this.name||e==="element"||e==="view:element"||e==="node"||e==="view:node"};function D4(){return null}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var O4=q(Co),vo=class extends O4{document;_children=[];_customProperties=new Map;constructor(e,t){super(),this.document=e,t&&this._insertChild(0,t)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return this.childCount===0}get root(){return this}get parent(){return null}get name(){}get getFillerOffset(){}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}toJSON(){let e=[];for(let t of this._children)e.push(t.toJSON());return e}_appendChild(e){return this._insertChild(this.childCount,e)}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(e,t){this._fireChange("children",this,{index:e});let i=0,o=D4(this.document,t);for(let n of o)n.parent!==null&&n._remove(),n.parent=this,this._children.splice(e,0,n),e++,i++;return i}_removeChildren(e,t=1){this._fireChange("children",this,{index:e});for(let i=e;itypeof i=="string"?new He(e,i):i instanceof hi?new He(e,i.data):i))}/** +*/var F4=q(xo),ko=class extends F4{document;_children=[];_customProperties=new Map;constructor(e,t){super(),this.document=e,t&&this._insertChild(0,t)}[Symbol.iterator](){return this._children[Symbol.iterator]()}get childCount(){return this._children.length}get isEmpty(){return this.childCount===0}get root(){return this}get parent(){return null}get name(){}get getFillerOffset(){}getCustomProperty(e){return this._customProperties.get(e)}*getCustomProperties(){yield*this._customProperties.entries()}toJSON(){let e=[];for(let t of this._children)e.push(t.toJSON());return e}_appendChild(e){return this._insertChild(this.childCount,e)}getChild(e){return this._children[e]}getChildIndex(e){return this._children.indexOf(e)}getChildren(){return this._children[Symbol.iterator]()}_insertChild(e,t){this._fireChange("children",this,{index:e});let i=0,o=N4(this.document,t);for(let n of o)n.parent!==null&&n._remove(),n.parent=this,this._children.splice(e,0,n),e++,i++;return i}_removeChildren(e,t=1){this._fireChange("children",this,{index:e});for(let i=e;itypeof i=="string"?new He(e,i):i instanceof mi?new He(e,i.data):i))}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var bd=class{document;_cloneGroups=new Map;_slotFactory=null;constructor(e){this.document=e}setSelection(...e){this.document.selection._setTo(...e)}setSelectionFocus(e,t){this.document.selection._setFocus(e,t)}createDocumentFragment(e){return new vo(this.document,e)}createText(e){return new He(this.document,e)}createAttributeElement(e,t,i={}){let o=new Pn(this.document,e,t);return typeof i.priority=="number"&&(o._priority=i.priority),i.id&&(o._id=i.id),i.renderUnsafeAttributes&&o._unsafeAttributesToRender.push(...i.renderUnsafeAttributes),o}createContainerElement(e,t,i={},o={}){let n;H4(i)?o=i:n=i;let s=new Xs(this.document,e,t,n);return o.renderUnsafeAttributes&&s._unsafeAttributesToRender.push(...o.renderUnsafeAttributes),s}createEditableElement(e,t,i={}){let o=new nl(this.document,e,t);return i.renderUnsafeAttributes&&o._unsafeAttributesToRender.push(...i.renderUnsafeAttributes),o}createEmptyElement(e,t,i={}){let o=new gd(this.document,e,t);return i.renderUnsafeAttributes&&o._unsafeAttributesToRender.push(...i.renderUnsafeAttributes),o}createUIElement(e,t,i){let o=new sl(this.document,e,t);return i&&(o.render=i),o}createRawElement(e,t,i,o={}){let n=new pd(this.document,e,t);return i&&(n.render=i),o.renderUnsafeAttributes&&n._unsafeAttributesToRender.push(...o.renderUnsafeAttributes),n}setAttribute(e,t,i,o){o!==void 0?o._setAttribute(e,t,i):i._setAttribute(e,t)}removeAttribute(e,t,i){i!==void 0?i._removeAttribute(e,t):t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,i){Ee(e)&&i===void 0?t._setStyle(e):i._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,i){i._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}breakAttributes(e){return e instanceof P?this._breakAttributes(e):this._breakAttributesRange(e)}breakContainer(e){let t=e.parent;if(!t.is("containerElement"))throw new p("view-writer-break-non-container-element",this.document);if(!t.parent)throw new p("view-writer-break-root",this.document);if(e.isAtStart)return P._createBefore(t);if(!e.isAtEnd){let i=t._clone(!1);this.insert(P._createAfter(t),i);let o=new N(e,P._createAt(t,"end")),n=new P(i,0);this.move(o,n)}return P._createAfter(t)}mergeAttributes(e){let t=e.offset,i=e.parent;if(i.is("$text"))return e;if(i.is("attributeElement")&&i.childCount===0){let s=i.parent,r=i.index;return i._remove(),this._removeFromClonedElementsGroup(i),this.mergeAttributes(new P(s,r))}let o=i.getChild(t-1),n=i.getChild(t);if(!o||!n)return e;if(o.is("$text")&&n.is("$text"))return Tg(o,n);if(o.is("attributeElement")&&n.is("attributeElement")&&o.isSimilar(n)){let s=o.childCount;return o._appendChild(n.getChildren()),n._remove(),this._removeFromClonedElementsGroup(n),this.mergeAttributes(new P(o,s))}return e}mergeContainers(e){let t=e.nodeBefore,i=e.nodeAfter;if(!t||!i||!t.is("containerElement")||!i.is("containerElement"))throw new p("view-writer-merge-containers-invalid-position",this.document);let o=t.getChild(t.childCount-1),n=o instanceof He?P._createAt(o,"end"):P._createAt(t,"end");return this.move(N._createIn(i),P._createAt(t,"end")),this.remove(N._createOn(i)),n}insert(e,t){t=Je(t)?[...t]:[t],fp(t,this.document);let i=t.reduce((s,r)=>{let a=s[s.length-1],l=!r.is("uiElement");return!a||a.breakAttributes!=l?s.push({breakAttributes:l,nodes:[r]}):a.nodes.push(r),s},[]),o=null,n=e;for(let{nodes:s,breakAttributes:r}of i){let a=this._insertNodes(n,s,r);o||(o=a.start),n=a.end}return o?new N(o,n):new N(e)}remove(e){let t=e instanceof N?e:N._createOn(e);if(Ws(t,this.document),t.isCollapsed)return new vo(this.document);let{start:i,end:o}=this._breakAttributesRange(t,!0),n=i.parent,s=o.offset-i.offset,r=n._removeChildren(i.offset,s);for(let l of r)this._removeFromClonedElementsGroup(l);let a=this.mergeAttributes(i);return t.start=a,t.end=a.clone(),new vo(this.document,r)}clear(e,t){Ws(e,this.document);let i=e.getWalker({direction:"backward",ignoreElementEnd:!0});for(let o of i){let n=o.item,s;if(n.is("element")&&t.isSimilar(n))s=N._createOn(n);else if(!o.nextPosition.isAfter(e.start)&&n.is("$textProxy")){let r=n.getAncestors().find(a=>a.is("element")&&t.isSimilar(a));r&&(s=N._createIn(r))}s&&(s.end.isAfter(e.end)&&(s.end=e.end),s.start.isBefore(e.start)&&(s.start=e.start),this.remove(s))}}move(e,t){let i;if(t.isAfter(e.end)){t=this._breakAttributes(t,!0);let o=t.parent,n=o.childCount;e=this._breakAttributesRange(e,!0),i=this.remove(e),t.offset+=o.childCount-n}else i=this.remove(e);return this.insert(t,i)}wrap(e,t){if(!(t instanceof Pn))throw new p("view-writer-wrap-invalid-attribute",this.document);if(Ws(e,this.document),e.isCollapsed){let i=e.start;i.parent.is("element")&&!F4(i.parent)&&(i=i.getLastMatchingPosition(n=>n.item.is("uiElement"))),i=this._wrapPosition(i,t);let o=this.document.selection;return o.isCollapsed&&o.getFirstPosition().isEqual(e.start)&&this.setSelection(i),new N(i)}else return this._wrapRange(e,t)}unwrap(e,t){if(!(t instanceof Pn))throw new p("view-writer-unwrap-invalid-attribute",this.document);if(Ws(e,this.document),e.isCollapsed)return e;let{start:i,end:o}=this._breakAttributesRange(e,!0),n=i.parent,s=this._unwrapChildren(n,i.offset,o.offset,t),r=this.mergeAttributes(s.start);r.isEqual(s.start)||s.end.offset--;let a=this.mergeAttributes(s.end);return new N(r,a)}rename(e,t){let i=new Xs(this.document,e,t.getAttributes());return this.insert(P._createAfter(t),i),this.move(N._createIn(t),P._createAt(i,0)),this.remove(N._createOn(t)),i}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return P._createAt(e,t)}createPositionAfter(e){return P._createAfter(e)}createPositionBefore(e){return P._createBefore(e)}createRange(e,t){return new N(e,t)}createRangeOn(e){return N._createOn(e)}createRangeIn(e){return N._createIn(e)}createSelection(...e){return new fi(...e)}createSlot(e="children"){if(!this._slotFactory)throw new p("view-writer-invalid-create-slot-context",this.document);return this._slotFactory(this,e)}_registerSlotFactory(e){this._slotFactory=e}_clearSlotFactory(){this._slotFactory=null}_insertNodes(e,t,i){let o;if(i?o=id(e):o=e.parent.is("$text")?e.parent.parent:e.parent,!o)throw new p("view-writer-invalid-position-container",this.document);let n;i?n=this._breakAttributes(e,!0):n=e.parent.is("$text")?Ju(e):e;let s=o._insertChild(n.offset,t);for(let c of t)this._addToClonedElementsGroup(c);let r=n.getShiftedBy(s),a=this.mergeAttributes(n);a.isEqual(n)||r.offset--;let l=this.mergeAttributes(r);return new N(a,l)}_wrapChildren(e,t,i,o){let n=t,s=[];for(;n!1,e.parent._insertChild(e.offset,i);let o=new N(e,e.getShiftedBy(1));this.wrap(o,t);let n=new P(i.parent,i.index);i._remove();let s=n.nodeBefore,r=n.nodeAfter;return s&&s.is("view:$text")&&r&&r.is("view:$text")?Tg(s,r):xg(n)}_breakAttributesRange(e,t=!1){let i=e.start,o=e.end;if(Ws(e,this.document),e.isCollapsed){let a=this._breakAttributes(e.start,t);return new N(a,a)}let n=this._breakAttributes(o,t),s=n.parent.childCount,r=this._breakAttributes(i,t);return n.offset+=n.parent.childCount-s,new N(r,n)}_breakAttributes(e,t=!1){let i=e.offset,o=e.parent;if(e.parent.is("emptyElement"))throw new p("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new p("view-writer-cannot-break-ui-element",this.document);if(e.parent.is("rawElement"))throw new p("view-writer-cannot-break-raw-element",this.document);if(!t&&o.is("$text")&&od(o.parent)||od(o))return e.clone();if(o.is("$text"))return this._breakAttributes(Ju(e),t);if(i==o.childCount){let n=new P(o.parent,o.index+1);return this._breakAttributes(n,t)}else if(i===0){let n=new P(o.parent,o.index);return this._breakAttributes(n,t)}else{let n=o.index+1,s=o._clone();o.parent._insertChild(n,s),this._addToClonedElementsGroup(s);let r=o.childCount-i,a=o._removeChildren(i,r);s._appendChild(a);let l=new P(o.parent,n);return this._breakAttributes(l,t)}}_addToClonedElementsGroup(e){if(!e.root.is("rootElement"))return;if(e.is("element"))for(let o of e.getChildren())this._addToClonedElementsGroup(o);let t=e.id;if(!t)return;let i=this._cloneGroups.get(t);i||(i=new Set,this._cloneGroups.set(t,i)),i.add(e),e._clonesGroup=i}_removeFromClonedElementsGroup(e){if(e.is("element"))for(let o of e.getChildren())this._removeFromClonedElementsGroup(o);let t=e.id;if(!t)return;let i=this._cloneGroups.get(t);i&&i.delete(e)}};function F4(e){return Array.from(e.getChildren()).some(t=>!t.is("uiElement"))}function id(e){let t=e.parent;for(;!od(t);){if(!t)return;t=t.parent}return t}function N4(e,t){return e.priorityt.priority?!1:e.getIdentity()i instanceof o))throw new p("view-writer-insert-invalid-node-type",t);i.is("$text")||fp(i.getChildren(),t)}}function od(e){return e&&(e.is("containerElement")||e.is("documentFragment"))}function Ws(e,t){let i=id(e.start),o=id(e.end);if(!i||!o||i!==o)throw new p("view-writer-invalid-range-container",t)}function H4(e){return Ee(e)}/** +*/var yd=class{document;_cloneGroups=new Map;_slotFactory=null;constructor(e){this.document=e}setSelection(...e){this.document.selection._setTo(...e)}setSelectionFocus(e,t){this.document.selection._setFocus(e,t)}createDocumentFragment(e){return new ko(this.document,e)}createText(e){return new He(this.document,e)}createAttributeElement(e,t,i={}){let o=new Pn(this.document,e,t);return typeof i.priority=="number"&&(o._priority=i.priority),i.id&&(o._id=i.id),i.renderUnsafeAttributes&&o._unsafeAttributesToRender.push(...i.renderUnsafeAttributes),o}createContainerElement(e,t,i={},o={}){let n;U4(i)?o=i:n=i;let s=new Xs(this.document,e,t,n);return o.renderUnsafeAttributes&&s._unsafeAttributesToRender.push(...o.renderUnsafeAttributes),s}createEditableElement(e,t,i={}){let o=new sl(this.document,e,t);return i.renderUnsafeAttributes&&o._unsafeAttributesToRender.push(...i.renderUnsafeAttributes),o}createEmptyElement(e,t,i={}){let o=new bd(this.document,e,t);return i.renderUnsafeAttributes&&o._unsafeAttributesToRender.push(...i.renderUnsafeAttributes),o}createUIElement(e,t,i){let o=new rl(this.document,e,t);return i&&(o.render=i),o}createRawElement(e,t,i,o={}){let n=new wd(this.document,e,t);return i&&(n.render=i),o.renderUnsafeAttributes&&n._unsafeAttributesToRender.push(...o.renderUnsafeAttributes),n}setAttribute(e,t,i,o){o!==void 0?o._setAttribute(e,t,i):i._setAttribute(e,t)}removeAttribute(e,t,i){i!==void 0?i._removeAttribute(e,t):t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,i){Ie(e)&&i===void 0?t._setStyle(e):i._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,i){i._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}breakAttributes(e){return e instanceof P?this._breakAttributes(e):this._breakAttributesRange(e)}breakContainer(e){let t=e.parent;if(!t.is("containerElement"))throw new p("view-writer-break-non-container-element",this.document);if(!t.parent)throw new p("view-writer-break-root",this.document);if(e.isAtStart)return P._createBefore(t);if(!e.isAtEnd){let i=t._clone(!1);this.insert(P._createAfter(t),i);let o=new N(e,P._createAt(t,"end")),n=new P(i,0);this.move(o,n)}return P._createAfter(t)}mergeAttributes(e){let t=e.offset,i=e.parent;if(i.is("$text"))return e;if(i.is("attributeElement")&&i.childCount===0){let s=i.parent,r=i.index;return i._remove(),this._removeFromClonedElementsGroup(i),this.mergeAttributes(new P(s,r))}let o=i.getChild(t-1),n=i.getChild(t);if(!o||!n)return e;if(o.is("$text")&&n.is("$text"))return Ag(o,n);if(o.is("attributeElement")&&n.is("attributeElement")&&o.isSimilar(n)){let s=o.childCount;return o._appendChild(n.getChildren()),n._remove(),this._removeFromClonedElementsGroup(n),this.mergeAttributes(new P(o,s))}return e}mergeContainers(e){let t=e.nodeBefore,i=e.nodeAfter;if(!t||!i||!t.is("containerElement")||!i.is("containerElement"))throw new p("view-writer-merge-containers-invalid-position",this.document);let o=t.getChild(t.childCount-1),n=o instanceof He?P._createAt(o,"end"):P._createAt(t,"end");return this.move(N._createIn(i),P._createAt(t,"end")),this.remove(N._createOn(i)),n}insert(e,t){t=Je(t)?[...t]:[t],gp(t,this.document);let i=t.reduce((s,r)=>{let a=s[s.length-1],l=!r.is("uiElement");return!a||a.breakAttributes!=l?s.push({breakAttributes:l,nodes:[r]}):a.nodes.push(r),s},[]),o=null,n=e;for(let{nodes:s,breakAttributes:r}of i){let a=this._insertNodes(n,s,r);o||(o=a.start),n=a.end}return o?new N(o,n):new N(e)}remove(e){let t=e instanceof N?e:N._createOn(e);if(Ws(t,this.document),t.isCollapsed)return new ko(this.document);let{start:i,end:o}=this._breakAttributesRange(t,!0),n=i.parent,s=o.offset-i.offset,r=n._removeChildren(i.offset,s);for(let l of r)this._removeFromClonedElementsGroup(l);let a=this.mergeAttributes(i);return t.start=a,t.end=a.clone(),new ko(this.document,r)}clear(e,t){Ws(e,this.document);let i=e.getWalker({direction:"backward",ignoreElementEnd:!0});for(let o of i){let n=o.item,s;if(n.is("element")&&t.isSimilar(n))s=N._createOn(n);else if(!o.nextPosition.isAfter(e.start)&&n.is("$textProxy")){let r=n.getAncestors().find(a=>a.is("element")&&t.isSimilar(a));r&&(s=N._createIn(r))}s&&(s.end.isAfter(e.end)&&(s.end=e.end),s.start.isBefore(e.start)&&(s.start=e.start),this.remove(s))}}move(e,t){let i;if(t.isAfter(e.end)){t=this._breakAttributes(t,!0);let o=t.parent,n=o.childCount;e=this._breakAttributesRange(e,!0),i=this.remove(e),t.offset+=o.childCount-n}else i=this.remove(e);return this.insert(t,i)}wrap(e,t){if(!(t instanceof Pn))throw new p("view-writer-wrap-invalid-attribute",this.document);if(Ws(e,this.document),e.isCollapsed){let i=e.start;i.parent.is("element")&&!z4(i.parent)&&(i=i.getLastMatchingPosition(n=>n.item.is("uiElement"))),i=this._wrapPosition(i,t);let o=this.document.selection;return o.isCollapsed&&o.getFirstPosition().isEqual(e.start)&&this.setSelection(i),new N(i)}else return this._wrapRange(e,t)}unwrap(e,t){if(!(t instanceof Pn))throw new p("view-writer-unwrap-invalid-attribute",this.document);if(Ws(e,this.document),e.isCollapsed)return e;let{start:i,end:o}=this._breakAttributesRange(e,!0),n=i.parent,s=this._unwrapChildren(n,i.offset,o.offset,t),r=this.mergeAttributes(s.start);r.isEqual(s.start)||s.end.offset--;let a=this.mergeAttributes(s.end);return new N(r,a)}rename(e,t){let i=new Xs(this.document,e,t.getAttributes());return this.insert(P._createAfter(t),i),this.move(N._createIn(t),P._createAt(i,0)),this.remove(N._createOn(t)),i}clearClonedElementsGroup(e){this._cloneGroups.delete(e)}createPositionAt(e,t){return P._createAt(e,t)}createPositionAfter(e){return P._createAfter(e)}createPositionBefore(e){return P._createBefore(e)}createRange(e,t){return new N(e,t)}createRangeOn(e){return N._createOn(e)}createRangeIn(e){return N._createIn(e)}createSelection(...e){return new gi(...e)}createSlot(e="children"){if(!this._slotFactory)throw new p("view-writer-invalid-create-slot-context",this.document);return this._slotFactory(this,e)}_registerSlotFactory(e){this._slotFactory=e}_clearSlotFactory(){this._slotFactory=null}_insertNodes(e,t,i){let o;if(i?o=nd(e):o=e.parent.is("$text")?e.parent.parent:e.parent,!o)throw new p("view-writer-invalid-position-container",this.document);let n;i?n=this._breakAttributes(e,!0):n=e.parent.is("$text")?Qu(e):e;let s=o._insertChild(n.offset,t);for(let c of t)this._addToClonedElementsGroup(c);let r=n.getShiftedBy(s),a=this.mergeAttributes(n);a.isEqual(n)||r.offset--;let l=this.mergeAttributes(r);return new N(a,l)}_wrapChildren(e,t,i,o){let n=t,s=[];for(;n!1,e.parent._insertChild(e.offset,i);let o=new N(e,e.getShiftedBy(1));this.wrap(o,t);let n=new P(i.parent,i.index);i._remove();let s=n.nodeBefore,r=n.nodeAfter;return s&&s.is("view:$text")&&r&&r.is("view:$text")?Ag(s,r):Eg(n)}_breakAttributesRange(e,t=!1){let i=e.start,o=e.end;if(Ws(e,this.document),e.isCollapsed){let a=this._breakAttributes(e.start,t);return new N(a,a)}let n=this._breakAttributes(o,t),s=n.parent.childCount,r=this._breakAttributes(i,t);return n.offset+=n.parent.childCount-s,new N(r,n)}_breakAttributes(e,t=!1){let i=e.offset,o=e.parent;if(e.parent.is("emptyElement"))throw new p("view-writer-cannot-break-empty-element",this.document);if(e.parent.is("uiElement"))throw new p("view-writer-cannot-break-ui-element",this.document);if(e.parent.is("rawElement"))throw new p("view-writer-cannot-break-raw-element",this.document);if(!t&&o.is("$text")&&sd(o.parent)||sd(o))return e.clone();if(o.is("$text"))return this._breakAttributes(Qu(e),t);if(i==o.childCount){let n=new P(o.parent,o.index+1);return this._breakAttributes(n,t)}else if(i===0){let n=new P(o.parent,o.index);return this._breakAttributes(n,t)}else{let n=o.index+1,s=o._clone();o.parent._insertChild(n,s),this._addToClonedElementsGroup(s);let r=o.childCount-i,a=o._removeChildren(i,r);s._appendChild(a);let l=new P(o.parent,n);return this._breakAttributes(l,t)}}_addToClonedElementsGroup(e){if(!e.root.is("rootElement"))return;if(e.is("element"))for(let o of e.getChildren())this._addToClonedElementsGroup(o);let t=e.id;if(!t)return;let i=this._cloneGroups.get(t);i||(i=new Set,this._cloneGroups.set(t,i)),i.add(e),e._clonesGroup=i}_removeFromClonedElementsGroup(e){if(e.is("element"))for(let o of e.getChildren())this._removeFromClonedElementsGroup(o);let t=e.id;if(!t)return;let i=this._cloneGroups.get(t);i&&i.delete(e)}};function z4(e){return Array.from(e.getChildren()).some(t=>!t.is("uiElement"))}function nd(e){let t=e.parent;for(;!sd(t);){if(!t)return;t=t.parent}return t}function H4(e,t){return e.priorityt.priority?!1:e.getIdentity()i instanceof o))throw new p("view-writer-insert-invalid-node-type",t);i.is("$text")||gp(i.getChildren(),t)}}function sd(e){return e&&(e.is("containerElement")||e.is("documentFragment"))}function Ws(e,t){let i=nd(e.start),o=nd(e.end);if(!i||!o||i!==o)throw new p("view-writer-invalid-range-container",t)}function U4(e){return Ie(e)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var mp=e=>e.createTextNode("\xA0"),gp=e=>{let t=e.createElement("span");return t.dataset.ckeFiller="true",t.innerText="\xA0",t},pp=e=>{let t=e.createElement("br");return t.dataset.ckeFiller="true",t};var er="\u2060".repeat(7);function Ze(e){return typeof e=="string"?e.substr(0,7)===er:Y(e)&&e.data.substr(0,7)===er}function In(e){return e.data.length==7&&Ze(e)}function Eg(e){let t=typeof e=="string"?e:e.data;return Ze(e)?t.slice(7):t}function W4(e){e.document.on("arrowKey",U4,{priority:"low"})}function U4(e,t){if(t.keyCode==O.arrowleft){let i=$t(t.domTarget);if(i&&i.rangeCount==1&&i.getRangeAt(0).collapsed){let o=i.getRangeAt(0).startContainer,n=i.getRangeAt(0).startOffset;Ze(o)&&n<=7&&i.collapse(o,0)}}}/** +*/var pp=e=>e.createTextNode("\xA0"),bp=e=>{let t=e.createElement("span");return t.dataset.ckeFiller="true",t.innerText="\xA0",t},wp=e=>{let t=e.createElement("br");return t.dataset.ckeFiller="true",t};var er="\u2060".repeat(7);function Ze(e){return typeof e=="string"?e.substr(0,7)===er:Y(e)&&e.data.substr(0,7)===er}function In(e){return e.data.length==7&&Ze(e)}function Ig(e){let t=typeof e=="string"?e:e.data;return Ze(e)?t.slice(7):t}function q4(e){e.document.on("arrowKey",$4,{priority:"low"})}function $4(e,t){if(t.keyCode==O.arrowleft){let i=Kt(t.domTarget);if(i&&i.rangeCount==1&&i.getRangeAt(0).collapsed){let o=i.getRangeAt(0).startContainer,n=i.getRangeAt(0).startOffset;Ze(o)&&n<=7&&i.collapse(o,0)}}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var q4=W(),$4=class extends q4{domConverter;markedAttributes=new Set;markedChildren=new Set;markedTexts=new Set;selection;_domRoots=new Set;_inlineFiller=null;_fakeSelectionContainer=null;constructor(e,t){super(),this.domConverter=e,this.selection=t,this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1),V.isBlink&&!V.isAndroid&&this.on("change:isSelecting",()=>{this.isSelecting||this.render()})}markToSync(e,t){if(e==="text")this.domConverter.mapViewToDom(t.parent)&&this.markedTexts.add(t);else{if(!this.domConverter.mapViewToDom(t))return;if(e==="attributes")this.markedAttributes.add(t);else if(e==="children")this.markedChildren.add(t);else throw new p("view-renderer-unknown-type",this)}}addDomRoot(e){this._domRoots.add(e)}removeDomRoot(e){this._domRoots.delete(e)}render(){if(this.isComposing&&!V.isAndroid)return;let e=null,t=V.isBlink&&!V.isAndroid?!this.isSelecting:!0;for(let i of this.markedChildren)this._updateChildrenMappings(i);t?(this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?e=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(e=this.selection.getFirstPosition(),this.markedChildren.add(e.parent))):this._inlineFiller&&_e(this._inlineFiller)&&(e=this.domConverter.domPositionToView(this._inlineFiller),e&&e.parent.is("$text")&&(e=P._createBefore(e.parent)));for(let i of this.markedAttributes)this._updateAttrs(i);for(let i of this.markedChildren)this._updateChildren(i,{inlineFillerPosition:e});for(let i of this.markedTexts)!this.markedChildren.has(i.parent)&&this.domConverter.mapViewToDom(i.parent)&&this._updateText(i,{inlineFillerPosition:e});if(t)if(e){let i=this.domConverter.viewPositionToDom(e),o=i.parent.ownerDocument;Ze(i.parent)?this._inlineFiller=i.parent:this._inlineFiller=Ag(o,i.parent,i.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.domConverter._clearTemporaryCustomProperties(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(e){let t=this.domConverter.mapViewToDom(e);if(!t)return;let i=Array.from(t.childNodes),o=Array.from(this.domConverter.viewChildrenToDom(e,{withChildren:!1})),n=this._diffNodeLists(i,o),s=this._findUpdateActions(n,i,o,K4);if(s.indexOf("update")!==-1){let r={equal:0,insert:0,delete:0};for(let a of s)if(a==="update"){let l=r.equal+r.insert,c=r.equal+r.delete,u=e.getChild(l);u&&!u.is("uiElement")&&!u.is("rawElement")&&this._updateElementMappings(u,i[c]),Bu(o[l]),r.equal++}else r[a]++}}_updateElementMappings(e,t){this.domConverter.unbindDomElement(t),this.domConverter.bindElements(t,e),this.markedChildren.add(e),this.markedAttributes.add(e)}_getInlineFillerPosition(){let e=this.selection.getFirstPosition();return e.parent.is("$text")?P._createBefore(e.parent):e}_isSelectionInInlineFiller(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed)return!1;let e=this.selection.getFirstPosition(),t=this.domConverter.viewPositionToDom(e);return!!(t&&Y(t.parent)&&Ze(t.parent))}_removeInlineFiller(){let e=this._inlineFiller;if(!Ze(e))throw new p("view-renderer-filler-was-lost",this);In(e)?e.remove():e.data=e.data.substr(7),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed)return!1;let e=this.selection.getFirstPosition(),t=e.parent,i=e.offset;if(!this.domConverter.mapViewToDom(t.root)||!t.is("element")||!j4(t))return!1;let o=e.nodeBefore,n=e.nodeAfter;return!(o instanceof He||n instanceof He||i===t.getFillerOffset()&&(!o||!o.is("element","br"))||V.isAndroid&&(o||n))}_updateText(e,t){let i=this.domConverter.findCorrespondingDomText(e),o=this.domConverter.viewToDom(e).data,n=t.inlineFillerPosition;n&&n.parent==e.parent&&n.offset==e.index&&(o=er+o),this._updateTextNode(i,o)}_updateAttrs(e){let t=this.domConverter.mapViewToDom(e);if(t){for(let i of Array.from(t.attributes)){let o=i.name;e.hasAttribute(o)||this.domConverter.removeDomElementAttribute(t,o)}for(let i of e.getAttributeKeys())this.domConverter.setDomElementAttribute(t,i,e.getAttribute(i),e)}}_updateChildren(e,t){let i=this.domConverter.mapViewToDom(e);if(!i)return;if(V.isAndroid){let u=null;for(let d of Array.from(i.childNodes)){if(u&&Y(u)&&Y(d)){i.normalize();break}u=d}}let o=t.inlineFillerPosition,n=i.childNodes,s=Array.from(this.domConverter.viewChildrenToDom(e,{bind:!0}));o&&o.parent===e&&Ag(i.ownerDocument,s,o.offset);let r=this._diffNodeLists(n,s),a=this._findUpdateActions(r,n,s,G4),l=0,c=new Set;for(let u of a)u==="delete"?(c.add(n[l]),Bu(n[l])):(u==="equal"||u==="update")&&l++;l=0;for(let u of a)u==="insert"?(Ru(i,l,s[l]),l++):u==="update"?(this._updateTextNode(n[l],s[l].data),l++):u==="equal"&&(this._markDescendantTextToSync(this.domConverter.domToView(s[l])),l++);for(let u of c)_e(u)||this.domConverter.unbindDomElement(u)}_diffNodeLists(e,t){return e=Q4(e,this._fakeSelectionContainer),Ni(e,t,J4.bind(null,this.domConverter))}_findUpdateActions(e,t,i,o){if(e.indexOf("insert")===-1||e.indexOf("delete")===-1)return e;let n=[],s=[],r=[],a={equal:0,insert:0,delete:0};for(let l of e)l==="insert"?r.push(i[a.equal+a.insert]):l==="delete"?s.push(t[a.equal+a.delete]):(n=n.concat(Ni(s,r,o).map(c=>c==="equal"?"update":c)),n.push("equal"),s=[],r=[]),a[l]++;return n.concat(Ni(s,r,o).map(l=>l==="equal"?"update":l))}_updateTextNode(e,t){let i=e.data;i!=t&&(V.isAndroid&&this.isComposing&&i.replace(/\u00A0/g," ")==t.replace(/\u00A0/g," ")||this._updateTextNodeInternal(e,t))}_updateTextNodeInternal(e,t){let i=Cu(e.data,t);for(let o of i)o.type==="insert"?e.insertData(o.index,o.values.join("")):e.deleteData(o.index,o.howMany)}_markDescendantTextToSync(e){if(e){if(e.is("$text"))this.markedTexts.add(e);else if(e.is("element"))for(let t of e.getChildren())this._markDescendantTextToSync(t)}}_updateSelection(){if(V.isBlink&&!V.isAndroid&&this.isSelecting&&!this.markedChildren.size)return;if(this.selection.rangeCount===0){this._removeDomSelection(),this._removeFakeSelection();return}let e=this.domConverter.mapViewToDom(this.selection.editableElement);if(!this.isFocused||!e){!this.selection.isFake&&this._fakeSelectionContainer&&this._fakeSelectionContainer.isConnected&&this._removeFakeSelection();return}this.selection.isFake?this._updateFakeSelection(e):this._fakeSelectionContainer&&this._fakeSelectionContainer.isConnected?(this._removeFakeSelection(),this._updateDomSelection(e)):this.isComposing&&V.isAndroid||this._updateDomSelection(e)}_updateFakeSelection(e){let t=e.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=Y4(t));let i=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(i,this.selection),!this._fakeSelectionNeedsUpdate(e))return;let o=Fe(i);(!o||o!=e)&&e.appendChild(i),i.textContent=this.selection.fakeSelectionLabel||"\xA0";let n=$t(e);if(!n)return;let s=t.createRange();s.selectNodeContents(i),n.setBaseAndExtent(s.startContainer,s.startOffset,s.endContainer,s.endOffset)}_updateDomSelection(e){let t=$t(e);if(!t||!this._domSelectionNeedsUpdate(t))return;let i=this.domConverter.viewPositionToDom(this.selection.anchor),o=this.domConverter.viewPositionToDom(this.selection.focus);t.setBaseAndExtent(i.parent,i.offset,o.parent,o.offset),V.isGecko&&Z4(o,t)}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;let t=e&&this.domConverter.domSelectionToView(e);return!(t&&this.selection.isEqual(t)||!this.selection.isCollapsed&&this.selection.isSimilar(t))}_fakeSelectionNeedsUpdate(e){let t=this._fakeSelectionContainer,i=$t(e);return!t||Fe(t)!==e||i&&i.anchorNode!==t&&!t.contains(i.anchorNode)?!0:t.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(let e of this._domRoots){let t=$t(e);if(t&&t.rangeCount){let i=zi(e),o=i&&this.domConverter.mapDomToView(i);i&&o&&t.removeAllRanges()}}}_removeFakeSelection(){let e=this._fakeSelectionContainer;e&&e.remove()}_updateFocus(){if(this.isFocused){let e=this.selection.editableElement;e&&this.domConverter.focus(e)}}};function j4(e){if(e.getAttribute("contenteditable")=="false")return!1;let t=e.findAncestor(i=>i.hasAttribute("contenteditable"));return!t||t.getAttribute("contenteditable")=="true"}function Ag(e,t,i){let o=t instanceof Array?t:t.childNodes,n=o[i];if(Y(n))return n.data=er+n.data,n;{let s=e.createTextNode(er);return Array.isArray(t)?o.splice(i,0,s):Ru(t,i,s),s}}function K4(e,t){return Ut(e)&&Ut(t)&&!Y(e)&&!Y(t)&&!go(e)&&!go(t)&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}function G4(e,t){return Ut(e)&&Ut(t)&&Y(e)&&Y(t)}function J4(e,t,i){return t===i?!0:Y(t)&&Y(i)?t.data===i.data:!!(e.isBlockFiller(t)&&e.isBlockFiller(i))}function Z4(e,t){let i=e.parent,o=e.offset;if(Y(i)&&In(i)&&(o=bo(i)+1,i=_e(i)),i.nodeType!=Node.ELEMENT_NODE||o!=i.childNodes.length-1)return;let n=i.childNodes[o];n&&n.tagName=="BR"&&t.addRange(t.getRangeAt(0))}function Q4(e,t){let i=Array.from(e);return i.length==0||!t||i[i.length-1]==t&&i.pop(),i}function Y4(e){let t=e.createElement("div");return t.className="ck-fake-selection-container",Object.assign(t.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),t.textContent="\xA0",t}/** +*/var j4=W(),K4=class extends j4{domConverter;markedAttributes=new Set;markedChildren=new Set;markedTexts=new Set;selection;_domRoots=new Set;_inlineFiller=null;_fakeSelectionContainer=null;constructor(e,t){super(),this.domConverter=e,this.selection=t,this.set("isFocused",!1),this.set("isSelecting",!1),this.set("isComposing",!1),V.isBlink&&!V.isAndroid&&this.on("change:isSelecting",()=>{this.isSelecting||this.render()})}markToSync(e,t){if(e==="text")this.domConverter.mapViewToDom(t.parent)&&this.markedTexts.add(t);else{if(!this.domConverter.mapViewToDom(t))return;if(e==="attributes")this.markedAttributes.add(t);else if(e==="children")this.markedChildren.add(t);else throw new p("view-renderer-unknown-type",this)}}addDomRoot(e){this._domRoots.add(e)}removeDomRoot(e){this._domRoots.delete(e)}render(){if(this.isComposing&&!V.isAndroid)return;let e=null,t=V.isBlink&&!V.isAndroid?!this.isSelecting:!0;for(let i of this.markedChildren)this._updateChildrenMappings(i);t?(this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?e=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(e=this.selection.getFirstPosition(),this.markedChildren.add(e.parent))):this._inlineFiller&&ke(this._inlineFiller)&&(e=this.domConverter.domPositionToView(this._inlineFiller),e&&e.parent.is("$text")&&(e=P._createBefore(e.parent)));for(let i of this.markedAttributes)this._updateAttrs(i);for(let i of this.markedChildren)this._updateChildren(i,{inlineFillerPosition:e});for(let i of this.markedTexts)!this.markedChildren.has(i.parent)&&this.domConverter.mapViewToDom(i.parent)&&this._updateText(i,{inlineFillerPosition:e});if(t)if(e){let i=this.domConverter.viewPositionToDom(e),o=i.parent.ownerDocument;Ze(i.parent)?this._inlineFiller=i.parent:this._inlineFiller=Sg(o,i.parent,i.offset)}else this._inlineFiller=null;this._updateFocus(),this._updateSelection(),this.domConverter._clearTemporaryCustomProperties(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear()}_updateChildrenMappings(e){let t=this.domConverter.mapViewToDom(e);if(!t)return;let i=Array.from(t.childNodes),o=Array.from(this.domConverter.viewChildrenToDom(e,{withChildren:!1})),n=this._diffNodeLists(i,o),s=this._findUpdateActions(n,i,o,J4);if(s.indexOf("update")!==-1){let r={equal:0,insert:0,delete:0};for(let a of s)if(a==="update"){let l=r.equal+r.insert,c=r.equal+r.delete,u=e.getChild(l);u&&!u.is("uiElement")&&!u.is("rawElement")&&this._updateElementMappings(u,i[c]),Du(o[l]),r.equal++}else r[a]++}}_updateElementMappings(e,t){this.domConverter.unbindDomElement(t),this.domConverter.bindElements(t,e),this.markedChildren.add(e),this.markedAttributes.add(e)}_getInlineFillerPosition(){let e=this.selection.getFirstPosition();return e.parent.is("$text")?P._createBefore(e.parent):e}_isSelectionInInlineFiller(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed)return!1;let e=this.selection.getFirstPosition(),t=this.domConverter.viewPositionToDom(e);return!!(t&&Y(t.parent)&&Ze(t.parent))}_removeInlineFiller(){let e=this._inlineFiller;if(!Ze(e))throw new p("view-renderer-filler-was-lost",this);In(e)?e.remove():e.data=e.data.substr(7),this._inlineFiller=null}_needsInlineFillerAtSelection(){if(this.selection.rangeCount!=1||!this.selection.isCollapsed)return!1;let e=this.selection.getFirstPosition(),t=e.parent,i=e.offset;if(!this.domConverter.mapViewToDom(t.root)||!t.is("element")||!G4(t))return!1;let o=e.nodeBefore,n=e.nodeAfter;return!(o instanceof He||n instanceof He||i===t.getFillerOffset()&&(!o||!o.is("element","br"))||V.isAndroid&&(o||n))}_updateText(e,t){let i=this.domConverter.findCorrespondingDomText(e),o=this.domConverter.viewToDom(e).data,n=t.inlineFillerPosition;n&&n.parent==e.parent&&n.offset==e.index&&(o=er+o),this._updateTextNode(i,o)}_updateAttrs(e){let t=this.domConverter.mapViewToDom(e);if(t){for(let i of Array.from(t.attributes)){let o=i.name;e.hasAttribute(o)||this.domConverter.removeDomElementAttribute(t,o)}for(let i of e.getAttributeKeys())this.domConverter.setDomElementAttribute(t,i,e.getAttribute(i),e)}}_updateChildren(e,t){let i=this.domConverter.mapViewToDom(e);if(!i)return;if(V.isAndroid){let u=null;for(let d of Array.from(i.childNodes)){if(u&&Y(u)&&Y(d)){i.normalize();break}u=d}}let o=t.inlineFillerPosition,n=i.childNodes,s=Array.from(this.domConverter.viewChildrenToDom(e,{bind:!0}));o&&o.parent===e&&Sg(i.ownerDocument,s,o.offset);let r=this._diffNodeLists(n,s),a=this._findUpdateActions(r,n,s,Z4),l=0,c=new Set;for(let u of a)u==="delete"?(c.add(n[l]),Du(n[l])):(u==="equal"||u==="update")&&l++;l=0;for(let u of a)u==="insert"?(Lu(i,l,s[l]),l++):u==="update"?(this._updateTextNode(n[l],s[l].data),l++):u==="equal"&&(this._markDescendantTextToSync(this.domConverter.domToView(s[l])),l++);for(let u of c)ke(u)||this.domConverter.unbindDomElement(u)}_diffNodeLists(e,t){return e=X4(e,this._fakeSelectionContainer),Hi(e,t,Q4.bind(null,this.domConverter))}_findUpdateActions(e,t,i,o){if(e.indexOf("insert")===-1||e.indexOf("delete")===-1)return e;let n=[],s=[],r=[],a={equal:0,insert:0,delete:0};for(let l of e)l==="insert"?r.push(i[a.equal+a.insert]):l==="delete"?s.push(t[a.equal+a.delete]):(n=n.concat(Hi(s,r,o).map(c=>c==="equal"?"update":c)),n.push("equal"),s=[],r=[]),a[l]++;return n.concat(Hi(s,r,o).map(l=>l==="equal"?"update":l))}_updateTextNode(e,t){let i=e.data;i!=t&&(V.isAndroid&&this.isComposing&&i.replace(/\u00A0/g," ")==t.replace(/\u00A0/g," ")||this._updateTextNodeInternal(e,t))}_updateTextNodeInternal(e,t){let i=Tu(e.data,t);for(let o of i)o.type==="insert"?e.insertData(o.index,o.values.join("")):e.deleteData(o.index,o.howMany)}_markDescendantTextToSync(e){if(e){if(e.is("$text"))this.markedTexts.add(e);else if(e.is("element"))for(let t of e.getChildren())this._markDescendantTextToSync(t)}}_updateSelection(){if(V.isBlink&&!V.isAndroid&&this.isSelecting&&!this.markedChildren.size)return;if(this.selection.rangeCount===0){this._removeDomSelection(),this._removeFakeSelection();return}let e=this.domConverter.mapViewToDom(this.selection.editableElement);if(!this.isFocused||!e){!this.selection.isFake&&this._fakeSelectionContainer&&this._fakeSelectionContainer.isConnected&&this._removeFakeSelection();return}this.selection.isFake?this._updateFakeSelection(e):this._fakeSelectionContainer&&this._fakeSelectionContainer.isConnected?(this._removeFakeSelection(),this._updateDomSelection(e)):this.isComposing&&V.isAndroid||this._updateDomSelection(e)}_updateFakeSelection(e){let t=e.ownerDocument;this._fakeSelectionContainer||(this._fakeSelectionContainer=e6(t));let i=this._fakeSelectionContainer;if(this.domConverter.bindFakeSelection(i,this.selection),!this._fakeSelectionNeedsUpdate(e))return;let o=Fe(i);(!o||o!=e)&&e.appendChild(i),i.textContent=this.selection.fakeSelectionLabel||"\xA0";let n=Kt(e);if(!n)return;let s=t.createRange();s.selectNodeContents(i),n.setBaseAndExtent(s.startContainer,s.startOffset,s.endContainer,s.endOffset)}_updateDomSelection(e){let t=Kt(e);if(!t||!this._domSelectionNeedsUpdate(t))return;let i=this.domConverter.viewPositionToDom(this.selection.anchor),o=this.domConverter.viewPositionToDom(this.selection.focus);t.setBaseAndExtent(i.parent,i.offset,o.parent,o.offset),V.isGecko&&Y4(o,t)}_domSelectionNeedsUpdate(e){if(!this.domConverter.isDomSelectionCorrect(e))return!0;let t=e&&this.domConverter.domSelectionToView(e);return!(t&&this.selection.isEqual(t)||!this.selection.isCollapsed&&this.selection.isSimilar(t))}_fakeSelectionNeedsUpdate(e){let t=this._fakeSelectionContainer,i=Kt(e);return!t||Fe(t)!==e||i&&i.anchorNode!==t&&!t.contains(i.anchorNode)?!0:t.textContent!==this.selection.fakeSelectionLabel}_removeDomSelection(){for(let e of this._domRoots){let t=Kt(e);if(t&&t.rangeCount){let i=Wi(e),o=i&&this.domConverter.mapDomToView(i);i&&o&&t.removeAllRanges()}}}_removeFakeSelection(){let e=this._fakeSelectionContainer;e&&e.remove()}_updateFocus(){if(this.isFocused){let e=this.selection.editableElement;e&&this.domConverter.focus(e)}}};function G4(e){if(e.getAttribute("contenteditable")=="false")return!1;let t=e.findAncestor(i=>i.hasAttribute("contenteditable"));return!t||t.getAttribute("contenteditable")=="true"}function Sg(e,t,i){let o=t instanceof Array?t:t.childNodes,n=o[i];if(Y(n))return n.data=er+n.data,n;{let s=e.createTextNode(er);return Array.isArray(t)?o.splice(i,0,s):Lu(t,i,s),s}}function J4(e,t){return $t(e)&&$t(t)&&!Y(e)&&!Y(t)&&!po(e)&&!po(t)&&e.tagName.toLowerCase()===t.tagName.toLowerCase()}function Z4(e,t){return $t(e)&&$t(t)&&Y(e)&&Y(t)}function Q4(e,t,i){return t===i?!0:Y(t)&&Y(i)?t.data===i.data:!!(e.isBlockFiller(t)&&e.isBlockFiller(i))}function Y4(e,t){let i=e.parent,o=e.offset;if(Y(i)&&In(i)&&(o=wo(i)+1,i=ke(i)),i.nodeType!=Node.ELEMENT_NODE||o!=i.childNodes.length-1)return;let n=i.childNodes[o];n&&n.tagName=="BR"&&t.addRange(t.getRangeAt(0))}function X4(e,t){let i=Array.from(e);return i.length==0||!t||i[i.length-1]==t&&i.pop(),i}function e6(e){let t=e.createElement("div");return t.className="ck-fake-selection-container",Object.assign(t.style,{position:"fixed",top:0,left:"-9999px",width:"42px"}),t.textContent="\xA0",t}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var X4=pp(S.document),e6=mp(S.document),t6=gp(S.document),Ua="data-ck-unsafe-attribute-",Ig="data-ck-unsafe-element",To=class{document;renderingMode;blockFillerMode;preElements;blockElements;inlineObjectElements;unsafeElements;_domDocument;_domToViewMapping=new WeakMap;_viewToDomMapping=new WeakMap;_fakeSelectionMapping=new WeakMap;_rawContentElementMatcher=new We;_inlineObjectElementMatcher=new We;_elementsWithTemporaryCustomProperties=new Set;constructor(e,{blockFillerMode:t,renderingMode:i="editing"}={}){this.document=e,this.renderingMode=i,this.blockFillerMode=t||(i==="editing"?"br":"nbsp"),this.preElements=["pre","textarea"],this.blockElements=["address","article","aside","blockquote","caption","center","dd","details","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","legend","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"],this.inlineObjectElements=["object","iframe","input","button","textarea","select","option","video","embed","audio","img","canvas"],this.unsafeElements=["script","style"],this._domDocument=this.renderingMode==="editing"?S.document:S.document.implementation.createHTMLDocument("")}get domDocument(){return this._domDocument}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new fi(t))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}unbindDomElement(e){let t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(t);for(let i of e.children)this.unbindDomElement(i)}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}shouldRenderAttribute(e,t,i){if(this.renderingMode==="data")return!0;if(e=e.toLowerCase(),e.startsWith("on")||e==="srcdoc")return!1;if(i==="img"&&(e==="src"||e==="srcset")||i==="source"&&e==="srcset")return!0;if(t=t.replace(/[\s\u0000-\u0020]+/g,""),t.match(/^javascript:/i))return!1;if(t.match(/^data:/i)){let o=t.match(/^data:image\/(png|jpeg|jpg|gif|webp|avif|bmp|x-icon|vnd\.microsoft\.icon|apng|tiff|heic|heif|jxl)($|[;,])/i),n=t.match(/^data:(audio|video)\/(mp4|mpeg|mp3|ogg|webm|wav|x-wav|aac|flac|quicktime|3gpp)($|[;,])/i);if(!o&&!n)return!1}return!0}setContentOf(e,t){if(this.renderingMode==="data"){e.innerHTML=at(t);return}let i=new DOMParser().parseFromString(at(t),"text/html"),o=i.createDocumentFragment(),n=i.body.childNodes;for(;n.length>0;)o.appendChild(n[0]);let s=i.createTreeWalker(o,NodeFilter.SHOW_ELEMENT),r=[],a;for(;a=s.nextNode();)r.push(a);for(let l of r){for(let u of l.getAttributeNames())this.setDomElementAttribute(l,u,l.getAttribute(u));let c=l.tagName.toLowerCase();this._shouldRenameElement(c)&&(Vg(c),l.replaceWith(this._createReplacementDomElement(c,l)))}for(;e.firstChild;)e.firstChild.remove();e.append(o)}viewToDom(e,t={}){if(e.is("$text")){let i=this._processDataFromViewText(e);return this._domDocument.createTextNode(i)}else{let i=e;if(this.mapViewToDom(i))if(i.getCustomProperty("editingPipeline:doNotReuseOnce"))this._elementsWithTemporaryCustomProperties.add(i);else return this.mapViewToDom(i);let o;if(i.is("documentFragment"))o=this._domDocument.createDocumentFragment(),t.bind&&this.bindDocumentFragments(o,i);else{if(i.is("uiElement"))return i.name==="$comment"?o=this._domDocument.createComment(i.getCustomProperty("$rawContent")):o=i.render(this._domDocument,this),t.bind&&this.bindElements(o,i),o;this._shouldRenameElement(i.name)?(Vg(i.name),o=this._createReplacementDomElement(i.name)):i.hasAttribute("xmlns")?o=this._domDocument.createElementNS(i.getAttribute("xmlns"),i.name):o=this._domDocument.createElement(i.name),i.is("rawElement")&&i.render(o,this),t.bind&&this.bindElements(o,i);for(let n of i.getAttributeKeys())this.setDomElementAttribute(o,n,i.getAttribute(n),i)}if(t.withChildren!==!1)for(let n of this.viewChildrenToDom(i,t))o instanceof HTMLTemplateElement?o.content.appendChild(n):o.appendChild(n);return o}}setDomElementAttribute(e,t,i,o){let n=this.shouldRenderAttribute(t,i,e.tagName.toLowerCase())||o&&o.shouldRenderUnsafeAttribute(t);if(n||D("domconverter-unsafe-attribute-detected",{domElement:e,key:t,value:i}),!sg(t)){D("domconverter-invalid-attribute-detected",{domElement:e,key:t,value:i});return}e.hasAttribute(t)&&!n?e.removeAttribute(t):e.hasAttribute(Ua+t)&&n&&e.removeAttribute(Ua+t);let s=n?t:Ua+t;e.setAttribute(s,Da(e,s,i))}removeDomElementAttribute(e,t){t!=Ig&&(e.removeAttribute(t),e.removeAttribute(Ua+t))}*viewChildrenToDom(e,t={}){let i=e.getFillerOffset&&e.getFillerOffset(),o=0;for(let n of e.getChildren()){i===o&&(yield this._getBlockFiller());let s=n.is("element")&&!!n.getCustomProperty("dataPipeline:transparentRendering")&&!G(n.getAttributes());if(s&&this.renderingMode=="data")if(n.is("rawElement")){let r=this._domDocument.createElement(n.name);n.render(r,this),yield*[...r.childNodes]}else yield*this.viewChildrenToDom(n,t);else s&&D("domconverter-transparent-rendering-unsupported-in-editing-pipeline",{viewElement:n}),yield this.viewToDom(n,t);o++}i===o&&(yield this._getBlockFiller())}viewRangeToDom(e){let t=this.viewPositionToDom(e.start),i=this.viewPositionToDom(e.end),o=this._domDocument.createRange();return o.setStart(t.parent,t.offset),o.setEnd(i.parent,i.offset),o}viewPositionToDom(e){let t=e.parent;if(t.is("$text")){let i=this.findCorrespondingDomText(t);if(!i)return null;let o=e.offset;return Ze(i)&&(o+=7),i.data&&o>i.data.length&&(o=i.data.length),{parent:i,offset:o}}else{let i,o,n;if(e.offset===0){if(i=this.mapViewToDom(t),!i)return null;n=i.childNodes[0]}else{let r=e.nodeBefore;if(o=r.is("$text")?this.findCorrespondingDomText(r):this.mapViewToDom(r),!o)return null;i=_e(o),n=o.nextSibling}if(Y(n)&&Ze(n))return{parent:n,offset:7};let s=o?bo(o)+1:0;return{parent:i,offset:s}}}domToView(e,t={}){let i=[],o=this._domToView(e,t,i),n=o.next().value;return!n||(o.next(),this._processDomInlineNodes(null,i,t),this.blockFillerMode=="br"&&Pg(n))||n.is("$text")&&n.data.length==0?null:n}*domChildrenToView(e,t={},i=[]){let o;e instanceof HTMLTemplateElement?o=[...e.content.childNodes]:o=[...e.childNodes];for(let n=0;n{let{scrollLeft:r,scrollTop:a}=s;n.push([r,a])}),t.focus({preventScroll:!0}),Sg(t,s=>{let[r,a]=n.shift();s.scrollLeft=r,s.scrollTop=a}),S.window.scrollTo(i,o)}_clearDomSelection(){let e=this.mapViewToDom(this.document.selection.editableElement);if(!e)return;let t=$t(e);if(!t)return;let i=this.domSelectionToView(t);i&&i.rangeCount>0&&t.removeAllRanges()}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isBlockFiller(e){return this.blockFillerMode=="br"?e.isEqualNode(X4):Rg(e,this.blockElements)?!0:e.isEqualNode(t6)||o6(e,this.blockElements)}isDomSelectionBackward(e){return Iu(e)}getHostViewElement(e){let t=Q0(e);for(t.pop();t.length;){let i=t.pop(),o=this._domToViewMapping.get(i);if(o&&(o.is("uiElement")||o.is("rawElement")))return o}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}registerRawContentMatcher(e){this._rawContentElementMatcher.add(e)}registerInlineObjectMatcher(e){this._inlineObjectElementMatcher.add(e)}_clearTemporaryCustomProperties(){for(let e of this._elementsWithTemporaryCustomProperties)e._removeCustomProperty("editingPipeline:doNotReuseOnce");this._elementsWithTemporaryCustomProperties.clear()}_getBlockFiller(){switch(this.blockFillerMode){case"nbsp":return mp(this._domDocument);case"markedNbsp":return gp(this._domDocument);case"br":return pp(this._domDocument)}}_isDomSelectionPositionCorrect(e,t){if(Y(e)&&Ze(e)&&t<7||this.isElement(e)&&Ze(e.childNodes[t]))return!1;let i=this.mapDomToView(e);return!(i&&(i.is("uiElement")||i.is("rawElement")))}*_domToView(e,t,i){if(this.blockFillerMode!="br"&&Rg(e,this.blockElements))return null;let o=this.getHostViewElement(e);if(o)return o;if(go(e)&&t.skipComments)return null;if(Y(e)){if(In(e))return null;{let n=e.data;if(n==="")return null;let s=new He(this.document,n);return i.push(s),s}}else{let n=this.mapDomToView(e);if(n)return this._isInlineObjectElement(n)&&i.push(n),n;if(this.isDocumentFragment(e))n=new vo(this.document),t.bind&&this.bindDocumentFragments(e,n);else{n=this._createViewElement(e,t),t.bind&&this.bindElements(e,n);let r=e.attributes;if(r)for(let a=r.length,l=0;l0?t[n-1]:null,c=n+1i.is("element")&&t.includes(i.name))}function Sg(e,t){let i=e;for(;i;)t(i),i=Fe(i)}function o6(e,t){return e.isEqualNode(e6)&&bp(e,t)&&_e(e).childNodes.length===1}function bp(e,t){let i=_e(e);return!!i&&!!i.tagName&&t.includes(i.tagName.toLowerCase())}function n6(e,t,i){return t=="\xA0"&&e&&e.is("element")&&e.childCount==1&&i.includes(e.name)}function s6(e,t){return t=="\xA0"&&e&&e.is("element","span")&&e.childCount==1&&e.hasAttribute("data-cke-filler")}function Pg(e){return e.is("element","br")&&e.hasAttribute("data-cke-filler")}function Rg(e,t){return e.tagName==="BR"&&bp(e,t)&&_e(e).childNodes.length===1}function Vg(e){e==="script"&&D("domconverter-unsafe-script-element-detected"),e==="style"&&D("domconverter-unsafe-style-element-detected")}function r6(e){if(!V.isGecko||!e.rangeCount)return!1;let t=e.getRangeAt(0).startContainer;try{Object.prototype.toString.call(t)}catch{return!0}return!1}/** +*/var t6=wp(S.document),i6=pp(S.document),o6=bp(S.document),qa="data-ck-unsafe-attribute-",Pg="data-ck-unsafe-element",Eo=class{document;renderingMode;blockFillerMode;preElements;blockElements;inlineObjectElements;unsafeElements;_domDocument;_domToViewMapping=new WeakMap;_viewToDomMapping=new WeakMap;_fakeSelectionMapping=new WeakMap;_rawContentElementMatcher=new We;_inlineObjectElementMatcher=new We;_elementsWithTemporaryCustomProperties=new Set;constructor(e,{blockFillerMode:t,renderingMode:i="editing"}={}){this.document=e,this.renderingMode=i,this.blockFillerMode=t||(i==="editing"?"br":"nbsp"),this.preElements=["pre","textarea"],this.blockElements=["address","article","aside","blockquote","caption","center","dd","details","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","legend","li","main","menu","nav","ol","p","pre","section","summary","table","tbody","td","tfoot","th","thead","tr","ul"],this.inlineObjectElements=["object","iframe","input","button","textarea","select","option","video","embed","audio","img","canvas"],this.unsafeElements=["script","style"],this._domDocument=this.renderingMode==="editing"?S.document:S.document.implementation.createHTMLDocument("")}get domDocument(){return this._domDocument}bindFakeSelection(e,t){this._fakeSelectionMapping.set(e,new gi(t))}fakeSelectionToView(e){return this._fakeSelectionMapping.get(e)}bindElements(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}unbindDomElement(e){let t=this._domToViewMapping.get(e);if(t){this._domToViewMapping.delete(e),this._viewToDomMapping.delete(t);for(let i of e.children)this.unbindDomElement(i)}}bindDocumentFragments(e,t){this._domToViewMapping.set(e,t),this._viewToDomMapping.set(t,e)}shouldRenderAttribute(e,t,i){if(this.renderingMode==="data")return!0;if(e=e.toLowerCase(),e.startsWith("on")||e==="srcdoc")return!1;if(i==="img"&&(e==="src"||e==="srcset")||i==="source"&&e==="srcset")return!0;if(t=t.replace(/[\s\u0000-\u0020]+/g,""),t.match(/^javascript:/i))return!1;if(t.match(/^data:/i)){let o=t.match(/^data:image\/(png|jpeg|jpg|gif|webp|avif|bmp|x-icon|vnd\.microsoft\.icon|apng|tiff|heic|heif|jxl)($|[;,])/i),n=t.match(/^data:(audio|video)\/(mp4|mpeg|mp3|ogg|webm|wav|x-wav|aac|flac|quicktime|3gpp)($|[;,])/i);if(!o&&!n)return!1}return!0}setContentOf(e,t){if(this.renderingMode==="data"){e.innerHTML=at(t);return}let i=new DOMParser().parseFromString(at(t),"text/html"),o=i.createDocumentFragment(),n=i.body.childNodes;for(;n.length>0;)o.appendChild(n[0]);let s=i.createTreeWalker(o,NodeFilter.SHOW_ELEMENT),r=[],a;for(;a=s.nextNode();)r.push(a);for(let l of r){for(let u of l.getAttributeNames())this.setDomElementAttribute(l,u,l.getAttribute(u));let c=l.tagName.toLowerCase();this._shouldRenameElement(c)&&(Mg(c),l.replaceWith(this._createReplacementDomElement(c,l)))}for(;e.firstChild;)e.firstChild.remove();e.append(o)}viewToDom(e,t={}){if(e.is("$text")){let i=this._processDataFromViewText(e);return this._domDocument.createTextNode(i)}else{let i=e;if(this.mapViewToDom(i))if(i.getCustomProperty("editingPipeline:doNotReuseOnce"))this._elementsWithTemporaryCustomProperties.add(i);else return this.mapViewToDom(i);let o;if(i.is("documentFragment"))o=this._domDocument.createDocumentFragment(),t.bind&&this.bindDocumentFragments(o,i);else{if(i.is("uiElement"))return i.name==="$comment"?o=this._domDocument.createComment(i.getCustomProperty("$rawContent")):o=i.render(this._domDocument,this),t.bind&&this.bindElements(o,i),o;this._shouldRenameElement(i.name)?(Mg(i.name),o=this._createReplacementDomElement(i.name)):i.hasAttribute("xmlns")?o=this._domDocument.createElementNS(i.getAttribute("xmlns"),i.name):o=this._domDocument.createElement(i.name),i.is("rawElement")&&i.render(o,this),t.bind&&this.bindElements(o,i);for(let n of i.getAttributeKeys())this.setDomElementAttribute(o,n,i.getAttribute(n),i)}if(t.withChildren!==!1)for(let n of this.viewChildrenToDom(i,t))o instanceof HTMLTemplateElement?o.content.appendChild(n):o.appendChild(n);return o}}setDomElementAttribute(e,t,i,o){let n=this.shouldRenderAttribute(t,i,e.tagName.toLowerCase())||o&&o.shouldRenderUnsafeAttribute(t);if(n||D("domconverter-unsafe-attribute-detected",{domElement:e,key:t,value:i}),!ag(t)){D("domconverter-invalid-attribute-detected",{domElement:e,key:t,value:i});return}e.hasAttribute(t)&&!n?e.removeAttribute(t):e.hasAttribute(qa+t)&&n&&e.removeAttribute(qa+t);let s=n?t:qa+t;e.setAttribute(s,Fa(e,s,i))}removeDomElementAttribute(e,t){t!=Pg&&(e.removeAttribute(t),e.removeAttribute(qa+t))}*viewChildrenToDom(e,t={}){let i=e.getFillerOffset&&e.getFillerOffset(),o=0;for(let n of e.getChildren()){i===o&&(yield this._getBlockFiller());let s=n.is("element")&&!!n.getCustomProperty("dataPipeline:transparentRendering")&&!J(n.getAttributes());if(s&&this.renderingMode=="data")if(n.is("rawElement")){let r=this._domDocument.createElement(n.name);n.render(r,this),yield*[...r.childNodes]}else yield*this.viewChildrenToDom(n,t);else s&&D("domconverter-transparent-rendering-unsupported-in-editing-pipeline",{viewElement:n}),yield this.viewToDom(n,t);o++}i===o&&(yield this._getBlockFiller())}viewRangeToDom(e){let t=this.viewPositionToDom(e.start),i=this.viewPositionToDom(e.end),o=this._domDocument.createRange();return o.setStart(t.parent,t.offset),o.setEnd(i.parent,i.offset),o}viewPositionToDom(e){let t=e.parent;if(t.is("$text")){let i=this.findCorrespondingDomText(t);if(!i)return null;let o=e.offset;return Ze(i)&&(o+=7),i.data&&o>i.data.length&&(o=i.data.length),{parent:i,offset:o}}else{let i,o,n;if(e.offset===0){if(i=this.mapViewToDom(t),!i)return null;n=i.childNodes[0]}else{let r=e.nodeBefore;if(o=r.is("$text")?this.findCorrespondingDomText(r):this.mapViewToDom(r),!o)return null;i=ke(o),n=o.nextSibling}if(Y(n)&&Ze(n))return{parent:n,offset:7};let s=o?wo(o)+1:0;return{parent:i,offset:s}}}domToView(e,t={}){let i=[],o=this._domToView(e,t,i),n=o.next().value;return!n||(o.next(),this._processDomInlineNodes(null,i,t),this.blockFillerMode=="br"&&Vg(n))||n.is("$text")&&n.data.length==0?null:n}*domChildrenToView(e,t={},i=[]){let o;e instanceof HTMLTemplateElement?o=[...e.content.childNodes]:o=[...e.childNodes];for(let n=0;n{let{scrollLeft:r,scrollTop:a}=s;n.push([r,a])}),t.focus({preventScroll:!0}),Rg(t,s=>{let[r,a]=n.shift();s.scrollLeft=r,s.scrollTop=a}),S.window.scrollTo(i,o)}_clearDomSelection(){let e=this.mapViewToDom(this.document.selection.editableElement);if(!e)return;let t=Kt(e);if(!t)return;let i=this.domSelectionToView(t);i&&i.rangeCount>0&&t.removeAllRanges()}isElement(e){return e&&e.nodeType==Node.ELEMENT_NODE}isDocumentFragment(e){return e&&e.nodeType==Node.DOCUMENT_FRAGMENT_NODE}isBlockFiller(e){return this.blockFillerMode=="br"?e.isEqualNode(t6):Lg(e,this.blockElements)?!0:e.isEqualNode(o6)||s6(e,this.blockElements)}isDomSelectionBackward(e){return Pu(e)}getHostViewElement(e){let t=X0(e);for(t.pop();t.length;){let i=t.pop(),o=this._domToViewMapping.get(i);if(o&&(o.is("uiElement")||o.is("rawElement")))return o}return null}isDomSelectionCorrect(e){return this._isDomSelectionPositionCorrect(e.anchorNode,e.anchorOffset)&&this._isDomSelectionPositionCorrect(e.focusNode,e.focusOffset)}registerRawContentMatcher(e){this._rawContentElementMatcher.add(e)}registerInlineObjectMatcher(e){this._inlineObjectElementMatcher.add(e)}_clearTemporaryCustomProperties(){for(let e of this._elementsWithTemporaryCustomProperties)e._removeCustomProperty("editingPipeline:doNotReuseOnce");this._elementsWithTemporaryCustomProperties.clear()}_getBlockFiller(){switch(this.blockFillerMode){case"nbsp":return pp(this._domDocument);case"markedNbsp":return bp(this._domDocument);case"br":return wp(this._domDocument)}}_isDomSelectionPositionCorrect(e,t){if(Y(e)&&Ze(e)&&t<7||this.isElement(e)&&Ze(e.childNodes[t]))return!1;let i=this.mapDomToView(e);return!(i&&(i.is("uiElement")||i.is("rawElement")))}*_domToView(e,t,i){if(this.blockFillerMode!="br"&&Lg(e,this.blockElements))return null;let o=this.getHostViewElement(e);if(o)return o;if(po(e)&&t.skipComments)return null;if(Y(e)){if(In(e))return null;{let n=e.data;if(n==="")return null;let s=new He(this.document,n);return i.push(s),s}}else{let n=this.mapDomToView(e);if(n)return this._isInlineObjectElement(n)&&i.push(n),n;if(this.isDocumentFragment(e))n=new ko(this.document),t.bind&&this.bindDocumentFragments(e,n);else{n=this._createViewElement(e,t),t.bind&&this.bindElements(e,n);let r=e.attributes;if(r)for(let a=r.length,l=0;l0?t[n-1]:null,c=n+1i.is("element")&&t.includes(i.name))}function Rg(e,t){let i=e;for(;i;)t(i),i=Fe(i)}function s6(e,t){return e.isEqualNode(i6)&&yp(e,t)&&ke(e).childNodes.length===1}function yp(e,t){let i=ke(e);return!!i&&!!i.tagName&&t.includes(i.tagName.toLowerCase())}function r6(e,t,i){return t=="\xA0"&&e&&e.is("element")&&e.childCount==1&&i.includes(e.name)}function a6(e,t){return t=="\xA0"&&e&&e.is("element","span")&&e.childCount==1&&e.hasAttribute("data-cke-filler")}function Vg(e){return e.is("element","br")&&e.hasAttribute("data-cke-filler")}function Lg(e,t){return e.tagName==="BR"&&yp(e,t)&&ke(e).childNodes.length===1}function Mg(e){e==="script"&&D("domconverter-unsafe-script-element-detected"),e==="style"&&D("domconverter-unsafe-style-element-detected")}function l6(e){if(!V.isGecko||!e.rangeCount)return!1;let t=e.getRangeAt(0).startContainer;try{Object.prototype.toString.call(t)}catch{return!0}return!1}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var a6=pe(),it=class extends a6{view;document;_isEnabled=!1;constructor(e){super(),this.view=e,this.document=e.document}get isEnabled(){return this._isEnabled}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(e){return e&&e.nodeType===3&&(e=_e(e)),!e||e.nodeType!==1?!1:e.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}};/** +*/var c6=be(),it=class extends c6{view;document;_isEnabled=!1;constructor(e){super(),this.view=e,this.document=e.document}get isEnabled(){return this._isEnabled}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}destroy(){this.disable(),this.stopListening()}checkShouldIgnoreEventFromTarget(e){return e&&e.nodeType===3&&(e=ke(e)),!e||e.nodeType!==1?!1:e.matches("[data-cke-ignore-events], [data-cke-ignore-events] *")}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var pi=class{view;document;domEvent;domTarget;constructor(e,t,i){this.view=e,this.document=e.document,this.domEvent=t,this.domTarget=t.target,Es(this,i)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}};/** +*/var wi=class{view;document;domEvent;domTarget;constructor(e,t,i){this.view=e,this.document=e.document,this.domEvent=t,this.domTarget=t.target,Es(this,i)}get target(){return this.view.domConverter.mapDomToView(this.domTarget)}preventDefault(){this.domEvent.preventDefault()}stopPropagation(){this.domEvent.stopPropagation()}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var $e=class extends it{useCapture=!1;usePassive=!1;observe(e){(typeof this.domEventType=="string"?[this.domEventType]:this.domEventType).forEach(t=>{this.listenTo(e,t,(i,o)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(o.target)&&this.onDomEvent(o)},{useCapture:this.useCapture,usePassive:this.usePassive})})}stopObserving(e){this.stopListening(e)}fire(e,t,i){this.isEnabled&&this.document.fire(e,new pi(this.view,t,i))}};/** +*/var $e=class extends it{useCapture=!1;usePassive=!1;observe(e){(typeof this.domEventType=="string"?[this.domEventType]:this.domEventType).forEach(t=>{this.listenTo(e,t,(i,o)=>{this.isEnabled&&!this.checkShouldIgnoreEventFromTarget(o.target)&&this.onDomEvent(o)},{useCapture:this.useCapture,usePassive:this.usePassive})})}stopObserving(e){this.stopListening(e)}fire(e,t,i){this.isEnabled&&this.document.fire(e,new wi(this.view,t,i))}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var l6=class extends $e{domEventType=["keydown","keyup"];onDomEvent(e){let t={keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,metaKey:e.metaKey,get keystroke(){return qt(this)}};this.fire(e.type,e,t)}};/** +*/var u6=class extends $e{domEventType=["keydown","keyup"];onDomEvent(e){let t={keyCode:e.keyCode,altKey:e.altKey,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,metaKey:e.metaKey,get keystroke(){return jt(this)}};this.fire(e.type,e,t)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var c6=class extends it{_fireSelectionChangeDoneDebounced;constructor(e){super(e),this._fireSelectionChangeDoneDebounced=ye(t=>{this.document.fire("selectionChangeDone",t)},200)}observe(){let e=this.document;e.on("arrowKey",(t,i)=>{e.selection.isFake&&this.isEnabled&&i.preventDefault()},{context:"$capture"}),e.on("arrowKey",(t,i)=>{e.selection.isFake&&this.isEnabled&&this._handleSelectionMove(i.keyCode)},{priority:"lowest"})}stopObserving(){}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){let t=this.document.selection,i=new fi(t.getRanges(),{backward:t.isBackward,fake:!1});(e==O.arrowleft||e==O.arrowup)&&i.setTo(i.getFirstPosition()),(e==O.arrowright||e==O.arrowdown)&&i.setTo(i.getLastPosition());let o={oldSelection:t,newSelection:i,domSelection:null};this.document.fire("selectionChange",o),this._fireSelectionChangeDoneDebounced(o)}};/** +*/var d6=class extends it{_fireSelectionChangeDoneDebounced;constructor(e){super(e),this._fireSelectionChangeDoneDebounced=ve(t=>{this.document.fire("selectionChangeDone",t)},200)}observe(){let e=this.document;e.on("arrowKey",(t,i)=>{e.selection.isFake&&this.isEnabled&&i.preventDefault()},{context:"$capture"}),e.on("arrowKey",(t,i)=>{e.selection.isFake&&this.isEnabled&&this._handleSelectionMove(i.keyCode)},{priority:"lowest"})}stopObserving(){}destroy(){super.destroy(),this._fireSelectionChangeDoneDebounced.cancel()}_handleSelectionMove(e){let t=this.document.selection,i=new gi(t.getRanges(),{backward:t.isBackward,fake:!1});(e==O.arrowleft||e==O.arrowup)&&i.setTo(i.getFirstPosition()),(e==O.arrowright||e==O.arrowdown)&&i.setTo(i.getLastPosition());let o={oldSelection:t,newSelection:i,domSelection:null};this.document.fire("selectionChange",o),this._fireSelectionChangeDoneDebounced(o)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var wp=class extends it{domConverter;_config;_domElements;_mutationObserver;constructor(e){super(e),this._config={childList:!0,characterData:!0,subtree:!0},this.domConverter=e.domConverter,this._domElements=new Set,this._mutationObserver=new window.MutationObserver(this._onMutations.bind(this))}flush(){this._onMutations(this._mutationObserver.takeRecords())}observe(e){this._domElements.add(e),this.isEnabled&&this._mutationObserver.observe(e,this._config)}stopObserving(e){if(this._domElements.delete(e),this.isEnabled){this._mutationObserver.disconnect();for(let t of this._domElements)this._mutationObserver.observe(t,this._config)}}enable(){super.enable();for(let e of this._domElements)this._mutationObserver.observe(e,this._config)}disable(){super.disable(),this._mutationObserver.disconnect()}destroy(){super.destroy(),this._mutationObserver.disconnect()}_onMutations(e){if(e.length===0)return;let t=this.domConverter,i=new Set,o=new Set;for(let s of e){let r=t.mapDomToView(s.target);r&&(r.is("uiElement")||r.is("rawElement")||s.type==="childList"&&!this._isBogusBrMutation(s)&&o.add(r))}for(let s of e){let r=t.mapDomToView(s.target);if(!(r&&(r.is("uiElement")||r.is("rawElement")))&&s.type==="characterData"){let a=t.findCorrespondingViewText(s.target);a&&!o.has(a.parent)?i.add(a):!a&&Ze(s.target)&&o.add(t.mapDomToView(_e(s.target)))}}let n=[];for(let s of i)n.push({type:"text",node:s});for(let s of o){let r=t.mapViewToDom(s),a=Array.from(s.getChildren()),l=Array.from(t.domChildrenToView(r,{withChildren:!1}));Is(a,l,u6)||n.push({type:"children",node:s})}n.length&&this.document.fire("mutations",{mutations:n})}_isBogusBrMutation(e){let t=null;return e.nextSibling===null&&e.removedNodes.length===0&&e.addedNodes.length==1&&(t=this.domConverter.domToView(e.addedNodes[0],{withChildren:!1})),t&&t.is("element","br")}};function u6(e,t){if(!Array.isArray(e))return e===t?!0:e.is("$text")&&t.is("$text")?e.data===t.data:!1}/** +*/var _p=class extends it{domConverter;_config;_domElements;_mutationObserver;constructor(e){super(e),this._config={childList:!0,characterData:!0,subtree:!0},this.domConverter=e.domConverter,this._domElements=new Set,this._mutationObserver=new window.MutationObserver(this._onMutations.bind(this))}flush(){this._onMutations(this._mutationObserver.takeRecords())}observe(e){this._domElements.add(e),this.isEnabled&&this._mutationObserver.observe(e,this._config)}stopObserving(e){if(this._domElements.delete(e),this.isEnabled){this._mutationObserver.disconnect();for(let t of this._domElements)this._mutationObserver.observe(t,this._config)}}enable(){super.enable();for(let e of this._domElements)this._mutationObserver.observe(e,this._config)}disable(){super.disable(),this._mutationObserver.disconnect()}destroy(){super.destroy(),this._mutationObserver.disconnect()}_onMutations(e){if(e.length===0)return;let t=this.domConverter,i=new Set,o=new Set;for(let s of e){let r=t.mapDomToView(s.target);r&&(r.is("uiElement")||r.is("rawElement")||s.type==="childList"&&!this._isBogusBrMutation(s)&&o.add(r))}for(let s of e){let r=t.mapDomToView(s.target);if(!(r&&(r.is("uiElement")||r.is("rawElement")))&&s.type==="characterData"){let a=t.findCorrespondingViewText(s.target);a&&!o.has(a.parent)?i.add(a):!a&&Ze(s.target)&&o.add(t.mapDomToView(ke(s.target)))}}let n=[];for(let s of i)n.push({type:"text",node:s});for(let s of o){let r=t.mapViewToDom(s),a=Array.from(s.getChildren()),l=Array.from(t.domChildrenToView(r,{withChildren:!1}));Is(a,l,h6)||n.push({type:"children",node:s})}n.length&&this.document.fire("mutations",{mutations:n})}_isBogusBrMutation(e){let t=null;return e.nextSibling===null&&e.removedNodes.length===0&&e.addedNodes.length==1&&(t=this.domConverter.domToView(e.addedNodes[0],{withChildren:!1})),t&&t.is("element","br")}};function h6(e,t){if(!Array.isArray(e))return e===t?!0:e.is("$text")&&t.is("$text")?e.data===t.data:!1}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */var tr=class extends $e{_renderTimeoutId=null;_isFocusChanging=!1;domEventType=["focus","blur"];constructor(e){super(e),this.useCapture=!0;let t=this.document;t.on("focus",()=>this._handleFocus()),t.on("blur",(i,o)=>this._handleBlur(o)),t.on("beforeinput",()=>{t.isFocused||this._handleFocus()},{priority:"highest"})}flush(){this._isFocusChanging&&(this._isFocusChanging=!1,this.document.isFocused=!0)}onDomEvent(e){this.fire(e.type,e)}destroy(){this._clearTimeout(),super.destroy()}_handleFocus(){this._clearTimeout(),this._isFocusChanging=!0,this._renderTimeoutId=setTimeout(()=>{this._renderTimeoutId=null,this.flush(),this.view.change(()=>{})},50)}_handleBlur(e){let t=this.document.selection.editableElement;(t===null||t===e.target)&&(this.document.isFocused=!1,this._isFocusChanging=!1,this.view.change(()=>{}))}_clearTimeout(){this._renderTimeoutId&&(clearTimeout(this._renderTimeoutId),this._renderTimeoutId=null)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var d6=class extends it{mutationObserver;focusObserver;selection;domConverter;_documents=new WeakSet;_fireSelectionChangeDoneDebounced;_clearInfiniteLoopInterval;_documentIsSelectingInactivityTimeoutDebounced;_loopbackCounter=0;_pendingSelectionChange=new Set;_observedDomRoots=new Set;constructor(e){super(e),this.mutationObserver=e.getObserver(wp),this.focusObserver=e.getObserver(tr),this.selection=this.document.selection,this.domConverter=e.domConverter,this._fireSelectionChangeDoneDebounced=ye(t=>{this.document.fire("selectionChangeDone",t)},200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._documentIsSelectingInactivityTimeoutDebounced=ye(()=>this.document.isSelecting=!1,5e3),this.view.document.on("change:isFocused",(t,i,o)=>{o&&this._pendingSelectionChange.size&&(this._handleSelectionChange(),this._pendingSelectionChange.clear())})}observe(e){let t=e.ownerDocument,i=()=>{this.document.isSelecting=!0,this._documentIsSelectingInactivityTimeoutDebounced()},o=()=>{this.document.isSelecting&&(this._handleSelectionChange(),this.document.isSelecting=!1,this._documentIsSelectingInactivityTimeoutDebounced.cancel())};this.listenTo(e,"selectstart",i,{priority:"highest"}),this.listenTo(e,"keydown",o,{priority:"highest",useCapture:!0}),this.listenTo(e,"keyup",o,{priority:"highest",useCapture:!0}),this._observedDomRoots.add(e),!this._documents.has(t)&&(this.listenTo(t,"mouseup",o,{priority:"highest",useCapture:!0}),this.listenTo(t,"selectionchange",()=>{this.document.isComposing&&!V.isAndroid||(this._handleSelectionChange(),this._documentIsSelectingInactivityTimeoutDebounced())}),this.listenTo(this.view.document,"compositionstart",()=>{this._handleSelectionChange()},{priority:"lowest"}),this._documents.add(t))}stopObserving(e){this.stopListening(e),this._observedDomRoots.delete(e)}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel(),this._documentIsSelectingInactivityTimeoutDebounced.cancel()}_reportInfiniteLoop(){}_handleSelectionChange(){if(!this.isEnabled)return;let e=$t(Array.from(this._observedDomRoots));if(!e){this.view.hasDomSelection=!1;return}if(this.checkShouldIgnoreEventFromTarget(e.anchorNode))return;this.mutationObserver.flush();let t=this.domConverter.domSelectionToView(e);if(t.rangeCount==0){this.view.hasDomSelection=!1;return}this.view.hasDomSelection=!0;let i=e.anchorNode.getRootNode();if(this.focusObserver.flush(),!this.view.document.isFocused&&!this.view.document.isReadOnly){this._pendingSelectionChange.add(i);return}if(this._pendingSelectionChange.delete(i),!(this.selection.isEqual(t)&&this.domConverter.isDomSelectionCorrect(e))){if(++this._loopbackCounter>60){this._reportInfiniteLoop();return}if(!h6(t))this.view.forceRender();else if(this.selection.isSimilar(t))this.view.forceRender();else{let o={oldSelection:this.selection,newSelection:t,domSelection:e};this.document.fire("selectionChange",o),this._fireSelectionChangeDoneDebounced(o)}}}_clearInfiniteLoop(){this._loopbackCounter=0}};function h6(e){return Array.from(e.getRanges()).flatMap(t=>[t.start.root,t.end.root]).every(t=>t&&t.is("rootElement"))}/** +*/var f6=class extends it{mutationObserver;focusObserver;selection;domConverter;_documents=new WeakSet;_fireSelectionChangeDoneDebounced;_clearInfiniteLoopInterval;_documentIsSelectingInactivityTimeoutDebounced;_loopbackCounter=0;_pendingSelectionChange=new Set;_observedDomRoots=new Set;constructor(e){super(e),this.mutationObserver=e.getObserver(_p),this.focusObserver=e.getObserver(tr),this.selection=this.document.selection,this.domConverter=e.domConverter,this._fireSelectionChangeDoneDebounced=ve(t=>{this.document.fire("selectionChangeDone",t)},200),this._clearInfiniteLoopInterval=setInterval(()=>this._clearInfiniteLoop(),1e3),this._documentIsSelectingInactivityTimeoutDebounced=ve(()=>this.document.isSelecting=!1,5e3),this.view.document.on("change:isFocused",(t,i,o)=>{o&&this._pendingSelectionChange.size&&(this._handleSelectionChange(),this._pendingSelectionChange.clear())})}observe(e){let t=e.ownerDocument,i=()=>{this.document.isSelecting=!0,this._documentIsSelectingInactivityTimeoutDebounced()},o=()=>{this.document.isSelecting&&(this._handleSelectionChange(),this.document.isSelecting=!1,this._documentIsSelectingInactivityTimeoutDebounced.cancel())};this.listenTo(e,"selectstart",i,{priority:"highest"}),this.listenTo(e,"keydown",o,{priority:"highest",useCapture:!0}),this.listenTo(e,"keyup",o,{priority:"highest",useCapture:!0}),this._observedDomRoots.add(e),!this._documents.has(t)&&(this.listenTo(t,"mouseup",o,{priority:"highest",useCapture:!0}),this.listenTo(t,"selectionchange",()=>{this.document.isComposing&&!V.isAndroid||(this._handleSelectionChange(),this._documentIsSelectingInactivityTimeoutDebounced())}),this.listenTo(this.view.document,"compositionstart",()=>{this._handleSelectionChange()},{priority:"lowest"}),this._documents.add(t))}stopObserving(e){this.stopListening(e),this._observedDomRoots.delete(e)}destroy(){super.destroy(),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel(),this._documentIsSelectingInactivityTimeoutDebounced.cancel()}_reportInfiniteLoop(){}_handleSelectionChange(){if(!this.isEnabled)return;let e=Kt(Array.from(this._observedDomRoots));if(!e){this.view.hasDomSelection=!1;return}if(this.checkShouldIgnoreEventFromTarget(e.anchorNode))return;this.mutationObserver.flush();let t=this.domConverter.domSelectionToView(e);if(t.rangeCount==0){this.view.hasDomSelection=!1;return}this.view.hasDomSelection=!0;let i=e.anchorNode.getRootNode();if(this.focusObserver.flush(),!this.view.document.isFocused&&!this.view.document.isReadOnly){this._pendingSelectionChange.add(i);return}if(this._pendingSelectionChange.delete(i),!(this.selection.isEqual(t)&&this.domConverter.isDomSelectionCorrect(e))){if(++this._loopbackCounter>60){this._reportInfiniteLoop();return}if(!m6(t))this.view.forceRender();else if(this.selection.isSimilar(t))this.view.forceRender();else{let o={oldSelection:this.selection,newSelection:t,domSelection:e};this.document.fire("selectionChange",o),this._fireSelectionChangeDoneDebounced(o)}}}_clearInfiniteLoop(){this._loopbackCounter=0}};function m6(e){return Array.from(e.getRanges()).flatMap(t=>[t.start.root,t.end.root]).every(t=>t&&t.is("rootElement"))}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var f6=class extends $e{domEventType=["compositionstart","compositionupdate","compositionend"];constructor(e){super(e);let t=this.document;t.on("compositionstart",()=>{t.isComposing=!0}),t.on("compositionend",()=>{t.isComposing=!1})}onDomEvent(e){this.fire(e.type,e,{data:e.data})}};/** +*/var g6=class extends $e{domEventType=["compositionstart","compositionupdate","compositionend"];constructor(e){super(e);let t=this.document;t.on("compositionstart",()=>{t.isComposing=!0}),t.on("compositionend",()=>{t.isComposing=!1})}onDomEvent(e){this.fire(e.type,e,{data:e.data})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var wd=class{_files;_native;constructor(e,t={}){this._files=t.cacheFiles?Lg(e):null,this._native=e}get files(){return this._files||(this._files=Lg(this._native)),this._files}get types(){return this._native.types}getData(e){return this._native.getData(e)}setData(e,t){this._native.setData(e,t)}set effectAllowed(e){this._native.effectAllowed=e}get effectAllowed(){return this._native.effectAllowed}set dropEffect(e){this._native.dropEffect=e}get dropEffect(){return this._native.dropEffect}setDragImage(e,t,i){this._native.setDragImage(e,t,i)}get isCanceled(){return this._native.dropEffect=="none"||!!this._native.mozUserCancelled}};function Lg(e){let t=Array.from(e.files||[]),i=Array.from(e.items||[]);return t.length?t:i.filter(o=>o.kind==="file").map(o=>o.getAsFile())}/** +*/var _d=class{_files;_native;constructor(e,t={}){this._files=t.cacheFiles?Bg(e):null,this._native=e}get files(){return this._files||(this._files=Bg(this._native)),this._files}get types(){return this._native.types}getData(e){return this._native.getData(e)}setData(e,t){this._native.setData(e,t)}set effectAllowed(e){this._native.effectAllowed=e}get effectAllowed(){return this._native.effectAllowed}set dropEffect(e){this._native.dropEffect=e}get dropEffect(){return this._native.dropEffect}setDragImage(e,t,i){this._native.setDragImage(e,t,i)}get isCanceled(){return this._native.dropEffect=="none"||!!this._native.mozUserCancelled}};function Bg(e){let t=Array.from(e.files||[]),i=Array.from(e.items||[]);return t.length?t:i.filter(o=>o.kind==="file").map(o=>o.getAsFile())}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var m6=class extends $e{domEventType="beforeinput";onDomEvent(e){let t=e.getTargetRanges(),i=this.view,o=i.document,n=null,s=null,r=[];if(e.dataTransfer&&(n=new wd(e.dataTransfer)),e.data!==null?s=e.data:n&&(s=n.getData("text/plain")),o.selection.isFake)r=Array.from(o.selection.getRanges()),e.preventDefault();else if(t.length)r=t.map(a=>{let l=i.domConverter.domPositionToView(a.startContainer,a.startOffset),c=i.domConverter.domPositionToView(a.endContainer,a.endOffset);if(l&&Ze(a.startContainer)&&a.startOffset<7){e.preventDefault();let u=7-a.startOffset;l=l.getLastMatchingPosition(d=>!!(d.item.is("attributeElement")||d.item.is("uiElement")||d.item.is("$textProxy")&&u--),{direction:"backward",singleCharacters:!0})}if(g6(a.endContainer,a.endOffset)&&e.preventDefault(),l)return i.createRange(l,c);if(c)return i.createRange(c)}).filter(a=>!!a);else if(V.isAndroid){let a=$t(e.target);r=Array.from(i.domConverter.domSelectionToView(a).getRanges())}if(V.isAndroid&&e.inputType=="insertCompositionText"&&s&&s.endsWith(` +*/var p6=class extends $e{domEventType="beforeinput";onDomEvent(e){let t=e.getTargetRanges(),i=this.view,o=i.document,n=null,s=null,r=[];if(e.dataTransfer&&(n=new _d(e.dataTransfer)),e.data!==null?s=e.data:n&&(s=n.getData("text/plain")),o.selection.isFake)r=Array.from(o.selection.getRanges()),e.preventDefault();else if(t.length)r=t.map(a=>{let l=i.domConverter.domPositionToView(a.startContainer,a.startOffset),c=i.domConverter.domPositionToView(a.endContainer,a.endOffset);if(l&&Ze(a.startContainer)&&a.startOffset<7){e.preventDefault();let u=7-a.startOffset;l=l.getLastMatchingPosition(d=>!!(d.item.is("attributeElement")||d.item.is("uiElement")||d.item.is("$textProxy")&&u--),{direction:"backward",singleCharacters:!0})}if(b6(a.endContainer,a.endOffset)&&e.preventDefault(),l)return i.createRange(l,c);if(c)return i.createRange(c)}).filter(a=>!!a);else if(V.isAndroid){let a=Kt(e.target);r=Array.from(i.domConverter.domSelectionToView(a).getRanges())}if(V.isAndroid&&e.inputType=="insertCompositionText"&&s&&s.endsWith(` `)){this.fire(e.type,e,{inputType:"insertParagraph",targetRanges:[i.createRange(r[0].end)]});return}if(["insertText","insertReplacementText"].includes(e.inputType)&&s&&s.includes(` -`)){let a=s.split(/\n{1,2}/g),l=r;e.preventDefault();for(let c=0;c{if(this.isEnabled&&fg(i.keyCode)){let o=new gi(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(o,i),o.stop.called&&t.stop()}})}observe(){}stopObserving(){}};/** +*/var w6=class extends it{constructor(e){super(e),this.document.on("keydown",(t,i)=>{if(this.isEnabled&&gg(i.keyCode)){let o=new bi(this.document,"arrowKey",this.document.selection.getFirstRange());this.document.fire(o,i),o.stop.called&&t.stop()}})}observe(){}stopObserving(){}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var b6=class extends it{constructor(e){super(e);let t=this.document;t.on("keydown",(i,o)=>{if(!this.isEnabled||o.keyCode!=O.tab||o.ctrlKey)return;let n=new gi(t,"tab",t.selection.getFirstRange());t.fire(n,o),n.stop.called&&i.stop()})}observe(){}stopObserving(){}};/** +*/var y6=class extends it{constructor(e){super(e);let t=this.document;t.on("keydown",(i,o)=>{if(!this.isEnabled||o.keyCode!=O.tab||o.ctrlKey)return;let n=new bi(t,"tab",t.selection.getFirstRange());t.fire(n,o),n.stop.called&&i.stop()})}observe(){}stopObserving(){}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var w6=W(),y6=class extends w6{document;domConverter;domRoots=new Map;_renderer;_initialDomRootAttributes=new WeakMap;_observers=new Map;_writer;_ongoingChange=!1;_postFixersInProgress=!1;_renderingDisabled=!1;_hasChangedSinceTheLastRendering=!1;constructor(e){super(),this.document=new ar(e),this.domConverter=new To(this.document),this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new $4(this.domConverter,this.document.selection),this._renderer.bind("isFocused","isSelecting","isComposing").to(this.document,"isFocused","isSelecting","isComposing"),this._writer=new bd(this.document),this.addObserver(wp),this.addObserver(tr),this.addObserver(d6),this.addObserver(l6),this.addObserver(c6),this.addObserver(f6),this.addObserver(p6),this.addObserver(m6),this.addObserver(b6),W4(this),V4(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0}),this.listenTo(this.document,"change:isFocused",()=>{this._hasChangedSinceTheLastRendering=!0}),V.isiOS&&this.listenTo(this.document,"blur",(t,i)=>{this.domConverter.mapDomToView(i.domEvent.relatedTarget)||this.domConverter._clearDomSelection()}),this.listenTo(this.document,"mutations",(t,{mutations:i})=>{i.forEach(o=>this._renderer.markToSync(o.type,o.node))},{priority:"low"}),this.listenTo(this.document,"mutations",()=>{this.forceRender()},{priority:"lowest"})}attachDomRoot(e,t="main"){let i=this.document.getRoot(t);i._name=e.tagName.toLowerCase();let o={};for(let{name:s,value:r}of Array.from(e.attributes))o[s]=r,s==="class"?this._writer.addClass(r.split(" "),i):i.hasAttribute(s)||this._writer.setAttribute(s,r,i);this._initialDomRootAttributes.set(e,o);let n=()=>{this._writer.setAttribute("contenteditable",(!i.isReadOnly).toString(),i),i.isReadOnly?this._writer.addClass("ck-read-only",i):this._writer.removeClass("ck-read-only",i)};n(),this.domRoots.set(t,e),this.domConverter.bindElements(e,i),this._renderer.markToSync("children",i),this._renderer.markToSync("attributes",i),this._renderer.addDomRoot(e),i.on("change:children",(s,r)=>this._renderer.markToSync("children",r)),i.on("change:attributes",(s,r)=>this._renderer.markToSync("attributes",r)),i.on("change:text",(s,r)=>this._renderer.markToSync("text",r)),i.on("change:isReadOnly",()=>this.change(n)),i.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(let s of this._observers.values())s.observe(e,t)}detachDomRoot(e){let t=this.domRoots.get(e);Array.from(t.attributes).forEach(({name:o})=>t.removeAttribute(o));let i=this._initialDomRootAttributes.get(t);for(let o in i)t.setAttribute(o,Da(t,o,i[o]));this.domRoots.delete(e),this.domConverter.unbindDomElement(t),this._renderer.removeDomRoot(t);for(let o of this._observers.values())o.stopObserving(t)}getDomRoot(e="main"){return this.domRoots.get(e)}addObserver(e){let t=this._observers.get(e);if(t)return t;t=new e(this),this._observers.set(e,t);for(let[i,o]of this.domRoots)t.observe(o,i);return t.enable(),t}getObserver(e){return this._observers.get(e)}disableObservers(){for(let e of this._observers.values())e.disable()}enableObservers(){for(let e of this._observers.values())e.enable()}scrollToTheSelection({alignToTop:e,forceScroll:t,viewportOffset:i=20,ancestorOffset:o=20}={}){let n=this.document.selection.getFirstRange();if(!n)return;let s=Ae({alignToTop:e,forceScroll:t,viewportOffset:i,ancestorOffset:o});typeof i=="number"&&(i={top:i,bottom:i,left:i,right:i});let r={target:this.domConverter.viewRangeToDom(n),viewportOffset:i,ancestorOffset:o,alignToTop:e,forceScroll:t};this.fire("scrollToTheSelection",r,s),lg(r)}focus(){if(!this.document.isFocused){let e=this.document.selection.editableElement;e&&(this.domConverter.focus(e),this.forceRender())}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress)throw new p("cannot-change-view-tree",this);try{if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;let t=e(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),t}catch(t){p.rethrowUnexpectedError(t,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.getObserver(tr).flush(),this.change(()=>{})}destroy(){for(let e of this._observers.values())e.destroy();this.document.destroy(),this.stopListening()}createPositionAt(e,t){return P._createAt(e,t)}createPositionAfter(e){return P._createAfter(e)}createPositionBefore(e){return P._createBefore(e)}createRange(e,t){return new N(e,t)}createRangeOn(e){return N._createOn(e)}createRangeIn(e){return N._createIn(e)}createSelection(...e){return new fi(...e)}_disableRendering(e){this._renderingDisabled=e,e==!1&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}};/** +*/var _6=W(),v6=class extends _6{document;domConverter;domRoots=new Map;_renderer;_initialDomRootAttributes=new WeakMap;_observers=new Map;_writer;_ongoingChange=!1;_postFixersInProgress=!1;_renderingDisabled=!1;_hasChangedSinceTheLastRendering=!1;constructor(e){super(),this.document=new ar(e),this.domConverter=new Eo(this.document),this.set("isRenderingInProgress",!1),this.set("hasDomSelection",!1),this._renderer=new K4(this.domConverter,this.document.selection),this._renderer.bind("isFocused","isSelecting","isComposing").to(this.document,"isFocused","isSelecting","isComposing"),this._writer=new yd(this.document),this.addObserver(_p),this.addObserver(tr),this.addObserver(f6),this.addObserver(u6),this.addObserver(d6),this.addObserver(g6),this.addObserver(w6),this.addObserver(p6),this.addObserver(y6),q4(this),M4(this),this.on("render",()=>{this._render(),this.document.fire("layoutChanged"),this._hasChangedSinceTheLastRendering=!1}),this.listenTo(this.document.selection,"change",()=>{this._hasChangedSinceTheLastRendering=!0}),this.listenTo(this.document,"change:isFocused",()=>{this._hasChangedSinceTheLastRendering=!0}),V.isiOS&&this.listenTo(this.document,"blur",(t,i)=>{this.domConverter.mapDomToView(i.domEvent.relatedTarget)||this.domConverter._clearDomSelection()}),this.listenTo(this.document,"mutations",(t,{mutations:i})=>{i.forEach(o=>this._renderer.markToSync(o.type,o.node))},{priority:"low"}),this.listenTo(this.document,"mutations",()=>{this.forceRender()},{priority:"lowest"})}attachDomRoot(e,t="main"){let i=this.document.getRoot(t);i._name=e.tagName.toLowerCase();let o={};for(let{name:s,value:r}of Array.from(e.attributes))o[s]=r,s==="class"?this._writer.addClass(r.split(" "),i):i.hasAttribute(s)||this._writer.setAttribute(s,r,i);this._initialDomRootAttributes.set(e,o);let n=()=>{this._writer.setAttribute("contenteditable",(!i.isReadOnly).toString(),i),i.isReadOnly?this._writer.addClass("ck-read-only",i):this._writer.removeClass("ck-read-only",i)};n(),this.domRoots.set(t,e),this.domConverter.bindElements(e,i),this._renderer.markToSync("children",i),this._renderer.markToSync("attributes",i),this._renderer.addDomRoot(e),i.on("change:children",(s,r)=>this._renderer.markToSync("children",r)),i.on("change:attributes",(s,r)=>this._renderer.markToSync("attributes",r)),i.on("change:text",(s,r)=>this._renderer.markToSync("text",r)),i.on("change:isReadOnly",()=>this.change(n)),i.on("change",()=>{this._hasChangedSinceTheLastRendering=!0});for(let s of this._observers.values())s.observe(e,t)}detachDomRoot(e){let t=this.domRoots.get(e);Array.from(t.attributes).forEach(({name:o})=>t.removeAttribute(o));let i=this._initialDomRootAttributes.get(t);for(let o in i)t.setAttribute(o,Fa(t,o,i[o]));this.domRoots.delete(e),this.domConverter.unbindDomElement(t),this._renderer.removeDomRoot(t);for(let o of this._observers.values())o.stopObserving(t)}getDomRoot(e="main"){return this.domRoots.get(e)}addObserver(e){let t=this._observers.get(e);if(t)return t;t=new e(this),this._observers.set(e,t);for(let[i,o]of this.domRoots)t.observe(o,i);return t.enable(),t}getObserver(e){return this._observers.get(e)}disableObservers(){for(let e of this._observers.values())e.disable()}enableObservers(){for(let e of this._observers.values())e.enable()}scrollToTheSelection({alignToTop:e,forceScroll:t,viewportOffset:i=20,ancestorOffset:o=20}={}){let n=this.document.selection.getFirstRange();if(!n)return;let s=Se({alignToTop:e,forceScroll:t,viewportOffset:i,ancestorOffset:o});typeof i=="number"&&(i={top:i,bottom:i,left:i,right:i});let r={target:this.domConverter.viewRangeToDom(n),viewportOffset:i,ancestorOffset:o,alignToTop:e,forceScroll:t};this.fire("scrollToTheSelection",r,s),ug(r)}focus(){if(!this.document.isFocused){let e=this.document.selection.editableElement;e&&(this.domConverter.focus(e),this.forceRender())}}change(e){if(this.isRenderingInProgress||this._postFixersInProgress)throw new p("cannot-change-view-tree",this);try{if(this._ongoingChange)return e(this._writer);this._ongoingChange=!0;let t=e(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire("render")),t}catch(t){p.rethrowUnexpectedError(t,this)}}forceRender(){this._hasChangedSinceTheLastRendering=!0,this.getObserver(tr).flush(),this.change(()=>{})}destroy(){for(let e of this._observers.values())e.destroy();this.document.destroy(),this.stopListening()}createPositionAt(e,t){return P._createAt(e,t)}createPositionAfter(e){return P._createAfter(e)}createPositionBefore(e){return P._createBefore(e)}createRange(e,t){return new N(e,t)}createRangeOn(e){return N._createOn(e)}createRangeIn(e){return N._createIn(e)}createSelection(...e){return new gi(...e)}_disableRendering(e){this._renderingDisabled=e,e==!1&&this.change(()=>{})}_render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Wi=class{is(){throw new Error("is() method is abstract")}};/** +*/var qi=class{is(){throw new Error("is() method is abstract")}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Gt=class extends Wi{textNode;data;offsetInText;constructor(e,t,i){if(super(),this.textNode=e,t<0||t>e.offsetSize)throw new p("model-textproxy-wrong-offsetintext",this);if(i<0||t+i>e.offsetSize)throw new p("model-textproxy-wrong-length",this);this.data=e.data.substring(t,t+i),this.offsetInText=t}get startOffset(){return this.textNode.startOffset!==null?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return this.startOffset!==null?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}getPath(){let e=this.textNode.getPath();return e.length>0&&(e[e.length-1]+=this.offsetInText),e}getAncestors(e={}){let t=[],i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}hasAttribute(e){return this.textNode.hasAttribute(e)}getAttribute(e){return this.textNode.getAttribute(e)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}};Gt.prototype.is=function(e){return e==="$textProxy"||e==="model:$textProxy"||e==="textProxy"||e==="model:textProxy"};/** +*/var Zt=class extends qi{textNode;data;offsetInText;constructor(e,t,i){if(super(),this.textNode=e,t<0||t>e.offsetSize)throw new p("model-textproxy-wrong-offsetintext",this);if(i<0||t+i>e.offsetSize)throw new p("model-textproxy-wrong-length",this);this.data=e.data.substring(t,t+i),this.offsetInText=t}get startOffset(){return this.textNode.startOffset!==null?this.textNode.startOffset+this.offsetInText:null}get offsetSize(){return this.data.length}get endOffset(){return this.startOffset!==null?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}getPath(){let e=this.textNode.getPath();return e.length>0&&(e[e.length-1]+=this.offsetInText),e}getAncestors(e={}){let t=[],i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}hasAttribute(e){return this.textNode.hasAttribute(e)}getAttribute(e){return this.textNode.getAttribute(e)}getAttributes(){return this.textNode.getAttributes()}getAttributeKeys(){return this.textNode.getAttributeKeys()}};Zt.prototype.is=function(e){return e==="$textProxy"||e==="model:$textProxy"||e==="textProxy"||e==="model:textProxy"};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Pt=class{direction;boundaries;singleCharacters;shallow;ignoreElementEnd;_position;_boundaryStartParent;_boundaryEndParent;_visitedParent;constructor(e){if(!e||!e.boundaries&&!e.startPosition)throw new p("model-tree-walker-no-start-position",null);let t=e.direction||"forward";if(t!="forward"&&t!="backward")throw new p("model-tree-walker-unknown-direction",e,{direction:t});this.direction=t,this.boundaries=e.boundaries||null,e.startPosition?this._position=e.startPosition.clone():this._position=A._createAt(this.boundaries[this.direction=="backward"?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.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}get position(){return this._position}skip(e){let t,i,o,n;do o=this.position,n=this._visitedParent,{done:t,value:i}=this.next();while(!t&&e(i));t||(this._position=o,this._visitedParent=n)}jumpTo(e){this._boundaryStartParent&&e.isBefore(this.boundaries.start)?e=this.boundaries.start:this._boundaryEndParent&&e.isAfter(this.boundaries.end)&&(e=this.boundaries.end),this._position=e.clone(),this._visitedParent=e.parent}next(){return this.direction=="forward"?this._next():this._previous()}_next(){let e=this.position,t=this.position.clone(),i=this._visitedParent;if(i.parent===null&&t.offset===i.maxOffset)return{done:!0,value:void 0};if(i===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0,value:void 0};let o=Gs(t,i),n=o||yp(t,i,o);if(n&&n.is("model:element")){if(!this.shallow)t.path.push(0),this._visitedParent=n;else{if(this.boundaries&&this.boundaries.end.isBefore(t))return{done:!0,value:void 0};t.offset++}return this._position=t,yo("elementStart",n,e,t,1)}if(n&&n.is("model:$text")){let s;if(this.singleCharacters)s=1;else{let l=n.endOffset;this._boundaryEndParent==i&&this.boundaries.end.offsetc&&(c=this.boundaries.start.offset),r=t.offset-c}let a=t.offset-s.startOffset,l=new Gt(s,a-r,r);return t.offset-=r,this._position=t,yo("text",l,e,t,r)}return t.path.pop(),this._position=t,this._visitedParent=i.parent,yo("elementStart",i,e,t,1)}};function yo(e,t,i,o,n){return{done:!1,value:{type:e,item:t,previousPosition:i,nextPosition:o,length:n}}}/** +*/var Rt=class{direction;boundaries;singleCharacters;shallow;ignoreElementEnd;_position;_boundaryStartParent;_boundaryEndParent;_visitedParent;constructor(e){if(!e||!e.boundaries&&!e.startPosition)throw new p("model-tree-walker-no-start-position",null);let t=e.direction||"forward";if(t!="forward"&&t!="backward")throw new p("model-tree-walker-unknown-direction",e,{direction:t});this.direction=t,this.boundaries=e.boundaries||null,e.startPosition?this._position=e.startPosition.clone():this._position=A._createAt(this.boundaries[this.direction=="backward"?"end":"start"]),this.position.stickiness="toNone",this.singleCharacters=!!e.singleCharacters,this.shallow=!!e.shallow,this.ignoreElementEnd=!!e.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}get position(){return this._position}skip(e){let t,i,o,n;do o=this.position,n=this._visitedParent,{done:t,value:i}=this.next();while(!t&&e(i));t||(this._position=o,this._visitedParent=n)}jumpTo(e){this._boundaryStartParent&&e.isBefore(this.boundaries.start)?e=this.boundaries.start:this._boundaryEndParent&&e.isAfter(this.boundaries.end)&&(e=this.boundaries.end),this._position=e.clone(),this._visitedParent=e.parent}next(){return this.direction=="forward"?this._next():this._previous()}_next(){let e=this.position,t=this.position.clone(),i=this._visitedParent;if(i.parent===null&&t.offset===i.maxOffset)return{done:!0,value:void 0};if(i===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0,value:void 0};let o=Gs(t,i),n=o||vp(t,i,o);if(n&&n.is("model:element")){if(!this.shallow)t.path.push(0),this._visitedParent=n;else{if(this.boundaries&&this.boundaries.end.isBefore(t))return{done:!0,value:void 0};t.offset++}return this._position=t,_o("elementStart",n,e,t,1)}if(n&&n.is("model:$text")){let s;if(this.singleCharacters)s=1;else{let l=n.endOffset;this._boundaryEndParent==i&&this.boundaries.end.offsetc&&(c=this.boundaries.start.offset),r=t.offset-c}let a=t.offset-s.startOffset,l=new Zt(s,a-r,r);return t.offset-=r,this._position=t,_o("text",l,e,t,r)}return t.path.pop(),this._position=t,this._visitedParent=i.parent,_o("elementStart",i,e,t,1)}};function _o(e,t,i,o,n){return{done:!1,value:{type:e,item:t,previousPosition:i,nextPosition:o,length:n}}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var A=class It extends Wi{root;path;stickiness;constructor(t,i,o="toNone"){if(super(),!t.is("element")&&!t.is("documentFragment"))throw new p("model-position-root-invalid",t);if(!Array.isArray(i)||i.length===0)throw new p("model-position-path-incorrect-format",t,{path:i});t.is("rootElement")?i=i.slice():(i=[...t.getPath(),...i],t=t.root),this.root=t,this.path=i,this.stickiness=o}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 i=0;i1)return!1;if(n===1)return Mg(t,this,o);if(n===-1)return Mg(this,t,o)}return this.path.length===t.path.length?!0:this.path.length>t.path.length?nd(this.path,i):nd(t.path,i)}hasSameParentAs(t){if(this.root!==t.root)return!1;let i=this.getParentPath(),o=t.getParentPath();return ve(i,o)=="same"}getTransformedByOperation(t){let i;switch(t.type){case"insert":i=this._getTransformedByInsertOperation(t);break;case"move":case"remove":case"reinsert":i=this._getTransformedByMoveOperation(t);break;case"split":i=this._getTransformedBySplitOperation(t);break;case"merge":i=this._getTransformedByMergeOperation(t);break;case"detach":i=this._getTransformedByDetachOperation(t);break;default:i=It._createAt(this)}return i}_getTransformedByDetachOperation(t){return this._getTransformedByDeletion(t.sourcePosition,t.howMany)||It._createAt(t.sourcePosition)}_getTransformedByInsertOperation(t){return this._getTransformedByInsertion(t.position,t.howMany)}_getTransformedByMoveOperation(t){return this._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany)}_getTransformedBySplitOperation(t){let i=t.movedRange;return i.containsPosition(this)||i.start.isEqual(this)&&this.stickiness=="toNext"?this._getCombined(t.splitPosition,t.moveTargetPosition):t.graveyardPosition?this._getTransformedByMove(t.graveyardPosition,t.insertionPosition,1):this._getTransformedByInsertion(t.insertionPosition,1)}_getTransformedByMergeOperation(t){let i=t.movedRange,o=i.containsPosition(this)||i.start.isEqual(this),n;return o?(n=this._getCombined(t.sourcePosition,t.targetPosition),t.sourcePosition.isBefore(t.targetPosition)&&(n=n._getTransformedByDeletion(t.deletionPosition,1))):this.isEqual(t.deletionPosition)?n=It._createAt(t.deletionPosition):n=this._getTransformedByMove(t.deletionPosition,t.graveyardPosition,1),n}_getTransformedByDeletion(t,i){let o=It._createAt(this);if(this.root!=t.root)return o;if(ve(t.getParentPath(),this.getParentPath())=="same"){if(t.offsetthis.offset)return null;o.offset-=i}}else if(ve(t.getParentPath(),this.getParentPath())=="prefix"){let n=t.path.length-1;if(t.offset<=this.path[n]){if(t.offset+i>this.path[n])return null;o.path[n]-=i}}return o}_getTransformedByInsertion(t,i){let o=It._createAt(this);if(this.root!=t.root)return o;if(ve(t.getParentPath(),this.getParentPath())=="same")(t.offset=t;){if(e.path[o]+n!==i.maxOffset)return!1;n=1,o--,i=i.parent}return!0}/** +*/var A=class St extends qi{root;path;stickiness;constructor(t,i,o="toNone"){if(super(),!t.is("element")&&!t.is("documentFragment"))throw new p("model-position-root-invalid",t);if(!Array.isArray(i)||i.length===0)throw new p("model-position-path-incorrect-format",t,{path:i});t.is("rootElement")?i=i.slice():(i=[...t.getPath(),...i],t=t.root),this.root=t,this.path=i,this.stickiness=o}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 i=0;i1)return!1;if(n===1)return Og(t,this,o);if(n===-1)return Og(this,t,o)}return this.path.length===t.path.length?!0:this.path.length>t.path.length?rd(this.path,i):rd(t.path,i)}hasSameParentAs(t){if(this.root!==t.root)return!1;let i=this.getParentPath(),o=t.getParentPath();return Ce(i,o)=="same"}getTransformedByOperation(t){let i;switch(t.type){case"insert":i=this._getTransformedByInsertOperation(t);break;case"move":case"remove":case"reinsert":i=this._getTransformedByMoveOperation(t);break;case"split":i=this._getTransformedBySplitOperation(t);break;case"merge":i=this._getTransformedByMergeOperation(t);break;case"detach":i=this._getTransformedByDetachOperation(t);break;default:i=St._createAt(this)}return i}_getTransformedByDetachOperation(t){return this._getTransformedByDeletion(t.sourcePosition,t.howMany)||St._createAt(t.sourcePosition)}_getTransformedByInsertOperation(t){return this._getTransformedByInsertion(t.position,t.howMany)}_getTransformedByMoveOperation(t){return this._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany)}_getTransformedBySplitOperation(t){let i=t.movedRange;return i.containsPosition(this)||i.start.isEqual(this)&&this.stickiness=="toNext"?this._getCombined(t.splitPosition,t.moveTargetPosition):t.graveyardPosition?this._getTransformedByMove(t.graveyardPosition,t.insertionPosition,1):this._getTransformedByInsertion(t.insertionPosition,1)}_getTransformedByMergeOperation(t){let i=t.movedRange,o=i.containsPosition(this)||i.start.isEqual(this),n;return o?(n=this._getCombined(t.sourcePosition,t.targetPosition),t.sourcePosition.isBefore(t.targetPosition)&&(n=n._getTransformedByDeletion(t.deletionPosition,1))):this.isEqual(t.deletionPosition)?n=St._createAt(t.deletionPosition):n=this._getTransformedByMove(t.deletionPosition,t.graveyardPosition,1),n}_getTransformedByDeletion(t,i){let o=St._createAt(this);if(this.root!=t.root)return o;if(Ce(t.getParentPath(),this.getParentPath())=="same"){if(t.offsetthis.offset)return null;o.offset-=i}}else if(Ce(t.getParentPath(),this.getParentPath())=="prefix"){let n=t.path.length-1;if(t.offset<=this.path[n]){if(t.offset+i>this.path[n])return null;o.path[n]-=i}}return o}_getTransformedByInsertion(t,i){let o=St._createAt(this);if(this.root!=t.root)return o;if(Ce(t.getParentPath(),this.getParentPath())=="same")(t.offset=t;){if(e.path[o]+n!==i.maxOffset)return!1;n=1,o--,i=i.parent}return!0}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var T=class se extends Wi{start;end;constructor(t,i){super(),this.start=A._createAt(t),this.end=i?A._createAt(i):A._createAt(t),this.start.stickiness=this.isCollapsed?"toNone":"toNext",this.end.stickiness=this.isCollapsed?"toNone":"toPrevious"}*[Symbol.iterator](){yield*new Pt({boundaries:this,ignoreElementEnd:!0})}get isCollapsed(){return this.start.isEqual(this.end)}get isFlat(){let t=this.start.getParentPath(),i=this.end.getParentPath();return ve(t,i)=="same"}get root(){return this.start.root}containsPosition(t){return t.isAfter(this.start)&&t.isBefore(this.end)}containsRange(t,i=!1){t.isCollapsed&&(i=!1);let o=this.containsPosition(t.start)||i&&this.start.isEqual(t.start),n=this.containsPosition(t.end)||i&&this.end.isEqual(t.end);return o&&n}containsItem(t){let i=A._createBefore(t);return this.containsPosition(i)||this.start.isEqual(i)}isEqual(t){return this.start.isEqual(t.start)&&this.end.isEqual(t.end)}isIntersecting(t){return this.start.isBefore(t.end)&&this.end.isAfter(t.start)}getDifference(t){let i=[];return this.isIntersecting(t)?(this.containsPosition(t.start)&&i.push(new se(this.start,t.start)),this.containsPosition(t.end)&&i.push(new se(t.end,this.end))):i.push(new se(this.start,this.end)),i}getIntersection(t){if(this.isIntersecting(t)){let i=this.start,o=this.end;return this.containsPosition(t.start)&&(i=t.start),this.containsPosition(t.end)&&(o=t.end),new se(i,o)}return null}getJoined(t,i=!1){let o=this.isIntersecting(t);if(o||(this.start.isBefore(t.start)?o=i?this.end.isTouching(t.start):this.end.isEqual(t.start):o=i?t.end.isTouching(this.start):t.end.isEqual(this.start)),!o)return null;let n=this.start,s=this.end;return t.start.isBefore(n)&&(n=t.start),t.end.isAfter(s)&&(s=t.end),new se(n,s)}getMinimalFlatRanges(){let t=[],i=this.start.getCommonPath(this.end).length,o=A._createAt(this.start),n=o.parent;for(;o.path.length>i+1;){let s=n.maxOffset-o.offset;s!==0&&t.push(new se(o,o.getShiftedBy(s))),o.path=o.path.slice(0,-1),o.offset++,n=n.parent}for(;o.path.length<=this.end.path.length;){let s=this.end.path[o.path.length-1],r=s-o.offset;r!==0&&t.push(new se(o,o.getShiftedBy(r))),o.offset=s,o.path.push(0)}return t}getWalker(t={}){return t.boundaries=this,new Pt(t)}*getItems(t={}){t.boundaries=this,t.ignoreElementEnd=!0;let i=new Pt(t);for(let o of i)yield o.item}*getPositions(t={}){t.boundaries=this;let i=new Pt(t);yield i.position;for(let o of i)yield o.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)];case"detach":return this._getTransformedByDetachOperation(t)}return[new se(this.start,this.end)]}getTransformedByOperations(t){let i=[new se(this.start,this.end)];for(let o of t)for(let n=0;n0?new this(o,n):new this(n,o)}static _createIn(t){return new this(A._createAt(t,0),A._createAt(t,t.maxOffset))}static _createOn(t){return this._createFromPositionAndShift(A._createBefore(t),t.offsetSize)}static _createFromRanges(t){if(t.length===0)throw new p("range-create-from-ranges-empty-array",null);if(t.length==1)return t[0].clone();let i=t[0];t.sort((s,r)=>s.start.isAfter(r.start)?1:-1);let o=t.indexOf(i),n=new this(i.start,i.end);for(let s=o-1;s>=0&&t[s].end.isEqual(n.start);s--)n.start=A._createAt(t[s].start);for(let s=o+1;si+1;){let s=n.maxOffset-o.offset;s!==0&&t.push(new se(o,o.getShiftedBy(s))),o.path=o.path.slice(0,-1),o.offset++,n=n.parent}for(;o.path.length<=this.end.path.length;){let s=this.end.path[o.path.length-1],r=s-o.offset;r!==0&&t.push(new se(o,o.getShiftedBy(r))),o.offset=s,o.path.push(0)}return t}getWalker(t={}){return t.boundaries=this,new Rt(t)}*getItems(t={}){t.boundaries=this,t.ignoreElementEnd=!0;let i=new Rt(t);for(let o of i)yield o.item}*getPositions(t={}){t.boundaries=this;let i=new Rt(t);yield i.position;for(let o of i)yield o.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)];case"detach":return this._getTransformedByDetachOperation(t)}return[new se(this.start,this.end)]}getTransformedByOperations(t){let i=[new se(this.start,this.end)];for(let o of t)for(let n=0;n0?new this(o,n):new this(n,o)}static _createIn(t){return new this(A._createAt(t,0),A._createAt(t,t.maxOffset))}static _createOn(t){return this._createFromPositionAndShift(A._createBefore(t),t.offsetSize)}static _createFromRanges(t){if(t.length===0)throw new p("range-create-from-ranges-empty-array",null);if(t.length==1)return t[0].clone();let i=t[0];t.sort((s,r)=>s.start.isAfter(r.start)?1:-1);let o=t.indexOf(i),n=new this(i.start,i.end);for(let s=o-1;s>=0&&t[s].end.isEqual(n.start);s--)n.start=A._createAt(t[s].start);for(let s=o+1;s{if(t.viewPosition)return;let i=this._modelToViewMapping.get(t.modelPosition.parent);if(!i)throw new p("mapping-model-position-view-parent-not-found",this,{modelPosition:t.modelPosition});t.viewPosition=this.findPositionIn(i,t.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(e,t)=>{if(t.modelPosition)return;let i=this.findMappedViewAncestor(t.viewPosition),o=this._viewToModelMapping.get(i),n=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,i);t.modelPosition=A._createAt(o,n)},{priority:"low"})}bindElements(e,t){this._modelToViewMapping.set(e,t),this._viewToModelMapping.set(t,e)}unbindViewElement(e,t={}){let i=this.toModelElement(e);if(this._elementToMarkerNames.has(e))for(let o of this._elementToMarkerNames.get(e))this._unboundMarkerNames.add(o);t.defer?this._deferredBindingRemovals.set(e,e.root):(this._viewToModelMapping.delete(e)&&this._cache.stopTracking(e),this._modelToViewMapping.get(i)==e&&this._modelToViewMapping.delete(i))}unbindModelElement(e){let t=this.toViewElement(e);if(this._modelToViewMapping.delete(e),this._viewToModelMapping.get(t)==e){/* v8 ignore next 4 -- @preserve */this._viewToModelMapping.delete(t)&&this._cache.stopTracking(t)}}bindElementToMarker(e,t){let i=this._markerNameToElements.get(t)||new Set;i.add(e);let o=this._elementToMarkerNames.get(e)||new Set;o.add(t),this._markerNameToElements.set(t,i),this._elementToMarkerNames.set(e,o)}unbindElementFromMarkerName(e,t){let i=this._markerNameToElements.get(t);i&&(i.delete(e),i.size==0&&this._markerNameToElements.delete(t));let o=this._elementToMarkerNames.get(e);o&&(o.delete(t),o.size==0&&this._elementToMarkerNames.delete(e))}flushUnboundMarkerNames(){let e=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),e}flushDeferredBindings(){for(let[e,t]of this._deferredBindingRemovals)e.root==t&&this.unbindViewElement(e);this._deferredBindingRemovals=new Map}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this._deferredBindingRemovals=new Map}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new T(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new N(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){let t={viewPosition:e,mapper:this};return this.fire("viewToModelPosition",t),t.modelPosition}toViewPosition(e,t={}){let i={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",i),i.viewPosition}markerNameToElements(e){let t=this._markerNameToElements.get(e);if(!t)return null;let i=new Set;for(let o of t)if(o.is("attributeElement"))for(let n of o.getElementsWithSameId())i.add(n);else i.add(o);return i}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;for(;!this._viewToModelMapping.has(t);)t=t.parent;return t}_toModelOffset(e,t,i){if(i!=e)return this._toModelOffset(e.parent,e.index,i)+this._toModelOffset(e,t,e);if(e.is("$text"))return t;let o=0;for(let n=0;n0;){let o=t.pop(),n=o.name&&this._viewToModelLengthCallbacks.size>0&&this._viewToModelLengthCallbacks.get(o.name);if(n)i+=n(o);else if(this._viewToModelMapping.has(o))i+=1;else if(o.is("$text"))i+=o.data.length;else{if(o.is("uiElement"))continue;for(let s of o.getChildren())t.push(s)}}return i}findPositionIn(e,t){if(t===0)return this._moveViewPositionToTextNode(new P(e,0));if(this._viewToModelLengthCallbacks.size==0&&this._viewToModelMapping.has(e)){let i=this._cache.getClosest(e,t);return this._findPositionStartingFrom(i.viewPosition,i.modelOffset,t,e,!0)}else return this._findPositionStartingFrom(new P(e,0),0,t,e,!1)}_findPositionStartingFrom(e,t,i,o,n){let s=e.parent,r=e.offset;if(s.is("$text"))return new P(s,i-t);let a,l=t,c=0;for(;l{this._clearCacheInsideParent(t,i.index)};_invalidateOnTextChangeCallback=(e,t)=>{this._clearCacheAfter(t)};save(e,t,i,o){let n=this._cachedMapping.get(i),s=n.cacheMap.get(o);if(s){let l=e.getChild(t-1),c=s.viewPosition.nodeBefore?this._nodeToCacheListIndex.get(s.viewPosition.nodeBefore):0;this._nodeToCacheListIndex.set(l,c);return}let r={viewPosition:new P(e,t),modelOffset:o};n.maxModelOffset=o>n.maxModelOffset?o:n.maxModelOffset,n.cacheMap.set(o,r);let a=n.cacheList.length-1;for(;a>=0&&n.cacheList[a].modelOffset>o;)a--;if(n.cacheList.splice(a+1,0,r),t>0){let l=e.getChild(t-1);this._nodeToCacheListIndex.set(l,a+1)}}getClosest(e,t){let i=this._cachedMapping.get(e),o;if(i)if(t>i.maxModelOffset)o=i.cacheList[i.cacheList.length-1];else{let n=i.cacheMap.get(t);n?o=n:o=this._findInCacheList(i.cacheList,t)}else o=this.startTracking(e);return{modelOffset:o.modelOffset,viewPosition:o.viewPosition.clone()}}startTracking(e){let t={viewPosition:new P(e,0),modelOffset:0},i={maxModelOffset:0,cacheList:[t],cacheMap:new Map([[0,t]])};return this._cachedMapping.set(e,i),e.on("change:children",this._invalidateOnChildrenChangeCallback),e.on("change:text",this._invalidateOnTextChangeCallback),t}stopTracking(e){e.off("change:children",this._invalidateOnChildrenChangeCallback),e.off("change:text",this._invalidateOnTextChangeCallback),this._cachedMapping.delete(e)}_clearCacheInsideParent(e,t){if(t==0)this._cachedMapping.has(e)?this._clearCacheAll(e):this._clearCacheInsideParent(e.parent,e.index);else{let i=e.getChild(t-1);this._clearCacheAfter(i)}}_clearCacheAll(e){let t=this._cachedMapping.get(e);t.maxModelOffset>0&&(t.maxModelOffset=0,t.cacheList.length=1,t.cacheMap.clear(),t.cacheMap.set(0,t.cacheList[0]))}_clearCacheAfter(e){let t=this._nodeToCacheListIndex.get(e);if(t===void 0){let o=e.parent;this._cachedMapping.has(o)||this._clearCacheInsideParent(o.parent,o.index);return}let i=e.parent;for(;!this._cachedMapping.has(i);)i=i.parent;this._clearCacheFromCacheIndex(i,t)}_clearCacheFromCacheIndex(e,t){t===0&&(t=1);let i=this._cachedMapping.get(e),o=i.cacheList[t-1];if(!o)return;i.maxModelOffset=o.modelOffset;let n=i.cacheList.splice(t);for(let s of n){i.cacheMap.delete(s.modelOffset);let r=s.viewPosition.nodeBefore;this._nodeToCacheListIndex.delete(r)}}_findInCacheList(e,t){let i=0,o=e.length-1,n=o-i>>1,s=e[n];for(;i>1),s=e[n];return s.modelOffset<=t?s:e[n-1]}};/** +*/var C6=q(),x6=q(),Cp=class extends C6{_modelToViewMapping=new WeakMap;_viewToModelMapping=new WeakMap;_viewToModelLengthCallbacks=new Map;_markerNameToElements=new Map;_elementToMarkerNames=new Map;_deferredBindingRemovals=new Map;_unboundMarkerNames=new Set;_cache=new T6;constructor(){super(),this.on("modelToViewPosition",(e,t)=>{if(t.viewPosition)return;let i=this._modelToViewMapping.get(t.modelPosition.parent);if(!i)throw new p("mapping-model-position-view-parent-not-found",this,{modelPosition:t.modelPosition});t.viewPosition=this.findPositionIn(i,t.modelPosition.offset)},{priority:"low"}),this.on("viewToModelPosition",(e,t)=>{if(t.modelPosition)return;let i=this.findMappedViewAncestor(t.viewPosition),o=this._viewToModelMapping.get(i),n=this._toModelOffset(t.viewPosition.parent,t.viewPosition.offset,i);t.modelPosition=A._createAt(o,n)},{priority:"low"})}bindElements(e,t){this._modelToViewMapping.set(e,t),this._viewToModelMapping.set(t,e)}unbindViewElement(e,t={}){let i=this.toModelElement(e);if(this._elementToMarkerNames.has(e))for(let o of this._elementToMarkerNames.get(e))this._unboundMarkerNames.add(o);t.defer?this._deferredBindingRemovals.set(e,e.root):(this._viewToModelMapping.delete(e)&&this._cache.stopTracking(e),this._modelToViewMapping.get(i)==e&&this._modelToViewMapping.delete(i))}unbindModelElement(e){let t=this.toViewElement(e);if(this._modelToViewMapping.delete(e),this._viewToModelMapping.get(t)==e){/* v8 ignore next 4 -- @preserve */this._viewToModelMapping.delete(t)&&this._cache.stopTracking(t)}}bindElementToMarker(e,t){let i=this._markerNameToElements.get(t)||new Set;i.add(e);let o=this._elementToMarkerNames.get(e)||new Set;o.add(t),this._markerNameToElements.set(t,i),this._elementToMarkerNames.set(e,o)}unbindElementFromMarkerName(e,t){let i=this._markerNameToElements.get(t);i&&(i.delete(e),i.size==0&&this._markerNameToElements.delete(t));let o=this._elementToMarkerNames.get(e);o&&(o.delete(t),o.size==0&&this._elementToMarkerNames.delete(e))}flushUnboundMarkerNames(){let e=Array.from(this._unboundMarkerNames);return this._unboundMarkerNames.clear(),e}flushDeferredBindings(){for(let[e,t]of this._deferredBindingRemovals)e.root==t&&this.unbindViewElement(e);this._deferredBindingRemovals=new Map}clearBindings(){this._modelToViewMapping=new WeakMap,this._viewToModelMapping=new WeakMap,this._markerNameToElements=new Map,this._elementToMarkerNames=new Map,this._unboundMarkerNames=new Set,this._deferredBindingRemovals=new Map}toModelElement(e){return this._viewToModelMapping.get(e)}toViewElement(e){return this._modelToViewMapping.get(e)}toModelRange(e){return new T(this.toModelPosition(e.start),this.toModelPosition(e.end))}toViewRange(e){return new N(this.toViewPosition(e.start),this.toViewPosition(e.end))}toModelPosition(e){let t={viewPosition:e,mapper:this};return this.fire("viewToModelPosition",t),t.modelPosition}toViewPosition(e,t={}){let i={modelPosition:e,mapper:this,isPhantom:t.isPhantom};return this.fire("modelToViewPosition",i),i.viewPosition}markerNameToElements(e){let t=this._markerNameToElements.get(e);if(!t)return null;let i=new Set;for(let o of t)if(o.is("attributeElement"))for(let n of o.getElementsWithSameId())i.add(n);else i.add(o);return i}registerViewToModelLength(e,t){this._viewToModelLengthCallbacks.set(e,t)}findMappedViewAncestor(e){let t=e.parent;for(;!this._viewToModelMapping.has(t);)t=t.parent;return t}_toModelOffset(e,t,i){if(i!=e)return this._toModelOffset(e.parent,e.index,i)+this._toModelOffset(e,t,e);if(e.is("$text"))return t;let o=0;for(let n=0;n0;){let o=t.pop(),n=o.name&&this._viewToModelLengthCallbacks.size>0&&this._viewToModelLengthCallbacks.get(o.name);if(n)i+=n(o);else if(this._viewToModelMapping.has(o))i+=1;else if(o.is("$text"))i+=o.data.length;else{if(o.is("uiElement"))continue;for(let s of o.getChildren())t.push(s)}}return i}findPositionIn(e,t){if(t===0)return this._moveViewPositionToTextNode(new P(e,0));if(this._viewToModelLengthCallbacks.size==0&&this._viewToModelMapping.has(e)){let i=this._cache.getClosest(e,t);return this._findPositionStartingFrom(i.viewPosition,i.modelOffset,t,e,!0)}else return this._findPositionStartingFrom(new P(e,0),0,t,e,!1)}_findPositionStartingFrom(e,t,i,o,n){let s=e.parent,r=e.offset;if(s.is("$text"))return new P(s,i-t);let a,l=t,c=0;for(;l{this._clearCacheInsideParent(t,i.index)};_invalidateOnTextChangeCallback=(e,t)=>{this._clearCacheAfter(t)};save(e,t,i,o){let n=this._cachedMapping.get(i),s=n.cacheMap.get(o);if(s){let l=e.getChild(t-1),c=s.viewPosition.nodeBefore?this._nodeToCacheListIndex.get(s.viewPosition.nodeBefore):0;this._nodeToCacheListIndex.set(l,c);return}let r={viewPosition:new P(e,t),modelOffset:o};n.maxModelOffset=o>n.maxModelOffset?o:n.maxModelOffset,n.cacheMap.set(o,r);let a=n.cacheList.length-1;for(;a>=0&&n.cacheList[a].modelOffset>o;)a--;if(n.cacheList.splice(a+1,0,r),t>0){let l=e.getChild(t-1);this._nodeToCacheListIndex.set(l,a+1)}}getClosest(e,t){let i=this._cachedMapping.get(e),o;if(i)if(t>i.maxModelOffset)o=i.cacheList[i.cacheList.length-1];else{let n=i.cacheMap.get(t);n?o=n:o=this._findInCacheList(i.cacheList,t)}else o=this.startTracking(e);return{modelOffset:o.modelOffset,viewPosition:o.viewPosition.clone()}}startTracking(e){let t={viewPosition:new P(e,0),modelOffset:0},i={maxModelOffset:0,cacheList:[t],cacheMap:new Map([[0,t]])};return this._cachedMapping.set(e,i),e.on("change:children",this._invalidateOnChildrenChangeCallback),e.on("change:text",this._invalidateOnTextChangeCallback),t}stopTracking(e){e.off("change:children",this._invalidateOnChildrenChangeCallback),e.off("change:text",this._invalidateOnTextChangeCallback),this._cachedMapping.delete(e)}_clearCacheInsideParent(e,t){if(t==0)this._cachedMapping.has(e)?this._clearCacheAll(e):this._clearCacheInsideParent(e.parent,e.index);else{let i=e.getChild(t-1);this._clearCacheAfter(i)}}_clearCacheAll(e){let t=this._cachedMapping.get(e);t.maxModelOffset>0&&(t.maxModelOffset=0,t.cacheList.length=1,t.cacheMap.clear(),t.cacheMap.set(0,t.cacheList[0]))}_clearCacheAfter(e){let t=this._nodeToCacheListIndex.get(e);if(t===void 0){let o=e.parent;this._cachedMapping.has(o)||this._clearCacheInsideParent(o.parent,o.index);return}let i=e.parent;for(;!this._cachedMapping.has(i);)i=i.parent;this._clearCacheFromCacheIndex(i,t)}_clearCacheFromCacheIndex(e,t){t===0&&(t=1);let i=this._cachedMapping.get(e),o=i.cacheList[t-1];if(!o)return;i.maxModelOffset=o.modelOffset;let n=i.cacheList.splice(t);for(let s of n){i.cacheMap.delete(s.modelOffset);let r=s.viewPosition.nodeBefore;this._nodeToCacheListIndex.delete(r)}}_findInCacheList(e,t){let i=0,o=e.length-1,n=o-i>>1,s=e[n];for(;i>1),s=e[n];return s.modelOffset<=t?s:e[n-1]}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var x6=class{_consumable=new Map;_textProxyRegistry=new Map;add(e,t){t=qa(t),e instanceof Gt&&(e=this._getSymbolForTextProxy(e)),this._consumable.has(e)||this._consumable.set(e,new Map),this._consumable.get(e).set(t,!0)}consume(e,t){return t=qa(t),e instanceof Gt&&(e=this._getSymbolForTextProxy(e)),this.test(e,t)?(this._consumable.get(e).set(t,!1),!0):!1}test(e,t){t=qa(t),e instanceof Gt&&(e=this._getSymbolForTextProxy(e));let i=this._consumable.get(e);if(i===void 0)return null;let o=i.get(t);return o===void 0?null:o}revert(e,t){t=qa(t),e instanceof Gt&&(e=this._getSymbolForTextProxy(e));let i=this.test(e,t);return i===!1?(this._consumable.get(e).set(t,!0),!0):i===!0?!1:null}verifyAllConsumed(e){let t=[];for(let[i,o]of this._consumable)for(let[n,s]of o){let r=n.split(":")[0];s&&e==r&&t.push({event:n,item:i.name||i.description})}if(t.length)throw new p("conversion-model-consumable-not-consumed",null,{items:t})}_getSymbolForTextProxy(e){let t=null,i=this._textProxyRegistry.get(e.startOffset);if(i){let o=i.get(e.endOffset);o&&(t=o.get(e.parent))}return t||(t=this._addSymbolForTextProxy(e)),t}_addSymbolForTextProxy(e){let t=e.startOffset,i=e.endOffset,o=e.parent,n=Symbol("$textProxy:"+e.data),s,r;return s=this._textProxyRegistry.get(t),s||(s=new Map,this._textProxyRegistry.set(t,s)),r=s.get(i),r||(r=new Map,s.set(i,r)),r.set(o,n),n}};function qa(e){let t=e.split(":");return t[0]=="insert"?t[0]:t[0]=="addMarker"||t[0]=="removeMarker"?e:t.length>1?t[0]+":"+t[1]:t[0]}/** +*/var E6=class{_consumable=new Map;_textProxyRegistry=new Map;add(e,t){t=$a(t),e instanceof Zt&&(e=this._getSymbolForTextProxy(e)),this._consumable.has(e)||this._consumable.set(e,new Map),this._consumable.get(e).set(t,!0)}consume(e,t){return t=$a(t),e instanceof Zt&&(e=this._getSymbolForTextProxy(e)),this.test(e,t)?(this._consumable.get(e).set(t,!1),!0):!1}test(e,t){t=$a(t),e instanceof Zt&&(e=this._getSymbolForTextProxy(e));let i=this._consumable.get(e);if(i===void 0)return null;let o=i.get(t);return o===void 0?null:o}revert(e,t){t=$a(t),e instanceof Zt&&(e=this._getSymbolForTextProxy(e));let i=this.test(e,t);return i===!1?(this._consumable.get(e).set(t,!0),!0):i===!0?!1:null}verifyAllConsumed(e){let t=[];for(let[i,o]of this._consumable)for(let[n,s]of o){let r=n.split(":")[0];s&&e==r&&t.push({event:n,item:i.name||i.description})}if(t.length)throw new p("conversion-model-consumable-not-consumed",null,{items:t})}_getSymbolForTextProxy(e){let t=null,i=this._textProxyRegistry.get(e.startOffset);if(i){let o=i.get(e.endOffset);o&&(t=o.get(e.parent))}return t||(t=this._addSymbolForTextProxy(e)),t}_addSymbolForTextProxy(e){let t=e.startOffset,i=e.endOffset,o=e.parent,n=Symbol("$textProxy:"+e.data),s,r;return s=this._textProxyRegistry.get(t),s||(s=new Map,this._textProxyRegistry.set(t,s)),r=s.get(i),r||(r=new Map,s.set(i,r)),r.set(o,n),n}};function $a(e){let t=e.split(":");return t[0]=="insert"?t[0]:t[0]=="addMarker"||t[0]=="removeMarker"?e:t.length>1?t[0]+":"+t[1]:t[0]}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Bg([e,t],[i,o]){if(t.end.compareWith(o.start)!=="after")return 1;if(t.start.compareWith(o.end)!=="before")return-1;switch(t.start.compareWith(o.start)){case"before":return 1;case"after":return-1;default:switch(t.end.compareWith(o.end)){case"before":return-1;case"after":return 1;default:return i.localeCompare(e)}}}/** +*/function Dg([e,t],[i,o]){if(t.end.compareWith(o.start)!=="after")return 1;if(t.start.compareWith(o.end)!=="before")return-1;switch(t.start.compareWith(o.start)){case"before":return 1;case"after":return-1;default:switch(t.end.compareWith(o.end)){case"before":return-1;case"after":return 1;default:return i.localeCompare(e)}}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var T6=q(),kp=class extends T6{_conversionApi;_firedEventsMap;constructor(e){super(),this._conversionApi={dispatcher:this,...e},this._firedEventsMap=new WeakMap}convertChanges(e,t,i){let o=e.getRefreshedItems(),n=this._createConversionApi(i,o);for(let a of e.getMarkersToRemove())this._convertMarkerRemove(a.name,a.range,n);let s=this._reduceChanges(e.getChanges(),o);for(let a of s)a.type==="insert"?this._convertInsert(T._createFromPositionAndShift(a.position,a.length),n):a.type==="reinsert"?this._convertReinsert(T._createFromPositionAndShift(a.position,a.length),n):a.type==="remove"?this._convertRemove(a.position,a.length,a.name,n):this._convertAttribute(a.range,a.attributeKey,a.attributeOldValue,a.attributeNewValue,n);n.mapper.flushDeferredBindings();for(let a of n.mapper.flushUnboundMarkerNames()){let l=t.get(a).getRange();this._convertMarkerRemove(a,l,n),this._convertMarkerAdd(a,l,n)}let r=e.getMarkersToAdd().sort((a,l)=>Bg([a.name,a.range],[l.name,l.range]));for(let a of r)this._convertMarkerAdd(a.name,a.range,n);n.consumable.verifyAllConsumed("insert")}convert(e,t,i,o={}){let n=this._createConversionApi(i,void 0,o);this._convertInsert(e,n);for(let[s,r]of Array.from(t).sort(Bg))this._convertMarkerAdd(s,r,n);n.consumable.verifyAllConsumed("insert")}convertSelection(e,t,i){let o=this._createConversionApi(i);this.fire("cleanSelection",{selection:e},o);let n=e.getFirstPosition().root;if(!o.mapper.toViewElement(n))return;let s=Array.from(t.getMarkersAtPosition(e.getFirstPosition()));if(this._addConsumablesForSelection(o.consumable,e,s),this.fire("selection",{selection:e},o),!!e.isCollapsed){for(let r of s)if(o.consumable.test(e,"addMarker:"+r.name)){let a=r.getRange();if(!E6(e.getFirstPosition(),r,o.mapper))continue;let l={item:e,markerName:r.name,markerRange:a};this.fire(`addMarker:${r.name}`,l,o)}for(let r of e.getAttributeKeys())if(o.consumable.test(e,"attribute:"+r)){let a={item:e,range:e.getFirstRange(),attributeKey:r,attributeOldValue:null,attributeNewValue:e.getAttribute(r)};this.fire(`attribute:${r}:$text`,a,o)}}}_convertInsert(e,t,i={}){i.doNotAddConsumables||this._addConsumablesForInsert(t.consumable,e);for(let o of e.getWalker({shallow:!0}))this._testAndFire("insert",Og(o),t)}_convertRemove(e,t,i,o){this.fire(`remove:${i}`,{position:e,length:t},o)}_convertAttribute(e,t,i,o,n){this._addConsumablesForRange(n.consumable,e,`attribute:${t}`);for(let s of e){let r={item:s.item,range:T._createFromPositionAndShift(s.previousPosition,s.length),attributeKey:t,attributeOldValue:i,attributeNewValue:o};this._testAndFire(`attribute:${t}`,r,n)}}_convertReinsert(e,t){let i=Array.from(e.getWalker({shallow:!0}));this._addConsumablesForInsert(t.consumable,i);for(let o of i.map(Og))this.fire(`remove:${o.item.is("element")?o.item.name:"$text"}`,{position:o.range.start,length:o.item.offsetSize,reconversion:!0},t),this._testAndFire("insert",{...o,reconversion:!0},t)}_convertMarkerAdd(e,t,i){if(t.root.rootName=="$graveyard")return;let o=`addMarker:${e}`;if(i.consumable.add(t,o),this.fire(o,{markerName:e,markerRange:t},i),!!i.consumable.consume(t,o)){this._addConsumablesForRange(i.consumable,t,o);for(let n of t.getItems()){if(!i.consumable.test(n,o))continue;let s={item:n,range:T._createOn(n),markerName:e,markerRange:t};this.fire(o,s,i)}}}_convertMarkerRemove(e,t,i){t.root.rootName!="$graveyard"&&this.fire(`removeMarker:${e}`,{markerName:e,markerRange:t},i)}_reduceChanges(e,t){let i={changes:e,refreshedItems:t};return this.fire("reduceChanges",i),i.changes}_addConsumablesForInsert(e,t){for(let i of t){let o=i.item;if(e.test(o,"insert")===null){e.add(o,"insert");for(let n of o.getAttributeKeys())e.add(o,"attribute:"+n)}}return e}_addConsumablesForRange(e,t,i){for(let o of t.getItems())e.add(o,i);return e}_addConsumablesForSelection(e,t,i){e.add(t,"selection");for(let o of i)e.add(t,"addMarker:"+o.name);for(let o of t.getAttributeKeys())e.add(t,"attribute:"+o);return e}_testAndFire(e,t,i){let o=A6(e,t),n=t.item.is("$textProxy")?i.consumable._getSymbolForTextProxy(t.item):t.item,s=this._firedEventsMap.get(i),r=s.get(n);if(!r)s.set(n,new Set([o]));else if(!r.has(o))r.add(o);else return;this.fire(o,t,i)}_testAndFireAddAttributes(e,t){let i={item:e,range:T._createOn(e)};for(let o of i.item.getAttributeKeys())i.attributeKey=o,i.attributeOldValue=null,i.attributeNewValue=i.item.getAttribute(o),this._testAndFire(`attribute:${o}`,i,t)}_createConversionApi(e,t=new Set,i={}){let o={...this._conversionApi,consumable:new x6,writer:e,options:i,convertItem:n=>this._convertInsert(T._createOn(n),o),convertChildren:n=>this._convertInsert(T._createIn(n),o,{doNotAddConsumables:!0}),convertAttributes:n=>this._testAndFireAddAttributes(n,o),canReuseView:n=>!t.has(o.mapper.toModelElement(n))};return this._firedEventsMap.set(o,new Map),o}};function E6(e,t,i){let o=t.getRange(),n=Array.from(e.getAncestors());return n.shift(),n.reverse(),!n.some(s=>{if(o.containsItem(s))return!!i.toViewElement(s).getCustomProperty("addHighlight")})}function A6(e,t){return`${e}:${t.item.is("element")?t.item.name:"$text"}`}function Og(e){return{item:e.item,range:T._createFromPositionAndShift(e.previousPosition,e.length)}}/** +*/var A6=q(),xp=class extends A6{_conversionApi;_firedEventsMap;constructor(e){super(),this._conversionApi={dispatcher:this,...e},this._firedEventsMap=new WeakMap}convertChanges(e,t,i){let o=e.getRefreshedItems(),n=this._createConversionApi(i,o);for(let a of e.getMarkersToRemove())this._convertMarkerRemove(a.name,a.range,n);let s=this._reduceChanges(e.getChanges(),o);for(let a of s)a.type==="insert"?this._convertInsert(T._createFromPositionAndShift(a.position,a.length),n):a.type==="reinsert"?this._convertReinsert(T._createFromPositionAndShift(a.position,a.length),n):a.type==="remove"?this._convertRemove(a.position,a.length,a.name,n):this._convertAttribute(a.range,a.attributeKey,a.attributeOldValue,a.attributeNewValue,n);n.mapper.flushDeferredBindings();for(let a of n.mapper.flushUnboundMarkerNames()){let l=t.get(a).getRange();this._convertMarkerRemove(a,l,n),this._convertMarkerAdd(a,l,n)}let r=e.getMarkersToAdd().sort((a,l)=>Dg([a.name,a.range],[l.name,l.range]));for(let a of r)this._convertMarkerAdd(a.name,a.range,n);n.consumable.verifyAllConsumed("insert")}convert(e,t,i,o={}){let n=this._createConversionApi(i,void 0,o);this._convertInsert(e,n);for(let[s,r]of Array.from(t).sort(Dg))this._convertMarkerAdd(s,r,n);n.consumable.verifyAllConsumed("insert")}convertSelection(e,t,i){let o=this._createConversionApi(i);this.fire("cleanSelection",{selection:e},o);let n=e.getFirstPosition().root;if(!o.mapper.toViewElement(n))return;let s=Array.from(t.getMarkersAtPosition(e.getFirstPosition()));if(this._addConsumablesForSelection(o.consumable,e,s),this.fire("selection",{selection:e},o),!!e.isCollapsed){for(let r of s)if(o.consumable.test(e,"addMarker:"+r.name)){let a=r.getRange();if(!I6(e.getFirstPosition(),r,o.mapper))continue;let l={item:e,markerName:r.name,markerRange:a};this.fire(`addMarker:${r.name}`,l,o)}for(let r of e.getAttributeKeys())if(o.consumable.test(e,"attribute:"+r)){let a={item:e,range:e.getFirstRange(),attributeKey:r,attributeOldValue:null,attributeNewValue:e.getAttribute(r)};this.fire(`attribute:${r}:$text`,a,o)}}}_convertInsert(e,t,i={}){i.doNotAddConsumables||this._addConsumablesForInsert(t.consumable,e);for(let o of e.getWalker({shallow:!0}))this._testAndFire("insert",Fg(o),t)}_convertRemove(e,t,i,o){this.fire(`remove:${i}`,{position:e,length:t},o)}_convertAttribute(e,t,i,o,n){this._addConsumablesForRange(n.consumable,e,`attribute:${t}`);for(let s of e){let r={item:s.item,range:T._createFromPositionAndShift(s.previousPosition,s.length),attributeKey:t,attributeOldValue:i,attributeNewValue:o};this._testAndFire(`attribute:${t}`,r,n)}}_convertReinsert(e,t){let i=Array.from(e.getWalker({shallow:!0}));this._addConsumablesForInsert(t.consumable,i);for(let o of i.map(Fg))this.fire(`remove:${o.item.is("element")?o.item.name:"$text"}`,{position:o.range.start,length:o.item.offsetSize,reconversion:!0},t),this._testAndFire("insert",{...o,reconversion:!0},t)}_convertMarkerAdd(e,t,i){if(t.root.rootName=="$graveyard")return;let o=`addMarker:${e}`;if(i.consumable.add(t,o),this.fire(o,{markerName:e,markerRange:t},i),!!i.consumable.consume(t,o)){this._addConsumablesForRange(i.consumable,t,o);for(let n of t.getItems()){if(!i.consumable.test(n,o))continue;let s={item:n,range:T._createOn(n),markerName:e,markerRange:t};this.fire(o,s,i)}}}_convertMarkerRemove(e,t,i){t.root.rootName!="$graveyard"&&this.fire(`removeMarker:${e}`,{markerName:e,markerRange:t},i)}_reduceChanges(e,t){let i={changes:e,refreshedItems:t};return this.fire("reduceChanges",i),i.changes}_addConsumablesForInsert(e,t){for(let i of t){let o=i.item;if(e.test(o,"insert")===null){e.add(o,"insert");for(let n of o.getAttributeKeys())e.add(o,"attribute:"+n)}}return e}_addConsumablesForRange(e,t,i){for(let o of t.getItems())e.add(o,i);return e}_addConsumablesForSelection(e,t,i){e.add(t,"selection");for(let o of i)e.add(t,"addMarker:"+o.name);for(let o of t.getAttributeKeys())e.add(t,"attribute:"+o);return e}_testAndFire(e,t,i){let o=S6(e,t),n=t.item.is("$textProxy")?i.consumable._getSymbolForTextProxy(t.item):t.item,s=this._firedEventsMap.get(i),r=s.get(n);if(!r)s.set(n,new Set([o]));else if(!r.has(o))r.add(o);else return;this.fire(o,t,i)}_testAndFireAddAttributes(e,t){let i={item:e,range:T._createOn(e)};for(let o of i.item.getAttributeKeys())i.attributeKey=o,i.attributeOldValue=null,i.attributeNewValue=i.item.getAttribute(o),this._testAndFire(`attribute:${o}`,i,t)}_createConversionApi(e,t=new Set,i={}){let o={...this._conversionApi,consumable:new E6,writer:e,options:i,convertItem:n=>this._convertInsert(T._createOn(n),o),convertChildren:n=>this._convertInsert(T._createIn(n),o,{doNotAddConsumables:!0}),convertAttributes:n=>this._testAndFireAddAttributes(n,o),canReuseView:n=>!t.has(o.mapper.toModelElement(n))};return this._firedEventsMap.set(o,new Map),o}};function I6(e,t,i){let o=t.getRange(),n=Array.from(e.getAncestors());return n.shift(),n.reverse(),!n.some(s=>{if(o.containsItem(s))return!!i.toViewElement(s).getCustomProperty("addHighlight")})}function S6(e,t){return`${e}:${t.item.is("element")?t.item.name:"$text"}`}function Fg(e){return{item:e.item,range:T._createFromPositionAndShift(e.previousPosition,e.length)}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Eo=class extends Wi{parent=null;_attrs;_index=null;_startOffset=null;constructor(e){super(),this._attrs=lt(e)}get document(){return null}get index(){return this._index}get startOffset(){return this._startOffset}get offsetSize(){return 1}get endOffset(){return this.startOffset===null?null:this.startOffset+this.offsetSize}get nextSibling(){let e=this.index;return e!==null&&this.parent.getChild(e+1)||null}get previousSibling(){let e=this.index;return e!==null&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.parent===null?!1:this.root.isAttached()}getPath(){let e=[],t=this;for(;t.parent;)e.unshift(t.startOffset),t=t.parent;return e}getAncestors(e={}){let t=[],i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}getCommonAncestor(e,t={}){let i=this.getAncestors(t),o=e.getAncestors(t),n=0;for(;i[n]==o[n]&&i[n];)n++;return n===0?null:i[n-1]}isBefore(e){if(this==e||this.root!==e.root)return!1;let t=this.getPath(),i=e.getPath(),o=ve(t,i);switch(o){case"prefix":return!0;case"extension":return!1;default:return t[o](t[i[0]]=i[1],t),{})),e}_clone(e){return new this.constructor(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=lt(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}};Eo.prototype.is=function(e){return e==="node"||e==="model:node"};/** +*/var Ao=class extends qi{parent=null;_attrs;_index=null;_startOffset=null;constructor(e){super(),this._attrs=lt(e)}get document(){return null}get index(){return this._index}get startOffset(){return this._startOffset}get offsetSize(){return 1}get endOffset(){return this.startOffset===null?null:this.startOffset+this.offsetSize}get nextSibling(){let e=this.index;return e!==null&&this.parent.getChild(e+1)||null}get previousSibling(){let e=this.index;return e!==null&&this.parent.getChild(e-1)||null}get root(){let e=this;for(;e.parent;)e=e.parent;return e}isAttached(){return this.parent===null?!1:this.root.isAttached()}getPath(){let e=[],t=this;for(;t.parent;)e.unshift(t.startOffset),t=t.parent;return e}getAncestors(e={}){let t=[],i=e.includeSelf?this:this.parent;for(;i;)t[e.parentFirst?"push":"unshift"](i),i=i.parent;return t}getCommonAncestor(e,t={}){let i=this.getAncestors(t),o=e.getAncestors(t),n=0;for(;i[n]==o[n]&&i[n];)n++;return n===0?null:i[n-1]}isBefore(e){if(this==e||this.root!==e.root)return!1;let t=this.getPath(),i=e.getPath(),o=Ce(t,i);switch(o){case"prefix":return!0;case"extension":return!1;default:return t[o](t[i[0]]=i[1],t),{})),e}_clone(e){return new this.constructor(this._attrs)}_remove(){this.parent._removeChildren(this.index)}_setAttribute(e,t){this._attrs.set(e,t)}_setAttributesTo(e){this._attrs=lt(e)}_removeAttribute(e){return this._attrs.delete(e)}_clearAttributes(){this._attrs.clear()}};Ao.prototype.is=function(e){return e==="node"||e==="model:node"};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var I6=q(Wi),St=class Cp extends I6{_lastRangeBackward=!1;_attrs=new Map;_ranges=[];constructor(...t){super(),t.length&&this.setTo(...t)}get anchor(){if(this._ranges.length>0){let t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.end:t.start}return null}get focus(){if(this._ranges.length>0){let t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.start:t.end}return null}get isCollapsed(){return this._ranges.length===1?this._ranges[0].isCollapsed:!1}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(t){if(this.rangeCount!=t.rangeCount)return!1;if(this.rangeCount===0)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(let i of this._ranges){let o=!1;for(let n of t._ranges)if(i.isEqual(n)){o=!0;break}if(!o)return!1}return!0}*getRanges(){for(let t of this._ranges)yield new T(t.start,t.end)}getFirstRange(){let t=null;for(let i of this._ranges)(!t||i.start.isBefore(t.start))&&(t=i);return t?new T(t.start,t.end):null}getLastRange(){let t=null;for(let i of this._ranges)(!t||i.end.isAfter(t.end))&&(t=i);return t?new T(t.start,t.end):null}getFirstPosition(){let t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){let t=this.getLastRange();return t?t.end.clone():null}setTo(...t){let[i,o,n]=t;if(typeof o=="object"&&(n=o,o=void 0),i===null)this._setRanges([]);else if(i instanceof Cp)this._setRanges(i.getRanges(),i.isBackward);else if(i&&typeof i.getRanges=="function")this._setRanges(i.getRanges(),i.isBackward);else if(i instanceof T)this._setRanges([i],!!n&&!!n.backward);else if(i instanceof A)this._setRanges([new T(i)]);else if(i instanceof Eo){let s=!!n&&!!n.backward,r;if(o=="in")r=T._createIn(i);else if(o=="on")r=T._createOn(i);else if(o!==void 0)r=new T(A._createAt(i,o));else throw new p("model-selection-setto-required-second-parameter",[this,i]);this._setRanges([r],s)}else if(Je(i))this._setRanges(i,n&&!!n.backward);else throw new p("model-selection-setto-not-selectable",[this,i])}_setRanges(t,i=!1){let o=Array.from(t),n=o.some(s=>{if(!(s instanceof T))throw new p("model-selection-set-ranges-not-range",[this,t]);return this._ranges.every(r=>!r.isEqual(s))});o.length===this._ranges.length&&!n||(this._replaceAllRanges(o),this._lastRangeBackward=!!i,this.fire("change:range",{directChange:!0}))}setFocus(t,i){if(this.anchor===null)throw new p("model-selection-setfocus-no-ranges",[this,t]);let o=A._createAt(t,i);if(o.compareWith(this.focus)=="same")return;let n=this.anchor;this._ranges.length&&this._popRange(),o.compareWith(n)=="before"?(this._pushRange(new T(o,n)),this._lastRangeBackward=!0):(this._pushRange(new T(n,o)),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,i){this.getAttribute(t)!==i&&(this._attrs.set(t,i),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}getSelectedElement(){return this.rangeCount!==1?null:this.getFirstRange().getContainedElement()}*getSelectedBlocks(){let t=new WeakSet;for(let i of this.getRanges()){let o=Dg(i.start,t);P6(o,i)&&(yield o);let n=i.getWalker();for(let r of n){let a=r.item;r.type=="elementEnd"&&S6(a,t,i)?yield a:r.type=="elementStart"&&a.is("model:element")&&a.root.document.model.schema.isBlock(a)&&n.jumpTo(A._createAt(a,"end"))}let s=Dg(i.end,t);R6(s,i)&&(yield s)}}containsEntireContent(t=this.anchor.root){let i=A._createAt(t,0),o=A._createAt(t,"end");return i.isTouching(this.getFirstPosition())&&o.isTouching(this.getLastPosition())}toJSON(){let t={ranges:Array.from(this.getRanges()).map(o=>o.toJSON())},i=Object.fromEntries(this.getAttributes());return Object.keys(i).length&&(t.attributes=i),this.isBackward&&(t.isBackward=!0),t}_pushRange(t){this._checkRange(t),this._ranges.push(new T(t.start,t.end))}_checkRange(t){for(let i=0;i0;)this._popRange()}_popRange(){this._ranges.pop()}};St.prototype.is=function(e){return e==="selection"||e==="model:selection"};function xp(e,t){return t.has(e)?!1:(t.add(e),e.root.document.model.schema.isBlock(e)&&!!e.parent)}function S6(e,t,i){return xp(e,t)&&yd(e,i)}function Dg(e,t){let i=e.parent.root.document.model.schema,o=e.parent.getAncestors({parentFirst:!0,includeSelf:!0}),n=!1,s=o.find(r=>n?!1:(n=i.isLimit(r),!n&&xp(r,t)));return o.forEach(r=>t.add(r)),s}function yd(e,t){let i=V6(e);return i?!t.containsRange(T._createOn(i),!0):!0}function P6(e,t){return e?t.isCollapsed||e.isEmpty?!0:t.start.isTouching(A._createAt(e,e.maxOffset))?!1:yd(e,t):!1}function R6(e,t){return e?t.isCollapsed||e.isEmpty?!0:t.end.isTouching(A._createAt(e,0))?!1:yd(e,t):!1}function V6(e){let t=e.root.document.model.schema,i=e.parent;for(;i;){if(t.isBlock(i))return i;i=i.parent}}/** +*/var P6=q(qi),Pt=class Tp extends P6{_lastRangeBackward=!1;_attrs=new Map;_ranges=[];constructor(...t){super(),t.length&&this.setTo(...t)}get anchor(){if(this._ranges.length>0){let t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.end:t.start}return null}get focus(){if(this._ranges.length>0){let t=this._ranges[this._ranges.length-1];return this._lastRangeBackward?t.start:t.end}return null}get isCollapsed(){return this._ranges.length===1?this._ranges[0].isCollapsed:!1}get rangeCount(){return this._ranges.length}get isBackward(){return!this.isCollapsed&&this._lastRangeBackward}isEqual(t){if(this.rangeCount!=t.rangeCount)return!1;if(this.rangeCount===0)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;for(let i of this._ranges){let o=!1;for(let n of t._ranges)if(i.isEqual(n)){o=!0;break}if(!o)return!1}return!0}*getRanges(){for(let t of this._ranges)yield new T(t.start,t.end)}getFirstRange(){let t=null;for(let i of this._ranges)(!t||i.start.isBefore(t.start))&&(t=i);return t?new T(t.start,t.end):null}getLastRange(){let t=null;for(let i of this._ranges)(!t||i.end.isAfter(t.end))&&(t=i);return t?new T(t.start,t.end):null}getFirstPosition(){let t=this.getFirstRange();return t?t.start.clone():null}getLastPosition(){let t=this.getLastRange();return t?t.end.clone():null}setTo(...t){let[i,o,n]=t;if(typeof o=="object"&&(n=o,o=void 0),i===null)this._setRanges([]);else if(i instanceof Tp)this._setRanges(i.getRanges(),i.isBackward);else if(i&&typeof i.getRanges=="function")this._setRanges(i.getRanges(),i.isBackward);else if(i instanceof T)this._setRanges([i],!!n&&!!n.backward);else if(i instanceof A)this._setRanges([new T(i)]);else if(i instanceof Ao){let s=!!n&&!!n.backward,r;if(o=="in")r=T._createIn(i);else if(o=="on")r=T._createOn(i);else if(o!==void 0)r=new T(A._createAt(i,o));else throw new p("model-selection-setto-required-second-parameter",[this,i]);this._setRanges([r],s)}else if(Je(i))this._setRanges(i,n&&!!n.backward);else throw new p("model-selection-setto-not-selectable",[this,i])}_setRanges(t,i=!1){let o=Array.from(t),n=o.some(s=>{if(!(s instanceof T))throw new p("model-selection-set-ranges-not-range",[this,t]);return this._ranges.every(r=>!r.isEqual(s))});o.length===this._ranges.length&&!n||(this._replaceAllRanges(o),this._lastRangeBackward=!!i,this.fire("change:range",{directChange:!0}))}setFocus(t,i){if(this.anchor===null)throw new p("model-selection-setfocus-no-ranges",[this,t]);let o=A._createAt(t,i);if(o.compareWith(this.focus)=="same")return;let n=this.anchor;this._ranges.length&&this._popRange(),o.compareWith(n)=="before"?(this._pushRange(new T(o,n)),this._lastRangeBackward=!0):(this._pushRange(new T(n,o)),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,i){this.getAttribute(t)!==i&&(this._attrs.set(t,i),this.fire("change:attribute",{attributeKeys:[t],directChange:!0}))}getSelectedElement(){return this.rangeCount!==1?null:this.getFirstRange().getContainedElement()}*getSelectedBlocks(){let t=new WeakSet;for(let i of this.getRanges()){let o=Ng(i.start,t);V6(o,i)&&(yield o);let n=i.getWalker();for(let r of n){let a=r.item;r.type=="elementEnd"&&R6(a,t,i)?yield a:r.type=="elementStart"&&a.is("model:element")&&a.root.document.model.schema.isBlock(a)&&n.jumpTo(A._createAt(a,"end"))}let s=Ng(i.end,t);L6(s,i)&&(yield s)}}containsEntireContent(t=this.anchor.root){let i=A._createAt(t,0),o=A._createAt(t,"end");return i.isTouching(this.getFirstPosition())&&o.isTouching(this.getLastPosition())}toJSON(){let t={ranges:Array.from(this.getRanges()).map(o=>o.toJSON())},i=Object.fromEntries(this.getAttributes());return Object.keys(i).length&&(t.attributes=i),this.isBackward&&(t.isBackward=!0),t}_pushRange(t){this._checkRange(t),this._ranges.push(new T(t.start,t.end))}_checkRange(t){for(let i=0;i0;)this._popRange()}_popRange(){this._ranges.pop()}};Pt.prototype.is=function(e){return e==="selection"||e==="model:selection"};function Ep(e,t){return t.has(e)?!1:(t.add(e),e.root.document.model.schema.isBlock(e)&&!!e.parent)}function R6(e,t,i){return Ep(e,t)&&vd(e,i)}function Ng(e,t){let i=e.parent.root.document.model.schema,o=e.parent.getAncestors({parentFirst:!0,includeSelf:!0}),n=!1,s=o.find(r=>n?!1:(n=i.isLimit(r),!n&&Ep(r,t)));return o.forEach(r=>t.add(r)),s}function vd(e,t){let i=M6(e);return i?!t.containsRange(T._createOn(i),!0):!0}function V6(e,t){return e?t.isCollapsed||e.isEmpty?!0:t.start.isTouching(A._createAt(e,e.maxOffset))?!1:vd(e,t):!1}function L6(e,t){return e?t.isCollapsed||e.isEmpty?!0:t.end.isTouching(A._createAt(e,0))?!1:vd(e,t):!1}function M6(e){let t=e.root.document.model.schema,i=e.parent;for(;i;){if(t.isBlock(i))return i;i=i.parent}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var L6=q(T),Qe=class Tp extends L6{constructor(t,i,o){super(t,i);let n=this.root,s=o||(n.is("rootElement")?n.document.model:null);if(!s)throw new p("model-liverange-no-model-reference",n);M6.call(this,s)}detach(){this.stopListening()}toRange(){return new T(this.start,this.end)}static fromRange(t){return new Tp(t.start,t.end)}static _fromRangeInDocumentFragment(t,i){return new this(t.start,t.end,i)}};Qe.prototype.is=function(e){return e==="liveRange"||e==="model:liveRange"||e=="range"||e==="model:range"};function M6(e){let t=!this.root.is("rootElement");this.listenTo(e,"applyOperation",(i,o)=>{let n=o[0];!t&&!n.isDocumentOperation||B6.call(this,n)},{priority:"low"})}function B6(e){let t=this.getTransformedByOperation(e);if(t.length===0){let r=e.sourcePosition;this.start=r,this.end=r,this.fire("change:drop",this.toRange(),{deletionPosition:r});return}let i=T._createFromRanges(t),o=!i.isEqual(this),n=O6(this,e),s=null;if(o){i.root.rootName=="$graveyard"&&(e.type=="remove"?s=e.sourcePosition:s=e.deletionPosition);let r=this.toRange();this.start=i.start,this.end=i.end,this.fire("change:range",r,{deletionPosition:s})}else n&&this.fire("change:content",this.toRange(),{deletionPosition:s})}function O6(e,t){switch(t.type){case"insert":return e.containsPosition(t.position);case"move":case"remove":case"reinsert":case"merge":return e.containsPosition(t.sourcePosition)||e.start.isEqual(t.sourcePosition)||e.containsPosition(t.targetPosition);case"split":return e.containsPosition(t.splitPosition)||e.containsPosition(t.insertionPosition)}return!1}/** +*/var B6=q(T),Qe=class Ap extends B6{constructor(t,i,o){super(t,i);let n=this.root,s=o||(n.is("rootElement")?n.document.model:null);if(!s)throw new p("model-liverange-no-model-reference",n);O6.call(this,s)}detach(){this.stopListening()}toRange(){return new T(this.start,this.end)}static fromRange(t){return new Ap(t.start,t.end)}static _fromRangeInDocumentFragment(t,i){return new this(t.start,t.end,i)}};Qe.prototype.is=function(e){return e==="liveRange"||e==="model:liveRange"||e=="range"||e==="model:range"};function O6(e){let t=!this.root.is("rootElement");this.listenTo(e,"applyOperation",(i,o)=>{let n=o[0];!t&&!n.isDocumentOperation||D6.call(this,n)},{priority:"low"})}function D6(e){let t=this.getTransformedByOperation(e);if(t.length===0){let r=e.sourcePosition;this.start=r,this.end=r,this.fire("change:drop",this.toRange(),{deletionPosition:r});return}let i=T._createFromRanges(t),o=!i.isEqual(this),n=F6(this,e),s=null;if(o){i.root.rootName=="$graveyard"&&(e.type=="remove"?s=e.sourcePosition:s=e.deletionPosition);let r=this.toRange();this.start=i.start,this.end=i.end,this.fire("change:range",r,{deletionPosition:s})}else n&&this.fire("change:content",this.toRange(),{deletionPosition:s})}function F6(e,t){switch(t.type){case"insert":return e.containsPosition(t.position);case"move":case"remove":case"reinsert":case"merge":return e.containsPosition(t.sourcePosition)||e.start.isEqual(t.sourcePosition)||e.containsPosition(t.targetPosition);case"split":return e.containsPosition(t.splitPosition)||e.containsPosition(t.insertionPosition)}return!1}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var ce=class sd extends Eo{_data;constructor(t,i){super(i),this._data=t||""}get offsetSize(){return this.data.length}get data(){return this._data}toJSON(){let t=super.toJSON();return t.data=this.data,t}_clone(){return new sd(this.data,this.getAttributes())}static fromJSON(t){return new sd(t.data,t.attributes)}};ce.prototype.is=function(e){return e==="$text"||e==="model:$text"||e==="text"||e==="model:text"||e==="node"||e==="model:node"};/** +*/var ce=class ad extends Ao{_data;constructor(t,i){super(i),this._data=t||""}get offsetSize(){return this.data.length}get data(){return this._data}toJSON(){let t=super.toJSON();return t.data=this.data,t}_clone(){return new ad(this.data,this.getAttributes())}static fromJSON(t){return new ad(t.data,t.attributes)}};ce.prototype.is=function(e){return e==="$text"||e==="model:$text"||e==="text"||e==="model:text"||e==="node"||e==="model:node"};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Js="selection:",D6=q(Wi),Ce=class extends D6{_selection;constructor(e){super(),this._selection=new F6(e),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(e){return this._selection.containsEntireContent(e)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(e){return this._selection.getAttribute(e)}hasAttribute(e){return this._selection.hasAttribute(e)}refresh(){this._selection.updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(e){this._selection.observeMarkers(e)}toJSON(){return this._selection.toJSON()}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(...e){this._selection.setTo(...e)}_setAttribute(e,t){this._selection.setAttribute(e,t)}_removeAttribute(e){this._selection.removeAttribute(e)}_getStoredAttributes(){return this._selection.getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(e){this._selection.restoreGravity(e)}static _getStoreAttributeKey(e){return Js+e}static _isStoreAttributeKey(e){return e.startsWith(Js)}static _dropStoreAttributeKeyPrefix(e){return e.startsWith(Js)?e.substring(10):e}};Ce.prototype.is=function(e){return e==="selection"||e=="model:selection"||e=="documentSelection"||e=="model:documentSelection"};var F6=class extends St{markers=new J({idProperty:"name"});_model;_document;_attributePriority=new Map;_selectionRestorePosition=null;_hasChangedRange=!1;_overriddenGravityRegister=new Set;_observedMarkers=new Set;constructor(e){super(),this._model=e.model,this._document=e,this.listenTo(this._model,"applyOperation",(t,i)=>{let o=i[0];!o.isDocumentOperation||o.type=="marker"||o.type=="rename"||o.type=="noop"||(this._ranges.length==0&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))},{priority:"lowest"}),this.on("change:range",()=>{this._validateSelectionRanges(this.getRanges())}),this.listenTo(this._model.markers,"update",(t,i,o,n)=>{this._updateMarker(i,n)}),this.listenTo(this._document,"change",(t,i)=>{z6(this._model,i)})}get isCollapsed(){return this._ranges.length===0?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 e=0;et.toJSON())),e}_validateSelectionRanges(e){for(let t of e)if(!this._document._validateSelectionRange(t))throw new p("document-selection-wrong-position",this,{range:t})}_prepareRange(e){if(this._checkRange(e),e.root==this._document.graveyard)return;let t=Qe.fromRange(e);return t.on("change:range",(i,o,n)=>{if(this._hasChangedRange=!0,t.root==this._document.graveyard){this._selectionRestorePosition=n.deletionPosition;let s=this._ranges.indexOf(t);this._ranges.splice(s,1),t.detach()}}),t}updateMarkers(){if(!this._observedMarkers.size)return;let e=[],t=!1;for(let o of this._model.markers){let n=o.name.split(":",1)[0];if(!this._observedMarkers.has(n))continue;let s=o.getRange();for(let r of this.getRanges())s.containsRange(r,!r.isCollapsed)&&e.push(o)}let i=Array.from(this.markers);for(let o of e)this.markers.has(o)||(this.markers.add(o),t=!0);for(let o of Array.from(this.markers))e.includes(o)||(this.markers.remove(o),t=!0);t&&this.fire("change:marker",{oldMarkers:i,directChange:!1})}_updateMarker(e,t){let i=e.name.split(":",1)[0];if(!this._observedMarkers.has(i))return;let o=!1,n=Array.from(this.markers),s=this.markers.has(e);if(!t)s&&(this.markers.remove(e),o=!0);else{let r=!1;for(let a of this.getRanges())if(t.containsRange(a,!a.isCollapsed)){r=!0;break}r&&!s?(this.markers.add(e),o=!0):!r&&s&&(this.markers.remove(e),o=!0)}o&&this.fire("change:marker",{oldMarkers:n,directChange:!1})}_updateAttributes(e){let t=lt(this._getSurroundingAttributes()),i=lt(this.getAttributes());if(e)this._attributePriority=new Map,this._attrs=new Map;else for(let[n,s]of this._attributePriority)s=="low"&&(this._attrs.delete(n),this._attributePriority.delete(n));this._setAttributesTo(t);let o=[];for(let[n,s]of this.getAttributes())(!i.has(n)||i.get(n)!==s)&&o.push(n);for(let[n]of i)this.hasAttribute(n)||o.push(n);o.length>0&&this.fire("change:attribute",{attributeKeys:o,directChange:!1})}_setAttribute(e,t,i=!0){let o=i?"normal":"low";return o=="low"&&this._attributePriority.get(e)=="normal"||super.getAttribute(e)===t?!1:(this._attrs.set(e,t),this._attributePriority.set(e,o),!0)}_removeAttribute(e,t=!0){let i=t?"normal":"low";return i=="low"&&this._attributePriority.get(e)=="normal"||(this._attributePriority.set(e,i),!super.hasAttribute(e))?!1:(this._attrs.delete(e),!0)}_setAttributesTo(e){let t=new Set;for(let[i,o]of this.getAttributes())e.get(i)!==o&&this._removeAttribute(i,!1);for(let[i,o]of e)this._setAttribute(i,o,!1)&&t.add(i);return t}*getStoredAttributes(){let e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty)for(let t of e.getAttributeKeys())t.startsWith(Js)&&(yield[t.substr(10),e.getAttribute(t)])}_getSurroundingAttributes(){let e=this.getFirstPosition(),t=this._model.schema;if(e.root.rootName=="$graveyard")return null;let i=null;if(this.isCollapsed){let o=e.textNode?e.textNode:e.nodeBefore,n=e.textNode?e.textNode:e.nodeAfter;this.isGravityOverridden||(i=Us(o,t)),i||(i=Us(n,t)),!this.isGravityOverridden&&!i&&(i=Us(o,t,"backward")),i||(i=Us(n,t,"forward")),i||(i=this.getStoredAttributes())}else{let o=this.getFirstRange();for(let n of o){if(n.item.is("element")&&t.isObject(n.item)){i=Us(n.item,t);break}if(n.type=="text"){i=n.item.getAttributes();break}}}return i}_fixGraveyardSelection(e){let t=this._model.schema.getNearestSelectionRange(e);t&&this._pushRange(t)}};function Us(e,t,i="self"){if(!e)return null;for(let o of N6(e,i)){if(!o)return null;if(o instanceof ce)return o.getAttributes();if(!t.isInline(o))continue;let n=t.isObject(o),s=[];for(let[r,a]of o.getAttributes())t.checkAttribute("$text",r)&&(!n||t.getAttributeProperties(r).copyFromObject!==!1)&&s.push([r,a]);return s}return null}function*N6(e,t){if(t=="self")yield e;else{let i=e;for(;i;)i=t=="backward"?i.previousSibling:i.nextSibling,yield i}return null}function z6(e,t){let i=e.document.differ;for(let o of i.getChanges()){if(o.type!="insert")continue;let n=o.position.parent;o.length===n.maxOffset&&e.enqueueChange(t,s=>{let r=Array.from(n.getAttributeKeys()).filter(a=>a.startsWith(Js));for(let a of r)s.removeAttribute(a,n)})}}/** +*/var Js="selection:",N6=q(qi),Te=class extends N6{_selection;constructor(e){super(),this._selection=new z6(e),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(e){return this._selection.containsEntireContent(e)}destroy(){this._selection.destroy()}getAttributeKeys(){return this._selection.getAttributeKeys()}getAttributes(){return this._selection.getAttributes()}getAttribute(e){return this._selection.getAttribute(e)}hasAttribute(e){return this._selection.hasAttribute(e)}refresh(){this._selection.updateMarkers(),this._selection._updateAttributes(!1)}observeMarkers(e){this._selection.observeMarkers(e)}toJSON(){return this._selection.toJSON()}_setFocus(e,t){this._selection.setFocus(e,t)}_setTo(...e){this._selection.setTo(...e)}_setAttribute(e,t){this._selection.setAttribute(e,t)}_removeAttribute(e){this._selection.removeAttribute(e)}_getStoredAttributes(){return this._selection.getStoredAttributes()}_overrideGravity(){return this._selection.overrideGravity()}_restoreGravity(e){this._selection.restoreGravity(e)}static _getStoreAttributeKey(e){return Js+e}static _isStoreAttributeKey(e){return e.startsWith(Js)}static _dropStoreAttributeKeyPrefix(e){return e.startsWith(Js)?e.substring(10):e}};Te.prototype.is=function(e){return e==="selection"||e=="model:selection"||e=="documentSelection"||e=="model:documentSelection"};var z6=class extends Pt{markers=new G({idProperty:"name"});_model;_document;_attributePriority=new Map;_selectionRestorePosition=null;_hasChangedRange=!1;_overriddenGravityRegister=new Set;_observedMarkers=new Set;constructor(e){super(),this._model=e.model,this._document=e,this.listenTo(this._model,"applyOperation",(t,i)=>{let o=i[0];!o.isDocumentOperation||o.type=="marker"||o.type=="rename"||o.type=="noop"||(this._ranges.length==0&&this._selectionRestorePosition&&this._fixGraveyardSelection(this._selectionRestorePosition),this._selectionRestorePosition=null,this._hasChangedRange&&(this._hasChangedRange=!1,this.fire("change:range",{directChange:!1})))},{priority:"lowest"}),this.on("change:range",()=>{this._validateSelectionRanges(this.getRanges())}),this.listenTo(this._model.markers,"update",(t,i,o,n)=>{this._updateMarker(i,n)}),this.listenTo(this._document,"change",(t,i)=>{W6(this._model,i)})}get isCollapsed(){return this._ranges.length===0?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 e=0;et.toJSON())),e}_validateSelectionRanges(e){for(let t of e)if(!this._document._validateSelectionRange(t))throw new p("document-selection-wrong-position",this,{range:t})}_prepareRange(e){if(this._checkRange(e),e.root==this._document.graveyard)return;let t=Qe.fromRange(e);return t.on("change:range",(i,o,n)=>{if(this._hasChangedRange=!0,t.root==this._document.graveyard){this._selectionRestorePosition=n.deletionPosition;let s=this._ranges.indexOf(t);this._ranges.splice(s,1),t.detach()}}),t}updateMarkers(){if(!this._observedMarkers.size)return;let e=[],t=!1;for(let o of this._model.markers){let n=o.name.split(":",1)[0];if(!this._observedMarkers.has(n))continue;let s=o.getRange();for(let r of this.getRanges())s.containsRange(r,!r.isCollapsed)&&e.push(o)}let i=Array.from(this.markers);for(let o of e)this.markers.has(o)||(this.markers.add(o),t=!0);for(let o of Array.from(this.markers))e.includes(o)||(this.markers.remove(o),t=!0);t&&this.fire("change:marker",{oldMarkers:i,directChange:!1})}_updateMarker(e,t){let i=e.name.split(":",1)[0];if(!this._observedMarkers.has(i))return;let o=!1,n=Array.from(this.markers),s=this.markers.has(e);if(!t)s&&(this.markers.remove(e),o=!0);else{let r=!1;for(let a of this.getRanges())if(t.containsRange(a,!a.isCollapsed)){r=!0;break}r&&!s?(this.markers.add(e),o=!0):!r&&s&&(this.markers.remove(e),o=!0)}o&&this.fire("change:marker",{oldMarkers:n,directChange:!1})}_updateAttributes(e){let t=lt(this._getSurroundingAttributes()),i=lt(this.getAttributes());if(e)this._attributePriority=new Map,this._attrs=new Map;else for(let[n,s]of this._attributePriority)s=="low"&&(this._attrs.delete(n),this._attributePriority.delete(n));this._setAttributesTo(t);let o=[];for(let[n,s]of this.getAttributes())(!i.has(n)||i.get(n)!==s)&&o.push(n);for(let[n]of i)this.hasAttribute(n)||o.push(n);o.length>0&&this.fire("change:attribute",{attributeKeys:o,directChange:!1})}_setAttribute(e,t,i=!0){let o=i?"normal":"low";return o=="low"&&this._attributePriority.get(e)=="normal"||super.getAttribute(e)===t?!1:(this._attrs.set(e,t),this._attributePriority.set(e,o),!0)}_removeAttribute(e,t=!0){let i=t?"normal":"low";return i=="low"&&this._attributePriority.get(e)=="normal"||(this._attributePriority.set(e,i),!super.hasAttribute(e))?!1:(this._attrs.delete(e),!0)}_setAttributesTo(e){let t=new Set;for(let[i,o]of this.getAttributes())e.get(i)!==o&&this._removeAttribute(i,!1);for(let[i,o]of e)this._setAttribute(i,o,!1)&&t.add(i);return t}*getStoredAttributes(){let e=this.getFirstPosition().parent;if(this.isCollapsed&&e.isEmpty)for(let t of e.getAttributeKeys())t.startsWith(Js)&&(yield[t.substr(10),e.getAttribute(t)])}_getSurroundingAttributes(){let e=this.getFirstPosition(),t=this._model.schema;if(e.root.rootName=="$graveyard")return null;let i=null;if(this.isCollapsed){let o=e.textNode?e.textNode:e.nodeBefore,n=e.textNode?e.textNode:e.nodeAfter;this.isGravityOverridden||(i=Us(o,t)),i||(i=Us(n,t)),!this.isGravityOverridden&&!i&&(i=Us(o,t,"backward")),i||(i=Us(n,t,"forward")),i||(i=this.getStoredAttributes())}else{let o=this.getFirstRange();for(let n of o){if(n.item.is("element")&&t.isObject(n.item)){i=Us(n.item,t);break}if(n.type=="text"){i=n.item.getAttributes();break}}}return i}_fixGraveyardSelection(e){let t=this._model.schema.getNearestSelectionRange(e);t&&this._pushRange(t)}};function Us(e,t,i="self"){if(!e)return null;for(let o of H6(e,i)){if(!o)return null;if(o instanceof ce)return o.getAttributes();if(!t.isInline(o))continue;let n=t.isObject(o),s=[];for(let[r,a]of o.getAttributes())t.checkAttribute("$text",r)&&(!n||t.getAttributeProperties(r).copyFromObject!==!1)&&s.push([r,a]);return s}return null}function*H6(e,t){if(t=="self")yield e;else{let i=e;for(;i;)i=t=="backward"?i.previousSibling:i.nextSibling,yield i}return null}function W6(e,t){let i=e.document.differ;for(let o of i.getChanges()){if(o.type!="insert")continue;let n=o.position.parent;o.length===n.maxOffset&&e.enqueueChange(t,s=>{let r=Array.from(n.getAttributeKeys()).filter(a=>a.startsWith(Js));for(let a of r)s.removeAttribute(a,n)})}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Zs=class{_nodes=[];_offsetToNode=[];constructor(e){e&&this._insertNodes(0,e)}[Symbol.iterator](){return this._nodes[Symbol.iterator]()}get length(){return this._nodes.length}get maxOffset(){return this._offsetToNode.length}getNode(e){return this._nodes[e]||null}getNodeAtOffset(e){return this._offsetToNode[e]||null}getNodeIndex(e){return e.index}getNodeStartOffset(e){return e.startOffset}indexToOffset(e){if(e==this._nodes.length)return this.maxOffset;let t=this._nodes[e];if(!t)throw new p("model-nodelist-index-out-of-bounds",this);return this.getNodeStartOffset(t)}offsetToIndex(e){if(e==this._offsetToNode.length)return this._nodes.length;let t=this._offsetToNode[e];if(!t)throw new p("model-nodelist-offset-out-of-bounds",this,{offset:e,nodeList:this});return this.getNodeIndex(t)}_insertNodes(e,t){let i=[];for(let n of t){if(!(n instanceof Eo))throw new p("model-nodelist-insertnodes-not-node",this);i.push(n)}let o=this.indexToOffset(e);Du(this._nodes,i,e),Du(this._offsetToNode,H6(i),o);for(let n=e;ni.index!==null),this._offsetToNode=this._offsetToNode.filter(i=>i.index!==null);let t=0;for(let i=0;ie.toJSON())}};function H6(e){let t=[],i=0;for(let o of e)for(let n=0;ni.index!==null),this._offsetToNode=this._offsetToNode.filter(i=>i.index!==null);let t=0;for(let i=0;ie.toJSON())}};function U6(e){let t=[],i=0;for(let o of e)for(let n=0;n0){t.children=[];for(let i of this._children)t.children.push(i.toJSON())}return t}_clone(t=!1){let i=t?U6(this._children):void 0;return new Ja(this.name,this.getAttributes(),i)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,i){let o=W6(i);for(let n of o)n.parent!==null&&n._remove(),n.parent=this;this._children._insertNodes(t,o)}_removeChildren(t,i=1){let o=this._children._removeNodes(t,i);for(let n of o)n.parent=null;return o}_removeChildrenArray(t){this._children._removeNodesArray(t);for(let i of t)i.parent=null}static fromJSON(t){let i;if(t.children){i=[];for(let o of t.children)o.name?i.push(Ja.fromJSON(o)):i.push(ce.fromJSON(o))}return new Ja(t.name,t.attributes,i)}};ie.prototype.is=function(e,t){return t?t===this.name&&(e==="element"||e==="model:element"):e==="element"||e==="model:element"||e==="node"||e==="model:node"};function W6(e){if(typeof e=="string")return[new ce(e)];Je(e)||(e=[e]);let t=[];for(let i of e)typeof i=="string"?t.push(new ce(i)):i instanceof Gt?t.push(new ce(i.data,i.getAttributes())):t.push(i);return t}function U6(e){let t=[];for(let i of e)t.push(i._clone(!0));return t}/** +*/var ie=class Za extends Ao{name;_children=new Zs;constructor(t,i,o){super(i),this.name=t,o&&this._insertChild(0,o)}get childCount(){return this._children.length}get maxOffset(){return this._children.maxOffset}get isEmpty(){return this.childCount===0}getChild(t){return this._children.getNode(t)}getChildAtOffset(t){return this._children.getNodeAtOffset(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 i=this;for(let o of t)i=i.getChildAtOffset(o);return i}findAncestor(t,i={}){let o=i.includeSelf?this:this.parent;for(;o;){if(o.name===t)return o;o=o.parent}return null}toJSON(){let t=super.toJSON();if(t.name=this.name,this._children.length>0){t.children=[];for(let i of this._children)t.children.push(i.toJSON())}return t}_clone(t=!1){let i=t?$6(this._children):void 0;return new Za(this.name,this.getAttributes(),i)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,i){let o=q6(i);for(let n of o)n.parent!==null&&n._remove(),n.parent=this;this._children._insertNodes(t,o)}_removeChildren(t,i=1){let o=this._children._removeNodes(t,i);for(let n of o)n.parent=null;return o}_removeChildrenArray(t){this._children._removeNodesArray(t);for(let i of t)i.parent=null}static fromJSON(t){let i;if(t.children){i=[];for(let o of t.children)o.name?i.push(Za.fromJSON(o)):i.push(ce.fromJSON(o))}return new Za(t.name,t.attributes,i)}};ie.prototype.is=function(e,t){return t?t===this.name&&(e==="element"||e==="model:element"):e==="element"||e==="model:element"||e==="node"||e==="model:node"};function q6(e){if(typeof e=="string")return[new ce(e)];Je(e)||(e=[e]);let t=[];for(let i of e)typeof i=="string"?t.push(new ce(i)):i instanceof Zt?t.push(new ce(i.data,i.getAttributes())):t.push(i);return t}function $6(e){let t=[];for(let i of e)t.push(i._clone(!0));return t}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Ep=class{_dispatchers;constructor(e){this._dispatchers=e}add(e){for(let t of this._dispatchers)e(t);return this}};/** +*/var Ip=class{_dispatchers;constructor(e){this._dispatchers=e}add(e){for(let t of this._dispatchers)e(t);return this}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var q6=class extends Ep{elementToElement(e){return this.add(l7(e))}elementToStructure(e){return this.add(c7(e))}attributeToElement(e){return this.add(u7(e))}attributeToAttribute(e){return this.add(d7(e))}markerToElement(e){return this.add(h7(e))}markerToHighlight(e){return this.add(m7(e))}markerToData(e){return this.add(f7(e))}};function Ap(){return(e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;let o=i.writer,n=i.mapper.toViewPosition(t.range.start),s=o.createText(t.item.data);o.insert(n,s)}}function Ip(){return(e,t,i)=>{i.convertAttributes(t.item),!t.reconversion&&t.item.is("element")&&!t.item.isEmpty&&i.convertChildren(t.item)}}function $6(){return(e,t,i)=>{if(t.reconversion)return;let o=i.mapper.toViewPosition(t.position),n=t.position.getShiftedBy(t.length),s=i.mapper.toViewPosition(n,{isPhantom:!0});Pp(i.writer.createRange(o,s).getTrimmed(),i)}}function Sp(e,t){let i=e.createAttributeElement("span",t.attributes);return t.classes&&i._addClass(t.classes),typeof t.priority=="number"&&(i._priority=t.priority),i._id=t.id,i}function j6(){return(e,t,i)=>{let o=t.selection;if(o.isCollapsed||!i.consumable.consume(o,"selection"))return;let n=[];for(let s of o.getRanges())n.push(i.mapper.toViewRange(s));i.writer.setSelection(n,{backward:o.isBackward})}}function K6(){return(e,t,i)=>{let o=t.selection;if(!o.isCollapsed||!i.consumable.consume(o,"selection"))return;let n=i.writer,s=o.getFirstPosition(),r=i.mapper.toViewPosition(s),a=n.breakAttributes(r);n.setSelection(a)}}function G6(){return(e,t,i)=>{let o=i.writer,n=o.document.selection;for(let s of n.getRanges())s.isCollapsed&&s.end.parent.isAttached()&&i.writer.mergeAttributes(s.start);o.setSelection(null)}}function J6(e){return(t,i,o)=>{if(!o.consumable.test(i.item,t.name))return;let n=e(i.attributeOldValue,o,i),s=e(i.attributeNewValue,o,i);if(!n&&!s)return;o.consumable.consume(i.item,t.name);let r=o.writer,a=r.document.selection;if(i.item instanceof St||i.item instanceof Ce)r.wrap(a.getFirstRange(),s);else{let l=o.mapper.toViewRange(i.range);i.attributeOldValue!==null&&n&&(l=r.unwrap(l,n)),i.attributeNewValue!==null&&s&&r.wrap(l,s)}}}function Z6(e,t=v7){return(i,o,n)=>{if(!t(o.item,n.consumable,{preflight:!0}))return;let s=e(o.item,n,o);if(!s)return;t(o.item,n.consumable);let r=o.reconversion&&Rp(o.item,n)||n.mapper.toViewPosition(o.range.start);n.mapper.bindElements(o.item,s),n.writer.insert(r,s),n.convertAttributes(o.item),Op(s,o.item.getChildren(),n,{reconversion:o.reconversion})}}function Q6(e,t){return(i,o,n)=>{if(!t(o.item,n.consumable,{preflight:!0}))return;let s=new Map;n.writer._registerSlotFactory(b7(o.item,s,n));let r=e(o.item,n,o);if(n.writer._clearSlotFactory(),!r)return;w7(o.item,s,n),t(o.item,n.consumable);let a=o.reconversion&&Rp(o.item,n)||n.mapper.toViewPosition(o.range.start);n.mapper.bindElements(o.item,r),n.writer.insert(a,r),n.convertAttributes(o.item),y7(r,s,n,{reconversion:o.reconversion})}}function Y6(e){return(t,i,o)=>{i.isOpening=!0;let n=e(i,o);i.isOpening=!1;let s=e(i,o);if(!n||!s)return;let{markerRange:r,markerName:a}=i;if(r.isCollapsed&&!o.consumable.consume(r,t.name))return;for(let h of r)if(!o.consumable.consume(h.item,t.name))return;let l=o.mapper,c=o.writer;c.setCustomProperty("markerBoundaryType","start",n),c.setCustomProperty("markerBoundaryName",a,n),c.setCustomProperty("markerBoundaryType","end",s),c.setCustomProperty("markerBoundaryName",a,s);let u=(h,f)=>{let m=l.markerNameToElements(h);if(m){for(let g of m)if(g.getCustomProperty("markerBoundaryType")===f)return l.toModelPosition(c.createPositionBefore(g))}return null};if(!r.isCollapsed){let h=l.toViewPosition(r.end).getLastMatchingPosition(({item:f})=>{if(!f.is("uiElement")||f.getCustomProperty("markerBoundaryType")!=="end")return!1;let m=f.getCustomProperty("markerBoundaryName"),g=u(m,"start");if(!g)return!1;let b=g.compareWith(r.start);return b==="same"?m.localeCompare(a)>0:b==="after"});c.insert(h,s),l.bindElementToMarker(s,a)}let d=l.toViewPosition(r.start).getLastMatchingPosition(({item:h})=>{if(!h.is("uiElement"))return!1;let f=h.getCustomProperty("markerBoundaryType");if(!f)return!1;if(f==="end")return!0;let m=h.getCustomProperty("markerBoundaryName"),g=u(m,"end");if(!g)return r.isCollapsed;if(r.isCollapsed)return!0;let b=g.compareWith(r.end);return b==="same"?m.localeCompare(a)<0:b==="after"});c.insert(d,n),l.bindElementToMarker(n,a),t.stop()}}function Pp(e,t){let i=t.writer.remove(e);for(let o of t.writer.createRangeIn(i).getItems())t.mapper.unbindViewElement(o,{defer:!0});return e.start}function Rp(e,t){let i=t.mapper.toViewElement(e);return i&&Pp(t.writer.createRangeOn(i),t)}function X6(){return(e,t,i)=>{let o=i.mapper.markerNameToElements(t.markerName);if(o){for(let n of o)i.mapper.unbindElementFromMarkerName(n,t.markerName),i.writer.clear(i.writer.createRangeOn(n),n);i.writer.clearClonedElementsGroup(t.markerName),e.stop()}}}function e7(e){return(t,i,o)=>{let n=e(i.markerName,o);if(!n)return;let s=i.markerRange;o.consumable.consume(s,t.name)&&(Fg(s,!1,o,i,n),Fg(s,!0,o,i,n),t.stop())}}function Fg(e,t,i,o,n){let s=t?e.start:e.end,r=s.nodeAfter&&s.nodeAfter.is("element")?s.nodeAfter:null,a=s.nodeBefore&&s.nodeBefore.is("element")?s.nodeBefore:null;if(r||a){let l,c;t&&r||!t&&!a?(l=r,c=!0):(l=a,c=!1);let u=i.mapper.toViewElement(l);if(u){t7(u,t,c,i,o,n);return}}i7(i.mapper.toViewPosition(s),t,i,o,n)}function t7(e,t,i,o,n,s){let r=`data-${s.group}-${t?"start":"end"}-${i?"before":"after"}`,a=e.hasAttribute(r)?e.getAttribute(r).split(","):[];a.unshift(s.name),o.writer.setAttribute(r,a.join(","),e),o.mapper.bindElementToMarker(e,n.markerName)}function i7(e,t,i,o,n){let s=`${n.group}-${t?"start":"end"}`,r=n.name?{name:n.name}:null,a=i.writer.createUIElement(s,r);i.writer.insert(e,a),i.mapper.bindElementToMarker(a,o.markerName)}function o7(e){return(t,i,o)=>{let n=e(i.markerName,o);if(!n)return;let s=o.mapper.markerNameToElements(i.markerName);if(!s)return;for(let a of s)o.mapper.unbindElementFromMarkerName(a,i.markerName),a.is("containerElement")?(r(`data-${n.group}-start-before`,a),r(`data-${n.group}-start-after`,a),r(`data-${n.group}-end-before`,a),r(`data-${n.group}-end-after`,a)):o.writer.clear(o.writer.createRangeOn(a),a);o.writer.clearClonedElementsGroup(i.markerName),t.stop();function r(a,l){if(l.hasAttribute(a)){let c=new Set(l.getAttribute(a).split(","));c.delete(n.name),c.size==0?o.writer.removeAttribute(a,l):o.writer.setAttribute(a,Array.from(c).join(","),l)}}}}function n7(e){return(t,i,o)=>{if(!o.consumable.test(i.item,t.name))return;let n=e(i.attributeOldValue,o,i),s=e(i.attributeNewValue,o,i);if(!n&&!s)return;o.consumable.consume(i.item,t.name);let r=o.mapper.toViewElement(i.item),a=o.writer;if(!r)throw new p("conversion-attribute-to-attribute-on-text",o.dispatcher,i);if(i.attributeOldValue!==null&&n){let l=n.value;n.key=="style"&&(typeof n.value=="string"?l=new Ks(a.document.stylesProcessor).setTo(n.value).getStylesEntries().map(([c])=>c):l=Object.keys(n.value)),a.removeAttribute(n.key,l,r)}if(i.attributeNewValue!==null&&s){let l=s.value;s.key=="style"&&typeof s.value=="string"&&(l=Object.fromEntries(new Ks(a.document.stylesProcessor).setTo(s.value).getStylesEntries())),a.setAttribute(s.key,l,!1,r)}}}function s7(e){return(t,i,o)=>{if(!i.item||!(i.item instanceof St||i.item instanceof Ce)&&!i.item.is("$textProxy"))return;let n=_d(e,i,o);if(!n||!o.consumable.consume(i.item,t.name))return;let s=o.writer,r=Sp(s,n),a=s.document.selection;if(i.item instanceof St||i.item instanceof Ce)s.wrap(a.getFirstRange(),r);else{let l=o.mapper.toViewRange(i.range),c=s.wrap(l,r);for(let u of c.getItems())if(u.is("attributeElement")&&u.isSimilar(r)){o.mapper.bindElementToMarker(u,i.markerName);break}}}}function r7(e){return(t,i,o)=>{if(!i.item||!(i.item instanceof ie))return;let n=_d(e,i,o);if(!n||!o.consumable.test(i.item,t.name))return;let s=o.mapper.toViewElement(i.item);if(s&&s.getCustomProperty("addHighlight")){o.consumable.consume(i.item,t.name);for(let r of T._createIn(i.item))o.consumable.consume(r.item,t.name);s.getCustomProperty("addHighlight")(s,n,o.writer),o.mapper.bindElementToMarker(s,i.markerName)}}}function a7(e){return(t,i,o)=>{if(i.markerRange.isCollapsed)return;let n=_d(e,i,o);if(!n)return;let s=Sp(o.writer,n),r=o.mapper.markerNameToElements(i.markerName);if(r){for(let a of r)o.mapper.unbindElementFromMarkerName(a,i.markerName),a.is("attributeElement")?o.writer.unwrap(o.writer.createRangeOn(a),s):a.getCustomProperty("removeHighlight")(a,n.id,o.writer);o.writer.clearClonedElementsGroup(i.markerName),t.stop()}}}function l7(e){let t=Vp(e.model),i=ir(e.view,"container");return t.attributes.length&&(t.children=!0),o=>{o.on(`insert:${t.name}`,Z6(i,Bp(t)),{priority:e.converterPriority||"normal"}),(t.children||t.attributes.length)&&o.on("reduceChanges",Mp(t),{priority:"low"})}}function c7(e){let t=Vp(e.model),i=ir(e.view,"container");return t.children=!0,o=>{if(o._conversionApi.schema.checkChild(t.name,"$text"))throw new p("conversion-element-to-structure-disallowed-text",o,{elementName:t.name});o.on(`insert:${t.name}`,Q6(i,Bp(t)),{priority:e.converterPriority||"normal"}),o.on("reduceChanges",Mp(t),{priority:"low"})}}function u7(e){e=Ae(e);let t=e.model;typeof t=="string"&&(t={key:t});let i=`attribute:${t.key}`;if(t.name&&(i+=":"+t.name),t.values)for(let n of t.values)e.view[n]=ir(e.view[n],"attribute");else e.view=ir(e.view,"attribute");let o=Lp(e);return n=>{n.on(i,J6(o),{priority:e.converterPriority||"normal"})}}function d7(e){e=Ae(e);let t=e.model;typeof t=="string"&&(t={key:t});let i=`attribute:${t.key}`;if(t.name&&(i+=":"+t.name),t.values)for(let n of t.values)e.view[n]=Ng(e.view[n]);else e.view=Ng(e.view);let o=Lp(e);return n=>{n.on(i,n7(o),{priority:e.converterPriority||"normal"})}}function h7(e){let t=ir(e.view,"ui");return i=>{i.on(`addMarker:${e.model}`,Y6(t),{priority:e.converterPriority||"normal"}),i.on(`removeMarker:${e.model}`,X6(),{priority:e.converterPriority||"normal"})}}function f7(e){e=Ae(e);let t=e.model,i=e.view;return i||(i=o=>({group:t,name:o.substr(e.model.length+1)})),o=>{o.on(`addMarker:${t}`,e7(i),{priority:e.converterPriority||"normal"}),o.on(`removeMarker:${t}`,o7(i),{priority:e.converterPriority||"normal"})}}function m7(e){return t=>{t.on(`addMarker:${e.model}`,s7(e.view),{priority:e.converterPriority||"normal"}),t.on(`addMarker:${e.model}`,r7(e.view),{priority:e.converterPriority||"normal"}),t.on(`removeMarker:${e.model}`,a7(e.view),{priority:e.converterPriority||"normal"})}}function Vp(e){return typeof e=="string"&&(e={name:e}),{name:e.name,attributes:e.attributes?j(e.attributes):[],children:!!e.children}}function ir(e,t){return typeof e=="function"?e:((i,o)=>g7(e,o,t))}function g7(e,t,i){typeof e=="string"&&(e={name:e});let o,n=t.writer,s=Object.assign({},e.attributes);if(i=="container")o=n.createContainerElement(e.name,s);else if(i=="attribute"){let r={priority:e.priority||Pn.DEFAULT_PRIORITY};o=n.createAttributeElement(e.name,s,r)}else o=n.createUIElement(e.name,s);if(e.styles){let r=Object.keys(e.styles);for(let a of r)n.setStyle(a,e.styles[a],o)}if(e.classes){let r=e.classes;if(typeof r=="string")n.addClass(r,o);else for(let a of r)n.addClass(a,o)}return o}function Lp(e){return e.model.values?((t,i,o)=>{let n=e.view[t];return n?n(t,i,o):null}):e.view}function Ng(e){return typeof e=="string"?t=>({key:e,value:t}):typeof e=="object"?e.value?()=>e:t=>({key:e.key,value:t}):e}function _d(e,t,i){let o=typeof e=="function"?e(t,i):{...e};return o?(o.priority||(o.priority=10),o.id||(o.id=t.markerName),o):null}function p7(e){return(t,i)=>{if(!t.is("element",e.name))return!1;if(i.type=="attribute"){if(e.attributes.includes(i.attributeKey))return!0}else if(e.children)return!0;return!1}}function Mp(e){let t=p7(e);return(i,o)=>{let n=[];o.reconvertedElements||(o.reconvertedElements=new Set);for(let s of o.changes){let r=s.type=="attribute"?s.range.start.nodeAfter:s.position.parent;if(!r||!t(r,s)||s.type=="reinsert"){n.push(s);continue}if(s.type=="insert"&&s.action=="rename"&&o.refreshedItems.add(s.position.nodeAfter),!o.reconvertedElements.has(r)){o.reconvertedElements.add(r);let a=A._createBefore(r),l=n.length;for(let c=n.length-1;c>=0;c--){let u=n[c],d=(u.type=="attribute"?u.range.start:u.position).compareWith(a);if(d=="before"||u.type=="remove"&&d=="same")break;l=c}n.splice(l,0,{type:"reinsert",name:r.name,position:a,length:1})}}o.changes=n}}function Bp(e){return(t,i,o={})=>{let n=["insert"];for(let s of e.attributes)t.hasAttribute(s)&&n.push(`attribute:${s}`);return n.every(s=>i.test(t,s))?(o.preflight||n.forEach(s=>i.consume(t,s)),!0):!1}}function b7(e,t,i){return(o,n)=>{let s=o.createContainerElement("$slot"),r;if(n==="children")r=Array.from(e.getChildren());else if(typeof n=="function")r=Array.from(e.getChildren()).filter(a=>n(a));else throw new p("conversion-slot-mode-unknown",i.dispatcher,{modeOrFilter:n});return t.set(s,r),s}}function w7(e,t,i){let o=Array.from(t.values()).flat(),n=new Set(o);if(n.size!=o.length)throw new p("conversion-slot-filter-overlap",i.dispatcher,{element:e});if(n.size!=e.childCount)throw new p("conversion-slot-filter-incomplete",i.dispatcher,{element:e})}function y7(e,t,i,o){i.mapper.on("modelToViewPosition",r,{priority:"highest"});let n=null,s=null;for([n,s]of t)Op(e,s,i,o),i.writer.setCustomProperty("$structureSlotParent",!0,n.parent),i.writer.move(i.writer.createRangeIn(n),i.writer.createPositionBefore(n)),i.writer.remove(n);i.mapper.off("modelToViewPosition",r);function r(a,l){let c=l.modelPosition.nodeAfter,u=s.indexOf(c);u<0||(l.viewPosition=l.mapper.findPositionIn(n,u))}}function Op(e,t,i,o){for(let n of t)_7(e.root,n,i,o)||i.convertItem(n)}function _7(e,t,i,o){let{writer:n,mapper:s}=i;if(!o.reconversion)return!1;let r=s.toViewElement(t);return!r||r.root==e||!i.canReuseView(r)?!1:(n.move(n.createRangeOn(r),s.toViewPosition(A._createBefore(t))),!0)}function v7(e,t,{preflight:i}={}){return i?t.test(e,"insert"):t.consume(e,"insert")}/** +*/var j6=class extends Ip{elementToElement(e){return this.add(u7(e))}elementToStructure(e){return this.add(d7(e))}attributeToElement(e){return this.add(h7(e))}attributeToAttribute(e){return this.add(f7(e))}markerToElement(e){return this.add(m7(e))}markerToHighlight(e){return this.add(p7(e))}markerToData(e){return this.add(g7(e))}};function Sp(){return(e,t,i)=>{if(!i.consumable.consume(t.item,e.name))return;let o=i.writer,n=i.mapper.toViewPosition(t.range.start),s=o.createText(t.item.data);o.insert(n,s)}}function Pp(){return(e,t,i)=>{i.convertAttributes(t.item),!t.reconversion&&t.item.is("element")&&!t.item.isEmpty&&i.convertChildren(t.item)}}function K6(){return(e,t,i)=>{if(t.reconversion)return;let o=i.mapper.toViewPosition(t.position),n=t.position.getShiftedBy(t.length),s=i.mapper.toViewPosition(n,{isPhantom:!0});Vp(i.writer.createRange(o,s).getTrimmed(),i)}}function Rp(e,t){let i=e.createAttributeElement("span",t.attributes);return t.classes&&i._addClass(t.classes),typeof t.priority=="number"&&(i._priority=t.priority),i._id=t.id,i}function G6(){return(e,t,i)=>{let o=t.selection;if(o.isCollapsed||!i.consumable.consume(o,"selection"))return;let n=[];for(let s of o.getRanges())n.push(i.mapper.toViewRange(s));i.writer.setSelection(n,{backward:o.isBackward})}}function J6(){return(e,t,i)=>{let o=t.selection;if(!o.isCollapsed||!i.consumable.consume(o,"selection"))return;let n=i.writer,s=o.getFirstPosition(),r=i.mapper.toViewPosition(s),a=n.breakAttributes(r);n.setSelection(a)}}function Z6(){return(e,t,i)=>{let o=i.writer,n=o.document.selection;for(let s of n.getRanges())s.isCollapsed&&s.end.parent.isAttached()&&i.writer.mergeAttributes(s.start);o.setSelection(null)}}function Q6(e){return(t,i,o)=>{if(!o.consumable.test(i.item,t.name))return;let n=e(i.attributeOldValue,o,i),s=e(i.attributeNewValue,o,i);if(!n&&!s)return;o.consumable.consume(i.item,t.name);let r=o.writer,a=r.document.selection;if(i.item instanceof Pt||i.item instanceof Te)r.wrap(a.getFirstRange(),s);else{let l=o.mapper.toViewRange(i.range);i.attributeOldValue!==null&&n&&(l=r.unwrap(l,n)),i.attributeNewValue!==null&&s&&r.wrap(l,s)}}}function Y6(e,t=C7){return(i,o,n)=>{if(!t(o.item,n.consumable,{preflight:!0}))return;let s=e(o.item,n,o);if(!s)return;t(o.item,n.consumable);let r=o.reconversion&&Lp(o.item,n)||n.mapper.toViewPosition(o.range.start);n.mapper.bindElements(o.item,s),n.writer.insert(r,s),n.convertAttributes(o.item),Fp(s,o.item.getChildren(),n,{reconversion:o.reconversion})}}function X6(e,t){return(i,o,n)=>{if(!t(o.item,n.consumable,{preflight:!0}))return;let s=new Map;n.writer._registerSlotFactory(y7(o.item,s,n));let r=e(o.item,n,o);if(n.writer._clearSlotFactory(),!r)return;_7(o.item,s,n),t(o.item,n.consumable);let a=o.reconversion&&Lp(o.item,n)||n.mapper.toViewPosition(o.range.start);n.mapper.bindElements(o.item,r),n.writer.insert(a,r),n.convertAttributes(o.item),v7(r,s,n,{reconversion:o.reconversion})}}function e7(e){return(t,i,o)=>{i.isOpening=!0;let n=e(i,o);i.isOpening=!1;let s=e(i,o);if(!n||!s)return;let{markerRange:r,markerName:a}=i;if(r.isCollapsed&&!o.consumable.consume(r,t.name))return;for(let h of r)if(!o.consumable.consume(h.item,t.name))return;let l=o.mapper,c=o.writer;c.setCustomProperty("markerBoundaryType","start",n),c.setCustomProperty("markerBoundaryName",a,n),c.setCustomProperty("markerBoundaryType","end",s),c.setCustomProperty("markerBoundaryName",a,s);let u=(h,f)=>{let m=l.markerNameToElements(h);if(m){for(let g of m)if(g.getCustomProperty("markerBoundaryType")===f)return l.toModelPosition(c.createPositionBefore(g))}return null};if(!r.isCollapsed){let h=l.toViewPosition(r.end).getLastMatchingPosition(({item:f})=>{if(!f.is("uiElement")||f.getCustomProperty("markerBoundaryType")!=="end")return!1;let m=f.getCustomProperty("markerBoundaryName"),g=u(m,"start");if(!g)return!1;let b=g.compareWith(r.start);return b==="same"?m.localeCompare(a)>0:b==="after"});c.insert(h,s),l.bindElementToMarker(s,a)}let d=l.toViewPosition(r.start).getLastMatchingPosition(({item:h})=>{if(!h.is("uiElement"))return!1;let f=h.getCustomProperty("markerBoundaryType");if(!f)return!1;if(f==="end")return!0;let m=h.getCustomProperty("markerBoundaryName"),g=u(m,"end");if(!g)return r.isCollapsed;if(r.isCollapsed)return!0;let b=g.compareWith(r.end);return b==="same"?m.localeCompare(a)<0:b==="after"});c.insert(d,n),l.bindElementToMarker(n,a),t.stop()}}function Vp(e,t){let i=t.writer.remove(e);for(let o of t.writer.createRangeIn(i).getItems())t.mapper.unbindViewElement(o,{defer:!0});return e.start}function Lp(e,t){let i=t.mapper.toViewElement(e);return i&&Vp(t.writer.createRangeOn(i),t)}function t7(){return(e,t,i)=>{let o=i.mapper.markerNameToElements(t.markerName);if(o){for(let n of o)i.mapper.unbindElementFromMarkerName(n,t.markerName),i.writer.clear(i.writer.createRangeOn(n),n);i.writer.clearClonedElementsGroup(t.markerName),e.stop()}}}function i7(e){return(t,i,o)=>{let n=e(i.markerName,o);if(!n)return;let s=i.markerRange;o.consumable.consume(s,t.name)&&(zg(s,!1,o,i,n),zg(s,!0,o,i,n),t.stop())}}function zg(e,t,i,o,n){let s=t?e.start:e.end,r=s.nodeAfter&&s.nodeAfter.is("element")?s.nodeAfter:null,a=s.nodeBefore&&s.nodeBefore.is("element")?s.nodeBefore:null;if(r||a){let l,c;t&&r||!t&&!a?(l=r,c=!0):(l=a,c=!1);let u=i.mapper.toViewElement(l);if(u){o7(u,t,c,i,o,n);return}}n7(i.mapper.toViewPosition(s),t,i,o,n)}function o7(e,t,i,o,n,s){let r=`data-${s.group}-${t?"start":"end"}-${i?"before":"after"}`,a=e.hasAttribute(r)?e.getAttribute(r).split(","):[];a.unshift(s.name),o.writer.setAttribute(r,a.join(","),e),o.mapper.bindElementToMarker(e,n.markerName)}function n7(e,t,i,o,n){let s=`${n.group}-${t?"start":"end"}`,r=n.name?{name:n.name}:null,a=i.writer.createUIElement(s,r);i.writer.insert(e,a),i.mapper.bindElementToMarker(a,o.markerName)}function s7(e){return(t,i,o)=>{let n=e(i.markerName,o);if(!n)return;let s=o.mapper.markerNameToElements(i.markerName);if(!s)return;for(let a of s)o.mapper.unbindElementFromMarkerName(a,i.markerName),a.is("containerElement")?(r(`data-${n.group}-start-before`,a),r(`data-${n.group}-start-after`,a),r(`data-${n.group}-end-before`,a),r(`data-${n.group}-end-after`,a)):o.writer.clear(o.writer.createRangeOn(a),a);o.writer.clearClonedElementsGroup(i.markerName),t.stop();function r(a,l){if(l.hasAttribute(a)){let c=new Set(l.getAttribute(a).split(","));c.delete(n.name),c.size==0?o.writer.removeAttribute(a,l):o.writer.setAttribute(a,Array.from(c).join(","),l)}}}}function r7(e){return(t,i,o)=>{if(!o.consumable.test(i.item,t.name))return;let n=e(i.attributeOldValue,o,i),s=e(i.attributeNewValue,o,i);if(!n&&!s)return;o.consumable.consume(i.item,t.name);let r=o.mapper.toViewElement(i.item),a=o.writer;if(!r)throw new p("conversion-attribute-to-attribute-on-text",o.dispatcher,i);if(i.attributeOldValue!==null&&n){let l=n.value;n.key=="style"&&(typeof n.value=="string"?l=new Ks(a.document.stylesProcessor).setTo(n.value).getStylesEntries().map(([c])=>c):l=Object.keys(n.value)),a.removeAttribute(n.key,l,r)}if(i.attributeNewValue!==null&&s){let l=s.value;s.key=="style"&&typeof s.value=="string"&&(l=Object.fromEntries(new Ks(a.document.stylesProcessor).setTo(s.value).getStylesEntries())),a.setAttribute(s.key,l,!1,r)}}}function a7(e){return(t,i,o)=>{if(!i.item||!(i.item instanceof Pt||i.item instanceof Te)&&!i.item.is("$textProxy"))return;let n=kd(e,i,o);if(!n||!o.consumable.consume(i.item,t.name))return;let s=o.writer,r=Rp(s,n),a=s.document.selection;if(i.item instanceof Pt||i.item instanceof Te)s.wrap(a.getFirstRange(),r);else{let l=o.mapper.toViewRange(i.range),c=s.wrap(l,r);for(let u of c.getItems())if(u.is("attributeElement")&&u.isSimilar(r)){o.mapper.bindElementToMarker(u,i.markerName);break}}}}function l7(e){return(t,i,o)=>{if(!i.item||!(i.item instanceof ie))return;let n=kd(e,i,o);if(!n||!o.consumable.test(i.item,t.name))return;let s=o.mapper.toViewElement(i.item);if(s&&s.getCustomProperty("addHighlight")){o.consumable.consume(i.item,t.name);for(let r of T._createIn(i.item))o.consumable.consume(r.item,t.name);s.getCustomProperty("addHighlight")(s,n,o.writer),o.mapper.bindElementToMarker(s,i.markerName)}}}function c7(e){return(t,i,o)=>{if(i.markerRange.isCollapsed)return;let n=kd(e,i,o);if(!n)return;let s=Rp(o.writer,n),r=o.mapper.markerNameToElements(i.markerName);if(r){for(let a of r)o.mapper.unbindElementFromMarkerName(a,i.markerName),a.is("attributeElement")?o.writer.unwrap(o.writer.createRangeOn(a),s):a.getCustomProperty("removeHighlight")(a,n.id,o.writer);o.writer.clearClonedElementsGroup(i.markerName),t.stop()}}}function u7(e){let t=Mp(e.model),i=ir(e.view,"container");return t.attributes.length&&(t.children=!0),o=>{o.on(`insert:${t.name}`,Y6(i,Dp(t)),{priority:e.converterPriority||"normal"}),(t.children||t.attributes.length)&&o.on("reduceChanges",Op(t),{priority:"low"})}}function d7(e){let t=Mp(e.model),i=ir(e.view,"container");return t.children=!0,o=>{if(o._conversionApi.schema.checkChild(t.name,"$text"))throw new p("conversion-element-to-structure-disallowed-text",o,{elementName:t.name});o.on(`insert:${t.name}`,X6(i,Dp(t)),{priority:e.converterPriority||"normal"}),o.on("reduceChanges",Op(t),{priority:"low"})}}function h7(e){e=Se(e);let t=e.model;typeof t=="string"&&(t={key:t});let i=`attribute:${t.key}`;if(t.name&&(i+=":"+t.name),t.values)for(let n of t.values)e.view[n]=ir(e.view[n],"attribute");else e.view=ir(e.view,"attribute");let o=Bp(e);return n=>{n.on(i,Q6(o),{priority:e.converterPriority||"normal"})}}function f7(e){e=Se(e);let t=e.model;typeof t=="string"&&(t={key:t});let i=`attribute:${t.key}`;if(t.name&&(i+=":"+t.name),t.values)for(let n of t.values)e.view[n]=Hg(e.view[n]);else e.view=Hg(e.view);let o=Bp(e);return n=>{n.on(i,r7(o),{priority:e.converterPriority||"normal"})}}function m7(e){let t=ir(e.view,"ui");return i=>{i.on(`addMarker:${e.model}`,e7(t),{priority:e.converterPriority||"normal"}),i.on(`removeMarker:${e.model}`,t7(),{priority:e.converterPriority||"normal"})}}function g7(e){e=Se(e);let t=e.model,i=e.view;return i||(i=o=>({group:t,name:o.substr(e.model.length+1)})),o=>{o.on(`addMarker:${t}`,i7(i),{priority:e.converterPriority||"normal"}),o.on(`removeMarker:${t}`,s7(i),{priority:e.converterPriority||"normal"})}}function p7(e){return t=>{t.on(`addMarker:${e.model}`,a7(e.view),{priority:e.converterPriority||"normal"}),t.on(`addMarker:${e.model}`,l7(e.view),{priority:e.converterPriority||"normal"}),t.on(`removeMarker:${e.model}`,c7(e.view),{priority:e.converterPriority||"normal"})}}function Mp(e){return typeof e=="string"&&(e={name:e}),{name:e.name,attributes:e.attributes?j(e.attributes):[],children:!!e.children}}function ir(e,t){return typeof e=="function"?e:((i,o)=>b7(e,o,t))}function b7(e,t,i){typeof e=="string"&&(e={name:e});let o,n=t.writer,s=Object.assign({},e.attributes);if(i=="container")o=n.createContainerElement(e.name,s);else if(i=="attribute"){let r={priority:e.priority||Pn.DEFAULT_PRIORITY};o=n.createAttributeElement(e.name,s,r)}else o=n.createUIElement(e.name,s);if(e.styles){let r=Object.keys(e.styles);for(let a of r)n.setStyle(a,e.styles[a],o)}if(e.classes){let r=e.classes;if(typeof r=="string")n.addClass(r,o);else for(let a of r)n.addClass(a,o)}return o}function Bp(e){return e.model.values?((t,i,o)=>{let n=e.view[t];return n?n(t,i,o):null}):e.view}function Hg(e){return typeof e=="string"?t=>({key:e,value:t}):typeof e=="object"?e.value?()=>e:t=>({key:e.key,value:t}):e}function kd(e,t,i){let o=typeof e=="function"?e(t,i):{...e};return o?(o.priority||(o.priority=10),o.id||(o.id=t.markerName),o):null}function w7(e){return(t,i)=>{if(!t.is("element",e.name))return!1;if(i.type=="attribute"){if(e.attributes.includes(i.attributeKey))return!0}else if(e.children)return!0;return!1}}function Op(e){let t=w7(e);return(i,o)=>{let n=[];o.reconvertedElements||(o.reconvertedElements=new Set);for(let s of o.changes){let r=s.type=="attribute"?s.range.start.nodeAfter:s.position.parent;if(!r||!t(r,s)||s.type=="reinsert"){n.push(s);continue}if(s.type=="insert"&&s.action=="rename"&&o.refreshedItems.add(s.position.nodeAfter),!o.reconvertedElements.has(r)){o.reconvertedElements.add(r);let a=A._createBefore(r),l=n.length;for(let c=n.length-1;c>=0;c--){let u=n[c],d=(u.type=="attribute"?u.range.start:u.position).compareWith(a);if(d=="before"||u.type=="remove"&&d=="same")break;l=c}n.splice(l,0,{type:"reinsert",name:r.name,position:a,length:1})}}o.changes=n}}function Dp(e){return(t,i,o={})=>{let n=["insert"];for(let s of e.attributes)t.hasAttribute(s)&&n.push(`attribute:${s}`);return n.every(s=>i.test(t,s))?(o.preflight||n.forEach(s=>i.consume(t,s)),!0):!1}}function y7(e,t,i){return(o,n)=>{let s=o.createContainerElement("$slot"),r;if(n==="children")r=Array.from(e.getChildren());else if(typeof n=="function")r=Array.from(e.getChildren()).filter(a=>n(a));else throw new p("conversion-slot-mode-unknown",i.dispatcher,{modeOrFilter:n});return t.set(s,r),s}}function _7(e,t,i){let o=Array.from(t.values()).flat(),n=new Set(o);if(n.size!=o.length)throw new p("conversion-slot-filter-overlap",i.dispatcher,{element:e});if(n.size!=e.childCount)throw new p("conversion-slot-filter-incomplete",i.dispatcher,{element:e})}function v7(e,t,i,o){i.mapper.on("modelToViewPosition",r,{priority:"highest"});let n=null,s=null;for([n,s]of t)Fp(e,s,i,o),i.writer.setCustomProperty("$structureSlotParent",!0,n.parent),i.writer.move(i.writer.createRangeIn(n),i.writer.createPositionBefore(n)),i.writer.remove(n);i.mapper.off("modelToViewPosition",r);function r(a,l){let c=l.modelPosition.nodeAfter,u=s.indexOf(c);u<0||(l.viewPosition=l.mapper.findPositionIn(n,u))}}function Fp(e,t,i,o){for(let n of t)k7(e.root,n,i,o)||i.convertItem(n)}function k7(e,t,i,o){let{writer:n,mapper:s}=i;if(!o.reconversion)return!1;let r=s.toViewElement(t);return!r||r.root==e||!i.canReuseView(r)?!1:(n.move(n.createRangeOn(r),s.toViewPosition(A._createBefore(t))),!0)}function C7(e,t,{preflight:i}={}){return i?t.test(e,"insert"):t.consume(e,"insert")}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Dp(e){let{schema:t,document:i}=e.model;for(let o of i.getRoots())if(o.isEmpty&&!t.checkChild(o,"$text")&&t.checkChild(o,"paragraph"))return e.insertElement("paragraph",o),!0;return!1}function rl(e,t,i){let o=i.createContext(e);return!(!i.checkChild(o,"paragraph")||!i.checkChild(o.push("paragraph"),t))}function Fp(e,t){let i=t.createElement("paragraph");return t.insert(i,e),t.createPositionAt(i,0)}/** +*/function Np(e){let{schema:t,document:i}=e.model;for(let o of i.getRoots())if(o.isEmpty&&!t.checkChild(o,"$text")&&t.checkChild(o,"paragraph"))return e.insertElement("paragraph",o),!0;return!1}function al(e,t,i){let o=i.createContext(e);return!(!i.checkChild(o,"paragraph")||!i.checkChild(o.push("paragraph"),t))}function zp(e,t){let i=t.createElement("paragraph");return t.insert(i,e),t.createPositionAt(i,0)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var k7=class extends Ep{elementToElement(e){return this.add(Np(e))}elementToAttribute(e){return this.add(T7(e))}attributeToAttribute(e){return this.add(E7(e))}elementToMarker(e){return this.add(A7(e))}dataToMarker(e){return this.add(I7(e))}};function zg(){return(e,t,i)=>{if(!t.modelRange&&i.consumable.consume(t.viewItem,{name:!0})){let{modelRange:o,modelCursor:n}=i.convertChildren(t.viewItem,t.modelCursor);t.modelRange=o,t.modelCursor=n}}}function C7(){return(e,t,{schema:i,consumable:o,writer:n})=>{let s=t.modelCursor;if(!o.test(t.viewItem))return;if(!i.checkChild(s,"$text")){if(!rl(s,"$text",i)||t.viewItem.data.trim().length==0)return;s=Fp(s,n)}o.consume(t.viewItem);let r=n.createText(t.viewItem.data);n.insert(r,s),t.modelRange=n.createRange(s,s.getShiftedBy(r.offsetSize)),t.modelCursor=t.modelRange.end}}function x7(e,t){return(i,o)=>{let n=o.newSelection,s=[];for(let a of n.getRanges())s.push(t.toModelRange(a));let r=e.createSelection(s,{backward:n.isBackward});r.isEqual(e.document.selection)||e.change(a=>{a.setSelection(r)})}}function Np(e){e=Ae(e);let t=rd(e),i=vd(e.view),o=i?`element:${i}`:"element";return n=>{n.on(o,t,{priority:e.converterPriority||"normal"})}}function T7(e){e=Ae(e),zp(e);let t=Hp(e,!1),i=vd(e.view),o=i?`element:${i}`:"element";return n=>{n.on(o,t,{priority:e.converterPriority||"low"})}}function E7(e){e=Ae(e);let t=null;(typeof e.view=="string"||e.view.key)&&(t=R7(e)),zp(e,t);let i=Hp(e,!0);return o=>{o.on("element",i,{priority:e.converterPriority||"low"})}}function A7(e){let t=M7(e.model);return Np({...e,model:t})}function I7(e){e=Ae(e),e.model||(e.model=n=>n?e.view+":"+n:e.view);let t={view:e.view,model:e.model},i=rd(Hg(t,"start")),o=rd(Hg(t,"end"));return n=>{n.on(`element:${e.view}-start`,i,{priority:e.converterPriority||"normal"}),n.on(`element:${e.view}-end`,o,{priority:e.converterPriority||"normal"});let s=le.low,r=le.highest,a=le.get(e.converterPriority)/r;n.on("element",S7(t),{priority:s+a})}}function S7(e){return(t,i,o)=>{let n=`data-${e.view}`;if(!o.consumable.test(i.viewItem,{attributes:n+"-end-after"})&&!o.consumable.test(i.viewItem,{attributes:n+"-start-after"})&&!o.consumable.test(i.viewItem,{attributes:n+"-end-before"})&&!o.consumable.test(i.viewItem,{attributes:n+"-start-before"}))return;i.modelRange||Object.assign(i,o.convertChildren(i.viewItem,i.modelCursor)),o.consumable.consume(i.viewItem,{attributes:n+"-end-after"})&&s(i.modelRange.end,i.viewItem.getAttribute(n+"-end-after").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-start-after"})&&s(i.modelRange.end,i.viewItem.getAttribute(n+"-start-after").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-end-before"})&&s(i.modelRange.start,i.viewItem.getAttribute(n+"-end-before").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-start-before"})&&s(i.modelRange.start,i.viewItem.getAttribute(n+"-start-before").split(","));function s(r,a){for(let l of a){let c=e.model(l,o),u=o.writer.createElement("$marker",{"data-name":c});o.writer.insert(u,r),i.modelCursor.isEqual(r)?i.modelCursor=i.modelCursor.getShiftedBy(1):i.modelCursor=i.modelCursor._getTransformedByInsertion(r,1),i.modelRange=i.modelRange._getTransformedByInsertion(r,1)[0]}}}}function vd(e){return typeof e=="string"?e:typeof e=="object"&&typeof e.name=="string"?e.name:null}function rd(e){let t=new We(e.view);return(i,o,n)=>{let s=t.match(o.viewItem);if(!s)return;let r=s.match;if(r.name=!0,!n.consumable.test(o.viewItem,r))return;let a=P7(e.model,o.viewItem,n);a&&n.safeInsert(a,o.modelCursor)&&(n.consumable.consume(o.viewItem,r),n.convertChildren(o.viewItem,a),n.updateConversionResult(a,o))}}function P7(e,t,i){return e instanceof Function?e(t,i):i.writer.createElement(e)}function R7(e){typeof e.view=="string"&&(e.view={key:e.view});let t=e.view.key,i=typeof e.view.value>"u"?/[\s\S]*/:e.view.value,o;return t=="class"||t=="style"?o={[t=="class"?"classes":"styles"]:i}:o={attributes:{[t]:i}},e.view.name&&(o.name=e.view.name),e.view=o,t}function zp(e,t=null){let i=t===null?!0:o=>o.getAttribute(t);e.model={key:typeof e.model!="object"?e.model:e.model.key,value:typeof e.model!="object"||typeof e.model.value>"u"?i:e.model.value}}function Hp(e,t){let i=new We(e.view);return(o,n,s)=>{if(!n.modelRange&&t)return;let r=i.match(n.viewItem);if(!r||(V7(e.view,n.viewItem)?r.match.name=!0:delete r.match.name,!s.consumable.test(n.viewItem,r.match)))return;let a=e.model.key,l=typeof e.model.value=="function"?e.model.value(n.viewItem,s,n):e.model.value;l!=null&&(n.modelRange||Object.assign(n,s.convertChildren(n.viewItem,n.modelCursor)),L7(n.modelRange,{key:a,value:l},t,s)&&(s.consumable.test(n.viewItem,{name:!0})&&(r.match.name=!0),s.consumable.consume(n.viewItem,r.match)))}}function V7(e,t){let i=typeof e=="function"?e(t):e;return typeof i=="object"&&!vd(i)?!1:!i.classes&&!i.attributes&&!i.styles}function L7(e,t,i,o){let n=!1;for(let s of Array.from(e.getItems({shallow:i})))o.schema.checkAttribute(s,t.key)&&(n=!0,!s.hasAttribute(t.key)&&o.writer.setAttribute(t.key,t.value,s));return n}function M7(e){return(t,i)=>{let o=typeof e=="string"?e:e(t,i);return i.writer.createElement("$marker",{"data-name":o})}}function Hg(e,t){let i=(o,n)=>{let s=o.getAttribute("name"),r=e.model(s,n);return n.writer.createElement("$marker",{"data-name":r})};return{view:`${e.view}-${t}`,model:i}}/** +*/var x7=class extends Ip{elementToElement(e){return this.add(Hp(e))}elementToAttribute(e){return this.add(A7(e))}attributeToAttribute(e){return this.add(I7(e))}elementToMarker(e){return this.add(S7(e))}dataToMarker(e){return this.add(P7(e))}};function Wg(){return(e,t,i)=>{if(!t.modelRange&&i.consumable.consume(t.viewItem,{name:!0})){let{modelRange:o,modelCursor:n}=i.convertChildren(t.viewItem,t.modelCursor);t.modelRange=o,t.modelCursor=n}}}function T7(){return(e,t,{schema:i,consumable:o,writer:n})=>{let s=t.modelCursor;if(!o.test(t.viewItem))return;if(!i.checkChild(s,"$text")){if(!al(s,"$text",i)||t.viewItem.data.trim().length==0)return;s=zp(s,n)}o.consume(t.viewItem);let r=n.createText(t.viewItem.data);n.insert(r,s),t.modelRange=n.createRange(s,s.getShiftedBy(r.offsetSize)),t.modelCursor=t.modelRange.end}}function E7(e,t){return(i,o)=>{let n=o.newSelection,s=[];for(let a of n.getRanges())s.push(t.toModelRange(a));let r=e.createSelection(s,{backward:n.isBackward});r.isEqual(e.document.selection)||e.change(a=>{a.setSelection(r)})}}function Hp(e){e=Se(e);let t=ld(e),i=Cd(e.view),o=i?`element:${i}`:"element";return n=>{n.on(o,t,{priority:e.converterPriority||"normal"})}}function A7(e){e=Se(e),Wp(e);let t=Up(e,!1),i=Cd(e.view),o=i?`element:${i}`:"element";return n=>{n.on(o,t,{priority:e.converterPriority||"low"})}}function I7(e){e=Se(e);let t=null;(typeof e.view=="string"||e.view.key)&&(t=L7(e)),Wp(e,t);let i=Up(e,!0);return o=>{o.on("element",i,{priority:e.converterPriority||"low"})}}function S7(e){let t=O7(e.model);return Hp({...e,model:t})}function P7(e){e=Se(e),e.model||(e.model=n=>n?e.view+":"+n:e.view);let t={view:e.view,model:e.model},i=ld(Ug(t,"start")),o=ld(Ug(t,"end"));return n=>{n.on(`element:${e.view}-start`,i,{priority:e.converterPriority||"normal"}),n.on(`element:${e.view}-end`,o,{priority:e.converterPriority||"normal"});let s=le.low,r=le.highest,a=le.get(e.converterPriority)/r;n.on("element",R7(t),{priority:s+a})}}function R7(e){return(t,i,o)=>{let n=`data-${e.view}`;if(!o.consumable.test(i.viewItem,{attributes:n+"-end-after"})&&!o.consumable.test(i.viewItem,{attributes:n+"-start-after"})&&!o.consumable.test(i.viewItem,{attributes:n+"-end-before"})&&!o.consumable.test(i.viewItem,{attributes:n+"-start-before"}))return;i.modelRange||Object.assign(i,o.convertChildren(i.viewItem,i.modelCursor)),o.consumable.consume(i.viewItem,{attributes:n+"-end-after"})&&s(i.modelRange.end,i.viewItem.getAttribute(n+"-end-after").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-start-after"})&&s(i.modelRange.end,i.viewItem.getAttribute(n+"-start-after").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-end-before"})&&s(i.modelRange.start,i.viewItem.getAttribute(n+"-end-before").split(",")),o.consumable.consume(i.viewItem,{attributes:n+"-start-before"})&&s(i.modelRange.start,i.viewItem.getAttribute(n+"-start-before").split(","));function s(r,a){for(let l of a){let c=e.model(l,o),u=o.writer.createElement("$marker",{"data-name":c});o.writer.insert(u,r),i.modelCursor.isEqual(r)?i.modelCursor=i.modelCursor.getShiftedBy(1):i.modelCursor=i.modelCursor._getTransformedByInsertion(r,1),i.modelRange=i.modelRange._getTransformedByInsertion(r,1)[0]}}}}function Cd(e){return typeof e=="string"?e:typeof e=="object"&&typeof e.name=="string"?e.name:null}function ld(e){let t=new We(e.view);return(i,o,n)=>{let s=t.match(o.viewItem);if(!s)return;let r=s.match;if(r.name=!0,!n.consumable.test(o.viewItem,r))return;let a=V7(e.model,o.viewItem,n);a&&n.safeInsert(a,o.modelCursor)&&(n.consumable.consume(o.viewItem,r),n.convertChildren(o.viewItem,a),n.updateConversionResult(a,o))}}function V7(e,t,i){return e instanceof Function?e(t,i):i.writer.createElement(e)}function L7(e){typeof e.view=="string"&&(e.view={key:e.view});let t=e.view.key,i=typeof e.view.value>"u"?/[\s\S]*/:e.view.value,o;return t=="class"||t=="style"?o={[t=="class"?"classes":"styles"]:i}:o={attributes:{[t]:i}},e.view.name&&(o.name=e.view.name),e.view=o,t}function Wp(e,t=null){let i=t===null?!0:o=>o.getAttribute(t);e.model={key:typeof e.model!="object"?e.model:e.model.key,value:typeof e.model!="object"||typeof e.model.value>"u"?i:e.model.value}}function Up(e,t){let i=new We(e.view);return(o,n,s)=>{if(!n.modelRange&&t)return;let r=i.match(n.viewItem);if(!r||(M7(e.view,n.viewItem)?r.match.name=!0:delete r.match.name,!s.consumable.test(n.viewItem,r.match)))return;let a=e.model.key,l=typeof e.model.value=="function"?e.model.value(n.viewItem,s,n):e.model.value;l!=null&&(n.modelRange||Object.assign(n,s.convertChildren(n.viewItem,n.modelCursor)),B7(n.modelRange,{key:a,value:l},t,s)&&(s.consumable.test(n.viewItem,{name:!0})&&(r.match.name=!0),s.consumable.consume(n.viewItem,r.match)))}}function M7(e,t){let i=typeof e=="function"?e(t):e;return typeof i=="object"&&!Cd(i)?!1:!i.classes&&!i.attributes&&!i.styles}function B7(e,t,i,o){let n=!1;for(let s of Array.from(e.getItems({shallow:i})))o.schema.checkAttribute(s,t.key)&&(n=!0,!s.hasAttribute(t.key)&&o.writer.setAttribute(t.key,t.value,s));return n}function O7(e){return(t,i)=>{let o=typeof e=="string"?e:e(t,i);return i.writer.createElement("$marker",{"data-name":o})}}function Ug(e,t){let i=(o,n)=>{let s=o.getAttribute("name"),r=e.model(s,n);return n.writer.createElement("$marker",{"data-name":r})};return{view:`${e.view}-${t}`,model:i}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var B7=W(),Wp=class extends B7{model;view;mapper;downcastDispatcher;constructor(e,t){super(),this.model=e,this.view=new y6(t),this.mapper=new vp,this.downcastDispatcher=new kp({mapper:this.mapper,schema:e.schema});let i=this.model.document,o=i.selection,n=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(s=>{this.downcastDispatcher.convertChanges(i.differ,n,s),this.downcastDispatcher.convertSelection(o,n,s)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",x7(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",Ap(),{priority:"lowest"}),this.downcastDispatcher.on("insert",Ip(),{priority:"lowest"}),this.downcastDispatcher.on("remove",$6(),{priority:"low"}),this.downcastDispatcher.on("cleanSelection",G6()),this.downcastDispatcher.on("selection",j6(),{priority:"low"}),this.downcastDispatcher.on("selection",K6(),{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(s=>{if(s.rootName=="$graveyard")return null;let r=new dp(this.view.document,s.name);return r.rootName=s.rootName,this.mapper.bindElements(s,r),r})}destroy(){this.view.destroy(),this.stopListening()}reconvertMarker(e){let t=typeof e=="string"?e:e.name,i=this.model.markers.get(t);if(!i)throw new p("editingcontroller-reconvertmarker-marker-not-exist",this,{markerName:t});this.model.change(()=>{this.model.markers._refresh(i)})}reconvertItem(e){this.model.change(()=>{this.model.document.differ._refreshItem(e)})}};/** +*/var D7=W(),qp=class extends D7{model;view;mapper;downcastDispatcher;constructor(e,t){super(),this.model=e,this.view=new v6(t),this.mapper=new Cp,this.downcastDispatcher=new xp({mapper:this.mapper,schema:e.schema});let i=this.model.document,o=i.selection,n=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(s=>{this.downcastDispatcher.convertChanges(i.differ,n,s),this.downcastDispatcher.convertSelection(o,n,s)})},{priority:"low"}),this.listenTo(this.view.document,"selectionChange",E7(this.model,this.mapper)),this.downcastDispatcher.on("insert:$text",Sp(),{priority:"lowest"}),this.downcastDispatcher.on("insert",Pp(),{priority:"lowest"}),this.downcastDispatcher.on("remove",K6(),{priority:"low"}),this.downcastDispatcher.on("cleanSelection",Z6()),this.downcastDispatcher.on("selection",G6(),{priority:"low"}),this.downcastDispatcher.on("selection",J6(),{priority:"low"}),this.view.document.roots.bindTo(this.model.document.roots).using(s=>{if(s.rootName=="$graveyard")return null;let r=new fp(this.view.document,s.name);return r.rootName=s.rootName,this.mapper.bindElements(s,r),r})}destroy(){this.view.destroy(),this.stopListening()}reconvertMarker(e){let t=typeof e=="string"?e:e.name,i=this.model.markers.get(t);if(!i)throw new p("editingcontroller-reconvertmarker-marker-not-exist",this,{markerName:t});this.model.change(()=>{this.model.markers._refresh(i)})}reconvertItem(e){this.model.change(()=>{this.model.document.differ._refreshItem(e)})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var O7=W(),D7=class extends O7{_sourceDefinitions={};_attributeProperties=Object.create(null);_customChildChecks=new Map;_customAttributeChecks=new Map;_genericCheckSymbol=Symbol("$generic");_compiledDefinitions;constructor(){super(),this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(e,t)=>{t[0]=new Rn(t[0])},{priority:"highest"}),this.on("checkChild",(e,t)=>{t[0]=new Rn(t[0]),t[1]=this.getDefinition(t[1])},{priority:"highest"})}register(e,t){if(this._sourceDefinitions[e])throw new p("schema-cannot-register-item-twice",this,{itemName:e});this._sourceDefinitions[e]=[Object.assign({},t)],this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e])throw new p("schema-cannot-extend-missing-item",this,{itemName:e});this._sourceDefinitions[e].push(Object.assign({},t)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(e){let t;return typeof e=="string"?t=e:"is"in e&&(e.is("$text")||e.is("$textProxy"))?t="$text":t=e.name,this.getDefinitions()[t]}isRegistered(e){return!!this.getDefinition(e)}isBlock(e){let t=this.getDefinition(e);return!!(t&&t.isBlock)}isLimit(e){let t=this.getDefinition(e);return t?!!(t.isLimit||t.isObject):!1}isObject(e){let t=this.getDefinition(e);return t?!!(t.isObject||t.isLimit&&t.isSelectable&&t.isContent):!1}isInline(e){let t=this.getDefinition(e);return!!(t&&t.isInline)}isSelectable(e){let t=this.getDefinition(e);return t?!!(t.isSelectable||t.isObject):!1}isContent(e){let t=this.getDefinition(e);return t?!!(t.isContent||t.isObject):!1}checkChild(e,t){return t?this._checkContextMatch(e,t):!1}checkAttribute(e,t){let i=this.getDefinition(e.last);if(!i)return!1;let o=this._evaluateAttributeChecks(e,t);return o!==void 0?o:i.allowAttributes.includes(t)}checkMerge(e,t){if(e instanceof A){let i=e.nodeBefore,o=e.nodeAfter;if(!(i instanceof ie))throw new p("schema-check-merge-no-element-before",this);if(!(o instanceof ie))throw new p("schema-check-merge-no-element-after",this);return this.checkMerge(i,o)}if(this.isLimit(e)||this.isLimit(t))return!1;for(let i of t.getChildren())if(!this.checkChild(e,i))return!1;return!0}addChildCheck(e,t){let i=t!==void 0?t:this._genericCheckSymbol,o=this._customChildChecks.get(i)||[];o.push(e),this._customChildChecks.set(i,o)}addAttributeCheck(e,t){let i=t!==void 0?t:this._genericCheckSymbol,o=this._customAttributeChecks.get(i)||[];o.push(e),this._customAttributeChecks.set(i,o)}setAttributeProperties(e,t){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),t)}getAttributeProperties(e){return this._attributeProperties[e]||Object.create(null)}getLimitElement(e){let t;for(e instanceof A?t=e.parent:t=(e instanceof T?[e]:Array.from(e.getRanges())).reduce((i,o)=>{let n=o.getCommonAncestor();return i?i.getCommonAncestor(n,{includeSelf:!0}):n},null);!this.isLimit(t)&&t.parent;)t=t.parent;return t}checkAttributeInSelection(e,t){if(e.isCollapsed){let i=[...e.getFirstPosition().getAncestors(),new ce("",e.getAttributes())];return this.checkAttribute(i,t)}else{let i=e.getRanges();for(let o of i)for(let n of o)if(this.checkAttribute(n.item,t))return!0}return!1}*getValidRanges(e,t,i={}){e=X7(e);for(let o of e)yield*this._getValidRangesForRange(o,t,i)}getNearestSelectionRange(e,t="both"){if(e.root.rootName=="$graveyard")return null;if(this.checkChild(e,"$text"))return new T(e);let i,o,n=e.getAncestors().reverse().find(s=>this.isLimit(s))||e.root;(t=="both"||t=="backward")&&(i=new Pt({boundaries:T._createIn(n),startPosition:e,direction:"backward"})),(t=="both"||t=="forward")&&(o=new Pt({boundaries:T._createIn(n),startPosition:e}));for(let s of Y7(i,o)){let r=s.walker==i?"elementEnd":"elementStart",a=s.value;if(a.type==r&&this.isObject(a.item))return T._createOn(a.item);if(this.checkChild(a.nextPosition,"$text"))return new T(a.nextPosition)}return null}findAllowedParent(e,t){let i=e.parent;for(;i;){if(this.checkChild(i,t))return i;if(this.isLimit(i))return null;i=i.parent}return null}setAllowedAttributes(e,t,i){let o=i.model;for(let[n,s]of Object.entries(t))o.schema.checkAttribute(e,n)&&i.setAttribute(n,s,e)}removeDisallowedAttributes(e,t){for(let i of e)if(i.is("$text"))Wg(this,i,t);else{let o=T._createIn(i).getPositions();for(let n of o){let s=n.nodeBefore||n.parent;Wg(this,s,t)}}}getAttributesWithProperty(e,t,i){let o={};for(let[n,s]of e.getAttributes()){let r=this.getAttributeProperties(n);r[t]!==void 0&&(i===void 0||i===r[t])&&(o[n]=s)}return o}createContext(e){return new Rn(e)}_clearCache(){this._compiledDefinitions=null}_compile(){let e={},t=this._sourceDefinitions,i=Object.keys(t);for(let n of i)e[n]=F7(t[n],n);let o=Object.values(e);for(let n of o)N7(e,n),z7(e,n),H7(e,n),W7(e,n);for(let n of o)U7(e,n);for(let n of o)q7(e,n);for(let n of o)$7(e,n);for(let n of o)K7(e,n);for(let n of o)G7(e,n);this._compiledDefinitions=j7(e)}_checkContextMatch(e,t){let i=e.last,o=this._evaluateChildChecks(e,t);if(o=o!==void 0?o:t.allowIn.includes(i.name),!o)return!1;let n=this.getDefinition(i),s=e.trimLast();return n?s.length==0?!0:this._checkContextMatch(s,n):!1}_evaluateChildChecks(e,t){let i=this._customChildChecks.get(this._genericCheckSymbol)||[],o=this._customChildChecks.get(t.name)||[];for(let n of[...i,...o]){let s=n(e,t);if(s!==void 0)return s}}_evaluateAttributeChecks(e,t){let i=this._customAttributeChecks.get(this._genericCheckSymbol)||[],o=this._customAttributeChecks.get(t)||[];for(let n of[...i,...o]){let s=n(e,t);if(s!==void 0)return s}}*_getValidRangesForRange(e,t,i){let o=e.start,n=e.start;for(let s of e.getItems({shallow:!0})){if(s.is("element"))if(i.includeEmptyRanges&&s.isEmpty){let r=this.createContext(s);this.checkChild(r,"$text")&&this.checkAttribute(r.push("$text"),t)&&(yield T._createIn(s))}else yield*this._getValidRangesForRange(T._createIn(s),t,i);this.checkAttribute(s,t)||(o.isEqual(n)||(yield new T(o,n)),o=A._createAfter(s)),n=A._createAfter(s)}o.isEqual(n)||(yield new T(o,n))}findOptimalInsertionRange(e,t){let i=e.getSelectedElement();if(i&&this.isObject(i)&&!this.isInline(i))return t=="before"||t=="after"?new T(A._createAt(i,t)):T._createOn(i);let o=G(e.getSelectedBlocks());if(!o)return new T(e.focus);if(o.isEmpty)return new T(A._createAt(o,0));let n=A._createAfter(o);return e.focus.isTouching(n)?new T(n):new T(A._createBefore(o))}},Rn=class Za{_items;constructor(t){if(t instanceof Za)return t;let i;typeof t=="string"?i=[t]:Array.isArray(t)?i=t:i=t.getAncestors({includeSelf:!0}),this._items=i.map(Q7)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(t){let i=new Za([t]);return i._items=[...this._items,...i._items],i}trimLast(){let t=new Za([]);return t._items=this._items.slice(0,-1),t}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 F7(e,t){let i={name:t,allowIn:new Set,allowChildren:new Set,disallowIn:new Set,disallowChildren:new Set,allowContentOf:new Set,allowWhere:new Set,allowAttributes:new Set,disallowAttributes:new Set,allowAttributesOf:new Set,inheritTypesFrom:new Set};return J7(e,i),Kt(e,i,"allowIn"),Kt(e,i,"allowChildren"),Kt(e,i,"disallowIn"),Kt(e,i,"disallowChildren"),Kt(e,i,"allowContentOf"),Kt(e,i,"allowWhere"),Kt(e,i,"allowAttributes"),Kt(e,i,"disallowAttributes"),Kt(e,i,"allowAttributesOf"),Kt(e,i,"inheritTypesFrom"),Z7(e,i),i}function N7(e,t){for(let i of t.allowIn){let o=e[i];o?o.allowChildren.add(t.name):t.allowIn.delete(i)}}function z7(e,t){for(let i of t.allowChildren){let o=e[i];o?o.allowIn.add(t.name):t.allowChildren.delete(i)}}function H7(e,t){for(let i of t.disallowIn){let o=e[i];o?o.disallowChildren.add(t.name):t.disallowIn.delete(i)}}function W7(e,t){for(let i of t.disallowChildren){let o=e[i];o?o.disallowIn.add(t.name):t.disallowChildren.delete(i)}}function U7(e,t){for(let i of t.disallowChildren)t.allowChildren.delete(i);for(let i of t.disallowIn)t.allowIn.delete(i);for(let i of t.disallowAttributes)t.allowAttributes.delete(i)}function q7(e,t){for(let i of t.allowContentOf){let o=e[i];o&&(o.disallowChildren.forEach(n=>{t.allowChildren.has(n)||(t.disallowChildren.add(n),e[n].disallowIn.add(t.name))}),o.allowChildren.forEach(n=>{t.disallowChildren.has(n)||(t.allowChildren.add(n),e[n].allowIn.add(t.name))}))}}function $7(e,t){for(let i of t.allowWhere){let o=e[i];o&&(o.disallowIn.forEach(n=>{t.allowIn.has(n)||(t.disallowIn.add(n),e[n].disallowChildren.add(t.name))}),o.allowIn.forEach(n=>{t.disallowIn.has(n)||(t.allowIn.add(n),e[n].allowChildren.add(t.name))}))}}function j7(e){let t={};for(let i of Object.values(e))t[i.name]={name:i.name,isBlock:!!i.isBlock,isContent:!!i.isContent,isInline:!!i.isInline,isLimit:!!i.isLimit,isObject:!!i.isObject,isSelectable:!!i.isSelectable,allowIn:Array.from(i.allowIn).filter(o=>!!e[o]),allowChildren:Array.from(i.allowChildren).filter(o=>!!e[o]),allowAttributes:Array.from(i.allowAttributes)};return t}function K7(e,t){for(let i of t.allowAttributesOf){let o=e[i];if(!o)return;o.allowAttributes.forEach(n=>{t.disallowAttributes.has(n)||t.allowAttributes.add(n)})}}function G7(e,t){for(let i of t.inheritTypesFrom){let o=e[i];if(o){let n=Object.keys(o).filter(s=>s.startsWith("is"));for(let s of n)s in t||(t[s]=o[s])}}}function J7(e,t){for(let i of e){let o=Object.keys(i).filter(n=>n.startsWith("is"));for(let n of o)t[n]=!!i[n]}}function Kt(e,t,i){for(let o of e){let n=o[i];typeof n=="string"&&(n=[n]),Array.isArray(n)&&n.forEach(s=>t[i].add(s))}}function Z7(e,t){for(let i of e){let o=i.inheritAllFrom;o&&(t.allowContentOf.add(o),t.allowWhere.add(o),t.allowAttributesOf.add(o),t.inheritTypesFrom.add(o))}}function Q7(e){return typeof e=="string"||e.is("documentFragment")?{name:typeof e=="string"?e:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:e.is("element")?e.name:"$text",*getAttributeKeys(){yield*e.getAttributeKeys()},getAttribute(t){return e.getAttribute(t)}}}function*Y7(e,t){let i=!1;for(;!i;){if(i=!0,e){let o=e.next();o.done||(i=!1,yield{walker:e,value:o.value})}if(t){let o=t.next();o.done||(i=!1,yield{walker:t,value:o.value})}}}function*X7(e){for(let t of e)yield*t.getMinimalFlatRanges()}function Wg(e,t,i){for(let o of t.getAttributeKeys())e.checkAttribute(t,o)||i.removeAttribute(o,t)}/** +*/var F7=W(),N7=class extends F7{_sourceDefinitions={};_attributeProperties=Object.create(null);_customChildChecks=new Map;_customAttributeChecks=new Map;_genericCheckSymbol=Symbol("$generic");_compiledDefinitions;constructor(){super(),this.decorate("checkChild"),this.decorate("checkAttribute"),this.on("checkAttribute",(e,t)=>{t[0]=new Rn(t[0])},{priority:"highest"}),this.on("checkChild",(e,t)=>{t[0]=new Rn(t[0]),t[1]=this.getDefinition(t[1])},{priority:"highest"})}register(e,t){if(this._sourceDefinitions[e])throw new p("schema-cannot-register-item-twice",this,{itemName:e});this._sourceDefinitions[e]=[Object.assign({},t)],this._clearCache()}extend(e,t){if(!this._sourceDefinitions[e])throw new p("schema-cannot-extend-missing-item",this,{itemName:e});this._sourceDefinitions[e].push(Object.assign({},t)),this._clearCache()}getDefinitions(){return this._compiledDefinitions||this._compile(),this._compiledDefinitions}getDefinition(e){let t;return typeof e=="string"?t=e:"is"in e&&(e.is("$text")||e.is("$textProxy"))?t="$text":t=e.name,this.getDefinitions()[t]}isRegistered(e){return!!this.getDefinition(e)}isBlock(e){let t=this.getDefinition(e);return!!(t&&t.isBlock)}isLimit(e){let t=this.getDefinition(e);return t?!!(t.isLimit||t.isObject):!1}isObject(e){let t=this.getDefinition(e);return t?!!(t.isObject||t.isLimit&&t.isSelectable&&t.isContent):!1}isInline(e){let t=this.getDefinition(e);return!!(t&&t.isInline)}isSelectable(e){let t=this.getDefinition(e);return t?!!(t.isSelectable||t.isObject):!1}isContent(e){let t=this.getDefinition(e);return t?!!(t.isContent||t.isObject):!1}checkChild(e,t){return t?this._checkContextMatch(e,t):!1}checkAttribute(e,t){let i=this.getDefinition(e.last);if(!i)return!1;let o=this._evaluateAttributeChecks(e,t);return o!==void 0?o:i.allowAttributes.includes(t)}checkMerge(e,t){if(e instanceof A){let i=e.nodeBefore,o=e.nodeAfter;if(!(i instanceof ie))throw new p("schema-check-merge-no-element-before",this);if(!(o instanceof ie))throw new p("schema-check-merge-no-element-after",this);return this.checkMerge(i,o)}if(this.isLimit(e)||this.isLimit(t))return!1;for(let i of t.getChildren())if(!this.checkChild(e,i))return!1;return!0}addChildCheck(e,t){let i=t!==void 0?t:this._genericCheckSymbol,o=this._customChildChecks.get(i)||[];o.push(e),this._customChildChecks.set(i,o)}addAttributeCheck(e,t){let i=t!==void 0?t:this._genericCheckSymbol,o=this._customAttributeChecks.get(i)||[];o.push(e),this._customAttributeChecks.set(i,o)}setAttributeProperties(e,t){this._attributeProperties[e]=Object.assign(this.getAttributeProperties(e),t)}getAttributeProperties(e){return this._attributeProperties[e]||Object.create(null)}getLimitElement(e){let t;for(e instanceof A?t=e.parent:t=(e instanceof T?[e]:Array.from(e.getRanges())).reduce((i,o)=>{let n=o.getCommonAncestor();return i?i.getCommonAncestor(n,{includeSelf:!0}):n},null);!this.isLimit(t)&&t.parent;)t=t.parent;return t}checkAttributeInSelection(e,t){if(e.isCollapsed){let i=[...e.getFirstPosition().getAncestors(),new ce("",e.getAttributes())];return this.checkAttribute(i,t)}else{let i=e.getRanges();for(let o of i)for(let n of o)if(this.checkAttribute(n.item,t))return!0}return!1}*getValidRanges(e,t,i={}){e=tC(e);for(let o of e)yield*this._getValidRangesForRange(o,t,i)}getNearestSelectionRange(e,t="both"){if(e.root.rootName=="$graveyard")return null;if(this.checkChild(e,"$text"))return new T(e);let i,o,n=e.getAncestors().reverse().find(s=>this.isLimit(s))||e.root;(t=="both"||t=="backward")&&(i=new Rt({boundaries:T._createIn(n),startPosition:e,direction:"backward"})),(t=="both"||t=="forward")&&(o=new Rt({boundaries:T._createIn(n),startPosition:e}));for(let s of eC(i,o)){let r=s.walker==i?"elementEnd":"elementStart",a=s.value;if(a.type==r&&this.isObject(a.item))return T._createOn(a.item);if(this.checkChild(a.nextPosition,"$text"))return new T(a.nextPosition)}return null}findAllowedParent(e,t){let i=e.parent;for(;i;){if(this.checkChild(i,t))return i;if(this.isLimit(i))return null;i=i.parent}return null}setAllowedAttributes(e,t,i){let o=i.model;for(let[n,s]of Object.entries(t))o.schema.checkAttribute(e,n)&&i.setAttribute(n,s,e)}removeDisallowedAttributes(e,t){for(let i of e)if(i.is("$text"))qg(this,i,t);else{let o=T._createIn(i).getPositions();for(let n of o){let s=n.nodeBefore||n.parent;qg(this,s,t)}}}getAttributesWithProperty(e,t,i){let o={};for(let[n,s]of e.getAttributes()){let r=this.getAttributeProperties(n);r[t]!==void 0&&(i===void 0||i===r[t])&&(o[n]=s)}return o}createContext(e){return new Rn(e)}_clearCache(){this._compiledDefinitions=null}_compile(){let e={},t=this._sourceDefinitions,i=Object.keys(t);for(let n of i)e[n]=z7(t[n],n);let o=Object.values(e);for(let n of o)H7(e,n),W7(e,n),U7(e,n),q7(e,n);for(let n of o)$7(e,n);for(let n of o)j7(e,n);for(let n of o)K7(e,n);for(let n of o)J7(e,n);for(let n of o)Z7(e,n);this._compiledDefinitions=G7(e)}_checkContextMatch(e,t){let i=e.last,o=this._evaluateChildChecks(e,t);if(o=o!==void 0?o:t.allowIn.includes(i.name),!o)return!1;let n=this.getDefinition(i),s=e.trimLast();return n?s.length==0?!0:this._checkContextMatch(s,n):!1}_evaluateChildChecks(e,t){let i=this._customChildChecks.get(this._genericCheckSymbol)||[],o=this._customChildChecks.get(t.name)||[];for(let n of[...i,...o]){let s=n(e,t);if(s!==void 0)return s}}_evaluateAttributeChecks(e,t){let i=this._customAttributeChecks.get(this._genericCheckSymbol)||[],o=this._customAttributeChecks.get(t)||[];for(let n of[...i,...o]){let s=n(e,t);if(s!==void 0)return s}}*_getValidRangesForRange(e,t,i){let o=e.start,n=e.start;for(let s of e.getItems({shallow:!0})){if(s.is("element"))if(i.includeEmptyRanges&&s.isEmpty){let r=this.createContext(s);this.checkChild(r,"$text")&&this.checkAttribute(r.push("$text"),t)&&(yield T._createIn(s))}else yield*this._getValidRangesForRange(T._createIn(s),t,i);this.checkAttribute(s,t)||(o.isEqual(n)||(yield new T(o,n)),o=A._createAfter(s)),n=A._createAfter(s)}o.isEqual(n)||(yield new T(o,n))}findOptimalInsertionRange(e,t){let i=e.getSelectedElement();if(i&&this.isObject(i)&&!this.isInline(i))return t=="before"||t=="after"?new T(A._createAt(i,t)):T._createOn(i);let o=J(e.getSelectedBlocks());if(!o)return new T(e.focus);if(o.isEmpty)return new T(A._createAt(o,0));let n=A._createAfter(o);return e.focus.isTouching(n)?new T(n):new T(A._createBefore(o))}},Rn=class Qa{_items;constructor(t){if(t instanceof Qa)return t;let i;typeof t=="string"?i=[t]:Array.isArray(t)?i=t:i=t.getAncestors({includeSelf:!0}),this._items=i.map(X7)}get length(){return this._items.length}get last(){return this._items[this._items.length-1]}[Symbol.iterator](){return this._items[Symbol.iterator]()}push(t){let i=new Qa([t]);return i._items=[...this._items,...i._items],i}trimLast(){let t=new Qa([]);return t._items=this._items.slice(0,-1),t}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 z7(e,t){let i={name:t,allowIn:new Set,allowChildren:new Set,disallowIn:new Set,disallowChildren:new Set,allowContentOf:new Set,allowWhere:new Set,allowAttributes:new Set,disallowAttributes:new Set,allowAttributesOf:new Set,inheritTypesFrom:new Set};return Q7(e,i),Jt(e,i,"allowIn"),Jt(e,i,"allowChildren"),Jt(e,i,"disallowIn"),Jt(e,i,"disallowChildren"),Jt(e,i,"allowContentOf"),Jt(e,i,"allowWhere"),Jt(e,i,"allowAttributes"),Jt(e,i,"disallowAttributes"),Jt(e,i,"allowAttributesOf"),Jt(e,i,"inheritTypesFrom"),Y7(e,i),i}function H7(e,t){for(let i of t.allowIn){let o=e[i];o?o.allowChildren.add(t.name):t.allowIn.delete(i)}}function W7(e,t){for(let i of t.allowChildren){let o=e[i];o?o.allowIn.add(t.name):t.allowChildren.delete(i)}}function U7(e,t){for(let i of t.disallowIn){let o=e[i];o?o.disallowChildren.add(t.name):t.disallowIn.delete(i)}}function q7(e,t){for(let i of t.disallowChildren){let o=e[i];o?o.disallowIn.add(t.name):t.disallowChildren.delete(i)}}function $7(e,t){for(let i of t.disallowChildren)t.allowChildren.delete(i);for(let i of t.disallowIn)t.allowIn.delete(i);for(let i of t.disallowAttributes)t.allowAttributes.delete(i)}function j7(e,t){for(let i of t.allowContentOf){let o=e[i];o&&(o.disallowChildren.forEach(n=>{t.allowChildren.has(n)||(t.disallowChildren.add(n),e[n].disallowIn.add(t.name))}),o.allowChildren.forEach(n=>{t.disallowChildren.has(n)||(t.allowChildren.add(n),e[n].allowIn.add(t.name))}))}}function K7(e,t){for(let i of t.allowWhere){let o=e[i];o&&(o.disallowIn.forEach(n=>{t.allowIn.has(n)||(t.disallowIn.add(n),e[n].disallowChildren.add(t.name))}),o.allowIn.forEach(n=>{t.disallowIn.has(n)||(t.allowIn.add(n),e[n].allowChildren.add(t.name))}))}}function G7(e){let t={};for(let i of Object.values(e))t[i.name]={name:i.name,isBlock:!!i.isBlock,isContent:!!i.isContent,isInline:!!i.isInline,isLimit:!!i.isLimit,isObject:!!i.isObject,isSelectable:!!i.isSelectable,allowIn:Array.from(i.allowIn).filter(o=>!!e[o]),allowChildren:Array.from(i.allowChildren).filter(o=>!!e[o]),allowAttributes:Array.from(i.allowAttributes)};return t}function J7(e,t){for(let i of t.allowAttributesOf){let o=e[i];if(!o)return;o.allowAttributes.forEach(n=>{t.disallowAttributes.has(n)||t.allowAttributes.add(n)})}}function Z7(e,t){for(let i of t.inheritTypesFrom){let o=e[i];if(o){let n=Object.keys(o).filter(s=>s.startsWith("is"));for(let s of n)s in t||(t[s]=o[s])}}}function Q7(e,t){for(let i of e){let o=Object.keys(i).filter(n=>n.startsWith("is"));for(let n of o)t[n]=!!i[n]}}function Jt(e,t,i){for(let o of e){let n=o[i];typeof n=="string"&&(n=[n]),Array.isArray(n)&&n.forEach(s=>t[i].add(s))}}function Y7(e,t){for(let i of e){let o=i.inheritAllFrom;o&&(t.allowContentOf.add(o),t.allowWhere.add(o),t.allowAttributesOf.add(o),t.inheritTypesFrom.add(o))}}function X7(e){return typeof e=="string"||e.is("documentFragment")?{name:typeof e=="string"?e:"$documentFragment",*getAttributeKeys(){},getAttribute(){}}:{name:e.is("element")?e.name:"$text",*getAttributeKeys(){yield*e.getAttributeKeys()},getAttribute(t){return e.getAttribute(t)}}}function*eC(e,t){let i=!1;for(;!i;){if(i=!0,e){let o=e.next();o.done||(i=!1,yield{walker:e,value:o.value})}if(t){let o=t.next();o.done||(i=!1,yield{walker:t,value:o.value})}}}function*tC(e){for(let t of e)yield*t.getMinimalFlatRanges()}function qg(e,t,i){for(let o of t.getAttributeKeys())e.checkAttribute(t,o)||i.removeAttribute(o,t)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var eC=q(),tC=class extends eC{conversionApi;_splitParts=new Map;_cursorParents=new Map;_modelCursor=null;_emptyElementsToKeep=new Set;constructor(e){super(),this.conversionApi={...e,consumable:null,writer:null,store:null,convertItem:(t,i)=>this._convertItem(t,i),convertChildren:(t,i)=>this._convertChildren(t,i),safeInsert:(t,i)=>this._safeInsert(t,i),updateConversionResult:(t,i)=>this._updateConversionResult(t,i),splitToAllowedParent:(t,i)=>this._splitToAllowedParent(t,i),getSplitParts:t=>this._getSplitParts(t),keepEmptyElement:t=>this._keepEmptyElement(t)}}convert(e,t,i=["$root"]){this.fire("viewCleanup",e),this._modelCursor=oC(i,t),this.conversionApi.writer=t,this.conversionApi.consumable=m4.createFrom(e),this.conversionApi.store={};let{modelRange:o}=this._convertItem(e,this._modelCursor),n=t.createDocumentFragment();if(o){this._removeEmptyElements();let s=this._modelCursor.parent,r=s._removeChildren(0,s.childCount);n._insertChild(0,r),n.markers=iC(n,t)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this._emptyElementsToKeep.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,n}_convertItem(e,t){let i={viewItem:e,modelCursor:t,modelRange:null};if(e.is("element")?this.fire(`element:${e.name}`,i,this.conversionApi):e.is("$text")?this.fire("text",i,this.conversionApi):this.fire("documentFragment",i,this.conversionApi),i.modelRange&&!(i.modelRange instanceof T))throw new p("view-conversion-dispatcher-incorrect-result",this);return{modelRange:i.modelRange,modelCursor:i.modelCursor}}_convertChildren(e,t){let i=t.is("position")?t:A._createAt(t,0),o=new T(i);for(let n of Array.from(e.getChildren())){let s=this._convertItem(n,i);s.modelRange instanceof T&&(o.end=s.modelRange.end,i=s.modelCursor)}return{modelRange:o,modelCursor:i}}_safeInsert(e,t){let i=this._splitToAllowedParent(e,t);return i?(this.conversionApi.writer.insert(e,i.position),!0):!1}_updateConversionResult(e,t){let i=this._getSplitParts(e),o=this.conversionApi.writer;t.modelRange||(t.modelRange=o.createRange(o.createPositionBefore(e),o.createPositionAfter(i[i.length-1])));let n=this._cursorParents.get(e);n?t.modelCursor=o.createPositionAt(n,0):t.modelCursor=t.modelRange.end}_splitToAllowedParent(e,t){let{schema:i,writer:o}=this.conversionApi,n=i.findAllowedParent(t,e);if(n){if(n===t.parent)return{position:t};this._modelCursor.parent.getAncestors().includes(n)&&(n=null)}if(!n)return rl(t,e,i)?{position:Fp(t,o)}:null;let s=this.conversionApi.writer.split(t,n),r=[];for(let l of s.range.getWalker())if(l.type=="elementEnd")r.push(l.item);else{let c=r.pop(),u=l.item;this._registerSplitPair(c,u)}let a=s.range.end.parent;return this._cursorParents.set(e,a),{position:s.position,cursorParent:a}}_registerSplitPair(e,t){this._splitParts.has(e)||this._splitParts.set(e,[e]);let i=this._splitParts.get(e);this._splitParts.set(t,i),i.push(t)}_getSplitParts(e){let t;return this._splitParts.has(e)?t=this._splitParts.get(e):t=[e],t}_keepEmptyElement(e){this._emptyElementsToKeep.add(e)}_removeEmptyElements(){let e=new Map;for(let t of this._splitParts.keys())if(t.isEmpty&&!this._emptyElementsToKeep.has(t)){let i=e.get(t.parent)||[];i.push(t),this._splitParts.delete(t),e.set(t.parent,i)}for(let[t,i]of e)t._removeChildrenArray(i);e.size&&this._removeEmptyElements()}};function iC(e,t){let i=new Set,o=new Map,n=T._createIn(e).getItems();for(let s of n)s.is("element","$marker")&&i.add(s);for(let s of i){let r=s.getAttribute("data-name"),a=t.createPositionBefore(s);o.has(r)?o.get(r).end=a.clone():o.set(r,new T(a.clone())),t.remove(s)}return o}function oC(e,t){let i;for(let o of new Rn(e)){let n={};for(let r of o.getAttributeKeys())n[r]=o.getAttribute(r);let s=t.createElement(o.name,n);i&&t.insert(s,i),i=A._createAt(s,0)}return i}/** +*/var iC=q(),oC=class extends iC{conversionApi;_splitParts=new Map;_cursorParents=new Map;_modelCursor=null;_emptyElementsToKeep=new Set;constructor(e){super(),this.conversionApi={...e,consumable:null,writer:null,store:null,convertItem:(t,i)=>this._convertItem(t,i),convertChildren:(t,i)=>this._convertChildren(t,i),safeInsert:(t,i)=>this._safeInsert(t,i),updateConversionResult:(t,i)=>this._updateConversionResult(t,i),splitToAllowedParent:(t,i)=>this._splitToAllowedParent(t,i),getSplitParts:t=>this._getSplitParts(t),keepEmptyElement:t=>this._keepEmptyElement(t)}}convert(e,t,i=["$root"]){this.fire("viewCleanup",e),this._modelCursor=sC(i,t),this.conversionApi.writer=t,this.conversionApi.consumable=p4.createFrom(e),this.conversionApi.store={};let{modelRange:o}=this._convertItem(e,this._modelCursor),n=t.createDocumentFragment();if(o){this._removeEmptyElements();let s=this._modelCursor.parent,r=s._removeChildren(0,s.childCount);n._insertChild(0,r),n.markers=nC(n,t)}return this._modelCursor=null,this._splitParts.clear(),this._cursorParents.clear(),this._emptyElementsToKeep.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,n}_convertItem(e,t){let i={viewItem:e,modelCursor:t,modelRange:null};if(e.is("element")?this.fire(`element:${e.name}`,i,this.conversionApi):e.is("$text")?this.fire("text",i,this.conversionApi):this.fire("documentFragment",i,this.conversionApi),i.modelRange&&!(i.modelRange instanceof T))throw new p("view-conversion-dispatcher-incorrect-result",this);return{modelRange:i.modelRange,modelCursor:i.modelCursor}}_convertChildren(e,t){let i=t.is("position")?t:A._createAt(t,0),o=new T(i);for(let n of Array.from(e.getChildren())){let s=this._convertItem(n,i);s.modelRange instanceof T&&(o.end=s.modelRange.end,i=s.modelCursor)}return{modelRange:o,modelCursor:i}}_safeInsert(e,t){let i=this._splitToAllowedParent(e,t);return i?(this.conversionApi.writer.insert(e,i.position),!0):!1}_updateConversionResult(e,t){let i=this._getSplitParts(e),o=this.conversionApi.writer;t.modelRange||(t.modelRange=o.createRange(o.createPositionBefore(e),o.createPositionAfter(i[i.length-1])));let n=this._cursorParents.get(e);n?t.modelCursor=o.createPositionAt(n,0):t.modelCursor=t.modelRange.end}_splitToAllowedParent(e,t){let{schema:i,writer:o}=this.conversionApi,n=i.findAllowedParent(t,e);if(n){if(n===t.parent)return{position:t};this._modelCursor.parent.getAncestors().includes(n)&&(n=null)}if(!n)return al(t,e,i)?{position:zp(t,o)}:null;let s=this.conversionApi.writer.split(t,n),r=[];for(let l of s.range.getWalker())if(l.type=="elementEnd")r.push(l.item);else{let c=r.pop(),u=l.item;this._registerSplitPair(c,u)}let a=s.range.end.parent;return this._cursorParents.set(e,a),{position:s.position,cursorParent:a}}_registerSplitPair(e,t){this._splitParts.has(e)||this._splitParts.set(e,[e]);let i=this._splitParts.get(e);this._splitParts.set(t,i),i.push(t)}_getSplitParts(e){let t;return this._splitParts.has(e)?t=this._splitParts.get(e):t=[e],t}_keepEmptyElement(e){this._emptyElementsToKeep.add(e)}_removeEmptyElements(){let e=new Map;for(let t of this._splitParts.keys())if(t.isEmpty&&!this._emptyElementsToKeep.has(t)){let i=e.get(t.parent)||[];i.push(t),this._splitParts.delete(t),e.set(t.parent,i)}for(let[t,i]of e)t._removeChildrenArray(i);e.size&&this._removeEmptyElements()}};function nC(e,t){let i=new Set,o=new Map,n=T._createIn(e).getItems();for(let s of n)s.is("element","$marker")&&i.add(s);for(let s of i){let r=s.getAttribute("data-name"),a=t.createPositionBefore(s);o.has(r)?o.get(r).end=a.clone():o.set(r,new T(a.clone())),t.remove(s)}return o}function sC(e,t){let i;for(let o of new Rn(e)){let n={};for(let r of o.getAttributeKeys())n[r]=o.getAttribute(r);let s=t.createElement(o.name,n);i&&t.insert(s,i),i=A._createAt(s,0)}return i}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var nC=class{getHtml(e){let t=S.document.implementation.createHTMLDocument("").createElement("div");return t.appendChild(e),t.innerHTML}};/** +*/var rC=class{getHtml(e){let t=S.document.implementation.createHTMLDocument("").createElement("div");return t.appendChild(e),t.innerHTML}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var kd=class{domParser;domConverter;htmlWriter;skipComments=!0;constructor(e){this.domParser=new DOMParser,this.domConverter=new To(e,{renderingMode:"data"}),this.htmlWriter=new nC}toData(e){let t=this.domConverter.viewToDom(e);return this.htmlWriter.getHtml(t)}toView(e){let t=this._toDom(e);return this.domConverter.domToView(t,{skipComments:this.skipComments})}registerRawContentMatcher(e){this.domConverter.registerRawContentMatcher(e)}useFillerType(e){this.domConverter.blockFillerMode=e=="marked"?"markedNbsp":"nbsp"}_toDom(e){/<(?:html|body|head|meta)(?:\s[^>]*)?>/i.test(e.trim().slice(0,1e4))||(e=`${e}`);let t=this.domParser.parseFromString(at(e),"text/html"),i=t.createDocumentFragment(),o=t.body.childNodes;for(;o.length>0;)i.appendChild(o[0]);return i}};/** +*/var xd=class{domParser;domConverter;htmlWriter;skipComments=!0;constructor(e){this.domParser=new DOMParser,this.domConverter=new Eo(e,{renderingMode:"data"}),this.htmlWriter=new rC}toData(e){let t=this.domConverter.viewToDom(e);return this.htmlWriter.getHtml(t)}toView(e){let t=this._toDom(e);return this.domConverter.domToView(t,{skipComments:this.skipComments})}registerRawContentMatcher(e){this.domConverter.registerRawContentMatcher(e)}useFillerType(e){this.domConverter.blockFillerMode=e=="marked"?"markedNbsp":"nbsp"}_toDom(e){/<(?:html|body|head|meta)(?:\s[^>]*)?>/i.test(e.trim().slice(0,1e4))||(e=`${e}`);let t=this.domParser.parseFromString(at(e),"text/html"),i=t.createDocumentFragment(),o=t.body.childNodes;for(;o.length>0;)i.appendChild(o[0]);return i}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var sC=q(),Up=class extends sC{model;mapper;downcastDispatcher;upcastDispatcher;viewDocument;stylesProcessor;htmlProcessor;processor;_viewWriter;constructor(e,t){super(),this.model=e,this.mapper=new vp,this.downcastDispatcher=new kp({mapper:this.mapper,schema:e.schema}),this.downcastDispatcher.on("insert:$text",Ap(),{priority:"lowest"}),this.downcastDispatcher.on("insert",Ip(),{priority:"lowest"}),this.upcastDispatcher=new tC({schema:e.schema}),this.viewDocument=new ar(t),this.stylesProcessor=t,this.htmlProcessor=new kd(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new bd(this.viewDocument),this.upcastDispatcher.on("text",C7(),{priority:"lowest"}),this.upcastDispatcher.on("element",zg(),{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",zg(),{priority:"lowest"}),W().prototype.decorate.call(this,"init"),W().prototype.decorate.call(this,"set"),W().prototype.decorate.call(this,"get"),W().prototype.decorate.call(this,"toView"),W().prototype.decorate.call(this,"toModel"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"}),this.on("ready",()=>{this.model.enqueueChange({isUndoable:!1},Dp)},{priority:"lowest"})}get(e={}){let{rootName:t="main",trim:i="empty"}=e;if(!this._checkIfRootsExists([t]))throw new p("datacontroller-get-non-existent-root",this);let o=this.model.document.getRoot(t);return o.isAttached()||D("datacontroller-get-detached-root",this),i==="empty"&&!this.model.hasContent(o,{ignoreWhitespaces:!0})?"":this.stringify(o,e)}stringify(e,t={}){let i=this.toView(e,t);return this.processor.toData(i)}toView(e,t={}){let i=this.viewDocument,o=this._viewWriter;this.mapper.clearBindings();let n=T._createIn(e),s=new vo(i);this.mapper.bindElements(e,s);let r=e.is("documentFragment")?e.markers:rC(e);return this.downcastDispatcher.convert(n,r,o,t),s}init(e){if(this.model.document.version)throw new p("datacontroller-init-document-not-empty",this);let t={};if(typeof e=="string"?t.main=e:t=e,!this._checkIfRootsExists(Object.keys(t)))throw new p("datacontroller-init-non-existent-root",this);return this.model.enqueueChange({isUndoable:!1},i=>{for(let o of Object.keys(t)){let n=this.model.document.getRoot(o);i.insert(this.parse(t[o],n),n,0)}}),Promise.resolve()}set(e,t={}){let i={};if(typeof e=="string"?i.main=e:i=e,!this._checkIfRootsExists(Object.keys(i)))throw new p("datacontroller-set-non-existent-root",this);this.model.enqueueChange(t.batchType||{},o=>{o.setSelection(null),o.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(let n of Object.keys(i)){let s=this.model.document.getRoot(n);o.remove(o.createRangeIn(s)),o.insert(this.parse(i[n],s),s,0)}})}parse(e,t="$root"){let i=this.processor.toView(e);return this.toModel(i,t)}toModel(e,t="$root"){return this.model.change(i=>this.upcastDispatcher.convert(e,i,t))}addStyleProcessorRules(e){e(this.stylesProcessor)}registerRawContentMatcher(e){this.processor&&this.processor!==this.htmlProcessor&&this.processor.registerRawContentMatcher(e),this.htmlProcessor.registerRawContentMatcher(e)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(let t of e)if(!this.model.document.getRoot(t))return!1;return!0}};function rC(e){let t=[],i=e.root.document;if(!i)return new Map;let o=T._createIn(e);for(let n of i.model.markers){let s=n.getRange(),r=s.isCollapsed,a=s.start.isEqual(o.start)||s.end.isEqual(o.end);if(r&&a)t.push([n.name,s]);else{let l=o.getIntersection(s);l&&t.push([n.name,l])}}return new Map(t)}/** +*/var aC=q(),$p=class extends aC{model;mapper;downcastDispatcher;upcastDispatcher;viewDocument;stylesProcessor;htmlProcessor;processor;_viewWriter;constructor(e,t){super(),this.model=e,this.mapper=new Cp,this.downcastDispatcher=new xp({mapper:this.mapper,schema:e.schema}),this.downcastDispatcher.on("insert:$text",Sp(),{priority:"lowest"}),this.downcastDispatcher.on("insert",Pp(),{priority:"lowest"}),this.upcastDispatcher=new oC({schema:e.schema}),this.viewDocument=new ar(t),this.stylesProcessor=t,this.htmlProcessor=new xd(this.viewDocument),this.processor=this.htmlProcessor,this._viewWriter=new yd(this.viewDocument),this.upcastDispatcher.on("text",T7(),{priority:"lowest"}),this.upcastDispatcher.on("element",Wg(),{priority:"lowest"}),this.upcastDispatcher.on("documentFragment",Wg(),{priority:"lowest"}),W().prototype.decorate.call(this,"init"),W().prototype.decorate.call(this,"set"),W().prototype.decorate.call(this,"get"),W().prototype.decorate.call(this,"toView"),W().prototype.decorate.call(this,"toModel"),this.on("init",()=>{this.fire("ready")},{priority:"lowest"}),this.on("ready",()=>{this.model.enqueueChange({isUndoable:!1},Np)},{priority:"lowest"})}get(e={}){let{rootName:t="main",trim:i="empty"}=e;if(!this._checkIfRootsExists([t]))throw new p("datacontroller-get-non-existent-root",this);let o=this.model.document.getRoot(t);return o.isAttached()||D("datacontroller-get-detached-root",this),i==="empty"&&!this.model.hasContent(o,{ignoreWhitespaces:!0})?"":this.stringify(o,e)}stringify(e,t={}){let i=this.toView(e,t);return this.processor.toData(i)}toView(e,t={}){let i=this.viewDocument,o=this._viewWriter;this.mapper.clearBindings();let n=T._createIn(e),s=new ko(i);this.mapper.bindElements(e,s);let r=e.is("documentFragment")?e.markers:lC(e);return this.downcastDispatcher.convert(n,r,o,t),s}init(e){if(this.model.document.version)throw new p("datacontroller-init-document-not-empty",this);let t={};if(typeof e=="string"?t.main=e:t=e,!this._checkIfRootsExists(Object.keys(t)))throw new p("datacontroller-init-non-existent-root",this);return this.model.enqueueChange({isUndoable:!1},i=>{for(let o of Object.keys(t)){let n=this.model.document.getRoot(o);i.insert(this.parse(t[o],n),n,0)}}),Promise.resolve()}set(e,t={}){let i={};if(typeof e=="string"?i.main=e:i=e,!this._checkIfRootsExists(Object.keys(i)))throw new p("datacontroller-set-non-existent-root",this);this.model.enqueueChange(t.batchType||{},o=>{o.setSelection(null),o.removeSelectionAttribute(this.model.document.selection.getAttributeKeys());for(let n of Object.keys(i)){let s=this.model.document.getRoot(n);o.remove(o.createRangeIn(s)),o.insert(this.parse(i[n],s),s,0)}})}parse(e,t="$root"){let i=this.processor.toView(e);return this.toModel(i,t)}toModel(e,t="$root"){return this.model.change(i=>this.upcastDispatcher.convert(e,i,t))}addStyleProcessorRules(e){e(this.stylesProcessor)}registerRawContentMatcher(e){this.processor&&this.processor!==this.htmlProcessor&&this.processor.registerRawContentMatcher(e),this.htmlProcessor.registerRawContentMatcher(e)}destroy(){this.stopListening()}_checkIfRootsExists(e){for(let t of e)if(!this.model.document.getRoot(t))return!1;return!0}};function lC(e){let t=[],i=e.root.document;if(!i)return new Map;let o=T._createIn(e);for(let n of i.model.markers){let s=n.getRange(),r=s.isCollapsed,a=s.start.isEqual(o.start)||s.end.isEqual(o.end);if(r&&a)t.push([n.name,s]);else{let l=o.getIntersection(s);l&&t.push([n.name,l])}}return new Map(t)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var qp=class{_helpers=new Map;_downcast;_upcast;constructor(e,t){this._downcast=j(e),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=j(t),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(e,t){let i=this._downcast.includes(t);if(!this._upcast.includes(t)&&!i)throw new p("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:i})}for(e){if(!this._helpers.has(e))throw new p("conversion-for-unknown-group",this);return this._helpers.get(e)}elementToElement(e){this.for("downcast").elementToElement(e);for(let{model:t,view:i}of Zu(e))this.for("upcast").elementToElement({model:t,view:i,converterPriority:e.converterPriority})}attributeToElement(e){this.for("downcast").attributeToElement(e);for(let{model:t,view:i}of Zu(e))this.for("upcast").elementToAttribute({view:i,model:t,converterPriority:e.converterPriority})}attributeToAttribute(e){this.for("downcast").attributeToAttribute(e);for(let{model:t,view:i}of Zu(e))this.for("upcast").attributeToAttribute({view:i,model:t})}_createConversionHelpers({name:e,dispatchers:t,isDowncast:i}){if(this._helpers.has(e))throw new p("conversion-group-exists",this);let o=i?new q6(t):new k7(t);this._helpers.set(e,o)}};function*Zu(e){if(e.model.values)for(let t of e.model.values){let i={key:e.model.key,value:t},o=e.view[t];yield*Ug(i,o,e.upcastAlso?e.upcastAlso[t]:void 0)}else yield*Ug(e.model,e.view,e.upcastAlso)}function*Ug(e,t,i){if(yield{model:e,view:t},i)for(let o of j(i))yield{model:e,view:o}}/** +*/var jp=class{_helpers=new Map;_downcast;_upcast;constructor(e,t){this._downcast=j(e),this._createConversionHelpers({name:"downcast",dispatchers:this._downcast,isDowncast:!0}),this._upcast=j(t),this._createConversionHelpers({name:"upcast",dispatchers:this._upcast,isDowncast:!1})}addAlias(e,t){let i=this._downcast.includes(t);if(!this._upcast.includes(t)&&!i)throw new p("conversion-add-alias-dispatcher-not-registered",this);this._createConversionHelpers({name:e,dispatchers:[t],isDowncast:i})}for(e){if(!this._helpers.has(e))throw new p("conversion-for-unknown-group",this);return this._helpers.get(e)}elementToElement(e){this.for("downcast").elementToElement(e);for(let{model:t,view:i}of Yu(e))this.for("upcast").elementToElement({model:t,view:i,converterPriority:e.converterPriority})}attributeToElement(e){this.for("downcast").attributeToElement(e);for(let{model:t,view:i}of Yu(e))this.for("upcast").elementToAttribute({view:i,model:t,converterPriority:e.converterPriority})}attributeToAttribute(e){this.for("downcast").attributeToAttribute(e);for(let{model:t,view:i}of Yu(e))this.for("upcast").attributeToAttribute({view:i,model:t})}_createConversionHelpers({name:e,dispatchers:t,isDowncast:i}){if(this._helpers.has(e))throw new p("conversion-group-exists",this);let o=i?new j6(t):new x7(t);this._helpers.set(e,o)}};function*Yu(e){if(e.model.values)for(let t of e.model.values){let i={key:e.model.key,value:t},o=e.view[t];yield*$g(i,o,e.upcastAlso?e.upcastAlso[t]:void 0)}else yield*$g(e.model,e.view,e.upcastAlso)}function*$g(e,t,i){if(yield{model:e,view:t},i)for(let o of j(i))yield{model:e,view:o}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -504,124 +504,124 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let */var ct=class{baseVersion;isDocumentOperation;batch;constructor(e){this.baseVersion=e,this.isDocumentOperation=this.baseVersion!==null,this.batch=null}_validate(){}toJSON(){let e=Object.assign({},this);return e.__className=this.constructor.className,delete e.batch,delete e.isDocumentOperation,e}static get className(){return"Operation"}static fromJSON(e,t){return new this(e.baseVersion)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Cd(e,t){let i=jp(t),o=i.reduce((r,a)=>r+a.offsetSize,0),n=e.parent;sr(e);let s=e.index;return n._insertChild(s,i),nr(n,s+i.length),nr(n,s),new T(e,e.getShiftedBy(o))}function $p(e){if(!e.isFlat)throw new p("operation-utils-remove-range-not-flat",this);let t=e.start.parent;sr(e.start),sr(e.end);let i=t._removeChildren(e.start.index,e.end.index-e.start.index);return nr(t,e.start.index),i}function or(e,t){if(!e.isFlat)throw new p("operation-utils-move-range-not-flat",this);let i=$p(e);return t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset),Cd(t,i)}function aC(e,t,i){sr(e.start),sr(e.end);for(let o of e.getItems({shallow:!0})){let n=o.is("$textProxy")?o.textNode:o;i!==null?n._setAttribute(t,i):n._removeAttribute(t),nr(n.parent,n.index)}nr(e.end.parent,e.end.index)}function jp(e){let t=[];function i(o){if(typeof o=="string")t.push(new ce(o));else if(o instanceof Gt)t.push(new ce(o.data,o.getAttributes()));else if(o instanceof Eo)t.push(o);else if(Je(o))for(let n of o)i(n)}i(e);for(let o=1;or+a.offsetSize,0),n=e.parent;sr(e);let s=e.index;return n._insertChild(s,i),nr(n,s+i.length),nr(n,s),new T(e,e.getShiftedBy(o))}function Kp(e){if(!e.isFlat)throw new p("operation-utils-remove-range-not-flat",this);let t=e.start.parent;sr(e.start),sr(e.end);let i=t._removeChildren(e.start.index,e.end.index-e.start.index);return nr(t,e.start.index),i}function or(e,t){if(!e.isFlat)throw new p("operation-utils-move-range-not-flat",this);let i=Kp(e);return t=t._getTransformedByDeletion(e.start,e.end.offset-e.start.offset),Td(t,i)}function cC(e,t,i){sr(e.start),sr(e.end);for(let o of e.getItems({shallow:!0})){let n=o.is("$textProxy")?o.textNode:o;i!==null?n._setAttribute(t,i):n._removeAttribute(t),nr(n.parent,n.index)}nr(e.end.parent,e.end.index)}function Gp(e){let t=[];function i(o){if(typeof o=="string")t.push(new ce(o));else if(o instanceof Zt)t.push(new ce(o.data,o.getAttributes()));else if(o instanceof Ao)t.push(o);else if(Je(o))for(let n of o)i(n)}i(e);for(let o=1;ot.maxOffset)throw new p("move-operation-nodes-do-not-exist",this);if(t===i&&o=o&&this.targetPosition.path[s]t.maxOffset)throw new p("move-operation-nodes-do-not-exist",this);if(t===i&&o=o&&this.targetPosition.path[s]o._clone(!0))),i=new ld(this.position,t,this.baseVersion);return i.shouldReceiveAttributes=this.shouldReceiveAttributes,i}getReversed(){let t=this.position.root.document.graveyard,i=new A(t,[0]);return new Z(this.position,this.nodes.maxOffset,i,this.baseVersion+1)}_validate(){let t=this.position.parent;if(!t||t.maxOffseti._clone(!0))),Cd(this.position,t)}toJSON(){let t=super.toJSON();return t.position=this.position.toJSON(),t.nodes=this.nodes.toJSON(),t}static get className(){return"InsertOperation"}static fromJSON(t,i){let o=[];for(let s of t.nodes)s.name?o.push(ie.fromJSON(s)):o.push(ce.fromJSON(s));let n=new ld(A.fromJSON(t.position,i),o,t.baseVersion);return n.shouldReceiveAttributes=t.shouldReceiveAttributes,n}};/** +*/var Ye=class ud extends ct{position;nodes;shouldReceiveAttributes;constructor(t,i,o){super(o),this.position=t.clone(),this.position.stickiness="toNone",this.nodes=new Zs(Gp(i)),this.shouldReceiveAttributes=!1}get type(){return"insert"}get howMany(){return this.nodes.maxOffset}get affectedSelectable(){return this.position.clone()}clone(){let t=new Zs([...this.nodes].map(o=>o._clone(!0))),i=new ud(this.position,t,this.baseVersion);return i.shouldReceiveAttributes=this.shouldReceiveAttributes,i}getReversed(){let t=this.position.root.document.graveyard,i=new A(t,[0]);return new Z(this.position,this.nodes.maxOffset,i,this.baseVersion+1)}_validate(){let t=this.position.parent;if(!t||t.maxOffseti._clone(!0))),Td(this.position,t)}toJSON(){let t=super.toJSON();return t.position=this.position.toJSON(),t.nodes=this.nodes.toJSON(),t}static get className(){return"InsertOperation"}static fromJSON(t,i){let o=[];for(let s of t.nodes)s.name?o.push(ie.fromJSON(s)):o.push(ce.fromJSON(s));let n=new ud(A.fromJSON(t.position,i),o,t.baseVersion);return n.shouldReceiveAttributes=t.shouldReceiveAttributes,n}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var ee=class Gp extends ct{splitPosition;howMany;insertionPosition;graveyardPosition;constructor(t,i,o,n,s){super(s),this.splitPosition=t.clone(),this.splitPosition.stickiness="toNext",this.howMany=i,this.insertionPosition=o,this.graveyardPosition=n?n.clone():null,this.graveyardPosition&&(this.graveyardPosition.stickiness="toNext")}get type(){return"split"}get moveTargetPosition(){let t=this.insertionPosition.path.slice();return t.push(0),new A(this.insertionPosition.root,t)}get movedRange(){let t=this.splitPosition.getShiftedBy(Number.POSITIVE_INFINITY);return new T(this.splitPosition,t)}get affectedSelectable(){let t=[T._createFromPositionAndShift(this.splitPosition,0),T._createFromPositionAndShift(this.insertionPosition,0)];return this.graveyardPosition&&t.push(T._createFromPositionAndShift(this.graveyardPosition,0)),t}clone(){return new Gp(this.splitPosition,this.howMany,this.insertionPosition,this.graveyardPosition,this.baseVersion)}getReversed(){let t=this.splitPosition.root.document.graveyard,i=new A(t,[0]);return new ke(this.moveTargetPosition,this.howMany,this.splitPosition,i,this.baseVersion+1)}_validate(){let t=this.splitPosition.parent,i=this.splitPosition.offset;if(!t||t.maxOffset1&&e.sourcePosition.isEqual(t.deletionPosition)?this._setRelation(e,t,"firstToMoveMerged"):e.howMany>1&&e.sourcePosition.getShiftedBy(e.howMany-1).isEqual(t.deletionPosition)&&this._setRelation(e,t,"lastToMoveMerged"):t instanceof Z&&(e.targetPosition.isEqual(t.sourcePosition)||e.targetPosition.isBefore(t.sourcePosition)?this._setRelation(e,t,"insertBefore"):this._setRelation(e,t,"insertAfter"));else if(e instanceof ee){if(t instanceof ke)e.splitPosition.isBefore(t.sourcePosition)&&this._setRelation(e,t,"splitBefore");else if(t instanceof Z)if(e.splitPosition.isEqual(t.sourcePosition)||e.splitPosition.isBefore(t.sourcePosition))this._setRelation(e,t,"splitBefore");else{let i=T._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&i.containsPosition(e.splitPosition)){let o=i.end.offset-e.splitPosition.offset,n=e.splitPosition.offset-i.start.offset;this._setRelation(e,t,{howMany:o,offset:n})}}}else if(e instanceof ke)t instanceof ke?(e.targetPosition.isEqual(t.sourcePosition)||this._setRelation(e,t,"mergeTargetNotMoved"),e.sourcePosition.isEqual(t.targetPosition)&&this._setRelation(e,t,"mergeSourceNotMoved"),e.sourcePosition.isEqual(t.sourcePosition)&&this._setRelation(e,t,"mergeSameElement")):t instanceof ee?e.sourcePosition.isEqual(t.splitPosition)&&this._setRelation(e,t,"splitAtSource"):t instanceof Z&&t.howMany>0&&(e.sourcePosition.isEqual(t.sourcePosition.getShiftedBy(t.howMany))&&this._setRelation(e,t,"mergeSourceAffected"),e.targetPosition.isEqual(t.sourcePosition)&&this._setRelation(e,t,"mergeTargetWasBefore"));else if(e instanceof Rt){let i=e.newRange;if(!i)return;if(t instanceof ke){let o=i.start.isEqual(t.targetPosition),n=i.start.isEqual(t.deletionPosition),s=i.end.isEqual(t.deletionPosition),r=i.end.isEqual(t.sourcePosition);(o||n||s||r)&&this._setRelation(e,t,{wasInLeftElement:o,wasStartBeforeMergedElement:n,wasEndBeforeMergedElement:s,wasInRightElement:r})}}}getContext(e,t,i){return{aIsStrong:i,aWasUndone:this._wasUndone(e),bWasUndone:this._wasUndone(t),abRelation:this._useRelations?this._getRelation(e,t):null,baRelation:this._useRelations?this._getRelation(t,e):null,forceWeakRemove:this._forceWeakRemove}}_wasUndone(e){let t=this.originalOperations.get(e);return t.wasUndone||this._history.isUndoneOperation(t)}_getRelation(e,t){let i=this.originalOperations.get(t),o=this._history.getUndoneOperation(i);if(!o)return null;let n=this.originalOperations.get(e),s=this._relations.get(n);return s&&s.get(o)||null}_setRelation(e,t,i){let o=this.originalOperations.get(e),n=this.originalOperations.get(t),s=this._relations.get(o);s||(s=new Map,this._relations.set(o,s)),s.set(n,i)}};function $g(e,t){for(let i of e)i.baseVersion=t++}function jg(e,t){for(let i=0;i{if(e.key===t.key&&e.range.start.hasSameParentAs(t.range.start)){let o=e.range.getDifference(t.range).map(s=>new ze(s,e.key,e.oldValue,e.newValue,0)),n=e.range.getIntersection(t.range);return n&&i.aIsStrong&&o.push(new ze(n,t.key,t.newValue,e.newValue,0)),o.length==0?[new Le(0)]:o}else return[e]});$(ze,Ye,(e,t)=>{if(e.range.start.hasSameParentAs(t.position)&&e.range.containsPosition(t.position)){let i=e.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes).map(o=>new ze(o,e.key,e.oldValue,e.newValue,e.baseVersion));if(t.shouldReceiveAttributes){let o=Qp(t,e.key,e.oldValue);o&&i.unshift(o)}return i}return e.range=e.range._getTransformedByInsertion(t.position,t.howMany,!1)[0],[e]});function Qp(e,t,i){let o=e.nodes.getNode(0).getAttribute(t);if(o==i)return null;let n=new T(e.position,e.position.getShiftedBy(e.howMany));return new ze(n,t,o,i,0)}$(ze,ke,(e,t)=>{let i=[];e.range.start.hasSameParentAs(t.deletionPosition)&&(e.range.containsPosition(t.deletionPosition)||e.range.start.isEqual(t.deletionPosition))&&i.push(T._createFromPositionAndShift(t.graveyardPosition,1));let o=e.range._getTransformedByMergeOperation(t);return o.isCollapsed||i.push(o),i.map(n=>new ze(n,e.key,e.oldValue,e.newValue,e.baseVersion))});$(ze,Z,(e,t)=>hC(e.range,t).map(i=>new ze(i,e.key,e.oldValue,e.newValue,e.baseVersion)));function hC(e,t){let i=T._createFromPositionAndShift(t.sourcePosition,t.howMany),o=null,n=[];i.containsRange(e,!0)?o=e:e.start.hasSameParentAs(i.start)?(n=e.getDifference(i),o=e.getIntersection(i)):n=[e];let s=[];for(let r of n){r=r._getTransformedByDeletion(t.sourcePosition,t.howMany);let a=t.getMovedRangeStart(),l=r.start.hasSameParentAs(a),c=r._getTransformedByInsertion(a,t.howMany,l);s.push(...c)}return o&&s.push(o._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,!1)[0]),s}$(ze,ee,(e,t)=>{if(e.range.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.range.end.offset++,[e];if(e.range.start.hasSameParentAs(t.splitPosition)&&e.range.containsPosition(t.splitPosition)){let i=e.clone();return i.range=new T(t.moveTargetPosition.clone(),e.range.end._getCombined(t.splitPosition,t.moveTargetPosition)),e.range.end=t.splitPosition.clone(),e.range.end.stickiness="toPrevious",[e,i]}return e.range=e.range._getTransformedBySplitOperation(t),[e]});$(Ye,ze,(e,t)=>{let i=[e];if(e.shouldReceiveAttributes&&e.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(e.position)){let o=Qp(e,t.key,t.newValue);o&&i.push(o)}return i});$(Ye,Ye,(e,t,i)=>e.position.isEqual(t.position)&&i.aIsStrong?[e]:(e.position=e.position._getTransformedByInsertOperation(t),[e]));$(Ye,Z,(e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e]));$(Ye,ee,(e,t)=>(e.position=e.position._getTransformedBySplitOperation(t),[e]));$(Ye,ke,(e,t)=>(e.position=e.position._getTransformedByMergeOperation(t),[e]));$(Rt,Ye,(e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByInsertOperation(t)[0]),e.newRange&&(e.newRange=e.newRange._getTransformedByInsertOperation(t)[0]),[e]));$(Rt,Rt,(e,t,i)=>{if(e.name==t.name)if(i.aIsStrong)e.oldRange=t.newRange?t.newRange.clone():null;else return[new Le(0)];return[e]});$(Rt,ke,(e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByMergeOperation(t)),e.newRange&&(e.newRange=e.newRange._getTransformedByMergeOperation(t)),[e]));$(Rt,Z,(e,t)=>{let i=[e];if(e.oldRange&&(e.oldRange=T._createFromRanges(e.oldRange._getTransformedByMoveOperation(t))),e.newRange){let o=e.newRange._getTransformedByMoveOperation(t);e.newRange=o[0];for(let n=1;n{if(e.oldRange&&(e.oldRange=e.oldRange._getTransformedBySplitOperation(t)),e.newRange){if(i.abRelation){let o=e.newRange._getTransformedBySplitOperation(t);return e.newRange.start.isEqual(t.splitPosition)?i.abRelation.wasStartBeforeMergedElement?e.newRange.start=A._createAt(t.insertionPosition):i.abRelation.wasInLeftElement?e.newRange.start=A._createAt(e.newRange.start):e.newRange.start=A._createAt(t.moveTargetPosition):e.newRange.start=o.start,e.newRange.end.isEqual(t.splitPosition)?e.newRange.end.isEqual(t.splitPosition)&&i.abRelation.wasEndBeforeMergedElement?e.newRange.end=A._createAt(t.insertionPosition):i.abRelation.wasInRightElement?e.newRange.end=A._createAt(t.moveTargetPosition):e.newRange.end=A._createAt(e.newRange.end):e.newRange.end=o.end,[e]}e.newRange=e.newRange._getTransformedBySplitOperation(t)}return[e]});$(ke,Ye,(e,t)=>(e.sourcePosition.hasSameParentAs(t.position)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByInsertOperation(t),e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t),[e]));$(ke,ke,(e,t,i)=>{if(e.sourcePosition.isEqual(t.sourcePosition)&&e.targetPosition.isEqual(t.targetPosition))if(i.bWasUndone){let o=t.graveyardPosition.path.slice();return o.push(0),e.sourcePosition=new A(t.graveyardPosition.root,o),e.howMany=0,[e]}else return[new Le(0)];if(e.sourcePosition.isEqual(t.sourcePosition)&&!e.targetPosition.isEqual(t.targetPosition)&&!i.bWasUndone&&i.abRelation!="splitAtSource"){let o=e.targetPosition.root.rootName=="$graveyard",n=t.targetPosition.root.rootName=="$graveyard";if(n&&!o||!(o&&!n)&&i.aIsStrong){let s=t.targetPosition._getTransformedByMergeOperation(t),r=e.targetPosition._getTransformedByMergeOperation(t);return[new Z(s,e.howMany,r,0)]}else return[new Le(0)]}return e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByMergeOperation(t),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),(!e.graveyardPosition.isEqual(t.graveyardPosition)||!i.aIsStrong)&&(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]});$(ke,Z,(e,t,i)=>{let o=T._createFromPositionAndShift(t.sourcePosition,t.howMany);return t.type=="remove"&&!i.bWasUndone&&e.deletionPosition.hasSameParentAs(t.sourcePosition)&&o.containsPosition(e.sourcePosition)?[new Le(0)]:(t.sourcePosition.getShiftedBy(t.howMany).isEqual(e.sourcePosition)?e.sourcePosition.stickiness="toNone":t.targetPosition.isEqual(e.sourcePosition)&&i.abRelation=="mergeSourceAffected"?e.sourcePosition.stickiness="toNext":t.sourcePosition.isEqual(e.targetPosition)?(e.targetPosition.stickiness="toNone",e.howMany-=t.howMany):t.targetPosition.isEqual(e.targetPosition)&&i.abRelation=="mergeTargetWasBefore"?(e.targetPosition.stickiness="toPrevious",e.howMany+=t.howMany):(e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition.hasSameParentAs(t.sourcePosition)&&(e.howMany-=t.howMany)),e.sourcePosition=e.sourcePosition._getTransformedByMoveOperation(t),e.targetPosition=e.targetPosition._getTransformedByMoveOperation(t),e.sourcePosition.stickiness="toPrevious",e.targetPosition.stickiness="toNext",e.graveyardPosition.isEqual(t.targetPosition)||(e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)),[e])});$(ke,ee,(e,t,i)=>{if(t.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByDeletion(t.graveyardPosition,1),e.deletionPosition.isEqual(t.graveyardPosition)&&(e.howMany=t.howMany)),e.targetPosition.isEqual(t.splitPosition)&&(t.graveyardPosition&&e.deletionPosition.isEqual(t.graveyardPosition)||i.abRelation=="mergeTargetNotMoved"))return e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),[e];if(e.sourcePosition.isEqual(t.splitPosition)){if(i.abRelation=="mergeSourceNotMoved")return e.howMany=0,e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e];if(i.abRelation=="mergeSameElement"||e.sourcePosition.offset>0)return e.sourcePosition=t.moveTargetPosition.clone(),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}return e.sourcePosition.hasSameParentAs(t.splitPosition)&&(e.howMany=t.splitPosition.offset),e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]});$(Z,Ye,(e,t)=>{let i=T._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByInsertOperation(t,!1)[0];return e.sourcePosition=i.start,e.howMany=i.end.offset-i.start.offset,e.targetPosition.isEqual(t.position)||(e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)),[e]});$(Z,Z,(e,t,i)=>{let o=T._createFromPositionAndShift(e.sourcePosition,e.howMany),n=T._createFromPositionAndShift(t.sourcePosition,t.howMany),s=i.aIsStrong,r=!i.aIsStrong;i.abRelation=="insertBefore"||i.baRelation=="insertAfter"?r=!0:(i.abRelation=="insertAfter"||i.baRelation=="insertBefore")&&(r=!1);let a;if(e.targetPosition.isEqual(t.targetPosition)&&r?a=e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany):a=e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Gg(e,t)&&Gg(t,e))return[t.getReversed()];if(o.containsPosition(t.targetPosition)&&o.containsRange(n,!0))return o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Sn([o],a);if(n.containsPosition(e.targetPosition)&&n.containsRange(o,!0))return o.start=o.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),o.end=o.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),Sn([o],a);let l=ve(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if(l=="prefix"||l=="extension")return o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Sn([o],a);e.type=="remove"&&t.type!="remove"&&!i.aWasUndone&&!i.forceWeakRemove?s=!0:e.type!="remove"&&t.type=="remove"&&!i.bWasUndone&&!i.forceWeakRemove&&(s=!1);let c=[],u=o.getDifference(n);for(let h of u){h.start=h.start._getTransformedByDeletion(t.sourcePosition,t.howMany),h.end=h.end._getTransformedByDeletion(t.sourcePosition,t.howMany);let f=ve(h.start.getParentPath(),t.getMovedRangeStart().getParentPath())=="same",m=h._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,f);c.push(...m)}let d=o.getIntersection(n);return d!==null&&s&&(d.start=d.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),d.end=d.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),c.length===0?c.push(d):c.length==1?n.start.isBefore(o.start)||n.start.isEqual(o.start)?c.unshift(d):c.push(d):c.splice(1,0,d)),c.length===0?[new Le(e.baseVersion)]:Sn(c,a)});$(Z,ee,(e,t,i)=>{let o=e.targetPosition.clone();if((!e.targetPosition.isEqual(t.insertionPosition)||!t.graveyardPosition||i.abRelation=="moveTargetAfter")&&(o=e.targetPosition._getTransformedBySplitOperation(t)),e.sourcePosition.isEqual(t.insertionPosition)&&i.abRelation=="firstToMoveMerged")return e.howMany++,e.targetPosition=o,[e];let n=T._createFromPositionAndShift(e.sourcePosition,e.howMany);if(n.end.isEqual(t.insertionPosition))return(!t.graveyardPosition||i.abRelation=="lastToMoveMerged")&&e.howMany++,e.targetPosition=o,[e];if(n.start.hasSameParentAs(t.splitPosition)&&n.containsPosition(t.splitPosition)){let r=new T(t.splitPosition,n.end);return r=r._getTransformedBySplitOperation(t),Sn([new T(n.start,t.splitPosition),r],o)}e.targetPosition.isEqual(t.splitPosition)&&i.abRelation=="insertAtSource"&&(o=t.moveTargetPosition),e.targetPosition.isEqual(t.insertionPosition)&&i.abRelation=="insertBetween"&&(o=e.targetPosition);let s=[n._getTransformedBySplitOperation(t)];if(t.graveyardPosition){let r=n.start.isEqual(t.graveyardPosition)||n.containsPosition(t.graveyardPosition);e.howMany>1&&r&&!i.aWasUndone&&s.push(T._createFromPositionAndShift(t.insertionPosition,1))}return Sn(s,o)});$(Z,ke,(e,t,i)=>{let o=T._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&o.containsPosition(t.sourcePosition)){if(e.type=="remove"&&!i.forceWeakRemove){if(!i.aWasUndone){let s=[],r=t.graveyardPosition.clone(),a=t.targetPosition._getTransformedByMergeOperation(t),l=e.targetPosition.getTransformedByOperation(t);e.howMany>1&&(s.push(new Z(e.sourcePosition,e.howMany-1,l,0)),r=r._getTransformedByMove(e.sourcePosition,l,e.howMany-1),a=a._getTransformedByMove(e.sourcePosition,l,e.howMany-1));let c=t.deletionPosition._getCombined(e.sourcePosition,l),u=new Z(r,1,c,0),d=u.getMovedRangeStart().path.slice();d.push(0);let h=new A(u.targetPosition.root,d);a=a._getTransformedByMove(r,c,1);let f=new Z(a,t.howMany,h,0);return s.push(u),s.push(f),s}}else if(e.howMany==1)return i.bWasUndone?(e.sourcePosition=t.graveyardPosition.clone(),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]):[new Le(0)]}let n=T._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByMergeOperation(t);return e.sourcePosition=n.start,e.howMany=n.end.offset-n.start.offset,e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]});$(Jt,Ye,(e,t)=>(e.position=e.position._getTransformedByInsertOperation(t),[e]));$(Jt,ke,(e,t)=>e.position.isEqual(t.deletionPosition)?(e.position=t.graveyardPosition.clone(),e.position.stickiness="toNext",[e]):(e.position=e.position._getTransformedByMergeOperation(t),[e]));$(Jt,Z,(e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e]));$(Jt,Jt,(e,t,i)=>{if(e.position.isEqual(t.position))if(i.aIsStrong)e.oldName=t.newName;else return[new Le(0)];return[e]});$(Jt,ee,(e,t)=>{let i=e.position.path,o=t.splitPosition.getParentPath();return ve(i,o)=="same"&&!t.graveyardPosition?[e,new Jt(e.position.getShiftedBy(1),e.oldName,e.newName,0)]:(e.position=e.position._getTransformedBySplitOperation(t),[e])});$(rr,rr,(e,t,i)=>{if(e.root===t.root&&e.key===t.key)if(i.aIsStrong)e.oldValue=t.newValue;else return[new Le(0)];return[e]});$(Vn,Vn,(e,t)=>e.rootName===t.rootName&&e.isAdd===t.isAdd?[new Le(0)]:[e]);$(ee,Ye,(e,t)=>(e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset{if(!e.graveyardPosition&&!i.bWasUndone&&e.splitPosition.hasSameParentAs(t.sourcePosition)){let o=t.graveyardPosition.path.slice();o.push(0);let n=new A(t.graveyardPosition.root,o),s=ee.getInsertionPosition(new A(t.graveyardPosition.root,o)),r=new ee(n,0,s,null,0);return e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=ee.getInsertionPosition(e.splitPosition),e.graveyardPosition=r.insertionPosition.clone(),e.graveyardPosition.stickiness="toNext",[r,e]}return e.splitPosition.hasSameParentAs(t.deletionPosition)&&!e.splitPosition.isAfter(t.deletionPosition)&&e.howMany--,e.splitPosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=ee.getInsertionPosition(e.splitPosition),e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]});$(ee,Z,(e,t,i)=>{let o=T._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.graveyardPosition){let s=o.start.isEqual(e.graveyardPosition)||o.containsPosition(e.graveyardPosition);if(!i.bWasUndone&&s){let r=e.splitPosition._getTransformedByMoveOperation(t),a=e.graveyardPosition._getTransformedByMoveOperation(t),l=a.path.slice();l.push(0);let c=new A(a.root,l);return[new Z(r,e.howMany,c,0)]}e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}let n=e.splitPosition.isEqual(t.targetPosition);if(n&&(i.baRelation=="insertAtSource"||i.abRelation=="splitBefore"))return e.howMany+=t.howMany,e.splitPosition=e.splitPosition._getTransformedByDeletion(t.sourcePosition,t.howMany),e.insertionPosition=ee.getInsertionPosition(e.splitPosition),[e];if(n&&i.abRelation&&i.abRelation.howMany){let{howMany:s,offset:r}=i.abRelation;return e.howMany+=s,e.splitPosition=e.splitPosition.getShiftedBy(r),[e]}if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&o.containsPosition(e.splitPosition)){let s=t.howMany-(e.splitPosition.offset-t.sourcePosition.offset);return e.howMany-=s,e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset{if(e.splitPosition.isEqual(t.splitPosition)){if(!e.graveyardPosition&&!t.graveyardPosition)return[new Le(0)];if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition))return[new Le(0)];if(i.abRelation=="splitBefore")return e.howMany=0,e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t),[e]}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){let o=e.splitPosition.root.rootName=="$graveyard",n=t.splitPosition.root.rootName=="$graveyard";if(n&&!o||!(o&&!n)&&i.aIsStrong){let s=[];return t.howMany&&s.push(new Z(t.moveTargetPosition,t.howMany,t.splitPosition,0)),e.howMany&&s.push(new Z(e.splitPosition,e.howMany,e.moveTargetPosition,0)),s}else return[new Le(0)]}if(e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t)),e.splitPosition.isEqual(t.insertionPosition)&&i.abRelation=="splitBefore")return e.howMany++,[e];if(t.splitPosition.isEqual(e.insertionPosition)&&i.baRelation=="splitBefore"){let o=t.insertionPosition.path.slice();o.push(0);let n=new A(t.insertionPosition.root,o);return[e,new Z(e.insertionPosition,1,n,0)]}return e.splitPosition.hasSameParentAs(t.splitPosition)&&e.splitPosition.offset1&&e.sourcePosition.isEqual(t.deletionPosition)?this._setRelation(e,t,"firstToMoveMerged"):e.howMany>1&&e.sourcePosition.getShiftedBy(e.howMany-1).isEqual(t.deletionPosition)&&this._setRelation(e,t,"lastToMoveMerged"):t instanceof Z&&(e.targetPosition.isEqual(t.sourcePosition)||e.targetPosition.isBefore(t.sourcePosition)?this._setRelation(e,t,"insertBefore"):this._setRelation(e,t,"insertAfter"));else if(e instanceof ee){if(t instanceof xe)e.splitPosition.isBefore(t.sourcePosition)&&this._setRelation(e,t,"splitBefore");else if(t instanceof Z)if(e.splitPosition.isEqual(t.sourcePosition)||e.splitPosition.isBefore(t.sourcePosition))this._setRelation(e,t,"splitBefore");else{let i=T._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&i.containsPosition(e.splitPosition)){let o=i.end.offset-e.splitPosition.offset,n=e.splitPosition.offset-i.start.offset;this._setRelation(e,t,{howMany:o,offset:n})}}}else if(e instanceof xe)t instanceof xe?(e.targetPosition.isEqual(t.sourcePosition)||this._setRelation(e,t,"mergeTargetNotMoved"),e.sourcePosition.isEqual(t.targetPosition)&&this._setRelation(e,t,"mergeSourceNotMoved"),e.sourcePosition.isEqual(t.sourcePosition)&&this._setRelation(e,t,"mergeSameElement")):t instanceof ee?e.sourcePosition.isEqual(t.splitPosition)&&this._setRelation(e,t,"splitAtSource"):t instanceof Z&&t.howMany>0&&(e.sourcePosition.isEqual(t.sourcePosition.getShiftedBy(t.howMany))&&this._setRelation(e,t,"mergeSourceAffected"),e.targetPosition.isEqual(t.sourcePosition)&&this._setRelation(e,t,"mergeTargetWasBefore"));else if(e instanceof Vt){let i=e.newRange;if(!i)return;if(t instanceof xe){let o=i.start.isEqual(t.targetPosition),n=i.start.isEqual(t.deletionPosition),s=i.end.isEqual(t.deletionPosition),r=i.end.isEqual(t.sourcePosition);(o||n||s||r)&&this._setRelation(e,t,{wasInLeftElement:o,wasStartBeforeMergedElement:n,wasEndBeforeMergedElement:s,wasInRightElement:r})}}}getContext(e,t,i){return{aIsStrong:i,aWasUndone:this._wasUndone(e),bWasUndone:this._wasUndone(t),abRelation:this._useRelations?this._getRelation(e,t):null,baRelation:this._useRelations?this._getRelation(t,e):null,forceWeakRemove:this._forceWeakRemove}}_wasUndone(e){let t=this.originalOperations.get(e);return t.wasUndone||this._history.isUndoneOperation(t)}_getRelation(e,t){let i=this.originalOperations.get(t),o=this._history.getUndoneOperation(i);if(!o)return null;let n=this.originalOperations.get(e),s=this._relations.get(n);return s&&s.get(o)||null}_setRelation(e,t,i){let o=this.originalOperations.get(e),n=this.originalOperations.get(t),s=this._relations.get(o);s||(s=new Map,this._relations.set(o,s)),s.set(n,i)}};function Kg(e,t){for(let i of e)i.baseVersion=t++}function Gg(e,t){for(let i=0;i{if(e.key===t.key&&e.range.start.hasSameParentAs(t.range.start)){let o=e.range.getDifference(t.range).map(s=>new ze(s,e.key,e.oldValue,e.newValue,0)),n=e.range.getIntersection(t.range);return n&&i.aIsStrong&&o.push(new ze(n,t.key,t.newValue,e.newValue,0)),o.length==0?[new Le(0)]:o}else return[e]});$(ze,Ye,(e,t)=>{if(e.range.start.hasSameParentAs(t.position)&&e.range.containsPosition(t.position)){let i=e.range._getTransformedByInsertion(t.position,t.howMany,!t.shouldReceiveAttributes).map(o=>new ze(o,e.key,e.oldValue,e.newValue,e.baseVersion));if(t.shouldReceiveAttributes){let o=Xp(t,e.key,e.oldValue);o&&i.unshift(o)}return i}return e.range=e.range._getTransformedByInsertion(t.position,t.howMany,!1)[0],[e]});function Xp(e,t,i){let o=e.nodes.getNode(0).getAttribute(t);if(o==i)return null;let n=new T(e.position,e.position.getShiftedBy(e.howMany));return new ze(n,t,o,i,0)}$(ze,xe,(e,t)=>{let i=[];e.range.start.hasSameParentAs(t.deletionPosition)&&(e.range.containsPosition(t.deletionPosition)||e.range.start.isEqual(t.deletionPosition))&&i.push(T._createFromPositionAndShift(t.graveyardPosition,1));let o=e.range._getTransformedByMergeOperation(t);return o.isCollapsed||i.push(o),i.map(n=>new ze(n,e.key,e.oldValue,e.newValue,e.baseVersion))});$(ze,Z,(e,t)=>mC(e.range,t).map(i=>new ze(i,e.key,e.oldValue,e.newValue,e.baseVersion)));function mC(e,t){let i=T._createFromPositionAndShift(t.sourcePosition,t.howMany),o=null,n=[];i.containsRange(e,!0)?o=e:e.start.hasSameParentAs(i.start)?(n=e.getDifference(i),o=e.getIntersection(i)):n=[e];let s=[];for(let r of n){r=r._getTransformedByDeletion(t.sourcePosition,t.howMany);let a=t.getMovedRangeStart(),l=r.start.hasSameParentAs(a),c=r._getTransformedByInsertion(a,t.howMany,l);s.push(...c)}return o&&s.push(o._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany,!1)[0]),s}$(ze,ee,(e,t)=>{if(e.range.end.isEqual(t.insertionPosition))return t.graveyardPosition||e.range.end.offset++,[e];if(e.range.start.hasSameParentAs(t.splitPosition)&&e.range.containsPosition(t.splitPosition)){let i=e.clone();return i.range=new T(t.moveTargetPosition.clone(),e.range.end._getCombined(t.splitPosition,t.moveTargetPosition)),e.range.end=t.splitPosition.clone(),e.range.end.stickiness="toPrevious",[e,i]}return e.range=e.range._getTransformedBySplitOperation(t),[e]});$(Ye,ze,(e,t)=>{let i=[e];if(e.shouldReceiveAttributes&&e.position.hasSameParentAs(t.range.start)&&t.range.containsPosition(e.position)){let o=Xp(e,t.key,t.newValue);o&&i.push(o)}return i});$(Ye,Ye,(e,t,i)=>e.position.isEqual(t.position)&&i.aIsStrong?[e]:(e.position=e.position._getTransformedByInsertOperation(t),[e]));$(Ye,Z,(e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e]));$(Ye,ee,(e,t)=>(e.position=e.position._getTransformedBySplitOperation(t),[e]));$(Ye,xe,(e,t)=>(e.position=e.position._getTransformedByMergeOperation(t),[e]));$(Vt,Ye,(e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByInsertOperation(t)[0]),e.newRange&&(e.newRange=e.newRange._getTransformedByInsertOperation(t)[0]),[e]));$(Vt,Vt,(e,t,i)=>{if(e.name==t.name)if(i.aIsStrong)e.oldRange=t.newRange?t.newRange.clone():null;else return[new Le(0)];return[e]});$(Vt,xe,(e,t)=>(e.oldRange&&(e.oldRange=e.oldRange._getTransformedByMergeOperation(t)),e.newRange&&(e.newRange=e.newRange._getTransformedByMergeOperation(t)),[e]));$(Vt,Z,(e,t)=>{let i=[e];if(e.oldRange&&(e.oldRange=T._createFromRanges(e.oldRange._getTransformedByMoveOperation(t))),e.newRange){let o=e.newRange._getTransformedByMoveOperation(t);e.newRange=o[0];for(let n=1;n{if(e.oldRange&&(e.oldRange=e.oldRange._getTransformedBySplitOperation(t)),e.newRange){if(i.abRelation){let o=e.newRange._getTransformedBySplitOperation(t);return e.newRange.start.isEqual(t.splitPosition)?i.abRelation.wasStartBeforeMergedElement?e.newRange.start=A._createAt(t.insertionPosition):i.abRelation.wasInLeftElement?e.newRange.start=A._createAt(e.newRange.start):e.newRange.start=A._createAt(t.moveTargetPosition):e.newRange.start=o.start,e.newRange.end.isEqual(t.splitPosition)?e.newRange.end.isEqual(t.splitPosition)&&i.abRelation.wasEndBeforeMergedElement?e.newRange.end=A._createAt(t.insertionPosition):i.abRelation.wasInRightElement?e.newRange.end=A._createAt(t.moveTargetPosition):e.newRange.end=A._createAt(e.newRange.end):e.newRange.end=o.end,[e]}e.newRange=e.newRange._getTransformedBySplitOperation(t)}return[e]});$(xe,Ye,(e,t)=>(e.sourcePosition.hasSameParentAs(t.position)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByInsertOperation(t),e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t),[e]));$(xe,xe,(e,t,i)=>{if(e.sourcePosition.isEqual(t.sourcePosition)&&e.targetPosition.isEqual(t.targetPosition))if(i.bWasUndone){let o=t.graveyardPosition.path.slice();return o.push(0),e.sourcePosition=new A(t.graveyardPosition.root,o),e.howMany=0,[e]}else return[new Le(0)];if(e.sourcePosition.isEqual(t.sourcePosition)&&!e.targetPosition.isEqual(t.targetPosition)&&!i.bWasUndone&&i.abRelation!="splitAtSource"){let o=e.targetPosition.root.rootName=="$graveyard",n=t.targetPosition.root.rootName=="$graveyard";if(n&&!o||!(o&&!n)&&i.aIsStrong){let s=t.targetPosition._getTransformedByMergeOperation(t),r=e.targetPosition._getTransformedByMergeOperation(t);return[new Z(s,e.howMany,r,0)]}else return[new Le(0)]}return e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition=e.sourcePosition._getTransformedByMergeOperation(t),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),(!e.graveyardPosition.isEqual(t.graveyardPosition)||!i.aIsStrong)&&(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]});$(xe,Z,(e,t,i)=>{let o=T._createFromPositionAndShift(t.sourcePosition,t.howMany);return t.type=="remove"&&!i.bWasUndone&&e.deletionPosition.hasSameParentAs(t.sourcePosition)&&o.containsPosition(e.sourcePosition)?[new Le(0)]:(t.sourcePosition.getShiftedBy(t.howMany).isEqual(e.sourcePosition)?e.sourcePosition.stickiness="toNone":t.targetPosition.isEqual(e.sourcePosition)&&i.abRelation=="mergeSourceAffected"?e.sourcePosition.stickiness="toNext":t.sourcePosition.isEqual(e.targetPosition)?(e.targetPosition.stickiness="toNone",e.howMany-=t.howMany):t.targetPosition.isEqual(e.targetPosition)&&i.abRelation=="mergeTargetWasBefore"?(e.targetPosition.stickiness="toPrevious",e.howMany+=t.howMany):(e.sourcePosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.sourcePosition.hasSameParentAs(t.sourcePosition)&&(e.howMany-=t.howMany)),e.sourcePosition=e.sourcePosition._getTransformedByMoveOperation(t),e.targetPosition=e.targetPosition._getTransformedByMoveOperation(t),e.sourcePosition.stickiness="toPrevious",e.targetPosition.stickiness="toNext",e.graveyardPosition.isEqual(t.targetPosition)||(e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)),[e])});$(xe,ee,(e,t,i)=>{if(t.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByDeletion(t.graveyardPosition,1),e.deletionPosition.isEqual(t.graveyardPosition)&&(e.howMany=t.howMany)),e.targetPosition.isEqual(t.splitPosition)&&(t.graveyardPosition&&e.deletionPosition.isEqual(t.graveyardPosition)||i.abRelation=="mergeTargetNotMoved"))return e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),[e];if(e.sourcePosition.isEqual(t.splitPosition)){if(i.abRelation=="mergeSourceNotMoved")return e.howMany=0,e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e];if(i.abRelation=="mergeSameElement"||e.sourcePosition.offset>0)return e.sourcePosition=t.moveTargetPosition.clone(),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]}return e.sourcePosition.hasSameParentAs(t.splitPosition)&&(e.howMany=t.splitPosition.offset),e.sourcePosition=e.sourcePosition._getTransformedBySplitOperation(t),e.targetPosition=e.targetPosition._getTransformedBySplitOperation(t),[e]});$(Z,Ye,(e,t)=>{let i=T._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByInsertOperation(t,!1)[0];return e.sourcePosition=i.start,e.howMany=i.end.offset-i.start.offset,e.targetPosition.isEqual(t.position)||(e.targetPosition=e.targetPosition._getTransformedByInsertOperation(t)),[e]});$(Z,Z,(e,t,i)=>{let o=T._createFromPositionAndShift(e.sourcePosition,e.howMany),n=T._createFromPositionAndShift(t.sourcePosition,t.howMany),s=i.aIsStrong,r=!i.aIsStrong;i.abRelation=="insertBefore"||i.baRelation=="insertAfter"?r=!0:(i.abRelation=="insertAfter"||i.baRelation=="insertBefore")&&(r=!1);let a;if(e.targetPosition.isEqual(t.targetPosition)&&r?a=e.targetPosition._getTransformedByDeletion(t.sourcePosition,t.howMany):a=e.targetPosition._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Zg(e,t)&&Zg(t,e))return[t.getReversed()];if(o.containsPosition(t.targetPosition)&&o.containsRange(n,!0))return o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Sn([o],a);if(n.containsPosition(e.targetPosition)&&n.containsRange(o,!0))return o.start=o.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),o.end=o.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),Sn([o],a);let l=Ce(e.sourcePosition.getParentPath(),t.sourcePosition.getParentPath());if(l=="prefix"||l=="extension")return o.start=o.start._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),o.end=o.end._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany),Sn([o],a);e.type=="remove"&&t.type!="remove"&&!i.aWasUndone&&!i.forceWeakRemove?s=!0:e.type!="remove"&&t.type=="remove"&&!i.bWasUndone&&!i.forceWeakRemove&&(s=!1);let c=[],u=o.getDifference(n);for(let h of u){h.start=h.start._getTransformedByDeletion(t.sourcePosition,t.howMany),h.end=h.end._getTransformedByDeletion(t.sourcePosition,t.howMany);let f=Ce(h.start.getParentPath(),t.getMovedRangeStart().getParentPath())=="same",m=h._getTransformedByInsertion(t.getMovedRangeStart(),t.howMany,f);c.push(...m)}let d=o.getIntersection(n);return d!==null&&s&&(d.start=d.start._getCombined(t.sourcePosition,t.getMovedRangeStart()),d.end=d.end._getCombined(t.sourcePosition,t.getMovedRangeStart()),c.length===0?c.push(d):c.length==1?n.start.isBefore(o.start)||n.start.isEqual(o.start)?c.unshift(d):c.push(d):c.splice(1,0,d)),c.length===0?[new Le(e.baseVersion)]:Sn(c,a)});$(Z,ee,(e,t,i)=>{let o=e.targetPosition.clone();if((!e.targetPosition.isEqual(t.insertionPosition)||!t.graveyardPosition||i.abRelation=="moveTargetAfter")&&(o=e.targetPosition._getTransformedBySplitOperation(t)),e.sourcePosition.isEqual(t.insertionPosition)&&i.abRelation=="firstToMoveMerged")return e.howMany++,e.targetPosition=o,[e];let n=T._createFromPositionAndShift(e.sourcePosition,e.howMany);if(n.end.isEqual(t.insertionPosition))return(!t.graveyardPosition||i.abRelation=="lastToMoveMerged")&&e.howMany++,e.targetPosition=o,[e];if(n.start.hasSameParentAs(t.splitPosition)&&n.containsPosition(t.splitPosition)){let r=new T(t.splitPosition,n.end);return r=r._getTransformedBySplitOperation(t),Sn([new T(n.start,t.splitPosition),r],o)}e.targetPosition.isEqual(t.splitPosition)&&i.abRelation=="insertAtSource"&&(o=t.moveTargetPosition),e.targetPosition.isEqual(t.insertionPosition)&&i.abRelation=="insertBetween"&&(o=e.targetPosition);let s=[n._getTransformedBySplitOperation(t)];if(t.graveyardPosition){let r=n.start.isEqual(t.graveyardPosition)||n.containsPosition(t.graveyardPosition);e.howMany>1&&r&&!i.aWasUndone&&s.push(T._createFromPositionAndShift(t.insertionPosition,1))}return Sn(s,o)});$(Z,xe,(e,t,i)=>{let o=T._createFromPositionAndShift(e.sourcePosition,e.howMany);if(t.deletionPosition.hasSameParentAs(e.sourcePosition)&&o.containsPosition(t.sourcePosition)){if(e.type=="remove"&&!i.forceWeakRemove){if(!i.aWasUndone){let s=[],r=t.graveyardPosition.clone(),a=t.targetPosition._getTransformedByMergeOperation(t),l=e.targetPosition.getTransformedByOperation(t);e.howMany>1&&(s.push(new Z(e.sourcePosition,e.howMany-1,l,0)),r=r._getTransformedByMove(e.sourcePosition,l,e.howMany-1),a=a._getTransformedByMove(e.sourcePosition,l,e.howMany-1));let c=t.deletionPosition._getCombined(e.sourcePosition,l),u=new Z(r,1,c,0),d=u.getMovedRangeStart().path.slice();d.push(0);let h=new A(u.targetPosition.root,d);a=a._getTransformedByMove(r,c,1);let f=new Z(a,t.howMany,h,0);return s.push(u),s.push(f),s}}else if(e.howMany==1)return i.bWasUndone?(e.sourcePosition=t.graveyardPosition.clone(),e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]):[new Le(0)]}let n=T._createFromPositionAndShift(e.sourcePosition,e.howMany)._getTransformedByMergeOperation(t);return e.sourcePosition=n.start,e.howMany=n.end.offset-n.start.offset,e.targetPosition=e.targetPosition._getTransformedByMergeOperation(t),[e]});$(Qt,Ye,(e,t)=>(e.position=e.position._getTransformedByInsertOperation(t),[e]));$(Qt,xe,(e,t)=>e.position.isEqual(t.deletionPosition)?(e.position=t.graveyardPosition.clone(),e.position.stickiness="toNext",[e]):(e.position=e.position._getTransformedByMergeOperation(t),[e]));$(Qt,Z,(e,t)=>(e.position=e.position._getTransformedByMoveOperation(t),[e]));$(Qt,Qt,(e,t,i)=>{if(e.position.isEqual(t.position))if(i.aIsStrong)e.oldName=t.newName;else return[new Le(0)];return[e]});$(Qt,ee,(e,t)=>{let i=e.position.path,o=t.splitPosition.getParentPath();return Ce(i,o)=="same"&&!t.graveyardPosition?[e,new Qt(e.position.getShiftedBy(1),e.oldName,e.newName,0)]:(e.position=e.position._getTransformedBySplitOperation(t),[e])});$(rr,rr,(e,t,i)=>{if(e.root===t.root&&e.key===t.key)if(i.aIsStrong)e.oldValue=t.newValue;else return[new Le(0)];return[e]});$(Vn,Vn,(e,t)=>e.rootName===t.rootName&&e.isAdd===t.isAdd?[new Le(0)]:[e]);$(ee,Ye,(e,t)=>(e.splitPosition.hasSameParentAs(t.position)&&e.splitPosition.offset{if(!e.graveyardPosition&&!i.bWasUndone&&e.splitPosition.hasSameParentAs(t.sourcePosition)){let o=t.graveyardPosition.path.slice();o.push(0);let n=new A(t.graveyardPosition.root,o),s=ee.getInsertionPosition(new A(t.graveyardPosition.root,o)),r=new ee(n,0,s,null,0);return e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=ee.getInsertionPosition(e.splitPosition),e.graveyardPosition=r.insertionPosition.clone(),e.graveyardPosition.stickiness="toNext",[r,e]}return e.splitPosition.hasSameParentAs(t.deletionPosition)&&!e.splitPosition.isAfter(t.deletionPosition)&&e.howMany--,e.splitPosition.hasSameParentAs(t.targetPosition)&&(e.howMany+=t.howMany),e.splitPosition=e.splitPosition._getTransformedByMergeOperation(t),e.insertionPosition=ee.getInsertionPosition(e.splitPosition),e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedByMergeOperation(t)),[e]});$(ee,Z,(e,t,i)=>{let o=T._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.graveyardPosition){let s=o.start.isEqual(e.graveyardPosition)||o.containsPosition(e.graveyardPosition);if(!i.bWasUndone&&s){let r=e.splitPosition._getTransformedByMoveOperation(t),a=e.graveyardPosition._getTransformedByMoveOperation(t),l=a.path.slice();l.push(0);let c=new A(a.root,l);return[new Z(r,e.howMany,c,0)]}e.graveyardPosition=e.graveyardPosition._getTransformedByMoveOperation(t)}let n=e.splitPosition.isEqual(t.targetPosition);if(n&&(i.baRelation=="insertAtSource"||i.abRelation=="splitBefore"))return e.howMany+=t.howMany,e.splitPosition=e.splitPosition._getTransformedByDeletion(t.sourcePosition,t.howMany),e.insertionPosition=ee.getInsertionPosition(e.splitPosition),[e];if(n&&i.abRelation&&i.abRelation.howMany){let{howMany:s,offset:r}=i.abRelation;return e.howMany+=s,e.splitPosition=e.splitPosition.getShiftedBy(r),[e]}if(e.splitPosition.hasSameParentAs(t.sourcePosition)&&o.containsPosition(e.splitPosition)){let s=t.howMany-(e.splitPosition.offset-t.sourcePosition.offset);return e.howMany-=s,e.splitPosition.hasSameParentAs(t.targetPosition)&&e.splitPosition.offset{if(e.splitPosition.isEqual(t.splitPosition)){if(!e.graveyardPosition&&!t.graveyardPosition)return[new Le(0)];if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition))return[new Le(0)];if(i.abRelation=="splitBefore")return e.howMany=0,e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t),[e]}if(e.graveyardPosition&&t.graveyardPosition&&e.graveyardPosition.isEqual(t.graveyardPosition)){let o=e.splitPosition.root.rootName=="$graveyard",n=t.splitPosition.root.rootName=="$graveyard";if(n&&!o||!(o&&!n)&&i.aIsStrong){let s=[];return t.howMany&&s.push(new Z(t.moveTargetPosition,t.howMany,t.splitPosition,0)),e.howMany&&s.push(new Z(e.splitPosition,e.howMany,e.moveTargetPosition,0)),s}else return[new Le(0)]}if(e.graveyardPosition&&(e.graveyardPosition=e.graveyardPosition._getTransformedBySplitOperation(t)),e.splitPosition.isEqual(t.insertionPosition)&&i.abRelation=="splitBefore")return e.howMany++,[e];if(t.splitPosition.isEqual(e.insertionPosition)&&i.baRelation=="splitBefore"){let o=t.insertionPosition.path.slice();o.push(0);let n=new A(t.insertionPosition.root,o);return[e,new Z(e.insertionPosition,1,n,0)]}return e.splitPosition.hasSameParentAs(t.splitPosition)&&e.splitPosition.offset{let n=o[0];!t&&!n.isDocumentOperation||gC.call(this,n)},{priority:"low"})}function gC(e){let t=this.getTransformedByOperation(e);if(!this.isEqual(t)){let i=this.toPosition();this.path=t.path,this.root=t.root,this.fire("change",i)}}/** +*/var gC=q(A),he=class extends gC{constructor(e,t,i="toNone",o){super(e,t,i);let n=o||(this.root.is("rootElement")?this.root.document.model:null);if(!n)throw new p("model-liveposition-no-model-reference",e);pC.call(this,n)}detach(){this.stopListening()}toPosition(){return new A(this.root,this.path.slice(),this.stickiness)}static fromPosition(e,t){return new this(e.root,e.path.slice(),t||e.stickiness)}static _fromPositionInDocumentFragment(e,t,i){return new this(e.root,e.path.slice(),i||e.stickiness,t)}};he.prototype.is=function(e){return e==="livePosition"||e==="model:livePosition"||e=="position"||e==="model:position"};function pC(e){let t=!this.root.is("rootElement");this.listenTo(e,"applyOperation",(i,o)=>{let n=o[0];!t&&!n.isDocumentOperation||bC.call(this,n)},{priority:"low"})}function bC(e){let t=this.getTransformedByOperation(e);if(!this.isEqual(t)){let i=this.toPosition();this.path=t.path,this.root=t.root,this.fire("change",i)}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */var Tn=class{operations;isUndoable;isLocal;isUndo;isTyping;constructor(e={}){typeof e=="string"&&(e=e==="transparent"?{isUndoable:!1}:{},D("batch-constructor-deprecated-string-type"));let{isUndoable:t=!0,isLocal:i=!0,isUndo:o=!1,isTyping:n=!1}=e;this.operations=[],this.isUndoable=t,this.isLocal=i,this.isUndo=o,this.isTyping=n}get baseVersion(){for(let e of this.operations)if(e.baseVersion!==null)return e.baseVersion;return null}addOperation(e){return e.isDocumentOperation&&(e.batch=this,this.operations.push(e)),e}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var pC=class dd{static _statesPriority=[void 0,"refresh","rename","move"];_markerCollection;_changesInElement=new Map;_elementsSnapshots=new Map;_elementChildrenSnapshots=new Map;_elementState=new Map;_changedMarkers=new Map;_changedRoots=new Map;_changeCount=0;_cachedChanges=null;_cachedChangesWithGraveyard=null;_refreshedItems=new Set;constructor(t){this._markerCollection=t}get isEmpty(){return this._changesInElement.size==0&&this._changedMarkers.size==0&&this._changedRoots.size==0}bufferOperation(t){let i=t;switch(i.type){case"insert":if(this._isInInsertedElement(i.position.parent))return;this._markInsert(i.position.parent,i.position.offset,i.nodes.maxOffset);break;case"addAttribute":case"removeAttribute":case"changeAttribute":for(let o of i.range.getItems({shallow:!0}))this._isInInsertedElement(o.parent)||this._markAttribute(o);break;case"remove":case"move":case"reinsert":{if(i.sourcePosition.isEqual(i.targetPosition)||i.sourcePosition.getShiftedBy(i.howMany).isEqual(i.targetPosition))return;let o=this._isInInsertedElement(i.sourcePosition.parent),n=this._isInInsertedElement(i.targetPosition.parent);o||this._markRemove(i.sourcePosition.parent,i.sourcePosition.offset,i.howMany),n||this._markInsert(i.targetPosition.parent,i.getMovedRangeStart().offset,i.howMany);let s=T._createFromPositionAndShift(i.sourcePosition,i.howMany);for(let r of s.getItems({shallow:!0}))this._setElementState(r,"move");break}case"rename":{if(this._isInInsertedElement(i.position.parent))return;this._markRemove(i.position.parent,i.position.offset,1),this._markInsert(i.position.parent,i.position.offset,1);let o=T._createFromPositionAndShift(i.position,1);for(let n of this._markerCollection.getMarkersIntersectingRange(o)){let s=n.getData();this.bufferMarkerChange(n.name,s,s)}this._setElementState(i.position.nodeAfter,"rename");break}case"split":{let o=i.splitPosition.parent;if(!this._isInInsertedElement(o)){this._markRemove(o,i.splitPosition.offset,i.howMany);let n=T._createFromPositionAndShift(i.splitPosition,i.howMany);for(let s of n.getItems({shallow:!0}))this._setElementState(s,"move")}this._isInInsertedElement(i.insertionPosition.parent)||this._markInsert(i.insertionPosition.parent,i.insertionPosition.offset,1),i.graveyardPosition&&(this._markRemove(i.graveyardPosition.parent,i.graveyardPosition.offset,1),this._setElementState(i.graveyardPosition.nodeAfter,"move"));break}case"merge":{let o=i.sourcePosition.parent;this._isInInsertedElement(o.parent)||this._markRemove(o.parent,o.startOffset,1);let n=i.graveyardPosition.parent;this._markInsert(n,i.graveyardPosition.offset,1),this._setElementState(o,"move");let s=i.targetPosition.parent;if(!this._isInInsertedElement(s)){this._markInsert(s,i.targetPosition.offset,o.maxOffset);let r=T._createFromPositionAndShift(i.sourcePosition,i.howMany);for(let a of r.getItems({shallow:!0}))this._setElementState(a,"move")}break}case"detachRoot":case"addRoot":{let o=i.affectedSelectable;if(!o._isLoaded||o.isAttached()==i.isAdd)return;this._bufferRootStateChange(i.rootName,i.isAdd);break}case"addRootAttribute":case"removeRootAttribute":case"changeRootAttribute":{if(!i.root._isLoaded)return;let o=i.root.rootName;this._bufferRootAttributeChange(o,i.key,i.oldValue,i.newValue);break}}this._cachedChanges=null}bufferMarkerChange(t,i,o){i.range&&i.range.root.is("rootElement")&&!i.range.root._isLoaded&&(i.range=null),o.range&&o.range.root.is("rootElement")&&!o.range.root._isLoaded&&(o.range=null);let n=this._changedMarkers.get(t);n?n.newMarkerData=o:(n={newMarkerData:o,oldMarkerData:i},this._changedMarkers.set(t,n)),n.oldMarkerData.range==null&&o.range==null&&this._changedMarkers.delete(t)}getMarkersToRemove(){let t=[];for(let[i,o]of this._changedMarkers)o.oldMarkerData.range!=null&&t.push({name:i,range:o.oldMarkerData.range});return t}getMarkersToAdd(){let t=[];for(let[i,o]of this._changedMarkers)o.newMarkerData.range!=null&&t.push({name:i,range:o.newMarkerData.range});return t}getChangedMarkers(){return Array.from(this._changedMarkers).map(([t,i])=>({name:t,data:{oldRange:i.oldMarkerData.range,newRange:i.newMarkerData.range}}))}hasDataChanges(){if(this.getChanges().length||this._changedRoots.size>0)return!0;for(let{newMarkerData:t,oldMarkerData:i}of this._changedMarkers.values()){if(t.affectsData!==i.affectsData)return!0;if(t.affectsData){let o=t.range&&!i.range,n=!t.range&&i.range,s=t.range&&i.range&&!t.range.isEqual(i.range);if(o||n||s)return!0}}return!1}getChanges(t={}){if(this._cachedChanges)return t.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();let i=[];for(let o of this._changesInElement.keys()){let n=this._changesInElement.get(o).sort((u,d)=>u.offset===d.offset?u.type!=d.type?u.type=="remove"?-1:1:0:u.offseto.position.root!=n.position.root?o.position.root.rootNameo);for(let o of i)delete o.changeCount,o.type=="attribute"&&(delete o.position,delete o.length);return this._changeCount=0,this._cachedChangesWithGraveyard=i,this._cachedChanges=i.filter(wC),t.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice()}getChangedRoots(){return Array.from(this._changedRoots.values()).map(t=>{let i={...t};return i.state!==void 0&&delete i.attributes,i})}getRefreshedItems(){return new Set(this._refreshedItems)}reset(){this._changesInElement.clear(),this._elementChildrenSnapshots.clear(),this._elementsSnapshots.clear(),this._elementState.clear(),this._changedMarkers.clear(),this._changedRoots.clear(),this._refreshedItems.clear(),this._cachedChanges=null}_refreshItem(t){if(this._isInInsertedElement(t.parent))return;this._markRemove(t.parent,t.startOffset,t.offsetSize),this._markInsert(t.parent,t.startOffset,t.offsetSize),this._refreshedItems.add(t),this._setElementState(t,"refresh");let i=T._createOn(t);for(let o of this._markerCollection.getMarkersIntersectingRange(i)){let n=o.getData();this.bufferMarkerChange(o.name,n,n)}this._cachedChanges=null}_bufferRootLoad(t){if(t.isAttached()){this._bufferRootStateChange(t.rootName,!0),this._markInsert(t,0,t.maxOffset);for(let i of t.getAttributeKeys())this._bufferRootAttributeChange(t.rootName,i,null,t.getAttribute(i));for(let i of this._markerCollection)if(i.getRange().root==t){let o=i.getData();this.bufferMarkerChange(i.name,{...o,range:null},o)}}}_bufferRootStateChange(t,i){if(!this._changedRoots.has(t)){this._changedRoots.set(t,{name:t,state:i?"attached":"detached"});return}let o=this._changedRoots.get(t);o.state!==void 0?(delete o.state,o.attributes===void 0&&this._changedRoots.delete(t)):o.state=i?"attached":"detached"}_bufferRootAttributeChange(t,i,o,n){let s=this._changedRoots.get(t)||{name:t},r=s.attributes||{};if(r[i]){let a=r[i];n===a.oldValue?delete r[i]:a.newValue=n}else r[i]={oldValue:o,newValue:n};Object.entries(r).length===0?(delete s.attributes,s.state===void 0&&this._changedRoots.delete(t)):(s.attributes=r,this._changedRoots.set(t,s))}_markInsert(t,i,o){if(t.root.is("rootElement")&&!t.root._isLoaded)return;let n={type:"insert",offset:i,howMany:o,count:this._changeCount++};this._markChange(t,n)}_markRemove(t,i,o){if(t.root.is("rootElement")&&!t.root._isLoaded)return;let n={type:"remove",offset:i,howMany:o,count:this._changeCount++};this._markChange(t,n),this._removeAllNestedChanges(t,i,o)}_markAttribute(t){if(t.root.is("rootElement")&&!t.root._isLoaded)return;let i={type:"attribute",offset:t.startOffset,howMany:t.offsetSize,count:this._changeCount++};this._markChange(t.parent,i)}_markChange(t,i){this._makeSnapshots(t);let o=this._getChangesForElement(t);this._handleChange(i,o),o.push(i);for(let n=0;no&&this._elementState.set(t,i)}_getDiffActionForNode(t,i){if(!t.is("element")||!this._elementsSnapshots.has(t))return i;let o=this._elementState.get(t);return!o||o=="move"?i:o}_getChangesForElement(t){let i;return this._changesInElement.has(t)?i=this._changesInElement.get(t):(i=[],this._changesInElement.set(t,i)),i}_makeSnapshots(t){if(this._elementChildrenSnapshots.has(t))return;let i=Zg(t.getChildren());this._elementChildrenSnapshots.set(t,i);for(let o of i)this._elementsSnapshots.set(o.node,o)}_handleChange(t,i){t.nodesToHandle=t.howMany;for(let o of i){let n=t.offset+t.howMany,s=o.offset+o.howMany;if(t.type=="insert"&&(o.type=="insert"&&(t.offset<=o.offset?o.offset+=t.howMany:t.offseto.offset){if(n>s){let r={type:"attribute",offset:s,howMany:n-s,count:this._changeCount++};this._handleChange(r,i),i.push(r)}t.nodesToHandle=o.offset-t.offset,t.howMany=t.nodesToHandle}else t.offset>=o.offset&&t.offsets?(t.nodesToHandle=n-s,t.offset=s):t.nodesToHandle=0);if(o.type=="remove"&&t.offseto.offset){let r={type:"attribute",offset:o.offset,howMany:n-o.offset,count:this._changeCount++};this._handleChange(r,i),i.push(r),t.nodesToHandle=o.offset-t.offset,t.howMany=t.nodesToHandle}o.type=="attribute"&&(t.offset>=o.offset&&n<=s?(t.nodesToHandle=0,t.howMany=0,t.offset=0):t.offset<=o.offset&&n>=s&&(o.howMany=0))}}t.howMany=t.nodesToHandle,delete t.nodesToHandle}_getInsertDiff(t,i,o,n,s){let r={type:"insert",position:A._createAt(t,i),name:n.name,attributes:new Map(n.attributes),length:1,changeCount:this._changeCount++,action:o};return o!="insert"&&s&&(r.before={name:s.name,attributes:new Map(s.attributes)}),r}_getRemoveDiff(t,i,o,n){return{type:"remove",action:o,position:A._createAt(t,i),name:n.name,attributes:new Map(n.attributes),length:1,changeCount:this._changeCount++}}_getAttributesDiff(t,i,o){let n=[];o=new Map(o);for(let[s,r]of i){let a=o.has(s)?o.get(s):null;a!==r&&n.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:s,attributeOldValue:r,attributeNewValue:a,changeCount:this._changeCount++}),o.delete(s)}for(let[s,r]of o)n.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:s,attributeOldValue:null,attributeNewValue:r,changeCount:this._changeCount++});return n}_isInInsertedElement(t){let i=t.parent;if(!i)return!1;let o=this._changesInElement.get(i),n=t.startOffset;if(o){for(let s of o)if(s.type=="insert"&&n>=s.offset&&no){for(let r=0;r1500)for(let r=0;r({name:t,data:{oldRange:i.oldMarkerData.range,newRange:i.newMarkerData.range}}))}hasDataChanges(){if(this.getChanges().length||this._changedRoots.size>0)return!0;for(let{newMarkerData:t,oldMarkerData:i}of this._changedMarkers.values()){if(t.affectsData!==i.affectsData)return!0;if(t.affectsData){let o=t.range&&!i.range,n=!t.range&&i.range,s=t.range&&i.range&&!t.range.isEqual(i.range);if(o||n||s)return!0}}return!1}getChanges(t={}){if(this._cachedChanges)return t.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();let i=[];for(let o of this._changesInElement.keys()){let n=this._changesInElement.get(o).sort((u,d)=>u.offset===d.offset?u.type!=d.type?u.type=="remove"?-1:1:0:u.offseto.position.root!=n.position.root?o.position.root.rootNameo);for(let o of i)delete o.changeCount,o.type=="attribute"&&(delete o.position,delete o.length);return this._changeCount=0,this._cachedChangesWithGraveyard=i,this._cachedChanges=i.filter(_C),t.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice()}getChangedRoots(){return Array.from(this._changedRoots.values()).map(t=>{let i={...t};return i.state!==void 0&&delete i.attributes,i})}getRefreshedItems(){return new Set(this._refreshedItems)}reset(){this._changesInElement.clear(),this._elementChildrenSnapshots.clear(),this._elementsSnapshots.clear(),this._elementState.clear(),this._changedMarkers.clear(),this._changedRoots.clear(),this._refreshedItems.clear(),this._cachedChanges=null}_refreshItem(t){if(this._isInInsertedElement(t.parent))return;this._markRemove(t.parent,t.startOffset,t.offsetSize),this._markInsert(t.parent,t.startOffset,t.offsetSize),this._refreshedItems.add(t),this._setElementState(t,"refresh");let i=T._createOn(t);for(let o of this._markerCollection.getMarkersIntersectingRange(i)){let n=o.getData();this.bufferMarkerChange(o.name,n,n)}this._cachedChanges=null}_bufferRootLoad(t){if(t.isAttached()){this._bufferRootStateChange(t.rootName,!0),this._markInsert(t,0,t.maxOffset);for(let i of t.getAttributeKeys())this._bufferRootAttributeChange(t.rootName,i,null,t.getAttribute(i));for(let i of this._markerCollection)if(i.getRange().root==t){let o=i.getData();this.bufferMarkerChange(i.name,{...o,range:null},o)}}}_bufferRootStateChange(t,i){if(!this._changedRoots.has(t)){this._changedRoots.set(t,{name:t,state:i?"attached":"detached"});return}let o=this._changedRoots.get(t);o.state!==void 0?(delete o.state,o.attributes===void 0&&this._changedRoots.delete(t)):o.state=i?"attached":"detached"}_bufferRootAttributeChange(t,i,o,n){let s=this._changedRoots.get(t)||{name:t},r=s.attributes||{};if(r[i]){let a=r[i];n===a.oldValue?delete r[i]:a.newValue=n}else r[i]={oldValue:o,newValue:n};Object.entries(r).length===0?(delete s.attributes,s.state===void 0&&this._changedRoots.delete(t)):(s.attributes=r,this._changedRoots.set(t,s))}_markInsert(t,i,o){if(t.root.is("rootElement")&&!t.root._isLoaded)return;let n={type:"insert",offset:i,howMany:o,count:this._changeCount++};this._markChange(t,n)}_markRemove(t,i,o){if(t.root.is("rootElement")&&!t.root._isLoaded)return;let n={type:"remove",offset:i,howMany:o,count:this._changeCount++};this._markChange(t,n),this._removeAllNestedChanges(t,i,o)}_markAttribute(t){if(t.root.is("rootElement")&&!t.root._isLoaded)return;let i={type:"attribute",offset:t.startOffset,howMany:t.offsetSize,count:this._changeCount++};this._markChange(t.parent,i)}_markChange(t,i){this._makeSnapshots(t);let o=this._getChangesForElement(t);this._handleChange(i,o),o.push(i);for(let n=0;no&&this._elementState.set(t,i)}_getDiffActionForNode(t,i){if(!t.is("element")||!this._elementsSnapshots.has(t))return i;let o=this._elementState.get(t);return!o||o=="move"?i:o}_getChangesForElement(t){let i;return this._changesInElement.has(t)?i=this._changesInElement.get(t):(i=[],this._changesInElement.set(t,i)),i}_makeSnapshots(t){if(this._elementChildrenSnapshots.has(t))return;let i=Yg(t.getChildren());this._elementChildrenSnapshots.set(t,i);for(let o of i)this._elementsSnapshots.set(o.node,o)}_handleChange(t,i){t.nodesToHandle=t.howMany;for(let o of i){let n=t.offset+t.howMany,s=o.offset+o.howMany;if(t.type=="insert"&&(o.type=="insert"&&(t.offset<=o.offset?o.offset+=t.howMany:t.offseto.offset){if(n>s){let r={type:"attribute",offset:s,howMany:n-s,count:this._changeCount++};this._handleChange(r,i),i.push(r)}t.nodesToHandle=o.offset-t.offset,t.howMany=t.nodesToHandle}else t.offset>=o.offset&&t.offsets?(t.nodesToHandle=n-s,t.offset=s):t.nodesToHandle=0);if(o.type=="remove"&&t.offseto.offset){let r={type:"attribute",offset:o.offset,howMany:n-o.offset,count:this._changeCount++};this._handleChange(r,i),i.push(r),t.nodesToHandle=o.offset-t.offset,t.howMany=t.nodesToHandle}o.type=="attribute"&&(t.offset>=o.offset&&n<=s?(t.nodesToHandle=0,t.howMany=0,t.offset=0):t.offset<=o.offset&&n>=s&&(o.howMany=0))}}t.howMany=t.nodesToHandle,delete t.nodesToHandle}_getInsertDiff(t,i,o,n,s){let r={type:"insert",position:A._createAt(t,i),name:n.name,attributes:new Map(n.attributes),length:1,changeCount:this._changeCount++,action:o};return o!="insert"&&s&&(r.before={name:s.name,attributes:new Map(s.attributes)}),r}_getRemoveDiff(t,i,o,n){return{type:"remove",action:o,position:A._createAt(t,i),name:n.name,attributes:new Map(n.attributes),length:1,changeCount:this._changeCount++}}_getAttributesDiff(t,i,o){let n=[];o=new Map(o);for(let[s,r]of i){let a=o.has(s)?o.get(s):null;a!==r&&n.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:s,attributeOldValue:r,attributeNewValue:a,changeCount:this._changeCount++}),o.delete(s)}for(let[s,r]of o)n.push({type:"attribute",position:t.start,range:t.clone(),length:1,attributeKey:s,attributeOldValue:null,attributeNewValue:r,changeCount:this._changeCount++});return n}_isInInsertedElement(t){let i=t.parent;if(!i)return!1;let o=this._changesInElement.get(i),n=t.startOffset;if(o){for(let s of o)if(s.type=="insert"&&n>=s.offset&&no){for(let r=0;r1500)for(let r=0;rthis._version+1&&this._gaps.set(this._version,e),this._version=e}get lastOperation(){return this._operations[this._operations.length-1]}addOperation(e){if(e.baseVersion!==this.version)throw new p("model-document-history-addoperation-incorrect-version",this,{operation:e,historyVersion:this.version});this._operations.push(e),this._version++,this._baseVersionToOperationIndex.set(e.baseVersion,this._operations.length-1)}getOperations(e,t=this.version){if(!this._operations.length)return[];let i=this._operations[0];e===void 0&&(e=i.baseVersion);let o=t-1;for(let[r,a]of this._gaps)e>r&&er&&othis.lastOperation.baseVersion)return[];let n=this._baseVersionToOperationIndex.get(e);n===void 0&&(n=0);let s=this._baseVersionToOperationIndex.get(o);return s===void 0&&(s=this._operations.length-1),this._operations.slice(n,s+1)}getOperation(e){let t=this._baseVersionToOperationIndex.get(e);if(t!==void 0)return this._operations[t]}setOperationAsUndone(e,t){this._undoPairs.set(t,e),this._undoneOperations.add(e)}isUndoingOperation(e){return this._undoPairs.has(e)}isUndoneOperation(e){return this._undoneOperations.has(e)}getUndoneOperation(e){return this._undoPairs.get(e)}reset(){this._version=0,this._undoPairs=new Map,this._operations=[],this._undoneOperations=new Set,this._gaps=new Map,this._baseVersionToOperationIndex=new Map}};/** +*/var vC=class{_operations=[];_undoPairs=new Map;_undoneOperations=new Set;_baseVersionToOperationIndex=new Map;_version=0;_gaps=new Map;get version(){return this._version}set version(e){this._operations.length&&e>this._version+1&&this._gaps.set(this._version,e),this._version=e}get lastOperation(){return this._operations[this._operations.length-1]}addOperation(e){if(e.baseVersion!==this.version)throw new p("model-document-history-addoperation-incorrect-version",this,{operation:e,historyVersion:this.version});this._operations.push(e),this._version++,this._baseVersionToOperationIndex.set(e.baseVersion,this._operations.length-1)}getOperations(e,t=this.version){if(!this._operations.length)return[];let i=this._operations[0];e===void 0&&(e=i.baseVersion);let o=t-1;for(let[r,a]of this._gaps)e>r&&er&&othis.lastOperation.baseVersion)return[];let n=this._baseVersionToOperationIndex.get(e);n===void 0&&(n=0);let s=this._baseVersionToOperationIndex.get(o);return s===void 0&&(s=this._operations.length-1),this._operations.slice(n,s+1)}getOperation(e){let t=this._baseVersionToOperationIndex.get(e);if(t!==void 0)return this._operations[t]}setOperationAsUndone(e,t){this._undoPairs.set(t,e),this._undoneOperations.add(e)}isUndoingOperation(e){return this._undoPairs.has(e)}isUndoneOperation(e){return this._undoneOperations.has(e)}getUndoneOperation(e){return this._undoPairs.get(e)}reset(){this._version=0,this._undoPairs=new Map,this._operations=[],this._undoneOperations=new Set,this._gaps=new Map,this._baseVersionToOperationIndex=new Map}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var ol=class extends ie{rootName;_document;_isAttached=!0;_isLoaded=!0;constructor(e,t,i="main"){super(t),this._document=e,this.rootName=i}get document(){return this._document}isAttached(){return this._isAttached}toJSON(){return this.rootName}};ol.prototype.is=function(e,t){return t?t===this.name&&(e==="rootElement"||e==="model:rootElement"||e==="element"||e==="model:element"):e==="rootElement"||e==="model:rootElement"||e==="element"||e==="model:element"||e==="node"||e==="model:node"};/** +*/var nl=class extends ie{rootName;_document;_isAttached=!0;_isLoaded=!0;constructor(e,t,i="main"){super(t),this._document=e,this.rootName=i}get document(){return this._document}isAttached(){return this._isAttached}toJSON(){return this.rootName}};nl.prototype.is=function(e,t){return t?t===this.name&&(e==="rootElement"||e==="model:rootElement"||e==="element"||e==="model:element"):e==="rootElement"||e==="model:rootElement"||e==="element"||e==="model:element"||e==="node"||e==="model:node"};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Qg="$graveyard",_C=q(),vC=class extends _C{model;history;selection;roots;differ;isReadOnly;_postFixers;_hasSelectionChangedFromTheLastChangeBlock;constructor(e){super(),this.model=e,this.history=new yC,this.selection=new Ce(this),this.roots=new J({idProperty:"rootName"}),this.differ=new pC(e.markers),this.isReadOnly=!1,this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root",Qg),this.listenTo(e,"applyOperation",(t,i)=>{let o=i[0];o.isDocumentOperation&&this.differ.bufferOperation(o)},{priority:"high"}),this.listenTo(e,"applyOperation",(t,i)=>{let o=i[0];o.isDocumentOperation&&this.history.addOperation(o)},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(e.markers,"update",(t,i,o,n,s)=>{let r={...i.getData(),range:n};this.differ.bufferMarkerChange(i.name,s,r),o===null&&i.on("change",(a,l)=>{let c=i.getData();this.differ.bufferMarkerChange(i.name,{...c,range:l},c)})}),this.registerPostFixer(t=>{let i=!1;for(let o of this.roots)!o.isAttached()&&!o.isEmpty&&(t.remove(t.createRangeIn(o)),i=!0);for(let o of this.model.markers)o.getRange().root.isAttached()||(t.removeMarker(o),i=!0);return i})}get version(){return this.history.version}set version(e){this.history.version=e}get graveyard(){return this.getRoot(Qg)}createRoot(e="$root",t="main"){if(this.roots.get(t))throw new p("model-document-createroot-name-exists",this,{name:t});let i=new ol(this,e,t);return this.roots.add(i),i}destroy(){this.selection.destroy(),this.stopListening()}getRoot(e="main"){return this.roots.get(e)}getRootNames(e=!1){return this.getRoots(e).map(t=>t.rootName)}getRoots(e=!1){return this.roots.filter(t=>t!=this.graveyard&&(e||t.isAttached())&&t._isLoaded)}registerPostFixer(e){this._postFixers.add(e)}toJSON(){let e=cu(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}_handleChangeBlock(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){let e=this.getRoots();return e.length?e[0]:this.graveyard}_getDefaultRange(){let e=this._getDefaultRoot(),t=this.model,i=t.schema,o=t.createPositionFromPath(e,[0]);return i.getNearestSelectionRange(o)||t.createRange(o)}_validateSelectionRange(e){return e.start.isValid()&&e.end.isValid()&&Yg(e.start)&&Yg(e.end)}_callPostFixers(e){let t=!1;do for(let i of this._postFixers)if(this.selection.refresh(),t=i(e),t)break;while(t)}};function Yg(e){let t=e.textNode;if(t){let i=t.data,o=e.offset-t.startOffset;return!Ds(i,o)&&!Fs(i,o)}return!0}/** +*/var Xg="$graveyard",kC=q(),CC=class extends kC{model;history;selection;roots;differ;isReadOnly;_postFixers;_hasSelectionChangedFromTheLastChangeBlock;constructor(e){super(),this.model=e,this.history=new vC,this.selection=new Te(this),this.roots=new G({idProperty:"rootName"}),this.differ=new wC(e.markers),this.isReadOnly=!1,this._postFixers=new Set,this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot("$root",Xg),this.listenTo(e,"applyOperation",(t,i)=>{let o=i[0];o.isDocumentOperation&&this.differ.bufferOperation(o)},{priority:"high"}),this.listenTo(e,"applyOperation",(t,i)=>{let o=i[0];o.isDocumentOperation&&this.history.addOperation(o)},{priority:"low"}),this.listenTo(this.selection,"change",()=>{this._hasSelectionChangedFromTheLastChangeBlock=!0}),this.listenTo(e.markers,"update",(t,i,o,n,s)=>{let r={...i.getData(),range:n};this.differ.bufferMarkerChange(i.name,s,r),o===null&&i.on("change",(a,l)=>{let c=i.getData();this.differ.bufferMarkerChange(i.name,{...c,range:l},c)})}),this.registerPostFixer(t=>{let i=!1;for(let o of this.roots)!o.isAttached()&&!o.isEmpty&&(t.remove(t.createRangeIn(o)),i=!0);for(let o of this.model.markers)o.getRange().root.isAttached()||(t.removeMarker(o),i=!0);return i})}get version(){return this.history.version}set version(e){this.history.version=e}get graveyard(){return this.getRoot(Xg)}createRoot(e="$root",t="main"){if(this.roots.get(t))throw new p("model-document-createroot-name-exists",this,{name:t});let i=new nl(this,e,t);return this.roots.add(i),i}destroy(){this.selection.destroy(),this.stopListening()}getRoot(e="main"){return this.roots.get(e)}getRootNames(e=!1){return this.getRoots(e).map(t=>t.rootName)}getRoots(e=!1){return this.roots.filter(t=>t!=this.graveyard&&(e||t.isAttached())&&t._isLoaded)}registerPostFixer(e){this._postFixers.add(e)}toJSON(){let e=du(this);return e.selection="[engine.model.DocumentSelection]",e.model="[engine.model.Model]",e}_handleChangeBlock(e){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(e),this.selection.refresh(),this.differ.hasDataChanges()?this.fire("change:data",e.batch):this.fire("change",e.batch),this.selection.refresh(),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1}_hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock}_getDefaultRoot(){let e=this.getRoots();return e.length?e[0]:this.graveyard}_getDefaultRange(){let e=this._getDefaultRoot(),t=this.model,i=t.schema,o=t.createPositionFromPath(e,[0]);return i.getNearestSelectionRange(o)||t.createRange(o)}_validateSelectionRange(e){return e.start.isValid()&&e.end.isValid()&&ep(e.start)&&ep(e.end)}_callPostFixers(e){let t=!1;do for(let i of this._postFixers)if(this.selection.refresh(),t=i(e),t)break;while(t)}};function ep(e){let t=e.textNode;if(t){let i=t.data,o=e.offset-t.startOffset;return!Ds(i,o)&&!Fs(i,o)}return!0}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var kC=q(),CC=q(Wi),xC=class extends kC{_markers=new Map;[Symbol.iterator](){return this._markers.values()}has(e){let t=e instanceof En?e.name:e;return this._markers.has(t)}get(e){return this._markers.get(e)||null}_set(e,t,i=!1,o=!1){let n=e instanceof En?e.name:e;if(n.includes(","))throw new p("markercollection-incorrect-marker-name",this);let s=this._markers.get(n);if(s){let l=s.getData(),c=s.getRange(),u=!1;return c.isEqual(t)||(s._attachLiveRange(Qe.fromRange(t)),u=!0),i!=s.managedUsingOperations&&(s._managedUsingOperations=i,u=!0),typeof o=="boolean"&&o!=s.affectsData&&(s._affectsData=o,u=!0),u&&this.fire(`update:${n}`,s,c,t,l),s}let r=Qe.fromRange(t),a=new En(n,r,i,o);return this._markers.set(n,a),this.fire(`update:${n}`,a,null,t,{...a.getData(),range:null}),a}_remove(e){let t=e instanceof En?e.name:e,i=this._markers.get(t);return i?(this._markers.delete(t),this.fire(`update:${t}`,i,i.getRange(),null,i.getData()),this._destroyMarker(i),!0):!1}_refresh(e){let t=e instanceof En?e.name:e,i=this._markers.get(t);if(!i)throw new p("markercollection-refresh-marker-not-exists",this);let o=i.getRange();this.fire(`update:${t}`,i,o,o,i.getData())}*getMarkersAtPosition(e){for(let t of this)t.getRange().containsPosition(e)&&(yield t)}*getMarkersIntersectingRange(e){for(let t of this)t.getRange().getIntersection(e)!==null&&(yield t)}destroy(){for(let e of this._markers.values())this._destroyMarker(e);this._markers.clear(),this.stopListening()}*getMarkersGroup(e){for(let t of this._markers.values())t.name.startsWith(e+":")&&(yield t)}_destroyMarker(e){e.stopListening(),e._detachLiveRange()}},En=class extends CC{name;_managedUsingOperations;_affectsData;_liveRange;constructor(e,t,i,o){super(),this.name=e,this._liveRange=this._attachLiveRange(t),this._managedUsingOperations=i,this._affectsData=o}get managedUsingOperations(){if(!this._liveRange)throw new p("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new p("marker-destroyed",this);return this._affectsData}getData(){return{range:this.getRange(),affectsData:this.affectsData,managedUsingOperations:this.managedUsingOperations}}getStart(){if(!this._liveRange)throw new p("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new p("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new p("marker-destroyed",this);return this._liveRange.toRange()}toJSON(){return{name:this.name,range:this._liveRange?.toJSON(),usingOperations:this._managedUsingOperations,affectsData:this._affectsData}}_attachLiveRange(e){return this._liveRange&&this._detachLiveRange(),e.delegate("change:range").to(this),e.delegate("change:content").to(this),this._liveRange=e,e}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}};En.prototype.is=function(e){return e==="marker"||e==="model:marker"};/** +*/var xC=q(),TC=q(qi),EC=class extends xC{_markers=new Map;[Symbol.iterator](){return this._markers.values()}has(e){let t=e instanceof En?e.name:e;return this._markers.has(t)}get(e){return this._markers.get(e)||null}_set(e,t,i=!1,o=!1){let n=e instanceof En?e.name:e;if(n.includes(","))throw new p("markercollection-incorrect-marker-name",this);let s=this._markers.get(n);if(s){let l=s.getData(),c=s.getRange(),u=!1;return c.isEqual(t)||(s._attachLiveRange(Qe.fromRange(t)),u=!0),i!=s.managedUsingOperations&&(s._managedUsingOperations=i,u=!0),typeof o=="boolean"&&o!=s.affectsData&&(s._affectsData=o,u=!0),u&&this.fire(`update:${n}`,s,c,t,l),s}let r=Qe.fromRange(t),a=new En(n,r,i,o);return this._markers.set(n,a),this.fire(`update:${n}`,a,null,t,{...a.getData(),range:null}),a}_remove(e){let t=e instanceof En?e.name:e,i=this._markers.get(t);return i?(this._markers.delete(t),this.fire(`update:${t}`,i,i.getRange(),null,i.getData()),this._destroyMarker(i),!0):!1}_refresh(e){let t=e instanceof En?e.name:e,i=this._markers.get(t);if(!i)throw new p("markercollection-refresh-marker-not-exists",this);let o=i.getRange();this.fire(`update:${t}`,i,o,o,i.getData())}*getMarkersAtPosition(e){for(let t of this)t.getRange().containsPosition(e)&&(yield t)}*getMarkersIntersectingRange(e){for(let t of this)t.getRange().getIntersection(e)!==null&&(yield t)}destroy(){for(let e of this._markers.values())this._destroyMarker(e);this._markers.clear(),this.stopListening()}*getMarkersGroup(e){for(let t of this._markers.values())t.name.startsWith(e+":")&&(yield t)}_destroyMarker(e){e.stopListening(),e._detachLiveRange()}},En=class extends TC{name;_managedUsingOperations;_affectsData;_liveRange;constructor(e,t,i,o){super(),this.name=e,this._liveRange=this._attachLiveRange(t),this._managedUsingOperations=i,this._affectsData=o}get managedUsingOperations(){if(!this._liveRange)throw new p("marker-destroyed",this);return this._managedUsingOperations}get affectsData(){if(!this._liveRange)throw new p("marker-destroyed",this);return this._affectsData}getData(){return{range:this.getRange(),affectsData:this.affectsData,managedUsingOperations:this.managedUsingOperations}}getStart(){if(!this._liveRange)throw new p("marker-destroyed",this);return this._liveRange.start.clone()}getEnd(){if(!this._liveRange)throw new p("marker-destroyed",this);return this._liveRange.end.clone()}getRange(){if(!this._liveRange)throw new p("marker-destroyed",this);return this._liveRange.toRange()}toJSON(){return{name:this.name,range:this._liveRange?.toJSON(),usingOperations:this._managedUsingOperations,affectsData:this._affectsData}}_attachLiveRange(e){return this._liveRange&&this._detachLiveRange(),e.delegate("change:range").to(this),e.delegate("change:content").to(this),this._liveRange=e,e}_detachLiveRange(){this._liveRange.stopDelegating("change:range",this),this._liveRange.stopDelegating("change:content",this),this._liveRange.detach(),this._liveRange=null}};En.prototype.is=function(e){return e==="marker"||e==="model:marker"};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var TC=class extends ct{sourcePosition;howMany;constructor(e,t){super(null),this.sourcePosition=e.clone(),this.howMany=t}get type(){return"detach"}get affectedSelectable(){return null}toJSON(){let e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e}_validate(){if(this.sourcePosition.root.document)throw new p("detach-operation-on-document-node",this)}_execute(){$p(T._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}};/** +*/var AC=class extends ct{sourcePosition;howMany;constructor(e,t){super(null),this.sourcePosition=e.clone(),this.howMany=t}get type(){return"detach"}get affectedSelectable(){return null}toJSON(){let e=super.toJSON();return e.sourcePosition=this.sourcePosition.toJSON(),e}_validate(){if(this.sourcePosition.root.document)throw new p("detach-operation-on-document-node",this)}_execute(){Kp(T._createFromPositionAndShift(this.sourcePosition,this.howMany))}static get className(){return"DetachOperation"}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var di=class Yp extends Wi{markers=new Map;_children=new Zs;constructor(t){super(),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 this.childCount===0}get nextSibling(){return null}get previousSibling(){return null}get root(){return this}get parent(){return null}get document(){return null}isAttached(){return!1}getAncestors(){return[]}getChild(t){return this._children.getNode(t)}getChildAtOffset(t){return this._children.getNodeAtOffset(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 i=this;for(let o of t)i=i.getChildAtOffset(o);return i}offsetToIndex(t){return this._children.offsetToIndex(t)}toJSON(){let t=[];for(let i of this._children)t.push(i.toJSON());return t}static fromJSON(t){let i=[];for(let o of t)o.name?i.push(ie.fromJSON(o)):i.push(ce.fromJSON(o));return new Yp(i)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,i){let o=EC(i);for(let n of o)n.parent!==null&&n._remove(),n.parent=this;this._children._insertNodes(t,o)}_removeChildren(t,i=1){let o=this._children._removeNodes(t,i);for(let n of o)n.parent=null;return o}_removeChildrenArray(t){this._children._removeNodesArray(t);for(let i of t)i.parent=null}};di.prototype.is=function(e){return e==="documentFragment"||e==="model:documentFragment"};function EC(e){return typeof e=="string"?[new ce(e)]:(Je(e)||(e=[e]),Array.from(e).map(t=>typeof t=="string"?new ce(t):t instanceof Gt?new ce(t.data,t.getAttributes()):t))}/** +*/var fi=class e1 extends qi{markers=new Map;_children=new Zs;constructor(t){super(),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 this.childCount===0}get nextSibling(){return null}get previousSibling(){return null}get root(){return this}get parent(){return null}get document(){return null}isAttached(){return!1}getAncestors(){return[]}getChild(t){return this._children.getNode(t)}getChildAtOffset(t){return this._children.getNodeAtOffset(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 i=this;for(let o of t)i=i.getChildAtOffset(o);return i}offsetToIndex(t){return this._children.offsetToIndex(t)}toJSON(){let t=[];for(let i of this._children)t.push(i.toJSON());return t}static fromJSON(t){let i=[];for(let o of t)o.name?i.push(ie.fromJSON(o)):i.push(ce.fromJSON(o));return new e1(i)}_appendChild(t){this._insertChild(this.childCount,t)}_insertChild(t,i){let o=IC(i);for(let n of o)n.parent!==null&&n._remove(),n.parent=this;this._children._insertNodes(t,o)}_removeChildren(t,i=1){let o=this._children._removeNodes(t,i);for(let n of o)n.parent=null;return o}_removeChildrenArray(t){this._children._removeNodesArray(t);for(let i of t)i.parent=null}};fi.prototype.is=function(e){return e==="documentFragment"||e==="model:documentFragment"};function IC(e){return typeof e=="string"?[new ce(e)]:(Je(e)||(e=[e]),Array.from(e).map(t=>typeof t=="string"?new ce(t):t instanceof Zt?new ce(t.data,t.getAttributes()):t))}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var AC=class{model;batch;constructor(e,t){this.model=e,this.batch=t}createText(e,t){return new ce(e,t)}createElement(e,t){return new ie(e,t)}createDocumentFragment(){return new di}cloneElement(e,t=!0){return e._clone(t)}insert(e,t,i=0){if(this._assertWriterUsedCorrectly(),e instanceof ce&&e.data=="")return;let o=A._createAt(t,i);if(e.parent)if(tp(e.root,o.root)){this.move(T._createOn(e),o);return}else{if(e.root.document)throw new p("model-writer-insert-forbidden-move",this);this.remove(e)}let n=o.root.document?o.root.document.version:null,s=e instanceof di?e._removeChildren(0,e.childCount):e,r=new Ye(o,s,n);if(e instanceof ce&&(r.shouldReceiveAttributes=!0),this.batch.addOperation(r),this.model.applyOperation(r),e instanceof di)for(let[a,l]of e.markers){let c=A._createAt(l.root,0),u={range:new T(l.start._getCombined(c,o),l.end._getCombined(c,o)),usingOperation:!0,affectsData:!0};this.model.markers.has(a)?this.updateMarker(a,u):this.addMarker(a,u)}}insertText(e,t,i,o){t instanceof di||t instanceof ie||t instanceof A?this.insert(this.createText(e),t,i):this.insert(this.createText(e,t),i,o)}insertElement(e,t,i,o){t instanceof di||t instanceof ie||t instanceof A?this.insert(this.createElement(e),t,i):this.insert(this.createElement(e,t),i,o)}append(e,t){this.insert(e,t,"end")}appendText(e,t,i){t instanceof di||t instanceof ie?this.insert(this.createText(e),t,"end"):this.insert(this.createText(e,t),i,"end")}appendElement(e,t,i){t instanceof di||t instanceof ie?this.insert(this.createElement(e),t,"end"):this.insert(this.createElement(e,t),i,"end")}setAttribute(e,t,i){if(this._assertWriterUsedCorrectly(),i instanceof T){let o=i.getMinimalFlatRanges();for(let n of o)Xg(this,e,t,n)}else ep(this,e,t,i)}setAttributes(e,t){for(let[i,o]of lt(e))this.setAttribute(i,o,t)}removeAttribute(e,t){if(this._assertWriterUsedCorrectly(),t instanceof T){let i=t.getMinimalFlatRanges();for(let o of i)Xg(this,e,null,o)}else ep(this,e,null,t)}clearAttributes(e){this._assertWriterUsedCorrectly();let t=i=>{for(let o of i.getAttributeKeys())this.removeAttribute(o,i)};if(!(e instanceof T))t(e);else for(let i of e.getItems())t(i)}move(e,t,i){if(this._assertWriterUsedCorrectly(),!(e instanceof T))throw new p("writer-move-invalid-range",this);if(!e.isFlat)throw new p("writer-move-range-not-flat",this);let o=A._createAt(t,i);if(o.isEqual(e.start))return;if(this._addOperationForAffectedMarkers("move",e),!tp(e.root,o.root))throw new p("writer-move-different-document",this);let n=e.root.document?e.root.document.version:null,s=new Z(e.start,e.end.offset-e.start.offset,o,n);this.batch.addOperation(s),this.model.applyOperation(s)}remove(e){this._assertWriterUsedCorrectly();let t=(e instanceof T?e:T._createOn(e)).getMinimalFlatRanges().reverse();for(let i of t)this._addOperationForAffectedMarkers("move",i),IC(i.start,i.end.offset-i.start.offset,this.batch,this.model)}merge(e){this._assertWriterUsedCorrectly();let t=e.nodeBefore,i=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(t instanceof ie))throw new p("writer-merge-no-element-before",this);if(!(i instanceof ie))throw new p("writer-merge-no-element-after",this);e.root.document?this._merge(e):this._mergeDetached(e)}createPositionFromPath(e,t,i){return this.model.createPositionFromPath(e,t,i)}createPositionAt(e,t){return this.model.createPositionAt(e,t)}createPositionAfter(e){return this.model.createPositionAfter(e)}createPositionBefore(e){return this.model.createPositionBefore(e)}createRange(e,t){return this.model.createRange(e,t)}createRangeIn(e){return this.model.createRangeIn(e)}createRangeOn(e){return this.model.createRangeOn(e)}createSelection(...e){return this.model.createSelection(...e)}_mergeDetached(e){let t=e.nodeBefore,i=e.nodeAfter;this.move(T._createIn(i),A._createAt(t,"end")),this.remove(i)}_merge(e){let t=A._createAt(e.nodeBefore,"end"),i=A._createAt(e.nodeAfter,0),o=e.root.document.graveyard,n=new A(o,[0]),s=e.root.document.version,r=new ke(i,e.nodeAfter.maxOffset,t,n,s);this.batch.addOperation(r),this.model.applyOperation(r)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof ie))throw new p("writer-rename-not-element-instance",this);let i=e.root.document?e.root.document.version:null,o=new Jt(A._createBefore(e),e.name,t,i);this.batch.addOperation(o),this.model.applyOperation(o)}split(e,t){this._assertWriterUsedCorrectly();let i=e.parent;if(!i.parent)throw new p("writer-split-element-no-parent",this);if(t||(t=i.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new p("writer-split-invalid-limit-element",this);let o,n;do{let s=i.root.document?i.root.document.version:null,r=i.maxOffset-e.offset,a=ee.getInsertionPosition(e),l=new ee(e,r,a,null,s);this.batch.addOperation(l),this.model.applyOperation(l),!o&&!n&&(o=i,n=e.parent.nextSibling),e=this.createPositionAfter(e.parent),i=e.parent}while(i!==t);return{position:e,range:new T(A._createAt(o,"end"),A._createAt(n,0))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new p("writer-wrap-range-not-flat",this);let i=t instanceof ie?t:new ie(t);if(i.childCount>0)throw new p("writer-wrap-element-not-empty",this);if(i.parent!==null)throw new p("writer-wrap-element-attached",this);this.insert(i,e.start);let o=new T(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(o,A._createAt(i,0))}unwrap(e){if(this._assertWriterUsedCorrectly(),e.parent===null)throw new p("writer-unwrap-element-no-parent",this);this.move(T._createIn(e),this.createPositionAfter(e)),this.remove(e)}addMarker(e,t){if(this._assertWriterUsedCorrectly(),!t||typeof t.usingOperation!="boolean")throw new p("writer-addmarker-no-usingoperation",this);let i=t.usingOperation,o=t.range,n=t.affectsData===void 0?!1:t.affectsData;if(this.model.markers.has(e))throw new p("writer-addmarker-marker-exists",this);if(!o)throw new p("writer-addmarker-no-range",this);return i?(qs(this,e,null,o,n),this.model.markers.get(e)):this.model.markers._set(e,o,i,n)}updateMarker(e,t){this._assertWriterUsedCorrectly();let i=typeof e=="string"?e:e.name,o=this.model.markers.get(i);if(!o)throw new p("writer-updatemarker-marker-not-exists",this);if(!t){D("writer-updatemarker-reconvert-using-editingcontroller",{markerName:i}),this.model.markers._refresh(o);return}let n=typeof t.usingOperation=="boolean",s=typeof t.affectsData=="boolean",r=s?t.affectsData:o.affectsData;if(!n&&!t.range&&!s)throw new p("writer-updatemarker-wrong-options",this);let a=o.getRange(),l=t.range?t.range:a;if(n&&t.usingOperation!==o.managedUsingOperations){t.usingOperation?qs(this,i,null,l,r):(qs(this,i,a,null,r),this.model.markers._set(i,l,void 0,r));return}o.managedUsingOperations?qs(this,i,a,l,r):this.model.markers._set(i,l,void 0,r)}removeMarker(e){this._assertWriterUsedCorrectly();let t=typeof e=="string"?e:e.name;if(!this.model.markers.has(t))throw new p("writer-removemarker-no-marker",this);let i=this.model.markers.get(t);if(!i.managedUsingOperations){this.model.markers._remove(t);return}let o=i.getRange();qs(this,t,o,null,i.affectsData)}addRoot(e,t="$root"){this._assertWriterUsedCorrectly();let i=this.model.document.getRoot(e);if(i&&i.isAttached())throw new p("writer-addroot-root-exists",this);let o=this.model.document,n=new Vn(e,t,!0,o,o.version);return this.batch.addOperation(n),this.model.applyOperation(n),this.model.document.getRoot(e)}detachRoot(e){this._assertWriterUsedCorrectly();let t=typeof e=="string"?this.model.document.getRoot(e):e;if(!t||!t.isAttached())throw new p("writer-detachroot-no-root",this);for(let n of this.model.markers)n.getRange().root===t&&this.removeMarker(n);for(let n of t.getAttributeKeys())this.removeAttribute(n,t);this.remove(this.createRangeIn(t));let i=this.model.document,o=new Vn(t.rootName,t.name,!1,i,i.version);this.batch.addOperation(o),this.model.applyOperation(o)}setSelection(...e){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(...e)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){if(this._assertWriterUsedCorrectly(),typeof e=="string")this._setSelectionAttribute(e,t);else for(let[i,o]of lt(e))this._setSelectionAttribute(i,o)}removeSelectionAttribute(e){if(this._assertWriterUsedCorrectly(),typeof e=="string")this._removeSelectionAttribute(e);else for(let t of e)this._removeSelectionAttribute(t)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(e){this.model.document.selection._restoreGravity(e)}_setSelectionAttribute(e,t){let i=this.model.document.selection;if(i.isCollapsed&&i.anchor.parent.isEmpty){let o=Ce._getStoreAttributeKey(e);this.setAttribute(o,t,i.anchor.parent)}i._setAttribute(e,t)}_removeSelectionAttribute(e){let t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){let i=Ce._getStoreAttributeKey(e);this.removeAttribute(i,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new p("writer-incorrect-use",this)}_addOperationForAffectedMarkers(e,t){for(let i of this.model.markers){if(!i.managedUsingOperations)continue;let o=i.getRange(),n;if(e==="move"){let s=t;n=s.containsPosition(o.start)||s.start.isEqual(o.start)||s.containsPosition(o.end)||s.end.isEqual(o.end)}else{let s=t,r=s.nodeBefore,a=s.nodeAfter,l=o.start.parent==r&&o.start.isAtEnd,c=o.end.parent==a&&o.end.offset==0,u=o.end.nodeAfter==a,d=o.start.nodeAfter==a;n=l||c||u||d}n&&this.updateMarker(i.name,{range:o})}}};function Xg(e,t,i,o){let n=e.model,s=n.document,r=o.start,a,l,c;for(let d of o.getWalker({shallow:!0}))c=d.item.getAttribute(t),a&&l!=c&&(l!=i&&u(),r=a),a=d.nextPosition,l=c;a instanceof A&&a!=r&&l!=i&&u();function u(){let d=new T(r,a),h=d.root.document?s.version:null,f=new ze(d,t,l,i,h);e.batch.addOperation(f),n.applyOperation(f)}}function ep(e,t,i,o){let n=e.model,s=n.document,r=o.getAttribute(t),a,l;if(r!=i){if(o.root===o){let c=o.document?s.version:null;l=new rr(o,t,r,i,c)}else{a=new T(A._createBefore(o),e.createPositionAfter(o));let c=a.root.document?s.version:null;l=new ze(a,t,r,i,c)}e.batch.addOperation(l),n.applyOperation(l)}}function qs(e,t,i,o,n){let s=e.model,r=s.document,a=new Rt(t,i,o,s.markers,!!n,r.version);e.batch.addOperation(a),s.applyOperation(a)}function IC(e,t,i,o){let n;if(e.root.document){let s=o.document,r=new A(s.graveyard,[0]);n=new Z(e,t,r,s.version)}else n=new TC(e,t);i.addOperation(n),o.applyOperation(n)}function tp(e,t){return e===t||e instanceof ol&&t instanceof ol}/** +*/var SC=class{model;batch;constructor(e,t){this.model=e,this.batch=t}createText(e,t){return new ce(e,t)}createElement(e,t){return new ie(e,t)}createDocumentFragment(){return new fi}cloneElement(e,t=!0){return e._clone(t)}insert(e,t,i=0){if(this._assertWriterUsedCorrectly(),e instanceof ce&&e.data=="")return;let o=A._createAt(t,i);if(e.parent)if(op(e.root,o.root)){this.move(T._createOn(e),o);return}else{if(e.root.document)throw new p("model-writer-insert-forbidden-move",this);this.remove(e)}let n=o.root.document?o.root.document.version:null,s=e instanceof fi?e._removeChildren(0,e.childCount):e,r=new Ye(o,s,n);if(e instanceof ce&&(r.shouldReceiveAttributes=!0),this.batch.addOperation(r),this.model.applyOperation(r),e instanceof fi)for(let[a,l]of e.markers){let c=A._createAt(l.root,0),u={range:new T(l.start._getCombined(c,o),l.end._getCombined(c,o)),usingOperation:!0,affectsData:!0};this.model.markers.has(a)?this.updateMarker(a,u):this.addMarker(a,u)}}insertText(e,t,i,o){t instanceof fi||t instanceof ie||t instanceof A?this.insert(this.createText(e),t,i):this.insert(this.createText(e,t),i,o)}insertElement(e,t,i,o){t instanceof fi||t instanceof ie||t instanceof A?this.insert(this.createElement(e),t,i):this.insert(this.createElement(e,t),i,o)}append(e,t){this.insert(e,t,"end")}appendText(e,t,i){t instanceof fi||t instanceof ie?this.insert(this.createText(e),t,"end"):this.insert(this.createText(e,t),i,"end")}appendElement(e,t,i){t instanceof fi||t instanceof ie?this.insert(this.createElement(e),t,"end"):this.insert(this.createElement(e,t),i,"end")}setAttribute(e,t,i){if(this._assertWriterUsedCorrectly(),i instanceof T){let o=i.getMinimalFlatRanges();for(let n of o)tp(this,e,t,n)}else ip(this,e,t,i)}setAttributes(e,t){for(let[i,o]of lt(e))this.setAttribute(i,o,t)}removeAttribute(e,t){if(this._assertWriterUsedCorrectly(),t instanceof T){let i=t.getMinimalFlatRanges();for(let o of i)tp(this,e,null,o)}else ip(this,e,null,t)}clearAttributes(e){this._assertWriterUsedCorrectly();let t=i=>{for(let o of i.getAttributeKeys())this.removeAttribute(o,i)};if(!(e instanceof T))t(e);else for(let i of e.getItems())t(i)}move(e,t,i){if(this._assertWriterUsedCorrectly(),!(e instanceof T))throw new p("writer-move-invalid-range",this);if(!e.isFlat)throw new p("writer-move-range-not-flat",this);let o=A._createAt(t,i);if(o.isEqual(e.start))return;if(this._addOperationForAffectedMarkers("move",e),!op(e.root,o.root))throw new p("writer-move-different-document",this);let n=e.root.document?e.root.document.version:null,s=new Z(e.start,e.end.offset-e.start.offset,o,n);this.batch.addOperation(s),this.model.applyOperation(s)}remove(e){this._assertWriterUsedCorrectly();let t=(e instanceof T?e:T._createOn(e)).getMinimalFlatRanges().reverse();for(let i of t)this._addOperationForAffectedMarkers("move",i),PC(i.start,i.end.offset-i.start.offset,this.batch,this.model)}merge(e){this._assertWriterUsedCorrectly();let t=e.nodeBefore,i=e.nodeAfter;if(this._addOperationForAffectedMarkers("merge",e),!(t instanceof ie))throw new p("writer-merge-no-element-before",this);if(!(i instanceof ie))throw new p("writer-merge-no-element-after",this);e.root.document?this._merge(e):this._mergeDetached(e)}createPositionFromPath(e,t,i){return this.model.createPositionFromPath(e,t,i)}createPositionAt(e,t){return this.model.createPositionAt(e,t)}createPositionAfter(e){return this.model.createPositionAfter(e)}createPositionBefore(e){return this.model.createPositionBefore(e)}createRange(e,t){return this.model.createRange(e,t)}createRangeIn(e){return this.model.createRangeIn(e)}createRangeOn(e){return this.model.createRangeOn(e)}createSelection(...e){return this.model.createSelection(...e)}_mergeDetached(e){let t=e.nodeBefore,i=e.nodeAfter;this.move(T._createIn(i),A._createAt(t,"end")),this.remove(i)}_merge(e){let t=A._createAt(e.nodeBefore,"end"),i=A._createAt(e.nodeAfter,0),o=e.root.document.graveyard,n=new A(o,[0]),s=e.root.document.version,r=new xe(i,e.nodeAfter.maxOffset,t,n,s);this.batch.addOperation(r),this.model.applyOperation(r)}rename(e,t){if(this._assertWriterUsedCorrectly(),!(e instanceof ie))throw new p("writer-rename-not-element-instance",this);let i=e.root.document?e.root.document.version:null,o=new Qt(A._createBefore(e),e.name,t,i);this.batch.addOperation(o),this.model.applyOperation(o)}split(e,t){this._assertWriterUsedCorrectly();let i=e.parent;if(!i.parent)throw new p("writer-split-element-no-parent",this);if(t||(t=i.parent),!e.parent.getAncestors({includeSelf:!0}).includes(t))throw new p("writer-split-invalid-limit-element",this);let o,n;do{let s=i.root.document?i.root.document.version:null,r=i.maxOffset-e.offset,a=ee.getInsertionPosition(e),l=new ee(e,r,a,null,s);this.batch.addOperation(l),this.model.applyOperation(l),!o&&!n&&(o=i,n=e.parent.nextSibling),e=this.createPositionAfter(e.parent),i=e.parent}while(i!==t);return{position:e,range:new T(A._createAt(o,"end"),A._createAt(n,0))}}wrap(e,t){if(this._assertWriterUsedCorrectly(),!e.isFlat)throw new p("writer-wrap-range-not-flat",this);let i=t instanceof ie?t:new ie(t);if(i.childCount>0)throw new p("writer-wrap-element-not-empty",this);if(i.parent!==null)throw new p("writer-wrap-element-attached",this);this.insert(i,e.start);let o=new T(e.start.getShiftedBy(1),e.end.getShiftedBy(1));this.move(o,A._createAt(i,0))}unwrap(e){if(this._assertWriterUsedCorrectly(),e.parent===null)throw new p("writer-unwrap-element-no-parent",this);this.move(T._createIn(e),this.createPositionAfter(e)),this.remove(e)}addMarker(e,t){if(this._assertWriterUsedCorrectly(),!t||typeof t.usingOperation!="boolean")throw new p("writer-addmarker-no-usingoperation",this);let i=t.usingOperation,o=t.range,n=t.affectsData===void 0?!1:t.affectsData;if(this.model.markers.has(e))throw new p("writer-addmarker-marker-exists",this);if(!o)throw new p("writer-addmarker-no-range",this);return i?(qs(this,e,null,o,n),this.model.markers.get(e)):this.model.markers._set(e,o,i,n)}updateMarker(e,t){this._assertWriterUsedCorrectly();let i=typeof e=="string"?e:e.name,o=this.model.markers.get(i);if(!o)throw new p("writer-updatemarker-marker-not-exists",this);if(!t){D("writer-updatemarker-reconvert-using-editingcontroller",{markerName:i}),this.model.markers._refresh(o);return}let n=typeof t.usingOperation=="boolean",s=typeof t.affectsData=="boolean",r=s?t.affectsData:o.affectsData;if(!n&&!t.range&&!s)throw new p("writer-updatemarker-wrong-options",this);let a=o.getRange(),l=t.range?t.range:a;if(n&&t.usingOperation!==o.managedUsingOperations){t.usingOperation?qs(this,i,null,l,r):(qs(this,i,a,null,r),this.model.markers._set(i,l,void 0,r));return}o.managedUsingOperations?qs(this,i,a,l,r):this.model.markers._set(i,l,void 0,r)}removeMarker(e){this._assertWriterUsedCorrectly();let t=typeof e=="string"?e:e.name;if(!this.model.markers.has(t))throw new p("writer-removemarker-no-marker",this);let i=this.model.markers.get(t);if(!i.managedUsingOperations){this.model.markers._remove(t);return}let o=i.getRange();qs(this,t,o,null,i.affectsData)}addRoot(e,t="$root"){this._assertWriterUsedCorrectly();let i=this.model.document.getRoot(e);if(i&&i.isAttached())throw new p("writer-addroot-root-exists",this);let o=this.model.document,n=new Vn(e,t,!0,o,o.version);return this.batch.addOperation(n),this.model.applyOperation(n),this.model.document.getRoot(e)}detachRoot(e){this._assertWriterUsedCorrectly();let t=typeof e=="string"?this.model.document.getRoot(e):e;if(!t||!t.isAttached())throw new p("writer-detachroot-no-root",this);for(let n of this.model.markers)n.getRange().root===t&&this.removeMarker(n);for(let n of t.getAttributeKeys())this.removeAttribute(n,t);this.remove(this.createRangeIn(t));let i=this.model.document,o=new Vn(t.rootName,t.name,!1,i,i.version);this.batch.addOperation(o),this.model.applyOperation(o)}setSelection(...e){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(...e)}setSelectionFocus(e,t){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(e,t)}setSelectionAttribute(e,t){if(this._assertWriterUsedCorrectly(),typeof e=="string")this._setSelectionAttribute(e,t);else for(let[i,o]of lt(e))this._setSelectionAttribute(i,o)}removeSelectionAttribute(e){if(this._assertWriterUsedCorrectly(),typeof e=="string")this._removeSelectionAttribute(e);else for(let t of e)this._removeSelectionAttribute(t)}overrideSelectionGravity(){return this.model.document.selection._overrideGravity()}restoreSelectionGravity(e){this.model.document.selection._restoreGravity(e)}_setSelectionAttribute(e,t){let i=this.model.document.selection;if(i.isCollapsed&&i.anchor.parent.isEmpty){let o=Te._getStoreAttributeKey(e);this.setAttribute(o,t,i.anchor.parent)}i._setAttribute(e,t)}_removeSelectionAttribute(e){let t=this.model.document.selection;if(t.isCollapsed&&t.anchor.parent.isEmpty){let i=Te._getStoreAttributeKey(e);this.removeAttribute(i,t.anchor.parent)}t._removeAttribute(e)}_assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new p("writer-incorrect-use",this)}_addOperationForAffectedMarkers(e,t){for(let i of this.model.markers){if(!i.managedUsingOperations)continue;let o=i.getRange(),n;if(e==="move"){let s=t;n=s.containsPosition(o.start)||s.start.isEqual(o.start)||s.containsPosition(o.end)||s.end.isEqual(o.end)}else{let s=t,r=s.nodeBefore,a=s.nodeAfter,l=o.start.parent==r&&o.start.isAtEnd,c=o.end.parent==a&&o.end.offset==0,u=o.end.nodeAfter==a,d=o.start.nodeAfter==a;n=l||c||u||d}n&&this.updateMarker(i.name,{range:o})}}};function tp(e,t,i,o){let n=e.model,s=n.document,r=o.start,a,l,c;for(let d of o.getWalker({shallow:!0}))c=d.item.getAttribute(t),a&&l!=c&&(l!=i&&u(),r=a),a=d.nextPosition,l=c;a instanceof A&&a!=r&&l!=i&&u();function u(){let d=new T(r,a),h=d.root.document?s.version:null,f=new ze(d,t,l,i,h);e.batch.addOperation(f),n.applyOperation(f)}}function ip(e,t,i,o){let n=e.model,s=n.document,r=o.getAttribute(t),a,l;if(r!=i){if(o.root===o){let c=o.document?s.version:null;l=new rr(o,t,r,i,c)}else{a=new T(A._createBefore(o),e.createPositionAfter(o));let c=a.root.document?s.version:null;l=new ze(a,t,r,i,c)}e.batch.addOperation(l),n.applyOperation(l)}}function qs(e,t,i,o,n){let s=e.model,r=s.document,a=new Vt(t,i,o,s.markers,!!n,r.version);e.batch.addOperation(a),s.applyOperation(a)}function PC(e,t,i,o){let n;if(e.root.document){let s=o.document,r=new A(s.graveyard,[0]);n=new Z(e,t,r,s.version)}else n=new AC(e,t);i.addOperation(n),o.applyOperation(n)}function op(e,t){return e===t||e instanceof nl&&t instanceof nl}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function SC(e){e.document.registerPostFixer(t=>PC(t,e))}function PC(e,t){let i=t.document.selection,o=t.schema,n=[],s=!1;for(let r of i.getRanges()){let a=al(r,o);a&&!a.isEqual(r)?(n.push(a),s=!0):n.push(r)}return s&&e.setSelection(MC(n),{backward:i.isBackward}),!1}function al(e,t){return e.isCollapsed?RC(e,t):VC(e,t)}function RC(e,t){let i=e.start,o=t.getNearestSelectionRange(i);if(!o){let s=i.getAncestors().reverse().find(r=>t.isObject(r));return s?T._createOn(s):null}if(!o.isCollapsed)return o;let n=o.start;return i.isEqual(n)?null:new T(n)}function VC(e,t){let{start:i,end:o}=e,n=t.checkChild(i,"$text"),s=t.checkChild(o,"$text"),r=t.getLimitElement(i),a=t.getLimitElement(o);if(r===a){if(n&&s)return null;if(LC(i,o,t)){let u=i.nodeAfter&&t.isSelectable(i.nodeAfter)?null:t.getNearestSelectionRange(i,"forward"),d=o.nodeBefore&&t.isSelectable(o.nodeBefore)?null:t.getNearestSelectionRange(o,"backward"),h=u?u.start:i,f=d?d.end:o;return new T(h,f)}}let l=r&&!r.is("rootElement"),c=a&&!a.is("rootElement");if(l||c){let u=i.nodeAfter&&o.nodeBefore&&i.nodeAfter.parent===o.nodeBefore.parent,d=l&&(!u||!op(i.nodeAfter,t)),h=c&&(!u||!op(o.nodeBefore,t)),f=i,m=o;return d&&(f=A._createBefore(ip(r,t))),h&&(m=A._createAfter(ip(a,t))),new T(f,m)}return null}function ip(e,t){let i=e,o=i;for(;t.isLimit(o)&&o.parent;)i=o,o=o.parent;return i}function LC(e,t,i){let o=e.nodeAfter&&!i.isLimit(e.nodeAfter)||i.checkChild(e,"$text"),n=t.nodeBefore&&!i.isLimit(t.nodeBefore)||i.checkChild(t,"$text");return o||n}function MC(e){let t=[...e],i=new Set,o=1;for(;o!i.has(s))}function op(e,t){return e&&t.isSelectable(e)}/** +*/function RC(e){e.document.registerPostFixer(t=>VC(t,e))}function VC(e,t){let i=t.document.selection,o=t.schema,n=[],s=!1;for(let r of i.getRanges()){let a=ll(r,o);a&&!a.isEqual(r)?(n.push(a),s=!0):n.push(r)}return s&&e.setSelection(OC(n),{backward:i.isBackward}),!1}function ll(e,t){return e.isCollapsed?LC(e,t):MC(e,t)}function LC(e,t){let i=e.start,o=t.getNearestSelectionRange(i);if(!o){let s=i.getAncestors().reverse().find(r=>t.isObject(r));return s?T._createOn(s):null}if(!o.isCollapsed)return o;let n=o.start;return i.isEqual(n)?null:new T(n)}function MC(e,t){let{start:i,end:o}=e,n=t.checkChild(i,"$text"),s=t.checkChild(o,"$text"),r=t.getLimitElement(i),a=t.getLimitElement(o);if(r===a){if(n&&s)return null;if(BC(i,o,t)){let u=i.nodeAfter&&t.isSelectable(i.nodeAfter)?null:t.getNearestSelectionRange(i,"forward"),d=o.nodeBefore&&t.isSelectable(o.nodeBefore)?null:t.getNearestSelectionRange(o,"backward"),h=u?u.start:i,f=d?d.end:o;return new T(h,f)}}let l=r&&!r.is("rootElement"),c=a&&!a.is("rootElement");if(l||c){let u=i.nodeAfter&&o.nodeBefore&&i.nodeAfter.parent===o.nodeBefore.parent,d=l&&(!u||!sp(i.nodeAfter,t)),h=c&&(!u||!sp(o.nodeBefore,t)),f=i,m=o;return d&&(f=A._createBefore(np(r,t))),h&&(m=A._createAfter(np(a,t))),new T(f,m)}return null}function np(e,t){let i=e,o=i;for(;t.isLimit(o)&&o.parent;)i=o,o=o.parent;return i}function BC(e,t,i){let o=e.nodeAfter&&!i.isLimit(e.nodeAfter)||i.checkChild(e,"$text"),n=t.nodeBefore&&!i.isLimit(t.nodeBefore)||i.checkChild(t,"$text");return o||n}function OC(e){let t=[...e],i=new Set,o=1;for(;o!i.has(s))}function sp(e,t){return e&&t.isSelectable(e)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function BC(e,t,i={}){if(t.isCollapsed)return;let o=t.getFirstRange();if(o.root.rootName=="$graveyard")return;let n=e.schema,s=e.document.selection,r=jC(t,s,o),a=Array.from(s.getAttributes()),l=!!s.getFirstRange()?.start.parent.isEmpty;e.change(c=>{if(!i.doNotResetEntireContent&&qC(n,t)){UC(c,t);return}let u={};if(!i.doNotAutoparagraph){let f=t.getSelectedElement();f&&Object.assign(u,n.getAttributesWithProperty(f,"copyOnReplace",!0))}let d,h;o.root instanceof di?(d=he._fromPositionInDocumentFragment(o.start,e,"toPrevious"),h=he._fromPositionInDocumentFragment(o.end,e,"toNext")):i.doNotFixSelection?(d=he.fromPosition(o.start,"toPrevious"),h=he.fromPosition(o.end,"toNext")):[d,h]=OC(o),d.isTouching(h)||c.remove(c.createRange(d,h)),i.leaveUnmerged||(FC(c,d,h),n.removeDisallowedAttributes(d.parent.getChildren(),c)),i1(c,t,d),!i.doNotAutoparagraph&&HC(n,d)&&t1(c,d,t,u),r&&$C(c,a,l),d.detach(),h.detach()})}function OC(e){let t=e.root.document.model,i=e.start,o=e.end;if(t.hasContent(e,{ignoreMarkers:!0})){let n=DC(o);if(n&&o.isTouching(t.createPositionAt(n,0))){let s=t.createSelection(e);t.modifySelection(s,{direction:"backward"});let r=s.getLastPosition(),a=t.createRange(r,o);t.hasContent(a,{ignoreMarkers:!0})||(o=r)}}return[he.fromPosition(i,"toPrevious"),he.fromPosition(o,"toNext")]}function DC(e){let t=e.parent,i=t.root.document.model.schema,o=t.getAncestors({parentFirst:!0,includeSelf:!0});for(let n of o){if(i.isLimit(n))return null;if(i.isBlock(n))return n}}function FC(e,t,i){let o=e.model;if(!xd(e.model.schema,t,i))return;let[n,s]=zC(t,i);!n||!s||(!o.hasContent(n,{ignoreMarkers:!0})&&o.hasContent(s,{ignoreMarkers:!0})?e1(e,t,i,n.parent):Xp(e,t,i,n.parent))}function Xp(e,t,i,o){let n=t.parent,s=i.parent;if(!(n==o||s==o)){for(t=e.createPositionAfter(n),i=e.createPositionBefore(s),i.isEqual(t)||e.insert(s,t),e.merge(t);i.parent.isEmpty;){let r=i.parent;i=e.createPositionBefore(r),e.remove(r)}xd(e.model.schema,t,i)&&Xp(e,t,i,o)}}function e1(e,t,i,o){let n=t.parent,s=i.parent;if(!(n==o||s==o)){for(t=e.createPositionAfter(n),i=e.createPositionBefore(s),i.isEqual(t)||e.insert(n,i);t.parent.isEmpty;){let r=t.parent;t=e.createPositionBefore(r),e.remove(r)}i=e.createPositionBefore(s),NC(e,i),xd(e.model.schema,t,i)&&e1(e,t,i,o)}}function NC(e,t){let i=t.nodeBefore,o=t.nodeAfter;i.name!=o.name&&e.rename(i,o.name),e.clearAttributes(i),e.setAttributes(Object.fromEntries(o.getAttributes()),i),e.merge(t)}function xd(e,t,i){let o=t.parent,n=i.parent;return o==n||e.isLimit(o)||e.isLimit(n)?!1:WC(t,i,e)}function zC(e,t){let i=e.getAncestors(),o=t.getAncestors(),n=0;for(;i[n]&&i[n]==o[n];)n++;return[i[n],o[n]]}function HC(e,t){let i=e.checkChild(t,"$text"),o=e.checkChild(t,"paragraph");return!i&&o}function WC(e,t,i){let o=new T(e,t);for(let n of o.getWalker())if(i.isLimit(n.item))return!1;return!0}function t1(e,t,i,o={}){let n=e.createElement("paragraph");e.model.schema.setAllowedAttributes(n,o,e),e.insert(n,t),i1(e,i,e.createPositionAt(n,0))}function UC(e,t){let i=e.model.schema.getLimitElement(t);e.remove(e.createRangeIn(i)),t1(e,e.createPositionAt(i,0),t)}function qC(e,t){let i=e.getLimitElement(t);if(!t.containsEntireContent(i))return!1;let o=t.getFirstRange();return o.start.parent==o.end.parent?!1:e.checkChild(i,"paragraph")}function i1(e,t,i){t instanceof Ce?e.setSelection(i):t.setTo(i)}function $C(e,t,i){if(!t.length)return;let o=e.model.document.selection;if(o.anchor.parent.isEmpty&&!i)for(let[n,s]of t)e.model.schema.getAttributeProperties(n).isFormatting&&e.model.schema.checkAttributeInSelection(o,n)&&e.setSelectionAttribute(n,s)}function jC(e,t,i){if(e instanceof Ce)return!0;if(t.isCollapsed){let o=t.getFirstPosition();return o.isEqual(i.start)||o.isEqual(i.end)}return!!t.getFirstRange()?.isIntersecting(i)}/** +*/function DC(e,t,i={}){if(t.isCollapsed)return;let o=t.getFirstRange();if(o.root.rootName=="$graveyard")return;let n=e.schema,s=e.document.selection,r=GC(t,s,o),a=Array.from(s.getAttributes()),l=!!s.getFirstRange()?.start.parent.isEmpty;e.change(c=>{if(!i.doNotResetEntireContent&&jC(n,t)){$C(c,t);return}let u={};if(!i.doNotAutoparagraph){let f=t.getSelectedElement();f&&Object.assign(u,n.getAttributesWithProperty(f,"copyOnReplace",!0))}let d,h;o.root instanceof fi?(d=he._fromPositionInDocumentFragment(o.start,e,"toPrevious"),h=he._fromPositionInDocumentFragment(o.end,e,"toNext")):i.doNotFixSelection?(d=he.fromPosition(o.start,"toPrevious"),h=he.fromPosition(o.end,"toNext")):[d,h]=FC(o),d.isTouching(h)||c.remove(c.createRange(d,h)),i.leaveUnmerged||(zC(c,d,h),n.removeDisallowedAttributes(d.parent.getChildren(),c)),n1(c,t,d),!i.doNotAutoparagraph&&UC(n,d)&&o1(c,d,t,u),r&&KC(c,a,l),d.detach(),h.detach()})}function FC(e){let t=e.root.document.model,i=e.start,o=e.end;if(t.hasContent(e,{ignoreMarkers:!0})){let n=NC(o);if(n&&o.isTouching(t.createPositionAt(n,0))){let s=t.createSelection(e);t.modifySelection(s,{direction:"backward"});let r=s.getLastPosition(),a=t.createRange(r,o);t.hasContent(a,{ignoreMarkers:!0})||(o=r)}}return[he.fromPosition(i,"toPrevious"),he.fromPosition(o,"toNext")]}function NC(e){let t=e.parent,i=t.root.document.model.schema,o=t.getAncestors({parentFirst:!0,includeSelf:!0});for(let n of o){if(i.isLimit(n))return null;if(i.isBlock(n))return n}}function zC(e,t,i){let o=e.model;if(!Ed(e.model.schema,t,i))return;let[n,s]=WC(t,i);!n||!s||(!o.hasContent(n,{ignoreMarkers:!0})&&o.hasContent(s,{ignoreMarkers:!0})?i1(e,t,i,n.parent):t1(e,t,i,n.parent))}function t1(e,t,i,o){let n=t.parent,s=i.parent;if(!(n==o||s==o)){for(t=e.createPositionAfter(n),i=e.createPositionBefore(s),i.isEqual(t)||e.insert(s,t),e.merge(t);i.parent.isEmpty;){let r=i.parent;i=e.createPositionBefore(r),e.remove(r)}Ed(e.model.schema,t,i)&&t1(e,t,i,o)}}function i1(e,t,i,o){let n=t.parent,s=i.parent;if(!(n==o||s==o)){for(t=e.createPositionAfter(n),i=e.createPositionBefore(s),i.isEqual(t)||e.insert(n,i);t.parent.isEmpty;){let r=t.parent;t=e.createPositionBefore(r),e.remove(r)}i=e.createPositionBefore(s),HC(e,i),Ed(e.model.schema,t,i)&&i1(e,t,i,o)}}function HC(e,t){let i=t.nodeBefore,o=t.nodeAfter;i.name!=o.name&&e.rename(i,o.name),e.clearAttributes(i),e.setAttributes(Object.fromEntries(o.getAttributes()),i),e.merge(t)}function Ed(e,t,i){let o=t.parent,n=i.parent;return o==n||e.isLimit(o)||e.isLimit(n)?!1:qC(t,i,e)}function WC(e,t){let i=e.getAncestors(),o=t.getAncestors(),n=0;for(;i[n]&&i[n]==o[n];)n++;return[i[n],o[n]]}function UC(e,t){let i=e.checkChild(t,"$text"),o=e.checkChild(t,"paragraph");return!i&&o}function qC(e,t,i){let o=new T(e,t);for(let n of o.getWalker())if(i.isLimit(n.item))return!1;return!0}function o1(e,t,i,o={}){let n=e.createElement("paragraph");e.model.schema.setAllowedAttributes(n,o,e),e.insert(n,t),n1(e,i,e.createPositionAt(n,0))}function $C(e,t){let i=e.model.schema.getLimitElement(t);e.remove(e.createRangeIn(i)),o1(e,e.createPositionAt(i,0),t)}function jC(e,t){let i=e.getLimitElement(t);if(!t.containsEntireContent(i))return!1;let o=t.getFirstRange();return o.start.parent==o.end.parent?!1:e.checkChild(i,"paragraph")}function n1(e,t,i){t instanceof Te?e.setSelection(i):t.setTo(i)}function KC(e,t,i){if(!t.length)return;let o=e.model.document.selection;if(o.anchor.parent.isEmpty&&!i)for(let[n,s]of t)e.model.schema.getAttributeProperties(n).isFormatting&&e.model.schema.checkAttributeInSelection(o,n)&&e.setSelectionAttribute(n,s)}function GC(e,t,i){if(e instanceof Te)return!0;if(t.isCollapsed){let o=t.getFirstPosition();return o.isEqual(i.start)||o.isEqual(i.end)}return!!t.getFirstRange()?.isIntersecting(i)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function KC(e,t){return e.change(i=>{let o=i.createDocumentFragment(),n=t.getFirstRange();if(!n||n.isCollapsed)return o;let s=n.start.root,r=n.start.getCommonPath(n.end),a=s.getNodeByPath(r),l;n.start.parent==n.end.parent?l=n:l=i.createRange(i.createPositionAt(a,n.start.path[r.length]),i.createPositionAt(a,n.end.path[r.length]+1));let c=l.end.offset-l.start.offset;for(let u of l.getItems({shallow:!0}))u.is("$textProxy")?i.appendText(u.data,u.getAttributes(),o):i.append(i.cloneElement(u,!0),o);if(l!=n){let u=n._getTransformedByMove(l.start,i.createPositionAt(o,0),c)[0],d=i.createRange(i.createPositionAt(o,0),u.start);np(i.createRange(u.end,i.createPositionAt(o,"end")),i),np(d,i)}return o})}function np(e,t){let i=[];Array.from(e.getItems({direction:"backward"})).map(o=>t.createRangeOn(o)).filter(o=>(o.start.isAfter(e.start)||o.start.isEqual(e.start))&&(o.end.isBefore(e.end)||o.end.isEqual(e.end))).forEach(o=>{i.push(o.start.parent),t.remove(o)}),i.forEach(o=>{let n=o;for(;n.parent&&n.isEmpty;){let s=t.createRangeOn(n);n=n.parent,t.remove(s)}})}/** +*/function JC(e,t){return e.change(i=>{let o=i.createDocumentFragment(),n=t.getFirstRange();if(!n||n.isCollapsed)return o;let s=n.start.root,r=n.start.getCommonPath(n.end),a=s.getNodeByPath(r),l;n.start.parent==n.end.parent?l=n:l=i.createRange(i.createPositionAt(a,n.start.path[r.length]),i.createPositionAt(a,n.end.path[r.length]+1));let c=l.end.offset-l.start.offset;for(let u of l.getItems({shallow:!0}))u.is("$textProxy")?i.appendText(u.data,u.getAttributes(),o):i.append(i.cloneElement(u,!0),o);if(l!=n){let u=n._getTransformedByMove(l.start,i.createPositionAt(o,0),c)[0],d=i.createRange(i.createPositionAt(o,0),u.start);rp(i.createRange(u.end,i.createPositionAt(o,"end")),i),rp(d,i)}return o})}function rp(e,t){let i=[];Array.from(e.getItems({direction:"backward"})).map(o=>t.createRangeOn(o)).filter(o=>(o.start.isAfter(e.start)||o.start.isEqual(e.start))&&(o.end.isBefore(e.end)||o.end.isEqual(e.end))).forEach(o=>{i.push(o.start.parent),t.remove(o)}),i.forEach(o=>{let n=o;for(;n.parent&&n.isEmpty;){let s=t.createRangeOn(n);n=n.parent,t.remove(s)}})}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function GC(e,t,i){return e.change(o=>{let n=i||e.document.selection;n.isCollapsed||e.deleteContent(n,{doNotAutoparagraph:!0});let s=new JC(e,o,n.anchor),r=[],a;if(t.is("documentFragment")){if(t.markers.size){let u=[];for(let[d,h]of t.markers){let{start:f,end:m}=h,g=f.isEqual(m);u.push({position:f,name:d,isCollapsed:g},{position:m,name:d,isCollapsed:g})}u.sort(({position:d},{position:h})=>d.isBefore(h)?1:-1);for(let{position:d,name:h,isCollapsed:f}of u){let m=null,g=null,b=d.parent===t&&d.isAtStart,k=d.parent===t&&d.isAtEnd;!b&&!k?(m=o.createElement("$marker"),o.insert(m,d)):f&&(g=b?"start":"end"),r.push({name:h,element:m,collapsed:g})}}a=t.getChildren()}else a=[t];s.handleNodes(a);let l=s.getSelectionRange();if(t.is("documentFragment")&&r.length){let u=l?Qe.fromRange(l):null,d={};for(let h=r.length-1;h>=0;h--){let{name:f,element:m,collapsed:g}=r[h],b=!d[f];if(b&&(d[f]=[]),m){let k=o.createPositionAt(m,"before");d[f].push(k),o.remove(m)}else{let k=s.getAffectedRange();if(!k){g&&d[f].push(s.position);continue}g?d[f].push(k[g]):d[f].push(b?k.start:k.end)}}for(let[h,[f,m]]of Object.entries(d))f&&m&&f.root===m.root&&f.root.document&&!o.model.markers.has(h)&&o.addMarker(h,{usingOperation:!0,affectsData:!0,range:new T(f,m)});u&&(l=u.toRange(),u.detach())}l&&(n instanceof Ce?o.setSelection(l):n.setTo(l));let c=s.getAffectedRange()||e.createRange(n.anchor);return s.destroy(),c})}var JC=class{model;writer;position;canMergeWith;schema;_documentFragment;_documentFragmentPosition;_firstNode=null;_lastNode=null;_lastAutoParagraph=null;_filterAttributesAndChildrenOf=[];_affectedStart=null;_affectedEnd=null;_nodeToSelect=null;constructor(e,t,i){this.model=e,this.writer=t,this.position=i,this.canMergeWith=new Set([this.position.parent]),this.schema=e.schema,this._documentFragment=t.createDocumentFragment(),this._documentFragmentPosition=t.createPositionAt(this._documentFragment,0)}handleNodes(e){for(let t of Array.from(e))t.offsetSize>0&&this._handleNode(t);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesAndChildrenOf,this.writer),this.model._config?.get("experimentalFlags.modelInsertContentDeepSchemaVerification")!==!1&&this._removeDisallowedChildren(this._filterAttributesAndChildrenOf),this._filterAttributesAndChildrenOf=[]}_removeDisallowedChildren(e){let t=Array.from(e);for(let i of t){if(!i.is("element"))continue;let o=[],n=[],s=this.writer.createRangeIn(i).getWalker({ignoreElementEnd:!0});for(let{item:r}of s){let a=r.parent;this.schema.checkChild(a,r)||(r.is("element")&&!this.schema.isObject(r)?(n.push(r),t.push(a)):o.push(r),s.jumpTo(this.writer.createPositionAfter(r)))}for(let r of n)this.writer.unwrap(r);for(let r of o)this.writer.remove(r)}}_updateLastNodeFromAutoParagraph(e){let t=this.writer.createPositionAfter(this._lastNode),i=this.writer.createPositionAfter(e);if(i.isAfter(t)){this._lastNode=e;/* v8 ignore if -- @preserve */if(this.position.parent!=e||!this.position.isAtEnd)throw new p("insertcontent-invalid-insertion-position",this);this.position=i,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this._nodeToSelect?T._createOn(this._nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new T(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(e){if(!this._checkAndSplitToAllowedPosition(e)){this.schema.isObject(e)||this._handleDisallowedNode(e);return}e=this._appendToFragment(e),this._firstNode||(this._firstNode=e),this._lastNode=e}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;let e=he.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this._documentFragment.getChild(0)==this._firstNode&&(this.writer.insert(this._firstNode,this.position),this._mergeOnLeft(),this.position=e.toPosition()),this._documentFragment.isEmpty||this.writer.insert(this._documentFragment,this.position),this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0),this.position=e.toPosition(),e.detach()}_handleDisallowedNode(e){e.is("element")&&this.handleNodes(e.getChildren())}_appendToFragment(e){/* v8 ignore if -- @preserve */if(!this.schema.checkChild(this.position,e))throw new p("insertcontent-wrong-position",this,{node:e,position:this.position});return this.writer.insert(e,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(e.offsetSize),e.parent||(e=this._documentFragmentPosition.nodeBefore),this.schema.isObject(e)&&!this.schema.checkChild(this.position,"$text")?this._nodeToSelect=e:this._nodeToSelect=null,this._filterAttributesAndChildrenOf.push(e),e}_setAffectedBoundaries(e){this._affectedStart||(this._affectedStart=he.fromPosition(e,"toPrevious")),(!this._affectedEnd||this._affectedEnd.isBefore(e))&&(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=he.fromPosition(e,"toNext"))}_mergeOnLeft(){let e=this._firstNode;if(!(e instanceof ie)||!this._canMergeLeft(e))return;let t=he._createBefore(e);t.stickiness="toNext";let i=he.fromPosition(this.position,"toNext");this._affectedStart.isEqual(t)&&(this._affectedStart.detach(),this._affectedStart=he._createAt(t.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=he._createAt(t.nodeBefore,"end","toNext")),this.position=i.toPosition(),i.detach(),this._filterAttributesAndChildrenOf.push(this.position.parent),t.detach()}_mergeOnRight(){let e=this._lastNode;if(!(e instanceof ie)||!this._canMergeRight(e))return;let t=he._createAfter(e);t.stickiness="toNext";/* v8 ignore if -- @preserve */if(!this.position.isEqual(t))throw new p("insertcontent-invalid-insertion-position",this);this.position=A._createAt(t.nodeBefore,"end");let i=he.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(t)&&(this._affectedEnd.detach(),this._affectedEnd=he._createAt(t.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=he._createAt(t.nodeBefore,0,"toPrevious")),this.position=i.toPosition(),i.detach(),this._filterAttributesAndChildrenOf.push(this.position.parent),t.detach()}_canMergeLeft(e){let t=e.previousSibling;return t instanceof ie&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(t,e)}_canMergeRight(e){let t=e.nextSibling;return t instanceof ie&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(e,t)}_insertAutoParagraph(){this._insertPartialFragment();let e=this.writer.createElement("paragraph");this.writer.insert(e,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=e,this.position=this.writer.createPositionAt(e,0)}_checkAndSplitToAllowedPosition(e){let t=this._getAllowedIn(this.position.parent,e);if(!t)return!1;for(t!=this.position.parent&&this._insertPartialFragment();t!=this.position.parent;)if(this.position.isAtStart){let i=this.position.parent;this.position=this.writer.createPositionBefore(i),i.isEmpty&&i.parent===t&&this.writer.remove(i)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{let i=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=i,this.canMergeWith.add(this.position.nodeAfter)}return this.schema.checkChild(this.position.parent,e)||this._insertAutoParagraph(),!0}_getAllowedIn(e,t){let i=this.schema.createContext(e);return this.schema.checkChild(i,t)||this.schema.checkChild(i,"paragraph")&&this.schema.checkChild(i.push("paragraph"),t)?e:this.schema.isLimit(e)?null:this._getAllowedIn(e.parent,t)}};/** +*/function ZC(e,t,i){return e.change(o=>{let n=i||e.document.selection;n.isCollapsed||e.deleteContent(n,{doNotAutoparagraph:!0});let s=new QC(e,o,n.anchor),r=[],a;if(t.is("documentFragment")){if(t.markers.size){let u=[];for(let[d,h]of t.markers){let{start:f,end:m}=h,g=f.isEqual(m);u.push({position:f,name:d,isCollapsed:g},{position:m,name:d,isCollapsed:g})}u.sort(({position:d},{position:h})=>d.isBefore(h)?1:-1);for(let{position:d,name:h,isCollapsed:f}of u){let m=null,g=null,b=d.parent===t&&d.isAtStart,k=d.parent===t&&d.isAtEnd;!b&&!k?(m=o.createElement("$marker"),o.insert(m,d)):f&&(g=b?"start":"end"),r.push({name:h,element:m,collapsed:g})}}a=t.getChildren()}else a=[t];s.handleNodes(a);let l=s.getSelectionRange();if(t.is("documentFragment")&&r.length){let u=l?Qe.fromRange(l):null,d={};for(let h=r.length-1;h>=0;h--){let{name:f,element:m,collapsed:g}=r[h],b=!d[f];if(b&&(d[f]=[]),m){let k=o.createPositionAt(m,"before");d[f].push(k),o.remove(m)}else{let k=s.getAffectedRange();if(!k){g&&d[f].push(s.position);continue}g?d[f].push(k[g]):d[f].push(b?k.start:k.end)}}for(let[h,[f,m]]of Object.entries(d))f&&m&&f.root===m.root&&f.root.document&&!o.model.markers.has(h)&&o.addMarker(h,{usingOperation:!0,affectsData:!0,range:new T(f,m)});u&&(l=u.toRange(),u.detach())}l&&(n instanceof Te?o.setSelection(l):n.setTo(l));let c=s.getAffectedRange()||e.createRange(n.anchor);return s.destroy(),c})}var QC=class{model;writer;position;canMergeWith;schema;_documentFragment;_documentFragmentPosition;_firstNode=null;_lastNode=null;_lastAutoParagraph=null;_filterAttributesAndChildrenOf=[];_affectedStart=null;_affectedEnd=null;_nodeToSelect=null;constructor(e,t,i){this.model=e,this.writer=t,this.position=i,this.canMergeWith=new Set([this.position.parent]),this.schema=e.schema,this._documentFragment=t.createDocumentFragment(),this._documentFragmentPosition=t.createPositionAt(this._documentFragment,0)}handleNodes(e){for(let t of Array.from(e))t.offsetSize>0&&this._handleNode(t);this._insertPartialFragment(),this._lastAutoParagraph&&this._updateLastNodeFromAutoParagraph(this._lastAutoParagraph),this._mergeOnRight(),this.schema.removeDisallowedAttributes(this._filterAttributesAndChildrenOf,this.writer),this.model._config?.get("experimentalFlags.modelInsertContentDeepSchemaVerification")!==!1&&this._removeDisallowedChildren(this._filterAttributesAndChildrenOf),this._filterAttributesAndChildrenOf=[]}_removeDisallowedChildren(e){let t=Array.from(e);for(let i of t){if(!i.is("element"))continue;let o=[],n=[],s=this.writer.createRangeIn(i).getWalker({ignoreElementEnd:!0});for(let{item:r}of s){let a=r.parent;this.schema.checkChild(a,r)||(r.is("element")&&!this.schema.isObject(r)?(n.push(r),t.push(a)):o.push(r),s.jumpTo(this.writer.createPositionAfter(r)))}for(let r of n)this.writer.unwrap(r);for(let r of o)this.writer.remove(r)}}_updateLastNodeFromAutoParagraph(e){let t=this.writer.createPositionAfter(this._lastNode),i=this.writer.createPositionAfter(e);if(i.isAfter(t)){this._lastNode=e;/* v8 ignore if -- @preserve */if(this.position.parent!=e||!this.position.isAtEnd)throw new p("insertcontent-invalid-insertion-position",this);this.position=i,this._setAffectedBoundaries(this.position)}}getSelectionRange(){return this._nodeToSelect?T._createOn(this._nodeToSelect):this.model.schema.getNearestSelectionRange(this.position)}getAffectedRange(){return this._affectedStart?new T(this._affectedStart,this._affectedEnd):null}destroy(){this._affectedStart&&this._affectedStart.detach(),this._affectedEnd&&this._affectedEnd.detach()}_handleNode(e){if(!this._checkAndSplitToAllowedPosition(e)){this.schema.isObject(e)||this._handleDisallowedNode(e);return}e=this._appendToFragment(e),this._firstNode||(this._firstNode=e),this._lastNode=e}_insertPartialFragment(){if(this._documentFragment.isEmpty)return;let e=he.fromPosition(this.position,"toNext");this._setAffectedBoundaries(this.position),this._documentFragment.getChild(0)==this._firstNode&&(this.writer.insert(this._firstNode,this.position),this._mergeOnLeft(),this.position=e.toPosition()),this._documentFragment.isEmpty||this.writer.insert(this._documentFragment,this.position),this._documentFragmentPosition=this.writer.createPositionAt(this._documentFragment,0),this.position=e.toPosition(),e.detach()}_handleDisallowedNode(e){e.is("element")&&this.handleNodes(e.getChildren())}_appendToFragment(e){/* v8 ignore if -- @preserve */if(!this.schema.checkChild(this.position,e))throw new p("insertcontent-wrong-position",this,{node:e,position:this.position});return this.writer.insert(e,this._documentFragmentPosition),this._documentFragmentPosition=this._documentFragmentPosition.getShiftedBy(e.offsetSize),e.parent||(e=this._documentFragmentPosition.nodeBefore),this.schema.isObject(e)&&!this.schema.checkChild(this.position,"$text")?this._nodeToSelect=e:this._nodeToSelect=null,this._filterAttributesAndChildrenOf.push(e),e}_setAffectedBoundaries(e){this._affectedStart||(this._affectedStart=he.fromPosition(e,"toPrevious")),(!this._affectedEnd||this._affectedEnd.isBefore(e))&&(this._affectedEnd&&this._affectedEnd.detach(),this._affectedEnd=he.fromPosition(e,"toNext"))}_mergeOnLeft(){let e=this._firstNode;if(!(e instanceof ie)||!this._canMergeLeft(e))return;let t=he._createBefore(e);t.stickiness="toNext";let i=he.fromPosition(this.position,"toNext");this._affectedStart.isEqual(t)&&(this._affectedStart.detach(),this._affectedStart=he._createAt(t.nodeBefore,"end","toPrevious")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.isEqual(this._affectedEnd)&&this._firstNode===this._lastNode&&(this._affectedEnd.detach(),this._affectedEnd=he._createAt(t.nodeBefore,"end","toNext")),this.position=i.toPosition(),i.detach(),this._filterAttributesAndChildrenOf.push(this.position.parent),t.detach()}_mergeOnRight(){let e=this._lastNode;if(!(e instanceof ie)||!this._canMergeRight(e))return;let t=he._createAfter(e);t.stickiness="toNext";/* v8 ignore if -- @preserve */if(!this.position.isEqual(t))throw new p("insertcontent-invalid-insertion-position",this);this.position=A._createAt(t.nodeBefore,"end");let i=he.fromPosition(this.position,"toPrevious");this._affectedEnd.isEqual(t)&&(this._affectedEnd.detach(),this._affectedEnd=he._createAt(t.nodeBefore,"end","toNext")),this._firstNode===this._lastNode&&(this._firstNode=t.nodeBefore,this._lastNode=t.nodeBefore),this.writer.merge(t),t.getShiftedBy(-1).isEqual(this._affectedStart)&&this._firstNode===this._lastNode&&(this._affectedStart.detach(),this._affectedStart=he._createAt(t.nodeBefore,0,"toPrevious")),this.position=i.toPosition(),i.detach(),this._filterAttributesAndChildrenOf.push(this.position.parent),t.detach()}_canMergeLeft(e){let t=e.previousSibling;return t instanceof ie&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(t,e)}_canMergeRight(e){let t=e.nextSibling;return t instanceof ie&&this.canMergeWith.has(t)&&this.model.schema.checkMerge(e,t)}_insertAutoParagraph(){this._insertPartialFragment();let e=this.writer.createElement("paragraph");this.writer.insert(e,this.position),this._setAffectedBoundaries(this.position),this._lastAutoParagraph=e,this.position=this.writer.createPositionAt(e,0)}_checkAndSplitToAllowedPosition(e){let t=this._getAllowedIn(this.position.parent,e);if(!t)return!1;for(t!=this.position.parent&&this._insertPartialFragment();t!=this.position.parent;)if(this.position.isAtStart){let i=this.position.parent;this.position=this.writer.createPositionBefore(i),i.isEmpty&&i.parent===t&&this.writer.remove(i)}else if(this.position.isAtEnd)this.position=this.writer.createPositionAfter(this.position.parent);else{let i=this.writer.createPositionAfter(this.position.parent);this._setAffectedBoundaries(this.position),this.writer.split(this.position),this.position=i,this.canMergeWith.add(this.position.nodeAfter)}return this.schema.checkChild(this.position.parent,e)||this._insertAutoParagraph(),!0}_getAllowedIn(e,t){let i=this.schema.createContext(e);return this.schema.checkChild(i,t)||this.schema.checkChild(i,"paragraph")&&this.schema.checkChild(i.push("paragraph"),t)?e:this.schema.isLimit(e)?null:this._getAllowedIn(e.parent,t)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function ZC(e,t,i,o={}){if(!e.schema.isObject(t))throw new p("insertobject-element-not-an-object",e,{object:t});let n=i||e.document.selection,s=n;o.findOptimalPosition&&e.schema.isBlock(t)&&(s=e.createSelection(e.schema.findOptimalInsertionRange(n,o.findOptimalPosition)));let r=G(n.getSelectedBlocks()),a={};return r&&Object.assign(a,e.schema.getAttributesWithProperty(r,"copyOnReplace",!0)),e.change(l=>{s.isCollapsed||e.deleteContent(s,{doNotAutoparagraph:!0});let c=t,u=s.anchor.parent,d=e.schema.createContext(u);!e.schema.checkChild(d,t)&&e.schema.checkChild(d,"paragraph")&&e.schema.checkChild(d.push("paragraph"),t)&&(c=l.createElement("paragraph"),l.insert(t,c)),e.schema.setAllowedAttributes(c,a,l);let h=e.insertContent(c,s);return h.isCollapsed||o.setSelection&&QC(l,t,o.setSelection,a),h})}function QC(e,t,i,o){let n=e.model;if(i=="on"){e.setSelection(t,"on");return}if(i!="after")throw new p("insertobject-invalid-place-parameter-value",n);let s=t.nextSibling;if(n.schema.isInline(t)){e.setSelection(t,"after");return}!(s&&n.schema.checkChild(s,"$text"))&&n.schema.checkChild(t.parent,"paragraph")&&(s=e.createElement("paragraph"),n.schema.setAllowedAttributes(s,o,e),n.insertContent(s,e.createPositionAfter(t))),s&&e.setSelection(s,0)}/** +*/function YC(e,t,i,o={}){if(!e.schema.isObject(t))throw new p("insertobject-element-not-an-object",e,{object:t});let n=i||e.document.selection,s=n;o.findOptimalPosition&&e.schema.isBlock(t)&&(s=e.createSelection(e.schema.findOptimalInsertionRange(n,o.findOptimalPosition)));let r=J(n.getSelectedBlocks()),a={};return r&&Object.assign(a,e.schema.getAttributesWithProperty(r,"copyOnReplace",!0)),e.change(l=>{s.isCollapsed||e.deleteContent(s,{doNotAutoparagraph:!0});let c=t,u=s.anchor.parent,d=e.schema.createContext(u);!e.schema.checkChild(d,t)&&e.schema.checkChild(d,"paragraph")&&e.schema.checkChild(d.push("paragraph"),t)&&(c=l.createElement("paragraph"),l.insert(t,c)),e.schema.setAllowedAttributes(c,a,l);let h=e.insertContent(c,s);return h.isCollapsed||o.setSelection&&XC(l,t,o.setSelection,a),h})}function XC(e,t,i,o){let n=e.model;if(i=="on"){e.setSelection(t,"on");return}if(i!="after")throw new p("insertobject-invalid-place-parameter-value",n);let s=t.nextSibling;if(n.schema.isInline(t)){e.setSelection(t,"after");return}!(s&&n.schema.checkChild(s,"$text"))&&n.schema.checkChild(t.parent,"paragraph")&&(s=e.createElement("paragraph"),n.schema.setAllowedAttributes(s,o,e),n.insertContent(s,e.createPositionAfter(t))),s&&e.setSelection(s,0)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var YC=' ,.?!:;"-()';function XC(e,t,i={}){let o=e.schema,n=i.direction!="backward",s=i.unit?i.unit:"character",r=!!i.treatEmojiAsSingleUnit,a=t.focus,l=new Pt({boundaries:o8(a,n),singleCharacters:!0,direction:n?"forward":"backward"}),c={walker:l,schema:o,isForward:n,unit:s,treatEmojiAsSingleUnit:r},u;for(;u=l.next();){if(u.done)return;let d=e8(c,u.value);if(d){t instanceof Ce?e.change(h=>{h.setSelectionFocus(d)}):t.setFocus(d);return}}}function e8(e,t){let{isForward:i,walker:o,unit:n,schema:s,treatEmojiAsSingleUnit:r}=e,{type:a,item:l,nextPosition:c}=t;if(a=="text")return e.unit==="word"?i8(o,i):t8(o,n,r);if(a==(i?"elementStart":"elementEnd")){if(s.isSelectable(l))return A._createAt(l,i?"after":"before");if(s.checkChild(c,"$text"))return c}else{if(s.isLimit(l)){o.skip(()=>!0);return}if(s.checkChild(c,"$text"))return c}}function t8(e,t,i){let o=e.position.textNode;if(o){let n=o.data,s=e.position.offset-o.startOffset;for(;Ds(n,s)||t=="character"&&Fs(n,s)||i&&za(n,s);)e.next(),s=e.position.offset-o.startOffset}return e.position}function i8(e,t){let i=e.position.textNode;for(i||(i=t?e.position.nodeAfter:e.position.nodeBefore);i&&i.is("$text");){let o=e.position.offset-i.startOffset;if(s8(i,o,t))i=t?e.position.nodeAfter:e.position.nodeBefore;else{if(n8(i.data,o,t))break;e.next()}}return e.position}function o8(e,t){let i=e.root,o=A._createAt(i,t?"end":0);return t?new T(e,o):new T(o,e)}function n8(e,t,i){let o=t+(i?0:-1);return YC.includes(e.charAt(o))}function s8(e,t,i){return t===(i?e.offsetSize:0)}/** +*/var e8=' ,.?!:;"-()';function t8(e,t,i={}){let o=e.schema,n=i.direction!="backward",s=i.unit?i.unit:"character",r=!!i.treatEmojiAsSingleUnit,a=t.focus,l=new Rt({boundaries:s8(a,n),singleCharacters:!0,direction:n?"forward":"backward"}),c={walker:l,schema:o,isForward:n,unit:s,treatEmojiAsSingleUnit:r},u;for(;u=l.next();){if(u.done)return;let d=i8(c,u.value);if(d){t instanceof Te?e.change(h=>{h.setSelectionFocus(d)}):t.setFocus(d);return}}}function i8(e,t){let{isForward:i,walker:o,unit:n,schema:s,treatEmojiAsSingleUnit:r}=e,{type:a,item:l,nextPosition:c}=t;if(a=="text")return e.unit==="word"?n8(o,i):o8(o,n,r);if(a==(i?"elementStart":"elementEnd")){if(s.isSelectable(l))return A._createAt(l,i?"after":"before");if(s.checkChild(c,"$text"))return c}else{if(s.isLimit(l)){o.skip(()=>!0);return}if(s.checkChild(c,"$text"))return c}}function o8(e,t,i){let o=e.position.textNode;if(o){let n=o.data,s=e.position.offset-o.startOffset;for(;Ds(n,s)||t=="character"&&Fs(n,s)||i&&Ha(n,s);)e.next(),s=e.position.offset-o.startOffset}return e.position}function n8(e,t){let i=e.position.textNode;for(i||(i=t?e.position.nodeAfter:e.position.nodeBefore);i&&i.is("$text");){let o=e.position.offset-i.startOffset;if(a8(i,o,t))i=t?e.position.nodeAfter:e.position.nodeBefore;else{if(r8(i.data,o,t))break;e.next()}}return e.position}function s8(e,t){let i=e.root,o=A._createAt(i,t?"end":0);return t?new T(e,o):new T(o,e)}function r8(e,t,i){let o=t+(i?0:-1);return e8.includes(e.charAt(o))}function a8(e,t,i){return t===(i?e.offsetSize:0)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var r8=W(),o1=class extends r8{markers;document;schema;_config;_pendingChanges;_currentWriter;constructor(e){super(),this.markers=new xC,this.document=new vC(this),this.schema=new D7,this._config=e,this._pendingChanges=[],this._currentWriter=null,["deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(t=>this.decorate(t)),this.on("applyOperation",(t,i)=>{i[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$inlineRoot",{allowContentOf:"$block",allowAttributesOf:"$root",isLimit:!0}),this.schema.register("$container",{allowIn:["$root","$container"]}),this.schema.register("$block",{allowIn:["$root","$container"],isBlock:!0}),this.schema.register("$blockObject",{allowWhere:"$block",isBlock:!0,isObject:!0}),this.schema.register("$inlineObject",{allowWhere:"$text",allowAttributesOf:"$text",isInline:!0,isObject:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:["$root","$inlineRoot"],allowChildren:"$text",isLimit:!0}),this.schema.register("$documentFragment",{allowContentOf:["$root","$inlineRoot"],allowChildren:"$text",isLimit:!0}),this.schema.register("$marker"),this.schema.addChildCheck(()=>!0,"$marker"),SC(this),this.document.registerPostFixer(Dp),this.on("insertContent",(t,[i,o])=>{t.return=GC(this,i,o)}),this.on("insertObject",(t,[i,o,n])=>{t.return=ZC(this,i,o,n)}),this.on("canEditAt",t=>{let i=!this.document.isReadOnly;t.return=i,i||t.stop()})}change(e){try{return this._pendingChanges.length===0?(this._pendingChanges.push({batch:new Tn,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(t){p.rethrowUnexpectedError(t,this)}}enqueueChange(e,t){try{e?typeof e=="function"?(t=e,e=new Tn):e instanceof Tn||(e=new Tn(e)):e=new Tn,this._pendingChanges.push({batch:e,callback:t}),this._pendingChanges.length==1&&this._runPendingChanges()}catch(i){p.rethrowUnexpectedError(i,this)}}applyOperation(e){e._execute()}insertContent(e,t,i,...o){let n=Qu(t,i);return this.fire("insertContent",[e,n,i,...o])}insertObject(e,t,i,o,...n){let s=Qu(t,i);return this.fire("insertObject",[e,s,o,o,...n])}deleteContent(e,t){BC(this,e,t)}modifySelection(e,t){XC(this,e,t)}getSelectedContent(e){return KC(this,e)}hasContent(e,t={}){let i;e.is("selection")?i=Array.from(e.getRanges()):e.is("range")?i=[e]:i=[T._createIn(e)];for(let o of i)if(this._rangeHasContent(o,t))return!0;return!1}_rangeHasContent(e,t){if(e.isCollapsed)return!1;let{ignoreWhitespaces:i=!1,ignoreMarkers:o=!1}=t;if(!o){for(let n of this.markers.getMarkersIntersectingRange(e))if(n.affectsData)return!0}for(let n of e.getItems())if(this.schema.isContent(n))if(n.is("$textProxy"))if(i){if(n.data.search(/\S/)!==-1)return!0}else return!0;else return!0;return!1}canEditAt(e){let t=Qu(e);return this.fire("canEditAt",[t])}createPositionFromPath(e,t,i){return new A(e,t,i)}createPositionAt(e,t){return A._createAt(e,t)}createPositionAfter(e){return A._createAfter(e)}createPositionBefore(e){return A._createBefore(e)}createRange(e,t){return new T(e,t)}createRangeIn(e){return T._createIn(e)}createRangeOn(e){return T._createOn(e)}createSelection(...e){return new St(...e)}createBatch(e){return new Tn(e)}createOperationFromJSON(e){return lC.fromJSON(e,this.document)}destroy(){this.document.destroy(),this.markers.destroy(),this.stopListening()}_runPendingChanges(){let e=[];this.fire("_beforeChanges");try{for(;this._pendingChanges.length;){let t=this._pendingChanges[0].batch;this._currentWriter=new AC(this,t);let i=this._pendingChanges[0].callback(this._currentWriter);e.push(i),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}}finally{this._pendingChanges.length=0,this._currentWriter=null,this.fire("_afterChanges")}return e}};function Qu(e,t){if(e)return e instanceof St||e instanceof Ce?e:e instanceof Eo?t||t===0?new St(e,t):e.is("rootElement")?new St(e,"in"):new St(e,"on"):new St(e)}/** +*/var l8=W(),s1=class extends l8{markers;document;schema;_config;_pendingChanges;_currentWriter;constructor(e){super(),this.markers=new EC,this.document=new CC(this),this.schema=new N7,this._config=e,this._pendingChanges=[],this._currentWriter=null,["deleteContent","modifySelection","getSelectedContent","applyOperation"].forEach(t=>this.decorate(t)),this.on("applyOperation",(t,i)=>{i[0]._validate()},{priority:"highest"}),this.schema.register("$root",{isLimit:!0}),this.schema.register("$inlineRoot",{allowContentOf:"$block",allowAttributesOf:"$root",isLimit:!0}),this.schema.register("$container",{allowIn:["$root","$container"]}),this.schema.register("$block",{allowIn:["$root","$container"],isBlock:!0}),this.schema.register("$blockObject",{allowWhere:"$block",isBlock:!0,isObject:!0}),this.schema.register("$inlineObject",{allowWhere:"$text",allowAttributesOf:"$text",isInline:!0,isObject:!0}),this.schema.register("$text",{allowIn:"$block",isInline:!0,isContent:!0}),this.schema.register("$clipboardHolder",{allowContentOf:["$root","$inlineRoot"],allowChildren:"$text",isLimit:!0}),this.schema.register("$documentFragment",{allowContentOf:["$root","$inlineRoot"],allowChildren:"$text",isLimit:!0}),this.schema.register("$marker"),this.schema.addChildCheck(()=>!0,"$marker"),RC(this),this.document.registerPostFixer(Np),this.on("insertContent",(t,[i,o])=>{t.return=ZC(this,i,o)}),this.on("insertObject",(t,[i,o,n])=>{t.return=YC(this,i,o,n)}),this.on("canEditAt",t=>{let i=!this.document.isReadOnly;t.return=i,i||t.stop()})}change(e){try{return this._pendingChanges.length===0?(this._pendingChanges.push({batch:new Tn,callback:e}),this._runPendingChanges()[0]):e(this._currentWriter)}catch(t){p.rethrowUnexpectedError(t,this)}}enqueueChange(e,t){try{e?typeof e=="function"?(t=e,e=new Tn):e instanceof Tn||(e=new Tn(e)):e=new Tn,this._pendingChanges.push({batch:e,callback:t}),this._pendingChanges.length==1&&this._runPendingChanges()}catch(i){p.rethrowUnexpectedError(i,this)}}applyOperation(e){e._execute()}insertContent(e,t,i,...o){let n=Xu(t,i);return this.fire("insertContent",[e,n,i,...o])}insertObject(e,t,i,o,...n){let s=Xu(t,i);return this.fire("insertObject",[e,s,o,o,...n])}deleteContent(e,t){DC(this,e,t)}modifySelection(e,t){t8(this,e,t)}getSelectedContent(e){return JC(this,e)}hasContent(e,t={}){let i;e.is("selection")?i=Array.from(e.getRanges()):e.is("range")?i=[e]:i=[T._createIn(e)];for(let o of i)if(this._rangeHasContent(o,t))return!0;return!1}_rangeHasContent(e,t){if(e.isCollapsed)return!1;let{ignoreWhitespaces:i=!1,ignoreMarkers:o=!1}=t;if(!o){for(let n of this.markers.getMarkersIntersectingRange(e))if(n.affectsData)return!0}for(let n of e.getItems())if(this.schema.isContent(n))if(n.is("$textProxy"))if(i){if(n.data.search(/\S/)!==-1)return!0}else return!0;else return!0;return!1}canEditAt(e){let t=Xu(e);return this.fire("canEditAt",[t])}createPositionFromPath(e,t,i){return new A(e,t,i)}createPositionAt(e,t){return A._createAt(e,t)}createPositionAfter(e){return A._createAfter(e)}createPositionBefore(e){return A._createBefore(e)}createRange(e,t){return new T(e,t)}createRangeIn(e){return T._createIn(e)}createRangeOn(e){return T._createOn(e)}createSelection(...e){return new Pt(...e)}createBatch(e){return new Tn(e)}createOperationFromJSON(e){return uC.fromJSON(e,this.document)}destroy(){this.document.destroy(),this.markers.destroy(),this.stopListening()}_runPendingChanges(){let e=[];this.fire("_beforeChanges");try{for(;this._pendingChanges.length;){let t=this._pendingChanges[0].batch;this._currentWriter=new SC(this,t);let i=this._pendingChanges[0].callback(this._currentWriter);e.push(i),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null}}finally{this._pendingChanges.length=0,this._currentWriter=null,this.fire("_afterChanges")}return e}};function Xu(e,t){if(e)return e instanceof Pt||e instanceof Te?e:e instanceof Ao?t||t===0?new Pt(e,t):e.is("rootElement")?new Pt(e,"in"):new Pt(e,"on"):new Pt(e)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var ll=class extends $e{domEventType="click";onDomEvent(e){this.fire(e.type,e)}};/** +*/var cl=class extends $e{domEventType="click";onDomEvent(e){this.fire(e.type,e)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */var lr=class extends $e{domEventType=["mousedown","mouseup","mouseover","mouseout"];onDomEvent(e){this.fire(e.type,e)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var n1=class extends $e{domEventType=["touchstart","touchend","touchmove"];onDomEvent(e){this.fire(e.type,e)}};/** +*/var r1=class extends $e{domEventType=["touchstart","touchend","touchmove"];onDomEvent(e){this.fire(e.type,e)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var cl=class extends $e{domEventType=["pointerdown","pointerup","pointermove"];onDomEvent(e){this.fire(e.type,e)}};/** +*/var ul=class extends $e{domEventType=["pointerdown","pointerup","pointermove"];onDomEvent(e){this.fire(e.type,e)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Vt=class{document;constructor(e){this.document=e}createDocumentFragment(e){return new vo(this.document,e)}createElement(e,t,i){return new mi(this.document,e,t,i)}createText(e){return new He(this.document,e)}clone(e,t=!1){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,i){return i._insertChild(e,t)}removeChildren(e,t,i){return i._removeChildren(e,t)}remove(e){let t=e.parent;return t?this.removeChildren(t.getChildIndex(e),1,t):[]}replace(e,t){let i=e.parent;if(i){let o=i.getChildIndex(e);return this.removeChildren(o,1,i),this.insertChild(o,t,i),!0}return!1}unwrapElement(e){let t=e.parent;if(t){let i=t.getChildIndex(e);this.remove(e),this.insertChild(i,e.getChildren(),t)}}rename(e,t){let i=new mi(this.document,e,t.getAttributes(),t.getChildren());return this.replace(t,i)?i:null}setAttribute(e,t,i){i._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,i){Ee(e)&&i===void 0?t._setStyle(e):i._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,i){i._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return P._createAt(e,t)}createPositionAfter(e){return P._createAfter(e)}createPositionBefore(e){return P._createBefore(e)}createRange(e,t){return new N(e,t)}createRangeOn(e){return N._createOn(e)}createRangeIn(e){return N._createIn(e)}createSelection(...e){return new fi(...e)}};/** +*/var Lt=class{document;constructor(e){this.document=e}createDocumentFragment(e){return new ko(this.document,e)}createElement(e,t,i){return new pi(this.document,e,t,i)}createText(e){return new He(this.document,e)}clone(e,t=!1){return e._clone(t)}appendChild(e,t){return t._appendChild(e)}insertChild(e,t,i){return i._insertChild(e,t)}removeChildren(e,t,i){return i._removeChildren(e,t)}remove(e){let t=e.parent;return t?this.removeChildren(t.getChildIndex(e),1,t):[]}replace(e,t){let i=e.parent;if(i){let o=i.getChildIndex(e);return this.removeChildren(o,1,i),this.insertChild(o,t,i),!0}return!1}unwrapElement(e){let t=e.parent;if(t){let i=t.getChildIndex(e);this.remove(e),this.insertChild(i,e.getChildren(),t)}}rename(e,t){let i=new pi(this.document,e,t.getAttributes(),t.getChildren());return this.replace(t,i)?i:null}setAttribute(e,t,i){i._setAttribute(e,t)}removeAttribute(e,t){t._removeAttribute(e)}addClass(e,t){t._addClass(e)}removeClass(e,t){t._removeClass(e)}setStyle(e,t,i){Ie(e)&&i===void 0?t._setStyle(e):i._setStyle(e,t)}removeStyle(e,t){t._removeStyle(e)}setCustomProperty(e,t,i){i._setCustomProperty(e,t)}removeCustomProperty(e,t){return t._removeCustomProperty(e)}createPositionAt(e,t){return P._createAt(e,t)}createPositionAfter(e){return P._createAfter(e)}createPositionBefore(e){return P._createBefore(e)}createRange(e,t){return new N(e,t)}createRangeOn(e){return N._createOn(e)}createRangeIn(e){return N._createIn(e)}createSelection(...e){return new gi(...e)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var a8=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,l8=/^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i,c8=/^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,u8=/^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i,d8=/^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,h8=/\w+\((?:[^()]|\([^()]*\))*\)|\S+/gi,f8=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","activeborder","activecaption","appworkspace","background","buttonface","buttonhighlight","buttonshadow","buttontext","captiontext","graytext","highlight","highlighttext","inactiveborder","inactivecaption","inactivecaptiontext","infobackground","infotext","menu","menutext","scrollbar","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","window","windowframe","windowtext","rebeccapurple","currentcolor","transparent"]);function Td(e){return e.startsWith("#")?a8.test(e):e.startsWith("rgb")?l8.test(e)||c8.test(e):e.startsWith("hsl")?u8.test(e)||d8.test(e):f8.has(e.toLowerCase())}var m8=["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset"];function g8(e){return m8.includes(e)}var p8=/^([+-]?[0-9]*([.][0-9]+)?(px|cm|mm|in|pc|pt|ch|em|ex|rem|vh|vw|vmin|vmax)|0)$/;function Mn(e){return p8.test(e)}var b8=/^[+-]?[0-9]*([.][0-9]+)?%$/;function ko(e){return b8.test(e)}var w8=["auto","cover","contain"];function y8(e){return w8.includes(e)||Mn(e)||ko(e)}var _8=["repeat-x","repeat-y","repeat","space","round","no-repeat"];function v8(e){return _8.includes(e)}var k8=["center","top","bottom","left","right"];function C8(e){return k8.includes(e)}var x8=["fixed","scroll","local"];function T8(e){return x8.includes(e)}var E8=["border-box","padding-box","content-box"];function A8(e){return E8.includes(e)}var I8=["border-box","padding-box","content-box","text"];function S8(e){return I8.includes(e)}function Qs(e=""){if(e==="")return{top:void 0,right:void 0,bottom:void 0,left:void 0};let t=Ed(e),i=t[0],o=t[2]||i,n=t[1]||i;return{top:i,bottom:o,right:n,left:t[3]||n}}function Ys(e){return t=>{let{top:i,right:o,bottom:n,left:s}=t,r=[];return[i,o,s,n].every(a=>!!a)?r.push([e,P8(t)]):(i&&r.push([e+"-top",i]),o&&r.push([e+"-right",o]),n&&r.push([e+"-bottom",n]),s&&r.push([e+"-left",s])),r}}function P8({top:e,right:t,bottom:i,left:o}){let n=[];return o!==t?n.push(e,t,i,o):i!==e?n.push(e,t,i):t!==e?n.push(e,t):n.push(e),n.join(" ")}function s1(e){return t=>({path:e,value:Qs(t)})}function Ed(e){let t=e.trim().slice(0,1500).matchAll(h8);return Array.from(t).map(i=>i[0])}/** +*/var c8=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,u8=/^rgb\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}[0-9]{1,3}[ %]?\)$/i,d8=/^rgba\([ ]?([0-9]{1,3}[ %]?,[ ]?){3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,h8=/^hsl\([ ]?([0-9]{1,3}[ %]?[,]?[ ]*){3}(1|[0-9]+%|[0]?\.?[0-9]+)?\)$/i,f8=/^hsla\([ ]?([0-9]{1,3}[ %]?,[ ]?){2,3}(1|[0-9]+%|[0]?\.?[0-9]+)\)$/i,m8=/\w+\((?:[^()]|\([^()]*\))*\)|\S+/gi,g8=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","activeborder","activecaption","appworkspace","background","buttonface","buttonhighlight","buttonshadow","buttontext","captiontext","graytext","highlight","highlighttext","inactiveborder","inactivecaption","inactivecaptiontext","infobackground","infotext","menu","menutext","scrollbar","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","window","windowframe","windowtext","rebeccapurple","currentcolor","transparent"]);function Ad(e){return e.startsWith("#")?c8.test(e):e.startsWith("rgb")?u8.test(e)||d8.test(e):e.startsWith("hsl")?h8.test(e)||f8.test(e):g8.has(e.toLowerCase())}var p8=["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset"];function b8(e){return p8.includes(e)}var w8=/^([+-]?[0-9]*([.][0-9]+)?(px|cm|mm|in|pc|pt|ch|em|ex|rem|vh|vw|vmin|vmax)|0)$/;function Mn(e){return w8.test(e)}var y8=/^[+-]?[0-9]*([.][0-9]+)?%$/;function Co(e){return y8.test(e)}var _8=["auto","cover","contain"];function v8(e){return _8.includes(e)||Mn(e)||Co(e)}var k8=["repeat-x","repeat-y","repeat","space","round","no-repeat"];function C8(e){return k8.includes(e)}var x8=["center","top","bottom","left","right"];function T8(e){return x8.includes(e)}var E8=["fixed","scroll","local"];function A8(e){return E8.includes(e)}var I8=["border-box","padding-box","content-box"];function S8(e){return I8.includes(e)}var P8=["border-box","padding-box","content-box","text"];function R8(e){return P8.includes(e)}function Qs(e=""){if(e==="")return{top:void 0,right:void 0,bottom:void 0,left:void 0};let t=Id(e),i=t[0],o=t[2]||i,n=t[1]||i;return{top:i,bottom:o,right:n,left:t[3]||n}}function Ys(e){return t=>{let{top:i,right:o,bottom:n,left:s}=t,r=[];return[i,o,s,n].every(a=>!!a)?r.push([e,V8(t)]):(i&&r.push([e+"-top",i]),o&&r.push([e+"-right",o]),n&&r.push([e+"-bottom",n]),s&&r.push([e+"-left",s])),r}}function V8({top:e,right:t,bottom:i,left:o}){let n=[];return o!==t?n.push(e,t,i,o):i!==e?n.push(e,t,i):t!==e?n.push(e,t):n.push(e),n.join(" ")}function a1(e){return t=>({path:e,value:Qs(t)})}function Id(e){let t=e.trim().slice(0,1500).matchAll(m8);return Array.from(t).map(i=>i[0])}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Ne={image:"none",repeat:"repeat",position:"0% 0%",size:"auto",origin:"padding-box",clip:"border-box",attachment:"scroll"},R8=["linear-gradient","repeating-linear-gradient","radial-gradient","repeating-radial-gradient","conic-gradient","repeating-conic-gradient","url"];function ul(e){e.setNormalizer("background-color",L8());for(let t in Ne)e.setNormalizer(`background-${t}`,M8(`background.${t}`)),e.setReducer(`background-${t}`,B8(`background-${t}`));e.setNormalizer("background",V8()),e.setReducer("background",O8()),e.setStyleRelation("background",["background-color","background-image","background-repeat","background-position","background-size","background-attachment","background-origin","background-clip"])}function V8(){return e=>{let t=U8(e);return t.length||t.push({...Ad(),color:e}),{path:"background",value:W8(t)}}}function L8(){return e=>({path:"background.color",value:e})}function M8(e){return t=>({path:e,value:r1(t)})}function B8(e){return t=>[[e,t.join(", ")]]}function O8(){return e=>{let t=e;return Object.keys(Ne).every(i=>{let o=t[i];return o!==void 0&&(!Array.isArray(o)||o.length>0)})?D8(t):F8(t)}}function D8(e){let t=[],i=z8(e).map(o=>N8(o).trim()).filter(Boolean).join(", ");return i&&t.push(["background",i]),t}function F8(e){let t=[];for(let i in Ne){let o=e[i];Array.isArray(o)&&t.push([`background-${i}`,o.join(", ")])}return e.color!==void 0&&t.push(["background-color",e.color]),t}function N8(e){let t=[];e.image&&e.image!==Ne.image&&t.push(e.image);let i=e.position.join(" "),o=!i||i===Ne.position;o||t.push(i);let n=e.size.join(" ");!n||n===Ne.size||(o&&t.push("0% 0%"),t.push("/",n));let s=e.repeat.join(" ");s&&s!==Ne.repeat&&t.push(s),e.attachment&&e.attachment!==Ne.attachment&&t.push(e.attachment);let r=e.origin===Ne.origin,a=e.clip===Ne.clip;return(!r||!a)&&(t.push(e.origin),e.clip!==e.origin&&t.push(e.clip)),e.color&&t.push(e.color),t.join(" ")}function z8(e){let t=H8(e),i=Array.from({length:t},(o,n)=>{let s=Ad();return e.image?.[n]&&(s.image=e.image[n]),e.position?.[n]&&(s.position=e.position[n].split(" ")),e.size?.[n]&&(s.size=e.size[n].split(" ")),e.repeat?.[n]&&(s.repeat=e.repeat[n].split(" ")),e.attachment?.[n]&&(s.attachment=e.attachment[n]),e.origin?.[n]&&(s.origin=e.origin[n]),e.clip?.[n]&&(s.clip=e.clip[n]),s});return e.color&&(i.at(-1).color=e.color),i}function H8(e){let t=0;for(let i of Object.values(e))Array.isArray(i)&&i.length>t&&(t=i.length);return t}function W8(e){let t={image:[],position:[],size:[],repeat:[],attachment:[],origin:[],clip:[]};for(let i of e)t.position.push(i.position.join(" ")),t.size.push(i.size.join(" ")),t.repeat.push(i.repeat.join(" ")),t.image.push(i.image),t.attachment.push(i.attachment),t.origin.push(i.origin),t.clip.push(i.clip);return e.at(-1)?.color&&(t.color=e.at(-1).color),t}function U8(e){return r1(e).map(q8).filter(t=>t!==null)}function q8(e){let t={},{value:i,image:o}=$8(e),n=Ed(i);o&&(t.image=o);for(let s=0;s{let t=$8(e);return t.length||t.push({...Sd(),color:e}),{path:"background",value:q8(t)}}}function B8(){return e=>({path:"background.color",value:e})}function O8(e){return t=>({path:e,value:l1(t)})}function D8(e){return t=>[[e,t.join(", ")]]}function F8(){return e=>{let t=e;return Object.keys(Ne).every(i=>{let o=t[i];return o!==void 0&&(!Array.isArray(o)||o.length>0)})?N8(t):z8(t)}}function N8(e){let t=[],i=W8(e).map(o=>H8(o).trim()).filter(Boolean).join(", ");return i&&t.push(["background",i]),t}function z8(e){let t=[];for(let i in Ne){let o=e[i];Array.isArray(o)&&t.push([`background-${i}`,o.join(", ")])}return e.color!==void 0&&t.push(["background-color",e.color]),t}function H8(e){let t=[];e.image&&e.image!==Ne.image&&t.push(e.image);let i=e.position.join(" "),o=!i||i===Ne.position;o||t.push(i);let n=e.size.join(" ");!n||n===Ne.size||(o&&t.push("0% 0%"),t.push("/",n));let s=e.repeat.join(" ");s&&s!==Ne.repeat&&t.push(s),e.attachment&&e.attachment!==Ne.attachment&&t.push(e.attachment);let r=e.origin===Ne.origin,a=e.clip===Ne.clip;return(!r||!a)&&(t.push(e.origin),e.clip!==e.origin&&t.push(e.clip)),e.color&&t.push(e.color),t.join(" ")}function W8(e){let t=U8(e),i=Array.from({length:t},(o,n)=>{let s=Sd();return e.image?.[n]&&(s.image=e.image[n]),e.position?.[n]&&(s.position=e.position[n].split(" ")),e.size?.[n]&&(s.size=e.size[n].split(" ")),e.repeat?.[n]&&(s.repeat=e.repeat[n].split(" ")),e.attachment?.[n]&&(s.attachment=e.attachment[n]),e.origin?.[n]&&(s.origin=e.origin[n]),e.clip?.[n]&&(s.clip=e.clip[n]),s});return e.color&&(i.at(-1).color=e.color),i}function U8(e){let t=0;for(let i of Object.values(e))Array.isArray(i)&&i.length>t&&(t=i.length);return t}function q8(e){let t={image:[],position:[],size:[],repeat:[],attachment:[],origin:[],clip:[]};for(let i of e)t.position.push(i.position.join(" ")),t.size.push(i.size.join(" ")),t.repeat.push(i.repeat.join(" ")),t.image.push(i.image),t.attachment.push(i.attachment),t.origin.push(i.origin),t.clip.push(i.clip);return e.at(-1)?.color&&(t.color=e.at(-1).color),t}function $8(e){return l1(e).map(j8).filter(t=>t!==null)}function j8(e){let t={},{value:i,image:o}=K8(e),n=Id(i);o&&(t.image=o);for(let s=0;s{let{color:t,style:i,width:o}=a1(e);return{path:"border",value:{color:Qs(t),style:Qs(i),width:Qs(o)}}}}function $a(e){return t=>{let{color:i,style:o,width:n}=a1(t),s={};return i!==void 0&&(s.color={[e]:i}),o!==void 0&&(s.style={[e]:o}),n!==void 0&&(s.width={[e]:n}),{path:"border",value:s}}}function Yu(e){return t=>({path:"border",value:K8(t,e)})}function K8(e,t){return{[t]:Qs(e)}}function bt(e,t){return i=>({path:"border",value:{[e]:{[t]:i}}})}function ja(e){return(t,i)=>{if(i.border)return js(i.border,e)}}function js(e,t){let i={};return e.width&&e.width[t]&&(i.width=e.width[t]),e.style&&e.style[t]&&(i.style=e.style[t]),e.color&&e.color[t]&&(i.color=e.color[t]),i}function a1(e){let t={},i=Ed(e);for(let o of i)Mn(o)||/thin|medium|thick/.test(o)?t.width=o:g8(o)?t.style=o:t.color=o;return t}function G8(){return t=>{let i=js(t,"top"),o=js(t,"right"),n=js(t,"bottom"),s=js(t,"left"),r=[i,o,n,s],a={width:e(r,"width"),style:e(r,"style"),color:e(r,"color")},l=An(a,"all");return l.length?l:[...Object.entries(a).reduce((c,[u,d])=>(d&&(c.push([`border-${u}`,d]),r.forEach(h=>delete h[u])),c),[]),...An(i,"top"),...An(o,"right"),...An(n,"bottom"),...An(s,"left")]};function e(t,i){return t.map(o=>o[i]).reduce((o,n)=>o==n?o:null)}}function Ka(e){return t=>An(t,e)}function An(e,t){let i=[];if(e&&e.width&&i.push("width"),e&&e.style&&i.push("style"),e&&e.color&&i.push("color"),i.length==3){let o=i.map(n=>e[n]).join(" ");return[t=="all"?["border",o]:[`border-${t}`,o]]}return t=="all"?[]:i.map(o=>[`border-${t}-${o}`,e[o]])}/** +*/function Pd(e){e.setNormalizer("border",G8()),e.setNormalizer("border-top",ja("top")),e.setNormalizer("border-right",ja("right")),e.setNormalizer("border-bottom",ja("bottom")),e.setNormalizer("border-left",ja("left")),e.setNormalizer("border-color",ed("color")),e.setNormalizer("border-width",ed("width")),e.setNormalizer("border-style",ed("style")),e.setNormalizer("border-top-color",wt("color","top")),e.setNormalizer("border-top-style",wt("style","top")),e.setNormalizer("border-top-width",wt("width","top")),e.setNormalizer("border-right-color",wt("color","right")),e.setNormalizer("border-right-style",wt("style","right")),e.setNormalizer("border-right-width",wt("width","right")),e.setNormalizer("border-bottom-color",wt("color","bottom")),e.setNormalizer("border-bottom-style",wt("style","bottom")),e.setNormalizer("border-bottom-width",wt("width","bottom")),e.setNormalizer("border-left-color",wt("color","left")),e.setNormalizer("border-left-style",wt("style","left")),e.setNormalizer("border-left-width",wt("width","left")),e.setExtractor("border-top",Ka("top")),e.setExtractor("border-right",Ka("right")),e.setExtractor("border-bottom",Ka("bottom")),e.setExtractor("border-left",Ka("left")),e.setExtractor("border-top-color","border.color.top"),e.setExtractor("border-right-color","border.color.right"),e.setExtractor("border-bottom-color","border.color.bottom"),e.setExtractor("border-left-color","border.color.left"),e.setExtractor("border-top-width","border.width.top"),e.setExtractor("border-right-width","border.width.right"),e.setExtractor("border-bottom-width","border.width.bottom"),e.setExtractor("border-left-width","border.width.left"),e.setExtractor("border-top-style","border.style.top"),e.setExtractor("border-right-style","border.style.right"),e.setExtractor("border-bottom-style","border.style.bottom"),e.setExtractor("border-left-style","border.style.left"),e.setReducer("border-color",Ys("border-color")),e.setReducer("border-style",Ys("border-style")),e.setReducer("border-width",Ys("border-width")),e.setReducer("border-top",Ga("top")),e.setReducer("border-right",Ga("right")),e.setReducer("border-bottom",Ga("bottom")),e.setReducer("border-left",Ga("left")),e.setReducer("border",Z8()),e.setStyleRelation("border",["border-color","border-style","border-width","border-top","border-right","border-bottom","border-left","border-top-color","border-right-color","border-bottom-color","border-left-color","border-top-style","border-right-style","border-bottom-style","border-left-style","border-top-width","border-right-width","border-bottom-width","border-left-width"]),e.setStyleRelation("border-color",["border-top-color","border-right-color","border-bottom-color","border-left-color"]),e.setStyleRelation("border-style",["border-top-style","border-right-style","border-bottom-style","border-left-style"]),e.setStyleRelation("border-width",["border-top-width","border-right-width","border-bottom-width","border-left-width"]),e.setStyleRelation("border-top",["border-top-color","border-top-style","border-top-width"]),e.setStyleRelation("border-right",["border-right-color","border-right-style","border-right-width"]),e.setStyleRelation("border-bottom",["border-bottom-color","border-bottom-style","border-bottom-width"]),e.setStyleRelation("border-left",["border-left-color","border-left-style","border-left-width"])}function G8(){return e=>{let{color:t,style:i,width:o}=c1(e);return{path:"border",value:{color:Qs(t),style:Qs(i),width:Qs(o)}}}}function ja(e){return t=>{let{color:i,style:o,width:n}=c1(t),s={};return i!==void 0&&(s.color={[e]:i}),o!==void 0&&(s.style={[e]:o}),n!==void 0&&(s.width={[e]:n}),{path:"border",value:s}}}function ed(e){return t=>({path:"border",value:J8(t,e)})}function J8(e,t){return{[t]:Qs(e)}}function wt(e,t){return i=>({path:"border",value:{[e]:{[t]:i}}})}function Ka(e){return(t,i)=>{if(i.border)return js(i.border,e)}}function js(e,t){let i={};return e.width&&e.width[t]&&(i.width=e.width[t]),e.style&&e.style[t]&&(i.style=e.style[t]),e.color&&e.color[t]&&(i.color=e.color[t]),i}function c1(e){let t={},i=Id(e);for(let o of i)Mn(o)||/thin|medium|thick/.test(o)?t.width=o:b8(o)?t.style=o:t.color=o;return t}function Z8(){return t=>{let i=js(t,"top"),o=js(t,"right"),n=js(t,"bottom"),s=js(t,"left"),r=[i,o,n,s],a={width:e(r,"width"),style:e(r,"style"),color:e(r,"color")},l=An(a,"all");return l.length?l:[...Object.entries(a).reduce((c,[u,d])=>(d&&(c.push([`border-${u}`,d]),r.forEach(h=>delete h[u])),c),[]),...An(i,"top"),...An(o,"right"),...An(n,"bottom"),...An(s,"left")]};function e(t,i){return t.map(o=>o[i]).reduce((o,n)=>o==n?o:null)}}function Ga(e){return t=>An(t,e)}function An(e,t){let i=[];if(e&&e.width&&i.push("width"),e&&e.style&&i.push("style"),e&&e.color&&i.push("color"),i.length==3){let o=i.map(n=>e[n]).join(" ");return[t=="all"?["border",o]:[`border-${t}`,o]]}return t=="all"?[]:i.map(o=>[`border-${t}-${o}`,e[o]])}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function l1(e){e.setNormalizer("margin",s1("margin")),e.setNormalizer("margin-top",t=>({path:"margin.top",value:t})),e.setNormalizer("margin-right",t=>({path:"margin.right",value:t})),e.setNormalizer("margin-bottom",t=>({path:"margin.bottom",value:t})),e.setNormalizer("margin-left",t=>({path:"margin.left",value:t})),e.setReducer("margin",Ys("margin")),e.setStyleRelation("margin",["margin-top","margin-right","margin-bottom","margin-left"])}/** +*/function u1(e){e.setNormalizer("margin",a1("margin")),e.setNormalizer("margin-top",t=>({path:"margin.top",value:t})),e.setNormalizer("margin-right",t=>({path:"margin.right",value:t})),e.setNormalizer("margin-bottom",t=>({path:"margin.bottom",value:t})),e.setNormalizer("margin-left",t=>({path:"margin.left",value:t})),e.setReducer("margin",Ys("margin")),e.setStyleRelation("margin",["margin-top","margin-right","margin-bottom","margin-left"])}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function c1(e){e.setNormalizer("padding",s1("padding")),e.setNormalizer("padding-top",t=>({path:"padding.top",value:t})),e.setNormalizer("padding-right",t=>({path:"padding.right",value:t})),e.setNormalizer("padding-bottom",t=>({path:"padding.bottom",value:t})),e.setNormalizer("padding-left",t=>({path:"padding.left",value:t})),e.setReducer("padding",Ys("padding")),e.setStyleRelation("padding",["padding-top","padding-right","padding-bottom","padding-left"])}/** +*/function d1(e){e.setNormalizer("padding",a1("padding")),e.setNormalizer("padding-top",t=>({path:"padding.top",value:t})),e.setNormalizer("padding-right",t=>({path:"padding.right",value:t})),e.setNormalizer("padding-bottom",t=>({path:"padding.bottom",value:t})),e.setNormalizer("padding-left",t=>({path:"padding.left",value:t})),e.setReducer("padding",Ys("padding")),e.setStyleRelation("padding",["padding-top","padding-right","padding-bottom","padding-left"])}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -642,52 +642,52 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var J8=W(),y=class extends J8{editor;_disableStack=new Set;constructor(e){super(),this.editor=e,this.set("isEnabled",!0)}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",u1,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",u1),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}};function u1(e){e.return=!1,e.stop()}/** +*/var Q8=W(),w=class extends Q8{editor;_disableStack=new Set;constructor(e){super(),this.editor=e,this.set("isEnabled",!0)}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",h1,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",h1),this.isEnabled=!0)}destroy(){this.stopListening()}static get isContextPlugin(){return!1}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}};function h1(e){e.return=!1,e.stop()}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Z8=W(),M=class extends Z8{editor;_isEnabledBasedOnSelection;_affectsData;_disableStack;static get _throwErrorWhenUsedAsAPlugin(){return!0}constructor(e){super(),this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._affectsData=!0,this._isEnabledBasedOnSelection=!0,this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.listenTo(e,"change:isReadOnly",()=>{this.refresh()}),this.on("set:isEnabled",t=>{if(!this.affectsData)return;let i=e.model.document.selection,o=i.getFirstPosition().root.rootName!="$graveyard"&&e.model.canEditAt(i);(e.isReadOnly||this._isEnabledBasedOnSelection&&!o)&&(t.return=!1,t.stop())},{priority:"highest"}),this.on("execute",t=>{this.isEnabled||t.stop()},{priority:"high"})}get affectsData(){return this._affectsData}set affectsData(e){this._affectsData=e}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",d1,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",d1),this.refresh())}execute(...e){}destroy(){this.stopListening()}};function d1(e){e.return=!1,e.stop()}/** +*/var Y8=W(),M=class extends Y8{editor;_isEnabledBasedOnSelection;_affectsData;_disableStack;static get _throwErrorWhenUsedAsAPlugin(){return!0}constructor(e){super(),this.editor=e,this.set("value",void 0),this.set("isEnabled",!1),this._affectsData=!0,this._isEnabledBasedOnSelection=!0,this._disableStack=new Set,this.decorate("execute"),this.listenTo(this.editor.model.document,"change",()=>{this.refresh()}),this.listenTo(e,"change:isReadOnly",()=>{this.refresh()}),this.on("set:isEnabled",t=>{if(!this.affectsData)return;let i=e.model.document.selection,o=i.getFirstPosition().root.rootName!="$graveyard"&&e.model.canEditAt(i);(e.isReadOnly||this._isEnabledBasedOnSelection&&!o)&&(t.return=!1,t.stop())},{priority:"highest"}),this.on("execute",t=>{this.isEnabled||t.stop()},{priority:"high"})}get affectsData(){return this._affectsData}set affectsData(e){this._affectsData=e}refresh(){this.isEnabled=!0}forceDisabled(e){this._disableStack.add(e),this._disableStack.size==1&&(this.on("set:isEnabled",f1,{priority:"highest"}),this.isEnabled=!1)}clearForceDisabled(e){this._disableStack.delete(e),this._disableStack.size==0&&(this.off("set:isEnabled",f1),this.refresh())}execute(...e){}destroy(){this.stopListening()}};function f1(e){e.return=!1,e.stop()}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Q8=class{_commands;constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){let i=this.get(e);if(!i)throw new p("commandcollection-command-not-found",this,{commandName:e});return i.execute(...t)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(let e of this.commands())e.destroy()}};/** +*/var X8=class{_commands;constructor(){this._commands=new Map}add(e,t){this._commands.set(e,t)}get(e){return this._commands.get(e)}execute(e,...t){let i=this.get(e);if(!i)throw new p("commandcollection-command-not-found",this,{commandName:e});return i.execute(...t)}*names(){yield*this._commands.keys()}*commands(){yield*this._commands.values()}[Symbol.iterator](){return this._commands[Symbol.iterator]()}destroy(){for(let e of this.commands())e.destroy()}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Y8=q(),g1=class extends Y8{_context;_plugins=new Map;_availablePlugins;_contextPlugins;constructor(e,t=[],i=[]){super(),this._context=e,this._availablePlugins=new Map;for(let o of t)o.pluginName&&this._availablePlugins.set(o.pluginName,o);this._contextPlugins=new Map;for(let[o,n]of i)this._contextPlugins.set(o,n),this._contextPlugins.set(n,o),o.pluginName&&this._availablePlugins.set(o.pluginName,o)}*[Symbol.iterator](){for(let e of this._plugins)typeof e[0]=="function"&&(yield e)}get(e){let t=this._plugins.get(e);if(!t){let i=e;throw typeof e=="function"&&(i=e.pluginName||e.name),new p("plugincollection-plugin-not-loaded",this._context,{plugin:i})}return t}has(e){return this._plugins.has(e)}async init(e,t=[],i=[]){let o=this,n=this._context;d(e),f(e);let s=[...h(e.filter(w=>!c(w,t)))];C(s,i);let r=v(s);return await _(r,"init"),await _(r,"afterInit"),r;function a(w){return typeof w=="function"}function l(w){return a(w)&&!!w.isContextPlugin}function c(w,E){return E.some(x=>x===w||u(w)===x||u(x)===w)}function u(w){return a(w)?w.pluginName||w.name:w}function d(w,E=new Set){w.forEach(x=>{a(x)&&(E.has(x)||(E.add(x),x.pluginName&&!o._availablePlugins.has(x.pluginName)&&o._availablePlugins.set(x.pluginName,x),x.requires&&d(x.requires,E)))})}function h(w,E=new Set){return w.map(x=>a(x)?x:o._availablePlugins.get(x)).reduce((x,B)=>E.has(B)?x:(E.add(B),B.requires&&(f(B.requires,B),h(B.requires,E).forEach(de=>x.add(de))),x.add(B)),new Set)}function f(w,E=null){w.map(x=>a(x)?x:o._availablePlugins.get(x)||x).forEach(x=>{m(x),g(x,E),b(x,E),k(x,E)})}function m(w){if(typeof w=="function"&&w._throwErrorWhenUsedAsAPlugin)throw new p("plugincollection-plugin-invalid-constructor",n,{name:w.name})}function g(w,E){if(!a(w))throw E?new p("plugincollection-soft-required",n,{missingPlugin:w,requiredBy:u(E)}):new p("plugincollection-plugin-not-found",n,{plugin:w})}function b(w,E){if(l(E)&&!l(w))throw new p("plugincollection-context-required",n,{plugin:u(w),requiredBy:u(E)})}function k(w,E){if(E&&c(w,t))throw new p("plugincollection-required",n,{plugin:u(w),requiredBy:u(E)})}function v(w){return w.map(E=>{let x=o._contextPlugins.get(E);return x=x||new E(n),o._add(E,x),x})}function _(w,E){return w.reduce((x,B)=>!B[E]||o._contextPlugins.has(B)?x:x.then(B[E].bind(B)),Promise.resolve())}function C(w,E){for(let x of E){if(typeof x!="function")throw new p("plugincollection-replace-plugin-invalid-type",null,{pluginItem:x});let B=x.pluginName;if(!B)throw new p("plugincollection-replace-plugin-missing-name",null,{pluginItem:x});if(x.requires&&x.requires.length)throw new p("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:B});let de=o._availablePlugins.get(B);if(!de)throw new p("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:B});let Ve=w.indexOf(de);if(Ve===-1){if(o._contextPlugins.has(de))return;throw new p("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:B})}if(de.requires&&de.requires.length)throw new p("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:B});w.splice(Ve,1,x),o._availablePlugins.set(B,x)}}}destroy(){let e=[];for(let[,t]of this)typeof t.destroy=="function"&&!this._contextPlugins.has(t)&&e.push(t.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);let i=e.pluginName;if(i){if(this._plugins.has(i))throw new p("plugincollection-plugin-name-conflict",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:e});this._plugins.set(i,t)}}};/** +*/var ex=q(),b1=class extends ex{_context;_plugins=new Map;_availablePlugins;_contextPlugins;constructor(e,t=[],i=[]){super(),this._context=e,this._availablePlugins=new Map;for(let o of t)o.pluginName&&this._availablePlugins.set(o.pluginName,o);this._contextPlugins=new Map;for(let[o,n]of i)this._contextPlugins.set(o,n),this._contextPlugins.set(n,o),o.pluginName&&this._availablePlugins.set(o.pluginName,o)}*[Symbol.iterator](){for(let e of this._plugins)typeof e[0]=="function"&&(yield e)}get(e){let t=this._plugins.get(e);if(!t){let i=e;throw typeof e=="function"&&(i=e.pluginName||e.name),new p("plugincollection-plugin-not-loaded",this._context,{plugin:i})}return t}has(e){return this._plugins.has(e)}async init(e,t=[],i=[]){let o=this,n=this._context;d(e),f(e);let s=[...h(e.filter(y=>!c(y,t)))];C(s,i);let r=v(s);return await _(r,"init"),await _(r,"afterInit"),r;function a(y){return typeof y=="function"}function l(y){return a(y)&&!!y.isContextPlugin}function c(y,E){return E.some(x=>x===y||u(y)===x||u(x)===y)}function u(y){return a(y)?y.pluginName||y.name:y}function d(y,E=new Set){y.forEach(x=>{a(x)&&(E.has(x)||(E.add(x),x.pluginName&&!o._availablePlugins.has(x.pluginName)&&o._availablePlugins.set(x.pluginName,x),x.requires&&d(x.requires,E)))})}function h(y,E=new Set){return y.map(x=>a(x)?x:o._availablePlugins.get(x)).reduce((x,B)=>E.has(B)?x:(E.add(B),B.requires&&(f(B.requires,B),h(B.requires,E).forEach(de=>x.add(de))),x.add(B)),new Set)}function f(y,E=null){y.map(x=>a(x)?x:o._availablePlugins.get(x)||x).forEach(x=>{m(x),g(x,E),b(x,E),k(x,E)})}function m(y){if(typeof y=="function"&&y._throwErrorWhenUsedAsAPlugin)throw new p("plugincollection-plugin-invalid-constructor",n,{name:y.name})}function g(y,E){if(!a(y))throw E?new p("plugincollection-soft-required",n,{missingPlugin:y,requiredBy:u(E)}):new p("plugincollection-plugin-not-found",n,{plugin:y})}function b(y,E){if(l(E)&&!l(y))throw new p("plugincollection-context-required",n,{plugin:u(y),requiredBy:u(E)})}function k(y,E){if(E&&c(y,t))throw new p("plugincollection-required",n,{plugin:u(y),requiredBy:u(E)})}function v(y){return y.map(E=>{let x=o._contextPlugins.get(E);return x=x||new E(n),o._add(E,x),x})}function _(y,E){return y.reduce((x,B)=>!B[E]||o._contextPlugins.has(B)?x:x.then(B[E].bind(B)),Promise.resolve())}function C(y,E){for(let x of E){if(typeof x!="function")throw new p("plugincollection-replace-plugin-invalid-type",null,{pluginItem:x});let B=x.pluginName;if(!B)throw new p("plugincollection-replace-plugin-missing-name",null,{pluginItem:x});if(x.requires&&x.requires.length)throw new p("plugincollection-plugin-for-replacing-cannot-have-dependencies",null,{pluginName:B});let de=o._availablePlugins.get(B);if(!de)throw new p("plugincollection-plugin-for-replacing-not-exist",null,{pluginName:B});let Ve=y.indexOf(de);if(Ve===-1){if(o._contextPlugins.has(de))return;throw new p("plugincollection-plugin-for-replacing-not-loaded",null,{pluginName:B})}if(de.requires&&de.requires.length)throw new p("plugincollection-replaced-plugin-cannot-have-dependencies",null,{pluginName:B});y.splice(Ve,1,x),o._availablePlugins.set(B,x)}}}destroy(){let e=[];for(let[,t]of this)typeof t.destroy=="function"&&!this._contextPlugins.has(t)&&e.push(t.destroy());return Promise.all(e)}_add(e,t){this._plugins.set(e,t);let i=e.pluginName;if(i){if(this._plugins.has(i))throw new p("plugincollection-plugin-name-conflict",null,{pluginName:i,plugin1:this._plugins.get(i).constructor,plugin2:e});this._plugins.set(i,t)}}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Vd(e,t=new Set){let i=[e],o=new Set,n=0;for(;i.length>n;){let s=i[n++];if(!(o.has(s)||!X8(s)||t.has(s)))if(o.add(s),Symbol.iterator in s)try{for(let r of s)i.push(r)}catch{}else for(let r in s)r!=="defaultValue"&&i.push(s[r])}return o}function X8(e){let t=Object.prototype.toString.call(e),i=typeof e;return!(i==="number"||i==="boolean"||i==="string"||i==="symbol"||i==="function"||t==="[object Date]"||t==="[object RegExp]"||t==="[object Module]"||e===void 0||e===null||e._watchdogExcluded||e instanceof EventTarget||e instanceof Event)}/** +*/function Md(e,t=new Set){let i=[e],o=new Set,n=0;for(;i.length>n;){let s=i[n++];if(!(o.has(s)||!tx(s)||t.has(s)))if(o.add(s),Symbol.iterator in s)try{for(let r of s)i.push(r)}catch{}else for(let r in s)r!=="defaultValue"&&i.push(s[r])}return o}function tx(e){let t=Object.prototype.toString.call(e),i=typeof e;return!(i==="number"||i==="boolean"||i==="string"||i==="symbol"||i==="function"||t==="[object Date]"||t==="[object RegExp]"||t==="[object Module]"||e===void 0||e===null||e._watchdogExcluded||e instanceof EventTarget||e instanceof Event)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var dl=new Set;function ex(e){dl.add(new WeakRef(e))}function tx(e){for(let t of dl)if(t.deref()===e){dl.delete(t);return}}function*ix(){yield*w1(dl)}var hl=new Set;function ox(e){b1(e)||hl.add(new WeakRef(e))}function nx(e){for(let t of hl)if(t.deref()===e){hl.delete(t);return}}function*p1(){yield*w1(hl)}function b1(e){for(let t of p1())if(t===e)return!0;return!1}function*w1(e){for(let t of e){let i=t.deref();i?yield i:e.delete(t)}}/** +*/var hl=new Set;function ix(e){hl.add(new WeakRef(e))}function ox(e){for(let t of hl)if(t.deref()===e){hl.delete(t);return}}function*nx(){yield*_1(hl)}var fl=new Set;function sx(e){y1(e)||fl.add(new WeakRef(e))}function rx(e){for(let t of fl)if(t.deref()===e){fl.delete(t);return}}function*w1(){yield*_1(fl)}function y1(e){for(let t of w1())if(t===e)return!0;return!1}function*_1(e){for(let t of e){let i=t.deref();i?yield i:e.delete(t)}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Ld(e,t,i=new Set){if(e===t&&sx(e))return!0;let o=Vd(e,i),n=Vd(t,i);for(let s of o)if(n.has(s))return!0;return!1}function sx(e){return typeof e=="object"&&e!==null}/** +*/function Bd(e,t,i=new Set){if(e===t&&ax(e))return!0;let o=Md(e,i),n=Md(t,i);for(let s of o)if(n.has(s))return!0;return!1}function ax(e){return typeof e=="object"&&e!==null}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var rx=class extends X{editor;constructor(e){super(),this.editor=e}set(e,t,i={}){if(typeof t=="string"){let o=t;t=(n,s)=>{this.editor.execute(o),s()}}super.set(e,t,i)}};/** +*/var lx=class extends X{editor;constructor(e){super(),this.editor=e}set(e,t,i={}){if(typeof t=="string"){let o=t;t=(n,s)=>{this.editor.execute(o),s()}}super.set(e,t,i)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Sd="contentEditing",h1="common",ax=class{keystrokeInfos=new Map;_editor;constructor(e){this._editor=e;let t=e.config.get("menuBar.isVisible"),i=e.locale.t;this.addKeystrokeInfoCategory({id:Sd,label:i("Content editing keystrokes"),description:i("These keyboard shortcuts allow for quick access to content editing features.")});let o=[{label:i("Close contextual balloons, dropdowns, and dialogs"),keystroke:"Esc"},{label:i("Open the accessibility help dialog"),keystroke:"Alt+0"},{label:i("Move focus between form fields (inputs, buttons, etc.)"),keystroke:[["Tab"],["Shift+Tab"]]},{label:i("Move focus to the toolbar, navigate between toolbars"),keystroke:"Alt+F10",mayRequireFn:!0},{label:i("Navigate through the toolbar or menu bar"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]},{label:i("Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content."),keystroke:[["Enter"],["Space"]]}];t&&o.push({label:i("Move focus to the menu bar, navigate between menu bars"),keystroke:"Alt+F9",mayRequireFn:!0}),this.addKeystrokeInfoCategory({id:"navigation",label:i("User interface and content navigation keystrokes"),description:i("Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface."),groups:[{id:"common",keystrokes:o}]})}addKeystrokeInfoCategory({id:e,label:t,description:i,groups:o}){this.keystrokeInfos.set(e,{id:e,label:t,description:i,groups:new Map}),this.addKeystrokeInfoGroup({categoryId:e,id:h1}),o&&o.forEach(n=>{this.addKeystrokeInfoGroup({categoryId:e,...n})})}addKeystrokeInfoGroup({categoryId:e=Sd,id:t,label:i,keystrokes:o}){let n=this.keystrokeInfos.get(e);if(!n)throw new p("accessibility-unknown-keystroke-info-category",this._editor,{groupId:t,categoryId:e});n.groups.set(t,{id:t,label:i,keystrokes:o||[]})}addKeystrokeInfos({categoryId:e=Sd,groupId:t=h1,keystrokes:i}){if(!this.keystrokeInfos.has(e))throw new p("accessibility-unknown-keystroke-info-category",this._editor,{categoryId:e,keystrokes:i});let o=this.keystrokeInfos.get(e);if(!o.groups.has(t))throw new p("accessibility-unknown-keystroke-info-group",this._editor,{groupId:t,categoryId:e,keystrokes:i});o.groups.get(t).keystrokes.push(...i)}};/** +*/var Rd="contentEditing",m1="common",cx=class{keystrokeInfos=new Map;_editor;constructor(e){this._editor=e;let t=e.config.get("menuBar.isVisible"),i=e.locale.t;this.addKeystrokeInfoCategory({id:Rd,label:i("Content editing keystrokes"),description:i("These keyboard shortcuts allow for quick access to content editing features.")});let o=[{label:i("Close contextual balloons, dropdowns, and dialogs"),keystroke:"Esc"},{label:i("Open the accessibility help dialog"),keystroke:"Alt+0"},{label:i("Move focus between form fields (inputs, buttons, etc.)"),keystroke:[["Tab"],["Shift+Tab"]]},{label:i("Move focus to the toolbar, navigate between toolbars"),keystroke:"Alt+F10",mayRequireFn:!0},{label:i("Navigate through the toolbar or menu bar"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]},{label:i("Execute the currently focused button. Executing buttons that interact with the editor content moves the focus back to the content."),keystroke:[["Enter"],["Space"]]}];t&&o.push({label:i("Move focus to the menu bar, navigate between menu bars"),keystroke:"Alt+F9",mayRequireFn:!0}),this.addKeystrokeInfoCategory({id:"navigation",label:i("User interface and content navigation keystrokes"),description:i("Use the following keystrokes for more efficient navigation in the CKEditor 5 user interface."),groups:[{id:"common",keystrokes:o}]})}addKeystrokeInfoCategory({id:e,label:t,description:i,groups:o}){this.keystrokeInfos.set(e,{id:e,label:t,description:i,groups:new Map}),this.addKeystrokeInfoGroup({categoryId:e,id:m1}),o&&o.forEach(n=>{this.addKeystrokeInfoGroup({categoryId:e,...n})})}addKeystrokeInfoGroup({categoryId:e=Rd,id:t,label:i,keystrokes:o}){let n=this.keystrokeInfos.get(e);if(!n)throw new p("accessibility-unknown-keystroke-info-category",this._editor,{groupId:t,categoryId:e});n.groups.set(t,{id:t,label:i,keystrokes:o||[]})}addKeystrokeInfos({categoryId:e=Rd,groupId:t=m1,keystrokes:i}){if(!this.keystrokeInfos.has(e))throw new p("accessibility-unknown-keystroke-info-category",this._editor,{categoryId:e,keystrokes:i});let o=this.keystrokeInfos.get(e);if(!o.groups.has(t))throw new p("accessibility-unknown-keystroke-info-group",this._editor,{groupId:t,categoryId:e,keystrokes:i});o.groups.get(t).keystrokes.push(...i)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function lx(e){return{sessionId:fx(),pageSessionId:mx(),hostname:window.location.hostname,version:globalThis.CKEDITOR_VERSION,type:cx(e),plugins:ux(e.plugins),distribution:dx(),env:hx(),integration:Object.create(null),menuBar:{isVisible:!!e.config.get("menuBar.isVisible")},language:{ui:e.locale.uiLanguage,content:e.locale.contentLanguage},toolbar:{main:Pd(e.config.get("toolbar")),block:Pd(e.config.get("blockToolbar")),balloon:Pd(e.config.get("balloonToolbar"))}}}function cx(e){return Object.getPrototypeOf(e).constructor.editorName}function ux(e){return Array.from(e).filter(([t])=>!!t.pluginName).map(([t])=>{let{pluginName:i,isContextPlugin:o,isOfficialPlugin:n,isPremiumPlugin:s}=t;return{isContext:!!o,isOfficial:!!n,isPremium:!!s,name:i}})}function Pd(e){if(!e)return;let t=Array.isArray(e)?{items:e}:e,i=n(t.items||[]);return{isMultiline:i.includes("-"),shouldNotGroupWhenFull:!!t.shouldNotGroupWhenFull,items:o(i)};function o(s){return s.filter(r=>r!=="|"&&r!=="-")}function n(s){return s.flatMap(r=>typeof r=="string"?[r]:n(r.items))}}function dx(){return{channel:window[Symbol.for("cke distribution")]||"sh"}}function hx(){let e="unknown",t="unknown";return V.isMac?e="mac":V.isWindows?e="windows":V.isiOS?e="ios":V.isAndroid&&(e="android"),V.isGecko?t="gecko":V.isBlink?t="blink":V.isSafari&&(t="safari"),{os:e,browser:t}}function fx(){return localStorage.getItem("__ckeditor-session-id")||localStorage.setItem("__ckeditor-session-id",ne()),localStorage.getItem("__ckeditor-session-id")}function mx(){return S.window.CKEDITOR_PAGE_SESSION_ID=S.window.CKEDITOR_PAGE_SESSION_ID||ne(),S.window.CKEDITOR_PAGE_SESSION_ID}/** +*/function ux(e){return{sessionId:gx(),pageSessionId:px(),hostname:window.location.hostname,version:globalThis.CKEDITOR_VERSION,type:dx(e),plugins:hx(e.plugins),distribution:fx(),env:mx(),integration:Object.create(null),menuBar:{isVisible:!!e.config.get("menuBar.isVisible")},language:{ui:e.locale.uiLanguage,content:e.locale.contentLanguage},toolbar:{main:Vd(e.config.get("toolbar")),block:Vd(e.config.get("blockToolbar")),balloon:Vd(e.config.get("balloonToolbar"))}}}function dx(e){return Object.getPrototypeOf(e).constructor.editorName}function hx(e){return Array.from(e).filter(([t])=>!!t.pluginName).map(([t])=>{let{pluginName:i,isContextPlugin:o,isOfficialPlugin:n,isPremiumPlugin:s}=t;return{isContext:!!o,isOfficial:!!n,isPremium:!!s,name:i}})}function Vd(e){if(!e)return;let t=Array.isArray(e)?{items:e}:e,i=n(t.items||[]);return{isMultiline:i.includes("-"),shouldNotGroupWhenFull:!!t.shouldNotGroupWhenFull,items:o(i)};function o(s){return s.filter(r=>r!=="|"&&r!=="-")}function n(s){return s.flatMap(r=>typeof r=="string"?[r]:n(r.items))}}function fx(){return{channel:window[Symbol.for("cke distribution")]||"sh"}}function mx(){let e="unknown",t="unknown";return V.isMac?e="mac":V.isWindows?e="windows":V.isiOS?e="ios":V.isAndroid&&(e="android"),V.isGecko?t="gecko":V.isBlink?t="blink":V.isSafari&&(t="safari"),{os:e,browser:t}}function gx(){return localStorage.getItem("__ckeditor-session-id")||localStorage.setItem("__ckeditor-session-id",ne()),localStorage.getItem("__ckeditor-session-id")}function px(){return S.window.CKEDITOR_PAGE_SESSION_ID=S.window.CKEDITOR_PAGE_SESSION_ID||ne(),S.window.CKEDITOR_PAGE_SESSION_ID}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var gx=W(),fl=class extends gx{static get editorName(){return"Editor"}accessibility;commands;config;conversion;data;editing;locale;model;plugins;keystrokes;t;static defaultConfig;static builtinPlugins;_context;get _errorExclusions(){return this._context._errorExclusions}_readOnlyLocks;_registeredRootsAttributesKeys=new Set;static get _throwErrorWhenUsedAsAPlugin(){return!0}constructor(e={}){if(super(),typeof e!="object"||Array.isArray(e))throw new p("editor-config-invalid-type");if("sanitizeHtml"in e)throw new p("editor-config-sanitizehtml-not-supported");let t=this.constructor,{translations:i,...o}=t.defaultConfig||{},{translations:n=i,...s}=e,r=e.language||o.language;this._context=e.context||new Md({language:r,translations:n}),this._context._addEditor(this,!e.context);let a=Array.from(t.builtinPlugins||[]);this.config=new xu(s,o),this.config.define("plugins",a),this.config.define(this._context._getEditorConfig()),c(this.config),this.plugins=new g1(this,a,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new Q8,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.once("ready",()=>ex(this),{priority:"high"}),this.once("destroy",()=>tx(this),{priority:"high"}),this.model=new o1(this.config),this.on("change:isReadOnly",()=>{this.model.document.isReadOnly=this.isReadOnly});let l=new ap;this.data=new Up(this.model,l),this.editing=new Wp(this.model,l),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new qp([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 rx(this),this.keystrokes.listenTo(this.editing.view.document),this.accessibility=new ax(this),u(this);function c(d){let h=d.get("licenseKey");if(!h&&window.CKEDITOR_GLOBAL_LICENSE_KEY&&(h=window.CKEDITOR_GLOBAL_LICENSE_KEY,d.set("licenseKey",h)),!h)throw new p("license-key-missing")}function u(d){let h=d.config.get("licenseKey"),f=window[Symbol.for("cke distribution")]||"sh";function m(w,E){d.enableReadOnlyMode(Symbol("invalidLicense")),d._showLicenseError(w,E)}function g(w){return["exp","jti","vc"].every(E=>E in w)}function b(w){return Object.getOwnPropertyNames(w).sort().filter(E=>E!="vc"&&w[E]!=null).map(E=>w[E])}function k(w){let{hostname:E}=new URL(window.location.href);if(w.includes(E))return!0;let x=E.split(".");return w.filter(B=>B.includes("*")).map(B=>B.split(".")).filter(B=>B.length<=x.length).map(B=>Array(x.length-B.length).fill(B[0]==="*"?"*":"").concat(B)).some(B=>x.every((de,Ve)=>B[Ve]===de||B[Ve]==="*"))}function v(w){let E=w[0].toUpperCase()+w.slice(1),x=w==="evaluation"?"an":"a";console.info(`%cCKEditor 5 ${E} License`,"color: #ffffff; background: #743CCD; font-size: 14px; padding: 4px 8px; border-radius: 4px;"),console.warn(`\u26A0\uFE0F You are using ${x} ${w} license of CKEditor 5${w==="trial"?" which is for evaluation purposes only":""}. For production usage, please obtain a production license at https://portal.ckeditor.com/`)}if(h=="GPL"){f=="cloud"&&m("distributionChannel");return}let _=Fu(h);if(!_){m("invalid");return}if(!g(_)){m("invalid");return}if(_.distributionChannel&&!j(_.distributionChannel).includes(f)){m("distributionChannel");return}if(pg(b(_))!=_.vc.toLowerCase()){m("invalid");return}if(new Date(_.exp*1e3)0&&!k(C)){m("domainLimit");return}if(["evaluation","trial"].includes(_.licenseType)&&_.exp*1e3{m("evaluationLimit")},6e5);d.on("destroy",()=>{clearTimeout(w)})}_.usageEndpoint&&d.once("ready",()=>{let w={requestId:ne(),requestTime:Math.round(Date.now()/1e3),license:h,editor:px(d)};d._sendUsageRequest(_.usageEndpoint,w).then(E=>{let{status:x,message:B}=E;B&&console.warn(B),x!="ok"&&m("usageLimit")},()=>{H0("license-key-validation-endpoint-not-reachable",{url:_.usageEndpoint})})},{priority:"high"})}}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(e){throw new p("editor-isreadonly-has-no-setter")}enableReadOnlyMode(e){if(typeof e!="string"&&typeof e!="symbol")throw new p("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)||(this._readOnlyLocks.add(e),this._readOnlyLocks.size===1&&this.fire("change:isReadOnly","isReadOnly",!0,!1))}disableReadOnlyMode(e){if(typeof e!="string"&&typeof e!="symbol")throw new p("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)&&(this._readOnlyLocks.delete(e),this._readOnlyLocks.size===0&&this.fire("change:isReadOnly","isReadOnly",!1,!0))}setData(e){this.data.set(e)}getData(e){return this.data.get(e)}async initPlugins(){let e=this.config,t=e.get("plugins"),i=e.get("removePlugins")||[],o=e.get("extraPlugins")||[],n=e.get("substitutePlugins")||[],s=await this.plugins.init(t.concat(o),i,n);return r(this),s;function r(a){let l=a.config.get("licenseKey");if(l==="GPL")return;let c=Fu(l);if(!c)return;let u=[...a.plugins].map(([d])=>d).find(d=>!d.pluginName||!d.licenseFeatureCode?!1:bg(c,d.licenseFeatureCode));u&&(a.enableReadOnlyMode(Symbol("invalidLicense")),a._showLicenseError("pluginNotAllowed",u.pluginName))}}async destroy(){this.state=="initializing"&&await new Promise(e=>this.once("ready",e)),this.fire("destroy"),this.stopListening(),this.commands.destroy(),await this.plugins.destroy(),this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy(),await this._context._removeEditor(this)}execute(e,...t){try{return this.commands.execute(e,...t)}catch(i){/* v8 ignore next -- @preserve */p.rethrowUnexpectedError(i,this)}}focus(){this.editing.view.focus()}registerRootAttribute(e){this._registeredRootsAttributesKeys.has(e)||(this._registeredRootsAttributesKeys.add(e),this.editing.model.schema.extend("$root",{allowAttributes:e}))}getRootAttributes(e="main"){let t=this.model.document.getRoot(e);if(!t)throw new p("get-root-attributes-missing-root",this,{rootName:e});let i={};for(let o of this._registeredRootsAttributesKeys)i[o]=t.hasAttribute(o)?t.getAttribute(o):null;return i}static create(...e){throw new Error("This is an abstract method.")}static get Context(){return Md}static get onEditorError(){return y1}_showLicenseError(e,t){setTimeout(()=>{if(e=="invalid")throw new p("invalid-license-key");if(e=="expired")throw new p("license-key-expired");if(e=="domainLimit")throw new p("license-key-domain-limit");if(e=="pluginNotAllowed"){let i=t.replace(/(Editing|UI)$/,""),o=this.plugins.has(i);throw new p("license-key-plugin-not-allowed",null,{pluginName:o?i:t})}if(e=="featureNotAllowed")throw new p("license-key-feature-not-allowed",null,{featureName:t});if(e=="evaluationLimit")throw new p("license-key-evaluation-limit");if(e=="trialLimit")throw new p("license-key-trial-limit");if(e=="developmentLimit")throw new p("license-key-development-limit");if(e=="usageLimit")throw new p("license-key-usage-limit");/* v8 ignore else -- @preserve */if(e=="distributionChannel")throw new p("license-key-invalid-distribution-channel")},0),this._showLicenseError=()=>{}}async _sendUsageRequest(e,t){let i=new Headers({"Content-Type":"application/json"}),o=await fetch(new URL(e),{method:"POST",headers:i,body:JSON.stringify(t)});if(!o.ok)throw new Error(`HTTP Response: ${o.status}`);return o.json()}};function px(e){let t=lx(e);function i(o,n){if(Ge(t,o)!==void 0)throw new p("editor-usage-data-path-already-set",{path:o});Ts(t,o,n)}return e.fire("collectUsageData",{setUsageData:i}),t}/** +*/var bx=W(),ml=class extends bx{static get editorName(){return"Editor"}accessibility;commands;config;conversion;data;editing;locale;model;plugins;keystrokes;t;static defaultConfig;static builtinPlugins;_context;get _errorExclusions(){return this._context._errorExclusions}_readOnlyLocks;_registeredRootsAttributesKeys=new Set;static get _throwErrorWhenUsedAsAPlugin(){return!0}constructor(e={}){if(super(),typeof e!="object"||Array.isArray(e))throw new p("editor-config-invalid-type");if("sanitizeHtml"in e)throw new p("editor-config-sanitizehtml-not-supported");let t=this.constructor,{translations:i,...o}=t.defaultConfig||{},{translations:n=i,...s}=e,r=e.language||o.language;this._context=e.context||new Od({language:r,translations:n}),this._context._addEditor(this,!e.context);let a=Array.from(t.builtinPlugins||[]);this.config=new Eu(s,o),this.config.define("plugins",a),this.config.define(this._context._getEditorConfig()),c(this.config),this.plugins=new b1(this,a,this._context.plugins),this.locale=this._context.locale,this.t=this.locale.t,this._readOnlyLocks=new Set,this.commands=new X8,this.set("state","initializing"),this.once("ready",()=>this.state="ready",{priority:"high"}),this.once("destroy",()=>this.state="destroyed",{priority:"high"}),this.once("ready",()=>ix(this),{priority:"high"}),this.once("destroy",()=>ox(this),{priority:"high"}),this.model=new s1(this.config),this.on("change:isReadOnly",()=>{this.model.document.isReadOnly=this.isReadOnly});let l=new cp;this.data=new $p(this.model,l),this.editing=new qp(this.model,l),this.editing.view.document.bind("isReadOnly").to(this),this.conversion=new jp([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 lx(this),this.keystrokes.listenTo(this.editing.view.document),this.accessibility=new cx(this),u(this);function c(d){let h=d.get("licenseKey");if(!h&&window.CKEDITOR_GLOBAL_LICENSE_KEY&&(h=window.CKEDITOR_GLOBAL_LICENSE_KEY,d.set("licenseKey",h)),!h)throw new p("license-key-missing")}function u(d){let h=d.config.get("licenseKey"),f=window[Symbol.for("cke distribution")]||"sh";function m(y,E){d.enableReadOnlyMode(Symbol("invalidLicense")),d._showLicenseError(y,E)}function g(y){return["exp","jti","vc"].every(E=>E in y)}function b(y){return Object.getOwnPropertyNames(y).sort().filter(E=>E!="vc"&&y[E]!=null).map(E=>y[E])}function k(y){let{hostname:E}=new URL(window.location.href);if(y.includes(E))return!0;let x=E.split(".");return y.filter(B=>B.includes("*")).map(B=>B.split(".")).filter(B=>B.length<=x.length).map(B=>Array(x.length-B.length).fill(B[0]==="*"?"*":"").concat(B)).some(B=>x.every((de,Ve)=>B[Ve]===de||B[Ve]==="*"))}function v(y){let E=y[0].toUpperCase()+y.slice(1),x=y==="evaluation"?"an":"a";console.info(`%cCKEditor 5 ${E} License`,"color: #ffffff; background: #743CCD; font-size: 14px; padding: 4px 8px; border-radius: 4px;"),console.warn(`\u26A0\uFE0F You are using ${x} ${y} license of CKEditor 5${y==="trial"?" which is for evaluation purposes only":""}. For production usage, please obtain a production license at https://portal.ckeditor.com/`)}if(h=="GPL"){f=="cloud"&&m("distributionChannel");return}let _=zu(h);if(!_){m("invalid");return}if(!g(_)){m("invalid");return}if(_.distributionChannel&&!j(_.distributionChannel).includes(f)){m("distributionChannel");return}if(wg(b(_))!=_.vc.toLowerCase()){m("invalid");return}if(new Date(_.exp*1e3)0&&!k(C)){m("domainLimit");return}if(["evaluation","trial"].includes(_.licenseType)&&_.exp*1e3{m("evaluationLimit")},6e5);d.on("destroy",()=>{clearTimeout(y)})}_.usageEndpoint&&d.once("ready",()=>{let y={requestId:ne(),requestTime:Math.round(Date.now()/1e3),license:h,editor:wx(d)};d._sendUsageRequest(_.usageEndpoint,y).then(E=>{let{status:x,message:B}=E;B&&console.warn(B),x!="ok"&&m("usageLimit")},()=>{U0("license-key-validation-endpoint-not-reachable",{url:_.usageEndpoint})})},{priority:"high"})}}get isReadOnly(){return this._readOnlyLocks.size>0}set isReadOnly(e){throw new p("editor-isreadonly-has-no-setter")}enableReadOnlyMode(e){if(typeof e!="string"&&typeof e!="symbol")throw new p("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)||(this._readOnlyLocks.add(e),this._readOnlyLocks.size===1&&this.fire("change:isReadOnly","isReadOnly",!0,!1))}disableReadOnlyMode(e){if(typeof e!="string"&&typeof e!="symbol")throw new p("editor-read-only-lock-id-invalid",null,{lockId:e});this._readOnlyLocks.has(e)&&(this._readOnlyLocks.delete(e),this._readOnlyLocks.size===0&&this.fire("change:isReadOnly","isReadOnly",!1,!0))}setData(e){this.data.set(e)}getData(e){return this.data.get(e)}async initPlugins(){let e=this.config,t=e.get("plugins"),i=e.get("removePlugins")||[],o=e.get("extraPlugins")||[],n=e.get("substitutePlugins")||[],s=await this.plugins.init(t.concat(o),i,n);return r(this),s;function r(a){let l=a.config.get("licenseKey");if(l==="GPL")return;let c=zu(l);if(!c)return;let u=[...a.plugins].map(([d])=>d).find(d=>!d.pluginName||!d.licenseFeatureCode?!1:yg(c,d.licenseFeatureCode));u&&(a.enableReadOnlyMode(Symbol("invalidLicense")),a._showLicenseError("pluginNotAllowed",u.pluginName))}}async destroy(){this.state=="initializing"&&await new Promise(e=>this.once("ready",e)),this.fire("destroy"),this.stopListening(),this.commands.destroy(),await this.plugins.destroy(),this.model.destroy(),this.data.destroy(),this.editing.destroy(),this.keystrokes.destroy(),await this._context._removeEditor(this)}execute(e,...t){try{return this.commands.execute(e,...t)}catch(i){/* v8 ignore next -- @preserve */p.rethrowUnexpectedError(i,this)}}focus(){this.editing.view.focus()}registerRootAttribute(e){this._registeredRootsAttributesKeys.has(e)||(this._registeredRootsAttributesKeys.add(e),this.editing.model.schema.extend("$root",{allowAttributes:e}))}getRootAttributes(e="main"){let t=this.model.document.getRoot(e);if(!t)throw new p("get-root-attributes-missing-root",this,{rootName:e});let i={};for(let o of this._registeredRootsAttributesKeys)i[o]=t.hasAttribute(o)?t.getAttribute(o):null;return i}static create(...e){throw new Error("This is an abstract method.")}static get Context(){return Od}static get onEditorError(){return v1}_showLicenseError(e,t){setTimeout(()=>{if(e=="invalid")throw new p("invalid-license-key");if(e=="expired")throw new p("license-key-expired");if(e=="domainLimit")throw new p("license-key-domain-limit");if(e=="pluginNotAllowed"){let i=t.replace(/(Editing|UI)$/,""),o=this.plugins.has(i);throw new p("license-key-plugin-not-allowed",null,{pluginName:o?i:t})}if(e=="featureNotAllowed")throw new p("license-key-feature-not-allowed",null,{featureName:t});if(e=="evaluationLimit")throw new p("license-key-evaluation-limit");if(e=="trialLimit")throw new p("license-key-trial-limit");if(e=="developmentLimit")throw new p("license-key-development-limit");if(e=="usageLimit")throw new p("license-key-usage-limit");/* v8 ignore else -- @preserve */if(e=="distributionChannel")throw new p("license-key-invalid-distribution-channel")},0),this._showLicenseError=()=>{}}async _sendUsageRequest(e,t){let i=new Headers({"Content-Type":"application/json"}),o=await fetch(new URL(e),{method:"POST",headers:i,body:JSON.stringify(t)});if(!o.ok)throw new Error(`HTTP Response: ${o.status}`);return o.json()}};function wx(e){let t=ux(e);function i(o,n){if(Ge(t,o)!==void 0)throw new p("editor-usage-data-path-already-set",{path:o});Ts(t,o,n)}return e.fire("collectUsageData",{setUsageData:i}),t}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function bx(e){if(e instanceof fl)return[e];if(e instanceof Md&&b1(e))return[e];if(!e||typeof e!="object")return[];let t=Array.from(ix()).filter(i=>Ld(i,e,i._errorExclusions));return t.length?t:Array.from(p1()).filter(i=>Ld(i,e)&&!wx(i,e))}function wx(e,t){return Array.from(e.editors).some(i=>Ld(i,t,i._errorExclusions))}/** +*/function yx(e){if(e instanceof ml)return[e];if(e instanceof Od&&y1(e))return[e];if(!e||typeof e!="object")return[];let t=Array.from(nx()).filter(i=>Bd(i,e,i._errorExclusions));return t.length?t:Array.from(w1()).filter(i=>Bd(i,e)&&!_x(i,e))}function _x(e,t){return Array.from(e.editors).some(i=>Bd(i,t,i._errorExclusions))}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var yx=class{_registrations=new Set;_reported=new WeakSet;_onError=e=>{this._handle(e.error)};_onRejection=e=>{this._handle(e.reason)};_isAttached=!1;add(e){let t={callback:e};return this._registrations.add(t),this._attach(),()=>{this._registrations.delete(t)&&this._detach()}}_attach(){this._isAttached||this._registrations.size===0||(this._isAttached=!0,S.window.addEventListener("error",this._onError),S.window.addEventListener("unhandledrejection",this._onRejection))}_detach(){!this._isAttached||this._registrations.size>0||(this._isAttached=!1,S.window.removeEventListener("error",this._onError),S.window.removeEventListener("unhandledrejection",this._onRejection))}_handle(e){if(!_x(e)||this._reported.has(e))return;let t=bx(e.context).filter(i=>!(i instanceof fl)||i.state==="ready");if(t.length){this._reported.add(e);for(let i of t)for(let{callback:o}of Array.from(this._registrations))try{o({error:e,source:i})}catch(n){console.error("An error happened in an editor error callback.",n)}}}};function _x(e){if(!(e instanceof Error))return!1;let t=e;return typeof t.is=="function"&&t.is("CKEditorError")}var vx=new yx;function y1(e){return vx.add(e)}/** +*/var vx=class{_registrations=new Set;_reported=new WeakSet;_onError=e=>{this._handle(e.error)};_onRejection=e=>{this._handle(e.reason)};_isAttached=!1;add(e){let t={callback:e};return this._registrations.add(t),this._attach(),()=>{this._registrations.delete(t)&&this._detach()}}_attach(){this._isAttached||this._registrations.size===0||(this._isAttached=!0,S.window.addEventListener("error",this._onError),S.window.addEventListener("unhandledrejection",this._onRejection))}_detach(){!this._isAttached||this._registrations.size>0||(this._isAttached=!1,S.window.removeEventListener("error",this._onError),S.window.removeEventListener("unhandledrejection",this._onRejection))}_handle(e){if(!kx(e)||this._reported.has(e))return;let t=yx(e.context).filter(i=>!(i instanceof ml)||i.state==="ready");if(t.length){this._reported.add(e);for(let i of t)for(let{callback:o}of Array.from(this._registrations))try{o({error:e,source:i})}catch(n){console.error("An error happened in an editor error callback.",n)}}}};function kx(e){if(!(e instanceof Error))return!1;let t=e;return typeof t.is=="function"&&t.is("CKEditorError")}var Cx=new vx;function v1(e){return Cx.add(e)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Md=class{config;plugins;locale;t;editors;_errorExclusions;static defaultConfig;static builtinPlugins;_contextOwner=null;constructor(e){let{translations:t,...i}=e||{};this.config=new xu(i,this.constructor.defaultConfig);let o=this.constructor.builtinPlugins;this.config.define("plugins",o),this.plugins=new g1(this,o);let n=this.config.get("language")||{};this.locale=new gg({uiLanguage:typeof n=="string"?n:n.ui,contentLanguage:this.config.get("language.content"),translations:t}),this.t=this.locale.t,this.editors=new J}initPlugins(){let e=this.config.get("plugins")||[],t=this.config.get("substitutePlugins")||[];for(let i of e.concat(t)){if(typeof i!="function")throw new p("context-initplugins-constructor-only",null,{Plugin:i});if(i.isContextPlugin!==!0)throw new p("context-initplugins-invalid-plugin",null,{Plugin:i})}return this.plugins.init(e,[],t).then(i=>(this._errorExclusions=Vd(this,new Set(this.editors)),ox(this),i))}destroy(){return nx(this),Promise.all(Array.from(this.editors,e=>e.destroy())).then(()=>this.plugins.destroy())}_addEditor(e,t){if(this._contextOwner)throw new p("context-addeditor-private-context");this.editors.add(e),t&&(this._contextOwner=e)}_removeEditor(e){return this.editors.has(e)&&this.editors.remove(e),this._contextOwner===e?this.destroy():Promise.resolve()}_getEditorConfig(){let e={};for(let t of this.config.names())["plugins","removePlugins","extraPlugins"].includes(t)||(e[t]=this.config.get(t));return e}static create(e){return new Promise(t=>{let i=new this(e);t(i.initPlugins().then(()=>i))})}static get onEditorError(){return y1}static get _throwErrorWhenUsedAsAPlugin(){return!0}};/** +*/var Od=class{config;plugins;locale;t;editors;_errorExclusions;static defaultConfig;static builtinPlugins;_contextOwner=null;constructor(e){let{translations:t,...i}=e||{};this.config=new Eu(i,this.constructor.defaultConfig);let o=this.constructor.builtinPlugins;this.config.define("plugins",o),this.plugins=new b1(this,o);let n=this.config.get("language")||{};this.locale=new bg({uiLanguage:typeof n=="string"?n:n.ui,contentLanguage:this.config.get("language.content"),translations:t}),this.t=this.locale.t,this.editors=new G}initPlugins(){let e=this.config.get("plugins")||[],t=this.config.get("substitutePlugins")||[];for(let i of e.concat(t)){if(typeof i!="function")throw new p("context-initplugins-constructor-only",null,{Plugin:i});if(i.isContextPlugin!==!0)throw new p("context-initplugins-invalid-plugin",null,{Plugin:i})}return this.plugins.init(e,[],t).then(i=>(this._errorExclusions=Md(this,new Set(this.editors)),sx(this),i))}destroy(){return rx(this),Promise.all(Array.from(this.editors,e=>e.destroy())).then(()=>this.plugins.destroy())}_addEditor(e,t){if(this._contextOwner)throw new p("context-addeditor-private-context");this.editors.add(e),t&&(this._contextOwner=e)}_removeEditor(e){return this.editors.has(e)&&this.editors.remove(e),this._contextOwner===e?this.destroy():Promise.resolve()}_getEditorConfig(){let e={};for(let t of this.config.names())["plugins","removePlugins","extraPlugins"].includes(t)||(e[t]=this.config.get(t));return e}static create(e){return new Promise(t=>{let i=new this(e);t(i.initPlugins().then(()=>i))})}static get onEditorError(){return v1}static get _throwErrorWhenUsedAsAPlugin(){return!0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var kx=W(),Bd=class extends kx{context;constructor(e){super(),this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}};/** +*/var xx=W(),Dd=class extends xx{context;constructor(e){super(),this.context=e}destroy(){this.stopListening()}static get isContextPlugin(){return!0}static get isOfficialPlugin(){return!1}static get isPremiumPlugin(){return!1}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//* v8 ignore stop -- @preserve *//** @@ -696,123 +696,123 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function _1(e){class t extends e{sourceElement;updateSourceElement(o){if(!this.sourceElement)throw new p("editor-missing-sourceelement",this);let n=this.config.get("updateSourceElementOnDestroy"),s=this.sourceElement instanceof HTMLTextAreaElement;if(!n&&!s){Pu(this.sourceElement,"");return}let r=typeof o=="string"?o:this.data.get();Pu(this.sourceElement,r)}}return t}/** +*/function k1(e){class t extends e{sourceElement;updateSourceElement(o){if(!this.sourceElement)throw new p("editor-missing-sourceelement",this);let n=this.config.get("updateSourceElementOnDestroy"),s=this.sourceElement instanceof HTMLTextAreaElement;if(!n&&!s){Vu(this.sourceElement,"");return}let r=typeof o=="string"?o:this.data.get();Vu(this.sourceElement,r)}}return t}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function v1(e,t){if(t.ckeditorInstance)throw new p("editor-source-element-already-used",e);t.ckeditorInstance=e,e.once("destroy",()=>{delete t.ckeditorInstance})}/** +*/function C1(e,t){if(t.ckeditorInstance)throw new p("editor-source-element-already-used",e);t.ckeditorInstance=e,e.once("destroy",()=>{delete t.ckeditorInstance})}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Cx=[["description","$description"],["title","$title"]];function k1(e){let t=e.config.get("roots");for(let[n,s]of Object.entries(t)){let r=null;for(let[a,l]of Cx)s[a]==null||s.modelAttributes&&l in s.modelAttributes||(r=r||{...s.modelAttributes},r[l]=s[a]);r&&e.config.set(`roots.${n}.modelAttributes`,r)}let i=e.config.get("roots"),o=!1;for(let n of Object.values(i))for(let s of Object.keys(n.modelAttributes||{}))e.registerRootAttribute(s),o=!0;o&&e.data.once("init",()=>{e.model.enqueueChange({isUndoable:!1},n=>{for(let[s,r]of Object.entries(i)){let a=e.model.document.getRoot(s);if(a)for(let[l,c]of Object.entries(r.modelAttributes||{}))c!==null&&n.setAttribute(l,c,a)}})})}/** +*/var Tx=[["description","$description"],["title","$title"]];function x1(e){let t=e.config.get("roots");for(let[n,s]of Object.entries(t)){let r=null;for(let[a,l]of Tx)s[a]==null||s.modelAttributes&&l in s.modelAttributes||(r=r||{...s.modelAttributes},r[l]=s[a]);r&&e.config.set(`roots.${n}.modelAttributes`,r)}let i=e.config.get("roots"),o=!1;for(let n of Object.values(i))for(let s of Object.keys(n.modelAttributes||{}))e.registerRootAttribute(s),o=!0;o&&e.data.once("init",()=>{e.model.enqueueChange({isUndoable:!1},n=>{for(let[s,r]of Object.entries(i)){let a=e.model.document.getRoot(s);if(a)for(let[l,c]of Object.entries(r.modelAttributes||{}))c!==null&&n.setAttribute(l,c,a)}})})}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function C1(e,t,i="main",o=!1){let n=t.get("root"),s=t.get("roots")||Object.create(null);if(!Ee(s))throw new p("editor-create-roots-not-plain-object",null);if(n)if(i){if(i in s)throw new p("editor-create-roots-with-main",null)}else throw new p("editor-create-multi-root-with-main",null);i&&!s[i]&&(s[i]=n||Object.create(null));let r=xx(e),a=Ex(t,r,i),l=Array.from(new Set([...r?Object.keys(e):[],...Object.keys(s),...Object.keys(a)]));for(let c of l){let u=s[c]||Object.create(null),d=r?e[c]:e;if(!o&&Zt(d)){if(u.element)throw new p("editor-create-root-element-overspecified",null);u.element=d}if(o&&Zt(u.element)&&(D("editor-create-root-element-not-supported"),u.element=void 0),u.initialData===void 0)if(a[c]===void 0){let h=Zt(u.element)?u.element:void 0;u.initialData=Tx(d||h||o&&t.get("attachTo")||"")}else{if(d&&!Zt(d))throw new p("editor-create-initial-data-overspecified",null);u.initialData=a[c]}else{if(d&&!Zt(d))throw new p("editor-create-root-initial-data-overspecified",null);if(a[c]!==void 0)throw new p("editor-create-legacy-initial-data-overspecified",null)}u.placeholder??=f1(t,"placeholder",c),u.label??=f1(t,"label",c),u.modelElement||="$root",u.element=Ax(u.element),s[c]=u}if(o&&Zt(e)){if(t.get("attachTo"))throw new p("editor-create-attachto-overspecified",null);t.set("attachTo",e)}if(!o&&t.get("attachTo"))throw new p("editor-create-attachto-ignored",null);t.set("roots",s)}function x1(e,t){return typeof e=="string"||Zt(e)||t&&Object.keys(t).length?{sourceElementOrData:e,editorConfig:t}:{sourceElementOrData:"",editorConfig:e}}function xx(e){return!!e&&typeof e=="object"&&!Array.isArray(e)&&!Zt(e)}function Tx(e){return Zt(e)?Y0(e):e}function Ex(e,t,i){return t||!i?e.get("initialData")||Object.create(null):{[i]:e.get("initialData")}}function f1(e,t,i){let o=e.get(t);if(o)return typeof o=="string"?o:o[i]}function Ax(e){if(e==null)return;if(Zt(e))return Rd(e.tagName),e;if(typeof e=="string")return Rd(e),{name:e};let{name:t,classes:i,styles:o,attributes:n}=e;t!==void 0&&Rd(t);let{class:s,style:r,...a}=n||{},l=!!n&&"class"in n,c=!!o&&Object.keys(o).length>0,u=c&&!!r;u&&D("editor-root-element-styles-overspecified");let d=[...m1(i),...m1(s)],h={...a};return l&&(h.class=""),u?h.style="":r&&(h.style=r),{...t!==void 0&&{name:t},...d.length&&{classes:d},...c&&{styles:o},...Object.keys(h).length&&{attributes:h}}}function m1(e){return e?j(e).flatMap(t=>t.split(/\s+/)).filter(Boolean):[]}function Rd(e){if(typeof e!="string"||!/^[A-Za-z][A-Za-z0-9_-]*$/.test(e))throw new p("editor-wrong-element-name",null,{name:e});if(["textarea","input"].includes(e.toLowerCase()))throw new p("editor-wrong-element",null)}function Zt(e){return et(e)}/** +*/function T1(e,t,i="main",o=!1){let n=t.get("root"),s=t.get("roots")||Object.create(null);if(!Ie(s))throw new p("editor-create-roots-not-plain-object",null);if(n)if(i){if(i in s)throw new p("editor-create-roots-with-main",null)}else throw new p("editor-create-multi-root-with-main",null);i&&!s[i]&&(s[i]=n||Object.create(null));let r=Ex(e),a=Ix(t,r,i),l=Array.from(new Set([...r?Object.keys(e):[],...Object.keys(s),...Object.keys(a)]));for(let c of l){let u=s[c]||Object.create(null),d=r?e[c]:e;if(!o&&Yt(d)){if(u.element)throw new p("editor-create-root-element-overspecified",null);u.element=d}if(o&&Yt(u.element)&&(D("editor-create-root-element-not-supported"),u.element=void 0),u.initialData===void 0)if(a[c]===void 0){let h=Yt(u.element)?u.element:void 0;u.initialData=Ax(d||h||o&&t.get("attachTo")||"")}else{if(d&&!Yt(d))throw new p("editor-create-initial-data-overspecified",null);u.initialData=a[c]}else{if(d&&!Yt(d))throw new p("editor-create-root-initial-data-overspecified",null);if(a[c]!==void 0)throw new p("editor-create-legacy-initial-data-overspecified",null)}u.placeholder??=g1(t,"placeholder",c),u.label??=g1(t,"label",c),u.modelElement||="$root",u.element=Sx(u.element),s[c]=u}if(o&&Yt(e)){if(t.get("attachTo"))throw new p("editor-create-attachto-overspecified",null);t.set("attachTo",e)}if(!o&&t.get("attachTo"))throw new p("editor-create-attachto-ignored",null);t.set("roots",s)}function E1(e,t){return typeof e=="string"||Yt(e)||t&&Object.keys(t).length?{sourceElementOrData:e,editorConfig:t}:{sourceElementOrData:"",editorConfig:e}}function Ex(e){return!!e&&typeof e=="object"&&!Array.isArray(e)&&!Yt(e)}function Ax(e){return Yt(e)?eg(e):e}function Ix(e,t,i){return t||!i?e.get("initialData")||Object.create(null):{[i]:e.get("initialData")}}function g1(e,t,i){let o=e.get(t);if(o)return typeof o=="string"?o:o[i]}function Sx(e){if(e==null)return;if(Yt(e))return Ld(e.tagName),e;if(typeof e=="string")return Ld(e),{name:e};let{name:t,classes:i,styles:o,attributes:n}=e;t!==void 0&&Ld(t);let{class:s,style:r,...a}=n||{},l=!!n&&"class"in n,c=!!o&&Object.keys(o).length>0,u=c&&!!r;u&&D("editor-root-element-styles-overspecified");let d=[...p1(i),...p1(s)],h={...a};return l&&(h.class=""),u?h.style="":r&&(h.style=r),{...t!==void 0&&{name:t},...d.length&&{classes:d},...c&&{styles:o},...Object.keys(h).length&&{attributes:h}}}function p1(e){return e?j(e).flatMap(t=>t.split(/\s+/)).filter(Boolean):[]}function Ld(e){if(typeof e!="string"||!/^[A-Za-z][A-Za-z0-9_-]*$/.test(e))throw new p("editor-wrong-element-name",null,{name:e});if(["textarea","input"].includes(e.toLowerCase()))throw new p("editor-wrong-element",null)}function Yt(e){return et(e)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function T1(e){let t=e.model.schema,i=e.model.document;for(let o of i.roots)if(!(o===i.graveyard||!o.isAttached())&&!t.isLimit(o))throw new p("editor-root-element-is-not-limit",null,{rootName:o.rootName,elementName:o.name})}/** +*/function A1(e){let t=e.model.schema,i=e.model.document;for(let o of i.roots)if(!(o===i.graveyard||!o.isAttached())&&!t.isLimit(o))throw new p("editor-root-element-is-not-limit",null,{rootName:o.rootName,elementName:o.name})}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function E1(e,t){let i=e.model.document.getRoot(t);return e.model.schema.checkChild(i,"$block")}/** +*/function I1(e,t){let i=e.model.document.getRoot(t);return e.model.schema.checkChild(i,"$block")}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Bn=class extends Bd{_actions;static get pluginName(){return"PendingActions"}static get isOfficialPlugin(){return!0}init(){this.set("hasAny",!1),this._actions=new J({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if(typeof e!="string")throw new p("pendingactions-add-invalid-message",this);let t=new(W());return t.set("message",e),this._actions.add(t),this.hasAny=!0,t}remove(e){this._actions.remove(e),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}};/** +*/var Bn=class extends Dd{_actions;static get pluginName(){return"PendingActions"}static get isOfficialPlugin(){return!0}init(){this.set("hasAny",!1),this._actions=new G({idProperty:"_id"}),this._actions.delegate("add","remove").to(this)}add(e){if(typeof e!="string")throw new p("pendingactions-add-invalid-message",this);let t=new(W());return t.set("message",e),this._actions.add(t),this.hasAny=!0,t}remove(e){this._actions.remove(e),this.hasAny=!!this._actions.length}get first(){return this._actions.get(0)}[Symbol.iterator](){return this._actions[Symbol.iterator]()}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options - */var A1='';var I1='',S1='',P1='',ml='',R1='',V1='',L1='';var gl='';var M1='',Od='',Dd='';var Fd='';var B1='';var O1='',D1='';var F1='',N1='';var cr='';var z1='';var H1='';var W1='',U1='';var q1='';var $1='';var j1='';var pl='';var K1='',On='',G1='',ur='',Dn='',Nd='',dr='',hr='',J1='',Z1='',Q1='',Y1='',X1='';var eb='';var zd='',tb='';var ib='';var ob='';var yt='';var nb=` -`,sb='',Hd='';var rb='';var ab='';var Wd=` -`;var lb='';var cb='',ub='',db='';var hb='',fb='',Ud='';var mb='',gb='';var bl='';var pb='';var qd='',bb='';/** + */var S1='';var P1='',R1='',V1='',gl='',L1='',M1='',B1='';var pl='';var O1='',Fd='',Nd='';var zd='';var D1='';var F1='',N1='';var z1='',H1='';var cr='';var W1='';var U1='';var q1='',$1='';var j1='';var K1='';var G1='';var bl='';var J1='',On='',Z1='',ur='',Dn='',Hd='',dr='',hr='',Q1='',Y1='',X1='',eb='',tb='';var ib='';var Wd='',ob='';var nb='';var sb='';var _t='';var rb=` +`,ab='',Ud='';var lb='';var cb='';var qd=` +`;var ub='';var db='',hb='',fb='';var mb='',gb='',$d='';var pb='',bb='';var wl='';var wb='';var jd='',yb='';/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var $d={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let e in $d)Object.freeze($d[e]);var jd=Object.freeze($d);var Kd=Ix,wb={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function Ix(e){var t,i=[],o=1,n;if(typeof e=="number")return{space:"rgb",values:[e>>>16,(e&65280)>>>8,e&255],alpha:1};if(typeof e=="number")return{space:"rgb",values:[e>>>16,(e&65280)>>>8,e&255],alpha:1};if(e=String(e).toLowerCase(),jd[e])i=jd[e].slice(),n="rgb";else if(e==="transparent")o=0,n="rgb",i=[0,0,0];else if(e[0]==="#"){var s=e.slice(1),r=s.length,a=r<=4;o=1,a?(i=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],r===4&&(o=parseInt(s[3]+s[3],16)/255)):(i=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],r===8&&(o=parseInt(s[6]+s[7],16)/255)),i[0]||(i[0]=0),i[1]||(i[1]=0),i[2]||(i[2]=0),n="rgb"}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(e)){var l=t[1];n=l.replace(/a$/,"");var c=n==="cmyk"?4:n==="gray"?1:3;i=t[2].trim().split(/\s*[,\/]\s*|\s+/),n==="color"&&(n=i.shift()),i=i.map(function(u,d){if(u[u.length-1]==="%")return u=parseFloat(u)/100,d===3?u:n==="rgb"?u*255:n[0]==="h"||n[0]==="l"&&!d?u*100:n==="lab"?u*125:n==="lch"?d<2?u*150:u*360:n[0]==="o"&&!d?u:n==="oklab"?u*.4:n==="oklch"?d<2?u*.4:u*360:u;if(n[d]==="h"||d===2&&n[n.length-1]==="h"){if(wb[u]!==void 0)return wb[u];if(u.endsWith("deg"))return parseFloat(u);if(u.endsWith("turn"))return parseFloat(u)*360;if(u.endsWith("grad"))return parseFloat(u)*360/400;if(u.endsWith("rad"))return parseFloat(u)*180/Math.PI}return u==="none"?0:parseFloat(u)}),o=i.length>c?i.pop():1}else/[0-9](?:\s|\/|,)/.test(e)&&(i=e.match(/([0-9]+)/g).map(function(u){return parseFloat(u)}),n=e.match(/([a-z])/ig)?.join("")?.toLowerCase()||"rgb");return{space:n,values:i,alpha:o}}var Gd={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let e in Gd)Object.freeze(Gd[e]);var Fn=Object.freeze(Gd);var yb={};for(let e of Object.keys(Fn))yb[Fn[e]]=e;var L={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},wi=L,bi=(6/29)**3;function Nn(e){let t=e>.0031308?1.055*e**.4166666666666667-.055:e*12.92;return Math.min(Math.max(0,t),1)}function zn(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}for(let e of Object.keys(L)){if(!("channels"in L[e]))throw new Error("missing channels property: "+e);if(!("labels"in L[e]))throw new Error("missing channel labels property: "+e);if(L[e].labels.length!==L[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:i}=L[e];delete L[e].channels,delete L[e].labels,Object.defineProperty(L[e],"channels",{value:t}),Object.defineProperty(L[e],"labels",{value:i})}L.rgb.hsl=function(e){let t=e[0]/255,i=e[1]/255,o=e[2]/255,n=Math.min(t,i,o),s=Math.max(t,i,o),r=s-n,a,l;switch(s){case n:{a=0;break}case t:{a=(i-o)/r;break}case i:{a=2+(o-t)/r;break}case o:{a=4+(t-i)/r;break}}a=Math.min(a*60,360),a<0&&(a+=360);let c=(n+s)/2;return s===n?l=0:c<=.5?l=r/(s+n):l=r/(2-s-n),[a,l*100,c*100]};L.rgb.hsv=function(e){let t,i,o,n,s,r=e[0]/255,a=e[1]/255,l=e[2]/255,c=Math.max(r,a,l),u=c-Math.min(r,a,l),d=function(h){return(c-h)/6/u+1/2};if(u===0)n=0,s=0;else{switch(s=u/c,t=d(r),i=d(a),o=d(l),c){case r:{n=o-i;break}case a:{n=1/3+t-o;break}case l:{n=2/3+i-t;break}}n<0?n+=1:n>1&&(n-=1)}return[n*360,s*100,c*100]};L.rgb.hwb=function(e){let t=e[0],i=e[1],o=e[2],n=L.rgb.hsl(e)[0],s=1/255*Math.min(t,Math.min(i,o));return o=1-1/255*Math.max(t,Math.max(i,o)),[n,s*100,o*100]};L.rgb.oklab=function(e){let t=zn(e[0]/255),i=zn(e[1]/255),o=zn(e[2]/255),n=Math.cbrt(.4122214708*t+.5363325363*i+.0514459929*o),s=Math.cbrt(.2119034982*t+.6806995451*i+.1073969566*o),r=Math.cbrt(.0883024619*t+.2817188376*i+.6299787005*o),a=.2104542553*n+.793617785*s-.0040720468*r,l=1.9779984951*n-2.428592205*s+.4505937099*r,c=.0259040371*n+.7827717662*s-.808675766*r;return[a*100,l*100,c*100]};L.rgb.cmyk=function(e){let t=e[0]/255,i=e[1]/255,o=e[2]/255,n=Math.min(1-t,1-i,1-o),s=(1-t-n)/(1-n)||0,r=(1-i-n)/(1-n)||0,a=(1-o-n)/(1-n)||0;return[s*100,r*100,a*100,n*100]};function Sx(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}L.rgb.keyword=function(e){let t=yb[e];if(t)return t;let i=Number.POSITIVE_INFINITY,o;for(let n of Object.keys(Fn)){let s=Fn[n],r=Sx(e,s);rbi?i**(1/3):7.787*i+16/116,o=o>bi?o**(1/3):7.787*o+16/116,n=n>bi?n**(1/3):7.787*n+16/116;let s=116*o-16,r=500*(i-o),a=200*(o-n);return[s,r,a]};L.hsl.rgb=function(e){let t=e[0]/360,i=e[1]/100,o=e[2]/100,n,s;if(i===0)return s=o*255,[s,s,s];let r=o<.5?o*(1+i):o+i-o*i,a=2*o-r,l=[0,0,0];for(let c=0;c<3;c++)n=t+1/3*-(c-1),n<0&&n++,n>1&&n--,6*n<1?s=a+(r-a)*6*n:2*n<1?s=r:3*n<2?s=a+(r-a)*(2/3-n)*6:s=a,l[c]=s*255;return l};L.hsl.hsv=function(e){let t=e[0],i=e[1]/100,o=e[2]/100,n=i,s=Math.max(o,.01);o*=2,i*=o<=1?o:2-o,n*=s<=1?s:2-s;let r=(o+i)/2,a=o===0?2*n/(s+n):2*i/(o+i);return[t,a*100,r*100]};L.hsv.rgb=function(e){let t=e[0]/60,i=e[1]/100,o=e[2]/100,n=Math.floor(t)%6,s=t-Math.floor(t),r=255*o*(1-i),a=255*o*(1-i*s),l=255*o*(1-i*(1-s));switch(o*=255,n){case 0:return[o,l,r];case 1:return[a,o,r];case 2:return[r,o,l];case 3:return[r,a,o];case 4:return[l,r,o];case 5:return[o,r,a]}};L.hsv.hsl=function(e){let t=e[0],i=e[1]/100,o=e[2]/100,n=Math.max(o,.01),s,r;r=(2-i)*o;let a=(2-i)*n;return s=i*n,s/=a<=1?a:2-a,s=s||0,r/=2,[t,s*100,r*100]};L.hwb.rgb=function(e){let t=e[0]/360,i=e[1]/100,o=e[2]/100,n=i+o,s;n>1&&(i/=n,o/=n);let r=Math.floor(6*t),a=1-o;s=6*t-r,(r&1)!==0&&(s=1-s);let l=i+s*(a-i),c,u,d;switch(r){default:case 6:case 0:{c=a,u=l,d=i;break}case 1:{c=l,u=a,d=i;break}case 2:{c=i,u=a,d=l;break}case 3:{c=i,u=l,d=a;break}case 4:{c=l,u=i,d=a;break}case 5:{c=a,u=i,d=l;break}}return[c*255,u*255,d*255]};L.cmyk.rgb=function(e){let t=e[0]/100,i=e[1]/100,o=e[2]/100,n=e[3]/100,s=1-Math.min(1,t*(1-n)+n),r=1-Math.min(1,i*(1-n)+n),a=1-Math.min(1,o*(1-n)+n);return[s*255,r*255,a*255]};L.xyz.rgb=function(e){let t=e[0]/100,i=e[1]/100,o=e[2]/100,n,s,r;return n=t*3.2404542+i*-1.5371385+o*-.4985314,s=t*-.969266+i*1.8760108+o*.041556,r=t*.0556434+i*-.2040259+o*1.0572252,n=Nn(n),s=Nn(s),r=Nn(r),[n*255,s*255,r*255]};L.xyz.lab=function(e){let t=e[0],i=e[1],o=e[2];t/=95.047,i/=100,o/=108.883,t=t>bi?t**(1/3):7.787*t+16/116,i=i>bi?i**(1/3):7.787*i+16/116,o=o>bi?o**(1/3):7.787*o+16/116;let n=116*i-16,s=500*(t-i),r=200*(i-o);return[n,s,r]};L.xyz.oklab=function(e){let t=e[0]/100,i=e[1]/100,o=e[2]/100,n=Math.cbrt(.8189330101*t+.3618667424*i-.1288597137*o),s=Math.cbrt(.0329845436*t+.9293118715*i+.0361456387*o),r=Math.cbrt(.0482003018*t+.2643662691*i+.633851707*o),a=.2104542553*n+.793617785*s-.0040720468*r,l=1.9779984951*n-2.428592205*s+.4505937099*r,c=.0259040371*n+.7827717662*s-.808675766*r;return[a*100,l*100,c*100]};L.oklab.oklch=function(e){return L.lab.lch(e)};L.oklab.xyz=function(e){let t=e[0]/100,i=e[1]/100,o=e[2]/100,n=(.999999998*t+.396337792*i+.215803758*o)**3,s=(1.000000008*t-.105561342*i-.063854175*o)**3,r=(1.000000055*t-.089484182*i-1.291485538*o)**3,a=1.227013851*n-.55779998*s+.281256149*r,l=-.040580178*n+1.11225687*s-.071676679*r,c=-.076381285*n-.421481978*s+1.58616322*r;return[a*100,l*100,c*100]};L.oklab.rgb=function(e){let t=e[0]/100,i=e[1]/100,o=e[2]/100,n=(t+.3963377774*i+.2158037573*o)**3,s=(t-.1055613458*i-.0638541728*o)**3,r=(t-.0894841775*i-1.291485548*o)**3,a=Nn(4.0767416621*n-3.3077115913*s+.2309699292*r),l=Nn(-1.2684380046*n+2.6097574011*s-.3413193965*r),c=Nn(-.0041960863*n-.7034186147*s+1.707614701*r);return[a*255,l*255,c*255]};L.oklch.oklab=function(e){return L.lch.lab(e)};L.lab.xyz=function(e){let t=e[0],i=e[1],o=e[2],n,s,r;s=(t+16)/116,n=i/500+s,r=s-o/200;let a=s**3,l=n**3,c=r**3;return s=a>bi?a:(s-16/116)/7.787,n=l>bi?l:(n-16/116)/7.787,r=c>bi?c:(r-16/116)/7.787,n*=95.047,s*=100,r*=108.883,[n,s,r]};L.lab.lch=function(e){let t=e[0],i=e[1],o=e[2],n;n=Math.atan2(o,i)*360/2/Math.PI,n<0&&(n+=360);let r=Math.sqrt(i*i+o*o);return[t,r,n]};L.lch.lab=function(e){let t=e[0],i=e[1],n=e[2]/360*2*Math.PI,s=i*Math.cos(n),r=i*Math.sin(n);return[t,s,r]};L.rgb.ansi16=function(e,t=null){let[i,o,n]=e,s=t===null?L.rgb.hsv(e)[2]:t;if(s=Math.round(s/50),s===0)return 30;let r=30+(Math.round(n/255)<<2|Math.round(o/255)<<1|Math.round(i/255));return s===2&&(r+=60),r};L.hsv.ansi16=function(e){return L.rgb.ansi16(L.hsv.rgb(e),e[2])};L.rgb.ansi256=function(e){let t=e[0],i=e[1],o=e[2];return t>>4===i>>4&&i>>4===o>>4?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(i/255*5)+Math.round(o/255*5)};L.ansi16.rgb=function(e){e=e[0];let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let i=(Math.trunc(e>50)+1)*.5,o=(t&1)*i*255,n=(t>>1&1)*i*255,s=(t>>2&1)*i*255;return[o,n,s]};L.ansi256.rgb=function(e){if(e=e[0],e>=232){let s=(e-232)*10+8;return[s,s,s]}e-=16;let t,i=Math.floor(e/36)/5*255,o=Math.floor((t=e%36)/6)/5*255,n=t%6/5*255;return[i,o,n]};L.rgb.hex=function(e){let i=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".slice(i.length)+i};L.hex.rgb=function(e){let t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let i=t[0];t[0].length===3&&(i=[...i].map(a=>a+a).join(""));let o=Number.parseInt(i,16),n=o>>16&255,s=o>>8&255,r=o&255;return[n,s,r]};L.rgb.hcg=function(e){let t=e[0]/255,i=e[1]/255,o=e[2]/255,n=Math.max(Math.max(t,i),o),s=Math.min(Math.min(t,i),o),r=n-s,a,l=r<1?s/(1-r):0;return r<=0?a=0:n===t?a=(i-o)/r%6:n===i?a=2+(o-t)/r:a=4+(t-i)/r,a/=6,a%=1,[a*360,r*100,l*100]};L.hsl.hcg=function(e){let t=e[1]/100,i=e[2]/100,o=i<.5?2*t*i:2*t*(1-i),n=0;return o<1&&(n=(i-.5*o)/(1-o)),[e[0],o*100,n*100]};L.hsv.hcg=function(e){let t=e[1]/100,i=e[2]/100,o=t*i,n=0;return o<1&&(n=(i-o)/(1-o)),[e[0],o*100,n*100]};L.hcg.rgb=function(e){let t=e[0]/360,i=e[1]/100,o=e[2]/100;if(i===0)return[o*255,o*255,o*255];let n=[0,0,0],s=t%1*6,r=s%1,a=1-r,l=0;switch(Math.floor(s)){case 0:{n[0]=1,n[1]=r,n[2]=0;break}case 1:{n[0]=a,n[1]=1,n[2]=0;break}case 2:{n[0]=0,n[1]=1,n[2]=r;break}case 3:{n[0]=0,n[1]=a,n[2]=1;break}case 4:{n[0]=r,n[1]=0,n[2]=1;break}default:n[0]=1,n[1]=0,n[2]=a}return l=(1-i)*o,[(i*n[0]+l)*255,(i*n[1]+l)*255,(i*n[2]+l)*255]};L.hcg.hsv=function(e){let t=e[1]/100,i=e[2]/100,o=t+i*(1-t),n=0;return o>0&&(n=t/o),[e[0],n*100,o*100]};L.hcg.hsl=function(e){let t=e[1]/100,o=e[2]/100*(1-t)+.5*t,n=0;return o>0&&o<.5?n=t/(2*o):o>=.5&&o<1&&(n=t/(2*(1-o))),[e[0],n*100,o*100]};L.hcg.hwb=function(e){let t=e[1]/100,i=e[2]/100,o=t+i*(1-t);return[e[0],(o-t)*100,(1-o)*100]};L.hwb.hcg=function(e){let t=e[1]/100,o=1-e[2]/100,n=o-t,s=0;return n<1&&(s=(o-n)/(1-n)),[e[0],n*100,s*100]};L.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};L.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};L.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};L.gray.hsl=function(e){return[0,0,e[0]]};L.gray.hsv=L.gray.hsl;L.gray.hwb=function(e){return[0,100,e[0]]};L.gray.cmyk=function(e){return[0,0,0,e[0]]};L.gray.lab=function(e){return[e[0],0,0]};L.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,o=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(o.length)+o};L.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function Px(){let e={},t=Object.keys(wi);for(let{length:i}=t,o=0;o0;){let o=i.pop(),n=Object.keys(wi[o]);for(let{length:s}=n,r=0;r1&&(i=o),e(i))};return"conversion"in e&&(t.conversion=e.conversion),t}function Dx(e){let t=function(...i){let o=i[0];if(o==null)return o;o.length>1&&(i=o);let n=e(i);if(typeof n=="object")for(let{length:s}=n,r=0;re>i?i:eMath.round(i*e)/i;var NU={grad:360/400,turn:360,rad:360/(Math.PI*2)},vb=e=>Hx(yl(e)),yl=e=>(e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?xe(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?xe(parseInt(e.substring(6,8),16)/255,2):1});var kb=e=>zx(Nx(e)),Fx=({h:e,s:t,v:i,a:o})=>{let n=(200-t)*i/100;return{h:xe(e),s:xe(n>0&&n<200?t*i/100/(n<=100?n:200-n)*100:0),l:xe(n/2),a:xe(o,2)}};var fr=e=>{let{h:t,s:i,l:o}=Fx(e);return`hsl(${t}, ${i}%, ${o}%)`};var Nx=({h:e,s:t,v:i,a:o})=>{e=e/360*6,t=t/100,i=i/100;let n=Math.floor(e),s=i*(1-t),r=i*(1-(e-n)*t),a=i*(1-(1-e+n)*t),l=n%6;return{r:xe([i,r,s,s,a,i][l]*255),g:xe([a,i,i,r,s,s][l]*255),b:xe([s,s,a,i,i,r][l]*255),a:xe(o,2)}};var wl=e=>{let t=e.toString(16);return t.length<2?"0"+t:t},zx=({r:e,g:t,b:i,a:o})=>{let n=o<1?wl(xe(o*255)):"";return"#"+wl(e)+wl(t)+wl(i)+n},Hx=({r:e,g:t,b:i,a:o})=>{let n=Math.max(e,t,i),s=n-Math.min(e,t,i),r=s?n===e?(t-i)/s:n===t?2+(i-e)/s:4+(e-t)/s:0;return{h:xe(60*(r<0?r+6:r)),s:xe(n?s/n*100:0),v:xe(n/255*100),a:o}};var Zd=(e,t)=>{if(e===t)return!0;for(let i in e)if(e[i]!==t[i])return!1;return!0};var Cb=(e,t)=>e.toLowerCase()===t.toLowerCase()?!0:Zd(yl(e),yl(t));var xb={},_l=e=>{let t=xb[e];return t||(t=document.createElement("template"),t.innerHTML=e,xb[e]=t),t},mr=(e,t,i)=>{e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))};var Wn=!1,Qd=e=>"touches"in e,Wx=e=>Wn&&!Qd(e)?!1:(Wn||(Wn=Qd(e)),!0),Tb=(e,t)=>{let i=Qd(t)?t.touches[0]:t,o=e.el.getBoundingClientRect();mr(e.el,"move",e.getMove({x:Ui((i.pageX-(o.left+window.pageXOffset))/o.width),y:Ui((i.pageY-(o.top+window.pageYOffset))/o.height)}))},Ux=(e,t)=>{let i=t.keyCode;i>40||e.xy&&i<37||i<33||(t.preventDefault(),mr(e.el,"move",e.getMove({x:i===39?.01:i===37?-.01:i===34?.05:i===33?-.05:i===35?1:i===36?-1:0,y:i===40?.01:i===38?-.01:0},!0)))},Un=class{constructor(t,i,o,n){let s=_l(`
`);t.appendChild(s.content.cloneNode(!0));let r=t.querySelector(`[part=${i}]`);r.addEventListener("mousedown",this),r.addEventListener("touchstart",this),r.addEventListener("keydown",this),this.el=r,this.xy=n,this.nodes=[r.firstChild,r]}set dragging(t){let i=t?document.addEventListener:document.removeEventListener;i(Wn?"touchmove":"mousemove",this),i(Wn?"touchend":"mouseup",this)}handleEvent(t){switch(t.type){case"mousedown":case"touchstart":if(t.preventDefault(),!Wx(t)||!Wn&&t.button!=0)return;this.el.focus(),Tb(this,t),this.dragging=!0;break;case"mousemove":case"touchmove":t.preventDefault(),Tb(this,t);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":Ux(this,t);break}}style(t){t.forEach((i,o)=>{for(let n in i)this.nodes[o].style.setProperty(n,i[n])})}};var vl=class extends Un{constructor(t){super(t,"hue",'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"',!1)}update({h:t}){this.h=t,this.style([{left:`${t/360*100}%`,color:fr({h:t,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${xe(t)}`)}getMove(t,i){return{h:i?Ui(this.h+t.x*360,0,360):360*t.x}}};var kl=class extends Un{constructor(t){super(t,"saturation",'aria-label="Color"',!0)}update(t){this.hsva=t,this.style([{top:`${100-t.v}%`,left:`${t.s}%`,color:fr(t)},{"background-color":fr({h:t.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${xe(t.s)}%, Brightness ${xe(t.v)}%`)}getMove(t,i){return{s:i?Ui(this.hsva.s+t.x*100,0,100):t.x*100,v:i?Ui(this.hsva.v-t.y*100,0,100):Math.round(100-t.y*100)}}};var Eb=':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}';var Ab="[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}";var Ib="[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}";var Cl=Symbol("same"),Yd=Symbol("color"),Sb=Symbol("hsva"),Xd=Symbol("update"),Pb=Symbol("parts"),Rb=Symbol("css"),Vb=Symbol("sliders"),xl=class extends HTMLElement{static get observedAttributes(){return["color"]}get[Rb](){return[Eb,Ab,Ib]}get[Vb](){return[kl,vl]}get color(){return this[Yd]}set color(t){if(!this[Cl](t)){let i=this.colorModel.toHsva(t);this[Xd](i),this[Yd]=t}}constructor(){super();let t=_l(``),i=this.attachShadow({mode:"open"});i.appendChild(t.content.cloneNode(!0)),i.addEventListener("move",this),this[Pb]=this[Vb].map(o=>new o(i))}connectedCallback(){if(this.hasOwnProperty("color")){let t=this.color;delete this.color,this.color=t}else this.color||(this.color=this.colorModel.defaultColor)}attributeChangedCallback(t,i,o){let n=this.colorModel.fromAttr(o);this[Cl](n)||(this.color=n)}handleEvent(t){let i=this[Sb],o={...i,...t.detail};this[Xd](o);let n;!Zd(o,i)&&!this[Cl](n=this.colorModel.fromHsva(o))&&(this[Yd]=n,mr(this,"color-changed",{value:n}))}[Cl](t){return this.color&&this.colorModel.equal(t,this.color)}[Xd](t){this[Sb]=t,this[Pb].forEach(i=>i.update(t))}};var qx={defaultColor:"#000",toHsva:vb,fromHsva:({h:e,s:t,v:i})=>kb({h:e,s:t,v:i,a:1}),equal:Cb,fromAttr:e=>e},Tl=class extends xl{get colorModel(){return qx}};/** +*/var Kd={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let e in Kd)Object.freeze(Kd[e]);var Gd=Object.freeze(Kd);var Jd=Px,_b={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function Px(e){var t,i=[],o=1,n;if(typeof e=="number")return{space:"rgb",values:[e>>>16,(e&65280)>>>8,e&255],alpha:1};if(typeof e=="number")return{space:"rgb",values:[e>>>16,(e&65280)>>>8,e&255],alpha:1};if(e=String(e).toLowerCase(),Gd[e])i=Gd[e].slice(),n="rgb";else if(e==="transparent")o=0,n="rgb",i=[0,0,0];else if(e[0]==="#"){var s=e.slice(1),r=s.length,a=r<=4;o=1,a?(i=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],r===4&&(o=parseInt(s[3]+s[3],16)/255)):(i=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],r===8&&(o=parseInt(s[6]+s[7],16)/255)),i[0]||(i[0]=0),i[1]||(i[1]=0),i[2]||(i[2]=0),n="rgb"}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(e)){var l=t[1];n=l.replace(/a$/,"");var c=n==="cmyk"?4:n==="gray"?1:3;i=t[2].trim().split(/\s*[,\/]\s*|\s+/),n==="color"&&(n=i.shift()),i=i.map(function(u,d){if(u[u.length-1]==="%")return u=parseFloat(u)/100,d===3?u:n==="rgb"?u*255:n[0]==="h"||n[0]==="l"&&!d?u*100:n==="lab"?u*125:n==="lch"?d<2?u*150:u*360:n[0]==="o"&&!d?u:n==="oklab"?u*.4:n==="oklch"?d<2?u*.4:u*360:u;if(n[d]==="h"||d===2&&n[n.length-1]==="h"){if(_b[u]!==void 0)return _b[u];if(u.endsWith("deg"))return parseFloat(u);if(u.endsWith("turn"))return parseFloat(u)*360;if(u.endsWith("grad"))return parseFloat(u)*360/400;if(u.endsWith("rad"))return parseFloat(u)*180/Math.PI}return u==="none"?0:parseFloat(u)}),o=i.length>c?i.pop():1}else/[0-9](?:\s|\/|,)/.test(e)&&(i=e.match(/([0-9]+)/g).map(function(u){return parseFloat(u)}),n=e.match(/([a-z])/ig)?.join("")?.toLowerCase()||"rgb");return{space:n,values:i,alpha:o}}var Zd={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let e in Zd)Object.freeze(Zd[e]);var Fn=Object.freeze(Zd);var vb={};for(let e of Object.keys(Fn))vb[Fn[e]]=e;var L={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},_i=L,yi=(6/29)**3;function Nn(e){let t=e>.0031308?1.055*e**.4166666666666667-.055:e*12.92;return Math.min(Math.max(0,t),1)}function zn(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}for(let e of Object.keys(L)){if(!("channels"in L[e]))throw new Error("missing channels property: "+e);if(!("labels"in L[e]))throw new Error("missing channel labels property: "+e);if(L[e].labels.length!==L[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:i}=L[e];delete L[e].channels,delete L[e].labels,Object.defineProperty(L[e],"channels",{value:t}),Object.defineProperty(L[e],"labels",{value:i})}L.rgb.hsl=function(e){let t=e[0]/255,i=e[1]/255,o=e[2]/255,n=Math.min(t,i,o),s=Math.max(t,i,o),r=s-n,a,l;switch(s){case n:{a=0;break}case t:{a=(i-o)/r;break}case i:{a=2+(o-t)/r;break}case o:{a=4+(t-i)/r;break}}a=Math.min(a*60,360),a<0&&(a+=360);let c=(n+s)/2;return s===n?l=0:c<=.5?l=r/(s+n):l=r/(2-s-n),[a,l*100,c*100]};L.rgb.hsv=function(e){let t,i,o,n,s,r=e[0]/255,a=e[1]/255,l=e[2]/255,c=Math.max(r,a,l),u=c-Math.min(r,a,l),d=function(h){return(c-h)/6/u+1/2};if(u===0)n=0,s=0;else{switch(s=u/c,t=d(r),i=d(a),o=d(l),c){case r:{n=o-i;break}case a:{n=1/3+t-o;break}case l:{n=2/3+i-t;break}}n<0?n+=1:n>1&&(n-=1)}return[n*360,s*100,c*100]};L.rgb.hwb=function(e){let t=e[0],i=e[1],o=e[2],n=L.rgb.hsl(e)[0],s=1/255*Math.min(t,Math.min(i,o));return o=1-1/255*Math.max(t,Math.max(i,o)),[n,s*100,o*100]};L.rgb.oklab=function(e){let t=zn(e[0]/255),i=zn(e[1]/255),o=zn(e[2]/255),n=Math.cbrt(.4122214708*t+.5363325363*i+.0514459929*o),s=Math.cbrt(.2119034982*t+.6806995451*i+.1073969566*o),r=Math.cbrt(.0883024619*t+.2817188376*i+.6299787005*o),a=.2104542553*n+.793617785*s-.0040720468*r,l=1.9779984951*n-2.428592205*s+.4505937099*r,c=.0259040371*n+.7827717662*s-.808675766*r;return[a*100,l*100,c*100]};L.rgb.cmyk=function(e){let t=e[0]/255,i=e[1]/255,o=e[2]/255,n=Math.min(1-t,1-i,1-o),s=(1-t-n)/(1-n)||0,r=(1-i-n)/(1-n)||0,a=(1-o-n)/(1-n)||0;return[s*100,r*100,a*100,n*100]};function Rx(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}L.rgb.keyword=function(e){let t=vb[e];if(t)return t;let i=Number.POSITIVE_INFINITY,o;for(let n of Object.keys(Fn)){let s=Fn[n],r=Rx(e,s);ryi?i**(1/3):7.787*i+16/116,o=o>yi?o**(1/3):7.787*o+16/116,n=n>yi?n**(1/3):7.787*n+16/116;let s=116*o-16,r=500*(i-o),a=200*(o-n);return[s,r,a]};L.hsl.rgb=function(e){let t=e[0]/360,i=e[1]/100,o=e[2]/100,n,s;if(i===0)return s=o*255,[s,s,s];let r=o<.5?o*(1+i):o+i-o*i,a=2*o-r,l=[0,0,0];for(let c=0;c<3;c++)n=t+1/3*-(c-1),n<0&&n++,n>1&&n--,6*n<1?s=a+(r-a)*6*n:2*n<1?s=r:3*n<2?s=a+(r-a)*(2/3-n)*6:s=a,l[c]=s*255;return l};L.hsl.hsv=function(e){let t=e[0],i=e[1]/100,o=e[2]/100,n=i,s=Math.max(o,.01);o*=2,i*=o<=1?o:2-o,n*=s<=1?s:2-s;let r=(o+i)/2,a=o===0?2*n/(s+n):2*i/(o+i);return[t,a*100,r*100]};L.hsv.rgb=function(e){let t=e[0]/60,i=e[1]/100,o=e[2]/100,n=Math.floor(t)%6,s=t-Math.floor(t),r=255*o*(1-i),a=255*o*(1-i*s),l=255*o*(1-i*(1-s));switch(o*=255,n){case 0:return[o,l,r];case 1:return[a,o,r];case 2:return[r,o,l];case 3:return[r,a,o];case 4:return[l,r,o];case 5:return[o,r,a]}};L.hsv.hsl=function(e){let t=e[0],i=e[1]/100,o=e[2]/100,n=Math.max(o,.01),s,r;r=(2-i)*o;let a=(2-i)*n;return s=i*n,s/=a<=1?a:2-a,s=s||0,r/=2,[t,s*100,r*100]};L.hwb.rgb=function(e){let t=e[0]/360,i=e[1]/100,o=e[2]/100,n=i+o,s;n>1&&(i/=n,o/=n);let r=Math.floor(6*t),a=1-o;s=6*t-r,(r&1)!==0&&(s=1-s);let l=i+s*(a-i),c,u,d;switch(r){default:case 6:case 0:{c=a,u=l,d=i;break}case 1:{c=l,u=a,d=i;break}case 2:{c=i,u=a,d=l;break}case 3:{c=i,u=l,d=a;break}case 4:{c=l,u=i,d=a;break}case 5:{c=a,u=i,d=l;break}}return[c*255,u*255,d*255]};L.cmyk.rgb=function(e){let t=e[0]/100,i=e[1]/100,o=e[2]/100,n=e[3]/100,s=1-Math.min(1,t*(1-n)+n),r=1-Math.min(1,i*(1-n)+n),a=1-Math.min(1,o*(1-n)+n);return[s*255,r*255,a*255]};L.xyz.rgb=function(e){let t=e[0]/100,i=e[1]/100,o=e[2]/100,n,s,r;return n=t*3.2404542+i*-1.5371385+o*-.4985314,s=t*-.969266+i*1.8760108+o*.041556,r=t*.0556434+i*-.2040259+o*1.0572252,n=Nn(n),s=Nn(s),r=Nn(r),[n*255,s*255,r*255]};L.xyz.lab=function(e){let t=e[0],i=e[1],o=e[2];t/=95.047,i/=100,o/=108.883,t=t>yi?t**(1/3):7.787*t+16/116,i=i>yi?i**(1/3):7.787*i+16/116,o=o>yi?o**(1/3):7.787*o+16/116;let n=116*i-16,s=500*(t-i),r=200*(i-o);return[n,s,r]};L.xyz.oklab=function(e){let t=e[0]/100,i=e[1]/100,o=e[2]/100,n=Math.cbrt(.8189330101*t+.3618667424*i-.1288597137*o),s=Math.cbrt(.0329845436*t+.9293118715*i+.0361456387*o),r=Math.cbrt(.0482003018*t+.2643662691*i+.633851707*o),a=.2104542553*n+.793617785*s-.0040720468*r,l=1.9779984951*n-2.428592205*s+.4505937099*r,c=.0259040371*n+.7827717662*s-.808675766*r;return[a*100,l*100,c*100]};L.oklab.oklch=function(e){return L.lab.lch(e)};L.oklab.xyz=function(e){let t=e[0]/100,i=e[1]/100,o=e[2]/100,n=(.999999998*t+.396337792*i+.215803758*o)**3,s=(1.000000008*t-.105561342*i-.063854175*o)**3,r=(1.000000055*t-.089484182*i-1.291485538*o)**3,a=1.227013851*n-.55779998*s+.281256149*r,l=-.040580178*n+1.11225687*s-.071676679*r,c=-.076381285*n-.421481978*s+1.58616322*r;return[a*100,l*100,c*100]};L.oklab.rgb=function(e){let t=e[0]/100,i=e[1]/100,o=e[2]/100,n=(t+.3963377774*i+.2158037573*o)**3,s=(t-.1055613458*i-.0638541728*o)**3,r=(t-.0894841775*i-1.291485548*o)**3,a=Nn(4.0767416621*n-3.3077115913*s+.2309699292*r),l=Nn(-1.2684380046*n+2.6097574011*s-.3413193965*r),c=Nn(-.0041960863*n-.7034186147*s+1.707614701*r);return[a*255,l*255,c*255]};L.oklch.oklab=function(e){return L.lch.lab(e)};L.lab.xyz=function(e){let t=e[0],i=e[1],o=e[2],n,s,r;s=(t+16)/116,n=i/500+s,r=s-o/200;let a=s**3,l=n**3,c=r**3;return s=a>yi?a:(s-16/116)/7.787,n=l>yi?l:(n-16/116)/7.787,r=c>yi?c:(r-16/116)/7.787,n*=95.047,s*=100,r*=108.883,[n,s,r]};L.lab.lch=function(e){let t=e[0],i=e[1],o=e[2],n;n=Math.atan2(o,i)*360/2/Math.PI,n<0&&(n+=360);let r=Math.sqrt(i*i+o*o);return[t,r,n]};L.lch.lab=function(e){let t=e[0],i=e[1],n=e[2]/360*2*Math.PI,s=i*Math.cos(n),r=i*Math.sin(n);return[t,s,r]};L.rgb.ansi16=function(e,t=null){let[i,o,n]=e,s=t===null?L.rgb.hsv(e)[2]:t;if(s=Math.round(s/50),s===0)return 30;let r=30+(Math.round(n/255)<<2|Math.round(o/255)<<1|Math.round(i/255));return s===2&&(r+=60),r};L.hsv.ansi16=function(e){return L.rgb.ansi16(L.hsv.rgb(e),e[2])};L.rgb.ansi256=function(e){let t=e[0],i=e[1],o=e[2];return t>>4===i>>4&&i>>4===o>>4?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(i/255*5)+Math.round(o/255*5)};L.ansi16.rgb=function(e){e=e[0];let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let i=(Math.trunc(e>50)+1)*.5,o=(t&1)*i*255,n=(t>>1&1)*i*255,s=(t>>2&1)*i*255;return[o,n,s]};L.ansi256.rgb=function(e){if(e=e[0],e>=232){let s=(e-232)*10+8;return[s,s,s]}e-=16;let t,i=Math.floor(e/36)/5*255,o=Math.floor((t=e%36)/6)/5*255,n=t%6/5*255;return[i,o,n]};L.rgb.hex=function(e){let i=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".slice(i.length)+i};L.hex.rgb=function(e){let t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let i=t[0];t[0].length===3&&(i=[...i].map(a=>a+a).join(""));let o=Number.parseInt(i,16),n=o>>16&255,s=o>>8&255,r=o&255;return[n,s,r]};L.rgb.hcg=function(e){let t=e[0]/255,i=e[1]/255,o=e[2]/255,n=Math.max(Math.max(t,i),o),s=Math.min(Math.min(t,i),o),r=n-s,a,l=r<1?s/(1-r):0;return r<=0?a=0:n===t?a=(i-o)/r%6:n===i?a=2+(o-t)/r:a=4+(t-i)/r,a/=6,a%=1,[a*360,r*100,l*100]};L.hsl.hcg=function(e){let t=e[1]/100,i=e[2]/100,o=i<.5?2*t*i:2*t*(1-i),n=0;return o<1&&(n=(i-.5*o)/(1-o)),[e[0],o*100,n*100]};L.hsv.hcg=function(e){let t=e[1]/100,i=e[2]/100,o=t*i,n=0;return o<1&&(n=(i-o)/(1-o)),[e[0],o*100,n*100]};L.hcg.rgb=function(e){let t=e[0]/360,i=e[1]/100,o=e[2]/100;if(i===0)return[o*255,o*255,o*255];let n=[0,0,0],s=t%1*6,r=s%1,a=1-r,l=0;switch(Math.floor(s)){case 0:{n[0]=1,n[1]=r,n[2]=0;break}case 1:{n[0]=a,n[1]=1,n[2]=0;break}case 2:{n[0]=0,n[1]=1,n[2]=r;break}case 3:{n[0]=0,n[1]=a,n[2]=1;break}case 4:{n[0]=r,n[1]=0,n[2]=1;break}default:n[0]=1,n[1]=0,n[2]=a}return l=(1-i)*o,[(i*n[0]+l)*255,(i*n[1]+l)*255,(i*n[2]+l)*255]};L.hcg.hsv=function(e){let t=e[1]/100,i=e[2]/100,o=t+i*(1-t),n=0;return o>0&&(n=t/o),[e[0],n*100,o*100]};L.hcg.hsl=function(e){let t=e[1]/100,o=e[2]/100*(1-t)+.5*t,n=0;return o>0&&o<.5?n=t/(2*o):o>=.5&&o<1&&(n=t/(2*(1-o))),[e[0],n*100,o*100]};L.hcg.hwb=function(e){let t=e[1]/100,i=e[2]/100,o=t+i*(1-t);return[e[0],(o-t)*100,(1-o)*100]};L.hwb.hcg=function(e){let t=e[1]/100,o=1-e[2]/100,n=o-t,s=0;return n<1&&(s=(o-n)/(1-n)),[e[0],n*100,s*100]};L.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};L.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};L.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};L.gray.hsl=function(e){return[0,0,e[0]]};L.gray.hsv=L.gray.hsl;L.gray.hwb=function(e){return[0,100,e[0]]};L.gray.cmyk=function(e){return[0,0,0,e[0]]};L.gray.lab=function(e){return[e[0],0,0]};L.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,o=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(o.length)+o};L.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function Vx(){let e={},t=Object.keys(_i);for(let{length:i}=t,o=0;o0;){let o=i.pop(),n=Object.keys(_i[o]);for(let{length:s}=n,r=0;r1&&(i=o),e(i))};return"conversion"in e&&(t.conversion=e.conversion),t}function Nx(e){let t=function(...i){let o=i[0];if(o==null)return o;o.length>1&&(i=o);let n=e(i);if(typeof n=="object")for(let{length:s}=n,r=0;re>i?i:eMath.round(i*e)/i;var UU={grad:360/400,turn:360,rad:360/(Math.PI*2)},Cb=e=>Ux(_l(e)),_l=e=>(e[0]==="#"&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Ee(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?Ee(parseInt(e.substring(6,8),16)/255,2):1});var xb=e=>Wx(Hx(e)),zx=({h:e,s:t,v:i,a:o})=>{let n=(200-t)*i/100;return{h:Ee(e),s:Ee(n>0&&n<200?t*i/100/(n<=100?n:200-n)*100:0),l:Ee(n/2),a:Ee(o,2)}};var fr=e=>{let{h:t,s:i,l:o}=zx(e);return`hsl(${t}, ${i}%, ${o}%)`};var Hx=({h:e,s:t,v:i,a:o})=>{e=e/360*6,t=t/100,i=i/100;let n=Math.floor(e),s=i*(1-t),r=i*(1-(e-n)*t),a=i*(1-(1-e+n)*t),l=n%6;return{r:Ee([i,r,s,s,a,i][l]*255),g:Ee([a,i,i,r,s,s][l]*255),b:Ee([s,s,a,i,i,r][l]*255),a:Ee(o,2)}};var yl=e=>{let t=e.toString(16);return t.length<2?"0"+t:t},Wx=({r:e,g:t,b:i,a:o})=>{let n=o<1?yl(Ee(o*255)):"";return"#"+yl(e)+yl(t)+yl(i)+n},Ux=({r:e,g:t,b:i,a:o})=>{let n=Math.max(e,t,i),s=n-Math.min(e,t,i),r=s?n===e?(t-i)/s:n===t?2+(i-e)/s:4+(e-t)/s:0;return{h:Ee(60*(r<0?r+6:r)),s:Ee(n?s/n*100:0),v:Ee(n/255*100),a:o}};var Yd=(e,t)=>{if(e===t)return!0;for(let i in e)if(e[i]!==t[i])return!1;return!0};var Tb=(e,t)=>e.toLowerCase()===t.toLowerCase()?!0:Yd(_l(e),_l(t));var Eb={},vl=e=>{let t=Eb[e];return t||(t=document.createElement("template"),t.innerHTML=e,Eb[e]=t),t},mr=(e,t,i)=>{e.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:i}))};var Wn=!1,Xd=e=>"touches"in e,qx=e=>Wn&&!Xd(e)?!1:(Wn||(Wn=Xd(e)),!0),Ab=(e,t)=>{let i=Xd(t)?t.touches[0]:t,o=e.el.getBoundingClientRect();mr(e.el,"move",e.getMove({x:$i((i.pageX-(o.left+window.pageXOffset))/o.width),y:$i((i.pageY-(o.top+window.pageYOffset))/o.height)}))},$x=(e,t)=>{let i=t.keyCode;i>40||e.xy&&i<37||i<33||(t.preventDefault(),mr(e.el,"move",e.getMove({x:i===39?.01:i===37?-.01:i===34?.05:i===33?-.05:i===35?1:i===36?-1:0,y:i===40?.01:i===38?-.01:0},!0)))},Un=class{constructor(t,i,o,n){let s=vl(`
`);t.appendChild(s.content.cloneNode(!0));let r=t.querySelector(`[part=${i}]`);r.addEventListener("mousedown",this),r.addEventListener("touchstart",this),r.addEventListener("keydown",this),this.el=r,this.xy=n,this.nodes=[r.firstChild,r]}set dragging(t){let i=t?document.addEventListener:document.removeEventListener;i(Wn?"touchmove":"mousemove",this),i(Wn?"touchend":"mouseup",this)}handleEvent(t){switch(t.type){case"mousedown":case"touchstart":if(t.preventDefault(),!qx(t)||!Wn&&t.button!=0)return;this.el.focus(),Ab(this,t),this.dragging=!0;break;case"mousemove":case"touchmove":t.preventDefault(),Ab(this,t);break;case"mouseup":case"touchend":this.dragging=!1;break;case"keydown":$x(this,t);break}}style(t){t.forEach((i,o)=>{for(let n in i)this.nodes[o].style.setProperty(n,i[n])})}};var kl=class extends Un{constructor(t){super(t,"hue",'aria-label="Hue" aria-valuemin="0" aria-valuemax="360"',!1)}update({h:t}){this.h=t,this.style([{left:`${t/360*100}%`,color:fr({h:t,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuenow",`${Ee(t)}`)}getMove(t,i){return{h:i?$i(this.h+t.x*360,0,360):360*t.x}}};var Cl=class extends Un{constructor(t){super(t,"saturation",'aria-label="Color"',!0)}update(t){this.hsva=t,this.style([{top:`${100-t.v}%`,left:`${t.s}%`,color:fr(t)},{"background-color":fr({h:t.h,s:100,v:100,a:1})}]),this.el.setAttribute("aria-valuetext",`Saturation ${Ee(t.s)}%, Brightness ${Ee(t.v)}%`)}getMove(t,i){return{s:i?$i(this.hsva.s+t.x*100,0,100):t.x*100,v:i?$i(this.hsva.v-t.y*100,0,100):Math.round(100-t.y*100)}}};var Ib=':host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:"";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}';var Sb="[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}";var Pb="[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}";var xl=Symbol("same"),eh=Symbol("color"),Rb=Symbol("hsva"),th=Symbol("update"),Vb=Symbol("parts"),Lb=Symbol("css"),Mb=Symbol("sliders"),Tl=class extends HTMLElement{static get observedAttributes(){return["color"]}get[Lb](){return[Ib,Sb,Pb]}get[Mb](){return[Cl,kl]}get color(){return this[eh]}set color(t){if(!this[xl](t)){let i=this.colorModel.toHsva(t);this[th](i),this[eh]=t}}constructor(){super();let t=vl(``),i=this.attachShadow({mode:"open"});i.appendChild(t.content.cloneNode(!0)),i.addEventListener("move",this),this[Vb]=this[Mb].map(o=>new o(i))}connectedCallback(){if(this.hasOwnProperty("color")){let t=this.color;delete this.color,this.color=t}else this.color||(this.color=this.colorModel.defaultColor)}attributeChangedCallback(t,i,o){let n=this.colorModel.fromAttr(o);this[xl](n)||(this.color=n)}handleEvent(t){let i=this[Rb],o={...i,...t.detail};this[th](o);let n;!Yd(o,i)&&!this[xl](n=this.colorModel.fromHsva(o))&&(this[eh]=n,mr(this,"color-changed",{value:n}))}[xl](t){return this.color&&this.colorModel.equal(t,this.color)}[th](t){this[Rb]=t,this[Vb].forEach(i=>i.update(t))}};var jx={defaultColor:"#000",toHsva:Cb,fromHsva:({h:e,s:t,v:i})=>xb({h:e,s:t,v:i,a:1}),equal:Tb,fromAttr:e=>e},El=class extends Tl{get colorModel(){return jx}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var be=class extends J{_parentElement;constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",(t,i,o)=>{this._renderViewIntoCollectionParent(i,o)}),this.on("remove",(t,i)=>{i.element&&this._parentElement&&i.element.remove()}),this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e;for(let t of this)this._renderViewIntoCollectionParent(t)}delegate(...e){if(!e.length||!jx(e))throw new p("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(let i of this)for(let o of e)i.delegate(o).to(t);this.on("add",(i,o)=>{for(let n of e)o.delegate(n).to(t)}),this.on("remove",(i,o)=>{for(let n of e)o.stopDelegating(n,t)})}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}remove(e){return super.remove(e)}};function jx(e){return e.every(t=>typeof t=="string")}/** +*/var we=class extends G{_parentElement;constructor(e=[]){super(e,{idProperty:"viewUid"}),this.on("add",(t,i,o)=>{this._renderViewIntoCollectionParent(i,o)}),this.on("remove",(t,i)=>{i.element&&this._parentElement&&i.element.remove()}),this._parentElement=null}destroy(){this.map(e=>e.destroy())}setParent(e){this._parentElement=e;for(let t of this)this._renderViewIntoCollectionParent(t)}delegate(...e){if(!e.length||!Gx(e))throw new p("ui-viewcollection-delegate-wrong-events",this);return{to:t=>{for(let i of this)for(let o of e)i.delegate(o).to(t);this.on("add",(i,o)=>{for(let n of e)o.delegate(n).to(t)}),this.on("remove",(i,o)=>{for(let n of e)o.stopDelegating(n,t)})}}}_renderViewIntoCollectionParent(e,t){e.isRendered||e.render(),e.element&&this._parentElement&&this._parentElement.insertBefore(e.element,this._parentElement.children[t])}remove(e){return super.remove(e)}};function Gx(e){return e.every(t=>typeof t=="string")}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Kx="http://www.w3.org/1999/xhtml",Gx=q(),_t=class extends Gx{ns;tag;text;attributes;children;eventListeners;_isRendered;_revertData;constructor(e){super(),Object.assign(this,Mb(Lb(e))),this._isRendered=!1,this._revertData=null}render(){let e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData=Db(),this._renderNode({node:e,intoFragment:!1,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new p("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){function*e(t){if(t.children)for(let i of t.children)Rl(i)?yield i:lh(i)&&(yield*e(i))}yield*e(this)}static bind(e,t){return{to(i,o){return new Jx({eventNameOrFunction:i,attribute:i,observable:e,emitter:t,callback:o})},if(i,o,n){return new ow({observable:e,emitter:t,attribute:i,valueIfTrue:o,callback:n})}}}static extend(e,t){if(e._isRendered)throw new p("template-extend-render",[this,e]);aw(e,Mb(Lb(t)))}_renderNode(e){let t;if(e.node?t=this.tag&&this.text:t=this.tag?this.text:!this.text,t)throw new p("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t||(t=e.node=document.createElementNS(this.ns||Kx,this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){let t=e.node;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(""),Il(this.text)?this._bindToObservable({schema:this.text,updater:Qx(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){if(!this.attributes)return;let t=e.node,i=e.revertData;for(let o in this.attributes){let n=t.getAttribute(o),s=this.attributes[o];i&&(i.attributes[o]=n);let r=Ob(s)?s[0].ns:null;if(Il(s)){let a=Ob(s)?s[0].value:s;i&&Fb(o)&&a.unshift(n),this._bindToObservable({schema:a,updater:Yx(t,o,r),data:e})}else if(o=="style"&&typeof s[0]!="string")this._renderStyleAttribute(s[0],e);else{i&&n&&Fb(o)&&s.unshift(n);let a=s.map(l=>l&&(l.value||l)).reduce((l,c)=>l.concat(c),[]).reduce(rw,"");$n(a)||t.setAttributeNS(r,o,a)}}}_renderStyleAttribute(e,t){let i=t.node;for(let o in e){let n=e[o];Il(n)?this._bindToObservable({schema:[n],updater:Xx(i,o),data:t}):rh(o)?i.style.setProperty(o,n):i.style[o]=n}}_renderElementChildren(e){let t=e.node,i=e.intoFragment?document.createDocumentFragment():t,o=e.isApplying,n=0;for(let s of this.children)if(ch(s)){if(!o){s.setParent(t);for(let r of s)i.appendChild(r.element)}}else if(Rl(s))o||(s.isRendered||s.render(),i.appendChild(s.element));else if(Ut(s))i.appendChild(s);else if(o){let r=e.revertData,a=Db();r.children.push(a),s._renderNode({intoFragment:!1,node:i.childNodes[n++],isApplying:!0,revertData:a})}else i.appendChild(s.render());e.intoFragment&&t.appendChild(i)}_setUpListeners(e){if(this.eventListeners)for(let t in this.eventListeners){let i=this.eventListeners[t].map(o=>{let[n,s]=t.split("@");return o.activateDomEventListener(n,s,e)});e.revertData&&e.revertData.bindings.push(i)}}_bindToObservable({schema:e,updater:t,data:i}){let o=i.revertData;nw(e,t,i);let n=e.filter(s=>!$n(s)).filter(s=>s.observable).map(s=>s.activateAttributeListener(e,t,i));o&&o.bindings.push(n)}_revertTemplateFromNode(e,t){for(let o of t.bindings)for(let n of o)n();if(t.text){e.textContent=t.text;return}let i=e;for(let o in t.attributes){let n=t.attributes[o];n===null?i.removeAttribute(o):i.setAttribute(o,n)}for(let o=0;onw(e,t,i);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,o),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,o)}}},Jx=class extends gr{eventNameOrFunction;constructor(e){super(e),this.eventNameOrFunction=e.eventNameOrFunction}activateDomEventListener(e,t,i){let o=(n,s)=>{(!t||s.target.matches(t))&&(typeof this.eventNameOrFunction=="function"?this.eventNameOrFunction(s):this.observable.fire(this.eventNameOrFunction,s))};return this.emitter.listenTo(i.node,e,o),()=>{this.emitter.stopListening(i.node,e,o)}}},ow=class extends gr{valueIfTrue;constructor(e){super(e),this.valueIfTrue=e.valueIfTrue}getValue(e){return $n(super.getValue(e))?!1:this.valueIfTrue||!0}};function Il(e){return e?(e.value&&(e=e.value),Array.isArray(e)?e.some(Il):e instanceof gr):!1}function rh(e){return/^--[a-zA-Z_-][\w-]*$/.test(e)}function Zx(e,t){return e.map(i=>i instanceof gr?i.getValue(t):i)}function nw(e,t,{node:i}){let o=Zx(e,i),n;e.length==1&&e[0]instanceof ow?n=o[0]:n=o.reduce(rw,""),$n(n)?t.remove():t.set(n)}function Qx(e){return{set(t){e.textContent=t},remove(){e.textContent=""}}}function Yx(e,t,i){return{set(o){e.setAttributeNS(i,t,o)},remove(){e.removeAttributeNS(i,t)}}}function Xx(e,t){return{set(i){rh(t)?e.style.setProperty(t,i):e.style[t]=i},remove(){rh(t)?e.style.removeProperty(t):e.style[t]=null}}}function Lb(e){return lo(e,t=>{if(t&&(t instanceof gr||lh(t)||Rl(t)||ch(t)))return t})}function Mb(e){if(typeof e=="string"?e=i9(e):e.text&&o9(e),e.on&&(e.eventListeners=t9(e.on),delete e.on),!e.text){e.attributes&&e9(e.attributes);let t=[];if(e.children)if(ch(e.children))t.push(e.children);else for(let i of e.children)lh(i)||Rl(i)||Ut(i)?t.push(i):t.push(new _t(i));e.children=t}return e}function e9(e){for(let t in e)e[t].value&&(e[t].value=j(e[t].value)),sw(e,t)}function t9(e){for(let t in e)sw(e,t);return e}function i9(e){return{text:[e]}}function o9(e){e.text=j(e.text)}function sw(e,t){e[t]=j(e[t])}function rw(e,t){return $n(t)?e:$n(e)?t:`${e} ${t}`}function Bb(e,t){for(let i in t)e[i]?e[i].push(...t[i]):e[i]=t[i]}function aw(e,t){if(t.attributes&&(e.attributes||(e.attributes={}),Bb(e.attributes,t.attributes)),t.eventListeners&&(e.eventListeners||(e.eventListeners={}),Bb(e.eventListeners,t.eventListeners)),t.text&&e.text.push(...t.text),t.children&&t.children.length){if(e.children.length!=t.children.length)throw new p("ui-template-extend-children-mismatch",e);let i=0;for(let o of t.children)aw(e.children[i++],o)}}function $n(e){return!e&&e!==0}function Rl(e){return e instanceof R}function lh(e){return e instanceof _t}function ch(e){return e instanceof be}function Ob(e){return ae(e[0])&&e[0].ns}function Db(){return{children:[],bindings:[],attributes:{}}}function Fb(e){return e=="class"||e=="style"}/** +*/var Jx="http://www.w3.org/1999/xhtml",Zx=q(),vt=class extends Zx{ns;tag;text;attributes;children;eventListeners;_isRendered;_revertData;constructor(e){super(),Object.assign(this,Ob(Bb(e))),this._isRendered=!1,this._revertData=null}render(){let e=this._renderNode({intoFragment:!0});return this._isRendered=!0,e}apply(e){return this._revertData=Nb(),this._renderNode({node:e,intoFragment:!1,isApplying:!0,revertData:this._revertData}),e}revert(e){if(!this._revertData)throw new p("ui-template-revert-not-applied",[this,e]);this._revertTemplateFromNode(e,this._revertData)}*getViews(){function*e(t){if(t.children)for(let i of t.children)Vl(i)?yield i:uh(i)&&(yield*e(i))}yield*e(this)}static bind(e,t){return{to(i,o){return new Qx({eventNameOrFunction:i,attribute:i,observable:e,emitter:t,callback:o})},if(i,o,n){return new sw({observable:e,emitter:t,attribute:i,valueIfTrue:o,callback:n})}}}static extend(e,t){if(e._isRendered)throw new p("template-extend-render",[this,e]);cw(e,Ob(Bb(t)))}_renderNode(e){let t;if(e.node?t=this.tag&&this.text:t=this.tag?this.text:!this.text,t)throw new p("ui-template-wrong-syntax",this);return this.text?this._renderText(e):this._renderElement(e)}_renderElement(e){let t=e.node;return t||(t=e.node=document.createElementNS(this.ns||Jx,this.tag)),this._renderAttributes(e),this._renderElementChildren(e),this._setUpListeners(e),t}_renderText(e){let t=e.node;return t?e.revertData.text=t.textContent:t=e.node=document.createTextNode(""),Sl(this.text)?this._bindToObservable({schema:this.text,updater:Xx(t),data:e}):t.textContent=this.text.join(""),t}_renderAttributes(e){if(!this.attributes)return;let t=e.node,i=e.revertData;for(let o in this.attributes){let n=t.getAttribute(o),s=this.attributes[o];i&&(i.attributes[o]=n);let r=Fb(s)?s[0].ns:null;if(Sl(s)){let a=Fb(s)?s[0].value:s;i&&zb(o)&&a.unshift(n),this._bindToObservable({schema:a,updater:e9(t,o,r),data:e})}else if(o=="style"&&typeof s[0]!="string")this._renderStyleAttribute(s[0],e);else{i&&n&&zb(o)&&s.unshift(n);let a=s.map(l=>l&&(l.value||l)).reduce((l,c)=>l.concat(c),[]).reduce(lw,"");$n(a)||t.setAttributeNS(r,o,a)}}}_renderStyleAttribute(e,t){let i=t.node;for(let o in e){let n=e[o];Sl(n)?this._bindToObservable({schema:[n],updater:t9(i,o),data:t}):lh(o)?i.style.setProperty(o,n):i.style[o]=n}}_renderElementChildren(e){let t=e.node,i=e.intoFragment?document.createDocumentFragment():t,o=e.isApplying,n=0;for(let s of this.children)if(dh(s)){if(!o){s.setParent(t);for(let r of s)i.appendChild(r.element)}}else if(Vl(s))o||(s.isRendered||s.render(),i.appendChild(s.element));else if($t(s))i.appendChild(s);else if(o){let r=e.revertData,a=Nb();r.children.push(a),s._renderNode({intoFragment:!1,node:i.childNodes[n++],isApplying:!0,revertData:a})}else i.appendChild(s.render());e.intoFragment&&t.appendChild(i)}_setUpListeners(e){if(this.eventListeners)for(let t in this.eventListeners){let i=this.eventListeners[t].map(o=>{let[n,s]=t.split("@");return o.activateDomEventListener(n,s,e)});e.revertData&&e.revertData.bindings.push(i)}}_bindToObservable({schema:e,updater:t,data:i}){let o=i.revertData;rw(e,t,i);let n=e.filter(s=>!$n(s)).filter(s=>s.observable).map(s=>s.activateAttributeListener(e,t,i));o&&o.bindings.push(n)}_revertTemplateFromNode(e,t){for(let o of t.bindings)for(let n of o)n();if(t.text){e.textContent=t.text;return}let i=e;for(let o in t.attributes){let n=t.attributes[o];n===null?i.removeAttribute(o):i.setAttribute(o,n)}for(let o=0;orw(e,t,i);return this.emitter.listenTo(this.observable,`change:${this.attribute}`,o),()=>{this.emitter.stopListening(this.observable,`change:${this.attribute}`,o)}}},Qx=class extends gr{eventNameOrFunction;constructor(e){super(e),this.eventNameOrFunction=e.eventNameOrFunction}activateDomEventListener(e,t,i){let o=(n,s)=>{(!t||s.target.matches(t))&&(typeof this.eventNameOrFunction=="function"?this.eventNameOrFunction(s):this.observable.fire(this.eventNameOrFunction,s))};return this.emitter.listenTo(i.node,e,o),()=>{this.emitter.stopListening(i.node,e,o)}}},sw=class extends gr{valueIfTrue;constructor(e){super(e),this.valueIfTrue=e.valueIfTrue}getValue(e){return $n(super.getValue(e))?!1:this.valueIfTrue||!0}};function Sl(e){return e?(e.value&&(e=e.value),Array.isArray(e)?e.some(Sl):e instanceof gr):!1}function lh(e){return/^--[a-zA-Z_-][\w-]*$/.test(e)}function Yx(e,t){return e.map(i=>i instanceof gr?i.getValue(t):i)}function rw(e,t,{node:i}){let o=Yx(e,i),n;e.length==1&&e[0]instanceof sw?n=o[0]:n=o.reduce(lw,""),$n(n)?t.remove():t.set(n)}function Xx(e){return{set(t){e.textContent=t},remove(){e.textContent=""}}}function e9(e,t,i){return{set(o){e.setAttributeNS(i,t,o)},remove(){e.removeAttributeNS(i,t)}}}function t9(e,t){return{set(i){lh(t)?e.style.setProperty(t,i):e.style[t]=i},remove(){lh(t)?e.style.removeProperty(t):e.style[t]=null}}}function Bb(e){return co(e,t=>{if(t&&(t instanceof gr||uh(t)||Vl(t)||dh(t)))return t})}function Ob(e){if(typeof e=="string"?e=n9(e):e.text&&s9(e),e.on&&(e.eventListeners=o9(e.on),delete e.on),!e.text){e.attributes&&i9(e.attributes);let t=[];if(e.children)if(dh(e.children))t.push(e.children);else for(let i of e.children)uh(i)||Vl(i)||$t(i)?t.push(i):t.push(new vt(i));e.children=t}return e}function i9(e){for(let t in e)e[t].value&&(e[t].value=j(e[t].value)),aw(e,t)}function o9(e){for(let t in e)aw(e,t);return e}function n9(e){return{text:[e]}}function s9(e){e.text=j(e.text)}function aw(e,t){e[t]=j(e[t])}function lw(e,t){return $n(t)?e:$n(e)?t:`${e} ${t}`}function Db(e,t){for(let i in t)e[i]?e[i].push(...t[i]):e[i]=t[i]}function cw(e,t){if(t.attributes&&(e.attributes||(e.attributes={}),Db(e.attributes,t.attributes)),t.eventListeners&&(e.eventListeners||(e.eventListeners={}),Db(e.eventListeners,t.eventListeners)),t.text&&e.text.push(...t.text),t.children&&t.children.length){if(e.children.length!=t.children.length)throw new p("ui-template-extend-children-mismatch",e);let i=0;for(let o of t.children)cw(e.children[i++],o)}}function $n(e){return!e&&e!==0}function Vl(e){return e instanceof R}function uh(e){return e instanceof vt}function dh(e){return e instanceof we}function Fb(e){return ae(e[0])&&e[0].ns}function Nb(){return{children:[],bindings:[],attributes:{}}}function zb(e){return e=="class"||e=="style"}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var n9=pe(W()),R=class extends n9{element;isRendered;locale;t;template;_viewCollections;_unboundChildren;_bindTemplate;constructor(e){super(),this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new J,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(t,i)=>{i.locale=e,i.t=e&&e.t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=_t.bind(this,this)}createCollection(e){let t=new be(e);return this._viewCollections.add(t),t}registerChild(e){Je(e)||(e=[e]);for(let t of e)this._unboundChildren.add(t)}deregisterChild(e){Je(e)||(e=[e]);for(let t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new _t(e)}extendTemplate(e){_t.extend(this.template,e)}render(){if(this.isRendered)throw new p("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(e=>e.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}};/** +*/var r9=be(W()),R=class extends r9{element;isRendered;locale;t;template;_viewCollections;_unboundChildren;_bindTemplate;constructor(e){super(),this.element=null,this.isRendered=!1,this.locale=e,this.t=e&&e.t,this._viewCollections=new G,this._unboundChildren=this.createCollection(),this._viewCollections.on("add",(t,i)=>{i.locale=e,i.t=e&&e.t}),this.decorate("render")}get bindTemplate(){return this._bindTemplate?this._bindTemplate:this._bindTemplate=vt.bind(this,this)}createCollection(e){let t=new we(e);return this._viewCollections.add(t),t}registerChild(e){Je(e)||(e=[e]);for(let t of e)this._unboundChildren.add(t)}deregisterChild(e){Je(e)||(e=[e]);for(let t of e)this._unboundChildren.remove(t)}setTemplate(e){this.template=new vt(e)}extendTemplate(e){vt.extend(this.template,e)}render(){if(this.isRendered)throw new p("ui-view-render-already-rendered",this);this.template&&(this.element=this.template.render(),this.registerChild(this.template.getViews())),this.isRendered=!0}destroy(){this.stopListening(),this._viewCollections.map(e=>e.destroy()),this.template&&this.template._revertData&&this.template.revert(this.element)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Nb={POLITE:"polite",ASSERTIVE:"assertive"},s9=class{editor;view;constructor(e){this.editor=e,e.once("ready",()=>{for(let t of Object.values(Nb))this.announce("",t)})}announce(e,t=Nb.POLITE){let i=this.editor;if(!i.ui.view)return;this.view||(this.view=new r9(i.locale),i.ui.view.body.add(this.view));let{politeness:o,isUnsafeHTML:n}=typeof t=="string"?{politeness:t}:t,s=this.view.regionViews.find(r=>r.politeness===o);s||(s=new a9(i,o),this.view.regionViews.add(s)),s.announce({announcement:e,isUnsafeHTML:n})}},r9=class extends R{regionViews;constructor(e){super(e),this.regionViews=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-aria-live-announcer"]},children:this.regionViews})}},a9=class extends R{politeness;_domConverter;_pruneAnnouncementsInterval;constructor(e,t){super(e.locale),this.setTemplate({tag:"div",attributes:{"aria-live":t,"aria-relevant":"additions"},children:[{tag:"ul",attributes:{class:["ck","ck-aria-live-region-list"]}}]}),e.on("destroy",()=>{/* v8 ignore else -- @preserve */this._pruneAnnouncementsInterval!==null&&(clearInterval(this._pruneAnnouncementsInterval),this._pruneAnnouncementsInterval=null)}),this.politeness=t,this._domConverter=e.data.htmlProcessor.domConverter,this._pruneAnnouncementsInterval=setInterval(()=>{this.element&&this._listElement.firstChild&&this._listElement.firstChild.remove()},5e3)}announce({announcement:e,isUnsafeHTML:t}){if(!e.trim().length)return;let i=document.createElement("li");t?this._domConverter.setContentOf(i,e):i.innerText=e,this._listElement.appendChild(i)}get _listElement(){return this.element.querySelector("ul")}};/** +*/var Hb={POLITE:"polite",ASSERTIVE:"assertive"},a9=class{editor;view;constructor(e){this.editor=e,e.once("ready",()=>{for(let t of Object.values(Hb))this.announce("",t)})}announce(e,t=Hb.POLITE){let i=this.editor;if(!i.ui.view)return;this.view||(this.view=new l9(i.locale),i.ui.view.body.add(this.view));let{politeness:o,isUnsafeHTML:n}=typeof t=="string"?{politeness:t}:t,s=this.view.regionViews.find(r=>r.politeness===o);s||(s=new c9(i,o),this.view.regionViews.add(s)),s.announce({announcement:e,isUnsafeHTML:n})}},l9=class extends R{regionViews;constructor(e){super(e),this.regionViews=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-aria-live-announcer"]},children:this.regionViews})}},c9=class extends R{politeness;_domConverter;_pruneAnnouncementsInterval;constructor(e,t){super(e.locale),this.setTemplate({tag:"div",attributes:{"aria-live":t,"aria-relevant":"additions"},children:[{tag:"ul",attributes:{class:["ck","ck-aria-live-region-list"]}}]}),e.on("destroy",()=>{/* v8 ignore else -- @preserve */this._pruneAnnouncementsInterval!==null&&(clearInterval(this._pruneAnnouncementsInterval),this._pruneAnnouncementsInterval=null)}),this.politeness=t,this._domConverter=e.data.htmlProcessor.domConverter,this._pruneAnnouncementsInterval=setInterval(()=>{this.element&&this._listElement.firstChild&&this._listElement.firstChild.remove()},5e3)}announce({announcement:e,isUnsafeHTML:t}){if(!e.trim().length)return;let i=document.createElement("li");t?this._domConverter.setContentOf(i,e):i.innerText=e,this._listElement.appendChild(i)}get _listElement(){return this.element.querySelector("ul")}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function vt({emitter:e,activator:t,callback:i,contextElements:o}){let n=new WeakSet,s=!1;function r(){return(typeof o=="function"?o():o).filter(l=>l)}function a(l){for(let c of l){let u=c.getRootNode();u===document||!st(u)||n.has(u)||(n.add(u),e.listenTo(u,"mousedown",(d,h)=>{t()&&zb(h,r())&&(s=!0)}))}}e.listenTo(document,"mousedown",()=>{t()&&a(r()),s=!1},{useCapture:!0}),e.listenTo(document,"mousedown",(l,c)=>{t()&&!zb(c,r())&&!s&&i(),s=!1})}function zb(e,t){for(let i of t)if(i.contains(e.target))return!0;return!1}/** +*/function kt({emitter:e,activator:t,callback:i,contextElements:o}){let n=new WeakSet,s=!1;function r(){return(typeof o=="function"?o():o).filter(l=>l)}function a(l){for(let c of l){let u=c.getRootNode();u===document||!st(u)||n.has(u)||(n.add(u),e.listenTo(u,"mousedown",(d,h)=>{t()&&Wb(h,r())&&(s=!0)}))}}e.listenTo(document,"mousedown",()=>{t()&&a(r()),s=!1},{useCapture:!0}),e.listenTo(document,"mousedown",(l,c)=>{t()&&!Wb(c,r())&&!s&&i(),s=!1})}function Wb(e,t){for(let i of t)if(i.contains(e.target))return!0;return!1}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */function Kn(e){class t extends e{disableCssTransitions(){this._isCssTransitionsDisabled=!0}enableCssTransitions(){this._isCssTransitionsDisabled=!1}constructor(...o){super(...o),this.set("_isCssTransitionsDisabled",!1),this.initializeCssTransitionDisablerMixin()}initializeCssTransitionDisablerMixin(){this.template&&this.extendTemplate({attributes:{class:[this.bindTemplate.if("_isCssTransitionsDisabled","ck-transitions-disabled")]}})}}return t}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function l9(e){class t extends e{_onDragBound=this._onDrag.bind(this);_onDragEndBound=this._onDragEnd.bind(this);_lastDraggingCoordinates={x:0,y:0};constructor(...o){super(...o),this.on("render",()=>{this._attachListeners()}),this.set("isDragging",!1)}_attachListeners(){this.listenTo(this.element,"mousedown",this._onDragStart.bind(this)),this.listenTo(this.element,"touchstart",this._onDragStart.bind(this))}_attachDragListeners(){this.listenTo(S.document,"mouseup",this._onDragEndBound),this.listenTo(S.document,"touchend",this._onDragEndBound),this.listenTo(S.document,"mousemove",this._onDragBound),this.listenTo(S.document,"touchmove",this._onDragBound)}_detachDragListeners(){this.stopListening(S.document,"mouseup",this._onDragEndBound),this.stopListening(S.document,"touchend",this._onDragEndBound),this.stopListening(S.document,"mousemove",this._onDragBound),this.stopListening(S.document,"touchmove",this._onDragBound)}_onDragStart(o,n){if(!this._isHandleElementPressed(n))return;this._attachDragListeners();let s,r;n instanceof MouseEvent?(s=n.clientX,r=n.clientY):(s=n.touches[0].clientX,r=n.touches[0].clientY),this._lastDraggingCoordinates={x:s,y:r},this.isDragging=!0}_onDrag(o,n){if(!this.isDragging){this._detachDragListeners();return}let s,r;n instanceof MouseEvent?(s=n.clientX,r=n.clientY):(s=n.touches[0].clientX,r=n.touches[0].clientY),n.preventDefault(),this.fire("drag",{deltaX:Math.round(s-this._lastDraggingCoordinates.x),deltaY:Math.round(r-this._lastDraggingCoordinates.y)}),this._lastDraggingCoordinates={x:s,y:r}}_onDragEnd(){this._detachDragListeners(),this.isDragging=!1}_isHandleElementPressed(o){return this.dragHandleElement?this.dragHandleElement===o.target||o.target instanceof HTMLElement&&rt(this.dragHandleElement,o.target):!1}}return t}/** +*/function u9(e){class t extends e{_onDragBound=this._onDrag.bind(this);_onDragEndBound=this._onDragEnd.bind(this);_lastDraggingCoordinates={x:0,y:0};constructor(...o){super(...o),this.on("render",()=>{this._attachListeners()}),this.set("isDragging",!1)}_attachListeners(){this.listenTo(this.element,"mousedown",this._onDragStart.bind(this)),this.listenTo(this.element,"touchstart",this._onDragStart.bind(this))}_attachDragListeners(){this.listenTo(S.document,"mouseup",this._onDragEndBound),this.listenTo(S.document,"touchend",this._onDragEndBound),this.listenTo(S.document,"mousemove",this._onDragBound),this.listenTo(S.document,"touchmove",this._onDragBound)}_detachDragListeners(){this.stopListening(S.document,"mouseup",this._onDragEndBound),this.stopListening(S.document,"touchend",this._onDragEndBound),this.stopListening(S.document,"mousemove",this._onDragBound),this.stopListening(S.document,"touchmove",this._onDragBound)}_onDragStart(o,n){if(!this._isHandleElementPressed(n))return;this._attachDragListeners();let s,r;n instanceof MouseEvent?(s=n.clientX,r=n.clientY):(s=n.touches[0].clientX,r=n.touches[0].clientY),this._lastDraggingCoordinates={x:s,y:r},this.isDragging=!0}_onDrag(o,n){if(!this.isDragging){this._detachDragListeners();return}let s,r;n instanceof MouseEvent?(s=n.clientX,r=n.clientY):(s=n.touches[0].clientX,r=n.touches[0].clientY),n.preventDefault(),this.fire("drag",{deltaX:Math.round(s-this._lastDraggingCoordinates.x),deltaY:Math.round(r-this._lastDraggingCoordinates.y)}),this._lastDraggingCoordinates={x:s,y:r}}_onDragEnd(){this._detachDragListeners(),this.isDragging=!1}_isHandleElementPressed(o){return this.dragHandleElement?this.dragHandleElement===o.target||o.target instanceof HTMLElement&&rt(this.dragHandleElement,o.target):!1}}return t}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function _i({view:e}){e.listenTo(e.element,"submit",(t,i)=>{i.preventDefault(),e.fire("submit")},{useCapture:!0})}/** +*/function ki({view:e}){e.listenTo(e.element,"submit",(t,i)=>{i.preventDefault(),e.fire("submit")},{useCapture:!0})}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Vl({keystrokeHandler:e,focusTracker:t,gridItems:i,numberOfColumns:o,uiLanguageDirection:n}){let s=typeof o=="number"?()=>o:o;e.set("arrowright",r((c,u)=>n==="rtl"?l(c,u.length):a(c,u.length))),e.set("arrowleft",r((c,u)=>n==="rtl"?a(c,u.length):l(c,u.length))),e.set("arrowup",r((c,u)=>{let d=c-s();return d<0&&(d=c+s()*Math.floor(u.length/s()),d>u.length-1&&(d-=s())),d})),e.set("arrowdown",r((c,u)=>{let d=c+s();return d>u.length-1&&(d=c%s()),d}));function r(c){return u=>{let d=i.find(f=>f.element===t.focusedElement),h=c(i.getIndex(d),i);i.get(h).focus(),u.stopPropagation(),u.preventDefault()}}function a(c,u){return c===u-1?0:c+1}function l(c,u){return c===0?u-1:c-1}}/** +*/function Ll({keystrokeHandler:e,focusTracker:t,gridItems:i,numberOfColumns:o,uiLanguageDirection:n}){let s=typeof o=="number"?()=>o:o;e.set("arrowright",r((c,u)=>n==="rtl"?l(c,u.length):a(c,u.length))),e.set("arrowleft",r((c,u)=>n==="rtl"?a(c,u.length):l(c,u.length))),e.set("arrowup",r((c,u)=>{let d=c-s();return d<0&&(d=c+s()*Math.floor(u.length/s()),d>u.length-1&&(d-=s())),d})),e.set("arrowdown",r((c,u)=>{let d=c+s();return d>u.length-1&&(d=c%s()),d}));function r(c){return u=>{let d=i.find(f=>f.element===t.focusedElement),h=c(i.getIndex(d),i);i.get(h).focus(),u.stopPropagation(),u.preventDefault()}}function a(c,u){return c===u-1?0:c+1}function l(c,u){return c===0?u-1:c-1}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */var ut=class extends R{id;constructor(e){super(e),this.set("text",void 0),this.set("for",void 0),this.id=`ck-editor__label_${ne()}`;let t=this.bindTemplate;this.setTemplate({tag:"label",attributes:{class:["ck","ck-label"],id:this.id,for:t.to("for")},children:[{text:t.to("text")}]})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var c9=class extends R{constructor(e,t){super(e);let i=e.t,o=new ut;o.text=i("Help Contents. To close this dialog press ESC."),this.setTemplate({tag:"div",attributes:{class:["ck","ck-accessibility-help-dialog__content"],"aria-labelledby":o.id,role:"document",tabindex:-1},children:[tt(document,"p",{},i("Below, you can find a list of keyboard shortcuts that can be used in the editor.")),...this._createCategories(Array.from(t.values())),o]})}focus(){this.element.focus()}_createCategories(e){return e.map(t=>{let i=[tt(document,"h3",{},t.label),...Array.from(t.groups.values()).map(o=>this._createGroup(o)).flat()];return t.description&&i.splice(1,0,tt(document,"p",{},t.description)),tt(document,"section",{},i)})}_createGroup(e){let t=e.keystrokes.sort((o,n)=>o.label.localeCompare(n.label)).map(o=>this._createGroupRow(o)).flat(),i=[tt(document,"dl",{},t)];return e.label&&i.unshift(tt(document,"h4",{},e.label)),i}_createGroupRow(e){let t=this.locale.t,i=tt(document,"dt"),o=tt(document,"dd"),n=d9(e.keystroke),s=[];for(let r of n)s.push(r.map(u9).join(""));return i.innerHTML=at(e.label),o.innerHTML=at(s.join(", ")+(e.mayRequireFn&&V.isMac?` ${t("(may require Fn)")}`:"")),[i,o]}};function u9(e){return Bs(e).split("+").map(t=>`${t}`).join("+")}function d9(e){return typeof e=="string"?[[e]]:typeof e[0]=="string"?[e]:e}/** +*/var d9=class extends R{constructor(e,t){super(e);let i=e.t,o=new ut;o.text=i("Help Contents. To close this dialog press ESC."),this.setTemplate({tag:"div",attributes:{class:["ck","ck-accessibility-help-dialog__content"],"aria-labelledby":o.id,role:"document",tabindex:-1},children:[tt(document,"p",{},i("Below, you can find a list of keyboard shortcuts that can be used in the editor.")),...this._createCategories(Array.from(t.values())),o]})}focus(){this.element.focus()}_createCategories(e){return e.map(t=>{let i=[tt(document,"h3",{},t.label),...Array.from(t.groups.values()).map(o=>this._createGroup(o)).flat()];return t.description&&i.splice(1,0,tt(document,"p",{},t.description)),tt(document,"section",{},i)})}_createGroup(e){let t=e.keystrokes.sort((o,n)=>o.label.localeCompare(n.label)).map(o=>this._createGroupRow(o)).flat(),i=[tt(document,"dl",{},t)];return e.label&&i.unshift(tt(document,"h4",{},e.label)),i}_createGroupRow(e){let t=this.locale.t,i=tt(document,"dt"),o=tt(document,"dd"),n=f9(e.keystroke),s=[];for(let r of n)s.push(r.map(h9).join(""));return i.innerHTML=at(e.label),o.innerHTML=at(s.join(", ")+(e.mayRequireFn&&V.isMac?` ${t("(may require Fn)")}`:"")),[i,o]}};function h9(e){return Bs(e).split("+").map(t=>`${t}`).join("+")}function f9(e){return typeof e=="string"?[[e]]:typeof e[0]=="string"?[e]:e}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Yt=class lw extends R{static presentationalAttributeNames=["alignment-baseline","baseline-shift","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-rendering","cursor","direction","display","dominant-baseline","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","mask","opacity","overflow","paint-order","pointer-events","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-overflow","text-rendering","transform","unicode-bidi","vector-effect","visibility","white-space","word-spacing","writing-mode"];constructor(){super();let t=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.set("isColorInherited",!0),this.set("isVisible",!0),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon",t.if("isVisible","ck-hidden",i=>!i),"ck-reset_all-excluded",t.if("isColorInherited","ck-icon_inherit-color")],viewBox:t.to("viewBox"),"aria-hidden":!0}})}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){let t=new DOMParser().parseFromString(at(this.content.trim()),"image/svg+xml").querySelector("svg");if(!t)throw new p("ui-iconview-invalid-svg",this);let i=t.getAttribute("viewBox");i&&(this.viewBox=i);for(let{name:o,value:n}of Array.from(t.attributes))lw.presentationalAttributeNames.includes(o)&&this.element.setAttribute(o,n);for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(;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})}};/** +*/var ei=class uw extends R{static presentationalAttributeNames=["alignment-baseline","baseline-shift","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-rendering","cursor","direction","display","dominant-baseline","fill","fill-opacity","fill-rule","filter","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","mask","opacity","overflow","paint-order","pointer-events","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-overflow","text-rendering","transform","unicode-bidi","vector-effect","visibility","white-space","word-spacing","writing-mode"];constructor(){super();let t=this.bindTemplate;this.set("content",""),this.set("viewBox","0 0 20 20"),this.set("fillColor",""),this.set("isColorInherited",!0),this.set("isVisible",!0),this.setTemplate({tag:"svg",ns:"http://www.w3.org/2000/svg",attributes:{class:["ck","ck-icon",t.if("isVisible","ck-hidden",i=>!i),"ck-reset_all-excluded",t.if("isColorInherited","ck-icon_inherit-color")],viewBox:t.to("viewBox"),"aria-hidden":!0}})}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){let t=new DOMParser().parseFromString(at(this.content.trim()),"image/svg+xml").querySelector("svg");if(!t)throw new p("ui-iconview-invalid-svg",this);let i=t.getAttribute("viewBox");i&&(this.viewBox=i);for(let{name:o,value:n}of Array.from(t.attributes))uw.presentationalAttributeNames.includes(o)&&this.element.setAttribute(o,n);for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);for(;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})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var cw=class extends R{constructor(){super(),this.set({style:void 0,text:void 0,id:void 0});let e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:e.to("style"),id:e.to("id")},children:[{text:e.to("text")}]})}};/** +*/var dw=class extends R{constructor(){super(),this.set({style:void 0,text:void 0,id:void 0});let e=this.bindTemplate;this.setTemplate({tag:"span",attributes:{class:["ck","ck-button__label"],style:e.to("style"),id:e.to("id")},children:[{text:e.to("text")}]})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var I=class extends R{children;labelView;iconView;keystrokeView;_focusDelayed=null;constructor(e,t=new cw){super(e);let i=this.bindTemplate,o=ne();this.set("_ariaPressed",!1),this.set("_ariaChecked",!1),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",`ck-editor__aria-label_${o}`),this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke",void 0),this.set("label",void 0),this.set("role",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.labelView=this._setupLabelView(t),this.iconView=new Yt,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.iconView.bind("content").to(this,"icon"),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this));let n={tag:"button",attributes:{class:["ck","ck-button",i.to("class"),i.if("isEnabled","ck-disabled",s=>!s),i.if("isVisible","ck-hidden",s=>!s),i.to("isOn",s=>s?"ck-on":"ck-off"),i.if("withText","ck-button_with-text"),i.if("withKeystroke","ck-button_with-keystroke")],role:i.to("role"),type:i.to("type",s=>s||"button"),tabindex:i.to("tabindex"),"aria-checked":i.to("_ariaChecked"),"aria-pressed":i.to("_ariaPressed"),"aria-label":i.to("ariaLabel"),"aria-labelledby":i.to("ariaLabelledBy"),"aria-disabled":i.if("isEnabled",!0,s=>!s),"data-cke-tooltip-text":i.to("_tooltipString"),"data-cke-tooltip-position":i.to("tooltipPosition")},children:this.children,on:{click:i.to(s=>{this.isEnabled?this.fire("execute"):s.preventDefault()})}};if(this.bind("_ariaPressed").to(this,"isOn",this,"isToggleable",this,"role",(s,r,a)=>!r||Hb(a)?!1:String(!!s)),this.bind("_ariaChecked").to(this,"isOn",this,"isToggleable",this,"role",(s,r,a)=>!r||!Hb(a)?!1:String(!!s)),V.isSafari){/* v8 ignore else -- @preserve */this._focusDelayed||(this._focusDelayed=Os(()=>this.focus(),0)),n.on.mousedown=i.to(()=>{this._focusDelayed()}),n.on.mouseup=i.to(()=>{this._focusDelayed.cancel()})}this.setTemplate(n)}render(){super.render(),this.icon&&this.children.add(this.iconView),this.on("change:icon",(e,t,i,o)=>{i&&!o?this.children.add(this.iconView,0):!i&&o&&this.children.remove(this.iconView)}),this.children.add(this.labelView),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}destroy(){this._focusDelayed&&this._focusDelayed.cancel(),super.destroy()}_setupLabelView(e){return e.bind("text","style","id").to(this,"label","labelStyle","ariaLabelledBy"),e}_createKeystrokeView(){let e=new R;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",t=>Bs(t))}]}),e}_getTooltipString(e,t,i){return e?typeof e=="string"?e:(i&&(i=Bs(i)),e instanceof Function?e(t,i):`${t}${i?` (${i})`:""}`):""}};function Hb(e){switch(e){case"radio":case"checkbox":case"option":case"switch":case"menuitemcheckbox":case"menuitemradio":return!0;default:return!1}}/** +*/var I=class extends R{children;labelView;iconView;keystrokeView;_focusDelayed=null;constructor(e,t=new dw){super(e);let i=this.bindTemplate,o=ne();this.set("_ariaPressed",!1),this.set("_ariaChecked",!1),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",`ck-editor__aria-label_${o}`),this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isVisible",!0),this.set("isToggleable",!1),this.set("keystroke",void 0),this.set("label",void 0),this.set("role",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.set("withKeystroke",!1),this.children=this.createCollection(),this.labelView=this._setupLabelView(t),this.iconView=new ei,this.iconView.extendTemplate({attributes:{class:"ck-button__icon"}}),this.iconView.bind("content").to(this,"icon"),this.keystrokeView=this._createKeystrokeView(),this.bind("_tooltipString").to(this,"tooltip",this,"label",this,"keystroke",this._getTooltipString.bind(this));let n={tag:"button",attributes:{class:["ck","ck-button",i.to("class"),i.if("isEnabled","ck-disabled",s=>!s),i.if("isVisible","ck-hidden",s=>!s),i.to("isOn",s=>s?"ck-on":"ck-off"),i.if("withText","ck-button_with-text"),i.if("withKeystroke","ck-button_with-keystroke")],role:i.to("role"),type:i.to("type",s=>s||"button"),tabindex:i.to("tabindex"),"aria-checked":i.to("_ariaChecked"),"aria-pressed":i.to("_ariaPressed"),"aria-label":i.to("ariaLabel"),"aria-labelledby":i.to("ariaLabelledBy"),"aria-disabled":i.if("isEnabled",!0,s=>!s),"data-cke-tooltip-text":i.to("_tooltipString"),"data-cke-tooltip-position":i.to("tooltipPosition")},children:this.children,on:{click:i.to(s=>{this.isEnabled?this.fire("execute"):s.preventDefault()})}};if(this.bind("_ariaPressed").to(this,"isOn",this,"isToggleable",this,"role",(s,r,a)=>!r||Ub(a)?!1:String(!!s)),this.bind("_ariaChecked").to(this,"isOn",this,"isToggleable",this,"role",(s,r,a)=>!r||!Ub(a)?!1:String(!!s)),V.isSafari){/* v8 ignore else -- @preserve */this._focusDelayed||(this._focusDelayed=Os(()=>this.focus(),0)),n.on.mousedown=i.to(()=>{this._focusDelayed()}),n.on.mouseup=i.to(()=>{this._focusDelayed.cancel()})}this.setTemplate(n)}render(){super.render(),this.icon&&this.children.add(this.iconView),this.on("change:icon",(e,t,i,o)=>{i&&!o?this.children.add(this.iconView,0):!i&&o&&this.children.remove(this.iconView)}),this.children.add(this.labelView),this.withKeystroke&&this.keystroke&&this.children.add(this.keystrokeView)}focus(){this.element.focus()}destroy(){this._focusDelayed&&this._focusDelayed.cancel(),super.destroy()}_setupLabelView(e){return e.bind("text","style","id").to(this,"label","labelStyle","ariaLabelledBy"),e}_createKeystrokeView(){let e=new R;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__keystroke"]},children:[{text:this.bindTemplate.to("keystroke",t=>Bs(t))}]}),e}_getTooltipString(e,t,i){return e?typeof e=="string"?e:(i&&(i=Bs(i)),e instanceof Function?e(t,i):`${t}${i?` (${i})`:""}`):""}};function Ub(e){switch(e){case"radio":case"checkbox":case"option":case"switch":case"menuitemcheckbox":case"menuitemradio":return!0;default:return!1}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Mt=class extends R{children;iconView;constructor(e,t={}){super(e);let i=this.bindTemplate;this.set("label",t.label||""),this.set("class",t.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",i.to("class")]},children:this.children}),t.icon&&(this.iconView=new Yt,this.iconView.content=t.icon,this.children.add(this.iconView));let o=new R(e);o.setTemplate({tag:"h2",attributes:{class:["ck","ck-form__header__label"],role:"presentation"},children:[{text:i.to("label")}]}),this.children.add(o)}};/** +*/var Bt=class extends R{children;iconView;constructor(e,t={}){super(e);let i=this.bindTemplate;this.set("label",t.label||""),this.set("class",t.class||null),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-form__header",i.to("class")]},children:this.children}),t.icon&&(this.iconView=new ei,this.iconView.content=t.icon,this.children.add(this.iconView));let o=new R(e);o.setTemplate({tag:"h2",attributes:{class:["ck","ck-form__header__label"],role:"presentation"},children:[{text:i.to("label")}]}),this.children.add(o)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var h9=q(),Ie=class extends h9{focusables;focusTracker;keystrokeHandler;actions;constructor(e){if(super(),this.focusables=e.focusables,this.focusTracker=e.focusTracker,this.keystrokeHandler=e.keystrokeHandler,this.actions=e.actions,e.actions&&e.keystrokeHandler)for(let t in e.actions){let i=e.actions[t];typeof i=="string"&&(i=[i]);for(let o of i)e.keystrokeHandler.set(o,(n,s)=>{this[t](),s()},e.keystrokeHandlerOptions)}this.on("forwardCycle",()=>this.focusFirst(),{priority:"low"}),this.on("backwardCycle",()=>this.focusLast(),{priority:"low"})}get first(){return this.focusables.find(eh)||null}get last(){return this.focusables.filter(eh).slice(-1)[0]||null}get next(){return this._getDomFocusableItem(1)}get previous(){return this._getDomFocusableItem(-1)}get current(){let e=null;return this.focusTracker.focusedElement===null?null:(this.focusables.find((t,i)=>{let o=t.element===this.focusTracker.focusedElement;return o&&(e=i),o}),e)}focusFirst(){this._focus(this.first,1)}focusLast(){this._focus(this.last,-1)}focusNext(){let e=this.next;if(e&&this.focusables.getIndex(e)===this.current){this.fire("forwardCycle");return}e===this.first?this.fire("forwardCycle"):this._focus(e,1)}focusPrevious(){let e=this.previous;if(e&&this.focusables.getIndex(e)===this.current){this.fire("backwardCycle");return}e===this.last?this.fire("backwardCycle"):this._focus(e,-1)}chain(e){let t=()=>this.current===null?null:this.focusables.get(this.current);this.listenTo(e,"forwardCycle",i=>{let o=t();this.focusNext(),o!==t()&&i.stop()},{priority:"low"}),this.listenTo(e,"backwardCycle",i=>{let o=t();this.focusPrevious(),o!==t()&&i.stop()},{priority:"low"})}unchain(e){this.stopListening(e)}_focus(e,t){e&&this.focusTracker.focusedElement!==e.element&&e.focus(t)}_getDomFocusableItem(e){let t=this.focusables.length;if(!t)return null;let i=this.current;if(i===null)return this[e===1?"first":"last"];let o=this.focusables.get(i),n=(i+t+e)%t;do{let s=this.focusables.get(n);if(eh(s)){o=s;break}n=(n+t+e)%t}while(n!==i);return o}};function eh(e){return pr(e)&&jt(e.element)}function pr(e){return"focus"in e&&typeof e.focus=="function"}function f9(e){return pr(e)&&"focusCycler"in e&&e.focusCycler instanceof Ie}/** +*/var m9=q(),Pe=class extends m9{focusables;focusTracker;keystrokeHandler;actions;constructor(e){if(super(),this.focusables=e.focusables,this.focusTracker=e.focusTracker,this.keystrokeHandler=e.keystrokeHandler,this.actions=e.actions,e.actions&&e.keystrokeHandler)for(let t in e.actions){let i=e.actions[t];typeof i=="string"&&(i=[i]);for(let o of i)e.keystrokeHandler.set(o,(n,s)=>{this[t](),s()},e.keystrokeHandlerOptions)}this.on("forwardCycle",()=>this.focusFirst(),{priority:"low"}),this.on("backwardCycle",()=>this.focusLast(),{priority:"low"})}get first(){return this.focusables.find(ih)||null}get last(){return this.focusables.filter(ih).slice(-1)[0]||null}get next(){return this._getDomFocusableItem(1)}get previous(){return this._getDomFocusableItem(-1)}get current(){let e=null;return this.focusTracker.focusedElement===null?null:(this.focusables.find((t,i)=>{let o=t.element===this.focusTracker.focusedElement;return o&&(e=i),o}),e)}focusFirst(){this._focus(this.first,1)}focusLast(){this._focus(this.last,-1)}focusNext(){let e=this.next;if(e&&this.focusables.getIndex(e)===this.current){this.fire("forwardCycle");return}e===this.first?this.fire("forwardCycle"):this._focus(e,1)}focusPrevious(){let e=this.previous;if(e&&this.focusables.getIndex(e)===this.current){this.fire("backwardCycle");return}e===this.last?this.fire("backwardCycle"):this._focus(e,-1)}chain(e){let t=()=>this.current===null?null:this.focusables.get(this.current);this.listenTo(e,"forwardCycle",i=>{let o=t();this.focusNext(),o!==t()&&i.stop()},{priority:"low"}),this.listenTo(e,"backwardCycle",i=>{let o=t();this.focusPrevious(),o!==t()&&i.stop()},{priority:"low"})}unchain(e){this.stopListening(e)}_focus(e,t){e&&this.focusTracker.focusedElement!==e.element&&e.focus(t)}_getDomFocusableItem(e){let t=this.focusables.length;if(!t)return null;let i=this.current;if(i===null)return this[e===1?"first":"last"];let o=this.focusables.get(i),n=(i+t+e)%t;do{let s=this.focusables.get(n);if(ih(s)){o=s;break}n=(n+t+e)%t}while(n!==i);return o}};function ih(e){return pr(e)&&Gt(e.element)}function pr(e){return"focus"in e&&typeof e.focus=="function"}function g9(e){return pr(e)&&"focusCycler"in e&&e.focusCycler instanceof Pe}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var m9=class extends R{children;keystrokes;focusCycler;_focusTracker;_focusables;constructor(e){super(e),this.children=this.createCollection(),this.keystrokes=new X,this._focusTracker=new Q,this._focusables=new be,this.focusCycler=new Ie({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__actions"]},children:this.children})}render(){super.render(),this.keystrokes.listenTo(this.element)}setButtons(e){for(let t of e){let i=new I(this.locale),o;i.on("execute",()=>t.onExecute()),t.onCreate&&t.onCreate(i);for(o in t)o!="onExecute"&&o!="onCreate"&&i.set(o,t[o]);i.extendTemplate({attributes:{class:"ck-button_standard"}}),this.children.add(i)}this._updateFocusCyclableItems()}focus(e){e===-1?this.focusCycler.focusLast():this.focusCycler.focusFirst()}_updateFocusCyclableItems(){Array.from(this.children).forEach(e=>{this._focusables.add(e),this._focusTracker.add(e.element)})}};/** +*/var p9=class extends R{children;keystrokes;focusCycler;_focusTracker;_focusables;constructor(e){super(e),this.children=this.createCollection(),this.keystrokes=new X,this._focusTracker=new Q,this._focusables=new we,this.focusCycler=new Pe({focusables:this._focusables,focusTracker:this._focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__actions"]},children:this.children})}render(){super.render(),this.keystrokes.listenTo(this.element)}setButtons(e){for(let t of e){let i=new I(this.locale),o;i.on("execute",()=>t.onExecute()),t.onCreate&&t.onCreate(i);for(o in t)o!="onExecute"&&o!="onCreate"&&i.set(o,t[o]);i.extendTemplate({attributes:{class:"ck-button_standard"}}),this.children.add(i)}this._updateFocusCyclableItems()}focus(e){e===-1?this.focusCycler.focusLast():this.focusCycler.focusFirst()}_updateFocusCyclableItems(){Array.from(this.children).forEach(e=>{this._focusables.add(e),this._focusTracker.add(e.element)})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var g9=class extends R{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__content"]},children:this.children})}reset(){for(;this.children.length;)this.children.remove(0)}};/** +*/var b9=class extends R{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog__content"]},children:this.children})}reset(){for(;this.children.length;)this.children.remove(0)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Lt={SCREEN_CENTER:"screen-center",EDITOR_CENTER:"editor-center",EDITOR_TOP_SIDE:"editor-top-side",EDITOR_TOP_CENTER:"editor-top-center",EDITOR_BOTTOM_CENTER:"editor-bottom-center",EDITOR_ABOVE_CENTER:"editor-above-center",EDITOR_BELOW_CENTER:"editor-below-center"},Wb=po("px"),p9=l9(R),b9=class uw extends p9{parts;headerView;closeButtonView;actionsView;static defaultOffset=15;contentView;keystrokes;focusTracker;wasMoved=!1;_getDomRootElement;_getViewportOffset;_focusables;_focusCycler;constructor(t,{getDomRootElement:i,getViewportOffset:o,keystrokeHandlerOptions:n}){super(t);let s=this.bindTemplate,r=t.t;this.set("className",""),this.set("ariaLabel",r("Editor dialog")),this.set("isModal",!1),this.set("position",Lt.SCREEN_CENTER),this.set("_isVisible",!1),this.set("_isTransparent",!1),this.set("_top",0),this.set("_left",0),this._getDomRootElement=i,this._getViewportOffset=o,this.decorate("moveTo"),this.parts=this.createCollection(),this.keystrokes=new X,this.focusTracker=new Q,this._focusables=new be,this._focusCycler=new Ie({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"},keystrokeHandlerOptions:n}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog-overlay",s.if("isModal","ck-dialog-overlay__transparent",a=>!a),s.if("_isVisible","ck-hidden",a=>!a)],tabindex:"-1"},children:[{tag:"div",attributes:{tabindex:"-1",class:["ck","ck-dialog",s.if("isModal","ck-dialog_modal"),s.to("className")],role:"dialog","aria-label":s.to("ariaLabel"),style:{top:s.to("_top",a=>Wb(a)),left:s.to("_left",a=>Wb(a)),visibility:s.if("_isTransparent","hidden")}},children:this.parts}]})}render(){super.render(),this.keystrokes.set("Esc",(t,i)=>{t.defaultPrevented||(this.fire("close",{source:"escKeyPress"}),i())}),this.on("drag",(t,{deltaX:i,deltaY:o})=>{this.wasMoved=!0,this.moveBy(i,o)}),this.listenTo(S.window,"resize",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.listenTo(S.document,"scroll",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.on("change:_isVisible",(t,i,o)=>{o&&(this._isTransparent=!0,setTimeout(()=>{this.updatePosition(),this._isTransparent=!1,this.focus()},10))}),this.keystrokes.listenTo(this.element)}get dragHandleElement(){return this.headerView&&!this.isModal?this.headerView.element:null}setupParts({icon:t,title:i,hasCloseButton:o=!0,content:n,actionButtons:s}){i&&(this.headerView=new Mt(this.locale,{icon:t}),o&&(this.closeButtonView=this._createCloseButton(),this.headerView.children.add(this.closeButtonView)),this.headerView.label=i,this.ariaLabel=i,this.parts.add(this.headerView,0)),n&&(n instanceof R&&(n=[n]),this.contentView=new g9(this.locale),this.contentView.children.addMany(n),this.parts.add(this.contentView)),s&&(this.actionsView=new m9(this.locale),this.actionsView.setButtons(s),this.parts.add(this.actionsView)),this._updateFocusCyclableItems()}focus(){this._focusCycler.focusFirst()}moveTo(t,i){let o=this._getViewportRect(),n=this._getDialogRect();t+n.width>o.right&&(t=o.right-n.width),t{this._focusables.add(i),this.focusTracker.add(i.element),f9(i)&&this._focusCycler.chain(i.focusCycler)})}_createCloseButton(){let t=new I(this.locale),i=this.locale.t;return t.set({label:i("Close"),tooltip:!0,icon:Od}),t.on("execute",()=>this.fire("close",{source:"closeButton"})),t}};/** +*/var Mt={SCREEN_CENTER:"screen-center",EDITOR_CENTER:"editor-center",EDITOR_TOP_SIDE:"editor-top-side",EDITOR_TOP_CENTER:"editor-top-center",EDITOR_BOTTOM_CENTER:"editor-bottom-center",EDITOR_ABOVE_CENTER:"editor-above-center",EDITOR_BELOW_CENTER:"editor-below-center"},qb=bo("px"),w9=u9(R),y9=class hw extends w9{parts;headerView;closeButtonView;actionsView;static defaultOffset=15;contentView;keystrokes;focusTracker;wasMoved=!1;_getDomRootElement;_getViewportOffset;_focusables;_focusCycler;constructor(t,{getDomRootElement:i,getViewportOffset:o,keystrokeHandlerOptions:n}){super(t);let s=this.bindTemplate,r=t.t;this.set("className",""),this.set("ariaLabel",r("Editor dialog")),this.set("isModal",!1),this.set("position",Mt.SCREEN_CENTER),this.set("_isVisible",!1),this.set("_isTransparent",!1),this.set("_top",0),this.set("_left",0),this._getDomRootElement=i,this._getViewportOffset=o,this.decorate("moveTo"),this.parts=this.createCollection(),this.keystrokes=new X,this.focusTracker=new Q,this._focusables=new we,this._focusCycler=new Pe({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"},keystrokeHandlerOptions:n}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-dialog-overlay",s.if("isModal","ck-dialog-overlay__transparent",a=>!a),s.if("_isVisible","ck-hidden",a=>!a)],tabindex:"-1"},children:[{tag:"div",attributes:{tabindex:"-1",class:["ck","ck-dialog",s.if("isModal","ck-dialog_modal"),s.to("className")],role:"dialog","aria-label":s.to("ariaLabel"),style:{top:s.to("_top",a=>qb(a)),left:s.to("_left",a=>qb(a)),visibility:s.if("_isTransparent","hidden")}},children:this.parts}]})}render(){super.render(),this.keystrokes.set("Esc",(t,i)=>{t.defaultPrevented||(this.fire("close",{source:"escKeyPress"}),i())}),this.on("drag",(t,{deltaX:i,deltaY:o})=>{this.wasMoved=!0,this.moveBy(i,o)}),this.listenTo(S.window,"resize",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.listenTo(S.document,"scroll",()=>{this._isVisible&&!this.wasMoved&&this.updatePosition()}),this.on("change:_isVisible",(t,i,o)=>{o&&(this._isTransparent=!0,setTimeout(()=>{this.updatePosition(),this._isTransparent=!1,this.focus()},10))}),this.keystrokes.listenTo(this.element)}get dragHandleElement(){return this.headerView&&!this.isModal?this.headerView.element:null}setupParts({icon:t,title:i,hasCloseButton:o=!0,content:n,actionButtons:s}){i&&(this.headerView=new Bt(this.locale,{icon:t}),o&&(this.closeButtonView=this._createCloseButton(),this.headerView.children.add(this.closeButtonView)),this.headerView.label=i,this.ariaLabel=i,this.parts.add(this.headerView,0)),n&&(n instanceof R&&(n=[n]),this.contentView=new b9(this.locale),this.contentView.children.addMany(n),this.parts.add(this.contentView)),s&&(this.actionsView=new p9(this.locale),this.actionsView.setButtons(s),this.parts.add(this.actionsView)),this._updateFocusCyclableItems()}focus(){this._focusCycler.focusFirst()}moveTo(t,i){let o=this._getViewportRect(),n=this._getDialogRect();t+n.width>o.right&&(t=o.right-n.width),t{this._focusables.add(i),this.focusTracker.add(i.element),g9(i)&&this._focusCycler.chain(i.focusCycler)})}_createCloseButton(){let t=new I(this.locale),i=this.locale.t;return t.set({label:i("Close"),tooltip:!0,icon:Fd}),t.on("execute",()=>this.fire("close",{source:"closeButton"})),t}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var w9=".ck-dialog-scroll-locked{overflow:hidden}",dw=class yi extends y{view;static _visibleDialogPlugin;_onHide;static get pluginName(){return"Dialog"}static get isOfficialPlugin(){return!0}constructor(t){super(t);let i=t.t;this._initShowHideListeners(),this._initFocusToggler(),this._initMultiRootIntegration(),this.set({id:null,isOpen:!1}),t.accessibility.addKeystrokeInfos({categoryId:"navigation",keystrokes:[{label:i("Move focus in and out of an active dialog window"),keystroke:"Ctrl+F6",mayRequireFn:!0}]})}destroy(){super.destroy(),yi._visibleDialogPlugin===this&&this._unlockBodyScroll()}_initShowHideListeners(){this.on("show",(t,i)=>{this._show(i)}),this.on("show",(t,i)=>{i.onShow&&i.onShow(this)},{priority:"low"}),this.on("hide",()=>{yi._visibleDialogPlugin&&yi._visibleDialogPlugin._hide()}),this.on("hide",()=>{this._onHide&&(this._onHide(this),this._onHide=void 0)},{priority:"low"})}_initFocusToggler(){let t=this.editor;t.keystrokes.set("Ctrl+F6",(i,o)=>{!this.isOpen||this.view.isModal||(this.view.focusTracker.isFocused?t.editing.view.focus():this.view.focus(),o())})}_initMultiRootIntegration(){let t=this.editor.model;t.document.on("change:data",()=>{if(!this.view)return;let i=t.document.differ.getChangedRoots();for(let o of i)o.state&&this.view.updatePosition()})}show(t){this.hide(),this.fire(`show:${t.id}`,t)}_show({id:t,icon:i,title:o,hasCloseButton:n=!0,content:s,actionButtons:r,className:a,isModal:l,position:c,onHide:u,getRootName:d,keystrokeHandlerOptions:h}){let f=this.editor;this.view=new b9(f.locale,{getDomRootElement:()=>{let g=d?.()??this.editor.model.document.selection.anchor.root.rootName;return!g||!f.editing.view.domRoots.has(g)?null:f.editing.view.getDomRoot(g)??null},getViewportOffset:()=>f.ui.viewportOffset,keystrokeHandlerOptions:h});let m=this.view;m.on("close",()=>{this.hide()}),f.ui.view.body.add(m),f.keystrokes.listenTo(m.element),c||(c=l?Lt.SCREEN_CENTER:Lt.EDITOR_CENTER),l&&this._lockBodyScroll(),m.set({position:c,_isVisible:!0,className:a,isModal:l}),m.setupParts({icon:i,title:o,hasCloseButton:n,content:s,actionButtons:r}),this.id=t,u&&(this._onHide=u),this.isOpen=!0,yi._visibleDialogPlugin=this}hide(){yi._visibleDialogPlugin&&yi._visibleDialogPlugin.fire(`hide:${yi._visibleDialogPlugin.id}`)}_hide(){if(!this.view)return;let t=this.editor,i=this.view;i.isModal&&this._unlockBodyScroll(),i.contentView&&i.contentView.reset(),t.ui.view.body.remove(i),t.ui.focusTracker.remove(i.element),t.keystrokes.stopListening(i.element),i.destroy(),t.editing.view.focus(),this.id=null,this.isOpen=!1,yi._visibleDialogPlugin=null}_lockBodyScroll(){tg(document,w9),document.documentElement.classList.add("ck-dialog-scroll-locked")}_unlockBodyScroll(){document.documentElement.classList.remove("ck-dialog-scroll-locked")}};/** +*/var _9=".ck-dialog-scroll-locked{overflow:hidden}",fw=class vi extends w{view;static _visibleDialogPlugin;_onHide;static get pluginName(){return"Dialog"}static get isOfficialPlugin(){return!0}constructor(t){super(t);let i=t.t;this._initShowHideListeners(),this._initFocusToggler(),this._initMultiRootIntegration(),this.set({id:null,isOpen:!1}),t.accessibility.addKeystrokeInfos({categoryId:"navigation",keystrokes:[{label:i("Move focus in and out of an active dialog window"),keystroke:"Ctrl+F6",mayRequireFn:!0}]})}destroy(){super.destroy(),vi._visibleDialogPlugin===this&&this._unlockBodyScroll()}_initShowHideListeners(){this.on("show",(t,i)=>{this._show(i)}),this.on("show",(t,i)=>{i.onShow&&i.onShow(this)},{priority:"low"}),this.on("hide",()=>{vi._visibleDialogPlugin&&vi._visibleDialogPlugin._hide()}),this.on("hide",()=>{this._onHide&&(this._onHide(this),this._onHide=void 0)},{priority:"low"})}_initFocusToggler(){let t=this.editor;t.keystrokes.set("Ctrl+F6",(i,o)=>{!this.isOpen||this.view.isModal||(this.view.focusTracker.isFocused?t.editing.view.focus():this.view.focus(),o())})}_initMultiRootIntegration(){let t=this.editor.model;t.document.on("change:data",()=>{if(!this.view)return;let i=t.document.differ.getChangedRoots();for(let o of i)o.state&&this.view.updatePosition()})}show(t){this.hide(),this.fire(`show:${t.id}`,t)}_show({id:t,icon:i,title:o,hasCloseButton:n=!0,content:s,actionButtons:r,className:a,isModal:l,position:c,onHide:u,getRootName:d,keystrokeHandlerOptions:h}){let f=this.editor;this.view=new y9(f.locale,{getDomRootElement:()=>{let g=d?.()??this.editor.model.document.selection.anchor.root.rootName;return!g||!f.editing.view.domRoots.has(g)?null:f.editing.view.getDomRoot(g)??null},getViewportOffset:()=>f.ui.viewportOffset,keystrokeHandlerOptions:h});let m=this.view;m.on("close",()=>{this.hide()}),f.ui.view.body.add(m),f.keystrokes.listenTo(m.element),c||(c=l?Mt.SCREEN_CENTER:Mt.EDITOR_CENTER),l&&this._lockBodyScroll(),m.set({position:c,_isVisible:!0,className:a,isModal:l}),m.setupParts({icon:i,title:o,hasCloseButton:n,content:s,actionButtons:r}),this.id=t,u&&(this._onHide=u),this.isOpen=!0,vi._visibleDialogPlugin=this}hide(){vi._visibleDialogPlugin&&vi._visibleDialogPlugin.fire(`hide:${vi._visibleDialogPlugin.id}`)}_hide(){if(!this.view)return;let t=this.editor,i=this.view;i.isModal&&this._unlockBodyScroll(),i.contentView&&i.contentView.reset(),t.ui.view.body.remove(i),t.ui.focusTracker.remove(i.element),t.keystrokes.stopListening(i.element),i.destroy(),t.editing.view.focus(),this.id=null,this.isOpen=!1,vi._visibleDialogPlugin=null}_lockBodyScroll(){og(document,_9),document.documentElement.classList.add("ck-dialog-scroll-locked")}_unlockBodyScroll(){document.documentElement.classList.remove("ck-dialog-scroll-locked")}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var ji=class extends I{_checkIconHolderView=new y9;constructor(e,t=new cw){super(e,t),this.set({hasCheckSpace:!1,_hasCheck:this.isToggleable});let i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-list-item-button",i.if("isToggleable","ck-list-item-button_toggleable")]}}),this.bind("_hasCheck").to(this,"hasCheckSpace",this,"isToggleable",(o,n)=>o||n)}render(){super.render(),this._hasCheck&&this.children.add(this._checkIconHolderView,0),this._watchCheckIconHolderMount()}_watchCheckIconHolderMount(){this._checkIconHolderView.bind("isOn").to(this,"isOn",e=>this.isToggleable&&e),this.on("change:_hasCheck",(e,t,i)=>{let{children:o,_checkIconHolderView:n}=this;i?o.add(n,0):o.remove(n)})}},y9=class extends R{children;_checkIconView=this._createCheckIconView();constructor(){super();let e=this.bindTemplate;this.children=this.createCollection(),this.set("isOn",!1),this.setTemplate({tag:"span",children:this.children,attributes:{class:["ck","ck-list-item-button__check-holder",e.to("isOn",t=>t?"ck-on":"ck-off")]}})}render(){super.render(),this.isOn&&this.children.add(this._checkIconView,0),this._watchCheckIconMount()}_watchCheckIconMount(){this.on("change:isOn",(e,t,i)=>{let{children:o,_checkIconView:n}=this;i&&!o.has(n)?o.add(n):!i&&o.has(n)&&o.remove(n)})}_createCheckIconView(){let e=new Yt;return e.content=Fd,e.extendTemplate({attributes:{class:"ck-list-item-button__check-icon"}}),e}};/** +*/var Gi=class extends I{_checkIconHolderView=new v9;constructor(e,t=new dw){super(e,t),this.set({hasCheckSpace:!1,_hasCheck:this.isToggleable});let i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-list-item-button",i.if("isToggleable","ck-list-item-button_toggleable")]}}),this.bind("_hasCheck").to(this,"hasCheckSpace",this,"isToggleable",(o,n)=>o||n)}render(){super.render(),this._hasCheck&&this.children.add(this._checkIconHolderView,0),this._watchCheckIconHolderMount()}_watchCheckIconHolderMount(){this._checkIconHolderView.bind("isOn").to(this,"isOn",e=>this.isToggleable&&e),this.on("change:_hasCheck",(e,t,i)=>{let{children:o,_checkIconHolderView:n}=this;i?o.add(n,0):o.remove(n)})}},v9=class extends R{children;_checkIconView=this._createCheckIconView();constructor(){super();let e=this.bindTemplate;this.children=this.createCollection(),this.set("isOn",!1),this.setTemplate({tag:"span",children:this.children,attributes:{class:["ck","ck-list-item-button__check-holder",e.to("isOn",t=>t?"ck-on":"ck-off")]}})}render(){super.render(),this.isOn&&this.children.add(this._checkIconView,0),this._watchCheckIconMount()}_watchCheckIconMount(){this.on("change:isOn",(e,t,i)=>{let{children:o,_checkIconView:n}=this;i&&!o.has(n)?o.add(n):!i&&o.has(n)&&o.remove(n)})}_createCheckIconView(){let e=new ei;return e.content=zd,e.extendTemplate({attributes:{class:"ck-list-item-button__check-icon"}}),e}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var oe=class extends ji{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}};/** +*/var oe=class extends Gi{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var hw=class extends y{contentView=null;static get requires(){return[dw]}static get pluginName(){return"AccessibilityHelp"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.locale.t;e.ui.componentFactory.add("accessibilityHelp",()=>{let i=this._createButton(I);return i.set({tooltip:!0,withText:!1,label:t("Accessibility help")}),i}),e.ui.componentFactory.add("menuBar:accessibilityHelp",()=>{let i=this._createButton(oe);return i.label=t("Accessibility"),i}),e.keystrokes.set("Alt+0",(i,o)=>{this._toggleDialog(),o()}),this._setupRootLabels()}_createButton(e){let t=this.editor,i=t.plugins.get("Dialog"),o=t.locale,n=new e(o);return n.set({keystroke:"Alt+0",icon:A1,isToggleable:!0}),n.on("execute",()=>this._toggleDialog()),n.bind("isOn").to(i,"id",s=>s==="accessibilityHelp"),n}_setupRootLabels(){let e=this.editor,t=e.editing.view,i=e.t;e.ui.on("ready",()=>{t.change(n=>{for(let s of t.document.roots)o(n,s)}),e.on("addRoot",(n,s)=>{let r=e.editing.view.document.getRoot(s.rootName);t.change(a=>o(a,r))},{priority:"low"})});function o(n,s){let r=[s.getAttribute("aria-label"),i("Press %0 for help.",[Bs("Alt+0")])].filter(a=>a).join(". ");n.setAttribute("aria-label",r,s)}}_toggleDialog(){let e=this.editor,t=e.plugins.get("Dialog"),i=e.locale.t;this.contentView||(this.contentView=new c9(e.locale,e.accessibility.keystrokeInfos)),t.id==="accessibilityHelp"?t.hide():t.show({id:"accessibilityHelp",className:"ck-accessibility-help-dialog",title:i("Accessibility help"),hasCloseButton:!0,content:this.contentView})}};/** +*/var mw=class extends w{contentView=null;static get requires(){return[fw]}static get pluginName(){return"AccessibilityHelp"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.locale.t;e.ui.componentFactory.add("accessibilityHelp",()=>{let i=this._createButton(I);return i.set({tooltip:!0,withText:!1,label:t("Accessibility help")}),i}),e.ui.componentFactory.add("menuBar:accessibilityHelp",()=>{let i=this._createButton(oe);return i.label=t("Accessibility"),i}),e.keystrokes.set("Alt+0",(i,o)=>{this._toggleDialog(),o()}),this._setupRootLabels()}_createButton(e){let t=this.editor,i=t.plugins.get("Dialog"),o=t.locale,n=new e(o);return n.set({keystroke:"Alt+0",icon:S1,isToggleable:!0}),n.on("execute",()=>this._toggleDialog()),n.bind("isOn").to(i,"id",s=>s==="accessibilityHelp"),n}_setupRootLabels(){let e=this.editor,t=e.editing.view,i=e.t;e.ui.on("ready",()=>{t.change(n=>{for(let s of t.document.roots)o(n,s)}),e.on("addRoot",(n,s)=>{let r=e.editing.view.document.getRoot(s.rootName);t.change(a=>o(a,r))},{priority:"low"})});function o(n,s){let r=[s.getAttribute("aria-label"),i("Press %0 for help.",[Bs("Alt+0")])].filter(a=>a).join(". ");n.setAttribute("aria-label",r,s)}}_toggleDialog(){let e=this.editor,t=e.plugins.get("Dialog"),i=e.locale.t;this.contentView||(this.contentView=new d9(e.locale,e.accessibility.keystrokeInfos)),t.id==="accessibilityHelp"?t.hide():t.show({id:"accessibilityHelp",className:"ck-accessibility-help-dialog",title:i("Accessibility help"),hasCloseButton:!0,content:this.contentView})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var fw=class $i extends be{locale;_bodyCollectionContainer;_mountTarget;static _bodyWrappers=new Map;constructor(t,i=[]){super(i),this.locale=t}get bodyCollectionContainer(){return this._bodyCollectionContainer||(this._bodyCollectionContainer=new _t({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection,role:"application"},children:this}).render()),this._bodyCollectionContainer}get mountTarget(){return this._mountTarget}attachToDom(t){let i=t||document.body,o=this._mountTarget;$i._getBodyWrapper(i).appendChild(this.bodyCollectionContainer),this._mountTarget=i,o&&o!==i&&$i._removeBodyWrapperIfEmpty(o),o!==i&&this.fire("remount")}syncMountTarget(t){t?this._mountTarget!==t&&this.attachToDom(t):this._mountTarget&&this.unmountFromDom()}destroy(){super.destroy(),this._removeFromDom()}unmountFromDom(){this._removeFromDom()}_removeFromDom(){let t=!!this._mountTarget;this._bodyCollectionContainer&&this._bodyCollectionContainer.remove(),$i._removeBodyWrapperIfEmpty(this._mountTarget),this._mountTarget=void 0,t&&this.fire("remount")}static _getBodyWrapper(t){let i=$i._bodyWrappers.get(t);return(!i||!t.contains(i))&&(i=tt(t.ownerDocument,"div",{class:"ck-body-wrapper"}),t.appendChild(i),$i._bodyWrappers.set(t,i)),i}static _removeBodyWrapperIfEmpty(t){if(!t)return;let i=$i._bodyWrappers.get(t);i&&!i.childElementCount&&(i.remove(),$i._bodyWrappers.delete(t))}};/** +*/var gw=class Ki extends we{locale;_bodyCollectionContainer;_mountTarget;static _bodyWrappers=new Map;constructor(t,i=[]){super(i),this.locale=t}get bodyCollectionContainer(){return this._bodyCollectionContainer||(this._bodyCollectionContainer=new vt({tag:"div",attributes:{class:["ck","ck-reset_all","ck-body","ck-rounded-corners"],dir:this.locale.uiLanguageDirection,role:"application"},children:this}).render()),this._bodyCollectionContainer}get mountTarget(){return this._mountTarget}attachToDom(t){let i=t||document.body,o=this._mountTarget;Ki._getBodyWrapper(i).appendChild(this.bodyCollectionContainer),this._mountTarget=i,o&&o!==i&&Ki._removeBodyWrapperIfEmpty(o),o!==i&&this.fire("remount")}syncMountTarget(t){t?this._mountTarget!==t&&this.attachToDom(t):this._mountTarget&&this.unmountFromDom()}destroy(){super.destroy(),this._removeFromDom()}unmountFromDom(){this._removeFromDom()}_removeFromDom(){let t=!!this._mountTarget;this._bodyCollectionContainer&&this._bodyCollectionContainer.remove(),Ki._removeBodyWrapperIfEmpty(this._mountTarget),this._mountTarget=void 0,t&&this.fire("remount")}static _getBodyWrapper(t){let i=Ki._bodyWrappers.get(t);return(!i||!t.contains(i))&&(i=tt(t.ownerDocument,"div",{class:"ck-body-wrapper"}),t.appendChild(i),Ki._bodyWrappers.set(t,i)),i}static _removeBodyWrapperIfEmpty(t){if(!t)return;let i=Ki._bodyWrappers.get(t);i&&!i.childElementCount&&(i.remove(),Ki._bodyWrappers.delete(t))}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Ub=po("px"),_9={top:-99999,left:-99999,name:"arrowless",config:{withArrow:!1}},Me=class Ao extends R{content;_pinWhenIsVisibleCallback;_resizeObserver;_scrollListenerDomRoots=[];constructor(t){super(t);let i=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",void 0),this._pinWhenIsVisibleCallback=null,this._resizeObserver=null,this.content=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-balloon-panel",i.to("position",o=>`ck-balloon-panel_${o}`),i.if("isVisible","ck-balloon-panel_visible"),i.if("withArrow","ck-balloon-panel_with-arrow"),i.to("class")],style:{top:i.to("top",Ub),left:i.to("left",Ub)}},children:this.content})}destroy(){this.hide(),super.destroy()}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(t){let i=Sl(t.target);if(i&&!jt(i))return!1;this.show();let o=Ao.defaultPositions,n=Object.assign({},{element:this.element,positions:[o.southArrowNorth,o.southArrowNorthMiddleWest,o.southArrowNorthMiddleEast,o.southArrowNorthWest,o.southArrowNorthEast,o.northArrowSouth,o.northArrowSouthMiddleWest,o.northArrowSouthMiddleEast,o.northArrowSouthWest,o.northArrowSouthEast,o.viewportStickyNorth],limiter:S.document.body,fitInViewport:!0},t),s=Ao._getOptimalPosition(n)||_9,r=parseInt(s.left),a=parseInt(s.top),l=s.name,{withArrow:c=!0}=s.config||{};return this.top=a,this.left=r,this.position=l,this.withArrow=c,!0}pin(t){this.unpin(),this._startPinning(t)&&(this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(t):this._stopPinning()},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){if(!this.attachTo(t))return!1;let i=Sl(t.target),o=t.limiter?Sl(t.limiter):S.document.body;this._scrollListenerDomRoots=v9([i,o]);for(let n of this._scrollListenerDomRoots)this.listenTo(n,"scroll",(s,r)=>{let a=r.target,l=i&&rt(a,i),c=o&&rt(a,o);(l||c||!i||!o)&&this.attachTo(t)},{useCapture:!0});if(this.listenTo(S.window,"resize",()=>{this.attachTo(t)}),!this._resizeObserver&&(i&&Y(i)&&(i=Fe(i)),i)){let n=()=>{jt(i)||this.unpin()};this._resizeObserver=new Ms(i,n)}return!0}_stopPinning(){for(let t of this._scrollListenerDomRoots)this.stopListening(t,"scroll");this._scrollListenerDomRoots=[],this.stopListening(S.window,"resize"),this._resizeObserver&&(this._resizeObserver.destroy(),this._resizeObserver=null)}static generatePositions(t={}){let{sideOffset:i=Ao.arrowSideOffset,heightOffset:o=Ao.arrowHeightOffset,stickyVerticalOffset:n=Ao.stickyVerticalOffset,config:s}=t;return{northWestArrowSouthWest:(l,c)=>({top:r(l,c),left:l.left-i,name:"arrow_sw",...s&&{config:s}}),northWestArrowSouthMiddleWest:(l,c)=>({top:r(l,c),left:l.left-c.width*.25-i,name:"arrow_smw",...s&&{config:s}}),northWestArrowSouth:(l,c)=>({top:r(l,c),left:l.left-c.width/2,name:"arrow_s",...s&&{config:s}}),northWestArrowSouthMiddleEast:(l,c)=>({top:r(l,c),left:l.left-c.width*.75+i,name:"arrow_sme",...s&&{config:s}}),northWestArrowSouthEast:(l,c)=>({top:r(l,c),left:l.left-c.width+i,name:"arrow_se",...s&&{config:s}}),northArrowSouthWest:(l,c)=>({top:r(l,c),left:l.left+l.width/2-i,name:"arrow_sw",...s&&{config:s}}),northArrowSouthMiddleWest:(l,c)=>({top:r(l,c),left:l.left+l.width/2-c.width*.25-i,name:"arrow_smw",...s&&{config:s}}),northArrowSouth:(l,c)=>({top:r(l,c),left:l.left+l.width/2-c.width/2,name:"arrow_s",...s&&{config:s}}),northArrowSouthMiddleEast:(l,c)=>({top:r(l,c),left:l.left+l.width/2-c.width*.75+i,name:"arrow_sme",...s&&{config:s}}),northArrowSouthEast:(l,c)=>({top:r(l,c),left:l.left+l.width/2-c.width+i,name:"arrow_se",...s&&{config:s}}),northEastArrowSouthWest:(l,c)=>({top:r(l,c),left:l.right-i,name:"arrow_sw",...s&&{config:s}}),northEastArrowSouthMiddleWest:(l,c)=>({top:r(l,c),left:l.right-c.width*.25-i,name:"arrow_smw",...s&&{config:s}}),northEastArrowSouth:(l,c)=>({top:r(l,c),left:l.right-c.width/2,name:"arrow_s",...s&&{config:s}}),northEastArrowSouthMiddleEast:(l,c)=>({top:r(l,c),left:l.right-c.width*.75+i,name:"arrow_sme",...s&&{config:s}}),northEastArrowSouthEast:(l,c)=>({top:r(l,c),left:l.right-c.width+i,name:"arrow_se",...s&&{config:s}}),southWestArrowNorthWest:l=>({top:a(l),left:l.left-i,name:"arrow_nw",...s&&{config:s}}),southWestArrowNorthMiddleWest:(l,c)=>({top:a(l),left:l.left-c.width*.25-i,name:"arrow_nmw",...s&&{config:s}}),southWestArrowNorth:(l,c)=>({top:a(l),left:l.left-c.width/2,name:"arrow_n",...s&&{config:s}}),southWestArrowNorthMiddleEast:(l,c)=>({top:a(l),left:l.left-c.width*.75+i,name:"arrow_nme",...s&&{config:s}}),southWestArrowNorthEast:(l,c)=>({top:a(l),left:l.left-c.width+i,name:"arrow_ne",...s&&{config:s}}),southArrowNorthWest:l=>({top:a(l),left:l.left+l.width/2-i,name:"arrow_nw",...s&&{config:s}}),southArrowNorthMiddleWest:(l,c)=>({top:a(l),left:l.left+l.width/2-c.width*.25-i,name:"arrow_nmw",...s&&{config:s}}),southArrowNorth:(l,c)=>({top:a(l),left:l.left+l.width/2-c.width/2,name:"arrow_n",...s&&{config:s}}),southArrowNorthMiddleEast:(l,c)=>({top:a(l),left:l.left+l.width/2-c.width*.75+i,name:"arrow_nme",...s&&{config:s}}),southArrowNorthEast:(l,c)=>({top:a(l),left:l.left+l.width/2-c.width+i,name:"arrow_ne",...s&&{config:s}}),southEastArrowNorthWest:l=>({top:a(l),left:l.right-i,name:"arrow_nw",...s&&{config:s}}),southEastArrowNorthMiddleWest:(l,c)=>({top:a(l),left:l.right-c.width*.25-i,name:"arrow_nmw",...s&&{config:s}}),southEastArrowNorth:(l,c)=>({top:a(l),left:l.right-c.width/2,name:"arrow_n",...s&&{config:s}}),southEastArrowNorthMiddleEast:(l,c)=>({top:a(l),left:l.right-c.width*.75+i,name:"arrow_nme",...s&&{config:s}}),southEastArrowNorthEast:(l,c)=>({top:a(l),left:l.right-c.width+i,name:"arrow_ne",...s&&{config:s}}),westArrowEast:(l,c)=>({top:l.top+l.height/2-c.height/2,left:l.left-c.width-o,name:"arrow_e",...s&&{config:s}}),eastArrowWest:(l,c)=>({top:l.top+l.height/2-c.height/2,left:l.right+o,name:"arrow_w",...s&&{config:s}}),viewportStickyNorth:(l,c,u)=>{let d=new F(S.document.body).getIntersection(u.getVisible());if(!d)return null;let h=d.getVisible();return!l.getIntersection(h)||!(h.top-l.top-n`ck-balloon-panel_${o}`),i.if("isVisible","ck-balloon-panel_visible"),i.if("withArrow","ck-balloon-panel_with-arrow"),i.to("class")],style:{top:i.to("top",$b),left:i.to("left",$b)}},children:this.content})}destroy(){this.hide(),super.destroy()}show(){this.isVisible=!0}hide(){this.isVisible=!1}attachTo(t){let i=Pl(t.target);if(i&&!Gt(i))return!1;this.show();let o=Io.defaultPositions,n=Object.assign({},{element:this.element,positions:[o.southArrowNorth,o.southArrowNorthMiddleWest,o.southArrowNorthMiddleEast,o.southArrowNorthWest,o.southArrowNorthEast,o.northArrowSouth,o.northArrowSouthMiddleWest,o.northArrowSouthMiddleEast,o.northArrowSouthWest,o.northArrowSouthEast,o.viewportStickyNorth],limiter:S.document.body,fitInViewport:!0},t),s=Io._getOptimalPosition(n)||k9,r=parseInt(s.left),a=parseInt(s.top),l=s.name,{withArrow:c=!0}=s.config||{};return this.top=a,this.left=r,this.position=l,this.withArrow=c,!0}pin(t){this.unpin(),this._startPinning(t)&&(this._pinWhenIsVisibleCallback=()=>{this.isVisible?this._startPinning(t):this._stopPinning()},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){if(!this.attachTo(t))return!1;let i=Pl(t.target),o=t.limiter?Pl(t.limiter):S.document.body;this._scrollListenerDomRoots=C9([i,o]);for(let n of this._scrollListenerDomRoots)this.listenTo(n,"scroll",(s,r)=>{let a=r.target,l=i&&rt(a,i),c=o&&rt(a,o);(l||c||!i||!o)&&this.attachTo(t)},{useCapture:!0});if(this.listenTo(S.window,"resize",()=>{this.attachTo(t)}),!this._resizeObserver&&(i&&Y(i)&&(i=Fe(i)),i)){let n=()=>{Gt(i)||this.unpin()};this._resizeObserver=new Ms(i,n)}return!0}_stopPinning(){for(let t of this._scrollListenerDomRoots)this.stopListening(t,"scroll");this._scrollListenerDomRoots=[],this.stopListening(S.window,"resize"),this._resizeObserver&&(this._resizeObserver.destroy(),this._resizeObserver=null)}static generatePositions(t={}){let{sideOffset:i=Io.arrowSideOffset,heightOffset:o=Io.arrowHeightOffset,stickyVerticalOffset:n=Io.stickyVerticalOffset,config:s}=t;return{northWestArrowSouthWest:(l,c)=>({top:r(l,c),left:l.left-i,name:"arrow_sw",...s&&{config:s}}),northWestArrowSouthMiddleWest:(l,c)=>({top:r(l,c),left:l.left-c.width*.25-i,name:"arrow_smw",...s&&{config:s}}),northWestArrowSouth:(l,c)=>({top:r(l,c),left:l.left-c.width/2,name:"arrow_s",...s&&{config:s}}),northWestArrowSouthMiddleEast:(l,c)=>({top:r(l,c),left:l.left-c.width*.75+i,name:"arrow_sme",...s&&{config:s}}),northWestArrowSouthEast:(l,c)=>({top:r(l,c),left:l.left-c.width+i,name:"arrow_se",...s&&{config:s}}),northArrowSouthWest:(l,c)=>({top:r(l,c),left:l.left+l.width/2-i,name:"arrow_sw",...s&&{config:s}}),northArrowSouthMiddleWest:(l,c)=>({top:r(l,c),left:l.left+l.width/2-c.width*.25-i,name:"arrow_smw",...s&&{config:s}}),northArrowSouth:(l,c)=>({top:r(l,c),left:l.left+l.width/2-c.width/2,name:"arrow_s",...s&&{config:s}}),northArrowSouthMiddleEast:(l,c)=>({top:r(l,c),left:l.left+l.width/2-c.width*.75+i,name:"arrow_sme",...s&&{config:s}}),northArrowSouthEast:(l,c)=>({top:r(l,c),left:l.left+l.width/2-c.width+i,name:"arrow_se",...s&&{config:s}}),northEastArrowSouthWest:(l,c)=>({top:r(l,c),left:l.right-i,name:"arrow_sw",...s&&{config:s}}),northEastArrowSouthMiddleWest:(l,c)=>({top:r(l,c),left:l.right-c.width*.25-i,name:"arrow_smw",...s&&{config:s}}),northEastArrowSouth:(l,c)=>({top:r(l,c),left:l.right-c.width/2,name:"arrow_s",...s&&{config:s}}),northEastArrowSouthMiddleEast:(l,c)=>({top:r(l,c),left:l.right-c.width*.75+i,name:"arrow_sme",...s&&{config:s}}),northEastArrowSouthEast:(l,c)=>({top:r(l,c),left:l.right-c.width+i,name:"arrow_se",...s&&{config:s}}),southWestArrowNorthWest:l=>({top:a(l),left:l.left-i,name:"arrow_nw",...s&&{config:s}}),southWestArrowNorthMiddleWest:(l,c)=>({top:a(l),left:l.left-c.width*.25-i,name:"arrow_nmw",...s&&{config:s}}),southWestArrowNorth:(l,c)=>({top:a(l),left:l.left-c.width/2,name:"arrow_n",...s&&{config:s}}),southWestArrowNorthMiddleEast:(l,c)=>({top:a(l),left:l.left-c.width*.75+i,name:"arrow_nme",...s&&{config:s}}),southWestArrowNorthEast:(l,c)=>({top:a(l),left:l.left-c.width+i,name:"arrow_ne",...s&&{config:s}}),southArrowNorthWest:l=>({top:a(l),left:l.left+l.width/2-i,name:"arrow_nw",...s&&{config:s}}),southArrowNorthMiddleWest:(l,c)=>({top:a(l),left:l.left+l.width/2-c.width*.25-i,name:"arrow_nmw",...s&&{config:s}}),southArrowNorth:(l,c)=>({top:a(l),left:l.left+l.width/2-c.width/2,name:"arrow_n",...s&&{config:s}}),southArrowNorthMiddleEast:(l,c)=>({top:a(l),left:l.left+l.width/2-c.width*.75+i,name:"arrow_nme",...s&&{config:s}}),southArrowNorthEast:(l,c)=>({top:a(l),left:l.left+l.width/2-c.width+i,name:"arrow_ne",...s&&{config:s}}),southEastArrowNorthWest:l=>({top:a(l),left:l.right-i,name:"arrow_nw",...s&&{config:s}}),southEastArrowNorthMiddleWest:(l,c)=>({top:a(l),left:l.right-c.width*.25-i,name:"arrow_nmw",...s&&{config:s}}),southEastArrowNorth:(l,c)=>({top:a(l),left:l.right-c.width/2,name:"arrow_n",...s&&{config:s}}),southEastArrowNorthMiddleEast:(l,c)=>({top:a(l),left:l.right-c.width*.75+i,name:"arrow_nme",...s&&{config:s}}),southEastArrowNorthEast:(l,c)=>({top:a(l),left:l.right-c.width+i,name:"arrow_ne",...s&&{config:s}}),westArrowEast:(l,c)=>({top:l.top+l.height/2-c.height/2,left:l.left-c.width-o,name:"arrow_e",...s&&{config:s}}),eastArrowWest:(l,c)=>({top:l.top+l.height/2-c.height/2,left:l.right+o,name:"arrow_w",...s&&{config:s}}),viewportStickyNorth:(l,c,u)=>{let d=new F(S.document.body).getIntersection(u.getVisible());if(!d)return null;let h=d.getVisible();return!l.getIntersection(h)||!(h.top-l.top-nthis._showBalloon(),50,{leading:!0});_lastFocusedEditableElement=null;_balloonClass;constructor(e,t={}){super(),this.editor=e,this._balloonClass=t.balloonClass,e.on("ready",()=>this._handleEditorReady())}destroy(){let e=this._balloonView;e&&(e.unpin(),this._balloonView=null),this._showBalloonThrottled.cancel(),this.stopListening()}_handleEditorReady(){let e=this.editor;this._isEnabled()&&e.ui.view&&(e.ui.focusTracker.on("change:isFocused",(t,i,o)=>{this._updateLastFocusedEditableElement(),o?this._showBalloon():this._hideBalloon()}),e.ui.focusTracker.on("change:focusedElement",(t,i,o)=>{this._updateLastFocusedEditableElement(),o&&this._showBalloon()}),e.ui.on("update",()=>{this._showBalloonThrottled()}))}_getNormalizedConfig(){return{side:this.editor.locale.contentLanguageDirection==="ltr"?"right":"left",position:"border",verticalOffset:0,horizontalOffset:5}}_showBalloon(){let e=this._getBalloonAttachOptions();e&&(this._balloonView||(this._balloonView=this._createBalloonView()),this._balloonView.pin(e))}_hideBalloon(){this._balloonView&&this._balloonView.unpin()}_createBalloonView(){let e=this.editor,t=new Me,i=this._createBadgeContent();return t.content.add(i),this._balloonClass&&(t.class=this._balloonClass),e.ui.view.body.add(t),t}_getBalloonAttachOptions(){if(!this._lastFocusedEditableElement)return null;let e=this._getNormalizedConfig(),t=e.side==="right"?T9(this._lastFocusedEditableElement,e):E9(this._lastFocusedEditableElement,e);return{target:this._lastFocusedEditableElement,positions:[t]}}_updateLastFocusedEditableElement(){let e=this.editor,t=e.ui.focusTracker.isFocused,i=e.ui.focusTracker.focusedElement;if(!t||!i){this._lastFocusedEditableElement=null;return}let o=Array.from(e.ui.getEditableElementsNames()).map(n=>e.ui.getEditableElement(n));o.includes(i)?this._lastFocusedEditableElement=i:this._lastFocusedEditableElement=o[0]}};function T9(e,t){return gw(e,t,(i,o)=>i.left+i.width-o.width-t.horizontalOffset)}function E9(e,t){return gw(e,t,i=>i.left+t.horizontalOffset)}function gw(e,t,i){return(o,n)=>{let s=new F(e);if(s.widththis._showBalloon(),50,{leading:!0});_lastFocusedEditableElement=null;_balloonClass;constructor(e,t={}){super(),this.editor=e,this._balloonClass=t.balloonClass,e.on("ready",()=>this._handleEditorReady())}destroy(){let e=this._balloonView;e&&(e.unpin(),this._balloonView=null),this._showBalloonThrottled.cancel(),this.stopListening()}_handleEditorReady(){let e=this.editor;this._isEnabled()&&e.ui.view&&(e.ui.focusTracker.on("change:isFocused",(t,i,o)=>{this._updateLastFocusedEditableElement(),o?this._showBalloon():this._hideBalloon()}),e.ui.focusTracker.on("change:focusedElement",(t,i,o)=>{this._updateLastFocusedEditableElement(),o&&this._showBalloon()}),e.ui.on("update",()=>{this._showBalloonThrottled()}))}_getNormalizedConfig(){return{side:this.editor.locale.contentLanguageDirection==="ltr"?"right":"left",position:"border",verticalOffset:0,horizontalOffset:5}}_showBalloon(){let e=this._getBalloonAttachOptions();e&&(this._balloonView||(this._balloonView=this._createBalloonView()),this._balloonView.pin(e))}_hideBalloon(){this._balloonView&&this._balloonView.unpin()}_createBalloonView(){let e=this.editor,t=new Me,i=this._createBadgeContent();return t.content.add(i),this._balloonClass&&(t.class=this._balloonClass),e.ui.view.body.add(t),t}_getBalloonAttachOptions(){if(!this._lastFocusedEditableElement)return null;let e=this._getNormalizedConfig(),t=e.side==="right"?A9(this._lastFocusedEditableElement,e):I9(this._lastFocusedEditableElement,e);return{target:this._lastFocusedEditableElement,positions:[t]}}_updateLastFocusedEditableElement(){let e=this.editor,t=e.ui.focusTracker.isFocused,i=e.ui.focusTracker.focusedElement;if(!t||!i){this._lastFocusedEditableElement=null;return}let o=Array.from(e.ui.getEditableElementsNames()).map(n=>e.ui.getEditableElement(n));o.includes(i)?this._lastFocusedEditableElement=i:this._lastFocusedEditableElement=o[0]}};function A9(e,t){return bw(e,t,(i,o)=>i.left+i.width-o.width-t.horizontalOffset)}function I9(e,t){return bw(e,t,i=>i.left+t.horizontalOffset)}function bw(e,t,i){return(o,n)=>{let s=new F(e);if(s.widthn.preventDefault())}}]})}};/** +*/var S9="Powered by",P9=class extends pw{constructor(e){super(e,{balloonClass:"ck-powered-by-balloon"})}_isEnabled(){let e=this.editor;if(e.config.get("ui.poweredBy.forceVisible"))return!0;let t=e.config.get("licenseKey");if(t=="GPL")return!0;let i=za(t.split(".")[1]);return i?!i.whiteLabel:!0}_createBadgeContent(){return new R9(this.editor.locale,this._getNormalizedConfig().label)}_getNormalizedConfig(){let e=super._getNormalizedConfig(),t=this.editor.config.get("ui.poweredBy")||{},i=t.position||e.position,o=i==="inside"?5:e.verticalOffset;return{position:i,side:t.side||e.side,label:t.label===void 0?S9:t.label,verticalOffset:t.verticalOffset!==void 0?t.verticalOffset:o,horizontalOffset:t.horizontalOffset!==void 0?t.horizontalOffset:e.horizontalOffset,forceVisible:!!t.forceVisible}}},R9=class extends R{constructor(e,t){super(e);let i=new ei,o=this.bindTemplate;i.set({content:rb,isColorInherited:!1}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-powered-by"],"aria-hidden":!0},children:[{tag:"a",attributes:{href:"https://ckeditor.com/powered-by-ckeditor/?utm_source=ckeditor&utm_medium=referral&utm_campaign=701Dn000000hVgmIAE_powered_by_ckeditor_logo",target:"_blank",tabindex:"-1"},children:[...t?[{tag:"span",attributes:{class:["ck","ck-powered-by__label"]},children:[t]}]:[],i],on:{dragstart:o.to(n=>n.preventDefault())}}]})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Io=class extends I{toggleSwitchView;constructor(e){super(e),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){let e=new R;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}};/** +*/var So=class extends I{toggleSwitchView;constructor(e){super(e),this.isToggleable=!0,this.toggleSwitchView=this._createToggleView(),this.extendTemplate({attributes:{class:"ck-switchbutton"}})}render(){super.render(),this.children.add(this.toggleSwitchView)}_createToggleView(){let e=new R;return e.setTemplate({tag:"span",attributes:{class:["ck","ck-button__toggle"]},children:[{tag:"span",attributes:{class:["ck","ck-button__toggle__inner"]}}]}),e}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -821,52 +821,52 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var P9=pw(I),R9=pw(ji),uh=class extends P9{},V9=class extends R9{};function pw(e){class t extends e{_fileInputView;constructor(...o){super(...o),this._fileInputView=new L9(this.locale),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.on("execute",()=>{this._fileInputView.open()}),this.extendTemplate({attributes:{class:"ck-file-dialog-button"}})}render(){super.render(),this.children.add(this._fileInputView)}}return t}var L9=class extends R{constructor(e){super(e),this.set("acceptedType",void 0),this.set("allowMultipleFiles",!1);let t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:t.to("acceptedType"),multiple:t.to("allowMultipleFiles")},on:{change:t.to(()=>{this.element?.files?.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}};/** +*/var V9=ww(I),L9=ww(Gi),hh=class extends V9{},M9=class extends L9{};function ww(e){class t extends e{_fileInputView;constructor(...o){super(...o),this._fileInputView=new B9(this.locale),this._fileInputView.bind("acceptedType").to(this),this._fileInputView.bind("allowMultipleFiles").to(this),this._fileInputView.delegate("done").to(this),this.on("execute",()=>{this._fileInputView.open()}),this.extendTemplate({attributes:{class:"ck-file-dialog-button"}})}render(){super.render(),this.children.add(this._fileInputView)}}return t}var B9=class extends R{constructor(e){super(e),this.set("acceptedType",void 0),this.set("allowMultipleFiles",!1);let t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck-hidden"],type:"file",tabindex:"-1",accept:t.to("acceptedType"),multiple:t.to("allowMultipleFiles")},on:{change:t.to(()=>{this.element?.files?.length&&this.fire("done",this.element.files),this.element.value=""})}})}open(){this.element.click()}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var dh=class extends R{buttonView;children;constructor(e,t){super(e);let i=this.bindTemplate;this.set("isCollapsed",!1),this.set("label",""),this.buttonView=this._createButtonView(),this.children=this.createCollection(),this.set("_collapsibleAriaLabelUid",void 0),t&&this.children.addMany(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-collapsible",i.if("isCollapsed","ck-collapsible_collapsed")]},children:[this.buttonView,{tag:"div",attributes:{class:["ck","ck-collapsible__children"],role:"region",hidden:i.if("isCollapsed","hidden"),"aria-labelledby":i.to("_collapsibleAriaLabelUid")},children:this.children}]})}render(){super.render(),this._collapsibleAriaLabelUid=this.buttonView.labelView.element.id}focus(){this.buttonView.focus()}_createButtonView(){let e=new I(this.locale),t=e.bindTemplate;return e.set({withText:!0,icon:cr}),e.extendTemplate({attributes:{"aria-expanded":t.to("isOn",i=>String(i))}}),e.bind("label").to(this),e.bind("isOn").to(this,"isCollapsed",i=>!i),e.on("execute",()=>{this.isCollapsed=!this.isCollapsed}),e}};/** +*/var fh=class extends R{buttonView;children;constructor(e,t){super(e);let i=this.bindTemplate;this.set("isCollapsed",!1),this.set("label",""),this.buttonView=this._createButtonView(),this.children=this.createCollection(),this.set("_collapsibleAriaLabelUid",void 0),t&&this.children.addMany(t),this.setTemplate({tag:"div",attributes:{class:["ck","ck-collapsible",i.if("isCollapsed","ck-collapsible_collapsed")]},children:[this.buttonView,{tag:"div",attributes:{class:["ck","ck-collapsible__children"],role:"region",hidden:i.if("isCollapsed","hidden"),"aria-labelledby":i.to("_collapsibleAriaLabelUid")},children:this.children}]})}render(){super.render(),this._collapsibleAriaLabelUid=this.buttonView.labelView.element.id}focus(){this.buttonView.focus()}_createButtonView(){let e=new I(this.locale),t=e.bindTemplate;return e.set({withText:!0,icon:cr}),e.extendTemplate({attributes:{"aria-expanded":t.to("isOn",i=>String(i))}}),e.bind("label").to(this),e.bind("isOn").to(this,"isCollapsed",i=>!i),e.on("execute",()=>{this.isCollapsed=!this.isCollapsed}),e}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var M9=/^(.+) (\d+)$/;function br(e,t){let i=B9(e);return t.map(o=>(o.label=O9(o.label,i),o))}function B9(e){let t=e.t;return{Black:t("Black"),"Dim grey":t("Dim grey"),Grey:t("Grey"),"Light grey":t("Light grey"),White:t("White"),Red:t("Red"),Orange:t("Orange"),Yellow:t("Yellow"),"Light green":t("Light green"),Green:t("Green"),Aquamarine:t("Aquamarine"),Turquoise:t("Turquoise"),"Light blue":t("Light blue"),Blue:t("Blue"),Purple:t("Purple"),Indigo:t("Indigo"),Cyan:t("Cyan"),Teal:t("Teal"),Lime:t("Lime"),Amber:t("Amber"),"Blue grey":t("Blue grey")}}function O9(e,t){let i=e.match(M9),o=i?i[1]:e,n=Object.hasOwn(t,o)?t[o]:void 0;return n?i?`${n} ${i[2]}`:n:e}function wr(e){return e.map(D9).filter(t=>!!t)}function D9(e){return typeof e=="string"?{model:e,label:e,hasBorder:!1,view:{name:"span",styles:{color:e}}}:{model:e.color,label:e.label||e.color,hasBorder:e.hasBorder===void 0?!1:e.hasBorder,view:{name:"span",styles:{color:`${e.color}`}}}}/** +*/var O9=/^(.+) (\d+)$/;function br(e,t){let i=D9(e);return t.map(o=>(o.label=F9(o.label,i),o))}function D9(e){let t=e.t;return{Black:t("Black"),"Dim grey":t("Dim grey"),Grey:t("Grey"),"Light grey":t("Light grey"),White:t("White"),Red:t("Red"),Orange:t("Orange"),Yellow:t("Yellow"),"Light green":t("Light green"),Green:t("Green"),Aquamarine:t("Aquamarine"),Turquoise:t("Turquoise"),"Light blue":t("Light blue"),Blue:t("Blue"),Purple:t("Purple"),Indigo:t("Indigo"),Cyan:t("Cyan"),Teal:t("Teal"),Lime:t("Lime"),Amber:t("Amber"),"Blue grey":t("Blue grey")}}function F9(e,t){let i=e.match(O9),o=i?i[1]:e,n=Object.hasOwn(t,o)?t[o]:void 0;return n?i?`${n} ${i[2]}`:n:e}function wr(e){return e.map(N9).filter(t=>!!t)}function N9(e){return typeof e=="string"?{model:e,label:e,hasBorder:!1,view:{name:"span",styles:{color:e}}}:{model:e.color,label:e.label||e.color,hasBorder:e.hasBorder===void 0?!1:e.hasBorder,view:{name:"span",styles:{color:`${e.color}`}}}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var bw=class extends I{constructor(e){super(e);let t=this.bindTemplate;this.set("color",void 0),this.set("hasBorder",!1),this.icon=D1,this.extendTemplate({attributes:{style:{backgroundColor:t.to("color",i=>V.isMediaForcedColors?null:i)},class:["ck","ck-color-grid__tile",t.if("hasBorder","ck-color-selector__color-tile_bordered")]}})}render(){super.render(),this.iconView.fillColor="hsl(0, 0%, 100%)"}};/** +*/var yw=class extends I{constructor(e){super(e);let t=this.bindTemplate;this.set("color",void 0),this.set("hasBorder",!1),this.icon=N1,this.extendTemplate({attributes:{style:{backgroundColor:t.to("color",i=>V.isMediaForcedColors?null:i)},class:["ck","ck-color-grid__tile",t.if("hasBorder","ck-color-selector__color-tile_bordered")]}})}render(){super.render(),this.iconView.fillColor="hsl(0, 0%, 100%)"}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var ww=[{label:"Red 50",color:"hsl(351, 100%, 96%)"},{label:"Purple 50",color:"hsl(292, 44%, 93%)"},{label:"Indigo 50",color:"hsl(231, 44%, 94%)"},{label:"Blue 50",color:"hsl(205, 87%, 94%)"},{label:"Cyan 50",color:"hsl(187, 72%, 93%)"},{label:"Teal 50",color:"hsl(177, 41%, 91%)"},{label:"Light green 50",color:"hsl(88, 52%, 94%)"},{label:"Lime 50",color:"hsl(66, 71%, 95%)"},{label:"Amber 50",color:"hsl(46, 100%, 94%)"},{label:"Orange 50",color:"hsl(37, 100%, 94%)"},{label:"Blue grey 50",color:"hsl(204, 15%, 94%)"},{label:"White",color:"hsl(0, 0%, 100%)",hasBorder:!0},{label:"Red 100",color:"hsl(354, 100%, 90%)"},{label:"Purple 100",color:"hsl(291, 46%, 83%)"},{label:"Indigo 100",color:"hsl(232, 45%, 84%)"},{label:"Blue 100",color:"hsl(207, 89%, 86%)"},{label:"Cyan 100",color:"hsl(187, 71%, 82%)"},{label:"Teal 100",color:"hsl(175, 41%, 79%)"},{label:"Light green 100",color:"hsl(88, 51%, 86%)"},{label:"Lime 100",color:"hsl(65, 69%, 86%)"},{label:"Amber 100",color:"hsl(45, 100%, 85%)"},{label:"Orange 100",color:"hsl(36, 100%, 85%)"},{label:"Blue grey 100",color:"hsl(199, 16%, 84%)"},{label:"Grey 100",color:"hsl(0, 0%, 96%)"},{label:"Red 200",color:"hsl(0, 73%, 77%)"},{label:"Purple 200",color:"hsl(291, 47%, 71%)"},{label:"Indigo 200",color:"hsl(231, 44%, 74%)"},{label:"Blue 200",color:"hsl(207, 90%, 77%)"},{label:"Cyan 200",color:"hsl(187, 72%, 71%)"},{label:"Teal 200",color:"hsl(174, 42%, 65%)"},{label:"Light green 200",color:"hsl(88, 50%, 77%)"},{label:"Lime 200",color:"hsl(66, 71%, 77%)"},{label:"Amber 200",color:"hsl(45, 100%, 76%)"},{label:"Orange 200",color:"hsl(36, 100%, 75%)"},{label:"Blue grey 200",color:"hsl(200, 15%, 73%)"},{label:"Grey 200",color:"hsl(0, 0%, 93%)"},{label:"Red 300",color:"hsl(0, 69%, 68%)"},{label:"Purple 300",color:"hsl(291, 47%, 60%)"},{label:"Indigo 300",color:"hsl(231, 44%, 64%)"},{label:"Blue 300",color:"hsl(207, 89%, 68%)"},{label:"Cyan 300",color:"hsl(187, 71%, 59%)"},{label:"Teal 300",color:"hsl(174, 42%, 51%)"},{label:"Light green 300",color:"hsl(88, 50%, 67%)"},{label:"Lime 300",color:"hsl(66, 70%, 68%)"},{label:"Amber 300",color:"hsl(46, 100%, 66%)"},{label:"Orange 300",color:"hsl(36, 100%, 65%)"},{label:"Blue grey 300",color:"hsl(200, 16%, 62%)"},{label:"Grey 300",color:"hsl(0, 0%, 88%)"},{label:"Red 400",color:"hsl(1, 83%, 63%)"},{label:"Purple 400",color:"hsl(291, 47%, 51%)"},{label:"Indigo 400",color:"hsl(231, 44%, 56%)"},{label:"Blue 400",color:"hsl(207, 90%, 61%)"},{label:"Cyan 400",color:"hsl(187, 71%, 50%)"},{label:"Teal 400",color:"hsl(174, 63%, 40%)"},{label:"Light green 400",color:"hsl(88, 50%, 60%)"},{label:"Lime 400",color:"hsl(66, 70%, 61%)"},{label:"Amber 400",color:"hsl(45, 100%, 58%)"},{label:"Orange 400",color:"hsl(36, 100%, 58%)"},{label:"Blue grey 400",color:"hsl(200, 15%, 54%)"},{label:"Grey 400",color:"hsl(0, 0%, 74%)"},{label:"Red 500",color:"hsl(4, 90%, 58%)"},{label:"Purple 500",color:"hsl(291, 64%, 42%)"},{label:"Indigo 500",color:"hsl(231, 48%, 48%)"},{label:"Blue 500",color:"hsl(207, 90%, 54%)"},{label:"Cyan 500",color:"hsl(187, 100%, 42%)"},{label:"Teal 500",color:"hsl(174, 100%, 29%)"},{label:"Light green 500",color:"hsl(88, 50%, 53%)"},{label:"Lime 500",color:"hsl(66, 70%, 54%)"},{label:"Amber 500",color:"hsl(45, 100%, 51%)"},{label:"Orange 500",color:"hsl(36, 100%, 50%)"},{label:"Blue grey 500",color:"hsl(200, 18%, 46%)"},{label:"Grey 500",color:"hsl(0, 0%, 62%)"},{label:"Red 600",color:"hsl(1, 77%, 55%)"},{label:"Purple 600",color:"hsl(288, 65%, 40%)"},{label:"Indigo 600",color:"hsl(232, 50%, 45%)"},{label:"Blue 600",color:"hsl(208, 79%, 51%)"},{label:"Cyan 600",color:"hsl(187, 100%, 38%)"},{label:"Teal 600",color:"hsl(174, 100%, 27%)"},{label:"Light green 600",color:"hsl(89, 46%, 48%)"},{label:"Lime 600",color:"hsl(64, 60%, 50%)"},{label:"Amber 600",color:"hsl(42, 100%, 50%)"},{label:"Orange 600",color:"hsl(34, 100%, 49%)"},{label:"Blue grey 600",color:"hsl(199, 18%, 40%)"},{label:"Grey 600",color:"hsl(0, 0%, 46%)"},{label:"Red 700",color:"hsl(0, 65%, 51%)"},{label:"Purple 700",color:"hsl(282, 68%, 38%)"},{label:"Indigo 700",color:"hsl(232, 54%, 41%)"},{label:"Blue 700",color:"hsl(210, 79%, 46%)"},{label:"Cyan 700",color:"hsl(186, 100%, 33%)"},{label:"Teal 700",color:"hsl(173, 100%, 24%)"},{label:"Light green 700",color:"hsl(92, 48%, 42%)"},{label:"Lime 700",color:"hsl(62, 61%, 44%)"},{label:"Amber 700",color:"hsl(38, 100%, 50%)"},{label:"Orange 700",color:"hsl(30, 100%, 48%)"},{label:"Blue grey 700",color:"hsl(199, 18%, 33%)"},{label:"Grey 700",color:"hsl(0, 0%, 38%)"},{label:"Red 800",color:"hsl(0, 66%, 47%)"},{label:"Purple 800",color:"hsl(277, 70%, 36%)"},{label:"Indigo 800",color:"hsl(233, 57%, 37%)"},{label:"Blue 800",color:"hsl(212, 80%, 42%)"},{label:"Cyan 800",color:"hsl(185, 100%, 28%)"},{label:"Teal 800",color:"hsl(173, 100%, 21%)"},{label:"Light green 800",color:"hsl(95, 50%, 37%)"},{label:"Lime 800",color:"hsl(60, 63%, 38%)"},{label:"Amber 800",color:"hsl(34, 100%, 50%)"},{label:"Orange 800",color:"hsl(27, 100%, 47%)"},{label:"Blue grey 800",color:"hsl(200, 18%, 26%)"},{label:"Grey 800",color:"hsl(0, 0%, 26%)"},{label:"Red 900",color:"hsl(0, 74%, 41%)"},{label:"Purple 900",color:"hsl(267, 75%, 31%)"},{label:"Indigo 900",color:"hsl(235, 66%, 30%)"},{label:"Blue 900",color:"hsl(217, 85%, 34%)"},{label:"Cyan 900",color:"hsl(182, 100%, 20%)"},{label:"Teal 900",color:"hsl(170, 100%, 15%)"},{label:"Light green 900",color:"hsl(103, 56%, 27%)"},{label:"Lime 900",color:"hsl(54, 70%, 30%)"},{label:"Amber 900",color:"hsl(26, 100%, 50%)"},{label:"Orange 900",color:"hsl(21, 100%, 45%)"},{label:"Blue grey 900",color:"hsl(200, 19%, 18%)"},{label:"Black",color:"hsl(0, 0%, 0%)"}],Ll=12;/** +*/var _w=[{label:"Red 50",color:"hsl(351, 100%, 96%)"},{label:"Purple 50",color:"hsl(292, 44%, 93%)"},{label:"Indigo 50",color:"hsl(231, 44%, 94%)"},{label:"Blue 50",color:"hsl(205, 87%, 94%)"},{label:"Cyan 50",color:"hsl(187, 72%, 93%)"},{label:"Teal 50",color:"hsl(177, 41%, 91%)"},{label:"Light green 50",color:"hsl(88, 52%, 94%)"},{label:"Lime 50",color:"hsl(66, 71%, 95%)"},{label:"Amber 50",color:"hsl(46, 100%, 94%)"},{label:"Orange 50",color:"hsl(37, 100%, 94%)"},{label:"Blue grey 50",color:"hsl(204, 15%, 94%)"},{label:"White",color:"hsl(0, 0%, 100%)",hasBorder:!0},{label:"Red 100",color:"hsl(354, 100%, 90%)"},{label:"Purple 100",color:"hsl(291, 46%, 83%)"},{label:"Indigo 100",color:"hsl(232, 45%, 84%)"},{label:"Blue 100",color:"hsl(207, 89%, 86%)"},{label:"Cyan 100",color:"hsl(187, 71%, 82%)"},{label:"Teal 100",color:"hsl(175, 41%, 79%)"},{label:"Light green 100",color:"hsl(88, 51%, 86%)"},{label:"Lime 100",color:"hsl(65, 69%, 86%)"},{label:"Amber 100",color:"hsl(45, 100%, 85%)"},{label:"Orange 100",color:"hsl(36, 100%, 85%)"},{label:"Blue grey 100",color:"hsl(199, 16%, 84%)"},{label:"Grey 100",color:"hsl(0, 0%, 96%)"},{label:"Red 200",color:"hsl(0, 73%, 77%)"},{label:"Purple 200",color:"hsl(291, 47%, 71%)"},{label:"Indigo 200",color:"hsl(231, 44%, 74%)"},{label:"Blue 200",color:"hsl(207, 90%, 77%)"},{label:"Cyan 200",color:"hsl(187, 72%, 71%)"},{label:"Teal 200",color:"hsl(174, 42%, 65%)"},{label:"Light green 200",color:"hsl(88, 50%, 77%)"},{label:"Lime 200",color:"hsl(66, 71%, 77%)"},{label:"Amber 200",color:"hsl(45, 100%, 76%)"},{label:"Orange 200",color:"hsl(36, 100%, 75%)"},{label:"Blue grey 200",color:"hsl(200, 15%, 73%)"},{label:"Grey 200",color:"hsl(0, 0%, 93%)"},{label:"Red 300",color:"hsl(0, 69%, 68%)"},{label:"Purple 300",color:"hsl(291, 47%, 60%)"},{label:"Indigo 300",color:"hsl(231, 44%, 64%)"},{label:"Blue 300",color:"hsl(207, 89%, 68%)"},{label:"Cyan 300",color:"hsl(187, 71%, 59%)"},{label:"Teal 300",color:"hsl(174, 42%, 51%)"},{label:"Light green 300",color:"hsl(88, 50%, 67%)"},{label:"Lime 300",color:"hsl(66, 70%, 68%)"},{label:"Amber 300",color:"hsl(46, 100%, 66%)"},{label:"Orange 300",color:"hsl(36, 100%, 65%)"},{label:"Blue grey 300",color:"hsl(200, 16%, 62%)"},{label:"Grey 300",color:"hsl(0, 0%, 88%)"},{label:"Red 400",color:"hsl(1, 83%, 63%)"},{label:"Purple 400",color:"hsl(291, 47%, 51%)"},{label:"Indigo 400",color:"hsl(231, 44%, 56%)"},{label:"Blue 400",color:"hsl(207, 90%, 61%)"},{label:"Cyan 400",color:"hsl(187, 71%, 50%)"},{label:"Teal 400",color:"hsl(174, 63%, 40%)"},{label:"Light green 400",color:"hsl(88, 50%, 60%)"},{label:"Lime 400",color:"hsl(66, 70%, 61%)"},{label:"Amber 400",color:"hsl(45, 100%, 58%)"},{label:"Orange 400",color:"hsl(36, 100%, 58%)"},{label:"Blue grey 400",color:"hsl(200, 15%, 54%)"},{label:"Grey 400",color:"hsl(0, 0%, 74%)"},{label:"Red 500",color:"hsl(4, 90%, 58%)"},{label:"Purple 500",color:"hsl(291, 64%, 42%)"},{label:"Indigo 500",color:"hsl(231, 48%, 48%)"},{label:"Blue 500",color:"hsl(207, 90%, 54%)"},{label:"Cyan 500",color:"hsl(187, 100%, 42%)"},{label:"Teal 500",color:"hsl(174, 100%, 29%)"},{label:"Light green 500",color:"hsl(88, 50%, 53%)"},{label:"Lime 500",color:"hsl(66, 70%, 54%)"},{label:"Amber 500",color:"hsl(45, 100%, 51%)"},{label:"Orange 500",color:"hsl(36, 100%, 50%)"},{label:"Blue grey 500",color:"hsl(200, 18%, 46%)"},{label:"Grey 500",color:"hsl(0, 0%, 62%)"},{label:"Red 600",color:"hsl(1, 77%, 55%)"},{label:"Purple 600",color:"hsl(288, 65%, 40%)"},{label:"Indigo 600",color:"hsl(232, 50%, 45%)"},{label:"Blue 600",color:"hsl(208, 79%, 51%)"},{label:"Cyan 600",color:"hsl(187, 100%, 38%)"},{label:"Teal 600",color:"hsl(174, 100%, 27%)"},{label:"Light green 600",color:"hsl(89, 46%, 48%)"},{label:"Lime 600",color:"hsl(64, 60%, 50%)"},{label:"Amber 600",color:"hsl(42, 100%, 50%)"},{label:"Orange 600",color:"hsl(34, 100%, 49%)"},{label:"Blue grey 600",color:"hsl(199, 18%, 40%)"},{label:"Grey 600",color:"hsl(0, 0%, 46%)"},{label:"Red 700",color:"hsl(0, 65%, 51%)"},{label:"Purple 700",color:"hsl(282, 68%, 38%)"},{label:"Indigo 700",color:"hsl(232, 54%, 41%)"},{label:"Blue 700",color:"hsl(210, 79%, 46%)"},{label:"Cyan 700",color:"hsl(186, 100%, 33%)"},{label:"Teal 700",color:"hsl(173, 100%, 24%)"},{label:"Light green 700",color:"hsl(92, 48%, 42%)"},{label:"Lime 700",color:"hsl(62, 61%, 44%)"},{label:"Amber 700",color:"hsl(38, 100%, 50%)"},{label:"Orange 700",color:"hsl(30, 100%, 48%)"},{label:"Blue grey 700",color:"hsl(199, 18%, 33%)"},{label:"Grey 700",color:"hsl(0, 0%, 38%)"},{label:"Red 800",color:"hsl(0, 66%, 47%)"},{label:"Purple 800",color:"hsl(277, 70%, 36%)"},{label:"Indigo 800",color:"hsl(233, 57%, 37%)"},{label:"Blue 800",color:"hsl(212, 80%, 42%)"},{label:"Cyan 800",color:"hsl(185, 100%, 28%)"},{label:"Teal 800",color:"hsl(173, 100%, 21%)"},{label:"Light green 800",color:"hsl(95, 50%, 37%)"},{label:"Lime 800",color:"hsl(60, 63%, 38%)"},{label:"Amber 800",color:"hsl(34, 100%, 50%)"},{label:"Orange 800",color:"hsl(27, 100%, 47%)"},{label:"Blue grey 800",color:"hsl(200, 18%, 26%)"},{label:"Grey 800",color:"hsl(0, 0%, 26%)"},{label:"Red 900",color:"hsl(0, 74%, 41%)"},{label:"Purple 900",color:"hsl(267, 75%, 31%)"},{label:"Indigo 900",color:"hsl(235, 66%, 30%)"},{label:"Blue 900",color:"hsl(217, 85%, 34%)"},{label:"Cyan 900",color:"hsl(182, 100%, 20%)"},{label:"Teal 900",color:"hsl(170, 100%, 15%)"},{label:"Light green 900",color:"hsl(103, 56%, 27%)"},{label:"Lime 900",color:"hsl(54, 70%, 30%)"},{label:"Amber 900",color:"hsl(26, 100%, 50%)"},{label:"Orange 900",color:"hsl(21, 100%, 45%)"},{label:"Blue grey 900",color:"hsl(200, 19%, 18%)"},{label:"Black",color:"hsl(0, 0%, 0%)"}],Ml=12;/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var qb=class extends R{columns;items;focusTracker;keystrokes;constructor(e,t){super(e);let i=t&&t.colorDefinitions?t.colorDefinitions:[];this.columns=t?.columns||12;let o={gridTemplateColumns:`repeat( ${this.columns}, 1fr)`};this.set("selectedColor",void 0),this.items=this.createCollection(),this.focusTracker=new Q,this.keystrokes=new X,this.items.on("add",(n,s)=>{s.isOn=s.color===this.selectedColor}),i.forEach(n=>{let s=new bw;s.set({color:n.color,label:n.label,tooltip:!0,hasBorder:n.options.hasBorder}),s.on("execute",()=>{this.fire("execute",{value:n.color,hasBorder:n.options.hasBorder,label:n.label})}),this.items.add(s)}),this.setTemplate({tag:"div",children:this.items,attributes:{class:["ck","ck-color-grid"],style:o}}),this.on("change:selectedColor",(n,s,r)=>{for(let a of this.items)a.isOn=a.color===r})}focus(){this.items.length&&this.items.first.focus()}focusLast(){this.items.length&&this.items.last.focus()}render(){super.render();for(let e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element),Vl({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:this.columns,uiLanguageDirection:this.locale?.uiLanguageDirection})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}};/** +*/var jb=class extends R{columns;items;focusTracker;keystrokes;constructor(e,t){super(e);let i=t&&t.colorDefinitions?t.colorDefinitions:[];this.columns=t?.columns||12;let o={gridTemplateColumns:`repeat( ${this.columns}, 1fr)`};this.set("selectedColor",void 0),this.items=this.createCollection(),this.focusTracker=new Q,this.keystrokes=new X,this.items.on("add",(n,s)=>{s.isOn=s.color===this.selectedColor}),i.forEach(n=>{let s=new yw;s.set({color:n.color,label:n.label,tooltip:!0,hasBorder:n.options.hasBorder}),s.on("execute",()=>{this.fire("execute",{value:n.color,hasBorder:n.options.hasBorder,label:n.label})}),this.items.add(s)}),this.setTemplate({tag:"div",children:this.items,attributes:{class:["ck","ck-color-grid"],style:o}}),this.on("change:selectedColor",(n,s,r)=>{for(let a of this.items)a.isOn=a.color===r})}focus(){this.items.length&&this.items.first.focus()}focusLast(){this.items.length&&this.items.last.focus()}render(){super.render();for(let e of this.items)this.focusTracker.add(e.element);this.items.on("add",(e,t)=>{this.focusTracker.add(t.element)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t.element)}),this.keystrokes.listenTo(this.element),Ll({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:this.columns,uiLanguageDirection:this.locale?.uiLanguageDirection})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function yw(e,t){if(!e)return"";let i=_w(e);if(!i)return"";if(i.space===t)return e;if(!H9(i))return"";let o=Jd[i.space][t];return o?z9(o(i.space==="hex"?i.hexValue:i.values),t):""}function F9(e){if(!e)return"";let t=_w(e);return t?t.space==="hex"?t.hexValue:yw(e,"hex"):"#000"}function N9(e,t){customElements.get(e)===void 0&&customElements.define(e,t)}function z9(e,t){switch(t){case"hex":return`#${e}`;case"rgb":return`rgb(${e[0]}, ${e[1]}, ${e[2]})`;case"hsl":return`hsl(${e[0]}, ${e[1]}%, ${e[2]}%)`;case"hwb":return`hwb(${e[0]}, ${e[1]}, ${e[2]})`;case"lab":return`lab(${e[0]}% ${e[1]} ${e[2]})`;case"lch":return`lch(${e[0]}% ${e[1]} ${e[2]})`;default:return""}}function _w(e){if(e.startsWith("#")){let i=Kd(e);return{space:"hex",values:i.values,hexValue:e,alpha:i.alpha}}let t=Kd(e);return t.space?t:null}function H9(e){return Object.keys(Jd).includes(e.space)}/** +*/function vw(e,t){if(!e)return"";let i=kw(e);if(!i)return"";if(i.space===t)return e;if(!U9(i))return"";let o=Qd[i.space][t];return o?W9(o(i.space==="hex"?i.hexValue:i.values),t):""}function z9(e){if(!e)return"";let t=kw(e);return t?t.space==="hex"?t.hexValue:vw(e,"hex"):"#000"}function H9(e,t){customElements.get(e)===void 0&&customElements.define(e,t)}function W9(e,t){switch(t){case"hex":return`#${e}`;case"rgb":return`rgb(${e[0]}, ${e[1]}, ${e[2]})`;case"hsl":return`hsl(${e[0]}, ${e[1]}%, ${e[2]}%)`;case"hwb":return`hwb(${e[0]}, ${e[1]}, ${e[2]})`;case"lab":return`lab(${e[0]}% ${e[1]} ${e[2]})`;case"lch":return`lch(${e[0]}% ${e[1]} ${e[2]})`;default:return""}}function kw(e){if(e.startsWith("#")){let i=Jd(e);return{space:"hex",values:i.values,hexValue:e,alpha:i.alpha}}let t=Jd(e);return t.space?t:null}function U9(e){return Object.keys(Qd).includes(e.space)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */var ue=class extends R{fieldView;labelView;statusView;fieldWrapperChildren;constructor(e,t){super(e);let i=`ck-labeled-field-view-${ne()}`,o=`ck-labeled-field-view-status-${ne()}`;this.fieldView=t(this,i,o),this.set("label",void 0),this.set("isEnabled",!0),this.set("isEmpty",!0),this.set("isFocused",!1),this.set("errorText",null),this.set("infoText",null),this.set("class",void 0),this.set("placeholder",void 0),this.labelView=this._createLabelView(i),this.statusView=this._createStatusView(o),this.fieldWrapperChildren=this.createCollection([this.fieldView,this.labelView]),this.bind("_statusText").to(this,"errorText",this,"infoText",(s,r)=>s||r);let n=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-labeled-field-view",n.to("class"),n.if("isEnabled","ck-disabled",s=>!s),n.if("isEmpty","ck-labeled-field-view_empty"),n.if("isFocused","ck-labeled-field-view_focused"),n.if("placeholder","ck-labeled-field-view_placeholder"),n.if("errorText","ck-error")]},children:[{tag:"div",attributes:{class:["ck","ck-labeled-field-view__input-wrapper"]},children:this.fieldWrapperChildren},this.statusView]})}_createLabelView(e){let t=new ut(this.locale);return t.for=e,t.bind("text").to(this,"label"),t}_createStatusView(e){let t=new R(this.locale),i=this.bindTemplate;return t.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",o=>!o)],id:e,role:i.if("errorText","alert")},children:[{text:i.to("_statusText")}]}),t}focus(e){this.fieldView.focus(e)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var W9=class extends R{focusTracker;constructor(e){super(e),this.set("value",void 0),this.set("id",void 0),this.set("placeholder",void 0),this.set("tabIndex",void 0),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById",void 0),this.set("ariaLabel",void 0),this.focusTracker=new Q,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);let t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck","ck-input",t.if("isFocused","ck-input_focused"),t.if("isEmpty","ck-input-text_empty"),t.if("hasError","ck-error")],id:t.to("id"),placeholder:t.to("placeholder"),tabindex:t.to("tabIndex"),readonly:t.to("isReadOnly"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById"),"aria-label":t.to("ariaLabel")},on:{input:t.to((...i)=>{this.fire("input",...i),this._updateIsEmpty()}),change:t.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",(e,t,i)=>{this._setDomElementValue(i),this._updateIsEmpty()})}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}reset(){this.value=this.element.value="",this._updateIsEmpty()}_updateIsEmpty(){this.isEmpty=U9(this.element)}_setDomElementValue(e){this.element.value=!e&&e!==0?"":e}};function U9(e){return!e.value}/** +*/var q9=class extends R{focusTracker;constructor(e){super(e),this.set("value",void 0),this.set("id",void 0),this.set("placeholder",void 0),this.set("tabIndex",void 0),this.set("isReadOnly",!1),this.set("hasError",!1),this.set("ariaDescribedById",void 0),this.set("ariaLabel",void 0),this.focusTracker=new Q,this.bind("isFocused").to(this.focusTracker),this.set("isEmpty",!0);let t=this.bindTemplate;this.setTemplate({tag:"input",attributes:{class:["ck","ck-input",t.if("isFocused","ck-input_focused"),t.if("isEmpty","ck-input-text_empty"),t.if("hasError","ck-error")],id:t.to("id"),placeholder:t.to("placeholder"),tabindex:t.to("tabIndex"),readonly:t.to("isReadOnly"),"aria-invalid":t.if("hasError",!0),"aria-describedby":t.to("ariaDescribedById"),"aria-label":t.to("ariaLabel")},on:{input:t.to((...i)=>{this.fire("input",...i),this._updateIsEmpty()}),change:t.to(this._updateIsEmpty.bind(this))}})}render(){super.render(),this.focusTracker.add(this.element),this._setDomElementValue(this.value),this._updateIsEmpty(),this.on("change:value",(e,t,i)=>{this._setDomElementValue(i),this._updateIsEmpty()})}destroy(){super.destroy(),this.focusTracker.destroy()}select(){this.element.select()}focus(){this.element.focus()}reset(){this.value=this.element.value="",this._updateIsEmpty()}_updateIsEmpty(){this.isEmpty=$9(this.element)}_setDomElementValue(e){this.element.value=!e&&e!==0?"":e}};function $9(e){return!e.value}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var vw=class extends W9{constructor(e){super(e),this.set("inputMode","text");let t=this.bindTemplate;this.extendTemplate({attributes:{inputmode:t.to("inputMode")}})}};/** +*/var Cw=class extends q9{constructor(e){super(e),this.set("inputMode","text");let t=this.bindTemplate;this.extendTemplate({attributes:{inputmode:t.to("inputMode")}})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var hh=class extends vw{constructor(e){super(e),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}};/** +*/var mh=class extends Cw{constructor(e){super(e),this.extendTemplate({attributes:{type:"text",class:["ck-input-text"]}})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var q9=class extends vw{constructor(e,{min:t,max:i,step:o}={}){super(e);let n=this.bindTemplate;this.set("min",t),this.set("max",i),this.set("step",o),this.extendTemplate({attributes:{type:"number",class:["ck-input-number"],min:n.to("min"),max:n.to("max"),step:n.to("step")}})}};/** +*/var j9=class extends Cw{constructor(e,{min:t,max:i,step:o}={}){super(e);let n=this.bindTemplate;this.set("min",t),this.set("max",i),this.set("step",o),this.extendTemplate({attributes:{type:"number",class:["ck-input-number"],min:n.to("min"),max:n.to("max"),step:n.to("step")}})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var $9=class extends R{children;constructor(e){super(e);let t=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",t.to("position",i=>`ck-dropdown__panel_${i}`),t.if("isVisible","ck-dropdown__panel-visible")],tabindex:"-1"},children:this.children,on:{selectstart:t.to(i=>{let o=i.target;o instanceof Element&&o.tagName.toLocaleLowerCase()==="input"||i.preventDefault()})}})}focus(){if(this.children.length){let e=this.children.first;typeof e.focus=="function"?e.focus():D("ui-dropdown-panel-focus-child-missing-focus",{childView:this.children.first,dropdownPanel:this})}}focusLast(){if(this.children.length){let e=this.children.last;typeof e.focusLast=="function"?e.focusLast():e.focus()}}};/** +*/var K9=class extends R{children;constructor(e){super(e);let t=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",t.to("position",i=>`ck-dropdown__panel_${i}`),t.if("isVisible","ck-dropdown__panel-visible")],tabindex:"-1"},children:this.children,on:{selectstart:t.to(i=>{let o=i.target;o instanceof Element&&o.tagName.toLocaleLowerCase()==="input"||i.preventDefault()})}})}focus(){if(this.children.length){let e=this.children.first;typeof e.focus=="function"?e.focus():D("ui-dropdown-panel-focus-child-missing-focus",{childView:this.children.first,dropdownPanel:this})}}focusLast(){if(this.children.length){let e=this.children.last;typeof e.focusLast=="function"?e.focusLast():e.focus()}}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var j9=class ah extends R{buttonView;panelView;focusTracker;keystrokes;listView;toolbarView;menuView;panelPositionLimiter=null;constructor(t,i,o){super(t);let n=this.bindTemplate;this.buttonView=i,this.panelView=o,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class",void 0),this.set("id",void 0),this.set("panelPosition","auto"),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new X,this.focusTracker=new Q,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",n.to("class"),n.if("isEnabled","ck-disabled",s=>!s)],id:n.to("id"),"aria-describedby":n.to("ariaDescribedById")},children:[i,o]}),i.extendTemplate({attributes:{class:["ck-dropdown__button"],"data-cke-tooltip-disabled":n.to("isOpen")}})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.on("change:isOpen",(i,o,n)=>{if(n)if(this.panelPosition==="auto"){let s=typeof this.panelPositionLimiter=="function"?this.panelPositionLimiter():this.panelPositionLimiter,r=ah._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions,...s?{limiter:s}:{}});this.panelView.position=r?r.name:this._defaultPanelPositionName}else this.panelView.position=this.panelPosition}),this.keystrokes.listenTo(this.element);let t=(i,o)=>{this.isOpen&&(this.isOpen=!1,o())};this.keystrokes.set("arrowdown",(i,o)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,o())}),this.keystrokes.set("arrowright",(i,o)=>{this.isOpen&&o()}),this.keystrokes.set("arrowleft",t),this.keystrokes.set("esc",t)}focus(){this.buttonView.focus()}get _panelPositions(){let{south:t,north:i,southEast:o,southWest:n,northEast:s,northWest:r,southMiddleEast:a,southMiddleWest:l,northMiddleEast:c,northMiddleWest:u}=ah.defaultPanelPositions;return this.locale.uiLanguageDirection!=="rtl"?[o,n,a,l,t,s,r,c,u,i]:[n,o,l,a,t,r,s,u,c,i]}get _defaultPanelPositionName(){return this.locale.uiLanguageDirection==="rtl"?"sw":"se"}static defaultPanelPositions={south:(t,i)=>({top:t.bottom,left:t.left-(i.width-t.width)/2,name:"s"}),southEast:t=>({top:t.bottom,left:t.left,name:"se"}),southWest:(t,i)=>({top:t.bottom,left:t.left-i.width+t.width,name:"sw"}),southMiddleEast:(t,i)=>({top:t.bottom,left:t.left-(i.width-t.width)/4,name:"sme"}),southMiddleWest:(t,i)=>({top:t.bottom,left:t.left-(i.width-t.width)*3/4,name:"smw"}),north:(t,i)=>({top:t.top-i.height,left:t.left-(i.width-t.width)/2,name:"n"}),northEast:(t,i)=>({top:t.top-i.height,left:t.left,name:"ne"}),northWest:(t,i)=>({top:t.top-i.height,left:t.left-i.width+t.width,name:"nw"}),northMiddleEast:(t,i)=>({top:t.top-i.height,left:t.left-(i.width-t.width)/4,name:"nme"}),northMiddleWest:(t,i)=>({top:t.top-i.height,left:t.left-(i.width-t.width)*3/4,name:"nmw"})};static _getOptimalPosition=Fa};/** +*/var G9=class ch extends R{buttonView;panelView;focusTracker;keystrokes;listView;toolbarView;menuView;panelPositionLimiter=null;constructor(t,i,o){super(t);let n=this.bindTemplate;this.buttonView=i,this.panelView=o,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("class",void 0),this.set("id",void 0),this.set("panelPosition","auto"),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new X,this.focusTracker=new Q,this.setTemplate({tag:"div",attributes:{class:["ck","ck-dropdown",n.to("class"),n.if("isEnabled","ck-disabled",s=>!s)],id:n.to("id"),"aria-describedby":n.to("ariaDescribedById")},children:[i,o]}),i.extendTemplate({attributes:{class:["ck-dropdown__button"],"data-cke-tooltip-disabled":n.to("isOpen")}})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.listenTo(this.buttonView,"open",()=>{this.isOpen=!this.isOpen}),this.on("change:isOpen",(i,o,n)=>{if(n)if(this.panelPosition==="auto"){let s=typeof this.panelPositionLimiter=="function"?this.panelPositionLimiter():this.panelPositionLimiter,r=ch._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions,...s?{limiter:s}:{}});this.panelView.position=r?r.name:this._defaultPanelPositionName}else this.panelView.position=this.panelPosition}),this.keystrokes.listenTo(this.element);let t=(i,o)=>{this.isOpen&&(this.isOpen=!1,o())};this.keystrokes.set("arrowdown",(i,o)=>{this.buttonView.isEnabled&&!this.isOpen&&(this.isOpen=!0,o())}),this.keystrokes.set("arrowright",(i,o)=>{this.isOpen&&o()}),this.keystrokes.set("arrowleft",t),this.keystrokes.set("esc",t)}focus(){this.buttonView.focus()}get _panelPositions(){let{south:t,north:i,southEast:o,southWest:n,northEast:s,northWest:r,southMiddleEast:a,southMiddleWest:l,northMiddleEast:c,northMiddleWest:u}=ch.defaultPanelPositions;return this.locale.uiLanguageDirection!=="rtl"?[o,n,a,l,t,s,r,c,u,i]:[n,o,l,a,t,r,s,u,c,i]}get _defaultPanelPositionName(){return this.locale.uiLanguageDirection==="rtl"?"sw":"se"}static defaultPanelPositions={south:(t,i)=>({top:t.bottom,left:t.left-(i.width-t.width)/2,name:"s"}),southEast:t=>({top:t.bottom,left:t.left,name:"se"}),southWest:(t,i)=>({top:t.bottom,left:t.left-i.width+t.width,name:"sw"}),southMiddleEast:(t,i)=>({top:t.bottom,left:t.left-(i.width-t.width)/4,name:"sme"}),southMiddleWest:(t,i)=>({top:t.bottom,left:t.left-(i.width-t.width)*3/4,name:"smw"}),north:(t,i)=>({top:t.top-i.height,left:t.left-(i.width-t.width)/2,name:"n"}),northEast:(t,i)=>({top:t.top-i.height,left:t.left,name:"ne"}),northWest:(t,i)=>({top:t.top-i.height,left:t.left-i.width+t.width,name:"nw"}),northMiddleEast:(t,i)=>({top:t.top-i.height,left:t.left-(i.width-t.width)/4,name:"nme"}),northMiddleWest:(t,i)=>({top:t.top-i.height,left:t.left-(i.width-t.width)*3/4,name:"nmw"})};static _getOptimalPosition=Na};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Ml=class extends I{arrowView;constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",t=>String(t))}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){let e=new Yt;return e.content=cr,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}};/** +*/var Bl=class extends I{arrowView;constructor(e){super(e),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",t=>String(t))}}),this.delegate("execute").to(this,"open")}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){let e=new ei;return e.content=cr,e.extendTemplate({attributes:{class:"ck-dropdown__arrow"}}),e}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -878,13 +878,13 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let */var ot=class extends R{children;constructor(e){super(e);let t=this.bindTemplate;this.set("isVisible",!0),this.children=this.createCollection(),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__item",t.if("isVisible","ck-hidden",i=>!i)],role:"presentation"},children:this.children})}focus(){this.children.first&&this.children.first.focus()}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var fh=class extends R{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}};/** +*/var gh=class extends R{constructor(e){super(e),this.setTemplate({tag:"li",attributes:{class:["ck","ck-list__separator"]}})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Pl=class extends R{labelView;items;children;constructor(e,t=new ut){super(e);let i=this.bindTemplate,o=new vi(e);this.set({label:"",isVisible:!0}),this.labelView=t,this.labelView.bind("text").to(this,"label"),this.children=this.createCollection(),this.children.addMany([this.labelView,o]),o.set({role:"group",ariaLabelledBy:t.id}),o.focusTracker.destroy(),o.keystrokes.destroy(),this.items=o.items,this.setTemplate({tag:"li",attributes:{role:"presentation",class:["ck","ck-list__group",i.if("isVisible","ck-hidden",n=>!n)]},children:this.children})}focus(){/* v8 ignore else -- @preserve */if(this.items){let e=this.items.find(t=>!(t instanceof fh));e&&e.focus()}}};/** +*/var Rl=class extends R{labelView;items;children;constructor(e,t=new ut){super(e);let i=this.bindTemplate,o=new Ci(e);this.set({label:"",isVisible:!0}),this.labelView=t,this.labelView.bind("text").to(this,"label"),this.children=this.createCollection(),this.children.addMany([this.labelView,o]),o.set({role:"group",ariaLabelledBy:t.id}),o.focusTracker.destroy(),o.keystrokes.destroy(),this.items=o.items,this.setTemplate({tag:"li",attributes:{role:"presentation",class:["ck","ck-list__group",i.if("isVisible","ck-hidden",n=>!n)]},children:this.children})}focus(){/* v8 ignore else -- @preserve */if(this.items){let e=this.items.find(t=>!(t instanceof gh));e&&e.focus()}}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var vi=class extends R{focusables;items;focusTracker;keystrokes;_focusCycler;_listItemGroupToChangeListeners=new WeakMap;constructor(e){super(e);let t=this.bindTemplate;this.focusables=new be,this.items=this.createCollection(),this.focusTracker=new Q,this.keystrokes=new X,this._focusCycler=new Ie({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",void 0),this.set("role",void 0),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"],role:t.to("role"),"aria-label":t.to("ariaLabel"),"aria-labelledby":t.to("ariaLabelledBy")},children:this.items})}render(){super.render();for(let e of this.items)e instanceof Pl?this._registerFocusableItemsGroup(e):e instanceof ot&&this._registerFocusableListItem(e);this.items.on("change",(e,t)=>{for(let i of t.removed)i instanceof Pl?this._deregisterFocusableItemsGroup(i):i instanceof ot&&this._deregisterFocusableListItem(i);for(let i of Array.from(t.added).reverse())i instanceof Pl?this._registerFocusableItemsGroup(i,t.index):this._registerFocusableListItem(i,t.index)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_registerFocusableListItem(e,t){this.focusTracker.add(e.element),this.focusables.add(e,t)}_deregisterFocusableListItem(e){this.focusTracker.remove(e.element),this.focusables.remove(e)}_getOnGroupItemsChangeCallback(e){return(t,i)=>{for(let o of i.removed)this._deregisterFocusableListItem(o);for(let o of Array.from(i.added).reverse())this._registerFocusableListItem(o,this.items.getIndex(e)+i.index)}}_registerFocusableItemsGroup(e,t){Array.from(e.items).forEach((o,n)=>{let s=typeof t<"u"?t+n:void 0;this._registerFocusableListItem(o,s)});let i=this._getOnGroupItemsChangeCallback(e);this._listItemGroupToChangeListeners.set(e,i),e.items.on("change",i)}_deregisterFocusableItemsGroup(e){for(let t of e.items)this._deregisterFocusableListItem(t);e.items.off("change",this._listItemGroupToChangeListeners.get(e)),this._listItemGroupToChangeListeners.delete(e)}};/** +*/var Ci=class extends R{focusables;items;focusTracker;keystrokes;_focusCycler;_listItemGroupToChangeListeners=new WeakMap;constructor(e){super(e);let t=this.bindTemplate;this.focusables=new we,this.items=this.createCollection(),this.focusTracker=new Q,this.keystrokes=new X,this._focusCycler=new Pe({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"arrowup",focusNext:"arrowdown"}}),this.set("ariaLabel",void 0),this.set("ariaLabelledBy",void 0),this.set("role",void 0),this.setTemplate({tag:"ul",attributes:{class:["ck","ck-reset","ck-list"],role:t.to("role"),"aria-label":t.to("ariaLabel"),"aria-labelledby":t.to("ariaLabelledBy")},children:this.items})}render(){super.render();for(let e of this.items)e instanceof Rl?this._registerFocusableItemsGroup(e):e instanceof ot&&this._registerFocusableListItem(e);this.items.on("change",(e,t)=>{for(let i of t.removed)i instanceof Rl?this._deregisterFocusableItemsGroup(i):i instanceof ot&&this._deregisterFocusableListItem(i);for(let i of Array.from(t.added).reverse())i instanceof Rl?this._registerFocusableItemsGroup(i,t.index):this._registerFocusableListItem(i,t.index)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}focusFirst(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}_registerFocusableListItem(e,t){this.focusTracker.add(e.element),this.focusables.add(e,t)}_deregisterFocusableListItem(e){this.focusTracker.remove(e.element),this.focusables.remove(e)}_getOnGroupItemsChangeCallback(e){return(t,i)=>{for(let o of i.removed)this._deregisterFocusableListItem(o);for(let o of Array.from(i.added).reverse())this._registerFocusableListItem(o,this.items.getIndex(e)+i.index)}}_registerFocusableItemsGroup(e,t){Array.from(e.items).forEach((o,n)=>{let s=typeof t<"u"?t+n:void 0;this._registerFocusableListItem(o,s)});let i=this._getOnGroupItemsChangeCallback(e);this._listItemGroupToChangeListeners.set(e,i),e.items.on("change",i)}_deregisterFocusableItemsGroup(e){for(let t of e.items)this._deregisterFocusableListItem(t);e.items.off("change",this._listItemGroupToChangeListeners.get(e)),this._listItemGroupToChangeListeners.delete(e)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -908,76 +908,76 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var kw=class extends R{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}};/** +*/var xw=class extends R{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__separator"]}})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var K9=class extends R{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}};/** +*/var J9=class extends R{constructor(e){super(e),this.setTemplate({tag:"span",attributes:{class:["ck","ck-toolbar__line-break"]}})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function G9(e){return e.bindTemplate.to(t=>{t.target===e.element&&t.preventDefault()})}/** +*/function Z9(e){return e.bindTemplate.to(t=>{t.target===e.element&&t.preventDefault()})}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function J9(e){if(Array.isArray(e))return{items:e,removeItems:[]};let t={items:[],removeItems:[]};return e?{...t,...e}:t}/** +*/function Q9(e){if(Array.isArray(e))return{items:e,removeItems:[]};let t={items:[],removeItems:[]};return e?{...t,...e}:t}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Z9={alignLeft:ml,bold:gl,importExport:q1,paragraph:zd,plus:ob,text:gb,threeVerticalDots:bl,pilcrow:ib,dragIndicator:N1},dt=class extends R{options;items;focusTracker;keystrokes;itemsView;children;focusables;_focusCycler;_behavior;constructor(e,t){super(e);let i=this.bindTemplate,o=this.t;this.options=t||{},this.set("ariaLabel",o("Editor toolbar")),this.set("maxWidth","auto"),this.set("role","toolbar"),this.set("isGrouping",!!this.options.shouldGroupWhenFull),this.items=this.createCollection(),this.focusTracker=new Q,this.keystrokes=new X,this.set("class",void 0),this.set("isCompact",!1),this.set("isVertical",!1),this.itemsView=new Q9(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();let n=e.uiLanguageDirection==="rtl";this._focusCycler=new Ie({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[n?"arrowright":"arrowleft","arrowup"],focusNext:[n?"arrowleft":"arrowright","arrowdown"]}});let s=["ck","ck-toolbar",i.to("class"),i.if("isCompact","ck-toolbar_compact"),i.if("isGrouping","ck-toolbar_grouping"),i.if("isVertical","ck-toolbar_vertical")];this.options.shouldGroupWhenFull&&this.options.isFloating&&s.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:s,role:i.to("role"),"aria-label":i.to("ariaLabel"),style:{maxWidth:i.to("maxWidth")},tabindex:-1},children:this.children,on:{mousedown:G9(this)}}),this._behavior=this.options.shouldGroupWhenFull?new jb(this):new $b(this)}render(){super.render(),this.focusTracker.add(this.element);for(let e of this.items)this.focusTracker.add(e);this.items.on("add",(e,t)=>{this.focusTracker.add(t)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t,i){this.items.addMany(this._buildItemsFromConfig(e,t,i))}switchBehavior(e){this._behavior.type!==e&&(this._behavior.destroy(),this.itemsView.children.clear(),this.focusables.clear(),e==="dynamic"?(this._behavior=new jb(this),this._behavior.render(this),this._behavior.refreshItems()):(this._behavior=new $b(this),this._behavior.render(this)))}_buildItemsFromConfig(e,t,i){let o=J9(e),n=i||o.removeItems;return this._cleanItemsConfiguration(o.items,t,n).map(s=>ae(s)?this._createNestedToolbarDropdown(s,t,n):s==="|"?new kw:s==="-"?new K9:t.create(s)).filter(s=>!!s)}_cleanItemsConfiguration(e,t,i){let o=e.filter((n,s,r)=>n==="|"?!0:i.indexOf(n)!==-1?!1:n==="-"?this.options.shouldGroupWhenFull?(D("toolbarview-line-break-ignored-when-grouping-items",r),!1):!0:!ae(n)&&!t.has(n)?(D("toolbarview-item-unavailable",{item:n}),!1):!0);return this._cleanSeparatorsAndLineBreaks(o)}_cleanSeparatorsAndLineBreaks(e){let t=s=>s!=="-"&&s!=="|",i=e.length,o=e.findIndex(t);if(o===-1)return[];let n=i-e.slice().reverse().findIndex(t);return e.slice(o,n).filter((s,r,a)=>t(s)?!0:!(r>0&&a[r-1]===s))}_createNestedToolbarDropdown(e,t,i){let{label:o,icon:n,items:s,tooltip:r=!0,withText:a=!1}=e;if(s=this._cleanItemsConfiguration(s,t,i),!s.length)return null;let l=this.locale,c=Se(l);return o||D("toolbarview-nested-toolbar-dropdown-missing-label",e),c.class="ck-toolbar__nested-toolbar-dropdown",c.buttonView.set({label:o,tooltip:r,withText:!!a}),n!==!1?c.buttonView.icon=Z9[n]||n||bl:c.buttonView.withText=!0,Gn(c,()=>c.toolbarView._buildItemsFromConfig(s,t,i)),c}},Q9=class extends R{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}},$b=class{type="static";constructor(e){e.isGrouping=!1,e.itemsView.children.bindTo(e.items).using(t=>t),e.focusables.bindTo(e.items).using(t=>pr(t)?t:null)}render(){}destroy(){}},jb=class{type="dynamic";view;viewChildren;viewFocusables;viewItemsView;viewFocusTracker;viewLocale;ungroupedItems;groupedItems;groupedItemsDropdown;resizeObserver=null;cachedPadding=null;shouldUpdateGroupingOnNextResize=!1;viewElement;constructor(e){this.view=e,this.viewChildren=e.children,this.viewFocusables=e.focusables,this.viewItemsView=e.itemsView,this.viewFocusTracker=e.focusTracker,this.viewLocale=e.locale,this.view.isGrouping=!0,this.ungroupedItems=e.createCollection(),this.groupedItems=e.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),e.itemsView.children.bindTo(this.ungroupedItems).using(t=>t),this.ungroupedItems.on("change",this._updateFocusCyclableItems.bind(this)),e.children.on("change",this._updateFocusCyclableItems.bind(this)),e.items.on("change",(t,i)=>{let o=i.index,n=Array.from(i.added);for(let s of i.removed)o>=this.ungroupedItems.length?this.groupedItems.remove(s):this.ungroupedItems.remove(s);for(let s=o;sthis.ungroupedItems.length?this.groupedItems.add(r,s-this.ungroupedItems.length):this.ungroupedItems.add(r,s)}this._updateGrouping()})}render(e){this.viewElement=e.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(e)}destroy(){this.groupedItemsDropdown.destroy(),this.viewChildren.length>1&&(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last)),this.resizeObserver.destroy()}refreshItems(){let e=this.view;if(e.items.length){for(let t=0;to.right-this.cachedPadding+n:i.left{(!e||e!==t.contentRect.width||this.shouldUpdateGroupingOnNextResize)&&(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),e=t.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new kw),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(){let e=this.viewLocale,t=e.t,i=Se(e);return i.class="ck-toolbar__grouped-dropdown",i.panelPosition=e.uiLanguageDirection==="ltr"?"sw":"se",Gn(i,this.groupedItems),i.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:e.uiLanguageDirection==="rtl"?"se":"sw",icon:bl}),i}_updateFocusCyclableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(e=>{pr(e)&&this.viewFocusables.add(e)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}};/** +*/var Y9={alignLeft:gl,bold:pl,importExport:j1,paragraph:Wd,plus:sb,text:bb,threeVerticalDots:wl,pilcrow:nb,dragIndicator:H1},dt=class extends R{options;items;focusTracker;keystrokes;itemsView;children;focusables;_focusCycler;_behavior;constructor(e,t){super(e);let i=this.bindTemplate,o=this.t;this.options=t||{},this.set("ariaLabel",o("Editor toolbar")),this.set("maxWidth","auto"),this.set("role","toolbar"),this.set("isGrouping",!!this.options.shouldGroupWhenFull),this.items=this.createCollection(),this.focusTracker=new Q,this.keystrokes=new X,this.set("class",void 0),this.set("isCompact",!1),this.set("isVertical",!1),this.itemsView=new X9(e),this.children=this.createCollection(),this.children.add(this.itemsView),this.focusables=this.createCollection();let n=e.uiLanguageDirection==="rtl";this._focusCycler=new Pe({focusables:this.focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:[n?"arrowright":"arrowleft","arrowup"],focusNext:[n?"arrowleft":"arrowright","arrowdown"]}});let s=["ck","ck-toolbar",i.to("class"),i.if("isCompact","ck-toolbar_compact"),i.if("isGrouping","ck-toolbar_grouping"),i.if("isVertical","ck-toolbar_vertical")];this.options.shouldGroupWhenFull&&this.options.isFloating&&s.push("ck-toolbar_floating"),this.setTemplate({tag:"div",attributes:{class:s,role:i.to("role"),"aria-label":i.to("ariaLabel"),style:{maxWidth:i.to("maxWidth")},tabindex:-1},children:this.children,on:{mousedown:Z9(this)}}),this._behavior=this.options.shouldGroupWhenFull?new Gb(this):new Kb(this)}render(){super.render(),this.focusTracker.add(this.element);for(let e of this.items)this.focusTracker.add(e);this.items.on("add",(e,t)=>{this.focusTracker.add(t)}),this.items.on("remove",(e,t)=>{this.focusTracker.remove(t)}),this.keystrokes.listenTo(this.element),this._behavior.render(this)}destroy(){return this._behavior.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy(),super.destroy()}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}fillFromConfig(e,t,i){this.items.addMany(this._buildItemsFromConfig(e,t,i))}switchBehavior(e){this._behavior.type!==e&&(this._behavior.destroy(),this.itemsView.children.clear(),this.focusables.clear(),e==="dynamic"?(this._behavior=new Gb(this),this._behavior.render(this),this._behavior.refreshItems()):(this._behavior=new Kb(this),this._behavior.render(this)))}_buildItemsFromConfig(e,t,i){let o=Q9(e),n=i||o.removeItems;return this._cleanItemsConfiguration(o.items,t,n).map(s=>ae(s)?this._createNestedToolbarDropdown(s,t,n):s==="|"?new xw:s==="-"?new J9:t.create(s)).filter(s=>!!s)}_cleanItemsConfiguration(e,t,i){let o=e.filter((n,s,r)=>n==="|"?!0:i.indexOf(n)!==-1?!1:n==="-"?this.options.shouldGroupWhenFull?(D("toolbarview-line-break-ignored-when-grouping-items",r),!1):!0:!ae(n)&&!t.has(n)?(D("toolbarview-item-unavailable",{item:n}),!1):!0);return this._cleanSeparatorsAndLineBreaks(o)}_cleanSeparatorsAndLineBreaks(e){let t=s=>s!=="-"&&s!=="|",i=e.length,o=e.findIndex(t);if(o===-1)return[];let n=i-e.slice().reverse().findIndex(t);return e.slice(o,n).filter((s,r,a)=>t(s)?!0:!(r>0&&a[r-1]===s))}_createNestedToolbarDropdown(e,t,i){let{label:o,icon:n,items:s,tooltip:r=!0,withText:a=!1}=e;if(s=this._cleanItemsConfiguration(s,t,i),!s.length)return null;let l=this.locale,c=ye(l);return o||D("toolbarview-nested-toolbar-dropdown-missing-label",e),c.class="ck-toolbar__nested-toolbar-dropdown",c.buttonView.set({label:o,tooltip:r,withText:!!a}),n!==!1?c.buttonView.icon=Y9[n]||n||wl:c.buttonView.withText=!0,Gn(c,()=>c.toolbarView._buildItemsFromConfig(s,t,i)),c}},X9=class extends R{children;constructor(e){super(e),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-toolbar__items"]},children:this.children})}},Kb=class{type="static";constructor(e){e.isGrouping=!1,e.itemsView.children.bindTo(e.items).using(t=>t),e.focusables.bindTo(e.items).using(t=>pr(t)?t:null)}render(){}destroy(){}},Gb=class{type="dynamic";view;viewChildren;viewFocusables;viewItemsView;viewFocusTracker;viewLocale;ungroupedItems;groupedItems;groupedItemsDropdown;resizeObserver=null;cachedPadding=null;shouldUpdateGroupingOnNextResize=!1;viewElement;constructor(e){this.view=e,this.viewChildren=e.children,this.viewFocusables=e.focusables,this.viewItemsView=e.itemsView,this.viewFocusTracker=e.focusTracker,this.viewLocale=e.locale,this.view.isGrouping=!0,this.ungroupedItems=e.createCollection(),this.groupedItems=e.createCollection(),this.groupedItemsDropdown=this._createGroupedItemsDropdown(),e.itemsView.children.bindTo(this.ungroupedItems).using(t=>t),this.ungroupedItems.on("change",this._updateFocusCyclableItems.bind(this)),e.children.on("change",this._updateFocusCyclableItems.bind(this)),e.items.on("change",(t,i)=>{let o=i.index,n=Array.from(i.added);for(let s of i.removed)o>=this.ungroupedItems.length?this.groupedItems.remove(s):this.ungroupedItems.remove(s);for(let s=o;sthis.ungroupedItems.length?this.groupedItems.add(r,s-this.ungroupedItems.length):this.ungroupedItems.add(r,s)}this._updateGrouping()})}render(e){this.viewElement=e.element,this._enableGroupingOnResize(),this._enableGroupingOnMaxWidthChange(e)}destroy(){this.groupedItemsDropdown.destroy(),this.viewChildren.length>1&&(this.viewChildren.remove(this.groupedItemsDropdown),this.viewChildren.remove(this.viewChildren.last)),this.resizeObserver.destroy()}refreshItems(){let e=this.view;if(e.items.length){for(let t=0;to.right-this.cachedPadding+n:i.left{(!e||e!==t.contentRect.width||this.shouldUpdateGroupingOnNextResize)&&(this.shouldUpdateGroupingOnNextResize=!1,this._updateGrouping(),e=t.contentRect.width)}),this._updateGrouping()}_enableGroupingOnMaxWidthChange(e){e.on("change:maxWidth",()=>{this._updateGrouping()})}_groupLastItem(){this.groupedItems.length||(this.viewChildren.add(new xw),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(){let e=this.viewLocale,t=e.t,i=ye(e);return i.class="ck-toolbar__grouped-dropdown",i.panelPosition=e.uiLanguageDirection==="ltr"?"sw":"se",Gn(i,this.groupedItems),i.buttonView.set({label:t("Show more items"),tooltip:!0,tooltipPosition:e.uiLanguageDirection==="rtl"?"se":"sw",icon:wl}),i}_updateFocusCyclableItems(){this.viewFocusables.clear(),this.ungroupedItems.map(e=>{pr(e)&&this.viewFocusables.add(e)}),this.groupedItems.length&&this.viewFocusables.add(this.groupedItemsDropdown)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var So=class extends R{children;actionView;arrowView;keystrokes;focusTracker;constructor(e,t){super(e);let i=this.bindTemplate;this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke",void 0),this.set("withKeystroke",!1),this.set("label",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(t),this.arrowView=this._createArrowView(),this.keystrokes=new X,this.focusTracker=new Q,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",i.to("class"),i.if("isVisible","ck-hidden",o=>!o),this.arrowView.bindTemplate.if("isOn","ck-splitbutton_open")]},children:this.children})}render(){super.render(),this.children.add(this.actionView),this.children.add(this.arrowView),this.focusTracker.add(this.actionView.element),this.focusTracker.add(this.arrowView.element),this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",(e,t)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),t())}),this.keystrokes.set("arrowleft",(e,t)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),t())})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.actionView.focus()}_createActionView(e){let t=e||new I;return e||t.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),t.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),t.delegate("execute").to(this),t}_createArrowView(){let e=new I,t=e.bindTemplate;return e.icon=cr,e.extendTemplate({attributes:{class:["ck-splitbutton__arrow"],"data-cke-tooltip-disabled":t.to("isOn"),"aria-haspopup":!0,"aria-expanded":t.to("isOn",i=>String(i))}}),e.bind("isEnabled").to(this),e.bind("label").to(this),e.bind("tooltip").to(this),e.delegate("execute").to(this,"open"),e}};/** +*/var xi=class extends R{children;actionView;arrowView;keystrokes;focusTracker;constructor(e,t){super(e);let i=this.bindTemplate;this.set("class",void 0),this.set("labelStyle",void 0),this.set("icon",void 0),this.set("isEnabled",!0),this.set("isOn",!1),this.set("isToggleable",!1),this.set("isVisible",!0),this.set("keystroke",void 0),this.set("withKeystroke",!1),this.set("label",void 0),this.set("tabindex",-1),this.set("tooltip",!1),this.set("tooltipPosition","s"),this.set("type","button"),this.set("withText",!1),this.children=this.createCollection(),this.actionView=this._createActionView(t),this.arrowView=this._createArrowView(),this.keystrokes=new X,this.focusTracker=new Q,this.setTemplate({tag:"div",attributes:{class:["ck","ck-splitbutton",i.to("class"),i.if("isVisible","ck-hidden",o=>!o),this.arrowView.bindTemplate.if("isOn","ck-splitbutton_open")]},children:this.children})}render(){super.render(),this.children.add(this.actionView),this.children.add(this.arrowView),this.focusTracker.add(this.actionView.element),this.focusTracker.add(this.arrowView.element),this.keystrokes.listenTo(this.element),this.keystrokes.set("arrowright",(e,t)=>{this.focusTracker.focusedElement===this.actionView.element&&(this.arrowView.focus(),t())}),this.keystrokes.set("arrowleft",(e,t)=>{this.focusTracker.focusedElement===this.arrowView.element&&(this.actionView.focus(),t())})}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this.actionView.focus()}_createActionView(e){let t=e||new I;return e||t.bind("icon","isEnabled","isOn","isToggleable","keystroke","label","tabindex","tooltip","tooltipPosition","type","withText").to(this),t.extendTemplate({attributes:{class:"ck-splitbutton__action"}}),t.delegate("execute").to(this),t}_createArrowView(){let e=new I,t=e.bindTemplate;return e.icon=cr,e.extendTemplate({attributes:{class:["ck-splitbutton__arrow"],"data-cke-tooltip-disabled":t.to("isOn"),"aria-haspopup":!0,"aria-expanded":t.to("isOn",i=>String(i))}}),e.bind("isEnabled").to(this),e.bind("label").to(this),e.bind("tooltip").to(this),e.delegate("execute").to(this,"open"),e}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Se(e,t=Ml){let i=typeof t=="function"?new t(e):t,o=new $9(e),n=new j9(e,i,o);return i.bind("isEnabled").to(n),i instanceof So?i.arrowView.bind("isOn").to(n,"isOpen"):i.bind("isOn").to(n,"isOpen"),Y9(n),n}function Gn(e,t,i={}){e.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.isOpen?Kb(e,t,i):e.once("change:isOpen",()=>Kb(e,t,i),{priority:"highest"}),i.enableActiveItemFocusOnDropdownOpen&&mh(e,()=>e.toolbarView.items.find(o=>o.isOn))}function Kb(e,t,i){let o=e.locale,n=o.t,s=e.toolbarView=new dt(o),r=typeof t=="function"?t():t;s.ariaLabel=i.ariaLabel||n("Dropdown toolbar"),i.maxWidth&&(s.maxWidth=i.maxWidth),i.class&&(s.class=i.class),i.isCompact&&(s.isCompact=i.isCompact),i.isVertical&&(s.isVertical=!0),r instanceof be?s.items.bindTo(r).using(a=>a):s.items.addMany(r),e.panelView.children.add(s),e.focusTracker.add(s),s.items.delegate("execute").to(e)}function Bt(e,t,i={}){e.isOpen?Gb(e,t,i):e.once("change:isOpen",()=>Gb(e,t,i),{priority:"highest"}),mh(e,()=>e.listView.items.find(o=>o instanceof ot?o.children.first.isOn:!1))}function Gb(e,t,i){let o=e.locale,n=e.listView=new vi(o),s=typeof t=="function"?t():t;n.ariaLabel=i.ariaLabel,n.role=i.role,xw(e,n.items,s,o),e.panelView.children.add(n),n.items.delegate("execute").to(e)}function mh(e,t){e.on("change:isOpen",()=>{if(!e.isOpen)return;let i=t();i&&(typeof i.focus=="function"?i.focus():D("ui-dropdown-focus-child-on-open-child-missing-focus",{view:i}))},{priority:le.low-10})}function Y9(e){X9(e),eT(e),tT(e),iT(e),oT(e),nT(e)}function X9(e){vt({emitter:e,activator:()=>e.isRendered&&e.isOpen,callback:()=>{e.isOpen=!1},contextElements:()=>[e.element,...Cw(e.focusTracker).filter(t=>!rt(e.element,t))]})}function Cw(e){return[...e.elements,...e.externalViews.flatMap(t=>Cw(t.focusTracker))]}function eT(e){e.on("execute",t=>{t.source instanceof Io||(e.isOpen=!1)})}function tT(e){e.focusTracker.on("change:isFocused",(t,i,o)=>{o||!e.isOpen||(e.isOpen=!1)})}function iT(e){e.keystrokes.set("arrowdown",(t,i)=>{e.isOpen&&(e.panelView.focus(),i())}),e.keystrokes.set("arrowup",(t,i)=>{e.isOpen&&(e.panelView.focusLast(),i())})}function oT(e){e.on("change:isOpen",(t,i,o)=>{o||e.focusTracker.elements.some(n=>n.contains(zi(n)))&&e.buttonView.focus()})}function nT(e){e.on("change:isOpen",(t,i,o)=>{o&&e.panelView.focus()},{priority:"low"})}function xw(e,t,i,o){sT(t),t.bindTo(i).using(n=>{if(n.type==="separator")return new fh(o);if(n.type==="group"){let s=new Pl(o);return s.set({label:n.label}),xw(e,s.items,n.items,o),s.items.delegate("execute").to(e),s}else if(n.type==="button"||n.type==="switchbutton"){let s=n.model.role==="menuitemcheckbox"||n.model.role==="menuitemradio",r=new ot(o),a;return n.type==="button"?(a=new ji(o,n.labelView),a.set({isToggleable:s})):a=new Io(o),a.bind(...Object.keys(n.model)).to(n.model),a.delegate("execute").to(r),r.children.add(a),r}return null})}function sT(e){let t=0,i=s=>!(s instanceof ot)||!(s.children.first instanceof ji)?null:s.children.first,o=s=>{let r=i(s);return!r||!r.isToggleable?null:r},n=s=>{for(let r of e){let a=i(r);a&&(a.hasCheckSpace=s)}};e.on("change",(s,r)=>{let a=t>0;for(let c of r.removed)o(c)&&t--;for(let c of r.added){let u=i(c);u&&(u.isToggleable&&t++,u.hasCheckSpace=t>0)}let l=t>0;a!==l&&n(l)})}/** +*/function ye(e,t=Bl){let i=typeof t=="function"?new t(e):t,o=new K9(e),n=new G9(e,i,o);return i.bind("isEnabled").to(n),i instanceof xi?i.arrowView.bind("isOn").to(n,"isOpen"):i.bind("isOn").to(n,"isOpen"),eT(n),n}function Gn(e,t,i={}){e.extendTemplate({attributes:{class:["ck-toolbar-dropdown"]}}),e.isOpen?Jb(e,t,i):e.once("change:isOpen",()=>Jb(e,t,i),{priority:"highest"}),i.enableActiveItemFocusOnDropdownOpen&&ph(e,()=>e.toolbarView.items.find(o=>o.isOn))}function Jb(e,t,i){let o=e.locale,n=o.t,s=e.toolbarView=new dt(o),r=typeof t=="function"?t():t;s.ariaLabel=i.ariaLabel||n("Dropdown toolbar"),i.maxWidth&&(s.maxWidth=i.maxWidth),i.class&&(s.class=i.class),i.isCompact&&(s.isCompact=i.isCompact),i.isVertical&&(s.isVertical=!0),r instanceof we?s.items.bindTo(r).using(a=>a):s.items.addMany(r),e.panelView.children.add(s),e.focusTracker.add(s),s.items.delegate("execute").to(e)}function ht(e,t,i={}){e.isOpen?Zb(e,t,i):e.once("change:isOpen",()=>Zb(e,t,i),{priority:"highest"}),ph(e,()=>e.listView.items.find(o=>o instanceof ot?o.children.first.isOn:!1))}function Zb(e,t,i){let o=e.locale,n=e.listView=new Ci(o),s=typeof t=="function"?t():t;n.ariaLabel=i.ariaLabel,n.role=i.role,Ew(e,n.items,s,o),e.panelView.children.add(n),n.items.delegate("execute").to(e)}function ph(e,t){e.on("change:isOpen",()=>{if(!e.isOpen)return;let i=t();i&&(typeof i.focus=="function"?i.focus():D("ui-dropdown-focus-child-on-open-child-missing-focus",{view:i}))},{priority:le.low-10})}function eT(e){tT(e),iT(e),oT(e),nT(e),sT(e),rT(e)}function tT(e){kt({emitter:e,activator:()=>e.isRendered&&e.isOpen,callback:()=>{e.isOpen=!1},contextElements:()=>[e.element,...Tw(e.focusTracker).filter(t=>!rt(e.element,t))]})}function Tw(e){return[...e.elements,...e.externalViews.flatMap(t=>Tw(t.focusTracker))]}function iT(e){e.on("execute",t=>{t.source instanceof So||(e.isOpen=!1)})}function oT(e){e.focusTracker.on("change:isFocused",(t,i,o)=>{o||!e.isOpen||(e.isOpen=!1)})}function nT(e){e.keystrokes.set("arrowdown",(t,i)=>{e.isOpen&&(e.panelView.focus(),i())}),e.keystrokes.set("arrowup",(t,i)=>{e.isOpen&&(e.panelView.focusLast(),i())})}function sT(e){e.on("change:isOpen",(t,i,o)=>{o||e.focusTracker.elements.some(n=>n.contains(Wi(n)))&&e.buttonView.focus()})}function rT(e){e.on("change:isOpen",(t,i,o)=>{o&&e.panelView.focus()},{priority:"low"})}function Ew(e,t,i,o){aT(t),t.bindTo(i).using(n=>{if(n.type==="separator")return new gh(o);if(n.type==="group"){let s=new Rl(o);return s.set({label:n.label}),Ew(e,s.items,n.items,o),s.items.delegate("execute").to(e),s}else if(n.type==="button"||n.type==="switchbutton"){let s=n.model.role==="menuitemcheckbox"||n.model.role==="menuitemradio",r=new ot(o),a;return n.type==="button"?(a=new Gi(o,n.labelView),a.set({isToggleable:s})):a=new So(o),a.bind(...Object.keys(n.model)).to(n.model),a.delegate("execute").to(r),r.children.add(a),r}return null})}function aT(e){let t=0,i=s=>!(s instanceof ot)||!(s.children.first instanceof Gi)?null:s.children.first,o=s=>{let r=i(s);return!r||!r.isToggleable?null:r},n=s=>{for(let r of e){let a=i(r);a&&(a.hasCheckSpace=s)}};e.on("change",(s,r)=>{let a=t>0;for(let c of r.removed)o(c)&&t--;for(let c of r.added){let u=i(c);u&&(u.isToggleable&&t++,u.hasCheckSpace=t>0)}let l=t>0;a!==l&&n(l)})}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var nt=(e,t,i)=>{let o=new hh(e.locale);return o.set({id:t,ariaDescribedById:i}),o.bind("isReadOnly").to(e,"isEnabled",n=>!n),o.bind("hasError").to(e,"errorText",n=>!!n),o.on("input",()=>{e.errorText=null}),e.bind("isEmpty","isFocused","placeholder").to(o),o},gh=(e,t,i)=>{let o=new q9(e.locale);return o.set({id:t,ariaDescribedById:i,inputMode:"numeric"}),o.bind("isReadOnly").to(e,"isEnabled",n=>!n),o.bind("hasError").to(e,"errorText",n=>!!n),o.on("input",()=>{e.errorText=null}),e.bind("isEmpty","isFocused","placeholder").to(o),o};var Bl=(e,t,i)=>{let o=Se(e.locale);return o.set({id:t,ariaDescribedById:i}),o.bind("isEnabled").to(e),o};/** +*/var nt=(e,t,i)=>{let o=new mh(e.locale);return o.set({id:t,ariaDescribedById:i}),o.bind("isReadOnly").to(e,"isEnabled",n=>!n),o.bind("hasError").to(e,"errorText",n=>!!n),o.on("input",()=>{e.errorText=null}),e.bind("isEmpty","isFocused","placeholder").to(o),o},bh=(e,t,i)=>{let o=new j9(e.locale);return o.set({id:t,ariaDescribedById:i,inputMode:"numeric"}),o.bind("isReadOnly").to(e,"isEnabled",n=>!n),o.bind("hasError").to(e,"errorText",n=>!!n),o.on("input",()=>{e.errorText=null}),e.bind("isEmpty","isFocused","placeholder").to(o),o};var Ol=(e,t,i)=>{let o=ye(e.locale);return o.set({id:t,ariaDescribedById:i}),o.bind("isEnabled").to(e),o};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var rT=150,aT=class extends R{hexInputRow;_debounceColorPickerEvent;_config;constructor(e,t={}){super(e),this.set({color:"",_hexColor:""}),this.hexInputRow=this._createInputRow();let i=this.createCollection();t.hideInput||i.add(this.hexInputRow),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker"],tabindex:-1},children:i}),this._config=t,this._debounceColorPickerEvent=ye(o=>{this.set("color",o),this.fire("colorSelected",{color:this.color})},rT,{leading:!0}),this.on("set:color",(o,n,s)=>{o.return=yw(s,this._config.format||"hsl")}),this.on("change:color",()=>{this._hexColor=th(this.color)}),this.on("change:_hexColor",()=>{zi(this.picker)!==this.picker&&this.picker.setAttribute("color",this._hexColor),th(this.color)!=th(this._hexColor)&&(this.color=this._hexColor)})}render(){super.render(),N9("hex-color-picker",Tl),this.picker=S.document.createElement("hex-color-picker"),this.picker.setAttribute("class","hex-color-picker"),this.picker.setAttribute("tabindex","-1"),this._createSlidersView();/* v8 ignore else -- @preserve */if(this.element){this.hexInputRow.element?this.element.insertBefore(this.picker,this.hexInputRow.element):this.element.appendChild(this.picker);let e=document.createElement("style");e.textContent='[role="slider"]:focus [part$="pointer"] {border: 1px solid #fff;outline: 1px solid var(--ck-color-focus-border);box-shadow: 0 0 0 2px #fff;}',this.picker.shadowRoot.appendChild(e)}this.picker.addEventListener("color-changed",e=>{let t=e.detail.value;this._debounceColorPickerEvent(t)})}focus(){/* v8 ignore next -- @preserve */!this._config.hideInput&&(V.isGecko||V.isiOS||V.isSafari||V.isBlink)&&this.hexInputRow.children.get(1).focus(),this.slidersView.first.focus()}_createSlidersView(){let e=[...this.picker.shadowRoot.children].filter(t=>t.getAttribute("role")==="slider").map(t=>new lT(t));this.slidersView=this.createCollection(),e.forEach(t=>{this.slidersView.add(t)})}_createInputRow(){let e=this._createColorInput();return new uT(this.locale,e)}_createColorInput(){let e=new ue(this.locale,nt),{t}=this.locale;return e.set({label:t("HEX"),class:"color-picker-hex-input"}),e.fieldView.bind("value").to(this,"_hexColor",i=>e.isFocused?e.fieldView.value:i.startsWith("#")?i.substring(1):i),e.fieldView.on("input",()=>{let i=e.fieldView.element.value;if(i){let o=Tw(i);o&&this._debounceColorPickerEvent(o)}}),e}isValid(){let{t:e}=this.locale;return this._config.hideInput?!0:(this.resetValidationStatus(),this.hexInputRow.getParsedColor()?!0:(this.hexInputRow.inputView.errorText=e('Please enter a valid color (e.g. "ff0000").'),!1))}resetValidationStatus(){this.hexInputRow.inputView.errorText=null}};function th(e){let t=F9(e);return t||(t="#000"),t.length===4&&(t="#"+[t[1],t[1],t[2],t[2],t[3],t[3]].join("")),t.toLowerCase()}var lT=class extends R{constructor(e){super(),this.element=e}focus(){this.element.focus()}},cT=class extends R{constructor(e){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__hash-view"]},children:"#"})}},uT=class extends R{children;inputView;constructor(e,t){super(e),this.inputView=t,this.children=this.createCollection([new cT,this.inputView]),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__row"]},children:this.children})}getParsedColor(){return Tw(this.inputView.fieldView.element.value)}};function Tw(e){if(!e)return null;let t=e.trim().replace(/^#/,"");return![3,4,6,8].includes(t.length)||!/^(([0-9a-fA-F]{2}){3,4}|([0-9a-fA-F]){3,4})$/.test(t)?null:`#${t}`}/** +*/var lT=150,cT=class extends R{hexInputRow;_debounceColorPickerEvent;_config;constructor(e,t={}){super(e),this.set({color:"",_hexColor:""}),this.hexInputRow=this._createInputRow();let i=this.createCollection();t.hideInput||i.add(this.hexInputRow),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker"],tabindex:-1},children:i}),this._config=t,this._debounceColorPickerEvent=ve(o=>{this.set("color",o),this.fire("colorSelected",{color:this.color})},lT,{leading:!0}),this.on("set:color",(o,n,s)=>{o.return=vw(s,this._config.format||"hsl")}),this.on("change:color",()=>{this._hexColor=oh(this.color)}),this.on("change:_hexColor",()=>{Wi(this.picker)!==this.picker&&this.picker.setAttribute("color",this._hexColor),oh(this.color)!=oh(this._hexColor)&&(this.color=this._hexColor)})}render(){super.render(),H9("hex-color-picker",El),this.picker=S.document.createElement("hex-color-picker"),this.picker.setAttribute("class","hex-color-picker"),this.picker.setAttribute("tabindex","-1"),this._createSlidersView();/* v8 ignore else -- @preserve */if(this.element){this.hexInputRow.element?this.element.insertBefore(this.picker,this.hexInputRow.element):this.element.appendChild(this.picker);let e=document.createElement("style");e.textContent='[role="slider"]:focus [part$="pointer"] {border: 1px solid #fff;outline: 1px solid var(--ck-color-focus-border);box-shadow: 0 0 0 2px #fff;}',this.picker.shadowRoot.appendChild(e)}this.picker.addEventListener("color-changed",e=>{let t=e.detail.value;this._debounceColorPickerEvent(t)})}focus(){/* v8 ignore next -- @preserve */!this._config.hideInput&&(V.isGecko||V.isiOS||V.isSafari||V.isBlink)&&this.hexInputRow.children.get(1).focus(),this.slidersView.first.focus()}_createSlidersView(){let e=[...this.picker.shadowRoot.children].filter(t=>t.getAttribute("role")==="slider").map(t=>new uT(t));this.slidersView=this.createCollection(),e.forEach(t=>{this.slidersView.add(t)})}_createInputRow(){let e=this._createColorInput();return new hT(this.locale,e)}_createColorInput(){let e=new ue(this.locale,nt),{t}=this.locale;return e.set({label:t("HEX"),class:"color-picker-hex-input"}),e.fieldView.bind("value").to(this,"_hexColor",i=>e.isFocused?e.fieldView.value:i.startsWith("#")?i.substring(1):i),e.fieldView.on("input",()=>{let i=e.fieldView.element.value;if(i){let o=Aw(i);o&&this._debounceColorPickerEvent(o)}}),e}isValid(){let{t:e}=this.locale;return this._config.hideInput?!0:(this.resetValidationStatus(),this.hexInputRow.getParsedColor()?!0:(this.hexInputRow.inputView.errorText=e('Please enter a valid color (e.g. "ff0000").'),!1))}resetValidationStatus(){this.hexInputRow.inputView.errorText=null}};function oh(e){let t=z9(e);return t||(t="#000"),t.length===4&&(t="#"+[t[1],t[1],t[2],t[2],t[3],t[3]].join("")),t.toLowerCase()}var uT=class extends R{constructor(e){super(),this.element=e}focus(){this.element.focus()}},dT=class extends R{constructor(e){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__hash-view"]},children:"#"})}},hT=class extends R{children;inputView;constructor(e,t){super(e),this.inputView=t,this.children=this.createCollection([new dT,this.inputView]),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-picker__row"]},children:this.children})}getParsedColor(){return Aw(this.inputView.fieldView.element.value)}};function Aw(e){if(!e)return null;let t=e.trim().replace(/^#/,"");return![3,4,6,8].includes(t.length)||!/^(([0-9a-fA-F]{2}){3,4}|([0-9a-fA-F]){3,4})$/.test(t)?null:`#${t}`}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var dT=W(J),hT=class extends dT{constructor(e){super(e),this.set("isEmpty",!0),this.on("change",()=>{this.set("isEmpty",this.length===0)})}add(e,t){return this.find(i=>i.color===e.color)?this:super.add(e,t)}hasColor(e){return!!this.find(t=>t.color===e)}};/** +*/var fT=W(G),mT=class extends fT{constructor(e){super(e),this.set("isEmpty",!0),this.on("change",()=>{this.set("isEmpty",this.length===0)})}add(e,t){return this.find(i=>i.color===e.color)?this:super.add(e,t)}hasColor(e){return!!this.find(t=>t.color===e)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var fT=class extends R{items;colorDefinitions;focusTracker;columns;documentColors;documentColorsCount;staticColorsGrid;documentColorsGrid;colorPickerButtonView;removeColorButtonView;_focusables;_documentColorsLabel;_removeButtonLabel;_colorPickerLabel;constructor(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:s,colorPickerLabel:r,focusTracker:a,focusables:l}){super(e);let c=this.bindTemplate;this.set("isVisible",!0),this.focusTracker=a,this.items=this.createCollection(),this.colorDefinitions=t,this.columns=i,this.documentColors=new hT,this.documentColorsCount=s,this._focusables=l,this._removeButtonLabel=o,this._colorPickerLabel=r,this._documentColorsLabel=n,this.setTemplate({tag:"div",attributes:{class:["ck-color-grids-fragment",c.if("isVisible","ck-hidden",u=>!u)]},children:this.items}),this.removeColorButtonView=this._createRemoveColorButton(),this.items.add(this.removeColorButtonView)}updateDocumentColors(e,t){let i=e.document,o=this.documentColorsCount;this.documentColors.clear();for(let n of i.getRoots()){let s=e.createRangeIn(n);for(let r of s.getItems())if(r.is("$textProxy")&&r.hasAttribute(t)&&(this._addColorToDocumentColors(r.getAttribute(t)),this.documentColors.length>=o))return}}updateSelectedColors(){let e=this.documentColorsGrid,t=this.staticColorsGrid,i=this.selectedColor;t.selectedColor=i,e&&(e.selectedColor=i)}render(){if(super.render(),this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount){let e=_t.bind(this.documentColors,this.documentColors),t=new R(this.locale);t.setTemplate({tag:"span",attributes:{class:["ck","ck-color-grid__label",e.if("isEmpty","ck-hidden")]},children:[{text:this._documentColorsLabel}]}),this.items.add(t),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}this._createColorPickerButton(),this._addColorSelectorElementsToFocusTracker()}focus(){this.removeColorButtonView.focus()}destroy(){super.destroy()}addColorPickerButton(){this.colorPickerButtonView&&(this.items.add(this.colorPickerButtonView),this.focusTracker.add(this.colorPickerButtonView.element),this._focusables.add(this.colorPickerButtonView))}_addColorSelectorElementsToFocusTracker(){this.focusTracker.add(this.removeColorButtonView.element),this._focusables.add(this.removeColorButtonView);/* v8 ignore else -- @preserve */this.staticColorsGrid&&(this.focusTracker.add(this.staticColorsGrid.element),this._focusables.add(this.staticColorsGrid)),this.documentColorsGrid&&(this.focusTracker.add(this.documentColorsGrid.element),this._focusables.add(this.documentColorsGrid))}_createColorPickerButton(){this.colorPickerButtonView=new I,this.colorPickerButtonView.set({label:this._colorPickerLabel,withText:!0,icon:O1,class:"ck-color-selector__color-picker"}),this.colorPickerButtonView.on("execute",()=>{this.fire("colorPicker:show")})}_createRemoveColorButton(){let e=new I;return e.set({withText:!0,icon:z1,label:this._removeButtonLabel}),e.class="ck-color-selector__remove-color",e.on("execute",()=>{this.fire("execute",{value:null,source:"removeColorButton"})}),e.render(),e}_createStaticColorsGrid(){let e=new qb(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return e.on("execute",(t,i)=>{this.fire("execute",{value:i.value,source:"staticColorsGrid"})}),e}_createDocumentColorsGrid(){let e=_t.bind(this.documentColors,this.documentColors),t=new qb(this.locale,{columns:this.columns});return t.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}}),t.items.bindTo(this.documentColors).using(i=>{let o=new bw;return o.set({color:i.color,hasBorder:i.options?.hasBorder}),i.label&&o.set({label:i.label,tooltip:!0}),o.on("execute",()=>{this.fire("execute",{value:i.color,source:"documentColorsGrid"})}),o}),this.documentColors.on("change:isEmpty",(i,o,n)=>{n&&(t.selectedColor=null)}),t}_addColorToDocumentColors(e){let t=this.colorDefinitions.find(i=>i.color===e);t?this.documentColors.add(Object.assign({},t)):this.documentColors.add({color:e,label:e,options:{hasBorder:!1}})}};/** +*/var gT=class extends R{items;colorDefinitions;focusTracker;columns;documentColors;documentColorsCount;staticColorsGrid;documentColorsGrid;colorPickerButtonView;removeColorButtonView;_focusables;_documentColorsLabel;_removeButtonLabel;_colorPickerLabel;constructor(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:s,colorPickerLabel:r,focusTracker:a,focusables:l}){super(e);let c=this.bindTemplate;this.set("isVisible",!0),this.focusTracker=a,this.items=this.createCollection(),this.colorDefinitions=t,this.columns=i,this.documentColors=new mT,this.documentColorsCount=s,this._focusables=l,this._removeButtonLabel=o,this._colorPickerLabel=r,this._documentColorsLabel=n,this.setTemplate({tag:"div",attributes:{class:["ck-color-grids-fragment",c.if("isVisible","ck-hidden",u=>!u)]},children:this.items}),this.removeColorButtonView=this._createRemoveColorButton(),this.items.add(this.removeColorButtonView)}updateDocumentColors(e,t){let i=e.document,o=this.documentColorsCount;this.documentColors.clear();for(let n of i.getRoots()){let s=e.createRangeIn(n);for(let r of s.getItems())if(r.is("$textProxy")&&r.hasAttribute(t)&&(this._addColorToDocumentColors(r.getAttribute(t)),this.documentColors.length>=o))return}}updateSelectedColors(){let e=this.documentColorsGrid,t=this.staticColorsGrid,i=this.selectedColor;t.selectedColor=i,e&&(e.selectedColor=i)}render(){if(super.render(),this.staticColorsGrid=this._createStaticColorsGrid(),this.items.add(this.staticColorsGrid),this.documentColorsCount){let e=vt.bind(this.documentColors,this.documentColors),t=new R(this.locale);t.setTemplate({tag:"span",attributes:{class:["ck","ck-color-grid__label",e.if("isEmpty","ck-hidden")]},children:[{text:this._documentColorsLabel}]}),this.items.add(t),this.documentColorsGrid=this._createDocumentColorsGrid(),this.items.add(this.documentColorsGrid)}this._createColorPickerButton(),this._addColorSelectorElementsToFocusTracker()}focus(){this.removeColorButtonView.focus()}destroy(){super.destroy()}addColorPickerButton(){this.colorPickerButtonView&&(this.items.add(this.colorPickerButtonView),this.focusTracker.add(this.colorPickerButtonView.element),this._focusables.add(this.colorPickerButtonView))}_addColorSelectorElementsToFocusTracker(){this.focusTracker.add(this.removeColorButtonView.element),this._focusables.add(this.removeColorButtonView);/* v8 ignore else -- @preserve */this.staticColorsGrid&&(this.focusTracker.add(this.staticColorsGrid.element),this._focusables.add(this.staticColorsGrid)),this.documentColorsGrid&&(this.focusTracker.add(this.documentColorsGrid.element),this._focusables.add(this.documentColorsGrid))}_createColorPickerButton(){this.colorPickerButtonView=new I,this.colorPickerButtonView.set({label:this._colorPickerLabel,withText:!0,icon:F1,class:"ck-color-selector__color-picker"}),this.colorPickerButtonView.on("execute",()=>{this.fire("colorPicker:show")})}_createRemoveColorButton(){let e=new I;return e.set({withText:!0,icon:W1,label:this._removeButtonLabel}),e.class="ck-color-selector__remove-color",e.on("execute",()=>{this.fire("execute",{value:null,source:"removeColorButton"})}),e.render(),e}_createStaticColorsGrid(){let e=new jb(this.locale,{colorDefinitions:this.colorDefinitions,columns:this.columns});return e.on("execute",(t,i)=>{this.fire("execute",{value:i.value,source:"staticColorsGrid"})}),e}_createDocumentColorsGrid(){let e=vt.bind(this.documentColors,this.documentColors),t=new jb(this.locale,{columns:this.columns});return t.extendTemplate({attributes:{class:e.if("isEmpty","ck-hidden")}}),t.items.bindTo(this.documentColors).using(i=>{let o=new yw;return o.set({color:i.color,hasBorder:i.options?.hasBorder}),i.label&&o.set({label:i.label,tooltip:!0}),o.on("execute",()=>{this.fire("execute",{value:i.color,source:"documentColorsGrid"})}),o}),this.documentColors.on("change:isEmpty",(i,o,n)=>{n&&(t.selectedColor=null)}),t}_addColorToDocumentColors(e){let t=this.colorDefinitions.find(i=>i.color===e);t?this.documentColors.add(Object.assign({},t)):this.documentColors.add({color:e,label:e,options:{hasBorder:!1}})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var mT=class extends R{items;colorPickerView;saveButtonView;cancelButtonView;actionBarView;focusTracker;keystrokes;_focusables;_colorPickerViewConfig;constructor(e,{focusTracker:t,focusables:i,keystrokes:o,colorPickerViewConfig:n}){super(e),this.items=this.createCollection(),this.focusTracker=t,this.keystrokes=o,this.set("isVisible",!1),this.set("selectedColor",void 0),this._focusables=i,this._colorPickerViewConfig=n;let s=this.bindTemplate,{saveButtonView:r,cancelButtonView:a}=this._createActionButtons();this.saveButtonView=r,this.cancelButtonView=a,this.actionBarView=this._createActionBarView({saveButtonView:r,cancelButtonView:a}),this.setTemplate({tag:"div",attributes:{class:["ck-color-picker-fragment",s.if("isVisible","ck-hidden",l=>!l)]},children:this.items})}render(){super.render();let e=new aT(this.locale,{...this._colorPickerViewConfig});this.colorPickerView=e,this.colorPickerView.render(),this.selectedColor&&(e.color=this.selectedColor),this.listenTo(this,"change:selectedColor",(t,i,o)=>{e.color=o}),this.items.add(this.colorPickerView),this.items.add(this.actionBarView),this._addColorPickersElementsToFocusTracker(),this._stopPropagationOnArrowsKeys(),this._executeOnEnterPress(),this._executeUponColorChange()}destroy(){super.destroy()}focus(){this.colorPickerView.focus()}resetValidationStatus(){this.colorPickerView.resetValidationStatus()}_executeOnEnterPress(){this.keystrokes.set("enter",e=>{this.isVisible&&this.focusTracker.focusedElement!==this.cancelButtonView.element&&this.colorPickerView.isValid()&&(this.fire("execute",{value:this.selectedColor}),e.stopPropagation(),e.preventDefault())})}_stopPropagationOnArrowsKeys(){let e=t=>t.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}_addColorPickersElementsToFocusTracker(){for(let t of this.colorPickerView.slidersView)this.focusTracker.add(t.element),this._focusables.add(t);let e=this.colorPickerView.hexInputRow.children.get(1);e.element&&(this.focusTracker.add(e.element),this._focusables.add(e)),this.focusTracker.add(this.saveButtonView.element),this._focusables.add(this.saveButtonView),this.focusTracker.add(this.cancelButtonView.element),this._focusables.add(this.cancelButtonView)}_createActionBarView({saveButtonView:e,cancelButtonView:t}){let i=new R,o=this.createCollection();return o.add(e),o.add(t),i.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector_action-bar"]},children:o}),i}_createActionButtons(){let e=this.locale,t=e.t,i=new I(e),o=new I(e);return i.set({icon:Fd,class:"ck-button-save",type:"button",withText:!1,label:t("Accept")}),o.set({icon:Od,class:"ck-button-cancel",type:"button",withText:!1,label:t("Cancel")}),i.on("execute",()=>{this.colorPickerView.isValid()&&this.fire("execute",{source:"colorPickerSaveButton",value:this.selectedColor})}),o.on("execute",()=>{this.fire("colorPicker:cancel")}),{saveButtonView:i,cancelButtonView:o}}_executeUponColorChange(){this.colorPickerView.on("colorSelected",(e,t)=>{this.fire("execute",{value:t.color,source:"colorPicker"}),this.set("selectedColor",t.color)})}};/** +*/var pT=class extends R{items;colorPickerView;saveButtonView;cancelButtonView;actionBarView;focusTracker;keystrokes;_focusables;_colorPickerViewConfig;constructor(e,{focusTracker:t,focusables:i,keystrokes:o,colorPickerViewConfig:n}){super(e),this.items=this.createCollection(),this.focusTracker=t,this.keystrokes=o,this.set("isVisible",!1),this.set("selectedColor",void 0),this._focusables=i,this._colorPickerViewConfig=n;let s=this.bindTemplate,{saveButtonView:r,cancelButtonView:a}=this._createActionButtons();this.saveButtonView=r,this.cancelButtonView=a,this.actionBarView=this._createActionBarView({saveButtonView:r,cancelButtonView:a}),this.setTemplate({tag:"div",attributes:{class:["ck-color-picker-fragment",s.if("isVisible","ck-hidden",l=>!l)]},children:this.items})}render(){super.render();let e=new cT(this.locale,{...this._colorPickerViewConfig});this.colorPickerView=e,this.colorPickerView.render(),this.selectedColor&&(e.color=this.selectedColor),this.listenTo(this,"change:selectedColor",(t,i,o)=>{e.color=o}),this.items.add(this.colorPickerView),this.items.add(this.actionBarView),this._addColorPickersElementsToFocusTracker(),this._stopPropagationOnArrowsKeys(),this._executeOnEnterPress(),this._executeUponColorChange()}destroy(){super.destroy()}focus(){this.colorPickerView.focus()}resetValidationStatus(){this.colorPickerView.resetValidationStatus()}_executeOnEnterPress(){this.keystrokes.set("enter",e=>{this.isVisible&&this.focusTracker.focusedElement!==this.cancelButtonView.element&&this.colorPickerView.isValid()&&(this.fire("execute",{value:this.selectedColor}),e.stopPropagation(),e.preventDefault())})}_stopPropagationOnArrowsKeys(){let e=t=>t.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}_addColorPickersElementsToFocusTracker(){for(let t of this.colorPickerView.slidersView)this.focusTracker.add(t.element),this._focusables.add(t);let e=this.colorPickerView.hexInputRow.children.get(1);e.element&&(this.focusTracker.add(e.element),this._focusables.add(e)),this.focusTracker.add(this.saveButtonView.element),this._focusables.add(this.saveButtonView),this.focusTracker.add(this.cancelButtonView.element),this._focusables.add(this.cancelButtonView)}_createActionBarView({saveButtonView:e,cancelButtonView:t}){let i=new R,o=this.createCollection();return o.add(e),o.add(t),i.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector_action-bar"]},children:o}),i}_createActionButtons(){let e=this.locale,t=e.t,i=new I(e),o=new I(e);return i.set({icon:zd,class:"ck-button-save",type:"button",withText:!1,label:t("Accept")}),o.set({icon:Fd,class:"ck-button-cancel",type:"button",withText:!1,label:t("Cancel")}),i.on("execute",()=>{this.colorPickerView.isValid()&&this.fire("execute",{source:"colorPickerSaveButton",value:this.selectedColor})}),o.on("execute",()=>{this.fire("colorPicker:cancel")}),{saveButtonView:i,cancelButtonView:o}}_executeUponColorChange(){this.colorPickerView.on("colorSelected",(e,t)=>{this.fire("execute",{value:t.color,source:"colorPicker"}),this.set("selectedColor",t.color)})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Ew=class extends R{focusTracker;keystrokes;items;colorGridsFragmentView;colorPickerFragmentView;_focusCycler;_focusables;_colorPickerViewConfig;constructor(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:s,colorPickerLabel:r,colorPickerViewConfig:a}){super(e),a&&Su()&&(D("color-picker-unavailable-with-trusted-types"),a=!1),this.items=this.createCollection(),this.focusTracker=new Q,this.keystrokes=new X,this._focusables=new be,this._colorPickerViewConfig=a,this._focusCycler=new Ie({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.colorGridsFragmentView=new fT(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:s,colorPickerLabel:r,focusTracker:this.focusTracker,focusables:this._focusables}),this.colorPickerFragmentView=new mT(e,{focusables:this._focusables,focusTracker:this.focusTracker,keystrokes:this.keystrokes,colorPickerViewConfig:a}),this.set("_isColorGridsFragmentVisible",!0),this.set("_isColorPickerFragmentVisible",!1),this.set("selectedColor",void 0),this.colorGridsFragmentView.bind("isVisible").to(this,"_isColorGridsFragmentVisible"),this.colorPickerFragmentView.bind("isVisible").to(this,"_isColorPickerFragmentVisible"),this.on("change:selectedColor",(l,c,u)=>{this.colorGridsFragmentView.set("selectedColor",u),this.colorPickerFragmentView.set("selectedColor",u)}),this.colorGridsFragmentView.on("change:selectedColor",(l,c,u)=>{this.set("selectedColor",u)}),this.colorPickerFragmentView.on("change:selectedColor",(l,c,u)=>{this.set("selectedColor",u)}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector"]},children:this.items})}render(){super.render(),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}appendUI(){this._appendColorGridsFragment(),this._colorPickerViewConfig&&this._appendColorPickerFragment()}showColorPickerFragment(){!this.colorPickerFragmentView.colorPickerView||this._isColorPickerFragmentVisible||(this._isColorPickerFragmentVisible=!0,this.colorPickerFragmentView.focus(),this.colorPickerFragmentView.resetValidationStatus(),this._isColorGridsFragmentVisible=!1)}showColorGridsFragment(){this._isColorGridsFragmentVisible||(this._isColorGridsFragmentVisible=!0,this.colorGridsFragmentView.focus(),this._isColorPickerFragmentVisible=!1)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}updateDocumentColors(e,t){this.colorGridsFragmentView.updateDocumentColors(e,t)}updateSelectedColors(){this.colorGridsFragmentView.updateSelectedColors()}_appendColorGridsFragment(){this.items.length||(this.items.add(this.colorGridsFragmentView),this.colorGridsFragmentView.delegate("execute").to(this),this.colorGridsFragmentView.delegate("colorPicker:show").to(this))}_appendColorPickerFragment(){this.items.length!==2&&(this.items.add(this.colorPickerFragmentView),this.colorGridsFragmentView.colorPickerButtonView&&this.colorGridsFragmentView.colorPickerButtonView.on("execute",()=>{this.showColorPickerFragment()}),this.colorGridsFragmentView.addColorPickerButton(),this.colorPickerFragmentView.delegate("execute").to(this),this.colorPickerFragmentView.delegate("colorPicker:cancel").to(this))}};/** +*/var Iw=class extends R{focusTracker;keystrokes;items;colorGridsFragmentView;colorPickerFragmentView;_focusCycler;_focusables;_colorPickerViewConfig;constructor(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:s,colorPickerLabel:r,colorPickerViewConfig:a}){super(e),a&&Ru()&&(D("color-picker-unavailable-with-trusted-types"),a=!1),this.items=this.createCollection(),this.focusTracker=new Q,this.keystrokes=new X,this._focusables=new we,this._colorPickerViewConfig=a,this._focusCycler=new Pe({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.colorGridsFragmentView=new gT(e,{colors:t,columns:i,removeButtonLabel:o,documentColorsLabel:n,documentColorsCount:s,colorPickerLabel:r,focusTracker:this.focusTracker,focusables:this._focusables}),this.colorPickerFragmentView=new pT(e,{focusables:this._focusables,focusTracker:this.focusTracker,keystrokes:this.keystrokes,colorPickerViewConfig:a}),this.set("_isColorGridsFragmentVisible",!0),this.set("_isColorPickerFragmentVisible",!1),this.set("selectedColor",void 0),this.colorGridsFragmentView.bind("isVisible").to(this,"_isColorGridsFragmentVisible"),this.colorPickerFragmentView.bind("isVisible").to(this,"_isColorPickerFragmentVisible"),this.on("change:selectedColor",(l,c,u)=>{this.colorGridsFragmentView.set("selectedColor",u),this.colorPickerFragmentView.set("selectedColor",u)}),this.colorGridsFragmentView.on("change:selectedColor",(l,c,u)=>{this.set("selectedColor",u)}),this.colorPickerFragmentView.on("change:selectedColor",(l,c,u)=>{this.set("selectedColor",u)}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-color-selector"]},children:this.items})}render(){super.render(),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}appendUI(){this._appendColorGridsFragment(),this._colorPickerViewConfig&&this._appendColorPickerFragment()}showColorPickerFragment(){!this.colorPickerFragmentView.colorPickerView||this._isColorPickerFragmentVisible||(this._isColorPickerFragmentVisible=!0,this.colorPickerFragmentView.focus(),this.colorPickerFragmentView.resetValidationStatus(),this._isColorGridsFragmentVisible=!1)}showColorGridsFragment(){this._isColorGridsFragmentVisible||(this._isColorGridsFragmentVisible=!0,this.colorGridsFragmentView.focus(),this._isColorPickerFragmentVisible=!1)}focus(){this._focusCycler.focusFirst()}focusLast(){this._focusCycler.focusLast()}updateDocumentColors(e,t){this.colorGridsFragmentView.updateDocumentColors(e,t)}updateSelectedColors(){this.colorGridsFragmentView.updateSelectedColors()}_appendColorGridsFragment(){this.items.length||(this.items.add(this.colorGridsFragmentView),this.colorGridsFragmentView.delegate("execute").to(this),this.colorGridsFragmentView.delegate("colorPicker:show").to(this))}_appendColorPickerFragment(){this.items.length!==2&&(this.items.add(this.colorPickerFragmentView),this.colorGridsFragmentView.colorPickerButtonView&&this.colorGridsFragmentView.colorPickerButtonView.on("execute",()=>{this.showColorPickerFragment()}),this.colorGridsFragmentView.addColorPickerButton(),this.colorPickerFragmentView.delegate("execute").to(this),this.colorPickerFragmentView.delegate("colorPicker:cancel").to(this))}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var gT=class{editor;_components=new Map;constructor(e){this.editor=e}*names(){for(let e of this._components.values())yield e.originalName}add(e,t){this._components.set(ih(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new p("componentfactory-item-missing",this,{name:e});return this._components.get(ih(e)).callback(this.editor.locale)}has(e){return this._components.has(ih(e))}};function ih(e){return String(e).toLowerCase()}/** +*/var bT=class{editor;_components=new Map;constructor(e){this.editor=e}*names(){for(let e of this._components.values())yield e.originalName}add(e,t){this._components.set(nh(e),{callback:t,originalName:e})}create(e){if(!this.has(e))throw new p("componentfactory-item-missing",this,{name:e});return this._components.get(nh(e)).callback(this.editor.locale)}has(e){return this._components.has(nh(e))}};function nh(e){return String(e).toLowerCase()}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Jb="ck-tooltip",pT=pe(),Aw=class Te extends pT{tooltipTextView;balloonPanelView;static defaultBalloonPositions=Me.generatePositions({heightOffset:5,sideOffset:13});_currentElementWithTooltip=null;_currentTooltipPosition=null;_mutationObserver=null;_pinTooltipDebounced;_unpinTooltipDebounced;_shadowRoots=new Set;_bodyCollectionByTree=new Map;_watchdogExcluded;_refCount=0;static _instance=null;static _registrations=new Map;static for(t){return Te._instance||(Te._instance=new Te(t)),Te._instance._refCount++,Te._instance}constructor(t){super(),this.tooltipTextView=new R(t),this.tooltipTextView.set("text",""),this.tooltipTextView.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:this.tooltipTextView.bindTemplate.to("text")}]}),this.balloonPanelView=new Me(t),this.balloonPanelView.class=Jb,this.balloonPanelView.content.add(this.tooltipTextView),this._mutationObserver=bT(()=>{this._updateTooltipPosition()}),this._pinTooltipDebounced=ye(this._pinTooltip,600),this._unpinTooltipDebounced=ye(this._unpinTooltip,400),this.listenTo(S.document,"keydown",this._onKeyDown.bind(this),{useCapture:!0}),this.listenTo(S.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(S.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(S.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(S.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(S.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}release(){this._refCount===0||--this._refCount>0||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),Te._registrations.clear(),this._bodyCollectionByTree.clear(),this._shadowRoots.clear(),Te._instance=null)}registerBodyCollection(t,{shadowRootRegistry:i,updateEmitter:o}={}){Te._registrations.has(t)||(Te._registrations.set(t,{shadowRootRegistry:i,updateEmitter:o}),this.listenTo(t,"remount",()=>{!t.mountTarget&&t.has(this.balloonPanelView)&&this._currentElementWithTooltip&&this._unpinTooltip(),this._rebuild()}),i&&(this.listenTo(i,"add",()=>this._rebuild()),this.listenTo(i,"remove",()=>this._rebuild())),this._rebuild())}unregisterBodyCollection(t){let i=Te._registrations.get(t);i&&(Te._registrations.delete(t),this.stopListening(t),i.shadowRootRegistry&&this.stopListening(i.shadowRootRegistry),i.updateEmitter&&!this._getUpdateEmitters().has(i.updateEmitter)&&this.stopListening(i.updateEmitter),t.has(this.balloonPanelView)&&(this._currentElementWithTooltip&&this._unpinTooltip(),t.remove(this.balloonPanelView)),this._rebuild())}_getUpdateEmitters(){let t=new Set;for(let{updateEmitter:i}of Te._registrations.values())i&&t.add(i);return t}_rebuild(){let t=new Map,i=(o,n)=>{t.has(o)||t.set(o,n)};for(let[o,{shadowRootRegistry:n}]of Te._registrations){let s=o.mountTarget;if(s&&i(s.getRootNode(),o),n)for(let r of n.getShadowRoots())i(r,o)}this._bodyCollectionByTree=t,this._resyncShadowRootListeners()}static getPositioningFunctions(t){let i=Te.defaultBalloonPositions;return{s:[i.southArrowNorth,i.southArrowNorthEast,i.southArrowNorthWest],n:[i.northArrowSouth],e:[i.eastArrowWest],w:[i.westArrowEast],sw:[i.southArrowNorthEast],se:[i.southArrowNorthWest]}[t]}_onKeyDown(t,i){i.key==="Escape"&&this._currentElementWithTooltip&&(this._unpinTooltip(),i.stopPropagation())}_onEnterOrFocus(t,i){if(Vu(i.target,this._shadowRoots))return;let{target:o}=i,n=oh(o);if(!n){if(t.name==="mouseenter"&&rt(this.balloonPanelView.element,o)){this._unpinTooltipDebounced.cancel();return}t.name==="focus"&&this._unpinTooltip();return}if(n===this._currentElementWithTooltip){this._unpinTooltipDebounced.cancel();return}this._unpinTooltip(),t.name==="focus"&&!n.matches(":hover")||n.matches("[data-cke-tooltip-instant]")?this._pinTooltip(n,nh(n)):this._pinTooltipDebounced(n,nh(n))}_onLeaveOrBlur(t,i){if(Vu(i.target,this._shadowRoots))return;let{target:o,relatedTarget:n}=i;if(t.name==="mouseleave"){if(!et(o))return;let s=this.balloonPanelView.element,r=!!s&&rt(s,n),a=!r&&o===s;if(r){this._unpinTooltipDebounced.cancel();return}if(!a&&this._currentElementWithTooltip&&o!==this._currentElementWithTooltip)return;let l=oh(o),c=oh(n);(a||l&&l!==c)&&(this._pinTooltipDebounced.cancel(),this._currentElementWithTooltip&&this._currentElementWithTooltip.matches("[data-cke-tooltip-instant]")||l&&l.matches("[data-cke-tooltip-instant]")?this._unpinTooltip():this._unpinTooltipDebounced())}else{if(this._currentElementWithTooltip&&o!==this._currentElementWithTooltip)return;this._pinTooltipDebounced.cancel(),this._unpinTooltipDebounced()}}_resyncShadowRootListeners(){let t=new Set;for(let i of this._bodyCollectionByTree.keys())st(i)&&t.add(i);for(let i of this._shadowRoots)t.has(i)||(this.stopListening(i),this._shadowRoots.delete(i));for(let i of t)this._shadowRoots.has(i)||(this.listenTo(i,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(i,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(i,"scroll",this._onScroll.bind(this),{useCapture:!0}),this.listenTo(i,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(i,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this._shadowRoots.add(i))}_onScroll(t,{target:i}){this._currentElementWithTooltip&&(rt(i,this.balloonPanelView.element)&&rt(i,this._currentElementWithTooltip)||this._unpinTooltip())}_pinTooltip(t,{text:i,position:o,cssClass:n}){if(this._unpinTooltip(),!!this._moveBalloonToConnectedBodyCollection(t)){this.tooltipTextView.text=i,this.balloonPanelView.class=[Jb,n].filter(s=>s).join(" "),this.balloonPanelView.pin({target:t,positions:Te.getPositioningFunctions(o)}),this._mutationObserver.attach(t);for(let s of this._getUpdateEmitters())this.listenTo(s,"update",this._updateTooltipPosition.bind(this),{priority:"low"});this._currentElementWithTooltip=t,this._currentTooltipPosition=o}}_moveBalloonToConnectedBodyCollection(t){let i=this.balloonPanelView,o=this._getConnectedBodyCollection(t);if(!o)return!1;for(let n of Te._registrations.keys())n!==o&&n.has(i)&&n.remove(i);return o.has(i)||o.add(i),!0}_getConnectedBodyCollection(t){let i=t.getRootNode(),o=this._bodyCollectionByTree.get(i);if(o&&o.mountTarget&&o.mountTarget.isConnected)return o;for(let n of Te._registrations.keys())if(n.mountTarget&&n.mountTarget.isConnected)return n;return G(Te._registrations.keys())||null}_unpinTooltip(){this._unpinTooltipDebounced.cancel(),this._pinTooltipDebounced.cancel(),this.balloonPanelView.unpin();for(let t of this._getUpdateEmitters())this.stopListening(t,"update");this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this.tooltipTextView.text="",this._mutationObserver.detach()}_updateTooltipPosition(){if(!this._currentElementWithTooltip)return;let t=nh(this._currentElementWithTooltip);if(!jt(this._currentElementWithTooltip)||!t.text){this._unpinTooltip();return}this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:Te.getPositioningFunctions(t.position)})}};function oh(e){return et(e)?e.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}function nh(e){return{text:e.dataset.ckeTooltipText,position:e.dataset.ckeTooltipPosition||"s",cssClass:e.dataset.ckeTooltipClass||""}}function bT(e){let t=new MutationObserver(()=>{e()});return{attach(i){t.observe(i,{attributes:!0,attributeFilter:["data-cke-tooltip-text","data-cke-tooltip-position"]})},detach(){t.disconnect()}}}/** +*/var Qb="ck-tooltip",wT=be(),Sw=class Ae extends wT{tooltipTextView;balloonPanelView;static defaultBalloonPositions=Me.generatePositions({heightOffset:5,sideOffset:13});_currentElementWithTooltip=null;_currentTooltipPosition=null;_mutationObserver=null;_pinTooltipDebounced;_unpinTooltipDebounced;_shadowRoots=new Set;_bodyCollectionByTree=new Map;_watchdogExcluded;_refCount=0;static _instance=null;static _registrations=new Map;static for(t){return Ae._instance||(Ae._instance=new Ae(t)),Ae._instance._refCount++,Ae._instance}constructor(t){super(),this.tooltipTextView=new R(t),this.tooltipTextView.set("text",""),this.tooltipTextView.setTemplate({tag:"span",attributes:{class:["ck","ck-tooltip__text"]},children:[{text:this.tooltipTextView.bindTemplate.to("text")}]}),this.balloonPanelView=new Me(t),this.balloonPanelView.class=Qb,this.balloonPanelView.content.add(this.tooltipTextView),this._mutationObserver=yT(()=>{this._updateTooltipPosition()}),this._pinTooltipDebounced=ve(this._pinTooltip,600),this._unpinTooltipDebounced=ve(this._unpinTooltip,400),this.listenTo(S.document,"keydown",this._onKeyDown.bind(this),{useCapture:!0}),this.listenTo(S.document,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(S.document,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(S.document,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(S.document,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(S.document,"scroll",this._onScroll.bind(this),{useCapture:!0}),this._watchdogExcluded=!0}release(){this._refCount===0||--this._refCount>0||(this._unpinTooltip(),this.balloonPanelView.destroy(),this.stopListening(),Ae._registrations.clear(),this._bodyCollectionByTree.clear(),this._shadowRoots.clear(),Ae._instance=null)}registerBodyCollection(t,{shadowRootRegistry:i,updateEmitter:o}={}){Ae._registrations.has(t)||(Ae._registrations.set(t,{shadowRootRegistry:i,updateEmitter:o}),this.listenTo(t,"remount",()=>{!t.mountTarget&&t.has(this.balloonPanelView)&&this._currentElementWithTooltip&&this._unpinTooltip(),this._rebuild()}),i&&(this.listenTo(i,"add",()=>this._rebuild()),this.listenTo(i,"remove",()=>this._rebuild())),this._rebuild())}unregisterBodyCollection(t){let i=Ae._registrations.get(t);i&&(Ae._registrations.delete(t),this.stopListening(t),i.shadowRootRegistry&&this.stopListening(i.shadowRootRegistry),i.updateEmitter&&!this._getUpdateEmitters().has(i.updateEmitter)&&this.stopListening(i.updateEmitter),t.has(this.balloonPanelView)&&(this._currentElementWithTooltip&&this._unpinTooltip(),t.remove(this.balloonPanelView)),this._rebuild())}_getUpdateEmitters(){let t=new Set;for(let{updateEmitter:i}of Ae._registrations.values())i&&t.add(i);return t}_rebuild(){let t=new Map,i=(o,n)=>{t.has(o)||t.set(o,n)};for(let[o,{shadowRootRegistry:n}]of Ae._registrations){let s=o.mountTarget;if(s&&i(s.getRootNode(),o),n)for(let r of n.getShadowRoots())i(r,o)}this._bodyCollectionByTree=t,this._resyncShadowRootListeners()}static getPositioningFunctions(t){let i=Ae.defaultBalloonPositions;return{s:[i.southArrowNorth,i.southArrowNorthEast,i.southArrowNorthWest],n:[i.northArrowSouth],e:[i.eastArrowWest],w:[i.westArrowEast],sw:[i.southArrowNorthEast],se:[i.southArrowNorthWest]}[t]}_onKeyDown(t,i){i.key==="Escape"&&this._currentElementWithTooltip&&(this._unpinTooltip(),i.stopPropagation())}_onEnterOrFocus(t,i){if(Mu(i.target,this._shadowRoots))return;let{target:o}=i,n=sh(o);if(!n){if(t.name==="mouseenter"&&rt(this.balloonPanelView.element,o)){this._unpinTooltipDebounced.cancel();return}t.name==="focus"&&this._unpinTooltip();return}if(n===this._currentElementWithTooltip){this._unpinTooltipDebounced.cancel();return}this._unpinTooltip(),t.name==="focus"&&!n.matches(":hover")||n.matches("[data-cke-tooltip-instant]")?this._pinTooltip(n,rh(n)):this._pinTooltipDebounced(n,rh(n))}_onLeaveOrBlur(t,i){if(Mu(i.target,this._shadowRoots))return;let{target:o,relatedTarget:n}=i;if(t.name==="mouseleave"){if(!et(o))return;let s=this.balloonPanelView.element,r=!!s&&rt(s,n),a=!r&&o===s;if(r){this._unpinTooltipDebounced.cancel();return}if(!a&&this._currentElementWithTooltip&&o!==this._currentElementWithTooltip)return;let l=sh(o),c=sh(n);(a||l&&l!==c)&&(this._pinTooltipDebounced.cancel(),this._currentElementWithTooltip&&this._currentElementWithTooltip.matches("[data-cke-tooltip-instant]")||l&&l.matches("[data-cke-tooltip-instant]")?this._unpinTooltip():this._unpinTooltipDebounced())}else{if(this._currentElementWithTooltip&&o!==this._currentElementWithTooltip)return;this._pinTooltipDebounced.cancel(),this._unpinTooltipDebounced()}}_resyncShadowRootListeners(){let t=new Set;for(let i of this._bodyCollectionByTree.keys())st(i)&&t.add(i);for(let i of this._shadowRoots)t.has(i)||(this.stopListening(i),this._shadowRoots.delete(i));for(let i of t)this._shadowRoots.has(i)||(this.listenTo(i,"mouseenter",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(i,"mouseleave",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this.listenTo(i,"scroll",this._onScroll.bind(this),{useCapture:!0}),this.listenTo(i,"focus",this._onEnterOrFocus.bind(this),{useCapture:!0}),this.listenTo(i,"blur",this._onLeaveOrBlur.bind(this),{useCapture:!0}),this._shadowRoots.add(i))}_onScroll(t,{target:i}){this._currentElementWithTooltip&&(rt(i,this.balloonPanelView.element)&&rt(i,this._currentElementWithTooltip)||this._unpinTooltip())}_pinTooltip(t,{text:i,position:o,cssClass:n}){if(this._unpinTooltip(),!!this._moveBalloonToConnectedBodyCollection(t)){this.tooltipTextView.text=i,this.balloonPanelView.class=[Qb,n].filter(s=>s).join(" "),this.balloonPanelView.pin({target:t,positions:Ae.getPositioningFunctions(o)}),this._mutationObserver.attach(t);for(let s of this._getUpdateEmitters())this.listenTo(s,"update",this._updateTooltipPosition.bind(this),{priority:"low"});this._currentElementWithTooltip=t,this._currentTooltipPosition=o}}_moveBalloonToConnectedBodyCollection(t){let i=this.balloonPanelView,o=this._getConnectedBodyCollection(t);if(!o)return!1;for(let n of Ae._registrations.keys())n!==o&&n.has(i)&&n.remove(i);return o.has(i)||o.add(i),!0}_getConnectedBodyCollection(t){let i=t.getRootNode(),o=this._bodyCollectionByTree.get(i);if(o&&o.mountTarget&&o.mountTarget.isConnected)return o;for(let n of Ae._registrations.keys())if(n.mountTarget&&n.mountTarget.isConnected)return n;return J(Ae._registrations.keys())||null}_unpinTooltip(){this._unpinTooltipDebounced.cancel(),this._pinTooltipDebounced.cancel(),this.balloonPanelView.unpin();for(let t of this._getUpdateEmitters())this.stopListening(t,"update");this._currentElementWithTooltip=null,this._currentTooltipPosition=null,this.tooltipTextView.text="",this._mutationObserver.detach()}_updateTooltipPosition(){if(!this._currentElementWithTooltip)return;let t=rh(this._currentElementWithTooltip);if(!Gt(this._currentElementWithTooltip)||!t.text){this._unpinTooltip();return}this.balloonPanelView.pin({target:this._currentElementWithTooltip,positions:Ae.getPositioningFunctions(t.position)})}};function sh(e){return et(e)?e.closest("[data-cke-tooltip-text]:not([data-cke-tooltip-disabled])"):null}function rh(e){return{text:e.dataset.ckeTooltipText,position:e.dataset.ckeTooltipPosition||"s",cssClass:e.dataset.ckeTooltipClass||""}}function yT(e){let t=new MutationObserver(()=>{e()});return{attach(i){t.observe(i,{attributes:!0,attributeFilter:["data-cke-tooltip-text","data-cke-tooltip-position"]})},detach(){t.disconnect()}}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var wT=q(),yT=class extends wT{bodyCollection;shadowRootRegistry;_tooltipManager;_resolveMountTarget;_resolveInlineContainer;_registeredInlineContainer=null;_ownsBodyCollection;_ownsShadowRootRegistry;_ownsTooltipManagerReference;_destroyed=!1;constructor(e,t){super(),this.bodyCollection=t.bodyCollection||new fw(e),this._ownsBodyCollection=!t.bodyCollection,this.shadowRootRegistry=t.shadowRootRegistry||new Lu,this._ownsShadowRootRegistry=!t.shadowRootRegistry,this._resolveMountTarget=t.resolveMountTarget,this._resolveInlineContainer=t.resolveInlineContainer,this._tooltipManager=t.tooltipManager||Aw.for(e),this._ownsTooltipManagerReference=!t.tooltipManager,this._tooltipManager.registerBodyCollection(this.bodyCollection,{shadowRootRegistry:this.shadowRootRegistry,updateEmitter:t.updateEmitter}),t.updateEmitter&&this.listenTo(t.updateEmitter,"update",()=>this.sync(),{priority:"high"}),this.listenTo(this.bodyCollection,"add",()=>this.sync())}sync(){if(this.bodyCollection.syncMountTarget(this._resolveMountTarget()),this._resolveInlineContainer){let e=this._resolveInlineContainer()||null;e!==this._registeredInlineContainer&&(this._registeredInlineContainer&&this.shadowRootRegistry.unregisterNode(this._registeredInlineContainer),this._registeredInlineContainer=e,e&&this.shadowRootRegistry.registerNode(e))}this.shadowRootRegistry.refresh()}destroy(){this._destroyed||(this._destroyed=!0,this.stopListening(),this._tooltipManager.unregisterBodyCollection(this.bodyCollection),this._ownsTooltipManagerReference&&this._tooltipManager.release(),this._ownsShadowRootRegistry&&this.shadowRootRegistry.destroy(),this._ownsBodyCollection&&this.bodyCollection.destroy())}};/** +*/var _T=q(),vT=class extends _T{bodyCollection;shadowRootRegistry;_tooltipManager;_resolveMountTarget;_resolveInlineContainer;_registeredInlineContainer=null;_ownsBodyCollection;_ownsShadowRootRegistry;_ownsTooltipManagerReference;_destroyed=!1;constructor(e,t){super(),this.bodyCollection=t.bodyCollection||new gw(e),this._ownsBodyCollection=!t.bodyCollection,this.shadowRootRegistry=t.shadowRootRegistry||new Bu,this._ownsShadowRootRegistry=!t.shadowRootRegistry,this._resolveMountTarget=t.resolveMountTarget,this._resolveInlineContainer=t.resolveInlineContainer,this._tooltipManager=t.tooltipManager||Sw.for(e),this._ownsTooltipManagerReference=!t.tooltipManager,this._tooltipManager.registerBodyCollection(this.bodyCollection,{shadowRootRegistry:this.shadowRootRegistry,updateEmitter:t.updateEmitter}),t.updateEmitter&&this.listenTo(t.updateEmitter,"update",()=>this.sync(),{priority:"high"}),this.listenTo(this.bodyCollection,"add",()=>this.sync())}sync(){if(this.bodyCollection.syncMountTarget(this._resolveMountTarget()),this._resolveInlineContainer){let e=this._resolveInlineContainer()||null;e!==this._registeredInlineContainer&&(this._registeredInlineContainer&&this.shadowRootRegistry.unregisterNode(this._registeredInlineContainer),this._registeredInlineContainer=e,e&&this.shadowRootRegistry.registerNode(e))}this.shadowRootRegistry.refresh()}destroy(){this._destroyed||(this._destroyed=!0,this.stopListening(),this._tooltipManager.unregisterBodyCollection(this.bodyCollection),this._ownsTooltipManagerReference&&this._tooltipManager.release(),this._ownsShadowRootRegistry&&this.shadowRootRegistry.destroy(),this._ownsBodyCollection&&this.bodyCollection.destroy())}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var _T=class extends mw{licenseTypeMessage={evaluation:"For evaluation purposes only",trial:"For evaluation purposes only",development:"For development purposes only"};constructor(e){super(e,{balloonClass:"ck-evaluation-badge-balloon"})}_isEnabled(){let e=Zb(this.editor.config.get("licenseKey"));return!!(e&&this.licenseTypeMessage[e])}_createBadgeContent(){let e=Zb(this.editor.config.get("licenseKey"));return new vT(this.editor.locale,this.licenseTypeMessage[e])}_getNormalizedConfig(){let e=super._getNormalizedConfig(),t=this.editor.config.get("ui.poweredBy")||{};return{position:t.position||e.position,side:(t.side||e.side)==="left"?"right":"left",verticalOffset:e.verticalOffset,horizontalOffset:e.horizontalOffset}}},vT=class extends R{constructor(e,t){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-evaluation-badge"],"aria-hidden":!0},children:[{tag:"span",attributes:{class:["ck","ck-evaluation-badge__label"]},children:[t]}]})}};function Zb(e){if(e=="GPL")return"GPL";let t=Na(e.split(".")[1]);return t?t.licenseType||"production":null}/** +*/var kT=class extends pw{licenseTypeMessage={evaluation:"For evaluation purposes only",trial:"For evaluation purposes only",development:"For development purposes only"};constructor(e){super(e,{balloonClass:"ck-evaluation-badge-balloon"})}_isEnabled(){let e=Yb(this.editor.config.get("licenseKey"));return!!(e&&this.licenseTypeMessage[e])}_createBadgeContent(){let e=Yb(this.editor.config.get("licenseKey"));return new CT(this.editor.locale,this.licenseTypeMessage[e])}_getNormalizedConfig(){let e=super._getNormalizedConfig(),t=this.editor.config.get("ui.poweredBy")||{};return{position:t.position||e.position,side:(t.side||e.side)==="left"?"right":"left",verticalOffset:e.verticalOffset,horizontalOffset:e.horizontalOffset}}},CT=class extends R{constructor(e,t){super(e),this.setTemplate({tag:"div",attributes:{class:["ck","ck-evaluation-badge"],"aria-hidden":!0},children:[{tag:"span",attributes:{class:["ck","ck-evaluation-badge__label"]},children:[t]}]})}};function Yb(e){if(e=="GPL")return"GPL";let t=za(e.split(".")[1]);return t?t.licenseType||"production":null}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */var Jn=class extends ot{constructor(e,t){super(e);let i=this.bindTemplate;this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item"]},on:{mouseenter:i.to("mouseenter")}}),this.delegate("mouseenter").to(t)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var El=5,qn={toggleMenusAndFocusItemsOnHover(e){e.on("menu:mouseenter",t=>{if(!(!e.isFocusBorderEnabled&&!e.isOpen)){if(e.isOpen)for(let i of e.menus){let o=t.path[0],n=o instanceof Jn&&o.children.first===i;i.isOpen=(t.path.includes(i)||n)&&i.isEnabled}t.source.focus()}})},focusCycleMenusOnArrows(e){let t=e.locale.uiLanguageDirection==="rtl";e.on("menu:arrowright",o=>{i(o.source,t?-1:1)}),e.on("menu:arrowleft",o=>{i(o.source,t?1:-1)});function i(o,n){let s=e.children.getIndex(o),r=o.isOpen,a=e.children.length,l=e.children.get((s+a+n)%a);o.isOpen=!1,r&&(l.isOpen=!0),l.buttonView.focus()}},closeMenusWhenTheBarCloses(e){e.on("change:isOpen",()=>{e.isOpen||e.menus.forEach(t=>{t.isOpen=!1})})},closeMenuWhenAnotherOnTheSameLevelOpens(e){e.on("menu:change:isOpen",(t,i,o)=>{o&&e.menus.filter(n=>t.source.parentMenuView===n.parentMenuView&&t.source!==n&&n.isOpen).forEach(n=>{n.isOpen=!1})})},closeOnClickOutside(e){vt({emitter:e,activator:()=>e.isOpen,callback:()=>e.close(),contextElements:()=>e.children.map(t=>t.element)})},enableFocusHighlightOnInteraction(e){let t=!1;e.on("change:isOpen",(i,o,n)=>{n||(t||(e.isFocusBorderEnabled=!1),t=!1)}),e.listenTo(e.element,"keydown",()=>{t=!0},{useCapture:!0}),e.listenTo(e.element,"keyup",()=>{t=!1},{useCapture:!0}),e.listenTo(e.element,"focus",()=>{t&&(e.isFocusBorderEnabled=!0)},{useCapture:!0})}},qi={openAndFocusPanelOnArrowDownKey(e){e.keystrokes.set("arrowdown",(t,i)=>{e.isEnabled&&e.focusTracker.focusedElement===e.buttonView.element&&(e.isOpen||(e.isOpen=!0),e.panelView.focus(),i())})},openOnArrowRightKey(e){let t=e.locale.uiLanguageDirection==="rtl"?"arrowleft":"arrowright";e.keystrokes.set(t,(i,o)=>{e.focusTracker.focusedElement!==e.buttonView.element||!e.isEnabled||(e.isOpen||(e.isOpen=!0),e.panelView.focus(),o())})},openOnButtonClick(e){e.buttonView.on("execute",()=>{e.isOpen=!0})},toggleOnButtonClick(e){e.buttonView.on("execute",()=>{e.isOpen=!e.isOpen})},openAndFocusOnEnterKeyPress(e){e.keystrokes.set("enter",(t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&(e.isOpen=!0,e.panelView.focus(),i())})},closeOnArrowLeftKey(e){let t=e.locale.uiLanguageDirection==="rtl"?"arrowright":"arrowleft";e.keystrokes.set(t,(i,o)=>{e.isOpen&&(e.isOpen=!1,e.focus(),o())})},closeOnEscKey(e){e.keystrokes.set("esc",(t,i)=>{e.isOpen&&(e.isOpen=!1,e.focus(),i())})},closeOnParentClose(e){e.parentMenuView.on("change:isOpen",(t,i,o)=>{!o&&t.source===e.parentMenuView&&(e.isOpen=!1)})}},kT={southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),eastSouth:e=>({top:e.top,left:e.right-El,name:"es"}),eastNorth:(e,t)=>({top:e.top-t.height,left:e.right-El,name:"en"}),westSouth:(e,t)=>({top:e.top,left:e.left-t.width+El,name:"ws"}),westNorth:(e,t)=>({top:e.top-t.height,left:e.left-t.width+El,name:"wn"})},CT=[{menuId:"file",label:"File",groups:[{groupId:"export",items:["menuBar:exportPdf","menuBar:exportWord"]},{groupId:"import",items:["menuBar:importWord"]},{groupId:"revisionHistory",items:["menuBar:revisionHistory"]}]},{menuId:"edit",label:"Edit",groups:[{groupId:"undo",items:["menuBar:undo","menuBar:redo"]},{groupId:"selectAll",items:["menuBar:selectAll"]},{groupId:"findAndReplace",items:["menuBar:findAndReplace"]}]},{menuId:"view",label:"View",groups:[{groupId:"sourceEditingEnhanced",items:["menuBar:sourceEditingEnhanced"]},{groupId:"sourceEditing",items:["menuBar:sourceEditing"]},{groupId:"showBlocks",items:["menuBar:showBlocks"]},{groupId:"previewMergeFields",items:["menuBar:previewMergeFields"]},{groupId:"fullscreen",items:["menuBar:fullscreen"]},{groupId:"restrictedEditing",items:["menuBar:restrictedEditing"]}]},{menuId:"insert",label:"Insert",groups:[{groupId:"insertMainWidgets",items:["menuBar:insertImage","menuBar:ckbox","menuBar:ckfinder","menuBar:insertTable","menuBar:insertTableLayout"]},{groupId:"insertInline",items:["menuBar:link","menuBar:insertFootnote","menuBar:bookmark","menuBar:comment","menuBar:insertMergeField","menuBar:emoji"]},{groupId:"insertMinorWidgets",items:["menuBar:mediaEmbed","menuBar:insertTemplate","menuBar:specialCharacters","menuBar:blockQuote","menuBar:codeBlock","menuBar:htmlEmbed"]},{groupId:"insertStructureWidgets",items:["menuBar:horizontalLine","menuBar:pageBreak","menuBar:tableOfContents"]},{groupId:"restrictedEditingException",items:["menuBar:restrictedEditingException:inline","menuBar:restrictedEditingException:block"]}]},{menuId:"format",label:"Format",groups:[{groupId:"textAndFont",items:[{menuId:"text",label:"Text",groups:[{groupId:"basicStyles",items:["menuBar:bold","menuBar:italic","menuBar:underline","menuBar:strikethrough","menuBar:superscript","menuBar:subscript","menuBar:code"]},{groupId:"textPartLanguage",items:["menuBar:textPartLanguage"]}]},{menuId:"font",label:"Font",groups:[{groupId:"fontProperties",items:["menuBar:fontSize","menuBar:fontFamily"]},{groupId:"fontColors",items:["menuBar:fontColor","menuBar:fontBackgroundColor"]},{groupId:"highlight",items:["menuBar:highlight"]}]},"menuBar:heading"]},{groupId:"list",items:["menuBar:bulletedList","menuBar:numberedList","menuBar:multiLevelList","menuBar:todoList"]},{groupId:"indent",items:["menuBar:alignment","menuBar:lineHeight","menuBar:indent","menuBar:outdent"]},{groupId:"caseChange",items:["menuBar:caseChange"]},{groupId:"removeFormat",items:["menuBar:removeFormat"]}]},{menuId:"tools",label:"Tools",groups:[{groupId:"aiTools",items:["menuBar:aiAssistant","menuBar:aiCommands","menuBar:toggleAi","menuBar:aiQuickActions"]},{groupId:"tools",items:["menuBar:trackChanges","menuBar:commentsArchive"]}]},{menuId:"help",label:"Help",groups:[{groupId:"help",items:["menuBar:accessibilityHelp"]}]}];function xT(e){let t;return!("items"in e)||!e.items?t={items:Ae(CT),addItems:[],removeItems:[],isVisible:!0,isUsingDefaultConfig:!0,...e}:t={items:e.items,removeItems:[],addItems:[],isVisible:!0,isUsingDefaultConfig:!1,...e},t}function TT({normalizedConfig:e,locale:t,componentFactory:i,extraItems:o}){let n=Ae(e);return Qb(e,n,o),ET(e,n),Qb(e,n,n.addItems),AT(e,n,i),Iw(e,n),IT(n,t),n}function ET(e,t){let i=t.removeItems,o=[];t.items=t.items.filter(({menuId:n})=>i.includes(n)?(o.push(n),!1):!0),Zn(t.items,n=>{n.groups=n.groups.filter(({groupId:s})=>i.includes(s)?(o.push(s),!1):!0);for(let s of n.groups)s.items=s.items.filter(r=>{let a=Sw(r);return i.includes(a)?(o.push(a),!1):!0})});for(let n of i)o.includes(n)||D("menu-bar-item-could-not-be-removed",{menuBarConfig:e,itemName:n})}function Qb(e,t,i){let o=[];if(i.length!=0){for(let n of i){let s=RT(n.position),r=VT(n.position);if(ST(n))if(!r)s==="start"?(t.items.unshift(n.menu),o.push(n)):s==="end"&&(t.items.push(n.menu),o.push(n));else{let a=t.items.findIndex(l=>l.menuId===r);a!=-1?s==="before"?(t.items.splice(a,0,n.menu),o.push(n)):s==="after"&&(t.items.splice(a+1,0,n.menu),o.push(n)):Yb(t,n.menu,r,s)&&o.push(n)}else PT(n)?Zn(t.items,a=>{if(a.menuId===r)s==="start"?(a.groups.unshift(n.group),o.push(n)):s==="end"&&(a.groups.push(n.group),o.push(n));else{let l=a.groups.findIndex(c=>c.groupId===r);l!==-1&&(s==="before"?(a.groups.splice(l,0,n.group),o.push(n)):s==="after"&&(a.groups.splice(l+1,0,n.group),o.push(n)))}}):Yb(t,n.item,r,s)&&o.push(n)}for(let n of i)o.includes(n)||D("menu-bar-item-could-not-be-added",{menuBarConfig:e,addedItemConfig:n})}}function Yb(e,t,i,o){let n=!1;return Zn(e.items,s=>{for(let{groupId:r,items:a}of s.groups){if(n)return;if(r===i)o==="start"?(a.unshift(t),n=!0):o==="end"&&(a.push(t),n=!0);else{let l=a.findIndex(c=>Sw(c)===i);l!==-1&&(o==="before"?(a.splice(l,0,t),n=!0):o==="after"&&(a.splice(l+1,0,t),n=!0))}}}),n}function AT(e,t,i){Zn(t.items,o=>{for(let n of o.groups)n.items=n.items.filter(s=>{let r=typeof s=="string"&&!i.has(s);return r&&!t.isUsingDefaultConfig&&D("menu-bar-item-unavailable",{menuBarConfig:e,parentMenuConfig:Ae(o),componentName:s}),!r})})}function Iw(e,t){let i=t.isUsingDefaultConfig,o=!1;if(t.items=t.items.filter(n=>n.groups.length?!0:(sh(e,n,i),!1)),!t.items.length){sh(e,e,i);return}Zn(t.items,n=>{n.groups=n.groups.filter(s=>s.items.length?!0:(o=!0,!1));for(let s of n.groups)s.items=s.items.filter(r=>Pw(r)&&!r.groups.length?(sh(e,r,i),o=!0,!1):!0)}),o&&Iw(e,t)}function sh(e,t,i){i||D("menu-bar-menu-empty",{menuBarConfig:e,emptyMenuConfig:t})}function IT(e,t){let i=t.t,o={File:i({string:"File",id:"MENU_BAR_MENU_FILE"}),Edit:i({string:"Edit",id:"MENU_BAR_MENU_EDIT"}),View:i({string:"View",id:"MENU_BAR_MENU_VIEW"}),Insert:i({string:"Insert",id:"MENU_BAR_MENU_INSERT"}),Format:i({string:"Format",id:"MENU_BAR_MENU_FORMAT"}),Tools:i({string:"Tools",id:"MENU_BAR_MENU_TOOLS"}),Help:i({string:"Help",id:"MENU_BAR_MENU_HELP"}),Text:i({string:"Text",id:"MENU_BAR_MENU_TEXT"}),Font:i({string:"Font",id:"MENU_BAR_MENU_FONT"})};Zn(e.items,n=>{n.label in o&&(n.label=o[n.label])})}function Zn(e,t){/* v8 ignore else -- @preserve */if(Array.isArray(e))for(let o of e)i(o);function i(o){t(o);for(let n of o.groups)for(let s of n.items)Pw(s)&&i(s)}}function ST(e){return typeof e=="object"&&"menu"in e}function PT(e){return typeof e=="object"&&"group"in e}function RT(e){return e.startsWith("start")?"start":e.startsWith("end")?"end":e.startsWith("after")?"after":"before"}function VT(e){let t=e.match(/^[^:]+:(.+)/);return t?t[1]:null}function Sw(e){return typeof e=="string"?e:e.menuId}function Pw(e){return typeof e=="object"&&"menuId"in e}/** +*/var Al=5,qn={toggleMenusAndFocusItemsOnHover(e){e.on("menu:mouseenter",t=>{if(!(!e.isFocusBorderEnabled&&!e.isOpen)){if(e.isOpen)for(let i of e.menus){let o=t.path[0],n=o instanceof Jn&&o.children.first===i;i.isOpen=(t.path.includes(i)||n)&&i.isEnabled}t.source.focus()}})},focusCycleMenusOnArrows(e){let t=e.locale.uiLanguageDirection==="rtl";e.on("menu:arrowright",o=>{i(o.source,t?-1:1)}),e.on("menu:arrowleft",o=>{i(o.source,t?1:-1)});function i(o,n){let s=e.children.getIndex(o),r=o.isOpen,a=e.children.length,l=e.children.get((s+a+n)%a);o.isOpen=!1,r&&(l.isOpen=!0),l.buttonView.focus()}},closeMenusWhenTheBarCloses(e){e.on("change:isOpen",()=>{e.isOpen||e.menus.forEach(t=>{t.isOpen=!1})})},closeMenuWhenAnotherOnTheSameLevelOpens(e){e.on("menu:change:isOpen",(t,i,o)=>{o&&e.menus.filter(n=>t.source.parentMenuView===n.parentMenuView&&t.source!==n&&n.isOpen).forEach(n=>{n.isOpen=!1})})},closeOnClickOutside(e){kt({emitter:e,activator:()=>e.isOpen,callback:()=>e.close(),contextElements:()=>e.children.map(t=>t.element)})},enableFocusHighlightOnInteraction(e){let t=!1;e.on("change:isOpen",(i,o,n)=>{n||(t||(e.isFocusBorderEnabled=!1),t=!1)}),e.listenTo(e.element,"keydown",()=>{t=!0},{useCapture:!0}),e.listenTo(e.element,"keyup",()=>{t=!1},{useCapture:!0}),e.listenTo(e.element,"focus",()=>{t&&(e.isFocusBorderEnabled=!0)},{useCapture:!0})}},ji={openAndFocusPanelOnArrowDownKey(e){e.keystrokes.set("arrowdown",(t,i)=>{e.isEnabled&&e.focusTracker.focusedElement===e.buttonView.element&&(e.isOpen||(e.isOpen=!0),e.panelView.focus(),i())})},openOnArrowRightKey(e){let t=e.locale.uiLanguageDirection==="rtl"?"arrowleft":"arrowright";e.keystrokes.set(t,(i,o)=>{e.focusTracker.focusedElement!==e.buttonView.element||!e.isEnabled||(e.isOpen||(e.isOpen=!0),e.panelView.focus(),o())})},openOnButtonClick(e){e.buttonView.on("execute",()=>{e.isOpen=!0})},toggleOnButtonClick(e){e.buttonView.on("execute",()=>{e.isOpen=!e.isOpen})},openAndFocusOnEnterKeyPress(e){e.keystrokes.set("enter",(t,i)=>{e.focusTracker.focusedElement===e.buttonView.element&&(e.isOpen=!0,e.panelView.focus(),i())})},closeOnArrowLeftKey(e){let t=e.locale.uiLanguageDirection==="rtl"?"arrowright":"arrowleft";e.keystrokes.set(t,(i,o)=>{e.isOpen&&(e.isOpen=!1,e.focus(),o())})},closeOnEscKey(e){e.keystrokes.set("esc",(t,i)=>{e.isOpen&&(e.isOpen=!1,e.focus(),i())})},closeOnParentClose(e){e.parentMenuView.on("change:isOpen",(t,i,o)=>{!o&&t.source===e.parentMenuView&&(e.isOpen=!1)})}},xT={southEast:e=>({top:e.bottom,left:e.left,name:"se"}),southWest:(e,t)=>({top:e.bottom,left:e.left-t.width+e.width,name:"sw"}),northEast:(e,t)=>({top:e.top-t.height,left:e.left,name:"ne"}),northWest:(e,t)=>({top:e.top-t.height,left:e.left-t.width+e.width,name:"nw"}),eastSouth:e=>({top:e.top,left:e.right-Al,name:"es"}),eastNorth:(e,t)=>({top:e.top-t.height,left:e.right-Al,name:"en"}),westSouth:(e,t)=>({top:e.top,left:e.left-t.width+Al,name:"ws"}),westNorth:(e,t)=>({top:e.top-t.height,left:e.left-t.width+Al,name:"wn"})},TT=[{menuId:"file",label:"File",groups:[{groupId:"export",items:["menuBar:exportPdf","menuBar:exportWord"]},{groupId:"import",items:["menuBar:importWord"]},{groupId:"revisionHistory",items:["menuBar:revisionHistory"]}]},{menuId:"edit",label:"Edit",groups:[{groupId:"undo",items:["menuBar:undo","menuBar:redo"]},{groupId:"selectAll",items:["menuBar:selectAll"]},{groupId:"findAndReplace",items:["menuBar:findAndReplace"]}]},{menuId:"view",label:"View",groups:[{groupId:"sourceEditingEnhanced",items:["menuBar:sourceEditingEnhanced"]},{groupId:"sourceEditing",items:["menuBar:sourceEditing"]},{groupId:"showBlocks",items:["menuBar:showBlocks"]},{groupId:"previewMergeFields",items:["menuBar:previewMergeFields"]},{groupId:"fullscreen",items:["menuBar:fullscreen"]},{groupId:"restrictedEditing",items:["menuBar:restrictedEditing"]}]},{menuId:"insert",label:"Insert",groups:[{groupId:"insertMainWidgets",items:["menuBar:insertImage","menuBar:ckbox","menuBar:ckfinder","menuBar:insertTable","menuBar:insertTableLayout"]},{groupId:"insertInline",items:["menuBar:link","menuBar:insertFootnote","menuBar:bookmark","menuBar:comment","menuBar:insertMergeField","menuBar:emoji"]},{groupId:"insertMinorWidgets",items:["menuBar:mediaEmbed","menuBar:insertTemplate","menuBar:specialCharacters","menuBar:blockQuote","menuBar:codeBlock","menuBar:htmlEmbed"]},{groupId:"insertStructureWidgets",items:["menuBar:horizontalLine","menuBar:pageBreak","menuBar:tableOfContents"]},{groupId:"restrictedEditingException",items:["menuBar:restrictedEditingException:inline","menuBar:restrictedEditingException:block"]}]},{menuId:"format",label:"Format",groups:[{groupId:"textAndFont",items:[{menuId:"text",label:"Text",groups:[{groupId:"basicStyles",items:["menuBar:bold","menuBar:italic","menuBar:underline","menuBar:strikethrough","menuBar:superscript","menuBar:subscript","menuBar:code"]},{groupId:"textPartLanguage",items:["menuBar:textPartLanguage"]}]},{menuId:"font",label:"Font",groups:[{groupId:"fontProperties",items:["menuBar:fontSize","menuBar:fontFamily"]},{groupId:"fontColors",items:["menuBar:fontColor","menuBar:fontBackgroundColor"]},{groupId:"highlight",items:["menuBar:highlight"]}]},"menuBar:heading"]},{groupId:"list",items:["menuBar:bulletedList","menuBar:numberedList","menuBar:multiLevelList","menuBar:todoList"]},{groupId:"indent",items:["menuBar:alignment","menuBar:lineHeight","menuBar:indent","menuBar:outdent"]},{groupId:"caseChange",items:["menuBar:caseChange"]},{groupId:"removeFormat",items:["menuBar:removeFormat"]}]},{menuId:"tools",label:"Tools",groups:[{groupId:"aiTools",items:["menuBar:aiAssistant","menuBar:aiCommands","menuBar:toggleAi","menuBar:aiQuickActions"]},{groupId:"tools",items:["menuBar:trackChanges","menuBar:commentsArchive"]}]},{menuId:"help",label:"Help",groups:[{groupId:"help",items:["menuBar:accessibilityHelp"]}]}];function ET(e){let t;return!("items"in e)||!e.items?t={items:Se(TT),addItems:[],removeItems:[],isVisible:!0,isUsingDefaultConfig:!0,...e}:t={items:e.items,removeItems:[],addItems:[],isVisible:!0,isUsingDefaultConfig:!1,...e},t}function AT({normalizedConfig:e,locale:t,componentFactory:i,extraItems:o}){let n=Se(e);return Xb(e,n,o),IT(e,n),Xb(e,n,n.addItems),ST(e,n,i),Pw(e,n),PT(n,t),n}function IT(e,t){let i=t.removeItems,o=[];t.items=t.items.filter(({menuId:n})=>i.includes(n)?(o.push(n),!1):!0),Zn(t.items,n=>{n.groups=n.groups.filter(({groupId:s})=>i.includes(s)?(o.push(s),!1):!0);for(let s of n.groups)s.items=s.items.filter(r=>{let a=Rw(r);return i.includes(a)?(o.push(a),!1):!0})});for(let n of i)o.includes(n)||D("menu-bar-item-could-not-be-removed",{menuBarConfig:e,itemName:n})}function Xb(e,t,i){let o=[];if(i.length!=0){for(let n of i){let s=LT(n.position),r=MT(n.position);if(RT(n))if(!r)s==="start"?(t.items.unshift(n.menu),o.push(n)):s==="end"&&(t.items.push(n.menu),o.push(n));else{let a=t.items.findIndex(l=>l.menuId===r);a!=-1?s==="before"?(t.items.splice(a,0,n.menu),o.push(n)):s==="after"&&(t.items.splice(a+1,0,n.menu),o.push(n)):ew(t,n.menu,r,s)&&o.push(n)}else VT(n)?Zn(t.items,a=>{if(a.menuId===r)s==="start"?(a.groups.unshift(n.group),o.push(n)):s==="end"&&(a.groups.push(n.group),o.push(n));else{let l=a.groups.findIndex(c=>c.groupId===r);l!==-1&&(s==="before"?(a.groups.splice(l,0,n.group),o.push(n)):s==="after"&&(a.groups.splice(l+1,0,n.group),o.push(n)))}}):ew(t,n.item,r,s)&&o.push(n)}for(let n of i)o.includes(n)||D("menu-bar-item-could-not-be-added",{menuBarConfig:e,addedItemConfig:n})}}function ew(e,t,i,o){let n=!1;return Zn(e.items,s=>{for(let{groupId:r,items:a}of s.groups){if(n)return;if(r===i)o==="start"?(a.unshift(t),n=!0):o==="end"&&(a.push(t),n=!0);else{let l=a.findIndex(c=>Rw(c)===i);l!==-1&&(o==="before"?(a.splice(l,0,t),n=!0):o==="after"&&(a.splice(l+1,0,t),n=!0))}}}),n}function ST(e,t,i){Zn(t.items,o=>{for(let n of o.groups)n.items=n.items.filter(s=>{let r=typeof s=="string"&&!i.has(s);return r&&!t.isUsingDefaultConfig&&D("menu-bar-item-unavailable",{menuBarConfig:e,parentMenuConfig:Se(o),componentName:s}),!r})})}function Pw(e,t){let i=t.isUsingDefaultConfig,o=!1;if(t.items=t.items.filter(n=>n.groups.length?!0:(ah(e,n,i),!1)),!t.items.length){ah(e,e,i);return}Zn(t.items,n=>{n.groups=n.groups.filter(s=>s.items.length?!0:(o=!0,!1));for(let s of n.groups)s.items=s.items.filter(r=>Vw(r)&&!r.groups.length?(ah(e,r,i),o=!0,!1):!0)}),o&&Pw(e,t)}function ah(e,t,i){i||D("menu-bar-menu-empty",{menuBarConfig:e,emptyMenuConfig:t})}function PT(e,t){let i=t.t,o={File:i({string:"File",id:"MENU_BAR_MENU_FILE"}),Edit:i({string:"Edit",id:"MENU_BAR_MENU_EDIT"}),View:i({string:"View",id:"MENU_BAR_MENU_VIEW"}),Insert:i({string:"Insert",id:"MENU_BAR_MENU_INSERT"}),Format:i({string:"Format",id:"MENU_BAR_MENU_FORMAT"}),Tools:i({string:"Tools",id:"MENU_BAR_MENU_TOOLS"}),Help:i({string:"Help",id:"MENU_BAR_MENU_HELP"}),Text:i({string:"Text",id:"MENU_BAR_MENU_TEXT"}),Font:i({string:"Font",id:"MENU_BAR_MENU_FONT"})};Zn(e.items,n=>{n.label in o&&(n.label=o[n.label])})}function Zn(e,t){/* v8 ignore else -- @preserve */if(Array.isArray(e))for(let o of e)i(o);function i(o){t(o);for(let n of o.groups)for(let s of n.items)Vw(s)&&i(s)}}function RT(e){return typeof e=="object"&&"menu"in e}function VT(e){return typeof e=="object"&&"group"in e}function LT(e){return e.startsWith("start")?"start":e.startsWith("end")?"end":e.startsWith("after")?"after":"before"}function MT(e){let t=e.match(/^[^:]+:(.+)/);return t?t[1]:null}function Rw(e){return typeof e=="string"?e:e.menuId}function Vw(e){return typeof e=="object"&&"menuId"in e}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var LT=W(),Rw=class extends LT{editor;componentFactory;focusTracker;tooltipManager;poweredBy;evaluationBadge;ariaLiveAnnouncer;isReady=!1;shadowRootRegistry=new Lu;_overlayHost=null;_editableElementsMap=new Map;_focusableToolbarDefinitions=[];_extraMenuBarElements=[];_lastFocusedForeignElement=null;_domEmitter;constructor(e){super();let t=e.editing.view;this.editor=e,this.componentFactory=new gT(e),this.focusTracker=new Q,this.tooltipManager=Aw.for(e.locale),this.poweredBy=new I9(e),this.evaluationBadge=new _T(e),this.ariaLiveAnnouncer=new s9(e),this._initViewportOffset(this._readViewportOffsetFromConfig()),BT(this),this.once("ready",()=>{MT(e),this._overlayHost=new yT(e.locale,{bodyCollection:this.view.body,shadowRootRegistry:this.shadowRootRegistry,tooltipManager:this.tooltipManager,resolveMountTarget:()=>this._getBodyCollectionMountTarget(),updateEmitter:this}),this._bindBodyCollectionWatchers(),this._overlayHost.sync(),this.isReady=!0}),this.listenTo(t.document,"layoutChanged",this.update.bind(this)),this.listenTo(t,"scrollToTheSelection",this._handleScrollToTheSelection.bind(this)),this._initFocusTracking(),this._initVisualViewportSupport()}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy(),this._overlayHost&&(this._overlayHost.destroy(),this._overlayHost=null),this.tooltipManager.release(),this.poweredBy.destroy(),this.evaluationBadge.destroy();for(let e of this._editableElementsMap.values())e.ckeditorInstance=null,this.editor.keystrokes.stopListening(e);this.shadowRootRegistry.destroy(),this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[],this._domEmitter&&this._domEmitter.stopListening()}setEditableElement(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor),this.focusTracker.add(t),this.shadowRootRegistry.registerNode(t);let i=()=>{this.editor.editing.view.getDomRoot(e)||this.editor.keystrokes.listenTo(t)};this.isReady?i():this.once("ready",i)}removeEditableElement(e){let t=this._editableElementsMap.get(e);t&&(this._editableElementsMap.delete(e),this.editor.keystrokes.stopListening(t),this.focusTracker.remove(t),this.shadowRootRegistry.unregisterNode(t),t.ckeditorInstance=null)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}addToolbar(e,t={}){let i=()=>{this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element),this.shadowRootRegistry.registerNode(e.element)};e.isRendered?i():e.once("render",i),this._focusableToolbarDefinitions.push({toolbarView:e,options:t})}extendMenuBar(e){this._extraMenuBarElements.push(e)}initMenuBar(e){let t=e.element;this.focusTracker.add(t),this.editor.keystrokes.listenTo(t),this.shadowRootRegistry.registerNode(t);let i=xT(this.editor.config.get("menuBar")||{});e.fillFromConfig(i,this.componentFactory,this._extraMenuBarElements),this.editor.keystrokes.set("Esc",(o,n)=>{t.contains(this.editor.ui.focusTracker.focusedElement)&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):this.editor.editing.view.focus(),n())}),this.editor.keystrokes.set("Alt+F9",(o,n)=>{t.contains(this.editor.ui.focusTracker.focusedElement)||(this._saveLastFocusedForeignElement(),e.isFocusBorderEnabled=!0,e.focus(),n())})}_readViewportOffsetFromConfig(){let e=this.editor,t=e.config.get("ui.viewportOffset");if(t)return t;let i=e.config.get("toolbar.viewportTopOffset");return i?(console.warn("editor-ui-deprecated-viewport-offset-config: The `toolbar.vieportTopOffset` configuration option is deprecated. It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead."),{top:i}):{top:0}}_initFocusTracking(){let e=this.editor,t;e.keystrokes.set("Alt+F10",(i,o)=>{this._saveLastFocusedForeignElement();let n=this._getCurrentFocusedToolbarDefinition();(!n||!t)&&(t=this._getFocusableCandidateToolbarDefinitions());for(let s=0;s{let n=this._getCurrentFocusedToolbarDefinition();n&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):e.editing.view.focus(),n.options.afterBlur&&n.options.afterBlur(),o())})}_saveLastFocusedForeignElement(){let e=this.focusTracker.focusedElement;Array.from(this._editableElementsMap.values()).includes(e)&&!Array.from(this.editor.editing.view.domRoots.values()).includes(e)&&(this._lastFocusedForeignElement=e)}_getFocusableCandidateToolbarDefinitions(){let e=[];for(let t of this._focusableToolbarDefinitions){let{toolbarView:i,options:o}=t;(jt(i.element)||o.beforeFocus)&&e.push(t)}return e.sort((t,i)=>Xb(t)-Xb(i)),e}_getCurrentFocusedToolbarDefinition(){for(let e of this._focusableToolbarDefinitions)if(e.toolbarView.element&&e.toolbarView.element.contains(this.focusTracker.focusedElement))return e;return null}_focusFocusableCandidateToolbar(e){let{toolbarView:t,options:{beforeFocus:i}}=e;return i&&i(),jt(t.element)?(t.focus(),!0):!1}_handleScrollToTheSelection(e,t){let i={top:0,bottom:0,left:0,right:0,...this.viewportOffset};t.viewportOffset.top+=i.top,t.viewportOffset.bottom+=i.bottom,t.viewportOffset.left+=i.left,t.viewportOffset.right+=i.right}_getBodyCollectionMountTarget(){let e=this.editor.config.get("ui.overlayContainer");if(e)return e;for(let t of this.editor.editing.view.domRoots.values()){let i=eg(t);if(i)return i}return null}_bindBodyCollectionWatchers(){let e=this.view.body;for(let t of e)this.focusTracker.add(t.element),this.shadowRootRegistry.registerNode(t.element);e.on("add",(t,i)=>{this.focusTracker.add(i.element),this.shadowRootRegistry.registerNode(i.element)}),e.on("remove",(t,i)=>{this.focusTracker.remove(i.element),this.shadowRootRegistry.unregisterNode(i.element)})}_initViewportOffset(e){this.on("set:viewportOffset",(t,i,o)=>{let n=this._getVisualViewportTopOffset(o);o.visualTop!==n&&(t.return={...o,visualTop:n})}),this.set("viewportOffset",e)}_initVisualViewportSupport(){if(!S.window.visualViewport)return;let e=()=>{let t=this._getVisualViewportTopOffset(this.viewportOffset);this.viewportOffset.visualTop!==t&&(this.viewportOffset={...this.viewportOffset,visualTop:t})};this._domEmitter=new(pe()),this._domEmitter.listenTo(S.window.visualViewport,"scroll",e),this._domEmitter.listenTo(S.window.visualViewport,"resize",e)}_getVisualViewportTopOffset(e){let t=ag().top,i=e.top||0;return t>i?0:i-t}};function Xb(e){let{toolbarView:t,options:i}=e,o=10;return jt(t.element)&&o--,i.isContextual&&(o-=2),o}function MT(e){let t=e.config.get("ui.overlayContainer");t&&!t.isConnected&&D("ui-overlay-container-not-connected",{overlayContainer:t})}function BT(e){e.editor.config.get("ui.overlayContainer")||e.shadowRootRegistry.once("add",(t,i)=>{D("ui-overlay-container-not-configured",{shadowRoot:i})})}/** +*/var BT=W(),Lw=class extends BT{editor;componentFactory;focusTracker;tooltipManager;poweredBy;evaluationBadge;ariaLiveAnnouncer;isReady=!1;shadowRootRegistry=new Bu;_overlayHost=null;_editableElementsMap=new Map;_focusableToolbarDefinitions=[];_extraMenuBarElements=[];_lastFocusedForeignElement=null;_domEmitter;constructor(e){super();let t=e.editing.view;this.editor=e,this.componentFactory=new bT(e),this.focusTracker=new Q,this.tooltipManager=Sw.for(e.locale),this.poweredBy=new P9(e),this.evaluationBadge=new kT(e),this.ariaLiveAnnouncer=new a9(e),this._initViewportOffset(this._readViewportOffsetFromConfig()),DT(this),this.once("ready",()=>{OT(e),this._overlayHost=new vT(e.locale,{bodyCollection:this.view.body,shadowRootRegistry:this.shadowRootRegistry,tooltipManager:this.tooltipManager,resolveMountTarget:()=>this._getBodyCollectionMountTarget(),updateEmitter:this}),this._bindBodyCollectionWatchers(),this._overlayHost.sync(),this.isReady=!0}),this.listenTo(t.document,"layoutChanged",this.update.bind(this)),this.listenTo(t,"scrollToTheSelection",this._handleScrollToTheSelection.bind(this)),this._initFocusTracking(),this._initVisualViewportSupport()}get element(){return null}update(){this.fire("update")}destroy(){this.stopListening(),this.focusTracker.destroy(),this._overlayHost&&(this._overlayHost.destroy(),this._overlayHost=null),this.tooltipManager.release(),this.poweredBy.destroy(),this.evaluationBadge.destroy();for(let e of this._editableElementsMap.values())e.ckeditorInstance=null,this.editor.keystrokes.stopListening(e);this.shadowRootRegistry.destroy(),this._editableElementsMap=new Map,this._focusableToolbarDefinitions=[],this._domEmitter&&this._domEmitter.stopListening()}setEditableElement(e,t){this._editableElementsMap.set(e,t),t.ckeditorInstance||(t.ckeditorInstance=this.editor),this.focusTracker.add(t),this.shadowRootRegistry.registerNode(t);let i=()=>{this.editor.editing.view.getDomRoot(e)||this.editor.keystrokes.listenTo(t)};this.isReady?i():this.once("ready",i)}removeEditableElement(e){let t=this._editableElementsMap.get(e);t&&(this._editableElementsMap.delete(e),this.editor.keystrokes.stopListening(t),this.focusTracker.remove(t),this.shadowRootRegistry.unregisterNode(t),t.ckeditorInstance=null)}getEditableElement(e="main"){return this._editableElementsMap.get(e)}getEditableElementsNames(){return this._editableElementsMap.keys()}addToolbar(e,t={}){let i=()=>{this.focusTracker.add(e),this.editor.keystrokes.listenTo(e.element),this.shadowRootRegistry.registerNode(e.element)};e.isRendered?i():e.once("render",i),this._focusableToolbarDefinitions.push({toolbarView:e,options:t})}extendMenuBar(e){this._extraMenuBarElements.push(e)}initMenuBar(e){let t=e.element;this.focusTracker.add(t),this.editor.keystrokes.listenTo(t),this.shadowRootRegistry.registerNode(t);let i=ET(this.editor.config.get("menuBar")||{});e.fillFromConfig(i,this.componentFactory,this._extraMenuBarElements),this.editor.keystrokes.set("Esc",(o,n)=>{t.contains(this.editor.ui.focusTracker.focusedElement)&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):this.editor.editing.view.focus(),n())}),this.editor.keystrokes.set("Alt+F9",(o,n)=>{t.contains(this.editor.ui.focusTracker.focusedElement)||(this._saveLastFocusedForeignElement(),e.isFocusBorderEnabled=!0,e.focus(),n())})}_readViewportOffsetFromConfig(){let e=this.editor,t=e.config.get("ui.viewportOffset");if(t)return t;let i=e.config.get("toolbar.viewportTopOffset");return i?(console.warn("editor-ui-deprecated-viewport-offset-config: The `toolbar.vieportTopOffset` configuration option is deprecated. It will be removed from future CKEditor versions. Use `ui.viewportOffset.top` instead."),{top:i}):{top:0}}_initFocusTracking(){let e=this.editor,t;e.keystrokes.set("Alt+F10",(i,o)=>{this._saveLastFocusedForeignElement();let n=this._getCurrentFocusedToolbarDefinition();(!n||!t)&&(t=this._getFocusableCandidateToolbarDefinitions());for(let s=0;s{let n=this._getCurrentFocusedToolbarDefinition();n&&(this._lastFocusedForeignElement?(this._lastFocusedForeignElement.focus(),this._lastFocusedForeignElement=null):e.editing.view.focus(),n.options.afterBlur&&n.options.afterBlur(),o())})}_saveLastFocusedForeignElement(){let e=this.focusTracker.focusedElement;Array.from(this._editableElementsMap.values()).includes(e)&&!Array.from(this.editor.editing.view.domRoots.values()).includes(e)&&(this._lastFocusedForeignElement=e)}_getFocusableCandidateToolbarDefinitions(){let e=[];for(let t of this._focusableToolbarDefinitions){let{toolbarView:i,options:o}=t;(Gt(i.element)||o.beforeFocus)&&e.push(t)}return e.sort((t,i)=>tw(t)-tw(i)),e}_getCurrentFocusedToolbarDefinition(){for(let e of this._focusableToolbarDefinitions)if(e.toolbarView.element&&e.toolbarView.element.contains(this.focusTracker.focusedElement))return e;return null}_focusFocusableCandidateToolbar(e){let{toolbarView:t,options:{beforeFocus:i}}=e;return i&&i(),Gt(t.element)?(t.focus(),!0):!1}_handleScrollToTheSelection(e,t){let i={top:0,bottom:0,left:0,right:0,...this.viewportOffset};t.viewportOffset.top+=i.top,t.viewportOffset.bottom+=i.bottom,t.viewportOffset.left+=i.left,t.viewportOffset.right+=i.right}_getBodyCollectionMountTarget(){let e=this.editor.config.get("ui.overlayContainer");if(e)return e;for(let t of this.editor.editing.view.domRoots.values()){let i=ig(t);if(i)return i}return null}_bindBodyCollectionWatchers(){let e=this.view.body;for(let t of e)this.focusTracker.add(t.element),this.shadowRootRegistry.registerNode(t.element);e.on("add",(t,i)=>{this.focusTracker.add(i.element),this.shadowRootRegistry.registerNode(i.element)}),e.on("remove",(t,i)=>{this.focusTracker.remove(i.element),this.shadowRootRegistry.unregisterNode(i.element)})}_initViewportOffset(e){this.on("set:viewportOffset",(t,i,o)=>{let n=this._getVisualViewportTopOffset(o);o.visualTop!==n&&(t.return={...o,visualTop:n})}),this.set("viewportOffset",e)}_initVisualViewportSupport(){if(!S.window.visualViewport)return;let e=()=>{let t=this._getVisualViewportTopOffset(this.viewportOffset);this.viewportOffset.visualTop!==t&&(this.viewportOffset={...this.viewportOffset,visualTop:t})};this._domEmitter=new(be()),this._domEmitter.listenTo(S.window.visualViewport,"scroll",e),this._domEmitter.listenTo(S.window.visualViewport,"resize",e)}_getVisualViewportTopOffset(e){let t=cg().top,i=e.top||0;return t>i?0:i-t}};function tw(e){let{toolbarView:t,options:i}=e,o=10;return Gt(t.element)&&o--,i.isContextual&&(o-=2),o}function OT(e){let t=e.config.get("ui.overlayContainer");t&&!t.isConnected&&D("ui-overlay-container-not-connected",{overlayContainer:t})}function DT(e){e.editor.config.get("ui.overlayContainer")||e.shadowRootRegistry.once("add",(t,i)=>{D("ui-overlay-container-not-configured",{shadowRoot:i})})}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Vw=class extends R{body;menuBarView;toolbar;constructor(e){super(e),this.body=new fw(e)}destroy(){return this.body.destroy(),super.destroy()}};/** +*/var Mw=class extends R{body;menuBarView;toolbar;constructor(e){super(e),this.body=new gw(e)}destroy(){return this.body.destroy(),super.destroy()}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var OT=class extends R{name=null;_editingView;_editableElement;_hasExternalElement;constructor(e,t,i){super(e);let{name:o,classes:n,styles:s,attributes:r}=(ew(i)?void 0:i)||{};this.set("isFocused",!1),this.set("isInlineRoot",!1),this.set("isMainFrameEditingRoot",!1),this.setTemplate({tag:o||"div",attributes:{...r,class:["ck","ck-content","ck-editor__editable","ck-rounded-corners",this.bindTemplate.if("isInlineRoot","ck-editor__editable_inline-root"),this.bindTemplate.if("isMainFrameEditingRoot","ck-editor__editable_root"),...n?j(n):[]],...s&&{style:s},lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this._editableElement=ew(i)?i:void 0,this._hasExternalElement=!!this._editableElement,this._editingView=t}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()}get hasExternalElement(){return this._hasExternalElement}_updateIsFocusedClasses(){let e=this._editingView;e.isRenderingInProgress?i(this):t(this);function t(o){e.change(n=>{let s=e.document.getRoot(o.name);n.addClass(o.isFocused?"ck-focused":"ck-blurred",s),n.removeClass(o.isFocused?"ck-blurred":"ck-focused",s)})}function i(o){e.once("change:isRenderingInProgress",(n,s,r)=>{r?i(o):t(o)})}}};function ew(e){return et(e)}/** +*/var FT=class extends R{name=null;_editingView;_editableElement;_hasExternalElement;constructor(e,t,i){super(e);let{name:o,classes:n,styles:s,attributes:r}=(iw(i)?void 0:i)||{};this.set("isFocused",!1),this.set("isInlineRoot",!1),this.set("isMainFrameEditingRoot",!1),this.setTemplate({tag:o||"div",attributes:{...r,class:["ck","ck-content","ck-editor__editable","ck-rounded-corners",this.bindTemplate.if("isInlineRoot","ck-editor__editable_inline-root"),this.bindTemplate.if("isMainFrameEditingRoot","ck-editor__editable_root"),...n?j(n):[]],...s&&{style:s},lang:e.contentLanguage,dir:e.contentLanguageDirection}}),this._editableElement=iw(i)?i:void 0,this._hasExternalElement=!!this._editableElement,this._editingView=t}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()}get hasExternalElement(){return this._hasExternalElement}_updateIsFocusedClasses(){let e=this._editingView;e.isRenderingInProgress?i(this):t(this);function t(o){e.change(n=>{let s=e.document.getRoot(o.name);n.addClass(o.isFocused?"ck-focused":"ck-blurred",s),n.removeClass(o.isFocused?"ck-blurred":"ck-focused",s)})}function i(o){e.once("change:isRenderingInProgress",(n,s,r)=>{r?i(o):t(o)})}}};function iw(e){return et(e)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Lw=class extends OT{_options;constructor(e,t,i,o={}){super(e,t,i),this._options=o,this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();let e=this._editingView;e.change(t=>{let i=e.document.getRoot(this.name);t.setAttribute("aria-label",this.getEditableAriaLabel(),i)})}getEditableAriaLabel(){let e=this.locale.t,t=this._options.label,i=this._editableElement,o=this.name;if(typeof t=="string")return t;if(typeof t=="object")return t[o];if(typeof t=="function")return t(this);if(i){let n=i.getAttribute("aria-label");if(n)return n}return e("Rich Text Editor. Editing area: %0",o)}};/** +*/var Bw=class extends FT{_options;constructor(e,t,i,o={}){super(e,t,i),this._options=o,this.extendTemplate({attributes:{role:"textbox",class:"ck-editor__editable_inline"}})}render(){super.render();let e=this._editingView;e.change(t=>{let i=e.document.getRoot(this.name);t.setAttribute("aria-label",this.getEditableAriaLabel(),i)})}getEditableAriaLabel(){let e=this.locale.t,t=this._options.label,i=this._editableElement,o=this.name;if(typeof t=="string")return t;if(typeof t=="object")return t[o];if(typeof t=="function")return t(this);if(i){let n=i.getAttribute("aria-label");if(n)return n}return e("Rich Text Editor. Editing area: %0",o)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */var fe=class extends R{children;constructor(e,t={}){super(e);let i=this.bindTemplate;this.set("class",["ck","ck-form__row",...j(t.class||[])]),this.children=this.createCollection(),t.children&&t.children.forEach(o=>this.children.add(o)),this.set("_role",null),this.set("_ariaLabelledBy",null),t.labelView&&this.set({_role:"group",_ariaLabelledBy:t.labelView.id}),this.setTemplate({tag:"div",attributes:{class:i.to("class",o=>o.join(" ")),role:i.to("_role"),"aria-labelledby":i.to("_ariaLabelledBy")},children:this.children})}};/** @@ -992,13 +992,13 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var ph=class extends Bd{static get pluginName(){return"Notification"}static get isOfficialPlugin(){return!0}init(){this.on("show:warning",(e,t)=>{window.alert(t.message)},{priority:"lowest"})}showSuccess(e,t={}){this._showNotification({message:e,type:"success",namespace:t.namespace,title:t.title})}showInfo(e,t={}){this._showNotification({message:e,type:"info",namespace:t.namespace,title:t.title})}showWarning(e,t={}){this._showNotification({message:e,type:"warning",namespace:t.namespace,title:t.title})}_showNotification(e){let t=e.namespace?`show:${e.type}:${e.namespace}`:`show:${e.type}`;this.fire(t,{message:e.message,type:e.type,title:e.title||""})}};/** +*/var wh=class extends Dd{static get pluginName(){return"Notification"}static get isOfficialPlugin(){return!0}init(){this.on("show:warning",(e,t)=>{window.alert(t.message)},{priority:"lowest"})}showSuccess(e,t={}){this._showNotification({message:e,type:"success",namespace:t.namespace,title:t.title})}showInfo(e,t={}){this._showNotification({message:e,type:"info",namespace:t.namespace,title:t.title})}showWarning(e,t={}){this._showNotification({message:e,type:"warning",namespace:t.namespace,title:t.title})}_showNotification(e){let t=e.namespace?`show:${e.type}:${e.namespace}`:`show:${e.type}`;this.fire(t,{message:e.message,type:e.type,title:e.title||""})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var DT=W(),ki=class extends DT{constructor(e,t){super(),t&&Es(this,t),e&&this.set(e)}};/** +*/var NT=W(),Ot=class extends NT{constructor(e,t){super(),t&&Es(this,t),e&&this.set(e)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Al=po("px"),re=class extends y{positionLimiter;visibleStack;_viewToStack=new Map;_idToStack=new Map;_view=null;_rotatorView=null;_fakePanelsView=null;static get pluginName(){return"ContextualBalloon"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.positionLimiter=()=>{let t=this.editor.editing.view,i=t.document.selection.editableElement;return i?t.domConverter.mapViewToDom(i.root):null},this.decorate("getPositionOptions"),this.set("visibleView",null),this.set("_numberOfStacks",0),this.set("_singleViewMode",!1)}destroy(){super.destroy(),this._view&&this._view.destroy(),this._rotatorView&&this._rotatorView.destroy(),this._fakePanelsView&&this._fakePanelsView.destroy()}get view(){return this._view||this._createPanelView(),this._view}hasView(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this._view||this._createPanelView(),this.hasView(e.view))throw new p("contextualballoon-add-view-exist",[this,e]);let t=e.stackId||"main";if(!this._idToStack.has(t)){this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,(!this._visibleStack||e.singleViewMode)&&this.showStack(t);return}let i=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),i.set(e.view,e),this._viewToStack.set(e.view,i),i===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new p("contextualballoon-remove-view-not-exist",[this,e]);let t=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(t.size===1?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),t.size===1?(this._idToStack.delete(this._getStackId(t)),this._numberOfStacks=this._idToStack.size):t.delete(e),this._viewToStack.delete(e)}updatePosition(e){e&&(this._visibleStack.get(this.visibleView).position=e),this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition()}getPositionOptions(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&(e.limiter||(e=Object.assign({},e,{limiter:this.positionLimiter})),e=Object.assign({},e,{viewportOffsetConfig:{...this.editor.ui.viewportOffset,top:this.editor.ui.viewportOffset.visualTop}})),e}showStack(e){this.visibleStack=e;let t=this._idToStack.get(e);if(!t)throw new p("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}_createPanelView(){this._view=new Me(this.editor.locale),this.editor.ui.view.body.add(this._view),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find(t=>t[1]===e)[0]}_showNextStack(){let e=Array.from(this._idToStack.values()),t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}_showPrevStack(){let e=Array.from(this._idToStack.values()),t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){let e=new FT(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(i,o)=>!o&&i>1),e.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(i,o)=>{if(o<2)return"";let n=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[n,o])}),e.buttonNextView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),e.buttonPrevView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),e}_createFakePanelsView(){let e=new NT(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(t,i)=>!i&&t>=2?Math.min(t-1,2):0),e.listenTo(this.view,"change:top",()=>e.updatePosition()),e.listenTo(this.view,"change:left",()=>e.updatePosition()),this.editor.ui.view.body.add(e),e}_showView({view:e,balloonClassName:t="",withArrow:i=!0,singleViewMode:o=!1}){this.view.class=t,this.view.withArrow=i,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition(),o&&(this._singleViewMode=!0)}},FT=class extends R{focusTracker;buttonPrevView;buttonNextView;content;constructor(e){super(e);let t=e.t,i=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new Q,this.buttonPrevView=this._createButtonView(t("Previous"),yt),this.buttonNextView=this._createButtonView(t("Next"),pl),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",o=>o?"":"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)}destroy(){super.destroy(),this.focusTracker.destroy()}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){let i=new I(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i.extendTemplate({on:{mousedown:i.bindTemplate.to(o=>o.preventDefault())}}),i}},NT=class extends R{content;_balloonPanelView;constructor(e,t){super(e);let 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=t,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",o=>o?"":"ck-hidden")],style:{top:i.to("top",Al),left:i.to("left",Al),width:i.to("width",Al),height:i.to("height",Al)}},children:this.content}),this.on("change:numberOfPanels",(o,n,s,r)=>{s>r?this._addPanels(s-r):this._removePanels(r-s),this.updatePosition()})}_addPanels(e){for(;e--;){let t=new R;t.setTemplate({tag:"div"}),this.content.add(t),this.registerChild(t)}}_removePanels(e){for(;e--;){let t=this.content.last;this.content.remove(t),this.deregisterChild(t),t.destroy()}}updatePosition(){if(this.numberOfPanels){let{top:e,left:t}=this._balloonPanelView,{width:i,height:o}=new F(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:i,height:o})}}};/** +*/var Il=bo("px"),re=class extends w{positionLimiter;visibleStack;_viewToStack=new Map;_idToStack=new Map;_view=null;_rotatorView=null;_fakePanelsView=null;static get pluginName(){return"ContextualBalloon"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.positionLimiter=()=>{let t=this.editor.editing.view,i=t.document.selection.editableElement;return i?t.domConverter.mapViewToDom(i.root):null},this.decorate("getPositionOptions"),this.set("visibleView",null),this.set("_numberOfStacks",0),this.set("_singleViewMode",!1)}destroy(){super.destroy(),this._view&&this._view.destroy(),this._rotatorView&&this._rotatorView.destroy(),this._fakePanelsView&&this._fakePanelsView.destroy()}get view(){return this._view||this._createPanelView(),this._view}hasView(e){return Array.from(this._viewToStack.keys()).includes(e)}add(e){if(this._view||this._createPanelView(),this.hasView(e.view))throw new p("contextualballoon-add-view-exist",[this,e]);let t=e.stackId||"main";if(!this._idToStack.has(t)){this._idToStack.set(t,new Map([[e.view,e]])),this._viewToStack.set(e.view,this._idToStack.get(t)),this._numberOfStacks=this._idToStack.size,(!this._visibleStack||e.singleViewMode)&&this.showStack(t);return}let i=this._idToStack.get(t);e.singleViewMode&&this.showStack(t),i.set(e.view,e),this._viewToStack.set(e.view,i),i===this._visibleStack&&this._showView(e)}remove(e){if(!this.hasView(e))throw new p("contextualballoon-remove-view-not-exist",[this,e]);let t=this._viewToStack.get(e);this._singleViewMode&&this.visibleView===e&&(this._singleViewMode=!1),this.visibleView===e&&(t.size===1?this._idToStack.size>1?this._showNextStack():(this.view.hide(),this.visibleView=null,this._rotatorView.hideView()):this._showView(Array.from(t.values())[t.size-2])),t.size===1?(this._idToStack.delete(this._getStackId(t)),this._numberOfStacks=this._idToStack.size):t.delete(e),this._viewToStack.delete(e)}updatePosition(e){e&&(this._visibleStack.get(this.visibleView).position=e),this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition()}getPositionOptions(){let e=Array.from(this._visibleStack.values()).pop().position;return e&&(e.limiter||(e=Object.assign({},e,{limiter:this.positionLimiter})),e=Object.assign({},e,{viewportOffsetConfig:{...this.editor.ui.viewportOffset,top:this.editor.ui.viewportOffset.visualTop}})),e}showStack(e){this.visibleStack=e;let t=this._idToStack.get(e);if(!t)throw new p("contextualballoon-showstack-stack-not-exist",this);this._visibleStack!==t&&this._showView(Array.from(t.values()).pop())}_createPanelView(){this._view=new Me(this.editor.locale),this.editor.ui.view.body.add(this._view),this._rotatorView=this._createRotatorView(),this._fakePanelsView=this._createFakePanelsView()}get _visibleStack(){return this._viewToStack.get(this.visibleView)}_getStackId(e){return Array.from(this._idToStack.entries()).find(t=>t[1]===e)[0]}_showNextStack(){let e=Array.from(this._idToStack.values()),t=e.indexOf(this._visibleStack)+1;e[t]||(t=0),this.showStack(this._getStackId(e[t]))}_showPrevStack(){let e=Array.from(this._idToStack.values()),t=e.indexOf(this._visibleStack)-1;e[t]||(t=e.length-1),this.showStack(this._getStackId(e[t]))}_createRotatorView(){let e=new zT(this.editor.locale),t=this.editor.locale.t;return this.view.content.add(e),e.bind("isNavigationVisible").to(this,"_numberOfStacks",this,"_singleViewMode",(i,o)=>!o&&i>1),e.on("change:isNavigationVisible",()=>this.updatePosition(),{priority:"low"}),e.bind("counter").to(this,"visibleView",this,"_numberOfStacks",(i,o)=>{if(o<2)return"";let n=Array.from(this._idToStack.values()).indexOf(this._visibleStack)+1;return t("%0 of %1",[n,o])}),e.buttonNextView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showNextStack()}),e.buttonPrevView.on("execute",()=>{e.focusTracker.isFocused&&this.editor.editing.view.focus(),this._showPrevStack()}),e}_createFakePanelsView(){let e=new HT(this.editor.locale,this.view);return e.bind("numberOfPanels").to(this,"_numberOfStacks",this,"_singleViewMode",(t,i)=>!i&&t>=2?Math.min(t-1,2):0),e.listenTo(this.view,"change:top",()=>e.updatePosition()),e.listenTo(this.view,"change:left",()=>e.updatePosition()),this.editor.ui.view.body.add(e),e}_showView({view:e,balloonClassName:t="",withArrow:i=!0,singleViewMode:o=!1}){this.view.class=t,this.view.withArrow=i,this._rotatorView.showView(e),this.visibleView=e,this.view.pin(this.getPositionOptions()),this._fakePanelsView.updatePosition(),o&&(this._singleViewMode=!0)}},zT=class extends R{focusTracker;buttonPrevView;buttonNextView;content;constructor(e){super(e);let t=e.t,i=this.bindTemplate;this.set("isNavigationVisible",!0),this.focusTracker=new Q,this.buttonPrevView=this._createButtonView(t("Previous"),_t),this.buttonNextView=this._createButtonView(t("Next"),bl),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",o=>o?"":"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)}destroy(){super.destroy(),this.focusTracker.destroy()}showView(e){this.hideView(),this.content.add(e)}hideView(){this.content.clear()}_createButtonView(e,t){let i=new I(this.locale);return i.set({label:e,icon:t,tooltip:!0}),i.extendTemplate({on:{mousedown:i.bindTemplate.to(o=>o.preventDefault())}}),i}},HT=class extends R{content;_balloonPanelView;constructor(e,t){super(e);let 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=t,this.setTemplate({tag:"div",attributes:{class:["ck-fake-panel",i.to("numberOfPanels",o=>o?"":"ck-hidden")],style:{top:i.to("top",Il),left:i.to("left",Il),width:i.to("width",Il),height:i.to("height",Il)}},children:this.content}),this.on("change:numberOfPanels",(o,n,s,r)=>{s>r?this._addPanels(s-r):this._removePanels(r-s),this.updatePosition()})}_addPanels(e){for(;e--;){let t=new R;t.setTemplate({tag:"div"}),this.content.add(t),this.registerChild(t)}}_removePanels(e){for(;e--;){let t=this.content.last;this.content.remove(t),this.deregisterChild(t),t.destroy()}}updatePosition(){if(this.numberOfPanels){let{top:e,left:t}=this._balloonPanelView,{width:i,height:o}=new F(this._balloonPanelView.element);Object.assign(this,{top:e,left:t,width:i,height:o})}}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -1040,22 +1040,22 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var zT=class extends ji{arrowView;constructor(e){super(e);let t=this.bindTemplate;this.set({withText:!0,role:"menuitem"}),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__button"],"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",i=>String(i)),"data-cke-tooltip-disabled":t.to("isOn")},on:{mouseenter:t.to("mouseenter")}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){let e=new Yt;return e.content=cr,e.extendTemplate({attributes:{class:"ck-menu-bar__menu__button__arrow"}}),e}};/** +*/var WT=class extends Gi{arrowView;constructor(e){super(e);let t=this.bindTemplate;this.set({withText:!0,role:"menuitem"}),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__button"],"aria-haspopup":!0,"aria-expanded":this.bindTemplate.to("isOn",i=>String(i)),"data-cke-tooltip-disabled":t.to("isOn")},on:{mouseenter:t.to("mouseenter")}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){let e=new ei;return e.content=cr,e.extendTemplate({attributes:{class:"ck-menu-bar__menu__button__arrow"}}),e}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var HT=class extends R{children;constructor(e){super(e);let t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-menu-bar__menu__panel",t.to("position",i=>`ck-menu-bar__menu__panel_position_${i}`),t.if("isVisible","ck-hidden",i=>!i)],tabindex:"-1"},children:this.children,on:{selectstart:t.to(i=>{i.target.tagName.toLocaleLowerCase()!=="input"&&i.preventDefault()})}})}focus(e=1){this.children.length&&(e===1?this.children.first.focus():this.children.last.focus())}};/** +*/var UT=class extends R{children;constructor(e){super(e);let t=this.bindTemplate;this.set("isVisible",!1),this.set("position","se"),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-reset","ck-menu-bar__menu__panel",t.to("position",i=>`ck-menu-bar__menu__panel_position_${i}`),t.if("isVisible","ck-hidden",i=>!i)],tabindex:"-1"},children:this.children,on:{selectstart:t.to(i=>{i.target.tagName.toLocaleLowerCase()!=="input"&&i.preventDefault()})}})}focus(e=1){this.children.length&&(e===1?this.children.first.focus():this.children.last.focus())}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Qt=class Mw extends R{buttonView;panelView;focusTracker;keystrokes;constructor(t){super(t);let i=this.bindTemplate;this.buttonView=new zT(t),this.buttonView.delegate("mouseenter").to(this),this.buttonView.bind("isOn","isEnabled").to(this,"isOpen","isEnabled"),this.panelView=new HT(t),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new X,this.focusTracker=new Q,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("panelPosition","w"),this.set("class",void 0),this.set("parentMenuView",null),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar__menu",i.to("class"),i.if("isEnabled","ck-disabled",o=>!o),i.if("parentMenuView","ck-menu-bar__menu_top-level",o=>!o)]},children:[this.buttonView,this.panelView]})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.keystrokes.listenTo(this.element),qi.closeOnEscKey(this),this._closeOnDisabled(),this._repositionPanelOnOpen()}_attachBehaviors(){this.parentMenuView?(qi.openOnButtonClick(this),qi.openOnArrowRightKey(this),qi.closeOnArrowLeftKey(this),qi.openAndFocusOnEnterKeyPress(this),qi.closeOnParentClose(this)):(this._propagateArrowKeystrokeEvents(),qi.openAndFocusPanelOnArrowDownKey(this),qi.toggleOnButtonClick(this))}_propagateArrowKeystrokeEvents(){this.keystrokes.set("arrowright",(t,i)=>{this.fire("arrowright"),i()}),this.keystrokes.set("arrowleft",(t,i)=>{this.fire("arrowleft"),i()})}_closeOnDisabled(){this.on("change:isEnabled",(t,i,o)=>{o||(this.isOpen=!1)})}_repositionPanelOnOpen(){this.on("change:isOpen",(t,i,o)=>{if(!o)return;let n=Mw._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=n?n.name:this._defaultMenuPositionName})}focus(){this.buttonView.focus()}get _panelPositions(){let{southEast:t,southWest:i,northEast:o,northWest:n,westSouth:s,eastSouth:r,westNorth:a,eastNorth:l}=kT;return this.locale.uiLanguageDirection==="ltr"?this.parentMenuView?[r,l,s,a]:[t,i,o,n]:this.parentMenuView?[s,a,r,l]:[i,t,n,o]}get _defaultMenuPositionName(){return this.locale.uiLanguageDirection==="ltr"?this.parentMenuView?"es":"se":this.parentMenuView?"ws":"sw"}static _getOptimalPosition=Fa};/** +*/var Xt=class Ow extends R{buttonView;panelView;focusTracker;keystrokes;constructor(t){super(t);let i=this.bindTemplate;this.buttonView=new WT(t),this.buttonView.delegate("mouseenter").to(this),this.buttonView.bind("isOn","isEnabled").to(this,"isOpen","isEnabled"),this.panelView=new UT(t),this.panelView.bind("isVisible").to(this,"isOpen"),this.keystrokes=new X,this.focusTracker=new Q,this.set("isOpen",!1),this.set("isEnabled",!0),this.set("panelPosition","w"),this.set("class",void 0),this.set("parentMenuView",null),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar__menu",i.to("class"),i.if("isEnabled","ck-disabled",o=>!o),i.if("parentMenuView","ck-menu-bar__menu_top-level",o=>!o)]},children:[this.buttonView,this.panelView]})}render(){super.render(),this.focusTracker.add(this.buttonView.element),this.focusTracker.add(this.panelView.element),this.keystrokes.listenTo(this.element),ji.closeOnEscKey(this),this._closeOnDisabled(),this._repositionPanelOnOpen()}_attachBehaviors(){this.parentMenuView?(ji.openOnButtonClick(this),ji.openOnArrowRightKey(this),ji.closeOnArrowLeftKey(this),ji.openAndFocusOnEnterKeyPress(this),ji.closeOnParentClose(this)):(this._propagateArrowKeystrokeEvents(),ji.openAndFocusPanelOnArrowDownKey(this),ji.toggleOnButtonClick(this))}_propagateArrowKeystrokeEvents(){this.keystrokes.set("arrowright",(t,i)=>{this.fire("arrowright"),i()}),this.keystrokes.set("arrowleft",(t,i)=>{this.fire("arrowleft"),i()})}_closeOnDisabled(){this.on("change:isEnabled",(t,i,o)=>{o||(this.isOpen=!1)})}_repositionPanelOnOpen(){this.on("change:isOpen",(t,i,o)=>{if(!o)return;let n=Ow._getOptimalPosition({element:this.panelView.element,target:this.buttonView.element,fitInViewport:!0,positions:this._panelPositions});this.panelView.position=n?n.name:this._defaultMenuPositionName})}focus(){this.buttonView.focus()}get _panelPositions(){let{southEast:t,southWest:i,northEast:o,northWest:n,westSouth:s,eastSouth:r,westNorth:a,eastNorth:l}=xT;return this.locale.uiLanguageDirection==="ltr"?this.parentMenuView?[r,l,s,a]:[t,i,o,n]:this.parentMenuView?[s,a,r,l]:[i,t,n,o]}get _defaultMenuPositionName(){return this.locale.uiLanguageDirection==="ltr"?this.parentMenuView?"es":"se":this.parentMenuView?"ws":"sw"}static _getOptimalPosition=Na};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var jn=class extends vi{constructor(e){super(e),this.role="menu",this.items.on("change",this._setItemsCheckSpace.bind(this))}_setItemsCheckSpace(){let e=Array.from(this.items).some(t=>{let i=tw(t);return i&&i.isToggleable});this.items.forEach(t=>{let i=tw(t);i&&(i.hasCheckSpace=e)})}};function tw(e){return e instanceof ot?e.children.map(t=>WT(t)?t.buttonView:t).find(t=>t instanceof ji):null}function WT(e){return typeof e=="object"&&"buttonView"in e&&e.buttonView instanceof I}/** +*/var jn=class extends Ci{constructor(e){super(e),this.role="menu",this.items.on("change",this._setItemsCheckSpace.bind(this))}_setItemsCheckSpace(){let e=Array.from(this.items).some(t=>{let i=ow(t);return i&&i.isToggleable});this.items.forEach(t=>{let i=ow(t);i&&(i.hasCheckSpace=e)})}};function ow(e){return e instanceof ot?e.children.map(t=>qT(t)?t.buttonView:t).find(t=>t instanceof Gi):null}function qT(e){return typeof e=="object"&&"buttonView"in e&&e.buttonView instanceof I}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var bh=class extends V9{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}};/** +*/var yh=class extends M9{constructor(e){super(e),this.set({withText:!0,withKeystroke:!0,tooltip:!1,role:"menuitem"}),this.extendTemplate({attributes:{class:["ck-menu-bar__menu__item__button"]}})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var iw=["mouseenter","arrowleft","arrowright","change:isOpen"],Bw=class extends R{children;menus=[];constructor(e){super(e);let t=e.t,i=this.bindTemplate;this.set({isOpen:!1,isFocusBorderEnabled:!1}),this._setupIsOpenUpdater(),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar",i.if("isFocusBorderEnabled","ck-menu-bar_focus-border-enabled")],"aria-label":t("Editor menu bar"),role:"menubar"},children:this.children})}fillFromConfig(e,t,i=[]){let o=this.locale,n=TT({normalizedConfig:e,locale:o,componentFactory:t,extraItems:i}).items.map(s=>this._createMenu({componentFactory:t,menuDefinition:s}));this.children.addMany(n)}render(){super.render(),qn.toggleMenusAndFocusItemsOnHover(this),qn.closeMenusWhenTheBarCloses(this),qn.closeMenuWhenAnotherOnTheSameLevelOpens(this),qn.focusCycleMenusOnArrows(this),qn.closeOnClickOutside(this),qn.enableFocusHighlightOnInteraction(this)}focus(){this.children.first&&this.children.first.focus()}close(){for(let e of this.children)e.isOpen=!1;this.isOpen=!1}disable(){for(let e of this.children)e.isEnabled=!1}enable(){for(let e of this.children)e.isEnabled=!0}registerMenu(e,t=null){t?(e.delegate(...iw).to(t),e.parentMenuView=t):e.delegate(...iw).to(this,i=>"menu:"+i),e._attachBehaviors(),this.menus.push(e)}_createMenu({componentFactory:e,menuDefinition:t,parentMenuView:i}){let o=this.locale,n=new Qt(o);return this.registerMenu(n,i),n.buttonView.set({label:t.label}),n.once("change:isOpen",()=>{let s=new jn(o);s.ariaLabel=t.label,n.panelView.children.add(s),s.items.addMany(this._createMenuItems({menuDefinition:t,parentMenuView:n,componentFactory:e}))}),n}_createMenuItems({menuDefinition:e,parentMenuView:t,componentFactory:i}){let o=this.locale,n=[];for(let s of e.groups){for(let r of s.items){let a=new Jn(o,t);if(ae(r))a.children.add(this._createMenu({componentFactory:i,menuDefinition:r,parentMenuView:t}));else{let l=this._createMenuItemContentFromFactory({componentName:r,componentFactory:i,parentMenuView:t});if(!l)continue;a.children.add(l)}n.push(a)}s!==e.groups[e.groups.length-1]&&n.push(new fh(o))}return n}_createMenuItemContentFromFactory({componentName:e,parentMenuView:t,componentFactory:i}){let o=i.create(e);return o instanceof Qt||o instanceof oe||o instanceof bh?(this._registerMenuTree(o,t),o.on("execute",()=>{this.close()}),o):(D("menu-bar-component-unsupported",{componentName:e,componentView:o}),null)}_registerMenuTree(e,t){if(!(e instanceof Qt)){e.delegate("mouseenter").to(t);return}this.registerMenu(e,t);let i=e.panelView.children.filter(n=>n instanceof jn)[0];if(!i){e.delegate("mouseenter").to(t);return}let o=i.items.filter(n=>n instanceof ot);for(let n of o)this._registerMenuTree(n.children.get(0),e)}_setupIsOpenUpdater(){let e;this.on("menu:change:isOpen",(t,i,o)=>{clearTimeout(e),o?this.isOpen=!0:e=setTimeout(()=>{this.isOpen=Array.from(this.children).some(n=>n.isOpen)},0)})}};/** +*/var nw=["mouseenter","arrowleft","arrowright","change:isOpen"],Dw=class extends R{children;menus=[];constructor(e){super(e);let t=e.t,i=this.bindTemplate;this.set({isOpen:!1,isFocusBorderEnabled:!1}),this._setupIsOpenUpdater(),this.children=this.createCollection(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-menu-bar",i.if("isFocusBorderEnabled","ck-menu-bar_focus-border-enabled")],"aria-label":t("Editor menu bar"),role:"menubar"},children:this.children})}fillFromConfig(e,t,i=[]){let o=this.locale,n=AT({normalizedConfig:e,locale:o,componentFactory:t,extraItems:i}).items.map(s=>this._createMenu({componentFactory:t,menuDefinition:s}));this.children.addMany(n)}render(){super.render(),qn.toggleMenusAndFocusItemsOnHover(this),qn.closeMenusWhenTheBarCloses(this),qn.closeMenuWhenAnotherOnTheSameLevelOpens(this),qn.focusCycleMenusOnArrows(this),qn.closeOnClickOutside(this),qn.enableFocusHighlightOnInteraction(this)}focus(){this.children.first&&this.children.first.focus()}close(){for(let e of this.children)e.isOpen=!1;this.isOpen=!1}disable(){for(let e of this.children)e.isEnabled=!1}enable(){for(let e of this.children)e.isEnabled=!0}registerMenu(e,t=null){t?(e.delegate(...nw).to(t),e.parentMenuView=t):e.delegate(...nw).to(this,i=>"menu:"+i),e._attachBehaviors(),this.menus.push(e)}_createMenu({componentFactory:e,menuDefinition:t,parentMenuView:i}){let o=this.locale,n=new Xt(o);return this.registerMenu(n,i),n.buttonView.set({label:t.label}),n.once("change:isOpen",()=>{let s=new jn(o);s.ariaLabel=t.label,n.panelView.children.add(s),s.items.addMany(this._createMenuItems({menuDefinition:t,parentMenuView:n,componentFactory:e}))}),n}_createMenuItems({menuDefinition:e,parentMenuView:t,componentFactory:i}){let o=this.locale,n=[];for(let s of e.groups){for(let r of s.items){let a=new Jn(o,t);if(ae(r))a.children.add(this._createMenu({componentFactory:i,menuDefinition:r,parentMenuView:t}));else{let l=this._createMenuItemContentFromFactory({componentName:r,componentFactory:i,parentMenuView:t});if(!l)continue;a.children.add(l)}n.push(a)}s!==e.groups[e.groups.length-1]&&n.push(new gh(o))}return n}_createMenuItemContentFromFactory({componentName:e,parentMenuView:t,componentFactory:i}){let o=i.create(e);return o instanceof Xt||o instanceof oe||o instanceof yh?(this._registerMenuTree(o,t),o.on("execute",()=>{this.close()}),o):(D("menu-bar-component-unsupported",{componentName:e,componentView:o}),null)}_registerMenuTree(e,t){if(!(e instanceof Xt)){e.delegate("mouseenter").to(t);return}this.registerMenu(e,t);let i=e.panelView.children.filter(n=>n instanceof jn)[0];if(!i){e.delegate("mouseenter").to(t);return}let o=i.items.filter(n=>n instanceof ot);for(let n of o)this._registerMenuTree(n.children.get(0),e)}_setupIsOpenUpdater(){let e;this.on("menu:change:isOpen",(t,i,o)=>{clearTimeout(e),o?this.isOpen=!0:e=setTimeout(()=>{this.isOpen=Array.from(this.children).some(n=>n.isOpen)},0)})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -1064,13 +1064,13 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var UT=class extends Rw{view;constructor(e,t){super(e),this.view=t}init(){let e=this.editor,t=this.view,i=e.editing.view,o=t.editable,n=i.document.getRoot();o.name=n.rootName,o.isInlineRoot=!E1(e,n.rootName),o.isMainFrameEditingRoot=!0,t.render();let s=o.element;this.setEditableElement(o.name,s),t.editable.bind("isFocused").to(this.focusTracker),i.attachDomRoot(s),this._initPlaceholder(),this._initToolbar(),this.initMenuBar(this.view.menuBarView),this.fire("ready")}destroy(){super.destroy();let e=this.view,t=this.editor.editing.view;t.getDomRoot(e.editable.name)&&t.detachDomRoot(e.editable.name),e.destroy()}_initToolbar(){let e=this.editor,t=this.view;t.toolbar.fillFromConfig(e.config.get("toolbar"),this.componentFactory),this.addToolbar(t.toolbar)}_initPlaceholder(){let e=this.editor,t=e.editing.view,i=t.document.getRoot(),o=e.config.get("roots")[i.rootName].placeholder;o&&(i.placeholder=o),Ln({view:t,element:i,isDirectHost:this.view.editable.isInlineRoot,keepOnFocus:!0})}};/** +*/var $T=class extends Lw{view;constructor(e,t){super(e),this.view=t}init(){let e=this.editor,t=this.view,i=e.editing.view,o=t.editable,n=i.document.getRoot();o.name=n.rootName,o.isInlineRoot=!I1(e,n.rootName),o.isMainFrameEditingRoot=!0,t.render();let s=o.element;this.setEditableElement(o.name,s),t.editable.bind("isFocused").to(this.focusTracker),i.attachDomRoot(s),this._initPlaceholder(),this._initToolbar(),this.initMenuBar(this.view.menuBarView),this.fire("ready")}destroy(){super.destroy();let e=this.view,t=this.editor.editing.view;t.getDomRoot(e.editable.name)&&t.detachDomRoot(e.editable.name),e.destroy()}_initToolbar(){let e=this.editor,t=this.view;t.toolbar.fillFromConfig(e.config.get("toolbar"),this.componentFactory),this.addToolbar(t.toolbar)}_initPlaceholder(){let e=this.editor,t=e.editing.view,i=t.document.getRoot(),o=e.config.get("roots")[i.rootName].placeholder;o&&(i.placeholder=o),Ln({view:t,element:i,isDirectHost:this.view.editable.isInlineRoot,keepOnFocus:!0})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var qT=class extends Vw{toolbar;editable;menuBarView;constructor(e,t,i={}){super(e),this.toolbar=new dt(e,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull}),this.menuBarView=new Bw(e),this.editable=new Lw(e,t,i.editableElement,{label:i.label}),this.toolbar.extendTemplate({attributes:{class:["ck-reset_all","ck-rounded-corners"],dir:e.uiLanguageDirection}}),this.menuBarView.extendTemplate({attributes:{class:["ck-reset_all","ck-rounded-corners"],dir:e.uiLanguageDirection}})}render(){super.render(),this.registerChild([this.menuBarView,this.toolbar,this.editable])}};/** +*/var jT=class extends Mw{toolbar;editable;menuBarView;constructor(e,t,i={}){super(e),this.toolbar=new dt(e,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull}),this.menuBarView=new Dw(e),this.editable=new Bw(e,t,i.editableElement,{label:i.label}),this.toolbar.extendTemplate({attributes:{class:["ck-reset_all","ck-rounded-corners"],dir:e.uiLanguageDirection}}),this.menuBarView.extendTemplate({attributes:{class:["ck-reset_all","ck-rounded-corners"],dir:e.uiLanguageDirection}})}render(){super.render(),this.registerChild([this.menuBarView,this.toolbar,this.editable])}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var $T=_1(fl),wh=class extends $T{static get editorName(){return"DecoupledEditor"}ui;constructor(e,t={}){let{sourceElementOrData:i,editorConfig:o}=x1(e,t);super(o),C1(i,this.config);let n=this.config.get("roots").main.element;jT(n)&&(this.sourceElement=n,v1(this,n)),this.model.document.createRoot(this.config.get("roots").main.modelElement),k1(this);let s=!this.config.get("toolbar.shouldNotGroupWhenFull"),r=new qT(this.locale,this.editing.view,{editableElement:n,shouldToolbarGroupWhenFull:s,label:this.config.get("roots").main.label});this.ui=new UT(this,r)}async destroy(){let e=this.getData();this.ui.destroy(),await super.destroy(),this.sourceElement&&this.updateSourceElement(e)}static async create(e,t={}){let i=new this(e,t);return await i.initPlugins(),T1(i),await i.ui.init(),await i.data.init(i.config.get("roots").main.initialData),i.fire("ready"),i}};function jT(e){return et(e)}/** +*/var KT=k1(ml),_h=class extends KT{static get editorName(){return"DecoupledEditor"}ui;constructor(e,t={}){let{sourceElementOrData:i,editorConfig:o}=E1(e,t);super(o),T1(i,this.config);let n=this.config.get("roots").main.element;GT(n)&&(this.sourceElement=n,C1(this,n)),this.model.document.createRoot(this.config.get("roots").main.modelElement),x1(this);let s=!this.config.get("toolbar.shouldNotGroupWhenFull"),r=new jT(this.locale,this.editing.view,{editableElement:n,shouldToolbarGroupWhenFull:s,label:this.config.get("roots").main.label});this.ui=new $T(this,r)}async destroy(){let e=this.getData();this.ui.destroy(),await super.destroy(),this.sourceElement&&this.updateSourceElement(e)}static async create(e,t={}){let i=new this(e,t);return await i.initPlugins(),A1(i),await i.ui.init(),await i.data.init(i.config.get("roots").main.initialData),i.fire("ready"),i}};function GT(e){return et(e)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -1079,46 +1079,46 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Hw=class{model;limit;_isLocked;_size;_batch=null;_changeCallback;_selectionChangeCallback;constructor(e,t=20){this.model=e,this._size=0,this.limit=t,this._isLocked=!1,this._changeCallback=(i,o)=>{o.isLocal&&o.isUndoable&&o!==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({isTyping:!0})),this._batch}get size(){return this._size}input(e){this._size+=e,this._size>=this.limit&&this._reset(!0)}get isLocked(){return this._isLocked}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(e=!1){(!this.isLocked||e)&&(this._batch=null,this._size=0)}};/** +*/var Uw=class{model;limit;_isLocked;_size;_batch=null;_changeCallback;_selectionChangeCallback;constructor(e,t=20){this.model=e,this._size=0,this.limit=t,this._isLocked=!1,this._changeCallback=(i,o)=>{o.isLocal&&o.isUndoable&&o!==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({isTyping:!0})),this._batch}get size(){return this._size}input(e){this._size+=e,this._size>=this.limit&&this._reset(!0)}get isLocked(){return this._isLocked}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(e=!1){(!this.isLocked||e)&&(this._batch=null,this._size=0)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var KT=class extends M{_buffer;constructor(e,t){super(e),this._buffer=new Hw(e.model,t),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){let t=this.editor.model,i=t.document,o=e.text||"",n=o.length,s=i.selection;if(e.selection?s=e.selection:e.range&&(s=t.createSelection(e.range)),!t.canEditAt(s))return;let r=e.resultRange;t.enqueueChange(this._buffer.batch,a=>{this._buffer.lock();let l=Array.from(i.selection.getAttributes());t.deleteContent(s),o&&t.insertContent(a.createText(o,l),s),r?a.setSelection(r):s.is("documentSelection")||a.setSelection(s),this._buffer.unlock(),this._buffer.input(n)})}};/** +*/var JT=class extends M{_buffer;constructor(e,t){super(e),this._buffer=new Uw(e.model,t),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}destroy(){super.destroy(),this._buffer.destroy()}execute(e={}){let t=this.editor.model,i=t.document,o=e.text||"",n=o.length,s=i.selection;if(e.selection?s=e.selection:e.range&&(s=t.createSelection(e.range)),!t.canEditAt(s))return;let r=e.resultRange;t.enqueueChange(this._buffer.batch,a=>{this._buffer.lock();let l=Array.from(i.selection.getAttributes());t.deleteContent(s),o&&t.insertContent(a.createText(o,l),s),r?a.setSelection(r):s.is("documentSelection")||a.setSelection(s),this._buffer.unlock(),this._buffer.input(n)})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Ww=["insertText","insertReplacementText"],GT=[...Ww,"insertCompositionText"],JT=class extends it{focusObserver;constructor(e){super(e),this.focusObserver=e.getObserver(tr);let t=V.isAndroid?GT:Ww,i=e.document;i.on("beforeinput",(o,n)=>{if(!this.isEnabled)return;let{data:s,targetRanges:r,inputType:a,domEvent:l,isComposing:c}=n;if(!t.includes(a))return;this.focusObserver.flush();let u=new pt(i,"insertText");i.fire(u,new pi(e,l,{text:s,selection:e.createSelection(r),isComposing:c})),u.stop.called&&o.stop()}),V.isAndroid||i.on("compositionend",(o,{data:n,domEvent:s})=>{this.isEnabled&&n&&i.fire("insertText",new pi(e,s,{text:n,isComposing:!0}))},{priority:"low"})}observe(){}stopObserving(){}};/** +*/var qw=["insertText","insertReplacementText"],ZT=[...qw,"insertCompositionText"],QT=class extends it{focusObserver;constructor(e){super(e),this.focusObserver=e.getObserver(tr);let t=V.isAndroid?ZT:qw,i=e.document;i.on("beforeinput",(o,n)=>{if(!this.isEnabled)return;let{data:s,targetRanges:r,inputType:a,domEvent:l,isComposing:c}=n;if(!t.includes(a))return;this.focusObserver.flush();let u=new bt(i,"insertText");i.fire(u,new wi(e,l,{text:s,selection:e.createSelection(r),isComposing:c})),u.stop.called&&o.stop()}),V.isAndroid||i.on("compositionend",(o,{data:n,domEvent:s})=>{this.isEnabled&&n&&i.fire("insertText",new wi(e,s,{text:n,isComposing:!0}))},{priority:"low"})}observe(){}stopObserving(){}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var yh=class extends y{_typingQueue;static get pluginName(){return"Input"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.model,i=e.editing.view,o=e.editing.mapper,n=t.document.selection;this._typingQueue=new ZT(e),i.addObserver(JT);let s=new KT(e,e.config.get("typing.undoStep")||20);e.commands.add("insertText",s),e.commands.add("input",s),this.listenTo(i.document,"beforeinput",()=>{this._typingQueue.flush("next beforeinput")},{priority:"high"}),this.listenTo(i.document,"insertText",(r,a)=>{let{text:l,selection:c}=a;if(i.document.selection.isFake&&c&&i.document.selection.isSimilar(c)&&a.preventDefault(),c&&Array.from(c.getRanges()).some(f=>!f.isCollapsed)&&a.preventDefault(),!s.isEnabled){a.preventDefault();return}let u;c&&(u=Array.from(c.getRanges()).filter(f=>f.root.is("rootElement")).map(f=>o.toModelRange(f)).map(f=>al(f,t.schema)||f)),(!u||!u.length)&&(u=Array.from(n.getRanges()));let d=l;if(V.isAndroid){let f=Array.from(u[0].getItems()).reduce((m,g)=>m+(g.is("$textProxy")?g.data:""),"");if(f&&(f.length<=d.length?d.startsWith(f)&&(d=d.substring(f.length),u[0].start=u[0].start.getShiftedBy(f.length)):f.startsWith(d)&&(u[0].start=u[0].start.getShiftedBy(d.length),d="")),d.length==0&&u[0].isCollapsed)return}let h={text:d,selection:t.createSelection(u)};this._typingQueue.push(h,!!a.isComposing),a.domEvent.defaultPrevented&&this._typingQueue.flush("beforeinput default prevented")}),V.isAndroid?this.listenTo(i.document,"keydown",(r,a)=>{n.isCollapsed||a.keyCode!=229||!i.document.isComposing||Ow(t,s)}):this.listenTo(i.document,"compositionstart",()=>{n.isCollapsed||Ow(t,s)},{priority:"high"}),this.listenTo(i.document,"mutations",(r,{mutations:a})=>{if(this._typingQueue.hasAffectedElements())for(let{node:l}of a){let c=YT(l,o),u=o.toModelElement(c);if(this._typingQueue.isElementAffected(u)){this._typingQueue.flush("mutations");return}}}),this.listenTo(i.document,"compositionend",()=>{this._typingQueue.flush("before composition end")},{priority:"high"}),this.listenTo(i.document,"compositionend",()=>{this._typingQueue.flush("after composition end");let r=[];if(this._typingQueue.hasAffectedElements())for(let a of this._typingQueue.flushAffectedElements()){let l=o.toViewElement(a);l&&r.push({type:"children",node:l})}(r.length||!V.isAndroid)&&i.document.fire("mutations",{mutations:r})},{priority:"lowest"})}destroy(){super.destroy(),this._typingQueue.destroy()}},ZT=class{editor;flushDebounced=ye(()=>this.flush("timeout"),50);_queue=[];_isComposing=!1;_affectedElements=new Set;constructor(e){this.editor=e}destroy(){for(this.flushDebounced.cancel(),this._affectedElements.clear();this._queue.length;)this.shift()}get length(){return this._queue.length}push(e,t){let i={text:e.text};if(e.selection){i.selectionRanges=[];for(let o of e.selection.getRanges())i.selectionRanges.push(Qe.fromRange(o)),this._affectedElements.add(o.start.parent)}this._queue.push(i),this._isComposing||=t,this.flushDebounced()}shift(){let e=this._queue.shift(),t={text:e.text};if(e.selectionRanges){let i=e.selectionRanges.map(o=>QT(o)).filter(o=>!!o);i.length&&(t.selection=this.editor.model.createSelection(i))}return t}flush(e){let t=this.editor,i=t.model,o=t.editing.view;if(this.flushDebounced.cancel(),!this._queue.length)return;let n=t.commands.get("insertText").buffer;i.enqueueChange(n.batch,()=>{for(n.lock();this._queue.length;){let s=this.shift();t.execute("insertText",s)}n.unlock(),this._isComposing||this._affectedElements.clear(),this._isComposing=!1}),o.scrollToTheSelection()}isElementAffected(e){return this._affectedElements.has(e)}hasAffectedElements(){return this._affectedElements.size>0}flushAffectedElements(){let e=Array.from(this._affectedElements);return this._affectedElements.clear(),e}};function Ow(e,t){if(!t.isEnabled)return;let i=t.buffer;i.lock(),e.enqueueChange(i.batch,()=>{e.deleteContent(e.document.selection)}),i.unlock()}function QT(e){let t=e.toRange();return e.detach(),t.root.rootName=="$graveyard"?null:t}function YT(e,t){let i=e.is("$text")?e.parent:e;for(;!t.toModelElement(i);)i=i.parent;return i}/** +*/var vh=class extends w{_typingQueue;static get pluginName(){return"Input"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.model,i=e.editing.view,o=e.editing.mapper,n=t.document.selection;this._typingQueue=new YT(e),i.addObserver(QT);let s=new JT(e,e.config.get("typing.undoStep")||20);e.commands.add("insertText",s),e.commands.add("input",s),this.listenTo(i.document,"beforeinput",()=>{this._typingQueue.flush("next beforeinput")},{priority:"high"}),this.listenTo(i.document,"insertText",(r,a)=>{let{text:l,selection:c}=a;if(i.document.selection.isFake&&c&&i.document.selection.isSimilar(c)&&a.preventDefault(),c&&Array.from(c.getRanges()).some(f=>!f.isCollapsed)&&a.preventDefault(),!s.isEnabled){a.preventDefault();return}let u;c&&(u=Array.from(c.getRanges()).filter(f=>f.root.is("rootElement")).map(f=>o.toModelRange(f)).map(f=>ll(f,t.schema)||f)),(!u||!u.length)&&(u=Array.from(n.getRanges()));let d=l;if(V.isAndroid){let f=Array.from(u[0].getItems()).reduce((m,g)=>m+(g.is("$textProxy")?g.data:""),"");if(f&&(f.length<=d.length?d.startsWith(f)&&(d=d.substring(f.length),u[0].start=u[0].start.getShiftedBy(f.length)):f.startsWith(d)&&(u[0].start=u[0].start.getShiftedBy(d.length),d="")),d.length==0&&u[0].isCollapsed)return}let h={text:d,selection:t.createSelection(u)};this._typingQueue.push(h,!!a.isComposing),a.domEvent.defaultPrevented&&this._typingQueue.flush("beforeinput default prevented")}),V.isAndroid?this.listenTo(i.document,"keydown",(r,a)=>{n.isCollapsed||a.keyCode!=229||!i.document.isComposing||Fw(t,s)}):this.listenTo(i.document,"compositionstart",()=>{n.isCollapsed||Fw(t,s)},{priority:"high"}),this.listenTo(i.document,"mutations",(r,{mutations:a})=>{if(this._typingQueue.hasAffectedElements())for(let{node:l}of a){let c=eE(l,o),u=o.toModelElement(c);if(this._typingQueue.isElementAffected(u)){this._typingQueue.flush("mutations");return}}}),this.listenTo(i.document,"compositionend",()=>{this._typingQueue.flush("before composition end")},{priority:"high"}),this.listenTo(i.document,"compositionend",()=>{this._typingQueue.flush("after composition end");let r=[];if(this._typingQueue.hasAffectedElements())for(let a of this._typingQueue.flushAffectedElements()){let l=o.toViewElement(a);l&&r.push({type:"children",node:l})}(r.length||!V.isAndroid)&&i.document.fire("mutations",{mutations:r})},{priority:"lowest"})}destroy(){super.destroy(),this._typingQueue.destroy()}},YT=class{editor;flushDebounced=ve(()=>this.flush("timeout"),50);_queue=[];_isComposing=!1;_affectedElements=new Set;constructor(e){this.editor=e}destroy(){for(this.flushDebounced.cancel(),this._affectedElements.clear();this._queue.length;)this.shift()}get length(){return this._queue.length}push(e,t){let i={text:e.text};if(e.selection){i.selectionRanges=[];for(let o of e.selection.getRanges())i.selectionRanges.push(Qe.fromRange(o)),this._affectedElements.add(o.start.parent)}this._queue.push(i),this._isComposing||=t,this.flushDebounced()}shift(){let e=this._queue.shift(),t={text:e.text};if(e.selectionRanges){let i=e.selectionRanges.map(o=>XT(o)).filter(o=>!!o);i.length&&(t.selection=this.editor.model.createSelection(i))}return t}flush(e){let t=this.editor,i=t.model,o=t.editing.view;if(this.flushDebounced.cancel(),!this._queue.length)return;let n=t.commands.get("insertText").buffer;i.enqueueChange(n.batch,()=>{for(n.lock();this._queue.length;){let s=this.shift();t.execute("insertText",s)}n.unlock(),this._isComposing||this._affectedElements.clear(),this._isComposing=!1}),o.scrollToTheSelection()}isElementAffected(e){return this._affectedElements.has(e)}hasAffectedElements(){return this._affectedElements.size>0}flushAffectedElements(){let e=Array.from(this._affectedElements);return this._affectedElements.clear(),e}};function Fw(e,t){if(!t.isEnabled)return;let i=t.buffer;i.lock(),e.enqueueChange(i.batch,()=>{e.deleteContent(e.document.selection)}),i.unlock()}function XT(e){let t=e.toRange();return e.detach(),t.root.rootName=="$graveyard"?null:t}function eE(e,t){let i=e.is("$text")?e.parent:e;for(;!t.toModelElement(i);)i=i.parent;return i}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Dw=class extends M{direction;_buffer;constructor(e,t){super(e),this.direction=t,this._buffer=new Hw(e.model,e.config.get("typing.undoStep")),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}execute(e={}){let t=this.editor.model,i=t.document;t.enqueueChange(this._buffer.batch,o=>{this._buffer.lock();let n=o.createSelection(e.selection||i.selection);if(!t.canEditAt(n))return;let s=e.sequence||1,r=n.isCollapsed;if(n.isCollapsed&&t.modifySelection(n,{direction:this.direction,unit:e.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(s)){this._replaceEntireContentWithParagraph(o);return}if(this._shouldReplaceFirstBlockWithParagraph(n,s)){this.editor.execute("paragraph",{selection:n});return}if(n.isCollapsed)return;let a=0;n.getFirstRange().getMinimalFlatRanges().forEach(l=>{a+=Ls(l.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),t.deleteContent(n,{doNotResetEntireContent:r,direction:this.direction}),this._buffer.input(a),o.setSelection(n),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;let t=this.editor.model,i=t.document.selection,o=t.schema.getLimitElement(i);if(!(i.isCollapsed&&i.containsEntireContent(o))||!t.schema.checkChild(o,"paragraph"))return!1;let n=o.getChild(0);return!(n&&n.is("element","paragraph"))}_replaceEntireContentWithParagraph(e){let t=this.editor.model,i=t.document.selection,o=t.schema.getLimitElement(i),n=e.createElement("paragraph");e.remove(e.createRangeIn(o)),e.insert(n,o),e.setSelection(n,0)}_shouldReplaceFirstBlockWithParagraph(e,t){let i=this.editor.model;if(t>1||this.direction!="backward"||!e.isCollapsed)return!1;let o=e.getFirstPosition(),n=i.schema.getLimitElement(o),s=n.getChild(0);return!(o.parent!=s||!e.containsEntireContent(s)||!i.schema.checkChild(n,"paragraph")||s.name=="paragraph")}};/** +*/var Nw=class extends M{direction;_buffer;constructor(e,t){super(e),this.direction=t,this._buffer=new Uw(e.model,e.config.get("typing.undoStep")),this._isEnabledBasedOnSelection=!1}get buffer(){return this._buffer}execute(e={}){let t=this.editor.model,i=t.document;t.enqueueChange(this._buffer.batch,o=>{this._buffer.lock();let n=o.createSelection(e.selection||i.selection);if(!t.canEditAt(n))return;let s=e.sequence||1,r=n.isCollapsed;if(n.isCollapsed&&t.modifySelection(n,{direction:this.direction,unit:e.unit,treatEmojiAsSingleUnit:!0}),this._shouldEntireContentBeReplacedWithParagraph(s)){this._replaceEntireContentWithParagraph(o);return}if(this._shouldReplaceFirstBlockWithParagraph(n,s)){this.editor.execute("paragraph",{selection:n});return}if(n.isCollapsed)return;let a=0;n.getFirstRange().getMinimalFlatRanges().forEach(l=>{a+=Ls(l.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}))}),t.deleteContent(n,{doNotResetEntireContent:r,direction:this.direction}),this._buffer.input(a),o.setSelection(n),this._buffer.unlock()})}_shouldEntireContentBeReplacedWithParagraph(e){if(e>1)return!1;let t=this.editor.model,i=t.document.selection,o=t.schema.getLimitElement(i);if(!(i.isCollapsed&&i.containsEntireContent(o))||!t.schema.checkChild(o,"paragraph"))return!1;let n=o.getChild(0);return!(n&&n.is("element","paragraph"))}_replaceEntireContentWithParagraph(e){let t=this.editor.model,i=t.document.selection,o=t.schema.getLimitElement(i),n=e.createElement("paragraph");e.remove(e.createRangeIn(o)),e.insert(n,o),e.setSelection(n,0)}_shouldReplaceFirstBlockWithParagraph(e,t){let i=this.editor.model;if(t>1||this.direction!="backward"||!e.isCollapsed)return!1;let o=e.getFirstPosition(),n=i.schema.getLimitElement(o),s=n.getChild(0);return!(o.parent!=s||!e.containsEntireContent(s)||!i.schema.checkChild(n,"paragraph")||s.name=="paragraph")}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var XT="character",Fw="word",eE="codePoint",Ki="selection",Yn="backward",vr="forward",Uw={deleteContent:{unit:Ki,direction:Yn},deleteContentBackward:{unit:eE,direction:Yn},deleteWordBackward:{unit:Fw,direction:Yn},deleteHardLineBackward:{unit:Ki,direction:Yn},deleteSoftLineBackward:{unit:Ki,direction:Yn},deleteContentForward:{unit:XT,direction:vr},deleteWordForward:{unit:Fw,direction:vr},deleteHardLineForward:{unit:Ki,direction:vr},deleteSoftLineForward:{unit:Ki,direction:vr}},tE=class extends it{constructor(e){super(e);let t=e.document,i=0;t.on("keydown",()=>{i++}),t.on("keyup",()=>{i=0}),t.on("beforeinput",(o,n)=>{if(!this.isEnabled)return;let{targetRanges:s,domEvent:r,inputType:a}=n,l=Uw[a];if(!l)return;let c={direction:l.direction,unit:l.unit,sequence:i};c.unit==Ki&&(c.selectionToRemove=e.createSelection(s[0])),a==="deleteContentBackward"&&(V.isAndroid&&(c.sequence=1),oE(s)&&(c.unit=Ki,c.selectionToRemove=e.createSelection(s)));let u=new gi(t,"delete",s[0]);t.fire(u,new pi(e,r,c)),u.stop.called&&o.stop()}),V.isBlink&&iE(this)}observe(){}stopObserving(){}};function iE(e){let t=e.view,i=t.document,o=null,n=!1;i.on("keydown",(a,{keyCode:l})=>{o=l,n=!1}),i.on("keyup",(a,{keyCode:l,domEvent:c})=>{let u=i.selection,d=e.isEnabled&&l==o&&s(l)&&!u.isCollapsed&&!n;if(o=null,d){let h=u.getFirstRange(),f=new gi(i,"delete",h),m={unit:Ki,direction:r(l),selectionToRemove:u};i.fire(f,new pi(t,c,m))}}),i.on("beforeinput",(a,{inputType:l})=>{let c=Uw[l];s(o)&&c&&c.direction==r(o)&&(n=!0)},{priority:"high"}),i.on("beforeinput",(a,{inputType:l,data:c})=>{o==O.delete&&l=="insertText"&&c=="\x7F"&&a.stop()},{priority:"high"});function s(a){return a==O.backspace||a==O.delete}function r(a){return a==O.backspace?Yn:vr}}function oE(e){if(e.length!=1||e[0].isCollapsed)return!1;let t=e[0].getWalker({direction:"backward",singleCharacters:!0,ignoreElementEnd:!0}),i=0;for(let{nextPosition:o,item:n}of t){if(o.parent.is("$text")){let s=o.parent.data,r=o.offset;if(Ds(s,r)||Fs(s,r)||za(s,r))continue;i++}else(n.is("containerElement")||n.is("emptyElement"))&&i++;if(i>1)return!0}return!1}/** +*/var tE="character",zw="word",iE="codePoint",Ji="selection",Yn="backward",vr="forward",$w={deleteContent:{unit:Ji,direction:Yn},deleteContentBackward:{unit:iE,direction:Yn},deleteWordBackward:{unit:zw,direction:Yn},deleteHardLineBackward:{unit:Ji,direction:Yn},deleteSoftLineBackward:{unit:Ji,direction:Yn},deleteContentForward:{unit:tE,direction:vr},deleteWordForward:{unit:zw,direction:vr},deleteHardLineForward:{unit:Ji,direction:vr},deleteSoftLineForward:{unit:Ji,direction:vr}},oE=class extends it{constructor(e){super(e);let t=e.document,i=0;t.on("keydown",()=>{i++}),t.on("keyup",()=>{i=0}),t.on("beforeinput",(o,n)=>{if(!this.isEnabled)return;let{targetRanges:s,domEvent:r,inputType:a}=n,l=$w[a];if(!l)return;let c={direction:l.direction,unit:l.unit,sequence:i};c.unit==Ji&&(c.selectionToRemove=e.createSelection(s[0])),a==="deleteContentBackward"&&(V.isAndroid&&(c.sequence=1),sE(s)&&(c.unit=Ji,c.selectionToRemove=e.createSelection(s)));let u=new bi(t,"delete",s[0]);t.fire(u,new wi(e,r,c)),u.stop.called&&o.stop()}),V.isBlink&&nE(this)}observe(){}stopObserving(){}};function nE(e){let t=e.view,i=t.document,o=null,n=!1;i.on("keydown",(a,{keyCode:l})=>{o=l,n=!1}),i.on("keyup",(a,{keyCode:l,domEvent:c})=>{let u=i.selection,d=e.isEnabled&&l==o&&s(l)&&!u.isCollapsed&&!n;if(o=null,d){let h=u.getFirstRange(),f=new bi(i,"delete",h),m={unit:Ji,direction:r(l),selectionToRemove:u};i.fire(f,new wi(t,c,m))}}),i.on("beforeinput",(a,{inputType:l})=>{let c=$w[l];s(o)&&c&&c.direction==r(o)&&(n=!0)},{priority:"high"}),i.on("beforeinput",(a,{inputType:l,data:c})=>{o==O.delete&&l=="insertText"&&c=="\x7F"&&a.stop()},{priority:"high"});function s(a){return a==O.backspace||a==O.delete}function r(a){return a==O.backspace?Yn:vr}}function sE(e){if(e.length!=1||e[0].isCollapsed)return!1;let t=e[0].getWalker({direction:"backward",singleCharacters:!0,ignoreElementEnd:!0}),i=0;for(let{nextPosition:o,item:n}of t){if(o.parent.is("$text")){let s=o.parent.data,r=o.offset;if(Ds(s,r)||Fs(s,r)||Ha(s,r))continue;i++}else(n.is("containerElement")||n.is("emptyElement"))&&i++;if(i>1)return!0}return!1}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var ht=class extends y{_undoOnBackspace;static get pluginName(){return"Delete"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.editing.view,i=t.document,o=e.model.document;t.addObserver(tE),this._undoOnBackspace=!1;let n=new Dw(e,"forward");e.commands.add("deleteForward",n),e.commands.add("forwardDelete",n),e.commands.add("delete",new Dw(e,"backward")),this.listenTo(i,"delete",(s,r)=>{i.isComposing||r.preventDefault();let{direction:a,sequence:l,selectionToRemove:c,unit:u}=r,d=a==="forward"?"deleteForward":"delete",h={sequence:l};if(u=="selection"){let f=Array.from(c.getRanges()).map(m=>e.editing.mapper.toModelRange(m)).map(m=>al(m,e.model.schema)||m);h.selection=e.model.createSelection(f)}else h.unit=u;e.execute(d,h),t.scrollToTheSelection()},{priority:"low"}),this.listenTo(i,"keydown",(s,r)=>{if(i.isComposing||r.keyCode!=O.backspace||!o.selection.isCollapsed)return;let a=e.model.schema.getLimitElement(o.selection),l=e.model.createPositionAt(a,0);if(l.isTouching(o.selection.getFirstPosition())){r.preventDefault();let c=e.model.schema.getNearestSelectionRange(l,"forward");if(!c)return;let u=t.createSelection(e.editing.mapper.toViewRange(c)),d=u.getFirstRange(),h=new gi(document,"delete",d),f={unit:"selection",direction:"backward",selectionToRemove:u};i.fire(h,new pi(t,r.domEvent,f))}}),this.editor.plugins.has("UndoEditing")&&(this.listenTo(i,"delete",(s,r)=>{this._undoOnBackspace&&r.direction=="backward"&&r.sequence==1&&r.unit=="codePoint"&&(this._undoOnBackspace=!1,e.execute("undo"),r.preventDefault(),s.stop())},{context:"$capture"}),this.listenTo(o,"change",()=>{this._undoOnBackspace=!1}))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}};/** +*/var ft=class extends w{_undoOnBackspace;static get pluginName(){return"Delete"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.editing.view,i=t.document,o=e.model.document;t.addObserver(oE),this._undoOnBackspace=!1;let n=new Nw(e,"forward");e.commands.add("deleteForward",n),e.commands.add("forwardDelete",n),e.commands.add("delete",new Nw(e,"backward")),this.listenTo(i,"delete",(s,r)=>{i.isComposing||r.preventDefault();let{direction:a,sequence:l,selectionToRemove:c,unit:u}=r,d=a==="forward"?"deleteForward":"delete",h={sequence:l};if(u=="selection"){let f=Array.from(c.getRanges()).map(m=>e.editing.mapper.toModelRange(m)).map(m=>ll(m,e.model.schema)||m);h.selection=e.model.createSelection(f)}else h.unit=u;e.execute(d,h),t.scrollToTheSelection()},{priority:"low"}),this.listenTo(i,"keydown",(s,r)=>{if(i.isComposing||r.keyCode!=O.backspace||!o.selection.isCollapsed)return;let a=e.model.schema.getLimitElement(o.selection),l=e.model.createPositionAt(a,0);if(l.isTouching(o.selection.getFirstPosition())){r.preventDefault();let c=e.model.schema.getNearestSelectionRange(l,"forward");if(!c)return;let u=t.createSelection(e.editing.mapper.toViewRange(c)),d=u.getFirstRange(),h=new bi(document,"delete",d),f={unit:"selection",direction:"backward",selectionToRemove:u};i.fire(h,new wi(t,r.domEvent,f))}}),this.editor.plugins.has("UndoEditing")&&(this.listenTo(i,"delete",(s,r)=>{this._undoOnBackspace&&r.direction=="backward"&&r.sequence==1&&r.unit=="codePoint"&&(this._undoOnBackspace=!1,e.execute("undo"),r.preventDefault(),s.stop())},{context:"$capture"}),this.listenTo(o,"change",()=>{this._undoOnBackspace=!1}))}requestUndoOnBackspace(){this.editor.plugins.has("UndoEditing")&&(this._undoOnBackspace=!0)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Dl=class extends y{static get requires(){return[yh,ht]}static get pluginName(){return"Typing"}static get isOfficialPlugin(){return!0}};/** +*/var Fl=class extends w{static get requires(){return[vh,ft]}static get pluginName(){return"Typing"}static get isOfficialPlugin(){return!0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function _h(e,t){let i=e.start;return{text:Array.from(e.getWalker({ignoreElementEnd:!1})).reduce((o,{item:n})=>n.is("$text")||n.is("$textProxy")?o+n.data:(i=t.createPositionAfter(n),""),""),range:t.createRange(i,e.end)}}/** +*/function kh(e,t){let i=e.start;return{text:Array.from(e.getWalker({ignoreElementEnd:!1})).reduce((o,{item:n})=>n.is("$text")||n.is("$textProxy")?o+n.data:(i=t.createPositionAfter(n),""),""),range:t.createRange(i,e.end)}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var nE=W(),Fl=class extends nE{model;testCallback;_hasMatch;constructor(e,t){super(),this.model=e,this.testCallback=t,this._hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))}),this._startListening()}get hasMatch(){return this._hasMatch}_startListening(){let e=this.model.document;this.listenTo(e.selection,"change:range",(t,{directChange:i})=>{if(i){if(!e.selection.isCollapsed){this.hasMatch&&(this.fire("unmatched"),this._hasMatch=!1);return}this._evaluateTextBeforeSelection("selection")}}),this.listenTo(e,"change:data",(t,i)=>{i.isUndo||!i.isLocal||this._evaluateTextBeforeSelection("data",{batch:i})})}_evaluateTextBeforeSelection(e,t={}){let i=this.model,o=i.document.selection,n=i.createRange(i.createPositionAt(o.focus.parent,0),o.focus),{text:s,range:r}=_h(n,i),a=this.testCallback(s);if(!a&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!a,a){let l=Object.assign(t,{text:s,range:r});typeof a=="object"&&Object.assign(l,a),this.fire(`matched:${e}`,l)}}};/** +*/var rE=W(),Nl=class extends rE{model;testCallback;_hasMatch;constructor(e,t){super(),this.model=e,this.testCallback=t,this._hasMatch=!1,this.set("isEnabled",!0),this.on("change:isEnabled",()=>{this.isEnabled?this._startListening():(this.stopListening(e.document.selection),this.stopListening(e.document))}),this._startListening()}get hasMatch(){return this._hasMatch}_startListening(){let e=this.model.document;this.listenTo(e.selection,"change:range",(t,{directChange:i})=>{if(i){if(!e.selection.isCollapsed){this.hasMatch&&(this.fire("unmatched"),this._hasMatch=!1);return}this._evaluateTextBeforeSelection("selection")}}),this.listenTo(e,"change:data",(t,i)=>{i.isUndo||!i.isLocal||this._evaluateTextBeforeSelection("data",{batch:i})})}_evaluateTextBeforeSelection(e,t={}){let i=this.model,o=i.document.selection,n=i.createRange(i.createPositionAt(o.focus.parent,0),o.focus),{text:s,range:r}=kh(n,i),a=this.testCallback(s);if(!a&&this.hasMatch&&this.fire("unmatched"),this._hasMatch=!!a,a){let l=Object.assign(t,{text:s,range:r});typeof a=="object"&&Object.assign(l,a),this.fire(`matched:${e}`,l)}}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Xn=class extends y{attributes;_overrideUid;_isNextGravityRestorationSkipped=!1;static get pluginName(){return"TwoStepCaretMovement"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.attributes=new Set,this._overrideUid=null}init(){let e=this.editor,t=e.model,i=e.editing.view,o=e.locale,n=t.document.selection;this.listenTo(i.document,"arrowKey",(s,r)=>{if(!n.isCollapsed||r.shiftKey||r.altKey||r.ctrlKey)return;let a=r.keyCode==O.arrowright,l=r.keyCode==O.arrowleft;if(!a&&!l)return;let c=o.contentLanguageDirection,u;c==="ltr"&&a||c==="rtl"&&l?u=this._handleForwardMovement(r):u=this._handleBackwardMovement(r),u===!0&&s.stop()},{context:"$text",priority:"highest"}),this.listenTo(n,"change:range",(s,r)=>{if(this._isNextGravityRestorationSkipped){this._isNextGravityRestorationSkipped=!1;return}this._isGravityOverridden&&(!r.directChange&&kt(n.getFirstPosition(),this.attributes)||this._restoreGravity())}),this._enableClickingAfterNode(),this._enableInsertContentSelectionAttributesFixer(),this._handleDeleteContentAfterNode()}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){let t=this.attributes,i=this.editor.model,o=i.document.selection,n=o.getFirstPosition();return this._isGravityOverridden||n.isAtStart&&Ci(o,t)?!1:kt(n,t)?(e&&_r(e),Ci(o,t)&&kt(n,t,!0)?yr(i,t):this._overrideGravity(),!0):!1}_handleBackwardMovement(e){let t=this.attributes,i=this.editor.model,o=i.document.selection,n=o.getFirstPosition();return this._isGravityOverridden?(e&&_r(e),this._restoreGravity(),kt(n,t,!0)?yr(i,t):Ol(i,t,n),!0):n.isAtStart?Ci(o,t)?(e&&_r(e),Ol(i,t,n),!0):!1:!Ci(o,t)&&kt(n,t,!0)?(e&&_r(e),Ol(i,t,n),!0):Nw(n,t)?n.isAtEnd&&!Ci(o,t)&&kt(n,t)?(e&&_r(e),Ol(i,t,n),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1):!1}_enableClickingAfterNode(){let e=this.editor,t=e.model,i=t.document.selection,o=e.editing.view.document;e.editing.view.addObserver(lr),e.editing.view.addObserver(n1);let n=!1,s=!1;this.listenTo(o,"touchstart",()=>{s=!1,n=!0}),this.listenTo(o,"mousedown",()=>{s=!0}),this.listenTo(o,"selectionChange",()=>{let r=this.attributes;if(!s&&!n||(s=!1,n=!1,!i.isCollapsed)||!Ci(i,r))return;let a=i.getFirstPosition();kt(a,r)&&(a.isAtStart||kt(a,r,!0)?yr(t,r):this._isGravityOverridden||this._overrideGravity())})}_enableInsertContentSelectionAttributesFixer(){let e=this.editor.model,t=e.document.selection,i=this.attributes;this.listenTo(e,"insertContent",()=>{let o=t.getFirstPosition();Ci(t,i)&&kt(o,i)&&yr(e,i)},{priority:"low"})}_handleDeleteContentAfterNode(){let e=this.editor,t=e.model,i=t.document.selection,o=e.editing.view,n=!1,s=!1;this.listenTo(o.document,"delete",(r,a)=>{n=a.direction==="backward"},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{if(!n)return;let r=i.getFirstPosition();s=Ci(i,this.attributes)&&!Nw(r,this.attributes)},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{n&&(n=!1,!s&&e.model.enqueueChange(()=>{let r=i.getFirstPosition();Ci(i,this.attributes)&&kt(r,this.attributes)&&(r.isAtStart||kt(r,this.attributes,!0)?yr(t,this.attributes):this._isGravityOverridden||this._overrideGravity())}))},{priority:"low"})}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(e=>e.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(e=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}};function Ci(e,t){for(let i of t)if(e.hasAttribute(i))return!0;return!1}function Ol(e,t,i){let o=i.nodeBefore;e.change(n=>{if(o){let s=[],r=e.schema.isObject(o)&&e.schema.isInline(o);for(let[a,l]of o.getAttributes())e.schema.checkAttribute("$text",a)&&(!r||e.schema.getAttributeProperties(a).copyFromObject!==!1)&&s.push([a,l]);n.setSelectionAttribute(s)}else n.removeSelectionAttribute(t)})}function yr(e,t){e.change(i=>{i.removeSelectionAttribute(t)})}function _r(e){e.preventDefault()}function Nw(e,t){return kt(e.getShiftedBy(-1),t)}function kt(e,t,i=!1){let{nodeBefore:o,nodeAfter:n}=e;for(let s of t){let r=o?o.getAttribute(s):void 0,a=n?n.getAttribute(s):void 0;if(!(i&&(r===void 0||a===void 0))&&a!==r)return!0}return!1}/** +*/var Xn=class extends w{attributes;_overrideUid;_isNextGravityRestorationSkipped=!1;static get pluginName(){return"TwoStepCaretMovement"}static get isOfficialPlugin(){return!0}constructor(e){super(e),this.attributes=new Set,this._overrideUid=null}init(){let e=this.editor,t=e.model,i=e.editing.view,o=e.locale,n=t.document.selection;this.listenTo(i.document,"arrowKey",(s,r)=>{if(!n.isCollapsed||r.shiftKey||r.altKey||r.ctrlKey)return;let a=r.keyCode==O.arrowright,l=r.keyCode==O.arrowleft;if(!a&&!l)return;let c=o.contentLanguageDirection,u;c==="ltr"&&a||c==="rtl"&&l?u=this._handleForwardMovement(r):u=this._handleBackwardMovement(r),u===!0&&s.stop()},{context:"$text",priority:"highest"}),this.listenTo(n,"change:range",(s,r)=>{if(this._isNextGravityRestorationSkipped){this._isNextGravityRestorationSkipped=!1;return}this._isGravityOverridden&&(!r.directChange&&Ct(n.getFirstPosition(),this.attributes)||this._restoreGravity())}),this._enableClickingAfterNode(),this._enableInsertContentSelectionAttributesFixer(),this._handleDeleteContentAfterNode()}registerAttribute(e){this.attributes.add(e)}_handleForwardMovement(e){let t=this.attributes,i=this.editor.model,o=i.document.selection,n=o.getFirstPosition();return this._isGravityOverridden||n.isAtStart&&Ti(o,t)?!1:Ct(n,t)?(e&&_r(e),Ti(o,t)&&Ct(n,t,!0)?yr(i,t):this._overrideGravity(),!0):!1}_handleBackwardMovement(e){let t=this.attributes,i=this.editor.model,o=i.document.selection,n=o.getFirstPosition();return this._isGravityOverridden?(e&&_r(e),this._restoreGravity(),Ct(n,t,!0)?yr(i,t):Dl(i,t,n),!0):n.isAtStart?Ti(o,t)?(e&&_r(e),Dl(i,t,n),!0):!1:!Ti(o,t)&&Ct(n,t,!0)?(e&&_r(e),Dl(i,t,n),!0):Hw(n,t)?n.isAtEnd&&!Ti(o,t)&&Ct(n,t)?(e&&_r(e),Dl(i,t,n),!0):(this._isNextGravityRestorationSkipped=!0,this._overrideGravity(),!1):!1}_enableClickingAfterNode(){let e=this.editor,t=e.model,i=t.document.selection,o=e.editing.view.document;e.editing.view.addObserver(lr),e.editing.view.addObserver(r1);let n=!1,s=!1;this.listenTo(o,"touchstart",()=>{s=!1,n=!0}),this.listenTo(o,"mousedown",()=>{s=!0}),this.listenTo(o,"selectionChange",()=>{let r=this.attributes;if(!s&&!n||(s=!1,n=!1,!i.isCollapsed)||!Ti(i,r))return;let a=i.getFirstPosition();Ct(a,r)&&(a.isAtStart||Ct(a,r,!0)?yr(t,r):this._isGravityOverridden||this._overrideGravity())})}_enableInsertContentSelectionAttributesFixer(){let e=this.editor.model,t=e.document.selection,i=this.attributes;this.listenTo(e,"insertContent",()=>{let o=t.getFirstPosition();Ti(t,i)&&Ct(o,i)&&yr(e,i)},{priority:"low"})}_handleDeleteContentAfterNode(){let e=this.editor,t=e.model,i=t.document.selection,o=e.editing.view,n=!1,s=!1;this.listenTo(o.document,"delete",(r,a)=>{n=a.direction==="backward"},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{if(!n)return;let r=i.getFirstPosition();s=Ti(i,this.attributes)&&!Hw(r,this.attributes)},{priority:"high"}),this.listenTo(t,"deleteContent",()=>{n&&(n=!1,!s&&e.model.enqueueChange(()=>{let r=i.getFirstPosition();Ti(i,this.attributes)&&Ct(r,this.attributes)&&(r.isAtStart||Ct(r,this.attributes,!0)?yr(t,this.attributes):this._isGravityOverridden||this._overrideGravity())}))},{priority:"low"})}get _isGravityOverridden(){return!!this._overrideUid}_overrideGravity(){this._overrideUid=this.editor.model.change(e=>e.overrideSelectionGravity())}_restoreGravity(){this.editor.model.change(e=>{e.restoreSelectionGravity(this._overrideUid),this._overrideUid=null})}};function Ti(e,t){for(let i of t)if(e.hasAttribute(i))return!0;return!1}function Dl(e,t,i){let o=i.nodeBefore;e.change(n=>{if(o){let s=[],r=e.schema.isObject(o)&&e.schema.isInline(o);for(let[a,l]of o.getAttributes())e.schema.checkAttribute("$text",a)&&(!r||e.schema.getAttributeProperties(a).copyFromObject!==!1)&&s.push([a,l]);n.setSelectionAttribute(s)}else n.removeSelectionAttribute(t)})}function yr(e,t){e.change(i=>{i.removeSelectionAttribute(t)})}function _r(e){e.preventDefault()}function Hw(e,t){return Ct(e.getShiftedBy(-1),t)}function Ct(e,t,i=!1){let{nodeBefore:o,nodeAfter:n}=e;for(let s of t){let r=o?o.getAttribute(s):void 0,a=n?n.getAttribute(s):void 0;if(!(i&&(r===void 0||a===void 0))&&a!==r)return!0}return!1}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var cj={copyright:{from:"(c)",to:"\xA9"},registeredTrademark:{from:"(r)",to:"\xAE"},trademark:{from:"(tm)",to:"\u2122"},oneHalf:{from:/(^|[^/a-z0-9])(1\/2)([^/a-z0-9])$/i,to:[null,"\xBD",null]},oneThird:{from:/(^|[^/a-z0-9])(1\/3)([^/a-z0-9])$/i,to:[null,"\u2153",null]},twoThirds:{from:/(^|[^/a-z0-9])(2\/3)([^/a-z0-9])$/i,to:[null,"\u2154",null]},oneForth:{from:/(^|[^/a-z0-9])(1\/4)([^/a-z0-9])$/i,to:[null,"\xBC",null]},threeQuarters:{from:/(^|[^/a-z0-9])(3\/4)([^/a-z0-9])$/i,to:[null,"\xBE",null]},lessThanOrEqual:{from:"<=",to:"\u2264"},greaterThanOrEqual:{from:">=",to:"\u2265"},notEqual:{from:"!=",to:"\u2260"},arrowLeft:{from:"<-",to:"\u2190"},arrowRight:{from:"->",to:"\u2192"},horizontalEllipsis:{from:"...",to:"\u2026"},enDash:{from:/(^| )(--)( )$/,to:[null,"\u2013",null]},emDash:{from:/(^| )(---)( )$/,to:[null,"\u2014",null]},quotesPrimary:{from:Qn('"'),to:[null,"\u201C",null,"\u201D"]},quotesSecondary:{from:Qn("'"),to:[null,"\u2018",null,"\u2019"]},quotesPrimaryEnGb:{from:Qn("'"),to:[null,"\u2018",null,"\u2019"]},quotesSecondaryEnGb:{from:Qn('"'),to:[null,"\u201C",null,"\u201D"]},quotesPrimaryPl:{from:Qn('"'),to:[null,"\u201E",null,"\u201D"]},quotesSecondaryPl:{from:Qn("'"),to:[null,"\u201A",null,"\u2019"]}};function Qn(e){return new RegExp(`(^|\\s)(${e})([^${e}]*)(${e})$`)}/** +*/var fj={copyright:{from:"(c)",to:"\xA9"},registeredTrademark:{from:"(r)",to:"\xAE"},trademark:{from:"(tm)",to:"\u2122"},oneHalf:{from:/(^|[^/a-z0-9])(1\/2)([^/a-z0-9])$/i,to:[null,"\xBD",null]},oneThird:{from:/(^|[^/a-z0-9])(1\/3)([^/a-z0-9])$/i,to:[null,"\u2153",null]},twoThirds:{from:/(^|[^/a-z0-9])(2\/3)([^/a-z0-9])$/i,to:[null,"\u2154",null]},oneForth:{from:/(^|[^/a-z0-9])(1\/4)([^/a-z0-9])$/i,to:[null,"\xBC",null]},threeQuarters:{from:/(^|[^/a-z0-9])(3\/4)([^/a-z0-9])$/i,to:[null,"\xBE",null]},lessThanOrEqual:{from:"<=",to:"\u2264"},greaterThanOrEqual:{from:">=",to:"\u2265"},notEqual:{from:"!=",to:"\u2260"},arrowLeft:{from:"<-",to:"\u2190"},arrowRight:{from:"->",to:"\u2192"},horizontalEllipsis:{from:"...",to:"\u2026"},enDash:{from:/(^| )(--)( )$/,to:[null,"\u2013",null]},emDash:{from:/(^| )(---)( )$/,to:[null,"\u2014",null]},quotesPrimary:{from:Qn('"'),to:[null,"\u201C",null,"\u201D"]},quotesSecondary:{from:Qn("'"),to:[null,"\u2018",null,"\u2019"]},quotesPrimaryEnGb:{from:Qn("'"),to:[null,"\u2018",null,"\u2019"]},quotesSecondaryEnGb:{from:Qn('"'),to:[null,"\u201C",null,"\u201D"]},quotesPrimaryPl:{from:Qn('"'),to:[null,"\u201E",null,"\u201D"]},quotesSecondaryPl:{from:Qn("'"),to:[null,"\u201A",null,"\u2019"]}};function Qn(e){return new RegExp(`(^|\\s)(${e})([^${e}]*)(${e})$`)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function kr(e,t,i,o){return o.createRange(zw(e,t,i,!0,o),zw(e,t,i,!1,o))}function zw(e,t,i,o,n){let s=e.textNode||(o?e.nodeBefore:e.nodeAfter),r=null;for(;s&&s.getAttribute(t)==i;)r=s,s=o?s.previousSibling:s.nextSibling;return r?n.createPositionAt(r,o?"before":"after"):e}/** +*/function kr(e,t,i,o){return o.createRange(Ww(e,t,i,!0,o),Ww(e,t,i,!1,o))}function Ww(e,t,i,o,n){let s=e.textNode||(o?e.nodeBefore:e.nodeAfter),r=null;for(;s&&s.getAttribute(t)==i;)r=s,s=o?s.previousSibling:s.nextSibling;return r?n.createPositionAt(r,o?"before":"after"):e}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Nl(e,t,i,o){let n=e.editing.view,s=new Set;n.document.registerPostFixer(r=>{let a=e.model.document.selection,l=!1;if(a.hasAttribute(t)){let c=kr(a.getFirstPosition(),t,a.getAttribute(t),e.model),u=e.editing.mapper.toViewRange(c);for(let d of u.getItems())d.is("element",i)&&!d.hasClass(o)&&(r.addClass(o,d),s.add(d),l=!0)}return l}),e.conversion.for("editingDowncast").add(r=>{r.on("insert",a,{priority:"highest"}),r.on("remove",a,{priority:"highest"}),r.on("attribute",a,{priority:"highest"}),r.on("selection",a,{priority:"highest"});function a(){n.change(l=>{for(let c of s.values())l.removeClass(o,c),s.delete(c)})}})}/** +*/function zl(e,t,i,o){let n=e.editing.view,s=new Set;n.document.registerPostFixer(r=>{let a=e.model.document.selection,l=!1;if(a.hasAttribute(t)){let c=kr(a.getFirstPosition(),t,a.getAttribute(t),e.model),u=e.editing.mapper.toViewRange(c);for(let d of u.getItems())d.is("element",i)&&!d.hasClass(o)&&(r.addClass(o,d),s.add(d),l=!0)}return l}),e.conversion.for("editingDowncast").add(r=>{r.on("insert",a,{priority:"highest"}),r.on("remove",a,{priority:"highest"}),r.on("attribute",a,{priority:"highest"}),r.on("selection",a,{priority:"highest"});function a(){n.change(l=>{for(let c of s.values())l.removeClass(o,c),s.delete(c)})}})}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -1130,19 +1130,19 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let */function*Po(e,t){for(let i of t)i&&e.getAttributeProperties(i[0]).copyOnEnter&&(yield i)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var sE=class extends M{execute(){this.editor.model.change(e=>{this.enterBlock(e),this.fire("afterExecute",{writer:e})})}enterBlock(e){let t=this.editor.model,i=t.document.selection,o=t.schema,n=i.isCollapsed,s=i.getFirstRange(),r=s.start.parent,a=s.end.parent;if(o.isLimit(r)||o.isLimit(a))return!n&&r==a&&t.deleteContent(i),!1;if(n){let l=Po(e.model.schema,i.getAttributes());return qw(e,s.start),e.setSelectionAttribute(l),!0}else{let l=!(s.start.isAtStart&&s.end.isAtEnd),c=r==a;if(t.deleteContent(i,{leaveUnmerged:l}),l){if(c)return qw(e,i.focus),!0;e.setSelection(a,0)}}return!1}};function qw(e,t){e.split(t),e.setSelection(t.parent.nextSibling,0)}/** +*/var aE=class extends M{execute(){this.editor.model.change(e=>{this.enterBlock(e),this.fire("afterExecute",{writer:e})})}enterBlock(e){let t=this.editor.model,i=t.document.selection,o=t.schema,n=i.isCollapsed,s=i.getFirstRange(),r=s.start.parent,a=s.end.parent;if(o.isLimit(r)||o.isLimit(a))return!n&&r==a&&t.deleteContent(i),!1;if(n){let l=Po(e.model.schema,i.getAttributes());return jw(e,s.start),e.setSelectionAttribute(l),!0}else{let l=!(s.start.isAtStart&&s.end.isAtEnd),c=r==a;if(t.deleteContent(i,{leaveUnmerged:l}),l){if(c)return jw(e,i.focus),!0;e.setSelection(a,0)}}return!1}};function jw(e,t){e.split(t),e.setSelection(t.parent.nextSibling,0)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var rE={insertParagraph:{isSoft:!1},insertLineBreak:{isSoft:!0}},jw=class extends it{constructor(e){super(e);let t=this.document,i=!1;t.on("keydown",(o,n)=>{i=n.shiftKey}),t.on("beforeinput",(o,n)=>{if(!this.isEnabled)return;let s=n.inputType;V.isSafari&&i&&s=="insertParagraph"&&(s="insertLineBreak");let r=n.domEvent,a=rE[s];if(!a)return;let l=new gi(t,"enter",n.targetRanges[0]);t.fire(l,new pi(e,r,{isSoft:a.isSoft})),l.stop.called&&o.stop()})}observe(){}stopObserving(){}};/** +*/var lE={insertParagraph:{isSoft:!1},insertLineBreak:{isSoft:!0}},Gw=class extends it{constructor(e){super(e);let t=this.document,i=!1;t.on("keydown",(o,n)=>{i=n.shiftKey}),t.on("beforeinput",(o,n)=>{if(!this.isEnabled)return;let s=n.inputType;V.isSafari&&i&&s=="insertParagraph"&&(s="insertLineBreak");let r=n.domEvent,a=lE[s];if(!a)return;let l=new bi(t,"enter",n.targetRanges[0]);t.fire(l,new wi(e,r,{isSoft:a.isSoft})),l.stop.called&&o.stop()})}observe(){}stopObserving(){}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Gi=class extends y{static get pluginName(){return"Enter"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.editing.view,i=t.document,o=this.editor.t;t.addObserver(jw),e.commands.add("enter",new sE(e)),this.listenTo(i,"enter",(n,s)=>{i.isComposing||s.preventDefault(),!s.isSoft&&(e.execute("enter"),t.scrollToTheSelection())},{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:o("Insert a hard break (a new paragraph)"),keystroke:"Enter"}]})}};/** +*/var Zi=class extends w{static get pluginName(){return"Enter"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.editing.view,i=t.document,o=this.editor.t;t.addObserver(Gw),e.commands.add("enter",new aE(e)),this.listenTo(i,"enter",(n,s)=>{i.isComposing||s.preventDefault(),!s.isSoft&&(e.execute("enter"),t.scrollToTheSelection())},{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:o("Insert a hard break (a new paragraph)"),keystroke:"Enter"}]})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var aE=class extends M{execute(){let e=this.editor.model,t=e.document;e.change(i=>{cE(e,i,t.selection),this.fire("afterExecute",{writer:i})})}refresh(){let e=this.editor.model,t=e.document;this.isEnabled=lE(e.schema,t.selection)}};function lE(e,t){if(t.rangeCount>1)return!1;let i=t.anchor;if(!i||!e.checkChild(i,"softBreak"))return!1;let o=t.getFirstRange(),n=o.start.parent,s=o.end.parent;return!((vh(n,e)||vh(s,e))&&n!==s)}function cE(e,t,i){let o=i.isCollapsed,n=i.getFirstRange(),s=n.start.parent,r=n.end.parent,a=s==r;if(o)$w(e,t,n.end,i.getAttributes());else{let l=!(n.start.isAtStart&&n.end.isAtEnd);e.deleteContent(i,{leaveUnmerged:l}),a?$w(e,t,i.focus,i.getAttributes()):l&&t.setSelection(r,0)}}function $w(e,t,i,o){let n=Array.from(Po(e.schema,o)),s=t.createElement("softBreak",n);e.insertContent(s,i),t.setSelection(s,"after")}function vh(e,t){return e.is("rootElement")?!1:t.isLimit(e)||vh(e.parent,t)}/** +*/var cE=class extends M{execute(){let e=this.editor.model,t=e.document;e.change(i=>{dE(e,i,t.selection),this.fire("afterExecute",{writer:i})})}refresh(){let e=this.editor.model,t=e.document;this.isEnabled=uE(e.schema,t.selection)}};function uE(e,t){if(t.rangeCount>1)return!1;let i=t.anchor;if(!i||!e.checkChild(i,"softBreak"))return!1;let o=t.getFirstRange(),n=o.start.parent,s=o.end.parent;return!((Ch(n,e)||Ch(s,e))&&n!==s)}function dE(e,t,i){let o=i.isCollapsed,n=i.getFirstRange(),s=n.start.parent,r=n.end.parent,a=s==r;if(o)Kw(e,t,n.end,i.getAttributes());else{let l=!(n.start.isAtStart&&n.end.isAtEnd);e.deleteContent(i,{leaveUnmerged:l}),a?Kw(e,t,i.focus,i.getAttributes()):l&&t.setSelection(r,0)}}function Kw(e,t,i,o){let n=Array.from(Po(e.schema,o)),s=t.createElement("softBreak",n);e.insertContent(s,i),t.setSelection(s,"after")}function Ch(e,t){return e.is("rootElement")?!1:t.isLimit(e)||Ch(e.parent,t)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Kw=class extends y{static get pluginName(){return"ShiftEnter"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.model.schema,i=e.conversion,o=e.editing.view,n=o.document,s=this.editor.t;t.register("softBreak",{allowWhere:"$text",allowAttributesOf:"$text",isInline:!0}),i.for("upcast").elementToElement({model:"softBreak",view:"br"}),i.for("downcast").elementToElement({model:"softBreak",view:(r,{writer:a})=>a.createEmptyElement("br")}),o.addObserver(jw),e.commands.add("shiftEnter",new aE(e)),e.model.document.registerPostFixer(r=>uE(r)),this.listenTo(n,"enter",(r,a)=>{n.isComposing||a.preventDefault(),a.isSoft&&(e.execute("shiftEnter"),o.scrollToTheSelection())},{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:s("Insert a soft break (a <br> element)"),keystroke:"Shift+Enter"}]})}};function uE(e){let t=new Set;for(let o of e.model.document.differ.getChanges())if(o.type=="insert"||o.type=="remove"){/* v8 ignore else -- @preserve */o.position.parent.is("element")&&t.add(o.position.parent)}else if(o.type=="attribute"){/* v8 ignore else -- @preserve */o.range.start.parent.is("element")&&t.add(o.range.start.parent)}let i=!1;for(let o of t)for(let n of o.getChildren()){if(!n.is("element","softBreak"))continue;let s=n.nextSibling;if(!s||s.is("element"))continue;let r=Array.from(n.getAttributes()).filter(([a,l])=>!dE(s,a,l));for(let[a]of r)e.removeAttribute(a,n),i=!0}return i}function dE(e,t,i){return e?.getAttribute(t)===i}/** +*/var Jw=class extends w{static get pluginName(){return"ShiftEnter"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.model.schema,i=e.conversion,o=e.editing.view,n=o.document,s=this.editor.t;t.register("softBreak",{allowWhere:"$text",allowAttributesOf:"$text",isInline:!0}),i.for("upcast").elementToElement({model:"softBreak",view:"br"}),i.for("downcast").elementToElement({model:"softBreak",view:(r,{writer:a})=>a.createEmptyElement("br")}),o.addObserver(Gw),e.commands.add("shiftEnter",new cE(e)),e.model.document.registerPostFixer(r=>hE(r)),this.listenTo(n,"enter",(r,a)=>{n.isComposing||a.preventDefault(),a.isSoft&&(e.execute("shiftEnter"),o.scrollToTheSelection())},{priority:"low"}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:s("Insert a soft break (a <br> element)"),keystroke:"Shift+Enter"}]})}};function hE(e){let t=new Set;for(let o of e.model.document.differ.getChanges())if(o.type=="insert"||o.type=="remove"){/* v8 ignore else -- @preserve */o.position.parent.is("element")&&t.add(o.position.parent)}else if(o.type=="attribute"){/* v8 ignore else -- @preserve */o.range.start.parent.is("element")&&t.add(o.range.start.parent)}let i=!1;for(let o of t)for(let n of o.getChildren()){if(!n.is("element","softBreak"))continue;let s=n.nextSibling;if(!s||s.is("element"))continue;let r=Array.from(n.getAttributes()).filter(([a,l])=>!fE(s,a,l));for(let[a]of r)e.removeAttribute(a,n),i=!0}return i}function fE(e,t,i){return e?.getAttribute(t)===i}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -1151,50 +1151,50 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var hE=q(),fE=class extends hE{_stack=[];add(e,t){let i=this._stack,o=i[0];this._insertDescriptor(e);let n=i[0];o!==n&&!kh(o,n)&&this.fire("change:top",{oldDescriptor:o,newDescriptor:n,writer:t})}remove(e,t){let i=this._stack,o=i[0];this._removeDescriptor(e);let n=i[0];o!==n&&!kh(o,n)&&this.fire("change:top",{oldDescriptor:o,newDescriptor:n,writer:t})}_insertDescriptor(e){let t=this._stack,i=t.findIndex(n=>n.id===e.id);if(kh(e,t[i]))return;i>-1&&t.splice(i,1);let o=0;for(;t[o]&&mE(t[o],e);)o++;t.splice(o,0,e)}_removeDescriptor(e){let t=this._stack,i=t.findIndex(o=>o.id===e);i>-1&&t.splice(i,1)}};function kh(e,t){return e&&t&&e.priority==t.priority&&zl(e.classes)==zl(t.classes)}function mE(e,t){return e.priority>t.priority?!0:e.priorityzl(t.classes)}function zl(e){return Array.isArray(e)?e.sort().join(","):e}/** +*/var mE=q(),gE=class extends mE{_stack=[];add(e,t){let i=this._stack,o=i[0];this._insertDescriptor(e);let n=i[0];o!==n&&!xh(o,n)&&this.fire("change:top",{oldDescriptor:o,newDescriptor:n,writer:t})}remove(e,t){let i=this._stack,o=i[0];this._removeDescriptor(e);let n=i[0];o!==n&&!xh(o,n)&&this.fire("change:top",{oldDescriptor:o,newDescriptor:n,writer:t})}_insertDescriptor(e){let t=this._stack,i=t.findIndex(n=>n.id===e.id);if(xh(e,t[i]))return;i>-1&&t.splice(i,1);let o=0;for(;t[o]&&pE(t[o],e);)o++;t.splice(o,0,e)}_removeDescriptor(e){let t=this._stack,i=t.findIndex(o=>o.id===e);i>-1&&t.splice(i,1)}};function xh(e,t){return e&&t&&e.priority==t.priority&&Hl(e.classes)==Hl(t.classes)}function pE(e,t){return e.priority>t.priority?!0:e.priorityHl(t.classes)}function Hl(e){return Array.isArray(e)?e.sort().join(","):e}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var gE="ck-widget",Gw="ck-widget_selected";function z(e){return e.is("element")?!!e.getCustomProperty("widget"):!1}function me(e,t,i={}){if(!e.is("containerElement"))throw new p("widget-to-widget-wrong-element-type",null,{element:e});return t.setAttribute("contenteditable","false",e),t.addClass(gE,e),t.setCustomProperty("widget",!0,e),e.getFillerOffset=_E,t.setCustomProperty("widgetLabel",[],e),i.label&&wE(e,i.label),i.hasSelectionHandle&&vE(e,t),e2(e,t),e}function pE(e,t,i){if(t.classes&&i.addClass(j(t.classes),e),t.attributes)for(let o in t.attributes)i.setAttribute(o,t.attributes[o],e)}function bE(e,t,i){if(t.classes&&i.removeClass(j(t.classes),e),t.attributes)for(let o in t.attributes)i.removeAttribute(o,e)}function e2(e,t,i=pE,o=bE){let n=new fE;n.on("change:top",(a,l)=>{l.oldDescriptor&&o(e,l.oldDescriptor,l.writer),l.newDescriptor&&i(e,l.newDescriptor,l.writer)});let s=(a,l,c)=>n.add(l,c),r=(a,l,c)=>n.remove(l,c);t.setCustomProperty("addHighlight",s,e),t.setCustomProperty("removeHighlight",r,e)}function wE(e,t){e.getCustomProperty("widgetLabel").push(t)}function yE(e){return e.getCustomProperty("widgetLabel").reduce((t,i)=>typeof i=="function"?t?t+". "+i():i():t?t+". "+i:i,"")}function Hl(e,t,i={}){return t.addClass(["ck-editor__editable","ck-editor__nested-editable"],e),i.withAriaRole!==!1&&t.setAttribute("role","textbox",e),e.isReadOnly||t.setAttribute("tabindex","-1",e),i.label&&t.setAttribute("aria-label",i.label,e),t.setAttribute("contenteditable",e.isReadOnly?"false":"true",e),e.on("change:isReadOnly",(o,n,s)=>{t.setAttribute("contenteditable",s?"false":"true",e),s?t.removeAttribute("tabindex",e):t.setAttribute("tabindex","-1",e)}),e.on("change:isFocused",(o,n,s)=>{s?t.addClass("ck-editor__nested-editable_focused",e):t.removeClass("ck-editor__nested-editable_focused",e)}),e2(e,t),e}function es(e,t){let i=e.getSelectedElement();if(i){let o=Ti(e);if(o)return t.createRange(t.createPositionAt(i,o))}return t.schema.findOptimalInsertionRange(e)}function t2(e,t){return(i,o)=>{let{mapper:n,viewPosition:s}=o,r=n.findMappedViewAncestor(s);if(!t(r))return;let a=n.toModelElement(r);o.modelPosition=e.createPositionAt(a,s.isAtStart?"before":"after")}}function _E(){return null}function vE(e,t){let i=t.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(o){let n=this.toDomElement(o),s=new Yt;return s.set("content",F1),s.render(),n.appendChild(s.element),n});t.insert(t.createPositionAt(e,0),i),t.addClass(["ck-widget_with-selection-handle"],e)}function Wl(e){let t=a=>{let{width:l,paddingLeft:c,paddingRight:u}=a.ownerDocument.defaultView.getComputedStyle(a);return parseFloat(l)-(parseFloat(c)||0)-(parseFloat(u)||0)},i=Fe(e);if(!i)return 0;let o=t(i),n=5,s=0,r=i;for(;isNaN(o);){if(r=Fe(r),++s>n)return 0;o=t(r)}return o}function kE(e,t=new F(e)){let i=Wl(e);return i?t.width/i*100:0}/** +*/var bE="ck-widget",Zw="ck-widget_selected";function z(e){return e.is("element")?!!e.getCustomProperty("widget"):!1}function me(e,t,i={}){if(!e.is("containerElement"))throw new p("widget-to-widget-wrong-element-type",null,{element:e});return t.setAttribute("contenteditable","false",e),t.addClass(bE,e),t.setCustomProperty("widget",!0,e),e.getFillerOffset=kE,t.setCustomProperty("widgetLabel",[],e),i.label&&_E(e,i.label),i.hasSelectionHandle&&CE(e,t),i2(e,t),e}function wE(e,t,i){if(t.classes&&i.addClass(j(t.classes),e),t.attributes)for(let o in t.attributes)i.setAttribute(o,t.attributes[o],e)}function yE(e,t,i){if(t.classes&&i.removeClass(j(t.classes),e),t.attributes)for(let o in t.attributes)i.removeAttribute(o,e)}function i2(e,t,i=wE,o=yE){let n=new gE;n.on("change:top",(a,l)=>{l.oldDescriptor&&o(e,l.oldDescriptor,l.writer),l.newDescriptor&&i(e,l.newDescriptor,l.writer)});let s=(a,l,c)=>n.add(l,c),r=(a,l,c)=>n.remove(l,c);t.setCustomProperty("addHighlight",s,e),t.setCustomProperty("removeHighlight",r,e)}function _E(e,t){e.getCustomProperty("widgetLabel").push(t)}function vE(e){return e.getCustomProperty("widgetLabel").reduce((t,i)=>typeof i=="function"?t?t+". "+i():i():t?t+". "+i:i,"")}function Wl(e,t,i={}){return t.addClass(["ck-editor__editable","ck-editor__nested-editable"],e),i.withAriaRole!==!1&&t.setAttribute("role","textbox",e),e.isReadOnly||t.setAttribute("tabindex","-1",e),i.label&&t.setAttribute("aria-label",i.label,e),t.setAttribute("contenteditable",e.isReadOnly?"false":"true",e),e.on("change:isReadOnly",(o,n,s)=>{t.setAttribute("contenteditable",s?"false":"true",e),s?t.removeAttribute("tabindex",e):t.setAttribute("tabindex","-1",e)}),e.on("change:isFocused",(o,n,s)=>{s?t.addClass("ck-editor__nested-editable_focused",e):t.removeClass("ck-editor__nested-editable_focused",e)}),i2(e,t),e}function es(e,t){let i=e.getSelectedElement();if(i){let o=Ai(e);if(o)return t.createRange(t.createPositionAt(i,o))}return t.schema.findOptimalInsertionRange(e)}function o2(e,t){return(i,o)=>{let{mapper:n,viewPosition:s}=o,r=n.findMappedViewAncestor(s);if(!t(r))return;let a=n.toModelElement(r);o.modelPosition=e.createPositionAt(a,s.isAtStart?"before":"after")}}function kE(){return null}function CE(e,t){let i=t.createUIElement("div",{class:"ck ck-widget__selection-handle"},function(o){let n=this.toDomElement(o),s=new ei;return s.set("content",z1),s.render(),n.appendChild(s.element),n});t.insert(t.createPositionAt(e,0),i),t.addClass(["ck-widget_with-selection-handle"],e)}function Ul(e){let t=a=>{let{width:l,paddingLeft:c,paddingRight:u}=a.ownerDocument.defaultView.getComputedStyle(a);return parseFloat(l)-(parseFloat(c)||0)-(parseFloat(u)||0)},i=Fe(e);if(!i)return 0;let o=t(i),n=5,s=0,r=i;for(;isNaN(o);){if(r=Fe(r),++s>n)return 0;o=t(r)}return o}function xE(e,t=new F(e)){let i=Ul(e);return i?t.width/i*100:0}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var xi="widget-type-around";function Ro(e,t,i){return!!e&&z(e)&&!i.isInline(t)}function i2(e){return e.closest(".ck-widget__type-around__button")}function CE(e){return e.classList.contains("ck-widget__type-around__button_before")?"before":"after"}function xE(e,t){let i=e.closest(".ck-widget");return t.mapDomToView(i)}function Ti(e){return e.getAttribute(xi)}function TE(e,t){let i=t;for(;i&&i.is("element")&&e.isObject(i);)i=i.previousSibling;if(!i?.is("element"))return[];if(i.isEmpty){let n=EE(i.getAttributes());return Array.from(Po(e,n))}let o=i.getChild(i.childCount-1);return e.isInline(o)?Array.from(Po(e,o.getAttributes())):[]}function*EE(e){for(let[t,i]of e)Ce._isStoreAttributeKey(t)&&(yield[Ce._dropStoreAttributeKeyPrefix(t),i])}/** +*/var Ei="widget-type-around";function Ro(e,t,i){return!!e&&z(e)&&!i.isInline(t)}function n2(e){return e.closest(".ck-widget__type-around__button")}function TE(e){return e.classList.contains("ck-widget__type-around__button_before")?"before":"after"}function EE(e,t){let i=e.closest(".ck-widget");return t.mapDomToView(i)}function Ai(e){return e.getAttribute(Ei)}function AE(e,t){let i=t;for(;i&&i.is("element")&&e.isObject(i);)i=i.previousSibling;if(!i?.is("element"))return[];if(i.isEmpty){let n=IE(i.getAttributes());return Array.from(Po(e,n))}let o=i.getChild(i.childCount-1);return e.isInline(o)?Array.from(Po(e,o.getAttributes())):[]}function*IE(e){for(let[t,i]of e)Te._isStoreAttributeKey(t)&&(yield[Te._dropStoreAttributeKeyPrefix(t),i])}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var o2=["before","after"],AE=new DOMParser().parseFromString(at(rb),"image/svg+xml").firstChild,Jw="ck-widget__type-around_disabled",IE=class extends y{_currentFakeCaretModelElement=null;static get pluginName(){return"WidgetTypeAround"}static get isOfficialPlugin(){return!0}static get requires(){return[Gi,ht]}init(){let e=this.editor,t=e.editing.view;this.on("change:isEnabled",(i,o,n)=>{t.change(s=>{for(let r of t.document.roots)n?s.removeClass(Jw,r):s.addClass(Jw,r)}),n||e.model.change(s=>{s.removeSelectionAttribute(xi)})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){super.destroy(),this._currentFakeCaretModelElement=null}_insertParagraph(e,t){let i=this.editor,{model:o}=i,{schema:n}=o,s=i.editing.view,r=n.getAttributesWithProperty(e,"copyOnReplace",!0),a=TE(n,e);o.change(l=>{i.execute("insertParagraph",{position:i.model.createPositionAt(e,t),attributes:r})&&l.setSelectionAttribute(a)}),s.focus(),s.scrollToTheSelection()}_listenToIfEnabled(e,t,i,o){this.listenTo(e,t,(...n)=>{this.isEnabled&&i(...n)},o)}_insertParagraphAccordingToFakeCaretPosition(){let e=this.editor.model.document.selection,t=Ti(e);if(!t)return!1;let i=e.getSelectedElement();return this._insertParagraph(i,t),!0}_enableTypeAroundUIInjection(){let e=this.editor,t=e.model.schema,i=e.locale.t,o={before:i("Insert paragraph before block"),after:i("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(n,s,r)=>{let a=r.mapper.toViewElement(s.item);a&&Ro(a,s.item,t)&&(SE(r.writer,o,a),a.getCustomProperty("widgetLabel").push(()=>this.isEnabled?i("Press Enter to type after or press Shift + Enter to type before the widget"):""))},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){let e=this.editor,t=e.model,i=t.document.selection,o=t.schema,n=e.editing.view;this._listenToIfEnabled(n.document,"arrowKey",(r,a)=>{this._handleArrowKeyPress(r,a)},{context:[z,"$text"],priority:"high"}),this._listenToIfEnabled(i,"change:range",(r,a)=>{a.directChange&&e.model.change(l=>{l.removeSelectionAttribute(xi)})}),this._listenToIfEnabled(t.document,"change:data",()=>{let r=i.getSelectedElement();if(r){let a=e.editing.mapper.toViewElement(r);if(Ro(a,r,o))return}e.model.change(a=>{a.removeSelectionAttribute(xi)})}),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(r,a,l)=>{let c=l.writer;if(this._currentFakeCaretModelElement){let f=l.mapper.toViewElement(this._currentFakeCaretModelElement);f&&(c.removeClass(o2.map(s),f),this._currentFakeCaretModelElement=null)}let u=a.selection.getSelectedElement();if(!u)return;let d=l.mapper.toViewElement(u);if(!Ro(d,u,o))return;let h=Ti(a.selection);h&&(c.addClass(s(h),d),this._currentFakeCaretModelElement=u)}),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(r,a,l)=>{l||e.model.change(c=>{c.removeSelectionAttribute(xi)})});function s(r){return`ck-widget_type-around_show-fake-caret_${r}`}}_handleArrowKeyPress(e,t){let i=this.editor,o=i.model,n=o.document.selection,s=o.schema,r=i.editing.view;if(t.shiftKey)return;let a=t.keyCode,l=mg(a,i.locale.contentLanguageDirection),c=r.document.selection.getSelectedElement(),u=i.editing.mapper.toModelElement(c),d;/* v8 ignore else -- @preserve */Ro(c,u,s)?d=this._handleArrowKeyPressOnSelectedWidget(l):n.isCollapsed?d=this._handleArrowKeyPressWhenSelectionNextToAWidget(l):t.shiftKey||(d=this._handleArrowKeyPressWhenNonCollapsedSelection(l)),d&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){let t=this.editor.model,i=t.document.selection,o=Ti(i);return t.change(n=>{if(o){if(o!==(e?"after":"before"))return n.removeSelectionAttribute(xi),!0}else return n.setSelectionAttribute(xi,e?"after":"before"),!0;return!1})}_handleArrowKeyPressWhenSelectionNextToAWidget(e){let t=this.editor,i=t.model,o=i.schema,n=t.plugins.get("Widget"),s=n._getObjectElementNextToSelection(e),r=t.editing.mapper.toViewElement(s);return Ro(r,s,o)?(i.change(a=>{n._setSelectionOverElement(s),a.setSelectionAttribute(xi,e?"before":"after")}),!0):!1}_handleArrowKeyPressWhenNonCollapsedSelection(e){let t=this.editor,i=t.model,o=i.schema,n=t.editing.mapper,s=i.document.selection,r=e?s.getLastPosition().nodeBefore:s.getFirstPosition().nodeAfter,a=n.toViewElement(r);return Ro(a,r,o)?(i.change(l=>{l.setSelection(r,"on"),l.setSelectionAttribute(xi,e?"after":"before")}),!0):!1}_enableInsertingParagraphsOnButtonClick(){let e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",(i,o)=>{let n=i2(o.domTarget);if(!n)return;let s=CE(n),r=xE(n,t.domConverter),a=e.editing.mapper.toModelElement(r);this._insertParagraph(a,s),o.preventDefault(),i.stop()})}_enableInsertingParagraphsOnEnterKeypress(){let e=this.editor,t=e.model.document.selection,i=e.editing.view;this._listenToIfEnabled(i.document,"enter",(o,n)=>{if(o.eventPhase!="atTarget")return;let s=t.getSelectedElement(),r=e.editing.mapper.toViewElement(s),a=e.model.schema,l;this._insertParagraphAccordingToFakeCaretPosition()?l=!0:Ro(r,s,a)&&(this._insertParagraph(s,n.isSoft?"before":"after"),l=!0),l&&(n.preventDefault(),o.stop())},{context:z})}_enableInsertingParagraphsOnTypingKeystroke(){let e=this.editor.editing.view.document;this._listenToIfEnabled(e,"insertText",(t,i)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(i.selection=e.selection)},{priority:"high"}),V.isAndroid?this._listenToIfEnabled(e,"keydown",(t,i)=>{i.keyCode==229&&this._insertParagraphAccordingToFakeCaretPosition()}):this._listenToIfEnabled(e,"compositionstart",()=>{this._insertParagraphAccordingToFakeCaretPosition()},{priority:"highest"})}_enableDeleteIntegration(){let e=this.editor,t=e.editing.view,i=e.model,o=i.schema;this._listenToIfEnabled(t.document,"delete",(n,s)=>{if(n.eventPhase!="atTarget")return;let r=Ti(i.document.selection);if(!r)return;let a=s.direction,l=i.document.selection.getSelectedElement(),c=r==="before",u=a=="forward";if(c===u)e.execute("delete",{selection:i.createSelection(l,"on")});else{let d=o.getNearestSelectionRange(i.createPositionAt(l,r),a);if(d)if(!d.isCollapsed)i.change(h=>{h.setSelection(d),e.execute(u?"deleteForward":"delete")});else{let h=i.createSelection(d.start);if(i.modifySelection(h,{direction:a}),!h.focus.isEqual(d.start))i.change(f=>{f.setSelection(d),e.execute(u?"deleteForward":"delete")});else{let f=VE(o,d.start.parent);i.deleteContent(i.createSelection(f,"on"),{doNotAutoparagraph:!0})}}}s.preventDefault(),n.stop()},{context:z})}_enableInsertContentIntegration(){let e=this.editor,t=this.editor.model,i=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",(o,[n,s])=>{if(s&&!s.is("documentSelection"))return;let r=Ti(i);if(r)return o.stop(),t.change(a=>{let l=i.getSelectedElement(),c=t.createPositionAt(l,r),u=a.createSelection(c),d=t.insertContent(n,u);return a.setSelection(u),d})},{priority:"high"})}_enableInsertObjectIntegration(){let e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"insertObject",(i,o)=>{let[,n,s={}]=o;if(n&&!n.is("documentSelection"))return;let r=Ti(t);r&&(s.findOptimalPosition=r,o[3]=s)},{priority:"high"})}_enableDeleteContentIntegration(){let e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",(i,[o])=>{o&&!o.is("documentSelection")||Ti(t)&&i.stop()},{priority:"high"})}};function SE(e,t,i){let o=e.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(n){let s=this.toDomElement(n);return PE(s,t),RE(s),s});e.insert(e.createPositionAt(i,"end"),o)}function PE(e,t){for(let i of o2){let o=new _t({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${i}`],title:t[i],"aria-hidden":"true"},children:[e.ownerDocument.importNode(AE,!0)]});e.appendChild(o.render())}}function RE(e){let t=new _t({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});e.appendChild(t.render())}function VE(e,t){let i=t;for(let o of t.getAncestors({parentFirst:!0})){if(o.childCount>1||e.isLimit(o))break;i=o}return i}/** +*/var s2=["before","after"],SE=new DOMParser().parseFromString(at(lb),"image/svg+xml").firstChild,Qw="ck-widget__type-around_disabled",PE=class extends w{_currentFakeCaretModelElement=null;static get pluginName(){return"WidgetTypeAround"}static get isOfficialPlugin(){return!0}static get requires(){return[Zi,ft]}init(){let e=this.editor,t=e.editing.view;this.on("change:isEnabled",(i,o,n)=>{t.change(s=>{for(let r of t.document.roots)n?s.removeClass(Qw,r):s.addClass(Qw,r)}),n||e.model.change(s=>{s.removeSelectionAttribute(Ei)})}),this._enableTypeAroundUIInjection(),this._enableInsertingParagraphsOnButtonClick(),this._enableInsertingParagraphsOnEnterKeypress(),this._enableInsertingParagraphsOnTypingKeystroke(),this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows(),this._enableDeleteIntegration(),this._enableInsertContentIntegration(),this._enableInsertObjectIntegration(),this._enableDeleteContentIntegration()}destroy(){super.destroy(),this._currentFakeCaretModelElement=null}_insertParagraph(e,t){let i=this.editor,{model:o}=i,{schema:n}=o,s=i.editing.view,r=n.getAttributesWithProperty(e,"copyOnReplace",!0),a=AE(n,e);o.change(l=>{i.execute("insertParagraph",{position:i.model.createPositionAt(e,t),attributes:r})&&l.setSelectionAttribute(a)}),s.focus(),s.scrollToTheSelection()}_listenToIfEnabled(e,t,i,o){this.listenTo(e,t,(...n)=>{this.isEnabled&&i(...n)},o)}_insertParagraphAccordingToFakeCaretPosition(){let e=this.editor.model.document.selection,t=Ai(e);if(!t)return!1;let i=e.getSelectedElement();return this._insertParagraph(i,t),!0}_enableTypeAroundUIInjection(){let e=this.editor,t=e.model.schema,i=e.locale.t,o={before:i("Insert paragraph before block"),after:i("Insert paragraph after block")};e.editing.downcastDispatcher.on("insert",(n,s,r)=>{let a=r.mapper.toViewElement(s.item);a&&Ro(a,s.item,t)&&(RE(r.writer,o,a),a.getCustomProperty("widgetLabel").push(()=>this.isEnabled?i("Press Enter to type after or press Shift + Enter to type before the widget"):""))},{priority:"low"})}_enableTypeAroundFakeCaretActivationUsingKeyboardArrows(){let e=this.editor,t=e.model,i=t.document.selection,o=t.schema,n=e.editing.view;this._listenToIfEnabled(n.document,"arrowKey",(r,a)=>{this._handleArrowKeyPress(r,a)},{context:[z,"$text"],priority:"high"}),this._listenToIfEnabled(i,"change:range",(r,a)=>{a.directChange&&e.model.change(l=>{l.removeSelectionAttribute(Ei)})}),this._listenToIfEnabled(t.document,"change:data",()=>{let r=i.getSelectedElement();if(r){let a=e.editing.mapper.toViewElement(r);if(Ro(a,r,o))return}e.model.change(a=>{a.removeSelectionAttribute(Ei)})}),this._listenToIfEnabled(e.editing.downcastDispatcher,"selection",(r,a,l)=>{let c=l.writer;if(this._currentFakeCaretModelElement){let f=l.mapper.toViewElement(this._currentFakeCaretModelElement);f&&(c.removeClass(s2.map(s),f),this._currentFakeCaretModelElement=null)}let u=a.selection.getSelectedElement();if(!u)return;let d=l.mapper.toViewElement(u);if(!Ro(d,u,o))return;let h=Ai(a.selection);h&&(c.addClass(s(h),d),this._currentFakeCaretModelElement=u)}),this._listenToIfEnabled(e.ui.focusTracker,"change:isFocused",(r,a,l)=>{l||e.model.change(c=>{c.removeSelectionAttribute(Ei)})});function s(r){return`ck-widget_type-around_show-fake-caret_${r}`}}_handleArrowKeyPress(e,t){let i=this.editor,o=i.model,n=o.document.selection,s=o.schema,r=i.editing.view;if(t.shiftKey)return;let a=t.keyCode,l=pg(a,i.locale.contentLanguageDirection),c=r.document.selection.getSelectedElement(),u=i.editing.mapper.toModelElement(c),d;/* v8 ignore else -- @preserve */Ro(c,u,s)?d=this._handleArrowKeyPressOnSelectedWidget(l):n.isCollapsed?d=this._handleArrowKeyPressWhenSelectionNextToAWidget(l):t.shiftKey||(d=this._handleArrowKeyPressWhenNonCollapsedSelection(l)),d&&(t.preventDefault(),e.stop())}_handleArrowKeyPressOnSelectedWidget(e){let t=this.editor.model,i=t.document.selection,o=Ai(i);return t.change(n=>{if(o){if(o!==(e?"after":"before"))return n.removeSelectionAttribute(Ei),!0}else return n.setSelectionAttribute(Ei,e?"after":"before"),!0;return!1})}_handleArrowKeyPressWhenSelectionNextToAWidget(e){let t=this.editor,i=t.model,o=i.schema,n=t.plugins.get("Widget"),s=n._getObjectElementNextToSelection(e),r=t.editing.mapper.toViewElement(s);return Ro(r,s,o)?(i.change(a=>{n._setSelectionOverElement(s),a.setSelectionAttribute(Ei,e?"before":"after")}),!0):!1}_handleArrowKeyPressWhenNonCollapsedSelection(e){let t=this.editor,i=t.model,o=i.schema,n=t.editing.mapper,s=i.document.selection,r=e?s.getLastPosition().nodeBefore:s.getFirstPosition().nodeAfter,a=n.toViewElement(r);return Ro(a,r,o)?(i.change(l=>{l.setSelection(r,"on"),l.setSelectionAttribute(Ei,e?"after":"before")}),!0):!1}_enableInsertingParagraphsOnButtonClick(){let e=this.editor,t=e.editing.view;this._listenToIfEnabled(t.document,"mousedown",(i,o)=>{let n=n2(o.domTarget);if(!n)return;let s=TE(n),r=EE(n,t.domConverter),a=e.editing.mapper.toModelElement(r);this._insertParagraph(a,s),o.preventDefault(),i.stop()})}_enableInsertingParagraphsOnEnterKeypress(){let e=this.editor,t=e.model.document.selection,i=e.editing.view;this._listenToIfEnabled(i.document,"enter",(o,n)=>{if(o.eventPhase!="atTarget")return;let s=t.getSelectedElement(),r=e.editing.mapper.toViewElement(s),a=e.model.schema,l;this._insertParagraphAccordingToFakeCaretPosition()?l=!0:Ro(r,s,a)&&(this._insertParagraph(s,n.isSoft?"before":"after"),l=!0),l&&(n.preventDefault(),o.stop())},{context:z})}_enableInsertingParagraphsOnTypingKeystroke(){let e=this.editor.editing.view.document;this._listenToIfEnabled(e,"insertText",(t,i)=>{this._insertParagraphAccordingToFakeCaretPosition()&&(i.selection=e.selection)},{priority:"high"}),V.isAndroid?this._listenToIfEnabled(e,"keydown",(t,i)=>{i.keyCode==229&&this._insertParagraphAccordingToFakeCaretPosition()}):this._listenToIfEnabled(e,"compositionstart",()=>{this._insertParagraphAccordingToFakeCaretPosition()},{priority:"highest"})}_enableDeleteIntegration(){let e=this.editor,t=e.editing.view,i=e.model,o=i.schema;this._listenToIfEnabled(t.document,"delete",(n,s)=>{if(n.eventPhase!="atTarget")return;let r=Ai(i.document.selection);if(!r)return;let a=s.direction,l=i.document.selection.getSelectedElement(),c=r==="before",u=a=="forward";if(c===u)e.execute("delete",{selection:i.createSelection(l,"on")});else{let d=o.getNearestSelectionRange(i.createPositionAt(l,r),a);if(d)if(!d.isCollapsed)i.change(h=>{h.setSelection(d),e.execute(u?"deleteForward":"delete")});else{let h=i.createSelection(d.start);if(i.modifySelection(h,{direction:a}),!h.focus.isEqual(d.start))i.change(f=>{f.setSelection(d),e.execute(u?"deleteForward":"delete")});else{let f=ME(o,d.start.parent);i.deleteContent(i.createSelection(f,"on"),{doNotAutoparagraph:!0})}}}s.preventDefault(),n.stop()},{context:z})}_enableInsertContentIntegration(){let e=this.editor,t=this.editor.model,i=t.document.selection;this._listenToIfEnabled(e.model,"insertContent",(o,[n,s])=>{if(s&&!s.is("documentSelection"))return;let r=Ai(i);if(r)return o.stop(),t.change(a=>{let l=i.getSelectedElement(),c=t.createPositionAt(l,r),u=a.createSelection(c),d=t.insertContent(n,u);return a.setSelection(u),d})},{priority:"high"})}_enableInsertObjectIntegration(){let e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"insertObject",(i,o)=>{let[,n,s={}]=o;if(n&&!n.is("documentSelection"))return;let r=Ai(t);r&&(s.findOptimalPosition=r,o[3]=s)},{priority:"high"})}_enableDeleteContentIntegration(){let e=this.editor,t=this.editor.model.document.selection;this._listenToIfEnabled(e.model,"deleteContent",(i,[o])=>{o&&!o.is("documentSelection")||Ai(t)&&i.stop()},{priority:"high"})}};function RE(e,t,i){let o=e.createUIElement("div",{class:"ck ck-reset_all ck-widget__type-around"},function(n){let s=this.toDomElement(n);return VE(s,t),LE(s),s});e.insert(e.createPositionAt(i,"end"),o)}function VE(e,t){for(let i of s2){let o=new vt({tag:"div",attributes:{class:["ck","ck-widget__type-around__button",`ck-widget__type-around__button_${i}`],title:t[i],"aria-hidden":"true"},children:[e.ownerDocument.importNode(SE,!0)]});e.appendChild(o.render())}}function LE(e){let t=new vt({tag:"div",attributes:{class:["ck","ck-widget__type-around__fake-caret"]}});e.appendChild(t.render())}function ME(e,t){let i=t;for(let o of t.getAncestors({parentFirst:!0})){if(o.childCount>1||e.isLimit(o))break;i=o}return i}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function LE(e){let t=e.model;return(i,o)=>{let n=o.keyCode==O.arrowup,s=o.keyCode==O.arrowdown,r=o.shiftKey,a=t.document.selection;if(!n&&!s)return;let l=s,c=ME(e,a,l);if(c){if(c.isCollapsed){if(a.isCollapsed)return;if(r)return}(c.isCollapsed||BE(e,c,l))&&(t.change(u=>{let d=l?c.end:c.start;if(r){let h=t.createSelection(a.anchor);h.setFocus(d),u.setSelection(h)}else u.setSelection(d)}),i.stop(),o.preventDefault(),o.stopPropagation())}}}function ME(e,t,i){let o=e.model;if(i){let n=t.focus,s=Zw(o,n,"forward");if(!s)return;let r=o.createRange(n,s),a=Qw(o.schema,r,"backward");/* v8 ignore else -- @preserve */if(a)return o.createRange(n,a)}else{let n=t.focus,s=Zw(o,n,"backward");if(!s)return;let r=o.createRange(s,n),a=Qw(o.schema,r,"forward");/* v8 ignore else -- @preserve */if(a)return o.createRange(a,n)}}function Zw(e,t,i){let o=e.schema,n=e.createRangeIn(t.root),s=i=="forward"?"elementStart":"elementEnd";for(let{previousPosition:r,item:a,type:l}of n.getWalker({startPosition:t,direction:i})){if(o.isLimit(a)&&!o.isInline(a))return r;if(l==s&&o.isBlock(a))return null}return null}function Qw(e,t,i){let o=i=="backward"?t.end:t.start;if(e.checkChild(o,"$text"))return o;for(let{nextPosition:n}of t.getWalker({direction:i}))if(e.checkChild(n,"$text"))return n}function BE(e,t,i){let o=e.model,n=e.view.domConverter;if(i){let c=o.createSelection(t.start);o.modifySelection(c),!c.focus.isAtEnd&&!t.start.isEqual(c.focus)&&(t=o.createRange(c.focus,t.end))}let s=e.mapper.toViewRange(t),r=n.viewRangeToDom(s),a=F.getDomRangeRects(r),l;for(let c of a){if(l===void 0){l=Math.round(c.bottom);continue}if(Math.round(c.top)>=l)return!1;l=Math.max(l,Math.round(c.bottom))}return!0}/** +*/function BE(e){let t=e.model;return(i,o)=>{let n=o.keyCode==O.arrowup,s=o.keyCode==O.arrowdown,r=o.shiftKey,a=t.document.selection;if(!n&&!s)return;let l=s,c=OE(e,a,l);if(c){if(c.isCollapsed){if(a.isCollapsed)return;if(r)return}(c.isCollapsed||DE(e,c,l))&&(t.change(u=>{let d=l?c.end:c.start;if(r){let h=t.createSelection(a.anchor);h.setFocus(d),u.setSelection(h)}else u.setSelection(d)}),i.stop(),o.preventDefault(),o.stopPropagation())}}}function OE(e,t,i){let o=e.model;if(i){let n=t.focus,s=Yw(o,n,"forward");if(!s)return;let r=o.createRange(n,s),a=Xw(o.schema,r,"backward");/* v8 ignore else -- @preserve */if(a)return o.createRange(n,a)}else{let n=t.focus,s=Yw(o,n,"backward");if(!s)return;let r=o.createRange(s,n),a=Xw(o.schema,r,"forward");/* v8 ignore else -- @preserve */if(a)return o.createRange(a,n)}}function Yw(e,t,i){let o=e.schema,n=e.createRangeIn(t.root),s=i=="forward"?"elementStart":"elementEnd";for(let{previousPosition:r,item:a,type:l}of n.getWalker({startPosition:t,direction:i})){if(o.isLimit(a)&&!o.isInline(a))return r;if(l==s&&o.isBlock(a))return null}return null}function Xw(e,t,i){let o=i=="backward"?t.end:t.start;if(e.checkChild(o,"$text"))return o;for(let{nextPosition:n}of t.getWalker({direction:i}))if(e.checkChild(n,"$text"))return n}function DE(e,t,i){let o=e.model,n=e.view.domConverter;if(i){let c=o.createSelection(t.start);o.modifySelection(c),!c.focus.isAtEnd&&!t.start.isEqual(c.focus)&&(t=o.createRange(c.focus,t.end))}let s=e.mapper.toViewRange(t),r=n.viewRangeToDom(s),a=F.getDomRangeRects(r),l;for(let c of a){if(l===void 0){l=Math.round(c.bottom);continue}if(Math.round(c.top)>=l)return!1;l=Math.max(l,Math.round(c.bottom))}return!0}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Pe=class extends y{_previouslySelected=new Set;static get pluginName(){return"Widget"}static get isOfficialPlugin(){return!0}static get requires(){return[IE,ht]}init(){let e=this.editor,t=e.editing.view,i=t.document,o=e.t;this.editor.editing.downcastDispatcher.on("selection",(n,s,r)=>{let a=r.writer,l=s.selection;if(l.isCollapsed)return;let c=l.getSelectedElement();if(!c)return;let u=e.editing.mapper.toViewElement(c);z(u)&&r.consumable.consume(l,"selection")&&a.setSelection(a.createRangeOn(u),{fake:!0,label:yE(u)})}),this.editor.editing.downcastDispatcher.on("selection",(n,s,r)=>{this._clearPreviouslySelectedWidgets(r.writer);let a=r.writer,l=a.document.selection,c=null;for(let u of l.getRanges())for(let d of u){let h=d.item;z(h)&&!HE(h,c)&&(a.addClass(Gw,h),this._previouslySelected.add(h),c=h)}},{priority:"low"}),t.addObserver(lr),t.addObserver(cl),this.listenTo(i,"mousedown",(...n)=>this._onMousedown(...n)),this.listenTo(i,"pointerdown",(...n)=>this._onPointerdown(...n)),this.listenTo(i,"arrowKey",(...n)=>{this._handleSelectionChangeOnArrowKeyPress(...n)},{context:[z,"$text"]}),this.listenTo(i,"arrowKey",(...n)=>{this._preventDefaultOnArrowKeyPress(...n)},{context:"$root"}),this.listenTo(i,"arrowKey",LE(this.editor.editing),{context:"$text"}),this.listenTo(i,"delete",(n,s)=>{this._handleDelete(s.direction=="forward")&&(s.preventDefault(),n.stop())},{context:"$root"}),this.listenTo(i,"tab",(n,s)=>{this._selectNextEditable(s.shiftKey?"backward":"forward")&&(t.scrollToTheSelection(),s.preventDefault(),n.stop())},{context:n=>z(n)||n.is("editableElement"),priority:"low"}),this.listenTo(i,"keydown",(n,s)=>{s.keystroke==O.esc&&this._selectAncestorWidget()&&(s.preventDefault(),n.stop())},{context:n=>n.is("editableElement"),priority:"low"}),e.accessibility.addKeystrokeInfoGroup({id:"widget",label:o("Keystrokes that can be used when a widget is selected (for example: image, table, etc.)"),keystrokes:[{label:o("Move focus from an editable area back to the parent widget"),keystroke:"Esc"},{label:o("Insert a new paragraph directly after a widget"),keystroke:"Enter"},{label:o("Insert a new paragraph directly before a widget"),keystroke:"Shift+Enter"},{label:o("Move the caret to allow typing directly before a widget"),keystroke:[["arrowup"],["arrowleft"]]},{label:o("Move the caret to allow typing directly after a widget"),keystroke:[["arrowdown"],["arrowright"]]}]})}_onMousedown(e,t){let i=t.target;i&&t.domEvent.detail>=3&&this._selectBlockContent(i)&&t.preventDefault()}_onPointerdown(e,t){if(!t.domEvent.isPrimary||i2(t.domTarget))return;let i=this.editor,o=i.editing.view,n=o.document,s=t.target;if(!s)return;if(!z(s)){let a=FE(s);if(!a)return;if(z(a))s=a;else{let l=NE(i,t);if(l&&z(l))s=l;else return}}(V.isAndroid||V.isiOS)&&t.preventDefault(),n.isFocused||o.focus();let r=i.editing.mapper.toModelElement(s);this._setSelectionOverElement(r)}_selectBlockContent(e){let t=this.editor,i=t.model,o=t.editing.mapper,n=i.schema,s=o.findMappedViewAncestor(this.editor.editing.view.createPositionAt(e,0)),r=WE(o.toModelElement(s),i.schema);return r?(i.change(a=>{let l=n.isLimit(r)?null:UE(a.createPositionAfter(r),n),c=a.createPositionAt(r,0),u=l?a.createPositionAt(l,0):a.createPositionAt(r,"end");a.setSelection(a.createRange(c,u))}),!0):!1}_handleSelectionChangeOnArrowKeyPress(e,t){let i=t.keyCode,o=this.editor.model,n=o.schema,s=o.document.selection,r=s.getSelectedElement(),a=wo(i,this.editor.locale.contentLanguageDirection),l=a=="down"||a=="right",c=a=="up"||a=="down";if(!t.shiftKey&&!s.isCollapsed){if(OE(s,n)){let b=l?s.getLastPosition():s.getFirstPosition(),k=n.getNearestSelectionRange(b,l?"forward":"backward");k&&(o.change(v=>{v.setSelection(k)}),t.preventDefault(),e.stop())}return}let u=DE(o,l),d=o.createSelection(u);if(o.modifySelection(d,{direction:l?"forward":"backward"}),d.isEqual(u))return;d.focus.isTouching(u.focus)&&n.checkChild(d.focus.parent,"$text")&&(l?!d.focus.isAtEnd:!d.focus.isAtStart)&&o.modifySelection(d,{direction:l?"forward":"backward"});let h=l?u.focus.nodeBefore:u.focus.nodeAfter,f=d.focus.nodeBefore,m=d.focus.nodeAfter,g=l?f:m;if(t.shiftKey)(r&&n.isObject(r)||g&&n.isObject(g)||h&&n.isObject(h))&&(o.change(b=>{b.setSelection(d)}),t.preventDefault(),e.stop());else if(g&&n.isObject(g)){if(n.isInline(g)&&c)return;o.change(b=>{b.setSelection(g,"on")}),t.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(e,t){let i=this.editor.model,o=i.schema,n=i.document.selection.getSelectedElement();n&&o.isObject(n)&&(t.preventDefault(),e.stop())}_handleDelete(e){let t=this.editor.model.document.selection;if(!this.editor.model.canEditAt(t)||!t.isCollapsed)return;let i=this._getObjectElementNextToSelection(e);if(i)return this.editor.model.change(o=>{let n=t.anchor.parent;for(;n.isEmpty;){let s=n;n=s.parent,o.remove(s)}this._setSelectionOverElement(i)}),!0}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){let t=this.editor.model,i=t.schema,o=t.document.selection,n=t.createSelection(o);if(t.modifySelection(n,{direction:e?"forward":"backward"}),n.isEqual(o))return null;let s=e?n.focus.nodeBefore:n.focus.nodeAfter;return s&&i.isObject(s)?s:null}_clearPreviouslySelectedWidgets(e){for(let t of this._previouslySelected)e.removeClass(Gw,t);this._previouslySelected.clear()}_selectNextEditable(e){let t=this.editor.editing,i=t.view,o=this.editor.model,n=i.document.selection,s=o.document.selection,r;if(s.rangeCount>1){let l=s.isBackward?s.getFirstRange():s.getLastRange();r=t.mapper.toViewPosition(e=="forward"?l.end:l.start)}else r=e=="forward"?n.getFirstPosition():n.getLastPosition();let a=this._findNextFocusRange(r,e);return a?(o.change(l=>{l.setSelection(a)}),!0):!1}_findNextFocusRange(e,t){let i=this.editor.editing,o=i.view,n=this.editor.model,s=o.document.selection,r=s.editableElement,a=r.getPath(),l=s.getSelectedElement();l&&!z(l)&&(l=null);let c=t=="forward"?o.createRange(e,o.createPositionAt(e.root,"end")):o.createRange(o.createPositionAt(e.root,0),e);for(let{nextPosition:u}of c.getWalker({direction:t})){let d=u.parent;if(z(d)&&d!=l){let h=i.mapper.toModelElement(d);if(!n.schema.isBlock(h))continue;if(ve(a,d.getPath())!="extension")return n.createRangeOn(h)}else if(d.is("editableElement")){if(d==r&&!l)continue;let h=i.mapper.toModelPosition(u),f=n.schema.getNearestSelectionRange(h,t);if(!f)continue;return d==r&&l?f:ve(a,d.getPath())!="extension"?n.createRangeIn(n.schema.getLimitElement(f)):f}}return null}_selectAncestorWidget(){let e=this.editor,t=e.editing.mapper,i=e.editing.view.document.selection.getFirstPosition().parent,o=(i.is("$text")?i.parent:i).findAncestor(z);if(!o)return!1;let n=t.toModelElement(o);return n?(e.model.change(s=>{s.setSelection(n,"on")}),!0):!1}};function OE(e,t){let i=e.getFirstPosition(),o=e.getLastPosition(),n=i.nodeAfter,s=o.nodeBefore;return!!n&&t.isObject(n)||!!s&&t.isObject(s)}function DE(e,t){let i=e.document.selection,o=i.getSelectedElement(),n=Ti(i);return o&&n=="before"?e.createSelection(o,"before"):o&&n=="after"?e.createSelection(o,"after"):e.createSelection(i.getRanges(),{backward:o&&e.schema.isObject(o)?!t:i.isBackward})}function FE(e){let t=e;for(;t;){if(t.is("editableElement")||z(t))return t;t=t.parent}return null}function NE(e,t){let i=e.editing.view,o=Oa(t.domEvent),n;if(o?n=i.domConverter.domRangeToView(o):n=i.createRange(i.createPositionAt(t.target,0)),!n)return null;let s=n.start;if(!s.parent)return null;let r=s.parent;if(s.parent.is("editableElement")||zE(e,s.parent)){/* v8 ignore else -- @preserve */s.isAtEnd&&s.nodeBefore?r=s.nodeBefore:s.isAtStart&&s.nodeAfter&&(r=s.nodeAfter)}return r.is("$text")?r.parent:r}function zE(e,t){if(!t.is("element")||z(t))return!1;let i=e.editing.mapper.toModelElement(t);return!!i&&!e.model.schema.checkChild(i,"$text")}function HE(e,t){return t?Array.from(e.getAncestors()).includes(t):!1}function WE(e,t){for(let i of e.getAncestors({includeSelf:!0,parentFirst:!0})){if(t.checkChild(i,"$text"))return i;if(t.isLimit(i)&&!t.isObject(i))break}return null}function UE(e,t){let i=new Pt({startPosition:e});for(let{item:o}of i){if(t.isLimit(o)||!o.is("element"))return null;if(t.checkChild(o,"$text"))return o}return null}/** +*/var Re=class extends w{_previouslySelected=new Set;static get pluginName(){return"Widget"}static get isOfficialPlugin(){return!0}static get requires(){return[PE,ft]}init(){let e=this.editor,t=e.editing.view,i=t.document,o=e.t;this.editor.editing.downcastDispatcher.on("selection",(n,s,r)=>{let a=r.writer,l=s.selection;if(l.isCollapsed)return;let c=l.getSelectedElement();if(!c)return;let u=e.editing.mapper.toViewElement(c);z(u)&&r.consumable.consume(l,"selection")&&a.setSelection(a.createRangeOn(u),{fake:!0,label:vE(u)})}),this.editor.editing.downcastDispatcher.on("selection",(n,s,r)=>{this._clearPreviouslySelectedWidgets(r.writer);let a=r.writer,l=a.document.selection,c=null;for(let u of l.getRanges())for(let d of u){let h=d.item;z(h)&&!UE(h,c)&&(a.addClass(Zw,h),this._previouslySelected.add(h),c=h)}},{priority:"low"}),t.addObserver(lr),t.addObserver(ul),this.listenTo(i,"mousedown",(...n)=>this._onMousedown(...n)),this.listenTo(i,"pointerdown",(...n)=>this._onPointerdown(...n)),this.listenTo(i,"arrowKey",(...n)=>{this._handleSelectionChangeOnArrowKeyPress(...n)},{context:[z,"$text"]}),this.listenTo(i,"arrowKey",(...n)=>{this._preventDefaultOnArrowKeyPress(...n)},{context:"$root"}),this.listenTo(i,"arrowKey",BE(this.editor.editing),{context:"$text"}),this.listenTo(i,"delete",(n,s)=>{this._handleDelete(s.direction=="forward")&&(s.preventDefault(),n.stop())},{context:"$root"}),this.listenTo(i,"tab",(n,s)=>{this._selectNextEditable(s.shiftKey?"backward":"forward")&&(t.scrollToTheSelection(),s.preventDefault(),n.stop())},{context:n=>z(n)||n.is("editableElement"),priority:"low"}),this.listenTo(i,"keydown",(n,s)=>{s.keystroke==O.esc&&this._selectAncestorWidget()&&(s.preventDefault(),n.stop())},{context:n=>n.is("editableElement"),priority:"low"}),e.accessibility.addKeystrokeInfoGroup({id:"widget",label:o("Keystrokes that can be used when a widget is selected (for example: image, table, etc.)"),keystrokes:[{label:o("Move focus from an editable area back to the parent widget"),keystroke:"Esc"},{label:o("Insert a new paragraph directly after a widget"),keystroke:"Enter"},{label:o("Insert a new paragraph directly before a widget"),keystroke:"Shift+Enter"},{label:o("Move the caret to allow typing directly before a widget"),keystroke:[["arrowup"],["arrowleft"]]},{label:o("Move the caret to allow typing directly after a widget"),keystroke:[["arrowdown"],["arrowright"]]}]})}_onMousedown(e,t){let i=t.target;i&&t.domEvent.detail>=3&&this._selectBlockContent(i)&&t.preventDefault()}_onPointerdown(e,t){if(!t.domEvent.isPrimary||n2(t.domTarget))return;let i=this.editor,o=i.editing.view,n=o.document,s=t.target;if(!s)return;if(!z(s)){let a=zE(s);if(!a)return;if(z(a))s=a;else{let l=HE(i,t);if(l&&z(l))s=l;else return}}(V.isAndroid||V.isiOS)&&t.preventDefault(),n.isFocused||o.focus();let r=i.editing.mapper.toModelElement(s);this._setSelectionOverElement(r)}_selectBlockContent(e){let t=this.editor,i=t.model,o=t.editing.mapper,n=i.schema,s=o.findMappedViewAncestor(this.editor.editing.view.createPositionAt(e,0)),r=qE(o.toModelElement(s),i.schema);return r?(i.change(a=>{let l=n.isLimit(r)?null:$E(a.createPositionAfter(r),n),c=a.createPositionAt(r,0),u=l?a.createPositionAt(l,0):a.createPositionAt(r,"end");a.setSelection(a.createRange(c,u))}),!0):!1}_handleSelectionChangeOnArrowKeyPress(e,t){let i=t.keyCode,o=this.editor.model,n=o.schema,s=o.document.selection,r=s.getSelectedElement(),a=yo(i,this.editor.locale.contentLanguageDirection),l=a=="down"||a=="right",c=a=="up"||a=="down";if(!t.shiftKey&&!s.isCollapsed){if(FE(s,n)){let b=l?s.getLastPosition():s.getFirstPosition(),k=n.getNearestSelectionRange(b,l?"forward":"backward");k&&(o.change(v=>{v.setSelection(k)}),t.preventDefault(),e.stop())}return}let u=NE(o,l),d=o.createSelection(u);if(o.modifySelection(d,{direction:l?"forward":"backward"}),d.isEqual(u))return;d.focus.isTouching(u.focus)&&n.checkChild(d.focus.parent,"$text")&&(l?!d.focus.isAtEnd:!d.focus.isAtStart)&&o.modifySelection(d,{direction:l?"forward":"backward"});let h=l?u.focus.nodeBefore:u.focus.nodeAfter,f=d.focus.nodeBefore,m=d.focus.nodeAfter,g=l?f:m;if(t.shiftKey)(r&&n.isObject(r)||g&&n.isObject(g)||h&&n.isObject(h))&&(o.change(b=>{b.setSelection(d)}),t.preventDefault(),e.stop());else if(g&&n.isObject(g)){if(n.isInline(g)&&c)return;o.change(b=>{b.setSelection(g,"on")}),t.preventDefault(),e.stop()}}_preventDefaultOnArrowKeyPress(e,t){let i=this.editor.model,o=i.schema,n=i.document.selection.getSelectedElement();n&&o.isObject(n)&&(t.preventDefault(),e.stop())}_handleDelete(e){let t=this.editor.model.document.selection;if(!this.editor.model.canEditAt(t)||!t.isCollapsed)return;let i=this._getObjectElementNextToSelection(e);if(i)return this.editor.model.change(o=>{let n=t.anchor.parent;for(;n.isEmpty;){let s=n;n=s.parent,o.remove(s)}this._setSelectionOverElement(i)}),!0}_setSelectionOverElement(e){this.editor.model.change(t=>{t.setSelection(t.createRangeOn(e))})}_getObjectElementNextToSelection(e){let t=this.editor.model,i=t.schema,o=t.document.selection,n=t.createSelection(o);if(t.modifySelection(n,{direction:e?"forward":"backward"}),n.isEqual(o))return null;let s=e?n.focus.nodeBefore:n.focus.nodeAfter;return s&&i.isObject(s)?s:null}_clearPreviouslySelectedWidgets(e){for(let t of this._previouslySelected)e.removeClass(Zw,t);this._previouslySelected.clear()}_selectNextEditable(e){let t=this.editor.editing,i=t.view,o=this.editor.model,n=i.document.selection,s=o.document.selection,r;if(s.rangeCount>1){let l=s.isBackward?s.getFirstRange():s.getLastRange();r=t.mapper.toViewPosition(e=="forward"?l.end:l.start)}else r=e=="forward"?n.getFirstPosition():n.getLastPosition();let a=this._findNextFocusRange(r,e);return a?(o.change(l=>{l.setSelection(a)}),!0):!1}_findNextFocusRange(e,t){let i=this.editor.editing,o=i.view,n=this.editor.model,s=o.document.selection,r=s.editableElement,a=r.getPath(),l=s.getSelectedElement();l&&!z(l)&&(l=null);let c=t=="forward"?o.createRange(e,o.createPositionAt(e.root,"end")):o.createRange(o.createPositionAt(e.root,0),e);for(let{nextPosition:u}of c.getWalker({direction:t})){let d=u.parent;if(z(d)&&d!=l){let h=i.mapper.toModelElement(d);if(!n.schema.isBlock(h))continue;if(Ce(a,d.getPath())!="extension")return n.createRangeOn(h)}else if(d.is("editableElement")){if(d==r&&!l)continue;let h=i.mapper.toModelPosition(u),f=n.schema.getNearestSelectionRange(h,t);if(!f)continue;return d==r&&l?f:Ce(a,d.getPath())!="extension"?n.createRangeIn(n.schema.getLimitElement(f)):f}}return null}_selectAncestorWidget(){let e=this.editor,t=e.editing.mapper,i=e.editing.view.document.selection.getFirstPosition().parent,o=(i.is("$text")?i.parent:i).findAncestor(z);if(!o)return!1;let n=t.toModelElement(o);return n?(e.model.change(s=>{s.setSelection(n,"on")}),!0):!1}};function FE(e,t){let i=e.getFirstPosition(),o=e.getLastPosition(),n=i.nodeAfter,s=o.nodeBefore;return!!n&&t.isObject(n)||!!s&&t.isObject(s)}function NE(e,t){let i=e.document.selection,o=i.getSelectedElement(),n=Ai(i);return o&&n=="before"?e.createSelection(o,"before"):o&&n=="after"?e.createSelection(o,"after"):e.createSelection(i.getRanges(),{backward:o&&e.schema.isObject(o)?!t:i.isBackward})}function zE(e){let t=e;for(;t;){if(t.is("editableElement")||z(t))return t;t=t.parent}return null}function HE(e,t){let i=e.editing.view,o=Da(t.domEvent),n;if(o?n=i.domConverter.domRangeToView(o):n=i.createRange(i.createPositionAt(t.target,0)),!n)return null;let s=n.start;if(!s.parent)return null;let r=s.parent;if(s.parent.is("editableElement")||WE(e,s.parent)){/* v8 ignore else -- @preserve */s.isAtEnd&&s.nodeBefore?r=s.nodeBefore:s.isAtStart&&s.nodeAfter&&(r=s.nodeAfter)}return r.is("$text")?r.parent:r}function WE(e,t){if(!t.is("element")||z(t))return!1;let i=e.editing.mapper.toModelElement(t);return!!i&&!e.model.schema.checkChild(i,"$text")}function UE(e,t){return t?Array.from(e.getAncestors()).includes(t):!1}function qE(e,t){for(let i of e.getAncestors({includeSelf:!0,parentFirst:!0})){if(t.checkChild(i,"$text"))return i;if(t.isLimit(i)&&!t.isObject(i))break}return null}function $E(e,t){let i=new Rt({startPosition:e});for(let{item:o}of i){if(t.isLimit(o)||!o.is("element"))return null;if(t.checkChild(o,"$text"))return o}return null}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var ts=class extends y{_toolbarDefinitions=new Map;_balloon;static get requires(){return[re]}static get pluginName(){return"WidgetToolbarRepository"}static get isOfficialPlugin(){return!0}init(){let e=this.editor;if(e.plugins.has("BalloonToolbar")){let t=e.plugins.get("BalloonToolbar");this.listenTo(t,"show",i=>{qE(e.editing.view.document.selection)&&i.stop()},{priority:"high"})}this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(let e of this._toolbarDefinitions.values())e.view.destroy()}register(e,{ariaLabel:t,items:i,getRelatedElement:o,balloonClassName:n="ck-toolbar-container",positions:s}){if(!i.length){D("widget-toolbar-no-items",{toolbarId:e});return}let r=this.editor,a=r.t,l=new dt(r.locale);if(l.ariaLabel=t||a("Widget toolbar"),this._toolbarDefinitions.has(e))throw new p("widget-toolbar-duplicated",this,{toolbarId:e});let c={view:l,getRelatedElement:o,balloonClassName:n,itemsConfig:i,positions:s,initialized:!1};r.ui.addToolbar(l,{isContextual:!0,beforeFocus:()=>{let u=o(r.editing.view.document.selection);u&&this._showToolbar(c,u)},afterBlur:()=>{this._hideToolbar(c)}}),this._toolbarDefinitions.set(e,c)}_updateToolbarsVisibility(){let e=0,t=null,i=null;for(let o of this._toolbarDefinitions.values()){let n=o.getRelatedElement(this.editor.editing.view.document.selection);if(!this.isEnabled||!n)this._isToolbarInBalloon(o)&&this._hideToolbar(o);else if(!this.editor.ui.focusTracker.isFocused)this._isToolbarVisible(o)&&this._hideToolbar(o);else{let s=n.getAncestors().length;s>e&&(e=s,t=n,i=o)}}i&&this._showToolbar(i,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?Yw(this.editor,t,e.positions):this._isToolbarInBalloon(e)||(e.initialized||(e.initialized=!0,e.view.fillFromConfig(e.itemsConfig,this.editor.ui.componentFactory)),this._balloon.add({view:e.view,position:n2(this.editor,t,e.positions),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(let i of this._toolbarDefinitions.values())if(this._isToolbarVisible(i)){let o=i.getRelatedElement(this.editor.editing.view.document.selection);Yw(this.editor,o,e.positions)}}))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}};function Yw(e,t,i){let o=e.plugins.get("ContextualBalloon"),n=n2(e,t,i);o.updatePosition(n)}function n2(e,t,i){let o=e.editing.view,n=Me.defaultPositions;return{target:o.domConverter.mapViewToDom(t),positions:i||[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,n.viewportStickyNorth]}}function qE(e){let t=e.getSelectedElement();return!!(t&&z(t))}/** +*/var ts=class extends w{_toolbarDefinitions=new Map;_balloon;static get requires(){return[re]}static get pluginName(){return"WidgetToolbarRepository"}static get isOfficialPlugin(){return!0}init(){let e=this.editor;if(e.plugins.has("BalloonToolbar")){let t=e.plugins.get("BalloonToolbar");this.listenTo(t,"show",i=>{jE(e.editing.view.document.selection)&&i.stop()},{priority:"high"})}this._balloon=this.editor.plugins.get("ContextualBalloon"),this.on("change:isEnabled",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui,"update",()=>{this._updateToolbarsVisibility()}),this.listenTo(e.ui.focusTracker,"change:isFocused",()=>{this._updateToolbarsVisibility()},{priority:"low"})}destroy(){super.destroy();for(let e of this._toolbarDefinitions.values())e.view.destroy()}register(e,{ariaLabel:t,items:i,getRelatedElement:o,balloonClassName:n="ck-toolbar-container",positions:s}){if(!i.length){D("widget-toolbar-no-items",{toolbarId:e});return}let r=this.editor,a=r.t,l=new dt(r.locale);if(l.ariaLabel=t||a("Widget toolbar"),this._toolbarDefinitions.has(e))throw new p("widget-toolbar-duplicated",this,{toolbarId:e});let c={view:l,getRelatedElement:o,balloonClassName:n,itemsConfig:i,positions:s,initialized:!1};r.ui.addToolbar(l,{isContextual:!0,beforeFocus:()=>{let u=o(r.editing.view.document.selection);u&&this._showToolbar(c,u)},afterBlur:()=>{this._hideToolbar(c)}}),this._toolbarDefinitions.set(e,c)}_updateToolbarsVisibility(){let e=0,t=null,i=null;for(let o of this._toolbarDefinitions.values()){let n=o.getRelatedElement(this.editor.editing.view.document.selection);if(!this.isEnabled||!n)this._isToolbarInBalloon(o)&&this._hideToolbar(o);else if(!this.editor.ui.focusTracker.isFocused)this._isToolbarVisible(o)&&this._hideToolbar(o);else{let s=n.getAncestors().length;s>e&&(e=s,t=n,i=o)}}i&&this._showToolbar(i,t)}_hideToolbar(e){this._balloon.remove(e.view),this.stopListening(this._balloon,"change:visibleView")}_showToolbar(e,t){this._isToolbarVisible(e)?e2(this.editor,t,e.positions):this._isToolbarInBalloon(e)||(e.initialized||(e.initialized=!0,e.view.fillFromConfig(e.itemsConfig,this.editor.ui.componentFactory)),this._balloon.add({view:e.view,position:r2(this.editor,t,e.positions),balloonClassName:e.balloonClassName}),this.listenTo(this._balloon,"change:visibleView",()=>{for(let i of this._toolbarDefinitions.values())if(this._isToolbarVisible(i)){let o=i.getRelatedElement(this.editor.editing.view.document.selection);e2(this.editor,o,e.positions)}}))}_isToolbarVisible(e){return this._balloon.visibleView===e.view}_isToolbarInBalloon(e){return this._balloon.hasView(e.view)}};function e2(e,t,i){let o=e.plugins.get("ContextualBalloon"),n=r2(e,t,i);o.updatePosition(n)}function r2(e,t,i){let o=e.editing.view,n=Me.defaultPositions;return{target:o.domConverter.mapViewToDom(t),positions:i||[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast,n.viewportStickyNorth]}}function jE(e){let t=e.getSelectedElement();return!!(t&&z(t))}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var $E=W(),jE=class extends $E{_referenceCoordinates;_options;_originalWidth;_originalHeight;_originalWidthPercents;_aspectRatio;constructor(e){super(),this.set("activeHandlePosition",null),this.set("proposedWidthPercents",null),this.set("proposedWidth",null),this.set("proposedHeight",null),this.set("proposedHandleHostWidth",null),this.set("proposedHandleHostHeight",null),this._options=e,this._referenceCoordinates=null}get originalWidth(){return this._originalWidth}get originalHeight(){return this._originalHeight}get originalWidthPercents(){return this._originalWidthPercents}get aspectRatio(){return this._aspectRatio}begin(e,t,i){let o=new F(t);this.activeHandlePosition=JE(e),this._referenceCoordinates=KE(t,ZE(this.activeHandlePosition)),this._originalWidth=o.width,this._originalHeight=o.height,this._aspectRatio=o.width/o.height;let n=i.style.width;n&&n.match(/^\d+(\.\d*)?%$/)?this._originalWidthPercents=parseFloat(n):this._originalWidthPercents=kE(i,o)}update(e){this.proposedWidth=e.width,this.proposedHeight=e.height,this.proposedWidthPercents=e.widthPercents,this.proposedHandleHostWidth=e.handleHostWidth,this.proposedHandleHostHeight=e.handleHostHeight}};function KE(e,t){let i=new F(e),o=t.split("-"),n={x:o[1]=="right"?i.right:i.left,y:o[0]=="bottom"?i.bottom:i.top};return n.x+=e.ownerDocument.defaultView.scrollX,n.y+=e.ownerDocument.defaultView.scrollY,n}function GE(e){return`ck-widget__resizer__handle-${e}`}function JE(e){for(let t of["top-left","top-right","bottom-right","bottom-left"])if(e.classList.contains(GE(t)))return t}function ZE(e){let t=e.split("-"),i={top:"bottom",bottom:"top",left:"right",right:"left"};return`${i[t[0]]}-${i[t[1]]}`}/** +*/var KE=W(),GE=class extends KE{_referenceCoordinates;_options;_originalWidth;_originalHeight;_originalWidthPercents;_aspectRatio;constructor(e){super(),this.set("activeHandlePosition",null),this.set("proposedWidthPercents",null),this.set("proposedWidth",null),this.set("proposedHeight",null),this.set("proposedHandleHostWidth",null),this.set("proposedHandleHostHeight",null),this._options=e,this._referenceCoordinates=null}get originalWidth(){return this._originalWidth}get originalHeight(){return this._originalHeight}get originalWidthPercents(){return this._originalWidthPercents}get aspectRatio(){return this._aspectRatio}begin(e,t,i){let o=new F(t);this.activeHandlePosition=QE(e),this._referenceCoordinates=JE(t,YE(this.activeHandlePosition)),this._originalWidth=o.width,this._originalHeight=o.height,this._aspectRatio=o.width/o.height;let n=i.style.width;n&&n.match(/^\d+(\.\d*)?%$/)?this._originalWidthPercents=parseFloat(n):this._originalWidthPercents=xE(i,o)}update(e){this.proposedWidth=e.width,this.proposedHeight=e.height,this.proposedWidthPercents=e.widthPercents,this.proposedHandleHostWidth=e.handleHostWidth,this.proposedHandleHostHeight=e.handleHostHeight}};function JE(e,t){let i=new F(e),o=t.split("-"),n={x:o[1]=="right"?i.right:i.left,y:o[0]=="bottom"?i.bottom:i.top};return n.x+=e.ownerDocument.defaultView.scrollX,n.y+=e.ownerDocument.defaultView.scrollY,n}function ZE(e){return`ck-widget__resizer__handle-${e}`}function QE(e){for(let t of["top-left","top-right","bottom-right","bottom-left"])if(e.classList.contains(ZE(t)))return t}function YE(e){let t=e.split("-"),i={top:"bottom",bottom:"top",left:"right",right:"left"};return`${i[t[0]]}-${i[t[1]]}`}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var QE=class extends R{constructor(){super();let e=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",e.to("_viewPosition",t=>t?`ck-orientation-${t}`:"")],style:{display:e.if("_isVisible","none",t=>!t)}},children:[{text:e.to("_label")}]})}_bindToState(e,t){this.bind("_isVisible").to(t,"proposedWidth",t,"proposedHeight",(i,o)=>i!==null&&o!==null),this.bind("_label").to(t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",t,"proposedWidthPercents",(i,o,n)=>e.unit==="px"?`${i}\xD7${o}`:`${n}%`),this.bind("_viewPosition").to(t,"activeHandlePosition",t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",(i,o,n)=>o<50||n<50?"above-center":i)}_dismiss(){this.unbind(),this._isVisible=!1}};/** +*/var XE=class extends R{constructor(){super();let e=this.bindTemplate;this.setTemplate({tag:"div",attributes:{class:["ck","ck-size-view",e.to("_viewPosition",t=>t?`ck-orientation-${t}`:"")],style:{display:e.if("_isVisible","none",t=>!t)}},children:[{text:e.to("_label")}]})}_bindToState(e,t){this.bind("_isVisible").to(t,"proposedWidth",t,"proposedHeight",(i,o)=>i!==null&&o!==null),this.bind("_label").to(t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",t,"proposedWidthPercents",(i,o,n)=>e.unit==="px"?`${i}\xD7${o}`:`${n}%`),this.bind("_viewPosition").to(t,"activeHandlePosition",t,"proposedHandleHostWidth",t,"proposedHandleHostHeight",(i,o,n)=>o<50||n<50?"above-center":i)}_dismiss(){this.unbind(),this._isVisible=!1}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var YE=W(),Xw=class extends YE{_state;_sizeView;_options;_viewResizerWrapper=null;_initialViewWidth;constructor(e){super(),this._options=e,this.set("isEnabled",!0),this.set("isSelected",!1),this.bind("isVisible").to(this,"isEnabled",this,"isSelected",(t,i)=>t&&i),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",t=>{!this.state.proposedWidth&&!this.state.proposedWidthPercents&&(this._cleanup(),t.stop())},{priority:"high"})}get state(){return this._state}show(){this._options.editor.editing.view.change(e=>{e.removeClass("ck-hidden",this._viewResizerWrapper)})}hide(){this._options.editor.editing.view.change(e=>{e.addClass("ck-hidden",this._viewResizerWrapper)})}attach(){let e=this,t=this._options.viewElement;this._options.editor.editing.view.change(i=>{let o=i.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},function(n){let s=this.toDomElement(n);return e._appendHandles(s),e._appendSizeUI(s),s});i.insert(i.createPositionAt(t,"end"),o),i.addClass("ck-widget_with-resizer",t),this._viewResizerWrapper=o,this.isVisible||this.hide()}),this.on("change:isVisible",()=>{this.isVisible?(this.show(),this.redraw()):this.hide()})}begin(e){this._state=new jE(this._options),this._sizeView._bindToState(this._options,this.state),this._initialViewWidth=this._options.viewElement.getStyle("width"),this.state.begin(e,this._getHandleHost(),this._getResizeHost())}updateSize(e){let t=this._proposeNewSize(e);this._options.editor.editing.view.change(a=>{let l=this._options.unit||"%",c=(l==="%"?t.widthPercents:t.width)+l;a.setStyle("width",c,this._options.viewElement)});let i=this._getHandleHost(),o=new F(i),n=Math.round(o.width),s=Math.round(o.height),r=new F(i);t.width=Math.round(r.width),t.height=Math.round(r.height),this.redraw(o),this.state.update({...t,handleHostWidth:n,handleHostHeight:s})}commit(){let e=this._options.unit||"%",t=(e==="%"?this.state.proposedWidthPercents:this.state.proposedWidth)+e;this._options.editor.editing.view.change(()=>{this._cleanup(),this._options.onCommit(t)})}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(e){let t=this._domResizerWrapper;if(!t?.isConnected)return;let i=Fe(t),o=this._getHandleHost(),n=this._viewResizerWrapper,s=[n.getStyle("width"),n.getStyle("height"),n.getStyle("left"),n.getStyle("top")],r;if(i.isSameNode(o)){let a=e||new F(o);r=[a.width+"px",a.height+"px",void 0,void 0]}else r=[o.offsetWidth+"px",o.offsetHeight+"px",o.offsetLeft+"px",o.offsetTop+"px"];ve(s,r)!=="same"&&this._options.editor.editing.view.change(a=>{a.setStyle({width:r[0],height:r[1],left:r[2],top:r[3]},n)})}containsHandle(e){return rt(this._domResizerWrapper,e)}static isResizeHandle(e){return e.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeView._dismiss(),this._options.editor.editing.view.change(e=>{e.setStyle("width",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(e){let t=this.state,i=eA(e),o=this._options.isCentered?this._options.isCentered(this):!0,n={x:t._referenceCoordinates.x-(i.x+t.originalWidth),y:i.y-t.originalHeight-t._referenceCoordinates.y};o&&t.activeHandlePosition.endsWith("-right")&&(n.x=i.x-(t._referenceCoordinates.x+t.originalWidth)),o&&(n.x*=2);let s=Math.abs(t.originalWidth+n.x),r=Math.abs(t.originalHeight+n.y);return(s/t.aspectRatio>r?"width":"height")=="width"?r=s/t.aspectRatio:s=r*t.aspectRatio,{width:Math.round(s),height:Math.round(r),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*s*100)/100,100)}}_getResizeHost(){let e=Fe(this._domResizerWrapper);return this._options.getResizeHost(e)}_getHandleHost(){let e=Fe(this._domResizerWrapper);return this._options.getHandleHost(e)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(e){for(let t of["top-left","top-right","bottom-right","bottom-left"])e.appendChild(new _t({tag:"div",attributes:{class:`ck-widget__resizer__handle ${XE(t)}`}}).render())}_appendSizeUI(e){this._sizeView=new QE,this._sizeView.render(),e.appendChild(this._sizeView.element)}};function XE(e){return`ck-widget__resizer__handle-${e}`}function eA(e){return{x:e.pageX,y:e.pageY}}/** +*/var eA=W(),t2=class extends eA{_state;_sizeView;_options;_viewResizerWrapper=null;_initialViewWidth;constructor(e){super(),this._options=e,this.set("isEnabled",!0),this.set("isSelected",!1),this.bind("isVisible").to(this,"isEnabled",this,"isSelected",(t,i)=>t&&i),this.decorate("begin"),this.decorate("cancel"),this.decorate("commit"),this.decorate("updateSize"),this.on("commit",t=>{!this.state.proposedWidth&&!this.state.proposedWidthPercents&&(this._cleanup(),t.stop())},{priority:"high"})}get state(){return this._state}show(){this._options.editor.editing.view.change(e=>{e.removeClass("ck-hidden",this._viewResizerWrapper)})}hide(){this._options.editor.editing.view.change(e=>{e.addClass("ck-hidden",this._viewResizerWrapper)})}attach(){let e=this,t=this._options.viewElement;this._options.editor.editing.view.change(i=>{let o=i.createUIElement("div",{class:"ck ck-reset_all ck-widget__resizer"},function(n){let s=this.toDomElement(n);return e._appendHandles(s),e._appendSizeUI(s),s});i.insert(i.createPositionAt(t,"end"),o),i.addClass("ck-widget_with-resizer",t),this._viewResizerWrapper=o,this.isVisible||this.hide()}),this.on("change:isVisible",()=>{this.isVisible?(this.show(),this.redraw()):this.hide()})}begin(e){this._state=new GE(this._options),this._sizeView._bindToState(this._options,this.state),this._initialViewWidth=this._options.viewElement.getStyle("width"),this.state.begin(e,this._getHandleHost(),this._getResizeHost())}updateSize(e){let t=this._proposeNewSize(e);this._options.editor.editing.view.change(a=>{let l=this._options.unit||"%",c=(l==="%"?t.widthPercents:t.width)+l;a.setStyle("width",c,this._options.viewElement)});let i=this._getHandleHost(),o=new F(i),n=Math.round(o.width),s=Math.round(o.height),r=new F(i);t.width=Math.round(r.width),t.height=Math.round(r.height),this.redraw(o),this.state.update({...t,handleHostWidth:n,handleHostHeight:s})}commit(){let e=this._options.unit||"%",t=(e==="%"?this.state.proposedWidthPercents:this.state.proposedWidth)+e;this._options.editor.editing.view.change(()=>{this._cleanup(),this._options.onCommit(t)})}cancel(){this._cleanup()}destroy(){this.cancel()}redraw(e){let t=this._domResizerWrapper;if(!t?.isConnected)return;let i=Fe(t),o=this._getHandleHost(),n=this._viewResizerWrapper,s=[n.getStyle("width"),n.getStyle("height"),n.getStyle("left"),n.getStyle("top")],r;if(i.isSameNode(o)){let a=e||new F(o);r=[a.width+"px",a.height+"px",void 0,void 0]}else r=[o.offsetWidth+"px",o.offsetHeight+"px",o.offsetLeft+"px",o.offsetTop+"px"];Ce(s,r)!=="same"&&this._options.editor.editing.view.change(a=>{a.setStyle({width:r[0],height:r[1],left:r[2],top:r[3]},n)})}containsHandle(e){return rt(this._domResizerWrapper,e)}static isResizeHandle(e){return e.classList.contains("ck-widget__resizer__handle")}_cleanup(){this._sizeView._dismiss(),this._options.editor.editing.view.change(e=>{e.setStyle("width",this._initialViewWidth,this._options.viewElement)})}_proposeNewSize(e){let t=this.state,i=iA(e),o=this._options.isCentered?this._options.isCentered(this):!0,n={x:t._referenceCoordinates.x-(i.x+t.originalWidth),y:i.y-t.originalHeight-t._referenceCoordinates.y};o&&t.activeHandlePosition.endsWith("-right")&&(n.x=i.x-(t._referenceCoordinates.x+t.originalWidth)),o&&(n.x*=2);let s=Math.abs(t.originalWidth+n.x),r=Math.abs(t.originalHeight+n.y);return(s/t.aspectRatio>r?"width":"height")=="width"?r=s/t.aspectRatio:s=r*t.aspectRatio,{width:Math.round(s),height:Math.round(r),widthPercents:Math.min(Math.round(t.originalWidthPercents/t.originalWidth*s*100)/100,100)}}_getResizeHost(){let e=Fe(this._domResizerWrapper);return this._options.getResizeHost(e)}_getHandleHost(){let e=Fe(this._domResizerWrapper);return this._options.getHandleHost(e)}get _domResizerWrapper(){return this._options.editor.editing.view.domConverter.mapViewToDom(this._viewResizerWrapper)}_appendHandles(e){for(let t of["top-left","top-right","bottom-right","bottom-left"])e.appendChild(new vt({tag:"div",attributes:{class:`ck-widget__resizer__handle ${tA(t)}`}}).render())}_appendSizeUI(e){this._sizeView=new XE,this._sizeView.render(),e.appendChild(this._sizeView.element)}};function tA(e){return`ck-widget__resizer__handle-${e}`}function iA(e){return{x:e.pageX,y:e.pageY}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var is=class extends y{_resizers=new Map;_observer;_redrawSelectedResizerThrottled;static get pluginName(){return"WidgetResize"}static get isOfficialPlugin(){return!0}init(){let e=this.editor.editing,t=S.window.document;this.set("selectedResizer",null),this.set("_activeResizer",null),e.view.addObserver(lr),this._observer=new(pe()),this.listenTo(e.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(t,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(t,"mouseup",this._mouseUpListener.bind(this)),this._redrawSelectedResizerThrottled=ai(()=>this.redrawSelectedResizer(),200),this.editor.ui.on("update",this._redrawSelectedResizerThrottled),this.editor.model.document.on("change",()=>{for(let[o,n]of this._resizers)o.isAttached()||(this._resizers.delete(o),n.destroy())},{priority:"lowest"}),this._observer.listenTo(S.window,"resize",this._redrawSelectedResizerThrottled);let i=this.editor.editing.view.document.selection;i.on("change",()=>{let o=i.getSelectedElement(),n=this.getResizerByViewElement(o)||null;n?this.select(n):this.deselect()})}redrawSelectedResizer(){this.selectedResizer&&this.selectedResizer.isVisible&&this.selectedResizer.redraw()}destroy(){super.destroy(),this._observer.stopListening();for(let e of this._resizers.values())e.destroy();this._redrawSelectedResizerThrottled.cancel()}select(e){this.deselect(),this.selectedResizer=e,this.selectedResizer.isSelected=!0}deselect(){this.selectedResizer&&(this.selectedResizer.isSelected=!1),this.selectedResizer=null}attachTo(e){let t=new Xw(e),i=this.editor.plugins;if(t.attach(),i.has("WidgetToolbarRepository")){let n=i.get("WidgetToolbarRepository");t.on("begin",()=>{n.forceDisabled("resize")},{priority:"lowest"}),t.on("cancel",()=>{n.clearForceDisabled("resize")},{priority:"highest"}),t.on("commit",()=>{n.clearForceDisabled("resize")},{priority:"highest"})}this._resizers.set(e.viewElement,t);let o=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(o)==t&&this.select(t),t}getResizerByViewElement(e){return this._resizers.get(e)}_getResizerByHandle(e){for(let t of this._resizers.values())if(t.containsHandle(e))return t}_mouseDownListener(e,t){let i=t.domTarget;Xw.isResizeHandle(i)&&(this._activeResizer=this._getResizerByHandle(i)||null,this._activeResizer&&(this._activeResizer.begin(i),e.stop(),t.preventDefault()))}_mouseMoveListener(e,t){this._activeResizer&&this._activeResizer.updateSize(t)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}};/** +*/var is=class extends w{_resizers=new Map;_observer;_redrawSelectedResizerThrottled;static get pluginName(){return"WidgetResize"}static get isOfficialPlugin(){return!0}init(){let e=this.editor.editing,t=S.window.document;this.set("selectedResizer",null),this.set("_activeResizer",null),e.view.addObserver(lr),this._observer=new(be()),this.listenTo(e.view.document,"mousedown",this._mouseDownListener.bind(this),{priority:"high"}),this._observer.listenTo(t,"mousemove",this._mouseMoveListener.bind(this)),this._observer.listenTo(t,"mouseup",this._mouseUpListener.bind(this)),this._redrawSelectedResizerThrottled=ci(()=>this.redrawSelectedResizer(),200),this.editor.ui.on("update",this._redrawSelectedResizerThrottled),this.editor.model.document.on("change",()=>{for(let[o,n]of this._resizers)o.isAttached()||(this._resizers.delete(o),n.destroy())},{priority:"lowest"}),this._observer.listenTo(S.window,"resize",this._redrawSelectedResizerThrottled);let i=this.editor.editing.view.document.selection;i.on("change",()=>{let o=i.getSelectedElement(),n=this.getResizerByViewElement(o)||null;n?this.select(n):this.deselect()})}redrawSelectedResizer(){this.selectedResizer&&this.selectedResizer.isVisible&&this.selectedResizer.redraw()}destroy(){super.destroy(),this._observer.stopListening();for(let e of this._resizers.values())e.destroy();this._redrawSelectedResizerThrottled.cancel()}select(e){this.deselect(),this.selectedResizer=e,this.selectedResizer.isSelected=!0}deselect(){this.selectedResizer&&(this.selectedResizer.isSelected=!1),this.selectedResizer=null}attachTo(e){let t=new t2(e),i=this.editor.plugins;if(t.attach(),i.has("WidgetToolbarRepository")){let n=i.get("WidgetToolbarRepository");t.on("begin",()=>{n.forceDisabled("resize")},{priority:"lowest"}),t.on("cancel",()=>{n.clearForceDisabled("resize")},{priority:"highest"}),t.on("commit",()=>{n.clearForceDisabled("resize")},{priority:"highest"})}this._resizers.set(e.viewElement,t);let o=this.editor.editing.view.document.selection.getSelectedElement();return this.getResizerByViewElement(o)==t&&this.select(t),t}getResizerByViewElement(e){return this._resizers.get(e)}_getResizerByHandle(e){for(let t of this._resizers.values())if(t.containsHandle(e))return t}_mouseDownListener(e,t){let i=t.domTarget;t2.isResizeHandle(i)&&(this._activeResizer=this._getResizerByHandle(i)||null,this._activeResizer&&(this._activeResizer.begin(i),e.stop(),t.preventDefault()))}_mouseMoveListener(e,t){this._activeResizer&&this._activeResizer.updateSize(t)}_mouseUpListener(){this._activeResizer&&(this._activeResizer.commit(),this._activeResizer=null)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Cr=class e extends y{static get pluginName(){return"OPMacroToc"}static get buttonName(){return"insertToc"}init(){let t=this.editor,i=t.model,o=t.conversion;i.schema.register("op-macro-toc",{allowWhere:"$block",isBlock:!0,isLimit:!0}),o.for("upcast").elementToElement({view:{name:"macro",classes:"toc"},model:"op-macro-toc"}),o.for("editingDowncast").elementToElement({model:"op-macro-toc",view:(n,{writer:s})=>me(this.createTocViewElement(s),s,{label:this.label})}),o.for("dataDowncast").elementToElement({model:"op-macro-toc",view:(n,{writer:s})=>this.createTocDataElement(s)}),t.ui.componentFactory.add(e.buttonName,n=>{let s=new I(n);return s.set({label:this.label,withText:!0}),s.on("execute",()=>{t.model.change(r=>{let a=r.createElement("op-macro-toc",{});t.model.insertContent(a,t.model.document.selection)})}),s})}get label(){return window.I18n.t("js.editor.macro.toc")}createTocViewElement(t){let i=t.createText(this.label),o=t.createContainerElement("div");return t.insert(t.createPositionAt(o,0),i),o}createTocDataElement(t){return t.createContainerElement("macro",{class:"toc"})}};var s2=Symbol("isOPEmbeddedTable");function r2(e,t,i){return t.setCustomProperty(s2,!0,e),me(e,t,{label:"your label here"})}function tA(e){return!!e.getCustomProperty(s2)&&z(e)}function a2(e){let t=e.getSelectedElement();return!!(t&&tA(t))}function Ji(e){return e.config?._config?.openProject?.context?.resource}function l2(e){return e.config?._config?.openProject?.context?.field}function Re(e){return e.config?._config?.openProject?.pluginContext}function Ct(e,t){return Re(e).services[t]}function Xt(e){return Ct(e,"pathHelperService")}function Ch(e){return Ct(e,"i18n")}var os=class e extends y{static get pluginName(){return"EmbeddedTableEditing"}static get buttonName(){return"insertEmbeddedTable"}init(){let t=this.editor,i=t.model,o=t.conversion,n=Re(t);this.text={button:window.I18n.t("js.editor.macro.embedded_table.button"),macro_text:window.I18n.t("js.editor.macro.embedded_table.text")},i.schema.register("op-macro-embedded-table",{allowWhere:"$block",allowAttributes:["opEmbeddedTableQuery"],isBlock:!0,isObject:!0}),o.for("upcast").elementToElement({view:{name:"macro",classes:"embedded-table"},model:(s,{writer:r})=>{let a=s.getAttribute("data-query-props");return r.createElement("op-macro-embedded-table",{opEmbeddedTableQuery:a?JSON.parse(a):{}})}}),o.for("editingDowncast").elementToElement({model:"op-macro-embedded-table",view:(s,{writer:r})=>r2(this.createEmbeddedTableView(r),r,{label:this.label})}),o.for("dataDowncast").elementToElement({model:"op-macro-embedded-table",view:(s,{writer:r})=>this.createEmbeddedTableDataElement(s,r)}),t.ui.componentFactory.add(e.buttonName,s=>{let r=new I(s);return r.set({label:this.text.button,withText:!0}),r.on("execute",()=>n.runInZone(()=>{let a=n.services.externalQueryConfiguration,l={};a.show({currentQuery:l,callback:c=>t.model.change(u=>{let d=u.createElement("op-macro-embedded-table",{opEmbeddedTableQuery:c});t.model.insertContent(d,t.model.document.selection)})})})),r})}createEmbeddedTableView(t){let i=t.createText(this.text.macro_text),o=t.createContainerElement("div");return t.insert(t.createPositionAt(o,0),i),o}createEmbeddedTableDataElement(t,i){let o=t.getAttribute("opEmbeddedTableQuery")||{};return i.createContainerElement("macro",{class:"embedded-table","data-query-props":JSON.stringify(o)})}};var c2=` -`;function Zi(e,t,i){e.ui.componentFactory.add(t,o=>{let n=new I(o);return n.set({label:I18n.t("js.button_edit"),icon:c2,tooltip:!0}),n.on("execute",()=>{let s=e.model.document.selection.getSelectedElement();s&&i(s)}),n})}var oA="ck-toolbar-container";function Qi(e,t,i,o){let n=t.config.get(i+".toolbar");if(!n||!n.length)return;let s=t.plugins.get("ContextualBalloon"),r=new dt(t.locale);function a(){t.ui.focusTracker.isFocused&&o(t.editing.view.document.selection)?l():c()}function l(){u()?nA(t,o):s.hasView(r)||s.add({view:r,position:u2(t),balloonClassName:oA})}function c(){u()&&s.remove(r)}function u(){return s.visibleView==r}r.fillFromConfig(n,t.ui.componentFactory),e.listenTo(t.editing.view,"render",a),e.listenTo(t.ui.focusTracker,"change:isFocused",a,{priority:"low"})}function nA(e,t){let i=e.plugins.get("ContextualBalloon");if(t(e.editing.view.document.selection)){let o=u2(e);i.updatePosition(o)}}function u2(e){let t=e.editing.view,i=Me.defaultPositions;return{target:t.domConverter.viewToDom(t.document.selection.getSelectedElement()),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast]}}var xr=class extends y{static get requires(){return[re]}static get pluginName(){return"EmbeddedTableToolbar"}init(){let t=this.editor,i=this.editor.model,o=Re(t);Zi(t,"opEditEmbeddedTableQuery",n=>{let s=o.services.externalQueryConfiguration,r=n.getAttribute("opEmbeddedTableQuery")||{};o.runInZone(()=>{s.show({currentQuery:r,callback:a=>i.change(l=>{l.setAttribute("opEmbeddedTableQuery",a,n)})})})})}afterInit(){Qi(this,this.editor,"OPMacroEmbeddedTable",a2)}};var Tr=class extends y{static get requires(){return[os,Pe,xr]}static get pluginName(){return"OPMacroEmbeddedTable"}static get buttonName(){return os.buttonName}};var d2=Symbol("isWpButtonMacroSymbol");function h2(e,t,i){return t.setCustomProperty(d2,!0,e),me(e,t,{label:i})}function sA(e){return!!e.getCustomProperty(d2)&&z(e)}function f2(e){let t=e.getSelectedElement();return!!(t&&sA(t))}var ns=class e extends y{static get pluginName(){return"OPMacroWpButtonEditing"}static get buttonName(){return"insertWorkPackageButton"}init(){let t=this.editor,i=t.model,o=t.conversion,n=Re(t);i.schema.register("op-macro-wp-button",{allowWhere:["$block"],allowAttributes:["type","classes"],isBlock:!0,isLimit:!0}),o.for("upcast").elementToElement({view:{name:"macro",classes:"create_work_package_link"},model:(s,{writer:r})=>{let a=s.getAttribute("data-type")||"",l=s.getAttribute("data-classes")||"";return r.createElement("op-macro-wp-button",{type:a,classes:l})}}),o.for("editingDowncast").elementToElement({model:"op-macro-wp-button",view:(s,{writer:r})=>this.createMacroViewElement(s,r)}),o.for("dataDowncast").elementToElement({model:"op-macro-wp-button",view:(s,{writer:r})=>r.createContainerElement("macro",{class:"create_work_package_link","data-type":s.getAttribute("type")||"","data-classes":s.getAttribute("classes")||""})}),t.ui.componentFactory.add(e.buttonName,s=>{let r=new I(s);return r.set({label:window.I18n.t("js.editor.macro.work_package_button.button"),withText:!0}),r.on("execute",()=>{n.services.macros.configureWorkPackageButton().then(l=>t.model.change(c=>{let u=c.createElement("op-macro-wp-button",{});c.setAttribute("type",l.type,u),c.setAttribute("classes",l.classes,u),t.model.insertContent(u,t.model.document.selection)}))}),r})}macroLabel(t){return t?window.I18n.t("js.editor.macro.work_package_button.with_type",{typename:t}):window.I18n.t("js.editor.macro.work_package_button.without_type")}createMacroViewElement(t,i){let o=t.getAttribute("classes")||"",n=this.macroLabel(),s=i.createText(n),r=i.createContainerElement("span",{class:o});return i.insert(i.createPositionAt(r,0),s),h2(r,i,{label:n})}};var Er=class extends y{static get requires(){return[re]}static get pluginName(){return"OPMacroWpButtonToolbar"}init(){let t=this.editor,i=Re(t);Zi(t,"opEditWpMacroButton",o=>{let n=i.services.macros,s=o.getAttribute("type"),r=o.getAttribute("classes");n.configureWorkPackageButton(s,r).then(a=>t.model.change(l=>{l.setAttribute("classes",a.classes,o),l.setAttribute("type",a.type,o)}))})}afterInit(){Qi(this,this.editor,"OPMacroWpButton",f2)}};var Ar=class extends y{static get requires(){return[ns,Pe,Er]}static get pluginName(){return"OPMacroWpButton"}static get buttonName(){return ns.buttonName}};/** +*/var Cr=class e extends w{static get pluginName(){return"OPMacroToc"}static get buttonName(){return"insertToc"}init(){let t=this.editor,i=t.model,o=t.conversion;i.schema.register("op-macro-toc",{allowWhere:"$block",isBlock:!0,isLimit:!0}),o.for("upcast").elementToElement({view:{name:"macro",classes:"toc"},model:"op-macro-toc"}),o.for("editingDowncast").elementToElement({model:"op-macro-toc",view:(n,{writer:s})=>me(this.createTocViewElement(s),s,{label:this.label})}),o.for("dataDowncast").elementToElement({model:"op-macro-toc",view:(n,{writer:s})=>this.createTocDataElement(s)}),t.ui.componentFactory.add(e.buttonName,n=>{let s=new I(n);return s.set({label:this.label,withText:!0}),s.on("execute",()=>{t.model.change(r=>{let a=r.createElement("op-macro-toc",{});t.model.insertContent(a,t.model.document.selection)})}),s})}get label(){return window.I18n.t("js.editor.macro.toc")}createTocViewElement(t){let i=t.createText(this.label),o=t.createContainerElement("div");return t.insert(t.createPositionAt(o,0),i),o}createTocDataElement(t){return t.createContainerElement("macro",{class:"toc"})}};var a2=Symbol("isOPEmbeddedTable");function l2(e,t,i){return t.setCustomProperty(a2,!0,e),me(e,t,{label:"your label here"})}function oA(e){return!!e.getCustomProperty(a2)&&z(e)}function c2(e){let t=e.getSelectedElement();return!!(t&&oA(t))}function Dt(e){return e.config?._config?.openProject?.context?.resource}function ql(e){return e.config?._config?.openProject?.context?.field}function ge(e){return e.config?._config?.openProject?.pluginContext}function xt(e,t){return ge(e).services[t]}function ti(e){return xt(e,"pathHelperService")}function Th(e){return xt(e,"i18n")}var os=class e extends w{static get pluginName(){return"EmbeddedTableEditing"}static get buttonName(){return"insertEmbeddedTable"}init(){let t=this.editor,i=t.model,o=t.conversion,n=ge(t);this.text={button:window.I18n.t("js.editor.macro.embedded_table.button"),macro_text:window.I18n.t("js.editor.macro.embedded_table.text")},i.schema.register("op-macro-embedded-table",{allowWhere:"$block",allowAttributes:["opEmbeddedTableQuery"],isBlock:!0,isObject:!0}),o.for("upcast").elementToElement({view:{name:"macro",classes:"embedded-table"},model:(s,{writer:r})=>{let a=s.getAttribute("data-query-props");return r.createElement("op-macro-embedded-table",{opEmbeddedTableQuery:a?JSON.parse(a):{}})}}),o.for("editingDowncast").elementToElement({model:"op-macro-embedded-table",view:(s,{writer:r})=>l2(this.createEmbeddedTableView(r),r,{label:this.label})}),o.for("dataDowncast").elementToElement({model:"op-macro-embedded-table",view:(s,{writer:r})=>this.createEmbeddedTableDataElement(s,r)}),t.ui.componentFactory.add(e.buttonName,s=>{let r=new I(s);return r.set({label:this.text.button,withText:!0}),r.on("execute",()=>n.runInZone(()=>{let a=n.services.externalQueryConfiguration,l={};a.show({currentQuery:l,callback:c=>t.model.change(u=>{let d=u.createElement("op-macro-embedded-table",{opEmbeddedTableQuery:c});t.model.insertContent(d,t.model.document.selection)})})})),r})}createEmbeddedTableView(t){let i=t.createText(this.text.macro_text),o=t.createContainerElement("div");return t.insert(t.createPositionAt(o,0),i),o}createEmbeddedTableDataElement(t,i){let o=t.getAttribute("opEmbeddedTableQuery")||{};return i.createContainerElement("macro",{class:"embedded-table","data-query-props":JSON.stringify(o)})}};var u2=` +`;function Qi(e,t,i){e.ui.componentFactory.add(t,o=>{let n=new I(o);return n.set({label:I18n.t("js.button_edit"),icon:u2,tooltip:!0}),n.on("execute",()=>{let s=e.model.document.selection.getSelectedElement();s&&i(s)}),n})}var sA="ck-toolbar-container";function Yi(e,t,i,o){let n=t.config.get(i+".toolbar");if(!n||!n.length)return;let s=t.plugins.get("ContextualBalloon"),r=new dt(t.locale);function a(){t.ui.focusTracker.isFocused&&o(t.editing.view.document.selection)?l():c()}function l(){u()?rA(t,o):s.hasView(r)||s.add({view:r,position:d2(t),balloonClassName:sA})}function c(){u()&&s.remove(r)}function u(){return s.visibleView==r}r.fillFromConfig(n,t.ui.componentFactory),e.listenTo(t.editing.view,"render",a),e.listenTo(t.ui.focusTracker,"change:isFocused",a,{priority:"low"})}function rA(e,t){let i=e.plugins.get("ContextualBalloon");if(t(e.editing.view.document.selection)){let o=d2(e);i.updatePosition(o)}}function d2(e){let t=e.editing.view,i=Me.defaultPositions;return{target:t.domConverter.viewToDom(t.document.selection.getSelectedElement()),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast]}}var xr=class extends w{static get requires(){return[re]}static get pluginName(){return"EmbeddedTableToolbar"}init(){let t=this.editor,i=this.editor.model,o=ge(t);Qi(t,"opEditEmbeddedTableQuery",n=>{let s=o.services.externalQueryConfiguration,r=n.getAttribute("opEmbeddedTableQuery")||{};o.runInZone(()=>{s.show({currentQuery:r,callback:a=>i.change(l=>{l.setAttribute("opEmbeddedTableQuery",a,n)})})})})}afterInit(){Yi(this,this.editor,"OPMacroEmbeddedTable",c2)}};var Tr=class extends w{static get requires(){return[os,Re,xr]}static get pluginName(){return"OPMacroEmbeddedTable"}static get buttonName(){return os.buttonName}};var h2=Symbol("isWpButtonMacroSymbol");function f2(e,t,i){return t.setCustomProperty(h2,!0,e),me(e,t,{label:i})}function aA(e){return!!e.getCustomProperty(h2)&&z(e)}function m2(e){let t=e.getSelectedElement();return!!(t&&aA(t))}var ns=class e extends w{static get pluginName(){return"OPMacroWpButtonEditing"}static get buttonName(){return"insertWorkPackageButton"}init(){let t=this.editor,i=t.model,o=t.conversion,n=ge(t);i.schema.register("op-macro-wp-button",{allowWhere:["$block"],allowAttributes:["type","classes"],isBlock:!0,isLimit:!0}),o.for("upcast").elementToElement({view:{name:"macro",classes:"create_work_package_link"},model:(s,{writer:r})=>{let a=s.getAttribute("data-type")||"",l=s.getAttribute("data-classes")||"";return r.createElement("op-macro-wp-button",{type:a,classes:l})}}),o.for("editingDowncast").elementToElement({model:"op-macro-wp-button",view:(s,{writer:r})=>this.createMacroViewElement(s,r)}),o.for("dataDowncast").elementToElement({model:"op-macro-wp-button",view:(s,{writer:r})=>r.createContainerElement("macro",{class:"create_work_package_link","data-type":s.getAttribute("type")||"","data-classes":s.getAttribute("classes")||""})}),t.ui.componentFactory.add(e.buttonName,s=>{let r=new I(s);return r.set({label:window.I18n.t("js.editor.macro.work_package_button.button"),withText:!0}),r.on("execute",()=>{n.services.macros.configureWorkPackageButton().then(l=>t.model.change(c=>{let u=c.createElement("op-macro-wp-button",{});c.setAttribute("type",l.type,u),c.setAttribute("classes",l.classes,u),t.model.insertContent(u,t.model.document.selection)}))}),r})}macroLabel(t){return t?window.I18n.t("js.editor.macro.work_package_button.with_type",{typename:t}):window.I18n.t("js.editor.macro.work_package_button.without_type")}createMacroViewElement(t,i){let o=t.getAttribute("classes")||"",n=this.macroLabel(),s=i.createText(n),r=i.createContainerElement("span",{class:o});return i.insert(i.createPositionAt(r,0),s),f2(r,i,{label:n})}};var Er=class extends w{static get requires(){return[re]}static get pluginName(){return"OPMacroWpButtonToolbar"}init(){let t=this.editor,i=ge(t);Qi(t,"opEditWpMacroButton",o=>{let n=i.services.macros,s=o.getAttribute("type"),r=o.getAttribute("classes");n.configureWorkPackageButton(s,r).then(a=>t.model.change(l=>{l.setAttribute("classes",a.classes,o),l.setAttribute("type",a.type,o)}))})}afterInit(){Yi(this,this.editor,"OPMacroWpButton",m2)}};var Ar=class extends w{static get requires(){return[ns,Re,Er]}static get pluginName(){return"OPMacroWpButton"}static get buttonName(){return ns.buttonName}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var rA=W(),aA=class extends rA{total;_reader;_data;constructor(){super();let e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=t=>{this.loaded=t.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){let t=this._reader;return this.total=e.size,new Promise((i,o)=>{t.onload=()=>{let n=t.result;this._data=n,i(n)},t.onerror=()=>{o("error")},t.onabort=()=>{o("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}};/** +*/var lA=W(),cA=class extends lA{total;_reader;_data;constructor(){super();let e=new window.FileReader;this._reader=e,this._data=void 0,this.set("loaded",0),e.onprogress=t=>{this.loaded=t.loaded}}get error(){return this._reader.error}get data(){return this._data}read(e){let t=this._reader;return this.total=e.size,new Promise((i,o)=>{t.onload=()=>{let n=t.result;this._data=n,i(n)},t.onerror=()=>{o("error")},t.onabort=()=>{o("aborted")},this._reader.readAsDataURL(e)})}abort(){this._reader.abort()}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var lA=W(),xt=class extends y{loaders=new J;_loadersMap=new Map;_pendingAction=null;static get pluginName(){return"FileRepository"}static get isOfficialPlugin(){return!0}static get requires(){return[Bn]}init(){this.loaders.on("change",()=>this._updatePendingAction()),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return D("filerepository-no-upload-adapter"),null;let t=new m2(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then(i=>{this._loadersMap.set(i,t)}).catch(()=>{}),t.on("change:uploaded",()=>{let i=0;for(let o of this.loaders)i+=o.uploaded;this.uploaded=i}),t.on("change:uploadTotal",()=>{let i=0;for(let o of this.loaders)o.uploadTotal&&(i+=o.uploadTotal);this.uploadTotal=i}),t}destroyLoader(e){let t=e instanceof m2?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach((i,o)=>{i===t&&this._loadersMap.delete(o)})}_updatePendingAction(){let e=this.editor.plugins.get(Bn);if(this.loaders.length){if(!this._pendingAction){let t=this.editor.t,i=o=>`${t("Upload in progress")} ${parseInt(o)}%.`;this._pendingAction=e.add(i(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",i)}}else e.remove(this._pendingAction),this._pendingAction=null}},m2=class extends lA{id;_filePromiseWrapper;_adapter;_reader;constructor(e,t){super(),this.id=ne(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new aA,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(i,o)=>o?i/o*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if(this.status!="idle")throw new p("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(e=>this._reader.read(e)).then(e=>{if(this.status!=="reading")throw this.status;return this.status="idle",e}).catch(e=>{throw e==="aborted"?(this.status="aborted","aborted"):(this.status="error",this._reader.error?this._reader.error:e)})}upload(){if(this.status!="idle")throw new p("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(e=>(this.uploadResponse=e,this.status="idle",e)).catch(e=>{throw this.status==="aborted"?"aborted":(this.status="error",e)})}abort(){let e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?e=="reading"?this._reader.abort():e=="uploading"&&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(e){let t={};return t.promise=new Promise((i,o)=>{t.rejecter=o,t.isFulfilled=!1,e.then(n=>{t.isFulfilled=!0,i(n)}).catch(n=>{t.isFulfilled=!0,o(n)})}),t}};/** +*/var uA=W(),Tt=class extends w{loaders=new G;_loadersMap=new Map;_pendingAction=null;static get pluginName(){return"FileRepository"}static get isOfficialPlugin(){return!0}static get requires(){return[Bn]}init(){this.loaders.on("change",()=>this._updatePendingAction()),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(e,t)=>t?e/t*100:0)}getLoader(e){return this._loadersMap.get(e)||null}createLoader(e){if(!this.createUploadAdapter)return D("filerepository-no-upload-adapter"),null;let t=new g2(Promise.resolve(e),this.createUploadAdapter);return this.loaders.add(t),this._loadersMap.set(e,t),e instanceof Promise&&t.file.then(i=>{this._loadersMap.set(i,t)}).catch(()=>{}),t.on("change:uploaded",()=>{let i=0;for(let o of this.loaders)i+=o.uploaded;this.uploaded=i}),t.on("change:uploadTotal",()=>{let i=0;for(let o of this.loaders)o.uploadTotal&&(i+=o.uploadTotal);this.uploadTotal=i}),t}destroyLoader(e){let t=e instanceof g2?e:this.getLoader(e);t._destroy(),this.loaders.remove(t),this._loadersMap.forEach((i,o)=>{i===t&&this._loadersMap.delete(o)})}_updatePendingAction(){let e=this.editor.plugins.get(Bn);if(this.loaders.length){if(!this._pendingAction){let t=this.editor.t,i=o=>`${t("Upload in progress")} ${parseInt(o)}%.`;this._pendingAction=e.add(i(this.uploadedPercent)),this._pendingAction.bind("message").to(this,"uploadedPercent",i)}}else e.remove(this._pendingAction),this._pendingAction=null}},g2=class extends uA{id;_filePromiseWrapper;_adapter;_reader;constructor(e,t){super(),this.id=ne(),this._filePromiseWrapper=this._createFilePromiseWrapper(e),this._adapter=t(this),this._reader=new cA,this.set("status","idle"),this.set("uploaded",0),this.set("uploadTotal",null),this.bind("uploadedPercent").to(this,"uploaded",this,"uploadTotal",(i,o)=>o?i/o*100:0),this.set("uploadResponse",null)}get file(){return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(e=>this._filePromiseWrapper?e:null):Promise.resolve(null)}get data(){return this._reader.data}read(){if(this.status!="idle")throw new p("filerepository-read-wrong-status",this);return this.status="reading",this.file.then(e=>this._reader.read(e)).then(e=>{if(this.status!=="reading")throw this.status;return this.status="idle",e}).catch(e=>{throw e==="aborted"?(this.status="aborted","aborted"):(this.status="error",this._reader.error?this._reader.error:e)})}upload(){if(this.status!="idle")throw new p("filerepository-upload-wrong-status",this);return this.status="uploading",this.file.then(()=>this._adapter.upload()).then(e=>(this.uploadResponse=e,this.status="idle",e)).catch(e=>{throw this.status==="aborted"?"aborted":(this.status="error",e)})}abort(){let e=this.status;this.status="aborted",this._filePromiseWrapper.isFulfilled?e=="reading"?this._reader.abort():e=="uploading"&&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(e){let t={};return t.promise=new Promise((i,o)=>{t.rejecter=o,t.isFulfilled=!1,e.then(n=>{t.isFulfilled=!0,i(n)}).catch(n=>{t.isFulfilled=!0,o(n)})}),t}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -1203,53 +1203,53 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Ir=class{constructor(t,i,o){this.loader=t,this.resource=i,this.editor=o}upload(){let t=this.resource,i=Ct(this.editor,"attachmentsResourceService");return t?this.loader.file.then(o=>i.attachFiles(t,[o]).toPromise().then(n=>(this.editor.model.fire("op:attachment-added",n),this.buildResponse(n[0]))).catch(n=>{console.error("Failed upload %O",n)})):(console.warn("resource not available in this CKEditor instance"),Promise.reject("Not possible to upload attachments without resource"))}buildResponse(t){return{default:t._links.staticDownloadLocation.href}}abort(){return!1}};/** +*/var Ir=class{constructor(t,i,o){this.loader=t,this.resource=i,this.editor=o}upload(){let t=this.resource,i=xt(this.editor,"attachmentsResourceService");return t?this.loader.file.then(o=>i.attachFiles(t,[o]).toPromise().then(n=>(this.editor.model.fire("op:attachment-added",n),this.buildResponse(n[0]))).catch(n=>{console.error("Failed upload %O",n)})):(console.warn("resource not available in this CKEditor instance"),Promise.reject("Not possible to upload attachments without resource"))}buildResponse(t){return{default:t._links.staticDownloadLocation.href}}abort(){return!1}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function cA(e){return e=e.replace(/&/g,"&").replace(//g,">").replace(/\r?\n\r?\n/g,"

").replace(/\r?\n/g,"
").replace(/\t/g,"    ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  "),(e.includes("

")||e.includes("
"))&&(e=`

${e}

`),e}/** +*/function dA(e){return e=e.replace(/&/g,"&").replace(//g,">").replace(/\r?\n\r?\n/g,"

").replace(/\r?\n/g,"
").replace(/\t/g,"    ").replace(/^\s/," ").replace(/\s$/," ").replace(/\s\s/g,"  "),(e.includes("

")||e.includes("
"))&&(e=`

${e}

`),e}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Sr=class extends $e{domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"];constructor(e){super(e);let t=this.document;this.listenTo(t,"paste",i("clipboardInput"),{priority:"low"}),this.listenTo(t,"drop",i("clipboardInput"),{priority:"low"}),this.listenTo(t,"dragover",i("dragging"),{priority:"low"});function i(o){return(n,s)=>{s.preventDefault();let r=s.dropRange?[s.dropRange]:null,a=s.dataTransfer,l=new pt(t,o),c="";a.getData("text/html")?c=a.getData("text/html"):a.getData("text/plain")&&(c=cA(a.getData("text/plain"))),t.fire(l,{dataTransfer:a,content:c,method:n.name,targetRanges:r,target:s.target,domEvent:s.domEvent}),l.stop.called&&s.stopPropagation()}}}onDomEvent(e){let t="clipboardData"in e?e.clipboardData:e.dataTransfer,i=e.type=="drop"||e.type=="paste",o={dataTransfer:new wd(t,{cacheFiles:i})};if(e.type=="drop"||e.type=="dragover"){let n=Oa(e);o.dropRange=n&&this.view.domConverter.domRangeToView(n)}this.fire(e.type,e,o)}};/** +*/var Sr=class extends $e{domEventType=["paste","copy","cut","drop","dragover","dragstart","dragend","dragenter","dragleave"];constructor(e){super(e);let t=this.document;this.listenTo(t,"paste",i("clipboardInput"),{priority:"low"}),this.listenTo(t,"drop",i("clipboardInput"),{priority:"low"}),this.listenTo(t,"dragover",i("dragging"),{priority:"low"});function i(o){return(n,s)=>{s.preventDefault();let r=s.dropRange?[s.dropRange]:null,a=s.dataTransfer,l=new bt(t,o),c="";a.getData("text/html")?c=a.getData("text/html"):a.getData("text/plain")&&(c=dA(a.getData("text/plain"))),t.fire(l,{dataTransfer:a,content:c,method:n.name,targetRanges:r,target:s.target,domEvent:s.domEvent}),l.stop.called&&s.stopPropagation()}}}onDomEvent(e){let t="clipboardData"in e?e.clipboardData:e.dataTransfer,i=e.type=="drop"||e.type=="paste",o={dataTransfer:new _d(t,{cacheFiles:i})};if(e.type=="drop"||e.type=="dragover"){let n=Da(e);o.dropRange=n&&this.view.domConverter.domRangeToView(n)}this.fire(e.type,e,o)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function uA(e){return e.replace(/(\s+)<\/span>/g,(t,i)=>i.length==1?" ":i).replace(//g,"")}/** +*/function hA(e){return e.replace(/(\s+)<\/span>/g,(t,i)=>i.length==1?" ":i).replace(//g,"")}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var g2=["figcaption","li"],p2=["ol","ul"];function v2(e,t){if(t.is("$text")||t.is("$textProxy"))return t.data;if(t.is("element","img")&&t.hasAttribute("alt"))return t.getAttribute("alt");if(t.is("element","br"))return` -`;let i="",o=null;for(let n of t.getChildren())i+=dA(n,o)+v2(e,n),o=n;if(t.is("rawElement")){let n=document.implementation.createHTMLDocument("").createElement("div");t.render(n,e),i+=k2(n)}return i}function k2(e){let t="";if(e.nodeType===Node.TEXT_NODE)return e.textContent;if(e.tagName==="BR")return` -`;for(let i of e.childNodes)t+=k2(i);return t}function dA(e,t){return t?e.is("element","li")&&!e.isEmpty&&e.getChild(0).is("containerElement")||p2.includes(e.name)&&p2.includes(t.name)?` +*/var p2=["figcaption","li"],b2=["ol","ul"];function k2(e,t){if(t.is("$text")||t.is("$textProxy"))return t.data;if(t.is("element","img")&&t.hasAttribute("alt"))return t.getAttribute("alt");if(t.is("element","br"))return` +`;let i="",o=null;for(let n of t.getChildren())i+=fA(n,o)+k2(e,n),o=n;if(t.is("rawElement")){let n=document.implementation.createHTMLDocument("").createElement("div");t.render(n,e),i+=C2(n)}return i}function C2(e){let t="";if(e.nodeType===Node.TEXT_NODE)return e.textContent;if(e.tagName==="BR")return` +`;for(let i of e.childNodes)t+=C2(i);return t}function fA(e,t){return t?e.is("element","li")&&!e.isEmpty&&e.getChild(0).is("containerElement")||b2.includes(e.name)&&b2.includes(t.name)?` -`:!e.is("containerElement")&&!t.is("containerElement")?"":g2.includes(e.name)||g2.includes(t.name)?` +`:!e.is("containerElement")&&!t.is("containerElement")?"":p2.includes(e.name)||p2.includes(t.name)?` `:e.is("element")&&e.getCustomProperty("dataPipeline:transparentRendering")||t.is("element")&&t.getCustomProperty("dataPipeline:transparentRendering")?"":` `:""}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var ss=class extends y{_markersToCopy=new Map;static get pluginName(){return"ClipboardMarkersUtils"}static get isOfficialPlugin(){return!0}_registerMarkerToCopy(e,t){this._markersToCopy.set(e,t)}_copySelectedFragmentWithMarkers(e,t,i=o=>o.model.getSelectedContent(o.model.document.selection)){return this.editor.model.change(o=>{let n=o.model.document.selection;o.setSelection(t);let s=this._insertFakeMarkersIntoSelection(o,o.model.document.selection,e),r=i(o),a=this._removeFakeMarkersInsideElement(o,r);for(let[l,c]of Object.entries(s)){a[l]||=o.createRangeIn(r);for(let u of c)o.remove(u)}r.markers.clear();for(let[l,c]of Object.entries(a))r.markers.set(l,c);return o.setSelection(n),r})}_pasteMarkersIntoTransformedElement(e,t){let i=this._getPasteMarkersFromRangeMap(e);return this.editor.model.change(o=>{let n=this._insertFakeMarkersElements(o,i),s=t(o),r=this._removeFakeMarkersInsideElement(o,s);for(let a of Object.values(n).flat())o.remove(a);for(let[a,l]of Object.entries(r))o.model.markers.has(a)||o.addMarker(a,{usingOperation:!0,affectsData:!0,range:l});return s})}_pasteFragmentWithMarkers(e){let t=this._getPasteMarkersFromRangeMap(e.markers);e.markers.clear();for(let i of t)e.markers.set(i.name,i.range);return this.editor.model.insertContent(e)}_forceMarkersCopy(e,t,i={allowedActions:"all",copyPartiallySelected:!0,duplicateOnPaste:!0}){let o=this._markersToCopy.get(e);this._markersToCopy.set(e,i),t(),o?this._markersToCopy.set(e,o):this._markersToCopy.delete(e)}_isMarkerCopyable(e,t){let i=this._getMarkerClipboardConfig(e);if(!i)return!1;if(!t)return!0;let{allowedActions:o}=i;return o==="all"||o.includes(t)}_hasMarkerConfiguration(e){return!!this._getMarkerClipboardConfig(e)}_getMarkerClipboardConfig(e){let[t]=e.split(":");return this._markersToCopy.get(t)||null}_insertFakeMarkersIntoSelection(e,t,i){let o=this._getCopyableMarkersFromSelection(e,t,i);return this._insertFakeMarkersElements(e,o)}_getCopyableMarkersFromSelection(e,t,i){let o=Array.from(t.getRanges()),n=new Set(o.flatMap(r=>Array.from(e.model.markers.getMarkersIntersectingRange(r)))),s=r=>{if(!this._isMarkerCopyable(r.name,i))return!1;let{copyPartiallySelected:a}=this._getMarkerClipboardConfig(r.name);if(!a){let l=r.getRange();return o.some(c=>c.containsRange(l,!0))}return!0};return Array.from(n).filter(s).map(r=>({name:i==="dragstart"?this._getUniqueMarkerName(r.name):r.name,range:r.getRange()}))}_getPasteMarkersFromRangeMap(e,t=null){let{model:i}=this.editor;return(e instanceof Map?Array.from(e.entries()):Object.entries(e)).flatMap(([o,n])=>{if(!this._hasMarkerConfiguration(o))return[{name:o,range:n}];if(this._isMarkerCopyable(o,t)){let s=this._getMarkerClipboardConfig(o),r=i.markers.has(o)&&i.markers.get(o).getRange().root.rootName==="$graveyard";return(s.duplicateOnPaste||r)&&(o=this._getUniqueMarkerName(o)),[{name:o,range:n}]}return[]})}_insertFakeMarkersElements(e,t){let i={},o=t.flatMap(n=>{let{start:s,end:r}=n.range;return[{position:s,marker:n,type:"start"},{position:r,marker:n,type:"end"}]}).sort(({position:n},{position:s})=>n.isBefore(s)?1:-1);for(let{position:n,marker:s,type:r}of o){let a=e.createElement("$marker",{"data-name":s.name,"data-type":r});i[s.name]||(i[s.name]=[]),i[s.name].push(a),e.insert(a,n)}return i}_removeFakeMarkersInsideElement(e,t){let i=this._getAllFakeMarkersFromElement(e,t).reduce((o,n)=>{let s=n.markerElement&&e.createPositionBefore(n.markerElement),r=o[n.name],a=!1;return r?.start&&r?.end&&(this._getMarkerClipboardConfig(n.name).duplicateOnPaste?o[this._getUniqueMarkerName(n.name)]=o[n.name]:a=!0,r=null),a||(o[n.name]={...r,[n.type]:s}),n.markerElement&&e.remove(n.markerElement),o},{});return uu(i,o=>new T(o.start||e.createPositionFromPath(t,[0]),o.end||e.createPositionAt(t,"end")))}_getAllFakeMarkersFromElement(e,t){let i=Array.from(e.createRangeIn(t)).flatMap(({item:s})=>s.is("element","$marker")?[{markerElement:s,name:s.getAttribute("data-name"),type:s.getAttribute("data-type")}]:[]),o=[],n=[];for(let s of i)s.type==="end"&&(i.some(r=>r.name===s.name&&r.type==="start")||o.push({markerElement:null,name:s.name,type:"start"})),s.type==="start"&&(i.some(r=>r.name===s.name&&r.type==="end")||n.unshift({markerElement:null,name:s.name,type:"end"}));return[...o,...i,...n]}_getUniqueMarkerName(e){let t=e.split(":"),i=ne().substring(1,6);return t.length===3?`${t.slice(0,2).join(":")}:${i}`:`${t.join(":")}:${i}`}};/** +*/var ss=class extends w{_markersToCopy=new Map;static get pluginName(){return"ClipboardMarkersUtils"}static get isOfficialPlugin(){return!0}_registerMarkerToCopy(e,t){this._markersToCopy.set(e,t)}_copySelectedFragmentWithMarkers(e,t,i=o=>o.model.getSelectedContent(o.model.document.selection)){return this.editor.model.change(o=>{let n=o.model.document.selection;o.setSelection(t);let s=this._insertFakeMarkersIntoSelection(o,o.model.document.selection,e),r=i(o),a=this._removeFakeMarkersInsideElement(o,r);for(let[l,c]of Object.entries(s)){a[l]||=o.createRangeIn(r);for(let u of c)o.remove(u)}r.markers.clear();for(let[l,c]of Object.entries(a))r.markers.set(l,c);return o.setSelection(n),r})}_pasteMarkersIntoTransformedElement(e,t){let i=this._getPasteMarkersFromRangeMap(e);return this.editor.model.change(o=>{let n=this._insertFakeMarkersElements(o,i),s=t(o),r=this._removeFakeMarkersInsideElement(o,s);for(let a of Object.values(n).flat())o.remove(a);for(let[a,l]of Object.entries(r))o.model.markers.has(a)||o.addMarker(a,{usingOperation:!0,affectsData:!0,range:l});return s})}_pasteFragmentWithMarkers(e){let t=this._getPasteMarkersFromRangeMap(e.markers);e.markers.clear();for(let i of t)e.markers.set(i.name,i.range);return this.editor.model.insertContent(e)}_forceMarkersCopy(e,t,i={allowedActions:"all",copyPartiallySelected:!0,duplicateOnPaste:!0}){let o=this._markersToCopy.get(e);this._markersToCopy.set(e,i),t(),o?this._markersToCopy.set(e,o):this._markersToCopy.delete(e)}_isMarkerCopyable(e,t){let i=this._getMarkerClipboardConfig(e);if(!i)return!1;if(!t)return!0;let{allowedActions:o}=i;return o==="all"||o.includes(t)}_hasMarkerConfiguration(e){return!!this._getMarkerClipboardConfig(e)}_getMarkerClipboardConfig(e){let[t]=e.split(":");return this._markersToCopy.get(t)||null}_insertFakeMarkersIntoSelection(e,t,i){let o=this._getCopyableMarkersFromSelection(e,t,i);return this._insertFakeMarkersElements(e,o)}_getCopyableMarkersFromSelection(e,t,i){let o=Array.from(t.getRanges()),n=new Set(o.flatMap(r=>Array.from(e.model.markers.getMarkersIntersectingRange(r)))),s=r=>{if(!this._isMarkerCopyable(r.name,i))return!1;let{copyPartiallySelected:a}=this._getMarkerClipboardConfig(r.name);if(!a){let l=r.getRange();return o.some(c=>c.containsRange(l,!0))}return!0};return Array.from(n).filter(s).map(r=>({name:i==="dragstart"?this._getUniqueMarkerName(r.name):r.name,range:r.getRange()}))}_getPasteMarkersFromRangeMap(e,t=null){let{model:i}=this.editor;return(e instanceof Map?Array.from(e.entries()):Object.entries(e)).flatMap(([o,n])=>{if(!this._hasMarkerConfiguration(o))return[{name:o,range:n}];if(this._isMarkerCopyable(o,t)){let s=this._getMarkerClipboardConfig(o),r=i.markers.has(o)&&i.markers.get(o).getRange().root.rootName==="$graveyard";return(s.duplicateOnPaste||r)&&(o=this._getUniqueMarkerName(o)),[{name:o,range:n}]}return[]})}_insertFakeMarkersElements(e,t){let i={},o=t.flatMap(n=>{let{start:s,end:r}=n.range;return[{position:s,marker:n,type:"start"},{position:r,marker:n,type:"end"}]}).sort(({position:n},{position:s})=>n.isBefore(s)?1:-1);for(let{position:n,marker:s,type:r}of o){let a=e.createElement("$marker",{"data-name":s.name,"data-type":r});i[s.name]||(i[s.name]=[]),i[s.name].push(a),e.insert(a,n)}return i}_removeFakeMarkersInsideElement(e,t){let i=this._getAllFakeMarkersFromElement(e,t).reduce((o,n)=>{let s=n.markerElement&&e.createPositionBefore(n.markerElement),r=o[n.name],a=!1;return r?.start&&r?.end&&(this._getMarkerClipboardConfig(n.name).duplicateOnPaste?o[this._getUniqueMarkerName(n.name)]=o[n.name]:a=!0,r=null),a||(o[n.name]={...r,[n.type]:s}),n.markerElement&&e.remove(n.markerElement),o},{});return hu(i,o=>new T(o.start||e.createPositionFromPath(t,[0]),o.end||e.createPositionAt(t,"end")))}_getAllFakeMarkersFromElement(e,t){let i=Array.from(e.createRangeIn(t)).flatMap(({item:s})=>s.is("element","$marker")?[{markerElement:s,name:s.getAttribute("data-name"),type:s.getAttribute("data-type")}]:[]),o=[],n=[];for(let s of i)s.type==="end"&&(i.some(r=>r.name===s.name&&r.type==="start")||o.push({markerElement:null,name:s.name,type:"start"})),s.type==="start"&&(i.some(r=>r.name===s.name&&r.type==="end")||n.unshift({markerElement:null,name:s.name,type:"end"}));return[...o,...i,...n]}_getUniqueMarkerName(e){let t=e.split(":"),i=ne().substring(1,6);return t.length===3?`${t.slice(0,2).join(":")}:${i}`:`${t.join(":")}:${i}`}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Be=class extends y{static get pluginName(){return"ClipboardPipeline"}static get isOfficialPlugin(){return!0}static get requires(){return[ss]}init(){this.editor.editing.view.addObserver(Sr),this._setupPasteDrop(),this._setupCopyCut()}_fireOutputTransformationEvent(e,t,i){let o=this.editor.plugins.get("ClipboardMarkersUtils");this.editor.model.enqueueChange({isUndoable:i==="cut"},()=>{let n=o._copySelectedFragmentWithMarkers(i,t);this.fire("outputTransformation",{dataTransfer:e,content:n,method:i})})}_setupPasteDrop(){let e=this.editor,t=e.model,i=e.editing.view,o=i.document,n=this.editor.plugins.get("ClipboardMarkersUtils");this.listenTo(o,"clipboardInput",(s,r)=>{r.method=="paste"&&!e.model.canEditAt(e.model.document.selection)&&s.stop()},{priority:"highest"}),this.listenTo(o,"clipboardInput",(s,r)=>{let a=r.dataTransfer,l=new pt(this,"inputTransformation"),c=a.getData("application/ckeditor5-editor-id")||null,u=typeof r.content=="string"?this.editor.data.htmlProcessor.toView(uA(r.content)):r.content;this.fire(l,{content:u,dataTransfer:a,sourceEditorId:c,extraContent:r.extraContent,targetRanges:r.targetRanges,method:r.method}),l.stop.called&&s.stop(),i.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(s,r)=>{if(r.content.isEmpty)return;let a=this.editor.data.toModel(r.content,"$clipboardHolder");a.childCount!=0&&(s.stop(),t.change(()=>{this.fire("contentInsertion",{content:a,method:r.method,sourceEditorId:r.sourceEditorId,dataTransfer:r.dataTransfer,targetRanges:r.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(s,r)=>{r.resultRange=n._pasteFragmentWithMarkers(r.content)},{priority:"low"})}_setupCopyCut(){let e=this.editor,t=e.model.document,i=e.editing.view.document,o=(n,s)=>{let r=s.dataTransfer;s.preventDefault(),this._fireOutputTransformationEvent(r,t.selection,n.name)};this.listenTo(i,"copy",o,{priority:"low"}),this.listenTo(i,"cut",(n,s)=>{e.model.canEditAt(e.model.document.selection)?o(n,s):s.preventDefault()},{priority:"low"}),this.listenTo(this,"outputTransformation",(n,s)=>{let r=e.data.toView(s.content,{isClipboardPipeline:!0});i.fire("clipboardOutput",{dataTransfer:s.dataTransfer,content:r,method:s.method})},{priority:"low"}),this.listenTo(i,"clipboardOutput",(n,s)=>{s.content.isEmpty||(s.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(s.content)),s.dataTransfer.setData("text/plain",v2(e.data.htmlProcessor.domConverter,s.content)),s.dataTransfer.setData("application/ckeditor5-editor-id",this.editor.id)),s.method=="cut"&&e.model.deleteContent(t.selection)},{priority:"low"})}};/** +*/var Be=class extends w{static get pluginName(){return"ClipboardPipeline"}static get isOfficialPlugin(){return!0}static get requires(){return[ss]}init(){this.editor.editing.view.addObserver(Sr),this._setupPasteDrop(),this._setupCopyCut()}_fireOutputTransformationEvent(e,t,i){let o=this.editor.plugins.get("ClipboardMarkersUtils");this.editor.model.enqueueChange({isUndoable:i==="cut"},()=>{let n=o._copySelectedFragmentWithMarkers(i,t);this.fire("outputTransformation",{dataTransfer:e,content:n,method:i})})}_setupPasteDrop(){let e=this.editor,t=e.model,i=e.editing.view,o=i.document,n=this.editor.plugins.get("ClipboardMarkersUtils");this.listenTo(o,"clipboardInput",(s,r)=>{r.method=="paste"&&!e.model.canEditAt(e.model.document.selection)&&s.stop()},{priority:"highest"}),this.listenTo(o,"clipboardInput",(s,r)=>{let a=r.dataTransfer,l=new bt(this,"inputTransformation"),c=a.getData("application/ckeditor5-editor-id")||null,u=typeof r.content=="string"?this.editor.data.htmlProcessor.toView(hA(r.content)):r.content;this.fire(l,{content:u,dataTransfer:a,sourceEditorId:c,extraContent:r.extraContent,targetRanges:r.targetRanges,method:r.method}),l.stop.called&&s.stop(),i.scrollToTheSelection()},{priority:"low"}),this.listenTo(this,"inputTransformation",(s,r)=>{if(r.content.isEmpty)return;let a=this.editor.data.toModel(r.content,"$clipboardHolder");a.childCount!=0&&(s.stop(),t.change(()=>{this.fire("contentInsertion",{content:a,method:r.method,sourceEditorId:r.sourceEditorId,dataTransfer:r.dataTransfer,targetRanges:r.targetRanges})}))},{priority:"low"}),this.listenTo(this,"contentInsertion",(s,r)=>{r.resultRange=n._pasteFragmentWithMarkers(r.content)},{priority:"low"})}_setupCopyCut(){let e=this.editor,t=e.model.document,i=e.editing.view.document,o=(n,s)=>{let r=s.dataTransfer;s.preventDefault(),this._fireOutputTransformationEvent(r,t.selection,n.name)};this.listenTo(i,"copy",o,{priority:"low"}),this.listenTo(i,"cut",(n,s)=>{e.model.canEditAt(e.model.document.selection)?o(n,s):s.preventDefault()},{priority:"low"}),this.listenTo(this,"outputTransformation",(n,s)=>{let r=e.data.toView(s.content,{isClipboardPipeline:!0});i.fire("clipboardOutput",{dataTransfer:s.dataTransfer,content:r,method:s.method})},{priority:"low"}),this.listenTo(i,"clipboardOutput",(n,s)=>{s.content.isEmpty||(s.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(s.content)),s.dataTransfer.setData("text/plain",k2(e.data.htmlProcessor.domConverter,s.content)),s.dataTransfer.setData("application/ckeditor5-editor-id",this.editor.id)),s.method=="cut"&&e.model.deleteContent(t.selection)},{priority:"low"})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*//* istanbul ignore file -- @preserve */var xh=po("px"),hA=class extends R{constructor(){super();let e=this.bindTemplate;this.set({isVisible:!1,left:null,top:null,width:null}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-clipboard-drop-target-line",e.if("isVisible","ck-hidden",t=>!t)],style:{left:e.to("left",t=>xh(t)),top:e.to("top",t=>xh(t)),width:e.to("width",t=>xh(t))}}})}};/** +*//* istanbul ignore file -- @preserve */var Eh=bo("px"),mA=class extends R{constructor(){super();let e=this.bindTemplate;this.set({isVisible:!1,left:null,top:null,width:null}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-clipboard-drop-target-line",e.if("isVisible","ck-hidden",t=>!t)],style:{left:e.to("left",t=>Eh(t)),top:e.to("top",t=>Eh(t)),width:e.to("width",t=>Eh(t))}}})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Ul=class extends y{removeDropMarkerDelayed=Os(()=>this.removeDropMarker(),40);_updateDropMarkerThrottled=ai(e=>this._updateDropMarker(e),40);_reconvertMarkerThrottled=ai(()=>{this.editor.model.markers.has("drop-target")&&this.editor.editing.reconvertMarker("drop-target")},0);_dropTargetLineView=new hA;_domEmitter=new(pe());_scrollables=new Map;static get pluginName(){return"DragDropTarget"}static get isOfficialPlugin(){return!0}init(){this._setupDropMarker()}destroy(){this._domEmitter.stopListening();for(let{resizeObserver:e}of this._scrollables.values())e.destroy();return this._updateDropMarkerThrottled.cancel(),this.removeDropMarkerDelayed.cancel(),this._reconvertMarkerThrottled.cancel(),super.destroy()}updateDropMarker(e,t,i,o,n,s){this.removeDropMarkerDelayed.cancel();let r=b2(this.editor,e,t,i,o,n,s);/* istanbul ignore next -- @preserve */return r?s&&s.containsRange(r)?(this.removeDropMarker(),null):r&&!this.editor.model.canEditAt(r)?(this.removeDropMarker(),null):(this._updateDropMarkerThrottled(r),r):null}getFinalDropRange(e,t,i,o,n,s){let r=b2(this.editor,e,t,i,o,n,s);return this.removeDropMarker(),r}removeDropMarker(){let e=this.editor.model;this.removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),this._dropTargetLineView.isVisible=!1,e.markers.has("drop-target")&&e.change(t=>{t.removeMarker("drop-target")})}_setupDropMarker(){let e=this.editor;e.ui.view.body.add(this._dropTargetLineView),e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(t,{writer:i})=>{if(e.model.schema.checkChild(t.markerRange.start,"$text"))return this._dropTargetLineView.isVisible=!1,this._createDropTargetPosition(i);t.markerRange.isCollapsed?this._updateDropTargetLine(t.markerRange):this._dropTargetLineView.isVisible=!1}})}_updateDropMarker(e){let t=this.editor,i=t.model.markers;t.model.change(o=>{i.has("drop-target")?i.get("drop-target").getRange().isEqual(e)||o.updateMarker("drop-target",{range:e}):o.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})})}_createDropTargetPosition(e){return e.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},function(t){let i=this.toDomElement(t);return i.append("\u2060",t.createElement("span"),"\u2060"),i})}_updateDropTargetLine(e){let t=this.editor.editing,i=e.start.nodeBefore,o=e.start.nodeAfter,n=e.start.parent,s=i?t.mapper.toViewElement(i):null,r=s?t.view.domConverter.mapViewToDom(s):null,a=o?t.mapper.toViewElement(o):null,l=a?t.view.domConverter.mapViewToDom(a):null,c=t.mapper.toViewElement(n);if(!c)return;let u=t.view.domConverter.mapViewToDom(c),d=this._getScrollableRect(c),{scrollX:h,scrollY:f}=S.window,m=r?new F(r):null,g=l?new F(l):null,b=new F(u).excludeScrollbarsAndBorders(),k=m?m.bottom:b.top,v=g?g.top:b.bottom,_=S.window.getComputedStyle(u),C=k<=v?(k+v)/2:v;if(d.topa.schema.checkChild(d,h))){if(a.schema.checkChild(d,"$text"))return a.createRange(d);if(u)return ql(e,w2(e,u.parent),o,n)}}}else if(a.schema.isInline(c))return ql(e,c,o,n)}if(a.schema.isBlock(c))return ql(e,c,o,n);if(a.schema.checkChild(c,"$block")){let u=Array.from(c.getChildren()).filter(f=>f.is("element")&&!fA(e,f)),d=0,h=u.length;if(h==0)return a.createRange(a.createPositionAt(c,"end"));for(;dthis.removeDropMarker(),40);_updateDropMarkerThrottled=ci(e=>this._updateDropMarker(e),40);_reconvertMarkerThrottled=ci(()=>{this.editor.model.markers.has("drop-target")&&this.editor.editing.reconvertMarker("drop-target")},0);_dropTargetLineView=new mA;_domEmitter=new(be());_scrollables=new Map;static get pluginName(){return"DragDropTarget"}static get isOfficialPlugin(){return!0}init(){this._setupDropMarker()}destroy(){this._domEmitter.stopListening();for(let{resizeObserver:e}of this._scrollables.values())e.destroy();return this._updateDropMarkerThrottled.cancel(),this.removeDropMarkerDelayed.cancel(),this._reconvertMarkerThrottled.cancel(),super.destroy()}updateDropMarker(e,t,i,o,n,s){this.removeDropMarkerDelayed.cancel();let r=w2(this.editor,e,t,i,o,n,s);/* istanbul ignore next -- @preserve */return r?s&&s.containsRange(r)?(this.removeDropMarker(),null):r&&!this.editor.model.canEditAt(r)?(this.removeDropMarker(),null):(this._updateDropMarkerThrottled(r),r):null}getFinalDropRange(e,t,i,o,n,s){let r=w2(this.editor,e,t,i,o,n,s);return this.removeDropMarker(),r}removeDropMarker(){let e=this.editor.model;this.removeDropMarkerDelayed.cancel(),this._updateDropMarkerThrottled.cancel(),this._dropTargetLineView.isVisible=!1,e.markers.has("drop-target")&&e.change(t=>{t.removeMarker("drop-target")})}_setupDropMarker(){let e=this.editor;e.ui.view.body.add(this._dropTargetLineView),e.conversion.for("editingDowncast").markerToHighlight({model:"drop-target",view:{classes:["ck-clipboard-drop-target-range"]}}),e.conversion.for("editingDowncast").markerToElement({model:"drop-target",view:(t,{writer:i})=>{if(e.model.schema.checkChild(t.markerRange.start,"$text"))return this._dropTargetLineView.isVisible=!1,this._createDropTargetPosition(i);t.markerRange.isCollapsed?this._updateDropTargetLine(t.markerRange):this._dropTargetLineView.isVisible=!1}})}_updateDropMarker(e){let t=this.editor,i=t.model.markers;t.model.change(o=>{i.has("drop-target")?i.get("drop-target").getRange().isEqual(e)||o.updateMarker("drop-target",{range:e}):o.addMarker("drop-target",{range:e,usingOperation:!1,affectsData:!1})})}_createDropTargetPosition(e){return e.createUIElement("span",{class:"ck ck-clipboard-drop-target-position"},function(t){let i=this.toDomElement(t);return i.append("\u2060",t.createElement("span"),"\u2060"),i})}_updateDropTargetLine(e){let t=this.editor.editing,i=e.start.nodeBefore,o=e.start.nodeAfter,n=e.start.parent,s=i?t.mapper.toViewElement(i):null,r=s?t.view.domConverter.mapViewToDom(s):null,a=o?t.mapper.toViewElement(o):null,l=a?t.view.domConverter.mapViewToDom(a):null,c=t.mapper.toViewElement(n);if(!c)return;let u=t.view.domConverter.mapViewToDom(c),d=this._getScrollableRect(c),{scrollX:h,scrollY:f}=S.window,m=r?new F(r):null,g=l?new F(l):null,b=new F(u).excludeScrollbarsAndBorders(),k=m?m.bottom:b.top,v=g?g.top:b.bottom,_=S.window.getComputedStyle(u),C=k<=v?(k+v)/2:v;if(d.topa.schema.checkChild(d,h))){if(a.schema.checkChild(d,"$text"))return a.createRange(d);if(u)return jl(e,y2(e,u.parent),o,n)}}}else if(a.schema.isInline(c))return jl(e,c,o,n)}if(a.schema.isBlock(c))return jl(e,c,o,n);if(a.schema.checkChild(c,"$block")){let u=Array.from(c.getChildren()).filter(f=>f.is("element")&&!gA(e,f)),d=0,h=u.length;if(h==0)return a.createRange(a.createPositionAt(c,"end"));for(;d{o?(this.forceDisabled("readOnlyMode"),this._isBlockDragging=!1):this.clearForceDisabled("readOnlyMode")}),V.isAndroid&&this.forceDisabled("noAndroidSupport"),e.plugins.has("BlockToolbar")){let t=e.plugins.get("BlockToolbar").buttonView.element;this._domEmitter.listenTo(t,"dragstart",(i,o)=>this._handleBlockDragStart(o)),this._domEmitter.listenTo(S.document,"dragover",(i,o)=>this._handleBlockDragging(o)),this._domEmitter.listenTo(S.document,"drop",(i,o)=>this._handleBlockDragging(o)),this._domEmitter.listenTo(S.document,"dragend",()=>this._handleBlockDragEnd(),{useCapture:!0}),this.isEnabled&&t.setAttribute("draggable","true"),this.on("change:isEnabled",(i,o,n)=>{t.setAttribute("draggable",n?"true":"false")})}}destroy(){return this._domEmitter.stopListening(),super.destroy()}_handleBlockDragStart(e){if(!this.isEnabled)return;let t=this.editor.model,i=t.document.selection,o=this.editor.editing.view,n=Array.from(i.getSelectedBlocks()),s=t.createRange(t.createPositionBefore(n[0]),t.createPositionAfter(n[n.length-1]));t.change(r=>r.setSelection(s)),this._isBlockDragging=!0,o.focus(),o.getObserver(Sr).onDomEvent(e)}_handleBlockDragging(e){if(!this.isEnabled||!this._isBlockDragging)return;let t=e.clientX+(this.editor.locale.contentLanguageDirection=="ltr"?100:-100),i=e.clientY,o=this.editor.editing.view,n=gA(o,t,i);n&&o.getObserver(Sr).onDomEvent({...e,type:e.type,dataTransfer:e.dataTransfer,target:n,clientX:t,clientY:i,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation()})}_handleBlockDragEnd(){this._isBlockDragging=!1}};function gA(e,t,i){let o=new Set;for(let s of e.domRoots.values()){let r=s.getRootNode();st(r)&&o.add(r)}let n=X0(t,i,Array.from(o));return n&&n.closest(".ck-editor__editable")?n:null}/** +*/var pA=class extends w{_isBlockDragging=!1;_domEmitter=new(be());static get pluginName(){return"DragDropBlockToolbar"}static get isOfficialPlugin(){return!0}init(){let e=this.editor;if(this.listenTo(e,"change:isReadOnly",(t,i,o)=>{o?(this.forceDisabled("readOnlyMode"),this._isBlockDragging=!1):this.clearForceDisabled("readOnlyMode")}),V.isAndroid&&this.forceDisabled("noAndroidSupport"),e.plugins.has("BlockToolbar")){let t=e.plugins.get("BlockToolbar").buttonView.element;this._domEmitter.listenTo(t,"dragstart",(i,o)=>this._handleBlockDragStart(o)),this._domEmitter.listenTo(S.document,"dragover",(i,o)=>this._handleBlockDragging(o)),this._domEmitter.listenTo(S.document,"drop",(i,o)=>this._handleBlockDragging(o)),this._domEmitter.listenTo(S.document,"dragend",()=>this._handleBlockDragEnd(),{useCapture:!0}),this.isEnabled&&t.setAttribute("draggable","true"),this.on("change:isEnabled",(i,o,n)=>{t.setAttribute("draggable",n?"true":"false")})}}destroy(){return this._domEmitter.stopListening(),super.destroy()}_handleBlockDragStart(e){if(!this.isEnabled)return;let t=this.editor.model,i=t.document.selection,o=this.editor.editing.view,n=Array.from(i.getSelectedBlocks()),s=t.createRange(t.createPositionBefore(n[0]),t.createPositionAfter(n[n.length-1]));t.change(r=>r.setSelection(s)),this._isBlockDragging=!0,o.focus(),o.getObserver(Sr).onDomEvent(e)}_handleBlockDragging(e){if(!this.isEnabled||!this._isBlockDragging)return;let t=e.clientX+(this.editor.locale.contentLanguageDirection=="ltr"?100:-100),i=e.clientY,o=this.editor.editing.view,n=bA(o,t,i);n&&o.getObserver(Sr).onDomEvent({...e,type:e.type,dataTransfer:e.dataTransfer,target:n,clientX:t,clientY:i,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation()})}_handleBlockDragEnd(){this._isBlockDragging=!1}};function bA(e,t,i){let o=new Set;for(let s of e.domRoots.values()){let r=s.getRootNode();st(r)&&o.add(r)}let n=tg(t,i,Array.from(o));return n&&n.closest(".ck-editor__editable")?n:null}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var pA=class extends y{_draggedRange;_draggingUid;_draggableElement;_clearDraggableAttributesDelayed=Os(()=>this._clearDraggableAttributes(),40);_blockMode=!1;_domEmitter=new(pe());_previewContainer;static get pluginName(){return"DragDrop"}static get isOfficialPlugin(){return!0}static get requires(){return[Be,Pe,Ul,mA]}init(){let e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,t.addObserver(Sr),t.addObserver(cl),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",(i,o,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(i,o,n)=>{n||this._finalizeDragging(!1)}),V.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._previewContainer&&this._previewContainer.remove(),this._domEmitter.stopListening(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){let e=this.editor,t=e.model,i=e.editing.view,o=i.document,n=e.plugins.get(Ul);this.listenTo(o,"dragstart",(s,r)=>{if(r.target?.is("editableElement")){r.preventDefault();return}if(this._prepareDraggedRange(r.target),!this._draggedRange){r.preventDefault();return}this._draggingUid=ne();let a=this.isEnabled&&e.model.canEditAt(this._draggedRange);r.dataTransfer.effectAllowed=a?"copyMove":"copy",r.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);let l=t.createSelection(this._draggedRange.toRange());this.editor.plugins.get("ClipboardPipeline")._fireOutputTransformationEvent(r.dataTransfer,l,"dragstart");let{dataTransfer:c,domTarget:u,domEvent:d}=r,{clientX:h}=d;this._updatePreview({dataTransfer:c,domTarget:u,clientX:h}),r.stopPropagation(),a||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")},{priority:"low"}),this.listenTo(o,"dragend",(s,r)=>{this._finalizeDragging(!r.dataTransfer.isCanceled&&r.dataTransfer.dropEffect=="move")},{priority:"low"}),this._domEmitter.listenTo(S.document,"dragend",()=>{this._blockMode=!1},{useCapture:!0}),this.listenTo(o,"dragenter",()=>{this.isEnabled&&i.focus()}),this.listenTo(o,"dragleave",()=>{n.removeDropMarkerDelayed()}),this.listenTo(o,"dragging",(s,r)=>{if(!this.isEnabled){r.dataTransfer.dropEffect="none";return}let{clientX:a,clientY:l}=r.domEvent;if(!n.updateDropMarker(r.target,r.targetRanges,a,l,this._blockMode,this._draggedRange)){r.dataTransfer.dropEffect="none";return}this._draggedRange||(r.dataTransfer.dropEffect="copy"),V.isGecko||(r.dataTransfer.effectAllowed=="copy"?r.dataTransfer.dropEffect="copy":["all","copyMove"].includes(r.dataTransfer.effectAllowed)&&(r.dataTransfer.dropEffect="move")),s.stop()},{priority:"low"})}_setupClipboardInputIntegration(){let e=this.editor,t=e.editing.view.document,i=e.plugins.get(Ul);this.listenTo(t,"clipboardInput",(o,n)=>{if(n.method!="drop")return;let{clientX:s,clientY:r}=n.domEvent,a=i.getFinalDropRange(n.target,n.targetRanges,s,r,this._blockMode,this._draggedRange);if(!a){this._finalizeDragging(!1),o.stop();return}if(this._draggedRange&&this._draggingUid!=n.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),y2(n.dataTransfer)=="move"&&this._draggedRange&&this._draggedRange.containsRange(a,!0)){this._finalizeDragging(!1),o.stop();return}n.targetRanges=[e.editing.mapper.toViewRange(a)]},{priority:"high"})}_setupContentInsertionIntegration(){let e=this.editor.plugins.get(Be);e.on("contentInsertion",(t,i)=>{if(!this.isEnabled||i.method!=="drop")return;let o=i.targetRanges.map(n=>this.editor.editing.mapper.toModelRange(n));this.editor.model.change(n=>n.setSelection(o))},{priority:"high"}),e.on("contentInsertion",(t,i)=>{if(!this.isEnabled||i.method!=="drop")return;let o=y2(i.dataTransfer)=="move",n=!i.resultRange||!i.resultRange.isCollapsed;this._finalizeDragging(n&&o)},{priority:"lowest"})}_setupDraggableAttributeHandling(){let e=this.editor,t=e.editing.view,i=t.document;this.listenTo(i,"pointerdown",(o,n)=>{if(V.isAndroid||!n)return;this._clearDraggableAttributesDelayed.cancel();let s=_2(n.target);if(V.isBlink&&!e.isReadOnly&&!s&&!i.selection.isCollapsed){let r=i.selection.getSelectedElement();(!r||!z(r))&&(s=i.selection.editableElement)}s&&(t.change(r=>{r.setAttribute("draggable","true",s)}),this._draggableElement=e.editing.mapper.toModelElement(s))}),this.listenTo(i,"pointerup",()=>{V.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){let e=this.editor.editing;e.view.change(t=>{this._draggableElement&&this._draggableElement.root.rootName!="$graveyard"&&t.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_finalizeDragging(e){let t=this.editor,i=t.model;t.plugins.get(Ul).removeDropMarker(),this._clearDraggableAttributes(),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._previewContainer&&(this._previewContainer.remove(),this._previewContainer=void 0),this._draggedRange&&(e&&this.isEnabled&&i.change(o=>{let n=i.createSelection(this._draggedRange);i.deleteContent(n,{doNotAutoparagraph:!0});let s=n.getFirstPosition().parent;s.isEmpty&&!i.schema.checkChild(s,"$text")&&i.schema.checkChild(s,"paragraph")&&o.insertElement("paragraph",s,0)}),this._draggedRange.detach(),this._draggedRange=null)}_prepareDraggedRange(e){let t=this.editor,i=t.model,o=i.document.selection,n=e?_2(e):null;if(n){let l=t.editing.mapper.toModelElement(n);this._draggedRange=Qe.fromRange(i.createRangeOn(l)),this._blockMode=i.schema.isBlock(l),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop");return}if(o.isCollapsed&&!o.getFirstPosition().parent.isEmpty)return;let s=Array.from(o.getSelectedBlocks()),r=o.getFirstRange();if(s.length==0){this._draggedRange=Qe.fromRange(r);return}let a=x2(i,s);if(s.length>1)this._draggedRange=Qe.fromRange(a),this._blockMode=!0;else if(s.length==1){let l=r.start.isTouching(a.start)&&r.end.isTouching(a.end);this._draggedRange=Qe.fromRange(l?a:r),this._blockMode=l}i.change(l=>l.setSelection(this._draggedRange.toRange()))}_updatePreview({dataTransfer:e,domTarget:t,clientX:i}){let o=this.editor.editing.view,n=o.document.selection.editableElement,s=o.domConverter.mapViewToDom(n),r=S.window.getComputedStyle(s),a=s.ownerDocument;this._previewContainer?this._previewContainer.firstElementChild&&this._previewContainer.removeChild(this._previewContainer.firstElementChild):this._previewContainer=tt(a,"div",{style:"position: fixed; left: -999999px;"});let l=s.getRootNode();st(l)?l.appendChild(this._previewContainer):a.body.appendChild(this._previewContainer);let c=tt(a,"div");c.className="ck ck-content ck-clipboard-preview";let u=new F(s),d=parseFloat(r.paddingLeft),h=parseFloat(r.paddingRight),f=parseFloat(r.width)-d-h;if(rt(s,t))if(V.isiOS)c.style.maxWidth=`${f}px`,c.style.padding="10px",c.style.minWidth="200px",c.style.minHeight="20px",c.style.boxSizing="border-box",c.style.backgroundColor="var(--ck-color-base-background)";else return;else if(V.isiOS)c.style.width=`${f}px`,c.style.backgroundColor="var(--ck-color-base-background)";else{let m=u.left-i+d;c.style.width=`${f+m}px`,c.style.paddingLeft=`${m}px`}o.domConverter.setContentOf(c,e.getData("text/html")),e.setDragImage(c,0,0),this._previewContainer.appendChild(c)}};function y2(e){return V.isGecko?e.dropEffect:["all","copyMove"].includes(e.effectAllowed)?"move":"copy"}function _2(e){if(e.is("editableElement"))return null;if(e.hasClass("ck-widget__selection-handle"))return e.findAncestor(z);if(z(e))return e;let t=e.findAncestor(i=>z(i)||i.is("editableElement"));return z(t)?t:null}function x2(e,t){let i=t[0],o=t[t.length-1],n=i.getCommonAncestor(o),s=e.createPositionBefore(i),r=e.createPositionAfter(o);if(n&&n.is("element")&&!e.schema.isLimit(n)){let a=e.createRangeOn(n),l=s.isTouching(a.start),c=r.isTouching(a.end);if(l&&c)return x2(e,[n])}return e.createRange(s,r)}/** +*/var wA=class extends w{_draggedRange;_draggingUid;_draggableElement;_clearDraggableAttributesDelayed=Os(()=>this._clearDraggableAttributes(),40);_blockMode=!1;_domEmitter=new(be());_previewContainer;static get pluginName(){return"DragDrop"}static get isOfficialPlugin(){return!0}static get requires(){return[Be,Re,$l,pA]}init(){let e=this.editor,t=e.editing.view;this._draggedRange=null,this._draggingUid="",this._draggableElement=null,t.addObserver(Sr),t.addObserver(ul),this._setupDragging(),this._setupContentInsertionIntegration(),this._setupClipboardInputIntegration(),this._setupDraggableAttributeHandling(),this.listenTo(e,"change:isReadOnly",(i,o,n)=>{n?this.forceDisabled("readOnlyMode"):this.clearForceDisabled("readOnlyMode")}),this.on("change:isEnabled",(i,o,n)=>{n||this._finalizeDragging(!1)}),V.isAndroid&&this.forceDisabled("noAndroidSupport")}destroy(){return this._draggedRange&&(this._draggedRange.detach(),this._draggedRange=null),this._previewContainer&&this._previewContainer.remove(),this._domEmitter.stopListening(),this._clearDraggableAttributesDelayed.cancel(),super.destroy()}_setupDragging(){let e=this.editor,t=e.model,i=e.editing.view,o=i.document,n=e.plugins.get($l);this.listenTo(o,"dragstart",(s,r)=>{if(r.target?.is("editableElement")){r.preventDefault();return}if(this._prepareDraggedRange(r.target),!this._draggedRange){r.preventDefault();return}this._draggingUid=ne();let a=this.isEnabled&&e.model.canEditAt(this._draggedRange);r.dataTransfer.effectAllowed=a?"copyMove":"copy",r.dataTransfer.setData("application/ckeditor5-dragging-uid",this._draggingUid);let l=t.createSelection(this._draggedRange.toRange());this.editor.plugins.get("ClipboardPipeline")._fireOutputTransformationEvent(r.dataTransfer,l,"dragstart");let{dataTransfer:c,domTarget:u,domEvent:d}=r,{clientX:h}=d;this._updatePreview({dataTransfer:c,domTarget:u,clientX:h}),r.stopPropagation(),a||(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid="")},{priority:"low"}),this.listenTo(o,"dragend",(s,r)=>{this._finalizeDragging(!r.dataTransfer.isCanceled&&r.dataTransfer.dropEffect=="move")},{priority:"low"}),this._domEmitter.listenTo(S.document,"dragend",()=>{this._blockMode=!1},{useCapture:!0}),this.listenTo(o,"dragenter",()=>{this.isEnabled&&i.focus()}),this.listenTo(o,"dragleave",()=>{n.removeDropMarkerDelayed()}),this.listenTo(o,"dragging",(s,r)=>{if(!this.isEnabled){r.dataTransfer.dropEffect="none";return}let{clientX:a,clientY:l}=r.domEvent;if(!n.updateDropMarker(r.target,r.targetRanges,a,l,this._blockMode,this._draggedRange)){r.dataTransfer.dropEffect="none";return}this._draggedRange||(r.dataTransfer.dropEffect="copy"),V.isGecko||(r.dataTransfer.effectAllowed=="copy"?r.dataTransfer.dropEffect="copy":["all","copyMove"].includes(r.dataTransfer.effectAllowed)&&(r.dataTransfer.dropEffect="move")),s.stop()},{priority:"low"})}_setupClipboardInputIntegration(){let e=this.editor,t=e.editing.view.document,i=e.plugins.get($l);this.listenTo(t,"clipboardInput",(o,n)=>{if(n.method!="drop")return;let{clientX:s,clientY:r}=n.domEvent,a=i.getFinalDropRange(n.target,n.targetRanges,s,r,this._blockMode,this._draggedRange);if(!a){this._finalizeDragging(!1),o.stop();return}if(this._draggedRange&&this._draggingUid!=n.dataTransfer.getData("application/ckeditor5-dragging-uid")&&(this._draggedRange.detach(),this._draggedRange=null,this._draggingUid=""),_2(n.dataTransfer)=="move"&&this._draggedRange&&this._draggedRange.containsRange(a,!0)){this._finalizeDragging(!1),o.stop();return}n.targetRanges=[e.editing.mapper.toViewRange(a)]},{priority:"high"})}_setupContentInsertionIntegration(){let e=this.editor.plugins.get(Be);e.on("contentInsertion",(t,i)=>{if(!this.isEnabled||i.method!=="drop")return;let o=i.targetRanges.map(n=>this.editor.editing.mapper.toModelRange(n));this.editor.model.change(n=>n.setSelection(o))},{priority:"high"}),e.on("contentInsertion",(t,i)=>{if(!this.isEnabled||i.method!=="drop")return;let o=_2(i.dataTransfer)=="move",n=!i.resultRange||!i.resultRange.isCollapsed;this._finalizeDragging(n&&o)},{priority:"lowest"})}_setupDraggableAttributeHandling(){let e=this.editor,t=e.editing.view,i=t.document;this.listenTo(i,"pointerdown",(o,n)=>{if(V.isAndroid||!n)return;this._clearDraggableAttributesDelayed.cancel();let s=v2(n.target);if(V.isBlink&&!e.isReadOnly&&!s&&!i.selection.isCollapsed){let r=i.selection.getSelectedElement();(!r||!z(r))&&(s=i.selection.editableElement)}s&&(t.change(r=>{r.setAttribute("draggable","true",s)}),this._draggableElement=e.editing.mapper.toModelElement(s))}),this.listenTo(i,"pointerup",()=>{V.isAndroid||this._clearDraggableAttributesDelayed()})}_clearDraggableAttributes(){let e=this.editor.editing;e.view.change(t=>{this._draggableElement&&this._draggableElement.root.rootName!="$graveyard"&&t.removeAttribute("draggable",e.mapper.toViewElement(this._draggableElement)),this._draggableElement=null})}_finalizeDragging(e){let t=this.editor,i=t.model;t.plugins.get($l).removeDropMarker(),this._clearDraggableAttributes(),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").clearForceDisabled("dragDrop"),this._draggingUid="",this._previewContainer&&(this._previewContainer.remove(),this._previewContainer=void 0),this._draggedRange&&(e&&this.isEnabled&&i.change(o=>{let n=i.createSelection(this._draggedRange);i.deleteContent(n,{doNotAutoparagraph:!0});let s=n.getFirstPosition().parent;s.isEmpty&&!i.schema.checkChild(s,"$text")&&i.schema.checkChild(s,"paragraph")&&o.insertElement("paragraph",s,0)}),this._draggedRange.detach(),this._draggedRange=null)}_prepareDraggedRange(e){let t=this.editor,i=t.model,o=i.document.selection,n=e?v2(e):null;if(n){let l=t.editing.mapper.toModelElement(n);this._draggedRange=Qe.fromRange(i.createRangeOn(l)),this._blockMode=i.schema.isBlock(l),t.plugins.has("WidgetToolbarRepository")&&t.plugins.get("WidgetToolbarRepository").forceDisabled("dragDrop");return}if(o.isCollapsed&&!o.getFirstPosition().parent.isEmpty)return;let s=Array.from(o.getSelectedBlocks()),r=o.getFirstRange();if(s.length==0){this._draggedRange=Qe.fromRange(r);return}let a=T2(i,s);if(s.length>1)this._draggedRange=Qe.fromRange(a),this._blockMode=!0;else if(s.length==1){let l=r.start.isTouching(a.start)&&r.end.isTouching(a.end);this._draggedRange=Qe.fromRange(l?a:r),this._blockMode=l}i.change(l=>l.setSelection(this._draggedRange.toRange()))}_updatePreview({dataTransfer:e,domTarget:t,clientX:i}){let o=this.editor.editing.view,n=o.document.selection.editableElement,s=o.domConverter.mapViewToDom(n),r=S.window.getComputedStyle(s),a=s.ownerDocument;this._previewContainer?this._previewContainer.firstElementChild&&this._previewContainer.removeChild(this._previewContainer.firstElementChild):this._previewContainer=tt(a,"div",{style:"position: fixed; left: -999999px;"});let l=s.getRootNode();st(l)?l.appendChild(this._previewContainer):a.body.appendChild(this._previewContainer);let c=tt(a,"div");c.className="ck ck-content ck-clipboard-preview";let u=new F(s),d=parseFloat(r.paddingLeft),h=parseFloat(r.paddingRight),f=parseFloat(r.width)-d-h;if(rt(s,t))if(V.isiOS)c.style.maxWidth=`${f}px`,c.style.padding="10px",c.style.minWidth="200px",c.style.minHeight="20px",c.style.boxSizing="border-box",c.style.backgroundColor="var(--ck-color-base-background)";else return;else if(V.isiOS)c.style.width=`${f}px`,c.style.backgroundColor="var(--ck-color-base-background)";else{let m=u.left-i+d;c.style.width=`${f+m}px`,c.style.paddingLeft=`${m}px`}o.domConverter.setContentOf(c,e.getData("text/html")),e.setDragImage(c,0,0),this._previewContainer.appendChild(c)}};function _2(e){return V.isGecko?e.dropEffect:["all","copyMove"].includes(e.effectAllowed)?"move":"copy"}function v2(e){if(e.is("editableElement"))return null;if(e.hasClass("ck-widget__selection-handle"))return e.findAncestor(z);if(z(e))return e;let t=e.findAncestor(i=>z(i)||i.is("editableElement"));return z(t)?t:null}function T2(e,t){let i=t[0],o=t[t.length-1],n=i.getCommonAncestor(o),s=e.createPositionBefore(i),r=e.createPositionAfter(o);if(n&&n.is("element")&&!e.schema.isLimit(n)){let a=e.createRangeOn(n),l=s.isTouching(a.start),c=r.isTouching(a.end);if(l&&c)return T2(e,[n])}return e.createRange(s,r)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var bA=class extends y{static get pluginName(){return"PastePlainText"}static get isOfficialPlugin(){return!0}static get requires(){return[Be]}init(){let e=this.editor,t=e.model,i=e.editing.view,o=t.document.selection;i.addObserver(Sr),e.plugins.get(Be).on("contentInsertion",(n,s)=>{wA(s.content,t)&&t.change(r=>{let a=Array.from(o.getAttributes()).filter(([c])=>t.schema.getAttributeProperties(c).isFormatting);o.isCollapsed||t.deleteContent(o,{doNotAutoparagraph:!0}),a.push(...o.getAttributes());let l=r.createRangeIn(s.content);for(let c of l.getItems())for(let u of a)t.schema.checkAttribute(c,u[0])&&r.setAttribute(u[0],u[1],c)})})}};function wA(e,t){let i=t.createRangeIn(e);if(e.childCount==1){let o=e.getChild(0);o.is("element")&&t.schema.isBlock(o)&&!t.schema.isObject(o)&&!t.schema.isLimit(o)&&(i=t.createRangeIn(o))}for(let o of i.getItems())if(!t.schema.isInline(o)||Array.from(o.getAttributeKeys()).find(n=>t.schema.getAttributeProperties(n).isFormatting))return!1;return!0}/** +*/var yA=class extends w{static get pluginName(){return"PastePlainText"}static get isOfficialPlugin(){return!0}static get requires(){return[Be]}init(){let e=this.editor,t=e.model,i=e.editing.view,o=t.document.selection;i.addObserver(Sr),e.plugins.get(Be).on("contentInsertion",(n,s)=>{_A(s.content,t)&&t.change(r=>{let a=Array.from(o.getAttributes()).filter(([c])=>t.schema.getAttributeProperties(c).isFormatting);o.isCollapsed||t.deleteContent(o,{doNotAutoparagraph:!0}),a.push(...o.getAttributes());let l=r.createRangeIn(s.content);for(let c of l.getItems())for(let u of a)t.schema.checkAttribute(c,u[0])&&r.setAttribute(u[0],u[1],c)})})}};function _A(e,t){let i=t.createRangeIn(e);if(e.childCount==1){let o=e.getChild(0);o.is("element")&&t.schema.isBlock(o)&&!t.schema.isObject(o)&&!t.schema.isLimit(o)&&(i=t.createRangeIn(o))}for(let o of i.getItems())if(!t.schema.isInline(o)||Array.from(o.getAttributeKeys()).find(n=>t.schema.getAttributeProperties(n).isFormatting))return!1;return!0}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Th=class extends y{static get pluginName(){return"Clipboard"}static get isOfficialPlugin(){return!0}static get requires(){return[ss,Be,pA,bA]}init(){let e=this.editor,t=this.editor.t;e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Copy selected content"),keystroke:"CTRL+C"},{label:t("Paste content"),keystroke:"CTRL+V"},{label:t("Paste content as plain text"),keystroke:"CTRL+SHIFT+V"}]})}};/** +*/var Ah=class extends w{static get pluginName(){return"Clipboard"}static get isOfficialPlugin(){return!0}static get requires(){return[ss,Be,wA,yA]}init(){let e=this.editor,t=this.editor.t;e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Copy selected content"),keystroke:"CTRL+C"},{label:t("Paste content"),keystroke:"CTRL+V"},{label:t("Paste content as plain text"),keystroke:"CTRL+SHIFT+V"}]})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -1258,22 +1258,22 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var T2=class extends M{_stack=[];_createdBatches=new WeakSet;constructor(e){super(e),this.refresh(),this._isEnabledBasedOnSelection=!1,this.listenTo(e.data,"set",(t,i)=>{i[1]={...i[1]};let o=i[1];o.batchType||(o.batchType={isUndoable:!1})},{priority:"high"}),this.listenTo(e.data,"set",(t,i)=>{i[1].batchType.isUndoable||this.clearStack()})}refresh(){this.isEnabled=this._stack.length>0}get createdBatches(){return this._createdBatches}addBatch(e){let t=this.editor.model.document.selection,i={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:i}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,i){let o=this.editor.model,n=o.document,s=[],r=e.map(l=>l.getTransformedByOperations(i)),a=r.flat();for(let l of r){let c=l.filter(u=>u.root!=n.graveyard).filter(u=>!_A(u,a));c.length&&(yA(c),s.push(c[0]))}s.length&&o.change(l=>{l.setSelection(s,{backward:t})})}_undo(e,t){let i=this.editor.model,o=i.document;this._createdBatches.add(t);let n=e.operations.slice().filter(s=>s.isDocumentOperation);n.reverse();for(let s of n){let r=s.baseVersion+1,a=Array.from(o.history.getOperations(r)),l=Zp([s.getReversed()],a,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(let c of l){let u=c.affectedSelectable;u&&!i.canEditAt(u)&&(c=new Le(c.baseVersion)),t.addOperation(c),i.applyOperation(c),o.history.setOperationAsUndone(s,c)}}}};function yA(e){e.sort((t,i)=>t.start.isBefore(i.start)?-1:1);for(let t=1;ti!==e&&i.containsRange(e,!0))}/** +*/var E2=class extends M{_stack=[];_createdBatches=new WeakSet;constructor(e){super(e),this.refresh(),this._isEnabledBasedOnSelection=!1,this.listenTo(e.data,"set",(t,i)=>{i[1]={...i[1]};let o=i[1];o.batchType||(o.batchType={isUndoable:!1})},{priority:"high"}),this.listenTo(e.data,"set",(t,i)=>{i[1].batchType.isUndoable||this.clearStack()})}refresh(){this.isEnabled=this._stack.length>0}get createdBatches(){return this._createdBatches}addBatch(e){let t=this.editor.model.document.selection,i={ranges:t.hasOwnRange?Array.from(t.getRanges()):[],isBackward:t.isBackward};this._stack.push({batch:e,selection:i}),this.refresh()}clearStack(){this._stack=[],this.refresh()}_restoreSelection(e,t,i){let o=this.editor.model,n=o.document,s=[],r=e.map(l=>l.getTransformedByOperations(i)),a=r.flat();for(let l of r){let c=l.filter(u=>u.root!=n.graveyard).filter(u=>!kA(u,a));c.length&&(vA(c),s.push(c[0]))}s.length&&o.change(l=>{l.setSelection(s,{backward:t})})}_undo(e,t){let i=this.editor.model,o=i.document;this._createdBatches.add(t);let n=e.operations.slice().filter(s=>s.isDocumentOperation);n.reverse();for(let s of n){let r=s.baseVersion+1,a=Array.from(o.history.getOperations(r)),l=Yp([s.getReversed()],a,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;for(let c of l){let u=c.affectedSelectable;u&&!i.canEditAt(u)&&(c=new Le(c.baseVersion)),t.addOperation(c),i.applyOperation(c),o.history.setOperationAsUndone(s,c)}}}};function vA(e){e.sort((t,i)=>t.start.isBefore(i.start)?-1:1);for(let t=1;ti!==e&&i.containsRange(e,!0))}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var vA=class extends T2{execute(e=null){let t=e?this._stack.findIndex(n=>n.batch==e):this._stack.length-1,i=this._stack.splice(t,1)[0],o=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(o,()=>{this._undo(i.batch,o);let n=this.editor.model.document.history.getOperations(i.batch.baseVersion);this._restoreSelection(i.selection.ranges,i.selection.isBackward,n)}),this.fire("revert",i.batch,o),this.refresh()}};/** +*/var CA=class extends E2{execute(e=null){let t=e?this._stack.findIndex(n=>n.batch==e):this._stack.length-1,i=this._stack.splice(t,1)[0],o=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(o,()=>{this._undo(i.batch,o);let n=this.editor.model.document.history.getOperations(i.batch.baseVersion);this._restoreSelection(i.selection.ranges,i.selection.isBackward,n)}),this.fire("revert",i.batch,o),this.refresh()}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var kA=class extends T2{execute(){let e=this._stack.pop(),t=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(t,()=>{let i=e.batch.operations[e.batch.operations.length-1].baseVersion+1,o=this.editor.model.document.history.getOperations(i);this._restoreSelection(e.selection.ranges,e.selection.isBackward,o),this._undo(e.batch,t)}),this.fire("revert",e.batch,t),this.refresh()}};/** +*/var xA=class extends E2{execute(){let e=this._stack.pop(),t=this.editor.model.createBatch({isUndo:!0});this.editor.model.enqueueChange(t,()=>{let i=e.batch.operations[e.batch.operations.length-1].baseVersion+1,o=this.editor.model.document.history.getOperations(i);this._restoreSelection(e.selection.ranges,e.selection.isBackward,o),this._undo(e.batch,t)}),this.fire("revert",e.batch,t),this.refresh()}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var CA=class extends y{_undoCommand;_redoCommand;_batchRegistry=new WeakSet;static get pluginName(){return"UndoEditing"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.t;this._undoCommand=new vA(e),this._redoCommand=new kA(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",(i,o)=>{let n=o[0];if(!n.isDocumentOperation)return;let s=n.batch,r=this._redoCommand.createdBatches.has(s),a=this._undoCommand.createdBatches.has(s);this._batchRegistry.has(s)||(this._batchRegistry.add(s),s.isUndoable&&(r?this._undoCommand.addBatch(s):a||(this._undoCommand.addBatch(s),this._redoCommand.clearStack())))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(i,o,n)=>{this._redoCommand.addBatch(n)}),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Undo"),keystroke:"CTRL+Z"},{label:t("Redo"),keystroke:[["CTRL+Y"],["CTRL+SHIFT+Z"]]}]})}};/** +*/var TA=class extends w{_undoCommand;_redoCommand;_batchRegistry=new WeakSet;static get pluginName(){return"UndoEditing"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.t;this._undoCommand=new CA(e),this._redoCommand=new xA(e),e.commands.add("undo",this._undoCommand),e.commands.add("redo",this._redoCommand),this.listenTo(e.model,"applyOperation",(i,o)=>{let n=o[0];if(!n.isDocumentOperation)return;let s=n.batch,r=this._redoCommand.createdBatches.has(s),a=this._undoCommand.createdBatches.has(s);this._batchRegistry.has(s)||(this._batchRegistry.add(s),s.isUndoable&&(r?this._undoCommand.addBatch(s):a||(this._undoCommand.addBatch(s),this._redoCommand.clearStack())))},{priority:"highest"}),this.listenTo(this._undoCommand,"revert",(i,o,n)=>{this._redoCommand.addBatch(n)}),e.keystrokes.set("CTRL+Z","undo"),e.keystrokes.set("CTRL+Y","redo"),e.keystrokes.set("CTRL+SHIFT+Z","redo"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Undo"),keystroke:"CTRL+Z"},{label:t("Redo"),keystroke:[["CTRL+Y"],["CTRL+SHIFT+Z"]]}]})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var xA=class extends y{static get pluginName(){return"UndoUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.locale,i=e.t,o=t.uiLanguageDirection=="ltr"?qd:Hd,n=t.uiLanguageDirection=="ltr"?Hd:qd;this._addButtonsToFactory("undo",i("Undo"),"CTRL+Z",o),this._addButtonsToFactory("redo",i("Redo"),"CTRL+Y",n)}_addButtonsToFactory(e,t,i,o){let n=this.editor;n.ui.componentFactory.add(e,()=>{let s=this._createButton(I,e,t,i,o);return s.set({tooltip:!0}),s}),n.ui.componentFactory.add("menuBar:"+e,()=>this._createButton(oe,e,t,i,o))}_createButton(e,t,i,o,n){let s=this.editor,r=s.locale,a=s.commands.get(t),l=new e(r);return l.set({label:i,icon:n,keystroke:o}),l.bind("isEnabled").to(a,"isEnabled"),this.listenTo(l,"execute",()=>{s.execute(t),s.editing.view.focus()}),l}};/** +*/var EA=class extends w{static get pluginName(){return"UndoUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.locale,i=e.t,o=t.uiLanguageDirection=="ltr"?jd:Ud,n=t.uiLanguageDirection=="ltr"?Ud:jd;this._addButtonsToFactory("undo",i("Undo"),"CTRL+Z",o),this._addButtonsToFactory("redo",i("Redo"),"CTRL+Y",n)}_addButtonsToFactory(e,t,i,o){let n=this.editor;n.ui.componentFactory.add(e,()=>{let s=this._createButton(I,e,t,i,o);return s.set({tooltip:!0}),s}),n.ui.componentFactory.add("menuBar:"+e,()=>this._createButton(oe,e,t,i,o))}_createButton(e,t,i,o,n){let s=this.editor,r=s.locale,a=s.commands.get(t),l=new e(r);return l.set({label:i,icon:n,keystroke:o}),l.bind("isEnabled").to(a,"isEnabled"),this.listenTo(l,"execute",()=>{s.execute(t),s.editing.view.focus()}),l}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Eh=class extends y{static get requires(){return[CA,xA]}static get pluginName(){return"Undo"}static get isOfficialPlugin(){return!0}};/** +*/var Ih=class extends w{static get requires(){return[TA,EA]}static get pluginName(){return"Undo"}static get isOfficialPlugin(){return!0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -1282,109 +1282,109 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function TA(e){return e.createContainerElement("span",{class:"image-inline"},e.createEmptyElement("img"))}function E2(e){return e.createContainerElement("figure",{class:"image"},[e.createEmptyElement("img"),e.createSlot("children")])}function EA(e,t){return e.getStyle("display")=="block"||e.findAncestor(t.isBlockImageView)?"imageBlock":"imageInline"}function rs(e,t,i){return!!e.findAllowedParent(t,i)||rl(t,i,e)}function Ph(e,t){let i=G(t.getSelectedBlocks());return!i||e.isObject(i)||i.isEmpty&&i.name!="listItem"?"imageBlock":"imageInline"}function jl(e){return e&&e.endsWith("px")?parseInt(e):null}function Kl(e){let t=jl(e.getStyle("width")),i=jl(e.getStyle("height"));return!!(t&&i)}/** +*/function AA(e){return e.createContainerElement("span",{class:"image-inline"},e.createEmptyElement("img"))}function A2(e){return e.createContainerElement("figure",{class:"image"},[e.createEmptyElement("img"),e.createSlot("children")])}function IA(e,t){return e.getStyle("display")=="block"||e.findAncestor(t.isBlockImageView)?"imageBlock":"imageInline"}function rs(e,t,i){return!!e.findAllowedParent(t,i)||al(t,i,e)}function Vh(e,t){let i=J(t.getSelectedBlocks());return!i||e.isObject(i)||i.isEmpty&&i.name!="listItem"?"imageBlock":"imageInline"}function Gl(e){return e&&e.endsWith("px")?parseInt(e):null}function Jl(e){let t=Gl(e.getStyle("width")),i=Gl(e.getStyle("height"));return!!(t&&i)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var AA=/^(image|image-inline)$/,Ue=class extends y{_domEmitter=new(pe());static get pluginName(){return"ImageUtils"}static get isOfficialPlugin(){return!0}isImage(e){return this.isInlineImage(e)||this.isBlockImage(e)}isInlineImageView(e){return!!e&&e.is("element","img")}isBlockImageView(e){return!!e&&e.is("element","figure")&&e.hasClass("image")}insertImage(e={},t=null,i=null,o={}){let n=this.editor,s=n.model,r=s.document.selection,a=M2(n,t||r,i);e={...Object.fromEntries(r.getAttributes()),...e};for(let l in e)s.schema.checkAttribute(a,l)||delete e[l];return s.change(l=>{let{setImageSizes:c=!0}=o,u=l.createElement(a,e);return s.insertObject(u,t,null,{setSelection:"on",findOptimalPosition:!t&&a!="imageInline"?"auto":void 0}),u.parent?(c&&this.setImageNaturalSizeAttributes(u),u):null})}setImageNaturalSizeAttributes(e){let t=e.getAttribute("src");t&&(e.getAttribute("width")||e.getAttribute("height")||this.editor.model.change(i=>{let o=new S.window.Image;this._domEmitter.listenTo(o,"load",()=>{!e.getAttribute("width")&&!e.getAttribute("height")&&this.editor.model.enqueueChange(i.batch,n=>{n.setAttribute("width",o.naturalWidth,e),n.setAttribute("height",o.naturalHeight,e)}),this._domEmitter.stopListening(o,"load")}),o.src=t}))}getClosestSelectedImageWidget(e){let t=e.getFirstPosition();if(!t)return null;let i=e.getSelectedElement();if(i&&this.isImageWidget(i))return i;let o=t.parent;for(;o;){if(o.is("element")&&this.isImageWidget(o))return o;o=o.parent}return null}getClosestSelectedImageElement(e){let t=e.getSelectedElement();return this.isImage(t)?t:e.getFirstPosition().findAncestor("imageBlock")}getImageWidgetFromImageView(e){return e.findAncestor({classes:AA})}isImageAllowed(){let e=this.editor.model.document.selection;return IA(this.editor,e)&&SA(e)}toImageWidget(e,t,i){return t.setCustomProperty("image",!0,e),me(e,t,{label:()=>{let n=this.findViewImgElement(e).getAttribute("alt");return n?`${n} ${i}`:i}})}isImageWidget(e){return!!e.getCustomProperty("image")&&z(e)}isBlockImage(e){return!!e&&e.is("element","imageBlock")}isInlineImage(e){return!!e&&e.is("element","imageInline")}findViewImgElement(e){if(this.isInlineImageView(e))return e;let t=this.editor.editing.view;for(let{item:i}of t.createRangeIn(e))if(this.isInlineImageView(i))return i}destroy(){return this._domEmitter.stopListening(),super.destroy()}};function IA(e,t){return M2(e,t,null)=="imageBlock"?L2(e.model,t):e.model.schema.checkChild(t.focus,"imageInline")}function SA(e){return[...e.focus.getAncestors()].every(t=>!t.is("element","imageBlock"))}function PA(e,t){let i=es(e,t).start.parent;return i.isEmpty&&!i.is("rootElement")?i.parent:i}function L2(e,t){let i=PA(t.is("position")?e.createSelection(t):t,e);return e.schema.checkChild(i,"imageBlock")}function M2(e,t,i){let o=e.model.schema,n=e.config.get("image.insert.type");return e.plugins.has("ImageBlockEditing")?e.plugins.has("ImageInlineEditing")?i||(!L2(e.model,t)||n==="inline"?"imageInline":n!=="auto"?"imageBlock":t.is("selection")?Ph(o,t):o.checkChild(t,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}/** +*/var SA=/^(image|image-inline)$/,Ue=class extends w{_domEmitter=new(be());static get pluginName(){return"ImageUtils"}static get isOfficialPlugin(){return!0}isImage(e){return this.isInlineImage(e)||this.isBlockImage(e)}isInlineImageView(e){return!!e&&e.is("element","img")}isBlockImageView(e){return!!e&&e.is("element","figure")&&e.hasClass("image")}insertImage(e={},t=null,i=null,o={}){let n=this.editor,s=n.model,r=s.document.selection,a=B2(n,t||r,i);e={...Object.fromEntries(r.getAttributes()),...e};for(let l in e)s.schema.checkAttribute(a,l)||delete e[l];return s.change(l=>{let{setImageSizes:c=!0}=o,u=l.createElement(a,e);return s.insertObject(u,t,null,{setSelection:"on",findOptimalPosition:!t&&a!="imageInline"?"auto":void 0}),u.parent?(c&&this.setImageNaturalSizeAttributes(u),u):null})}setImageNaturalSizeAttributes(e){let t=e.getAttribute("src");t&&(e.getAttribute("width")||e.getAttribute("height")||this.editor.model.change(i=>{let o=new S.window.Image;this._domEmitter.listenTo(o,"load",()=>{!e.getAttribute("width")&&!e.getAttribute("height")&&this.editor.model.enqueueChange(i.batch,n=>{n.setAttribute("width",o.naturalWidth,e),n.setAttribute("height",o.naturalHeight,e)}),this._domEmitter.stopListening(o,"load")}),o.src=t}))}getClosestSelectedImageWidget(e){let t=e.getFirstPosition();if(!t)return null;let i=e.getSelectedElement();if(i&&this.isImageWidget(i))return i;let o=t.parent;for(;o;){if(o.is("element")&&this.isImageWidget(o))return o;o=o.parent}return null}getClosestSelectedImageElement(e){let t=e.getSelectedElement();return this.isImage(t)?t:e.getFirstPosition().findAncestor("imageBlock")}getImageWidgetFromImageView(e){return e.findAncestor({classes:SA})}isImageAllowed(){let e=this.editor.model.document.selection;return PA(this.editor,e)&&RA(e)}toImageWidget(e,t,i){return t.setCustomProperty("image",!0,e),me(e,t,{label:()=>{let n=this.findViewImgElement(e).getAttribute("alt");return n?`${n} ${i}`:i}})}isImageWidget(e){return!!e.getCustomProperty("image")&&z(e)}isBlockImage(e){return!!e&&e.is("element","imageBlock")}isInlineImage(e){return!!e&&e.is("element","imageInline")}findViewImgElement(e){if(this.isInlineImageView(e))return e;let t=this.editor.editing.view;for(let{item:i}of t.createRangeIn(e))if(this.isInlineImageView(i))return i}destroy(){return this._domEmitter.stopListening(),super.destroy()}};function PA(e,t){return B2(e,t,null)=="imageBlock"?M2(e.model,t):e.model.schema.checkChild(t.focus,"imageInline")}function RA(e){return[...e.focus.getAncestors()].every(t=>!t.is("element","imageBlock"))}function VA(e,t){let i=es(e,t).start.parent;return i.isEmpty&&!i.is("rootElement")?i.parent:i}function M2(e,t){let i=VA(t.is("position")?e.createSelection(t):t,e);return e.schema.checkChild(i,"imageBlock")}function B2(e,t,i){let o=e.model.schema,n=e.config.get("image.insert.type");return e.plugins.has("ImageBlockEditing")?e.plugins.has("ImageInlineEditing")?i||(!M2(e.model,t)||n==="inline"?"imageInline":n!=="auto"?"imageBlock":t.is("selection")?Vh(o,t):o.checkChild(t,"imageInline")?"imageInline":"imageBlock"):"imageBlock":"imageInline"}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var DG=new RegExp(String(/^(http(s)?:\/\/)?[\w-]+\.[\w.~:/[\]@!$&'()*+,;=%-]+/.source+/\.(jpg|jpeg|png|gif|ico|webp|JPG|JPEG|PNG|GIF|ICO|WEBP)/.source+/(\?[\w.~:/[\]@!$&'()*+,;=%-]*)?/.source+/(#[\w.~:/[\]@!$&'()*+,;=%-]*)?$/.source));/** +*/var HG=new RegExp(String(/^(http(s)?:\/\/)?[\w-]+\.[\w.~:/[\]@!$&'()*+,;=%-]+/.source+/\.(jpg|jpeg|png|gif|ico|webp|JPG|JPEG|PNG|GIF|ICO|WEBP)/.source+/(\?[\w.~:/[\]@!$&'()*+,;=%-]*)?/.source+/(#[\w.~:/[\]@!$&'()*+,;=%-]*)?$/.source));/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var RA=class extends M{refresh(){let e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}execute(e){let t=this.editor,i=t.plugins.get("ImageUtils"),o=t.model,n=i.getClosestSelectedImageElement(o.document.selection);o.change(s=>{s.setAttribute("alt",e.newValue,n)})}};/** +*/var LA=class extends M{refresh(){let e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled&&e.hasAttribute("alt")?this.value=e.getAttribute("alt"):this.value=!1}execute(e){let t=this.editor,i=t.plugins.get("ImageUtils"),o=t.model,n=i.getClosestSelectedImageElement(o.document.selection);o.change(s=>{s.setAttribute("alt",e.newValue,n)})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var VA=class extends y{static get requires(){return[Ue]}static get pluginName(){return"ImageTextAlternativeEditing"}static get isOfficialPlugin(){return!0}init(){this.editor.commands.add("imageTextAlternative",new RA(this.editor))}};/** +*/var MA=class extends w{static get requires(){return[Ue]}static get pluginName(){return"ImageTextAlternativeEditing"}static get isOfficialPlugin(){return!0}init(){this.editor.commands.add("imageTextAlternative",new LA(this.editor))}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var LA=class extends R{focusTracker;keystrokes;labeledInput;backButtonView;saveButtonView;children;_focusables;_focusCycler;constructor(e){super(e),this.focusTracker=new Q,this.keystrokes=new X,this.backButtonView=this._createBackButton(),this.saveButtonView=this._createSaveButton(),this.labeledInput=this._createLabeledInputView(),this.children=this.createCollection([this._createHeaderView()]),this.children.add(new fe(e,{children:[this.labeledInput,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-top-padding","ck-form__row_large-bottom-padding"]})),this._focusables=new be,this.keystrokes.set("Esc",(t,i)=>{this.fire("cancel"),i()}),this._focusCycler=new Ie({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:this.children})}render(){super.render(),_i({view:this}),[this.backButtonView,this.labeledInput,this.saveButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createBackButton(){let e=this.locale.t,t=new I(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:yt,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createSaveButton(){let e=this.locale.t,t=new I(this.locale);return t.set({label:e("Save"),withText:!0,type:"submit",class:"ck-button-action ck-button_standard"}),t}_createHeaderView(){let e=this.locale.t,t=new Mt(this.locale,{label:e("Text Alternative")});return t.children.add(this.backButtonView,0),t}_createLabeledInputView(){let e=this.locale.t,t=new ue(this.locale,nt);return t.label=e("Text alternative"),t.class="ck-labeled-field-view_full-width",t}};/** +*/var BA=class extends R{focusTracker;keystrokes;labeledInput;backButtonView;saveButtonView;children;_focusables;_focusCycler;constructor(e){super(e),this.focusTracker=new Q,this.keystrokes=new X,this.backButtonView=this._createBackButton(),this.saveButtonView=this._createSaveButton(),this.labeledInput=this._createLabeledInputView(),this.children=this.createCollection([this._createHeaderView()]),this.children.add(new fe(e,{children:[this.labeledInput,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-top-padding","ck-form__row_large-bottom-padding"]})),this._focusables=new we,this.keystrokes.set("Esc",(t,i)=>{this.fire("cancel"),i()}),this._focusCycler=new Pe({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-text-alternative-form","ck-responsive-form"],tabindex:"-1"},children:this.children})}render(){super.render(),ki({view:this}),[this.backButtonView,this.labeledInput,this.saveButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createBackButton(){let e=this.locale.t,t=new I(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:_t,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createSaveButton(){let e=this.locale.t,t=new I(this.locale);return t.set({label:e("Save"),withText:!0,type:"submit",class:"ck-button-action ck-button_standard"}),t}_createHeaderView(){let e=this.locale.t,t=new Bt(this.locale,{label:e("Text Alternative")});return t.children.add(this.backButtonView,0),t}_createLabeledInputView(){let e=this.locale.t,t=new ue(this.locale,nt);return t.label=e("Text alternative"),t.class="ck-labeled-field-view_full-width",t}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function MA(e){let t=e.plugins.get("ContextualBalloon");if(e.plugins.get("ImageUtils").getClosestSelectedImageWidget(e.editing.view.document.selection)){let i=Rh(e);t.updatePosition(i)}}function Rh(e){let t=e.editing.view,i=Me.defaultPositions,o=e.plugins.get("ImageUtils");return{target:t.domConverter.mapViewToDom(o.getClosestSelectedImageWidget(t.document.selection)),positions:[i.northArrowSouth,i.northWestArrowSouthWest,i.northEastArrowSouthEast,i.southArrowNorth,i.southWestArrowNorthWest,i.southEastArrowNorthEast,i.viewportStickyNorth]}}/** +*/function OA(e){let t=e.plugins.get("ContextualBalloon");if(e.plugins.get("ImageUtils").getClosestSelectedImageWidget(e.editing.view.document.selection)){let i=Lh(e);t.updatePosition(i)}}function Lh(e){let t=e.editing.view,i=Me.defaultPositions,o=e.plugins.get("ImageUtils");return{target:t.domConverter.mapViewToDom(o.getClosestSelectedImageWidget(t.document.selection)),positions:[i.northArrowSouth,i.northWestArrowSouthWest,i.northEastArrowSouthEast,i.southArrowNorth,i.southWestArrowNorthWest,i.southEastArrowNorthEast,i.viewportStickyNorth]}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var BA=class extends y{_balloon;_form;static get requires(){return[re]}static get pluginName(){return"ImageTextAlternativeUI"}static get isOfficialPlugin(){return!0}init(){this._createButton()}destroy(){super.destroy(),this._form&&this._form.destroy()}_createButton(){let e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",i=>{let o=e.commands.get("imageTextAlternative"),n=new I(i);return n.set({label:t("Change image text alternative"),icon:mb,tooltip:!0}),n.bind("isEnabled").to(o,"isEnabled"),n.bind("isOn").to(o,"value",s=>!!s),this.listenTo(n,"execute",()=>{this._showForm()}),n})}_createForm(){let e=this.editor,t=e.editing.view.document,i=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(Kn(LA))(e.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this.listenTo(e.ui,"update",()=>{i.getClosestSelectedImageWidget(t.selection)?this._isVisible&&MA(e):this._hideForm(!0)}),vt({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;this._form||this._createForm();let e=this.editor,t=e.commands.get("imageTextAlternative"),i=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:Rh(e)}),i.fieldView.value=i.fieldView.element.value=t.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}};/** +*/var DA=class extends w{_balloon;_form;static get requires(){return[re]}static get pluginName(){return"ImageTextAlternativeUI"}static get isOfficialPlugin(){return!0}init(){this._createButton()}destroy(){super.destroy(),this._form&&this._form.destroy()}_createButton(){let e=this.editor,t=e.t;e.ui.componentFactory.add("imageTextAlternative",i=>{let o=e.commands.get("imageTextAlternative"),n=new I(i);return n.set({label:t("Change image text alternative"),icon:pb,tooltip:!0}),n.bind("isEnabled").to(o,"isEnabled"),n.bind("isOn").to(o,"value",s=>!!s),this.listenTo(n,"execute",()=>{this._showForm()}),n})}_createForm(){let e=this.editor,t=e.editing.view.document,i=e.plugins.get("ImageUtils");this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(Kn(BA))(e.locale),this._form.render(),this.listenTo(this._form,"submit",()=>{e.execute("imageTextAlternative",{newValue:this._form.labeledInput.fieldView.element.value}),this._hideForm(!0)}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),this.listenTo(e.ui,"update",()=>{i.getClosestSelectedImageWidget(t.selection)?this._isVisible&&OA(e):this._hideForm(!0)}),kt({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(){if(this._isVisible)return;this._form||this._createForm();let e=this.editor,t=e.commands.get("imageTextAlternative"),i=this._form.labeledInput;this._form.disableCssTransitions(),this._isInBalloon||this._balloon.add({view:this._form,position:Lh(e)}),i.fieldView.value=i.fieldView.element.value=t.value||"",this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var B2=class extends y{static get requires(){return[VA,BA]}static get pluginName(){return"ImageTextAlternative"}static get isOfficialPlugin(){return!0}};/** +*/var O2=class extends w{static get requires(){return[MA,DA]}static get pluginName(){return"ImageTextAlternative"}static get isOfficialPlugin(){return!0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function OA(e){let t=(i,o,n)=>{if(!n.consumable.test(o.viewItem,{name:!0,classes:"image"}))return;let s=e.findViewImgElement(o.viewItem);if(!s||!n.consumable.test(s,{name:!0})||!rs(n.schema,o.modelCursor,"imageBlock"))return;n.consumable.consume(o.viewItem,{name:!0,classes:"image"});let r=n.convertItem(s,o.modelCursor);/* istanbul ignore if: defensive guard for the `ModelRange | null` return type -- @preserve */if(!r.modelRange){n.consumable.revert(o.viewItem,{name:!0,classes:"image"});return}let a=G(r.modelRange.getItems());if(!a){n.consumable.revert(o.viewItem,{name:!0,classes:"image"});return}n.convertChildren(o.viewItem,a),n.updateConversionResult(a,o)};return i=>{i.on("element:figure",t)}}function O2(e,t){let i=(o,n,s)=>{let r=EA(n.viewItem,t),a=n.viewItem.hasAttribute("src")?{src:n.viewItem.getAttribute("src")}:void 0,l={name:!0,attributes:Object.keys(a||{})};if(!s.consumable.test(n.viewItem,l))return;r!=e&&!rs(s.schema,n.modelCursor,r)&&(r=e);let c=s.writer.createElement(r,a);s.safeInsert(c,n.modelCursor)&&(s.consumable.consume(n.viewItem,l),s.convertChildren(n.viewItem,c),s.updateConversionResult(c,n))};return o=>{o.on("element:img",i)}}function D2(e,t){let i=(o,n,s)=>{if(!s.consumable.consume(n.item,o.name))return;let r=s.writer,a=s.mapper.toViewElement(n.item),l=e.findViewImgElement(a);n.attributeNewValue===null?(r.removeAttribute("srcset",l),r.removeAttribute("sizes",l)):n.attributeNewValue&&(r.setAttribute("srcset",n.attributeNewValue,l),r.setAttribute("sizes","100vw",l))};return o=>{o.on(`attribute:srcset:${t}`,i)}}function Gl(e,t,i){let o=(n,s,r)=>{if(!r.consumable.consume(s.item,n.name))return;let a=r.writer,l=r.mapper.toViewElement(s.item),c=e.findViewImgElement(l);a.setAttribute(s.attributeKey,s.attributeNewValue||"",c)};return n=>{n.on(`attribute:${i}:${t}`,o)}}/** +*/function FA(e){let t=(i,o,n)=>{if(!n.consumable.test(o.viewItem,{name:!0,classes:"image"}))return;let s=e.findViewImgElement(o.viewItem);if(!s||!n.consumable.test(s,{name:!0})||!rs(n.schema,o.modelCursor,"imageBlock"))return;n.consumable.consume(o.viewItem,{name:!0,classes:"image"});let r=n.convertItem(s,o.modelCursor);/* istanbul ignore if: defensive guard for the `ModelRange | null` return type -- @preserve */if(!r.modelRange){n.consumable.revert(o.viewItem,{name:!0,classes:"image"});return}let a=J(r.modelRange.getItems());if(!a){n.consumable.revert(o.viewItem,{name:!0,classes:"image"});return}n.convertChildren(o.viewItem,a),n.updateConversionResult(a,o)};return i=>{i.on("element:figure",t)}}function D2(e,t){let i=(o,n,s)=>{let r=IA(n.viewItem,t),a=n.viewItem.hasAttribute("src")?{src:n.viewItem.getAttribute("src")}:void 0,l={name:!0,attributes:Object.keys(a||{})};if(!s.consumable.test(n.viewItem,l))return;r!=e&&!rs(s.schema,n.modelCursor,r)&&(r=e);let c=s.writer.createElement(r,a);s.safeInsert(c,n.modelCursor)&&(s.consumable.consume(n.viewItem,l),s.convertChildren(n.viewItem,c),s.updateConversionResult(c,n))};return o=>{o.on("element:img",i)}}function F2(e,t){let i=(o,n,s)=>{if(!s.consumable.consume(n.item,o.name))return;let r=s.writer,a=s.mapper.toViewElement(n.item),l=e.findViewImgElement(a);n.attributeNewValue===null?(r.removeAttribute("srcset",l),r.removeAttribute("sizes",l)):n.attributeNewValue&&(r.setAttribute("srcset",n.attributeNewValue,l),r.setAttribute("sizes","100vw",l))};return o=>{o.on(`attribute:srcset:${t}`,i)}}function Zl(e,t,i){let o=(n,s,r)=>{if(!r.consumable.consume(s.item,n.name))return;let a=r.writer,l=r.mapper.toViewElement(s.item),c=e.findViewImgElement(l);a.setAttribute(s.attributeKey,s.attributeNewValue||"",c)};return n=>{n.on(`attribute:${i}:${t}`,o)}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Vh=class extends it{observe(e){this.listenTo(e,"load",(t,i)=>{let o=i.target;this.checkShouldIgnoreEventFromTarget(o)||o.tagName=="IMG"&&this._fireEvents(i)},{useCapture:!0})}stopObserving(e){this.stopListening(e)}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}};/** +*/var Mh=class extends it{observe(e){this.listenTo(e,"load",(t,i)=>{let o=i.target;this.checkShouldIgnoreEventFromTarget(o)||o.tagName=="IMG"&&this._fireEvents(i)},{useCapture:!0})}stopObserving(e){this.stopListening(e)}_fireEvents(e){this.isEnabled&&(this.document.fire("layoutChanged"),this.document.fire("imageLoaded",e))}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var DA=class extends M{constructor(e){super(e);let t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||t==="block"&&D("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||t==="inline"&&D("image-inline-plugin-required")}refresh(){let e=this.editor.plugins.get("ImageUtils");this.isEnabled=e.isImageAllowed()}execute(e){let t=j(e.source),i=this.editor.model.document.selection,o=this.editor.plugins.get("ImageUtils"),n=Object.fromEntries(i.getAttributes());t.forEach((s,r)=>{let a=i.getSelectedElement();if(typeof s=="string"&&(s={src:s}),r&&a&&o.isImage(a)){let l=this.editor.model.createPositionAfter(a);o.insertImage({...s,...n},l,e.imageType)}else e.breakBlock?o.insertImage({...s,...n},i.getFirstPosition(),e.imageType):o.insertImage({...s,...n},null,e.imageType)})}};/** +*/var NA=class extends M{constructor(e){super(e);let t=e.config.get("image.insert.type");e.plugins.has("ImageBlockEditing")||t==="block"&&D("image-block-plugin-required"),e.plugins.has("ImageInlineEditing")||t==="inline"&&D("image-inline-plugin-required")}refresh(){let e=this.editor.plugins.get("ImageUtils");this.isEnabled=e.isImageAllowed()}execute(e){let t=j(e.source),i=this.editor.model.document.selection,o=this.editor.plugins.get("ImageUtils"),n=Object.fromEntries(i.getAttributes());t.forEach((s,r)=>{let a=i.getSelectedElement();if(typeof s=="string"&&(s={src:s}),r&&a&&o.isImage(a)){let l=this.editor.model.createPositionAfter(a);o.insertImage({...s,...n},l,e.imageType)}else e.breakBlock?o.insertImage({...s,...n},i.getFirstPosition(),e.imageType):o.insertImage({...s,...n},null,e.imageType)})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var FA=class extends M{constructor(e){super(e),this.decorate("cleanupImage")}refresh(){let e=this.editor.plugins.get("ImageUtils"),t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=e.isImage(t),this.value=this.isEnabled?t.getAttribute("src"):null}execute(e){let t=this.editor.model.document.selection.getSelectedElement(),i=this.editor.plugins.get("ImageUtils");this.editor.model.change(o=>{o.setAttribute("src",e.source,t),this.cleanupImage(o,t),i.setImageNaturalSizeAttributes(t)})}cleanupImage(e,t){e.removeAttribute("srcset",t),e.removeAttribute("sizes",t),e.removeAttribute("sources",t),e.removeAttribute("width",t),e.removeAttribute("height",t),e.removeAttribute("alt",t)}};/** +*/var zA=class extends M{constructor(e){super(e),this.decorate("cleanupImage")}refresh(){let e=this.editor.plugins.get("ImageUtils"),t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=e.isImage(t),this.value=this.isEnabled?t.getAttribute("src"):null}execute(e){let t=this.editor.model.document.selection.getSelectedElement(),i=this.editor.plugins.get("ImageUtils");this.editor.model.change(o=>{o.setAttribute("src",e.source,t),this.cleanupImage(o,t),i.setImageNaturalSizeAttributes(t)})}cleanupImage(e,t){e.removeAttribute("srcset",t),e.removeAttribute("sizes",t),e.removeAttribute("sources",t),e.removeAttribute("width",t),e.removeAttribute("height",t),e.removeAttribute("alt",t)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Lh=class extends y{static get requires(){return[Ue]}static get pluginName(){return"ImageEditing"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.conversion;e.editing.view.addObserver(Vh),t.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:"srcset"});let i=new DA(e),o=new FA(e);e.commands.add("insertImage",i),e.commands.add("replaceImageSource",o),e.commands.add("imageInsert",i)}};/** +*/var Bh=class extends w{static get requires(){return[Ue]}static get pluginName(){return"ImageEditing"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.conversion;e.editing.view.addObserver(Mh),t.for("upcast").attributeToAttribute({view:{name:"img",key:"alt"},model:"alt"}).attributeToAttribute({view:{name:"img",key:"srcset"},model:"srcset"});let i=new NA(e),o=new zA(e);e.commands.add("insertImage",i),e.commands.add("replaceImageSource",o),e.commands.add("imageInsert",i)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var F2=class extends y{static get requires(){return[Ue]}static get pluginName(){return"ImageSizeAttributes"}static get isOfficialPlugin(){return!0}afterInit(){this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline")}_registerSchema(){let e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&e.extend("imageBlock",{allowAttributes:["width","height"]}),this.editor.plugins.has("ImageInlineEditing")&&e.extend("imageInline",{allowAttributes:["width","height"]})}_registerConverters(e){let t=this.editor,i=t.plugins.get("ImageUtils"),o=e==="imageBlock"?"figure":"img";t.conversion.for("upcast").attributeToAttribute({view:{name:o,styles:{width:/.+/}},model:{key:"width",value:s=>Kl(s)?jl(s.getStyle("width")):null}}).attributeToAttribute({view:{name:o,key:"width"},model:"width"}).attributeToAttribute({view:{name:o,styles:{height:/.+/}},model:{key:"height",value:s=>Kl(s)?jl(s.getStyle("height")):null}}).attributeToAttribute({view:{name:o,key:"height"},model:"height"}),t.conversion.for("editingDowncast").add(s=>{n(s,"width","width",!0,!0),n(s,"height","height",!0,!0)}),t.conversion.for("dataDowncast").add(s=>{n(s,"width","width",!1),n(s,"height","height",!1)}),t.conversion.for("upcast").add(s=>{s.on("element:img",(r,a,l)=>{let c=a.viewItem.getAttribute("width"),u=a.viewItem.getAttribute("height");c&&u&&l.consumable.consume(a.viewItem,{styles:["aspect-ratio"]})})});function n(s,r,a,l,c=!1){s.on(`attribute:${r}:${e}`,(u,d,h)=>{if(!h.consumable.consume(d.item,u.name))return;let f=h.writer,m=h.mapper.toViewElement(d.item),g=i.findViewImgElement(m);d.attributeNewValue!==null?f.setAttribute(a,d.attributeNewValue,g):f.removeAttribute(a,g);let b=d.item.getAttribute("width"),k=d.item.getAttribute("height"),v=b&&k;if(v&&c&&f.setAttribute("loading","lazy",g),d.item.hasAttribute("sources"))return;let _=d.item.hasAttribute("resizedWidth");e==="imageInline"&&!_&&!l||v&&f.setStyle("aspect-ratio",`${b}/${k}`,g)})}}};/** +*/var N2=class extends w{static get requires(){return[Ue]}static get pluginName(){return"ImageSizeAttributes"}static get isOfficialPlugin(){return!0}afterInit(){this._registerSchema(),this._registerConverters("imageBlock"),this._registerConverters("imageInline")}_registerSchema(){let e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&e.extend("imageBlock",{allowAttributes:["width","height"]}),this.editor.plugins.has("ImageInlineEditing")&&e.extend("imageInline",{allowAttributes:["width","height"]})}_registerConverters(e){let t=this.editor,i=t.plugins.get("ImageUtils"),o=e==="imageBlock"?"figure":"img";t.conversion.for("upcast").attributeToAttribute({view:{name:o,styles:{width:/.+/}},model:{key:"width",value:s=>Jl(s)?Gl(s.getStyle("width")):null}}).attributeToAttribute({view:{name:o,key:"width"},model:"width"}).attributeToAttribute({view:{name:o,styles:{height:/.+/}},model:{key:"height",value:s=>Jl(s)?Gl(s.getStyle("height")):null}}).attributeToAttribute({view:{name:o,key:"height"},model:"height"}),t.conversion.for("editingDowncast").add(s=>{n(s,"width","width",!0,!0),n(s,"height","height",!0,!0)}),t.conversion.for("dataDowncast").add(s=>{n(s,"width","width",!1),n(s,"height","height",!1)}),t.conversion.for("upcast").add(s=>{s.on("element:img",(r,a,l)=>{let c=a.viewItem.getAttribute("width"),u=a.viewItem.getAttribute("height");c&&u&&l.consumable.consume(a.viewItem,{styles:["aspect-ratio"]})})});function n(s,r,a,l,c=!1){s.on(`attribute:${r}:${e}`,(u,d,h)=>{if(!h.consumable.consume(d.item,u.name))return;let f=h.writer,m=h.mapper.toViewElement(d.item),g=i.findViewImgElement(m);d.attributeNewValue!==null?f.setAttribute(a,d.attributeNewValue,g):f.removeAttribute(a,g);let b=d.item.getAttribute("width"),k=d.item.getAttribute("height"),v=b&&k;if(v&&c&&f.setAttribute("loading","lazy",g),d.item.hasAttribute("sources"))return;let _=d.item.hasAttribute("resizedWidth");e==="imageInline"&&!_&&!l||v&&f.setStyle("aspect-ratio",`${b}/${k}`,g)})}}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var N2=class extends M{_modelElementName;constructor(e,t){super(e),this._modelElementName=t}refresh(){let e=this.editor,t=e.model,i=t.schema,o=e.plugins.get("ImageUtils"),n=o.getClosestSelectedImageElement(t.document.selection);if(!(this._modelElementName==="imageBlock"?o.isInlineImage(n):o.isBlockImage(n))){this.isEnabled=!1;return}let s=t.createPositionBefore(n);this.isEnabled=rs(i,s,this._modelElementName)}execute(e={}){let t=this.editor,i=this.editor.model,o=t.plugins.get("ImageUtils"),n=o.getClosestSelectedImageElement(i.document.selection),s=Object.fromEntries(n.getAttributes());return!s.src&&!s.uploadId?null:i.change(r=>{let{setImageSizes:a=!0}=e,l=Array.from(i.markers).filter(d=>d.getRange().containsItem(n)),c=o.insertImage(s,i.createSelection(n,"on"),this._modelElementName,{setImageSizes:a});if(!c)return null;let u=r.createRangeOn(c);for(let d of l){let h=d.getRange(),f=h.root.rootName!="$graveyard"?h.getJoined(u,!0):u;r.updateMarker(d,{range:f})}return{oldElement:n,newElement:c}})}};/** +*/var z2=class extends M{_modelElementName;constructor(e,t){super(e),this._modelElementName=t}refresh(){let e=this.editor,t=e.model,i=t.schema,o=e.plugins.get("ImageUtils"),n=o.getClosestSelectedImageElement(t.document.selection);if(!(this._modelElementName==="imageBlock"?o.isInlineImage(n):o.isBlockImage(n))){this.isEnabled=!1;return}let s=t.createPositionBefore(n);this.isEnabled=rs(i,s,this._modelElementName)}execute(e={}){let t=this.editor,i=this.editor.model,o=t.plugins.get("ImageUtils"),n=o.getClosestSelectedImageElement(i.document.selection),s=Object.fromEntries(n.getAttributes());return!s.src&&!s.uploadId?null:i.change(r=>{let{setImageSizes:a=!0}=e,l=Array.from(i.markers).filter(d=>d.getRange().containsItem(n)),c=o.insertImage(s,i.createSelection(n,"on"),this._modelElementName,{setImageSizes:a});if(!c)return null;let u=r.createRangeOn(c);for(let d of l){let h=d.getRange(),f=h.root.rootName!="$graveyard"?h.getJoined(u,!0):u;r.updateMarker(d,{range:f})}return{oldElement:n,newElement:c}})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var z2=class extends y{static get requires(){return[Ue]}static get pluginName(){return"ImagePlaceholder"}static get isOfficialPlugin(){return!0}afterInit(){this._setupSchema(),this._setupConversion(),this._setupLoadListener()}_setupSchema(){let e=this.editor.model.schema;e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["placeholder"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["placeholder"]})}_setupConversion(){let e=this.editor,t=e.conversion,i=e.plugins.get("ImageUtils");t.for("editingDowncast").add(o=>{o.on("attribute:placeholder",(n,s,r)=>{if(!r.consumable.test(s.item,n.name)||!s.item.is("element","imageBlock")&&!s.item.is("element","imageInline"))return;r.consumable.consume(s.item,n.name);let a=r.writer,l=r.mapper.toViewElement(s.item),c=i.findViewImgElement(l);s.attributeNewValue?(a.addClass("image_placeholder",c),a.setStyle("background-image",`url(${s.attributeNewValue})`,c),a.setCustomProperty("editingPipeline:doNotReuseOnce",!0,c)):(a.removeClass("image_placeholder",c),a.removeStyle("background-image",c))})})}_setupLoadListener(){let e=this.editor,t=e.model,i=e.editing,o=i.view,n=e.plugins.get("ImageUtils");o.addObserver(Vh),this.listenTo(o.document,"imageLoaded",(s,r)=>{let a=o.domConverter.mapDomToView(r.target);if(!a)return;let l=n.getImageWidgetFromImageView(a);if(!l)return;let c=i.mapper.toModelElement(l);!c||!c.hasAttribute("placeholder")||t.enqueueChange({isUndoable:!1},u=>{u.removeAttribute("placeholder",c)})})}};/** +*/var H2=class extends w{static get requires(){return[Ue]}static get pluginName(){return"ImagePlaceholder"}static get isOfficialPlugin(){return!0}afterInit(){this._setupSchema(),this._setupConversion(),this._setupLoadListener()}_setupSchema(){let e=this.editor.model.schema;e.isRegistered("imageBlock")&&e.extend("imageBlock",{allowAttributes:["placeholder"]}),e.isRegistered("imageInline")&&e.extend("imageInline",{allowAttributes:["placeholder"]})}_setupConversion(){let e=this.editor,t=e.conversion,i=e.plugins.get("ImageUtils");t.for("editingDowncast").add(o=>{o.on("attribute:placeholder",(n,s,r)=>{if(!r.consumable.test(s.item,n.name)||!s.item.is("element","imageBlock")&&!s.item.is("element","imageInline"))return;r.consumable.consume(s.item,n.name);let a=r.writer,l=r.mapper.toViewElement(s.item),c=i.findViewImgElement(l);s.attributeNewValue?(a.addClass("image_placeholder",c),a.setStyle("background-image",`url(${s.attributeNewValue})`,c),a.setCustomProperty("editingPipeline:doNotReuseOnce",!0,c)):(a.removeClass("image_placeholder",c),a.removeStyle("background-image",c))})})}_setupLoadListener(){let e=this.editor,t=e.model,i=e.editing,o=i.view,n=e.plugins.get("ImageUtils");o.addObserver(Mh),this.listenTo(o.document,"imageLoaded",(s,r)=>{let a=o.domConverter.mapDomToView(r.target);if(!a)return;let l=n.getImageWidgetFromImageView(a);if(!l)return;let c=i.mapper.toModelElement(l);!c||!c.hasAttribute("placeholder")||t.enqueueChange({isUndoable:!1},u=>{u.removeAttribute("placeholder",c)})})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Mh=class extends y{static get requires(){return[Lh,F2,Ue,z2,Be]}static get pluginName(){return"ImageBlockEditing"}static get isOfficialPlugin(){return!0}init(){let e=this.editor;e.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),e.plugins.has("ImageInlineEditing")&&(e.commands.add("imageTypeBlock",new N2(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){let e=this.editor,t=e.t,i=e.conversion,o=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToStructure({model:"imageBlock",view:(n,{writer:s})=>E2(s)}),i.for("editingDowncast").elementToStructure({model:"imageBlock",view:(n,{writer:s})=>o.toImageWidget(E2(s),s,t("image widget"))}),i.for("downcast").add(Gl(o,"imageBlock","src")).add(Gl(o,"imageBlock","alt")).add(D2(o,"imageBlock")),i.for("upcast").add(O2("imageBlock",o)).add(OA(o))}_setupClipboardIntegration(){let e=this.editor,t=e.model,i=e.editing.view,o=e.plugins.get("ImageUtils"),n=e.plugins.get("ClipboardPipeline");this.listenTo(n,"inputTransformation",(s,r)=>{let a=Array.from(r.content.getChildren()),l;if(!a.every(o.isInlineImageView))return;r.targetRanges?l=e.editing.mapper.toModelRange(r.targetRanges[0]):l=t.document.selection.getFirstRange();let c=t.createSelection(l),u=c.getFirstPosition();if(u&&rs(t.schema,u,"imageBlock")&&Ph(t.schema,c)==="imageBlock"){let d=new Vt(i.document),h=a.map(f=>d.createElement("figure",{class:"image"},f));r.content=d.createDocumentFragment(h)}}),this.listenTo(n,"contentInsertion",(s,r)=>{r.method==="paste"&&t.change(a=>{let l=a.createRangeIn(r.content);for(let c of l.getItems())c.is("element","imageBlock")&&o.setImageNaturalSizeAttributes(c)})})}};/** +*/var Oh=class extends w{static get requires(){return[Bh,N2,Ue,H2,Be]}static get pluginName(){return"ImageBlockEditing"}static get isOfficialPlugin(){return!0}init(){let e=this.editor;e.model.schema.register("imageBlock",{inheritAllFrom:"$blockObject",allowAttributes:["alt","src","srcset"]}),this._setupConversion(),e.plugins.has("ImageInlineEditing")&&(e.commands.add("imageTypeBlock",new z2(this.editor,"imageBlock")),this._setupClipboardIntegration())}_setupConversion(){let e=this.editor,t=e.t,i=e.conversion,o=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToStructure({model:"imageBlock",view:(n,{writer:s})=>A2(s)}),i.for("editingDowncast").elementToStructure({model:"imageBlock",view:(n,{writer:s})=>o.toImageWidget(A2(s),s,t("image widget"))}),i.for("downcast").add(Zl(o,"imageBlock","src")).add(Zl(o,"imageBlock","alt")).add(F2(o,"imageBlock")),i.for("upcast").add(D2("imageBlock",o)).add(FA(o))}_setupClipboardIntegration(){let e=this.editor,t=e.model,i=e.editing.view,o=e.plugins.get("ImageUtils"),n=e.plugins.get("ClipboardPipeline");this.listenTo(n,"inputTransformation",(s,r)=>{let a=Array.from(r.content.getChildren()),l;if(!a.every(o.isInlineImageView))return;r.targetRanges?l=e.editing.mapper.toModelRange(r.targetRanges[0]):l=t.document.selection.getFirstRange();let c=t.createSelection(l),u=c.getFirstPosition();if(u&&rs(t.schema,u,"imageBlock")&&Vh(t.schema,c)==="imageBlock"){let d=new Lt(i.document),h=a.map(f=>d.createElement("figure",{class:"image"},f));r.content=d.createDocumentFragment(h)}}),this.listenTo(n,"contentInsertion",(s,r)=>{r.method==="paste"&&t.change(a=>{let l=a.createRangeIn(r.content);for(let c of l.getItems())c.is("element","imageBlock")&&o.setImageNaturalSizeAttributes(c)})})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var NA=class extends R{focusTracker;keystrokes;_focusables;_focusCycler;children;constructor(e,t=[]){super(e),this.focusTracker=new Q,this.keystrokes=new X,this._focusables=new be,this.children=this.createCollection(),this._focusCycler=new Ie({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});for(let i of t)this.children.add(i),this._focusables.add(i),i instanceof dh&&this._focusables.addMany(i.children);this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-form"],tabindex:-1},children:this.children})}render(){super.render(),_i({view:this});for(let t of this._focusables)this.focusTracker.add(t.element);this.keystrokes.listenTo(this.element);let e=t=>t.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}};/** +*/var HA=class extends R{focusTracker;keystrokes;_focusables;_focusCycler;children;constructor(e,t=[]){super(e),this.focusTracker=new Q,this.keystrokes=new X,this._focusables=new we,this.children=this.createCollection(),this._focusCycler=new Pe({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});for(let i of t)this.children.add(i),this._focusables.add(i),i instanceof fh&&this._focusables.addMany(i.children);this.setTemplate({tag:"form",attributes:{class:["ck","ck-image-insert-form"],tabindex:-1},children:this.children})}render(){super.render(),ki({view:this});for(let t of this._focusables)this.focusTracker.add(t.element);this.keystrokes.listenTo(this.element);let e=t=>t.stopPropagation();this.keystrokes.set("arrowright",e),this.keystrokes.set("arrowleft",e),this.keystrokes.set("arrowup",e),this.keystrokes.set("arrowdown",e)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var H2=class extends y{static get pluginName(){return"ImageInsertUI"}static get isOfficialPlugin(){return!0}static get requires(){return[Ue]}dropdownView;_integrations=new Map;constructor(e){super(e),e.config.define("image.insert.integrations",["upload","assetManager","url"])}init(){let e=this.editor,t=e.model.document.selection,i=e.plugins.get("ImageUtils");this.set("isImageSelected",!1),this.listenTo(e.model.document,"change",()=>{this.isImageSelected=i.isImage(t.getSelectedElement())});let o=s=>this._createToolbarComponent(s),n=s=>this._createMenuBarComponent(s);e.ui.componentFactory.add("insertImage",o),e.ui.componentFactory.add("imageInsert",o),e.ui.componentFactory.add("menuBar:insertImage",n)}registerIntegration({name:e,observable:t,buttonViewCreator:i,formViewCreator:o,menuBarButtonViewCreator:n,requiresForm:s=!1,override:r=!1}){this._integrations.has(e)&&!r&&D("image-insert-integration-exists",{name:e}),this._integrations.set(e,{observable:t,buttonViewCreator:i,menuBarButtonViewCreator:n,formViewCreator:o,requiresForm:s})}_createToolbarComponent(e){let t=this.editor,i=e.t,o=this._prepareIntegrations();if(!o.length)return null;let n,s=o[0];if(o.length==1){if(!s.requiresForm)return s.buttonViewCreator(!0);n=s.buttonViewCreator(!0)}else{let l=s.buttonViewCreator(!1);n=new So(e,l),n.tooltip=!0,n.bind("label").to(this,"isImageSelected",c=>i(c?"Replace image":"Insert image"))}let r=this.dropdownView=Se(e,n),a=o.map(({observable:l})=>typeof l=="function"?l():l);return r.bind("isEnabled").toMany(a,"isEnabled",(...l)=>l.some(c=>c)),r.once("change:isOpen",()=>{let l=o.flatMap(({formViewCreator:u})=>u(o.length==1)),c=new NA(t.locale,l);r.panelView.children.add(c)}),r}_createMenuBarComponent(e){let t=e.t,i=this._prepareIntegrations();if(!i.length)return null;let o=i.flatMap(({menuBarButtonViewCreator:r})=>r(i.length==1)),n=new Qt(e),s=new jn(e);n.panelView.children.add(s),n.buttonView.set({icon:W1,label:t("Image")});for(let r of o){let a=new Jn(e,n);a.children.add(r),s.items.add(a),r.delegate("execute").to(n)}return n}_prepareIntegrations(){let e=this.editor.config.get("image.insert.integrations"),t=[];if(!e.length)return D("image-insert-integrations-not-specified"),t;for(let i of e){if(!this._integrations.has(i)){["upload","assetManager","url"].includes(i)||D("image-insert-unknown-integration",{item:i});continue}t.push(this._integrations.get(i))}return t.length||D("image-insert-integrations-not-registered"),t}};/** +*/var W2=class extends w{static get pluginName(){return"ImageInsertUI"}static get isOfficialPlugin(){return!0}static get requires(){return[Ue]}dropdownView;_integrations=new Map;constructor(e){super(e),e.config.define("image.insert.integrations",["upload","assetManager","url"])}init(){let e=this.editor,t=e.model.document.selection,i=e.plugins.get("ImageUtils");this.set("isImageSelected",!1),this.listenTo(e.model.document,"change",()=>{this.isImageSelected=i.isImage(t.getSelectedElement())});let o=s=>this._createToolbarComponent(s),n=s=>this._createMenuBarComponent(s);e.ui.componentFactory.add("insertImage",o),e.ui.componentFactory.add("imageInsert",o),e.ui.componentFactory.add("menuBar:insertImage",n)}registerIntegration({name:e,observable:t,buttonViewCreator:i,formViewCreator:o,menuBarButtonViewCreator:n,requiresForm:s=!1,override:r=!1}){this._integrations.has(e)&&!r&&D("image-insert-integration-exists",{name:e}),this._integrations.set(e,{observable:t,buttonViewCreator:i,menuBarButtonViewCreator:n,formViewCreator:o,requiresForm:s})}_createToolbarComponent(e){let t=this.editor,i=e.t,o=this._prepareIntegrations();if(!o.length)return null;let n,s=o[0];if(o.length==1){if(!s.requiresForm)return s.buttonViewCreator(!0);n=s.buttonViewCreator(!0)}else{let l=s.buttonViewCreator(!1);n=new xi(e,l),n.tooltip=!0,n.bind("label").to(this,"isImageSelected",c=>i(c?"Replace image":"Insert image"))}let r=this.dropdownView=ye(e,n),a=o.map(({observable:l})=>typeof l=="function"?l():l);return r.bind("isEnabled").toMany(a,"isEnabled",(...l)=>l.some(c=>c)),r.once("change:isOpen",()=>{let l=o.flatMap(({formViewCreator:u})=>u(o.length==1)),c=new HA(t.locale,l);r.panelView.children.add(c)}),r}_createMenuBarComponent(e){let t=e.t,i=this._prepareIntegrations();if(!i.length)return null;let o=i.flatMap(({menuBarButtonViewCreator:r})=>r(i.length==1)),n=new Xt(e),s=new jn(e);n.panelView.children.add(s),n.buttonView.set({icon:q1,label:t("Image")});for(let r of o){let a=new Jn(e,n);a.children.add(r),s.items.add(a),r.delegate("execute").to(n)}return n}_prepareIntegrations(){let e=this.editor.config.get("image.insert.integrations"),t=[];if(!e.length)return D("image-insert-integrations-not-specified"),t;for(let i of e){if(!this._integrations.has(i)){["upload","assetManager","url"].includes(i)||D("image-insert-unknown-integration",{item:i});continue}t.push(this._integrations.get(i))}return t.length||D("image-insert-integrations-not-registered"),t}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var W2=class extends y{static get requires(){return[Mh,Pe,B2,H2]}static get pluginName(){return"ImageBlock"}static get isOfficialPlugin(){return!0}};/** +*/var U2=class extends w{static get requires(){return[Oh,Re,O2,W2]}static get pluginName(){return"ImageBlock"}static get isOfficialPlugin(){return!0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var zA=class extends y{static get requires(){return[Lh,F2,Ue,z2,Be]}static get pluginName(){return"ImageInlineEditing"}static get isOfficialPlugin(){return!0}init(){let e=this.editor;e.model.schema.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"],disallowIn:["caption"]}),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new N2(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){let e=this.editor,t=e.t,i=e.conversion,o=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToElement({model:"imageInline",view:(n,{writer:s})=>s.createEmptyElement("img")}),i.for("editingDowncast").elementToStructure({model:"imageInline",view:(n,{writer:s})=>o.toImageWidget(TA(s),s,t("image widget"))}),i.for("downcast").add(Gl(o,"imageInline","src")).add(Gl(o,"imageInline","alt")).add(D2(o,"imageInline")),i.for("upcast").add(O2("imageInline",o))}_setupClipboardIntegration(){let e=this.editor,t=e.model,i=e.editing.view,o=e.plugins.get("ImageUtils"),n=e.plugins.get("ClipboardPipeline");this.listenTo(n,"inputTransformation",(s,r)=>{let a=Array.from(r.content.getChildren()),l;if(!a.every(o.isBlockImageView))return;r.targetRanges?l=e.editing.mapper.toModelRange(r.targetRanges[0]):l=t.document.selection.getFirstRange();let c=t.createSelection(l),u=c.getFirstPosition();if(!(u&&rs(t.schema,u,"imageBlock"))||Ph(t.schema,c)==="imageInline"){let d=new Vt(i.document),h=a.map(f=>f.childCount===1?(Array.from(f.getAttributes()).forEach(m=>d.setAttribute(...m,o.findViewImgElement(f))),f.getChild(0)):f);r.content=d.createDocumentFragment(h)}}),this.listenTo(n,"contentInsertion",(s,r)=>{r.method==="paste"&&t.change(a=>{let l=a.createRangeIn(r.content);for(let c of l.getItems())c.is("element","imageInline")&&o.setImageNaturalSizeAttributes(c)})})}};/** +*/var WA=class extends w{static get requires(){return[Bh,N2,Ue,H2,Be]}static get pluginName(){return"ImageInlineEditing"}static get isOfficialPlugin(){return!0}init(){let e=this.editor;e.model.schema.register("imageInline",{inheritAllFrom:"$inlineObject",allowAttributes:["alt","src","srcset"],disallowIn:["caption"]}),this._setupConversion(),e.plugins.has("ImageBlockEditing")&&(e.commands.add("imageTypeInline",new z2(this.editor,"imageInline")),this._setupClipboardIntegration())}_setupConversion(){let e=this.editor,t=e.t,i=e.conversion,o=e.plugins.get("ImageUtils");i.for("dataDowncast").elementToElement({model:"imageInline",view:(n,{writer:s})=>s.createEmptyElement("img")}),i.for("editingDowncast").elementToStructure({model:"imageInline",view:(n,{writer:s})=>o.toImageWidget(AA(s),s,t("image widget"))}),i.for("downcast").add(Zl(o,"imageInline","src")).add(Zl(o,"imageInline","alt")).add(F2(o,"imageInline")),i.for("upcast").add(D2("imageInline",o))}_setupClipboardIntegration(){let e=this.editor,t=e.model,i=e.editing.view,o=e.plugins.get("ImageUtils"),n=e.plugins.get("ClipboardPipeline");this.listenTo(n,"inputTransformation",(s,r)=>{let a=Array.from(r.content.getChildren()),l;if(!a.every(o.isBlockImageView))return;r.targetRanges?l=e.editing.mapper.toModelRange(r.targetRanges[0]):l=t.document.selection.getFirstRange();let c=t.createSelection(l),u=c.getFirstPosition();if(!(u&&rs(t.schema,u,"imageBlock"))||Vh(t.schema,c)==="imageInline"){let d=new Lt(i.document),h=a.map(f=>f.childCount===1?(Array.from(f.getAttributes()).forEach(m=>d.setAttribute(...m,o.findViewImgElement(f))),f.getChild(0)):f);r.content=d.createDocumentFragment(h)}}),this.listenTo(n,"contentInsertion",(s,r)=>{r.method==="paste"&&t.change(a=>{let l=a.createRangeIn(r.content);for(let c of l.getItems())c.is("element","imageInline")&&o.setImageNaturalSizeAttributes(c)})})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var U2=class extends y{static get requires(){return[zA,Pe,B2,H2]}static get pluginName(){return"ImageInline"}static get isOfficialPlugin(){return!0}};/** +*/var q2=class extends w{static get requires(){return[WA,Re,O2,W2]}static get pluginName(){return"ImageInline"}static get isOfficialPlugin(){return!0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var q2=class extends y{static get pluginName(){return"ImageCaptionUtils"}static get isOfficialPlugin(){return!0}static get requires(){return[Ue]}getCaptionFromImageModelElement(e){for(let t of e.getChildren())if(t&&t.is("element","caption"))return t;return null}getCaptionFromModelSelection(e){let t=this.editor.plugins.get("ImageUtils"),i=e.getFirstPosition().findAncestor("caption");return i&&t.isBlockImage(i.parent)?i:null}matchImageCaptionViewElement(e){let t=this.editor.plugins.get("ImageUtils");return e.name=="figcaption"&&t.isBlockImageView(e.parent)?{name:!0}:null}};/** +*/var $2=class extends w{static get pluginName(){return"ImageCaptionUtils"}static get isOfficialPlugin(){return!0}static get requires(){return[Ue]}getCaptionFromImageModelElement(e){for(let t of e.getChildren())if(t&&t.is("element","caption"))return t;return null}getCaptionFromModelSelection(e){let t=this.editor.plugins.get("ImageUtils"),i=e.getFirstPosition().findAncestor("caption");return i&&t.isBlockImage(i.parent)?i:null}matchImageCaptionViewElement(e){let t=this.editor.plugins.get("ImageUtils");return e.name=="figcaption"&&t.isBlockImageView(e.parent)?{name:!0}:null}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var HA=class extends M{refresh(){let e=this.editor,t=e.plugins.get("ImageCaptionUtils"),i=e.plugins.get("ImageUtils");if(!e.plugins.has(Mh)){this.isEnabled=!1,this.value=!1;return}let o=e.model.document.selection,n=o.getSelectedElement();if(!n){let s=t.getCaptionFromModelSelection(o);this.isEnabled=!!s,this.value=!!s;return}if(this.isEnabled=i.isImage(n),this.isEnabled&&i.isInlineImage(n)){let s=e.model.createPositionBefore(n);this.isEnabled=rs(e.model.schema,s,"imageBlock")}this.isEnabled?this.value=!!t.getCaptionFromImageModelElement(n):this.value=!1}execute(e={}){let{focusCaptionOnShow:t}=e;this.editor.model.change(i=>{this.value?this._hideImageCaption(i):this._showImageCaption(i,t)})}_showImageCaption(e,t){let i=this.editor.model.document.selection,o=this.editor.plugins.get("ImageCaptionEditing"),n=this.editor.plugins.get("ImageUtils"),s=i.getSelectedElement(),r=o._getSavedCaption(s);n.isInlineImage(s)&&(this.editor.execute("imageTypeBlock"),s=i.getSelectedElement());let a=r||e.createElement("caption");e.append(a,s),t&&e.setSelection(a,"in")}_hideImageCaption(e){let t=this.editor,i=t.model.document.selection,o=t.plugins.get("ImageCaptionEditing"),n=t.plugins.get("ImageCaptionUtils"),s=i.getSelectedElement(),r;s?r=n.getCaptionFromImageModelElement(s):(r=n.getCaptionFromModelSelection(i),s=r.parent),o._saveCaption(s,r),e.setSelection(s,"on"),e.remove(r)}};/** +*/var UA=class extends M{refresh(){let e=this.editor,t=e.plugins.get("ImageCaptionUtils"),i=e.plugins.get("ImageUtils");if(!e.plugins.has(Oh)){this.isEnabled=!1,this.value=!1;return}let o=e.model.document.selection,n=o.getSelectedElement();if(!n){let s=t.getCaptionFromModelSelection(o);this.isEnabled=!!s,this.value=!!s;return}if(this.isEnabled=i.isImage(n),this.isEnabled&&i.isInlineImage(n)){let s=e.model.createPositionBefore(n);this.isEnabled=rs(e.model.schema,s,"imageBlock")}this.isEnabled?this.value=!!t.getCaptionFromImageModelElement(n):this.value=!1}execute(e={}){let{focusCaptionOnShow:t}=e;this.editor.model.change(i=>{this.value?this._hideImageCaption(i):this._showImageCaption(i,t)})}_showImageCaption(e,t){let i=this.editor.model.document.selection,o=this.editor.plugins.get("ImageCaptionEditing"),n=this.editor.plugins.get("ImageUtils"),s=i.getSelectedElement(),r=o._getSavedCaption(s);n.isInlineImage(s)&&(this.editor.execute("imageTypeBlock"),s=i.getSelectedElement());let a=r||e.createElement("caption");e.append(a,s),t&&e.setSelection(a,"in")}_hideImageCaption(e){let t=this.editor,i=t.model.document.selection,o=t.plugins.get("ImageCaptionEditing"),n=t.plugins.get("ImageCaptionUtils"),s=i.getSelectedElement(),r;s?r=n.getCaptionFromImageModelElement(s):(r=n.getCaptionFromModelSelection(i),s=r.parent),o._saveCaption(s,r),e.setSelection(s,"on"),e.remove(r)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var WA=class extends y{static get requires(){return[Ue,q2]}static get pluginName(){return"ImageCaptionEditing"}static get isOfficialPlugin(){return!0}_savedCaptionsMap;constructor(e){super(e),this._savedCaptionsMap=new WeakMap}init(){let e=this.editor,t=e.model.schema;t.isRegistered("caption")?t.extend("caption",{allowIn:"imageBlock"}):t.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:!0}),e.commands.add("toggleImageCaption",new HA(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration(),this._registerCaptionReconversion()}_setupConversion(){let e=this.editor,t=e.editing.view,i=e.plugins.get("ImageUtils"),o=e.plugins.get("ImageCaptionUtils"),n=e.t;e.conversion.for("upcast").elementToElement({view:s=>o.matchImageCaptionViewElement(s),model:"caption"}),e.conversion.for("dataDowncast").elementToElement({model:"caption",view:(s,{writer:r})=>i.isBlockImage(s.parent)?r.createContainerElement("figcaption"):null}),e.conversion.for("editingDowncast").elementToElement({model:"caption",view:(s,{writer:r})=>{if(!i.isBlockImage(s.parent))return null;let a=r.createEditableElement("figcaption");r.setCustomProperty("imageCaption",!0,a),a.placeholder=n("Enter image caption"),Ln({view:t,element:a,keepOnFocus:!0});let l=s.parent.getAttribute("alt"),c=l?n("Caption for image: %0",[l]):n("Caption for the image");return Hl(a,r,{label:c})}})}_setupImageTypeCommandsIntegration(){let e=this.editor,t=e.plugins.get("ImageUtils"),i=e.plugins.get("ImageCaptionUtils"),o=e.commands.get("imageTypeInline"),n=e.commands.get("imageTypeBlock"),s=r=>{if(!r.return)return;let{oldElement:a,newElement:l}=r.return;/* istanbul ignore if: paranoid check -- @preserve */if(!a)return;if(t.isBlockImage(a)){let u=i.getCaptionFromImageModelElement(a);if(u){this._saveCaption(l,u);return}}let c=this._getSavedCaption(a);c&&this._saveCaption(l,c)};o&&this.listenTo(o,"execute",s,{priority:"low"}),n&&this.listenTo(n,"execute",s,{priority:"low"})}_getSavedCaption(e){let t=this._savedCaptionsMap.get(e);return t?ie.fromJSON(t):null}_saveCaption(e,t){this._savedCaptionsMap.set(e,t.toJSON())}_registerCaptionReconversion(){let e=this.editor,t=e.model,i=e.plugins.get("ImageUtils"),o=e.plugins.get("ImageCaptionUtils");t.document.on("change:data",()=>{let n=t.document.differ.getChanges();for(let s of n){if(s.attributeKey!=="alt")continue;let r=s.range.start.nodeAfter;if(i.isBlockImage(r)){let a=o.getCaptionFromImageModelElement(r);if(!a)return;e.editing.reconvertItem(a)}}})}};/** +*/var qA=class extends w{static get requires(){return[Ue,$2]}static get pluginName(){return"ImageCaptionEditing"}static get isOfficialPlugin(){return!0}_savedCaptionsMap;constructor(e){super(e),this._savedCaptionsMap=new WeakMap}init(){let e=this.editor,t=e.model.schema;t.isRegistered("caption")?t.extend("caption",{allowIn:"imageBlock"}):t.register("caption",{allowIn:"imageBlock",allowContentOf:"$block",isLimit:!0}),e.commands.add("toggleImageCaption",new UA(this.editor)),this._setupConversion(),this._setupImageTypeCommandsIntegration(),this._registerCaptionReconversion()}_setupConversion(){let e=this.editor,t=e.editing.view,i=e.plugins.get("ImageUtils"),o=e.plugins.get("ImageCaptionUtils"),n=e.t;e.conversion.for("upcast").elementToElement({view:s=>o.matchImageCaptionViewElement(s),model:"caption"}),e.conversion.for("dataDowncast").elementToElement({model:"caption",view:(s,{writer:r})=>i.isBlockImage(s.parent)?r.createContainerElement("figcaption"):null}),e.conversion.for("editingDowncast").elementToElement({model:"caption",view:(s,{writer:r})=>{if(!i.isBlockImage(s.parent))return null;let a=r.createEditableElement("figcaption");r.setCustomProperty("imageCaption",!0,a),a.placeholder=n("Enter image caption"),Ln({view:t,element:a,keepOnFocus:!0});let l=s.parent.getAttribute("alt"),c=l?n("Caption for image: %0",[l]):n("Caption for the image");return Wl(a,r,{label:c})}})}_setupImageTypeCommandsIntegration(){let e=this.editor,t=e.plugins.get("ImageUtils"),i=e.plugins.get("ImageCaptionUtils"),o=e.commands.get("imageTypeInline"),n=e.commands.get("imageTypeBlock"),s=r=>{if(!r.return)return;let{oldElement:a,newElement:l}=r.return;/* istanbul ignore if: paranoid check -- @preserve */if(!a)return;if(t.isBlockImage(a)){let u=i.getCaptionFromImageModelElement(a);if(u){this._saveCaption(l,u);return}}let c=this._getSavedCaption(a);c&&this._saveCaption(l,c)};o&&this.listenTo(o,"execute",s,{priority:"low"}),n&&this.listenTo(n,"execute",s,{priority:"low"})}_getSavedCaption(e){let t=this._savedCaptionsMap.get(e);return t?ie.fromJSON(t):null}_saveCaption(e,t){this._savedCaptionsMap.set(e,t.toJSON())}_registerCaptionReconversion(){let e=this.editor,t=e.model,i=e.plugins.get("ImageUtils"),o=e.plugins.get("ImageCaptionUtils");t.document.on("change:data",()=>{let n=t.document.differ.getChanges();for(let s of n){if(s.attributeKey!=="alt")continue;let r=s.range.start.nodeAfter;if(i.isBlockImage(r)){let a=o.getCaptionFromImageModelElement(r);if(!a)return;e.editing.reconvertItem(a)}}})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var UA=class extends y{static get requires(){return[q2]}static get pluginName(){return"ImageCaptionUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.editing.view,i=e.plugins.get("ImageCaptionUtils"),o=e.t;e.ui.componentFactory.add("toggleImageCaption",n=>{let s=e.commands.get("toggleImageCaption"),r=new I(n);return r.set({icon:Dd,tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(s,"value","isEnabled"),r.bind("label").to(s,"value",a=>o(a?"Toggle caption off":"Toggle caption on")),this.listenTo(r,"execute",()=>{e.execute("toggleImageCaption",{focusCaptionOnShow:!0});let a=i.getCaptionFromModelSelection(e.model.document.selection);if(a){let l=e.editing.mapper.toViewElement(a);t.scrollToTheSelection(),t.change(c=>{c.addClass("image__caption_highlighted",l)})}e.editing.view.focus()}),r})}};/** +*/var $A=class extends w{static get requires(){return[$2]}static get pluginName(){return"ImageCaptionUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.editing.view,i=e.plugins.get("ImageCaptionUtils"),o=e.t;e.ui.componentFactory.add("toggleImageCaption",n=>{let s=e.commands.get("toggleImageCaption"),r=new I(n);return r.set({icon:Nd,tooltip:!0,isToggleable:!0}),r.bind("isOn","isEnabled").to(s,"value","isEnabled"),r.bind("label").to(s,"value",a=>o(a?"Toggle caption off":"Toggle caption on")),this.listenTo(r,"execute",()=>{e.execute("toggleImageCaption",{focusCaptionOnShow:!0});let a=i.getCaptionFromModelSelection(e.model.document.selection);if(a){let l=e.editing.mapper.toViewElement(a);t.scrollToTheSelection(),t.change(c=>{c.addClass("image__caption_highlighted",l)})}e.editing.view.focus()}),r})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var $2=class extends y{static get requires(){return[WA,UA]}static get pluginName(){return"ImageCaption"}static get isOfficialPlugin(){return!0}};/** +*/var j2=class extends w{static get requires(){return[qA,$A]}static get pluginName(){return"ImageCaption"}static get isOfficialPlugin(){return!0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function j2(e){let t=e.map(i=>i.replace("+","\\+"));return new RegExp(`^image\\/(${t.join("|")})$`)}function qA(e){return new Promise((t,i)=>{let o=e.getAttribute("src");fetch(o).then(n=>n.blob()).then(n=>{let s=K2(n,o),r=`image.${s.replace("image/","")}`;t(new File([n],r,{type:s}))}).catch(n=>n&&n.name==="TypeError"?jA(o).then(t).catch(i):i(n))})}function $A(e,t){return!e.isInlineImageView(t)||!t.getAttribute("src")?!1:!!t.getAttribute("src").match(/^data:image\/\w+;base64,/g)||!!t.getAttribute("src").match(/^blob:/g)}function K2(e,t){return e.type?e.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}function jA(e){return KA(e).then(t=>{let i=K2(t,e),o=`image.${i.replace("image/","")}`;return new File([t],o,{type:i})})}function KA(e){return new Promise((t,i)=>{let o=S.document.createElement("img");o.addEventListener("load",()=>{let n=S.document.createElement("canvas");n.width=o.width,n.height=o.height,n.getContext("2d").drawImage(o,0,0),n.toBlob(s=>s?t(s):i())}),o.addEventListener("error",()=>i()),o.src=e})}/** +*/function K2(e){let t=e.map(i=>i.replace("+","\\+"));return new RegExp(`^image\\/(${t.join("|")})$`)}function jA(e){return new Promise((t,i)=>{let o=e.getAttribute("src");fetch(o).then(n=>n.blob()).then(n=>{let s=G2(n,o),r=`image.${s.replace("image/","")}`;t(new File([n],r,{type:s}))}).catch(n=>n&&n.name==="TypeError"?GA(o).then(t).catch(i):i(n))})}function KA(e,t){return!e.isInlineImageView(t)||!t.getAttribute("src")?!1:!!t.getAttribute("src").match(/^data:image\/\w+;base64,/g)||!!t.getAttribute("src").match(/^blob:/g)}function G2(e,t){return e.type?e.type:t.match(/data:(image\/\w+);base64/)?t.match(/data:(image\/\w+);base64/)[1].toLowerCase():"image/jpeg"}function GA(e){return JA(e).then(t=>{let i=G2(t,e),o=`image.${i.replace("image/","")}`;return new File([t],o,{type:i})})}function JA(e){return new Promise((t,i)=>{let o=S.document.createElement("img");o.addEventListener("load",()=>{let n=S.document.createElement("canvas");n.width=o.width,n.height=o.height,n.getContext("2d").drawImage(o,0,0),n.toBlob(s=>s?t(s):i())}),o.addEventListener("error",()=>i()),o.src=e})}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var GA=class extends y{static get pluginName(){return"ImageUploadUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor;e.ui.componentFactory.add("uploadImage",()=>this._createToolbarButton()),e.ui.componentFactory.add("imageUpload",()=>this._createToolbarButton()),e.ui.componentFactory.add("menuBar:uploadImage",()=>this._createMenuBarButton("standalone")),e.plugins.has("ImageInsertUI")&&e.plugins.get("ImageInsertUI").registerIntegration({name:"upload",observable:()=>e.commands.get("uploadImage"),buttonViewCreator:()=>this._createToolbarButton(),formViewCreator:()=>this._createDropdownButton(),menuBarButtonViewCreator:t=>this._createMenuBarButton(t?"insertOnly":"insertNested")})}_createButton(e){let t=this.editor,i=t.locale,o=t.commands.get("uploadImage"),n=t.config.get("image.upload.types"),s=j2(n),r=new e(t.locale),a=i.t;return r.set({acceptedType:n.map(l=>`image/${l}`).join(","),allowMultipleFiles:!0,label:a("Upload from computer"),icon:U1}),r.bind("isEnabled").to(o),r.on("done",(l,c)=>{let u=Array.from(c).filter(d=>s.test(d.type));u.length&&(t.execute("uploadImage",{file:u}),t.editing.view.focus())}),r}_createToolbarButton(){let e=this.editor.locale.t,t=this.editor.plugins.get("ImageInsertUI"),i=this.editor.commands.get("uploadImage"),o=this._createButton(uh);return o.tooltip=!0,o.bind("label").to(t,"isImageSelected",i,"isAccessAllowed",(n,s)=>e(s?n?"Replace image from computer":"Upload image from computer":"You have no image upload permissions.")),o}_createDropdownButton(){let e=this.editor.locale.t,t=this.editor.plugins.get("ImageInsertUI"),i=this._createButton(uh);return i.withText=!0,i.bind("label").to(t,"isImageSelected",o=>e(o?"Replace from computer":"Upload from computer")),i.on("execute",()=>{t.dropdownView.isOpen=!1}),i}_createMenuBarButton(e){let t=this.editor.locale.t,i=this._createButton(bh);switch(i.withText=!0,e){case"standalone":i.label=t("Image from computer");break;case"insertOnly":i.label=t("Image");break;case"insertNested":i.label=t("From computer")}return i}};/** +*/var ZA=class extends w{static get pluginName(){return"ImageUploadUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor;e.ui.componentFactory.add("uploadImage",()=>this._createToolbarButton()),e.ui.componentFactory.add("imageUpload",()=>this._createToolbarButton()),e.ui.componentFactory.add("menuBar:uploadImage",()=>this._createMenuBarButton("standalone")),e.plugins.has("ImageInsertUI")&&e.plugins.get("ImageInsertUI").registerIntegration({name:"upload",observable:()=>e.commands.get("uploadImage"),buttonViewCreator:()=>this._createToolbarButton(),formViewCreator:()=>this._createDropdownButton(),menuBarButtonViewCreator:t=>this._createMenuBarButton(t?"insertOnly":"insertNested")})}_createButton(e){let t=this.editor,i=t.locale,o=t.commands.get("uploadImage"),n=t.config.get("image.upload.types"),s=K2(n),r=new e(t.locale),a=i.t;return r.set({acceptedType:n.map(l=>`image/${l}`).join(","),allowMultipleFiles:!0,label:a("Upload from computer"),icon:$1}),r.bind("isEnabled").to(o),r.on("done",(l,c)=>{let u=Array.from(c).filter(d=>s.test(d.type));u.length&&(t.execute("uploadImage",{file:u}),t.editing.view.focus())}),r}_createToolbarButton(){let e=this.editor.locale.t,t=this.editor.plugins.get("ImageInsertUI"),i=this.editor.commands.get("uploadImage"),o=this._createButton(hh);return o.tooltip=!0,o.bind("label").to(t,"isImageSelected",i,"isAccessAllowed",(n,s)=>e(s?n?"Replace image from computer":"Upload image from computer":"You have no image upload permissions.")),o}_createDropdownButton(){let e=this.editor.locale.t,t=this.editor.plugins.get("ImageInsertUI"),i=this._createButton(hh);return i.withText=!0,i.bind("label").to(t,"isImageSelected",o=>e(o?"Replace from computer":"Upload from computer")),i.on("execute",()=>{t.dropdownView.isOpen=!1}),i}_createMenuBarButton(e){let t=this.editor.locale.t,i=this._createButton(yh);switch(i.withText=!0,e){case"standalone":i.label=t("Image from computer");break;case"insertOnly":i.label=t("Image");break;case"insertNested":i.label=t("From computer")}return i}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var JA=class extends y{static get pluginName(){return"ImageUploadProgress"}static get isOfficialPlugin(){return!0}placeholder;constructor(e){super(e),this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}init(){let e=this.editor;e.plugins.has("ImageBlockEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",this.uploadStatusChange),e.plugins.has("ImageInlineEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",this.uploadStatusChange)}uploadStatusChange=(e,t,i)=>{let o=this.editor,n=t.item,s=n.getAttribute("uploadId");if(!i.consumable.consume(t.item,e.name))return;let r=o.plugins.get("ImageUtils"),a=o.plugins.get(xt),l=s?t.attributeNewValue:null,c=this.placeholder,u=o.editing.mapper.toViewElement(n),d=i.writer;if(l=="reading"){A2(u,d),I2(r,c,u,d);return}if(l=="uploading"){let h=a.loaders.get(s);A2(u,d),h?(S2(u,d),QA(u,d,h,o.editing.view),iI(r,u,d,h)):I2(r,c,u,d);return}l=="complete"&&a.loaders.get(s)&&XA(u,d,o.editing.view),YA(u,d),S2(u,d),ZA(u,d)}};function A2(e,t){e.hasClass("ck-appear")||t.addClass("ck-appear",e)}function ZA(e,t){t.removeClass("ck-appear",e)}function I2(e,t,i,o){i.hasClass("ck-image-upload-placeholder")||o.addClass("ck-image-upload-placeholder",i);let n=e.findViewImgElement(i);n.getAttribute("src")!==t&&o.setAttribute("src",t,n),G2(i,"placeholder")||o.insert(o.createPositionAfter(n),tI(o))}function S2(e,t){e.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",e),J2(e,t,"placeholder")}function QA(e,t,i,o){let n=eI(t);t.insert(t.createPositionAt(e,"end"),n),i.on("change:uploadedPercent",(s,r,a)=>{o.change(l=>{l.setStyle("width",a+"%",n)})})}function YA(e,t){J2(e,t,"progressBar")}function XA(e,t,i){let o=t.createUIElement("div",{class:"ck-image-upload-complete-icon"});t.insert(t.createPositionAt(e,"end"),o),setTimeout(()=>{i.change(n=>n.remove(n.createRangeOn(o)))},3e3)}function eI(e){let t=e.createUIElement("div",{class:"ck-progress-bar"});return e.setCustomProperty("progressBar",!0,t),t}function tI(e){let t=e.createUIElement("div",{class:"ck-upload-placeholder-loader"});return e.setCustomProperty("placeholder",!0,t),t}function G2(e,t){for(let i of e.getChildren())if(i.getCustomProperty(t))return i}function J2(e,t,i){let o=G2(e,i);o&&t.remove(t.createRangeOn(o))}function iI(e,t,i,o){if(o.data){let n=e.findViewImgElement(t);i.setAttribute("src",o.data,n)}}/** +*/var QA=class extends w{static get pluginName(){return"ImageUploadProgress"}static get isOfficialPlugin(){return!0}placeholder;constructor(e){super(e),this.placeholder="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="}init(){let e=this.editor;e.plugins.has("ImageBlockEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageBlock",this.uploadStatusChange),e.plugins.has("ImageInlineEditing")&&e.editing.downcastDispatcher.on("attribute:uploadStatus:imageInline",this.uploadStatusChange)}uploadStatusChange=(e,t,i)=>{let o=this.editor,n=t.item,s=n.getAttribute("uploadId");if(!i.consumable.consume(t.item,e.name))return;let r=o.plugins.get("ImageUtils"),a=o.plugins.get(Tt),l=s?t.attributeNewValue:null,c=this.placeholder,u=o.editing.mapper.toViewElement(n),d=i.writer;if(l=="reading"){I2(u,d),S2(r,c,u,d);return}if(l=="uploading"){let h=a.loaders.get(s);I2(u,d),h?(P2(u,d),XA(u,d,h,o.editing.view),nI(r,u,d,h)):S2(r,c,u,d);return}l=="complete"&&a.loaders.get(s)&&tI(u,d,o.editing.view),eI(u,d),P2(u,d),YA(u,d)}};function I2(e,t){e.hasClass("ck-appear")||t.addClass("ck-appear",e)}function YA(e,t){t.removeClass("ck-appear",e)}function S2(e,t,i,o){i.hasClass("ck-image-upload-placeholder")||o.addClass("ck-image-upload-placeholder",i);let n=e.findViewImgElement(i);n.getAttribute("src")!==t&&o.setAttribute("src",t,n),J2(i,"placeholder")||o.insert(o.createPositionAfter(n),oI(o))}function P2(e,t){e.hasClass("ck-image-upload-placeholder")&&t.removeClass("ck-image-upload-placeholder",e),Z2(e,t,"placeholder")}function XA(e,t,i,o){let n=iI(t);t.insert(t.createPositionAt(e,"end"),n),i.on("change:uploadedPercent",(s,r,a)=>{o.change(l=>{l.setStyle("width",a+"%",n)})})}function eI(e,t){Z2(e,t,"progressBar")}function tI(e,t,i){let o=t.createUIElement("div",{class:"ck-image-upload-complete-icon"});t.insert(t.createPositionAt(e,"end"),o),setTimeout(()=>{i.change(n=>n.remove(n.createRangeOn(o)))},3e3)}function iI(e){let t=e.createUIElement("div",{class:"ck-progress-bar"});return e.setCustomProperty("progressBar",!0,t),t}function oI(e){let t=e.createUIElement("div",{class:"ck-upload-placeholder-loader"});return e.setCustomProperty("placeholder",!0,t),t}function J2(e,t){for(let i of e.getChildren())if(i.getCustomProperty(t))return i}function Z2(e,t,i){let o=J2(e,i);o&&t.remove(t.createRangeOn(o))}function nI(e,t,i,o){if(o.data){let n=e.findViewImgElement(t);i.setAttribute("src",o.data,n)}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var oI=class extends M{constructor(e){super(e),this.set("isAccessAllowed",!0)}refresh(){let e=this.editor,t=e.plugins.get("ImageUtils"),i=e.model.document.selection.getSelectedElement();this.isEnabled=t.isImageAllowed()||t.isImage(i)}execute(e){let t=j(e.file),i=this.editor.model.document.selection,o=this.editor.plugins.get("ImageUtils"),n=Object.fromEntries(i.getAttributes());t.forEach((s,r)=>{let a=i.getSelectedElement();if(r&&a&&o.isImage(a)){let l=this.editor.model.createPositionAfter(a);this._uploadImage(s,n,l)}else this._uploadImage(s,n)})}_uploadImage(e,t,i){let o=this.editor,n=o.plugins.get(xt).createLoader(e),s=o.plugins.get("ImageUtils");n&&s.insertImage({...t,uploadId:n.id},i)}};/** +*/var sI=class extends M{constructor(e){super(e),this.set("isAccessAllowed",!0)}refresh(){let e=this.editor,t=e.plugins.get("ImageUtils"),i=e.model.document.selection.getSelectedElement();this.isEnabled=t.isImageAllowed()||t.isImage(i)}execute(e){let t=j(e.file),i=this.editor.model.document.selection,o=this.editor.plugins.get("ImageUtils"),n=Object.fromEntries(i.getAttributes());t.forEach((s,r)=>{let a=i.getSelectedElement();if(r&&a&&o.isImage(a)){let l=this.editor.model.createPositionAfter(a);this._uploadImage(s,n,l)}else this._uploadImage(s,n)})}_uploadImage(e,t,i){let o=this.editor,n=o.plugins.get(Tt).createLoader(e),s=o.plugins.get("ImageUtils");n&&s.insertImage({...t,uploadId:n.id},i)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var nI=class extends y{static get requires(){return[xt,ph,Be,Ue]}static get pluginName(){return"ImageUploadEditing"}static get isOfficialPlugin(){return!0}_uploadImageElements;_uploadedImages=new Map;constructor(e){super(e),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}init(){let e=this.editor,t=e.model.document,i=e.conversion,o=e.plugins.get(xt),n=e.plugins.get("ImageUtils"),s=e.plugins.get("ClipboardPipeline"),r=j2(e.config.get("image.upload.types")),a=new oI(e);e.commands.add("uploadImage",a),e.commands.add("imageUpload",a),i.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}).add(l=>l.on("element:img",(c,u,d)=>{if(!d.consumable.test(u.viewItem,{attributes:["data-ck-upload-id"]}))return;let h=u.viewItem.getAttribute("data-ck-upload-id");if(!h||!u.modelRange)return;let[f]=Array.from(u.modelRange.getItems({shallow:!0})),m=o.loaders.get(h);/* v8 ignore else -- @preserve */f&&(d.writer.setAttribute("uploadId",h,f),d.consumable.consume(u.viewItem,{attributes:["data-ck-upload-id"]}),m&&m.data&&d.writer.setAttribute("uploadStatus",m.status,f))},{priority:"low"})),this.listenTo(e.editing.view.document,"clipboardInput",(l,c)=>{if(sI(c.dataTransfer))return;let u=Array.from(c.dataTransfer.files).filter(d=>d?r.test(d.type):!1);if(u.length&&(l.stop(),e.model.change(d=>{c.targetRanges&&d.setSelection(c.targetRanges.map(h=>e.editing.mapper.toModelRange(h))),e.execute("uploadImage",{file:u})}),!e.commands.get("uploadImage").isAccessAllowed)){let d=e.plugins.get("Notification"),h=e.locale.t;d.showWarning(h("You have no image upload permissions."),{namespace:"image"})}}),this.listenTo(s,"inputTransformation",(l,c)=>{let u=Array.from(e.editing.view.createRangeIn(c.content)).map(h=>h.item).filter(h=>$A(n,h)&&!h.getAttribute("uploadProcessed")).map(h=>({promise:qA(h),imageElement:h}));if(!u.length)return;let d=new Vt(e.editing.view.document);for(let h of u){d.setAttribute("uploadProcessed",!0,h.imageElement);let f=o.createLoader(h.promise);f&&(d.setAttribute("src","",h.imageElement),d.setAttribute("uploadId",f.id,h.imageElement))}}),e.editing.view.document.on("dragover",(l,c)=>{c.preventDefault()}),t.on("change",()=>{let l=t.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),c=new Set;for(let u of l)if(u.type=="insert"&&u.name!="$text"){let d=u.position.nodeAfter,h=u.position.root.rootName=="$graveyard";for(let f of rI(e,d)){let m=f.getAttribute("uploadId"),g=f.getAttribute("uploadStatus");if(!m||g=="complete")continue;let b=o.loaders.get(m);if(!b){!h&&this._uploadedImages.has(m)&&e.model.enqueueChange({isUndoable:!1},k=>{k.setAttribute("uploadStatus","complete",f),this.fire("uploadComplete",{data:this._uploadedImages.get(m),imageElement:f})});continue}if(h){if(!c.has(m)){/* v8 ignore else -- @preserve */Array.from(this._uploadImageElements.get(m)).every(k=>k.root.rootName=="$graveyard")&&b.abort()}}else c.add(m),this._uploadImageElements.has(m)?this._uploadImageElements.get(m).add(f):this._uploadImageElements.set(m,new Set([f])),b.status=="idle"&&this._readAndUpload(b)}}}),this.on("uploadComplete",(l,{imageElement:c,data:u})=>{let d=u.urls?u.urls:u;this.editor.model.change(h=>{h.setAttribute("src",d.default,c),this._parseAndSetSrcsetAttributeOnImage(d,c,h),n.setImageNaturalSizeAttributes(c)})},{priority:"low"})}afterInit(){let e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&(e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this._registerConverters("imageBlock")),this.editor.plugins.has("ImageInlineEditing")&&(e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]}),this._registerConverters("imageInline"))}_readAndUpload(e){let t=this.editor,i=t.model,o=t.locale.t,n=t.plugins.get(xt),s=t.plugins.get(ph),r=t.plugins.get("ImageUtils"),a=this._uploadImageElements;return i.enqueueChange({isUndoable:!1},c=>{let u=a.get(e.id);for(let d of u)c.setAttribute("uploadStatus","reading",d)}),e.read().then(()=>{let c=e.upload();/* v8 ignore else -- @preserve */t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Uploading image"));for(let u of a.get(e.id)){/* istanbul ignore next -- @preserve */if(V.isSafari){let d=t.editing.mapper.toViewElement(u),h=r.findViewImgElement(d);t.editing.view.once("render",()=>{if(!h.parent)return;let f=t.editing.view.domConverter.mapViewToDom(h.parent);if(!f)return;let m=f.style.display;f.style.display="none",f._ckHack=f.offsetHeight,f.style.display=m})}i.enqueueChange({isUndoable:!1},d=>{d.setAttribute("uploadStatus","uploading",u)})}return c}).then(c=>{i.enqueueChange({isUndoable:!1},u=>{for(let d of a.get(e.id))u.setAttribute("uploadStatus","complete",d),this.fire("uploadComplete",{data:c,imageElement:d});/* v8 ignore else -- @preserve */t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Image upload complete")),this._uploadedImages.set(e.id,c)}),l()}).catch(c=>{/* v8 ignore else -- @preserve */if(t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Error during image upload")),e.status!=="error"&&e.status!=="aborted")throw c;e.status=="error"&&c&&s.showWarning(c,{title:o("Upload failed"),namespace:"upload"}),i.enqueueChange({isUndoable:!1},u=>{for(let d of a.get(e.id))d.root.rootName!=="$graveyard"&&u.remove(d)}),l()});function l(){i.enqueueChange({isUndoable:!1},c=>{for(let u of a.get(e.id))c.removeAttribute("uploadId",u),c.removeAttribute("uploadStatus",u);a.delete(e.id)}),n.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,i){let o=0,n=Object.keys(e).filter(s=>{let r=parseInt(s,10);if(!isNaN(r))return o=Math.max(o,r),!0}).map(s=>`${e[s]} ${s}w`).join(", ");if(n!=""){let s={srcset:n};!t.hasAttribute("width")&&!t.hasAttribute("height")&&(s.width=o),i.setAttributes(s,t)}}_registerConverters(e){let{conversion:t,plugins:i}=this.editor,o=i.get(xt),n=i.get(Ue);t.for("dataDowncast").add(s=>{s.on(`attribute:uploadId:${e}`,(r,a,l)=>{if(!l.consumable.test(a.item,r.name))return;let c=o.loaders.get(a.attributeNewValue);if(!c||!c.data)return null;let u=l.mapper.toViewElement(a.item),d=n.findViewImgElement(u);/* v8 ignore else -- @preserve */d&&(l.consumable.consume(a.item,r.name),l.writer.setAttribute("data-ck-upload-id",c.id,d))})})}};function sI(e){return Array.from(e.types).includes("text/html")&&e.getData("text/html")!==""}function rI(e,t){let i=e.plugins.get("ImageUtils");return Array.from(e.model.createRangeOn(t)).filter(o=>i.isImage(o.item)).map(o=>o.item)}/** +*/var rI=class extends w{static get requires(){return[Tt,wh,Be,Ue]}static get pluginName(){return"ImageUploadEditing"}static get isOfficialPlugin(){return!0}_uploadImageElements;_uploadedImages=new Map;constructor(e){super(e),e.config.define("image",{upload:{types:["jpeg","png","gif","bmp","webp","tiff"]}}),this._uploadImageElements=new Map}init(){let e=this.editor,t=e.model.document,i=e.conversion,o=e.plugins.get(Tt),n=e.plugins.get("ImageUtils"),s=e.plugins.get("ClipboardPipeline"),r=K2(e.config.get("image.upload.types")),a=new sI(e);e.commands.add("uploadImage",a),e.commands.add("imageUpload",a),i.for("upcast").attributeToAttribute({view:{name:"img",key:"uploadId"},model:"uploadId"}).add(l=>l.on("element:img",(c,u,d)=>{if(!d.consumable.test(u.viewItem,{attributes:["data-ck-upload-id"]}))return;let h=u.viewItem.getAttribute("data-ck-upload-id");if(!h||!u.modelRange)return;let[f]=Array.from(u.modelRange.getItems({shallow:!0})),m=o.loaders.get(h);/* v8 ignore else -- @preserve */f&&(d.writer.setAttribute("uploadId",h,f),d.consumable.consume(u.viewItem,{attributes:["data-ck-upload-id"]}),m&&m.data&&d.writer.setAttribute("uploadStatus",m.status,f))},{priority:"low"})),this.listenTo(e.editing.view.document,"clipboardInput",(l,c)=>{if(aI(c.dataTransfer))return;let u=Array.from(c.dataTransfer.files).filter(d=>d?r.test(d.type):!1);if(u.length&&(l.stop(),e.model.change(d=>{c.targetRanges&&d.setSelection(c.targetRanges.map(h=>e.editing.mapper.toModelRange(h))),e.execute("uploadImage",{file:u})}),!e.commands.get("uploadImage").isAccessAllowed)){let d=e.plugins.get("Notification"),h=e.locale.t;d.showWarning(h("You have no image upload permissions."),{namespace:"image"})}}),this.listenTo(s,"inputTransformation",(l,c)=>{let u=Array.from(e.editing.view.createRangeIn(c.content)).map(h=>h.item).filter(h=>KA(n,h)&&!h.getAttribute("uploadProcessed")).map(h=>({promise:jA(h),imageElement:h}));if(!u.length)return;let d=new Lt(e.editing.view.document);for(let h of u){d.setAttribute("uploadProcessed",!0,h.imageElement);let f=o.createLoader(h.promise);f&&(d.setAttribute("src","",h.imageElement),d.setAttribute("uploadId",f.id,h.imageElement))}}),e.editing.view.document.on("dragover",(l,c)=>{c.preventDefault()}),t.on("change",()=>{let l=t.differ.getChanges({includeChangesInGraveyard:!0}).reverse(),c=new Set;for(let u of l)if(u.type=="insert"&&u.name!="$text"){let d=u.position.nodeAfter,h=u.position.root.rootName=="$graveyard";for(let f of lI(e,d)){let m=f.getAttribute("uploadId"),g=f.getAttribute("uploadStatus");if(!m||g=="complete")continue;let b=o.loaders.get(m);if(!b){!h&&this._uploadedImages.has(m)&&e.model.enqueueChange({isUndoable:!1},k=>{k.setAttribute("uploadStatus","complete",f),this.fire("uploadComplete",{data:this._uploadedImages.get(m),imageElement:f})});continue}if(h){if(!c.has(m)){/* v8 ignore else -- @preserve */Array.from(this._uploadImageElements.get(m)).every(k=>k.root.rootName=="$graveyard")&&b.abort()}}else c.add(m),this._uploadImageElements.has(m)?this._uploadImageElements.get(m).add(f):this._uploadImageElements.set(m,new Set([f])),b.status=="idle"&&this._readAndUpload(b)}}}),this.on("uploadComplete",(l,{imageElement:c,data:u})=>{let d=u.urls?u.urls:u;this.editor.model.change(h=>{h.setAttribute("src",d.default,c),this._parseAndSetSrcsetAttributeOnImage(d,c,h),n.setImageNaturalSizeAttributes(c)})},{priority:"low"})}afterInit(){let e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&(e.extend("imageBlock",{allowAttributes:["uploadId","uploadStatus"]}),this._registerConverters("imageBlock")),this.editor.plugins.has("ImageInlineEditing")&&(e.extend("imageInline",{allowAttributes:["uploadId","uploadStatus"]}),this._registerConverters("imageInline"))}_readAndUpload(e){let t=this.editor,i=t.model,o=t.locale.t,n=t.plugins.get(Tt),s=t.plugins.get(wh),r=t.plugins.get("ImageUtils"),a=this._uploadImageElements;return i.enqueueChange({isUndoable:!1},c=>{let u=a.get(e.id);for(let d of u)c.setAttribute("uploadStatus","reading",d)}),e.read().then(()=>{let c=e.upload();/* v8 ignore else -- @preserve */t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Uploading image"));for(let u of a.get(e.id)){/* istanbul ignore next -- @preserve */if(V.isSafari){let d=t.editing.mapper.toViewElement(u),h=r.findViewImgElement(d);t.editing.view.once("render",()=>{if(!h.parent)return;let f=t.editing.view.domConverter.mapViewToDom(h.parent);if(!f)return;let m=f.style.display;f.style.display="none",f._ckHack=f.offsetHeight,f.style.display=m})}i.enqueueChange({isUndoable:!1},d=>{d.setAttribute("uploadStatus","uploading",u)})}return c}).then(c=>{i.enqueueChange({isUndoable:!1},u=>{for(let d of a.get(e.id))u.setAttribute("uploadStatus","complete",d),this.fire("uploadComplete",{data:c,imageElement:d});/* v8 ignore else -- @preserve */t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Image upload complete")),this._uploadedImages.set(e.id,c)}),l()}).catch(c=>{/* v8 ignore else -- @preserve */if(t.ui&&t.ui.ariaLiveAnnouncer.announce(o("Error during image upload")),e.status!=="error"&&e.status!=="aborted")throw c;e.status=="error"&&c&&s.showWarning(c,{title:o("Upload failed"),namespace:"upload"}),i.enqueueChange({isUndoable:!1},u=>{for(let d of a.get(e.id))d.root.rootName!=="$graveyard"&&u.remove(d)}),l()});function l(){i.enqueueChange({isUndoable:!1},c=>{for(let u of a.get(e.id))c.removeAttribute("uploadId",u),c.removeAttribute("uploadStatus",u);a.delete(e.id)}),n.destroyLoader(e)}}_parseAndSetSrcsetAttributeOnImage(e,t,i){let o=0,n=Object.keys(e).filter(s=>{let r=parseInt(s,10);if(!isNaN(r))return o=Math.max(o,r),!0}).map(s=>`${e[s]} ${s}w`).join(", ");if(n!=""){let s={srcset:n};!t.hasAttribute("width")&&!t.hasAttribute("height")&&(s.width=o),i.setAttributes(s,t)}}_registerConverters(e){let{conversion:t,plugins:i}=this.editor,o=i.get(Tt),n=i.get(Ue);t.for("dataDowncast").add(s=>{s.on(`attribute:uploadId:${e}`,(r,a,l)=>{if(!l.consumable.test(a.item,r.name))return;let c=o.loaders.get(a.attributeNewValue);if(!c||!c.data)return null;let u=l.mapper.toViewElement(a.item),d=n.findViewImgElement(u);/* v8 ignore else -- @preserve */d&&(l.consumable.consume(a.item,r.name),l.writer.setAttribute("data-ck-upload-id",c.id,d))})})}};function aI(e){return Array.from(e.types).includes("text/html")&&e.getData("text/html")!==""}function lI(e,t){let i=e.plugins.get("ImageUtils");return Array.from(e.model.createRangeOn(t)).filter(o=>i.isImage(o.item)).map(o=>o.item)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Z2=class extends y{static get pluginName(){return"ImageUpload"}static get isOfficialPlugin(){return!0}static get requires(){return[nI,GA,JA]}};/** +*/var Q2=class extends w{static get pluginName(){return"ImageUpload"}static get isOfficialPlugin(){return!0}static get requires(){return[rI,ZA,QA]}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -1399,76 +1399,76 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var aI=class extends M{refresh(){let e=this.editor,t=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);this.isEnabled=!!t,!t||!t.hasAttribute("resizedWidth")?this.value=null:this.value={width:t.getAttribute("resizedWidth"),height:null}}execute(e){let t=this.editor,i=t.model,o=t.plugins.get("ImageUtils"),n=o.getClosestSelectedImageElement(i.document.selection);this.value={width:e.width,height:null},n&&i.change(s=>{s.setAttribute("resizedWidth",e.width,n),s.removeAttribute("resizedHeight",n),o.setImageNaturalSizeAttributes(n)})}};/** +*/var cI=class extends M{refresh(){let e=this.editor,t=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);this.isEnabled=!!t,!t||!t.hasAttribute("resizedWidth")?this.value=null:this.value={width:t.getAttribute("resizedWidth"),height:null}}execute(e){let t=this.editor,i=t.model,o=t.plugins.get("ImageUtils"),n=o.getClosestSelectedImageElement(i.document.selection);this.value={width:e.width,height:null},n&&i.change(s=>{s.setAttribute("resizedWidth",e.width,n),s.removeAttribute("resizedHeight",n),o.setImageNaturalSizeAttributes(n)})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Q2=class extends y{static get requires(){return[Ue]}static get pluginName(){return"ImageResizeEditing"}static get licenseFeatureCode(){return"IR"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}constructor(e){super(e),e.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:custom",value:"custom",icon:"custom"},{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]})}init(){let e=this.editor,t=new aI(e);this._registerConverters("imageBlock"),this._registerConverters("imageInline"),e.commands.add("resizeImage",t),e.commands.add("imageResize",t)}afterInit(){this._registerSchema()}_registerSchema(){let e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&(e.extend("imageBlock",{allowAttributes:["resizedWidth","resizedHeight"]}),e.setAttributeProperties("resizedWidth",{isFormatting:!0}),e.setAttributeProperties("resizedHeight",{isFormatting:!0})),this.editor.plugins.has("ImageInlineEditing")&&(e.extend("imageInline",{allowAttributes:["resizedWidth","resizedHeight"]}),e.setAttributeProperties("resizedWidth",{isFormatting:!0}),e.setAttributeProperties("resizedHeight",{isFormatting:!0}))}_registerConverters(e){let t=this.editor,i=t.plugins.get("ImageUtils");t.conversion.for("downcast").add(o=>o.on(`attribute:resizedWidth:${e}`,(n,s,r)=>{if(!r.consumable.consume(s.item,n.name))return;let a=r.writer,l=r.mapper.toViewElement(s.item);s.attributeNewValue!==null?(a.setStyle("width",s.attributeNewValue,l),a.addClass("image_resized",l)):(a.removeStyle("width",l),a.removeClass("image_resized",l))})),t.conversion.for("dataDowncast").attributeToAttribute({model:{name:e,key:"resizedHeight"},view:o=>({key:"style",value:{height:o}})}),t.conversion.for("editingDowncast").add(o=>o.on(`attribute:resizedHeight:${e}`,(n,s,r)=>{if(!r.consumable.consume(s.item,n.name))return;let a=r.writer,l=r.mapper.toViewElement(s.item),c=e==="imageInline"?i.findViewImgElement(l):l;s.attributeNewValue!==null?a.setStyle("height",s.attributeNewValue,c):a.removeStyle("height",c)})),t.conversion.for("upcast").attributeToAttribute({view:{name:e==="imageBlock"?"figure":"img",styles:{width:/.+/}},model:{key:"resizedWidth",value:o=>Kl(o)?null:o.getStyle("width")}}),t.conversion.for("upcast").attributeToAttribute({view:{name:e==="imageBlock"?"figure":"img",styles:{height:/.+/}},model:{key:"resizedHeight",value:o=>Kl(o)?null:o.getStyle("height")}}),t.conversion.for("upcast").add(o=>{o.on(`element:${e==="imageBlock"?"figure":"img"}`,(n,s,r)=>{r.consumable.consume(s.viewItem,{classes:["image_resized"]})})})}};/** +*/var Y2=class extends w{static get requires(){return[Ue]}static get pluginName(){return"ImageResizeEditing"}static get licenseFeatureCode(){return"IR"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}constructor(e){super(e),e.config.define("image",{resizeUnit:"%",resizeOptions:[{name:"resizeImage:original",value:null,icon:"original"},{name:"resizeImage:custom",value:"custom",icon:"custom"},{name:"resizeImage:25",value:"25",icon:"small"},{name:"resizeImage:50",value:"50",icon:"medium"},{name:"resizeImage:75",value:"75",icon:"large"}]})}init(){let e=this.editor,t=new cI(e);this._registerConverters("imageBlock"),this._registerConverters("imageInline"),e.commands.add("resizeImage",t),e.commands.add("imageResize",t)}afterInit(){this._registerSchema()}_registerSchema(){let e=this.editor.model.schema;this.editor.plugins.has("ImageBlockEditing")&&(e.extend("imageBlock",{allowAttributes:["resizedWidth","resizedHeight"]}),e.setAttributeProperties("resizedWidth",{isFormatting:!0}),e.setAttributeProperties("resizedHeight",{isFormatting:!0})),this.editor.plugins.has("ImageInlineEditing")&&(e.extend("imageInline",{allowAttributes:["resizedWidth","resizedHeight"]}),e.setAttributeProperties("resizedWidth",{isFormatting:!0}),e.setAttributeProperties("resizedHeight",{isFormatting:!0}))}_registerConverters(e){let t=this.editor,i=t.plugins.get("ImageUtils");t.conversion.for("downcast").add(o=>o.on(`attribute:resizedWidth:${e}`,(n,s,r)=>{if(!r.consumable.consume(s.item,n.name))return;let a=r.writer,l=r.mapper.toViewElement(s.item);s.attributeNewValue!==null?(a.setStyle("width",s.attributeNewValue,l),a.addClass("image_resized",l)):(a.removeStyle("width",l),a.removeClass("image_resized",l))})),t.conversion.for("dataDowncast").attributeToAttribute({model:{name:e,key:"resizedHeight"},view:o=>({key:"style",value:{height:o}})}),t.conversion.for("editingDowncast").add(o=>o.on(`attribute:resizedHeight:${e}`,(n,s,r)=>{if(!r.consumable.consume(s.item,n.name))return;let a=r.writer,l=r.mapper.toViewElement(s.item),c=e==="imageInline"?i.findViewImgElement(l):l;s.attributeNewValue!==null?a.setStyle("height",s.attributeNewValue,c):a.removeStyle("height",c)})),t.conversion.for("upcast").attributeToAttribute({view:{name:e==="imageBlock"?"figure":"img",styles:{width:/.+/}},model:{key:"resizedWidth",value:o=>Jl(o)?null:o.getStyle("width")}}),t.conversion.for("upcast").attributeToAttribute({view:{name:e==="imageBlock"?"figure":"img",styles:{height:/.+/}},model:{key:"resizedHeight",value:o=>Jl(o)?null:o.getStyle("height")}}),t.conversion.for("upcast").add(o=>{o.on(`element:${e==="imageBlock"?"figure":"img"}`,(n,s,r)=>{r.consumable.consume(s.viewItem,{classes:["image_resized"]})})})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Ah={small:X1,medium:Y1,large:Q1,custom:J1,original:Z1},lI=class extends y{static get requires(){return[Q2]}static get pluginName(){return"ImageResizeButtons"}static get isOfficialPlugin(){return!0}_resizeUnit;constructor(e){super(e),this._resizeUnit=e.config.get("image.resizeUnit")}init(){let e=this.editor,t=e.config.get("image.resizeOptions"),i=e.commands.get("resizeImage");this.bind("isEnabled").to(i);for(let o of t)this._registerImageResizeButton(o);this._registerImageResizeDropdown(t)}_registerImageResizeButton(e){let t=this.editor,{name:i,value:o,icon:n}=e;t.ui.componentFactory.add(i,s=>{let r=new I(s),a=t.commands.get("resizeImage"),l=this._getOptionLabelValue(e,!0);if(!Ah[n])throw new p("imageresizebuttons-missing-icon",t,e);if(r.set({label:l,icon:Ah[n],tooltip:l,isToggleable:!0}),r.bind("isEnabled").to(this),t.plugins.has("ImageCustomResizeUI")&&Pr(e)){let c=t.plugins.get("ImageCustomResizeUI");this.listenTo(r,"execute",()=>{c._showForm(this._resizeUnit)})}else{let c=o?o+this._resizeUnit:null;r.bind("isOn").to(a,"value",a,"isEnabled",Sh(c)),this.listenTo(r,"execute",()=>{t.execute("resizeImage",{width:c})})}return r})}_registerImageResizeDropdown(e){let t=this.editor,i=t.t,o=e.find(s=>!s.value),n=s=>{let r=t.commands.get("resizeImage"),a=Se(s,Ml),l=a.buttonView,c=i("Resize image");return l.set({tooltip:c,commandValue:o.value,icon:Ah.medium,isToggleable:!0,label:this._getOptionLabelValue(o),withText:!0,class:"ck-resize-image-button",ariaLabel:c,ariaLabelledBy:void 0}),l.bind("label").to(r,"value",u=>u&&u.width?u.width:this._getOptionLabelValue(o)),a.bind("isEnabled").to(this),Bt(a,()=>this._getResizeDropdownListItemDefinitions(e,r),{ariaLabel:i("Image resize list"),role:"menu"}),this.listenTo(a,"execute",u=>{"onClick"in u.source?u.source.onClick():(t.execute(u.source.commandName,{width:u.source.commandValue}),t.editing.view.focus())}),a};t.ui.componentFactory.add("resizeImage",n),t.ui.componentFactory.add("imageResize",n)}_getOptionLabelValue(e,t=!1){let i=this.editor.t;return e.label?e.label:t?Pr(e)?i("Custom image size"):e.value?i("Resize image to %0",e.value+this._resizeUnit):i("Resize image to the original size"):Pr(e)?i("Custom"):e.value?e.value+this._resizeUnit:i("Original")}_getResizeDropdownListItemDefinitions(e,t){let{editor:i}=this,o=new J,n=e.map(s=>Pr(s)?{...s,valueWithUnits:"custom"}:s.value?{...s,valueWithUnits:`${s.value}${this._resizeUnit}`}:{...s,valueWithUnits:null});for(let s of n){let r;if(i.plugins.has("ImageCustomResizeUI")&&Pr(s)){let a=i.plugins.get("ImageCustomResizeUI");r={type:"button",model:new ki({label:this._getOptionLabelValue(s),role:"menuitemradio",withText:!0,icon:null,onClick:()=>{a._showForm(this._resizeUnit)}})};let l=Object.values(n).map(c=>c.valueWithUnits);r.model.bind("isOn").to(t,"value",t,"isEnabled",cI(l))}else r={type:"button",model:new ki({commandName:"resizeImage",commandValue:s.valueWithUnits,label:this._getOptionLabelValue(s),role:"menuitemradio",withText:!0,icon:null})},r.model.bind("isOn").to(t,"value",t,"isEnabled",Sh(s.valueWithUnits));r.model.bind("isEnabled").to(t,"isEnabled"),o.add(r)}return o}};function Pr(e){return e.value==="custom"}function Sh(e){return(t,i)=>{let o=t;return o===void 0||!i?!1:e===null&&o===e?!0:o!==null&&o.width===e}}function cI(e){return(t,i)=>!e.some(o=>Sh(o)(t,i))}/** +*/var Sh={small:tb,medium:eb,large:X1,custom:Q1,original:Y1},uI=class extends w{static get requires(){return[Y2]}static get pluginName(){return"ImageResizeButtons"}static get isOfficialPlugin(){return!0}_resizeUnit;constructor(e){super(e),this._resizeUnit=e.config.get("image.resizeUnit")}init(){let e=this.editor,t=e.config.get("image.resizeOptions"),i=e.commands.get("resizeImage");this.bind("isEnabled").to(i);for(let o of t)this._registerImageResizeButton(o);this._registerImageResizeDropdown(t)}_registerImageResizeButton(e){let t=this.editor,{name:i,value:o,icon:n}=e;t.ui.componentFactory.add(i,s=>{let r=new I(s),a=t.commands.get("resizeImage"),l=this._getOptionLabelValue(e,!0);if(!Sh[n])throw new p("imageresizebuttons-missing-icon",t,e);if(r.set({label:l,icon:Sh[n],tooltip:l,isToggleable:!0}),r.bind("isEnabled").to(this),t.plugins.has("ImageCustomResizeUI")&&Pr(e)){let c=t.plugins.get("ImageCustomResizeUI");this.listenTo(r,"execute",()=>{c._showForm(this._resizeUnit)})}else{let c=o?o+this._resizeUnit:null;r.bind("isOn").to(a,"value",a,"isEnabled",Rh(c)),this.listenTo(r,"execute",()=>{t.execute("resizeImage",{width:c})})}return r})}_registerImageResizeDropdown(e){let t=this.editor,i=t.t,o=e.find(s=>!s.value),n=s=>{let r=t.commands.get("resizeImage"),a=ye(s,Bl),l=a.buttonView,c=i("Resize image");return l.set({tooltip:c,commandValue:o.value,icon:Sh.medium,isToggleable:!0,label:this._getOptionLabelValue(o),withText:!0,class:"ck-resize-image-button",ariaLabel:c,ariaLabelledBy:void 0}),l.bind("label").to(r,"value",u=>u&&u.width?u.width:this._getOptionLabelValue(o)),a.bind("isEnabled").to(this),ht(a,()=>this._getResizeDropdownListItemDefinitions(e,r),{ariaLabel:i("Image resize list"),role:"menu"}),this.listenTo(a,"execute",u=>{"onClick"in u.source?u.source.onClick():(t.execute(u.source.commandName,{width:u.source.commandValue}),t.editing.view.focus())}),a};t.ui.componentFactory.add("resizeImage",n),t.ui.componentFactory.add("imageResize",n)}_getOptionLabelValue(e,t=!1){let i=this.editor.t;return e.label?e.label:t?Pr(e)?i("Custom image size"):e.value?i("Resize image to %0",e.value+this._resizeUnit):i("Resize image to the original size"):Pr(e)?i("Custom"):e.value?e.value+this._resizeUnit:i("Original")}_getResizeDropdownListItemDefinitions(e,t){let{editor:i}=this,o=new G,n=e.map(s=>Pr(s)?{...s,valueWithUnits:"custom"}:s.value?{...s,valueWithUnits:`${s.value}${this._resizeUnit}`}:{...s,valueWithUnits:null});for(let s of n){let r;if(i.plugins.has("ImageCustomResizeUI")&&Pr(s)){let a=i.plugins.get("ImageCustomResizeUI");r={type:"button",model:new Ot({label:this._getOptionLabelValue(s),role:"menuitemradio",withText:!0,icon:null,onClick:()=>{a._showForm(this._resizeUnit)}})};let l=Object.values(n).map(c=>c.valueWithUnits);r.model.bind("isOn").to(t,"value",t,"isEnabled",dI(l))}else r={type:"button",model:new Ot({commandName:"resizeImage",commandValue:s.valueWithUnits,label:this._getOptionLabelValue(s),role:"menuitemradio",withText:!0,icon:null})},r.model.bind("isOn").to(t,"value",t,"isEnabled",Rh(s.valueWithUnits));r.model.bind("isEnabled").to(t,"isEnabled"),o.add(r)}return o}};function Pr(e){return e.value==="custom"}function Rh(e){return(t,i)=>{let o=t;return o===void 0||!i?!1:e===null&&o===e?!0:o!==null&&o.width===e}}function dI(e){return(t,i)=>!e.some(o=>Rh(o)(t,i))}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var uI="figure.image.ck-widget > img,figure.image.ck-widget > picture > img,figure.image.ck-widget > a > img,figure.image.ck-widget > a > picture > img,span.image-inline.ck-widget > img,span.image-inline.ck-widget > picture > img",Ih="image_resized",dI=class extends y{static get requires(){return[is,Ue]}static get pluginName(){return"ImageResizeHandles"}static get isOfficialPlugin(){return!0}init(){let e=this.editor.commands.get("resizeImage");this.bind("isEnabled").to(e),this._setupResizerCreator()}_setupResizerCreator(){let e=this.editor,t=e.editing.view,i=e.plugins.get("ImageUtils");t.addObserver(Vh),this.listenTo(t.document,"imageLoaded",(o,n)=>{if(!n.target.matches(uI))return;let s=e.editing.view.domConverter,r=s.domToView(n.target),a=i.getImageWidgetFromImageView(r),l=this.editor.plugins.get(is).getResizerByViewElement(a);if(l){l.redraw();return}let c=e.editing.mapper,u=c.toModelElement(a);l=e.plugins.get(is).attachTo({unit:e.config.get("image.resizeUnit"),modelElement:u,viewElement:a,editor:e,getHandleHost(d){return d.querySelector("img")},getResizeHost(){return s.mapViewToDom(c.toViewElement(u))},isCentered(){return u.getAttribute("imageStyle")=="alignCenter"},onCommit(d){t.change(h=>{h.removeClass(Ih,a)}),e.execute("resizeImage",{width:d})}}),l.on("updateSize",()=>{a.hasClass(Ih)||t.change(h=>{h.addClass(Ih,a)});let d=u.name==="imageInline"?r:a;d.getStyle("height")&&t.change(h=>{h.removeStyle("height",d)})}),l.bind("isEnabled").to(this)})}};/** +*/var hI="figure.image.ck-widget > img,figure.image.ck-widget > picture > img,figure.image.ck-widget > a > img,figure.image.ck-widget > a > picture > img,span.image-inline.ck-widget > img,span.image-inline.ck-widget > picture > img",Ph="image_resized",fI=class extends w{static get requires(){return[is,Ue]}static get pluginName(){return"ImageResizeHandles"}static get isOfficialPlugin(){return!0}init(){let e=this.editor.commands.get("resizeImage");this.bind("isEnabled").to(e),this._setupResizerCreator()}_setupResizerCreator(){let e=this.editor,t=e.editing.view,i=e.plugins.get("ImageUtils");t.addObserver(Mh),this.listenTo(t.document,"imageLoaded",(o,n)=>{if(!n.target.matches(hI))return;let s=e.editing.view.domConverter,r=s.domToView(n.target),a=i.getImageWidgetFromImageView(r),l=this.editor.plugins.get(is).getResizerByViewElement(a);if(l){l.redraw();return}let c=e.editing.mapper,u=c.toModelElement(a);l=e.plugins.get(is).attachTo({unit:e.config.get("image.resizeUnit"),modelElement:u,viewElement:a,editor:e,getHandleHost(d){return d.querySelector("img")},getResizeHost(){return s.mapViewToDom(c.toViewElement(u))},isCentered(){return u.getAttribute("imageStyle")=="alignCenter"},onCommit(d){t.change(h=>{h.removeClass(Ph,a)}),e.execute("resizeImage",{width:d})}}),l.on("updateSize",()=>{a.hasClass(Ph)||t.change(h=>{h.addClass(Ph,a)});let d=u.name==="imageInline"?r:a;d.getStyle("height")&&t.change(h=>{h.removeStyle("height",d)})}),l.bind("isEnabled").to(this)})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Y2(e){let{editing:t}=e,i=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);if(!i)return null;let o=t.mapper.toViewElement(i);return{model:i,view:o,dom:t.view.domConverter.mapViewToDom(o)}}/** +*/function X2(e){let{editing:t}=e,i=e.plugins.get("ImageUtils").getClosestSelectedImageElement(e.model.document.selection);if(!i)return null;let o=t.mapper.toViewElement(i);return{model:i,view:o,dom:t.view.domConverter.mapViewToDom(o)}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function hI(e,t){let i=Y2(e);if(!i)return null;let o=Nu(i.model.getAttribute("resizedWidth")||null);if(!o)return null;if(o.unit===t)return o;let n=Wl(i.dom),s={unit:"px",value:new F(i.dom).width};return zu(n,s,t)}/** +*/function mI(e,t){let i=X2(e);if(!i)return null;let o=Hu(i.model.getAttribute("resizedWidth")||null);if(!o)return null;if(o.unit===t)return o;let n=Ul(i.dom),s={unit:"px",value:new F(i.dom).width};return Wu(n,s,t)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var fI=class extends R{focusTracker;keystrokes;unit;backButtonView;saveButtonView;labeledInput;children;_focusables;_focusCycler;_validators;constructor(e,t,i){super(e),this.focusTracker=new Q,this.keystrokes=new X,this.unit=t,this.backButtonView=this._createBackButton(),this.saveButtonView=this._createSaveButton(),this.labeledInput=this._createLabeledInputView(),this.children=this.createCollection([this._createHeaderView()]),this.children.add(new fe(e,{children:[this.labeledInput,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-top-padding","ck-form__row_large-bottom-padding"]})),this._focusables=new be,this._validators=i,this.keystrokes.set("Esc",(o,n)=>{this.fire("cancel"),n()}),this._focusCycler=new Ie({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-image-custom-resize-form","ck-responsive-form"],tabindex:"-1"},children:this.children})}render(){super.render(),_i({view:this}),[this.backButtonView,this.labeledInput,this.saveButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createBackButton(){let e=this.locale.t,t=new I(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:yt,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createSaveButton(){let e=this.locale.t,t=new I(this.locale);return t.set({label:e("Save"),withText:!0,type:"submit",class:"ck-button-action"}),t}_createHeaderView(){let e=this.locale.t,t=new Mt(this.locale,{label:e("Image Resize")});return t.children.add(this.backButtonView,0),t}_createLabeledInputView(){let e=this.locale.t,t=new ue(this.locale,gh);return t.label=e("Resize image (in %0)",this.unit),t.class="ck-labeled-field-view_full-width",t.fieldView.set({step:.1}),t}isValid(){this.resetFormStatus();for(let e of this._validators){let t=e(this);if(t)return this.labeledInput.errorText=t,!1}return!0}resetFormStatus(){this.labeledInput.errorText=null}get rawSize(){let{element:e}=this.labeledInput.fieldView;return e?e.value:null}get parsedSize(){let{rawSize:e}=this;if(e===null)return null;let t=Number.parseFloat(e);return Number.isNaN(t)?null:t}get sizeWithUnits(){let{parsedSize:e,unit:t}=this;return e===null?null:`${e}${t}`}};/** +*/var gI=class extends R{focusTracker;keystrokes;unit;backButtonView;saveButtonView;labeledInput;children;_focusables;_focusCycler;_validators;constructor(e,t,i){super(e),this.focusTracker=new Q,this.keystrokes=new X,this.unit=t,this.backButtonView=this._createBackButton(),this.saveButtonView=this._createSaveButton(),this.labeledInput=this._createLabeledInputView(),this.children=this.createCollection([this._createHeaderView()]),this.children.add(new fe(e,{children:[this.labeledInput,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-top-padding","ck-form__row_large-bottom-padding"]})),this._focusables=new we,this._validators=i,this.keystrokes.set("Esc",(o,n)=>{this.fire("cancel"),n()}),this._focusCycler=new Pe({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-image-custom-resize-form","ck-responsive-form"],tabindex:"-1"},children:this.children})}render(){super.render(),ki({view:this}),[this.backButtonView,this.labeledInput,this.saveButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createBackButton(){let e=this.locale.t,t=new I(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:_t,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createSaveButton(){let e=this.locale.t,t=new I(this.locale);return t.set({label:e("Save"),withText:!0,type:"submit",class:"ck-button-action"}),t}_createHeaderView(){let e=this.locale.t,t=new Bt(this.locale,{label:e("Image Resize")});return t.children.add(this.backButtonView,0),t}_createLabeledInputView(){let e=this.locale.t,t=new ue(this.locale,bh);return t.label=e("Resize image (in %0)",this.unit),t.class="ck-labeled-field-view_full-width",t.fieldView.set({step:.1}),t}isValid(){this.resetFormStatus();for(let e of this._validators){let t=e(this);if(t)return this.labeledInput.errorText=t,!1}return!0}resetFormStatus(){this.labeledInput.errorText=null}get rawSize(){let{element:e}=this.labeledInput.fieldView;return e?e.value:null}get parsedSize(){let{rawSize:e}=this;if(e===null)return null;let t=Number.parseFloat(e);return Number.isNaN(t)?null:t}get sizeWithUnits(){let{parsedSize:e,unit:t}=this;return e===null?null:`${e}${t}`}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function mI(e,t){let i=Y2(e);if(!i)return null;let o=Wl(i.dom),n=Nu(window.getComputedStyle(i.dom).minWidth)||{value:1,unit:"px"};return{unit:t,lower:Math.max(.1,zu(o,n,t).value),upper:t==="px"?o:100}}/** +*/function pI(e,t){let i=X2(e);if(!i)return null;let o=Ul(i.dom),n=Hu(window.getComputedStyle(i.dom).minWidth)||{value:1,unit:"px"};return{unit:t,lower:Math.max(.1,Wu(o,n,t).value),upper:t==="px"?o:100}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var gI=class extends y{_balloon;_form;static get requires(){return[re]}static get pluginName(){return"ImageCustomResizeUI"}static get isOfficialPlugin(){return!0}destroy(){super.destroy(),this._form&&this._form.destroy()}_createForm(e){let t=this.editor;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(Kn(fI))(t.locale,e,pI(t)),this._form.render(),this.listenTo(this._form,"submit",()=>{this._form.isValid()&&(t.execute("resizeImage",{width:this._form.sizeWithUnits}),this._hideForm(!0))}),this.listenTo(this._form.labeledInput,"change:errorText",()=>{t.ui.update()}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),vt({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(e){if(this._isVisible)return;this._form||this._createForm(e);let t=this.editor,i=this._form.labeledInput;this._form.disableCssTransitions(),this._form.resetFormStatus(),this._isInBalloon||this._balloon.add({view:this._form,position:Rh(t)});let o=hI(t,e),n=o?o.value.toFixed(1):"",s=mI(t,e);i.fieldView.value=i.fieldView.element.value=n,s&&Object.assign(i.fieldView,{min:s.lower.toFixed(1),max:Math.ceil(s.upper).toFixed(1)}),this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}};function pI(e){let t=e.t;return[i=>{if(i.rawSize.trim()==="")return t("The value must not be empty.");if(i.parsedSize===null)return t("The value should be a plain number.")}]}/** +*/var bI=class extends w{_balloon;_form;static get requires(){return[re]}static get pluginName(){return"ImageCustomResizeUI"}static get isOfficialPlugin(){return!0}destroy(){super.destroy(),this._form&&this._form.destroy()}_createForm(e){let t=this.editor;this._balloon=this.editor.plugins.get("ContextualBalloon"),this._form=new(Kn(gI))(t.locale,e,wI(t)),this._form.render(),this.listenTo(this._form,"submit",()=>{this._form.isValid()&&(t.execute("resizeImage",{width:this._form.sizeWithUnits}),this._hideForm(!0))}),this.listenTo(this._form.labeledInput,"change:errorText",()=>{t.ui.update()}),this.listenTo(this._form,"cancel",()=>{this._hideForm(!0)}),kt({emitter:this._form,activator:()=>this._isVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideForm()})}_showForm(e){if(this._isVisible)return;this._form||this._createForm(e);let t=this.editor,i=this._form.labeledInput;this._form.disableCssTransitions(),this._form.resetFormStatus(),this._isInBalloon||this._balloon.add({view:this._form,position:Lh(t)});let o=mI(t,e),n=o?o.value.toFixed(1):"",s=pI(t,e);i.fieldView.value=i.fieldView.element.value=n,s&&Object.assign(i.fieldView,{min:s.lower.toFixed(1),max:Math.ceil(s.upper).toFixed(1)}),this._form.labeledInput.fieldView.select(),this._form.enableCssTransitions()}_hideForm(e=!1){this._isInBalloon&&(this._form.focusTracker.isFocused&&this._form.saveButtonView.focus(),this._balloon.remove(this._form),e&&this.editor.editing.view.focus())}get _isVisible(){return!!this._balloon&&this._balloon.visibleView===this._form}get _isInBalloon(){return!!this._balloon&&this._balloon.hasView(this._form)}};function wI(e){let t=e.t;return[i=>{if(i.rawSize.trim()==="")return t("The value must not be empty.");if(i.parsedSize===null)return t("The value should be a plain number.")}]}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var X2=class extends y{static get requires(){return[Q2,dI,gI,lI]}static get pluginName(){return"ImageResize"}static get isOfficialPlugin(){return!0}};/** +*/var ey=class extends w{static get requires(){return[Y2,fI,bI,uI]}static get pluginName(){return"ImageResize"}static get isOfficialPlugin(){return!0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var bI=class extends M{_defaultStyles;_styles;constructor(e,t){super(e),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(t.map(i=>{if(i.isDefault)for(let o of i.modelElements)this._defaultStyles[o]=i.name;return[i.name,i]}))}refresh(){let e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled?e.hasAttribute("imageStyle")?this.value=e.getAttribute("imageStyle"):this.value=this._defaultStyles[e.name]:this.value=!1}isStyleEnabled(e){if(!this.isEnabled)return!1;let t=this.editor.plugins.get("ImageUtils"),i=t.getClosestSelectedImageElement(this.editor.model.document.selection);if(!i||!this._styles.has(e))return!1;if(!this.shouldConvertImageType(e,i))return!0;let o=t.isBlockImage(i)?"imageTypeInline":"imageTypeBlock",n=this.editor.commands.get(o);return!!n&&n.isEnabled}execute(e={}){let t=this.editor,i=t.model,o=t.plugins.get("ImageUtils");e.value&&!this.isStyleEnabled(e.value)||i.change(n=>{let s=e.value,{setImageSizes:r=!0}=e,a=o.getClosestSelectedImageElement(i.document.selection);s&&this.shouldConvertImageType(s,a)&&(this.editor.execute(o.isBlockImage(a)?"imageTypeInline":"imageTypeBlock",{setImageSizes:r}),a=o.getClosestSelectedImageElement(i.document.selection)),!s||this._styles.get(s).isDefault?n.removeAttribute("imageStyle",a):n.setAttribute("imageStyle",s,a),r&&o.setImageNaturalSizeAttributes(a)})}shouldConvertImageType(e,t){return!this._styles.get(e).modelElements.includes(t.name)}};/** +*/var yI=class extends M{_defaultStyles;_styles;constructor(e,t){super(e),this._defaultStyles={imageBlock:!1,imageInline:!1},this._styles=new Map(t.map(i=>{if(i.isDefault)for(let o of i.modelElements)this._defaultStyles[o]=i.name;return[i.name,i]}))}refresh(){let e=this.editor.plugins.get("ImageUtils").getClosestSelectedImageElement(this.editor.model.document.selection);this.isEnabled=!!e,this.isEnabled?e.hasAttribute("imageStyle")?this.value=e.getAttribute("imageStyle"):this.value=this._defaultStyles[e.name]:this.value=!1}isStyleEnabled(e){if(!this.isEnabled)return!1;let t=this.editor.plugins.get("ImageUtils"),i=t.getClosestSelectedImageElement(this.editor.model.document.selection);if(!i||!this._styles.has(e))return!1;if(!this.shouldConvertImageType(e,i))return!0;let o=t.isBlockImage(i)?"imageTypeInline":"imageTypeBlock",n=this.editor.commands.get(o);return!!n&&n.isEnabled}execute(e={}){let t=this.editor,i=t.model,o=t.plugins.get("ImageUtils");e.value&&!this.isStyleEnabled(e.value)||i.change(n=>{let s=e.value,{setImageSizes:r=!0}=e,a=o.getClosestSelectedImageElement(i.document.selection);s&&this.shouldConvertImageType(s,a)&&(this.editor.execute(o.isBlockImage(a)?"imageTypeInline":"imageTypeBlock",{setImageSizes:r}),a=o.getClosestSelectedImageElement(i.document.selection)),!s||this._styles.get(s).isDefault?n.removeAttribute("imageStyle",a):n.setAttribute("imageStyle",s,a),r&&o.setImageNaturalSizeAttributes(a)})}shouldConvertImageType(e,t){return!this._styles.get(e).modelElements.includes(t.name)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var $l={get inline(){return{name:"inline",title:"In line",icon:Nd,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:ur,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:dr,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:On,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:Dn,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:hr,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:On,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:Dn,modelElements:["imageBlock"],className:"image-style-side"}}},wI={full:G1,left:dr,right:hr,center:On,inlineLeft:ur,inlineRight:Dn,inline:Nd},yI=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function Jl(e,t){for(let i of t)if(i.name===e)return i}function _I(e){return(e.configuredStyles.options||[]).map(t=>CI(t)).filter(t=>xI(t,e))}function vI(e,t){return e&&t?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:e?{options:["block","side"]}:t?{options:["inline","alignLeft","alignRight"]}:{}}function kI(e){return e.has("ImageBlockEditing")&&e.has("ImageInlineEditing")?[...yI]:[]}function CI(e){return typeof e=="string"?$l[e]?e={...$l[e]}:e={name:e}:e=TI($l[e.name],e),typeof e.icon=="string"&&(e.icon=wI[e.icon]||e.icon),e}function xI(e,{isBlockPluginLoaded:t,isInlinePluginLoaded:i}){let{modelElements:o,name:n}=e;if(!o||!o.length||!n)return ey({style:e}),!1;{let s=[t?"imageBlock":null,i?"imageInline":null];if(!o.some(r=>s.includes(r)))return D("image-style-missing-dependency",{style:e,missingPlugins:o.map(r=>r==="imageBlock"?"ImageBlockEditing":"ImageInlineEditing")}),!1}return!0}function TI(e,t){let i={...t};for(let o in e)Object.prototype.hasOwnProperty.call(t,o)||(i[o]=e[o]);return i}function ey(e){D("image-style-configuration-definition-invalid",e)}var Zl={normalizeStyles:_I,getDefaultStylesConfiguration:vI,getDefaultDropdownDefinitions:kI,warnInvalidStyle:ey};/** +*/var Kl={get inline(){return{name:"inline",title:"In line",icon:Hd,modelElements:["imageInline"],isDefault:!0}},get alignLeft(){return{name:"alignLeft",title:"Left aligned image",icon:ur,modelElements:["imageBlock","imageInline"],className:"image-style-align-left"}},get alignBlockLeft(){return{name:"alignBlockLeft",title:"Left aligned image",icon:dr,modelElements:["imageBlock"],className:"image-style-block-align-left"}},get alignCenter(){return{name:"alignCenter",title:"Centered image",icon:On,modelElements:["imageBlock"],className:"image-style-align-center"}},get alignRight(){return{name:"alignRight",title:"Right aligned image",icon:Dn,modelElements:["imageBlock","imageInline"],className:"image-style-align-right"}},get alignBlockRight(){return{name:"alignBlockRight",title:"Right aligned image",icon:hr,modelElements:["imageBlock"],className:"image-style-block-align-right"}},get block(){return{name:"block",title:"Centered image",icon:On,modelElements:["imageBlock"],isDefault:!0}},get side(){return{name:"side",title:"Side image",icon:Dn,modelElements:["imageBlock"],className:"image-style-side"}}},_I={full:Z1,left:dr,right:hr,center:On,inlineLeft:ur,inlineRight:Dn,inline:Hd},vI=[{name:"imageStyle:wrapText",title:"Wrap text",defaultItem:"imageStyle:alignLeft",items:["imageStyle:alignLeft","imageStyle:alignRight"]},{name:"imageStyle:breakText",title:"Break text",defaultItem:"imageStyle:block",items:["imageStyle:alignBlockLeft","imageStyle:block","imageStyle:alignBlockRight"]}];function Ql(e,t){for(let i of t)if(i.name===e)return i}function kI(e){return(e.configuredStyles.options||[]).map(t=>TI(t)).filter(t=>EI(t,e))}function CI(e,t){return e&&t?{options:["inline","alignLeft","alignRight","alignCenter","alignBlockLeft","alignBlockRight","block","side"]}:e?{options:["block","side"]}:t?{options:["inline","alignLeft","alignRight"]}:{}}function xI(e){return e.has("ImageBlockEditing")&&e.has("ImageInlineEditing")?[...vI]:[]}function TI(e){return typeof e=="string"?Kl[e]?e={...Kl[e]}:e={name:e}:e=AI(Kl[e.name],e),typeof e.icon=="string"&&(e.icon=_I[e.icon]||e.icon),e}function EI(e,{isBlockPluginLoaded:t,isInlinePluginLoaded:i}){let{modelElements:o,name:n}=e;if(!o||!o.length||!n)return ty({style:e}),!1;{let s=[t?"imageBlock":null,i?"imageInline":null];if(!o.some(r=>s.includes(r)))return D("image-style-missing-dependency",{style:e,missingPlugins:o.map(r=>r==="imageBlock"?"ImageBlockEditing":"ImageInlineEditing")}),!1}return!0}function AI(e,t){let i={...t};for(let o in e)Object.prototype.hasOwnProperty.call(t,o)||(i[o]=e[o]);return i}function ty(e){D("image-style-configuration-definition-invalid",e)}var Yl={normalizeStyles:kI,getDefaultStylesConfiguration:CI,getDefaultDropdownDefinitions:xI,warnInvalidStyle:ty};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function EI(e){return(t,i,o)=>{if(!o.consumable.consume(i.item,t.name))return;let n=Jl(i.attributeNewValue,e),s=Jl(i.attributeOldValue,e),r=o.mapper.toViewElement(i.item),a=o.writer;s&&a.removeClass(s.className,r),n&&a.addClass(n.className,r)}}function AI(e){let t={imageInline:e.filter(i=>!i.isDefault&&i.modelElements.includes("imageInline")),imageBlock:e.filter(i=>!i.isDefault&&i.modelElements.includes("imageBlock"))};return(i,o,n)=>{if(!o.modelRange)return;let s=o.viewItem,r=G(o.modelRange.getItems());if(r&&n.schema.checkAttribute(r,"imageStyle")){for(let a of t[r.name])n.consumable.consume(s,{classes:a.className})&&n.writer.setAttribute("imageStyle",a.name,r);II(n,s,r,e)}}}function II(e,t,i,o){if(!e.consumable.test(t,{styles:["float"]}))return;let n=null;switch(t.getStyle("float")){case"left":n="alignLeft";break;case"right":n="alignRight"}if(!n)return;let s=Jl(n,o);if(!s)return;let r=$l[s.name];Bi(s,r)&&(e.writer.setAttribute("imageStyle",n,i),e.consumable.consume(t,{styles:["float"]}))}/** +*/function II(e){return(t,i,o)=>{if(!o.consumable.consume(i.item,t.name))return;let n=Ql(i.attributeNewValue,e),s=Ql(i.attributeOldValue,e),r=o.mapper.toViewElement(i.item),a=o.writer;s&&a.removeClass(s.className,r),n&&a.addClass(n.className,r)}}function SI(e){let t={imageInline:e.filter(i=>!i.isDefault&&i.modelElements.includes("imageInline")),imageBlock:e.filter(i=>!i.isDefault&&i.modelElements.includes("imageBlock"))};return(i,o,n)=>{if(!o.modelRange)return;let s=o.viewItem,r=J(o.modelRange.getItems());if(r&&n.schema.checkAttribute(r,"imageStyle")){for(let a of t[r.name])n.consumable.consume(s,{classes:a.className})&&n.writer.setAttribute("imageStyle",a.name,r);PI(n,s,r,e)}}}function PI(e,t,i,o){if(!e.consumable.test(t,{styles:["float"]}))return;let n=null;switch(t.getStyle("float")){case"left":n="alignLeft";break;case"right":n="alignRight"}if(!n)return;let s=Ql(n,o);if(!s)return;let r=Kl[s.name];Di(s,r)&&(e.writer.setAttribute("imageStyle",n,i),e.consumable.consume(t,{styles:["float"]}))}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var ty=class extends y{static get pluginName(){return"ImageStyleEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Ue]}normalizedStyles;init(){let e=this.editor,t=e.plugins.has("ImageBlockEditing"),i=e.plugins.has("ImageInlineEditing");e.config.define("image.styles",Zl.getDefaultStylesConfiguration(t,i)),this.normalizedStyles=Zl.normalizeStyles({configuredStyles:e.config.get("image.styles"),isBlockPluginLoaded:t,isInlinePluginLoaded:i}),this._setupConversion(t,i),this._setupPostFixer(),e.commands.add("imageStyle",new bI(e,this.normalizedStyles))}_setupConversion(e,t){let i=this.editor,o=i.model.schema,n=EI(this.normalizedStyles),s=AI(this.normalizedStyles);i.editing.downcastDispatcher.on("attribute:imageStyle",n),i.data.downcastDispatcher.on("attribute:imageStyle",n),e&&(o.extend("imageBlock",{allowAttributes:"imageStyle"}),o.setAttributeProperties("imageStyle",{isFormatting:!0,blockAlignment:SI(this.normalizedStyles)}),i.data.upcastDispatcher.on("element:figure",s,{priority:"low"})),t&&(o.extend("imageInline",{allowAttributes:"imageStyle"}),o.setAttributeProperties("imageStyle",{isFormatting:!0}),i.data.upcastDispatcher.on("element:img",s,{priority:"low"}))}_setupPostFixer(){let e=this.editor,t=e.model.document,i=e.plugins.get(Ue),o=new Map(this.normalizedStyles.map(n=>[n.name,n]));t.registerPostFixer(n=>{let s=!1;for(let r of t.differ.getChanges())if(r.type=="insert"||r.type=="attribute"&&r.attributeKey=="imageStyle"){let a=r.type=="insert"?r.position.nodeAfter:r.range.start.nodeAfter;if(a&&a.is("element","paragraph")&&a.childCount>0&&(a=a.getChild(0)),!i.isImage(a))continue;let l=a.getAttribute("imageStyle");if(!l)continue;let c=o.get(l);(!c||!c.modelElements.includes(a.name))&&(n.removeAttribute("imageStyle",a),s=!0)}return s})}};function SI(e){let t=(...i)=>{let o=i.map(n=>Jl(n,e)).find(n=>n?.modelElements.includes("imageBlock"));if(o)return{isDefault:!!o.isDefault,value:o.name}};return Object.fromEntries(Object.entries({left:["alignBlockLeft","alignLeft"],right:["alignBlockRight","alignRight"],center:["block","alignCenter"]}).map(([i,o])=>[i,t(...o)]).filter(([,i])=>i!==void 0))}/** +*/var iy=class extends w{static get pluginName(){return"ImageStyleEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Ue]}normalizedStyles;init(){let e=this.editor,t=e.plugins.has("ImageBlockEditing"),i=e.plugins.has("ImageInlineEditing");e.config.define("image.styles",Yl.getDefaultStylesConfiguration(t,i)),this.normalizedStyles=Yl.normalizeStyles({configuredStyles:e.config.get("image.styles"),isBlockPluginLoaded:t,isInlinePluginLoaded:i}),this._setupConversion(t,i),this._setupPostFixer(),e.commands.add("imageStyle",new yI(e,this.normalizedStyles))}_setupConversion(e,t){let i=this.editor,o=i.model.schema,n=II(this.normalizedStyles),s=SI(this.normalizedStyles);i.editing.downcastDispatcher.on("attribute:imageStyle",n),i.data.downcastDispatcher.on("attribute:imageStyle",n),e&&(o.extend("imageBlock",{allowAttributes:"imageStyle"}),o.setAttributeProperties("imageStyle",{isFormatting:!0,blockAlignment:RI(this.normalizedStyles)}),i.data.upcastDispatcher.on("element:figure",s,{priority:"low"})),t&&(o.extend("imageInline",{allowAttributes:"imageStyle"}),o.setAttributeProperties("imageStyle",{isFormatting:!0}),i.data.upcastDispatcher.on("element:img",s,{priority:"low"}))}_setupPostFixer(){let e=this.editor,t=e.model.document,i=e.plugins.get(Ue),o=new Map(this.normalizedStyles.map(n=>[n.name,n]));t.registerPostFixer(n=>{let s=!1;for(let r of t.differ.getChanges())if(r.type=="insert"||r.type=="attribute"&&r.attributeKey=="imageStyle"){let a=r.type=="insert"?r.position.nodeAfter:r.range.start.nodeAfter;if(a&&a.is("element","paragraph")&&a.childCount>0&&(a=a.getChild(0)),!i.isImage(a))continue;let l=a.getAttribute("imageStyle");if(!l)continue;let c=o.get(l);(!c||!c.modelElements.includes(a.name))&&(n.removeAttribute("imageStyle",a),s=!0)}return s})}};function RI(e){let t=(...i)=>{let o=i.map(n=>Ql(n,e)).find(n=>n?.modelElements.includes("imageBlock"));if(o)return{isDefault:!!o.isDefault,value:o.name}};return Object.fromEntries(Object.entries({left:["alignBlockLeft","alignLeft"],right:["alignBlockRight","alignRight"],center:["block","alignCenter"]}).map(([i,o])=>[i,t(...o)]).filter(([,i])=>i!==void 0))}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var PI=class extends y{static get requires(){return[ty]}static get pluginName(){return"ImageStyleUI"}static get isOfficialPlugin(){return!0}get localizedDefaultStylesTitles(){let e=this.editor.t;return{"Wrap text":e("Wrap text"),"Break text":e("Break text"),"In line":e("In line"),"Full size image":e("Full size image"),"Side image":e("Side image"),"Left aligned image":e("Left aligned image"),"Centered image":e("Centered image"),"Right aligned image":e("Right aligned image")}}init(){let e=this.editor.plugins,t=this.editor.config.get("image.toolbar")||[],i=P2(e.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(let n of i)this._createButton(n);let o=P2([...t.filter(ae),...Zl.getDefaultDropdownDefinitions(e)],this.localizedDefaultStylesTitles);for(let n of o)this._createDropdown(n,i)}_createDropdown(e,t){let i=this.editor.ui.componentFactory;i.add(e.name,o=>{let n,{defaultItem:s,items:r,title:a}=e,l=r.filter(h=>t.find(({name:f})=>R2(f)===h)).map(h=>{let f=i.create(h);return h===s&&(n=f),f});r.length!==l.length&&Zl.warnInvalidStyle({dropdown:e});let c=Se(o,So),u=c.buttonView,d=u.arrowView;return Gn(c,l,{enableActiveItemFocusOnDropdownOpen:!0}),u.set({label:V2(a,n.label),class:null,tooltip:!0}),d.unbind("label"),d.set({label:a}),u.bind("icon").toMany(l,"isOn",(...h)=>{let f=h.findIndex(ho);return f<0?n.icon:l[f].icon}),u.bind("label").toMany(l,"isOn",(...h)=>{let f=h.findIndex(ho);return V2(a,f<0?n.label:l[f].label)}),u.bind("isOn").toMany(l,"isOn",(...h)=>h.some(ho)),u.bind("class").toMany(l,"isOn",(...h)=>h.some(ho)?"ck-splitbutton_flatten":void 0),u.on("execute",()=>{l.some(({isOn:h})=>h)?c.isOpen=!c.isOpen:n.fire("execute")}),c.bind("isEnabled").toMany(l,"isEnabled",(...h)=>h.some(ho)),this.listenTo(c,"execute",()=>{this.editor.editing.view.focus()}),c})}_createButton(e){let t=e.name;this.editor.ui.componentFactory.add(R2(t),i=>{let o=this.editor,n=o.commands.get("imageStyle"),s=new I(i);s.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0});let r=[n],a=o.commands.get("imageTypeBlock"),l=o.commands.get("imageTypeInline");return a&&r.push(a),l&&r.push(l),s.bind("isEnabled").toMany(r,"isEnabled",()=>n.isStyleEnabled(t)),s.bind("isOn").to(n,"value",c=>c===t),s.on("execute",this._executeCommand.bind(this,t)),s})}_executeCommand(e){this.editor.execute("imageStyle",{value:e}),this.editor.editing.view.focus()}};function P2(e,t){for(let i of e)t[i.title]&&(i.title=t[i.title]);return e}function R2(e){return`imageStyle:${e}`}function V2(e,t){return(e?e+": ":"")+t}/** +*/var VI=class extends w{static get requires(){return[iy]}static get pluginName(){return"ImageStyleUI"}static get isOfficialPlugin(){return!0}get localizedDefaultStylesTitles(){let e=this.editor.t;return{"Wrap text":e("Wrap text"),"Break text":e("Break text"),"In line":e("In line"),"Full size image":e("Full size image"),"Side image":e("Side image"),"Left aligned image":e("Left aligned image"),"Centered image":e("Centered image"),"Right aligned image":e("Right aligned image")}}init(){let e=this.editor.plugins,t=this.editor.config.get("image.toolbar")||[],i=R2(e.get("ImageStyleEditing").normalizedStyles,this.localizedDefaultStylesTitles);for(let n of i)this._createButton(n);let o=R2([...t.filter(ae),...Yl.getDefaultDropdownDefinitions(e)],this.localizedDefaultStylesTitles);for(let n of o)this._createDropdown(n,i)}_createDropdown(e,t){let i=this.editor.ui.componentFactory;i.add(e.name,o=>{let n,{defaultItem:s,items:r,title:a}=e,l=r.filter(h=>t.find(({name:f})=>V2(f)===h)).map(h=>{let f=i.create(h);return h===s&&(n=f),f});r.length!==l.length&&Yl.warnInvalidStyle({dropdown:e});let c=ye(o,xi),u=c.buttonView,d=u.arrowView;return Gn(c,l,{enableActiveItemFocusOnDropdownOpen:!0}),u.set({label:L2(a,n.label),class:null,tooltip:!0}),d.unbind("label"),d.set({label:a}),u.bind("icon").toMany(l,"isOn",(...h)=>{let f=h.findIndex(fo);return f<0?n.icon:l[f].icon}),u.bind("label").toMany(l,"isOn",(...h)=>{let f=h.findIndex(fo);return L2(a,f<0?n.label:l[f].label)}),u.bind("isOn").toMany(l,"isOn",(...h)=>h.some(fo)),u.bind("class").toMany(l,"isOn",(...h)=>h.some(fo)?"ck-splitbutton_flatten":void 0),u.on("execute",()=>{l.some(({isOn:h})=>h)?c.isOpen=!c.isOpen:n.fire("execute")}),c.bind("isEnabled").toMany(l,"isEnabled",(...h)=>h.some(fo)),this.listenTo(c,"execute",()=>{this.editor.editing.view.focus()}),c})}_createButton(e){let t=e.name;this.editor.ui.componentFactory.add(V2(t),i=>{let o=this.editor,n=o.commands.get("imageStyle"),s=new I(i);s.set({label:e.title,icon:e.icon,tooltip:!0,isToggleable:!0});let r=[n],a=o.commands.get("imageTypeBlock"),l=o.commands.get("imageTypeInline");return a&&r.push(a),l&&r.push(l),s.bind("isEnabled").toMany(r,"isEnabled",()=>n.isStyleEnabled(t)),s.bind("isOn").to(n,"value",c=>c===t),s.on("execute",this._executeCommand.bind(this,t)),s})}_executeCommand(e){this.editor.execute("imageStyle",{value:e}),this.editor.editing.view.focus()}};function R2(e,t){for(let i of e)t[i.title]&&(i.title=t[i.title]);return e}function V2(e){return`imageStyle:${e}`}function L2(e,t){return(e?e+": ":"")+t}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var iy=class extends y{static get requires(){return[ty,PI]}static get pluginName(){return"ImageStyle"}static get isOfficialPlugin(){return!0}};/** +*/var oy=class extends w{static get requires(){return[iy,VI]}static get pluginName(){return"ImageStyle"}static get isOfficialPlugin(){return!0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var oy=class extends y{static get requires(){return[ts,Ue]}static get pluginName(){return"ImageToolbar"}static get isOfficialPlugin(){return!0}afterInit(){let e=this.editor,t=e.t,i=e.plugins.get(ts),o=e.plugins.get("ImageUtils");i.register("image",{ariaLabel:t("Image toolbar"),items:RI(e.config.get("image.toolbar")||[]),getRelatedElement:n=>o.getClosestSelectedImageWidget(n)})}};function RI(e){return e.map(t=>ae(t)?t.name:t)}/** +*/var ny=class extends w{static get requires(){return[ts,Ue]}static get pluginName(){return"ImageToolbar"}static get isOfficialPlugin(){return!0}afterInit(){let e=this.editor,t=e.t,i=e.plugins.get(ts),o=e.plugins.get("ImageUtils");i.register("image",{ariaLabel:t("Image toolbar"),items:LI(e.config.get("image.toolbar")||[]),getRelatedElement:n=>o.getClosestSelectedImageWidget(n)})}};function LI(e){return e.map(t=>ae(t)?t.name:t)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Rr=class extends y{static get requires(){return[xt,Z2]}static get pluginName(){return"OpUploadPlugin"}init(){this.editor.plugins.get("FileRepository").createUploadAdapter=t=>{let i=Ji(this.editor);return new Ir(t,i,this.editor)}}};var ny=Symbol("isWpButtonMacroSymbol");function sy(e,t,i){return t.setCustomProperty(ny,!0,e),me(e,t,{label:i})}function VI(e){return!!e.getCustomProperty(ny)&&z(e)}function ry(e){let t=e.getSelectedElement();return!!(t&&VI(t))}var as=class e extends y{static get pluginName(){return"OPChildPagesEditing"}static get buttonName(){return"insertChildPages"}init(){let t=this.editor,i=t.model,o=t.conversion;i.schema.register("op-macro-child-pages",{allowWhere:["$block"],allowAttributes:["page"],isBlock:!0,isLimit:!0}),o.for("upcast").elementToElement({view:{name:"macro",classes:"child_pages"},model:(n,{writer:s})=>{let r=n.getAttribute("data-page")||"",a=n.getAttribute("data-include-parent")=="true";return s.createElement("op-macro-child-pages",{page:r,includeParent:a})}}),o.for("editingDowncast").elementToElement({model:"op-macro-child-pages",view:(n,{writer:s})=>this.createMacroViewElement(n,s)}).add(n=>n.on("attribute:page",this.modelAttributeToView.bind(this))).add(n=>n.on("attribute:includeParent",this.modelAttributeToView.bind(this))),o.for("dataDowncast").elementToElement({model:"op-macro-child-pages",view:(n,{writer:s})=>s.createContainerElement("macro",{class:"child_pages","data-page":n.getAttribute("page")||"","data-include-parent":n.getAttribute("includeParent")||""})}),t.ui.componentFactory.add(e.buttonName,n=>{let s=new I(n);return s.set({label:window.I18n.t("js.editor.macro.child_pages.button"),withText:!0}),s.on("execute",()=>{t.model.change(r=>{let a=r.createElement("op-macro-child-pages",{});t.model.insertContent(a,t.model.document.selection)})}),s})}modelAttributeToView(t,i,o){let n=i.item;if(!n.is("element","op-macro-child-pages"))return;o.consumable.consume(i.item,t.name);let s=o.mapper.toViewElement(n);o.writer.remove(o.writer.createRangeIn(s)),this.setPlaceholderContent(o.writer,n,s)}macroLabel(){return window.I18n.t("js.editor.macro.child_pages.text")}pageLabel(t){return t&&t.length>0?t:window.I18n.t("js.editor.macro.child_pages.this_page")}includeParentText(t){return t?` (${window.I18n.t("js.editor.macro.child_pages.include_parent")})`:""}createMacroViewElement(t,i){let o=i.createContainerElement("div");return this.setPlaceholderContent(i,t,o),sy(o,i,{label:this.macroLabel()})}setPlaceholderContent(t,i,o){let n=i.getAttribute("page"),s=i.getAttribute("includeParent"),r=this.macroLabel(),a=this.pageLabel(n),l=t.createContainerElement("span",{class:"macro-value"}),c=[t.createText(`${r} `)];t.insert(t.createPositionAt(l,0),t.createText(`${a}`)),c.push(l),c.push(t.createText(this.includeParentText(s))),t.insert(t.createPositionAt(o,0),c)}};var Vr=class extends y{static get requires(){return[re]}static get pluginName(){return"OPChildPagesToolbar"}init(){let t=this.editor,i=this.editor.model,o=Re(t);Zi(t,"opEditChildPagesMacroButton",n=>{let s=o.services.macros,r=n.getAttribute("page"),a=n.getAttribute("includeParent"),l=r&&r.length>0?r:"";s.configureChildPages(l,a).then(c=>i.change(u=>{u.setAttribute("page",c.page,n),u.setAttribute("includeParent",c.includeParent,n)}))})}afterInit(){Qi(this,this.editor,"OPChildPages",ry)}};var Lr=class extends y{static get requires(){return[as,Pe,Vr]}static get pluginName(){return"OPChildPages"}static get buttonName(){return as.buttonName}};/** +*/var Rr=class extends w{static get requires(){return[Tt,Q2]}static get pluginName(){return"OpUploadPlugin"}init(){this.editor.plugins.get("FileRepository").createUploadAdapter=t=>{let i=Dt(this.editor);return new Ir(t,i,this.editor)}}};var sy=Symbol("isWpButtonMacroSymbol");function ry(e,t,i){return t.setCustomProperty(sy,!0,e),me(e,t,{label:i})}function MI(e){return!!e.getCustomProperty(sy)&&z(e)}function ay(e){let t=e.getSelectedElement();return!!(t&&MI(t))}var as=class e extends w{static get pluginName(){return"OPChildPagesEditing"}static get buttonName(){return"insertChildPages"}init(){let t=this.editor,i=t.model,o=t.conversion;i.schema.register("op-macro-child-pages",{allowWhere:["$block"],allowAttributes:["page"],isBlock:!0,isLimit:!0}),o.for("upcast").elementToElement({view:{name:"macro",classes:"child_pages"},model:(n,{writer:s})=>{let r=n.getAttribute("data-page")||"",a=n.getAttribute("data-include-parent")=="true";return s.createElement("op-macro-child-pages",{page:r,includeParent:a})}}),o.for("editingDowncast").elementToElement({model:"op-macro-child-pages",view:(n,{writer:s})=>this.createMacroViewElement(n,s)}).add(n=>n.on("attribute:page",this.modelAttributeToView.bind(this))).add(n=>n.on("attribute:includeParent",this.modelAttributeToView.bind(this))),o.for("dataDowncast").elementToElement({model:"op-macro-child-pages",view:(n,{writer:s})=>s.createContainerElement("macro",{class:"child_pages","data-page":n.getAttribute("page")||"","data-include-parent":n.getAttribute("includeParent")||""})}),t.ui.componentFactory.add(e.buttonName,n=>{let s=new I(n);return s.set({label:window.I18n.t("js.editor.macro.child_pages.button"),withText:!0}),s.on("execute",()=>{t.model.change(r=>{let a=r.createElement("op-macro-child-pages",{});t.model.insertContent(a,t.model.document.selection)})}),s})}modelAttributeToView(t,i,o){let n=i.item;if(!n.is("element","op-macro-child-pages"))return;o.consumable.consume(i.item,t.name);let s=o.mapper.toViewElement(n);o.writer.remove(o.writer.createRangeIn(s)),this.setPlaceholderContent(o.writer,n,s)}macroLabel(){return window.I18n.t("js.editor.macro.child_pages.text")}pageLabel(t){return t&&t.length>0?t:window.I18n.t("js.editor.macro.child_pages.this_page")}includeParentText(t){return t?` (${window.I18n.t("js.editor.macro.child_pages.include_parent")})`:""}createMacroViewElement(t,i){let o=i.createContainerElement("div");return this.setPlaceholderContent(i,t,o),ry(o,i,{label:this.macroLabel()})}setPlaceholderContent(t,i,o){let n=i.getAttribute("page"),s=i.getAttribute("includeParent"),r=this.macroLabel(),a=this.pageLabel(n),l=t.createContainerElement("span",{class:"macro-value"}),c=[t.createText(`${r} `)];t.insert(t.createPositionAt(l,0),t.createText(`${a}`)),c.push(l),c.push(t.createText(this.includeParentText(s))),t.insert(t.createPositionAt(o,0),c)}};var Vr=class extends w{static get requires(){return[re]}static get pluginName(){return"OPChildPagesToolbar"}init(){let t=this.editor,i=this.editor.model,o=ge(t);Qi(t,"opEditChildPagesMacroButton",n=>{let s=o.services.macros,r=n.getAttribute("page"),a=n.getAttribute("includeParent"),l=r&&r.length>0?r:"";s.configureChildPages(l,a).then(c=>i.change(u=>{u.setAttribute("page",c.page,n),u.setAttribute("includeParent",c.includeParent,n)}))})}afterInit(){Yi(this,this.editor,"OPChildPages",ay)}};var Lr=class extends w{static get requires(){return[as,Re,Vr]}static get pluginName(){return"OPChildPages"}static get buttonName(){return as.buttonName}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var LI=class extends M{constructor(e){super(e),this.affectsData=!1}execute(){let e=this.editor.model,t=e.document.selection,i=e.schema.getLimitElement(t);if(t.containsEntireContent(i)||!ay(e.schema,i))do if(i=i.parent,!i)return;while(!ay(e.schema,i));e.change(o=>{o.setSelection(i,"in")})}};function ay(e,t){return e.isLimit(t)&&(e.checkChild(t,"$text")||e.checkChild(t,"paragraph"))}/** +*/var BI=class extends M{constructor(e){super(e),this.affectsData=!1}execute(){let e=this.editor.model,t=e.document.selection,i=e.schema.getLimitElement(t);if(t.containsEntireContent(i)||!ly(e.schema,i))do if(i=i.parent,!i)return;while(!ly(e.schema,i));e.change(o=>{o.setSelection(i,"in")})}};function ly(e,t){return e.isLimit(t)&&(e.checkChild(t,"$text")||e.checkChild(t,"paragraph"))}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var MI=Cn("Ctrl+A"),BI=class extends y{static get pluginName(){return"SelectAllEditing"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.t,i=e.editing.view.document;e.commands.add("selectAll",new LI(e)),this.listenTo(i,"keydown",(o,n)=>{qt(n)===MI&&(e.execute("selectAll"),n.preventDefault())}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Select all"),keystroke:"CTRL+A"}]})}};/** +*/var OI=Cn("Ctrl+A"),DI=class extends w{static get pluginName(){return"SelectAllEditing"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.t,i=e.editing.view.document;e.commands.add("selectAll",new BI(e)),this.listenTo(i,"keydown",(o,n)=>{jt(n)===OI&&(e.execute("selectAll"),n.preventDefault())}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Select all"),keystroke:"CTRL+A"}]})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var OI=class extends y{static get pluginName(){return"SelectAllUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor;e.ui.componentFactory.add("selectAll",()=>{let t=this._createButton(I);return t.set({tooltip:!0}),t}),e.ui.componentFactory.add("menuBar:selectAll",()=>this._createButton(oe))}_createButton(e){let t=this.editor,i=t.locale,o=t.commands.get("selectAll"),n=new e(t.locale),s=i.t;return n.set({label:s("Select all"),icon:ab,keystroke:"Ctrl+A"}),n.bind("isEnabled").to(o,"isEnabled"),this.listenTo(n,"execute",()=>{t.execute("selectAll"),t.editing.view.focus()}),n}};/** +*/var FI=class extends w{static get pluginName(){return"SelectAllUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor;e.ui.componentFactory.add("selectAll",()=>{let t=this._createButton(I);return t.set({tooltip:!0}),t}),e.ui.componentFactory.add("menuBar:selectAll",()=>this._createButton(oe))}_createButton(e){let t=this.editor,i=t.locale,o=t.commands.get("selectAll"),n=new e(t.locale),s=i.t;return n.set({label:s("Select all"),icon:cb,keystroke:"Ctrl+A"}),n.bind("isEnabled").to(o,"isEnabled"),this.listenTo(n,"execute",()=>{t.execute("selectAll"),t.editing.view.focus()}),n}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var ly=class extends y{static get requires(){return[BI,OI]}static get pluginName(){return"SelectAll"}static get isOfficialPlugin(){return!0}};/** +*/var cy=class extends w{static get requires(){return[DI,FI]}static get pluginName(){return"SelectAll"}static get isOfficialPlugin(){return!0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -1477,7 +1477,7 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var cy=class extends y{static get requires(){return[hw,Th,Gi,ly,Kw,Dl,Eh]}static get pluginName(){return"Essentials"}static get isOfficialPlugin(){return!0}};/** +*/var uy=class extends w{static get requires(){return[mw,Ah,Zi,cy,Jw,Fl,Ih]}static get pluginName(){return"Essentials"}static get isOfficialPlugin(){return!0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -1486,10 +1486,10 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var uy="ckCsrfToken",dy=40,DI="abcdefghijklmnopqrstuvwxyz0123456789";function FI(){let e=NI(uy);return(!e||e.length!=dy)&&(e=HI(dy),zI(uy,e)),e}function NI(e){e=e.toLowerCase();let t=document.cookie.split(";");for(let i of t){let o=i.split("=");if(decodeURIComponent(o[0].trim().toLowerCase())===e)return decodeURIComponent(o[1])}return null}function zI(e,t){document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path=/"}function HI(e){let t="",i=new Uint8Array(e);window.crypto.getRandomValues(i);for(let o=0;o.5?n.toUpperCase():n}return t}/** +*/var dy="ckCsrfToken",hy=40,NI="abcdefghijklmnopqrstuvwxyz0123456789";function zI(){let e=HI(dy);return(!e||e.length!=hy)&&(e=UI(hy),WI(dy,e)),e}function HI(e){e=e.toLowerCase();let t=document.cookie.split(";");for(let i of t){let o=i.split("=");if(decodeURIComponent(o[0].trim().toLowerCase())===e)return decodeURIComponent(o[1])}return null}function WI(e,t){document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path=/"}function UI(e){let t="",i=new Uint8Array(e);window.crypto.getRandomValues(i);for(let o=0;o.5?n.toUpperCase():n}return t}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var hy=class extends y{static get requires(){return[xt]}static get pluginName(){return"CKFinderUploadAdapter"}static get isOfficialPlugin(){return!0}init(){let e=this.editor.config.get("ckfinder.uploadUrl");e&&(this.editor.plugins.get(xt).createUploadAdapter=t=>new WI(t,e,this.editor.t))}},WI=class{loader;url;t;xhr;constructor(e,t,i){this.loader=e,this.url=t,this.t=i}upload(){return this.loader.file.then(e=>new Promise((t,i)=>{this._initRequest(),this._initListeners(t,i,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){let e=this.xhr=new XMLHttpRequest;e.open("POST",this.url,!0),e.responseType="json"}_initListeners(e,t,i){let o=this.xhr,n=this.loader,s=this.t,r=s("Cannot upload file:")+` ${i.name}.`;o.addEventListener("error",()=>t(r)),o.addEventListener("abort",()=>t()),o.addEventListener("load",()=>{let a=o.response;if(!a||!a.uploaded)return t(a&&a.error&&a.error.message?a.error.message:r);e({default:a.url})});/* v8 ignore else -- @preserve */o.upload&&o.upload.addEventListener("progress",a=>{a.lengthComputable&&(n.uploadTotal=a.total,n.uploaded=a.loaded)})}_sendRequest(e){let t=new FormData;t.append("upload",e),t.append("ckCsrfToken",FI()),this.xhr.send(t)}};/** +*/var fy=class extends w{static get requires(){return[Tt]}static get pluginName(){return"CKFinderUploadAdapter"}static get isOfficialPlugin(){return!0}init(){let e=this.editor.config.get("ckfinder.uploadUrl");e&&(this.editor.plugins.get(Tt).createUploadAdapter=t=>new qI(t,e,this.editor.t))}},qI=class{loader;url;t;xhr;constructor(e,t,i){this.loader=e,this.url=t,this.t=i}upload(){return this.loader.file.then(e=>new Promise((t,i)=>{this._initRequest(),this._initListeners(t,i,e),this._sendRequest(e)}))}abort(){this.xhr&&this.xhr.abort()}_initRequest(){let e=this.xhr=new XMLHttpRequest;e.open("POST",this.url,!0),e.responseType="json"}_initListeners(e,t,i){let o=this.xhr,n=this.loader,s=this.t,r=s("Cannot upload file:")+` ${i.name}.`;o.addEventListener("error",()=>t(r)),o.addEventListener("abort",()=>t()),o.addEventListener("load",()=>{let a=o.response;if(!a||!a.uploaded)return t(a&&a.error&&a.error.message?a.error.message:r);e({default:a.url})});/* v8 ignore else -- @preserve */o.upload&&o.upload.addEventListener("progress",a=>{a.lengthComputable&&(n.uploadTotal=a.total,n.uploaded=a.loaded)})}_sendRequest(e){let t=new FormData;t.append("upload",e),t.append("ckCsrfToken",zI()),this.xhr.send(t)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -1498,13 +1498,13 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Yi(e,t,i,o){let n,s=null;typeof o=="function"?n=o:(s=e.commands.get(o),n=()=>{e.execute(o)}),e.model.document.on("change:data",(r,a)=>{if(s&&!s.isEnabled||!t.isEnabled)return;let l=G(e.model.document.selection.getRanges());if(!l.isCollapsed||a.isUndo||!a.isLocal)return;let c=Array.from(e.model.document.differ.getChanges()),u=c[0];if(c.length!=1||u.type!=="insert"||u.name!="$text"||u.length!=1)return;let d=u.position.parent;if(d.is("element","codeBlock")||d.is("element","listItem")&&typeof o!="function"&&!["numberedList","bulletedList","todoList"].includes(o)||s&&s.value===!0)return;let h=d.getChild(0),f=e.model.createRangeOn(h);if(!f.containsRange(l)&&!l.end.isEqual(f.end))return;let m=i.exec(h.data.substr(0,l.end.offset));m&&e.model.enqueueChange(g=>{let b=e.model.document.selection,k=g.createPositionAt(d,0),v=g.createPositionAt(d,m[0].length),_=new Qe(k,v);if(n({match:m})!==!1){let C=Array.from(b.getAttributes());g.remove(_);let w=b.getFirstRange(),E=g.createRangeIn(d);d.isEmpty&&!E.isEqual(w)&&!E.containsRange(w,!0)&&g.remove(d),UI(g,b,C)}_.detach(),e.model.enqueueChange(()=>{e.plugins.get("Delete").requestUndoOnBackspace()})})})}function UI(e,t,i){let o=e.model.schema,n=t.getFirstPosition(),s=new Rn(n);o.checkChild(s,"$text")&&(s=s.push("$text"));for(let[r,a]of i)o.checkAttribute(s,r)&&e.setSelectionAttribute(r,a)}/** +*/function Xi(e,t,i,o){let n,s=null;typeof o=="function"?n=o:(s=e.commands.get(o),n=()=>{e.execute(o)}),e.model.document.on("change:data",(r,a)=>{if(s&&!s.isEnabled||!t.isEnabled)return;let l=J(e.model.document.selection.getRanges());if(!l.isCollapsed||a.isUndo||!a.isLocal)return;let c=Array.from(e.model.document.differ.getChanges()),u=c[0];if(c.length!=1||u.type!=="insert"||u.name!="$text"||u.length!=1)return;let d=u.position.parent;if(d.is("element","codeBlock")||d.is("element","listItem")&&typeof o!="function"&&!["numberedList","bulletedList","todoList"].includes(o)||s&&s.value===!0)return;let h=d.getChild(0),f=e.model.createRangeOn(h);if(!f.containsRange(l)&&!l.end.isEqual(f.end))return;let m=i.exec(h.data.substr(0,l.end.offset));m&&e.model.enqueueChange(g=>{let b=e.model.document.selection,k=g.createPositionAt(d,0),v=g.createPositionAt(d,m[0].length),_=new Qe(k,v);if(n({match:m})!==!1){let C=Array.from(b.getAttributes());g.remove(_);let y=b.getFirstRange(),E=g.createRangeIn(d);d.isEmpty&&!E.isEqual(y)&&!E.containsRange(y,!0)&&g.remove(d),$I(g,b,C)}_.detach(),e.model.enqueueChange(()=>{e.plugins.get("Delete").requestUndoOnBackspace()})})})}function $I(e,t,i){let o=e.model.schema,n=t.getFirstPosition(),s=new Rn(n);o.checkChild(s,"$text")&&(s=s.push("$text"));for(let[r,a]of i)o.checkAttribute(s,r)&&e.setSelectionAttribute(r,a)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function ls(e,t,i,o){let n,s;i instanceof RegExp?n=i:s=i,s=s||(r=>{let a,l=[],c=[];for(;(a=n.exec(r))!==null&&!(a&&a.length<4);){let{index:u,"1":d,"2":h,"3":f}=a,m=d+h+f;u+=a[0].length-m.length;let g=[u,u+d.length],b=[u+d.length+h.length,u+d.length+h.length+f.length];l.push(g),l.push(b),c.push([u+d.length,u+d.length+h.length])}return{remove:l,format:c}}),e.model.document.on("change:data",(r,a)=>{if(a.isUndo||!a.isLocal||!t.isEnabled)return;let l=e.model,c=l.document.selection;if(!c.isCollapsed)return;let u=Array.from(l.document.differ.getChanges()),d=u[0];if(u.length!=1||d.type!=="insert"||d.name!="$text"||d.length!=1)return;let h=c.focus,f=h.parent,{text:m,range:g}=qI(l.createRange(l.createPositionAt(f,0),h),l),b=s(m),k=fy(g.start,b.format,l),v=fy(g.start,b.remove,l);k.length&&v.length&&l.enqueueChange(_=>{if(o(_,k)!==!1){for(let C of v.reverse())_.remove(C);l.enqueueChange(()=>{e.plugins.get("Delete").requestUndoOnBackspace()})}})})}function fy(e,t,i){return t.filter(o=>o[0]!==void 0&&o[1]!==void 0).map(o=>i.createRange(e.getShiftedBy(o[0]),e.getShiftedBy(o[1])))}function qI(e,t){let i=e.start;return{text:Array.from(e.getItems()).reduce((o,n)=>!(n.is("$text")||n.is("$textProxy"))||n.getAttribute("code")?(i=t.createPositionAfter(n),""):o+n.data,""),range:t.createRange(i,e.end)}}/** +*/function ls(e,t,i,o){let n,s;i instanceof RegExp?n=i:s=i,s=s||(r=>{let a,l=[],c=[];for(;(a=n.exec(r))!==null&&!(a&&a.length<4);){let{index:u,"1":d,"2":h,"3":f}=a,m=d+h+f;u+=a[0].length-m.length;let g=[u,u+d.length],b=[u+d.length+h.length,u+d.length+h.length+f.length];l.push(g),l.push(b),c.push([u+d.length,u+d.length+h.length])}return{remove:l,format:c}}),e.model.document.on("change:data",(r,a)=>{if(a.isUndo||!a.isLocal||!t.isEnabled)return;let l=e.model,c=l.document.selection;if(!c.isCollapsed)return;let u=Array.from(l.document.differ.getChanges()),d=u[0];if(u.length!=1||d.type!=="insert"||d.name!="$text"||d.length!=1)return;let h=c.focus,f=h.parent,{text:m,range:g}=jI(l.createRange(l.createPositionAt(f,0),h),l),b=s(m),k=my(g.start,b.format,l),v=my(g.start,b.remove,l);k.length&&v.length&&l.enqueueChange(_=>{if(o(_,k)!==!1){for(let C of v.reverse())_.remove(C);l.enqueueChange(()=>{e.plugins.get("Delete").requestUndoOnBackspace()})}})})}function my(e,t,i){return t.filter(o=>o[0]!==void 0&&o[1]!==void 0).map(o=>i.createRange(e.getShiftedBy(o[0]),e.getShiftedBy(o[1])))}function jI(e,t){let i=e.start;return{text:Array.from(e.getItems()).reduce((o,n)=>!(n.is("$text")||n.is("$textProxy"))||n.getAttribute("code")?(i=t.createPositionAfter(n),""):o+n.data,""),range:t.createRange(i,e.end)}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var my=class extends y{static get requires(){return[ht]}static get pluginName(){return"Autoformat"}static get isOfficialPlugin(){return!0}afterInit(){let e=this.editor,t=this.editor.t;this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats(),this._addCodeBlockAutoformats(),this._addHorizontalLineAutoformats(),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Revert autoformatting action"),keystroke:"Backspace"}]})}_addListAutoformats(){let e=this.editor.commands;if(e.get("bulletedList")&&Yi(this.editor,this,/^[*-]\s$/,"bulletedList"),e.get("numberedList")){let t=e.get("numberedList"),i=!!e.get("listStart");Yi(this.editor,this,/^(\d+)[.|)]\s$/,({match:o})=>{if(!t.isEnabled||t.value===!0)return!1;this.editor.execute("numberedList",i?{additionalAttributes:{listStart:parseInt(o[1])}}:void 0)})}e.get("todoList")&&Yi(this.editor,this,/^\[\s?\]\s$/,"todoList"),e.get("checkTodoList")&&Yi(this.editor,this,/^\[\s?x\s?\]\s$/,()=>{this.editor.execute("todoList"),this.editor.execute("checkTodoList")})}_addBasicStylesAutoformats(){let e=this.editor.commands;if(e.get("bold")){let t=Ql(this.editor,"bold");ls(this.editor,this,/(?:^|\s)(\*\*)([^*]+)(\*\*)$/g,t),ls(this.editor,this,/(?:^|\s)(__)([^_]+)(__)$/g,t)}if(e.get("italic")){let t=Ql(this.editor,"italic");ls(this.editor,this,/(?:^|\s)(\*)([^*_]+)(\*)$/g,t),ls(this.editor,this,/(?:^|\s)(_)([^_]+)(_)$/g,t)}if(e.get("code")){let t=Ql(this.editor,"code");ls(this.editor,this,/(`)([^`]+)(`)$/g,t)}if(e.get("strikethrough")){let t=Ql(this.editor,"strikethrough");ls(this.editor,this,/(~~)([^~]+)(~~)$/g,t)}}_addHeadingAutoformats(){let e=this.editor.commands.get("heading");e&&e.modelElements.filter(t=>t.match(/^heading[1-6]$/)).forEach(t=>{let i=t[7],o=new RegExp(`^(#{${i}})\\s$`);Yi(this.editor,this,o,()=>{if(!e.isEnabled||e.value===t)return!1;this.editor.execute("heading",{value:t})})})}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&Yi(this.editor,this,/^>\s$/,"blockQuote")}_addCodeBlockAutoformats(){let e=this.editor,t=e.model.document.selection;e.commands.get("codeBlock")&&Yi(e,this,/^```$/,()=>{if(t.getFirstPosition().parent.is("element","listItem"))return!1;this.editor.execute("codeBlock",{usePreviousLanguageChoice:!0})})}_addHorizontalLineAutoformats(){this.editor.commands.get("horizontalLine")&&Yi(this.editor,this,/^---$/,"horizontalLine")}};function Ql(e,t){return(i,o)=>{if(!e.commands.get(t).isEnabled)return!1;let n=e.model.schema.getValidRanges(o,t);for(let s of n)i.setAttribute(t,!0,s);i.removeSelectionAttribute(t)}}/** +*/var gy=class extends w{static get requires(){return[ft]}static get pluginName(){return"Autoformat"}static get isOfficialPlugin(){return!0}afterInit(){let e=this.editor,t=this.editor.t;this._addListAutoformats(),this._addBasicStylesAutoformats(),this._addHeadingAutoformats(),this._addBlockQuoteAutoformats(),this._addCodeBlockAutoformats(),this._addHorizontalLineAutoformats(),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Revert autoformatting action"),keystroke:"Backspace"}]})}_addListAutoformats(){let e=this.editor.commands;if(e.get("bulletedList")&&Xi(this.editor,this,/^[*-]\s$/,"bulletedList"),e.get("numberedList")){let t=e.get("numberedList"),i=!!e.get("listStart");Xi(this.editor,this,/^(\d+)[.|)]\s$/,({match:o})=>{if(!t.isEnabled||t.value===!0)return!1;this.editor.execute("numberedList",i?{additionalAttributes:{listStart:parseInt(o[1])}}:void 0)})}e.get("todoList")&&Xi(this.editor,this,/^\[\s?\]\s$/,"todoList"),e.get("checkTodoList")&&Xi(this.editor,this,/^\[\s?x\s?\]\s$/,()=>{this.editor.execute("todoList"),this.editor.execute("checkTodoList")})}_addBasicStylesAutoformats(){let e=this.editor.commands;if(e.get("bold")){let t=Xl(this.editor,"bold");ls(this.editor,this,/(?:^|\s)(\*\*)([^*]+)(\*\*)$/g,t),ls(this.editor,this,/(?:^|\s)(__)([^_]+)(__)$/g,t)}if(e.get("italic")){let t=Xl(this.editor,"italic");ls(this.editor,this,/(?:^|\s)(\*)([^*_]+)(\*)$/g,t),ls(this.editor,this,/(?:^|\s)(_)([^_]+)(_)$/g,t)}if(e.get("code")){let t=Xl(this.editor,"code");ls(this.editor,this,/(`)([^`]+)(`)$/g,t)}if(e.get("strikethrough")){let t=Xl(this.editor,"strikethrough");ls(this.editor,this,/(~~)([^~]+)(~~)$/g,t)}}_addHeadingAutoformats(){let e=this.editor.commands.get("heading");e&&e.modelElements.filter(t=>t.match(/^heading[1-6]$/)).forEach(t=>{let i=t[7],o=new RegExp(`^(#{${i}})\\s$`);Xi(this.editor,this,o,()=>{if(!e.isEnabled||e.value===t)return!1;this.editor.execute("heading",{value:t})})})}_addBlockQuoteAutoformats(){this.editor.commands.get("blockQuote")&&Xi(this.editor,this,/^>\s$/,"blockQuote")}_addCodeBlockAutoformats(){let e=this.editor,t=e.model.document.selection;e.commands.get("codeBlock")&&Xi(e,this,/^```$/,()=>{if(t.getFirstPosition().parent.is("element","listItem"))return!1;this.editor.execute("codeBlock",{usePreviousLanguageChoice:!0})})}_addHorizontalLineAutoformats(){this.editor.commands.get("horizontalLine")&&Xi(this.editor,this,/^---$/,"horizontalLine")}};function Xl(e,t){return(i,o)=>{if(!e.commands.get(t).isEnabled)return!1;let n=e.model.schema.getValidRanges(o,t);for(let s of n)i.setAttribute(t,!0,s);i.removeSelectionAttribute(t)}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -1513,46 +1513,46 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Yl=class extends M{attributeKey;constructor(e,t){super(e),this.attributeKey=t}refresh(){let e=this.editor.model,t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){let t=this.editor.model,i=t.document.selection,o=e.forceValue===void 0?!this.value:e.forceValue;t.change(n=>{if(i.isCollapsed)o?n.setSelectionAttribute(this.attributeKey,!0):n.removeSelectionAttribute(this.attributeKey);else{let s=t.schema.getValidRanges(i.getRanges(),this.attributeKey,{includeEmptyRanges:!0});for(let r of s){let a=r,l=this.attributeKey;r.isCollapsed&&(a=r.start.parent,l=Ce._getStoreAttributeKey(this.attributeKey)),o?n.setAttribute(l,o,a):n.removeAttribute(l,a)}}})}_getValueFromFirstAllowedNode(){let e=this.editor.model,t=e.schema,i=e.document.selection;if(i.isCollapsed)return i.hasAttribute(this.attributeKey);for(let o of i.getRanges())for(let n of o.getItems())if(t.checkAttribute(n,this.attributeKey))return n.hasAttribute(this.attributeKey);return!1}};/** +*/var ec=class extends M{attributeKey;constructor(e,t){super(e),this.attributeKey=t}refresh(){let e=this.editor.model,t=e.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=e.schema.checkAttributeInSelection(t.selection,this.attributeKey)}execute(e={}){let t=this.editor.model,i=t.document.selection,o=e.forceValue===void 0?!this.value:e.forceValue;t.change(n=>{if(i.isCollapsed)o?n.setSelectionAttribute(this.attributeKey,!0):n.removeSelectionAttribute(this.attributeKey);else{let s=t.schema.getValidRanges(i.getRanges(),this.attributeKey,{includeEmptyRanges:!0});for(let r of s){let a=r,l=this.attributeKey;r.isCollapsed&&(a=r.start.parent,l=Te._getStoreAttributeKey(this.attributeKey)),o?n.setAttribute(l,o,a):n.removeAttribute(l,a)}}})}_getValueFromFirstAllowedNode(){let e=this.editor.model,t=e.schema,i=e.document.selection;if(i.isCollapsed)return i.hasAttribute(this.attributeKey);for(let o of i.getRanges())for(let n of o.getItems())if(t.checkAttribute(n,this.attributeKey))return n.hasAttribute(this.attributeKey);return!1}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var cs="bold",$I=class extends y{static get pluginName(){return"BoldEditing"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:cs}),e.model.schema.setAttributeProperties(cs,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:cs,view:"strong",upcastAlso:["b",i=>{let o=i.getStyle("font-weight");return o&&(o=="bold"||Number(o)>=600)?{name:!0,styles:["font-weight"]}:null}]}),e.commands.add(cs,new Yl(e,cs)),e.keystrokes.set("CTRL+B",cs),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Bold text"),keystroke:"CTRL+B"}]})}};/** +*/var cs="bold",KI=class extends w{static get pluginName(){return"BoldEditing"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:cs}),e.model.schema.setAttributeProperties(cs,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:cs,view:"strong",upcastAlso:["b",i=>{let o=i.getStyle("font-weight");return o&&(o=="bold"||Number(o)>=600)?{name:!0,styles:["font-weight"]}:null}]}),e.commands.add(cs,new ec(e,cs)),e.keystrokes.set("CTRL+B",cs),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Bold text"),keystroke:"CTRL+B"}]})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Xl({editor:e,commandName:t,plugin:i,icon:o,label:n,keystroke:s}){return r=>{let a=e.commands.get(t),l=new r(e.locale);return l.set({label:n,icon:o,keystroke:s,isToggleable:!0}),l.bind("isEnabled").to(a,"isEnabled"),l.bind("isOn").to(a,"value"),l instanceof oe?l.set({role:"menuitemcheckbox"}):l.set({tooltip:!0}),i.listenTo(l,"execute",()=>{e.execute(t),e.editing.view.focus()}),l}}/** +*/function tc({editor:e,commandName:t,plugin:i,icon:o,label:n,keystroke:s}){return r=>{let a=e.commands.get(t),l=new r(e.locale);return l.set({label:n,icon:o,keystroke:s,isToggleable:!0}),l.bind("isEnabled").to(a,"isEnabled"),l.bind("isOn").to(a,"value"),l instanceof oe?l.set({role:"menuitemcheckbox"}):l.set({tooltip:!0}),i.listenTo(l,"execute",()=>{e.execute(t),e.editing.view.focus()}),l}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var gy="bold",jI=class extends y{static get pluginName(){return"BoldUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.locale.t,i=Xl({editor:e,commandName:gy,plugin:this,icon:gl,label:t("Bold"),keystroke:"CTRL+B"});e.ui.componentFactory.add(gy,()=>i(I)),e.ui.componentFactory.add("menuBar:bold",()=>i(oe))}};/** +*/var py="bold",GI=class extends w{static get pluginName(){return"BoldUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.locale.t,i=tc({editor:e,commandName:py,plugin:this,icon:pl,label:t("Bold"),keystroke:"CTRL+B"});e.ui.componentFactory.add(py,()=>i(I)),e.ui.componentFactory.add("menuBar:bold",()=>i(oe))}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var yy=class extends y{static get requires(){return[$I,jI]}static get pluginName(){return"Bold"}static get isOfficialPlugin(){return!0}};/** +*/var _y=class extends w{static get requires(){return[KI,GI]}static get pluginName(){return"Bold"}static get isOfficialPlugin(){return!0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Vo="code",KI="ck-code_selected",GI=class extends y{static get pluginName(){return"CodeEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Xn]}init(){let e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:Vo}),e.model.schema.setAttributeProperties(Vo,{isFormatting:!0,copyOnEnter:!1}),e.conversion.attributeToElement({model:Vo,view:"code"}),e.commands.add(Vo,new Yl(e,Vo)),e.plugins.get(Xn).registerAttribute(Vo),Nl(e,Vo,"code",KI),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Move out of an inline code style"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}};/** +*/var Vo="code",JI="ck-code_selected",ZI=class extends w{static get pluginName(){return"CodeEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Xn]}init(){let e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:Vo}),e.model.schema.setAttributeProperties(Vo,{isFormatting:!0,copyOnEnter:!1}),e.conversion.attributeToElement({model:Vo,view:"code"}),e.commands.add(Vo,new ec(e,Vo)),e.plugins.get(Xn).registerAttribute(Vo),zl(e,Vo,"code",JI),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Move out of an inline code style"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var py="code",JI=class extends y{static get pluginName(){return"CodeUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.locale.t,i=Xl({editor:e,commandName:py,plugin:this,icon:B1,label:t("Code")});e.ui.componentFactory.add(py,()=>i(I)),e.ui.componentFactory.add("menuBar:code",()=>i(oe))}};/** +*/var by="code",QI=class extends w{static get pluginName(){return"CodeUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.locale.t,i=tc({editor:e,commandName:by,plugin:this,icon:D1,label:t("Code")});e.ui.componentFactory.add(by,()=>i(I)),e.ui.componentFactory.add("menuBar:code",()=>i(oe))}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var _y=class extends y{static get requires(){return[GI,JI]}static get pluginName(){return"Code"}static get isOfficialPlugin(){return!0}};/** +*/var vy=class extends w{static get requires(){return[ZI,QI]}static get pluginName(){return"Code"}static get isOfficialPlugin(){return!0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var us="italic",ZI=class extends y{static get pluginName(){return"ItalicEditing"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:us}),e.model.schema.setAttributeProperties(us,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:us,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add(us,new Yl(e,us)),e.keystrokes.set("CTRL+I",us),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Italic text"),keystroke:"CTRL+I"}]})}};/** +*/var us="italic",YI=class extends w{static get pluginName(){return"ItalicEditing"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:us}),e.model.schema.setAttributeProperties(us,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:us,view:"i",upcastAlso:["em",{styles:{"font-style":"italic"}}]}),e.commands.add(us,new ec(e,us)),e.keystrokes.set("CTRL+I",us),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Italic text"),keystroke:"CTRL+I"}]})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var by="italic",QI=class extends y{static get pluginName(){return"ItalicUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.locale.t,i=Xl({editor:e,commandName:by,plugin:this,icon:$1,keystroke:"CTRL+I",label:t("Italic")});e.ui.componentFactory.add(by,()=>i(I)),e.ui.componentFactory.add("menuBar:italic",()=>i(oe))}};/** +*/var wy="italic",XI=class extends w{static get pluginName(){return"ItalicUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.locale.t,i=tc({editor:e,commandName:wy,plugin:this,icon:K1,keystroke:"CTRL+I",label:t("Italic")});e.ui.componentFactory.add(wy,()=>i(I)),e.ui.componentFactory.add("menuBar:italic",()=>i(oe))}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var vy=class extends y{static get requires(){return[ZI,QI]}static get pluginName(){return"Italic"}static get isOfficialPlugin(){return!0}};/** +*/var ky=class extends w{static get requires(){return[YI,XI]}static get pluginName(){return"Italic"}static get isOfficialPlugin(){return!0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Mr="strikethrough",YI=class extends y{static get pluginName(){return"StrikethroughEditing"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:Mr}),e.model.schema.setAttributeProperties(Mr,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Mr,view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),e.commands.add(Mr,new Yl(e,Mr)),e.keystrokes.set("CTRL+SHIFT+X","strikethrough"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Strikethrough text"),keystroke:"CTRL+SHIFT+X"}]})}};/** +*/var Mr="strikethrough",eS=class extends w{static get pluginName(){return"StrikethroughEditing"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=this.editor.t;e.model.schema.extend("$text",{allowAttributes:Mr}),e.model.schema.setAttributeProperties(Mr,{isFormatting:!0,copyOnEnter:!0}),e.conversion.attributeToElement({model:Mr,view:"s",upcastAlso:["del","strike",{styles:{"text-decoration":"line-through"}}]}),e.commands.add(Mr,new ec(e,Mr)),e.keystrokes.set("CTRL+SHIFT+X","strikethrough"),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Strikethrough text"),keystroke:"CTRL+SHIFT+X"}]})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var wy="strikethrough",XI=class extends y{static get pluginName(){return"StrikethroughUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.locale.t,i=Xl({editor:e,commandName:wy,plugin:this,icon:lb,keystroke:"CTRL+SHIFT+X",label:t("Strikethrough")});e.ui.componentFactory.add(wy,()=>i(I)),e.ui.componentFactory.add("menuBar:strikethrough",()=>i(oe))}};/** +*/var yy="strikethrough",tS=class extends w{static get pluginName(){return"StrikethroughUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.locale.t,i=tc({editor:e,commandName:yy,plugin:this,icon:ub,keystroke:"CTRL+SHIFT+X",label:t("Strikethrough")});e.ui.componentFactory.add(yy,()=>i(I)),e.ui.componentFactory.add("menuBar:strikethrough",()=>i(oe))}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var ky=class extends y{static get requires(){return[YI,XI]}static get pluginName(){return"Strikethrough"}static get isOfficialPlugin(){return!0}};/** +*/var Cy=class extends w{static get requires(){return[eS,tS]}static get pluginName(){return"Strikethrough"}static get isOfficialPlugin(){return!0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -1588,16 +1588,16 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var eS=class extends M{refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){let t=this.editor.model,i=t.schema,o=t.document.selection,n=Array.from(o.getSelectedBlocks()),s=e.forceValue===void 0?!this.value:e.forceValue;t.change(r=>{if(!s)this._removeQuote(r,n.filter(ec));else{let a=n.filter(l=>ec(l)||xy(i,l));this._applyQuote(r,a)}})}_getValue(){let e=this.editor.model.document.selection,t=G(e.getSelectedBlocks());return!!(t&&ec(t))}_checkEnabled(){if(this.value)return!0;let e=this.editor.model.document.selection,t=this.editor.model.schema,i=G(e.getSelectedBlocks());return i?xy(t,i):!1}_removeQuote(e,t){Cy(e,t).reverse().forEach(i=>{if(i.start.isAtStart&&i.end.isAtEnd){e.unwrap(i.start.parent);return}if(i.start.isAtStart){let n=e.createPositionBefore(i.start.parent);e.move(i,n);return}i.end.isAtEnd||e.split(i.end);let o=e.createPositionAfter(i.end.parent);e.move(i,o)})}_applyQuote(e,t){let i=[];Cy(e,t).reverse().forEach(o=>{let n=ec(o.start);n||(n=e.createElement("blockQuote"),e.wrap(o,n)),i.push(n)}),i.reverse().reduce((o,n)=>o.nextSibling==n?(e.merge(e.createPositionAfter(o)),o):n)}};function ec(e){return e.parent.name=="blockQuote"?e.parent:null}function Cy(e,t){let i,o=0,n=[];for(;o{if(!s)this._removeQuote(r,n.filter(ic));else{let a=n.filter(l=>ic(l)||Ty(i,l));this._applyQuote(r,a)}})}_getValue(){let e=this.editor.model.document.selection,t=J(e.getSelectedBlocks());return!!(t&&ic(t))}_checkEnabled(){if(this.value)return!0;let e=this.editor.model.document.selection,t=this.editor.model.schema,i=J(e.getSelectedBlocks());return i?Ty(t,i):!1}_removeQuote(e,t){xy(e,t).reverse().forEach(i=>{if(i.start.isAtStart&&i.end.isAtEnd){e.unwrap(i.start.parent);return}if(i.start.isAtStart){let n=e.createPositionBefore(i.start.parent);e.move(i,n);return}i.end.isAtEnd||e.split(i.end);let o=e.createPositionAfter(i.end.parent);e.move(i,o)})}_applyQuote(e,t){let i=[];xy(e,t).reverse().forEach(o=>{let n=ic(o.start);n||(n=e.createElement("blockQuote"),e.wrap(o,n)),i.push(n)}),i.reverse().reduce((o,n)=>o.nextSibling==n?(e.merge(e.createPositionAfter(o)),o):n)}};function ic(e){return e.parent.name=="blockQuote"?e.parent:null}function xy(e,t){let i,o=0,n=[];for(;o{let r=e.model.document.differ.getChanges();for(let a of r)if(a.type=="insert"){let l=a.position.nodeAfter;if(!l)continue;if(l.is("element","blockQuote")&&l.isEmpty)return s.remove(l),!0;if(l.is("element","blockQuote")&&!t.checkChild(a.position,l))return s.unwrap(l),!0;if(l.is("element")){let c=s.createRangeIn(l);for(let u of c.getItems())if(u.is("element","blockQuote")&&!t.checkChild(s.createPositionBefore(u),u))return s.unwrap(u),!0}}else if(a.type=="remove"){let l=a.position.parent;if(l.is("element","blockQuote")&&l.isEmpty)return s.remove(l),!0}return!1});let i=this.editor.editing.view.document,o=e.model.document.selection,n=e.commands.get("blockQuote");this.listenTo(i,"enter",(s,r)=>{!o.isCollapsed||!n.value||o.getLastPosition().parent.isEmpty&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),r.preventDefault(),s.stop())},{context:"blockquote"}),this.listenTo(i,"delete",(s,r)=>{if(r.direction!="backward"||!o.isCollapsed||!n.value)return;let a=o.getLastPosition().parent;a.isEmpty&&!a.previousSibling&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),r.preventDefault(),s.stop())},{context:"blockquote"})}};/** +*/var oS=class extends w{static get pluginName(){return"BlockQuoteEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Zi,ft]}init(){let e=this.editor,t=e.model.schema;e.commands.add("blockQuote",new iS(e)),t.register("blockQuote",{inheritAllFrom:"$container"}),e.conversion.elementToElement({model:"blockQuote",view:"blockquote"}),e.model.document.registerPostFixer(s=>{let r=e.model.document.differ.getChanges();for(let a of r)if(a.type=="insert"){let l=a.position.nodeAfter;if(!l)continue;if(l.is("element","blockQuote")&&l.isEmpty)return s.remove(l),!0;if(l.is("element","blockQuote")&&!t.checkChild(a.position,l))return s.unwrap(l),!0;if(l.is("element")){let c=s.createRangeIn(l);for(let u of c.getItems())if(u.is("element","blockQuote")&&!t.checkChild(s.createPositionBefore(u),u))return s.unwrap(u),!0}}else if(a.type=="remove"){let l=a.position.parent;if(l.is("element","blockQuote")&&l.isEmpty)return s.remove(l),!0}return!1});let i=this.editor.editing.view.document,o=e.model.document.selection,n=e.commands.get("blockQuote");this.listenTo(i,"enter",(s,r)=>{!o.isCollapsed||!n.value||o.getLastPosition().parent.isEmpty&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),r.preventDefault(),s.stop())},{context:"blockquote"}),this.listenTo(i,"delete",(s,r)=>{if(r.direction!="backward"||!o.isCollapsed||!n.value)return;let a=o.getLastPosition().parent;a.isEmpty&&!a.previousSibling&&(e.execute("blockQuote"),e.editing.view.scrollToTheSelection(),r.preventDefault(),s.stop())},{context:"blockquote"})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var iS=class extends y{static get pluginName(){return"BlockQuoteUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor;e.ui.componentFactory.add("blockQuote",()=>{let t=this._createButton(I);return t.set({tooltip:!0}),t}),e.ui.componentFactory.add("menuBar:blockQuote",()=>{let t=this._createButton(oe);return t.set({role:"menuitemcheckbox"}),t})}_createButton(e){let t=this.editor,i=t.locale,o=t.commands.get("blockQuote"),n=new e(t.locale),s=i.t;return n.set({label:s("Block quote"),icon:sb,isToggleable:!0}),n.bind("isEnabled").to(o,"isEnabled"),n.bind("isOn").to(o,"value"),this.listenTo(n,"execute",()=>{t.execute("blockQuote"),t.editing.view.focus()}),n}};/** +*/var nS=class extends w{static get pluginName(){return"BlockQuoteUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor;e.ui.componentFactory.add("blockQuote",()=>{let t=this._createButton(I);return t.set({tooltip:!0}),t}),e.ui.componentFactory.add("menuBar:blockQuote",()=>{let t=this._createButton(oe);return t.set({role:"menuitemcheckbox"}),t})}_createButton(e){let t=this.editor,i=t.locale,o=t.commands.get("blockQuote"),n=new e(t.locale),s=i.t;return n.set({label:s("Block quote"),icon:ab,isToggleable:!0}),n.bind("isEnabled").to(o,"isEnabled"),n.bind("isOn").to(o,"value"),this.listenTo(n,"execute",()=>{t.execute("blockQuote"),t.editing.view.focus()}),n}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Ty=class extends y{static get requires(){return[tS,iS]}static get pluginName(){return"BlockQuote"}static get isOfficialPlugin(){return!0}};/** +*/var Ey=class extends w{static get requires(){return[oS,nS]}static get pluginName(){return"BlockQuote"}static get isOfficialPlugin(){return!0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -1606,13 +1606,13 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var oS=class extends M{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}refresh(){let e=this.editor.model,t=e.document,i=G(t.selection.getSelectedBlocks());this.value=!!i&&i.is("element","paragraph"),this.isEnabled=!!i&&Ey(i,e.schema)}execute(e={}){let t=this.editor.model,i=t.document,o=e.selection||i.selection;t.canEditAt(o)&&t.change(n=>{let s=o.getSelectedBlocks();for(let r of s)!r.is("element","paragraph")&&Ey(r,t.schema)&&n.rename(r,"paragraph")})}};function Ey(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}/** +*/var sS=class extends M{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}refresh(){let e=this.editor.model,t=e.document,i=J(t.selection.getSelectedBlocks());this.value=!!i&&i.is("element","paragraph"),this.isEnabled=!!i&&Ay(i,e.schema)}execute(e={}){let t=this.editor.model,i=t.document,o=e.selection||i.selection;t.canEditAt(o)&&t.change(n=>{let s=o.getSelectedBlocks();for(let r of s)!r.is("element","paragraph")&&Ay(r,t.schema)&&n.rename(r,"paragraph")})}};function Ay(e,t){return t.checkChild(e.parent,"paragraph")&&!t.isObject(e)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var nS=class extends M{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}execute(e){let t=this.editor.model,i=e.attributes,o=e.position;return t.canEditAt(o)?t.change(n=>{if(o=this._findPositionToInsertParagraph(o,n),!o)return null;let s=n.createElement("paragraph");return i&&t.schema.setAllowedAttributes(s,i,n),t.insertContent(s,o),n.setSelection(s,"in"),n.createPositionAt(s,0)}):null}_findPositionToInsertParagraph(e,t){let i=this.editor.model;if(i.schema.checkChild(e,"paragraph"))return e;let o=i.schema.findAllowedParent(e,"paragraph");if(!o)return null;let n=e.parent,s=i.schema.checkChild(n,"$text");return n.isEmpty||s&&e.isAtEnd?i.createPositionAfter(n):!n.isEmpty&&s&&e.isAtStart?i.createPositionBefore(n):t.split(e,o).position}};/** +*/var rS=class extends M{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}execute(e){let t=this.editor.model,i=e.attributes,o=e.position;return t.canEditAt(o)?t.change(n=>{if(o=this._findPositionToInsertParagraph(o,n),!o)return null;let s=n.createElement("paragraph");return i&&t.schema.setAllowedAttributes(s,i,n),t.insertContent(s,o),n.setSelection(s,"in"),n.createPositionAt(s,0)}):null}_findPositionToInsertParagraph(e,t){let i=this.editor.model;if(i.schema.checkChild(e,"paragraph"))return e;let o=i.schema.findAllowedParent(e,"paragraph");if(!o)return null;let n=e.parent,s=i.schema.checkChild(n,"$text");return n.isEmpty||s&&e.isAtEnd?i.createPositionAfter(n):!n.isEmpty&&s&&e.isAtStart?i.createPositionBefore(n):t.split(e,o).position}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var tc=class Ay extends y{static get pluginName(){return"Paragraph"}static get isOfficialPlugin(){return!0}init(){let t=this.editor,i=t.model;t.commands.add("paragraph",new oS(t)),t.commands.add("insertParagraph",new nS(t)),i.schema.register("paragraph",{inheritAllFrom:"$block"}),t.conversion.elementToElement({model:"paragraph",view:"p"}),t.conversion.for("upcast").elementToElement({model:(o,{writer:n})=>!Ay.paragraphLikeElements.has(o.name)||o.isEmpty?null:n.createElement("paragraph"),view:/.+/,converterPriority:"low"})}static paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"])};/** +*/var oc=class Iy extends w{static get pluginName(){return"Paragraph"}static get isOfficialPlugin(){return!0}init(){let t=this.editor,i=t.model;t.commands.add("paragraph",new sS(t)),t.commands.add("insertParagraph",new rS(t)),i.schema.register("paragraph",{inheritAllFrom:"$block"}),t.conversion.elementToElement({model:"paragraph",view:"p"}),t.conversion.for("upcast").elementToElement({model:(o,{writer:n})=>!Iy.paragraphLikeElements.has(o.name)||o.isEmpty?null:n.createElement("paragraph"),view:/.+/,converterPriority:"low"})}static paragraphLikeElements=new Set(["blockquote","dd","div","dt","h1","h2","h3","h4","h5","h6","li","p","td","th"])};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -1624,19 +1624,19 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var sS=class extends M{modelElements;constructor(e,t){super(e),this.modelElements=t}refresh(){let e=G(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(t=>Iy(e,t,this.editor.model.schema))}execute(e){let t=this.editor.model,i=t.document,o=e.value;t.change(n=>{let s=Array.from(i.selection.getSelectedBlocks()).filter(r=>Iy(r,o,t.schema));for(let r of s)r.is("element",o)||n.rename(r,o)})}};function Iy(e,t,i){return i.checkChild(e.parent,t)&&!i.isObject(e)}/** +*/var aS=class extends M{modelElements;constructor(e,t){super(e),this.modelElements=t}refresh(){let e=J(this.editor.model.document.selection.getSelectedBlocks());this.value=!!e&&this.modelElements.includes(e.name)&&e.name,this.isEnabled=!!e&&this.modelElements.some(t=>Sy(e,t,this.editor.model.schema))}execute(e){let t=this.editor.model,i=t.document,o=e.value;t.change(n=>{let s=Array.from(i.selection.getSelectedBlocks()).filter(r=>Sy(r,o,t.schema));for(let r of s)r.is("element",o)||n.rename(r,o)})}};function Sy(e,t,i){return i.checkChild(e.parent,t)&&!i.isObject(e)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Sy="paragraph",rS=class extends y{static get pluginName(){return"HeadingEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.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[tc]}init(){let e=this.editor,t=e.config.get("heading.options"),i=[];for(let o of t)o.model!=="paragraph"&&(e.model.schema.register(o.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(o),i.push(o.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new sS(e,i))}afterInit(){let e=this.editor,t=e.commands.get("enter"),i=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",(o,n)=>{let s=e.model.document.selection.getFirstPosition().parent;i.some(r=>s.is("element",r.model))&&!s.is("element",Sy)&&s.childCount===0&&n.writer.rename(s,Sy)})}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:le.low+1})}};/** +*/var Py="paragraph",lS=class extends w{static get pluginName(){return"HeadingEditing"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.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[oc]}init(){let e=this.editor,t=e.config.get("heading.options"),i=[];for(let o of t)o.model!=="paragraph"&&(e.model.schema.register(o.model,{inheritAllFrom:"$block"}),e.conversion.elementToElement(o),i.push(o.model));this._addDefaultH1Conversion(e),e.commands.add("heading",new aS(e,i))}afterInit(){let e=this.editor,t=e.commands.get("enter"),i=e.config.get("heading.options");t&&this.listenTo(t,"afterExecute",(o,n)=>{let s=e.model.document.selection.getFirstPosition().parent;i.some(r=>s.is("element",r.model))&&!s.is("element",Py)&&s.childCount===0&&n.writer.rename(s,Py)})}_addDefaultH1Conversion(e){e.conversion.for("upcast").elementToElement({model:"heading1",view:"h1",converterPriority:le.low+1})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function aS(e){let t=e.t,i={Paragraph:t("Paragraph"),"Heading 1":t("Heading 1"),"Heading 2":t("Heading 2"),"Heading 3":t("Heading 3"),"Heading 4":t("Heading 4"),"Heading 5":t("Heading 5"),"Heading 6":t("Heading 6")};return e.config.get("heading.options").map(o=>{let n=i[o.title];return n&&n!=o.title&&(o.title=n),o})}/** +*/function cS(e){let t=e.t,i={Paragraph:t("Paragraph"),"Heading 1":t("Heading 1"),"Heading 2":t("Heading 2"),"Heading 3":t("Heading 3"),"Heading 4":t("Heading 4"),"Heading 5":t("Heading 5"),"Heading 6":t("Heading 6")};return e.config.get("heading.options").map(o=>{let n=i[o.title];return n&&n!=o.title&&(o.title=n),o})}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var lS=class extends y{static get pluginName(){return"HeadingUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.t,i=aS(e),o=t("Choose heading"),n=t("Heading");e.ui.componentFactory.add("heading",s=>{let r={},a=new J,l=e.commands.get("heading"),c=e.commands.get("paragraph"),u=[l];for(let h of i){let f={type:"button",model:new ki({label:h.title,class:h.class,role:"menuitemradio",withText:!0})};h.model==="paragraph"?(f.model.bind("isOn").to(c,"value"),f.model.set("commandName","paragraph"),u.push(c)):(f.model.bind("isOn").to(l,"value",m=>m===h.model),f.model.set({commandName:"heading",commandValue:h.model})),a.add(f),r[h.model]=h.title}let d=Se(s);return Bt(d,a,{ariaLabel:n,role:"menu"}),d.buttonView.set({ariaLabel:n,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:n}),d.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),d.bind("isEnabled").toMany(u,"isEnabled",(...h)=>h.some(f=>f)),d.buttonView.bind("label").to(l,"value",c,"value",(h,f)=>{let m=f?"paragraph":h;return typeof m=="boolean"||!r[m]?o:r[m]}),d.buttonView.bind("ariaLabel").to(l,"value",c,"value",(h,f)=>{let m=f?"paragraph":h;return typeof m=="boolean"||!r[m]?n:`${r[m]}, ${n}`}),this.listenTo(d,"execute",h=>{let{commandName:f,commandValue:m}=h.source;e.execute(f,m?{value:m}:void 0),e.editing.view.focus()}),d}),e.ui.componentFactory.add("menuBar:heading",s=>{let r=new Qt(s),a=e.commands.get("heading"),l=e.commands.get("paragraph"),c=[a],u=new jn(s);r.set({class:"ck-heading-dropdown"}),u.set({ariaLabel:t("Heading"),role:"menu"}),r.buttonView.set({label:t("Heading")}),r.panelView.children.add(u);for(let d of i){let h=new Jn(s,r),f=new oe(s);h.children.add(f),u.items.add(h),f.set({isToggleable:!0,label:d.title,role:"menuitemradio",class:d.class}),f.delegate("execute").to(r),f.on("execute",()=>{let m=d.model==="paragraph"?"paragraph":"heading";e.execute(m,{value:d.model}),e.editing.view.focus()}),d.model==="paragraph"?(f.bind("isOn").to(l,"value"),c.push(l)):f.bind("isOn").to(a,"value",m=>m===d.model)}return r.bind("isEnabled").toMany(c,"isEnabled",(...d)=>d.some(h=>h)),r})}};/** +*/var uS=class extends w{static get pluginName(){return"HeadingUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.t,i=cS(e),o=t("Choose heading"),n=t("Heading");e.ui.componentFactory.add("heading",s=>{let r={},a=new G,l=e.commands.get("heading"),c=e.commands.get("paragraph"),u=[l];for(let h of i){let f={type:"button",model:new Ot({label:h.title,class:h.class,role:"menuitemradio",withText:!0})};h.model==="paragraph"?(f.model.bind("isOn").to(c,"value"),f.model.set("commandName","paragraph"),u.push(c)):(f.model.bind("isOn").to(l,"value",m=>m===h.model),f.model.set({commandName:"heading",commandValue:h.model})),a.add(f),r[h.model]=h.title}let d=ye(s);return ht(d,a,{ariaLabel:n,role:"menu"}),d.buttonView.set({ariaLabel:n,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:n}),d.extendTemplate({attributes:{class:["ck-heading-dropdown"]}}),d.bind("isEnabled").toMany(u,"isEnabled",(...h)=>h.some(f=>f)),d.buttonView.bind("label").to(l,"value",c,"value",(h,f)=>{let m=f?"paragraph":h;return typeof m=="boolean"||!r[m]?o:r[m]}),d.buttonView.bind("ariaLabel").to(l,"value",c,"value",(h,f)=>{let m=f?"paragraph":h;return typeof m=="boolean"||!r[m]?n:`${r[m]}, ${n}`}),this.listenTo(d,"execute",h=>{let{commandName:f,commandValue:m}=h.source;e.execute(f,m?{value:m}:void 0),e.editing.view.focus()}),d}),e.ui.componentFactory.add("menuBar:heading",s=>{let r=new Xt(s),a=e.commands.get("heading"),l=e.commands.get("paragraph"),c=[a],u=new jn(s);r.set({class:"ck-heading-dropdown"}),u.set({ariaLabel:t("Heading"),role:"menu"}),r.buttonView.set({label:t("Heading")}),r.panelView.children.add(u);for(let d of i){let h=new Jn(s,r),f=new oe(s);h.children.add(f),u.items.add(h),f.set({isToggleable:!0,label:d.title,role:"menuitemradio",class:d.class}),f.delegate("execute").to(r),f.on("execute",()=>{let m=d.model==="paragraph"?"paragraph":"heading";e.execute(m,{value:d.model}),e.editing.view.focus()}),d.model==="paragraph"?(f.bind("isOn").to(l,"value"),c.push(l)):f.bind("isOn").to(a,"value",m=>m===d.model)}return r.bind("isEnabled").toMany(c,"isEnabled",(...d)=>d.some(h=>h)),r})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Py=class extends y{static get requires(){return[rS,lS]}static get pluginName(){return"Heading"}static get isOfficialPlugin(){return!0}};/** +*/var Ry=class extends w{static get requires(){return[lS,uS]}static get pluginName(){return"Heading"}static get isOfficialPlugin(){return!0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -1651,49 +1651,49 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var cS=class{_definitions=new Set;_conflictChecker;get length(){return this._definitions.size}setConflictChecker(e){this._conflictChecker=e}add(e){Array.isArray(e)?e.forEach(t=>this._definitions.add(t)):this._definitions.add(e)}getDispatcher(){return e=>{let t=(o,n)=>{let s=n.createAttributeElement("a",o.attributes,{priority:5});o.classes&&n.addClass(o.classes,s);for(let r in o.styles)n.setStyle(r,o.styles[r],s);return n.setCustomProperty("link",!0,s),s},i=o=>(n,s,r)=>{if(s.attributeKey.startsWith("link")&&!(s.attributeKey=="linkHref"&&!r.consumable.test(s.item,"attribute:linkHref"))&&!(!s.item.is("selection")&&!r.schema.isInline(s.item)))for(let a of this._definitions)a.callback(s.item.getAttribute("linkHref"))&&!this._conflictChecker?.(a,s.item)&&o?s.item.is("selection")?r.writer.wrap(r.writer.document.selection.getFirstRange(),t(a,r.writer)):r.writer.wrap(r.mapper.toViewRange(s.range),t(a,r.writer)):r.writer.unwrap(r.mapper.toViewRange(s.range),t(a,r.writer))};e.on("attribute",i(!1),{priority:le.high-1}),e.on("attribute",i(!0),{priority:le.high-2})}}getDispatcherForLinkedImage(){return e=>{let t=i=>(o,n,{writer:s,mapper:r})=>{if(!n.item.is("element","imageBlock")||!n.attributeKey.startsWith("link"))return;let a=r.toViewElement(n.item),l=Array.from(a.getChildren()).find(c=>c.is("element","a"));if(l)for(let c of this._definitions){let u=lt(c.attributes);if(c.callback(n.item.getAttribute("linkHref"))&&!this._conflictChecker?.(c,n.item)&&i){for(let[d,h]of u)d==="class"?s.addClass(h,l):s.setAttribute(d,h,!1,l);c.classes&&s.addClass(c.classes,l);for(let d in c.styles)s.setStyle(d,c.styles[d],l)}else{for(let[d,h]of u)d==="class"?s.removeClass(h,l):s.removeAttribute(d,h,l);c.classes&&s.removeClass(c.classes,l);for(let d in c.styles)s.removeStyle(d,l)}}};e.on("attribute",t(!1),{priority:le.high-1}),e.on("attribute",t(!0),{priority:le.high-2})}}};/** +*/var dS=class{_definitions=new Set;_conflictChecker;get length(){return this._definitions.size}setConflictChecker(e){this._conflictChecker=e}add(e){Array.isArray(e)?e.forEach(t=>this._definitions.add(t)):this._definitions.add(e)}getDispatcher(){return e=>{let t=(o,n)=>{let s=n.createAttributeElement("a",o.attributes,{priority:5});o.classes&&n.addClass(o.classes,s);for(let r in o.styles)n.setStyle(r,o.styles[r],s);return n.setCustomProperty("link",!0,s),s},i=o=>(n,s,r)=>{if(s.attributeKey.startsWith("link")&&!(s.attributeKey=="linkHref"&&!r.consumable.test(s.item,"attribute:linkHref"))&&!(!s.item.is("selection")&&!r.schema.isInline(s.item)))for(let a of this._definitions)a.callback(s.item.getAttribute("linkHref"))&&!this._conflictChecker?.(a,s.item)&&o?s.item.is("selection")?r.writer.wrap(r.writer.document.selection.getFirstRange(),t(a,r.writer)):r.writer.wrap(r.mapper.toViewRange(s.range),t(a,r.writer)):r.writer.unwrap(r.mapper.toViewRange(s.range),t(a,r.writer))};e.on("attribute",i(!1),{priority:le.high-1}),e.on("attribute",i(!0),{priority:le.high-2})}}getDispatcherForLinkedImage(){return e=>{let t=i=>(o,n,{writer:s,mapper:r})=>{if(!n.item.is("element","imageBlock")||!n.attributeKey.startsWith("link"))return;let a=r.toViewElement(n.item),l=Array.from(a.getChildren()).find(c=>c.is("element","a"));if(l)for(let c of this._definitions){let u=lt(c.attributes);if(c.callback(n.item.getAttribute("linkHref"))&&!this._conflictChecker?.(c,n.item)&&i){for(let[d,h]of u)d==="class"?s.addClass(h,l):s.setAttribute(d,h,!1,l);c.classes&&s.addClass(c.classes,l);for(let d in c.styles)s.setStyle(d,c.styles[d],l)}else{for(let[d,h]of u)d==="class"?s.removeClass(h,l):s.removeAttribute(d,h,l);c.classes&&s.removeClass(c.classes,l);for(let d in c.styles)s.removeStyle(d,l)}}};e.on("attribute",t(!1),{priority:le.high-1}),e.on("attribute",t(!0),{priority:le.high-2})}}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var uS=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,dS="^(?:(?:):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))",hS=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,fS=/^((\w+:(\/{2,})?)|(\W))/i,mS=["https?","ftps?","mailto"],ic="Ctrl+K";function gS(e){return e.is("attributeElement")&&!!e.getCustomProperty("link")}function Ry(e,{writer:t}){let i=t.createAttributeElement("a",{href:e},{priority:5});return t.setCustomProperty("link",!0,i),i}function My(e,t=mS){let i=String(e),o=t.join("|");return pS(i,new RegExp(`${dS.replace("",o)}`,"i"))?i:"#"}function pS(e,t){return!!e.replace(uS,"").match(t)}function bS(e,t){let i={"Open in a new tab":e("Open in a new tab"),Downloadable:e("Downloadable")};return t.forEach(o=>("label"in o&&i[o.label]&&(o.label=i[o.label]),o)),t}function wS(e){let t=[];if(e)for(let[i,o]of Object.entries(e)){let n=Object.assign({},o,{id:`link${fu(i)}`});t.push(n)}return t}function Oh(e,t){return e?t.checkAttribute(e.name,"linkHref"):!1}function yS(e){return hS.test(e)}function Nh(e,t){let i=yS(e)?"mailto:":t,o=!!i&&!By(e);return e&&o?i+e:e}function By(e){return fS.test(e)}function _S(e){window.open(e,"_blank","noopener")}function Dh(e){let t="";for(let i of e.getItems()){if(!i.is("$text")&&!i.is("$textProxy"))return;t+=i.data}return t}/** +*/var hS=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,fS="^(?:(?:):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))",mS=/^[\S]+@((?![-_])(?:[-\w\u00a1-\uffff]{0,63}[^-_]\.))+(?:[a-z\u00a1-\uffff]{2,})$/i,gS=/^((\w+:(\/{2,})?)|(\W))/i,pS=["https?","ftps?","mailto"],nc="Ctrl+K";function bS(e){return e.is("attributeElement")&&!!e.getCustomProperty("link")}function Vy(e,{writer:t}){let i=t.createAttributeElement("a",{href:e},{priority:5});return t.setCustomProperty("link",!0,i),i}function By(e,t=pS){let i=String(e),o=t.join("|");return wS(i,new RegExp(`${fS.replace("",o)}`,"i"))?i:"#"}function wS(e,t){return!!e.replace(hS,"").match(t)}function yS(e,t){let i={"Open in a new tab":e("Open in a new tab"),Downloadable:e("Downloadable")};return t.forEach(o=>("label"in o&&i[o.label]&&(o.label=i[o.label]),o)),t}function _S(e){let t=[];if(e)for(let[i,o]of Object.entries(e)){let n=Object.assign({},o,{id:`link${gu(i)}`});t.push(n)}return t}function Fh(e,t){return e?t.checkAttribute(e.name,"linkHref"):!1}function vS(e){return mS.test(e)}function Hh(e,t){let i=vS(e)?"mailto:":t,o=!!i&&!Oy(e);return e&&o?i+e:e}function Oy(e){return gS.test(e)}function kS(e){window.open(e,"_blank","noopener")}function Nh(e){let t="";for(let i of e.getItems()){if(!i.is("$text")&&!i.is("$textProxy"))return;t+=i.data}return t}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Fh(e,t){if(e.attributes&&t.attributes&&Object.keys(e.attributes).some(o=>!i(o)&&o in t.attributes)||e.styles&&t.styles&&Object.keys(e.styles).some(o=>o in t.styles))return!0;return!1;function i(o){return o==="class"||o==="style"||o==="rel"}}function Oy({decoratorStates:e,allDecorators:t}){let i={...e};for(let n in e)if(e[n]&&o(n)){let s=vS(n,t);for(let r of s)i[r]=!1}function o(n){return t.some(s=>s.id===n&&!s.value)}return i}function vS(e,t){let i=t.find(o=>o.id===e);/* istanbul ignore next -- @preserve */return i?t.filter(o=>o.id!==e&&Fh(i,o)).map(o=>o.id):[]}/** +*/function zh(e,t){if(e.attributes&&t.attributes&&Object.keys(e.attributes).some(o=>!i(o)&&o in t.attributes)||e.styles&&t.styles&&Object.keys(e.styles).some(o=>o in t.styles))return!0;return!1;function i(o){return o==="class"||o==="style"||o==="rel"}}function Dy({decoratorStates:e,allDecorators:t}){let i={...e};for(let n in e)if(e[n]&&o(n)){let s=CS(n,t);for(let r of s)i[r]=!1}function o(n){return t.some(s=>s.id===n&&!s.value)}return i}function CS(e,t){let i=t.find(o=>o.id===e);/* istanbul ignore next -- @preserve */return i?t.filter(o=>o.id!==e&&zh(i,o)).map(o=>o.id):[]}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var kS=class extends M{manualDecorators=new J;automaticDecorators=new cS;restoreManualDecoratorStates(){for(let e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){let e=this.editor.model,t=e.document.selection,i=t.getSelectedElement()||G(t.getSelectedBlocks());Oh(i,e.schema)?(this.value=i.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(i,"linkHref")):(this.value=t.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref"));for(let o of this.manualDecorators)o.value=this._getDecoratorStateFromModel(o.id)}execute(e,t={},i){let o=this.editor.model,n=o.document.selection,s=Oy({allDecorators:Array.from(this.manualDecorators),decoratorStates:t}),r=[],a=[];for(let l in s)s[l]?r.push(l):a.push(l);o.change(l=>{let c=h=>{l.setAttribute("linkHref",e,h),r.forEach(f=>l.setAttribute(f,!0,h)),a.forEach(f=>l.removeAttribute(f,h))},u=(h,f)=>{let m=Dh(h);if(!m)return h;let g=i;if(g||(g=f&&f==m?e:m),g!=m){let b=l.createDocumentFragment();for(let C of h.getItems()){let w=C;l.append(l.createText(w.data,w.getAttributes()),b)}let k=l.createRangeIn(b),v=CS(m,g),_=0;for(let{offset:C,actual:w,expected:E}of v){let x=C+_,B=l.createRange(k.start.getShiftedBy(x),k.start.getShiftedBy(x+w.length)),de=xS(B,k).getAttributes(),Ve=Array.from(de).filter(([iu])=>o.schema.getAttributeProperties(iu).isFormatting),Go=l.createText(E,Ve);c(Go),l.remove(B),l.insert(Go,B.start),_+=E.length}return o.insertContent(b,h),l.createRange(h.start,h.start.getShiftedBy(g.length))}},d=h=>{let{plugins:f}=this.editor;if(l.setSelection(h.end),f.has("TwoStepCaretMovement"))f.get("TwoStepCaretMovement")._handleForwardMovement();else for(let m of["linkHref",...r,...a])l.removeSelectionAttribute(m)};if(n.isCollapsed){let h=n.getFirstPosition();if(n.hasAttribute("linkHref")){let f=n.getAttribute("linkHref"),m=kr(h,"linkHref",f,o),g=u(m,f);c(g||m),g&&d(g)}else if(e!==""){let f=lt(n.getAttributes());f.set("linkHref",e),r.forEach(m=>{f.set(m,!0)}),d(o.insertContent(l.createText(i||e,f),h))}}else{let h=Array.from(n.getRanges()),f=o.schema.getValidRanges(h,"linkHref"),m=[];for(let k of n.getSelectedBlocks())o.schema.checkAttribute(k,"linkHref")&&m.push(l.createRangeOn(k));let g=m.slice();for(let k of f)this._isRangeToUpdate(k,m)&&g.push(k);let b=h.map(k=>({start:he.fromPosition(k.start,"toPrevious"),end:he.fromPosition(k.end,"toNext")}));for(let k of g){let v=(k.start.textNode||k.start.nodeAfter).getAttribute("linkHref");k=u(k,v)||k,c(k)}l.setSelection(b.map(k=>{let v=k.start.toPosition(),_=k.end.toPosition();return k.start.detach(),k.end.detach(),o.createRange(v,_)}))}}),this.restoreManualDecoratorStates()}_getDecoratorStateFromModel(e){let t=this.editor.model,i=t.document.selection,o=i.getSelectedElement();return Oh(o,t.schema)?o.getAttribute(e):i.getAttribute(e)}_isRangeToUpdate(e,t){for(let i of t)if(i.containsRange(e))return!1;return!0}};function CS(e,t){let i=Ni(e,t),o={equal:0,insert:0,delete:0},n=[],s="",r="";for(let a of[...i,null])a=="insert"?r+=t[o.equal+o.insert]:a=="delete"?s+=e[o.equal+o.delete]:(s.length||r.length)&&(n.push({offset:o.equal,actual:s,expected:r}),s="",r=""),a&&o[a]++;return n}function xS(e,t){if(!e.isCollapsed)return G(e.getItems());let i=e.start;return i.textNode?i.textNode:!i.nodeBefore||i.isEqual(t.start)?i.nodeAfter:i.nodeBefore}/** +*/var xS=class extends M{manualDecorators=new G;automaticDecorators=new dS;restoreManualDecoratorStates(){for(let e of this.manualDecorators)e.value=this._getDecoratorStateFromModel(e.id)}refresh(){let e=this.editor.model,t=e.document.selection,i=t.getSelectedElement()||J(t.getSelectedBlocks());Fh(i,e.schema)?(this.value=i.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttribute(i,"linkHref")):(this.value=t.getAttribute("linkHref"),this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref"));for(let o of this.manualDecorators)o.value=this._getDecoratorStateFromModel(o.id)}execute(e,t={},i){let o=this.editor.model,n=o.document.selection,s=Dy({allDecorators:Array.from(this.manualDecorators),decoratorStates:t}),r=[],a=[];for(let l in s)s[l]?r.push(l):a.push(l);o.change(l=>{let c=h=>{l.setAttribute("linkHref",e,h),r.forEach(f=>l.setAttribute(f,!0,h)),a.forEach(f=>l.removeAttribute(f,h))},u=(h,f)=>{let m=Nh(h);if(!m)return h;let g=i;if(g||(g=f&&f==m?e:m),g!=m){let b=l.createDocumentFragment();for(let C of h.getItems()){let y=C;l.append(l.createText(y.data,y.getAttributes()),b)}let k=l.createRangeIn(b),v=TS(m,g),_=0;for(let{offset:C,actual:y,expected:E}of v){let x=C+_,B=l.createRange(k.start.getShiftedBy(x),k.start.getShiftedBy(x+y.length)),de=ES(B,k).getAttributes(),Ve=Array.from(de).filter(([nu])=>o.schema.getAttributeProperties(nu).isFormatting),Go=l.createText(E,Ve);c(Go),l.remove(B),l.insert(Go,B.start),_+=E.length}return o.insertContent(b,h),l.createRange(h.start,h.start.getShiftedBy(g.length))}},d=h=>{let{plugins:f}=this.editor;if(l.setSelection(h.end),f.has("TwoStepCaretMovement"))f.get("TwoStepCaretMovement")._handleForwardMovement();else for(let m of["linkHref",...r,...a])l.removeSelectionAttribute(m)};if(n.isCollapsed){let h=n.getFirstPosition();if(n.hasAttribute("linkHref")){let f=n.getAttribute("linkHref"),m=kr(h,"linkHref",f,o),g=u(m,f);c(g||m),g&&d(g)}else if(e!==""){let f=lt(n.getAttributes());f.set("linkHref",e),r.forEach(m=>{f.set(m,!0)}),d(o.insertContent(l.createText(i||e,f),h))}}else{let h=Array.from(n.getRanges()),f=o.schema.getValidRanges(h,"linkHref"),m=[];for(let k of n.getSelectedBlocks())o.schema.checkAttribute(k,"linkHref")&&m.push(l.createRangeOn(k));let g=m.slice();for(let k of f)this._isRangeToUpdate(k,m)&&g.push(k);let b=h.map(k=>({start:he.fromPosition(k.start,"toPrevious"),end:he.fromPosition(k.end,"toNext")}));for(let k of g){let v=(k.start.textNode||k.start.nodeAfter).getAttribute("linkHref");k=u(k,v)||k,c(k)}l.setSelection(b.map(k=>{let v=k.start.toPosition(),_=k.end.toPosition();return k.start.detach(),k.end.detach(),o.createRange(v,_)}))}}),this.restoreManualDecoratorStates()}_getDecoratorStateFromModel(e){let t=this.editor.model,i=t.document.selection,o=i.getSelectedElement();return Fh(o,t.schema)?o.getAttribute(e):i.getAttribute(e)}_isRangeToUpdate(e,t){for(let i of t)if(i.containsRange(e))return!1;return!0}};function TS(e,t){let i=Hi(e,t),o={equal:0,insert:0,delete:0},n=[],s="",r="";for(let a of[...i,null])a=="insert"?r+=t[o.equal+o.insert]:a=="delete"?s+=e[o.equal+o.delete]:(s.length||r.length)&&(n.push({offset:o.equal,actual:s,expected:r}),s="",r=""),a&&o[a]++;return n}function ES(e,t){if(!e.isCollapsed)return J(e.getItems());let i=e.start;return i.textNode?i.textNode:!i.nodeBefore||i.isEqual(t.start)?i.nodeAfter:i.nodeBefore}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var TS=class extends M{refresh(){let e=this.editor.model,t=e.document.selection,i=t.getSelectedElement();Oh(i,e.schema)?this.isEnabled=e.schema.checkAttribute(i,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref")}execute(){let e=this.editor,t=this.editor.model,i=t.document.selection,o=e.commands.get("link");t.change(n=>{let s=i.isCollapsed?[kr(i.getFirstPosition(),"linkHref",i.getAttribute("linkHref"),t)]:t.schema.getValidRanges(i.getRanges(),"linkHref");for(let r of s)if(n.removeAttribute("linkHref",r),o)for(let a of o.manualDecorators)n.removeAttribute(a.id,r)})}};/** +*/var AS=class extends M{refresh(){let e=this.editor.model,t=e.document.selection,i=t.getSelectedElement();Fh(i,e.schema)?this.isEnabled=e.schema.checkAttribute(i,"linkHref"):this.isEnabled=e.schema.checkAttributeInSelection(t,"linkHref")}execute(){let e=this.editor,t=this.editor.model,i=t.document.selection,o=e.commands.get("link");t.change(n=>{let s=i.isCollapsed?[kr(i.getFirstPosition(),"linkHref",i.getAttribute("linkHref"),t)]:t.schema.getValidRanges(i.getRanges(),"linkHref");for(let r of s)if(n.removeAttribute("linkHref",r),o)for(let a of o.manualDecorators)n.removeAttribute(a.id,r)})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var ES=W(),AS=class extends ES{id;defaultValue;label;attributes;classes;styles;constructor({id:e,label:t,attributes:i,classes:o,styles:n,defaultValue:s}){super(),this.id=e,this.set("value",void 0),this.defaultValue=s,this.label=t,this.attributes=i,this.classes=o,this.styles=n}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}};/** +*/var IS=W(),SS=class extends IS{id;defaultValue;label;attributes;classes;styles;constructor({id:e,label:t,attributes:i,classes:o,styles:n,defaultValue:s}){super(),this.id=e,this.set("value",void 0),this.defaultValue=s,this.label=t,this.attributes=i,this.classes=o,this.styles=n}_createPattern(){return{attributes:this.attributes,classes:this.classes,styles:this.styles}}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var IS="ck-link_selected",Vy="automatic",SS="manual",PS=/^(https?:)?\/\//,oc=class extends y{_linkOpeners=[];static get pluginName(){return"LinkEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Xn,yh,Be]}constructor(e){super(e),e.config.define("link",{allowCreatingEmptyLinks:!1,addTargetToExternalLinks:!1,toolbar:["linkPreview","|","editLink","linkProperties","unlink"]})}init(){let e=this.editor,t=this.editor.config.get("link.allowedProtocols");e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:Ry}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(o,n)=>Ry(My(o,t),n)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:o=>o.getAttribute("href")}}),e.commands.add("link",new kS(e)),e.commands.add("unlink",new TS(e));let i=bS(e.t,wS(e.config.get("link.decorators")));this._enableAutomaticDecorators(i.filter(o=>o.mode===Vy)),this._enableManualDecorators(i.filter(o=>o.mode===SS)),e.plugins.get(Xn).registerAttribute("linkHref"),Nl(e,"linkHref","a",IS),this._enableLinkOpen(),this._enableSelectionAttributesFixer(),this._enableClipboardIntegration(),this._enableDecoratorConflictPostfixer()}_registerLinkOpener(e){this._linkOpeners.push(e)}_enableAutomaticDecorators(e){let t=this.editor,i=t.commands.get("link"),o=i.automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&o.add({id:"linkIsExternal",mode:Vy,callback:n=>!!n&&PS.test(n),attributes:{target:"_blank",rel:"noopener noreferrer"}}),o.add(e),o.setConflictChecker((n,s)=>{for(let r of i.manualDecorators)if(s.hasAttribute(r.id)&&Fh(n,r))return!0}),o.length&&t.conversion.for("downcast").add(o.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;let t=this.editor,i=t.commands.get("link").manualDecorators;e.forEach(o=>{t.model.schema.extend("$text",{allowAttributes:o.id});let n=new AS(o);i.add(n),t.conversion.for("downcast").add(s=>{let r=l=>{let c=l.createAttributeElement("a",n.attributes,{priority:5});n.classes&&l.addClass(n.classes,c);for(let u in n.styles)l.setStyle(u,n.styles[u],c);return l.setCustomProperty("link",!0,c),c},a=l=>(c,u,d)=>{if(!(!u.item.is("selection")&&!d.schema.isInline(u.item))){if(!l&&u.attributeOldValue){if(!d.consumable.test(u.item,c.name))return;d.writer.unwrap(d.mapper.toViewRange(u.range),r(d.writer))}if(l&&u.attributeNewValue){if(!d.consumable.consume(u.item,c.name))return;u.item.is("selection")?d.writer.wrap(d.writer.document.selection.getFirstRange(),r(d.writer)):d.writer.wrap(d.mapper.toViewRange(u.range),r(d.writer))}}};s.on(`attribute:${n.id}`,a(!1),{priority:le.high-1}),s.on(`attribute:${n.id}`,a(!0),{priority:le.high-2})}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",...n._createPattern()},model:{key:n.id}})})}_enableLinkOpen(){let e=this.editor,t=e.editing.view.document,i=o=>{this._linkOpeners.some(n=>n(o))||_S(o)};this.listenTo(t,"click",(o,n)=>{if(!(V.isMac?n.domEvent.metaKey:n.domEvent.ctrlKey))return;let s=n.domTarget;if(s.tagName.toLowerCase()!="a"&&(s=s.closest("a")),!s)return;let r=s.getAttribute("href");r&&(o.stop(),n.preventDefault(),i(r))},{context:"$capture"}),this.listenTo(t,"keydown",(o,n)=>{let s=e.commands.get("link").value;s&&n.keyCode===O.enter&&n.altKey&&(o.stop(),i(s))})}_enableSelectionAttributesFixer(){let e=this.editor.model,t=e.document.selection;this.listenTo(t,"change:attribute",(i,{attributeKeys:o})=>{!o.includes("linkHref")||t.hasAttribute("linkHref")||e.change(n=>{RS(n,VS(e.schema))})})}_enableClipboardIntegration(){let e=this.editor,t=e.model,i=this.editor.config.get("link.defaultProtocol");i&&this.listenTo(e.plugins.get("ClipboardPipeline"),"contentInsertion",(o,n)=>{t.change(s=>{let r=s.createRangeIn(n.content);for(let a of r.getItems())if(a.hasAttribute("linkHref")){let l=Nh(a.getAttribute("linkHref"),i);s.setAttribute("linkHref",l,a)}})})}_enableDecoratorConflictPostfixer(){let e=this.editor,t=e.model,i=e.commands.get("link");t.document.registerPostFixer(o=>{let n=!1,s=t.document.differ.getChanges(),r=new Set,a=new Set(i.manualDecorators.map(l=>l.id));for(let l of s){if(l.type==="attribute"){if(l.attributeKey!=="linkHref"&&!a.has(l.attributeKey))continue;for(let c of l.range.getItems())c.hasAttribute("linkHref")&&r.add(c)}l.type==="insert"&&l.attributes.has("linkHref")&&l.position.nodeAfter&&r.add(l.position.nodeAfter)}for(let l of r){let c=[];for(let u of i.manualDecorators)if(l.hasAttribute(u.id)){for(let d=c.length-1;d>=0;d--){let h=c[d];Fh(h,u)&&(o.removeAttribute(h.id,l),c.splice(d,1),n=!0)}c.push(u)}}return n})}};function RS(e,t){e.removeSelectionAttribute("linkHref");for(let i of t)e.removeSelectionAttribute(i)}function VS(e){return e.getDefinition("$text").allowAttributes.filter(t=>t.startsWith("link"))}/** +*/var PS="ck-link_selected",Ly="automatic",RS="manual",VS=/^(https?:)?\/\//,sc=class extends w{_linkOpeners=[];static get pluginName(){return"LinkEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Xn,vh,Be]}constructor(e){super(e),e.config.define("link",{allowCreatingEmptyLinks:!1,addTargetToExternalLinks:!1,toolbar:["linkPreview","|","editLink","linkProperties","unlink"]})}init(){let e=this.editor,t=this.editor.config.get("link.allowedProtocols");e.model.schema.extend("$text",{allowAttributes:"linkHref"}),e.conversion.for("dataDowncast").attributeToElement({model:"linkHref",view:Vy}),e.conversion.for("editingDowncast").attributeToElement({model:"linkHref",view:(o,n)=>Vy(By(o,t),n)}),e.conversion.for("upcast").elementToAttribute({view:{name:"a",attributes:{href:!0}},model:{key:"linkHref",value:o=>o.getAttribute("href")}}),e.commands.add("link",new xS(e)),e.commands.add("unlink",new AS(e));let i=yS(e.t,_S(e.config.get("link.decorators")));this._enableAutomaticDecorators(i.filter(o=>o.mode===Ly)),this._enableManualDecorators(i.filter(o=>o.mode===RS)),e.plugins.get(Xn).registerAttribute("linkHref"),zl(e,"linkHref","a",PS),this._enableLinkOpen(),this._enableSelectionAttributesFixer(),this._enableClipboardIntegration(),this._enableDecoratorConflictPostfixer()}_registerLinkOpener(e){this._linkOpeners.push(e)}_enableAutomaticDecorators(e){let t=this.editor,i=t.commands.get("link"),o=i.automaticDecorators;t.config.get("link.addTargetToExternalLinks")&&o.add({id:"linkIsExternal",mode:Ly,callback:n=>!!n&&VS.test(n),attributes:{target:"_blank",rel:"noopener noreferrer"}}),o.add(e),o.setConflictChecker((n,s)=>{for(let r of i.manualDecorators)if(s.hasAttribute(r.id)&&zh(n,r))return!0}),o.length&&t.conversion.for("downcast").add(o.getDispatcher())}_enableManualDecorators(e){if(!e.length)return;let t=this.editor,i=t.commands.get("link").manualDecorators;e.forEach(o=>{t.model.schema.extend("$text",{allowAttributes:o.id});let n=new SS(o);i.add(n),t.conversion.for("downcast").add(s=>{let r=l=>{let c=l.createAttributeElement("a",n.attributes,{priority:5});n.classes&&l.addClass(n.classes,c);for(let u in n.styles)l.setStyle(u,n.styles[u],c);return l.setCustomProperty("link",!0,c),c},a=l=>(c,u,d)=>{if(!(!u.item.is("selection")&&!d.schema.isInline(u.item))){if(!l&&u.attributeOldValue){if(!d.consumable.test(u.item,c.name))return;d.writer.unwrap(d.mapper.toViewRange(u.range),r(d.writer))}if(l&&u.attributeNewValue){if(!d.consumable.consume(u.item,c.name))return;u.item.is("selection")?d.writer.wrap(d.writer.document.selection.getFirstRange(),r(d.writer)):d.writer.wrap(d.mapper.toViewRange(u.range),r(d.writer))}}};s.on(`attribute:${n.id}`,a(!1),{priority:le.high-1}),s.on(`attribute:${n.id}`,a(!0),{priority:le.high-2})}),t.conversion.for("upcast").elementToAttribute({view:{name:"a",...n._createPattern()},model:{key:n.id}})})}_enableLinkOpen(){let e=this.editor,t=e.editing.view.document,i=o=>{this._linkOpeners.some(n=>n(o))||kS(o)};this.listenTo(t,"click",(o,n)=>{if(!(V.isMac?n.domEvent.metaKey:n.domEvent.ctrlKey))return;let s=n.domTarget;if(s.tagName.toLowerCase()!="a"&&(s=s.closest("a")),!s)return;let r=s.getAttribute("href");r&&(o.stop(),n.preventDefault(),i(r))},{context:"$capture"}),this.listenTo(t,"keydown",(o,n)=>{let s=e.commands.get("link").value;s&&n.keyCode===O.enter&&n.altKey&&(o.stop(),i(s))})}_enableSelectionAttributesFixer(){let e=this.editor.model,t=e.document.selection;this.listenTo(t,"change:attribute",(i,{attributeKeys:o})=>{!o.includes("linkHref")||t.hasAttribute("linkHref")||e.change(n=>{LS(n,MS(e.schema))})})}_enableClipboardIntegration(){let e=this.editor,t=e.model,i=this.editor.config.get("link.defaultProtocol");i&&this.listenTo(e.plugins.get("ClipboardPipeline"),"contentInsertion",(o,n)=>{t.change(s=>{let r=s.createRangeIn(n.content);for(let a of r.getItems())if(a.hasAttribute("linkHref")){let l=Hh(a.getAttribute("linkHref"),i);s.setAttribute("linkHref",l,a)}})})}_enableDecoratorConflictPostfixer(){let e=this.editor,t=e.model,i=e.commands.get("link");t.document.registerPostFixer(o=>{let n=!1,s=t.document.differ.getChanges(),r=new Set,a=new Set(i.manualDecorators.map(l=>l.id));for(let l of s){if(l.type==="attribute"){if(l.attributeKey!=="linkHref"&&!a.has(l.attributeKey))continue;for(let c of l.range.getItems())c.hasAttribute("linkHref")&&r.add(c)}l.type==="insert"&&l.attributes.has("linkHref")&&l.position.nodeAfter&&r.add(l.position.nodeAfter)}for(let l of r){let c=[];for(let u of i.manualDecorators)if(l.hasAttribute(u.id)){for(let d=c.length-1;d>=0;d--){let h=c[d];zh(h,u)&&(o.removeAttribute(h.id,l),c.splice(d,1),n=!0)}c.push(u)}}return n})}};function LS(e,t){e.removeSelectionAttribute("linkHref");for(let i of t)e.removeSelectionAttribute(i)}function MS(e){return e.getDefinition("$text").allowAttributes.filter(t=>t.startsWith("link"))}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var LS=class extends I{constructor(e){super(e);let t=this.bindTemplate;this.set({href:void 0,withText:!0}),this.extendTemplate({attributes:{class:["ck-link-toolbar__preview"],href:t.to("href"),target:"_blank",rel:"noopener noreferrer"},on:{click:t.to(i=>{if(this.href){let o=()=>i.preventDefault();this.fire("navigate",this.href,o)}})}}),this.template.tag="a"}};/** +*/var BS=class extends I{constructor(e){super(e);let t=this.bindTemplate;this.set({href:void 0,withText:!0}),this.extendTemplate({attributes:{class:["ck-link-toolbar__preview"],href:t.to("href"),target:"_blank",rel:"noopener noreferrer"},on:{click:t.to(i=>{if(this.href){let o=()=>i.preventDefault();this.fire("navigate",this.href,o)}})}}),this.template.tag="a"}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var MS=class extends R{focusTracker=new Q;keystrokes=new X;backButtonView;saveButtonView;manualDecoratorsButtonView;displayedTextInputView;urlInputView;children;providersListChildren;_validators;_focusables=new be;_focusCycler;constructor(e,t){super(e),this._validators=t,this.backButtonView=this._createBackButton(),this.saveButtonView=this._createSaveButton(),this.manualDecoratorsButtonView=this._createManualDecoratorsButton(),this.displayedTextInputView=this._createDisplayedTextInput(),this.urlInputView=this._createUrlInput(),this.providersListChildren=this.createCollection(),this.children=this.createCollection([this._createHeaderView()]),this._createFormChildren(),this.listenTo(this.providersListChildren,"add",()=>{this.stopListening(this.providersListChildren,"add"),this.children.add(this._createProvidersListView())}),this._focusCycler=new Ie({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-link-form","ck-responsive-form"],tabindex:"-1"},children:this.children})}render(){super.render(),_i({view:this}),[this.urlInputView,this.manualDecoratorsButtonView,this.saveButtonView,...this.providersListChildren,this.backButtonView,this.displayedTextInputView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}isValid(){this.resetFormStatus();for(let e of this._validators){let t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null}_createBackButton(){let e=this.locale.t,t=new I(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:yt,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createSaveButton(){let e=this.locale.t,t=new I(this.locale);return t.set({label:e("Insert"),tooltip:!1,withText:!0,type:"submit",class:"ck-button-action ck-button_standard"}),t}_createManualDecoratorsButton(){let e=this.locale.t,t=new I(this.locale);return t.set({label:e("Link properties"),icon:Wd,tooltip:!0,isVisible:!1}),t.delegate("execute").to(this,"showDecorators"),t}_createHeaderView(){let e=this.locale.t,t=new Mt(this.locale,{label:e("Link")});return t.children.add(this.backButtonView,0),t}_createProvidersListView(){let e=new vi(this.locale);return e.extendTemplate({attributes:{class:["ck-link-form__providers-list"]}}),e.items.bindTo(this.providersListChildren).using(t=>{let i=new ot(this.locale);return i.children.add(t),i}),e}_createDisplayedTextInput(){let e=this.locale.t,t=new ue(this.locale,nt);return t.label=e("Displayed text"),t.class="ck-labeled-field-view_full-width",t}_createUrlInput(){let e=this.locale.t,t=new ue(this.locale,nt);return t.fieldView.inputMode="url",t.label=e("Link URL"),t.class="ck-labeled-field-view_full-width",t}_createFormChildren(){this.children.add(new fe(this.locale,{children:[this.displayedTextInputView],class:["ck-form__row_large-top-padding"]})),this.children.add(new fe(this.locale,{children:[this.urlInputView,this.manualDecoratorsButtonView,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-bottom-padding"]}))}get url(){let{element:e}=this.urlInputView.fieldView;return e?e.value.trim():null}};/** +*/var OS=class extends R{focusTracker=new Q;keystrokes=new X;backButtonView;saveButtonView;manualDecoratorsButtonView;displayedTextInputView;urlInputView;children;providersListChildren;_validators;_focusables=new we;_focusCycler;constructor(e,t){super(e),this._validators=t,this.backButtonView=this._createBackButton(),this.saveButtonView=this._createSaveButton(),this.manualDecoratorsButtonView=this._createManualDecoratorsButton(),this.displayedTextInputView=this._createDisplayedTextInput(),this.urlInputView=this._createUrlInput(),this.providersListChildren=this.createCollection(),this.children=this.createCollection([this._createHeaderView()]),this._createFormChildren(),this.listenTo(this.providersListChildren,"add",()=>{this.stopListening(this.providersListChildren,"add"),this.children.add(this._createProvidersListView())}),this._focusCycler=new Pe({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-link-form","ck-responsive-form"],tabindex:"-1"},children:this.children})}render(){super.render(),ki({view:this}),[this.urlInputView,this.manualDecoratorsButtonView,this.saveButtonView,...this.providersListChildren,this.backButtonView,this.displayedTextInputView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}isValid(){this.resetFormStatus();for(let e of this._validators){let t=e(this);if(t)return this.urlInputView.errorText=t,!1}return!0}resetFormStatus(){this.urlInputView.errorText=null}_createBackButton(){let e=this.locale.t,t=new I(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:_t,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createSaveButton(){let e=this.locale.t,t=new I(this.locale);return t.set({label:e("Insert"),tooltip:!1,withText:!0,type:"submit",class:"ck-button-action ck-button_standard"}),t}_createManualDecoratorsButton(){let e=this.locale.t,t=new I(this.locale);return t.set({label:e("Link properties"),icon:qd,tooltip:!0,isVisible:!1}),t.delegate("execute").to(this,"showDecorators"),t}_createHeaderView(){let e=this.locale.t,t=new Bt(this.locale,{label:e("Link")});return t.children.add(this.backButtonView,0),t}_createProvidersListView(){let e=new Ci(this.locale);return e.extendTemplate({attributes:{class:["ck-link-form__providers-list"]}}),e.items.bindTo(this.providersListChildren).using(t=>{let i=new ot(this.locale);return i.children.add(t),i}),e}_createDisplayedTextInput(){let e=this.locale.t,t=new ue(this.locale,nt);return t.label=e("Displayed text"),t.class="ck-labeled-field-view_full-width",t}_createUrlInput(){let e=this.locale.t,t=new ue(this.locale,nt);return t.fieldView.inputMode="url",t.label=e("Link URL"),t.class="ck-labeled-field-view_full-width",t}_createFormChildren(){this.children.add(new fe(this.locale,{children:[this.displayedTextInputView],class:["ck-form__row_large-top-padding"]})),this.children.add(new fe(this.locale,{children:[this.urlInputView,this.manualDecoratorsButtonView,this.saveButtonView],class:["ck-form__row_with-submit","ck-form__row_large-bottom-padding"]}))}get url(){let{element:e}=this.urlInputView.fieldView;return e?e.value.trim():null}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var BS=class extends R{focusTracker=new Q;keystrokes=new X;backButtonView;listView;listChildren;emptyListInformation;children;_focusables=new be;_focusCycler;constructor(e){super(e),this.listChildren=this.createCollection(),this.backButtonView=this._createBackButton(),this.listView=this._createListView(),this.emptyListInformation=this._createEmptyLinksListItemView(),this.children=this.createCollection([this._createHeaderView(),this.emptyListInformation]),this.set("title",""),this.set("emptyListPlaceholder",""),this.set("hasItems",!1),this.listenTo(this.listChildren,"change",()=>{this.hasItems=this.listChildren.length>0}),this.on("change:hasItems",(t,i,o)=>{o?(this.children.remove(this.emptyListInformation),this.children.add(this.listView)):(this.children.remove(this.listView),this.children.add(this.emptyListInformation))}),this.keystrokes.set("Esc",(t,i)=>{this.fire("cancel"),i()}),this._focusCycler=new Ie({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-providers"],tabindex:"-1"},children:this.children})}render(){super.render(),[this.listView,this.backButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createListView(){let e=new vi(this.locale);return e.extendTemplate({attributes:{class:["ck-link-providers__list"]}}),e.items.bindTo(this.listChildren).using(t=>{let i=new ot(this.locale);return i.children.add(t),i}),e}_createBackButton(){let e=this.locale.t,t=new I(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:yt,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createHeaderView(){let e=new Mt(this.locale);return e.bind("label").to(this,"title"),e.children.add(this.backButtonView,0),e}_createEmptyLinksListItemView(){let e=new R(this.locale);return e.setTemplate({tag:"p",attributes:{class:["ck","ck-link__empty-list-info"]},children:[{text:this.bindTemplate.to("emptyListPlaceholder")}]}),e}};/** +*/var DS=class extends R{focusTracker=new Q;keystrokes=new X;backButtonView;listView;listChildren;emptyListInformation;children;_focusables=new we;_focusCycler;constructor(e){super(e),this.listChildren=this.createCollection(),this.backButtonView=this._createBackButton(),this.listView=this._createListView(),this.emptyListInformation=this._createEmptyLinksListItemView(),this.children=this.createCollection([this._createHeaderView(),this.emptyListInformation]),this.set("title",""),this.set("emptyListPlaceholder",""),this.set("hasItems",!1),this.listenTo(this.listChildren,"change",()=>{this.hasItems=this.listChildren.length>0}),this.on("change:hasItems",(t,i,o)=>{o?(this.children.remove(this.emptyListInformation),this.children.add(this.listView)):(this.children.remove(this.listView),this.children.add(this.emptyListInformation))}),this.keystrokes.set("Esc",(t,i)=>{this.fire("cancel"),i()}),this._focusCycler=new Pe({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-providers"],tabindex:"-1"},children:this.children})}render(){super.render(),[this.listView,this.backButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createListView(){let e=new Ci(this.locale);return e.extendTemplate({attributes:{class:["ck-link-providers__list"]}}),e.items.bindTo(this.listChildren).using(t=>{let i=new ot(this.locale);return i.children.add(t),i}),e}_createBackButton(){let e=this.locale.t,t=new I(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:_t,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_createHeaderView(){let e=new Bt(this.locale);return e.bind("label").to(this,"title"),e.children.add(this.backButtonView,0),e}_createEmptyLinksListItemView(){let e=new R(this.locale);return e.setTemplate({tag:"p",attributes:{class:["ck","ck-link__empty-list-info"]},children:[{text:this.bindTemplate.to("emptyListPlaceholder")}]}),e}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var OS=class extends R{focusTracker=new Q;keystrokes=new X;backButtonView;children;listChildren;_focusables=new be;_focusCycler;constructor(e){super(e),this.backButtonView=this._createBackButton(),this.listChildren=this.createCollection(),this.children=this.createCollection([this._createHeaderView(),this._createListView()]),this._focusCycler=new Ie({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-properties"],tabindex:"-1"},children:this.children}),this.keystrokes.set("Esc",(t,i)=>{this.fire("back"),i()})}render(){super.render(),[...this.listChildren,this.backButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createBackButton(){let e=this.locale.t,t=new I(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:yt,tooltip:!0}),t.delegate("execute").to(this,"back"),t}_createHeaderView(){let e=this.locale.t,t=new Mt(this.locale,{label:e("Link properties")});return t.children.add(this.backButtonView,0),t}_createListView(){let e=new vi(this.locale);return e.extendTemplate({attributes:{class:["ck-link__list"]}}),e.items.bindTo(this.listChildren).using(t=>{let i=new ot(this.locale);return i.children.add(t),i}),e}};/** +*/var FS=class extends R{focusTracker=new Q;keystrokes=new X;backButtonView;children;listChildren;_focusables=new we;_focusCycler;constructor(e){super(e),this.backButtonView=this._createBackButton(),this.listChildren=this.createCollection(),this.children=this.createCollection([this._createHeaderView(),this._createListView()]),this._focusCycler=new Pe({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-link-properties"],tabindex:"-1"},children:this.children}),this.keystrokes.set("Esc",(t,i)=>{this.fire("back"),i()})}render(){super.render(),[...this.listChildren,this.backButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createBackButton(){let e=this.locale.t,t=new I(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:_t,tooltip:!0}),t.delegate("execute").to(this,"back"),t}_createHeaderView(){let e=this.locale.t,t=new Bt(this.locale,{label:e("Link properties")});return t.children.add(this.backButtonView,0),t}_createListView(){let e=new Ci(this.locale);return e.extendTemplate({attributes:{class:["ck-link__list"]}}),e.items.bindTo(this.listChildren).using(t=>{let i=new ot(this.locale);return i.children.add(t),i}),e}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var DS=class extends I{arrowView;constructor(e){super(e),this.set({withText:!0}),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{class:["ck-link__button"]}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){let e=new Yt;return e.content=pl,e}};/** +*/var NS=class extends I{arrowView;constructor(e){super(e),this.set({withText:!0}),this.arrowView=this._createArrowView(),this.extendTemplate({attributes:{class:["ck-link__button"]}})}render(){super.render(),this.children.add(this.arrowView)}_createArrowView(){let e=new ei;return e.content=bl,e}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var ei="link-ui",FS=class extends y{toolbarView=null;formView=null;linkProviderItemsView=null;propertiesView=null;_balloon;_linksProviders=new J;static get requires(){return[re,oc]}static get pluginName(){return"LinkUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=this.editor.t;this.set("selectedLinkableText",void 0),e.editing.view.addObserver(ll),this._balloon=e.plugins.get(re),this._registerComponents(),this._registerEditingOpeners(),this._enableBalloonActivators(),e.conversion.for("editingDowncast").markerToHighlight({model:ei,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:ei,view:(i,{writer:o})=>{if(!i.markerRange.isCollapsed)return null;let n=o.createUIElement("span");return o.addClass(["ck-fake-link-selection","ck-fake-link-selection_collapsed"],n),n}}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Create link"),keystroke:ic},{label:t("Move out of a link"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}destroy(){super.destroy(),this.propertiesView&&this.propertiesView.destroy(),this.formView&&this.formView.destroy(),this.toolbarView&&this.toolbarView.destroy(),this.linkProviderItemsView&&this.linkProviderItemsView.destroy()}registerLinksListProvider(e){let t=this._linksProviders.filter(i=>(i.order||0)<=(e.order||0)).length;this._linksProviders.add(e,t)}_createViews(){let e=this.editor.commands.get("link");this.toolbarView=this._createToolbarView(),this.formView=this._createFormView(),e.manualDecorators.length&&(this.propertiesView=this._createPropertiesView()),this._enableUserBalloonInteractions()}_createToolbarView(){let e=this.editor,t=new dt(e.locale),i=e.commands.get("link");t.class="ck-link-toolbar";let o=e.config.get("link.toolbar");return i.manualDecorators.length||(o=o.filter(n=>n!=="linkProperties")),t.fillFromConfig(o,e.ui.componentFactory),t.keystrokes.set("Esc",(n,s)=>{this._hideUI(),s()}),t.keystrokes.set(ic,(n,s)=>{this._addFormView(),s()}),e.ui.addToolbar(t,{isContextual:!0,beforeFocus:()=>{this._getSelectedLinkElement()&&!this._isToolbarVisible&&this._showUI(!0)},afterBlur:()=>{this._hideUI(!1)}}),t}_createFormView(){let e=this.editor,t=e.locale.t,i=e.commands.get("link"),o=e.config.get("link.defaultProtocol"),n=new(Kn(MS))(e.locale,NS(e));return n.displayedTextInputView.bind("isEnabled").to(this,"selectedLinkableText",s=>s!==void 0),n.urlInputView.bind("isEnabled").to(i,"isEnabled"),n.saveButtonView.bind("isEnabled").to(i,"isEnabled"),n.saveButtonView.bind("label").to(i,"value",s=>t(s?"Update":"Insert")),this.listenTo(n,"submit",()=>{if(n.isValid()){let s=n.urlInputView.fieldView.element.value,r=Nh(s,o),a=n.displayedTextInputView.fieldView.element.value;e.execute("link",r,this._getDecoratorSwitchesState(),a!==this.selectedLinkableText?a:void 0),this._closeFormView()}}),this.listenTo(n.urlInputView,"change:errorText",()=>{e.ui.update()}),this.listenTo(n,"cancel",()=>{this._closeFormView()}),n.keystrokes.set("Esc",(s,r)=>{this._closeFormView(),r()}),n.providersListChildren.bindTo(this._linksProviders).using(s=>this._createLinksListProviderButton(s)),n.manualDecoratorsButtonView.isVisible=i.manualDecorators.length>0,this.listenTo(n,"showDecorators",()=>{this._addPropertiesView()}),n}_createLinkProviderListView(e){return e.getListItems().map(({href:t,label:i,icon:o})=>{let n=new I;return n.set({label:i,icon:o,tooltip:!1,withText:!0}),n.on("execute",()=>{this.formView.resetFormStatus(),this.formView.urlInputView.fieldView.value=t,this.editor.editing.view.focus(),this._removeLinksProviderView(),this.formView.focus()}),n})}_createLinkProviderItemsView(e){let t=this.editor,i=t.locale.t,o=new BS(t.locale),{emptyListPlaceholder:n,label:s}=e;return o.emptyListPlaceholder=n||i("No links available"),o.title=s,this.listenTo(o,"cancel",()=>{t.editing.view.focus(),this._removeLinksProviderView(),this.formView.focus()}),o}_createPropertiesView(){let e=this.editor,t=this.editor.commands.get("link"),i=new(Kn(OS))(e.locale);return this.listenTo(i,"back",()=>{this._isFormInPanel?(this._removePropertiesView(),this.formView.focus()):(e.editing.view.focus(),this._removePropertiesView())}),i.listChildren.bindTo(t.manualDecorators).using(o=>{let n=new Io(e.locale);return n.set({label:o.label,withText:!0}),n.bind("isOn").toMany([o,t],"value",(s,r)=>r===void 0&&s===void 0?!!o.defaultValue:!!s),n.on("execute",()=>{let s=!n.isOn;t.value!==void 0?e.execute("link",t.value,{...this._getDecoratorSwitchesState(),[o.id]:s}):this._togglePendingManualDecorator(o,s)}),n}),i}_getDecoratorSwitchesState(){let e=this.editor.commands.get("link");return Array.from(e.manualDecorators).reduce((t,i)=>{let o=e.value===void 0&&i.value===void 0?i.defaultValue:i.value;return{...t,[i.id]:!!o}},{})}_togglePendingManualDecorator(e,t){let i=this.editor.commands.get("link"),o=Array.from(i.manualDecorators),n=this._getDecoratorSwitchesState(),s=o.map(a=>({id:a.id,attributes:a.attributes,styles:a.styles,value:n[a.id]}));n[e.id]=t;let r=Oy({decoratorStates:n,allDecorators:s});for(let a of o)a.value=r[a.id]}_resetPendingManualDecoratorsState(){let e=this.editor.commands.get("link");for(let t of e.manualDecorators)t.value=void 0}_registerEditingOpeners(){this.editor.plugins.get(oc)._registerLinkOpener(e=>{let t=this._getLinkProviderLinkByHref(e);if(!t)return!1;let{item:i,provider:o}=t;return o.navigate?o.navigate(i):!1})}_registerComponents(){let e=this.editor;e.ui.componentFactory.add("link",()=>{let t=this._createButton(I);return t.set({tooltip:!0}),t}),e.ui.componentFactory.add("menuBar:link",()=>{let t=this._createButton(oe);return t.set({role:"menuitemcheckbox"}),t}),e.ui.componentFactory.add("linkPreview",t=>{let i=new LS(t),o=e.config.get("link.allowedProtocols"),n=e.commands.get("link"),s=t.t;i.bind("isEnabled").to(n,"value",a=>!!a),i.bind("href").to(n,"value",a=>a&&My(a,o));let r=a=>{if(a===""){i.label=s("This link has no URL"),i.icon=void 0,i.tooltip=!1;return}if(!a){i.label=void 0,i.icon=void 0,i.tooltip=s("Open link in new tab");return}let l=this._getLinkProviderLinkByHref(a);if(l){let{label:c,tooltip:u,icon:d}=l.item;i.label=c,i.tooltip=u||!1,i.icon=d}else i.label=a,i.icon=void 0,i.tooltip=s("Open link in new tab")};return r(n.value),this.listenTo(n,"change:value",(a,l,c)=>{r(c)}),this.listenTo(i,"navigate",(a,l,c)=>{let u=this._getLinkProviderLinkByHref(l);if(!u)return;let{provider:d,item:h}=u,{navigate:f}=d;f&&f(h)&&(a.stop(),c())}),i}),e.ui.componentFactory.add("unlink",t=>{let i=e.commands.get("unlink"),o=new I(t),n=t.t;return o.set({label:n("Unlink"),icon:bb,tooltip:!0}),o.bind("isEnabled").to(i),this.listenTo(o,"execute",()=>{e.execute("unlink"),this._hideUI()}),o}),e.ui.componentFactory.add("editLink",t=>{let i=e.commands.get("link"),o=new I(t),n=t.t;return o.set({label:n("Edit link"),icon:tb,tooltip:!0}),o.bind("isEnabled").to(i),this.listenTo(o,"execute",()=>{this._addFormView()}),o}),e.ui.componentFactory.add("linkProperties",t=>{let i=e.commands.get("link"),o=new I(t),n=t.t;return o.set({label:n("Link properties"),icon:Wd,tooltip:!0}),o.bind("isEnabled").to(i,"isEnabled",i,"value",i,"manualDecorators",(s,r,a)=>s&&r!==void 0&&a.length>0),this.listenTo(o,"execute",()=>{this._addPropertiesView()}),o})}_createLinksListProviderButton(e){let t=this.editor.locale,i=new DS(t);return i.set({label:e.label}),this.listenTo(i,"execute",()=>{this._showLinksProviderView(e)}),i}_createButton(e){let t=this.editor,i=t.locale,o=t.commands.get("link"),n=new e(t.locale),s=i.t;return n.set({label:s("Link"),icon:j1,keystroke:ic,isToggleable:!0}),n.bind("isEnabled").to(o,"isEnabled"),n.bind("isOn").to(o,"value",r=>!!r),this.listenTo(n,"execute",()=>{t.editing.view.scrollToTheSelection(),this._showUI(!0),this._getSelectedLinkElement()&&this._addFormView()}),n}_enableBalloonActivators(){let e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),e.keystrokes.set(ic,(i,o)=>{o(),e.commands.get("link").isEnabled&&(e.editing.view.scrollToTheSelection(),this._showUI(!0))})}_enableUserBalloonInteractions(){this.editor.keystrokes.set("Tab",(e,t)=>{this._isToolbarVisible&&!this.toolbarView.focusTracker.isFocused&&(this.toolbarView.focus(),t())},{priority:"high"}),this.editor.keystrokes.set("Esc",(e,t)=>{this._isUIVisible&&(this._hideUI(),t())}),vt({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:()=>[this._balloon.view.element],callback:()=>{this._hideUI(!1)}})}_addToolbarView(){this.toolbarView||this._createViews(),!this._isToolbarInPanel&&this._balloon.add({view:this.toolbarView,position:this._getBalloonPositionData(),balloonClassName:"ck-toolbar-container"})}_addFormView(){if(this.formView||this._createViews(),this._isFormInPanel)return;let e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this.formView.resetFormStatus(),this.formView.backButtonView.isVisible=e.isEnabled&&e.value!==void 0,this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this.selectedLinkableText=this._getSelectedLinkableText(),this.formView.displayedTextInputView.fieldView.value=this.selectedLinkableText||"",this.formView.urlInputView.fieldView.value=e.value||"",this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions()}_addPropertiesView(){this.propertiesView||this._createViews(),!this._arePropertiesInPanel&&(this.propertiesView.disableCssTransitions(),this._balloon.add({view:this.propertiesView,position:this._getBalloonPositionData()}),this.propertiesView.enableCssTransitions(),this.propertiesView.focus())}_showLinksProviderView(e){this.linkProviderItemsView&&this._removeLinksProviderView(),this.linkProviderItemsView=this._createLinkProviderItemsView(e),this._addLinkProviderItemsView(e)}_addLinkProviderItemsView(e){this.linkProviderItemsView.listChildren.clear(),this.linkProviderItemsView.listChildren.addMany(this._createLinkProviderListView(e)),this._balloon.add({view:this.linkProviderItemsView,position:this._getBalloonPositionData()}),this.linkProviderItemsView.focus()}_closeFormView(){let e=this.editor.commands.get("link");this.selectedLinkableText=void 0,e.value!==void 0?this._removeFormView():this._hideUI()}_removePropertiesView(){this._arePropertiesInPanel&&this._balloon.remove(this.propertiesView)}_removeLinksProviderView(){this._isLinksListInPanel&&this._balloon.remove(this.linkProviderItemsView)}_removeFormView(e=!0){if(this._isFormInPanel){let t=this.editor.commands.get("link");this.formView.saveButtonView.focus(),this.formView.displayedTextInputView.fieldView.reset(),this.formView.urlInputView.fieldView.reset(),t.value===void 0&&this._resetPendingManualDecoratorsState(),this._balloon.remove(this.formView),e&&this.editor.editing.view.focus(),this._hideFakeVisualSelection()}}_showUI(e=!1){this.formView||this._createViews(),this._getSelectedLinkElement()?(this._isToolbarVisible?this._addFormView():this._addToolbarView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addToolbarView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(e=!0){let t=this.editor;this._isUIInPanel&&(this.stopListening(t.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e&&t.editing.view.focus(),this._removeLinksProviderView(),this._removePropertiesView(),this._removeFormView(e),this._isToolbarInPanel&&this._balloon.remove(this.toolbarView),this._hideFakeVisualSelection())}_startUpdatingUI(){let e=this.editor,t=e.editing.view.document,i=this._getSelectedLinkElement(),o=s(),n=()=>{let r=this._getSelectedLinkElement(),a=s();i&&!r||!i&&a!==o?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),i=r,o=a};function s(){return t.selection.focus.getAncestors().reverse().find(r=>r.is("element"))}this.listenTo(e.ui,"update",n),this.listenTo(this._balloon,"change:visibleView",n)}get _arePropertiesInPanel(){return!!this.propertiesView&&this._balloon.hasView(this.propertiesView)}get _isLinksListInPanel(){return!!this.linkProviderItemsView&&this._balloon.hasView(this.linkProviderItemsView)}get _isFormInPanel(){return!!this.formView&&this._balloon.hasView(this.formView)}get _isToolbarInPanel(){return!!this.toolbarView&&this._balloon.hasView(this.toolbarView)}get _isPropertiesVisible(){return!!this.propertiesView&&this._balloon.visibleView===this.propertiesView}get _isFormVisible(){return!!this.formView&&this._balloon.visibleView==this.formView}get _isToolbarVisible(){return!!this.toolbarView&&this._balloon.visibleView===this.toolbarView}get _isUIInPanel(){return this._arePropertiesInPanel||this._isLinksListInPanel||this._isFormInPanel||this._isToolbarInPanel}get _isUIVisible(){return this._isPropertiesVisible||this._isLinksListInPanel||this._isFormVisible||this._isToolbarVisible}_getBalloonPositionData(){let e=this.editor.editing.view,t=e.document;if(this.editor.model.markers.has(ei)){let i=this.editor.editing.mapper.markerNameToElements(ei);if(i){let o=Array.from(i),n=e.createRange(e.createPositionBefore(o[0]),e.createPositionAfter(o[o.length-1]));return{target:e.domConverter.viewRangeToDom(n)}}}return{target:()=>{let i=this._getSelectedLinkElement();return i?e.domConverter.mapViewToDom(i):e.domConverter.viewRangeToDom(t.selection.getFirstRange())}}}_getSelectedLinkElement(){let e=this.editor.editing.view,t=e.document.selection,i=t.getSelectedElement();if(t.isCollapsed||i&&z(i))return Bh(t.getFirstPosition());{let o=t.getFirstRange().getTrimmed(),n=Bh(o.start),s=Bh(o.end);return!n||n!=s?null:e.createRangeIn(n).getTrimmed().isEqual(o)?n:null}}_getSelectedLinkableText(){let e=this.editor.model,t=this.editor.editing,i=this._getSelectedLinkElement();if(!i)return Dh(e.document.selection.getFirstRange());let o=t.view.createRangeOn(i),n=t.mapper.toModelRange(o);return Dh(n)}_getLinkProviderLinkByHref(e){if(!e)return null;for(let t of this._linksProviders){let i=t.getItem?t.getItem(e):t.getListItems().find(o=>o.href===e);if(i)return{provider:t,item:i}}return null}_showFakeVisualSelection(){let e=this.editor.model;e.change(t=>{let i=e.document.selection.getFirstRange();if(e.markers.has(ei))t.updateMarker(ei,{range:i});else if(i.start.isAtEnd){let o=i.start.getLastMatchingPosition(({item:n})=>!e.schema.isContent(n),{boundaries:i});t.addMarker(ei,{usingOperation:!1,affectsData:!1,range:t.createRange(o,i.end)})}else t.addMarker(ei,{usingOperation:!1,affectsData:!1,range:i})})}_hideFakeVisualSelection(){let e=this.editor.model;e.markers.has(ei)&&e.change(t=>{t.removeMarker(ei)})}};function Bh(e){return e.getAncestors().find(t=>gS(t))||null}function NS(e){let t=e.t,i=e.config.get("link.allowCreatingEmptyLinks");return[o=>{if(!i&&!o.url.length)return t("Link URL must not be empty.")}]}/** +*/var ii="link-ui",zS=class extends w{toolbarView=null;formView=null;linkProviderItemsView=null;propertiesView=null;_balloon;_linksProviders=new G;static get requires(){return[re,sc]}static get pluginName(){return"LinkUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=this.editor.t;this.set("selectedLinkableText",void 0),e.editing.view.addObserver(cl),this._balloon=e.plugins.get(re),this._registerComponents(),this._registerEditingOpeners(),this._enableBalloonActivators(),e.conversion.for("editingDowncast").markerToHighlight({model:ii,view:{classes:["ck-fake-link-selection"]}}),e.conversion.for("editingDowncast").markerToElement({model:ii,view:(i,{writer:o})=>{if(!i.markerRange.isCollapsed)return null;let n=o.createUIElement("span");return o.addClass(["ck-fake-link-selection","ck-fake-link-selection_collapsed"],n),n}}),e.accessibility.addKeystrokeInfos({keystrokes:[{label:t("Create link"),keystroke:nc},{label:t("Move out of a link"),keystroke:[["arrowleft","arrowleft"],["arrowright","arrowright"]]}]})}destroy(){super.destroy(),this.propertiesView&&this.propertiesView.destroy(),this.formView&&this.formView.destroy(),this.toolbarView&&this.toolbarView.destroy(),this.linkProviderItemsView&&this.linkProviderItemsView.destroy()}registerLinksListProvider(e){let t=this._linksProviders.filter(i=>(i.order||0)<=(e.order||0)).length;this._linksProviders.add(e,t)}_createViews(){let e=this.editor.commands.get("link");this.toolbarView=this._createToolbarView(),this.formView=this._createFormView(),e.manualDecorators.length&&(this.propertiesView=this._createPropertiesView()),this._enableUserBalloonInteractions()}_createToolbarView(){let e=this.editor,t=new dt(e.locale),i=e.commands.get("link");t.class="ck-link-toolbar";let o=e.config.get("link.toolbar");return i.manualDecorators.length||(o=o.filter(n=>n!=="linkProperties")),t.fillFromConfig(o,e.ui.componentFactory),t.keystrokes.set("Esc",(n,s)=>{this._hideUI(),s()}),t.keystrokes.set(nc,(n,s)=>{this._addFormView(),s()}),e.ui.addToolbar(t,{isContextual:!0,beforeFocus:()=>{this._getSelectedLinkElement()&&!this._isToolbarVisible&&this._showUI(!0)},afterBlur:()=>{this._hideUI(!1)}}),t}_createFormView(){let e=this.editor,t=e.locale.t,i=e.commands.get("link"),o=e.config.get("link.defaultProtocol"),n=new(Kn(OS))(e.locale,HS(e));return n.displayedTextInputView.bind("isEnabled").to(this,"selectedLinkableText",s=>s!==void 0),n.urlInputView.bind("isEnabled").to(i,"isEnabled"),n.saveButtonView.bind("isEnabled").to(i,"isEnabled"),n.saveButtonView.bind("label").to(i,"value",s=>t(s?"Update":"Insert")),this.listenTo(n,"submit",()=>{if(n.isValid()){let s=n.urlInputView.fieldView.element.value,r=Hh(s,o),a=n.displayedTextInputView.fieldView.element.value;e.execute("link",r,this._getDecoratorSwitchesState(),a!==this.selectedLinkableText?a:void 0),this._closeFormView()}}),this.listenTo(n.urlInputView,"change:errorText",()=>{e.ui.update()}),this.listenTo(n,"cancel",()=>{this._closeFormView()}),n.keystrokes.set("Esc",(s,r)=>{this._closeFormView(),r()}),n.providersListChildren.bindTo(this._linksProviders).using(s=>this._createLinksListProviderButton(s)),n.manualDecoratorsButtonView.isVisible=i.manualDecorators.length>0,this.listenTo(n,"showDecorators",()=>{this._addPropertiesView()}),n}_createLinkProviderListView(e){return e.getListItems().map(({href:t,label:i,icon:o})=>{let n=new I;return n.set({label:i,icon:o,tooltip:!1,withText:!0}),n.on("execute",()=>{this.formView.resetFormStatus(),this.formView.urlInputView.fieldView.value=t,this.editor.editing.view.focus(),this._removeLinksProviderView(),this.formView.focus()}),n})}_createLinkProviderItemsView(e){let t=this.editor,i=t.locale.t,o=new DS(t.locale),{emptyListPlaceholder:n,label:s}=e;return o.emptyListPlaceholder=n||i("No links available"),o.title=s,this.listenTo(o,"cancel",()=>{t.editing.view.focus(),this._removeLinksProviderView(),this.formView.focus()}),o}_createPropertiesView(){let e=this.editor,t=this.editor.commands.get("link"),i=new(Kn(FS))(e.locale);return this.listenTo(i,"back",()=>{this._isFormInPanel?(this._removePropertiesView(),this.formView.focus()):(e.editing.view.focus(),this._removePropertiesView())}),i.listChildren.bindTo(t.manualDecorators).using(o=>{let n=new So(e.locale);return n.set({label:o.label,withText:!0}),n.bind("isOn").toMany([o,t],"value",(s,r)=>r===void 0&&s===void 0?!!o.defaultValue:!!s),n.on("execute",()=>{let s=!n.isOn;t.value!==void 0?e.execute("link",t.value,{...this._getDecoratorSwitchesState(),[o.id]:s}):this._togglePendingManualDecorator(o,s)}),n}),i}_getDecoratorSwitchesState(){let e=this.editor.commands.get("link");return Array.from(e.manualDecorators).reduce((t,i)=>{let o=e.value===void 0&&i.value===void 0?i.defaultValue:i.value;return{...t,[i.id]:!!o}},{})}_togglePendingManualDecorator(e,t){let i=this.editor.commands.get("link"),o=Array.from(i.manualDecorators),n=this._getDecoratorSwitchesState(),s=o.map(a=>({id:a.id,attributes:a.attributes,styles:a.styles,value:n[a.id]}));n[e.id]=t;let r=Dy({decoratorStates:n,allDecorators:s});for(let a of o)a.value=r[a.id]}_resetPendingManualDecoratorsState(){let e=this.editor.commands.get("link");for(let t of e.manualDecorators)t.value=void 0}_registerEditingOpeners(){this.editor.plugins.get(sc)._registerLinkOpener(e=>{let t=this._getLinkProviderLinkByHref(e);if(!t)return!1;let{item:i,provider:o}=t;return o.navigate?o.navigate(i):!1})}_registerComponents(){let e=this.editor;e.ui.componentFactory.add("link",()=>{let t=this._createButton(I);return t.set({tooltip:!0}),t}),e.ui.componentFactory.add("menuBar:link",()=>{let t=this._createButton(oe);return t.set({role:"menuitemcheckbox"}),t}),e.ui.componentFactory.add("linkPreview",t=>{let i=new BS(t),o=e.config.get("link.allowedProtocols"),n=e.commands.get("link"),s=t.t;i.bind("isEnabled").to(n,"value",a=>!!a),i.bind("href").to(n,"value",a=>a&&By(a,o));let r=a=>{if(a===""){i.label=s("This link has no URL"),i.icon=void 0,i.tooltip=!1;return}if(!a){i.label=void 0,i.icon=void 0,i.tooltip=s("Open link in new tab");return}let l=this._getLinkProviderLinkByHref(a);if(l){let{label:c,tooltip:u,icon:d}=l.item;i.label=c,i.tooltip=u||!1,i.icon=d}else i.label=a,i.icon=void 0,i.tooltip=s("Open link in new tab")};return r(n.value),this.listenTo(n,"change:value",(a,l,c)=>{r(c)}),this.listenTo(i,"navigate",(a,l,c)=>{let u=this._getLinkProviderLinkByHref(l);if(!u)return;let{provider:d,item:h}=u,{navigate:f}=d;f&&f(h)&&(a.stop(),c())}),i}),e.ui.componentFactory.add("unlink",t=>{let i=e.commands.get("unlink"),o=new I(t),n=t.t;return o.set({label:n("Unlink"),icon:yb,tooltip:!0}),o.bind("isEnabled").to(i),this.listenTo(o,"execute",()=>{e.execute("unlink"),this._hideUI()}),o}),e.ui.componentFactory.add("editLink",t=>{let i=e.commands.get("link"),o=new I(t),n=t.t;return o.set({label:n("Edit link"),icon:ob,tooltip:!0}),o.bind("isEnabled").to(i),this.listenTo(o,"execute",()=>{this._addFormView()}),o}),e.ui.componentFactory.add("linkProperties",t=>{let i=e.commands.get("link"),o=new I(t),n=t.t;return o.set({label:n("Link properties"),icon:qd,tooltip:!0}),o.bind("isEnabled").to(i,"isEnabled",i,"value",i,"manualDecorators",(s,r,a)=>s&&r!==void 0&&a.length>0),this.listenTo(o,"execute",()=>{this._addPropertiesView()}),o})}_createLinksListProviderButton(e){let t=this.editor.locale,i=new NS(t);return i.set({label:e.label}),this.listenTo(i,"execute",()=>{this._showLinksProviderView(e)}),i}_createButton(e){let t=this.editor,i=t.locale,o=t.commands.get("link"),n=new e(t.locale),s=i.t;return n.set({label:s("Link"),icon:G1,keystroke:nc,isToggleable:!0}),n.bind("isEnabled").to(o,"isEnabled"),n.bind("isOn").to(o,"value",r=>!!r),this.listenTo(n,"execute",()=>{t.editing.view.scrollToTheSelection(),this._showUI(!0),this._getSelectedLinkElement()&&this._addFormView()}),n}_enableBalloonActivators(){let e=this.editor,t=e.editing.view.document;this.listenTo(t,"click",()=>{this._getSelectedLinkElement()&&this._showUI()}),e.keystrokes.set(nc,(i,o)=>{o(),e.commands.get("link").isEnabled&&(e.editing.view.scrollToTheSelection(),this._showUI(!0))})}_enableUserBalloonInteractions(){this.editor.keystrokes.set("Tab",(e,t)=>{this._isToolbarVisible&&!this.toolbarView.focusTracker.isFocused&&(this.toolbarView.focus(),t())},{priority:"high"}),this.editor.keystrokes.set("Esc",(e,t)=>{this._isUIVisible&&(this._hideUI(),t())}),kt({emitter:this.formView,activator:()=>this._isUIInPanel,contextElements:()=>[this._balloon.view.element],callback:()=>{this._hideUI(!1)}})}_addToolbarView(){this.toolbarView||this._createViews(),!this._isToolbarInPanel&&this._balloon.add({view:this.toolbarView,position:this._getBalloonPositionData(),balloonClassName:"ck-toolbar-container"})}_addFormView(){if(this.formView||this._createViews(),this._isFormInPanel)return;let e=this.editor.commands.get("link");this.formView.disableCssTransitions(),this.formView.resetFormStatus(),this.formView.backButtonView.isVisible=e.isEnabled&&e.value!==void 0,this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this.selectedLinkableText=this._getSelectedLinkableText(),this.formView.displayedTextInputView.fieldView.value=this.selectedLinkableText||"",this.formView.urlInputView.fieldView.value=e.value||"",this._balloon.visibleView===this.formView&&this.formView.urlInputView.fieldView.select(),this.formView.enableCssTransitions()}_addPropertiesView(){this.propertiesView||this._createViews(),!this._arePropertiesInPanel&&(this.propertiesView.disableCssTransitions(),this._balloon.add({view:this.propertiesView,position:this._getBalloonPositionData()}),this.propertiesView.enableCssTransitions(),this.propertiesView.focus())}_showLinksProviderView(e){this.linkProviderItemsView&&this._removeLinksProviderView(),this.linkProviderItemsView=this._createLinkProviderItemsView(e),this._addLinkProviderItemsView(e)}_addLinkProviderItemsView(e){this.linkProviderItemsView.listChildren.clear(),this.linkProviderItemsView.listChildren.addMany(this._createLinkProviderListView(e)),this._balloon.add({view:this.linkProviderItemsView,position:this._getBalloonPositionData()}),this.linkProviderItemsView.focus()}_closeFormView(){let e=this.editor.commands.get("link");this.selectedLinkableText=void 0,e.value!==void 0?this._removeFormView():this._hideUI()}_removePropertiesView(){this._arePropertiesInPanel&&this._balloon.remove(this.propertiesView)}_removeLinksProviderView(){this._isLinksListInPanel&&this._balloon.remove(this.linkProviderItemsView)}_removeFormView(e=!0){if(this._isFormInPanel){let t=this.editor.commands.get("link");this.formView.saveButtonView.focus(),this.formView.displayedTextInputView.fieldView.reset(),this.formView.urlInputView.fieldView.reset(),t.value===void 0&&this._resetPendingManualDecoratorsState(),this._balloon.remove(this.formView),e&&this.editor.editing.view.focus(),this._hideFakeVisualSelection()}}_showUI(e=!1){this.formView||this._createViews(),this._getSelectedLinkElement()?(this._isToolbarVisible?this._addFormView():this._addToolbarView(),e&&this._balloon.showStack("main")):(this._showFakeVisualSelection(),this._addToolbarView(),e&&this._balloon.showStack("main"),this._addFormView()),this._startUpdatingUI()}_hideUI(e=!0){let t=this.editor;this._isUIInPanel&&(this.stopListening(t.ui,"update"),this.stopListening(this._balloon,"change:visibleView"),e&&t.editing.view.focus(),this._removeLinksProviderView(),this._removePropertiesView(),this._removeFormView(e),this._isToolbarInPanel&&this._balloon.remove(this.toolbarView),this._hideFakeVisualSelection())}_startUpdatingUI(){let e=this.editor,t=e.editing.view.document,i=this._getSelectedLinkElement(),o=s(),n=()=>{let r=this._getSelectedLinkElement(),a=s();i&&!r||!i&&a!==o?this._hideUI():this._isUIVisible&&this._balloon.updatePosition(this._getBalloonPositionData()),i=r,o=a};function s(){return t.selection.focus.getAncestors().reverse().find(r=>r.is("element"))}this.listenTo(e.ui,"update",n),this.listenTo(this._balloon,"change:visibleView",n)}get _arePropertiesInPanel(){return!!this.propertiesView&&this._balloon.hasView(this.propertiesView)}get _isLinksListInPanel(){return!!this.linkProviderItemsView&&this._balloon.hasView(this.linkProviderItemsView)}get _isFormInPanel(){return!!this.formView&&this._balloon.hasView(this.formView)}get _isToolbarInPanel(){return!!this.toolbarView&&this._balloon.hasView(this.toolbarView)}get _isPropertiesVisible(){return!!this.propertiesView&&this._balloon.visibleView===this.propertiesView}get _isFormVisible(){return!!this.formView&&this._balloon.visibleView==this.formView}get _isToolbarVisible(){return!!this.toolbarView&&this._balloon.visibleView===this.toolbarView}get _isUIInPanel(){return this._arePropertiesInPanel||this._isLinksListInPanel||this._isFormInPanel||this._isToolbarInPanel}get _isUIVisible(){return this._isPropertiesVisible||this._isLinksListInPanel||this._isFormVisible||this._isToolbarVisible}_getBalloonPositionData(){let e=this.editor.editing.view,t=e.document;if(this.editor.model.markers.has(ii)){let i=this.editor.editing.mapper.markerNameToElements(ii);if(i){let o=Array.from(i),n=e.createRange(e.createPositionBefore(o[0]),e.createPositionAfter(o[o.length-1]));return{target:e.domConverter.viewRangeToDom(n)}}}return{target:()=>{let i=this._getSelectedLinkElement();return i?e.domConverter.mapViewToDom(i):e.domConverter.viewRangeToDom(t.selection.getFirstRange())}}}_getSelectedLinkElement(){let e=this.editor.editing.view,t=e.document.selection,i=t.getSelectedElement();if(t.isCollapsed||i&&z(i))return Dh(t.getFirstPosition());{let o=t.getFirstRange().getTrimmed(),n=Dh(o.start),s=Dh(o.end);return!n||n!=s?null:e.createRangeIn(n).getTrimmed().isEqual(o)?n:null}}_getSelectedLinkableText(){let e=this.editor.model,t=this.editor.editing,i=this._getSelectedLinkElement();if(!i)return Nh(e.document.selection.getFirstRange());let o=t.view.createRangeOn(i),n=t.mapper.toModelRange(o);return Nh(n)}_getLinkProviderLinkByHref(e){if(!e)return null;for(let t of this._linksProviders){let i=t.getItem?t.getItem(e):t.getListItems().find(o=>o.href===e);if(i)return{provider:t,item:i}}return null}_showFakeVisualSelection(){let e=this.editor.model;e.change(t=>{let i=e.document.selection.getFirstRange();if(e.markers.has(ii))t.updateMarker(ii,{range:i});else if(i.start.isAtEnd){let o=i.start.getLastMatchingPosition(({item:n})=>!e.schema.isContent(n),{boundaries:i});t.addMarker(ii,{usingOperation:!1,affectsData:!1,range:t.createRange(o,i.end)})}else t.addMarker(ii,{usingOperation:!1,affectsData:!1,range:i})})}_hideFakeVisualSelection(){let e=this.editor.model;e.markers.has(ii)&&e.change(t=>{t.removeMarker(ii)})}};function Dh(e){return e.getAncestors().find(t=>bS(t))||null}function HS(e){let t=e.t,i=e.config.get("link.allowCreatingEmptyLinks");return[o=>{if(!i&&!o.url.length)return t("Link URL must not be empty.")}]}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var zS=4,Dy=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63}))|localhost)(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i"),HS=2,WS=class extends y{static get requires(){return[ht,oc]}static get pluginName(){return"AutoLink"}static get isOfficialPlugin(){return!0}init(){let e=this.editor.model.document.selection;e.on("change:range",()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling(),this._enablePasteLinking()}_expandLinkRange(e,t){return t.textNode&&t.textNode.hasAttribute("linkHref")?kr(t,"linkHref",t.textNode.getAttribute("linkHref"),e):null}_selectEntireLinks(e,t){let i=this.editor.model,o=i.document.selection,n=o.getFirstPosition(),s=o.getLastPosition(),r=t.getJoined(this._expandLinkRange(i,n)||t);r&&(r=r.getJoined(this._expandLinkRange(i,s)||t)),r&&(r.start.isBefore(n)||r.end.isAfter(s))&&e.setSelection(r)}_enablePasteLinking(){let e=this.editor,t=e.model,i=t.document.selection,o=e.plugins.get("ClipboardPipeline"),n=e.commands.get("link");o.on("inputTransformation",(s,r)=>{if(!this.isEnabled||!n.isEnabled||i.isCollapsed||r.method!=="paste"||i.rangeCount>1)return;let a=i.getFirstRange(),l=r.dataTransfer.getData("text/plain");if(!l)return;let c=l.match(Dy);c&&c[2]===l&&(t.change(u=>{this._selectEntireLinks(u,a),n.execute(l)}),s.stop())},{priority:"high"})}_enableTypingHandling(){let e=this.editor,t=new Fl(e.model,i=>{let o=i;if(!US(o))return;o=o.slice(0,-1),"!.:,;?".includes(o[o.length-1])&&(o=o.slice(0,-1));let n=Ly(o);if(n)return{url:n,removedTrailingCharacters:i.length-o.length}});t.on("matched:data",(i,o)=>{let{batch:n,range:s,url:r,removedTrailingCharacters:a}=o;if(!n.isTyping)return;let l=s.end.getShiftedBy(-a),c=l.getShiftedBy(-r.length),u=e.model.createRange(c,l);this._applyAutoLink(r,u)}),t.bind("isEnabled").to(this)}_enableEnterHandling(){let e=this.editor,t=e.model,i=e.commands.get("enter");i&&i.on("execute",()=>{let o=t.document.selection.getFirstPosition(),n;o.parent.previousSibling?.is("element")?n=t.createRangeIn(o.parent.previousSibling):n=t.createRange(t.createPositionAt(o.parent,0),o),this._checkAndApplyAutoLinkOnRange(n)})}_enableShiftEnterHandling(){let e=this.editor,t=e.model,i=e.commands.get("shiftEnter");i&&i.on("execute",()=>{let o=t.document.selection.getFirstPosition(),n=t.createRange(t.createPositionAt(o.parent,0),o.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(n)})}_checkAndApplyAutoLinkOnRange(e){let t=this.editor.model,{text:i,range:o}=_h(e,t),n=Ly(i);if(n){let s=t.createRange(o.end.getShiftedBy(-n.length),o.end);this._applyAutoLink(n,s)}}_applyAutoLink(e,t){let i=this.editor.model,o=this.editor.config.get("link.defaultProtocol"),n=Nh(e,o);!this.isEnabled||!qS(t,i)||!By(n)||$S(t)||this._persistAutoLink(n,t)}_persistAutoLink(e,t){let i=this.editor.model,o=this.editor.plugins.get("Delete");i.enqueueChange(n=>{n.setAttribute("linkHref",e,t),i.enqueueChange(()=>{o.requestUndoOnBackspace()})})}};function US(e){return e.length>zS&&e[e.length-1]===" "&&e[e.length-2]!==" "}function Ly(e){let t=Dy.exec(e);return t?t[HS]:null}function qS(e,t){return t.schema.checkAttributeInSelection(t.createSelection(e),"linkHref")}function $S(e){let t=e.start.nodeAfter;return!!t&&t.hasAttribute("linkHref")}/** +*/var WS=4,Fy=new RegExp("(^|\\s)(((?:(?:(?:https?|ftp):)?\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(((?!www\\.)|(www\\.))(?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.)+(?:[a-z\\u00a1-\\uffff]{2,63}))|localhost)(?::\\d{2,5})?(?:[/?#]\\S*)?)|((www.|(\\S+@))((?![-_])(?:[-_a-z0-9\\u00a1-\\uffff]{1,63}\\.))+(?:[a-z\\u00a1-\\uffff]{2,63})))$","i"),US=2,qS=class extends w{static get requires(){return[ft,sc]}static get pluginName(){return"AutoLink"}static get isOfficialPlugin(){return!0}init(){let e=this.editor.model.document.selection;e.on("change:range",()=>{this.isEnabled=!e.anchor.parent.is("element","codeBlock")}),this._enableTypingHandling()}afterInit(){this._enableEnterHandling(),this._enableShiftEnterHandling(),this._enablePasteLinking()}_expandLinkRange(e,t){return t.textNode&&t.textNode.hasAttribute("linkHref")?kr(t,"linkHref",t.textNode.getAttribute("linkHref"),e):null}_selectEntireLinks(e,t){let i=this.editor.model,o=i.document.selection,n=o.getFirstPosition(),s=o.getLastPosition(),r=t.getJoined(this._expandLinkRange(i,n)||t);r&&(r=r.getJoined(this._expandLinkRange(i,s)||t)),r&&(r.start.isBefore(n)||r.end.isAfter(s))&&e.setSelection(r)}_enablePasteLinking(){let e=this.editor,t=e.model,i=t.document.selection,o=e.plugins.get("ClipboardPipeline"),n=e.commands.get("link");o.on("inputTransformation",(s,r)=>{if(!this.isEnabled||!n.isEnabled||i.isCollapsed||r.method!=="paste"||i.rangeCount>1)return;let a=i.getFirstRange(),l=r.dataTransfer.getData("text/plain");if(!l)return;let c=l.match(Fy);c&&c[2]===l&&(t.change(u=>{this._selectEntireLinks(u,a),n.execute(l)}),s.stop())},{priority:"high"})}_enableTypingHandling(){let e=this.editor,t=new Nl(e.model,i=>{let o=i;if(!$S(o))return;o=o.slice(0,-1),"!.:,;?".includes(o[o.length-1])&&(o=o.slice(0,-1));let n=My(o);if(n)return{url:n,removedTrailingCharacters:i.length-o.length}});t.on("matched:data",(i,o)=>{let{batch:n,range:s,url:r,removedTrailingCharacters:a}=o;if(!n.isTyping)return;let l=s.end.getShiftedBy(-a),c=l.getShiftedBy(-r.length),u=e.model.createRange(c,l);this._applyAutoLink(r,u)}),t.bind("isEnabled").to(this)}_enableEnterHandling(){let e=this.editor,t=e.model,i=e.commands.get("enter");i&&i.on("execute",()=>{let o=t.document.selection.getFirstPosition(),n;o.parent.previousSibling?.is("element")?n=t.createRangeIn(o.parent.previousSibling):n=t.createRange(t.createPositionAt(o.parent,0),o),this._checkAndApplyAutoLinkOnRange(n)})}_enableShiftEnterHandling(){let e=this.editor,t=e.model,i=e.commands.get("shiftEnter");i&&i.on("execute",()=>{let o=t.document.selection.getFirstPosition(),n=t.createRange(t.createPositionAt(o.parent,0),o.getShiftedBy(-1));this._checkAndApplyAutoLinkOnRange(n)})}_checkAndApplyAutoLinkOnRange(e){let t=this.editor.model,{text:i,range:o}=kh(e,t),n=My(i);if(n){let s=t.createRange(o.end.getShiftedBy(-n.length),o.end);this._applyAutoLink(n,s)}}_applyAutoLink(e,t){let i=this.editor.model,o=this.editor.config.get("link.defaultProtocol"),n=Hh(e,o);!this.isEnabled||!jS(t,i)||!Oy(n)||KS(t)||this._persistAutoLink(n,t)}_persistAutoLink(e,t){let i=this.editor.model,o=this.editor.plugins.get("Delete");i.enqueueChange(n=>{n.setAttribute("linkHref",e,t),i.enqueueChange(()=>{o.requestUndoOnBackspace()})})}};function $S(e){return e.length>WS&&e[e.length-1]===" "&&e[e.length-2]!==" "}function My(e){let t=Fy.exec(e);return t?t[US]:null}function jS(e,t){return t.schema.checkAttributeInSelection(t.createSelection(e),"linkHref")}function KS(e){let t=e.start.nodeAfter;return!!t&&t.hasAttribute("linkHref")}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Fy=class extends y{static get requires(){return[oc,FS,WS]}static get pluginName(){return"Link"}static get isOfficialPlugin(){return!0}};/** +*/var Ny=class extends w{static get requires(){return[sc,zS,qS]}static get pluginName(){return"Link"}static get isOfficialPlugin(){return!0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -1735,7 +1735,7 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Hh(e){return e.map(t=>jS(t)).filter(t=>t!==void 0)}var Ny={get tiny(){return{title:"Tiny",model:"tiny",view:{name:"span",classes:"text-tiny",priority:7}}},get small(){return{title:"Small",model:"small",view:{name:"span",classes:"text-small",priority:7}}},get big(){return{title:"Big",model:"big",view:{name:"span",classes:"text-big",priority:7}}},get huge(){return{title:"Huge",model:"huge",view:{name:"span",classes:"text-huge",priority:7}}}};function jS(e){if(typeof e=="number"&&(e=String(e)),typeof e=="object"&&JS(e))return zh(e);let t=GS(e);if(t)return zh(t);if(e==="default")return{model:void 0,title:"Default"};if(!ZS(e))return KS(e)}function KS(e){return typeof e=="string"&&(e={title:e,model:`${parseFloat(e)}px`}),e.view={name:"span",styles:{"font-size":e.model}},zh(e)}function zh(e){return e.view&&typeof e.view!="string"&&!e.view.priority&&(e.view.priority=7),e}function GS(e){return typeof e=="string"?Ny[e]:Ny[e.model]}function JS(e){return e.title&&e.model&&e.view}function ZS(e){let t;if(typeof e=="object")if(e.model)t=parseFloat(e.model);else throw new p("font-size-invalid-definition",null,e);else t=parseFloat(e);return isNaN(t)}/** +*/function Uh(e){return e.map(t=>GS(t)).filter(t=>t!==void 0)}var zy={get tiny(){return{title:"Tiny",model:"tiny",view:{name:"span",classes:"text-tiny",priority:7}}},get small(){return{title:"Small",model:"small",view:{name:"span",classes:"text-small",priority:7}}},get big(){return{title:"Big",model:"big",view:{name:"span",classes:"text-big",priority:7}}},get huge(){return{title:"Huge",model:"huge",view:{name:"span",classes:"text-huge",priority:7}}}};function GS(e){if(typeof e=="number"&&(e=String(e)),typeof e=="object"&&QS(e))return Wh(e);let t=ZS(e);if(t)return Wh(t);if(e==="default")return{model:void 0,title:"Default"};if(!YS(e))return JS(e)}function JS(e){return typeof e=="string"&&(e={title:e,model:`${parseFloat(e)}px`}),e.view={name:"span",styles:{"font-size":e.model}},Wh(e)}function Wh(e){return e.view&&typeof e.view!="string"&&!e.view.priority&&(e.view.priority=7),e}function ZS(e){return typeof e=="string"?zy[e]:zy[e.model]}function QS(e){return e.title&&e.model&&e.view}function YS(e){let t;if(typeof e=="object")if(e.model)t=parseFloat(e.model);else throw new p("font-size-invalid-definition",null,e);else t=parseFloat(e);return isNaN(t)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -1783,70 +1783,70 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Tt=class{_startElement;_referenceIndent;_isForward;_includeSelf;_sameAttributes;_sameIndent;_lowerIndent;_higherIndent;constructor(e,t){this._startElement=e,this._referenceIndent=e.getAttribute("listIndent"),this._isForward=t.direction=="forward",this._includeSelf=!!t.includeSelf,this._sameAttributes=j(t.sameAttributes||[]),this._sameIndent=!!t.sameIndent,this._lowerIndent=!!t.lowerIndent,this._higherIndent=!!t.higherIndent}static first(e,t){let i=new this(e,t)[Symbol.iterator]();return G(i)}*[Symbol.iterator](){let e=[];for(let{node:t}of new Fr(this._getStartNode(),this._isForward?"forward":"backward")){let i=t.getAttribute("listIndent");if(ithis._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){e.push(t);continue}}else{if(!this._sameIndent){if(this._higherIndent){e.length&&(yield*e,e.length=0);break}continue}if(this._sameAttributes.some(o=>t.getAttribute(o)!==this._startElement.getAttribute(o)))break}e.length&&(yield*e,e.length=0),yield t}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}},Fr=class{_node;_isForward;_previousNodesByIndent=[];_previous=null;_previousNodeIndent=null;constructor(e,t="forward"){this._node=e,this._isForward=t==="forward"}[Symbol.iterator](){return this}next(){if(!K(this._node))return{done:!0,value:void 0};let e=this._node.getAttribute("listIndent"),t=null;if(this._previous){let o=this._previousNodeIndent;e>o?this._previousNodesByIndent[o]=this._previous:ethis._referenceIndent){if(!this._higherIndent)continue;if(!this._isForward){e.push(t);continue}}else{if(!this._sameIndent){if(this._higherIndent){e.length&&(yield*e,e.length=0);break}continue}if(this._sameAttributes.some(o=>t.getAttribute(o)!==this._startElement.getAttribute(o)))break}e.length&&(yield*e,e.length=0),yield t}}_getStartNode(){return this._includeSelf?this._startElement:this._isForward?this._startElement.nextSibling:this._startElement.previousSibling}},Fr=class{_node;_isForward;_previousNodesByIndent=[];_previous=null;_previousNodeIndent=null;constructor(e,t="forward"){this._node=e,this._isForward=t==="forward"}[Symbol.iterator](){return this}next(){if(!K(this._node))return{done:!0,value:void 0};let e=this._node.getAttribute("listIndent"),t=null;if(this._previous){let o=this._previousNodeIndent;e>o?this._previousNodesByIndent[o]=this._previous:ea.getAttribute("listIndent"))),r=new Map;for(let a of o)r.set(a,Tt.first(a,{lowerIndent:!0}));for(let a of o){if(n.has(a))continue;n.add(a);let l=a.getAttribute("listIndent")-1;if(l<0){rc(a,t,i);continue}if(a.getAttribute("listIndent")==s&&r.get(a)){let c=nP(a,r.get(a),t);for(let u of c)n.add(u);if(c.length)continue}t.setAttribute("listIndent",l,a)}return Lo(n)}function rc(e,t,i){e=j(e);for(let o of e)o.is("element","listItem")&&t.rename(o,"paragraph");for(let o of e)for(let n of o.getAttributeKeys())i.includes(n)&&t.removeAttribute(n,o);return e}function Or(e){if(!e.length)return!1;let t=e[0].getAttribute("listItemId");return t?!e.some(i=>i.getAttribute("listItemId")!=t):!1}function tP(e,t){let i=[],o=Number.POSITIVE_INFINITY;for(let{node:n}of new Fr(e.nextSibling)){let s=n.getAttribute("listIndent");if(s==0)break;st.root.rootName!=="$graveyard").sort((t,i)=>t.index-i.index)}function Dr(e){let t=e.document.selection.getSelectedElement();return t&&e.schema.isObject(t)&&e.schema.isBlock(t)?t:null}function Wh(e,t){return t.checkChild(e.parent,"listItem")&&t.checkChild(e,"$text")&&!t.isObject(e)}function iP(e){return e=="numbered"||e=="customNumbered"}function oP(e){let t=e.getAttribute("listIndent"),i=e.getAttribute("listType"),o=e.getAttribute("listItemId"),n=e.previousSibling,s=!1;for(;K(n);){let r=n.getAttribute("listIndent");if(re.index?qh(e,t,i):[]}/** +*/var ds=class{static next(){return ne()}};function K(e){return!!e&&e.is("element")&&e.hasAttribute("listItemId")}function Ii(e,t={}){return[...eo(e,{...t,direction:"backward"}),...eo(e,{...t,direction:"forward"})]}function eo(e,t={}){let i=t.direction=="forward",o=Array.from(new Et(e,{...t,includeSelf:i,sameIndent:!0,sameAttributes:"listItemId"}));return i?o:o.reverse()}function eP(e){return Array.from(new Et(e,{direction:"forward",higherIndent:!0}))}function t_(e,t){let i=new Et(e,{sameIndent:!0,sameAttributes:"listType",...t}),o=new Et(e,{sameIndent:!0,sameAttributes:"listType",includeSelf:!0,direction:"forward",...t});return[...Array.from(i).reverse(),...o]}function oi(e){return!Et.first(e,{sameIndent:!0,sameAttributes:"listItemId"})}function Hy(e){return!Et.first(e,{direction:"forward",sameIndent:!0,sameAttributes:"listItemId"})}function Nr(e,t={}){e=j(e);let i=t.withNested!==!1,o=new Set;for(let n of e)for(let s of Ii(n,{higherIndent:i}))o.add(s);return Lo(o)}function tP(e){e=j(e);let t=new Set;for(let i of e)for(let o of t_(i))t.add(o);return Lo(t)}function Zh(e,t){let i=eo(e,{direction:"forward"}),o=ds.next();for(let n of i)t.setAttribute("listItemId",o,n);return i}function jh(e,t,i){let o={};for(let[s,r]of t.getAttributes())s.startsWith("list")&&(o[s]=r);let n=eo(e,{direction:"forward"});for(let s of n)i.setAttributes(o,s);return n}function Kh(e,t,{expand:i,indentBy:o=1,attributeNames:n}){e=j(e);let s=i?Nr(e):e;for(let r of s){let a=r.getAttribute("listIndent")+o;a<0?lc(r,t,n):t.setAttribute("listIndent",a,r)}return s}function iP(e,t,{attributeNames:i}){e=j(e);let o=Nr(e),n=new Set,s=Math.min(...o.map(a=>a.getAttribute("listIndent"))),r=new Map;for(let a of o)r.set(a,Et.first(a,{lowerIndent:!0}));for(let a of o){if(n.has(a))continue;n.add(a);let l=a.getAttribute("listIndent")-1;if(l<0){lc(a,t,i);continue}if(a.getAttribute("listIndent")==s&&r.get(a)){let c=rP(a,r.get(a),t);for(let u of c)n.add(u);if(c.length)continue}t.setAttribute("listIndent",l,a)}return Lo(n)}function lc(e,t,i){e=j(e);for(let o of e)o.is("element","listItem")&&t.rename(o,"paragraph");for(let o of e)for(let n of o.getAttributeKeys())i.includes(n)&&t.removeAttribute(n,o);return e}function Or(e){if(!e.length)return!1;let t=e[0].getAttribute("listItemId");return t?!e.some(i=>i.getAttribute("listItemId")!=t):!1}function oP(e,t){let i=[],o=Number.POSITIVE_INFINITY;for(let{node:n}of new Fr(e.nextSibling)){let s=n.getAttribute("listIndent");if(s==0)break;st.root.rootName!=="$graveyard").sort((t,i)=>t.index-i.index)}function Dr(e){let t=e.document.selection.getSelectedElement();return t&&e.schema.isObject(t)&&e.schema.isBlock(t)?t:null}function qh(e,t){return t.checkChild(e.parent,"listItem")&&t.checkChild(e,"$text")&&!t.isObject(e)}function nP(e){return e=="numbered"||e=="customNumbered"}function sP(e){let t=e.getAttribute("listIndent"),i=e.getAttribute("listType"),o=e.getAttribute("listItemId"),n=e.previousSibling,s=!1;for(;K(n);){let r=n.getAttribute("listIndent");if(re.index?jh(e,t,i):[]}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Hy=class extends M{_direction;constructor(e,t){super(e),this._direction=t}refresh(){this.isEnabled=this._checkEnabled()}execute(){let e=this.editor,t=e.model,i=Wy(t.document.selection),o=e.plugins.get("ListEditing").getListAttributeNames();t.change(n=>{let s=[];Or(i)&&!ti(i[0])?(this._direction=="forward"&&s.push(...$h(i,n,{attributeNames:o})),s.push(...Gh(i[0],n))):this._direction=="forward"?s.push(...$h(i,n,{expand:!0,attributeNames:o})):s.push(...eP(i,n,{attributeNames:o}));for(let r of s){if(!r.hasAttribute("listType"))continue;let a=Tt.first(r,{sameIndent:!0});a&&n.setAttribute("listType",a.getAttribute("listType"),r)}this._fireAfterExecute(s)})}_fireAfterExecute(e){this.fire("afterExecute",Lo(new Set(e)))}_checkEnabled(){let e=Wy(this.editor.model.document.selection),t=e[0];if(!t)return!1;if(this._direction=="backward"||Or(e)&&!ti(e[0])||this.editor.config.get("list.enableSkipLevelLists"))return!0;e=Nr(e),t=e[0];let i=Tt.first(t,{sameIndent:!0});return i?i.getAttribute("listType")==t.getAttribute("listType"):!1}};function Wy(e){let t=Array.from(e.getSelectedBlocks()),i=t.findIndex(o=>!K(o));return i!=-1&&(t.length=i),t}/** +*/var Wy=class extends M{_direction;constructor(e,t){super(e),this._direction=t}refresh(){this.isEnabled=this._checkEnabled()}execute(){let e=this.editor,t=e.model,i=Uy(t.document.selection),o=e.plugins.get("ListEditing").getListAttributeNames();t.change(n=>{let s=[];Or(i)&&!oi(i[0])?(this._direction=="forward"&&s.push(...Kh(i,n,{attributeNames:o})),s.push(...Zh(i[0],n))):this._direction=="forward"?s.push(...Kh(i,n,{expand:!0,attributeNames:o})):s.push(...iP(i,n,{attributeNames:o}));for(let r of s){if(!r.hasAttribute("listType"))continue;let a=Et.first(r,{sameIndent:!0});a&&n.setAttribute("listType",a.getAttribute("listType"),r)}this._fireAfterExecute(s)})}_fireAfterExecute(e){this.fire("afterExecute",Lo(new Set(e)))}_checkEnabled(){let e=Uy(this.editor.model.document.selection),t=e[0];if(!t)return!1;if(this._direction=="backward"||Or(e)&&!oi(e[0])||this.editor.config.get("list.enableSkipLevelLists"))return!0;e=Nr(e),t=e[0];let i=Et.first(t,{sameIndent:!0});return i?i.getAttribute("listType")==t.getAttribute("listType"):!1}};function Uy(e){let t=Array.from(e.getSelectedBlocks()),i=t.findIndex(o=>!K(o));return i!=-1&&(t.length=i),t}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Br=class extends M{type;_listWalkerOptions;constructor(e,t,i={}){super(e),this.type=t,this._listWalkerOptions=i.multiLevel?{higherIndent:!0,lowerIndent:!0,sameAttributes:[]}:void 0}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){let t=this.editor.model,i=t.document,o=Dr(t),n=Array.from(i.selection.getSelectedBlocks()).filter(r=>t.schema.checkAttribute(r,"listType")||Wh(r,t.schema)),s=e.forceValue!==void 0?!e.forceValue:this.value;t.change(r=>{if(s){let a=n[n.length-1],l=this.editor.plugins.get("ListEditing").getListAttributeNames(),c=Xi(a,{direction:"forward"}),u=[];c.length>1&&u.push(...Gh(c[1],r)),u.push(...rc(n,r,l)),u.push(...tP(a,r)),this._fireAfterExecute(u)}else if((o||i.selection.isCollapsed)&&K(n[0])){let a=e_(o||n[0],this._listWalkerOptions);for(let l of a)r.setAttributes({...e.additionalAttributes,listType:this.type},l);this._fireAfterExecute(a)}else{let a=[];for(let l of n)if(!l.hasAttribute("listType"))!l.is("element","listItem")&&Wh(l,t.schema)&&r.rename(l,"listItem"),r.setAttributes({...e.additionalAttributes,listIndent:0,listItemId:ds.next(),listType:this.type},l),a.push(l);else for(let c of Nr(l,{withNested:!1}))c.getAttribute("listType")!=this.type&&(r.setAttributes({...e.additionalAttributes,listType:this.type},c),a.push(c));this._fireAfterExecute(a)}})}_fireAfterExecute(e){this.fire("afterExecute",Lo(new Set(e)))}_getValue(){let e=this.editor.model.document.selection,t=Array.from(e.getSelectedBlocks());if(!t.length)return!1;for(let i of t)if(i.getAttribute("listType")!=this.type)return!1;return!0}_checkEnabled(){let e=this.editor.model,t=e.schema,i=e.document.selection,o=Array.from(i.getSelectedBlocks());if(!o.length)return!1;if(this.value)return!0;for(let n of o)if(t.checkAttribute(n,"listType")||Wh(n,t))return!0;return!1}};/** +*/var Br=class extends M{type;_listWalkerOptions;constructor(e,t,i={}){super(e),this.type=t,this._listWalkerOptions=i.multiLevel?{higherIndent:!0,lowerIndent:!0,sameAttributes:[]}:void 0}refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled()}execute(e={}){let t=this.editor.model,i=t.document,o=Dr(t),n=Array.from(i.selection.getSelectedBlocks()).filter(r=>t.schema.checkAttribute(r,"listType")||qh(r,t.schema)),s=e.forceValue!==void 0?!e.forceValue:this.value;t.change(r=>{if(s){let a=n[n.length-1],l=this.editor.plugins.get("ListEditing").getListAttributeNames(),c=eo(a,{direction:"forward"}),u=[];c.length>1&&u.push(...Zh(c[1],r)),u.push(...lc(n,r,l)),u.push(...oP(a,r)),this._fireAfterExecute(u)}else if((o||i.selection.isCollapsed)&&K(n[0])){let a=t_(o||n[0],this._listWalkerOptions);for(let l of a)r.setAttributes({...e.additionalAttributes,listType:this.type},l);this._fireAfterExecute(a)}else{let a=[];for(let l of n)if(!l.hasAttribute("listType"))!l.is("element","listItem")&&qh(l,t.schema)&&r.rename(l,"listItem"),r.setAttributes({...e.additionalAttributes,listIndent:0,listItemId:ds.next(),listType:this.type},l),a.push(l);else for(let c of Nr(l,{withNested:!1}))c.getAttribute("listType")!=this.type&&(r.setAttributes({...e.additionalAttributes,listType:this.type},c),a.push(c));this._fireAfterExecute(a)}})}_fireAfterExecute(e){this.fire("afterExecute",Lo(new Set(e)))}_getValue(){let e=this.editor.model.document.selection,t=Array.from(e.getSelectedBlocks());if(!t.length)return!1;for(let i of t)if(i.getAttribute("listType")!=this.type)return!1;return!0}_checkEnabled(){let e=this.editor.model,t=e.schema,i=e.document.selection,o=Array.from(i.getSelectedBlocks());if(!o.length)return!1;if(this.value)return!0;for(let n of o)if(t.checkAttribute(n,"listType")||qh(n,t))return!0;return!1}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Uy=class extends M{_direction;constructor(e,t){super(e),this._direction=t}refresh(){this.isEnabled=this._checkEnabled()}execute({shouldMergeOnBlocksContentLevel:e=!1}={}){let t=this.editor,i=t.model,o=i.document.selection,n=[],s=t.plugins.get("ListEditing").getListAttributeNames();i.change(r=>{let{firstElement:a,lastElement:l}=this._getMergeSubjectElements(o,e);if(!a||!l)return;let c=a.getAttribute("listIndent")||0,u=l.getAttribute("listIndent"),d=l.getAttribute("listItemId");if(c!=u){let h=YS(l);n.push(...$h([l,...h],r,{indentBy:c-u,expand:c{let{firstElement:a,lastElement:l}=this._getMergeSubjectElements(o,e);if(!a||!l)return;let c=a.getAttribute("listIndent")||0,u=l.getAttribute("listIndent"),d=l.getAttribute("listItemId");if(c!=u){let h=eP(l);n.push(...Kh([l,...h],r,{indentBy:c-u,expand:c{let t=Gh(this._getStartBlock(),e);this._fireAfterExecute(t)})}_fireAfterExecute(e){this.fire("afterExecute",Lo(new Set(e)))}_checkEnabled(){let e=this.editor.model.document.selection,t=this._getStartBlock();return e.isCollapsed&&K(t)&&!ti(t)}_getStartBlock(){let e=this.editor.model.document.selection.getFirstPosition().parent;return this._direction=="before"?e:e.nextSibling}};/** +*/var $y=class extends M{_direction;constructor(e,t){super(e),this._direction=t}refresh(){this.isEnabled=this._checkEnabled()}execute(){this.editor.model.change(e=>{let t=Zh(this._getStartBlock(),e);this._fireAfterExecute(t)})}_fireAfterExecute(e){this.fire("afterExecute",Lo(new Set(e)))}_checkEnabled(){let e=this.editor.model.document.selection,t=this._getStartBlock();return e.isCollapsed&&K(t)&&!oi(t)}_getStartBlock(){let e=this.editor.model.document.selection.getFirstPosition().parent;return this._direction=="before"?e:e.nextSibling}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var sP=class extends y{static get pluginName(){return"ListItemBoldIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[ft]}init(){let e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(ft);!e.plugins.has("BoldEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.registerFormatAttribute("bold","listItemBold"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemBold",setAttributeOnDowncast(o,n,s,r){n&&(o.addClass("ck-list-marker-bold",s),V.isSafari&&!(r&&r.dataPipeline)&&o.setStyle("--ck-content-list-marker-dummy-bold","0",s))}}))}afterInit(){let e=this.editor,t=e.model;!e.plugins.has("BoldEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.schema.extend("$listItem",{allowAttributes:"listItemBold"}),t.schema.setAttributeProperties("listItemBold",{isFormatting:!0}),t.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemBold"),e.conversion.for("upcast").attributeToAttribute({model:"listItemBold",view:{name:"li",classes:"ck-list-marker-bold"}}))}};/** +*/var aP=class extends w{static get pluginName(){return"ListItemBoldIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[mt]}init(){let e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(mt);!e.plugins.has("BoldEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.registerFormatAttribute("bold","listItemBold"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemBold",setAttributeOnDowncast(o,n,s,r){n&&(o.addClass("ck-list-marker-bold",s),V.isSafari&&!(r&&r.dataPipeline)&&o.setStyle("--ck-content-list-marker-dummy-bold","0",s))}}))}afterInit(){let e=this.editor,t=e.model;!e.plugins.has("BoldEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.schema.extend("$listItem",{allowAttributes:"listItemBold"}),t.schema.setAttributeProperties("listItemBold",{isFormatting:!0}),t.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemBold"),e.conversion.for("upcast").attributeToAttribute({model:"listItemBold",view:{name:"li",classes:"ck-list-marker-bold"}}))}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var rP=class extends y{static get pluginName(){return"ListItemItalicIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[ft]}init(){let e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(ft);!e.plugins.has("ItalicEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.registerFormatAttribute("italic","listItemItalic"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemItalic",setAttributeOnDowncast(o,n,s,r){n&&(o.addClass("ck-list-marker-italic",s),V.isSafari&&!(r&&r.dataPipeline)&&o.setStyle("--ck-content-list-marker-dummy-italic","0",s))}}))}afterInit(){let e=this.editor,t=e.model;!e.plugins.has("ItalicEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.schema.extend("$listItem",{allowAttributes:"listItemItalic"}),t.schema.setAttributeProperties("listItemItalic",{isFormatting:!0}),t.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemItalic"),e.conversion.for("upcast").attributeToAttribute({model:"listItemItalic",view:{name:"li",classes:"ck-list-marker-italic"}}))}};/** +*/var lP=class extends w{static get pluginName(){return"ListItemItalicIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[mt]}init(){let e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(mt);!e.plugins.has("ItalicEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.registerFormatAttribute("italic","listItemItalic"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemItalic",setAttributeOnDowncast(o,n,s,r){n&&(o.addClass("ck-list-marker-italic",s),V.isSafari&&!(r&&r.dataPipeline)&&o.setStyle("--ck-content-list-marker-dummy-italic","0",s))}}))}afterInit(){let e=this.editor,t=e.model;!e.plugins.has("ItalicEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.schema.extend("$listItem",{allowAttributes:"listItemItalic"}),t.schema.setAttributeProperties("listItemItalic",{isFormatting:!0}),t.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemItalic"),e.conversion.for("upcast").attributeToAttribute({model:"listItemItalic",view:{name:"li",classes:"ck-list-marker-italic"}}))}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var aP=class extends y{static get pluginName(){return"ListItemFontSizeIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[ft]}init(){let e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(ft);if(!e.plugins.has("FontSizeEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting"))return;let o=Hh(e.config.get("fontSize.options"));t.registerFormatAttribute("fontSize","listItemFontSize"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontSize",setAttributeOnDowncast(n,s,r,a){if(s){let l=o.find(c=>c.model==s);l&&l.view&&typeof l.view!="string"?l.view.styles?(n.addClass("ck-list-marker-font-size",r),n.setStyle("--ck-content-list-marker-font-size",l.view.styles["font-size"],r)):l.view.classes&&(n.addClass(`ck-list-marker-font-size-${s}`,r),V.isSafari&&!(a&&a.dataPipeline)&&n.setStyle("--ck-content-list-marker-dummy-font-size","0",r)):(n.addClass("ck-list-marker-font-size",r),n.setStyle("--ck-content-list-marker-font-size",s,r))}}})}afterInit(){let e=this.editor,t=e.model;if(!e.plugins.has("FontSizeEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting"))return;t.schema.extend("$listItem",{allowAttributes:"listItemFontSize"}),t.schema.setAttributeProperties("listItemFontSize",{isFormatting:!0}),t.schema.addAttributeCheck(o=>{if(!o.last.getAttribute("listItemId"))return!1},"listItemFontSize"),e.conversion.for("upcast").elementToAttribute({model:{key:"listItemFontSize",value:o=>o.getStyle("--ck-content-list-marker-font-size")},view:{name:"li",classes:"ck-list-marker-font-size",styles:{"--ck-content-list-marker-font-size":/.*/}}});let i=Hh(e.config.get("fontSize.options"));for(let o of i)o.model&&o.view&&e.conversion.for("upcast").elementToAttribute({model:{key:"listItemFontSize",value:o.model},view:{name:"li",classes:`ck-list-marker-font-size-${o.model}`}})}};/** +*/var cP=class extends w{static get pluginName(){return"ListItemFontSizeIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[mt]}init(){let e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(mt);if(!e.plugins.has("FontSizeEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting"))return;let o=Uh(e.config.get("fontSize.options"));t.registerFormatAttribute("fontSize","listItemFontSize"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontSize",setAttributeOnDowncast(n,s,r,a){if(s){let l=o.find(c=>c.model==s);l&&l.view&&typeof l.view!="string"?l.view.styles?(n.addClass("ck-list-marker-font-size",r),n.setStyle("--ck-content-list-marker-font-size",l.view.styles["font-size"],r)):l.view.classes&&(n.addClass(`ck-list-marker-font-size-${s}`,r),V.isSafari&&!(a&&a.dataPipeline)&&n.setStyle("--ck-content-list-marker-dummy-font-size","0",r)):(n.addClass("ck-list-marker-font-size",r),n.setStyle("--ck-content-list-marker-font-size",s,r))}}})}afterInit(){let e=this.editor,t=e.model;if(!e.plugins.has("FontSizeEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting"))return;t.schema.extend("$listItem",{allowAttributes:"listItemFontSize"}),t.schema.setAttributeProperties("listItemFontSize",{isFormatting:!0}),t.schema.addAttributeCheck(o=>{if(!o.last.getAttribute("listItemId"))return!1},"listItemFontSize"),e.conversion.for("upcast").elementToAttribute({model:{key:"listItemFontSize",value:o=>o.getStyle("--ck-content-list-marker-font-size")},view:{name:"li",classes:"ck-list-marker-font-size",styles:{"--ck-content-list-marker-font-size":/.*/}}});let i=Uh(e.config.get("fontSize.options"));for(let o of i)o.model&&o.view&&e.conversion.for("upcast").elementToAttribute({model:{key:"listItemFontSize",value:o.model},view:{name:"li",classes:`ck-list-marker-font-size-${o.model}`}})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var lP=class extends y{static get pluginName(){return"ListItemFontColorIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[ft]}init(){let e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(ft);!e.plugins.has("FontColorEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.registerFormatAttribute("fontColor","listItemFontColor"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontColor",setAttributeOnDowncast(o,n,s){n&&(o.addClass("ck-list-marker-color",s),o.setStyle("--ck-content-list-marker-color",n,s))}}))}afterInit(){let e=this.editor,t=e.model;!e.plugins.has("FontColorEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.schema.extend("$listItem",{allowAttributes:"listItemFontColor"}),t.schema.setAttributeProperties("listItemFontColor",{isFormatting:!0}),t.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemFontColor"),e.conversion.for("upcast").attributeToAttribute({model:{key:"listItemFontColor",value:i=>i.getStyle("--ck-content-list-marker-color")},view:{name:"li",classes:"ck-list-marker-color",styles:{"--ck-content-list-marker-color":/.*/}}}))}};/** +*/var uP=class extends w{static get pluginName(){return"ListItemFontColorIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[mt]}init(){let e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(mt);!e.plugins.has("FontColorEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.registerFormatAttribute("fontColor","listItemFontColor"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontColor",setAttributeOnDowncast(o,n,s){n&&(o.addClass("ck-list-marker-color",s),o.setStyle("--ck-content-list-marker-color",n,s))}}))}afterInit(){let e=this.editor,t=e.model;!e.plugins.has("FontColorEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.schema.extend("$listItem",{allowAttributes:"listItemFontColor"}),t.schema.setAttributeProperties("listItemFontColor",{isFormatting:!0}),t.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemFontColor"),e.conversion.for("upcast").attributeToAttribute({model:{key:"listItemFontColor",value:i=>i.getStyle("--ck-content-list-marker-color")},view:{name:"li",classes:"ck-list-marker-color",styles:{"--ck-content-list-marker-color":/.*/}}}))}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var cP=class extends y{static get pluginName(){return"ListItemFontFamilyIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[ft]}init(){let e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(ft);!e.plugins.has("FontFamilyEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.registerFormatAttribute("fontFamily","listItemFontFamily"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontFamily",setAttributeOnDowncast(o,n,s){n&&(o.addClass("ck-list-marker-font-family",s),o.setStyle("--ck-content-list-marker-font-family",n,s))}}))}afterInit(){let e=this.editor,t=e.model;!e.plugins.has("FontFamilyEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.schema.extend("$listItem",{allowAttributes:"listItemFontFamily"}),t.schema.setAttributeProperties("listItemFontFamily",{isFormatting:!0}),t.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemFontFamily"),e.conversion.for("upcast").attributeToAttribute({model:{key:"listItemFontFamily",value:i=>i.getStyle("--ck-content-list-marker-font-family")},view:{name:"li",classes:"ck-list-marker-font-family",styles:{"--ck-content-list-marker-font-family":/.*/}}}))}};/** +*/var dP=class extends w{static get pluginName(){return"ListItemFontFamilyIntegration"}static get isOfficialPlugin(){return!0}static get requires(){return[mt]}init(){let e=this.editor,t=e.plugins.get("ListFormatting"),i=e.plugins.get(mt);!e.plugins.has("FontFamilyEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.registerFormatAttribute("fontFamily","listItemFontFamily"),i.registerDowncastStrategy({scope:"item",attributeName:"listItemFontFamily",setAttributeOnDowncast(o,n,s){n&&(o.addClass("ck-list-marker-font-family",s),o.setStyle("--ck-content-list-marker-font-family",n,s))}}))}afterInit(){let e=this.editor,t=e.model;!e.plugins.has("FontFamilyEditing")||!this.editor.config.get("list.enableListItemMarkerFormatting")||(t.schema.extend("$listItem",{allowAttributes:"listItemFontFamily"}),t.schema.setAttributeProperties("listItemFontFamily",{isFormatting:!0}),t.schema.addAttributeCheck(i=>{if(!i.last.getAttribute("listItemId"))return!1},"listItemFontFamily"),e.conversion.for("upcast").attributeToAttribute({model:{key:"listItemFontFamily",value:i=>i.getStyle("--ck-content-list-marker-font-family")},view:{name:"li",classes:"ck-list-marker-font-family",styles:{"--ck-content-list-marker-font-family":/.*/}}}))}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var uP=class extends y{_loadedFormatting={};static get pluginName(){return"ListFormatting"}static get isOfficialPlugin(){return!0}static get requires(){return[sP,rP,aP,lP,cP]}constructor(e){super(e),e.config.define("list.enableListItemMarkerFormatting",!0)}afterInit(){this.editor.config.get("list.enableListItemMarkerFormatting")&&this._registerPostfixerForListItemFormatting()}_registerPostfixerForListItemFormatting(){let e=this.editor.model;e.document.registerPostFixer(t=>{let i=e.document.differ.getChanges(),o=new Set,n=!1;for(let s of i)if(s.type==="attribute")(s.attributeKey=="listItemId"||s.attributeKey=="listType"||this._isInlineOrSelectionFormatting(s.attributeKey)||Object.values(this._loadedFormatting).includes(s.attributeKey))&&(K(s.range.start.nodeAfter)?o.add(s.range.start.nodeAfter):K(s.range.start.parent)&&o.add(s.range.start.parent));else if(K(s.position.nodeAfter)&&o.add(s.position.nodeAfter),K(s.position.nodeBefore)&&o.add(s.position.nodeBefore),K(s.position.parent)&&o.add(s.position.parent),s.type=="insert"&&s.name!="$text"){let r=t.createRangeIn(s.position.nodeAfter);for(let a of r.getItems())K(a)&&o.add(a)}for(let s of o){let r=dP(e,s,Object.keys(this._loadedFormatting));for(let[a,l]of Object.entries(r)){let c=this._loadedFormatting[a];(l&&hP(t,s,c,l)||!l&&fP(t,s,c))&&(n=!0)}}return n})}registerFormatAttribute(e,t){this._loadedFormatting[e]=t}_isInlineOrSelectionFormatting(e){return e.replace(/^selection:/,"")in this._loadedFormatting}};function dP(e,t,i){return ti(t)?$y(e,t,i):$y(e,Ei(t)[0],i)}function $y(e,t,i){if(!mP(t)||e.schema.isLimit(t))return Object.fromEntries(i.map(r=>[r]));if(t.isEmpty)return Object.fromEntries(i.map(r=>[r,t.getAttribute(`selection:${r}`)]));let o=new Set(i),n={},s=e.createRangeIn(t).getWalker({ignoreElementEnd:!0});for(let{item:r}of s){for(let a of o)if(e.schema.checkAttribute(r,a)){let l=r.getAttribute(a);l===void 0?(o.delete(a),n[a]=void 0):n[a]===void 0?n[a]=l:n[a]!==l&&(o.delete(a),n[a]=void 0)}else a in n||(n[a]=void 0);if(!o.size)break;e.schema.isLimit(r)&&s.jumpTo(e.createPositionAfter(r))}return n}function hP(e,t,i,o){let n=Ei(t),s=!1;for(let r of n)(!r.hasAttribute(i)||r.getAttribute(i)!==o)&&(e.setAttribute(i,o,r),s=!0);return s}function fP(e,t,i){let o=Ei(t),n=!1;for(let s of o)s.hasAttribute(i)&&(e.removeAttribute(i,s),n=!0);return n}function mP(e){return["numbered","bulleted","customNumbered","customBulleted"].includes(e.getAttribute("listType"))}/** +*/var hP=class extends w{_loadedFormatting={};static get pluginName(){return"ListFormatting"}static get isOfficialPlugin(){return!0}static get requires(){return[aP,lP,cP,uP,dP]}constructor(e){super(e),e.config.define("list.enableListItemMarkerFormatting",!0)}afterInit(){this.editor.config.get("list.enableListItemMarkerFormatting")&&this._registerPostfixerForListItemFormatting()}_registerPostfixerForListItemFormatting(){let e=this.editor.model;e.document.registerPostFixer(t=>{let i=e.document.differ.getChanges(),o=new Set,n=!1;for(let s of i)if(s.type==="attribute")(s.attributeKey=="listItemId"||s.attributeKey=="listType"||this._isInlineOrSelectionFormatting(s.attributeKey)||Object.values(this._loadedFormatting).includes(s.attributeKey))&&(K(s.range.start.nodeAfter)?o.add(s.range.start.nodeAfter):K(s.range.start.parent)&&o.add(s.range.start.parent));else if(K(s.position.nodeAfter)&&o.add(s.position.nodeAfter),K(s.position.nodeBefore)&&o.add(s.position.nodeBefore),K(s.position.parent)&&o.add(s.position.parent),s.type=="insert"&&s.name!="$text"){let r=t.createRangeIn(s.position.nodeAfter);for(let a of r.getItems())K(a)&&o.add(a)}for(let s of o){let r=fP(e,s,Object.keys(this._loadedFormatting));for(let[a,l]of Object.entries(r)){let c=this._loadedFormatting[a];(l&&mP(t,s,c,l)||!l&&gP(t,s,c))&&(n=!0)}}return n})}registerFormatAttribute(e,t){this._loadedFormatting[e]=t}_isInlineOrSelectionFormatting(e){return e.replace(/^selection:/,"")in this._loadedFormatting}};function fP(e,t,i){return oi(t)?jy(e,t,i):jy(e,Ii(t)[0],i)}function jy(e,t,i){if(!pP(t)||e.schema.isLimit(t))return Object.fromEntries(i.map(r=>[r]));if(t.isEmpty)return Object.fromEntries(i.map(r=>[r,t.getAttribute(`selection:${r}`)]));let o=new Set(i),n={},s=e.createRangeIn(t).getWalker({ignoreElementEnd:!0});for(let{item:r}of s){for(let a of o)if(e.schema.checkAttribute(r,a)){let l=r.getAttribute(a);l===void 0?(o.delete(a),n[a]=void 0):n[a]===void 0?n[a]=l:n[a]!==l&&(o.delete(a),n[a]=void 0)}else a in n||(n[a]=void 0);if(!o.size)break;e.schema.isLimit(r)&&s.jumpTo(e.createPositionAfter(r))}return n}function mP(e,t,i,o){let n=Ii(t),s=!1;for(let r of n)(!r.hasAttribute(i)||r.getAttribute(i)!==o)&&(e.setAttribute(i,o,r),s=!0);return s}function gP(e,t,i){let o=Ii(t),n=!1;for(let s of o)s.hasAttribute(i)&&(e.removeAttribute(i,s),n=!0);return n}function pP(e){return["numbered","bulleted","customNumbered","customBulleted"].includes(e.getAttribute("listType"))}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var gP=class extends y{static get pluginName(){return"ListUtils"}static get isOfficialPlugin(){return!0}expandListBlocksToCompleteList(e){return XS(e)}isFirstBlockOfListItem(e){return ti(e)}isListItemBlock(e){return K(e)}expandListBlocksToCompleteItems(e,t={}){return Nr(e,t)}isNumberedListType(e){return iP(e)}isFirstListItemInList(e){return oP(e)}};/** +*/var bP=class extends w{static get pluginName(){return"ListUtils"}static get isOfficialPlugin(){return!0}expandListBlocksToCompleteList(e){return tP(e)}isFirstBlockOfListItem(e){return oi(e)}isListItemBlock(e){return K(e)}expandListBlocksToCompleteItems(e,t={}){return Nr(e,t)}isNumberedListType(e){return nP(e)}isFirstListItemInList(e){return sP(e)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function pP(e){return e.is("element","ol")||e.is("element","ul")}function jh(e){return e.is("element","li")}function bP(e){let t=0,i=e.parent;for(;i;){if(jh(i))t++;else{let o=i.previousSibling;o&&jh(o)&&t++}i=i.parent}return t}function jy(e,t,i,o=i_(i,t)){return e.createAttributeElement(t_(i),null,{priority:2*t/100-100,id:o})}function Ky(e,t,i){return e.createAttributeElement("li",null,{priority:(2*t+1)/100-100,id:i})}function t_(e){return e=="numbered"||e=="customNumbered"?"ol":"ul"}function i_(e,t){return`list-${e}-${t}`}/** +*/function wP(e){return e.is("element","ol")||e.is("element","ul")}function Gh(e){return e.is("element","li")}function yP(e){let t=0,i=e.parent;for(;i;){if(Gh(i))t++;else{let o=i.previousSibling;o&&Gh(o)&&t++}i=i.parent}return t}function Ky(e,t,i,o=o_(i,t)){return e.createAttributeElement(i_(i),null,{priority:2*t/100-100,id:o})}function Gy(e,t,i){return e.createAttributeElement("li",null,{priority:(2*t+1)/100-100,id:i})}function i_(e){return e=="numbered"||e=="customNumbered"?"ol":"ul"}function o_(e,t){return`list-${e}-${t}`}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Ot(e,t,i){let o=e.nodeBefore;if(K(o)){let n=o;for(let{node:s}of new Fr(n,"backward"))if(n=s,i.has(n)||(i.add(n),t.has(o)))return;t.add(n)}else{let n=e.nodeAfter;K(n)&&t.add(n)}}function wP(e,t){let i=0,o=-1,n=null,s=!1;for(let{node:r}of e){let a=r.getAttribute("listIndent");if(a>i){let l;n===null?(n=a-i,l=i):(n>a&&(n=a),l=a-n),l>o+1&&(l=o+1),t.setAttribute("listIndent",l,r),s=!0,o=l}else n=null,i=a+1,o=a}return s}function yP(e,t,i){let o=new Set,n=!1;for(let{node:s}of e){if(o.has(s))continue;let r=s.getAttribute("listType"),a=s.getAttribute("listItemId");if(t.has(a)&&(a=ds.next()),t.add(a),s.is("element","listItem")){s.getAttribute("listItemId")!=a&&(i.setAttribute("listItemId",a,s),n=!0);continue}for(let l of Xi(s,{direction:"forward"}))o.add(l),l.getAttribute("listType")!=r&&(a=ds.next(),r=l.getAttribute("listType")),l.getAttribute("listItemId")!=a&&(i.setAttribute("listItemId",a,l),n=!0)}return n}/** +*/function Ft(e,t,i){let o=e.nodeBefore;if(K(o)){let n=o;for(let{node:s}of new Fr(n,"backward"))if(n=s,i.has(n)||(i.add(n),t.has(o)))return;t.add(n)}else{let n=e.nodeAfter;K(n)&&t.add(n)}}function _P(e,t){let i=0,o=-1,n=null,s=!1;for(let{node:r}of e){let a=r.getAttribute("listIndent");if(a>i){let l;n===null?(n=a-i,l=i):(n>a&&(n=a),l=a-n),l>o+1&&(l=o+1),t.setAttribute("listIndent",l,r),s=!0,o=l}else n=null,i=a+1,o=a}return s}function vP(e,t,i){let o=new Set,n=!1;for(let{node:s}of e){if(o.has(s))continue;let r=s.getAttribute("listType"),a=s.getAttribute("listItemId");if(t.has(a)&&(a=ds.next()),t.add(a),s.is("element","listItem")){s.getAttribute("listItemId")!=a&&(i.setAttribute("listItemId",a,s),n=!0);continue}for(let l of eo(s,{direction:"forward"}))o.add(l),l.getAttribute("listType")!=r&&(a=ds.next(),r=l.getAttribute("listType")),l.getAttribute("listItemId")!=a&&(i.setAttribute("listItemId",a,l),n=!0)}return n}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function _P(){return(e,t,i)=>{let o=t.viewItem;if(o.getStyle("list-style-type")!=="none"||!vP(o)||!i.consumable.consume(o,{name:!0}))return;let{modelRange:n,modelCursor:s}=i.convertChildren(o,t.modelCursor);t.modelRange=n,t.modelCursor=s}}function vP(e){let t=!1;for(let i of e.getChildren()){if(i.is("element","ul")||i.is("element","ol")){t=!0;continue}return!1}return t}function kP(){return(e,t,i)=>{let{writer:o,schema:n}=i;if(!t.modelRange)return;let s=Array.from(t.modelRange.getItems({shallow:!0})).filter(d=>n.checkAttribute(d,"listItemId"));if(!s.length||s.every(d=>d.hasAttribute("listItemId")))return;let r=t.viewItem.getAttribute("data-list-item-id")||ds.next();i.consumable.consume(t.viewItem,{attributes:"data-list-item-id"});let a=bP(t.viewItem),l=t.viewItem.parent&&t.viewItem.parent.is("element","ol")?"numbered":"bulleted",c=s[0].getAttribute("listType");c&&(l=c);let u={listItemId:r,listIndent:a,listType:l};for(let d of s)d.hasAttribute("listItemId")||o.setAttributes(u,d);s.length>1&&s[1].getAttribute("listItemId")!=u.listItemId&&i.keepEmptyElement(s[0])}}function CP(e,t,i,o){return()=>{let u=e.document.differ.getChanges(),d=[],h=new Set,f=new Set,m=new Set;for(let g of u)if(g.type=="insert"&&g.name!="$text")Ot(g.position,h,m),g.attributes.has("listItemId")?f.add(g.position.nodeAfter):Ot(g.position.getShiftedBy(g.length),h,m);else if(g.type=="remove"&&g.attributes.has("listItemId"))Ot(g.position,h,m);else if(g.type=="attribute"){let b=g.range.start.nodeAfter;i.includes(g.attributeKey)?(Ot(g.range.start,h,m),g.attributeNewValue===null?(Ot(g.range.start.getShiftedBy(1),h,m),a(b)&&d.push(b)):f.add(b)):K(b)&&a(b)&&d.push(b)}for(let g of h.values())d.push(...n(g,f));for(let g of new Set(d))t.reconvertItem(g)};function n(u,d){let h=[],f=new Set,m=[];for(let{node:g,previous:b}of new Fr(u)){if(f.has(g))continue;let k=g.getAttribute("listIndent");b&&ki.includes(d)))}function r(u,d,h){for(let f=d-1;f>=0&&!h[f];f--){let m=n_(u,f),g=null;if(!m){for(let k=f-1;k>=0;k--)if(h[k]){g=h[k].modelElement;break}}let b=m||g||u;h[f]={modelAttributes:{...s(b),listItemId:`list-item-skip-${f}`,listIndent:f},modelElement:b}}}function a(u,d){let h=t.mapper.toViewElement(u);if(!h)return!1;if(l(h)||o.fire("checkElement",{modelElement:u,viewElement:h}))return!0;if(!u.is("element","paragraph")&&!u.is("element","listItem"))return!1;let f=s_(u,i,d);return f&&h.is("element","p")?!0:!!(!f&&h.is("element","span"))}function l(u){for(u=u.parent;u.is("attributeElement")&&["ol","ul","li"].includes(u.name);)u=u.parent;return!!(u.getCustomProperty("$structureSlotParent")&&!t.mapper.toModelElement(u))}function c(u,d,h){if(h.has(u))return!1;let f=t.mapper.toViewElement(u),m=d.length-1;for(let g=f.parent;!g.is("editableElement");g=g.parent){let b=jh(g),k=pP(g);if(!(!k&&!b)){if(d[m]){let v=`checkAttributes:${b?"item":"list"}`;if(o.fire(v,{viewElement:g,modelAttributes:d[m].modelAttributes,modelReferenceElement:d[m].modelElement}))break}if(k&&(m--,m<0))return!1}}return!0}}function Gy(e,t,i,{dataPipeline:o,enableSkipLevelLists:n}){let s=PP(e,t);return(r,a,l)=>{let{writer:c,mapper:u,consumable:d}=l,h=a.item;if(!e.includes(a.attributeKey)||!s(h,d))return;let f={...l.options,dataPipeline:o,enableSkipLevelLists:n},m=TP(h,u,i,c);o_(m,c,u),IP(m,c),SP(h,AP(h,m,t,c,f),t,c,f)}}function xP(e){return(t,i,o)=>{let{writer:n,mapper:s}=o,r=t.name.split(":")[1];if(!e.checkAttribute(r,"listItemId"))return;let a=s.toViewPosition(i.position),l=i.position.getShiftedBy(i.length),c=s.toViewPosition(l,{isPhantom:!0}),u=n.createRange(a,c).getTrimmed().end.nodeBefore;/* istanbul ignore next -- @preserve */u&&o_(u,n,s)}}function Jy(e,{dataPipeline:t}={}){return(i,{writer:o})=>{if(!s_(i,e))return null;if(!t)return o.createContainerElement("span",{class:"ck-list-bogus-paragraph"});let n=o.createContainerElement("p");return o.setCustomProperty("dataPipeline:transparentRendering",!0,n),n}}function TP(e,t,i,o){let n=i.createRangeOn(e),s=t.toViewRange(n).getTrimmed().getWalker();for(let{item:r}of s)if(r.is("element")&&r.getCustomProperty("listItemMarker"))s.jumpTo(o.createPositionAfter(r));else if(r.is("element")&&!r.getCustomProperty("listItemWrapper"))return r}function EP(e,t){return(i,o)=>{if(o.modelPosition.offset>0)return;let n=o.modelPosition.parent;if(!K(n)||!e.some(c=>c.scope=="itemMarker"&&c.canInjectMarkerIntoElement&&c.canInjectMarkerIntoElement(n)))return;let s=o.mapper.toViewElement(n),r=t.createRangeIn(s),a=r.getWalker(),l=r.start;for(let{item:c}of a){if(c.is("element")&&o.mapper.toModelElement(c)||c.is("$textProxy"))break;c.is("element")&&c.getCustomProperty("listItemMarker")&&(l=t.createPositionAfter(c),a.skip(({previousPosition:u})=>!u.isEqual(l)))}o.viewPosition=l}}function o_(e,t,i){for(;e.parent.is("attributeElement")&&e.parent.getCustomProperty("listItemWrapper");)t.unwrap(t.createRangeOn(e),e.parent);let o=[];n(t.createPositionBefore(e).getWalker({direction:"backward"})),n(t.createRangeIn(e).getWalker());for(let s of o)t.remove(s);function n(s){for(let{item:r}of s){if(r.is("element")&&i.toModelElement(r))break;r.is("element")&&r.getCustomProperty("listItemMarker")&&o.push(r)}}}function AP(e,t,i,o,{dataPipeline:n}){let s=o.createRangeOn(t);if(!ti(e))return s;for(let r of i){if(r.scope!="itemMarker")continue;let a=r.createElement(o,e,{dataPipeline:n});if(!a||(o.setCustomProperty("listItemMarker",!0,a),r.canInjectMarkerIntoElement&&r.canInjectMarkerIntoElement(e)?o.insert(o.createPositionAt(t,0),a):(o.insert(s.start,a),s=o.createRange(o.createPositionBefore(a),o.createPositionAfter(t))),!r.createWrapperElement||!r.canWrapElement))continue;let l=r.createWrapperElement(o,e,{dataPipeline:n});o.setCustomProperty("listItemWrapper",!0,l),r.canWrapElement(e)?s=o.wrap(s,l):(s=o.wrap(o.createRangeOn(a),l),s=o.createRange(s.start,o.createPositionAfter(t)))}return s}function IP(e,t){let i=e.parent;for(;i.is("attributeElement")&&["ul","ol","li"].includes(i.name);){let o=i.parent;t.unwrap(t.createRangeOn(e),i),i=o}}function SP(e,t,i,o,n){if(!e.hasAttribute("listIndent"))return;let s=e.getAttribute("listIndent"),r=n.enableSkipLevelLists,a=e;for(let l=s;l>=0;l--){let c=a.getAttribute("listIndent")!==l;if(c){let u=n_(e,l)||a,d=u.getAttribute("listType"),h=Ky(o,l,`list-item-skip-${l}`),f=jy(o,l,d);o.setStyle("list-style-type","none",h);for(let m of i)m.scope=="list"&&u.hasAttribute(m.attributeName)&&m.setAttributeOnDowncast(o,u.getAttribute(m.attributeName),f,n,u);t=o.wrap(t,h),t=o.wrap(t,f)}else{let u=Ky(o,l,a.getAttribute("listItemId")),d=jy(o,l,a.getAttribute("listType"));for(let h of i)(h.scope=="list"||h.scope=="item")&&a.hasAttribute(h.attributeName)&&h.setAttributeOnDowncast(o,a.getAttribute(h.attributeName),h.scope=="list"?d:u,n,a);t=o.wrap(t,u),t=o.wrap(t,d)}if(l==0)break;if(!c){let u=Tt.first(a,{lowerIndent:!0});if(u)a=u;else if(!r)break}}}function n_(e,t){let i=e.nextSibling;for(;i&&K(i);){let o=i.getAttribute("listIndent");if(oo.consume===!1).map(o=>o.attributeName);return(o,n)=>{let s=[];for(let r of e)o.hasAttribute(r)&&!i.includes(r)&&s.push(`attribute:${r}`);return s.every(r=>n.test(o,r)!==!1)?(s.forEach(r=>n.consume(o,r)),!0):!1}}function s_(e,t,i=Ei(e)){if(!K(e))return!1;for(let o of e.getAttributeKeys())if(!(o.startsWith("selection:")||o=="htmlEmptyBlock")&&!t.includes(o))return!1;return i.length<2}/** +*/function kP(){return(e,t,i)=>{let o=t.viewItem;if(o.getStyle("list-style-type")!=="none"||!CP(o)||!i.consumable.consume(o,{name:!0}))return;let{modelRange:n,modelCursor:s}=i.convertChildren(o,t.modelCursor);t.modelRange=n,t.modelCursor=s}}function CP(e){let t=!1;for(let i of e.getChildren()){if(i.is("element","ul")||i.is("element","ol")){t=!0;continue}return!1}return t}function xP(){return(e,t,i)=>{let{writer:o,schema:n}=i;if(!t.modelRange)return;let s=Array.from(t.modelRange.getItems({shallow:!0})).filter(d=>n.checkAttribute(d,"listItemId"));if(!s.length||s.every(d=>d.hasAttribute("listItemId")))return;let r=t.viewItem.getAttribute("data-list-item-id")||ds.next();i.consumable.consume(t.viewItem,{attributes:"data-list-item-id"});let a=yP(t.viewItem),l=t.viewItem.parent&&t.viewItem.parent.is("element","ol")?"numbered":"bulleted",c=s[0].getAttribute("listType");c&&(l=c);let u={listItemId:r,listIndent:a,listType:l};for(let d of s)d.hasAttribute("listItemId")||o.setAttributes(u,d);s.length>1&&s[1].getAttribute("listItemId")!=u.listItemId&&i.keepEmptyElement(s[0])}}function TP(e,t,i,o){return()=>{let u=e.document.differ.getChanges(),d=[],h=new Set,f=new Set,m=new Set;for(let g of u)if(g.type=="insert"&&g.name!="$text")Ft(g.position,h,m),g.attributes.has("listItemId")?f.add(g.position.nodeAfter):Ft(g.position.getShiftedBy(g.length),h,m);else if(g.type=="remove"&&g.attributes.has("listItemId"))Ft(g.position,h,m);else if(g.type=="attribute"){let b=g.range.start.nodeAfter;i.includes(g.attributeKey)?(Ft(g.range.start,h,m),g.attributeNewValue===null?(Ft(g.range.start.getShiftedBy(1),h,m),a(b)&&d.push(b)):f.add(b)):K(b)&&a(b)&&d.push(b)}for(let g of h.values())d.push(...n(g,f));for(let g of new Set(d))t.reconvertItem(g)};function n(u,d){let h=[],f=new Set,m=[];for(let{node:g,previous:b}of new Fr(u)){if(f.has(g))continue;let k=g.getAttribute("listIndent");b&&ki.includes(d)))}function r(u,d,h){for(let f=d-1;f>=0&&!h[f];f--){let m=s_(u,f),g=null;if(!m){for(let k=f-1;k>=0;k--)if(h[k]){g=h[k].modelElement;break}}let b=m||g||u;h[f]={modelAttributes:{...s(b),listItemId:`list-item-skip-${f}`,listIndent:f},modelElement:b}}}function a(u,d){let h=t.mapper.toViewElement(u);if(!h)return!1;if(l(h)||o.fire("checkElement",{modelElement:u,viewElement:h}))return!0;if(!u.is("element","paragraph")&&!u.is("element","listItem"))return!1;let f=r_(u,i,d);return f&&h.is("element","p")?!0:!!(!f&&h.is("element","span"))}function l(u){for(u=u.parent;u.is("attributeElement")&&["ol","ul","li"].includes(u.name);)u=u.parent;return!!(u.getCustomProperty("$structureSlotParent")&&!t.mapper.toModelElement(u))}function c(u,d,h){if(h.has(u))return!1;let f=t.mapper.toViewElement(u),m=d.length-1;for(let g=f.parent;!g.is("editableElement");g=g.parent){let b=Gh(g),k=wP(g);if(!(!k&&!b)){if(d[m]){let v=`checkAttributes:${b?"item":"list"}`;if(o.fire(v,{viewElement:g,modelAttributes:d[m].modelAttributes,modelReferenceElement:d[m].modelElement}))break}if(k&&(m--,m<0))return!1}}return!0}}function Jy(e,t,i,{dataPipeline:o,enableSkipLevelLists:n}){let s=VP(e,t);return(r,a,l)=>{let{writer:c,mapper:u,consumable:d}=l,h=a.item;if(!e.includes(a.attributeKey)||!s(h,d))return;let f={...l.options,dataPipeline:o,enableSkipLevelLists:n},m=AP(h,u,i,c);n_(m,c,u),PP(m,c),RP(h,SP(h,m,t,c,f),t,c,f)}}function EP(e){return(t,i,o)=>{let{writer:n,mapper:s}=o,r=t.name.split(":")[1];if(!e.checkAttribute(r,"listItemId"))return;let a=s.toViewPosition(i.position),l=i.position.getShiftedBy(i.length),c=s.toViewPosition(l,{isPhantom:!0}),u=n.createRange(a,c).getTrimmed().end.nodeBefore;/* istanbul ignore next -- @preserve */u&&n_(u,n,s)}}function Zy(e,{dataPipeline:t}={}){return(i,{writer:o})=>{if(!r_(i,e))return null;if(!t)return o.createContainerElement("span",{class:"ck-list-bogus-paragraph"});let n=o.createContainerElement("p");return o.setCustomProperty("dataPipeline:transparentRendering",!0,n),n}}function AP(e,t,i,o){let n=i.createRangeOn(e),s=t.toViewRange(n).getTrimmed().getWalker();for(let{item:r}of s)if(r.is("element")&&r.getCustomProperty("listItemMarker"))s.jumpTo(o.createPositionAfter(r));else if(r.is("element")&&!r.getCustomProperty("listItemWrapper"))return r}function IP(e,t){return(i,o)=>{if(o.modelPosition.offset>0)return;let n=o.modelPosition.parent;if(!K(n)||!e.some(c=>c.scope=="itemMarker"&&c.canInjectMarkerIntoElement&&c.canInjectMarkerIntoElement(n)))return;let s=o.mapper.toViewElement(n),r=t.createRangeIn(s),a=r.getWalker(),l=r.start;for(let{item:c}of a){if(c.is("element")&&o.mapper.toModelElement(c)||c.is("$textProxy"))break;c.is("element")&&c.getCustomProperty("listItemMarker")&&(l=t.createPositionAfter(c),a.skip(({previousPosition:u})=>!u.isEqual(l)))}o.viewPosition=l}}function n_(e,t,i){for(;e.parent.is("attributeElement")&&e.parent.getCustomProperty("listItemWrapper");)t.unwrap(t.createRangeOn(e),e.parent);let o=[];n(t.createPositionBefore(e).getWalker({direction:"backward"})),n(t.createRangeIn(e).getWalker());for(let s of o)t.remove(s);function n(s){for(let{item:r}of s){if(r.is("element")&&i.toModelElement(r))break;r.is("element")&&r.getCustomProperty("listItemMarker")&&o.push(r)}}}function SP(e,t,i,o,{dataPipeline:n}){let s=o.createRangeOn(t);if(!oi(e))return s;for(let r of i){if(r.scope!="itemMarker")continue;let a=r.createElement(o,e,{dataPipeline:n});if(!a||(o.setCustomProperty("listItemMarker",!0,a),r.canInjectMarkerIntoElement&&r.canInjectMarkerIntoElement(e)?o.insert(o.createPositionAt(t,0),a):(o.insert(s.start,a),s=o.createRange(o.createPositionBefore(a),o.createPositionAfter(t))),!r.createWrapperElement||!r.canWrapElement))continue;let l=r.createWrapperElement(o,e,{dataPipeline:n});o.setCustomProperty("listItemWrapper",!0,l),r.canWrapElement(e)?s=o.wrap(s,l):(s=o.wrap(o.createRangeOn(a),l),s=o.createRange(s.start,o.createPositionAfter(t)))}return s}function PP(e,t){let i=e.parent;for(;i.is("attributeElement")&&["ul","ol","li"].includes(i.name);){let o=i.parent;t.unwrap(t.createRangeOn(e),i),i=o}}function RP(e,t,i,o,n){if(!e.hasAttribute("listIndent"))return;let s=e.getAttribute("listIndent"),r=n.enableSkipLevelLists,a=e;for(let l=s;l>=0;l--){let c=a.getAttribute("listIndent")!==l;if(c){let u=s_(e,l)||a,d=u.getAttribute("listType"),h=Gy(o,l,`list-item-skip-${l}`),f=Ky(o,l,d);o.setStyle("list-style-type","none",h);for(let m of i)m.scope=="list"&&u.hasAttribute(m.attributeName)&&m.setAttributeOnDowncast(o,u.getAttribute(m.attributeName),f,n,u);t=o.wrap(t,h),t=o.wrap(t,f)}else{let u=Gy(o,l,a.getAttribute("listItemId")),d=Ky(o,l,a.getAttribute("listType"));for(let h of i)(h.scope=="list"||h.scope=="item")&&a.hasAttribute(h.attributeName)&&h.setAttributeOnDowncast(o,a.getAttribute(h.attributeName),h.scope=="list"?d:u,n,a);t=o.wrap(t,u),t=o.wrap(t,d)}if(l==0)break;if(!c){let u=Et.first(a,{lowerIndent:!0});if(u)a=u;else if(!r)break}}}function s_(e,t){let i=e.nextSibling;for(;i&&K(i);){let o=i.getAttribute("listIndent");if(oo.consume===!1).map(o=>o.attributeName);return(o,n)=>{let s=[];for(let r of e)o.hasAttribute(r)&&!i.includes(r)&&s.push(`attribute:${r}`);return s.every(r=>n.test(o,r)!==!1)?(s.forEach(r=>n.consume(o,r)),!0):!1}}function r_(e,t,i=Ii(e)){if(!K(e))return!1;for(let o of e.getAttributeKeys())if(!(o.startsWith("selection:")||o=="htmlEmptyBlock")&&!t.includes(o))return!1;return i.length<2}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var sc=["listType","listIndent","listItemId"],ft=class extends y{_downcastStrategies=[];static get pluginName(){return"ListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Gi,ht,gP,Be,uP]}constructor(e){super(e),e.config.define("list.multiBlock",!0)}init(){let e=this.editor,t=e.model,i=e.config.get("list.multiBlock");if(e.plugins.has("LegacyListEditing"))throw new p("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"});t.schema.register("$listItem",{allowAttributes:sc}),i?(t.schema.extend("$container",{allowAttributesOf:"$listItem"}),t.schema.extend("$block",{allowAttributesOf:"$listItem"}),t.schema.extend("$blockObject",{allowAttributesOf:"$listItem"})):t.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"});for(let o of sc)t.schema.setAttributeProperties(o,{copyOnReplace:!0});e.commands.add("numberedList",new Br(e,"numbered")),e.commands.add("bulletedList",new Br(e,"bulleted")),e.commands.add("customNumberedList",new Br(e,"customNumbered",{multiLevel:!0})),e.commands.add("customBulletedList",new Br(e,"customBulleted",{multiLevel:!0})),e.commands.add("indentList",new Hy(e,"forward")),e.commands.add("outdentList",new Hy(e,"backward")),e.commands.add("splitListItemBefore",new qy(e,"before")),e.commands.add("splitListItemAfter",new qy(e,"after")),i&&(e.commands.add("mergeListItemBackward",new Uy(e,"backward")),e.commands.add("mergeListItemForward",new Uy(e,"forward"))),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration(),this._setupAccessibilityIntegration(),this._setupListItemIdConversionStrategy()}afterInit(){let e=this.editor.commands,t=e.get("indent"),i=e.get("outdent");t&&t.registerChildCommand(e.get("indentList"),{priority:"high"}),i&&i.registerChildCommand(e.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(e){this._downcastStrategies.push(e)}getListAttributeNames(){return[...sc,...this._downcastStrategies.map(e=>e.attributeName)]}_setupDeleteIntegration(){let e=this.editor,t=e.commands.get("mergeListItemBackward"),i=e.commands.get("mergeListItemForward");this.listenTo(e.editing.view.document,"delete",(o,n)=>{let s=e.model.document.selection;Dr(e.model)||e.model.change(()=>{let r=s.getFirstPosition();if(s.isCollapsed&&n.direction=="backward"){if(!r.isAtStart)return;let a=r.parent;if(!K(a))return;let l=Tt.first(a,{sameAttributes:"listType",sameIndent:!0}),c=a.getAttribute("listIndent")===0||!K(a.previousSibling);if(!l&&c)zy(a)||e.execute("splitListItemAfter"),e.execute("outdentList");else{if(!t||!t.isEnabled)return;t.execute({shouldMergeOnBlocksContentLevel:Zy(e.model,"backward")})}n.preventDefault(),o.stop()}else{if(s.isCollapsed&&!s.getLastPosition().isAtEnd||!i||!i.isEnabled)return;i.execute({shouldMergeOnBlocksContentLevel:Zy(e.model,"forward")}),n.preventDefault(),o.stop()}})},{context:"li"})}_setupEnterIntegration(){let e=this.editor,t=e.model,i=e.commands,o=i.get("enter");this.listenTo(e.editing.view.document,"enter",(n,s)=>{let r=t.document,a=r.selection.getFirstPosition().parent;if(r.selection.isCollapsed&&K(a)&&a.isEmpty&&!s.isSoft){let l=ti(a),c=zy(a);l&&c?(e.execute("outdentList"),s.preventDefault(),n.stop()):l&&!c?(e.execute("splitListItemAfter"),s.preventDefault(),n.stop()):c&&(e.execute("splitListItemBefore"),s.preventDefault(),n.stop())}},{context:"li"}),this.listenTo(o,"afterExecute",()=>{let n=i.get("splitListItemBefore");if(n.refresh(),!n.isEnabled)return;let s=e.model.document.selection.getLastPosition().parent;Ei(s).length===2&&n.execute()})}_setupTabIntegration(){let e=this.editor;this.listenTo(e.editing.view.document,"tab",(t,i)=>{let o=i.shiftKey?"outdentList":"indentList";this.editor.commands.get(o).isEnabled&&(e.execute(o),i.stopPropagation(),i.preventDefault(),t.stop())},{context:"li"})}_setupConversion(){let e=this.editor,t=e.model,i=this.getListAttributeNames(),o=e.config.get("list.multiBlock"),n=o?"paragraph":"listItem",s=!!e.config.get("list.enableSkipLevelLists");e.conversion.for("upcast").elementToElement({view:"li",model:(a,{writer:l})=>l.createElement(n,{listType:""})}).elementToElement({view:"p",model:(a,{writer:l})=>a.parent&&a.parent.is("element","li")?l.createElement(n,{listType:""}):null,converterPriority:"high"}).add(a=>{a.on("element:p",(l,c,u)=>{let d=c.viewItem;if(!d.parent||!d.parent.is("element","li")||d.isEmpty||!d.getAttributeKeys().next().done)return;for(let m of d.parent.getChildren())if(m!==d&&!(m.is("element","ol")||m.is("element","ul")))return;u.consumable.consume(d,{name:!0});let{modelRange:h,modelCursor:f}=u.convertChildren(d,c.modelCursor);c.modelRange=h,c.modelCursor=f},{priority:"highest"}),s&&a.on("element:li",_P(),{priority:"high"}),a.on("element:li",kP())}),o||e.conversion.for("downcast").elementToElement({model:"listItem",view:"p"}),e.conversion.for("editingDowncast").elementToElement({model:n,view:Jy(i),converterPriority:"high"}).add(a=>{a.on("attribute",Gy(i,this._downcastStrategies,t,{enableSkipLevelLists:s})),a.on("remove",xP(t.schema))}),e.conversion.for("dataDowncast").elementToElement({model:n,view:Jy(i,{dataPipeline:!0}),converterPriority:"high"}).add(a=>{a.on("attribute",Gy(i,this._downcastStrategies,t,{dataPipeline:!0,enableSkipLevelLists:s}))});let r=EP(this._downcastStrategies,e.editing.view);e.editing.mapper.on("modelToViewPosition",r),e.data.mapper.on("modelToViewPosition",r),this.listenTo(t.document,"change:data",CP(t,e.editing,i,this),{priority:"high"}),this.on("checkAttributes:item",(a,{viewElement:l,modelAttributes:c})=>{l.id!=c.listItemId&&(a.return=!0,a.stop())}),this.on("checkAttributes:list",(a,{viewElement:l,modelAttributes:c})=>{(l.name!=t_(c.listType)||l.id!=i_(c.listType,c.listIndent))&&(a.return=!0,a.stop())})}_setupModelPostFixing(){let e=this.editor.model,t=this.getListAttributeNames();e.document.registerPostFixer(i=>RP(e,i,t,this)),this.editor.config.get("list.enableSkipLevelLists")||this.on("postFixer",(i,{listNodes:o,writer:n})=>{i.return=wP(o,n)||i.return},{priority:"high"}),this.on("postFixer",(i,{listNodes:o,writer:n,seenIds:s})=>{i.return=yP(o,s,n)||i.return},{priority:"high"})}_setupClipboardIntegration(){let e=this.editor.model,t=this.editor.plugins.get("ClipboardPipeline");this.listenTo(e,"insertContent",VP(e),{priority:"high"}),this.listenTo(t,"outputTransformation",(i,o)=>{e.change(n=>{let s=Array.from(o.content.getChildren()),r=s[s.length-1];if(s.length>1&&r.is("element")&&r.isEmpty&&s.slice(0,-1).every(K)&&n.remove(r),o.method=="copy"||o.method=="cut"){let a=Array.from(o.content.getChildren());Or(a)&&rc(a,n,this.getListAttributeNames())}})})}_setupAccessibilityIntegration(){let e=this.editor,t=e.t;e.accessibility.addKeystrokeInfoGroup({id:"list",label:t("Keystrokes that can be used in a list"),keystrokes:[{label:t("Increase list item indent"),keystroke:"Tab"},{label:t("Decrease list item indent"),keystroke:"Shift+Tab"}]})}_setupListItemIdConversionStrategy(){this.registerDowncastStrategy({scope:"item",attributeName:"listItemId",setAttributeOnDowncast(e,t,i,o){o&&(o.skipListItemIds||o.isClipboardPipeline)||e.setAttribute("data-list-item-id",t,i)}})}};function RP(e,t,i,o){let n=e.document.differ.getChanges(),s=new Set,r=new Set,a=o.editor.config.get("list.multiBlock"),l=!1;for(let u of n){if(u.type=="insert"&&u.name!="$text"){let d=u.position.nodeAfter;if(!e.schema.checkAttribute(d,"listItemId"))for(let h of Array.from(d.getAttributeKeys()))i.includes(h)&&(t.removeAttribute(h,d),l=!0);Ot(u.position,r,s),u.attributes.has("listItemId")||Ot(u.position.getShiftedBy(u.length),r,s);for(let{item:h,previousPosition:f}of e.createRangeIn(d))K(h)&&Ot(f,r,s)}else u.type=="remove"?Ot(u.position,r,s):u.type=="attribute"&&i.includes(u.attributeKey)&&(Ot(u.range.start,r,s),u.attributeNewValue===null&&Ot(u.range.start.getShiftedBy(1),r,s));if(!a&&u.type=="attribute"&&sc.includes(u.attributeKey)){let d=u.range.start.nodeAfter;u.attributeNewValue===null&&d&&d.is("element","listItem")?(t.rename(d,"paragraph"),l=!0):u.attributeOldValue===null&&d&&d.is("element")&&d.name!="listItem"&&(t.rename(d,"listItem"),l=!0)}}let c=new Set;for(let u of r.values())l=o.fire("postFixer",{listNodes:new QS(u),listHead:u,writer:t,seenIds:c})||l;return l}function VP(e){return(t,[i,o])=>{let n=(i.is("documentFragment")?Array.from(i.getChildren()):[i]).filter(a=>!e.schema.isInline(a));if(!n.length)return;let s=(o?e.createSelection(o):e.document.selection).getFirstPosition(),r;if(K(s.parent))r=s.parent;else if(K(s.nodeBefore)&&K(s.nodeAfter))r=s.nodeBefore;else return;e.change(a=>{let l=r.getAttribute("listType"),c=r.getAttribute("listIndent"),u=n[0].getAttribute("listIndent")||0,d=Math.max(c-u,0);for(let h of n){let f=K(h);r.is("element","listItem")&&h.is("element","paragraph")&&a.rename(h,"listItem"),a.setAttributes({listIndent:(f?h.getAttribute("listIndent"):0)+d,listItemId:f?h.getAttribute("listItemId"):ds.next(),listType:l},h)}})}}function Zy(e,t){let i=e.document.selection;if(!i.isCollapsed)return!Dr(e);if(t==="forward")return!0;let o=i.getFirstPosition().parent,n=o.previousSibling;return e.schema.isObject(n)?!1:n.isEmpty?!0:Or([o,n])}/** +*/var ac=["listType","listIndent","listItemId"],mt=class extends w{_downcastStrategies=[];static get pluginName(){return"ListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Zi,ft,bP,Be,hP]}constructor(e){super(e),e.config.define("list.multiBlock",!0)}init(){let e=this.editor,t=e.model,i=e.config.get("list.multiBlock");if(e.plugins.has("LegacyListEditing"))throw new p("list-feature-conflict",this,{conflictPlugin:"LegacyListEditing"});t.schema.register("$listItem",{allowAttributes:ac}),i?(t.schema.extend("$container",{allowAttributesOf:"$listItem"}),t.schema.extend("$block",{allowAttributesOf:"$listItem"}),t.schema.extend("$blockObject",{allowAttributesOf:"$listItem"})):t.schema.register("listItem",{inheritAllFrom:"$block",allowAttributesOf:"$listItem"});for(let o of ac)t.schema.setAttributeProperties(o,{copyOnReplace:!0});e.commands.add("numberedList",new Br(e,"numbered")),e.commands.add("bulletedList",new Br(e,"bulleted")),e.commands.add("customNumberedList",new Br(e,"customNumbered",{multiLevel:!0})),e.commands.add("customBulletedList",new Br(e,"customBulleted",{multiLevel:!0})),e.commands.add("indentList",new Wy(e,"forward")),e.commands.add("outdentList",new Wy(e,"backward")),e.commands.add("splitListItemBefore",new $y(e,"before")),e.commands.add("splitListItemAfter",new $y(e,"after")),i&&(e.commands.add("mergeListItemBackward",new qy(e,"backward")),e.commands.add("mergeListItemForward",new qy(e,"forward"))),this._setupDeleteIntegration(),this._setupEnterIntegration(),this._setupTabIntegration(),this._setupClipboardIntegration(),this._setupAccessibilityIntegration(),this._setupListItemIdConversionStrategy()}afterInit(){let e=this.editor.commands,t=e.get("indent"),i=e.get("outdent");t&&t.registerChildCommand(e.get("indentList"),{priority:"high"}),i&&i.registerChildCommand(e.get("outdentList"),{priority:"lowest"}),this._setupModelPostFixing(),this._setupConversion()}registerDowncastStrategy(e){this._downcastStrategies.push(e)}getListAttributeNames(){return[...ac,...this._downcastStrategies.map(e=>e.attributeName)]}_setupDeleteIntegration(){let e=this.editor,t=e.commands.get("mergeListItemBackward"),i=e.commands.get("mergeListItemForward");this.listenTo(e.editing.view.document,"delete",(o,n)=>{let s=e.model.document.selection;Dr(e.model)||e.model.change(()=>{let r=s.getFirstPosition();if(s.isCollapsed&&n.direction=="backward"){if(!r.isAtStart)return;let a=r.parent;if(!K(a))return;let l=Et.first(a,{sameAttributes:"listType",sameIndent:!0}),c=a.getAttribute("listIndent")===0||!K(a.previousSibling);if(!l&&c)Hy(a)||e.execute("splitListItemAfter"),e.execute("outdentList");else{if(!t||!t.isEnabled)return;t.execute({shouldMergeOnBlocksContentLevel:Qy(e.model,"backward")})}n.preventDefault(),o.stop()}else{if(s.isCollapsed&&!s.getLastPosition().isAtEnd||!i||!i.isEnabled)return;i.execute({shouldMergeOnBlocksContentLevel:Qy(e.model,"forward")}),n.preventDefault(),o.stop()}})},{context:"li"})}_setupEnterIntegration(){let e=this.editor,t=e.model,i=e.commands,o=i.get("enter");this.listenTo(e.editing.view.document,"enter",(n,s)=>{let r=t.document,a=r.selection.getFirstPosition().parent;if(r.selection.isCollapsed&&K(a)&&a.isEmpty&&!s.isSoft){let l=oi(a),c=Hy(a);l&&c?(e.execute("outdentList"),s.preventDefault(),n.stop()):l&&!c?(e.execute("splitListItemAfter"),s.preventDefault(),n.stop()):c&&(e.execute("splitListItemBefore"),s.preventDefault(),n.stop())}},{context:"li"}),this.listenTo(o,"afterExecute",()=>{let n=i.get("splitListItemBefore");if(n.refresh(),!n.isEnabled)return;let s=e.model.document.selection.getLastPosition().parent;Ii(s).length===2&&n.execute()})}_setupTabIntegration(){let e=this.editor;this.listenTo(e.editing.view.document,"tab",(t,i)=>{let o=i.shiftKey?"outdentList":"indentList";this.editor.commands.get(o).isEnabled&&(e.execute(o),i.stopPropagation(),i.preventDefault(),t.stop())},{context:"li"})}_setupConversion(){let e=this.editor,t=e.model,i=this.getListAttributeNames(),o=e.config.get("list.multiBlock"),n=o?"paragraph":"listItem",s=!!e.config.get("list.enableSkipLevelLists");e.conversion.for("upcast").elementToElement({view:"li",model:(a,{writer:l})=>l.createElement(n,{listType:""})}).elementToElement({view:"p",model:(a,{writer:l})=>a.parent&&a.parent.is("element","li")?l.createElement(n,{listType:""}):null,converterPriority:"high"}).add(a=>{a.on("element:p",(l,c,u)=>{let d=c.viewItem;if(!d.parent||!d.parent.is("element","li")||d.isEmpty||!d.getAttributeKeys().next().done)return;for(let m of d.parent.getChildren())if(m!==d&&!(m.is("element","ol")||m.is("element","ul")))return;u.consumable.consume(d,{name:!0});let{modelRange:h,modelCursor:f}=u.convertChildren(d,c.modelCursor);c.modelRange=h,c.modelCursor=f},{priority:"highest"}),s&&a.on("element:li",kP(),{priority:"high"}),a.on("element:li",xP())}),o||e.conversion.for("downcast").elementToElement({model:"listItem",view:"p"}),e.conversion.for("editingDowncast").elementToElement({model:n,view:Zy(i),converterPriority:"high"}).add(a=>{a.on("attribute",Jy(i,this._downcastStrategies,t,{enableSkipLevelLists:s})),a.on("remove",EP(t.schema))}),e.conversion.for("dataDowncast").elementToElement({model:n,view:Zy(i,{dataPipeline:!0}),converterPriority:"high"}).add(a=>{a.on("attribute",Jy(i,this._downcastStrategies,t,{dataPipeline:!0,enableSkipLevelLists:s}))});let r=IP(this._downcastStrategies,e.editing.view);e.editing.mapper.on("modelToViewPosition",r),e.data.mapper.on("modelToViewPosition",r),this.listenTo(t.document,"change:data",TP(t,e.editing,i,this),{priority:"high"}),this.on("checkAttributes:item",(a,{viewElement:l,modelAttributes:c})=>{l.id!=c.listItemId&&(a.return=!0,a.stop())}),this.on("checkAttributes:list",(a,{viewElement:l,modelAttributes:c})=>{(l.name!=i_(c.listType)||l.id!=o_(c.listType,c.listIndent))&&(a.return=!0,a.stop())})}_setupModelPostFixing(){let e=this.editor.model,t=this.getListAttributeNames();e.document.registerPostFixer(i=>LP(e,i,t,this)),this.editor.config.get("list.enableSkipLevelLists")||this.on("postFixer",(i,{listNodes:o,writer:n})=>{i.return=_P(o,n)||i.return},{priority:"high"}),this.on("postFixer",(i,{listNodes:o,writer:n,seenIds:s})=>{i.return=vP(o,s,n)||i.return},{priority:"high"})}_setupClipboardIntegration(){let e=this.editor.model,t=this.editor.plugins.get("ClipboardPipeline");this.listenTo(e,"insertContent",MP(e),{priority:"high"}),this.listenTo(t,"outputTransformation",(i,o)=>{e.change(n=>{let s=Array.from(o.content.getChildren()),r=s[s.length-1];if(s.length>1&&r.is("element")&&r.isEmpty&&s.slice(0,-1).every(K)&&n.remove(r),o.method=="copy"||o.method=="cut"){let a=Array.from(o.content.getChildren());Or(a)&&lc(a,n,this.getListAttributeNames())}})})}_setupAccessibilityIntegration(){let e=this.editor,t=e.t;e.accessibility.addKeystrokeInfoGroup({id:"list",label:t("Keystrokes that can be used in a list"),keystrokes:[{label:t("Increase list item indent"),keystroke:"Tab"},{label:t("Decrease list item indent"),keystroke:"Shift+Tab"}]})}_setupListItemIdConversionStrategy(){this.registerDowncastStrategy({scope:"item",attributeName:"listItemId",setAttributeOnDowncast(e,t,i,o){o&&(o.skipListItemIds||o.isClipboardPipeline)||e.setAttribute("data-list-item-id",t,i)}})}};function LP(e,t,i,o){let n=e.document.differ.getChanges(),s=new Set,r=new Set,a=o.editor.config.get("list.multiBlock"),l=!1;for(let u of n){if(u.type=="insert"&&u.name!="$text"){let d=u.position.nodeAfter;if(!e.schema.checkAttribute(d,"listItemId"))for(let h of Array.from(d.getAttributeKeys()))i.includes(h)&&(t.removeAttribute(h,d),l=!0);Ft(u.position,r,s),u.attributes.has("listItemId")||Ft(u.position.getShiftedBy(u.length),r,s);for(let{item:h,previousPosition:f}of e.createRangeIn(d))K(h)&&Ft(f,r,s)}else u.type=="remove"?Ft(u.position,r,s):u.type=="attribute"&&i.includes(u.attributeKey)&&(Ft(u.range.start,r,s),u.attributeNewValue===null&&Ft(u.range.start.getShiftedBy(1),r,s));if(!a&&u.type=="attribute"&&ac.includes(u.attributeKey)){let d=u.range.start.nodeAfter;u.attributeNewValue===null&&d&&d.is("element","listItem")?(t.rename(d,"paragraph"),l=!0):u.attributeOldValue===null&&d&&d.is("element")&&d.name!="listItem"&&(t.rename(d,"listItem"),l=!0)}}let c=new Set;for(let u of r.values())l=o.fire("postFixer",{listNodes:new XS(u),listHead:u,writer:t,seenIds:c})||l;return l}function MP(e){return(t,[i,o])=>{let n=(i.is("documentFragment")?Array.from(i.getChildren()):[i]).filter(a=>!e.schema.isInline(a));if(!n.length)return;let s=(o?e.createSelection(o):e.document.selection).getFirstPosition(),r;if(K(s.parent))r=s.parent;else if(K(s.nodeBefore)&&K(s.nodeAfter))r=s.nodeBefore;else return;e.change(a=>{let l=r.getAttribute("listType"),c=r.getAttribute("listIndent"),u=n[0].getAttribute("listIndent")||0,d=Math.max(c-u,0);for(let h of n){let f=K(h);r.is("element","listItem")&&h.is("element","paragraph")&&a.rename(h,"listItem"),a.setAttributes({listIndent:(f?h.getAttribute("listIndent"):0)+d,listItemId:f?h.getAttribute("listItemId"):ds.next(),listType:l},h)}})}}function Qy(e,t){let i=e.document.selection;if(!i.isCollapsed)return!Dr(e);if(t==="forward")return!0;let o=i.getFirstPosition().parent,n=o.previousSibling;return e.schema.isObject(n)?!1:n.isEmpty?!0:Or([o,n])}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function Kh(e,t,i,o){e.ui.componentFactory.add(t,()=>{let n=Qy(I,e,t,i,o);return n.set({tooltip:!0,isToggleable:!0}),n}),e.ui.componentFactory.add(`menuBar:${t}`,()=>{let n=Qy(oe,e,t,i,o);return n.set({role:"menuitemcheckbox",isToggleable:!0}),n})}function Qy(e,t,i,o,n){let s=t.commands.get(i),r=new e(t.locale);return r.set({label:o,icon:n}),r.bind("isOn","isEnabled").to(s,"value","isEnabled"),r.on("execute",()=>{t.execute(i),t.editing.view.focus()}),r}/** +*/function Jh(e,t,i,o){e.ui.componentFactory.add(t,()=>{let n=Yy(I,e,t,i,o);return n.set({tooltip:!0,isToggleable:!0}),n}),e.ui.componentFactory.add(`menuBar:${t}`,()=>{let n=Yy(oe,e,t,i,o);return n.set({role:"menuitemcheckbox",isToggleable:!0}),n})}function Yy(e,t,i,o,n){let s=t.commands.get(i),r=new e(t.locale);return r.set({label:o,icon:n}),r.bind("isOn","isEnabled").to(s,"value","isEnabled"),r.on("execute",()=>{t.execute(i),t.editing.view.focus()}),r}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var LP=class extends y{static get pluginName(){return"ListUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor.t;this.editor.ui.componentFactory.has("numberedList")||Kh(this.editor,"numberedList",e("Numbered List"),K1),this.editor.ui.componentFactory.has("bulletedList")||Kh(this.editor,"bulletedList",e("Bulleted List"),M1)}};/** +*/var BP=class extends w{static get pluginName(){return"ListUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor.t;this.editor.ui.componentFactory.has("numberedList")||Jh(this.editor,"numberedList",e("Numbered List"),J1),this.editor.ui.componentFactory.has("bulletedList")||Jh(this.editor,"bulletedList",e("Bulleted List"),O1)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var r_=class extends y{static get requires(){return[ft,LP]}static get pluginName(){return"List"}static get isOfficialPlugin(){return!0}};/** +*/var a_=class extends w{static get requires(){return[mt,BP]}static get pluginName(){return"List"}static get isOfficialPlugin(){return!0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var MP={},BP={},OP={},DP=[{listStyle:"disc",typeAttribute:"disc",listType:"bulleted"},{listStyle:"circle",typeAttribute:"circle",listType:"bulleted"},{listStyle:"square",typeAttribute:"square",listType:"bulleted"},{listStyle:"decimal",typeAttribute:"1",listType:"numbered"},{listStyle:"decimal-leading-zero",typeAttribute:null,listType:"numbered"},{listStyle:"lower-roman",typeAttribute:"i",listType:"numbered"},{listStyle:"upper-roman",typeAttribute:"I",listType:"numbered"},{listStyle:"lower-alpha",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-alpha",typeAttribute:"A",listType:"numbered"},{listStyle:"lower-latin",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-latin",typeAttribute:"A",listType:"numbered"},{listStyle:"arabic-indic",typeAttribute:null,listType:"numbered"}];for(let{listStyle:e,typeAttribute:t,listType:i}of DP)MP[e]=i,BP[e]=t,t&&(OP[t]=e);/** +*/var OP={},DP={},FP={},NP=[{listStyle:"disc",typeAttribute:"disc",listType:"bulleted"},{listStyle:"circle",typeAttribute:"circle",listType:"bulleted"},{listStyle:"square",typeAttribute:"square",listType:"bulleted"},{listStyle:"decimal",typeAttribute:"1",listType:"numbered"},{listStyle:"decimal-leading-zero",typeAttribute:null,listType:"numbered"},{listStyle:"lower-roman",typeAttribute:"i",listType:"numbered"},{listStyle:"upper-roman",typeAttribute:"I",listType:"numbered"},{listStyle:"lower-alpha",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-alpha",typeAttribute:"A",listType:"numbered"},{listStyle:"lower-latin",typeAttribute:"a",listType:"numbered"},{listStyle:"upper-latin",typeAttribute:"A",listType:"numbered"},{listStyle:"arabic-indic",typeAttribute:null,listType:"numbered"}];for(let{listStyle:e,typeAttribute:t,listType:i}of NP)OP[e]=i,DP[e]=t,t&&(FP[t]=e);/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -1876,19 +1876,19 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var FP=class extends M{constructor(e){super(e),this.on("execute",()=>{this.refresh()},{priority:"highest"})}refresh(){let e=this._getSelectedItems();this.value=this._getValue(e),this.isEnabled=!!e.length}execute(e={}){this.editor.model.change(t=>{let i=this._getSelectedItems(),o=e.forceValue===void 0?!this._getValue(i):e.forceValue;for(let n of i)o?t.setAttribute("todoListChecked",!0,n):t.removeAttribute("todoListChecked",n)})}_getValue(e){return e.every(t=>t.getAttribute("todoListChecked"))}_getSelectedItems(){let e=this.editor.model,t=e.schema,i=e.document.selection.getFirstRange(),o=i.start.parent,n=[];t.checkAttribute(o,"todoListChecked")&&n.push(...Ei(o));for(let s of i.getItems({shallow:!0}))t.checkAttribute(s,"todoListChecked")&&!n.includes(s)&&n.push(...Ei(s));return n}};/** +*/var zP=class extends M{constructor(e){super(e),this.on("execute",()=>{this.refresh()},{priority:"highest"})}refresh(){let e=this._getSelectedItems();this.value=this._getValue(e),this.isEnabled=!!e.length}execute(e={}){this.editor.model.change(t=>{let i=this._getSelectedItems(),o=e.forceValue===void 0?!this._getValue(i):e.forceValue;for(let n of i)o?t.setAttribute("todoListChecked",!0,n):t.removeAttribute("todoListChecked",n)})}_getValue(e){return e.every(t=>t.getAttribute("todoListChecked"))}_getSelectedItems(){let e=this.editor.model,t=e.schema,i=e.document.selection.getFirstRange(),o=i.start.parent,n=[];t.checkAttribute(o,"todoListChecked")&&n.push(...Ii(o));for(let s of i.getItems({shallow:!0}))t.checkAttribute(s,"todoListChecked")&&!n.includes(s)&&n.push(...Ii(s));return n}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var NP=class extends $e{domEventType=["change"];onDomEvent(e){if(e.target){let t=this.view.domConverter.mapDomToView(e.target);t&&t.is("element","input")&&t.getAttribute("type")=="checkbox"&&t.findAncestor({classes:"todo-list__label"})&&this.fire("todoCheckboxChange",e)}}};/** +*/var HP=class extends $e{domEventType=["change"];onDomEvent(e){if(e.target){let t=this.view.domConverter.mapDomToView(e.target);t&&t.is("element","input")&&t.getAttribute("type")=="checkbox"&&t.findAncestor({classes:"todo-list__label"})&&this.fire("todoCheckboxChange",e)}}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var zP=Cn("Ctrl+Enter"),HP=class extends y{static get pluginName(){return"TodoListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[ft]}init(){let e=this.editor,t=e.model,i=e.editing,o=e.plugins.get(ft),n=e.config.get("list.multiBlock")?"paragraph":"listItem";e.commands.add("todoList",new Br(e,"todo")),e.commands.add("checkTodoList",new FP(e)),i.view.addObserver(NP),t.schema.extend("$listItem",{allowAttributes:"todoListChecked"}),t.schema.addAttributeCheck(s=>{let r=s.last;if(!r.getAttribute("listItemId")||r.getAttribute("listType")!="todo")return!1},"todoListChecked"),e.conversion.for("upcast").add(s=>{s.on("element:input",UP()),s.on("element:li",WP(),{priority:"low"}),s.on("element:label",Uh({name:"label",classes:"todo-list__label"})),s.on("element:label",Uh({name:"label",classes:["todo-list__label","todo-list__label_without-description"]})),s.on("element:span",Uh({name:"span",classes:"todo-list__label__description"})),s.on("element:ul",qP({name:"ul",classes:"todo-list"}))}),e.conversion.for("downcast").elementToElement({model:n,view:(s,{writer:r})=>{if(nc(s,o.getListAttributeNames()))return r.createContainerElement("span",{class:"todo-list__label__description"})},converterPriority:"highest"}),o.registerDowncastStrategy({scope:"list",attributeName:"listType",setAttributeOnDowncast(s,r,a){r=="todo"?s.addClass("todo-list",a):s.removeClass("todo-list",a)}}),o.registerDowncastStrategy({scope:"itemMarker",attributeName:"todoListChecked",createElement(s,r,{dataPipeline:a}){if(r.getAttribute("listType")!="todo")return null;let l=s.createUIElement("input",{type:"checkbox",...r.getAttribute("todoListChecked")?{checked:"checked"}:null,...a?{disabled:"disabled"}:{tabindex:"-1"}});if(a)return l;let c=s.createContainerElement("span",{contenteditable:"false"},l);return c.getFillerOffset=()=>null,c},canWrapElement(s){return nc(s,o.getListAttributeNames())},createWrapperElement(s,r,{dataPipeline:a}){let l=["todo-list__label"];return nc(r,o.getListAttributeNames())||l.push("todo-list__label_without-description"),s.createAttributeElement(a?"label":"span",{class:l.join(" ")})}}),o.on("checkElement",(s,{modelElement:r,viewElement:a})=>{let l=nc(r,o.getListAttributeNames());a.hasClass("todo-list__label__description")!=l&&(s.return=!0,s.stop())}),o.on("checkElement",(s,{modelElement:r,viewElement:a})=>{let l=r.getAttribute("listType")=="todo"&&ti(r),c=!1,u=e.editing.view.createPositionBefore(a).getWalker({direction:"backward"});for(let{item:d}of u){if(d.is("element")&&e.editing.mapper.toModelElement(d))break;d.is("element","input")&&d.getAttribute("type")=="checkbox"&&(c=!0)}c!=l&&(s.return=!0,s.stop())}),o.on("postFixer",(s,{listNodes:r,writer:a})=>{for(let{node:l,previousNodeInList:c}of r){if(!c||c.getAttribute("listItemId")!=l.getAttribute("listItemId"))continue;let u=c.hasAttribute("todoListChecked"),d=l.hasAttribute("todoListChecked");d&&!u?(a.removeAttribute("todoListChecked",l),s.return=!0):!d&&u&&(a.setAttribute("todoListChecked",!0,l),s.return=!0)}}),t.document.registerPostFixer(s=>{let r=t.document.differ.getChanges(),a=!1;for(let l of r)if(l.type=="attribute"&&l.attributeKey=="listType"){let c=l.range.start.nodeAfter;l.attributeOldValue=="todo"&&c.hasAttribute("todoListChecked")&&(s.removeAttribute("todoListChecked",c),a=!0)}else if(l.type=="insert"&&l.name!="$text")for(let{item:c}of s.createRangeOn(l.position.nodeAfter))c.is("element")&&c.getAttribute("listType")!="todo"&&c.hasAttribute("todoListChecked")&&(s.removeAttribute("todoListChecked",c),a=!0);return a}),this.listenTo(i.view.document,"keydown",(s,r)=>{qt(r)===zP&&(e.execute("checkTodoList"),s.stop())},{priority:"high"}),this.listenTo(i.view.document,"todoCheckboxChange",(s,r)=>{let a=r.target;if(!a||!a.is("element","input"))return;let l=i.view.createPositionAfter(a),c=i.mapper.toModelPosition(l).parent;c&&K(c)&&c.getAttribute("listType")=="todo"&&this._handleCheckmarkChange(c)}),this.listenTo(i.view.document,"arrowKey",jP(t,e.locale),{context:"$text"}),this.listenTo(i.mapper,"viewToModelPosition",(s,r)=>{let a=r.viewPosition.parent,l=a.is("attributeElement","li")&&r.viewPosition.offset==0,c=Yy(a)&&r.viewPosition.offset<=1,u=a.is("element","span")&&a.getAttribute("contenteditable")=="false"&&Yy(a.parent);if(!l&&!c&&!u)return;let d=r.modelPosition.nodeAfter;d&&d.getAttribute("listType")=="todo"&&(r.modelPosition=t.createPositionAt(d,0))},{priority:"low"}),this._initAriaAnnouncements()}_handleCheckmarkChange(e){let t=this.editor,i=t.model,o=Array.from(i.document.selection.getRanges());i.change(n=>{n.setSelection(e,"end"),t.execute("checkTodoList"),n.setSelection(o)})}_initAriaAnnouncements(){let{model:e,ui:t,t:i}=this.editor,o=null;t&&e.document.selection.on("change:range",()=>{let n=e.document.selection.focus.parent,s=Xy(o),r=Xy(n);s&&!r?t.ariaLiveAnnouncer.announce(i("Leaving a to-do list")):!s&&r&&t.ariaLiveAnnouncer.announce(i("Entering a to-do list")),o=n})}};function WP(){return(e,t,i)=>{let{writer:o,schema:n}=i;if(!t.modelRange)return;let s=Array.from(t.modelRange.getItems({shallow:!0})).filter(r=>r.getAttribute("listType")==="todo"&&n.checkAttribute(r,"listItemId")).reduce((r,a)=>{let l=a.getAttribute("listItemId");return r.has(l)||r.set(l,Ei(a)),r},new Map);for(let[,r]of s.entries())if(r.some(a=>a.getAttribute("todoListChecked")))for(let a of r)o.setAttribute("todoListChecked",!0,a)}}function UP(){return(e,t,i)=>{let o=t.modelCursor,n=o.parent,s=t.viewItem;if(!i.consumable.test(s,{name:!0})||s.getAttribute("type")!="checkbox"||!o.isAtStart||!n.hasAttribute("listType"))return;i.consumable.consume(s,{name:!0});let r=i.writer;r.setAttribute("listType","todo",n),t.viewItem.hasAttribute("checked")&&r.setAttribute("todoListChecked",!0,n),t.modelRange=r.createRange(o)}}function Uh(e){let t=new We(e);return(i,o,n)=>{let s=t.match(o.viewItem);s&&n.consumable.consume(o.viewItem,s.match)&&Object.assign(o,n.convertChildren(o.viewItem,o.modelCursor))}}function qP(e){let t=new We(e);return(i,o,n)=>{let s=t.match(o.viewItem);if(!s)return;let r=s.match;r.name=!1,n.consumable.consume(o.viewItem,r)}}function nc(e,t){return(e.is("element","paragraph")||e.is("element","listItem"))&&e.getAttribute("listType")=="todo"&&ti(e)&&$P(e,t)}function $P(e,t){for(let i of e.getAttributeKeys())if(!i.startsWith("selection:")&&!t.includes(i))return!1;return!0}function jP(e,t){return(i,o)=>{let n=wo(o.keyCode,t.contentLanguageDirection),s=e.schema,r=e.document.selection;if(!r.isCollapsed)return;let a=r.getFirstPosition(),l=a.parent;if(n=="right"&&a.isAtEnd){let c=s.getNearestSelectionRange(e.createPositionAfter(l),"forward");if(!c)return;let u=c.start.parent;u&&K(u)&&u.getAttribute("listType")=="todo"&&(e.change(d=>d.setSelection(c)),o.preventDefault(),o.stopPropagation(),i.stop())}else if(n=="left"&&a.isAtStart&&K(l)&&l.getAttribute("listType")=="todo"){let c=s.getNearestSelectionRange(e.createPositionBefore(l),"backward");if(!c)return;e.change(u=>u.setSelection(c)),o.preventDefault(),o.stopPropagation(),i.stop()}}}function Yy(e){return!!e&&e.is("attributeElement")&&e.hasClass("todo-list__label")}function Xy(e){return!e||!e.is("element","paragraph")&&!e.is("element","listItem")?!1:e.getAttribute("listType")=="todo"}/** +*/var WP=Cn("Ctrl+Enter"),UP=class extends w{static get pluginName(){return"TodoListEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[mt]}init(){let e=this.editor,t=e.model,i=e.editing,o=e.plugins.get(mt),n=e.config.get("list.multiBlock")?"paragraph":"listItem";e.commands.add("todoList",new Br(e,"todo")),e.commands.add("checkTodoList",new zP(e)),i.view.addObserver(HP),t.schema.extend("$listItem",{allowAttributes:"todoListChecked"}),t.schema.addAttributeCheck(s=>{let r=s.last;if(!r.getAttribute("listItemId")||r.getAttribute("listType")!="todo")return!1},"todoListChecked"),e.conversion.for("upcast").add(s=>{s.on("element:input",$P()),s.on("element:li",qP(),{priority:"low"}),s.on("element:label",$h({name:"label",classes:"todo-list__label"})),s.on("element:label",$h({name:"label",classes:["todo-list__label","todo-list__label_without-description"]})),s.on("element:span",$h({name:"span",classes:"todo-list__label__description"})),s.on("element:ul",jP({name:"ul",classes:"todo-list"}))}),e.conversion.for("downcast").elementToElement({model:n,view:(s,{writer:r})=>{if(rc(s,o.getListAttributeNames()))return r.createContainerElement("span",{class:"todo-list__label__description"})},converterPriority:"highest"}),o.registerDowncastStrategy({scope:"list",attributeName:"listType",setAttributeOnDowncast(s,r,a){r=="todo"?s.addClass("todo-list",a):s.removeClass("todo-list",a)}}),o.registerDowncastStrategy({scope:"itemMarker",attributeName:"todoListChecked",createElement(s,r,{dataPipeline:a}){if(r.getAttribute("listType")!="todo")return null;let l=s.createUIElement("input",{type:"checkbox",...r.getAttribute("todoListChecked")?{checked:"checked"}:null,...a?{disabled:"disabled"}:{tabindex:"-1"}});if(a)return l;let c=s.createContainerElement("span",{contenteditable:"false"},l);return c.getFillerOffset=()=>null,c},canWrapElement(s){return rc(s,o.getListAttributeNames())},createWrapperElement(s,r,{dataPipeline:a}){let l=["todo-list__label"];return rc(r,o.getListAttributeNames())||l.push("todo-list__label_without-description"),s.createAttributeElement(a?"label":"span",{class:l.join(" ")})}}),o.on("checkElement",(s,{modelElement:r,viewElement:a})=>{let l=rc(r,o.getListAttributeNames());a.hasClass("todo-list__label__description")!=l&&(s.return=!0,s.stop())}),o.on("checkElement",(s,{modelElement:r,viewElement:a})=>{let l=r.getAttribute("listType")=="todo"&&oi(r),c=!1,u=e.editing.view.createPositionBefore(a).getWalker({direction:"backward"});for(let{item:d}of u){if(d.is("element")&&e.editing.mapper.toModelElement(d))break;d.is("element","input")&&d.getAttribute("type")=="checkbox"&&(c=!0)}c!=l&&(s.return=!0,s.stop())}),o.on("postFixer",(s,{listNodes:r,writer:a})=>{for(let{node:l,previousNodeInList:c}of r){if(!c||c.getAttribute("listItemId")!=l.getAttribute("listItemId"))continue;let u=c.hasAttribute("todoListChecked"),d=l.hasAttribute("todoListChecked");d&&!u?(a.removeAttribute("todoListChecked",l),s.return=!0):!d&&u&&(a.setAttribute("todoListChecked",!0,l),s.return=!0)}}),t.document.registerPostFixer(s=>{let r=t.document.differ.getChanges(),a=!1;for(let l of r)if(l.type=="attribute"&&l.attributeKey=="listType"){let c=l.range.start.nodeAfter;l.attributeOldValue=="todo"&&c.hasAttribute("todoListChecked")&&(s.removeAttribute("todoListChecked",c),a=!0)}else if(l.type=="insert"&&l.name!="$text")for(let{item:c}of s.createRangeOn(l.position.nodeAfter))c.is("element")&&c.getAttribute("listType")!="todo"&&c.hasAttribute("todoListChecked")&&(s.removeAttribute("todoListChecked",c),a=!0);return a}),this.listenTo(i.view.document,"keydown",(s,r)=>{jt(r)===WP&&(e.execute("checkTodoList"),s.stop())},{priority:"high"}),this.listenTo(i.view.document,"todoCheckboxChange",(s,r)=>{let a=r.target;if(!a||!a.is("element","input"))return;let l=i.view.createPositionAfter(a),c=i.mapper.toModelPosition(l).parent;c&&K(c)&&c.getAttribute("listType")=="todo"&&this._handleCheckmarkChange(c)}),this.listenTo(i.view.document,"arrowKey",GP(t,e.locale),{context:"$text"}),this.listenTo(i.mapper,"viewToModelPosition",(s,r)=>{let a=r.viewPosition.parent,l=a.is("attributeElement","li")&&r.viewPosition.offset==0,c=Xy(a)&&r.viewPosition.offset<=1,u=a.is("element","span")&&a.getAttribute("contenteditable")=="false"&&Xy(a.parent);if(!l&&!c&&!u)return;let d=r.modelPosition.nodeAfter;d&&d.getAttribute("listType")=="todo"&&(r.modelPosition=t.createPositionAt(d,0))},{priority:"low"}),this._initAriaAnnouncements()}_handleCheckmarkChange(e){let t=this.editor,i=t.model,o=Array.from(i.document.selection.getRanges());i.change(n=>{n.setSelection(e,"end"),t.execute("checkTodoList"),n.setSelection(o)})}_initAriaAnnouncements(){let{model:e,ui:t,t:i}=this.editor,o=null;t&&e.document.selection.on("change:range",()=>{let n=e.document.selection.focus.parent,s=e_(o),r=e_(n);s&&!r?t.ariaLiveAnnouncer.announce(i("Leaving a to-do list")):!s&&r&&t.ariaLiveAnnouncer.announce(i("Entering a to-do list")),o=n})}};function qP(){return(e,t,i)=>{let{writer:o,schema:n}=i;if(!t.modelRange)return;let s=Array.from(t.modelRange.getItems({shallow:!0})).filter(r=>r.getAttribute("listType")==="todo"&&n.checkAttribute(r,"listItemId")).reduce((r,a)=>{let l=a.getAttribute("listItemId");return r.has(l)||r.set(l,Ii(a)),r},new Map);for(let[,r]of s.entries())if(r.some(a=>a.getAttribute("todoListChecked")))for(let a of r)o.setAttribute("todoListChecked",!0,a)}}function $P(){return(e,t,i)=>{let o=t.modelCursor,n=o.parent,s=t.viewItem;if(!i.consumable.test(s,{name:!0})||s.getAttribute("type")!="checkbox"||!o.isAtStart||!n.hasAttribute("listType"))return;i.consumable.consume(s,{name:!0});let r=i.writer;r.setAttribute("listType","todo",n),t.viewItem.hasAttribute("checked")&&r.setAttribute("todoListChecked",!0,n),t.modelRange=r.createRange(o)}}function $h(e){let t=new We(e);return(i,o,n)=>{let s=t.match(o.viewItem);s&&n.consumable.consume(o.viewItem,s.match)&&Object.assign(o,n.convertChildren(o.viewItem,o.modelCursor))}}function jP(e){let t=new We(e);return(i,o,n)=>{let s=t.match(o.viewItem);if(!s)return;let r=s.match;r.name=!1,n.consumable.consume(o.viewItem,r)}}function rc(e,t){return(e.is("element","paragraph")||e.is("element","listItem"))&&e.getAttribute("listType")=="todo"&&oi(e)&&KP(e,t)}function KP(e,t){for(let i of e.getAttributeKeys())if(!i.startsWith("selection:")&&!t.includes(i))return!1;return!0}function GP(e,t){return(i,o)=>{let n=yo(o.keyCode,t.contentLanguageDirection),s=e.schema,r=e.document.selection;if(!r.isCollapsed)return;let a=r.getFirstPosition(),l=a.parent;if(n=="right"&&a.isAtEnd){let c=s.getNearestSelectionRange(e.createPositionAfter(l),"forward");if(!c)return;let u=c.start.parent;u&&K(u)&&u.getAttribute("listType")=="todo"&&(e.change(d=>d.setSelection(c)),o.preventDefault(),o.stopPropagation(),i.stop())}else if(n=="left"&&a.isAtStart&&K(l)&&l.getAttribute("listType")=="todo"){let c=s.getNearestSelectionRange(e.createPositionBefore(l),"backward");if(!c)return;e.change(u=>u.setSelection(c)),o.preventDefault(),o.stopPropagation(),i.stop()}}}function Xy(e){return!!e&&e.is("attributeElement")&&e.hasClass("todo-list__label")}function e_(e){return!e||!e.is("element","paragraph")&&!e.is("element","listItem")?!1:e.getAttribute("listType")=="todo"}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var KP=class extends y{static get pluginName(){return"TodoListUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor.t;Kh(this.editor,"todoList",e("To-do List"),pb)}};/** +*/var JP=class extends w{static get pluginName(){return"TodoListUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor.t;Jh(this.editor,"todoList",e("To-do List"),wb)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var a_=class extends y{static get requires(){return[HP,KP]}static get pluginName(){return"TodoList"}static get isOfficialPlugin(){return!0}};/** +*/var l_=class extends w{static get requires(){return[UP,JP]}static get pluginName(){return"TodoList"}static get isOfficialPlugin(){return!0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -1942,7 +1942,7 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var l_='';var zr=class extends y{static get pluginName(){return"OPHelpLinkPlugin"}init(){let t=this.editor,i=t.config.get("openProject.helpURL");t.ui.componentFactory.add("openProjectShowFormattingHelp",o=>{let n=new I(o);return n.set({label:window.I18n.t("js.inplace.link_formatting_help"),icon:l_,tooltip:!0}),n.on("execute",()=>{window.open(i,"_blank")}),n})}};var c_=` +*/var c_='';var zr=class extends w{static get pluginName(){return"OPHelpLinkPlugin"}init(){let t=this.editor,i=t.config.get("openProject.helpURL");t.ui.componentFactory.add("openProjectShowFormattingHelp",o=>{let n=new I(o);return n.set({label:window.I18n.t("js.inplace.link_formatting_help"),icon:c_,tooltip:!0}),n.on("execute",()=>{window.open(i,"_blank")}),n})}};var u_=` -`;var d_=Symbol("isOPCodeBlock");function ZP(e,t,i){return t.setCustomProperty(d_,!0,e),me(e,t,{label:i})}function ac(e){return!!e.getCustomProperty(d_)&&z(e)}function h_(e){let t=e.getSelectedElement();return!!(t&&ac(t))}function f_(e,t,i){let o=t.createContainerElement("pre",{title:window.I18n.t("js.editor.macro.toolbar_help")});return Jh(t,e,o),ZP(o,t,i)}function Jh(e,t,i){let n=(t.getAttribute("opCodeblockLanguage")||"language-text").replace(/^language-/,""),s=e.createContainerElement("div",{class:"op-uc-code-block--language"});u_(e,n,s,"text"),e.insert(e.createPositionAt(i,0),s);let r=t.getAttribute("opCodeblockContent");u_(e,r,i,"(empty)")}function u_(e,t,i,o){let n=e.createText(t||o);e.insert(e.createPositionAt(i,0),n)}function m_(){return t=>{t.on("insert:codeblock",e,{priority:"high"})};function e(t,i,o){let n=i.item,s=n.getAttribute("opCodeblockLanguage")||"language-text",r=n.getAttribute("opCodeblockContent");o.consumable.consume(n,"insert");let a=o.writer,l=a.createContainerElement("pre"),c=a.createContainerElement("div",{class:"op-uc-code-block--language"}),u=a.createContainerElement("code",{class:s}),d=a.createText(s),h=a.createText(r);a.insert(a.createPositionAt(u,0),h),a.insert(a.createPositionAt(c,0),d),a.insert(a.createPositionAt(l,0),c),a.insert(a.createPositionAt(l,0),u),o.mapper.bindElements(n,u),o.mapper.bindElements(n,l),o.mapper.bindElements(n,c);let f=o.mapper.toViewPosition(i.range.start);a.insert(f,l),t.stop()}}function g_(){return t=>{t.on("element:pre",e,{priority:"high"})};function e(t,i,o){if(!o.consumable.test(i.viewItem,{name:!0}))return;let n=Array.from(i.viewItem.getChildren()).find(a=>a.is("element","code"));if(!n||!o.consumable.consume(n,{name:!0}))return;let s=o.writer.createElement("codeblock");o.writer.setAttribute("opCodeblockLanguage",n.getAttribute("class"),s);let r=o.splitToAllowedParent(s,i.modelCursor);if(r){o.writer.insert(s,r.position);let a=n.getChild(0);if(a){o.consumable.consume(a,{name:!0});let l=p_(n).replace(/\n$/,"");o.writer.setAttribute("opCodeblockContent",l,s)}i.modelRange=o.writer.createRange(o.writer.createPositionBefore(s),o.writer.createPositionAfter(s)),i.modelCursor=i.modelRange.end}}}function p_(e){if(e.is("$text")||e.is("$textProxy"))return e.data;if(typeof e.getChildren!="function")return"";let t="";for(let i of e.getChildren())t+=p_(i);return t}function b_(){return t=>{t.on("attribute:opCodeblockContent",e),t.on("attribute:opCodeblockLanguage",e)};function e(t,i,o){let n=i.item;o.consumable.consume(i.item,t.name);let s=o.mapper.toViewElement(n);o.writer.remove(o.writer.createRangeOn(s.getChild(1))),o.writer.remove(o.writer.createRangeOn(s.getChild(0))),Jh(o.writer,n,s)}}var Hr=class extends $e{constructor(t){super(t),this.domEventType="dblclick"}onDomEvent(t){this.fire(t.type,t)}};var Wr=class extends y{static get pluginName(){return"CodeBlockEditing"}init(){let t=this.editor,i=t.model.schema,o=t.conversion,n=t.editing.view,s=n.document,r=Re(t);i.register("codeblock",{isObject:!0,isBlock:!0,allowContentOf:"$block",allowWhere:["$root","$block"],allowIn:["$root"],allowAttributes:["opCodeblockLanguage","opCodeblockContent"]}),o.for("upcast").add(g_()),o.for("editingDowncast").elementToElement({model:"codeblock",view:(a,{writer:l})=>f_(a,l,"Code block")}).add(b_()),o.for("dataDowncast").add(m_()),this.editor.editing.mapper.on("viewToModelPosition",t2(this.editor.model,a=>a.hasClass("op-uc-code-block"))),n.addObserver(Hr),this.listenTo(s,"dblclick",(a,l)=>{let c=l.target,u=l.domEvent;if(u.shiftKey||u.altKey||u.metaKey||!ac(c)&&(c=c.findAncestor(ac),!c))return;l.preventDefault(),l.stopPropagation();let d=t.editing.mapper.toModelElement(c),h=r.services.macros,f=d.getAttribute("opCodeblockLanguage"),m=d.getAttribute("opCodeblockContent");h.editCodeBlock(m,f).then(g=>t.model.change(b=>{b.setAttribute("opCodeblockLanguage",g.languageClass,d),b.setAttribute("opCodeblockContent",g.content,d)}))}),t.ui.componentFactory.add("insertCodeBlock",a=>{let l=new I(a);return l.set({label:window.I18n.t("js.editor.macro.code_block.button"),icon:c_,tooltip:!0}),l.on("execute",()=>{r.services.macros.editCodeBlock().then(c=>t.model.change(u=>{let d=u.createElement("codeblock");u.setAttribute("opCodeblockLanguage",c.languageClass,d),u.setAttribute("opCodeblockContent",c.content,d),t.model.insertContent(d,t.model.document.selection)}))}),l})}};var Ur=class extends y{static get requires(){return[re]}static get pluginName(){return"CodeBlockToolbar"}init(){let t=this.editor,i=this.editor.model,o=Re(t);Zi(t,"opEditCodeBlock",n=>{let s=o.services.macros,r=n.getAttribute("opCodeblockLanguage"),a=n.getAttribute("opCodeblockContent");s.editCodeBlock(a,r).then(l=>i.change(c=>{c.setAttribute("opCodeblockLanguage",l.languageClass,n),c.setAttribute("opCodeblockContent",l.content,n)}))})}afterInit(){Qi(this,this.editor,"OPCodeBlock",h_)}};var qr=class extends y{static get pluginName(){return"CodeBlock"}static get requires(){return[Wr,Ur]}};/** +`;var h_=Symbol("isOPCodeBlock");function YP(e,t,i){return t.setCustomProperty(h_,!0,e),me(e,t,{label:i})}function cc(e){return!!e.getCustomProperty(h_)&&z(e)}function f_(e){let t=e.getSelectedElement();return!!(t&&cc(t))}function m_(e,t,i){let o=t.createContainerElement("pre",{title:window.I18n.t("js.editor.macro.toolbar_help")});return Qh(t,e,o),YP(o,t,i)}function Qh(e,t,i){let n=(t.getAttribute("opCodeblockLanguage")||"language-text").replace(/^language-/,""),s=e.createContainerElement("div",{class:"op-uc-code-block--language"});d_(e,n,s,"text"),e.insert(e.createPositionAt(i,0),s);let r=t.getAttribute("opCodeblockContent");d_(e,r,i,"(empty)")}function d_(e,t,i,o){let n=e.createText(t||o);e.insert(e.createPositionAt(i,0),n)}function g_(){return t=>{t.on("insert:codeblock",e,{priority:"high"})};function e(t,i,o){let n=i.item,s=n.getAttribute("opCodeblockLanguage")||"language-text",r=n.getAttribute("opCodeblockContent");o.consumable.consume(n,"insert");let a=o.writer,l=a.createContainerElement("pre"),c=a.createContainerElement("div",{class:"op-uc-code-block--language"}),u=a.createContainerElement("code",{class:s}),d=a.createText(s),h=a.createText(r);a.insert(a.createPositionAt(u,0),h),a.insert(a.createPositionAt(c,0),d),a.insert(a.createPositionAt(l,0),c),a.insert(a.createPositionAt(l,0),u),o.mapper.bindElements(n,u),o.mapper.bindElements(n,l),o.mapper.bindElements(n,c);let f=o.mapper.toViewPosition(i.range.start);a.insert(f,l),t.stop()}}function p_(){return t=>{t.on("element:pre",e,{priority:"high"})};function e(t,i,o){if(!o.consumable.test(i.viewItem,{name:!0}))return;let n=Array.from(i.viewItem.getChildren()).find(a=>a.is("element","code"));if(!n||!o.consumable.consume(n,{name:!0}))return;let s=o.writer.createElement("codeblock");o.writer.setAttribute("opCodeblockLanguage",n.getAttribute("class"),s);let r=o.splitToAllowedParent(s,i.modelCursor);if(r){o.writer.insert(s,r.position);let a=n.getChild(0);if(a){o.consumable.consume(a,{name:!0});let l=b_(n).replace(/\n$/,"");o.writer.setAttribute("opCodeblockContent",l,s)}i.modelRange=o.writer.createRange(o.writer.createPositionBefore(s),o.writer.createPositionAfter(s)),i.modelCursor=i.modelRange.end}}}function b_(e){if(e.is("$text")||e.is("$textProxy"))return e.data;if(typeof e.getChildren!="function")return"";let t="";for(let i of e.getChildren())t+=b_(i);return t}function w_(){return t=>{t.on("attribute:opCodeblockContent",e),t.on("attribute:opCodeblockLanguage",e)};function e(t,i,o){let n=i.item;o.consumable.consume(i.item,t.name);let s=o.mapper.toViewElement(n);o.writer.remove(o.writer.createRangeOn(s.getChild(1))),o.writer.remove(o.writer.createRangeOn(s.getChild(0))),Qh(o.writer,n,s)}}var Hr=class extends $e{constructor(t){super(t),this.domEventType="dblclick"}onDomEvent(t){this.fire(t.type,t)}};var Wr=class extends w{static get pluginName(){return"CodeBlockEditing"}init(){let t=this.editor,i=t.model.schema,o=t.conversion,n=t.editing.view,s=n.document,r=ge(t);i.register("codeblock",{isObject:!0,isBlock:!0,allowContentOf:"$block",allowWhere:["$root","$block"],allowIn:["$root"],allowAttributes:["opCodeblockLanguage","opCodeblockContent"]}),o.for("upcast").add(p_()),o.for("editingDowncast").elementToElement({model:"codeblock",view:(a,{writer:l})=>m_(a,l,"Code block")}).add(w_()),o.for("dataDowncast").add(g_()),this.editor.editing.mapper.on("viewToModelPosition",o2(this.editor.model,a=>a.hasClass("op-uc-code-block"))),n.addObserver(Hr),this.listenTo(s,"dblclick",(a,l)=>{let c=l.target,u=l.domEvent;if(u.shiftKey||u.altKey||u.metaKey||!cc(c)&&(c=c.findAncestor(cc),!c))return;l.preventDefault(),l.stopPropagation();let d=t.editing.mapper.toModelElement(c),h=r.services.macros,f=d.getAttribute("opCodeblockLanguage"),m=d.getAttribute("opCodeblockContent");h.editCodeBlock(m,f).then(g=>t.model.change(b=>{b.setAttribute("opCodeblockLanguage",g.languageClass,d),b.setAttribute("opCodeblockContent",g.content,d)}))}),t.ui.componentFactory.add("insertCodeBlock",a=>{let l=new I(a);return l.set({label:window.I18n.t("js.editor.macro.code_block.button"),icon:u_,tooltip:!0}),l.on("execute",()=>{r.services.macros.editCodeBlock().then(c=>t.model.change(u=>{let d=u.createElement("codeblock");u.setAttribute("opCodeblockLanguage",c.languageClass,d),u.setAttribute("opCodeblockContent",c.content,d),t.model.insertContent(d,t.model.document.selection)}))}),l})}};var Ur=class extends w{static get requires(){return[re]}static get pluginName(){return"CodeBlockToolbar"}init(){let t=this.editor,i=this.editor.model,o=ge(t);Qi(t,"opEditCodeBlock",n=>{let s=o.services.macros,r=n.getAttribute("opCodeblockLanguage"),a=n.getAttribute("opCodeblockContent");s.editCodeBlock(a,r).then(l=>i.change(c=>{c.setAttribute("opCodeblockLanguage",l.languageClass,n),c.setAttribute("opCodeblockContent",l.content,n)}))})}afterInit(){Yi(this,this.editor,"OPCodeBlock",f_)}};var qr=class extends w{static get pluginName(){return"CodeBlock"}static get requires(){return[Wr,Ur]}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var QP=/^(left|center|right)$/,YP=/^(left|none|right)$/;function lf(e,t){let{modelAttribute:i,styleName:o,attributeName:n,attributeType:s,viewElement:r,defaultValue:a,shouldUpcast:l=()=>!0,reduceBoxSides:c=!1}=t;e.for("upcast").attributeToAttribute({view:{name:r,styles:{[o]:/[\s\S]+/}},model:{key:i,value:(u,d,h)=>{if(!l(u))return;let f=Mo(a,"",h),m=u.getNormalizedStyle(o),g=c?fc(m):m;if(f!==g)return g;d.consumable.consume(u,{styles:o})}}}),n&&e.for("upcast").attributeToAttribute({view:{name:r,attributes:{[n]:/.+/}},model:{key:i,value:(u,d,h)=>{if(u.name=="figure"||u.hasStyle(o)||u.name=="table"&&u.parent.name=="figure"&&u.parent.hasStyle(o))return;let f=Mo(a,"",h),m=u.getAttribute(n);if(m&&s=="length"){let g=parseFloat(m);isNaN(g)?m=f:m=g+(m.includes("%")?"%":"px")}if(f!==m)return m;d.consumable.consume(u,{attributes:n})}}})}function Yh(e,t,i,o){let{conversion:n}=e;n.for("upcast").add(s=>{s.on(`element:${t}`,(r,a,l)=>{let{modelRange:c,viewItem:u}=a;if(!c)return;let d=["border-top-width","border-top-color","border-top-style","border-bottom-width","border-bottom-color","border-bottom-style","border-right-width","border-right-color","border-right-style","border-left-width","border-left-color","border-left-style"].filter(C=>u.hasStyle(C)),h=u.is("element","table")?u:u.findAncestor("table"),f=h.hasAttribute("border");if(!d.length&&!f)return;let m={styles:d};if(!l.consumable.test(u,m))return;let g=G(c.getItems({shallow:!0})),b=g.findAncestor("table",{includeSelf:!0}),k=o;b&&b.getAttribute("tableType")=="layout"&&(k={style:"none",color:"",width:""}),l.consumable.consume(u,m);let v={style:u.getNormalizedStyle("border-style"),color:u.getNormalizedStyle("border-color"),width:u.getNormalizedStyle("border-width")};if(f&&l.consumable.test(h,{attributes:"border"})){let C=parseFloat(h.getAttribute("border")||"1"),w=Number.isNaN(C)||!Number.isFinite(C)||C<0||u.name!="table"&&C>1?"1px":`${C}px`;v.width={top:w,bottom:w,right:w,left:w,...v.width||{}},u.is("element","table")&&l.consumable.consume(h,{attributes:"border"})}let _={style:fc(v.style),color:fc(v.color),width:fc(v.width)};_.style!==k.style&&l.writer.setAttribute(i.style,_.style,g),_.color!==k.color&&l.writer.setAttribute(i.color,_.color,g),_.width!==k.width&&l.writer.setAttribute(i.width,_.width,g)})})}function $r(e,t){let{modelElement:i,modelAttribute:o,styleName:n}=t;e.for("downcast").attributeToAttribute({model:{name:i,key:o},view:s=>({key:"style",value:{[n]:s}})})}function hc(e,t){let{modelAttribute:i,styleName:o}=t;e.for("downcast").add(n=>{n.on(`attribute:${i}:table`,(s,r,a)=>{let{item:l,attributeNewValue:c}=r,{mapper:u,writer:d}=a;if(!a.consumable.consume(r.item,s.name))return;let h=Array.from(u.toViewElement(l).getChildren()).find(f=>f.is("element","table"));c?d.setStyle(o,c,h):d.removeStyle(o,h)})})}function Mo(e,t,i){let o=i.modelRange&&G(i.modelRange.getItems({shallow:!0})),n=o&&o.is("element")&&o.findAncestor("table",{includeSelf:!0});return n&&n.getAttribute("tableType")==="layout"?t:e}function fc(e){if(!e)return;let t=["top","right","bottom","left"];if(!t.every(o=>e[o]))return e;let i=e.top;return t.every(o=>e[o]===i)?i:e}function Xh(e,t,i){let{conversion:o}=e;o.for("upcast").add(n=>{n.on(`element:${t}`,(s,r,a)=>{let{modelRange:l,viewItem:c}=r;if(!l)return;if(c.is("element","table")){a.consumable.consume(c,{attributes:"cellpadding"});return}let u=c.findAncestor("table");if(!u.hasAttribute("cellpadding")||!a.consumable.test(u,{attributes:"cellpadding"}))return;let d=l?.start?.nodeAfter,h=parseFloat(u.getAttribute("cellpadding")||"1"),f=Number.isNaN(h)||!Number.isFinite(h)||h<0?"0px":`${h}px`,m=d.getAttribute("tableCellPadding");if(!m)i!==f&&a.writer.setAttribute("tableCellPadding",f,d);else if(typeof m=="object"){let g={...i!==f&&{top:f},...i!==f&&{right:f},...i!==f&&{bottom:f},...i!==f&&{left:f},...m};a.writer.setAttribute("tableCellPadding",g,d)}},{priority:"low"})})}var je={left:{className:"table-style-align-left"},center:{className:"table-style-align-center"},right:{className:"table-style-align-right"},blockLeft:{className:"table-style-block-align-left"},blockRight:{className:"table-style-block-align-right"}},XP=[{view:{name:/^(table|figure)$/,styles:{float:YP}},getAlign:e=>{let t=e.getStyle("float");return t==="none"&&(t="center"),t},getConsumables(e){let t=e.getStyle("float"),i=["float"];return t==="left"&&e.hasStyle("margin-right")?i.push("margin-right"):t==="right"&&e.hasStyle("margin-left")&&i.push("margin-left"),{styles:i}}},{view:{name:/^(table|figure)$/,styles:{"margin-left":"auto","margin-right":"auto"}},getAlign:()=>"center",getConsumables:()=>({styles:["margin-left","margin-right"]})},{view:{name:/^(table|figure)$/,key:"class",value:"table-style-align-left"},getAlign:()=>"left",getConsumables(){return{classes:je.left.className}}},{view:{name:/^(table|figure)$/,key:"class",value:je.right.className},getAlign:()=>"right",getConsumables(){return{classes:je.right.className}}},{view:{name:/^(table|figure)$/,key:"class",value:je.center.className},getAlign:()=>"center",getConsumables(){return{classes:je.center.className}}},{view:{name:/^(table|figure)$/,key:"class",value:je.blockLeft.className},getAlign:()=>"blockLeft",getConsumables(){return{classes:je.blockLeft.className}}},{view:{name:/^(table|figure)$/,key:"class",value:je.blockRight.className},getAlign:()=>"blockRight",getConsumables(){return{classes:je.blockRight.className}}},{view:{name:/^(table|figure)$/,styles:{"margin-left":"0","margin-right":"auto"}},getAlign:()=>"blockLeft",getConsumables(){return{styles:["margin-left","margin-right"]}}},{view:{name:/^(table|figure)$/,styles:{"margin-left":"auto","margin-right":"0"}},getAlign:()=>"blockRight",getConsumables(){return{styles:["margin-left","margin-right"]}}},{view:{name:"table",attributes:{align:QP}},getAlign:e=>e.getAttribute("align"),getConsumables(){return{attributes:"align"}}}],lc={center:{align:"center",style:"margin-left: auto; margin-right: auto;",className:"table-style-align-center"},left:{align:"left",style:"float: left;",className:"table-style-align-left"},right:{align:"right",style:"float: right;",className:"table-style-align-right"},blockLeft:{align:void 0,style:"margin-left: 0; margin-right: auto;",className:je.blockLeft.className},blockRight:{align:void 0,style:"margin-left: auto; margin-right: 0;",className:je.blockRight.className}};/** +*/var XP=/^(left|center|right)$/,eR=/^(left|none|right)$/;function uf(e,t){let{modelAttribute:i,styleName:o,attributeName:n,attributeType:s,viewElement:r,defaultValue:a,shouldUpcast:l=()=>!0,reduceBoxSides:c=!1}=t;e.for("upcast").attributeToAttribute({view:{name:r,styles:{[o]:/[\s\S]+/}},model:{key:i,value:(u,d,h)=>{if(!l(u))return;let f=Mo(a,"",h),m=u.getNormalizedStyle(o),g=c?gc(m):m;if(f!==g)return g;d.consumable.consume(u,{styles:o})}}}),n&&e.for("upcast").attributeToAttribute({view:{name:r,attributes:{[n]:/.+/}},model:{key:i,value:(u,d,h)=>{if(u.name=="figure"||u.hasStyle(o)||u.name=="table"&&u.parent.name=="figure"&&u.parent.hasStyle(o))return;let f=Mo(a,"",h),m=u.getAttribute(n);if(m&&s=="length"){let g=parseFloat(m);isNaN(g)?m=f:m=g+(m.includes("%")?"%":"px")}if(f!==m)return m;d.consumable.consume(u,{attributes:n})}}})}function ef(e,t,i,o){let{conversion:n}=e;n.for("upcast").add(s=>{s.on(`element:${t}`,(r,a,l)=>{let{modelRange:c,viewItem:u}=a;if(!c)return;let d=["border-top-width","border-top-color","border-top-style","border-bottom-width","border-bottom-color","border-bottom-style","border-right-width","border-right-color","border-right-style","border-left-width","border-left-color","border-left-style"].filter(C=>u.hasStyle(C)),h=u.is("element","table")?u:u.findAncestor("table"),f=h.hasAttribute("border");if(!d.length&&!f)return;let m={styles:d};if(!l.consumable.test(u,m))return;let g=J(c.getItems({shallow:!0})),b=g.findAncestor("table",{includeSelf:!0}),k=o;b&&b.getAttribute("tableType")=="layout"&&(k={style:"none",color:"",width:""}),l.consumable.consume(u,m);let v={style:u.getNormalizedStyle("border-style"),color:u.getNormalizedStyle("border-color"),width:u.getNormalizedStyle("border-width")};if(f&&l.consumable.test(h,{attributes:"border"})){let C=parseFloat(h.getAttribute("border")||"1"),y=Number.isNaN(C)||!Number.isFinite(C)||C<0||u.name!="table"&&C>1?"1px":`${C}px`;v.width={top:y,bottom:y,right:y,left:y,...v.width||{}},u.is("element","table")&&l.consumable.consume(h,{attributes:"border"})}let _={style:gc(v.style),color:gc(v.color),width:gc(v.width)};_.style!==k.style&&l.writer.setAttribute(i.style,_.style,g),_.color!==k.color&&l.writer.setAttribute(i.color,_.color,g),_.width!==k.width&&l.writer.setAttribute(i.width,_.width,g)})})}function $r(e,t){let{modelElement:i,modelAttribute:o,styleName:n}=t;e.for("downcast").attributeToAttribute({model:{name:i,key:o},view:s=>({key:"style",value:{[n]:s}})})}function mc(e,t){let{modelAttribute:i,styleName:o}=t;e.for("downcast").add(n=>{n.on(`attribute:${i}:table`,(s,r,a)=>{let{item:l,attributeNewValue:c}=r,{mapper:u,writer:d}=a;if(!a.consumable.consume(r.item,s.name))return;let h=Array.from(u.toViewElement(l).getChildren()).find(f=>f.is("element","table"));c?d.setStyle(o,c,h):d.removeStyle(o,h)})})}function Mo(e,t,i){let o=i.modelRange&&J(i.modelRange.getItems({shallow:!0})),n=o&&o.is("element")&&o.findAncestor("table",{includeSelf:!0});return n&&n.getAttribute("tableType")==="layout"?t:e}function gc(e){if(!e)return;let t=["top","right","bottom","left"];if(!t.every(o=>e[o]))return e;let i=e.top;return t.every(o=>e[o]===i)?i:e}function tf(e,t,i){let{conversion:o}=e;o.for("upcast").add(n=>{n.on(`element:${t}`,(s,r,a)=>{let{modelRange:l,viewItem:c}=r;if(!l)return;if(c.is("element","table")){a.consumable.consume(c,{attributes:"cellpadding"});return}let u=c.findAncestor("table");if(!u.hasAttribute("cellpadding")||!a.consumable.test(u,{attributes:"cellpadding"}))return;let d=l?.start?.nodeAfter,h=parseFloat(u.getAttribute("cellpadding")||"1"),f=Number.isNaN(h)||!Number.isFinite(h)||h<0?"0px":`${h}px`,m=d.getAttribute("tableCellPadding");if(!m)i!==f&&a.writer.setAttribute("tableCellPadding",f,d);else if(typeof m=="object"){let g={...i!==f&&{top:f},...i!==f&&{right:f},...i!==f&&{bottom:f},...i!==f&&{left:f},...m};a.writer.setAttribute("tableCellPadding",g,d)}},{priority:"low"})})}var je={left:{className:"table-style-align-left"},center:{className:"table-style-align-center"},right:{className:"table-style-align-right"},blockLeft:{className:"table-style-block-align-left"},blockRight:{className:"table-style-block-align-right"}},tR=[{view:{name:/^(table|figure)$/,styles:{float:eR}},getAlign:e=>{let t=e.getStyle("float");return t==="none"&&(t="center"),t},getConsumables(e){let t=e.getStyle("float"),i=["float"];return t==="left"&&e.hasStyle("margin-right")?i.push("margin-right"):t==="right"&&e.hasStyle("margin-left")&&i.push("margin-left"),{styles:i}}},{view:{name:/^(table|figure)$/,styles:{"margin-left":"auto","margin-right":"auto"}},getAlign:()=>"center",getConsumables:()=>({styles:["margin-left","margin-right"]})},{view:{name:/^(table|figure)$/,key:"class",value:"table-style-align-left"},getAlign:()=>"left",getConsumables(){return{classes:je.left.className}}},{view:{name:/^(table|figure)$/,key:"class",value:je.right.className},getAlign:()=>"right",getConsumables(){return{classes:je.right.className}}},{view:{name:/^(table|figure)$/,key:"class",value:je.center.className},getAlign:()=>"center",getConsumables(){return{classes:je.center.className}}},{view:{name:/^(table|figure)$/,key:"class",value:je.blockLeft.className},getAlign:()=>"blockLeft",getConsumables(){return{classes:je.blockLeft.className}}},{view:{name:/^(table|figure)$/,key:"class",value:je.blockRight.className},getAlign:()=>"blockRight",getConsumables(){return{classes:je.blockRight.className}}},{view:{name:/^(table|figure)$/,styles:{"margin-left":"0","margin-right":"auto"}},getAlign:()=>"blockLeft",getConsumables(){return{styles:["margin-left","margin-right"]}}},{view:{name:/^(table|figure)$/,styles:{"margin-left":"auto","margin-right":"0"}},getAlign:()=>"blockRight",getConsumables(){return{styles:["margin-left","margin-right"]}}},{view:{name:"table",attributes:{align:XP}},getAlign:e=>e.getAttribute("align"),getConsumables(){return{attributes:"align"}}}],uc={center:{align:"center",style:"margin-left: auto; margin-right: auto;",className:"table-style-align-center"},left:{align:"left",style:"float: left;",className:"table-style-align-left"},right:{align:"right",style:"float: right;",className:"table-style-align-right"},blockLeft:{align:void 0,style:"margin-left: 0; margin-right: auto;",className:je.blockLeft.className},blockRight:{align:void 0,style:"margin-left: auto; margin-right: 0;",className:je.blockRight.className}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var U=class{_table;_startRow;_endRow;_startColumn;_endColumn;_includeAllSlots;_skipRows;_row;_rowIndex;_column;_cellIndex;_spannedCells;_nextCellAtColumn;_jumpedToStartRow=!1;constructor(e,t={}){this._table=e,this._startRow=t.row!==void 0?t.row:t.startRow||0,this._endRow=t.row!==void 0?t.row:t.endRow,this._startColumn=t.column!==void 0?t.column:t.startColumn||0,this._endColumn=t.column!==void 0?t.column:t.endColumn,this._includeAllSlots=!!t.includeAllSlots,this._skipRows=new Set,this._row=0,this._rowIndex=0,this._column=0,this._cellIndex=0,this._spannedCells=new Map,this._nextCellAtColumn=-1}[Symbol.iterator](){return this}next(){this._canJumpToStartRow()&&this._jumpToNonSpannedRowClosestToStartRow();let e=this._table.getChild(this._rowIndex);if(!e||this._isOverEndRow())return{done:!0,value:void 0};if(!e.is("element","tableRow"))return this._rowIndex++,this.next();if(this._isOverEndColumn())return this._advanceToNextRow();let t=null,i=this._getSpanned();if(i)this._includeAllSlots&&!this._shouldSkipSlot()&&(t=this._formatOutValue(i.cell,i.row,i.column));else{let o=e.getChild(this._cellIndex);if(!o)return this._advanceToNextRow();let n=parseInt(o.getAttribute("colspan")||"1"),s=parseInt(o.getAttribute("rowspan")||"1");(n>1||s>1)&&this._recordSpans(o,s,n),this._shouldSkipSlot()||(t=this._formatOutValue(o)),this._nextCellAtColumn=this._column+n}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,t||this.next()}skipRow(e){this._skipRows.add(e)}_advanceToNextRow(){return this._row++,this._rowIndex++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next()}_isOverEndRow(){return this._endRow!==void 0&&this._row>this._endRow}_isOverEndColumn(){return this._endColumn!==void 0&&this._column>this._endColumn}_formatOutValue(e,t=this._row,i=this._column){return{done:!1,value:new eR(this,e,t,i)}}_shouldSkipSlot(){let e=this._skipRows.has(this._row),t=this._rowthis._endColumn;return e||t||i||o}_getSpanned(){let e=this._spannedCells.get(this._row);return e&&e.get(this._column)||null}_recordSpans(e,t,i){let o={cell:e,row:this._row,column:this._column};for(let n=this._row;n0&&!this._jumpedToStartRow}_jumpToNonSpannedRowClosestToStartRow(){let e=this._getRowLength(0);for(let t=this._startRow;!this._jumpedToStartRow;t--)e===this._getRowLength(t)&&(this._row=t,this._rowIndex=t,this._jumpedToStartRow=!0)}_getRowLength(e){return[...this._table.getChild(e).getChildren()].reduce((t,i)=>t+parseInt(i.getAttribute("colspan")||"1"),0)}},eR=class{cell;row;column;cellAnchorRow;cellAnchorColumn;_cellIndex;_rowIndex;_table;constructor(e,t,i,o){this.cell=t,this.row=e._row,this.column=e._column,this.cellAnchorRow=i,this.cellAnchorColumn=o,this._cellIndex=e._cellIndex,this._rowIndex=e._rowIndex,this._table=e._table}get isAnchor(){return this.row===this.cellAnchorRow&&this.column===this.cellAnchorColumn}get cellWidth(){return parseInt(this.cell.getAttribute("colspan")||"1")}get cellHeight(){return parseInt(this.cell.getAttribute("rowspan")||"1")}get rowIndex(){return this._rowIndex}getPositionBefore(){return this._table.root.document.model.createPositionAt(this._table.getChild(this.row),this._cellIndex)}};/** +*/var U=class{_table;_startRow;_endRow;_startColumn;_endColumn;_includeAllSlots;_skipRows;_row;_rowIndex;_column;_cellIndex;_spannedCells;_nextCellAtColumn;_jumpedToStartRow=!1;constructor(e,t={}){this._table=e,this._startRow=t.row!==void 0?t.row:t.startRow||0,this._endRow=t.row!==void 0?t.row:t.endRow,this._startColumn=t.column!==void 0?t.column:t.startColumn||0,this._endColumn=t.column!==void 0?t.column:t.endColumn,this._includeAllSlots=!!t.includeAllSlots,this._skipRows=new Set,this._row=0,this._rowIndex=0,this._column=0,this._cellIndex=0,this._spannedCells=new Map,this._nextCellAtColumn=-1}[Symbol.iterator](){return this}next(){this._canJumpToStartRow()&&this._jumpToNonSpannedRowClosestToStartRow();let e=this._table.getChild(this._rowIndex);if(!e||this._isOverEndRow())return{done:!0,value:void 0};if(!e.is("element","tableRow"))return this._rowIndex++,this.next();if(this._isOverEndColumn())return this._advanceToNextRow();let t=null,i=this._getSpanned();if(i)this._includeAllSlots&&!this._shouldSkipSlot()&&(t=this._formatOutValue(i.cell,i.row,i.column));else{let o=e.getChild(this._cellIndex);if(!o)return this._advanceToNextRow();let n=parseInt(o.getAttribute("colspan")||"1"),s=parseInt(o.getAttribute("rowspan")||"1");(n>1||s>1)&&this._recordSpans(o,s,n),this._shouldSkipSlot()||(t=this._formatOutValue(o)),this._nextCellAtColumn=this._column+n}return this._column++,this._column==this._nextCellAtColumn&&this._cellIndex++,t||this.next()}skipRow(e){this._skipRows.add(e)}_advanceToNextRow(){return this._row++,this._rowIndex++,this._column=0,this._cellIndex=0,this._nextCellAtColumn=-1,this.next()}_isOverEndRow(){return this._endRow!==void 0&&this._row>this._endRow}_isOverEndColumn(){return this._endColumn!==void 0&&this._column>this._endColumn}_formatOutValue(e,t=this._row,i=this._column){return{done:!1,value:new iR(this,e,t,i)}}_shouldSkipSlot(){let e=this._skipRows.has(this._row),t=this._rowthis._endColumn;return e||t||i||o}_getSpanned(){let e=this._spannedCells.get(this._row);return e&&e.get(this._column)||null}_recordSpans(e,t,i){let o={cell:e,row:this._row,column:this._column};for(let n=this._row;n0&&!this._jumpedToStartRow}_jumpToNonSpannedRowClosestToStartRow(){let e=this._getRowLength(0);for(let t=this._startRow;!this._jumpedToStartRow;t--)e===this._getRowLength(t)&&(this._row=t,this._rowIndex=t,this._jumpedToStartRow=!0)}_getRowLength(e){return[...this._table.getChild(e).getChildren()].reduce((t,i)=>t+parseInt(i.getAttribute("colspan")||"1"),0)}},iR=class{cell;row;column;cellAnchorRow;cellAnchorColumn;_cellIndex;_rowIndex;_table;constructor(e,t,i,o){this.cell=t,this.row=e._row,this.column=e._column,this.cellAnchorRow=i,this.cellAnchorColumn=o,this._cellIndex=e._cellIndex,this._rowIndex=e._rowIndex,this._table=e._table}get isAnchor(){return this.row===this.cellAnchorRow&&this.column===this.cellAnchorColumn}get cellWidth(){return parseInt(this.cell.getAttribute("colspan")||"1")}get cellHeight(){return parseInt(this.cell.getAttribute("rowspan")||"1")}get rowIndex(){return this._rowIndex}getPositionBefore(){return this._table.root.document.model.createPositionAt(this._table.getChild(this.row),this._cellIndex)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */function Kr(e){return e==="header"||e==="header-row"||e==="header-column"}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function te(e,t,i,o,n=1){t!=null&&n!==void 0&&n!==null&&t>n?o.setAttribute(e,t,i):o.removeAttribute(e,i)}function Bo(e,t,i={}){let o=e.createElement("tableCell",i);return e.insertElement("paragraph",o),e.insert(o,t),o}function ef(e,t){let i=t.parent.parent,o=parseInt(i.getAttribute("headingColumns")||"0"),{column:n}=e.getCellLocation(t);return!!o&&nn?o.setAttribute(e,t,i):o.removeAttribute(e,i)}function Bo(e,t,i={}){let o=e.createElement("tableCell",i);return e.insertElement("paragraph",o),e.insert(o,t),o}function of(e,t){let i=t.parent.parent,o=parseInt(i.getAttribute("headingColumns")||"0"),{column:n}=e.getCellLocation(t);return!!o&&n1&&(l.rowspan=c);let u=parseInt(e.getAttribute("colspan")||"1");u>1&&(l.colspan=u);let d=s,h=d+a,f=[...new U(n,{startRow:d,endRow:h,includeAllSlots:!0})],m=null,g;for(let b of f){let{row:k,column:v,cell:_}=b;_===e&&g===void 0&&(g=v),g!==void 0&&g===v&&k===h&&(m=Bo(i,b.getPositionBefore(),l))}return te("rowspan",a,e,i),m}function N_(e,t){let i=[],o=new U(e);for(let n of o){let{column:s,cellWidth:r}=n,a=s+r-1;s1&&(r.colspan=a);let l=parseInt(e.getAttribute("rowspan")||"1");l>1&&(r.rowspan=l);let c=Bo(o,o.createPositionAfter(e),r);return te("colspan",s,e,o),c}function H_(e,t,i,o,n,s){let r=parseInt(e.getAttribute("colspan")||"1"),a=parseInt(e.getAttribute("rowspan")||"1");if(i+r-1>n){let l=n-i+1;te("colspan",l,e,s,1)}if(t+a-1>o){let l=o-t+1;te("rowspan",l,e,s,1)}}function oR(e,t,i,o,n){let s=parseInt(t.getAttribute("headingRows")||"0");if(s>0){let a=s-i;te("headingRows",a,e,n,0)}let r=parseInt(t.getAttribute("headingColumns")||"0");if(r>0){let a=r-o;te("headingColumns",a,e,n,0)}}function nR(e,t,i,o,n){let s=Array.from(t.getChildren()).reduce((c,u)=>u.is("element","tableRow")?c+1:c,0),r=parseInt(t.getAttribute("footerRows")||"0"),a=s-r;if(r<1)return;let l=0;o>=a&&(l=o-Math.max(a,i)+1),te("footerRows",l,e,n,0)}function tf(e,t){let i=t.getColumns(e),o=new Array(i).fill(0);for(let{column:s}of new U(e))o[s]++;let n=o.reduce((s,r,a)=>r?s:[...s,a],[]);if(n.length>0){let s=n[n.length-1];return t.removeColumns(e,{at:s}),!0}return!1}function of(e,t){let i=[],o=t.getRows(e);for(let n=0;n0){let n=i[i.length-1];return t.removeRows(e,{at:n}),!0}return!1}function df(e,t){tf(e,t)||of(e,t)}function W_(e,t){let i=Array.from(new U(e,{startColumn:t.firstColumn,endColumn:t.lastColumn,row:t.lastRow}));if(i.every(({cellHeight:n})=>n===1))return t.lastRow;let o=i[0].cellHeight-1;return t.lastRow+o}function U_(e,t){let i=Array.from(new U(e,{startRow:t.firstRow,endRow:t.lastRow,column:t.lastColumn}));if(i.every(({cellWidth:n})=>n===1))return t.lastColumn;let o=i[0].cellWidth-1;return t.lastColumn+o}function sR(e){for(let t of e.getChildren())if(t.is("element","table"))return t}/** +*/function N_(e,t,i){let{startRow:o,startColumn:n,endRow:s,endColumn:r}=t,a=i.createElement("table"),l=e.getAttribute("tableType");l&&i.setAttribute("tableType",l,a);let c=s-o+1;for(let d=0;d1&&(l.rowspan=c);let u=parseInt(e.getAttribute("colspan")||"1");u>1&&(l.colspan=u);let d=s,h=d+a,f=[...new U(n,{startRow:d,endRow:h,includeAllSlots:!0})],m=null,g;for(let b of f){let{row:k,column:v,cell:_}=b;_===e&&g===void 0&&(g=v),g!==void 0&&g===v&&k===h&&(m=Bo(i,b.getPositionBefore(),l))}return te("rowspan",a,e,i),m}function z_(e,t){let i=[],o=new U(e);for(let n of o){let{column:s,cellWidth:r}=n,a=s+r-1;s1&&(r.colspan=a);let l=parseInt(e.getAttribute("rowspan")||"1");l>1&&(r.rowspan=l);let c=Bo(o,o.createPositionAfter(e),r);return te("colspan",s,e,o),c}function W_(e,t,i,o,n,s){let r=parseInt(e.getAttribute("colspan")||"1"),a=parseInt(e.getAttribute("rowspan")||"1");if(i+r-1>n){let l=n-i+1;te("colspan",l,e,s,1)}if(t+a-1>o){let l=o-t+1;te("rowspan",l,e,s,1)}}function sR(e,t,i,o,n){let s=parseInt(t.getAttribute("headingRows")||"0");if(s>0){let a=s-i;te("headingRows",a,e,n,0)}let r=parseInt(t.getAttribute("headingColumns")||"0");if(r>0){let a=r-o;te("headingColumns",a,e,n,0)}}function rR(e,t,i,o,n){let s=Array.from(t.getChildren()).reduce((c,u)=>u.is("element","tableRow")?c+1:c,0),r=parseInt(t.getAttribute("footerRows")||"0"),a=s-r;if(r<1)return;let l=0;o>=a&&(l=o-Math.max(a,i)+1),te("footerRows",l,e,n,0)}function nf(e,t){let i=t.getColumns(e),o=new Array(i).fill(0);for(let{column:s}of new U(e))o[s]++;let n=o.reduce((s,r,a)=>r?s:[...s,a],[]);if(n.length>0){let s=n[n.length-1];return t.removeColumns(e,{at:s}),!0}return!1}function sf(e,t){let i=[],o=t.getRows(e);for(let n=0;n0){let n=i[i.length-1];return t.removeRows(e,{at:n}),!0}return!1}function ff(e,t){nf(e,t)||sf(e,t)}function U_(e,t){let i=Array.from(new U(e,{startColumn:t.firstColumn,endColumn:t.lastColumn,row:t.lastRow}));if(i.every(({cellHeight:n})=>n===1))return t.lastRow;let o=i[0].cellHeight-1;return t.lastRow+o}function q_(e,t){let i=Array.from(new U(e,{startRow:t.firstRow,endRow:t.lastRow,column:t.lastColumn}));if(i.every(({cellWidth:n})=>n===1))return t.lastColumn;let o=i[0].cellWidth-1;return t.lastColumn+o}function aR(e){for(let t of e.getChildren())if(t.is("element","table"))return t}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function rR(){return e=>{e.on("element:figure",(t,i,o)=>{if(!o.consumable.test(i.viewItem,{name:!0,classes:"table"}))return;let n=sR(i.viewItem);if(!n||!o.consumable.test(n,{name:!0}))return;o.consumable.consume(i.viewItem,{name:!0,classes:"table"});let s=o.convertItem(n,i.modelCursor);/* istanbul ignore if: defensive guard for the `ModelRange | null` return type -- @preserve */if(!s.modelRange){o.consumable.revert(i.viewItem,{name:!0,classes:"table"});return}let r=G(s.modelRange.getItems());if(!r||!r.is("element","table")){o.consumable.revert(i.viewItem,{name:!0,classes:"table"}),s.modelRange.isCollapsed||(i.modelRange=s.modelRange,i.modelCursor=s.modelCursor);return}o.convertChildren(i.viewItem,o.writer.createPositionAt(r,"end")),o.updateConversionResult(r,i)})}}function aR(e){return t=>{t.on("element:table",(i,o,n)=>{let s=o.viewItem;if(!n.consumable.test(s,{name:!0}))return;let{rows:r,headingRows:a,headingColumns:l,footerRows:c}=cR(s),u={};l&&(u.headingColumns=l),a&&(u.headingRows=a),e.enableFooters&&c&&(u.footerRows=c);let d=n.writer.createElement("table",u);if(n.safeInsert(d,o.modelCursor)){if(n.consumable.consume(s,{name:!0}),r.forEach(h=>n.convertItem(h,n.writer.createPositionAt(d,"end"))),n.convertChildren(s,n.writer.createPositionAt(d,"end")),d.isEmpty){let h=n.writer.createElement("tableRow");n.writer.insert(h,n.writer.createPositionAt(d,"end")),Bo(n.writer,n.writer.createPositionAt(h,"end"))}n.updateConversionResult(d,o)}})}}function lR(){return e=>{e.on("element:tr",(t,i)=>{i.viewItem.isEmpty&&i.modelCursor.index==0&&t.stop()},{priority:"high"})}}function w_(e){return t=>{t.on(`element:${e}`,(i,o,{writer:n})=>{if(!o.modelRange)return;let s=o.modelRange.start.nodeAfter,r=n.createPositionAt(s,0);if(o.viewItem.isEmpty){n.insertElement("paragraph",r);return}let a=Array.from(s.getChildren());if(a.every(l=>l.is("element","$marker"))){let l=n.createElement("paragraph");n.insert(l,n.createPositionAt(s,0));for(let c of a)n.move(n.createRangeOn(c),n.createPositionAt(l,"end"))}},{priority:"low"})}}function cR(e){let t,i=!0,o=[],n=[],s=[],r=null,a=null,l=Array.from(e.getChildren());for(let u=0;ug.is("element","tr")),f=null,m=null;for(let g of h){let b=Array.from(g.getChildren()).filter(k=>k.is("element","td")||k.is("element","th"));if(d.name==="tfoot"){a||={element:d,rows:h},i=!1;let k=a.element===d;if(!k&&m===null)for(let v=u;v0&&(f===null||b.length===f)&&b.every(k=>k.is("element","th"))&&i?(o.push(g),i=!0):(n.push(g),i=!1),f=Math.max(f||0,b.length)}}let c=uR(n);for(let u of c){let d=0;for(;d{let s=[],r=Array.from(n.getChildren()).filter(l=>l.name==="th"||l.name==="td"),a=new Map;for(;r.length||s.length0)s.push(l.cell);else{let c=r.shift();if(c){let u=parseInt(c.getAttribute("colspan")||"1"),d=parseInt(c.getAttribute("rowspan")||"1");for(let h=0;h1&&a.set(s.length,{cell:c,remaining:d-1}),s.push(c)}else{s.push(null);continue}}}for(let[l,c]of t.entries())c.remaining-=1,c.remaining>0&&!a.has(l)&&a.set(l,c);return t=a,i=Math.max(i,s.length),s});for(let n of o)for(;n.length{e.on("element:figure",(t,i,o)=>{if(!o.consumable.test(i.viewItem,{name:!0,classes:"table"}))return;let n=aR(i.viewItem);if(!n||!o.consumable.test(n,{name:!0}))return;o.consumable.consume(i.viewItem,{name:!0,classes:"table"});let s=o.convertItem(n,i.modelCursor);/* istanbul ignore if: defensive guard for the `ModelRange | null` return type -- @preserve */if(!s.modelRange){o.consumable.revert(i.viewItem,{name:!0,classes:"table"});return}let r=J(s.modelRange.getItems());if(!r||!r.is("element","table")){o.consumable.revert(i.viewItem,{name:!0,classes:"table"}),s.modelRange.isCollapsed||(i.modelRange=s.modelRange,i.modelCursor=s.modelCursor);return}o.convertChildren(i.viewItem,o.writer.createPositionAt(r,"end")),o.updateConversionResult(r,i)})}}function cR(e){return t=>{t.on("element:table",(i,o,n)=>{let s=o.viewItem;if(!n.consumable.test(s,{name:!0}))return;let{rows:r,headingRows:a,headingColumns:l,footerRows:c}=dR(s),u={};l&&(u.headingColumns=l),a&&(u.headingRows=a),e.enableFooters&&c&&(u.footerRows=c);let d=n.writer.createElement("table",u);if(n.safeInsert(d,o.modelCursor)){if(n.consumable.consume(s,{name:!0}),r.forEach(h=>n.convertItem(h,n.writer.createPositionAt(d,"end"))),n.convertChildren(s,n.writer.createPositionAt(d,"end")),d.isEmpty){let h=n.writer.createElement("tableRow");n.writer.insert(h,n.writer.createPositionAt(d,"end")),Bo(n.writer,n.writer.createPositionAt(h,"end"))}n.updateConversionResult(d,o)}})}}function uR(){return e=>{e.on("element:tr",(t,i)=>{i.viewItem.isEmpty&&i.modelCursor.index==0&&t.stop()},{priority:"high"})}}function y_(e){return t=>{t.on(`element:${e}`,(i,o,{writer:n})=>{if(!o.modelRange)return;let s=o.modelRange.start.nodeAfter,r=n.createPositionAt(s,0);if(o.viewItem.isEmpty){n.insertElement("paragraph",r);return}let a=Array.from(s.getChildren());if(a.every(l=>l.is("element","$marker"))){let l=n.createElement("paragraph");n.insert(l,n.createPositionAt(s,0));for(let c of a)n.move(n.createRangeOn(c),n.createPositionAt(l,"end"))}},{priority:"low"})}}function dR(e){let t,i=!0,o=[],n=[],s=[],r=null,a=null,l=Array.from(e.getChildren());for(let u=0;ug.is("element","tr")),f=null,m=null;for(let g of h){let b=Array.from(g.getChildren()).filter(k=>k.is("element","td")||k.is("element","th"));if(d.name==="tfoot"){a||={element:d,rows:h},i=!1;let k=a.element===d;if(!k&&m===null)for(let v=u;v0&&(f===null||b.length===f)&&b.every(k=>k.is("element","th"))&&i?(o.push(g),i=!0):(n.push(g),i=!1),f=Math.max(f||0,b.length)}}let c=hR(n);for(let u of c){let d=0;for(;d{let s=[],r=Array.from(n.getChildren()).filter(l=>l.name==="th"||l.name==="td"),a=new Map;for(;r.length||s.length0)s.push(l.cell);else{let c=r.shift();if(c){let u=parseInt(c.getAttribute("colspan")||"1"),d=parseInt(c.getAttribute("rowspan")||"1");for(let h=0;h1&&a.set(s.length,{cell:c,remaining:d-1}),s.push(c)}else{s.push(null);continue}}}for(let[l,c]of t.entries())c.remaining-=1,c.remaining>0&&!a.has(l)&&a.set(l,c);return t=a,i=Math.max(i,s.length),s});for(let n of o)for(;n.lengthi.is("element","tableColumnGroup"))}function hR(e){let t=dR(e);return t?Array.from(t.getChildren()):[]}/** +*/function fR(e){if(e.is("element","tableColumnGroup"))return e;let t=e.getChildren();return Array.from(t).find(i=>i.is("element","tableColumnGroup"))}function mR(e){let t=fR(e);return t?Array.from(t.getChildren()):[]}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var we=class extends y{static get pluginName(){return"TableUtils"}static get isOfficialPlugin(){return!0}init(){this.decorate("insertColumns"),this.decorate("insertRows")}getCellLocation(e){let t=e.parent,i=t.parent,o=i.getChildIndex(t),n=new U(i,{row:o});for(let{cell:s,row:r,column:a}of n)if(s===e)return{row:r,column:a}}createTable(e,t){let i=e.createElement("table");return Zh(e,i,0,t.rows||2,t.columns||2),t.footerRows&&this.setFooterRowsCount(e,i,t.footerRows),t.headingRows&&this.setHeadingRowsCount(e,i,t.headingRows),t.headingColumns&&this.setHeadingColumnsCount(e,i,t.headingColumns),i}insertRows(e,t={}){let i=this.editor.model,o=t.at||0,n=t.rows||1,s=t.copyStructureFromAbove!==void 0,r=t.copyStructureFromAbove?o-1:o,a=Ai(this.editor),l=!!this.editor.config.get("table.tableCellProperties.scopedHeaders"),c=this.getRows(e),u=this.getColumns(e);if(o>c)throw new p("tableutils-insertrows-insert-out-of-range",this,{options:t});i.change(d=>{let h=e.getAttribute("headingRows")||0,f=e.getAttribute("footerRows")||0;if(h>o&&(h+=n),f&&o>c-f&&(f+=n),!s&&(o===0||o===c)){let m=Zh(d,e,o,n,u);if(a)for(let g=0;g0){let w=Bo(d,C,_>1?{colspan:_}:void 0);a&&eo({table:e,writer:d,cell:w,row:o+b,column:v,scopedHeaders:l})}v+=Math.abs(_)-1}}}this.setFooterRowsCount(d,e,f),this.setHeadingRowsCount(d,e,h,{updateCellType:!1})})}insertColumns(e,t={}){let i=this.editor.model,o=t.at||0,n=t.columns||1,s=Ai(this.editor),r=!!this.editor.config.get("table.tableCellProperties.scopedHeaders");i.change(a=>{let l=e.getAttribute("headingColumns");on-1)throw new p("tableutils-removerows-row-index-out-of-range",this,{table:e,options:t});i.change(a=>{let l={first:s,last:r},{cellsToMove:c,cellsToTrim:u}=pR(e,l);c.size&&bR(e,r+1,c,a);for(let d=r;d>=s;d--)a.remove(e.getChild(d));for(let{rowspan:d,cell:h}of u)te("rowspan",d,h,a);if(mR(e,l,a),gR(e,n,l,a),tf(e,this)||of(e,this),Ai(this.editor)){let d=e.getAttribute("headingRows")||0,h=this.getRows(e);for(;d{fR(e,{first:o,last:s},r);let a=hR(e);for(let l=s;l>=o;l--){for(let{cell:c,column:u,cellWidth:d}of[...new U(e)])u<=l&&d>1&&u+d>l?te("colspan",d-1,c,r):u===l&&r.remove(c);if(a[l]){let c=l===0?a[1]:a[l-1],u=a[l].getAttribute("columnWidth"),d=parseFloat(u),h=parseFloat(c.getAttribute("columnWidth"));r.remove(a[l]);let f=u.trim().endsWith("px")?"px":"%";r.setAttribute("columnWidth",`${d+h}${f}`,c)}}if(of(e,this)||tf(e,this),Ai(this.editor)){let l=e.getAttribute("headingColumns")||0,c=this.getColumns(e);for(;l{if(s>1){let{newCellsSpan:a,updatedSpan:l}=y_(s,t);te("colspan",l,e,r);let c={};a>1&&(c.colspan=a),n>1&&(c.rowspan=n),fs(s>t?t-1:s-1,r,r.createPositionAfter(e),c)}if(sf===e),u=l.filter(({cell:f,cellWidth:m,column:g})=>{let b=f!==e&&g===c,k=gc;return b||k});for(let{cell:f,cellWidth:m}of u)r.setAttribute("colspan",m+a,f);let d={};n>1&&(d.rowspan=n),fs(a,r,r.createPositionAfter(e),d);let h=o.getAttribute("headingColumns")||0;h>c&&te("headingColumns",h+a,o,r)}})}splitCellHorizontally(e,t=2){let i=this.editor.model,o=e.parent,n=o.parent,s=n.getChildIndex(o),r=parseInt(e.getAttribute("rowspan")||"1"),a=parseInt(e.getAttribute("colspan")||"1");i.change(l=>{if(r>1){let c=[...new U(n,{startRow:s,endRow:s+r-1,includeAllSlots:!0})],{newCellsSpan:u,updatedSpan:d}=y_(r,t);te("rowspan",d,e,l);let{column:h}=c.find(({cell:g})=>g===e),f={};u>1&&(f.rowspan=u),a>1&&(f.colspan=a);let m=0;for(let g of c){let{column:b,row:k}=g,v=k>=s+d,_=b===h;m>=u&&_&&(m=0),v&&_&&(m||fs(1,l,g.getPositionBefore(),f),m++)}}if(rs){let v=b+c;l.setAttribute("rowspan",v,g)}let h={};a>1&&(h.colspan=a),Zh(l,n,s+1,c,1,h);let f=n.getAttribute("headingRows")||0;f>s&&te("headingRows",f+c,n,l);let m=n.getAttribute("footerRows")||0;u-m<=s&&te("footerRows",m+c,n,l)}})}getColumns(e){return[...e.getChild(0).getChildren()].filter(t=>t.is("element","tableCell")).reduce((t,i)=>t+parseInt(i.getAttribute("colspan")||"1"),0)}getRows(e){return Array.from(e.getChildren()).reduce((t,i)=>i.is("element","tableRow")?t+1:t,0)}createTableWalker(e,t={}){return new U(e,t)}getSelectedTableCells(e){let t=[];for(let i of this.sortRanges(e.getRanges())){let o=i.getContainedElement();o&&o.is("element","tableCell")&&t.push(o)}return t}setFooterRowsCount(e,t,i){if(!this.editor.config.get("table.enableFooters"))return;let o=t.getAttribute("headingRows")||0,n=this.getRows(t),s=Math.min(i,n);if(te("footerRows",s,t,e,0),o+s>n){let r=n-s;this.setHeadingRowsCount(e,t,r)}}setHeadingRowsCount(e,t,i,o={}){let{updateCellType:n=!0,resetFormerHeadingCells:s=!0,autoExpand:r=!0}=o,a=this.getRows(t),l=!!this.editor.config.get("table.tableCellProperties.scopedHeaders"),c=t.getAttribute("headingRows")||0,u=Math.min(i,a);if(u===c)return;te("headingRows",u,t,e,0);let d=t.getAttribute("footerRows")||0;if(u+d>a){let h=a-u;this.setFooterRowsCount(e,t,h)}if(Ai(this.editor)){if(n){for(let{cell:h,row:f,column:m}of new U(t,{endRow:u-1}))eo({table:t,writer:e,cell:h,row:f,column:m,scopedHeaders:l});if(s&&uc){for(;ul){for(;ui.parent.index);return this._getFirstLastIndexesObject(t)}getColumnIndexes(e){let t=e[0].findAncestor("table"),i=[...new U(t)].filter(o=>e.includes(o.cell)).map(o=>o.column);return this._getFirstLastIndexesObject(i)}isSelectionRectangular(e){if(e.length<2||!this._areCellInTheSameTableSection(e))return!1;let t=new Set,i=new Set,o=0;for(let n of e){let{row:s,column:r}=this.getCellLocation(n),a=parseInt(n.getAttribute("rowspan"))||1,l=parseInt(n.getAttribute("colspan"))||1;t.add(s),i.add(r),a>1&&t.add(s+a-1),l>1&&i.add(r+l-1),o+=a*l}return yR(t,i)==o}sortRanges(e){return Array.from(e).sort(wR)}_getFirstLastIndexesObject(e){let t=e.sort((i,o)=>i-o);return{first:t[0],last:t[t.length-1]}}_areCellInTheSameTableSection(e){let t=e[0].findAncestor("table"),i=this.getRows(t),o=this.getRowIndexes(e),n=parseInt(t.getAttribute("headingRows"))||0,s=parseInt(t.getAttribute("footerRows"))||0;if(!this._areIndexesInSameHeadingSection(o,n)||!this._areIndexesInSameFooterSection(o,i,s))return!1;let r=this.getColumnIndexes(e),a=parseInt(t.getAttribute("headingColumns"))||0;return this._areIndexesInSameHeadingSection(r,a)}_areIndexesInSameHeadingSection({first:e,last:t},i){return e=n==t>=n}};function Zh(e,t,i,o,n,s={}){let r=[];for(let a=0;a=r){let a=i>=r?s-(o-i+1):t-1-o;te("footerRows",a,e,n,0)}}function pR(e,{first:t,last:i}){let o=new Map,n=[];for(let{row:s,column:r,cellHeight:a,cell:l}of new U(e,{endRow:i})){let c=s+a-1;if(s>=t&&s<=i&&c>i){let u=a-(i-s+1);o.set(r,{cell:l,rowspan:u})}if(s=t){let u;c>=i?u=i-t+1:u=c-t+1,n.push({cell:l,rowspan:a-u})}}return{cellsToMove:o,cellsToTrim:n}}function bR(e,t,i,o){let n=[...new U(e,{includeAllSlots:!0,row:t})],s=e.getChild(t),r;for(let{column:a,cell:l,isAnchor:c}of n)if(i.has(a)){let{cell:u,rowspan:d}=i.get(a),h=r?o.createPositionAfter(r):o.createPositionAt(s,0);o.move(o.createRangeOn(u),h),te("rowspan",d,u,o),r=u}else c&&(r=l)}function wR(e,t){let i=e.start,o=t.start;return i.isBefore(o)?-1:1}function yR(e,t){let i=Array.from(e.values()),o=Array.from(t.values()),n=Math.max(...i),s=Math.min(...i),r=Math.max(...o),a=Math.min(...o);return(n-s+1)*(r-a+1)}function eo({writer:e,table:t,row:i,column:o,cell:n,scopedHeaders:s}){let r=t.getAttribute("headingRows")||0,a=t.getAttribute("headingColumns")||0;if(i>=r&&o>=a){e.removeAttribute("tableCellType",n);return}let l="header";s&&(ic)throw new p("tableutils-insertrows-insert-out-of-range",this,{options:t});i.change(d=>{let h=e.getAttribute("headingRows")||0,f=e.getAttribute("footerRows")||0;if(h>o&&(h+=n),f&&o>c-f&&(f+=n),!s&&(o===0||o===c)){let m=Yh(d,e,o,n,u);if(a)for(let g=0;g0){let y=Bo(d,C,_>1?{colspan:_}:void 0);a&&to({table:e,writer:d,cell:y,row:o+b,column:v,scopedHeaders:l})}v+=Math.abs(_)-1}}}this.setFooterRowsCount(d,e,f),this.setHeadingRowsCount(d,e,h,{updateCellType:!1})})}insertColumns(e,t={}){let i=this.editor.model,o=t.at||0,n=t.columns||1,s=Si(this.editor),r=!!this.editor.config.get("table.tableCellProperties.scopedHeaders");i.change(a=>{let l=e.getAttribute("headingColumns");on-1)throw new p("tableutils-removerows-row-index-out-of-range",this,{table:e,options:t});i.change(a=>{let l={first:s,last:r},{cellsToMove:c,cellsToTrim:u}=wR(e,l);c.size&&yR(e,r+1,c,a);for(let d=r;d>=s;d--)a.remove(e.getChild(d));for(let{rowspan:d,cell:h}of u)te("rowspan",d,h,a);if(pR(e,l,a),bR(e,n,l,a),nf(e,this)||sf(e,this),Si(this.editor)){let d=e.getAttribute("headingRows")||0,h=this.getRows(e);for(;d{gR(e,{first:o,last:s},r);let a=mR(e);for(let l=s;l>=o;l--){for(let{cell:c,column:u,cellWidth:d}of[...new U(e)])u<=l&&d>1&&u+d>l?te("colspan",d-1,c,r):u===l&&r.remove(c);if(a[l]){let c=l===0?a[1]:a[l-1],u=a[l].getAttribute("columnWidth"),d=parseFloat(u),h=parseFloat(c.getAttribute("columnWidth"));r.remove(a[l]);let f=u.trim().endsWith("px")?"px":"%";r.setAttribute("columnWidth",`${d+h}${f}`,c)}}if(sf(e,this)||nf(e,this),Si(this.editor)){let l=e.getAttribute("headingColumns")||0,c=this.getColumns(e);for(;l{if(s>1){let{newCellsSpan:a,updatedSpan:l}=__(s,t);te("colspan",l,e,r);let c={};a>1&&(c.colspan=a),n>1&&(c.rowspan=n),fs(s>t?t-1:s-1,r,r.createPositionAfter(e),c)}if(sf===e),u=l.filter(({cell:f,cellWidth:m,column:g})=>{let b=f!==e&&g===c,k=gc;return b||k});for(let{cell:f,cellWidth:m}of u)r.setAttribute("colspan",m+a,f);let d={};n>1&&(d.rowspan=n),fs(a,r,r.createPositionAfter(e),d);let h=o.getAttribute("headingColumns")||0;h>c&&te("headingColumns",h+a,o,r)}})}splitCellHorizontally(e,t=2){let i=this.editor.model,o=e.parent,n=o.parent,s=n.getChildIndex(o),r=parseInt(e.getAttribute("rowspan")||"1"),a=parseInt(e.getAttribute("colspan")||"1");i.change(l=>{if(r>1){let c=[...new U(n,{startRow:s,endRow:s+r-1,includeAllSlots:!0})],{newCellsSpan:u,updatedSpan:d}=__(r,t);te("rowspan",d,e,l);let{column:h}=c.find(({cell:g})=>g===e),f={};u>1&&(f.rowspan=u),a>1&&(f.colspan=a);let m=0;for(let g of c){let{column:b,row:k}=g,v=k>=s+d,_=b===h;m>=u&&_&&(m=0),v&&_&&(m||fs(1,l,g.getPositionBefore(),f),m++)}}if(rs){let v=b+c;l.setAttribute("rowspan",v,g)}let h={};a>1&&(h.colspan=a),Yh(l,n,s+1,c,1,h);let f=n.getAttribute("headingRows")||0;f>s&&te("headingRows",f+c,n,l);let m=n.getAttribute("footerRows")||0;u-m<=s&&te("footerRows",m+c,n,l)}})}getColumns(e){return[...e.getChild(0).getChildren()].filter(t=>t.is("element","tableCell")).reduce((t,i)=>t+parseInt(i.getAttribute("colspan")||"1"),0)}getRows(e){return Array.from(e.getChildren()).reduce((t,i)=>i.is("element","tableRow")?t+1:t,0)}createTableWalker(e,t={}){return new U(e,t)}getSelectedTableCells(e){let t=[];for(let i of this.sortRanges(e.getRanges())){let o=i.getContainedElement();o&&o.is("element","tableCell")&&t.push(o)}return t}setFooterRowsCount(e,t,i){if(!this.editor.config.get("table.enableFooters"))return;let o=t.getAttribute("headingRows")||0,n=this.getRows(t),s=Math.min(i,n);if(te("footerRows",s,t,e,0),o+s>n){let r=n-s;this.setHeadingRowsCount(e,t,r)}}setHeadingRowsCount(e,t,i,o={}){let{updateCellType:n=!0,resetFormerHeadingCells:s=!0,autoExpand:r=!0}=o,a=this.getRows(t),l=!!this.editor.config.get("table.tableCellProperties.scopedHeaders"),c=t.getAttribute("headingRows")||0,u=Math.min(i,a);if(u===c)return;te("headingRows",u,t,e,0);let d=t.getAttribute("footerRows")||0;if(u+d>a){let h=a-u;this.setFooterRowsCount(e,t,h)}if(Si(this.editor)){if(n){for(let{cell:h,row:f,column:m}of new U(t,{endRow:u-1}))to({table:t,writer:e,cell:h,row:f,column:m,scopedHeaders:l});if(s&&uc){for(;ul){for(;ui.parent.index);return this._getFirstLastIndexesObject(t)}getColumnIndexes(e){let t=e[0].findAncestor("table"),i=[...new U(t)].filter(o=>e.includes(o.cell)).map(o=>o.column);return this._getFirstLastIndexesObject(i)}isSelectionRectangular(e){if(e.length<2||!this._areCellInTheSameTableSection(e))return!1;let t=new Set,i=new Set,o=0;for(let n of e){let{row:s,column:r}=this.getCellLocation(n),a=parseInt(n.getAttribute("rowspan"))||1,l=parseInt(n.getAttribute("colspan"))||1;t.add(s),i.add(r),a>1&&t.add(s+a-1),l>1&&i.add(r+l-1),o+=a*l}return vR(t,i)==o}sortRanges(e){return Array.from(e).sort(_R)}_getFirstLastIndexesObject(e){let t=e.sort((i,o)=>i-o);return{first:t[0],last:t[t.length-1]}}_areCellInTheSameTableSection(e){let t=e[0].findAncestor("table"),i=this.getRows(t),o=this.getRowIndexes(e),n=parseInt(t.getAttribute("headingRows"))||0,s=parseInt(t.getAttribute("footerRows"))||0;if(!this._areIndexesInSameHeadingSection(o,n)||!this._areIndexesInSameFooterSection(o,i,s))return!1;let r=this.getColumnIndexes(e),a=parseInt(t.getAttribute("headingColumns"))||0;return this._areIndexesInSameHeadingSection(r,a)}_areIndexesInSameHeadingSection({first:e,last:t},i){return e=n==t>=n}};function Yh(e,t,i,o,n,s={}){let r=[];for(let a=0;a=r){let a=i>=r?s-(o-i+1):t-1-o;te("footerRows",a,e,n,0)}}function wR(e,{first:t,last:i}){let o=new Map,n=[];for(let{row:s,column:r,cellHeight:a,cell:l}of new U(e,{endRow:i})){let c=s+a-1;if(s>=t&&s<=i&&c>i){let u=a-(i-s+1);o.set(r,{cell:l,rowspan:u})}if(s=t){let u;c>=i?u=i-t+1:u=c-t+1,n.push({cell:l,rowspan:a-u})}}return{cellsToMove:o,cellsToTrim:n}}function yR(e,t,i,o){let n=[...new U(e,{includeAllSlots:!0,row:t})],s=e.getChild(t),r;for(let{column:a,cell:l,isAnchor:c}of n)if(i.has(a)){let{cell:u,rowspan:d}=i.get(a),h=r?o.createPositionAfter(r):o.createPositionAt(s,0);o.move(o.createRangeOn(u),h),te("rowspan",d,u,o),r=u}else c&&(r=l)}function _R(e,t){let i=e.start,o=t.start;return i.isBefore(o)?-1:1}function vR(e,t){let i=Array.from(e.values()),o=Array.from(t.values()),n=Math.max(...i),s=Math.min(...i),r=Math.max(...o),a=Math.min(...o);return(n-s+1)*(r-a+1)}function to({writer:e,table:t,row:i,column:o,cell:n,scopedHeaders:s}){let r=t.getAttribute("headingRows")||0,a=t.getAttribute("headingColumns")||0;if(i>=r&&o>=a){e.removeAttribute("tableCellType",n);return}let l="header";s&&(i{let n=i.getAttribute("headingRows")||0,s=i.getAttribute("footerRows")||0,r=o.createContainerElement("table",null,[]),a=o.createContainerElement("figure",{class:"table"},r),l=e.getRows(i);n>0&&o.insert(o.createPositionAt(r,"end"),o.createContainerElement("thead",null,o.createSlot(c=>c.is("element","tableRow")&&c.indexc.is("element","tableRow")&&c.index>=n&&c.index0&&o.insert(o.createPositionAt(r,"end"),o.createContainerElement("tfoot",null,o.createSlot(c=>c.is("element","tableRow")&&c.index>=l-s)));for(let{positionOffset:c,filter:u}of t.additionalSlots)o.insert(o.createPositionAt(r,c),o.createSlot(u));return o.insert(o.createPositionAt(r,"after"),o.createSlot(c=>c.is("element","tableRow")?!1:!t.additionalSlots.some(({filter:u})=>u(c)))),t.asWidget?vR(a,o):a}}function _R(){return(e,{writer:t})=>e.isEmpty?t.createEmptyElement("tr"):t.createContainerElement("tr")}function v_(e){return(i,{writer:o})=>{if(e.cellTypeEnabled?.()){let d=i.getAttribute("tableCellType");return t(o,Kr(d)?"th":"td")}let n=i.parent,s=n.parent,r=s.getChildIndex(n),a=new U(s,{row:r}),l=s.getAttribute("headingRows")||0,c=s.getAttribute("headingColumns")||0,u=null;for(let d of a)if(d.cell==i){u=t(o,d.row{if(!t.parent.is("element","tableCell")||!q_(t))return null;if(e.asWidget)return i.createContainerElement("span",{class:"ck-table-bogus-paragraph"});{let o=i.createContainerElement("p");return i.setCustomProperty("dataPipeline:transparentRendering",!0,o),o}}}function q_(e){return e.parent.childCount==1&&!kR(e)}function vR(e,t){return t.setCustomProperty("table",!0,e),me(e,t,{hasSelectionHandle:!0})}function kR(e){for(let t of e.getAttributeKeys())if(!(t.startsWith("selection:")||t=="htmlEmptyBlock"))return!0;return!1}function CR(e){return(t,i)=>{let o=e.plugins.has("PlainTableOutput"),n=i.options.isClipboardPipeline,s=mf(e,t);return o||s||n?TR(t,i,e):null}}function xR(e){return(t,{writer:i,options:o})=>{let n=e.plugins.has("PlainTableOutput"),s=o.isClipboardPipeline,r=mf(e,t);return(n||r||s)&&t.parent.name==="table"?i.createContainerElement("caption"):null}}function TR(e,t,i){let o=i.plugins.get(we),n=t.writer,s=o.getRows(e),r=e.getAttribute("headingRows")||0,a=e.getAttribute("footerRows")||0,l=s-a,c=n.createSlot(v=>v.is("element","tableRow")&&v.indexv.is("element","tableRow")&&v.index>=r&&v.indexv.is("element","tableRow")&&v.index>=l),h=n.createSlot(v=>!v.is("element","tableRow")),f=n.createContainerElement("thead",null,c),m=n.createContainerElement("tbody",null,u),g=n.createContainerElement("tfoot",null,d),b=[];r&&b.push(f),r+ao.on(`attribute:${i}:table`,(n,s,r)=>{let{item:a,attributeNewValue:l}=s,{mapper:c,writer:u}=r,d=e.plugins.has("PlainTableOutput"),h=r.options.isClipboardPipeline,f=mf(e,a);if(!(d||f||h)||!r.consumable.consume(a,n.name))return;let m=c.toViewElement(a);l?u.setStyle(t,l,m):u.removeStyle(t,m)},{priority:"high"}))}function mf(e,t){let i=e.plugins.has("TableLayoutEditing"),o=e.config.get("table.tableLayout.stripFigureFromContentTable")??!1,n=t.findAncestor("table",{includeSelf:!0})?.getAttribute("tableType");return i&&(o||n==="layout")}/** +*/function v_(e,t){return(i,{writer:o})=>{let n=i.getAttribute("headingRows")||0,s=i.getAttribute("footerRows")||0,r=o.createContainerElement("table",null,[]),a=o.createContainerElement("figure",{class:"table"},r),l=e.getRows(i);n>0&&o.insert(o.createPositionAt(r,"end"),o.createContainerElement("thead",null,o.createSlot(c=>c.is("element","tableRow")&&c.indexc.is("element","tableRow")&&c.index>=n&&c.index0&&o.insert(o.createPositionAt(r,"end"),o.createContainerElement("tfoot",null,o.createSlot(c=>c.is("element","tableRow")&&c.index>=l-s)));for(let{positionOffset:c,filter:u}of t.additionalSlots)o.insert(o.createPositionAt(r,c),o.createSlot(u));return o.insert(o.createPositionAt(r,"after"),o.createSlot(c=>c.is("element","tableRow")?!1:!t.additionalSlots.some(({filter:u})=>u(c)))),t.asWidget?CR(a,o):a}}function kR(){return(e,{writer:t})=>e.isEmpty?t.createEmptyElement("tr"):t.createContainerElement("tr")}function k_(e){return(i,{writer:o})=>{if(e.cellTypeEnabled?.()){let d=i.getAttribute("tableCellType");return t(o,Kr(d)?"th":"td")}let n=i.parent,s=n.parent,r=s.getChildIndex(n),a=new U(s,{row:r}),l=s.getAttribute("headingRows")||0,c=s.getAttribute("headingColumns")||0,u=null;for(let d of a)if(d.cell==i){u=t(o,d.row{if(!t.parent.is("element","tableCell")||!$_(t))return null;if(e.asWidget)return i.createContainerElement("span",{class:"ck-table-bogus-paragraph"});{let o=i.createContainerElement("p");return i.setCustomProperty("dataPipeline:transparentRendering",!0,o),o}}}function $_(e){return e.parent.childCount==1&&!xR(e)}function CR(e,t){return t.setCustomProperty("table",!0,e),me(e,t,{hasSelectionHandle:!0})}function xR(e){for(let t of e.getAttributeKeys())if(!(t.startsWith("selection:")||t=="htmlEmptyBlock"))return!0;return!1}function TR(e){return(t,i)=>{let o=e.plugins.has("PlainTableOutput"),n=i.options.isClipboardPipeline,s=pf(e,t);return o||s||n?AR(t,i,e):null}}function ER(e){return(t,{writer:i,options:o})=>{let n=e.plugins.has("PlainTableOutput"),s=o.isClipboardPipeline,r=pf(e,t);return(n||r||s)&&t.parent.name==="table"?i.createContainerElement("caption"):null}}function AR(e,t,i){let o=i.plugins.get(_e),n=t.writer,s=o.getRows(e),r=e.getAttribute("headingRows")||0,a=e.getAttribute("footerRows")||0,l=s-a,c=n.createSlot(v=>v.is("element","tableRow")&&v.indexv.is("element","tableRow")&&v.index>=r&&v.indexv.is("element","tableRow")&&v.index>=l),h=n.createSlot(v=>!v.is("element","tableRow")),f=n.createContainerElement("thead",null,c),m=n.createContainerElement("tbody",null,u),g=n.createContainerElement("tfoot",null,d),b=[];r&&b.push(f),r+ao.on(`attribute:${i}:table`,(n,s,r)=>{let{item:a,attributeNewValue:l}=s,{mapper:c,writer:u}=r,d=e.plugins.has("PlainTableOutput"),h=r.options.isClipboardPipeline,f=pf(e,a);if(!(d||f||h)||!r.consumable.consume(a,n.name))return;let m=c.toViewElement(a);l?u.setStyle(t,l,m):u.removeStyle(t,m)},{priority:"high"}))}function pf(e,t){let i=e.plugins.has("TableLayoutEditing"),o=e.config.get("table.tableLayout.stripFigureFromContentTable")??!1,n=t.findAncestor("table",{includeSelf:!0})?.getAttribute("tableType");return i&&(o||n==="layout")}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var AR=class extends M{refresh(){let e=this.editor.model,t=e.document.selection,i=e.schema;this.isEnabled=IR(t,i)}execute(e={}){let t=this.editor,i=t.model,o=i.document.selection,n=t.plugins.get("TableUtils"),s=!!t.config.get("table.enableFooters"),r=t.config.get("table.defaultHeadings.rows"),a=t.config.get("table.defaultHeadings.columns"),l=t.config.get("table.defaultFooters");e.headingRows===void 0&&r&&(e.headingRows=r),e.headingColumns===void 0&&a&&(e.headingColumns=a),s&&e.footerRows===void 0&&l&&(e.footerRows=l),!s&&"footerRows"in e&&delete e.footerRows,i.change(c=>{let u=Array.from(Po(i.schema,o.getAttributes())),d=n.createTable(c,e);if(i.insertObject(d,null,null,{findOptimalPosition:"auto"}),c.setSelection(c.createPositionAt(d.getNodeByPath([0,0,0]),0)),e.inheritTextFormattingAttributes!==!1&&u.length)for(let h of iR(d))for(let[f,m]of u)c.setAttribute(Ce._getStoreAttributeKey(f),m,h)})}};function IR(e,t){let i=e.getFirstPosition().parent,o=i===i.root?i:i.parent;return t.checkChild(o,"table")}/** +*/var SR=class extends M{refresh(){let e=this.editor.model,t=e.document.selection,i=e.schema;this.isEnabled=PR(t,i)}execute(e={}){let t=this.editor,i=t.model,o=i.document.selection,n=t.plugins.get("TableUtils"),s=!!t.config.get("table.enableFooters"),r=t.config.get("table.defaultHeadings.rows"),a=t.config.get("table.defaultHeadings.columns"),l=t.config.get("table.defaultFooters");e.headingRows===void 0&&r&&(e.headingRows=r),e.headingColumns===void 0&&a&&(e.headingColumns=a),s&&e.footerRows===void 0&&l&&(e.footerRows=l),!s&&"footerRows"in e&&delete e.footerRows,i.change(c=>{let u=Array.from(Po(i.schema,o.getAttributes())),d=n.createTable(c,e);if(i.insertObject(d,null,null,{findOptimalPosition:"auto"}),c.setSelection(c.createPositionAt(d.getNodeByPath([0,0,0]),0)),e.inheritTextFormattingAttributes!==!1&&u.length)for(let h of nR(d))for(let[f,m]of u)c.setAttribute(Te._getStoreAttributeKey(f),m,h)})}};function PR(e,t){let i=e.getFirstPosition().parent,o=i===i.root?i:i.parent;return t.checkChild(o,"table")}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var C_=class extends M{order;constructor(e,t={}){super(e),this.order=t.order||"below"}refresh(){let e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){let e=this.editor,t=e.model.document.selection,i=e.plugins.get("TableUtils"),o=this.order==="above",n=i.getSelectionAffectedTableCells(t),s=i.getRowIndexes(n),r=o?s.first:s.last,a=n[0].findAncestor("table");i.insertRows(a,{at:o?r:r+1,copyStructureFromAbove:!o})}};/** +*/var x_=class extends M{order;constructor(e,t={}){super(e),this.order=t.order||"below"}refresh(){let e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){let e=this.editor,t=e.model.document.selection,i=e.plugins.get("TableUtils"),o=this.order==="above",n=i.getSelectionAffectedTableCells(t),s=i.getRowIndexes(n),r=o?s.first:s.last,a=n[0].findAncestor("table");i.insertRows(a,{at:o?r:r+1,copyStructureFromAbove:!o})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var x_=class extends M{order;constructor(e,t={}){super(e),this.order=t.order||"right"}refresh(){let e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){let e=this.editor,t=e.model.document.selection,i=e.plugins.get("TableUtils"),o=this.order==="left",n=i.getSelectionAffectedTableCells(t),s=i.getColumnIndexes(n),r=o?s.first:s.last,a=n[0].findAncestor("table");i.insertColumns(a,{columns:1,at:o?r:r+1})}};/** +*/var T_=class extends M{order;constructor(e,t={}){super(e),this.order=t.order||"right"}refresh(){let e=this.editor.model.document.selection,t=!!this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e).length;this.isEnabled=t}execute(){let e=this.editor,t=e.model.document.selection,i=e.plugins.get("TableUtils"),o=this.order==="left",n=i.getSelectionAffectedTableCells(t),s=i.getColumnIndexes(n),r=o?s.first:s.last,a=n[0].findAncestor("table");i.insertColumns(a,{columns:1,at:o?r:r+1})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var T_=class extends M{direction;constructor(e,t={}){super(e),this.direction=t.direction||"horizontally"}refresh(){let e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){let e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),i=this.direction==="horizontally";this.editor.model.change(()=>{for(let o of t)i?e.splitCellHorizontally(o,2):e.splitCellVertically(o,2)})}};/** +*/var E_=class extends M{direction;constructor(e,t={}){super(e),this.direction=t.direction||"horizontally"}refresh(){let e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){let e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),i=this.direction==="horizontally";this.editor.model.change(()=>{for(let o of t)i?e.splitCellHorizontally(o,2):e.splitCellVertically(o,2)})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var cc=class extends M{direction;isHorizontal;constructor(e,t){super(e),this.direction=t.direction,this.isHorizontal=this.direction=="right"||this.direction=="left"}refresh(){let e=this._getMergeableCell();this.value=e,this.isEnabled=!!e}execute(){let e=this.editor.model,t=e.document,i=this.editor.plugins.get("TableUtils").getTableCellsContainingSelection(t.selection)[0],o=this.value,n=this.direction;e.change(s=>{let r=n=="right"||n=="down",a=r?i:o,l=r?o:i,c=l.parent;RR(l,a,s);let u=this.isHorizontal?"colspan":"rowspan",d=parseInt(i.getAttribute(u)||"1"),h=parseInt(o.getAttribute(u)||"1");s.setAttribute(u,d+h,a),s.setSelection(s.createRangeIn(a));let f=this.editor.plugins.get("TableUtils"),m=c.findAncestor("table");df(m,f)})}_getMergeableCell(){let e=this.editor.model.document,t=this.editor.plugins.get("TableUtils"),i=t.getTableCellsContainingSelection(e.selection)[0];if(!i)return;let o=this.isHorizontal?SR(i,this.direction,t):PR(i,this.direction,t);if(!o)return;let n=this.isHorizontal?"rowspan":"colspan",s=parseInt(i.getAttribute(n)||"1");if(parseInt(o.getAttribute(n)||"1")===s)return o}};function SR(e,t,i){let o=e.parent.parent,n=t=="right"?e.nextSibling:e.previousSibling,s=(o.getAttribute("headingColumns")||0)>0;if(!n)return;let r=t=="right"?e:n,a=t=="right"?n:e,{column:l}=i.getCellLocation(r),{column:c}=i.getCellLocation(a),u=parseInt(r.getAttribute("colspan")||"1"),d=ef(i,r),h=ef(i,a);if(!(s&&d!=h))return l+u===c?n:void 0}function PR(e,t,i){let o=e.parent,n=o.parent,s=n.getChildIndex(o),r=i.getRows(n);if(t=="down"&&s===r-1||t=="up"&&s===0)return null;let a=parseInt(e.getAttribute("rowspan")||"1"),l=n.getAttribute("headingRows")||0,c=n.getAttribute("footerRows")||0,u=r-c,d=t=="up"&&s===u,h=t=="up"&&s===l,f=t=="down"&&s+a===l,m=t=="down"&&s+a===u;if(l&&(f||h)||c&&(d||m))return null;let g=parseInt(e.getAttribute("rowspan")||"1"),b=t=="down"?s+g:s,k=[...new U(n,{endRow:b})],v=k.find(C=>C.cell===e).column,_=k.find(({row:C,cellHeight:w,column:E})=>E!==v?!1:t=="down"?C===b:b===C+w);return _&&_.cell?_.cell:null}function RR(e,t,i){E_(e)||(E_(t)&&i.remove(i.createRangeIn(t)),i.move(i.createRangeIn(e),i.createPositionAt(t,"end"))),i.remove(e)}function E_(e){let t=e.getChild(0);return e.childCount==1&&t.is("element","paragraph")&&t.isEmpty}/** +*/var dc=class extends M{direction;isHorizontal;constructor(e,t){super(e),this.direction=t.direction,this.isHorizontal=this.direction=="right"||this.direction=="left"}refresh(){let e=this._getMergeableCell();this.value=e,this.isEnabled=!!e}execute(){let e=this.editor.model,t=e.document,i=this.editor.plugins.get("TableUtils").getTableCellsContainingSelection(t.selection)[0],o=this.value,n=this.direction;e.change(s=>{let r=n=="right"||n=="down",a=r?i:o,l=r?o:i,c=l.parent;LR(l,a,s);let u=this.isHorizontal?"colspan":"rowspan",d=parseInt(i.getAttribute(u)||"1"),h=parseInt(o.getAttribute(u)||"1");s.setAttribute(u,d+h,a),s.setSelection(s.createRangeIn(a));let f=this.editor.plugins.get("TableUtils"),m=c.findAncestor("table");ff(m,f)})}_getMergeableCell(){let e=this.editor.model.document,t=this.editor.plugins.get("TableUtils"),i=t.getTableCellsContainingSelection(e.selection)[0];if(!i)return;let o=this.isHorizontal?RR(i,this.direction,t):VR(i,this.direction,t);if(!o)return;let n=this.isHorizontal?"rowspan":"colspan",s=parseInt(i.getAttribute(n)||"1");if(parseInt(o.getAttribute(n)||"1")===s)return o}};function RR(e,t,i){let o=e.parent.parent,n=t=="right"?e.nextSibling:e.previousSibling,s=(o.getAttribute("headingColumns")||0)>0;if(!n)return;let r=t=="right"?e:n,a=t=="right"?n:e,{column:l}=i.getCellLocation(r),{column:c}=i.getCellLocation(a),u=parseInt(r.getAttribute("colspan")||"1"),d=of(i,r),h=of(i,a);if(!(s&&d!=h))return l+u===c?n:void 0}function VR(e,t,i){let o=e.parent,n=o.parent,s=n.getChildIndex(o),r=i.getRows(n);if(t=="down"&&s===r-1||t=="up"&&s===0)return null;let a=parseInt(e.getAttribute("rowspan")||"1"),l=n.getAttribute("headingRows")||0,c=n.getAttribute("footerRows")||0,u=r-c,d=t=="up"&&s===u,h=t=="up"&&s===l,f=t=="down"&&s+a===l,m=t=="down"&&s+a===u;if(l&&(f||h)||c&&(d||m))return null;let g=parseInt(e.getAttribute("rowspan")||"1"),b=t=="down"?s+g:s,k=[...new U(n,{endRow:b})],v=k.find(C=>C.cell===e).column,_=k.find(({row:C,cellHeight:y,column:E})=>E!==v?!1:t=="down"?C===b:b===C+y);return _&&_.cell?_.cell:null}function LR(e,t,i){A_(e)||(A_(t)&&i.remove(i.createRangeIn(t)),i.move(i.createRangeIn(e),i.createPositionAt(t,"end"))),i.remove(e)}function A_(e){let t=e.getChild(0);return e.childCount==1&&t.is("element","paragraph")&&t.isEmpty}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var VR=class extends M{refresh(){let e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),i=t[0];if(i){let o=i.findAncestor("table"),n=e.getRows(o)-1,s=e.getRowIndexes(t),r=s.first===0&&s.last===n;this.isEnabled=!r}else this.isEnabled=!1}execute(){let e=this.editor.model,t=this.editor.plugins.get("TableUtils"),i=t.getSelectionAffectedTableCells(e.document.selection),o=t.getRowIndexes(i),n=i[0],s=n.findAncestor("table"),r=t.getCellLocation(n).column;e.change(a=>{let l=o.last-o.first+1;t.removeRows(s,{at:o.first,rows:l});let c=LR(s,o.first,r,t.getRows(s));a.setSelection(a.createPositionAt(c,0))})}};function LR(e,t,i,o){let n=e.getChild(Math.min(t,o-1)),s=n.getChild(0),r=0;for(let a of n.getChildren()){if(r>i)return s;s=a,r+=parseInt(a.getAttribute("colspan")||"1")}return s}/** +*/var MR=class extends M{refresh(){let e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),i=t[0];if(i){let o=i.findAncestor("table"),n=e.getRows(o)-1,s=e.getRowIndexes(t),r=s.first===0&&s.last===n;this.isEnabled=!r}else this.isEnabled=!1}execute(){let e=this.editor.model,t=this.editor.plugins.get("TableUtils"),i=t.getSelectionAffectedTableCells(e.document.selection),o=t.getRowIndexes(i),n=i[0],s=n.findAncestor("table"),r=t.getCellLocation(n).column;e.change(a=>{let l=o.last-o.first+1;t.removeRows(s,{at:o.first,rows:l});let c=BR(s,o.first,r,t.getRows(s));a.setSelection(a.createPositionAt(c,0))})}};function BR(e,t,i,o){let n=e.getChild(Math.min(t,o-1)),s=n.getChild(0),r=0;for(let a of n.getChildren()){if(r>i)return s;s=a,r+=parseInt(a.getAttribute("colspan")||"1")}return s}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var MR=class extends M{refresh(){let e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),i=t[0];if(i){let o=i.findAncestor("table"),n=e.getColumns(o),{first:s,last:r}=e.getColumnIndexes(t);this.isEnabled=r-sa.cell===t).column,last:n.find(a=>a.cell===i).column},r=BR(n,t,i,s);this.editor.model.change(a=>{let l=s.last-s.first+1;e.removeColumns(o,{at:s.first,columns:l}),a.setSelection(a.createPositionAt(r,0))})}};function BR(e,t,i,o){return parseInt(i.getAttribute("colspan")||"1")>1?i:t.previousSibling||i.nextSibling?i.nextSibling||t.previousSibling:o.first?e.reverse().find(({column:n})=>nn>o.last).cell}function OR(e,t){let i=t.getSelectionAffectedTableCells(e),o=i[0],n=i.pop(),s=[o,n];return o.isBefore(n)?s:s.reverse()}/** +*/var OR=class extends M{refresh(){let e=this.editor.plugins.get("TableUtils"),t=e.getSelectionAffectedTableCells(this.editor.model.document.selection),i=t[0];if(i){let o=i.findAncestor("table"),n=e.getColumns(o),{first:s,last:r}=e.getColumnIndexes(t);this.isEnabled=r-sa.cell===t).column,last:n.find(a=>a.cell===i).column},r=DR(n,t,i,s);this.editor.model.change(a=>{let l=s.last-s.first+1;e.removeColumns(o,{at:s.first,columns:l}),a.setSelection(a.createPositionAt(r,0))})}};function DR(e,t,i,o){return parseInt(i.getAttribute("colspan")||"1")>1?i:t.previousSibling||i.nextSibling?i.nextSibling||t.previousSibling:o.first?e.reverse().find(({column:n})=>nn>o.last).cell}function FR(e,t){let i=t.getSelectionAffectedTableCells(e),o=i[0],n=i.pop(),s=[o,n];return o.isBefore(n)?s:s.reverse()}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var DR=class extends M{refresh(){let e=this.editor.plugins.get("TableUtils"),t=this.editor.model,i=e.getSelectionAffectedTableCells(t.document.selection);if(i.length===0){this.isEnabled=!1,this.value=!1;return}let o=i[0].findAncestor("table");this.isEnabled=t.schema.checkAttribute(o,"headingRows"),this.value=i.every(n=>this._isInHeading(n,n.parent.parent))}execute(e={}){if(e.forceValue===this.value)return;let t=this.editor.plugins.get("TableUtils"),i=this.editor.model,o=t.getSelectionAffectedTableCells(i.document.selection),n=o[0].findAncestor("table"),{first:s,last:r}=t.getRowIndexes(o),a=this.value?s:r+1,l=n.getAttribute("headingRows")||0;i.change(c=>{if(a){let u=cf(n,a,a>l?l:0);for(let{cell:d}of u)uf(d,a,c)}t.setHeadingRowsCount(c,n,a)})}_isInHeading(e,t){let i=parseInt(t.getAttribute("headingRows")||"0");return!!i&&e.parent.indexthis._isInHeading(n,n.parent.parent))}execute(e={}){if(e.forceValue===this.value)return;let t=this.editor.plugins.get("TableUtils"),i=this.editor.model,o=t.getSelectionAffectedTableCells(i.document.selection),n=o[0].findAncestor("table"),{first:s,last:r}=t.getRowIndexes(o),a=this.value?s:r+1,l=n.getAttribute("headingRows")||0;i.change(c=>{if(a){let u=df(n,a,a>l?l:0);for(let{cell:d}of u)hf(d,a,c)}t.setHeadingRowsCount(c,n,a)})}_isInHeading(e,t){let i=parseInt(t.getAttribute("headingRows")||"0");return!!i&&e.parent.indexthis._isInFooter(n,o))}execute(e={}){if(e.forceValue===this.value)return;let t=this.editor.plugins.get("TableUtils"),i=this.editor.model,o=t.getSelectionAffectedTableCells(i.document.selection),n=o[0].findAncestor("table"),{first:s,last:r}=t.getRowIndexes(o),a=t.getRows(n),l=this.value?a-(r+1):a-s,c=n.getAttribute("footerRows")||0;i.change(u=>{if(l){let d=a-l,h=a-c,f=cf(n,d,d>h?h:0);for(let{cell:m}of f)uf(m,d,u)}t.setFooterRowsCount(u,n,l)})}_isInFooter(e,t){let i=parseInt(t.getAttribute("footerRows")||"0"),o=this.editor.plugins.get("TableUtils").getRows(t),n=e.parent.index;return!!i&&n>=o-i}};/** +*/var zR=class extends M{refresh(){let e=this.editor.plugins.get("TableUtils"),t=this.editor.model,i=e.getSelectionAffectedTableCells(t.document.selection);if(i.length===0){this.isEnabled=!1,this.value=!1;return}let o=i[0].findAncestor("table");this.isEnabled=t.schema.checkAttribute(o,"footerRows"),this.value=i.every(n=>this._isInFooter(n,o))}execute(e={}){if(e.forceValue===this.value)return;let t=this.editor.plugins.get("TableUtils"),i=this.editor.model,o=t.getSelectionAffectedTableCells(i.document.selection),n=o[0].findAncestor("table"),{first:s,last:r}=t.getRowIndexes(o),a=t.getRows(n),l=this.value?a-(r+1):a-s,c=n.getAttribute("footerRows")||0;i.change(u=>{if(l){let d=a-l,h=a-c,f=df(n,d,d>h?h:0);for(let{cell:m}of f)hf(m,d,u)}t.setFooterRowsCount(u,n,l)})}_isInFooter(e,t){let i=parseInt(t.getAttribute("footerRows")||"0"),o=this.editor.plugins.get("TableUtils").getRows(t),n=e.parent.index;return!!i&&n>=o-i}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var NR=class extends M{refresh(){let e=this.editor.plugins.get("TableUtils"),t=this.editor.model,i=e.getSelectionAffectedTableCells(t.document.selection);if(i.length===0){this.isEnabled=!1,this.value=!1;return}let o=i[0].findAncestor("table");this.isEnabled=t.schema.checkAttribute(o,"headingColumns"),this.value=i.every(n=>ef(e,n))}execute(e={}){if(e.forceValue===this.value)return;let t=this.editor.plugins.get("TableUtils"),i=this.editor.model,o=t.getSelectionAffectedTableCells(i.document.selection),n=o[0].findAncestor("table"),{first:s,last:r}=t.getColumnIndexes(o),a=this.value?s:r+1;i.change(l=>{if(a){let c=N_(n,a);for(let{cell:u,column:d}of c)z_(u,d,a,l)}t.setHeadingColumnsCount(l,n,a)})}};/** +*/var HR=class extends M{refresh(){let e=this.editor.plugins.get("TableUtils"),t=this.editor.model,i=e.getSelectionAffectedTableCells(t.document.selection);if(i.length===0){this.isEnabled=!1,this.value=!1;return}let o=i[0].findAncestor("table");this.isEnabled=t.schema.checkAttribute(o,"headingColumns"),this.value=i.every(n=>of(e,n))}execute(e={}){if(e.forceValue===this.value)return;let t=this.editor.plugins.get("TableUtils"),i=this.editor.model,o=t.getSelectionAffectedTableCells(i.document.selection),n=o[0].findAncestor("table"),{first:s,last:r}=t.getColumnIndexes(o),a=this.value?s:r+1;i.change(l=>{if(a){let c=z_(n,a);for(let{cell:u,column:d}of c)H_(u,d,a,l)}t.setHeadingColumnsCount(l,n,a)})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var zR=class extends M{refresh(){let e=this.editor.plugins.get(we),t=e.getSelectedTableCells(this.editor.model.document.selection);this.isEnabled=e.isSelectionRectangular(t)}execute(){let e=this.editor.model,t=this.editor.plugins.get(we);e.change(i=>{let o=t.getSelectedTableCells(e.document.selection),n=o.shift(),{mergeWidth:s,mergeHeight:r}=WR(n,o,t);te("colspan",s,n,i),te("rowspan",r,n,i);for(let l of o)HR(l,n,i);let a=n.findAncestor("table");df(a,t),i.setSelection(n,"in")})}};function HR(e,t,i){A_(e)||(A_(t)&&i.remove(i.createRangeIn(t)),i.move(i.createRangeIn(e),i.createPositionAt(t,"end"))),i.remove(e)}function A_(e){let t=e.getChild(0);return e.childCount==1&&t.is("element","paragraph")&&t.isEmpty}function WR(e,t,i){let o=0,n=0;for(let a of t){let{row:l,column:c}=i.getCellLocation(a);o=I_(a,c,o,"colspan"),n=I_(a,l,n,"rowspan")}let{row:s,column:r}=i.getCellLocation(e);return{mergeWidth:o-r,mergeHeight:n-s}}function I_(e,t,i,o){let n=parseInt(e.getAttribute(o)||"1");return Math.max(i,t+n)}/** +*/var WR=class extends M{refresh(){let e=this.editor.plugins.get(_e),t=e.getSelectedTableCells(this.editor.model.document.selection);this.isEnabled=e.isSelectionRectangular(t)}execute(){let e=this.editor.model,t=this.editor.plugins.get(_e);e.change(i=>{let o=t.getSelectedTableCells(e.document.selection),n=o.shift(),{mergeWidth:s,mergeHeight:r}=qR(n,o,t);te("colspan",s,n,i),te("rowspan",r,n,i);for(let l of o)UR(l,n,i);let a=n.findAncestor("table");ff(a,t),i.setSelection(n,"in")})}};function UR(e,t,i){I_(e)||(I_(t)&&i.remove(i.createRangeIn(t)),i.move(i.createRangeIn(e),i.createPositionAt(t,"end"))),i.remove(e)}function I_(e){let t=e.getChild(0);return e.childCount==1&&t.is("element","paragraph")&&t.isEmpty}function qR(e,t,i){let o=0,n=0;for(let a of t){let{row:l,column:c}=i.getCellLocation(a);o=S_(a,c,o,"colspan"),n=S_(a,l,n,"rowspan")}let{row:s,column:r}=i.getCellLocation(e);return{mergeWidth:o-r,mergeHeight:n-s}}function S_(e,t,i,o){let n=parseInt(e.getAttribute(o)||"1");return Math.max(i,t+n)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var UR=class extends M{constructor(e){super(e),this.affectsData=!1}refresh(){let e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){let e=this.editor.model,t=this.editor.plugins.get("TableUtils"),i=t.getSelectionAffectedTableCells(e.document.selection),o=t.getRowIndexes(i),n=i[0].findAncestor("table"),s=[];for(let r=o.first;r<=o.last;r++)for(let a of n.getChild(r).getChildren())s.push(e.createRangeOn(a));e.change(r=>{r.setSelection(s)})}};/** +*/var $R=class extends M{constructor(e){super(e),this.affectsData=!1}refresh(){let e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){let e=this.editor.model,t=this.editor.plugins.get("TableUtils"),i=t.getSelectionAffectedTableCells(e.document.selection),o=t.getRowIndexes(i),n=i[0].findAncestor("table"),s=[];for(let r=o.first;r<=o.last;r++)for(let a of n.getChild(r).getChildren())s.push(e.createRangeOn(a));e.change(r=>{r.setSelection(s)})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var qR=class extends M{constructor(e){super(e),this.affectsData=!1}refresh(){let e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){let e=this.editor.plugins.get("TableUtils"),t=this.editor.model,i=e.getSelectionAffectedTableCells(t.document.selection),o=i[0],n=i.pop(),s=o.findAncestor("table"),r=e.getCellLocation(o),a=e.getCellLocation(n),l=Math.min(r.column,a.column),c=Math.max(r.column,a.column),u=[];for(let d of new U(s,{startColumn:l,endColumn:c}))u.push(t.createRangeOn(d.cell));t.change(d=>{d.setSelection(u)})}};/** +*/var jR=class extends M{constructor(e){super(e),this.affectsData=!1}refresh(){let e=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(this.editor.model.document.selection);this.isEnabled=e.length>0}execute(){let e=this.editor.plugins.get("TableUtils"),t=this.editor.model,i=e.getSelectionAffectedTableCells(t.document.selection),o=i[0],n=i.pop(),s=o.findAncestor("table"),r=e.getCellLocation(o),a=e.getCellLocation(n),l=Math.min(r.column,a.column),c=Math.max(r.column,a.column),u=[];for(let d of new U(s,{startColumn:l,endColumn:c}))u.push(t.createRangeOn(d.cell));t.change(d=>{d.setSelection(u)})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function $R(e){e.document.registerPostFixer(t=>jR(t,e))}function jR(e,t){let i=t.document.differ.getChanges(),o=!1,n=new Set;for(let s of i){let r=null;s.type=="insert"&&s.name=="table"&&(r=s.position.nodeAfter),(s.type=="insert"||s.type=="remove")&&(s.name=="tableRow"||s.name=="tableCell")&&(r=s.position.findAncestor("table")),QR(s)&&(r=s.range.start.findAncestor("table")),r&&!n.has(r)&&(o=KR(r,e)||o,o=GR(r,e)||o,n.add(r))}return o}function KR(e,t){let i=!1,o=JR(e);if(o.length){i=!0;for(let n of o)te("rowspan",n.rowspan,n.cell,t,1)}return i}function GR(e,t){let i=!1,o=ZR(e),n=[];for(let[a,l]of o.entries())!l&&e.getChild(a).is("element","tableRow")&&n.push(a);if(n.length){i=!0;for(let a of n.reverse())t.remove(e.getChild(a)),o.splice(a,1)}let s=o.filter((a,l)=>e.getChild(l).is("element","tableRow")),r=s[0];if(!s.every(a=>a===r)){let a=s.reduce((l,c)=>c>l?c:l,0);for(let[l,c]of s.entries()){let u=a-c;if(u){for(let d=0;da.is("element","tableRow")?r+1:r,0),n=o-i,s=[];for(let{row:r,cell:a,cellHeight:l}of new U(e)){if(l<2)continue;let c=r=n,d;if(c?d=t:u?d=o:d=n,r+l>d){let h=d-r;s.push({cell:a,rowspan:h})}}return s}function ZR(e){let t=new Array(e.childCount).fill(0);for(let{rowIndex:i}of new U(e,{includeAllSlots:!0}))t[i]++;return t}function QR(e){if(e.type!=="attribute")return!1;let t=e.attributeKey;return t==="headingRows"||t==="colspan"||t==="rowspan"}/** +*/function KR(e){e.document.registerPostFixer(t=>GR(t,e))}function GR(e,t){let i=t.document.differ.getChanges(),o=!1,n=new Set;for(let s of i){let r=null;s.type=="insert"&&s.name=="table"&&(r=s.position.nodeAfter),(s.type=="insert"||s.type=="remove")&&(s.name=="tableRow"||s.name=="tableCell")&&(r=s.position.findAncestor("table")),XR(s)&&(r=s.range.start.findAncestor("table")),r&&!n.has(r)&&(o=JR(r,e)||o,o=ZR(r,e)||o,n.add(r))}return o}function JR(e,t){let i=!1,o=QR(e);if(o.length){i=!0;for(let n of o)te("rowspan",n.rowspan,n.cell,t,1)}return i}function ZR(e,t){let i=!1,o=YR(e),n=[];for(let[a,l]of o.entries())!l&&e.getChild(a).is("element","tableRow")&&n.push(a);if(n.length){i=!0;for(let a of n.reverse())t.remove(e.getChild(a)),o.splice(a,1)}let s=o.filter((a,l)=>e.getChild(l).is("element","tableRow")),r=s[0];if(!s.every(a=>a===r)){let a=s.reduce((l,c)=>c>l?c:l,0);for(let[l,c]of s.entries()){let u=a-c;if(u){for(let d=0;da.is("element","tableRow")?r+1:r,0),n=o-i,s=[];for(let{row:r,cell:a,cellHeight:l}of new U(e)){if(l<2)continue;let c=r=n,d;if(c?d=t:u?d=o:d=n,r+l>d){let h=d-r;s.push({cell:a,rowspan:h})}}return s}function YR(e){let t=new Array(e.childCount).fill(0);for(let{rowIndex:i}of new U(e,{includeAllSlots:!0}))t[i]++;return t}function XR(e){if(e.type!=="attribute")return!1;let t=e.attributeKey;return t==="headingRows"||t==="colspan"||t==="rowspan"}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function YR(e){e.document.registerPostFixer(t=>XR(t,e))}function XR(e,t){let i=t.document.differ.getChanges(),o=!1;for(let n of i)n.type=="insert"&&n.name=="table"&&(o=eV(n.position.nodeAfter,e)||o),n.type=="insert"&&n.name=="tableRow"&&(o=$_(n.position.nodeAfter,e)||o),n.type=="insert"&&n.name=="tableCell"&&(o=nf(n.position.nodeAfter,e)||o),(n.type=="remove"||n.type=="insert")&&tV(n)&&(o=nf(n.position.parent,e)||o);return o}function eV(e,t){let i=!1;for(let o of e.getChildren())o.is("element","tableRow")&&(i=$_(o,t)||i);return i}function $_(e,t){let i=!1;for(let o of e.getChildren())i=nf(o,t)||i;return i}function nf(e,t){if(e.childCount==0)return t.insertElement("paragraph",e),!0;let i=Array.from(e.getChildren()).filter(o=>o.is("$text"));for(let o of i)t.wrap(t.createRangeOn(o),"paragraph");return!!i.length}function tV(e){return e.position.parent.is("element","tableCell")?e.type=="insert"&&e.name=="$text"||e.type=="remove":!1}/** +*/function eV(e){e.document.registerPostFixer(t=>tV(t,e))}function tV(e,t){let i=t.document.differ.getChanges(),o=!1;for(let n of i)n.type=="insert"&&n.name=="table"&&(o=iV(n.position.nodeAfter,e)||o),n.type=="insert"&&n.name=="tableRow"&&(o=j_(n.position.nodeAfter,e)||o),n.type=="insert"&&n.name=="tableCell"&&(o=rf(n.position.nodeAfter,e)||o),(n.type=="remove"||n.type=="insert")&&oV(n)&&(o=rf(n.position.parent,e)||o);return o}function iV(e,t){let i=!1;for(let o of e.getChildren())o.is("element","tableRow")&&(i=j_(o,t)||i);return i}function j_(e,t){let i=!1;for(let o of e.getChildren())i=rf(o,t)||i;return i}function rf(e,t){if(e.childCount==0)return t.insertElement("paragraph",e),!0;let i=Array.from(e.getChildren()).filter(o=>o.is("$text"));for(let o of i)t.wrap(t.createRangeOn(o),"paragraph");return!!i.length}function oV(e){return e.position.parent.is("element","tableCell")?e.type=="insert"&&e.name=="$text"||e.type=="remove":!1}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function iV(e){let{model:t}=e,i=e.plugins.get(we);t.document.registerPostFixer(o=>{let n=!1,s=t.document.differ.getChanges(),r=new Set;for(let a of s){let l=null;a.type=="attribute"&&(a.attributeKey=="headingRows"||a.attributeKey=="footerRows")?l=a.range.start.nodeAfter:(a.type=="insert"&&a.name=="tableRow"||a.type=="remove"&&a.name=="tableRow")&&(l=a.position.parent),l&&l.is("element","table")&&r.add(l)}for(let a of r)oV(i,o,a)&&(n=!0);return n})}function oV(e,t,i){let o=i.getAttribute("headingRows")||0,n=i.getAttribute("footerRows")||0,s=e.getRows(i);if(o+n>s){let r=Math.max(0,s-o);return te("footerRows",r,i,t,0),!0}return!1}/** +*/function nV(e){let{model:t}=e,i=e.plugins.get(_e);t.document.registerPostFixer(o=>{let n=!1,s=t.document.differ.getChanges(),r=new Set;for(let a of s){let l=null;a.type=="attribute"&&(a.attributeKey=="headingRows"||a.attributeKey=="footerRows")?l=a.range.start.nodeAfter:(a.type=="insert"&&a.name=="tableRow"||a.type=="remove"&&a.name=="tableRow")&&(l=a.position.parent),l&&l.is("element","table")&&r.add(l)}for(let a of r)sV(i,o,a)&&(n=!0);return n})}function sV(e,t,i){let o=i.getAttribute("headingRows")||0,n=i.getAttribute("footerRows")||0,s=e.getRows(i);if(o+n>s){let r=Math.max(0,s-o);return te("footerRows",r,i,t,0),!0}return!1}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function nV(e,t){let i=e.document.differ,o=new Set,n=new Set,s=new Set;for(let r of i.getChanges()){let a;if(r.type=="attribute"){let d=r.range.start.nodeAfter;if(!d||!d.is("element","table")||r.attributeKey!="headingRows"&&r.attributeKey!="headingColumns"&&r.attributeKey!="footerRows")continue;a=d}else(r.name=="tableRow"||r.name=="tableCell")&&(a=r.position.findAncestor("table"));if(!a)continue;r.type=="insert"&&r.name=="tableRow"&&t.mapper.toViewElement(r.position.nodeAfter)&&o.add(r.position.nodeAfter);let l=a.getAttribute("headingRows")||0,c=a.getAttribute("headingColumns")||0,u=new U(a);for(let d of u){let h=t.mapper.toViewElement(d.cell);if(!h||!h.is("element"))continue;let f=d.rowrV(r,t.mapper));for(let r of s)t.reconvertItem(r)}}function rV(e,t){if(!e.is("element","paragraph"))return!1;let i=t.toViewElement(e);return i?q_(e)!==i.is("element","span"):!1}/** +*/function aV(e,t){let i=e.document.differ,o=new Set;for(let n of i.getChanges()){let s=n.type=="attribute"?n.range.start.parent:n.position.parent;s.is("element","tableCell")&&o.add(s)}for(let n of o.values()){let s=Array.from(n.getChildren()).filter(r=>lV(r,t.mapper));for(let r of s)t.reconvertItem(r)}}function lV(e,t){if(!e.is("element","paragraph"))return!1;let i=t.toViewElement(e);return i?$_(e)!==i.is("element","span"):!1}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var vc=class extends y{_additionalSlots;static get pluginName(){return"TableEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[we]}constructor(e){super(e),this._additionalSlots=[]}init(){let e=this.editor,t=e.model,i=t.schema,o=e.conversion,n=e.plugins.get(we);e.config.define("table.enableFooters",!1);let s=!!e.config.get("table.enableFooters");i.register("table",{inheritAllFrom:"$blockObject",allowAttributes:["headingRows","headingColumns",...s?["footerRows"]:[]]}),i.register("tableRow",{allowIn:"table",isLimit:!0}),i.register("tableCell",{allowContentOf:"$container",allowIn:"tableRow",allowAttributes:["colspan","rowspan"],isLimit:!0,isSelectable:!0}),o.for("upcast").add(rR()),o.for("upcast").add(aR({enableFooters:s})),o.for("editingDowncast").elementToStructure({model:{name:"table",attributes:["headingRows",...s?["footerRows"]:[]]},view:__(n,{asWidget:!0,additionalSlots:this._additionalSlots})}),o.for("dataDowncast").elementToStructure({model:{name:"table",attributes:["headingRows",...s?["footerRows"]:[]]},view:__(n,{additionalSlots:this._additionalSlots})}),o.for("upcast").elementToElement({model:"tableRow",view:"tr"}),o.for("upcast").add(lR()),o.for("downcast").elementToElement({model:"tableRow",view:_R()}),o.for("upcast").elementToElement({model:"tableCell",view:"td"}),o.for("upcast").elementToElement({model:"tableCell",view:"th"}),o.for("upcast").add(w_("td")),o.for("upcast").add(w_("th")),o.for("editingDowncast").elementToElement({model:"tableCell",view:v_({asWidget:!0,cellTypeEnabled:()=>Ai(this.editor)})}),o.for("dataDowncast").elementToElement({model:"tableCell",view:v_({cellTypeEnabled:()=>Ai(this.editor)})}),o.for("editingDowncast").elementToElement({model:"paragraph",view:k_({asWidget:!0}),converterPriority:"high"}),o.for("dataDowncast").elementToElement({model:"paragraph",view:k_(),converterPriority:"high"}),o.for("downcast").attributeToAttribute({model:"colspan",view:"colspan"}),o.for("upcast").attributeToAttribute({model:{key:"colspan",value:S_("colspan")},view:"colspan"}),o.for("downcast").attributeToAttribute({model:"rowspan",view:"rowspan"}),o.for("upcast").attributeToAttribute({model:{key:"rowspan",value:S_("rowspan")},view:"rowspan"}),this._addPlainTableOutputConverters(),e.config.define("table.defaultHeadings.rows",0),e.config.define("table.defaultHeadings.columns",0),e.config.define("table.defaultFooters",0),e.config.define("table.showHiddenBorders",!0),e.config.get("table.showHiddenBorders")&&e.editing.view.change(r=>{for(let a of e.editing.view.document.roots)r.addClass("ck-table-show-hidden-borders",a)}),e.commands.add("insertTable",new AR(e)),e.commands.add("insertTableRowAbove",new C_(e,{order:"above"})),e.commands.add("insertTableRowBelow",new C_(e,{order:"below"})),e.commands.add("insertTableColumnLeft",new x_(e,{order:"left"})),e.commands.add("insertTableColumnRight",new x_(e,{order:"right"})),e.commands.add("removeTableRow",new VR(e)),e.commands.add("removeTableColumn",new MR(e)),e.commands.add("splitTableCellVertically",new T_(e,{direction:"vertically"})),e.commands.add("splitTableCellHorizontally",new T_(e,{direction:"horizontally"})),e.commands.add("mergeTableCells",new zR(e)),e.commands.add("mergeTableCellRight",new cc(e,{direction:"right"})),e.commands.add("mergeTableCellLeft",new cc(e,{direction:"left"})),e.commands.add("mergeTableCellDown",new cc(e,{direction:"down"})),e.commands.add("mergeTableCellUp",new cc(e,{direction:"up"})),e.commands.add("setTableColumnHeader",new NR(e)),e.commands.add("setTableRowHeader",new DR(e)),s&&e.commands.add("setTableFooterRow",new FR(e)),e.commands.add("selectTableRow",new UR(e)),e.commands.add("selectTableColumn",new qR(e)),$R(t),YR(t),s&&iV(e),this.listenTo(t.document,"change:data",()=>{Ai(e)||nV(t,e.editing),sV(t,e.editing)})}registerAdditionalSlot(e){this._additionalSlots.push(e)}_addPlainTableOutputConverters(){let e=this.editor;e.conversion.for("dataDowncast").elementToStructure({model:"table",view:CR(e),converterPriority:"high"}),e.plugins.has("TableCaptionEditing")&&e.conversion.for("dataDowncast").elementToElement({model:"caption",view:xR(e),converterPriority:"high"}),e.plugins.has("TablePropertiesEditing")&&ER(e)}};function S_(e){return t=>{let i=parseInt(t.getAttribute(e));return Number.isNaN(i)||i<=0?null:i}}/** +*/var Cc=class extends w{_additionalSlots;static get pluginName(){return"TableEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[_e]}constructor(e){super(e),this._additionalSlots=[]}init(){let e=this.editor,t=e.model,i=t.schema,o=e.conversion,n=e.plugins.get(_e);e.config.define("table.enableFooters",!1);let s=!!e.config.get("table.enableFooters");i.register("table",{inheritAllFrom:"$blockObject",allowAttributes:["headingRows","headingColumns",...s?["footerRows"]:[]]}),i.register("tableRow",{allowIn:"table",isLimit:!0}),i.register("tableCell",{allowContentOf:"$container",allowIn:"tableRow",allowAttributes:["colspan","rowspan"],isLimit:!0,isSelectable:!0}),o.for("upcast").add(lR()),o.for("upcast").add(cR({enableFooters:s})),o.for("editingDowncast").elementToStructure({model:{name:"table",attributes:["headingRows",...s?["footerRows"]:[]]},view:v_(n,{asWidget:!0,additionalSlots:this._additionalSlots})}),o.for("dataDowncast").elementToStructure({model:{name:"table",attributes:["headingRows",...s?["footerRows"]:[]]},view:v_(n,{additionalSlots:this._additionalSlots})}),o.for("upcast").elementToElement({model:"tableRow",view:"tr"}),o.for("upcast").add(uR()),o.for("downcast").elementToElement({model:"tableRow",view:kR()}),o.for("upcast").elementToElement({model:"tableCell",view:"td"}),o.for("upcast").elementToElement({model:"tableCell",view:"th"}),o.for("upcast").add(y_("td")),o.for("upcast").add(y_("th")),o.for("editingDowncast").elementToElement({model:"tableCell",view:k_({asWidget:!0,cellTypeEnabled:()=>Si(this.editor)})}),o.for("dataDowncast").elementToElement({model:"tableCell",view:k_({cellTypeEnabled:()=>Si(this.editor)})}),o.for("editingDowncast").elementToElement({model:"paragraph",view:C_({asWidget:!0}),converterPriority:"high"}),o.for("dataDowncast").elementToElement({model:"paragraph",view:C_(),converterPriority:"high"}),o.for("downcast").attributeToAttribute({model:"colspan",view:"colspan"}),o.for("upcast").attributeToAttribute({model:{key:"colspan",value:P_("colspan")},view:"colspan"}),o.for("downcast").attributeToAttribute({model:"rowspan",view:"rowspan"}),o.for("upcast").attributeToAttribute({model:{key:"rowspan",value:P_("rowspan")},view:"rowspan"}),this._addPlainTableOutputConverters(),e.config.define("table.defaultHeadings.rows",0),e.config.define("table.defaultHeadings.columns",0),e.config.define("table.defaultFooters",0),e.config.define("table.showHiddenBorders",!0),e.config.get("table.showHiddenBorders")&&e.editing.view.change(r=>{for(let a of e.editing.view.document.roots)r.addClass("ck-table-show-hidden-borders",a)}),e.commands.add("insertTable",new SR(e)),e.commands.add("insertTableRowAbove",new x_(e,{order:"above"})),e.commands.add("insertTableRowBelow",new x_(e,{order:"below"})),e.commands.add("insertTableColumnLeft",new T_(e,{order:"left"})),e.commands.add("insertTableColumnRight",new T_(e,{order:"right"})),e.commands.add("removeTableRow",new MR(e)),e.commands.add("removeTableColumn",new OR(e)),e.commands.add("splitTableCellVertically",new E_(e,{direction:"vertically"})),e.commands.add("splitTableCellHorizontally",new E_(e,{direction:"horizontally"})),e.commands.add("mergeTableCells",new WR(e)),e.commands.add("mergeTableCellRight",new dc(e,{direction:"right"})),e.commands.add("mergeTableCellLeft",new dc(e,{direction:"left"})),e.commands.add("mergeTableCellDown",new dc(e,{direction:"down"})),e.commands.add("mergeTableCellUp",new dc(e,{direction:"up"})),e.commands.add("setTableColumnHeader",new HR(e)),e.commands.add("setTableRowHeader",new NR(e)),s&&e.commands.add("setTableFooterRow",new zR(e)),e.commands.add("selectTableRow",new $R(e)),e.commands.add("selectTableColumn",new jR(e)),KR(t),eV(t),s&&nV(e),this.listenTo(t.document,"change:data",()=>{Si(e)||rV(t,e.editing),aV(t,e.editing)})}registerAdditionalSlot(e){this._additionalSlots.push(e)}_addPlainTableOutputConverters(){let e=this.editor;e.conversion.for("dataDowncast").elementToStructure({model:"table",view:TR(e),converterPriority:"high"}),e.plugins.has("TableCaptionEditing")&&e.conversion.for("dataDowncast").elementToElement({model:"caption",view:ER(e),converterPriority:"high"}),e.plugins.has("TablePropertiesEditing")&&IR(e)}};function P_(e){return t=>{let i=parseInt(t.getAttribute(e));return Number.isNaN(i)||i<=0?null:i}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var P_=class extends R{items;keystrokes;focusTracker;constructor(e){super(e);let t=this.bindTemplate;this.items=this._createGridCollection(),this.keystrokes=new X,this.focusTracker=new Q,this.set("rows",0),this.set("columns",0),this.bind("label").to(this,"columns",this,"rows",(i,o)=>`${o} \xD7 ${i}`),this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-table-dropdown__grid"]},on:{"mouseover@.ck-insert-table-dropdown-grid-box":t.to("boxover")},children:this.items},{tag:"div",attributes:{class:["ck","ck-insert-table-dropdown__label"],"aria-hidden":!0},children:[{text:t.to("label")}]}],on:{mousedown:t.to(i=>{i.preventDefault()}),click:t.to(()=>{this.fire("execute")})}}),this.on("boxover",(i,o)=>{let{row:n,column:s}=o.target.dataset;this.items.get((parseInt(n,10)-1)*10+(parseInt(s,10)-1)).focus()}),this.focusTracker.on("change:focusedElement",(i,o,n)=>{if(!n)return;let{row:s,column:r}=n.dataset;this.set({rows:parseInt(s),columns:parseInt(r)})}),this.on("change:columns",()=>this._highlightGridBoxes()),this.on("change:rows",()=>this._highlightGridBoxes())}render(){super.render(),Vl({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:10,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection});for(let e of this.items)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element)}reset(){this.set({rows:1,columns:1})}focus(){this.items.get(0).focus()}focusLast(){this.items.get(0).focus()}_highlightGridBoxes(){let e=this.rows,t=this.columns;this.items.map((i,o)=>{let n=Math.floor(o/10),s=o%10,r=n`${o} \xD7 ${i}`),this.setTemplate({tag:"div",attributes:{class:["ck"]},children:[{tag:"div",attributes:{class:["ck-insert-table-dropdown__grid"]},on:{"mouseover@.ck-insert-table-dropdown-grid-box":t.to("boxover")},children:this.items},{tag:"div",attributes:{class:["ck","ck-insert-table-dropdown__label"],"aria-hidden":!0},children:[{text:t.to("label")}]}],on:{mousedown:t.to(i=>{i.preventDefault()}),click:t.to(()=>{this.fire("execute")})}}),this.on("boxover",(i,o)=>{let{row:n,column:s}=o.target.dataset;this.items.get((parseInt(n,10)-1)*10+(parseInt(s,10)-1)).focus()}),this.focusTracker.on("change:focusedElement",(i,o,n)=>{if(!n)return;let{row:s,column:r}=n.dataset;this.set({rows:parseInt(s),columns:parseInt(r)})}),this.on("change:columns",()=>this._highlightGridBoxes()),this.on("change:rows",()=>this._highlightGridBoxes())}render(){super.render(),Ll({keystrokeHandler:this.keystrokes,focusTracker:this.focusTracker,gridItems:this.items,numberOfColumns:10,uiLanguageDirection:this.locale&&this.locale.uiLanguageDirection});for(let e of this.items)this.focusTracker.add(e.element);this.keystrokes.listenTo(this.element)}reset(){this.set({rows:1,columns:1})}focus(){this.items.get(0).focus()}focusLast(){this.items.get(0).focus()}_highlightGridBoxes(){let e=this.rows,t=this.columns;this.items.map((i,o)=>{let n=Math.floor(o/10),s=o%10,r=n{let s=e.commands.get("insertTable"),r=Se(n);r.bind("isEnabled").to(s),r.buttonView.set({icon:Ud,label:t("Insert table"),tooltip:!0});let a;return r.on("change:isOpen",()=>{a||(a=new P_(n),r.panelView.children.add(a),a.delegate("execute").to(r),r.on("execute",()=>{e.execute("insertTable",{rows:a.rows,columns:a.columns}),e.editing.view.focus()}))}),r}),e.ui.componentFactory.add("menuBar:insertTable",n=>{let s=e.commands.get("insertTable"),r=new Qt(n),a=new P_(n);return a.delegate("execute").to(r),r.on("change:isOpen",(l,c,u)=>{u||a.reset()}),a.on("execute",()=>{e.execute("insertTable",{rows:a.rows,columns:a.columns}),e.editing.view.focus()}),r.buttonView.set({label:t("Table"),icon:Ud}),r.panelView.children.add(a),r.bind("isEnabled").to(s),r}),e.ui.componentFactory.add("tableColumn",n=>{let s=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:t("Header column"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:i?"insertTableColumnLeft":"insertTableColumnRight",label:t("Insert column left")}},{type:"button",model:{commandName:i?"insertTableColumnRight":"insertTableColumnLeft",label:t("Insert column right")}},{type:"button",model:{commandName:"removeTableColumn",label:t("Delete column")}},{type:"button",model:{commandName:"selectTableColumn",label:t("Select column")}}];return this._prepareDropdown(t("Column"),ub,s,n)}),e.ui.componentFactory.add("tableRow",n=>{let s=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:t("Header row"),bindIsOn:!0}},o&&{type:"switchbutton",model:{commandName:"setTableFooterRow",label:t("Footer row"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowAbove",label:t("Insert row above")}},{type:"button",model:{commandName:"insertTableRowBelow",label:t("Insert row below")}},{type:"button",model:{commandName:"removeTableRow",label:t("Delete row")}},{type:"button",model:{commandName:"selectTableRow",label:t("Select row")}}].filter(Boolean);return this._prepareDropdown(t("Row"),fb,s,n)}),e.ui.componentFactory.add("mergeTableCells",n=>{let s=[{type:"button",model:{commandName:"mergeTableCellUp",label:t("Merge cell up")}},{type:"button",model:{commandName:i?"mergeTableCellRight":"mergeTableCellLeft",label:t("Merge cell right")}},{type:"button",model:{commandName:"mergeTableCellDown",label:t("Merge cell down")}},{type:"button",model:{commandName:i?"mergeTableCellLeft":"mergeTableCellRight",label:t("Merge cell left")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:t("Split cell vertically")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:t("Split cell horizontally")}}];return this._prepareMergeSplitButtonDropdown(t("Merge cells"),db,s,n)})}_prepareDropdown(e,t,i,o){let n=this.editor,s=Se(o),r=this._fillDropdownWithListOptions(s,i);return s.buttonView.set({label:e,icon:t,tooltip:!0}),s.bind("isEnabled").toMany(r,"isEnabled",(...a)=>a.some(l=>l)),this.listenTo(s,"execute",a=>{n.execute(a.source.commandName),a.source instanceof Io||n.editing.view.focus()}),s}_prepareMergeSplitButtonDropdown(e,t,i,o){let n=this.editor,s=Se(o,So),r="mergeTableCells",a=n.commands.get(r),l=this._fillDropdownWithListOptions(s,i);return s.buttonView.set({label:e,icon:t,tooltip:!0,isEnabled:!0}),s.bind("isEnabled").toMany([a,...l],"isEnabled",(...c)=>c.some(u=>u)),this.listenTo(s.buttonView,"execute",()=>{n.execute(r),n.editing.view.focus()}),this.listenTo(s,"execute",c=>{n.execute(c.source.commandName),n.editing.view.focus()}),s}_fillDropdownWithListOptions(e,t){let i=this.editor,o=[],n=new J;for(let s of t)lV(s,i,o,n);return Bt(e,n),o}};function lV(e,t,i,o){if(e.type==="button"||e.type==="switchbutton"){let n=e.model=new ki(e.model),{commandName:s,bindIsOn:r}=e.model,a=t.commands.get(s);i.push(a),n.set({commandName:s}),n.bind("isEnabled").to(a),r&&n.bind("isOn").to(a,"value"),n.set({withText:!0})}o.add(e)}/** +*/var cV=class extends w{static get pluginName(){return"TableUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=this.editor.t,i=e.locale.contentLanguageDirection==="ltr",o=!!e.config.get("table.enableFooters");e.ui.componentFactory.add("insertTable",n=>{let s=e.commands.get("insertTable"),r=ye(n);r.bind("isEnabled").to(s),r.buttonView.set({icon:$d,label:t("Insert table"),tooltip:!0});let a;return r.on("change:isOpen",()=>{a||(a=new R_(n),r.panelView.children.add(a),a.delegate("execute").to(r),r.on("execute",()=>{e.execute("insertTable",{rows:a.rows,columns:a.columns}),e.editing.view.focus()}))}),r}),e.ui.componentFactory.add("menuBar:insertTable",n=>{let s=e.commands.get("insertTable"),r=new Xt(n),a=new R_(n);return a.delegate("execute").to(r),r.on("change:isOpen",(l,c,u)=>{u||a.reset()}),a.on("execute",()=>{e.execute("insertTable",{rows:a.rows,columns:a.columns}),e.editing.view.focus()}),r.buttonView.set({label:t("Table"),icon:$d}),r.panelView.children.add(a),r.bind("isEnabled").to(s),r}),e.ui.componentFactory.add("tableColumn",n=>{let s=[{type:"switchbutton",model:{commandName:"setTableColumnHeader",label:t("Header column"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:i?"insertTableColumnLeft":"insertTableColumnRight",label:t("Insert column left")}},{type:"button",model:{commandName:i?"insertTableColumnRight":"insertTableColumnLeft",label:t("Insert column right")}},{type:"button",model:{commandName:"removeTableColumn",label:t("Delete column")}},{type:"button",model:{commandName:"selectTableColumn",label:t("Select column")}}];return this._prepareDropdown(t("Column"),hb,s,n)}),e.ui.componentFactory.add("tableRow",n=>{let s=[{type:"switchbutton",model:{commandName:"setTableRowHeader",label:t("Header row"),bindIsOn:!0}},o&&{type:"switchbutton",model:{commandName:"setTableFooterRow",label:t("Footer row"),bindIsOn:!0}},{type:"separator"},{type:"button",model:{commandName:"insertTableRowAbove",label:t("Insert row above")}},{type:"button",model:{commandName:"insertTableRowBelow",label:t("Insert row below")}},{type:"button",model:{commandName:"removeTableRow",label:t("Delete row")}},{type:"button",model:{commandName:"selectTableRow",label:t("Select row")}}].filter(Boolean);return this._prepareDropdown(t("Row"),gb,s,n)}),e.ui.componentFactory.add("mergeTableCells",n=>{let s=[{type:"button",model:{commandName:"mergeTableCellUp",label:t("Merge cell up")}},{type:"button",model:{commandName:i?"mergeTableCellRight":"mergeTableCellLeft",label:t("Merge cell right")}},{type:"button",model:{commandName:"mergeTableCellDown",label:t("Merge cell down")}},{type:"button",model:{commandName:i?"mergeTableCellLeft":"mergeTableCellRight",label:t("Merge cell left")}},{type:"separator"},{type:"button",model:{commandName:"splitTableCellVertically",label:t("Split cell vertically")}},{type:"button",model:{commandName:"splitTableCellHorizontally",label:t("Split cell horizontally")}}];return this._prepareMergeSplitButtonDropdown(t("Merge cells"),fb,s,n)})}_prepareDropdown(e,t,i,o){let n=this.editor,s=ye(o),r=this._fillDropdownWithListOptions(s,i);return s.buttonView.set({label:e,icon:t,tooltip:!0}),s.bind("isEnabled").toMany(r,"isEnabled",(...a)=>a.some(l=>l)),this.listenTo(s,"execute",a=>{n.execute(a.source.commandName),a.source instanceof So||n.editing.view.focus()}),s}_prepareMergeSplitButtonDropdown(e,t,i,o){let n=this.editor,s=ye(o,xi),r="mergeTableCells",a=n.commands.get(r),l=this._fillDropdownWithListOptions(s,i);return s.buttonView.set({label:e,icon:t,tooltip:!0,isEnabled:!0}),s.bind("isEnabled").toMany([a,...l],"isEnabled",(...c)=>c.some(u=>u)),this.listenTo(s.buttonView,"execute",()=>{n.execute(r),n.editing.view.focus()}),this.listenTo(s,"execute",c=>{n.execute(c.source.commandName),n.editing.view.focus()}),s}_fillDropdownWithListOptions(e,t){let i=this.editor,o=[],n=new G;for(let s of t)uV(s,i,o,n);return ht(e,n),o}};function uV(e,t,i,o){if(e.type==="button"||e.type==="switchbutton"){let n=e.model=new Ot(e.model),{commandName:s,bindIsOn:r}=e.model,a=t.commands.get(s);i.push(a),n.set({commandName:s}),n.bind("isEnabled").to(a),r&&n.bind("isOn").to(a,"value"),n.set({withText:!0})}o.add(e)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var to=class extends y{static get pluginName(){return"TableSelection"}static get isOfficialPlugin(){return!0}static get requires(){return[we,we]}init(){let e=this.editor,t=e.model,i=e.editing.view;this.listenTo(t,"deleteContent",(o,n)=>this._handleDeleteContent(o,n),{priority:"high"}),this.listenTo(i.document,"insertText",(o,n)=>this._handleInsertTextEvent(o,n),{priority:"high"}),this._defineSelectionConverter(),this._enablePluginDisabling()}getSelectedTableCells(){let e=this.editor.plugins.get(we),t=this.editor.model.document.selection,i=e.getSelectedTableCells(t);return i.length==0?null:i}getSelectionAsFragment(){let e=this.editor.plugins.get(we),t=this.getSelectedTableCells();return t?this.editor.model.change(i=>{let o=i.createDocumentFragment(),{first:n,last:s}=e.getColumnIndexes(t),{first:r,last:a}=e.getRowIndexes(t),l=t[0].findAncestor("table"),c=a,u=s;if(e.isSelectionRectangular(t)){let h={firstColumn:n,lastColumn:s,firstRow:r,lastRow:a};c=W_(l,h),u=U_(l,h)}let d=F_(l,{startRow:r,startColumn:n,endRow:c,endColumn:u},i);return i.insert(d,o,0),o}):null}setCellSelection(e,t){let i=this._getCellsToSelect(e,t);this.editor.model.change(o=>{o.setSelection(i.cells.map(n=>o.createRangeOn(n)),{backward:i.backward})})}getFocusCell(){let e=[...this.editor.model.document.selection.getRanges()].pop().getContainedElement();return e&&e.is("element","tableCell")?e:null}getAnchorCell(){let e=this.editor.model.document.selection,t=G(e.getRanges()).getContainedElement();return t&&t.is("element","tableCell")?t:null}_defineSelectionConverter(){let e=this.editor,t=new Set;e.conversion.for("editingDowncast").add(o=>o.on("selection",(n,s,r)=>{let a=r.writer;i(a);let l=this.getSelectedTableCells();if(!l)return;for(let u of l){let d=r.mapper.toViewElement(u);a.addClass("ck-editor__editable_selected",d),t.add(d)}let c=r.mapper.toViewElement(l[l.length-1]);a.setSelection(c,0)},{priority:"lowest"}));function i(o){for(let n of t)o.removeClass("ck-editor__editable_selected",n);t.clear()}}_enablePluginDisabling(){let e=this.editor;this.on("change:isEnabled",()=>{if(!this.isEnabled){let t=this.getSelectedTableCells();if(!t)return;e.model.change(i=>{let o=i.createPositionAt(t[0],0),n=e.model.schema.getNearestSelectionRange(o);i.setSelection(n)})}})}_handleDeleteContent(e,t){let i=this.editor.plugins.get(we),o=t[0],n=t[1],s=this.editor.model,r=!n||n.direction=="backward",a=i.getSelectedTableCells(o);a.length&&(e.stop(),s.change(l=>{let c=a[r?a.length-1:0];s.change(d=>{for(let h of a)s.deleteContent(d.createSelection(h,"in"))});let u=s.schema.getNearestSelectionRange(l.createPositionAt(c,0));o.is("documentSelection")?l.setSelection(u):o.setTo(u)}))}_handleInsertTextEvent(e,t){let i=this.editor,o=this.getSelectedTableCells();if(!o)return;let n=i.editing.view,s=i.editing.mapper,r=o.map(a=>n.createRangeOn(s.toViewElement(a)));t.selection=n.createSelection(r),t.preventDefault()}_getCellsToSelect(e,t){let i=this.editor.plugins.get("TableUtils"),o=i.getCellLocation(e),n=i.getCellLocation(t),s=Math.min(o.row,n.row),r=Math.max(o.row,n.row),a=Math.min(o.column,n.column),l=parseInt(t.getAttribute("colspan")||"1")-1,c=Math.max(o.column,n.column+l),u=new Array(r-s+1).fill(null).map(()=>[]),d={startRow:s,endRow:r,startColumn:a,endColumn:c};for(let{row:m,cell:g}of new U(e.findAncestor("table"),d))u[m-s].push(g);let h=n.rowm.reverse()),{cells:u.flat(),backward:h||f}}};/** +*/var io=class extends w{static get pluginName(){return"TableSelection"}static get isOfficialPlugin(){return!0}static get requires(){return[_e,_e]}init(){let e=this.editor,t=e.model,i=e.editing.view;this.listenTo(t,"deleteContent",(o,n)=>this._handleDeleteContent(o,n),{priority:"high"}),this.listenTo(i.document,"insertText",(o,n)=>this._handleInsertTextEvent(o,n),{priority:"high"}),this._defineSelectionConverter(),this._enablePluginDisabling()}getSelectedTableCells(){let e=this.editor.plugins.get(_e),t=this.editor.model.document.selection,i=e.getSelectedTableCells(t);return i.length==0?null:i}getSelectionAsFragment(){let e=this.editor.plugins.get(_e),t=this.getSelectedTableCells();return t?this.editor.model.change(i=>{let o=i.createDocumentFragment(),{first:n,last:s}=e.getColumnIndexes(t),{first:r,last:a}=e.getRowIndexes(t),l=t[0].findAncestor("table"),c=a,u=s;if(e.isSelectionRectangular(t)){let h={firstColumn:n,lastColumn:s,firstRow:r,lastRow:a};c=U_(l,h),u=q_(l,h)}let d=N_(l,{startRow:r,startColumn:n,endRow:c,endColumn:u},i);return i.insert(d,o,0),o}):null}setCellSelection(e,t){let i=this._getCellsToSelect(e,t);this.editor.model.change(o=>{o.setSelection(i.cells.map(n=>o.createRangeOn(n)),{backward:i.backward})})}getFocusCell(){let e=[...this.editor.model.document.selection.getRanges()].pop().getContainedElement();return e&&e.is("element","tableCell")?e:null}getAnchorCell(){let e=this.editor.model.document.selection,t=J(e.getRanges()).getContainedElement();return t&&t.is("element","tableCell")?t:null}_defineSelectionConverter(){let e=this.editor,t=new Set;e.conversion.for("editingDowncast").add(o=>o.on("selection",(n,s,r)=>{let a=r.writer;i(a);let l=this.getSelectedTableCells();if(!l)return;for(let u of l){let d=r.mapper.toViewElement(u);a.addClass("ck-editor__editable_selected",d),t.add(d)}let c=r.mapper.toViewElement(l[l.length-1]);a.setSelection(c,0)},{priority:"lowest"}));function i(o){for(let n of t)o.removeClass("ck-editor__editable_selected",n);t.clear()}}_enablePluginDisabling(){let e=this.editor;this.on("change:isEnabled",()=>{if(!this.isEnabled){let t=this.getSelectedTableCells();if(!t)return;e.model.change(i=>{let o=i.createPositionAt(t[0],0),n=e.model.schema.getNearestSelectionRange(o);i.setSelection(n)})}})}_handleDeleteContent(e,t){let i=this.editor.plugins.get(_e),o=t[0],n=t[1],s=this.editor.model,r=!n||n.direction=="backward",a=i.getSelectedTableCells(o);a.length&&(e.stop(),s.change(l=>{let c=a[r?a.length-1:0];s.change(d=>{for(let h of a)s.deleteContent(d.createSelection(h,"in"))});let u=s.schema.getNearestSelectionRange(l.createPositionAt(c,0));o.is("documentSelection")?l.setSelection(u):o.setTo(u)}))}_handleInsertTextEvent(e,t){let i=this.editor,o=this.getSelectedTableCells();if(!o)return;let n=i.editing.view,s=i.editing.mapper,r=o.map(a=>n.createRangeOn(s.toViewElement(a)));t.selection=n.createSelection(r),t.preventDefault()}_getCellsToSelect(e,t){let i=this.editor.plugins.get("TableUtils"),o=i.getCellLocation(e),n=i.getCellLocation(t),s=Math.min(o.row,n.row),r=Math.max(o.row,n.row),a=Math.min(o.column,n.column),l=parseInt(t.getAttribute("colspan")||"1")-1,c=Math.max(o.column,n.column+l),u=new Array(r-s+1).fill(null).map(()=>[]),d={startRow:s,endRow:r,startColumn:a,endColumn:c};for(let{row:m,cell:g}of new U(e.findAncestor("table"),d))u[m-s].push(g);let h=n.rowm.reverse()),{cells:u.flat(),backward:h||f}}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var cV=class extends y{static get pluginName(){return"TableClipboard"}static get isOfficialPlugin(){return!0}static get requires(){return[ss,Be,to,we]}init(){let e=this.editor.editing.view.document;this.listenTo(e,"copy",(t,i)=>this._onCopyCut(t,i)),this.listenTo(e,"cut",(t,i)=>this._onCopyCut(t,i)),this._listenToContentInsertion(),this.decorate("_replaceTableSlotCell")}_listenToContentInsertion(){let{editor:e}=this,t=e.plugins.get(Be),i=e.plugins.get(to),o=!1;t.on("contentInsertion",(n,s)=>{o=s.method==="paste"}),this.listenTo(e.model,"insertContent",(n,[s,r])=>{(o||i.getSelectedTableCells()!==null)&&this._onInsertContent(n,s,r)},{priority:"high"}),t.on("contentInsertion",()=>{o=!1},{priority:"lowest"})}_onCopyCut(e,t){let i=this.editor.editing.view,o=this.editor.plugins.get(to),n=this.editor.plugins.get(ss);o.getSelectedTableCells()&&(e.name=="cut"&&!this.editor.model.canEditAt(this.editor.model.document.selection)||(t.preventDefault(),e.stop(),this.editor.model.enqueueChange({isUndoable:e.name==="cut"},()=>{let s=n._copySelectedFragmentWithMarkers(e.name,this.editor.model.document.selection,()=>o.getSelectionAsFragment());i.document.fire("clipboardOutput",{dataTransfer:t.dataTransfer,content:this.editor.data.toView(s),method:e.name})})))}_onInsertContent(e,t,i){if(i&&!i.is("documentSelection"))return;let o=this.editor.model,n=this.editor.plugins.get(we),s=this.editor.plugins.get(ss),r=this.getTableIfOnlyTableInContent(t,o);if(!r)return;let a=n.getSelectionAffectedTableCells(o.document.selection);if(!a.length){df(r,n);return}e.stop(),t.is("documentFragment")?s._pasteMarkersIntoTransformedElement(t.markers,l=>this._replaceSelectedCells(r,a,l)):this.editor.model.change(l=>{this._replaceSelectedCells(r,a,l)})}_replaceSelectedCells(e,t,i){let o=this.editor.plugins.get(we),n={width:o.getColumns(e),height:o.getRows(e)},s=uV(t,n,i,o),r=s.lastRow-s.firstRow+1,a=s.lastColumn-s.firstColumn+1,l={startRow:0,startColumn:0,endRow:Math.min(r,n.height)-1,endColumn:Math.min(a,n.width)-1};e=F_(e,l,i);let c=t[0].findAncestor("table"),u=this._replaceSelectedCellsWithPasted(e,n,c,s,i,o);if(this.editor.plugins.get("TableSelection").isEnabled){let d=o.sortRanges(u.map(h=>i.createRangeOn(h)));i.setSelection(d)}else i.setSelection(u[0],0);return c}_replaceSelectedCellsWithPasted(e,t,i,o,n,s){let{width:r,height:a}=t,l=hV(e,r,a),c=[...new U(i,{startRow:o.firstRow,endRow:o.lastRow,startColumn:o.firstColumn,endColumn:o.lastColumn,includeAllSlots:!0})],u=[],d;for(let _ of c){let{row:C,column:w}=_;w===o.firstColumn&&(d=_.getPositionBefore());let E=C-o.firstRow,x=w-o.firstColumn,B=l[E%a][x%r],de=B?n.cloneElement(B):null,Ve=this._replaceTableSlotCell(_,de,d,n);Ve&&(H_(Ve,C,w,o.lastRow,o.lastColumn,n),u.push(Ve),d=n.createPositionAfter(Ve))}let h=parseInt(i.getAttribute("headingRows")||"0"),f=parseInt(i.getAttribute("headingColumns")||"0"),m=parseInt(i.getAttribute("footerRows")||"0"),g=s.getRows(i)-m,b=o.firstRown&&o.insertColumns(e,{at:n,columns:i-n}),t>s&&o.insertRows(e,{at:s,rows:t-s})}function hV(e,t,i){let o=new Array(i).fill(null).map(()=>new Array(t).fill(null));for(let{column:n,row:s,cell:r}of new U(e))o[s][n]=r;return o}function fV(e,t,i){let{firstRow:o,lastRow:n,firstColumn:s,lastColumn:r}=t,a={first:o,last:n},l={first:s,last:r};sf(e,s,a,i),sf(e,r+1,a,i),gc(e,o,l,i),gc(e,n+1,l,i,o)}function gc(e,t,i,o,n=0){if(!(t<1))return cf(e,t,n).filter(({column:s,cellWidth:r})=>j_(s,r,i)).map(({cell:s})=>uf(s,t,o))}function sf(e,t,i,o){if(!(t<1))return N_(e,t).filter(({row:n,cellHeight:s})=>j_(n,s,i)).map(({cell:n,column:s})=>z_(n,s,t,o))}function j_(e,t,i){let o=e+t-1,{first:n,last:s}=i;return e>=n&&e<=s||e=n}/** +*/var dV=class extends w{static get pluginName(){return"TableClipboard"}static get isOfficialPlugin(){return!0}static get requires(){return[ss,Be,io,_e]}init(){let e=this.editor.editing.view.document;this.listenTo(e,"copy",(t,i)=>this._onCopyCut(t,i)),this.listenTo(e,"cut",(t,i)=>this._onCopyCut(t,i)),this._listenToContentInsertion(),this.decorate("_replaceTableSlotCell")}_listenToContentInsertion(){let{editor:e}=this,t=e.plugins.get(Be),i=e.plugins.get(io),o=!1;t.on("contentInsertion",(n,s)=>{o=s.method==="paste"}),this.listenTo(e.model,"insertContent",(n,[s,r])=>{(o||i.getSelectedTableCells()!==null)&&this._onInsertContent(n,s,r)},{priority:"high"}),t.on("contentInsertion",()=>{o=!1},{priority:"lowest"})}_onCopyCut(e,t){let i=this.editor.editing.view,o=this.editor.plugins.get(io),n=this.editor.plugins.get(ss);o.getSelectedTableCells()&&(e.name=="cut"&&!this.editor.model.canEditAt(this.editor.model.document.selection)||(t.preventDefault(),e.stop(),this.editor.model.enqueueChange({isUndoable:e.name==="cut"},()=>{let s=n._copySelectedFragmentWithMarkers(e.name,this.editor.model.document.selection,()=>o.getSelectionAsFragment());i.document.fire("clipboardOutput",{dataTransfer:t.dataTransfer,content:this.editor.data.toView(s),method:e.name})})))}_onInsertContent(e,t,i){if(i&&!i.is("documentSelection"))return;let o=this.editor.model,n=this.editor.plugins.get(_e),s=this.editor.plugins.get(ss),r=this.getTableIfOnlyTableInContent(t,o);if(!r)return;let a=n.getSelectionAffectedTableCells(o.document.selection);if(!a.length){ff(r,n);return}e.stop(),t.is("documentFragment")?s._pasteMarkersIntoTransformedElement(t.markers,l=>this._replaceSelectedCells(r,a,l)):this.editor.model.change(l=>{this._replaceSelectedCells(r,a,l)})}_replaceSelectedCells(e,t,i){let o=this.editor.plugins.get(_e),n={width:o.getColumns(e),height:o.getRows(e)},s=hV(t,n,i,o),r=s.lastRow-s.firstRow+1,a=s.lastColumn-s.firstColumn+1,l={startRow:0,startColumn:0,endRow:Math.min(r,n.height)-1,endColumn:Math.min(a,n.width)-1};e=N_(e,l,i);let c=t[0].findAncestor("table"),u=this._replaceSelectedCellsWithPasted(e,n,c,s,i,o);if(this.editor.plugins.get("TableSelection").isEnabled){let d=o.sortRanges(u.map(h=>i.createRangeOn(h)));i.setSelection(d)}else i.setSelection(u[0],0);return c}_replaceSelectedCellsWithPasted(e,t,i,o,n,s){let{width:r,height:a}=t,l=mV(e,r,a),c=[...new U(i,{startRow:o.firstRow,endRow:o.lastRow,startColumn:o.firstColumn,endColumn:o.lastColumn,includeAllSlots:!0})],u=[],d;for(let _ of c){let{row:C,column:y}=_;y===o.firstColumn&&(d=_.getPositionBefore());let E=C-o.firstRow,x=y-o.firstColumn,B=l[E%a][x%r],de=B?n.cloneElement(B):null,Ve=this._replaceTableSlotCell(_,de,d,n);Ve&&(W_(Ve,C,y,o.lastRow,o.lastColumn,n),u.push(Ve),d=n.createPositionAfter(Ve))}let h=parseInt(i.getAttribute("headingRows")||"0"),f=parseInt(i.getAttribute("headingColumns")||"0"),m=parseInt(i.getAttribute("footerRows")||"0"),g=s.getRows(i)-m,b=o.firstRown&&o.insertColumns(e,{at:n,columns:i-n}),t>s&&o.insertRows(e,{at:s,rows:t-s})}function mV(e,t,i){let o=new Array(i).fill(null).map(()=>new Array(t).fill(null));for(let{column:n,row:s,cell:r}of new U(e))o[s][n]=r;return o}function gV(e,t,i){let{firstRow:o,lastRow:n,firstColumn:s,lastColumn:r}=t,a={first:o,last:n},l={first:s,last:r};af(e,s,a,i),af(e,r+1,a,i),bc(e,o,l,i),bc(e,n+1,l,i,o)}function bc(e,t,i,o,n=0){if(!(t<1))return df(e,t,n).filter(({column:s,cellWidth:r})=>K_(s,r,i)).map(({cell:s})=>hf(s,t,o))}function af(e,t,i,o){if(!(t<1))return z_(e,t).filter(({row:n,cellHeight:s})=>K_(n,s,i)).map(({cell:n,column:s})=>H_(n,s,t,o))}function K_(e,t,i){let o=e+t-1,{first:n,last:s}=i;return e>=n&&e<=s||e=n}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var mV=class extends y{static get pluginName(){return"TableKeyboard"}static get isOfficialPlugin(){return!0}static get requires(){return[to,we]}init(){let e=this.editor,t=e.editing.view.document,i=e.t;this.listenTo(t,"arrowKey",(...o)=>this._onArrowKey(...o),{context:"table"}),this.listenTo(t,"tab",(...o)=>this._handleTabOnSelectedTable(...o),{context:"figure"}),this.listenTo(t,"tab",(...o)=>this._handleTab(...o),{context:["th","td"]}),e.accessibility.addKeystrokeInfoGroup({id:"table",label:i("Keystrokes that can be used in a table cell"),keystrokes:[{label:i("Move the selection to the next cell"),keystroke:"Tab"},{label:i("Move the selection to the previous cell"),keystroke:"Shift+Tab"},{label:i("Insert a new table row (when in the last cell of a table)"),keystroke:"Tab"},{label:i("Navigate through the table"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]}]})}_handleTabOnSelectedTable(e,t){let i=this.editor.model.document.selection.getSelectedElement();!i||!i.is("element","table")||t.stopPropagation()}_handleTab(e,t){let i=this.editor,o=this.editor.plugins.get(we),n=this.editor.plugins.get("TableSelection"),s=i.model.document.selection,r=!t.shiftKey,a=o.getTableCellsContainingSelection(s)[0];if(a||(a=n.getFocusCell()),!a)return;t.stopPropagation();let l=a.parent,c=l.parent,u=c.getChildIndex(l),d=l.getChildIndex(a)===l.childCount-1,h=u===o.getRows(c)-1;r&&h&&d&&i.execute("insertTableRowBelow")}_onArrowKey(e,t){let i=this.editor,o=t.keyCode,n=wo(o,i.locale.contentLanguageDirection);this._handleArrowKeys(n,t.shiftKey)&&(t.preventDefault(),t.stopPropagation(),e.stop())}_handleArrowKeys(e,t){let i=this.editor.plugins.get(we),o=this.editor.plugins.get("TableSelection"),n=this.editor.model,s=n.document.selection,r=["right","down"].includes(e),a=i.getSelectedTableCells(s);if(a.length){let c;return t?c=o.getFocusCell():c=r?a[a.length-1]:a[0],this._navigateFromCellInDirection(c,e,t),!0}let l=s.focus.findAncestor("tableCell");/* istanbul ignore if: paranoid check -- @preserve */if(!l)return!1;if(!s.isCollapsed)if(t){if(s.isBackward==r&&!s.containsEntireContent(l))return!1}else{let c=s.getSelectedElement();if(!c||!n.schema.isObject(c))return!1}return this._isSelectionAtCellEdge(s,l,r)?(this._navigateFromCellInDirection(l,e,t),!0):!1}_isSelectionAtCellEdge(e,t,i){let o=this.editor.model,n=this.editor.model.schema,s=i?e.getLastPosition():e.getFirstPosition();if(!n.getLimitElement(s).is("element","tableCell"))return o.createPositionAt(t,i?"end":0).isTouching(s);let r=o.createSelection(s);return o.modifySelection(r,{direction:i?"forward":"backward"}),s.isEqual(r.focus)}_navigateFromCellInDirection(e,t,i=!1){let o=this.editor.model,n=e.findAncestor("table"),s=[...new U(n,{includeAllSlots:!0})],{row:r,column:a}=s[s.length-1],l=s.find(({cell:m})=>m==e),{row:c,column:u}=l;switch(t){case"left":u--;break;case"up":c--;break;case"right":u+=l.cellWidth;break;case"down":c+=l.cellHeight}if(c<0||c>r||u<0&&c<=0||u>a&&c>=r){o.change(m=>{m.setSelection(m.createRangeOn(n))});return}u<0?(u=i?0:a,c--):u>a&&(u=i?a:0,c++);let d=s.find(m=>m.row==c&&m.column==u).cell,h=["right","down"].includes(t),f=this.editor.plugins.get("TableSelection");if(i&&f.isEnabled){let m=f.getAnchorCell()||e;f.setCellSelection(m,d)}else{let m=o.createPositionAt(d,h?0:"end");o.change(g=>{g.setSelection(m)})}}};/** +*/var pV=class extends w{static get pluginName(){return"TableKeyboard"}static get isOfficialPlugin(){return!0}static get requires(){return[io,_e]}init(){let e=this.editor,t=e.editing.view.document,i=e.t;this.listenTo(t,"arrowKey",(...o)=>this._onArrowKey(...o),{context:"table"}),this.listenTo(t,"tab",(...o)=>this._handleTabOnSelectedTable(...o),{context:"figure"}),this.listenTo(t,"tab",(...o)=>this._handleTab(...o),{context:["th","td"]}),e.accessibility.addKeystrokeInfoGroup({id:"table",label:i("Keystrokes that can be used in a table cell"),keystrokes:[{label:i("Move the selection to the next cell"),keystroke:"Tab"},{label:i("Move the selection to the previous cell"),keystroke:"Shift+Tab"},{label:i("Insert a new table row (when in the last cell of a table)"),keystroke:"Tab"},{label:i("Navigate through the table"),keystroke:[["arrowup"],["arrowright"],["arrowdown"],["arrowleft"]]}]})}_handleTabOnSelectedTable(e,t){let i=this.editor.model.document.selection.getSelectedElement();!i||!i.is("element","table")||t.stopPropagation()}_handleTab(e,t){let i=this.editor,o=this.editor.plugins.get(_e),n=this.editor.plugins.get("TableSelection"),s=i.model.document.selection,r=!t.shiftKey,a=o.getTableCellsContainingSelection(s)[0];if(a||(a=n.getFocusCell()),!a)return;t.stopPropagation();let l=a.parent,c=l.parent,u=c.getChildIndex(l),d=l.getChildIndex(a)===l.childCount-1,h=u===o.getRows(c)-1;r&&h&&d&&i.execute("insertTableRowBelow")}_onArrowKey(e,t){let i=this.editor,o=t.keyCode,n=yo(o,i.locale.contentLanguageDirection);this._handleArrowKeys(n,t.shiftKey)&&(t.preventDefault(),t.stopPropagation(),e.stop())}_handleArrowKeys(e,t){let i=this.editor.plugins.get(_e),o=this.editor.plugins.get("TableSelection"),n=this.editor.model,s=n.document.selection,r=["right","down"].includes(e),a=i.getSelectedTableCells(s);if(a.length){let c;return t?c=o.getFocusCell():c=r?a[a.length-1]:a[0],this._navigateFromCellInDirection(c,e,t),!0}let l=s.focus.findAncestor("tableCell");/* istanbul ignore if: paranoid check -- @preserve */if(!l)return!1;if(!s.isCollapsed)if(t){if(s.isBackward==r&&!s.containsEntireContent(l))return!1}else{let c=s.getSelectedElement();if(!c||!n.schema.isObject(c))return!1}return this._isSelectionAtCellEdge(s,l,r)?(this._navigateFromCellInDirection(l,e,t),!0):!1}_isSelectionAtCellEdge(e,t,i){let o=this.editor.model,n=this.editor.model.schema,s=i?e.getLastPosition():e.getFirstPosition();if(!n.getLimitElement(s).is("element","tableCell"))return o.createPositionAt(t,i?"end":0).isTouching(s);let r=o.createSelection(s);return o.modifySelection(r,{direction:i?"forward":"backward"}),s.isEqual(r.focus)}_navigateFromCellInDirection(e,t,i=!1){let o=this.editor.model,n=e.findAncestor("table"),s=[...new U(n,{includeAllSlots:!0})],{row:r,column:a}=s[s.length-1],l=s.find(({cell:m})=>m==e),{row:c,column:u}=l;switch(t){case"left":u--;break;case"up":c--;break;case"right":u+=l.cellWidth;break;case"down":c+=l.cellHeight}if(c<0||c>r||u<0&&c<=0||u>a&&c>=r){o.change(m=>{m.setSelection(m.createRangeOn(n))});return}u<0?(u=i?0:a,c--):u>a&&(u=i?a:0,c++);let d=s.find(m=>m.row==c&&m.column==u).cell,h=["right","down"].includes(t),f=this.editor.plugins.get("TableSelection");if(i&&f.isEnabled){let m=f.getAnchorCell()||e;f.setCellSelection(m,d)}else{let m=o.createPositionAt(d,h?0:"end");o.change(g=>{g.setSelection(m)})}}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var gV=class extends $e{domEventType=["mousemove","mouseleave"];onDomEvent(e){this.fire(e.type,e)}};/** +*/var bV=class extends $e{domEventType=["mousemove","mouseleave"];onDomEvent(e){this.fire(e.type,e)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var pV=class extends y{static get pluginName(){return"TableMouse"}static get isOfficialPlugin(){return!0}static get requires(){return[to,we]}init(){this.editor.editing.view.addObserver(gV),this._enableShiftClickSelection(),this._enableMouseDragSelection()}_enableShiftClickSelection(){let e=this.editor,t=e.plugins.get(we),i=!1,o=e.plugins.get(to);this.listenTo(e.editing.view.document,"mousedown",(n,s)=>{let r=e.model.document.selection;if(!this.isEnabled||!o.isEnabled||!s.domEvent.shiftKey)return;let a=o.getAnchorCell()||t.getTableCellsContainingSelection(r)[0];if(!a)return;let l=this._getModelTableCellFromDomEvent(s);l&&R_(a,l)&&(i=!0,o.setCellSelection(a,l),s.preventDefault())}),this.listenTo(e.editing.view.document,"mouseup",()=>{i=!1}),this.listenTo(e.editing.view.document,"selectionChange",n=>{i&&n.stop()},{priority:"highest"})}_enableMouseDragSelection(){let e=this.editor,t,i,o=!1,n=!1,s=e.plugins.get(to);this.listenTo(e.editing.view.document,"mousedown",(r,a)=>{!this.isEnabled||!s.isEnabled||a.domEvent.shiftKey||a.domEvent.ctrlKey||a.domEvent.altKey||(t=this._getModelTableCellFromDomEvent(a))}),this.listenTo(e.editing.view.document,"mousemove",(r,a)=>{if(!a.domEvent.buttons||!t)return;let l=this._getModelTableCellFromDomEvent(a);l&&R_(t,l)&&(i=l,!o&&i!=t&&(o=!0)),o&&(n=!0,s.setCellSelection(t,i),a.preventDefault())}),this.listenTo(e.editing.view.document,"mouseup",()=>{o=!1,n=!1,t=null,i=null}),this.listenTo(e.editing.view.document,"selectionChange",r=>{n&&r.stop()},{priority:"highest"})}_getModelTableCellFromDomEvent(e){let t=e.target,i=this.editor.editing.view.createPositionAt(t,0);return this.editor.editing.mapper.toModelPosition(i).parent.findAncestor("tableCell",{includeSelf:!0})}};function R_(e,t){return e.parent.parent==t.parent.parent}/** +*/var wV=class extends w{static get pluginName(){return"TableMouse"}static get isOfficialPlugin(){return!0}static get requires(){return[io,_e]}init(){this.editor.editing.view.addObserver(bV),this._enableShiftClickSelection(),this._enableMouseDragSelection()}_enableShiftClickSelection(){let e=this.editor,t=e.plugins.get(_e),i=!1,o=e.plugins.get(io);this.listenTo(e.editing.view.document,"mousedown",(n,s)=>{let r=e.model.document.selection;if(!this.isEnabled||!o.isEnabled||!s.domEvent.shiftKey)return;let a=o.getAnchorCell()||t.getTableCellsContainingSelection(r)[0];if(!a)return;let l=this._getModelTableCellFromDomEvent(s);l&&V_(a,l)&&(i=!0,o.setCellSelection(a,l),s.preventDefault())}),this.listenTo(e.editing.view.document,"mouseup",()=>{i=!1}),this.listenTo(e.editing.view.document,"selectionChange",n=>{i&&n.stop()},{priority:"highest"})}_enableMouseDragSelection(){let e=this.editor,t,i,o=!1,n=!1,s=e.plugins.get(io);this.listenTo(e.editing.view.document,"mousedown",(r,a)=>{!this.isEnabled||!s.isEnabled||a.domEvent.shiftKey||a.domEvent.ctrlKey||a.domEvent.altKey||(t=this._getModelTableCellFromDomEvent(a))}),this.listenTo(e.editing.view.document,"mousemove",(r,a)=>{if(!a.domEvent.buttons||!t)return;let l=this._getModelTableCellFromDomEvent(a);l&&V_(t,l)&&(i=l,!o&&i!=t&&(o=!0)),o&&(n=!0,s.setCellSelection(t,i),a.preventDefault())}),this.listenTo(e.editing.view.document,"mouseup",()=>{o=!1,n=!1,t=null,i=null}),this.listenTo(e.editing.view.document,"selectionChange",r=>{n&&r.stop()},{priority:"highest"})}_getModelTableCellFromDomEvent(e){let t=e.target,i=this.editor.editing.view.createPositionAt(t,0);return this.editor.editing.mapper.toModelPosition(i).parent.findAncestor("tableCell",{includeSelf:!0})}};function V_(e,t){return e.parent.parent==t.parent.parent}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var K_=class extends y{static get requires(){return[vc,aV,to,pV,mV,cV,Pe]}static get pluginName(){return"Table"}static get isOfficialPlugin(){return!0}};/** +*/var G_=class extends w{static get requires(){return[Cc,cV,io,wV,pV,dV,Re]}static get pluginName(){return"Table"}static get isOfficialPlugin(){return!0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function pc(e){let t=G_(e);return t||kc(e)}function G_(e){let t=e.getSelectedElement();return t&&J_(t)?t:null}function kc(e){let t=e.getFirstPosition();if(!t)return null;let i=t.parent;for(;i;){if(i.is("element")&&J_(i))return i;i=i.parent}return null}function J_(e){return e.is("element")&&!!e.getCustomProperty("table")&&z(e)}/** +*/function wc(e){let t=J_(e);return t||xc(e)}function J_(e){let t=e.getSelectedElement();return t&&Z_(t)?t:null}function xc(e){let t=e.getFirstPosition();if(!t)return null;let i=t.parent;for(;i;){if(i.is("element")&&Z_(i))return i;i=i.parent}return null}function Z_(e){return e.is("element")&&!!e.getCustomProperty("table")&&z(e)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Z_=class extends y{static get requires(){return[ts]}static get pluginName(){return"TableToolbar"}static get isOfficialPlugin(){return!0}afterInit(){let e=this.editor,t=e.t,i=e.plugins.get(ts),o=e.config.get("table.contentToolbar"),n=e.config.get("table.tableToolbar");o&&i.register("tableContent",{ariaLabel:t("Table toolbar"),items:o,getRelatedElement:kc}),n&&i.register("table",{ariaLabel:t("Table toolbar"),items:n,getRelatedElement:G_})}};/** +*/var Q_=class extends w{static get requires(){return[ts]}static get pluginName(){return"TableToolbar"}static get isOfficialPlugin(){return!0}afterInit(){let e=this.editor,t=e.t,i=e.plugins.get(ts),o=e.config.get("table.contentToolbar"),n=e.config.get("table.tableToolbar");o&&i.register("tableContent",{ariaLabel:t("Table toolbar"),items:o,getRelatedElement:xc}),n&&i.register("table",{ariaLabel:t("Table toolbar"),items:n,getRelatedElement:J_})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var bV=class extends R{options;focusTracker;focusCycler;_focusables;dropdownView;inputView;keystrokes;_stillTyping;constructor(e,t){super(e),this.set("value",""),this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isEmpty",!0),this.options=t,this.focusTracker=new Q,this._focusables=new be,this.dropdownView=this._createDropdownView(),this.inputView=this._createInputTextView(),this.keystrokes=new X,this._stillTyping=!1,this.focusCycler=new Ie({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-input-color"]},children:[this.dropdownView,this.inputView]}),this.on("change:value",(i,o,n)=>this._setInputValue(n))}render(){super.render(),[this.inputView,this.dropdownView.buttonView].forEach(e=>{this.focusTracker.add(e.element),this._focusables.add(e)}),this.keystrokes.listenTo(this.element)}focus(e){e===-1?this.focusCycler.focusLast():this.focusCycler.focusFirst()}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createDropdownView(){let e=this.locale,t=e.t,i=this.bindTemplate,o=this._createColorSelector(e),n=Se(e),s=new R;s.setTemplate({tag:"span",attributes:{class:["ck","ck-input-color__button__preview"],style:{backgroundColor:i.to("value")}},children:[{tag:"span",attributes:{class:["ck","ck-input-color__button__preview__no-color-indicator",i.if("value","ck-hidden",a=>a!="")]}}]}),n.buttonView.extendTemplate({attributes:{class:"ck-input-color__button"}}),n.buttonView.children.add(s),n.buttonView.label=t("Color picker"),n.buttonView.tooltip=!0,n.panelView.extendTemplate({attributes:{class:"ck-dropdown__panel_fit-content"}}),n.panelPosition=e.uiLanguageDirection==="rtl"?"se":"sw",n.panelView.children.add(o),n.bind("isEnabled").to(this,"isReadOnly",a=>!a);let r=!1;return n.on("change:isOpen",(a,l,c)=>{r||(r=!0,o.appendUI()),c&&(o.updateSelectedColors(),o.showColorGridsFragment())}),n}_createInputTextView(){let e=this.locale,t=new hh(e);return t.extendTemplate({on:{blur:t.bindTemplate.to("blur")}}),t.value=this.value,t.bind("isReadOnly","hasError").to(this),this.bind("isFocused","isEmpty").to(t),t.on("input",()=>{let i=t.element.value,o=this.options.colorDefinitions.find(n=>i===n.label);this._stillTyping=!0,this.value=o&&o.color||i}),t.on("blur",()=>{this._stillTyping=!1,this._setInputValue(t.element.value)}),t.delegate("input").to(this),t}_createColorSelector(e){let t=e.t,i=this.options.defaultColorValue||"",o=t(i?"Restore default":"Remove color"),n=new Ew(e,{colors:this.options.colorDefinitions,columns:this.options.columns??Ll,removeButtonLabel:o,colorPickerLabel:t("Color picker"),colorPickerViewConfig:this.options.colorPickerConfig===!1?!1:{...this.options.colorPickerConfig,hideInput:!0}});n.on("execute",(r,a)=>{if(a.source==="colorPickerSaveButton"){this.dropdownView.isOpen=!1;return}this.value=a.value||i,this.fire("input"),a.source!=="colorPicker"&&(this.dropdownView.isOpen=!1)});let s=this.value;return n.on("colorPicker:cancel",()=>{this.value=s,this.fire("input"),this.dropdownView.isOpen=!1}),n.on("colorPicker:show",()=>{s=this.value}),n.bind("selectedColor").to(this,"value"),n}_setInputValue(e){if(!this._stillTyping){let t=V_(e),i=this.options.colorDefinitions.find(o=>t===V_(o.color));i?this.inputView.value=i.label:this.inputView.value=e||""}}};function V_(e){return e.replace(/([(,])\s+/g,"$1").replace(/^\s+|\s+(?=[),\s]|$)/g,"").replace(/,|\s/g," ")}/** +*/var yV=class extends R{options;focusTracker;focusCycler;_focusables;dropdownView;inputView;keystrokes;_stillTyping;constructor(e,t){super(e),this.set("value",""),this.set("isReadOnly",!1),this.set("isFocused",!1),this.set("isEmpty",!0),this.options=t,this.focusTracker=new Q,this._focusables=new we,this.dropdownView=this._createDropdownView(),this.inputView=this._createInputTextView(),this.keystrokes=new X,this._stillTyping=!1,this.focusCycler=new Pe({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}}),this.setTemplate({tag:"div",attributes:{class:["ck","ck-input-color"]},children:[this.dropdownView,this.inputView]}),this.on("change:value",(i,o,n)=>this._setInputValue(n))}render(){super.render(),[this.inputView,this.dropdownView.buttonView].forEach(e=>{this.focusTracker.add(e.element),this._focusables.add(e)}),this.keystrokes.listenTo(this.element)}focus(e){e===-1?this.focusCycler.focusLast():this.focusCycler.focusFirst()}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}_createDropdownView(){let e=this.locale,t=e.t,i=this.bindTemplate,o=this._createColorSelector(e),n=ye(e),s=new R;s.setTemplate({tag:"span",attributes:{class:["ck","ck-input-color__button__preview"],style:{backgroundColor:i.to("value")}},children:[{tag:"span",attributes:{class:["ck","ck-input-color__button__preview__no-color-indicator",i.if("value","ck-hidden",a=>a!="")]}}]}),n.buttonView.extendTemplate({attributes:{class:"ck-input-color__button"}}),n.buttonView.children.add(s),n.buttonView.label=t("Color picker"),n.buttonView.tooltip=!0,n.panelView.extendTemplate({attributes:{class:"ck-dropdown__panel_fit-content"}}),n.panelPosition=e.uiLanguageDirection==="rtl"?"se":"sw",n.panelView.children.add(o),n.bind("isEnabled").to(this,"isReadOnly",a=>!a);let r=!1;return n.on("change:isOpen",(a,l,c)=>{r||(r=!0,o.appendUI()),c&&(o.updateSelectedColors(),o.showColorGridsFragment())}),n}_createInputTextView(){let e=this.locale,t=new mh(e);return t.extendTemplate({on:{blur:t.bindTemplate.to("blur")}}),t.value=this.value,t.bind("isReadOnly","hasError").to(this),this.bind("isFocused","isEmpty").to(t),t.on("input",()=>{let i=t.element.value,o=this.options.colorDefinitions.find(n=>i===n.label);this._stillTyping=!0,this.value=o&&o.color||i}),t.on("blur",()=>{this._stillTyping=!1,this._setInputValue(t.element.value)}),t.delegate("input").to(this),t}_createColorSelector(e){let t=e.t,i=this.options.defaultColorValue||"",o=t(i?"Restore default":"Remove color"),n=new Iw(e,{colors:this.options.colorDefinitions,columns:this.options.columns??Ml,removeButtonLabel:o,colorPickerLabel:t("Color picker"),colorPickerViewConfig:this.options.colorPickerConfig===!1?!1:{...this.options.colorPickerConfig,hideInput:!0}});n.on("execute",(r,a)=>{if(a.source==="colorPickerSaveButton"){this.dropdownView.isOpen=!1;return}this.value=a.value||i,this.fire("input"),a.source!=="colorPicker"&&(this.dropdownView.isOpen=!1)});let s=this.value;return n.on("colorPicker:cancel",()=>{this.value=s,this.fire("input"),this.dropdownView.isOpen=!1}),n.on("colorPicker:show",()=>{s=this.value}),n.bind("selectedColor").to(this,"value"),n}_setInputValue(e){if(!this._stillTyping){let t=L_(e),i=this.options.colorDefinitions.find(o=>t===L_(o.color));i?this.inputView.value=i.label:this.inputView.value=e||""}}};function L_(e){return e.replace(/([(,])\s+/g,"$1").replace(/^\s+|\s+(?=[),\s]|$)/g,"").replace(/,|\s/g," ")}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var gf=e=>e==="";function pf(e){return{none:e("None"),solid:e("Solid"),dotted:e("Dotted"),dashed:e("Dashed"),double:e("Double"),groove:e("Groove"),ridge:e("Ridge"),inset:e("Inset"),outset:e("Outset")}}function Q_(e){return e('The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".')}function Y_(e){return e('The value is invalid. Try "10px" or "2em" or simply "2".')}function bc(e){return e=e.trim().toLowerCase(),gf(e)||Td(e)}function jr(e){return e=e.trim(),gf(e)||t5(e)||Mn(e)||ko(e)}function X_(e){return e=e.trim(),gf(e)||t5(e)||Mn(e)}function e5(e,t){let i=new J,o=pf(e.t);for(let n in o){let s={type:"button",model:new ki({_borderStyleValue:n,label:o[n],role:"menuitemradio",withText:!0})};n==="none"?s.model.bind("isOn").to(e,"borderStyle",r=>t==="none"?!r:r===n):s.model.bind("isOn").to(e,"borderStyle",r=>r===n),i.add(s)}return i}function rf(e){let{view:t,icons:i,toolbar:o,labels:n,propertyName:s,nameToValue:r,defaultValue:a}=e;for(let l in n){let c=new I(t.locale);c.set({role:"radio",isToggleable:!0,label:n[l],icon:i[l],tooltip:n[l]});let u=r?r(l):l;c.bind("isOn").to(t,s,d=>{let h=d;return d===""&&a&&(h=a),u===h}),c.on("execute",()=>{!a&&u&&t[s]===u?t[s]=void 0:t[s]=u}),o.items.add(c)}}var wc=ww;function yc(e){return(t,i,o)=>{let n=new bV(t.locale,{colorDefinitions:wV(e.colorConfig),columns:e.columns,defaultColorValue:e.defaultColorValue,colorPickerConfig:e.colorPickerConfig});return n.inputView.set({id:i,ariaDescribedById:o}),n.bind("isReadOnly").to(t,"isEnabled",s=>!s),n.bind("hasError").to(t,"errorText",s=>!!s),n.on("input",()=>{t.errorText=null}),t.bind("isEmpty","isFocused").to(n),n}}function t5(e){let t=parseFloat(e);return!Number.isNaN(t)&&e===String(t)}function wV(e){return e.map(t=>({color:t.model,label:t.label,options:{hasBorder:t.hasBorder}}))}/** +*/var bf=e=>e==="";function wf(e){return{none:e("None"),solid:e("Solid"),dotted:e("Dotted"),dashed:e("Dashed"),double:e("Double"),groove:e("Groove"),ridge:e("Ridge"),inset:e("Inset"),outset:e("Outset")}}function Y_(e){return e('The color is invalid. Try "#FF0000" or "rgb(255,0,0)" or "red".')}function X_(e){return e('The value is invalid. Try "10px" or "2em" or simply "2".')}function yc(e){return e=e.trim().toLowerCase(),bf(e)||Ad(e)}function jr(e){return e=e.trim(),bf(e)||i5(e)||Mn(e)||Co(e)}function e5(e){return e=e.trim(),bf(e)||i5(e)||Mn(e)}function t5(e,t){let i=new G,o=wf(e.t);for(let n in o){let s={type:"button",model:new Ot({_borderStyleValue:n,label:o[n],role:"menuitemradio",withText:!0})};n==="none"?s.model.bind("isOn").to(e,"borderStyle",r=>t==="none"?!r:r===n):s.model.bind("isOn").to(e,"borderStyle",r=>r===n),i.add(s)}return i}function lf(e){let{view:t,icons:i,toolbar:o,labels:n,propertyName:s,nameToValue:r,defaultValue:a}=e;for(let l in n){let c=new I(t.locale);c.set({role:"radio",isToggleable:!0,label:n[l],icon:i[l],tooltip:n[l]});let u=r?r(l):l;c.bind("isOn").to(t,s,d=>{let h=d;return d===""&&a&&(h=a),u===h}),c.on("execute",()=>{!a&&u&&t[s]===u?t[s]=void 0:t[s]=u}),o.items.add(c)}}var _c=_w;function vc(e){return(t,i,o)=>{let n=new yV(t.locale,{colorDefinitions:_V(e.colorConfig),columns:e.columns,defaultColorValue:e.defaultColorValue,colorPickerConfig:e.colorPickerConfig});return n.inputView.set({id:i,ariaDescribedById:o}),n.bind("isReadOnly").to(t,"isEnabled",s=>!s),n.bind("hasError").to(t,"errorText",s=>!!s),n.on("input",()=>{t.errorText=null}),t.bind("isEmpty","isFocused").to(n),n}}function i5(e){let t=parseFloat(e);return!Number.isNaN(t)&&e===String(t)}function _V(e){return e.map(t=>({color:t.model,label:t.label,options:{hasBorder:t.hasBorder}}))}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var yV=class extends R{options;focusTracker;keystrokes;children;borderStyleDropdown;borderWidthInput;borderColorInput;backgroundInput;cellTypeDropdown;paddingInput;widthInput;heightInput;horizontalAlignmentToolbar;verticalAlignmentToolbar;saveButtonView;cancelButtonView;backButtonView;_focusables;_focusCycler;constructor(e,t){super(e),this.set({borderStyle:"",borderWidth:"",borderColor:"",padding:"",backgroundColor:"",width:"",height:"",horizontalAlignment:"",verticalAlignment:"",cellType:""}),this.options=t;let{borderStyleDropdown:i,borderWidthInput:o,borderColorInput:n,borderRowLabel:s}=this._createBorderFields(),{backgroundRowLabel:r,backgroundInput:a}=this._createBackgroundFields(),{cellTypeRowLabel:l,cellTypeDropdown:c}=this._createCellTypeField(),{widthInput:u,operatorLabel:d,heightInput:h,dimensionsLabel:f}=this._createDimensionFields(),{horizontalAlignmentToolbar:m,verticalAlignmentToolbar:g,alignmentLabel:b}=this._createAlignmentFields();this.focusTracker=new Q,this.keystrokes=new X,this.children=this.createCollection(),this.borderStyleDropdown=i,this.borderWidthInput=o,this.borderColorInput=n,this.backgroundInput=a,this.cellTypeDropdown=c,this.paddingInput=this._createPaddingField(),this.widthInput=u,this.heightInput=h,this.horizontalAlignmentToolbar=m,this.verticalAlignmentToolbar=g;let{saveButtonView:k,cancelButtonView:v}=this._createActionButtons();this.saveButtonView=k,this.cancelButtonView=v,this.backButtonView=this._createBackButton(),this._focusables=new be,this._focusCycler=new Ie({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});let _=new Mt(e,{label:this.t("Cell properties")});_.children.add(this.backButtonView,0),this.children.add(_),this.children.add(new fe(e,{labelView:s,children:[s,i,o,n],class:"ck-table-form__border-row"})),this.children.add(new fe(e,{children:[new fe(e,{labelView:l,children:[l,c],class:"ck-table-form__cell-type-row"}),new fe(e,{labelView:r,children:[r,a],class:"ck-table-form__background-row"})]})),this.children.add(new fe(e,{children:[new fe(e,{labelView:f,children:[f,u,d,h],class:"ck-table-form__dimensions-row"}),new fe(e,{children:[this.paddingInput],class:"ck-table-cell-properties-form__padding-row"})]})),this.children.add(new fe(e,{labelView:b,children:[b,m,g],class:"ck-table-cell-properties-form__alignment-row"})),this.children.add(new fe(e,{children:[this.cancelButtonView,this.saveButtonView],class:["ck-table-form__action-row"]})),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-table-form","ck-table-cell-properties-form"],tabindex:"-1"},children:this.children})}render(){super.render(),_i({view:this}),[this.borderColorInput,this.backgroundInput].forEach(e=>{this._focusCycler.chain(e.fieldView.focusCycler)}),[this.borderStyleDropdown,this.borderColorInput,this.borderWidthInput,this.cellTypeDropdown,this.backgroundInput,this.widthInput,this.heightInput,this.paddingInput,this.horizontalAlignmentToolbar,this.verticalAlignmentToolbar,this.cancelButtonView,this.saveButtonView,this.backButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createBorderFields(){let e=this.options.defaultTableCellProperties,t={style:e.borderStyle,width:e.borderWidth,color:e.borderColor},i=yc({colorConfig:this.options.borderColors,columns:this.options.colorGridColumns,defaultColorValue:t.color,colorPickerConfig:this.options.colorPickerConfig}),o=this.locale,n=this.t,s=n("Style"),r=new ut(o);r.text=n("Border");let a=pf(n),l=new ue(o,Bl);l.set({label:s,class:"ck-table-form__border-style"}),l.fieldView.buttonView.set({ariaLabel:s,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:s}),l.fieldView.buttonView.bind("label").to(this,"borderStyle",d=>a[d||"none"]),l.fieldView.on("execute",d=>{this.borderStyle=d.source._borderStyleValue}),l.bind("isEmpty").to(this,"borderStyle",d=>!d),Bt(l.fieldView,e5(this,t.style),{role:"menu",ariaLabel:s});let c=new ue(o,nt);c.set({label:n("Width"),class:"ck-table-form__border-width"}),c.fieldView.bind("value").to(this,"borderWidth"),c.bind("isEnabled").to(this,"borderStyle",uc),c.fieldView.on("input",()=>{this.borderWidth=c.fieldView.element.value});let u=new ue(o,i);return u.set({label:n("Color"),class:"ck-table-form__border-color"}),u.fieldView.bind("value").to(this,"borderColor"),u.bind("isEnabled").to(this,"borderStyle",uc),u.fieldView.on("input",()=>{this.borderColor=u.fieldView.value}),this.on("change:borderStyle",(d,h,f,m)=>{uc(f)||(this.borderColor="",this.borderWidth=""),uc(m)||(this.borderColor=t.color,this.borderWidth=t.width)}),{borderRowLabel:r,borderStyleDropdown:l,borderColorInput:u,borderWidthInput:c}}_createBackgroundFields(){let e=this.locale,t=this.t,i=new ut(e);i.text=t("Background");let o=yc({colorConfig:this.options.backgroundColors,columns:this.options.colorGridColumns,defaultColorValue:this.options.defaultTableCellProperties.backgroundColor,colorPickerConfig:this.options.colorPickerConfig}),n=new ue(e,o);return n.set({label:t("Color"),class:"ck-table-cell-properties-form__background"}),n.fieldView.bind("value").to(this,"backgroundColor"),n.fieldView.on("input",()=>{this.backgroundColor=n.fieldView.value}),{backgroundRowLabel:i,backgroundInput:n}}_createCellTypeField(){let e=this.locale,t=this.t,i=new ut(e);i.text=t("Cell type");let o=this._cellTypeLabels,n=new ue(e,Bl);return n.set({label:t("Cell type"),class:"ck-table-cell-properties-form__cell-type"}),n.fieldView.buttonView.set({ariaLabel:t("Cell type"),ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:t("Cell type")}),n.fieldView.buttonView.bind("label").to(this,"cellType",s=>o[s||"data"]),n.fieldView.on("execute",s=>{this.cellType=s.source._cellTypeValue}),n.bind("isEmpty").to(this,"cellType",s=>!s),Bt(n.fieldView,this._getCellTypeDefinitions(),{role:"menu",ariaLabel:t("Cell type")}),{cellTypeRowLabel:i,cellTypeDropdown:n}}_createDimensionFields(){let e=this.locale,t=this.t,i=new ut(e);i.text=t("Dimensions");let o=new ue(e,nt);o.set({label:t("Width"),class:"ck-table-form__dimensions-row__width"}),o.fieldView.bind("value").to(this,"width"),o.fieldView.on("input",()=>{this.width=o.fieldView.element.value});let n=new R(e);n.setTemplate({tag:"span",attributes:{class:["ck-table-form__dimension-operator"]},children:[{text:"\xD7"}]});let s=new ue(e,nt);return s.set({label:t("Height"),class:"ck-table-form__dimensions-row__height"}),s.fieldView.bind("value").to(this,"height"),s.fieldView.on("input",()=>{this.height=s.fieldView.element.value}),{dimensionsLabel:i,widthInput:o,operatorLabel:n,heightInput:s}}_createPaddingField(){let e=this.locale,t=this.t,i=new ue(e,nt);return i.set({label:t("Padding"),class:"ck-table-cell-properties-form__padding"}),i.fieldView.bind("value").to(this,"padding"),i.fieldView.on("input",()=>{this.padding=i.fieldView.element.value}),i}_createAlignmentFields(){let e=this.locale,t=this.t,i=new ut(e),o={left:ml,center:S1,right:V1,justify:P1,top:L1,middle:R1,bottom:I1};i.text=t("Table cell text alignment");let n=new dt(e),s=e.contentLanguageDirection==="rtl";n.set({isCompact:!0,role:"radiogroup",ariaLabel:t("Horizontal text alignment toolbar"),class:"ck-table-cell-properties-form__horizontal-alignment-toolbar"}),rf({view:this,icons:o,toolbar:n,labels:this._horizontalAlignmentLabels,propertyName:"horizontalAlignment",nameToValue:a=>{if(s){if(a==="left")return"right";if(a==="right")return"left"}return a},defaultValue:this.options.defaultTableCellProperties.horizontalAlignment});let r=new dt(e);return r.set({isCompact:!0,role:"radiogroup",ariaLabel:t("Vertical text alignment toolbar"),class:"ck-table-cell-properties-form__vertical-alignment-toolbar"}),rf({view:this,icons:o,toolbar:r,labels:this._verticalAlignmentLabels,propertyName:"verticalAlignment",defaultValue:this.options.defaultTableCellProperties.verticalAlignment}),{horizontalAlignmentToolbar:n,verticalAlignmentToolbar:r,alignmentLabel:i}}_createActionButtons(){let e=this.locale,t=this.t,i=new I(e),o=new I(e),n=[this.borderWidthInput,this.borderColorInput,this.backgroundInput,this.paddingInput];return i.set({label:t("Save"),class:"ck-button-action ck-button_standard",type:"submit",withText:!0}),i.bind("isEnabled").toMany(n,"errorText",(...s)=>s.every(r=>!r)),o.set({label:t("Cancel"),withText:!0,class:"ck-button_standard"}),o.delegate("execute").to(this,"cancel"),{saveButtonView:i,cancelButtonView:o}}_createBackButton(){let e=this.locale.t,t=new I(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:yt,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_getCellTypeDefinitions(){let e=new J,t=this._cellTypeLabels,i=["data","header"];this.options.showScopedHeaderOptions&&i.push("header-column","header-row");for(let o of i){let n={type:"button",model:new ki({_cellTypeValue:o,label:t[o],role:"menuitemradio",withText:!0})};n.model.bind("isOn").to(this,"cellType",s=>s===o),e.add(n)}return e}get _horizontalAlignmentLabels(){let e=this.locale,t=this.t,i=t("Align cell text to the left"),o=t("Align cell text to the center"),n=t("Align cell text to the right"),s=t("Justify cell text");return e.uiLanguageDirection==="rtl"?{right:n,center:o,left:i,justify:s}:{left:i,center:o,right:n,justify:s}}get _verticalAlignmentLabels(){let e=this.t;return{top:e("Align cell text to the top"),middle:e("Align cell text to the middle"),bottom:e("Align cell text to the bottom")}}get _cellTypeLabels(){let e=this.t;return{data:e("Data cell"),header:e("Header cell"),"header-column":e("Column header"),"header-row":e("Row header")}}};function uc(e){return e!=="none"}/** +*/var vV=class extends R{options;focusTracker;keystrokes;children;borderStyleDropdown;borderWidthInput;borderColorInput;backgroundInput;cellTypeDropdown;paddingInput;widthInput;heightInput;horizontalAlignmentToolbar;verticalAlignmentToolbar;saveButtonView;cancelButtonView;backButtonView;_focusables;_focusCycler;constructor(e,t){super(e),this.set({borderStyle:"",borderWidth:"",borderColor:"",padding:"",backgroundColor:"",width:"",height:"",horizontalAlignment:"",verticalAlignment:"",cellType:""}),this.options=t;let{borderStyleDropdown:i,borderWidthInput:o,borderColorInput:n,borderRowLabel:s}=this._createBorderFields(),{backgroundRowLabel:r,backgroundInput:a}=this._createBackgroundFields(),{cellTypeRowLabel:l,cellTypeDropdown:c}=this._createCellTypeField(),{widthInput:u,operatorLabel:d,heightInput:h,dimensionsLabel:f}=this._createDimensionFields(),{horizontalAlignmentToolbar:m,verticalAlignmentToolbar:g,alignmentLabel:b}=this._createAlignmentFields();this.focusTracker=new Q,this.keystrokes=new X,this.children=this.createCollection(),this.borderStyleDropdown=i,this.borderWidthInput=o,this.borderColorInput=n,this.backgroundInput=a,this.cellTypeDropdown=c,this.paddingInput=this._createPaddingField(),this.widthInput=u,this.heightInput=h,this.horizontalAlignmentToolbar=m,this.verticalAlignmentToolbar=g;let{saveButtonView:k,cancelButtonView:v}=this._createActionButtons();this.saveButtonView=k,this.cancelButtonView=v,this.backButtonView=this._createBackButton(),this._focusables=new we,this._focusCycler=new Pe({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});let _=new Bt(e,{label:this.t("Cell properties")});_.children.add(this.backButtonView,0),this.children.add(_),this.children.add(new fe(e,{labelView:s,children:[s,i,o,n],class:"ck-table-form__border-row"})),this.children.add(new fe(e,{children:[new fe(e,{labelView:l,children:[l,c],class:"ck-table-form__cell-type-row"}),new fe(e,{labelView:r,children:[r,a],class:"ck-table-form__background-row"})]})),this.children.add(new fe(e,{children:[new fe(e,{labelView:f,children:[f,u,d,h],class:"ck-table-form__dimensions-row"}),new fe(e,{children:[this.paddingInput],class:"ck-table-cell-properties-form__padding-row"})]})),this.children.add(new fe(e,{labelView:b,children:[b,m,g],class:"ck-table-cell-properties-form__alignment-row"})),this.children.add(new fe(e,{children:[this.cancelButtonView,this.saveButtonView],class:["ck-table-form__action-row"]})),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-table-form","ck-table-cell-properties-form"],tabindex:"-1"},children:this.children})}render(){super.render(),ki({view:this}),[this.borderColorInput,this.backgroundInput].forEach(e=>{this._focusCycler.chain(e.fieldView.focusCycler)}),[this.borderStyleDropdown,this.borderColorInput,this.borderWidthInput,this.cellTypeDropdown,this.backgroundInput,this.widthInput,this.heightInput,this.paddingInput,this.horizontalAlignmentToolbar,this.verticalAlignmentToolbar,this.cancelButtonView,this.saveButtonView,this.backButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createBorderFields(){let e=this.options.defaultTableCellProperties,t={style:e.borderStyle,width:e.borderWidth,color:e.borderColor},i=vc({colorConfig:this.options.borderColors,columns:this.options.colorGridColumns,defaultColorValue:t.color,colorPickerConfig:this.options.colorPickerConfig}),o=this.locale,n=this.t,s=n("Style"),r=new ut(o);r.text=n("Border");let a=wf(n),l=new ue(o,Ol);l.set({label:s,class:"ck-table-form__border-style"}),l.fieldView.buttonView.set({ariaLabel:s,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:s}),l.fieldView.buttonView.bind("label").to(this,"borderStyle",d=>a[d||"none"]),l.fieldView.on("execute",d=>{this.borderStyle=d.source._borderStyleValue}),l.bind("isEmpty").to(this,"borderStyle",d=>!d),ht(l.fieldView,t5(this,t.style),{role:"menu",ariaLabel:s});let c=new ue(o,nt);c.set({label:n("Width"),class:"ck-table-form__border-width"}),c.fieldView.bind("value").to(this,"borderWidth"),c.bind("isEnabled").to(this,"borderStyle",hc),c.fieldView.on("input",()=>{this.borderWidth=c.fieldView.element.value});let u=new ue(o,i);return u.set({label:n("Color"),class:"ck-table-form__border-color"}),u.fieldView.bind("value").to(this,"borderColor"),u.bind("isEnabled").to(this,"borderStyle",hc),u.fieldView.on("input",()=>{this.borderColor=u.fieldView.value}),this.on("change:borderStyle",(d,h,f,m)=>{hc(f)||(this.borderColor="",this.borderWidth=""),hc(m)||(this.borderColor=t.color,this.borderWidth=t.width)}),{borderRowLabel:r,borderStyleDropdown:l,borderColorInput:u,borderWidthInput:c}}_createBackgroundFields(){let e=this.locale,t=this.t,i=new ut(e);i.text=t("Background");let o=vc({colorConfig:this.options.backgroundColors,columns:this.options.colorGridColumns,defaultColorValue:this.options.defaultTableCellProperties.backgroundColor,colorPickerConfig:this.options.colorPickerConfig}),n=new ue(e,o);return n.set({label:t("Color"),class:"ck-table-cell-properties-form__background"}),n.fieldView.bind("value").to(this,"backgroundColor"),n.fieldView.on("input",()=>{this.backgroundColor=n.fieldView.value}),{backgroundRowLabel:i,backgroundInput:n}}_createCellTypeField(){let e=this.locale,t=this.t,i=new ut(e);i.text=t("Cell type");let o=this._cellTypeLabels,n=new ue(e,Ol);return n.set({label:t("Cell type"),class:"ck-table-cell-properties-form__cell-type"}),n.fieldView.buttonView.set({ariaLabel:t("Cell type"),ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:t("Cell type")}),n.fieldView.buttonView.bind("label").to(this,"cellType",s=>o[s||"data"]),n.fieldView.on("execute",s=>{this.cellType=s.source._cellTypeValue}),n.bind("isEmpty").to(this,"cellType",s=>!s),ht(n.fieldView,this._getCellTypeDefinitions(),{role:"menu",ariaLabel:t("Cell type")}),{cellTypeRowLabel:i,cellTypeDropdown:n}}_createDimensionFields(){let e=this.locale,t=this.t,i=new ut(e);i.text=t("Dimensions");let o=new ue(e,nt);o.set({label:t("Width"),class:"ck-table-form__dimensions-row__width"}),o.fieldView.bind("value").to(this,"width"),o.fieldView.on("input",()=>{this.width=o.fieldView.element.value});let n=new R(e);n.setTemplate({tag:"span",attributes:{class:["ck-table-form__dimension-operator"]},children:[{text:"\xD7"}]});let s=new ue(e,nt);return s.set({label:t("Height"),class:"ck-table-form__dimensions-row__height"}),s.fieldView.bind("value").to(this,"height"),s.fieldView.on("input",()=>{this.height=s.fieldView.element.value}),{dimensionsLabel:i,widthInput:o,operatorLabel:n,heightInput:s}}_createPaddingField(){let e=this.locale,t=this.t,i=new ue(e,nt);return i.set({label:t("Padding"),class:"ck-table-cell-properties-form__padding"}),i.fieldView.bind("value").to(this,"padding"),i.fieldView.on("input",()=>{this.padding=i.fieldView.element.value}),i}_createAlignmentFields(){let e=this.locale,t=this.t,i=new ut(e),o={left:gl,center:R1,right:M1,justify:V1,top:B1,middle:L1,bottom:P1};i.text=t("Table cell text alignment");let n=new dt(e),s=e.contentLanguageDirection==="rtl";n.set({isCompact:!0,role:"radiogroup",ariaLabel:t("Horizontal text alignment toolbar"),class:"ck-table-cell-properties-form__horizontal-alignment-toolbar"}),lf({view:this,icons:o,toolbar:n,labels:this._horizontalAlignmentLabels,propertyName:"horizontalAlignment",nameToValue:a=>{if(s){if(a==="left")return"right";if(a==="right")return"left"}return a},defaultValue:this.options.defaultTableCellProperties.horizontalAlignment});let r=new dt(e);return r.set({isCompact:!0,role:"radiogroup",ariaLabel:t("Vertical text alignment toolbar"),class:"ck-table-cell-properties-form__vertical-alignment-toolbar"}),lf({view:this,icons:o,toolbar:r,labels:this._verticalAlignmentLabels,propertyName:"verticalAlignment",defaultValue:this.options.defaultTableCellProperties.verticalAlignment}),{horizontalAlignmentToolbar:n,verticalAlignmentToolbar:r,alignmentLabel:i}}_createActionButtons(){let e=this.locale,t=this.t,i=new I(e),o=new I(e),n=[this.borderWidthInput,this.borderColorInput,this.backgroundInput,this.paddingInput];return i.set({label:t("Save"),class:"ck-button-action ck-button_standard",type:"submit",withText:!0}),i.bind("isEnabled").toMany(n,"errorText",(...s)=>s.every(r=>!r)),o.set({label:t("Cancel"),withText:!0,class:"ck-button_standard"}),o.delegate("execute").to(this,"cancel"),{saveButtonView:i,cancelButtonView:o}}_createBackButton(){let e=this.locale.t,t=new I(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:_t,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}_getCellTypeDefinitions(){let e=new G,t=this._cellTypeLabels,i=["data","header"];this.options.showScopedHeaderOptions&&i.push("header-column","header-row");for(let o of i){let n={type:"button",model:new Ot({_cellTypeValue:o,label:t[o],role:"menuitemradio",withText:!0})};n.model.bind("isOn").to(this,"cellType",s=>s===o),e.add(n)}return e}get _horizontalAlignmentLabels(){let e=this.locale,t=this.t,i=t("Align cell text to the left"),o=t("Align cell text to the center"),n=t("Align cell text to the right"),s=t("Justify cell text");return e.uiLanguageDirection==="rtl"?{right:n,center:o,left:i,justify:s}:{left:i,center:o,right:n,justify:s}}get _verticalAlignmentLabels(){let e=this.t;return{top:e("Align cell text to the top"),middle:e("Align cell text to the middle"),bottom:e("Align cell text to the bottom")}}get _cellTypeLabels(){let e=this.t;return{data:e("Data cell"),header:e("Header cell"),"header-column":e("Column header"),"header-row":e("Row header")}}};function hc(e){return e!=="none"}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var af=[Me.defaultPositions.northArrowSouth,Me.defaultPositions.northArrowSouthWest,Me.defaultPositions.northArrowSouthEast,Me.defaultPositions.southArrowNorth,Me.defaultPositions.southArrowNorthWest,Me.defaultPositions.southArrowNorthEast,Me.defaultPositions.viewportStickyNorth];function i5(e,t){let i=e.plugins.get("ContextualBalloon"),o=e.editing.view.document.selection,n;t==="cell"?kc(o)&&(n=n5(e)):pc(o)&&(n=o5(e)),n&&i.updatePosition(n)}function o5(e){let t=e.model.document.selection,i=Gr(t),o=e.editing.mapper.toViewElement(i);return{target:e.editing.view.domConverter.mapViewToDom(o),positions:af}}function n5(e){let t=e.editing.mapper,i=e.editing.view.domConverter,o=e.model.document.selection;if(o.rangeCount>1)return{target:()=>_V(o.getRanges(),e),positions:af};let n=s5(o.getFirstPosition()),s=t.toViewElement(n);return{target:i.mapViewToDom(s),positions:af}}function s5(e){return e.nodeAfter&&e.nodeAfter.is("element","tableCell")?e.nodeAfter:e.findAncestor("tableCell")}function _V(e,t){let i=t.editing.mapper,o=t.editing.view.domConverter,n=Array.from(e).map(s=>{let r=s5(s.start),a=i.toViewElement(r);return new F(o.mapViewToDom(a))});return F.getBoundingRect(n)}/** +*/var cf=[Me.defaultPositions.northArrowSouth,Me.defaultPositions.northArrowSouthWest,Me.defaultPositions.northArrowSouthEast,Me.defaultPositions.southArrowNorth,Me.defaultPositions.southArrowNorthWest,Me.defaultPositions.southArrowNorthEast,Me.defaultPositions.viewportStickyNorth];function o5(e,t){let i=e.plugins.get("ContextualBalloon"),o=e.editing.view.document.selection,n;t==="cell"?xc(o)&&(n=s5(e)):wc(o)&&(n=n5(e)),n&&i.updatePosition(n)}function n5(e){let t=e.model.document.selection,i=Gr(t),o=e.editing.mapper.toViewElement(i);return{target:e.editing.view.domConverter.mapViewToDom(o),positions:cf}}function s5(e){let t=e.editing.mapper,i=e.editing.view.domConverter,o=e.model.document.selection;if(o.rangeCount>1)return{target:()=>kV(o.getRanges(),e),positions:cf};let n=r5(o.getFirstPosition()),s=t.toViewElement(n);return{target:i.mapViewToDom(s),positions:cf}}function r5(e){return e.nodeAfter&&e.nodeAfter.is("element","tableCell")?e.nodeAfter:e.findAncestor("tableCell")}function kV(e,t){let i=t.editing.mapper,o=t.editing.view.domConverter,n=Array.from(e).map(s=>{let r=r5(s.start),a=i.toViewElement(r);return new F(o.mapViewToDom(a))});return F.getBoundingRect(n)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var vV=500,L_={borderStyle:"tableCellBorderStyle",borderColor:"tableCellBorderColor",borderWidth:"tableCellBorderWidth",height:"tableCellHeight",width:"tableCellWidth",padding:"tableCellPadding",backgroundColor:"tableCellBackgroundColor",horizontalAlignment:"tableCellHorizontalAlignment",verticalAlignment:"tableCellVerticalAlignment",cellType:"tableCellType"},kV=class extends y{_defaultContentTableCellProperties;_defaultLayoutTableCellProperties;_balloon;view;_viewWithContentTableDefaults;_viewWithLayoutTableDefaults;_undoStepBatch;_isReady;static get requires(){return[re]}static get pluginName(){return"TableCellPropertiesUI"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("table.tableCellProperties",{borderColors:wc,backgroundColors:wc,colorGridColumns:Ll})}init(){let e=this.editor,t=e.t;this._defaultContentTableCellProperties=ff(e.config.get("table.tableCellProperties.defaultProperties"),{includeVerticalAlignmentProperty:!0,includeHorizontalAlignmentProperty:!0,includePaddingProperty:!0,isRightToLeftContent:e.locale.contentLanguageDirection==="rtl"}),this._defaultLayoutTableCellProperties=_c(void 0,{includeVerticalAlignmentProperty:!0,includeHorizontalAlignmentProperty:!0,isRightToLeftContent:e.locale.contentLanguageDirection==="rtl"}),this._balloon=e.plugins.get(re),this.view=null,this._isReady=!1,e.ui.componentFactory.add("tableCellProperties",i=>{let o=new I(i);o.set({label:t("Cell properties"),icon:cb,tooltip:!0}),this.listenTo(o,"execute",()=>this._showView());let n=Object.values(L_).map(s=>e.commands.get(s)).filter(s=>!!s);return o.bind("isEnabled").toMany(n,"isEnabled",(...s)=>s.some(r=>r)),o})}destroy(){super.destroy(),this.view&&this.view.destroy()}_createPropertiesView(e){let t=this.editor,i=t.config.get("table.tableCellProperties"),o=!!t.config.get("table.tableCellProperties.scopedHeaders"),n=wr(i.borderColors),s=br(t.locale,n),r=wr(i.backgroundColors),a=br(t.locale,r),l=i.colorPicker!==!1,c=new yV(t.locale,{borderColors:s,backgroundColors:a,defaultTableCellProperties:e,colorGridColumns:i.colorGridColumns,colorPickerConfig:l?i.colorPicker||{}:!1,showScopedHeaderOptions:o}),u=t.t;c.render(),this.listenTo(c,"submit",()=>{this._hideView()}),this.listenTo(c,"cancel",()=>{this._undoStepBatch.operations.length&&t.execute("undo",this._undoStepBatch),this._hideView()}),c.keystrokes.set("Esc",(m,g)=>{this._hideView(),g()}),vt({emitter:c,activator:()=>this._isViewInBalloon,contextElements:[this._balloon.view.element],callback:()=>this._hideView()});let d=Q_(u),h=Y_(u);c.on("change:borderStyle",this._getPropertyChangeCallback("tableCellBorderStyle")),c.on("change:borderColor",this._getValidatedPropertyChangeCallback({viewField:c.borderColorInput,commandName:"tableCellBorderColor",errorText:d,validator:bc})),c.on("change:borderWidth",this._getValidatedPropertyChangeCallback({viewField:c.borderWidthInput,commandName:"tableCellBorderWidth",errorText:h,validator:X_})),c.on("change:padding",this._getValidatedPropertyChangeCallback({viewField:c.paddingInput,commandName:"tableCellPadding",errorText:h,validator:jr})),c.on("change:width",this._getValidatedPropertyChangeCallback({viewField:c.widthInput,commandName:"tableCellWidth",errorText:h,validator:jr})),c.on("change:height",this._getValidatedPropertyChangeCallback({viewField:c.heightInput,commandName:"tableCellHeight",errorText:h,validator:jr})),c.on("change:backgroundColor",this._getValidatedPropertyChangeCallback({viewField:c.backgroundInput,commandName:"tableCellBackgroundColor",errorText:d,validator:bc})),c.on("change:horizontalAlignment",this._getPropertyChangeCallback("tableCellHorizontalAlignment")),c.on("change:verticalAlignment",this._getPropertyChangeCallback("tableCellVerticalAlignment"));let f=t.commands.get("tableCellType");return f&&(c.cellTypeDropdown.bind("isEnabled").to(f,"isEnabled"),c.on("change:cellType",this._getPropertyChangeCallback("tableCellType"))),c}_fillViewFormFromCommandValues(){let e=this.editor.commands,t=e.get("tableCellBorderStyle");Object.entries(L_).flatMap(([i,o])=>{let n=i==="width"?this._getWidthCommandName():o,s=e.get(n);if(!s)return[];let r=i,a;return r==="cellType"?a="":a=this.view===this._viewWithContentTableDefaults?this._defaultContentTableCellProperties[r]||"":this._defaultLayoutTableCellProperties[r]||"",[[i,s.value||a]]}).forEach(([i,o])=>{(i==="borderColor"||i==="borderWidth")&&t.value==="none"||this.view.set(i,o)}),this._isReady=!0}_showView(){let e=this.editor,t=pc(e.editing.view.document.selection),i=t&&e.editing.mapper.toModelElement(t),o=!i||i.getAttribute("tableType")!=="layout";o&&!this._viewWithContentTableDefaults?this._viewWithContentTableDefaults=this._createPropertiesView(this._defaultContentTableCellProperties):!o&&!this._viewWithLayoutTableDefaults&&(this._viewWithLayoutTableDefaults=this._createPropertiesView(this._defaultLayoutTableCellProperties)),this.view=o?this._viewWithContentTableDefaults:this._viewWithLayoutTableDefaults,this.listenTo(e.ui,"update",()=>{this._updateView()}),this._fillViewFormFromCommandValues(),this._balloon.add({view:this.view,position:n5(e)}),this._undoStepBatch=e.model.createBatch(),this.view.focus()}_hideView(){let e=this.editor;this.stopListening(e.ui,"update"),this._isReady=!1,this.view.saveButtonView.focus(),this._balloon.remove(this.view),this.editor.editing.view.focus()}_updateView(){let e=this.editor,t=e.editing.view.document;kc(t.selection)?this._isViewVisible&&i5(e,"cell"):this._hideView()}get _isViewVisible(){return!!this.view&&this._balloon.visibleView===this.view}get _isViewInBalloon(){return!!this.view&&this._balloon.hasView(this.view)}_getPropertyChangeCallback(e){return(t,i,o)=>{this._isReady&&this.editor.execute(e,{value:o,batch:this._undoStepBatch})}}_getValidatedPropertyChangeCallback(e){let{commandName:t,viewField:i,validator:o,errorText:n}=e,s=ye(()=>{i.errorText=n},vV);return(r,a,l)=>{if(s.cancel(),!!this._isReady)if(o(l)){let c=t==="tableCellWidth"?this._getWidthCommandName():t;this.editor.execute(c,{value:l,batch:this._undoStepBatch}),i.errorText=null}else s()}}_getWidthCommandName(){let e=this.editor.commands.get("tableColumnWidth");return e&&e.isEnabled?"tableColumnWidth":"tableCellWidth"}};/** +*/var CV=500,M_={borderStyle:"tableCellBorderStyle",borderColor:"tableCellBorderColor",borderWidth:"tableCellBorderWidth",height:"tableCellHeight",width:"tableCellWidth",padding:"tableCellPadding",backgroundColor:"tableCellBackgroundColor",horizontalAlignment:"tableCellHorizontalAlignment",verticalAlignment:"tableCellVerticalAlignment",cellType:"tableCellType"},xV=class extends w{_defaultContentTableCellProperties;_defaultLayoutTableCellProperties;_balloon;view;_viewWithContentTableDefaults;_viewWithLayoutTableDefaults;_undoStepBatch;_isReady;static get requires(){return[re]}static get pluginName(){return"TableCellPropertiesUI"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("table.tableCellProperties",{borderColors:_c,backgroundColors:_c,colorGridColumns:Ml})}init(){let e=this.editor,t=e.t;this._defaultContentTableCellProperties=gf(e.config.get("table.tableCellProperties.defaultProperties"),{includeVerticalAlignmentProperty:!0,includeHorizontalAlignmentProperty:!0,includePaddingProperty:!0,isRightToLeftContent:e.locale.contentLanguageDirection==="rtl"}),this._defaultLayoutTableCellProperties=kc(void 0,{includeVerticalAlignmentProperty:!0,includeHorizontalAlignmentProperty:!0,isRightToLeftContent:e.locale.contentLanguageDirection==="rtl"}),this._balloon=e.plugins.get(re),this.view=null,this._isReady=!1,e.ui.componentFactory.add("tableCellProperties",i=>{let o=new I(i);o.set({label:t("Cell properties"),icon:db,tooltip:!0}),this.listenTo(o,"execute",()=>this._showView());let n=Object.values(M_).map(s=>e.commands.get(s)).filter(s=>!!s);return o.bind("isEnabled").toMany(n,"isEnabled",(...s)=>s.some(r=>r)),o})}destroy(){super.destroy(),this.view&&this.view.destroy()}_createPropertiesView(e){let t=this.editor,i=t.config.get("table.tableCellProperties"),o=!!t.config.get("table.tableCellProperties.scopedHeaders"),n=wr(i.borderColors),s=br(t.locale,n),r=wr(i.backgroundColors),a=br(t.locale,r),l=i.colorPicker!==!1,c=new vV(t.locale,{borderColors:s,backgroundColors:a,defaultTableCellProperties:e,colorGridColumns:i.colorGridColumns,colorPickerConfig:l?i.colorPicker||{}:!1,showScopedHeaderOptions:o}),u=t.t;c.render(),this.listenTo(c,"submit",()=>{this._hideView()}),this.listenTo(c,"cancel",()=>{this._undoStepBatch.operations.length&&t.execute("undo",this._undoStepBatch),this._hideView()}),c.keystrokes.set("Esc",(m,g)=>{this._hideView(),g()}),kt({emitter:c,activator:()=>this._isViewInBalloon,contextElements:[this._balloon.view.element],callback:()=>this._hideView()});let d=Y_(u),h=X_(u);c.on("change:borderStyle",this._getPropertyChangeCallback("tableCellBorderStyle")),c.on("change:borderColor",this._getValidatedPropertyChangeCallback({viewField:c.borderColorInput,commandName:"tableCellBorderColor",errorText:d,validator:yc})),c.on("change:borderWidth",this._getValidatedPropertyChangeCallback({viewField:c.borderWidthInput,commandName:"tableCellBorderWidth",errorText:h,validator:e5})),c.on("change:padding",this._getValidatedPropertyChangeCallback({viewField:c.paddingInput,commandName:"tableCellPadding",errorText:h,validator:jr})),c.on("change:width",this._getValidatedPropertyChangeCallback({viewField:c.widthInput,commandName:"tableCellWidth",errorText:h,validator:jr})),c.on("change:height",this._getValidatedPropertyChangeCallback({viewField:c.heightInput,commandName:"tableCellHeight",errorText:h,validator:jr})),c.on("change:backgroundColor",this._getValidatedPropertyChangeCallback({viewField:c.backgroundInput,commandName:"tableCellBackgroundColor",errorText:d,validator:yc})),c.on("change:horizontalAlignment",this._getPropertyChangeCallback("tableCellHorizontalAlignment")),c.on("change:verticalAlignment",this._getPropertyChangeCallback("tableCellVerticalAlignment"));let f=t.commands.get("tableCellType");return f&&(c.cellTypeDropdown.bind("isEnabled").to(f,"isEnabled"),c.on("change:cellType",this._getPropertyChangeCallback("tableCellType"))),c}_fillViewFormFromCommandValues(){let e=this.editor.commands,t=e.get("tableCellBorderStyle");Object.entries(M_).flatMap(([i,o])=>{let n=i==="width"?this._getWidthCommandName():o,s=e.get(n);if(!s)return[];let r=i,a;return r==="cellType"?a="":a=this.view===this._viewWithContentTableDefaults?this._defaultContentTableCellProperties[r]||"":this._defaultLayoutTableCellProperties[r]||"",[[i,s.value||a]]}).forEach(([i,o])=>{(i==="borderColor"||i==="borderWidth")&&t.value==="none"||this.view.set(i,o)}),this._isReady=!0}_showView(){let e=this.editor,t=wc(e.editing.view.document.selection),i=t&&e.editing.mapper.toModelElement(t),o=!i||i.getAttribute("tableType")!=="layout";o&&!this._viewWithContentTableDefaults?this._viewWithContentTableDefaults=this._createPropertiesView(this._defaultContentTableCellProperties):!o&&!this._viewWithLayoutTableDefaults&&(this._viewWithLayoutTableDefaults=this._createPropertiesView(this._defaultLayoutTableCellProperties)),this.view=o?this._viewWithContentTableDefaults:this._viewWithLayoutTableDefaults,this.listenTo(e.ui,"update",()=>{this._updateView()}),this._fillViewFormFromCommandValues(),this._balloon.add({view:this.view,position:s5(e)}),this._undoStepBatch=e.model.createBatch(),this.view.focus()}_hideView(){let e=this.editor;this.stopListening(e.ui,"update"),this._isReady=!1,this.view.saveButtonView.focus(),this._balloon.remove(this.view),this.editor.editing.view.focus()}_updateView(){let e=this.editor,t=e.editing.view.document;xc(t.selection)?this._isViewVisible&&o5(e,"cell"):this._hideView()}get _isViewVisible(){return!!this.view&&this._balloon.visibleView===this.view}get _isViewInBalloon(){return!!this.view&&this._balloon.hasView(this.view)}_getPropertyChangeCallback(e){return(t,i,o)=>{this._isReady&&this.editor.execute(e,{value:o,batch:this._undoStepBatch})}}_getValidatedPropertyChangeCallback(e){let{commandName:t,viewField:i,validator:o,errorText:n}=e,s=ve(()=>{i.errorText=n},CV);return(r,a,l)=>{if(s.cancel(),!!this._isReady)if(o(l)){let c=t==="tableCellWidth"?this._getWidthCommandName():t;this.editor.execute(c,{value:l,batch:this._undoStepBatch}),i.errorText=null}else s()}}_getWidthCommandName(){let e=this.editor.commands.get("tableColumnWidth");return e&&e.isEnabled?"tableColumnWidth":"tableCellWidth"}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var ii=class extends M{attributeName;_defaultValue;_defaultContentTableValue;_defaultLayoutTableValue;constructor(e,t,i){switch(super(e),this.attributeName=t,this._defaultContentTableValue=i,t){case"tableCellType":this._defaultLayoutTableValue="data";break;case"tableCellBorderStyle":this._defaultLayoutTableValue="none";break;case"tableCellHorizontalAlignment":this._defaultLayoutTableValue="left";break;case"tableCellVerticalAlignment":this._defaultLayoutTableValue="middle";break;default:this._defaultLayoutTableValue=void 0}}refresh(){let e=this.editor.model.document.selection,t=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e),i=Gr(e);this._defaultValue=!i||i.getAttribute("tableType")!=="layout"?this._defaultContentTableValue:this._defaultLayoutTableValue,this.isEnabled=!!t.length,this.value=this._getSingleValue(t)}execute(e={}){let{value:t,batch:i}=e,o=this.editor.model,n=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(o.document.selection),s=this._getValueToSet(t);o.enqueueChange(i,r=>{s?n.forEach(a=>r.setAttribute(this.attributeName,s,a)):n.forEach(a=>r.removeAttribute(this.attributeName,a)),this.fire("afterExecute",{writer:r,tableCells:n,valueToSet:s})})}_getAttribute(e){if(!e)return;let t=e.getAttribute(this.attributeName);if(t!==this._defaultValue)return t}_getValueToSet(e){if(e!==this._defaultValue)return e}_getSingleValue(e){let t=this._getAttribute(e[0]);return e.every(i=>this._getAttribute(i)===t)?t:void 0}};/** +*/var ni=class extends M{attributeName;_defaultValue;_defaultContentTableValue;_defaultLayoutTableValue;constructor(e,t,i){switch(super(e),this.attributeName=t,this._defaultContentTableValue=i,t){case"tableCellType":this._defaultLayoutTableValue="data";break;case"tableCellBorderStyle":this._defaultLayoutTableValue="none";break;case"tableCellHorizontalAlignment":this._defaultLayoutTableValue="left";break;case"tableCellVerticalAlignment":this._defaultLayoutTableValue="middle";break;default:this._defaultLayoutTableValue=void 0}}refresh(){let e=this.editor.model.document.selection,t=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(e),i=Gr(e);this._defaultValue=!i||i.getAttribute("tableType")!=="layout"?this._defaultContentTableValue:this._defaultLayoutTableValue,this.isEnabled=!!t.length,this.value=this._getSingleValue(t)}execute(e={}){let{value:t,batch:i}=e,o=this.editor.model,n=this.editor.plugins.get("TableUtils").getSelectionAffectedTableCells(o.document.selection),s=this._getValueToSet(t);o.enqueueChange(i,r=>{s?n.forEach(a=>r.setAttribute(this.attributeName,s,a)):n.forEach(a=>r.removeAttribute(this.attributeName,a)),this.fire("afterExecute",{writer:r,tableCells:n,valueToSet:s})})}_getAttribute(e){if(!e)return;let t=e.getAttribute(this.attributeName);if(t!==this._defaultValue)return t}_getValueToSet(e){if(e!==this._defaultValue)return e}_getSingleValue(e){let t=this._getAttribute(e[0]);return e.every(i=>this._getAttribute(i)===t)?t:void 0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var CV=class extends ii{constructor(e,t){super(e,"tableCellWidth",t)}_getValueToSet(e){if(e=Do(e,"px"),e!==this._defaultValue)return e}};/** +*/var TV=class extends ni{constructor(e,t){super(e,"tableCellWidth",t)}_getValueToSet(e){if(e=Do(e,"px"),e!==this._defaultValue)return e}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var xV=class extends y{static get pluginName(){return"TableCellWidthEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[vc]}init(){let e=this.editor,t=ff(e.config.get("table.tableCellProperties.defaultProperties"));mc(e.model.schema,e.conversion,{modelAttribute:"tableCellWidth",styleName:"width",attributeName:"width",attributeType:"length",defaultValue:t.width}),e.commands.add("tableCellWidth",new CV(e,t.width))}};/** +*/var EV=class extends w{static get pluginName(){return"TableCellWidthEditing"}static get isOfficialPlugin(){return!0}static get requires(){return[Cc]}init(){let e=this.editor,t=gf(e.config.get("table.tableCellProperties.defaultProperties"));pc(e.model.schema,e.conversion,{modelAttribute:"tableCellWidth",styleName:"width",attributeName:"width",attributeType:"length",defaultValue:t.width}),e.commands.add("tableCellWidth",new TV(e,t.width))}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var TV=class extends ii{constructor(e,t){super(e,"tableCellPadding",t)}_getAttribute(e){if(!e)return;let t=Oo(e.getAttribute(this.attributeName));if(t!==this._defaultValue)return t}_getValueToSet(e){let t=Do(e,"px");if(t!==this._defaultValue)return t}};/** +*/var AV=class extends ni{constructor(e,t){super(e,"tableCellPadding",t)}_getAttribute(e){if(!e)return;let t=Oo(e.getAttribute(this.attributeName));if(t!==this._defaultValue)return t}_getValueToSet(e){let t=Do(e,"px");if(t!==this._defaultValue)return t}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var EV=class extends ii{constructor(e,t){super(e,"tableCellHeight",t)}_getValueToSet(e){let t=Do(e,"px");if(t!==this._defaultValue)return t}};/** +*/var IV=class extends ni{constructor(e,t){super(e,"tableCellHeight",t)}_getValueToSet(e){let t=Do(e,"px");if(t!==this._defaultValue)return t}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var AV=class extends ii{constructor(e,t){super(e,"tableCellBackgroundColor",t)}};/** +*/var SV=class extends ni{constructor(e,t){super(e,"tableCellBackgroundColor",t)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var IV=class extends ii{constructor(e,t){super(e,"tableCellVerticalAlignment",t)}};/** +*/var PV=class extends ni{constructor(e,t){super(e,"tableCellVerticalAlignment",t)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var SV=class extends ii{constructor(e,t){super(e,"tableCellHorizontalAlignment",t)}};/** +*/var RV=class extends ni{constructor(e,t){super(e,"tableCellHorizontalAlignment",t)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var PV=class extends ii{constructor(e,t){super(e,"tableCellBorderStyle",t)}_getAttribute(e){if(!e)return;let t=Oo(e.getAttribute(this.attributeName));if(t!==this._defaultValue)return t}};/** +*/var VV=class extends ni{constructor(e,t){super(e,"tableCellBorderStyle",t)}_getAttribute(e){if(!e)return;let t=Oo(e.getAttribute(this.attributeName));if(t!==this._defaultValue)return t}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var RV=class extends ii{constructor(e,t){super(e,"tableCellBorderColor",t)}_getAttribute(e){if(!e)return;let t=Oo(e.getAttribute(this.attributeName));if(t!==this._defaultValue)return t}};/** +*/var LV=class extends ni{constructor(e,t){super(e,"tableCellBorderColor",t)}_getAttribute(e){if(!e)return;let t=Oo(e.getAttribute(this.attributeName));if(t!==this._defaultValue)return t}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var VV=class extends ii{constructor(e,t){super(e,"tableCellBorderWidth",t)}_getAttribute(e){if(!e)return;let t=Oo(e.getAttribute(this.attributeName));if(t!==this._defaultValue)return t}_getValueToSet(e){let t=Do(e,"px");if(t!==this._defaultValue)return t}};/** +*/var MV=class extends ni{constructor(e,t){super(e,"tableCellBorderWidth",t)}_getAttribute(e){if(!e)return;let t=Oo(e.getAttribute(this.attributeName));if(t!==this._defaultValue)return t}_getValueToSet(e){let t=Do(e,"px");if(t!==this._defaultValue)return t}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var LV=class extends ii{constructor(e){super(e,"tableCellType","data"),this.on("afterExecute",(t,i)=>{let{writer:o,tableCells:n}=i;r5(this.editor.plugins.get(we),o,tR(n).keys())})}refresh(){super.refresh();let e=Gr(this.editor.model.document.selection);this.isEnabled&&e&&e.getAttribute("tableType")==="layout"&&(this.isEnabled=!1)}_getAttribute(e){return e?.getAttribute(this.attributeName)||"data"}};function r5(e,t,i){let o=!1;for(let n of i){let s=n.getAttribute("headingRows")||0,r=n.getAttribute("headingColumns")||0,a=n.getAttribute("footerRows")||0,l=e.getRows(n)-a,c=r>s;if(c){let d=Qh(e,n,"column",r,s);d!==r&&(e.setHeadingColumnsCount(t,n,d,{updateCellType:!1}),r=d,o=!0)}let u=Qh(e,n,"row",s,r);if(a>0&&(u=Math.min(u,l)),u!==s&&(e.setHeadingRowsCount(t,n,u,{updateCellType:!1}),s=u,o=!0),!c){let d=Qh(e,n,"column",r,s);d!==r&&(e.setHeadingColumnsCount(t,n,d,{updateCellType:!1}),o=!0)}}return o}function Qh(e,t,i,o,n){let s=i==="row"?e.getRows(t):e.getColumns(t),r=o;for(let a=0;a=n&&(u=!0)}if(!c)return Math.min(r,a);u&&(r=Math.max(r,a+1))}return Math.min(r,s)}/** +*/var BV=class extends ni{constructor(e){super(e,"tableCellType","data"),this.on("afterExecute",(t,i)=>{let{writer:o,tableCells:n}=i;a5(this.editor.plugins.get(_e),o,oR(n).keys())})}refresh(){super.refresh();let e=Gr(this.editor.model.document.selection);this.isEnabled&&e&&e.getAttribute("tableType")==="layout"&&(this.isEnabled=!1)}_getAttribute(e){return e?.getAttribute(this.attributeName)||"data"}};function a5(e,t,i){let o=!1;for(let n of i){let s=n.getAttribute("headingRows")||0,r=n.getAttribute("headingColumns")||0,a=n.getAttribute("footerRows")||0,l=e.getRows(n)-a,c=r>s;if(c){let d=Xh(e,n,"column",r,s);d!==r&&(e.setHeadingColumnsCount(t,n,d,{updateCellType:!1}),r=d,o=!0)}let u=Xh(e,n,"row",s,r);if(a>0&&(u=Math.min(u,l)),u!==s&&(e.setHeadingRowsCount(t,n,u,{updateCellType:!1}),s=u,o=!0),!c){let d=Xh(e,n,"column",r,s);d!==r&&(e.setHeadingColumnsCount(t,n,d,{updateCellType:!1}),o=!0)}}return o}function Xh(e,t,i,o,n){let s=i==="row"?e.getRows(t):e.getColumns(t),r=o;for(let a=0;a=n&&(u=!0)}if(!c)return Math.min(r,a);u&&(r=Math.max(r,a+1))}return Math.min(r,s)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var M_=/^(top|middle|bottom)$/,a5=/^(left|center|right|justify)$/,MV=class extends y{static get pluginName(){return"TableCellPropertiesEditing"}static get licenseFeatureCode(){return"TCP"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}static get requires(){return[vc,xV]}init(){let e=this.editor,t=e.model.schema,i=e.conversion;e.config.define("table.tableCellProperties.defaultProperties",{});let o=ff(e.config.get("table.tableCellProperties.defaultProperties"),{includeVerticalAlignmentProperty:!0,includeHorizontalAlignmentProperty:!0,includePaddingProperty:!0,isRightToLeftContent:e.locale.contentLanguageDirection==="rtl"});e.data.addStyleProcessorRules(Id),BV(e,{color:o.borderColor,style:o.borderStyle,width:o.borderWidth}),e.commands.add("tableCellBorderStyle",new PV(e,o.borderStyle)),e.commands.add("tableCellBorderColor",new RV(e,o.borderColor)),e.commands.add("tableCellBorderWidth",new VV(e,o.borderWidth)),mc(t,i,{modelAttribute:"tableCellHeight",styleName:"height",attributeName:"height",attributeType:"length",defaultValue:o.height}),e.commands.add("tableCellHeight",new EV(e,o.height)),e.data.addStyleProcessorRules(c1),mc(t,i,{modelAttribute:"tableCellPadding",styleName:"padding",reduceBoxSides:!0,defaultValue:o.padding}),zV(e,o.padding),e.commands.add("tableCellPadding",new TV(e,o.padding)),e.data.addStyleProcessorRules(ul),mc(t,i,{modelAttribute:"tableCellBackgroundColor",styleName:"background-color",attributeName:"bgcolor",attributeType:"color",defaultValue:o.backgroundColor}),e.commands.add("tableCellBackgroundColor",new AV(e,o.backgroundColor)),OV(t,i,o.horizontalAlignment),DV(i),e.commands.add("tableCellHorizontalAlignment",new SV(e,o.horizontalAlignment)),FV(t,i,o.verticalAlignment),e.commands.add("tableCellVerticalAlignment",new IV(e,o.verticalAlignment)),NV(e),e.commands.add("tableCellType",new LV(e))}};function BV(e,t){let{conversion:i}=e,{schema:o}=e.model,n={width:"tableCellBorderWidth",color:"tableCellBorderColor",style:"tableCellBorderStyle"};o.extend("tableCell",{allowAttributes:Object.values(n)});for(let s of Object.values(n))o.setAttributeProperties(s,{isFormatting:!0});Yh(e,"td",n,t),Yh(e,"th",n,t),$r(i,{modelElement:"tableCell",modelAttribute:n.style,styleName:"border-style"}),$r(i,{modelElement:"tableCell",modelAttribute:n.color,styleName:"border-color"}),$r(i,{modelElement:"tableCell",modelAttribute:n.width,styleName:"border-width"})}function OV(e,t,i){e.extend("tableCell",{allowAttributes:["tableCellHorizontalAlignment"]}),e.setAttributeProperties("tableCellHorizontalAlignment",{isFormatting:!0}),t.for("downcast").attributeToAttribute({model:{name:"tableCell",key:"tableCellHorizontalAlignment"},view:o=>({key:"style",value:{"text-align":o}})}),t.for("upcast").attributeToAttribute({view:{name:/^(td|th)$/,styles:{"text-align":a5}},model:{key:"tableCellHorizontalAlignment",value:(o,n,s)=>{let r=Mo(i,"left",s),a=o.getStyle("text-align");if(a!==r)return a;n.consumable.consume(o,{styles:"text-align"})}}})}function DV(e){e.for("upcast").add(i=>{let o=new We({name:/^(td|th)$/,attributes:{align:a5}});i.on("element",(n,s,r)=>{if(!o.match(s.viewItem))return;let a=s.modelRange?.start.nodeAfter;/* istanbul ignore if -- @preserve */if(!a?.is("element"))return;let l=s.viewItem.getAttribute("align");if(r.consumable.consume(s.viewItem,{attributes:["align"]}))for(let c of a.getChildren())c.is("element")&&t(c,l,r)},{priority:"low"})});function t(i,o,{schema:n,writer:s}){let r=n.getDefinition(i);if(r)for(let a of r.allowAttributes){if(i.hasAttribute(a))continue;let{blockAlignment:l}=n.getAttributeProperties(a);if(!l)continue;let c=(typeof l=="function"?l(i):l)[o];c&&!c.isDefault&&s.setAttribute(a,c.value,i);return}}}function FV(e,t,i){e.extend("tableCell",{allowAttributes:["tableCellVerticalAlignment"]}),e.setAttributeProperties("tableCellVerticalAlignment",{isFormatting:!0}),t.for("downcast").attributeToAttribute({model:{name:"tableCell",key:"tableCellVerticalAlignment"},view:o=>({key:"style",value:{"vertical-align":o}})}),t.for("upcast").attributeToAttribute({view:{name:/^(td|th)$/,styles:{"vertical-align":M_}},model:{key:"tableCellVerticalAlignment",value:(o,n,s)=>{let r=Mo(i,"middle",s),a=o.getStyle("vertical-align");if(a!==r)return a;n.consumable.consume(o,{styles:"vertical-align"})}}}).attributeToAttribute({view:{name:/^(td|th)$/,attributes:{valign:M_}},model:{key:"tableCellVerticalAlignment",value:(o,n,s)=>{let r=Mo(i,"middle",s),a=o.getAttribute("valign");if(a!==r)return a;n.consumable.consume(o,{attributes:"valign"})}}})}function NV(e){let{model:t,conversion:i,editing:o,config:n}=e,{schema:s}=t;n.define("table.tableCellProperties.scopedHeaders",!0);let r=!!n.get("table.tableCellProperties.scopedHeaders"),a=e.plugins.get(we);s.extend("tableCell",{allowAttributes:["tableCellType"]}),s.setAttributeProperties("tableCellType",{isFormatting:!0}),s.addAttributeCheck(l=>{if(Array.from(l).reverse().find(c=>c.name==="table")?.getAttribute("tableType")==="layout")return!1},"tableCellType"),i.for("upcast").add(l=>{l.on("element:th",(c,u,d)=>{let{writer:h}=d,{modelRange:f}=u,m=f?.start.nodeAfter;m?.is("element","tableCell")&&!m.hasAttribute("tableCellType")&&h.setAttribute("tableCellType","header",m)}),l.on("element:table",(c,u,d)=>{let{writer:h}=d,{modelRange:f}=u,m=f?.start.nodeAfter;if(m?.is("element","table")&&m.getAttribute("tableType")==="layout")for(let{cell:g}of new U(m)){let b=g.getAttribute("tableCellType");if(Kr(b)){h.setAttribute("tableType","content",m);break}}},{priority:le.low-1})}),r&&(i.for("downcast").attributeToAttribute({model:{name:"tableCell",key:"tableCellType"},view:l=>{switch(l){case"header-row":return{key:"scope",value:"row"};case"header-column":return{key:"scope",value:"col"}}}}),i.for("upcast").add(l=>{l.on("element:th",(c,u,d)=>{let{writer:h,consumable:f}=d,{viewItem:m,modelRange:g}=u,b=g?.start.nodeAfter;if(b&&b.getAttribute("tableCellType")==="header"&&f.consume(m,{attributes:["scope"]}))switch(m.getAttribute("scope")){case"row":h.setAttribute("tableCellType","header-row",b);break;case"col":h.setAttribute("tableCellType","header-column",b)}})})),t.document.registerPostFixer(l=>{let c=t.document.differ.getChanges(),u=new Set;for(let d of c){if(d.type==="attribute"&&(d.attributeKey==="headingRows"||d.attributeKey==="headingColumns")){let h=d.range.start.nodeAfter;h?.is("element","table")&&h.root.rootName!=="$graveyard"&&u.add(h)}if(d.type==="attribute"&&d.attributeKey==="tableCellType"){let h=d.range.start.nodeAfter;if(h?.is("element","tableCell")&&h.root.rootName!=="$graveyard"){let f=h.findAncestor("table");f&&u.add(f)}}if(d.type==="insert"&&d.position.nodeAfter){for(let{item:h}of t.createRangeOn(d.position.nodeAfter))if(h.is("element","tableCell")&&h.getAttribute("tableCellType")&&h.root.rootName!=="$graveyard"){let f=h.findAncestor("table");f&&u.add(f)}}}return r5(a,l,u)}),t.document.on("change:data",()=>{let{differ:l}=t.document,c=new Set;for(let u of l.getChanges())if(u.type==="attribute"&&u.attributeKey==="tableCellType"){let d=u.range.start.nodeAfter;d.is("element","tableCell")&&c.add(d)}for(let u of c){let d=o.mapper.toViewElement(u),h=u.getAttribute("tableCellType"),f=Kr(h)?"th":"td";d?.name!==f&&o.reconvertItem(u)}})}function zV(e,t){Xh(e,"td",t),Xh(e,"th",t)}/** +*/var B_=/^(top|middle|bottom)$/,l5=/^(left|center|right|justify)$/,OV=class extends w{static get pluginName(){return"TableCellPropertiesEditing"}static get licenseFeatureCode(){return"TCP"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}static get requires(){return[Cc,EV]}init(){let e=this.editor,t=e.model.schema,i=e.conversion;e.config.define("table.tableCellProperties.defaultProperties",{});let o=gf(e.config.get("table.tableCellProperties.defaultProperties"),{includeVerticalAlignmentProperty:!0,includeHorizontalAlignmentProperty:!0,includePaddingProperty:!0,isRightToLeftContent:e.locale.contentLanguageDirection==="rtl"});e.data.addStyleProcessorRules(Pd),DV(e,{color:o.borderColor,style:o.borderStyle,width:o.borderWidth}),e.commands.add("tableCellBorderStyle",new VV(e,o.borderStyle)),e.commands.add("tableCellBorderColor",new LV(e,o.borderColor)),e.commands.add("tableCellBorderWidth",new MV(e,o.borderWidth)),pc(t,i,{modelAttribute:"tableCellHeight",styleName:"height",attributeName:"height",attributeType:"length",defaultValue:o.height}),e.commands.add("tableCellHeight",new IV(e,o.height)),e.data.addStyleProcessorRules(d1),pc(t,i,{modelAttribute:"tableCellPadding",styleName:"padding",reduceBoxSides:!0,defaultValue:o.padding}),WV(e,o.padding),e.commands.add("tableCellPadding",new AV(e,o.padding)),e.data.addStyleProcessorRules(dl),pc(t,i,{modelAttribute:"tableCellBackgroundColor",styleName:"background-color",attributeName:"bgcolor",attributeType:"color",defaultValue:o.backgroundColor}),e.commands.add("tableCellBackgroundColor",new SV(e,o.backgroundColor)),FV(t,i,o.horizontalAlignment),NV(i),e.commands.add("tableCellHorizontalAlignment",new RV(e,o.horizontalAlignment)),zV(t,i,o.verticalAlignment),e.commands.add("tableCellVerticalAlignment",new PV(e,o.verticalAlignment)),HV(e),e.commands.add("tableCellType",new BV(e))}};function DV(e,t){let{conversion:i}=e,{schema:o}=e.model,n={width:"tableCellBorderWidth",color:"tableCellBorderColor",style:"tableCellBorderStyle"};o.extend("tableCell",{allowAttributes:Object.values(n)});for(let s of Object.values(n))o.setAttributeProperties(s,{isFormatting:!0});ef(e,"td",n,t),ef(e,"th",n,t),$r(i,{modelElement:"tableCell",modelAttribute:n.style,styleName:"border-style"}),$r(i,{modelElement:"tableCell",modelAttribute:n.color,styleName:"border-color"}),$r(i,{modelElement:"tableCell",modelAttribute:n.width,styleName:"border-width"})}function FV(e,t,i){e.extend("tableCell",{allowAttributes:["tableCellHorizontalAlignment"]}),e.setAttributeProperties("tableCellHorizontalAlignment",{isFormatting:!0}),t.for("downcast").attributeToAttribute({model:{name:"tableCell",key:"tableCellHorizontalAlignment"},view:o=>({key:"style",value:{"text-align":o}})}),t.for("upcast").attributeToAttribute({view:{name:/^(td|th)$/,styles:{"text-align":l5}},model:{key:"tableCellHorizontalAlignment",value:(o,n,s)=>{let r=Mo(i,"left",s),a=o.getStyle("text-align");if(a!==r)return a;n.consumable.consume(o,{styles:"text-align"})}}})}function NV(e){e.for("upcast").add(i=>{let o=new We({name:/^(td|th)$/,attributes:{align:l5}});i.on("element",(n,s,r)=>{if(!o.match(s.viewItem))return;let a=s.modelRange?.start.nodeAfter;/* istanbul ignore if -- @preserve */if(!a?.is("element"))return;let l=s.viewItem.getAttribute("align");if(r.consumable.consume(s.viewItem,{attributes:["align"]}))for(let c of a.getChildren())c.is("element")&&t(c,l,r)},{priority:"low"})});function t(i,o,{schema:n,writer:s}){let r=n.getDefinition(i);if(r)for(let a of r.allowAttributes){if(i.hasAttribute(a))continue;let{blockAlignment:l}=n.getAttributeProperties(a);if(!l)continue;let c=(typeof l=="function"?l(i):l)[o];c&&!c.isDefault&&s.setAttribute(a,c.value,i);return}}}function zV(e,t,i){e.extend("tableCell",{allowAttributes:["tableCellVerticalAlignment"]}),e.setAttributeProperties("tableCellVerticalAlignment",{isFormatting:!0}),t.for("downcast").attributeToAttribute({model:{name:"tableCell",key:"tableCellVerticalAlignment"},view:o=>({key:"style",value:{"vertical-align":o}})}),t.for("upcast").attributeToAttribute({view:{name:/^(td|th)$/,styles:{"vertical-align":B_}},model:{key:"tableCellVerticalAlignment",value:(o,n,s)=>{let r=Mo(i,"middle",s),a=o.getStyle("vertical-align");if(a!==r)return a;n.consumable.consume(o,{styles:"vertical-align"})}}}).attributeToAttribute({view:{name:/^(td|th)$/,attributes:{valign:B_}},model:{key:"tableCellVerticalAlignment",value:(o,n,s)=>{let r=Mo(i,"middle",s),a=o.getAttribute("valign");if(a!==r)return a;n.consumable.consume(o,{attributes:"valign"})}}})}function HV(e){let{model:t,conversion:i,editing:o,config:n}=e,{schema:s}=t;n.define("table.tableCellProperties.scopedHeaders",!0);let r=!!n.get("table.tableCellProperties.scopedHeaders"),a=e.plugins.get(_e);s.extend("tableCell",{allowAttributes:["tableCellType"]}),s.setAttributeProperties("tableCellType",{isFormatting:!0}),s.addAttributeCheck(l=>{if(Array.from(l).reverse().find(c=>c.name==="table")?.getAttribute("tableType")==="layout")return!1},"tableCellType"),i.for("upcast").add(l=>{l.on("element:th",(c,u,d)=>{let{writer:h}=d,{modelRange:f}=u,m=f?.start.nodeAfter;m?.is("element","tableCell")&&!m.hasAttribute("tableCellType")&&h.setAttribute("tableCellType","header",m)}),l.on("element:table",(c,u,d)=>{let{writer:h}=d,{modelRange:f}=u,m=f?.start.nodeAfter;if(m?.is("element","table")&&m.getAttribute("tableType")==="layout")for(let{cell:g}of new U(m)){let b=g.getAttribute("tableCellType");if(Kr(b)){h.setAttribute("tableType","content",m);break}}},{priority:le.low-1})}),r&&(i.for("downcast").attributeToAttribute({model:{name:"tableCell",key:"tableCellType"},view:l=>{switch(l){case"header-row":return{key:"scope",value:"row"};case"header-column":return{key:"scope",value:"col"}}}}),i.for("upcast").add(l=>{l.on("element:th",(c,u,d)=>{let{writer:h,consumable:f}=d,{viewItem:m,modelRange:g}=u,b=g?.start.nodeAfter;if(b&&b.getAttribute("tableCellType")==="header"&&f.consume(m,{attributes:["scope"]}))switch(m.getAttribute("scope")){case"row":h.setAttribute("tableCellType","header-row",b);break;case"col":h.setAttribute("tableCellType","header-column",b)}})})),t.document.registerPostFixer(l=>{let c=t.document.differ.getChanges(),u=new Set;for(let d of c){if(d.type==="attribute"&&(d.attributeKey==="headingRows"||d.attributeKey==="headingColumns")){let h=d.range.start.nodeAfter;h?.is("element","table")&&h.root.rootName!=="$graveyard"&&u.add(h)}if(d.type==="attribute"&&d.attributeKey==="tableCellType"){let h=d.range.start.nodeAfter;if(h?.is("element","tableCell")&&h.root.rootName!=="$graveyard"){let f=h.findAncestor("table");f&&u.add(f)}}if(d.type==="insert"&&d.position.nodeAfter){for(let{item:h}of t.createRangeOn(d.position.nodeAfter))if(h.is("element","tableCell")&&h.getAttribute("tableCellType")&&h.root.rootName!=="$graveyard"){let f=h.findAncestor("table");f&&u.add(f)}}}return a5(a,l,u)}),t.document.on("change:data",()=>{let{differ:l}=t.document,c=new Set;for(let u of l.getChanges())if(u.type==="attribute"&&u.attributeKey==="tableCellType"){let d=u.range.start.nodeAfter;d.is("element","tableCell")&&c.add(d)}for(let u of c){let d=o.mapper.toViewElement(u),h=u.getAttribute("tableCellType"),f=Kr(h)?"th":"td";d?.name!==f&&o.reconvertItem(u)}})}function WV(e,t){tf(e,"td",t),tf(e,"th",t)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var l5=class extends y{static get pluginName(){return"TableCellProperties"}static get isOfficialPlugin(){return!0}static get requires(){return[MV,kV]}};/** +*/var c5=class extends w{static get pluginName(){return"TableCellProperties"}static get isOfficialPlugin(){return!0}static get requires(){return[OV,xV]}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -2230,37 +2230,37 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let */var Fo=class extends M{attributeName;_defaultValue;_defaultContentTableValue;_defaultLayoutTableValue;constructor(e,t,i){super(e),this.attributeName=t,this._defaultContentTableValue=i,this._defaultLayoutTableValue=t==="tableBorderStyle"?"none":void 0}refresh(){let e=this.editor.model.document.selection,t=Gr(e);this._defaultValue=!t||t.getAttribute("tableType")!=="layout"?this._defaultContentTableValue:this._defaultLayoutTableValue,this.isEnabled=!!t,this.value=this._getValue(t)}execute(e={}){let t=this.editor.model,i=t.document.selection,{value:o,batch:n}=e,s=Gr(i),r=this._getValueToSet(o);t.enqueueChange(n,a=>{r?a.setAttribute(this.attributeName,r,s):a.removeAttribute(this.attributeName,s)})}_getValue(e){if(!e)return;let t=e.getAttribute(this.attributeName);if(t!==this._defaultValue)return t}_getValueToSet(e){if(e!==this._defaultValue)return e}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var HV=class extends Fo{constructor(e,t){super(e,"tableBackgroundColor",t)}};/** +*/var UV=class extends Fo{constructor(e,t){super(e,"tableBackgroundColor",t)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var WV=class extends Fo{constructor(e,t){super(e,"tableBorderColor",t)}_getValue(e){if(!e)return;let t=Oo(e.getAttribute(this.attributeName));if(t!==this._defaultValue)return t}};/** +*/var qV=class extends Fo{constructor(e,t){super(e,"tableBorderColor",t)}_getValue(e){if(!e)return;let t=Oo(e.getAttribute(this.attributeName));if(t!==this._defaultValue)return t}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var UV=class extends Fo{constructor(e,t){super(e,"tableBorderStyle",t)}_getValue(e){if(!e)return;let t=Oo(e.getAttribute(this.attributeName));if(t!==this._defaultValue)return t}};/** +*/var $V=class extends Fo{constructor(e,t){super(e,"tableBorderStyle",t)}_getValue(e){if(!e)return;let t=Oo(e.getAttribute(this.attributeName));if(t!==this._defaultValue)return t}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var qV=class extends Fo{constructor(e,t){super(e,"tableBorderWidth",t)}_getValue(e){if(!e)return;let t=Oo(e.getAttribute(this.attributeName));if(t!==this._defaultValue)return t}_getValueToSet(e){let t=Do(e,"px");if(t!==this._defaultValue)return t}};/** +*/var jV=class extends Fo{constructor(e,t){super(e,"tableBorderWidth",t)}_getValue(e){if(!e)return;let t=Oo(e.getAttribute(this.attributeName));if(t!==this._defaultValue)return t}_getValueToSet(e){let t=Do(e,"px");if(t!==this._defaultValue)return t}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var $V=class extends Fo{constructor(e,t){super(e,"tableWidth",t)}_getValueToSet(e){if(e=Do(e,"px"),e!==this._defaultValue)return e}};/** +*/var KV=class extends Fo{constructor(e,t){super(e,"tableWidth",t)}_getValueToSet(e){if(e=Do(e,"px"),e!==this._defaultValue)return e}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var jV=class extends Fo{constructor(e,t){super(e,"tableHeight",t)}_getValueToSet(e){if(e=Do(e,"px"),e!==this._defaultValue)return e}};/** +*/var GV=class extends Fo{constructor(e,t){super(e,"tableHeight",t)}_getValueToSet(e){if(e=Do(e,"px"),e!==this._defaultValue)return e}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var KV=class extends Fo{constructor(e,t){super(e,"tableAlignment",t)}};/** +*/var JV=class extends Fo{constructor(e,t){super(e,"tableAlignment",t)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var GV=class extends y{static get pluginName(){return"TablePropertiesEditing"}static get licenseFeatureCode(){return"TCP"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}static get requires(){return[vc]}init(){let e=this.editor,t=e.model.schema,i=e.conversion;e.config.define("table.tableProperties.defaultProperties",{});let o=hf(e.config.get("table.tableProperties.defaultProperties"),{includeAlignmentProperty:!0}),n=e.config.get("table.tableProperties.alignment.useInlineStyles")===!0;e.data.addStyleProcessorRules(l1),e.data.addStyleProcessorRules(Id),ZV(e,{color:o.borderColor,style:o.borderStyle,width:o.borderWidth}),e.commands.add("tableBorderColor",new WV(e,o.borderColor)),e.commands.add("tableBorderStyle",new UV(e,o.borderStyle)),e.commands.add("tableBorderWidth",new qV(e,o.borderWidth)),QV(t,i,o.alignment,n),e.commands.add("tableAlignment",new KV(e,o.alignment)),O_(t,i,{modelAttribute:"tableWidth",styleName:"width",attributeName:"width",attributeType:"length",defaultValue:o.width}),e.commands.add("tableWidth",new $V(e,o.width)),O_(t,i,{modelAttribute:"tableHeight",styleName:"height",attributeName:"height",attributeType:"length",defaultValue:o.height}),e.commands.add("tableHeight",new jV(e,o.height)),e.data.addStyleProcessorRules(ul),eL(t,i,{modelAttribute:"tableBackgroundColor",styleName:"background-color",attributeName:"bgcolor",attributeType:"color",defaultValue:o.backgroundColor}),e.commands.add("tableBackgroundColor",new HV(e,o.backgroundColor)),Xh(e,"table");let s=e.editing.view.document;this.listenTo(s,"clipboardOutput",(r,a)=>{e.editing.view.change(l=>{for(let{item:c}of l.createRangeIn(a.content))JV(c,l);a.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(a.content))})},{priority:"lowest"})}};function JV(e,t){if(!e.is("element","table"))return;let i=e.getAttribute("align"),o=e.getStyle("float"),n=e.getStyle("margin-left"),s=e.getStyle("margin-right");if(i&&i==="center"||o&&o==="right"&&i&&i==="right"){B_(t,i,e);return}o===void 0&&n==="auto"&&s==="0"&&B_(t,"right",e)}function B_(e,t,i){let o=e.createPositionBefore(i),n=e.createContainerElement("div",{align:t},i);e.insert(o,n)}function ZV(e,t){let{conversion:i}=e,{schema:o}=e.model,n={width:"tableBorderWidth",color:"tableBorderColor",style:"tableBorderStyle"};o.extend("table",{allowAttributes:Object.values(n)});for(let s of Object.values(n))o.setAttributeProperties(s,{isFormatting:!0});Yh(e,"table",n,t),hc(i,{modelAttribute:n.color,styleName:"border-color"}),hc(i,{modelAttribute:n.style,styleName:"border-style"}),hc(i,{modelAttribute:n.width,styleName:"border-width"})}function QV(e,t,i,o){e.extend("table",{allowAttributes:["tableAlignment"]}),e.setAttributeProperties("tableAlignment",{isFormatting:!0,blockAlignment:n=>({left:{value:"blockLeft"},right:{value:"blockRight"},center:{value:"center",isDefault:n.getAttribute("tableType")!=="layout"}})}),t.for("downcast").attributeToAttribute({model:{name:"table",key:"tableAlignment",values:["left","center","right","blockLeft","blockRight"]},view:{left:o?{key:"style",value:{float:"left","margin-right":"var(--ck-content-table-style-spacing, 1.5em)"}}:{key:"class",value:je.left.className},right:o?{key:"style",value:{float:"right","margin-left":"var(--ck-content-table-style-spacing, 1.5em)"}}:{key:"class",value:je.right.className},center:o?{key:"style",value:{"margin-left":"auto","margin-right":"auto"}}:{key:"class",value:je.center.className},blockLeft:o?{key:"style",value:{"margin-left":"0","margin-right":"auto"}}:{key:"class",value:je.blockLeft.className},blockRight:o?{key:"style",value:{"margin-left":"auto","margin-right":"0"}}:{key:"class",value:je.blockRight.className}},converterPriority:"high"}),XP.forEach(n=>{t.for("upcast").attributeToAttribute({view:n.view,model:{key:"tableAlignment",value:(s,r,a)=>{if(tL(s))return;let l=Mo(i,"",a),c=n.getAlign(s),u=n.getConsumables(s);if(r.consumable.consume(s,u),c!==l)return c}}})}),t.for("upcast").add(YV(i))}function YV(e){return t=>{t.on("element:div",(i,o,n)=>{if(!n.consumable.test(o.viewItem,{name:!0,attributes:"align"}))return;let s=Array.from(o.viewItem.getChildren()).filter(u=>u.is("$text")||u.is("$textProxy")?u.data.trim()!=="":!0);if(s.length!==1||!s[0].is("element","table"))return;let[r]=s;if(!n.consumable.test(r,{name:!0}))return;n.consumable.consume(o.viewItem,{name:!0,attributes:"align"});let a=n.convertItem(r,o.modelCursor),l=G(a.modelRange.getItems());if(!l||!l.is("element","table")){n.consumable.revert(o.viewItem,{name:!0,attributes:"align"}),a.modelRange&&!a.modelRange.isCollapsed&&(o.modelRange=a.modelRange,o.modelCursor=a.modelCursor);return}let c=XV(o.viewItem.getAttribute("align"),r.getAttribute("align"),Mo(e,"",o));c&&n.writer.setAttribute("tableAlignment",c,l),n.updateConversionResult(l,o)})}}function XV(e,t,i){if(e)switch(e){case"right":return t==="right"?"right":t==="left"?"left":"blockRight";case"center":return"center";case"left":return t===void 0?"blockLeft":"left";default:return i}}function eL(e,t,i){let{modelAttribute:o}=i;e.extend("table",{allowAttributes:[o]}),e.setAttributeProperties(o,{isFormatting:!0}),lf(t,{viewElement:"table",...i}),hc(t,i)}function O_(e,t,i){let{modelAttribute:o}=i;e.extend("table",{allowAttributes:[o]}),e.setAttributeProperties(o,{isFormatting:!0}),lf(t,{viewElement:/^(table|figure)$/,shouldUpcast:n=>!(n.name=="table"&&n.parent.name=="figure"||n.name=="figure"&&!n.hasClass("table")),...i}),$r(t,{modelElement:"table",...i})}function tL(e){return e.name=="figure"&&!e.hasClass("table")}/** +*/var ZV=class extends w{static get pluginName(){return"TablePropertiesEditing"}static get licenseFeatureCode(){return"TCP"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}static get requires(){return[Cc]}init(){let e=this.editor,t=e.model.schema,i=e.conversion;e.config.define("table.tableProperties.defaultProperties",{});let o=mf(e.config.get("table.tableProperties.defaultProperties"),{includeAlignmentProperty:!0}),n=e.config.get("table.tableProperties.alignment.useInlineStyles")===!0;e.data.addStyleProcessorRules(u1),e.data.addStyleProcessorRules(Pd),YV(e,{color:o.borderColor,style:o.borderStyle,width:o.borderWidth}),e.commands.add("tableBorderColor",new qV(e,o.borderColor)),e.commands.add("tableBorderStyle",new $V(e,o.borderStyle)),e.commands.add("tableBorderWidth",new jV(e,o.borderWidth)),XV(t,i,o.alignment,n),e.commands.add("tableAlignment",new JV(e,o.alignment)),D_(t,i,{modelAttribute:"tableWidth",styleName:"width",attributeName:"width",attributeType:"length",defaultValue:o.width}),e.commands.add("tableWidth",new KV(e,o.width)),D_(t,i,{modelAttribute:"tableHeight",styleName:"height",attributeName:"height",attributeType:"length",defaultValue:o.height}),e.commands.add("tableHeight",new GV(e,o.height)),e.data.addStyleProcessorRules(dl),iL(t,i,{modelAttribute:"tableBackgroundColor",styleName:"background-color",attributeName:"bgcolor",attributeType:"color",defaultValue:o.backgroundColor}),e.commands.add("tableBackgroundColor",new UV(e,o.backgroundColor)),tf(e,"table");let s=e.editing.view.document;this.listenTo(s,"clipboardOutput",(r,a)=>{e.editing.view.change(l=>{for(let{item:c}of l.createRangeIn(a.content))QV(c,l);a.dataTransfer.setData("text/html",this.editor.data.htmlProcessor.toData(a.content))})},{priority:"lowest"})}};function QV(e,t){if(!e.is("element","table"))return;let i=e.getAttribute("align"),o=e.getStyle("float"),n=e.getStyle("margin-left"),s=e.getStyle("margin-right");if(i&&i==="center"||o&&o==="right"&&i&&i==="right"){O_(t,i,e);return}o===void 0&&n==="auto"&&s==="0"&&O_(t,"right",e)}function O_(e,t,i){let o=e.createPositionBefore(i),n=e.createContainerElement("div",{align:t},i);e.insert(o,n)}function YV(e,t){let{conversion:i}=e,{schema:o}=e.model,n={width:"tableBorderWidth",color:"tableBorderColor",style:"tableBorderStyle"};o.extend("table",{allowAttributes:Object.values(n)});for(let s of Object.values(n))o.setAttributeProperties(s,{isFormatting:!0});ef(e,"table",n,t),mc(i,{modelAttribute:n.color,styleName:"border-color"}),mc(i,{modelAttribute:n.style,styleName:"border-style"}),mc(i,{modelAttribute:n.width,styleName:"border-width"})}function XV(e,t,i,o){e.extend("table",{allowAttributes:["tableAlignment"]}),e.setAttributeProperties("tableAlignment",{isFormatting:!0,blockAlignment:n=>({left:{value:"blockLeft"},right:{value:"blockRight"},center:{value:"center",isDefault:n.getAttribute("tableType")!=="layout"}})}),t.for("downcast").attributeToAttribute({model:{name:"table",key:"tableAlignment",values:["left","center","right","blockLeft","blockRight"]},view:{left:o?{key:"style",value:{float:"left","margin-right":"var(--ck-content-table-style-spacing, 1.5em)"}}:{key:"class",value:je.left.className},right:o?{key:"style",value:{float:"right","margin-left":"var(--ck-content-table-style-spacing, 1.5em)"}}:{key:"class",value:je.right.className},center:o?{key:"style",value:{"margin-left":"auto","margin-right":"auto"}}:{key:"class",value:je.center.className},blockLeft:o?{key:"style",value:{"margin-left":"0","margin-right":"auto"}}:{key:"class",value:je.blockLeft.className},blockRight:o?{key:"style",value:{"margin-left":"auto","margin-right":"0"}}:{key:"class",value:je.blockRight.className}},converterPriority:"high"}),tR.forEach(n=>{t.for("upcast").attributeToAttribute({view:n.view,model:{key:"tableAlignment",value:(s,r,a)=>{if(oL(s))return;let l=Mo(i,"",a),c=n.getAlign(s),u=n.getConsumables(s);if(r.consumable.consume(s,u),c!==l)return c}}})}),t.for("upcast").add(eL(i))}function eL(e){return t=>{t.on("element:div",(i,o,n)=>{if(!n.consumable.test(o.viewItem,{name:!0,attributes:"align"}))return;let s=Array.from(o.viewItem.getChildren()).filter(u=>u.is("$text")||u.is("$textProxy")?u.data.trim()!=="":!0);if(s.length!==1||!s[0].is("element","table"))return;let[r]=s;if(!n.consumable.test(r,{name:!0}))return;n.consumable.consume(o.viewItem,{name:!0,attributes:"align"});let a=n.convertItem(r,o.modelCursor),l=J(a.modelRange.getItems());if(!l||!l.is("element","table")){n.consumable.revert(o.viewItem,{name:!0,attributes:"align"}),a.modelRange&&!a.modelRange.isCollapsed&&(o.modelRange=a.modelRange,o.modelCursor=a.modelCursor);return}let c=tL(o.viewItem.getAttribute("align"),r.getAttribute("align"),Mo(e,"",o));c&&n.writer.setAttribute("tableAlignment",c,l),n.updateConversionResult(l,o)})}}function tL(e,t,i){if(e)switch(e){case"right":return t==="right"?"right":t==="left"?"left":"blockRight";case"center":return"center";case"left":return t===void 0?"blockLeft":"left";default:return i}}function iL(e,t,i){let{modelAttribute:o}=i;e.extend("table",{allowAttributes:[o]}),e.setAttributeProperties(o,{isFormatting:!0}),uf(t,{viewElement:"table",...i}),mc(t,i)}function D_(e,t,i){let{modelAttribute:o}=i;e.extend("table",{allowAttributes:[o]}),e.setAttributeProperties(o,{isFormatting:!0}),uf(t,{viewElement:/^(table|figure)$/,shouldUpcast:n=>!(n.name=="table"&&n.parent.name=="figure"||n.name=="figure"&&!n.hasClass("table")),...i}),$r(t,{modelElement:"table",...i})}function oL(e){return e.name=="figure"&&!e.hasClass("table")}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var iL=class extends R{options;focusTracker;keystrokes;children;borderStyleDropdown;borderWidthInput;borderColorInput;backgroundInput;widthInput;heightInput;alignmentToolbar;saveButtonView;cancelButtonView;backButtonView;_focusables;_focusCycler;constructor(e,t){super(e),this.set({borderStyle:"",borderWidth:"",borderColor:"",backgroundColor:"",width:"",height:"",alignment:""}),this.options=t;let{borderStyleDropdown:i,borderWidthInput:o,borderColorInput:n,borderRowLabel:s}=this._createBorderFields(),{backgroundRowLabel:r,backgroundInput:a}=this._createBackgroundFields(),{widthInput:l,operatorLabel:c,heightInput:u,dimensionsLabel:d}=this._createDimensionFields(),{alignmentToolbar:h,alignmentLabel:f}=this._createAlignmentFields();this.focusTracker=new Q,this.keystrokes=new X,this.children=this.createCollection(),this.borderStyleDropdown=i,this.borderWidthInput=o,this.borderColorInput=n,this.backgroundInput=a,this.widthInput=l,this.heightInput=u,this.alignmentToolbar=h;let{saveButtonView:m,cancelButtonView:g}=this._createActionButtons();this.saveButtonView=m,this.cancelButtonView=g,this.backButtonView=this._createBackButton(),this._focusables=new be,this._focusCycler=new Ie({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});let b=new Mt(e,{label:this.t("Table properties")});b.children.add(this.backButtonView,0),this.children.add(b),this.children.add(new fe(e,{labelView:s,children:[s,i,o,n],class:"ck-table-form__border-row"})),this.children.add(new fe(e,{children:[new fe(e,{labelView:d,children:[d,l,c,u],class:"ck-table-form__dimensions-row"}),new fe(e,{labelView:r,children:[r,a],class:"ck-table-form__background-row"})]})),this.children.add(new fe(e,{labelView:f,children:[f,h],class:"ck-table-properties-form__alignment-row"})),this.children.add(new fe(e,{children:[this.cancelButtonView,this.saveButtonView],class:["ck-table-form__action-row"]})),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-table-form","ck-table-properties-form"],tabindex:"-1"},children:this.children})}render(){super.render(),_i({view:this}),[this.borderColorInput,this.backgroundInput].forEach(e=>{this._focusCycler.chain(e.fieldView.focusCycler)}),[this.borderStyleDropdown,this.borderWidthInput,this.borderColorInput,this.widthInput,this.heightInput,this.backgroundInput,this.alignmentToolbar,this.cancelButtonView,this.saveButtonView,this.backButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createBorderFields(){let e=this.options.defaultTableProperties,t={style:e.borderStyle,width:e.borderWidth,color:e.borderColor},i=yc({colorConfig:this.options.borderColors,columns:this.options.colorGridColumns,defaultColorValue:t.color,colorPickerConfig:this.options.colorPickerConfig}),o=this.locale,n=this.t,s=n("Style"),r=new ut(o);r.text=n("Border");let a=pf(n),l=new ue(o,Bl);l.set({label:s,class:"ck-table-form__border-style"}),l.fieldView.buttonView.set({ariaLabel:s,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:s}),l.fieldView.buttonView.bind("label").to(this,"borderStyle",d=>a[d||"none"]),l.fieldView.on("execute",d=>{this.borderStyle=d.source._borderStyleValue}),l.bind("isEmpty").to(this,"borderStyle",d=>!d),Bt(l.fieldView,e5(this,t.style),{role:"menu",ariaLabel:s});let c=new ue(o,nt);c.set({label:n("Width"),class:"ck-table-form__border-width"}),c.fieldView.bind("value").to(this,"borderWidth"),c.bind("isEnabled").to(this,"borderStyle",dc),c.fieldView.on("input",()=>{this.borderWidth=c.fieldView.element.value});let u=new ue(o,i);return u.set({label:n("Color"),class:"ck-table-form__border-color"}),u.fieldView.bind("value").to(this,"borderColor"),u.bind("isEnabled").to(this,"borderStyle",dc),u.fieldView.on("input",()=>{this.borderColor=u.fieldView.value}),this.on("change:borderStyle",(d,h,f,m)=>{dc(f)||(this.borderColor="",this.borderWidth=""),dc(m)||(this.borderColor=t.color,this.borderWidth=t.width)}),{borderRowLabel:r,borderStyleDropdown:l,borderColorInput:u,borderWidthInput:c}}_createBackgroundFields(){let e=this.locale,t=this.t,i=new ut(e);i.text=t("Background");let o=yc({colorConfig:this.options.backgroundColors,columns:this.options.colorGridColumns,defaultColorValue:this.options.defaultTableProperties.backgroundColor,colorPickerConfig:this.options.colorPickerConfig}),n=new ue(e,o);return n.set({label:t("Color"),class:"ck-table-properties-form__background"}),n.fieldView.bind("value").to(this,"backgroundColor"),n.fieldView.on("input",()=>{this.backgroundColor=n.fieldView.value}),{backgroundRowLabel:i,backgroundInput:n}}_createDimensionFields(){let e=this.locale,t=this.t,i=new ut(e);i.text=t("Dimensions");let o=new ue(e,nt);o.set({label:t("Width"),class:"ck-table-form__dimensions-row__width"}),o.fieldView.bind("value").to(this,"width"),o.fieldView.on("input",()=>{this.width=o.fieldView.element.value});let n=new R(e);n.setTemplate({tag:"span",attributes:{class:["ck-table-form__dimension-operator"]},children:[{text:"\xD7"}]});let s=new ue(e,nt);return s.set({label:t("Height"),class:"ck-table-form__dimensions-row__height"}),s.fieldView.bind("value").to(this,"height"),s.fieldView.on("input",()=>{this.height=s.fieldView.element.value}),{dimensionsLabel:i,widthInput:o,operatorLabel:n,heightInput:s}}_createAlignmentFields(){let e=this.locale,t=this.t,i=new ut(e);i.text=t("Table Alignment");let o=new dt(e);return o.set({role:"radiogroup",isCompact:!0,ariaLabel:t("Table alignment toolbar")}),rf({view:this,icons:{left:ur,center:On,right:Dn,blockLeft:dr,blockRight:hr},toolbar:o,labels:this._alignmentLabels,propertyName:"alignment",defaultValue:this.options.defaultTableProperties.alignment}),{alignmentLabel:i,alignmentToolbar:o}}_createActionButtons(){let e=this.locale,t=this.t,i=new I(e),o=new I(e),n=[this.borderWidthInput,this.borderColorInput,this.backgroundInput,this.widthInput,this.heightInput];return i.set({label:t("Save"),class:"ck-button-action ck-button_standard",type:"submit",withText:!0}),i.bind("isEnabled").toMany(n,"errorText",(...s)=>s.every(r=>!r)),o.set({label:t("Cancel"),withText:!0,class:"ck-button_standard"}),o.delegate("execute").to(this,"cancel"),{saveButtonView:i,cancelButtonView:o}}_createBackButton(){let e=this.locale.t,t=new I(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:yt,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}get _alignmentLabels(){let e=this.locale,t=this.t,i=t("Align table to the left with no text wrapping"),o=t("Align table to the right with no text wrapping"),n=t("Align table to the left with text wrapping"),s=t("Center table with no text wrapping"),r=t("Align table to the right with text wrapping");return e.uiLanguageDirection==="rtl"?{right:r,left:n,blockRight:o,center:s,blockLeft:i}:{blockLeft:i,center:s,blockRight:o,left:n,right:r}}};function dc(e){return e!=="none"}/** +*/var nL=class extends R{options;focusTracker;keystrokes;children;borderStyleDropdown;borderWidthInput;borderColorInput;backgroundInput;widthInput;heightInput;alignmentToolbar;saveButtonView;cancelButtonView;backButtonView;_focusables;_focusCycler;constructor(e,t){super(e),this.set({borderStyle:"",borderWidth:"",borderColor:"",backgroundColor:"",width:"",height:"",alignment:""}),this.options=t;let{borderStyleDropdown:i,borderWidthInput:o,borderColorInput:n,borderRowLabel:s}=this._createBorderFields(),{backgroundRowLabel:r,backgroundInput:a}=this._createBackgroundFields(),{widthInput:l,operatorLabel:c,heightInput:u,dimensionsLabel:d}=this._createDimensionFields(),{alignmentToolbar:h,alignmentLabel:f}=this._createAlignmentFields();this.focusTracker=new Q,this.keystrokes=new X,this.children=this.createCollection(),this.borderStyleDropdown=i,this.borderWidthInput=o,this.borderColorInput=n,this.backgroundInput=a,this.widthInput=l,this.heightInput=u,this.alignmentToolbar=h;let{saveButtonView:m,cancelButtonView:g}=this._createActionButtons();this.saveButtonView=m,this.cancelButtonView=g,this.backButtonView=this._createBackButton(),this._focusables=new we,this._focusCycler=new Pe({focusables:this._focusables,focusTracker:this.focusTracker,keystrokeHandler:this.keystrokes,actions:{focusPrevious:"shift + tab",focusNext:"tab"}});let b=new Bt(e,{label:this.t("Table properties")});b.children.add(this.backButtonView,0),this.children.add(b),this.children.add(new fe(e,{labelView:s,children:[s,i,o,n],class:"ck-table-form__border-row"})),this.children.add(new fe(e,{children:[new fe(e,{labelView:d,children:[d,l,c,u],class:"ck-table-form__dimensions-row"}),new fe(e,{labelView:r,children:[r,a],class:"ck-table-form__background-row"})]})),this.children.add(new fe(e,{labelView:f,children:[f,h],class:"ck-table-properties-form__alignment-row"})),this.children.add(new fe(e,{children:[this.cancelButtonView,this.saveButtonView],class:["ck-table-form__action-row"]})),this.setTemplate({tag:"form",attributes:{class:["ck","ck-form","ck-table-form","ck-table-properties-form"],tabindex:"-1"},children:this.children})}render(){super.render(),ki({view:this}),[this.borderColorInput,this.backgroundInput].forEach(e=>{this._focusCycler.chain(e.fieldView.focusCycler)}),[this.borderStyleDropdown,this.borderWidthInput,this.borderColorInput,this.widthInput,this.heightInput,this.backgroundInput,this.alignmentToolbar,this.cancelButtonView,this.saveButtonView,this.backButtonView].forEach(e=>{this._focusables.add(e),this.focusTracker.add(e.element)}),this.keystrokes.listenTo(this.element)}destroy(){super.destroy(),this.focusTracker.destroy(),this.keystrokes.destroy()}focus(){this._focusCycler.focusFirst()}_createBorderFields(){let e=this.options.defaultTableProperties,t={style:e.borderStyle,width:e.borderWidth,color:e.borderColor},i=vc({colorConfig:this.options.borderColors,columns:this.options.colorGridColumns,defaultColorValue:t.color,colorPickerConfig:this.options.colorPickerConfig}),o=this.locale,n=this.t,s=n("Style"),r=new ut(o);r.text=n("Border");let a=wf(n),l=new ue(o,Ol);l.set({label:s,class:"ck-table-form__border-style"}),l.fieldView.buttonView.set({ariaLabel:s,ariaLabelledBy:void 0,isOn:!1,withText:!0,tooltip:s}),l.fieldView.buttonView.bind("label").to(this,"borderStyle",d=>a[d||"none"]),l.fieldView.on("execute",d=>{this.borderStyle=d.source._borderStyleValue}),l.bind("isEmpty").to(this,"borderStyle",d=>!d),ht(l.fieldView,t5(this,t.style),{role:"menu",ariaLabel:s});let c=new ue(o,nt);c.set({label:n("Width"),class:"ck-table-form__border-width"}),c.fieldView.bind("value").to(this,"borderWidth"),c.bind("isEnabled").to(this,"borderStyle",fc),c.fieldView.on("input",()=>{this.borderWidth=c.fieldView.element.value});let u=new ue(o,i);return u.set({label:n("Color"),class:"ck-table-form__border-color"}),u.fieldView.bind("value").to(this,"borderColor"),u.bind("isEnabled").to(this,"borderStyle",fc),u.fieldView.on("input",()=>{this.borderColor=u.fieldView.value}),this.on("change:borderStyle",(d,h,f,m)=>{fc(f)||(this.borderColor="",this.borderWidth=""),fc(m)||(this.borderColor=t.color,this.borderWidth=t.width)}),{borderRowLabel:r,borderStyleDropdown:l,borderColorInput:u,borderWidthInput:c}}_createBackgroundFields(){let e=this.locale,t=this.t,i=new ut(e);i.text=t("Background");let o=vc({colorConfig:this.options.backgroundColors,columns:this.options.colorGridColumns,defaultColorValue:this.options.defaultTableProperties.backgroundColor,colorPickerConfig:this.options.colorPickerConfig}),n=new ue(e,o);return n.set({label:t("Color"),class:"ck-table-properties-form__background"}),n.fieldView.bind("value").to(this,"backgroundColor"),n.fieldView.on("input",()=>{this.backgroundColor=n.fieldView.value}),{backgroundRowLabel:i,backgroundInput:n}}_createDimensionFields(){let e=this.locale,t=this.t,i=new ut(e);i.text=t("Dimensions");let o=new ue(e,nt);o.set({label:t("Width"),class:"ck-table-form__dimensions-row__width"}),o.fieldView.bind("value").to(this,"width"),o.fieldView.on("input",()=>{this.width=o.fieldView.element.value});let n=new R(e);n.setTemplate({tag:"span",attributes:{class:["ck-table-form__dimension-operator"]},children:[{text:"\xD7"}]});let s=new ue(e,nt);return s.set({label:t("Height"),class:"ck-table-form__dimensions-row__height"}),s.fieldView.bind("value").to(this,"height"),s.fieldView.on("input",()=>{this.height=s.fieldView.element.value}),{dimensionsLabel:i,widthInput:o,operatorLabel:n,heightInput:s}}_createAlignmentFields(){let e=this.locale,t=this.t,i=new ut(e);i.text=t("Table Alignment");let o=new dt(e);return o.set({role:"radiogroup",isCompact:!0,ariaLabel:t("Table alignment toolbar")}),lf({view:this,icons:{left:ur,center:On,right:Dn,blockLeft:dr,blockRight:hr},toolbar:o,labels:this._alignmentLabels,propertyName:"alignment",defaultValue:this.options.defaultTableProperties.alignment}),{alignmentLabel:i,alignmentToolbar:o}}_createActionButtons(){let e=this.locale,t=this.t,i=new I(e),o=new I(e),n=[this.borderWidthInput,this.borderColorInput,this.backgroundInput,this.widthInput,this.heightInput];return i.set({label:t("Save"),class:"ck-button-action ck-button_standard",type:"submit",withText:!0}),i.bind("isEnabled").toMany(n,"errorText",(...s)=>s.every(r=>!r)),o.set({label:t("Cancel"),withText:!0,class:"ck-button_standard"}),o.delegate("execute").to(this,"cancel"),{saveButtonView:i,cancelButtonView:o}}_createBackButton(){let e=this.locale.t,t=new I(this.locale);return t.set({class:"ck-button-back",label:e("Back"),icon:_t,tooltip:!0}),t.delegate("execute").to(this,"cancel"),t}get _alignmentLabels(){let e=this.locale,t=this.t,i=t("Align table to the left with no text wrapping"),o=t("Align table to the right with no text wrapping"),n=t("Align table to the left with text wrapping"),s=t("Center table with no text wrapping"),r=t("Align table to the right with text wrapping");return e.uiLanguageDirection==="rtl"?{right:r,left:n,blockRight:o,center:s,blockLeft:i}:{blockLeft:i,center:s,blockRight:o,left:n,right:r}}};function fc(e){return e!=="none"}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var oL=500,D_={borderStyle:"tableBorderStyle",borderColor:"tableBorderColor",borderWidth:"tableBorderWidth",backgroundColor:"tableBackgroundColor",width:"tableWidth",height:"tableHeight",alignment:"tableAlignment"},nL=class extends y{_defaultContentTableProperties;_defaultLayoutTableProperties;_balloon;view=null;_viewWithContentTableDefaults=null;_viewWithLayoutTableDefaults=null;_undoStepBatch;_isReady;static get requires(){return[re]}static get pluginName(){return"TablePropertiesUI"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("table.tableProperties",{borderColors:wc,backgroundColors:wc,colorGridColumns:Ll})}init(){let e=this.editor;this._defaultContentTableProperties=hf(e.config.get("table.tableProperties.defaultProperties"),{includeAlignmentProperty:!0}),this._defaultLayoutTableProperties=_c(),this._balloon=e.plugins.get(re),e.ui.componentFactory.add("tableProperties",()=>this._createTablePropertiesButton())}_createTablePropertiesButton(){let e=this.editor,t=e.t,i=new I(e.locale);i.set({label:t("Table properties"),icon:hb,tooltip:!0}),this.listenTo(i,"execute",()=>this._showView());let o=Object.values(D_).map(n=>e.commands.get(n));return i.bind("isEnabled").toMany(o,"isEnabled",(...n)=>n.some(s=>s)),i}destroy(){super.destroy(),this.view&&this.view.destroy()}_createPropertiesView(e){let t=this.editor,i=t.config.get("table.tableProperties"),o=wr(i.borderColors),n=br(t.locale,o),s=wr(i.backgroundColors),r=br(t.locale,s),a=i.colorPicker!==!1,l=new iL(t.locale,{borderColors:n,backgroundColors:r,defaultTableProperties:e,colorGridColumns:i.colorGridColumns,colorPickerConfig:a?i.colorPicker||{}:!1}),c=t.t;l.render(),this.listenTo(l,"submit",()=>{this._hideView()}),this.listenTo(l,"cancel",()=>{this._undoStepBatch.operations.length&&t.execute("undo",this._undoStepBatch),this._hideView()}),l.keystrokes.set("Esc",(h,f)=>{this._hideView(),f()}),vt({emitter:l,activator:()=>this._isViewInBalloon,contextElements:[this._balloon.view.element],callback:()=>this._hideView()});let u=Q_(c),d=Y_(c);return l.on("change:borderStyle",this._getPropertyChangeCallback("tableBorderStyle")),l.on("change:borderColor",this._getValidatedPropertyChangeCallback({viewField:l.borderColorInput,commandName:"tableBorderColor",errorText:u,validator:bc})),l.on("change:borderWidth",this._getValidatedPropertyChangeCallback({viewField:l.borderWidthInput,commandName:"tableBorderWidth",errorText:d,validator:X_})),l.on("change:backgroundColor",this._getValidatedPropertyChangeCallback({viewField:l.backgroundInput,commandName:"tableBackgroundColor",errorText:u,validator:bc})),l.on("change:width",this._getValidatedPropertyChangeCallback({viewField:l.widthInput,commandName:"tableWidth",errorText:d,validator:jr})),l.on("change:height",this._getValidatedPropertyChangeCallback({viewField:l.heightInput,commandName:"tableHeight",errorText:d,validator:jr})),l.on("change:alignment",this._getPropertyChangeCallback("tableAlignment")),l}_fillViewFormFromCommandValues(){let e=this.editor.commands,t=e.get("tableBorderStyle");Object.entries(D_).map(([i,o])=>{let n=i,s=this.view===this._viewWithContentTableDefaults?this._defaultContentTableProperties[n]||"":this._defaultLayoutTableProperties[n]||"";return[n,e.get(o).value||s]}).forEach(([i,o])=>{(i==="borderColor"||i==="borderWidth")&&t.value==="none"||this.view.set(i,o)}),this._isReady=!0}_showView(){let e=this.editor,t=pc(e.editing.view.document.selection),i=t&&e.editing.mapper.toModelElement(t),o=!i||i.getAttribute("tableType")!=="layout";o&&!this._viewWithContentTableDefaults?this._viewWithContentTableDefaults=this._createPropertiesView(this._defaultContentTableProperties):!o&&!this._viewWithLayoutTableDefaults&&(this._viewWithLayoutTableDefaults=this._createPropertiesView(this._defaultLayoutTableProperties)),this.view=o?this._viewWithContentTableDefaults:this._viewWithLayoutTableDefaults,this.listenTo(e.ui,"update",()=>{this._updateView()}),this._fillViewFormFromCommandValues(),this._balloon.add({view:this.view,position:o5(e)}),this._undoStepBatch=e.model.createBatch(),this.view.focus()}_hideView(){let e=this.editor;this.stopListening(e.ui,"update"),this._isReady=!1,this.view.saveButtonView.focus(),this._balloon.remove(this.view),this.editor.editing.view.focus()}_updateView(){let e=this.editor,t=e.editing.view.document;pc(t.selection)?this._isViewVisible&&i5(e,"table"):this._hideView()}get _isViewVisible(){return!!this.view&&this._balloon.visibleView===this.view}get _isViewInBalloon(){return!!this.view&&this._balloon.hasView(this.view)}_getPropertyChangeCallback(e){return(t,i,o)=>{this._isReady&&this.editor.execute(e,{value:o,batch:this._undoStepBatch})}}_getValidatedPropertyChangeCallback(e){let{commandName:t,viewField:i,validator:o,errorText:n}=e,s=ye(()=>{i.errorText=n},oL);return(r,a,l)=>{s.cancel(),this._isReady&&(o(l)?(this.editor.execute(t,{value:l,batch:this._undoStepBatch}),i.errorText=null):s())}}};/** +*/var sL=500,F_={borderStyle:"tableBorderStyle",borderColor:"tableBorderColor",borderWidth:"tableBorderWidth",backgroundColor:"tableBackgroundColor",width:"tableWidth",height:"tableHeight",alignment:"tableAlignment"},rL=class extends w{_defaultContentTableProperties;_defaultLayoutTableProperties;_balloon;view=null;_viewWithContentTableDefaults=null;_viewWithLayoutTableDefaults=null;_undoStepBatch;_isReady;static get requires(){return[re]}static get pluginName(){return"TablePropertiesUI"}static get isOfficialPlugin(){return!0}constructor(e){super(e),e.config.define("table.tableProperties",{borderColors:_c,backgroundColors:_c,colorGridColumns:Ml})}init(){let e=this.editor;this._defaultContentTableProperties=mf(e.config.get("table.tableProperties.defaultProperties"),{includeAlignmentProperty:!0}),this._defaultLayoutTableProperties=kc(),this._balloon=e.plugins.get(re),e.ui.componentFactory.add("tableProperties",()=>this._createTablePropertiesButton())}_createTablePropertiesButton(){let e=this.editor,t=e.t,i=new I(e.locale);i.set({label:t("Table properties"),icon:mb,tooltip:!0}),this.listenTo(i,"execute",()=>this._showView());let o=Object.values(F_).map(n=>e.commands.get(n));return i.bind("isEnabled").toMany(o,"isEnabled",(...n)=>n.some(s=>s)),i}destroy(){super.destroy(),this.view&&this.view.destroy()}_createPropertiesView(e){let t=this.editor,i=t.config.get("table.tableProperties"),o=wr(i.borderColors),n=br(t.locale,o),s=wr(i.backgroundColors),r=br(t.locale,s),a=i.colorPicker!==!1,l=new nL(t.locale,{borderColors:n,backgroundColors:r,defaultTableProperties:e,colorGridColumns:i.colorGridColumns,colorPickerConfig:a?i.colorPicker||{}:!1}),c=t.t;l.render(),this.listenTo(l,"submit",()=>{this._hideView()}),this.listenTo(l,"cancel",()=>{this._undoStepBatch.operations.length&&t.execute("undo",this._undoStepBatch),this._hideView()}),l.keystrokes.set("Esc",(h,f)=>{this._hideView(),f()}),kt({emitter:l,activator:()=>this._isViewInBalloon,contextElements:[this._balloon.view.element],callback:()=>this._hideView()});let u=Y_(c),d=X_(c);return l.on("change:borderStyle",this._getPropertyChangeCallback("tableBorderStyle")),l.on("change:borderColor",this._getValidatedPropertyChangeCallback({viewField:l.borderColorInput,commandName:"tableBorderColor",errorText:u,validator:yc})),l.on("change:borderWidth",this._getValidatedPropertyChangeCallback({viewField:l.borderWidthInput,commandName:"tableBorderWidth",errorText:d,validator:e5})),l.on("change:backgroundColor",this._getValidatedPropertyChangeCallback({viewField:l.backgroundInput,commandName:"tableBackgroundColor",errorText:u,validator:yc})),l.on("change:width",this._getValidatedPropertyChangeCallback({viewField:l.widthInput,commandName:"tableWidth",errorText:d,validator:jr})),l.on("change:height",this._getValidatedPropertyChangeCallback({viewField:l.heightInput,commandName:"tableHeight",errorText:d,validator:jr})),l.on("change:alignment",this._getPropertyChangeCallback("tableAlignment")),l}_fillViewFormFromCommandValues(){let e=this.editor.commands,t=e.get("tableBorderStyle");Object.entries(F_).map(([i,o])=>{let n=i,s=this.view===this._viewWithContentTableDefaults?this._defaultContentTableProperties[n]||"":this._defaultLayoutTableProperties[n]||"";return[n,e.get(o).value||s]}).forEach(([i,o])=>{(i==="borderColor"||i==="borderWidth")&&t.value==="none"||this.view.set(i,o)}),this._isReady=!0}_showView(){let e=this.editor,t=wc(e.editing.view.document.selection),i=t&&e.editing.mapper.toModelElement(t),o=!i||i.getAttribute("tableType")!=="layout";o&&!this._viewWithContentTableDefaults?this._viewWithContentTableDefaults=this._createPropertiesView(this._defaultContentTableProperties):!o&&!this._viewWithLayoutTableDefaults&&(this._viewWithLayoutTableDefaults=this._createPropertiesView(this._defaultLayoutTableProperties)),this.view=o?this._viewWithContentTableDefaults:this._viewWithLayoutTableDefaults,this.listenTo(e.ui,"update",()=>{this._updateView()}),this._fillViewFormFromCommandValues(),this._balloon.add({view:this.view,position:n5(e)}),this._undoStepBatch=e.model.createBatch(),this.view.focus()}_hideView(){let e=this.editor;this.stopListening(e.ui,"update"),this._isReady=!1,this.view.saveButtonView.focus(),this._balloon.remove(this.view),this.editor.editing.view.focus()}_updateView(){let e=this.editor,t=e.editing.view.document;wc(t.selection)?this._isViewVisible&&o5(e,"table"):this._hideView()}get _isViewVisible(){return!!this.view&&this._balloon.visibleView===this.view}get _isViewInBalloon(){return!!this.view&&this._balloon.hasView(this.view)}_getPropertyChangeCallback(e){return(t,i,o)=>{this._isReady&&this.editor.execute(e,{value:o,batch:this._undoStepBatch})}}_getValidatedPropertyChangeCallback(e){let{commandName:t,viewField:i,validator:o,errorText:n}=e,s=ve(()=>{i.errorText=n},sL);return(r,a,l)=>{s.cancel(),this._isReady&&(o(l)?(this.editor.execute(t,{value:l,batch:this._undoStepBatch}),i.errorText=null):s())}}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var c5=class extends y{static get pluginName(){return"TableProperties"}static get isOfficialPlugin(){return!0}static get requires(){return[GV,nL]}};/** +*/var u5=class extends w{static get pluginName(){return"TableProperties"}static get isOfficialPlugin(){return!0}static get requires(){return[ZV,rL]}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -2296,98 +2296,99 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function sL(e,t){let i=[];for(let o of t.createRangeIn(e)){let n=o.item;n.is("element","a")&&!n.hasAttribute("href")&&(n.hasAttribute("id")||n.hasAttribute("name"))&&i.push(n)}for(let o of i){let n=o.parent.getChildIndex(o)+1,s=o.getChildren();t.insertChild(n,s,o.parent),rL(o)&&t.remove(o)}}function rL(e){let t=e.getAttribute("name");return!!t&&t.startsWith("_")}/** +*/function aL(e,t){let i=[];for(let o of t.createRangeIn(e)){let n=o.item;n.is("element","a")&&!n.hasAttribute("href")&&(n.hasAttribute("id")||n.hasAttribute("name"))&&i.push(n)}for(let o of i){let n=o.parent.getChildIndex(o)+1,s=o.getChildren();t.insertChild(n,s,o.parent),lL(o)&&t.remove(o)}}function lL(e){let t=e.getAttribute("name");return!!t&&t.startsWith("_")}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function f5(e){let t=parseFloat(e);return e.endsWith("pt")?ms(t*96/72):e.endsWith("pc")?ms(t*12*96/72):e.endsWith("in")?ms(t*96):e.endsWith("cm")?ms(t*96/2.54):e.endsWith("mm")?ms(t/10*96/2.54):e}function ms(e){return Math.round(e)+"px"}/** +*/function m5(e){let t=parseFloat(e);return e.endsWith("pt")?ms(t*96/72):e.endsWith("pc")?ms(t*12*96/72):e.endsWith("in")?ms(t*96):e.endsWith("cm")?ms(t*96/2.54):e.endsWith("mm")?ms(t/10*96/2.54):e}function ms(e){return Math.round(e)+"px"}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function aL(e,t,i,o=!1){if(!e.childCount)return;let n=new Vt(e.document),s=uL(e,n);if(!s.length)return;let r=[],a=[],l=Cc();for(let c of s)if(c.indent!==void 0){dL(c)||(xc(n,a,l),l=Cc(),r.length=1,a.length=0);let u=`${c.id}:${c.indent}`,d=o?c.indent-1:Math.min(c.indent-1,a.length);d0&&(xc(n,a,l),l=Cc()),r.length=d,a.length=d),da.length-1||a[d].listElement.name!=h.type){h.type=="ol"&&c.id!==void 0&&r[d]&&r[d][u]&&(h.startIndex=r[d][u]);let m=bL(h,n,i);if(a.length==0){let g=c.element.parent,b=g.getChildIndex(c.element)+1;n.insertChild(b,m,g)}else if(d==0){let g=a[0].listElement,b=g.parent,k=b.getChildIndex(g)+1;n.insertChild(k,m,b)}else{let g=a[d-1].listItemElements;n.appendChild(m,g[g.length-1])}a[d]={...c,listElement:m,listItemElements:[]},c.id!==void 0&&(r[d]||(r[d]={}),r[d][u]=h.startIndex||1)}else if(a[d].isIntermediate){m5(a[d].listElement,h,n,i),a[d]={...c,listElement:a[d].listElement,listItemElements:a[d].listItemElements};/* v8 ignore else -- @preserve */if(c.id!==void 0){/* v8 ignore else -- @preserve */r[d]||(r[d]={}),r[d][u]=h.startIndex||1}}let f=c.element.name=="li"?c.element:n.createElement("li");lL(n,a,l,c,f,d),n.appendChild(f,a[d].listElement),a[d].listItemElements.push(f),c.id!==void 0&&r[d]&&r[d][u]++,c.element!=f&&n.appendChild(c.element,f),yL(c.element,n),n.removeStyle("text-indent",c.element),n.removeStyle("margin-left",c.element)}else{let u=a.find(d=>d.marginLeft==c.marginLeft);if(u){let d=u.listItemElements;n.appendChild(c.element,d[d.length-1]),n.removeStyle("margin-left",c.element),a.length=a.indexOf(u)+1,r.length=a.length+1}else xc(n,a,l),l=Cc(),a.length=0}xc(n,a,l)}function lL(e,t,i,o,n,s){if(o.marginLeft===void 0){s==0&&(i.canApplyMarginOnList=!1);return}let r=parseFloat(o.marginLeft),a=0;for(let u=0;u0){e.setStyle("margin-left",i.marginLeft,t[0].listElement);for(let o of i.topLevelListItemElements)e.removeStyle("margin-left",o)}}function cL(e,t){for(let i of t.createRangeIn(e)){let o=i.item;if(o.is("element","li")){let n=o.getChild(0);n&&n.is("element","p")&&t.unwrapElement(n)}}}function uL(e,t){let i=t.createRangeIn(e),o=[],n=new Set;for(let s of i.getItems()){if(!s.is("element")||!s.name.match(/^(p|h\d+|li|div)$/))continue;let r=_L(s);if(r!==void 0&&parseFloat(r)==0&&!Array.from(s.getClassNames()).find(a=>a.startsWith("MsoList"))&&(r=void 0),s.hasStyle("mso-list")&&s.getStyle("mso-list")!=="none"||r!==void 0&&n.has(r)){let a=wL(s);o.push({element:s,id:a.id,order:a.order,indent:a.indent,marginLeft:r}),r!==void 0&&n.add(r)}else n.clear()}return o}function dL(e){let t=e.element.previousSibling;for(;t&&hL(t);)t=t.previousSibling;if(!t){let i=e.element.parent;return bf(i)&&(!i.previousSibling||bf(i.previousSibling))}return bf(t)}function hL(e){return e.is("element")&&e.childCount===0&&/^(?:span|a|o:p)$/.test(e.name)}function bf(e){return e.is("element","ol")||e.is("element","ul")}function fL(e,t){let i=new RegExp(`@list l${e.id}:level${e.indent}\\s*({[^}]*)`,"gi"),o=/mso-level-number-format:([^;]{0,100});/gi,n=/mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi,s=new RegExp(`@list\\s+l${e.id}:level\\d\\s*{[^{]*mso-level-text:"%\\d\\\\.`,"gi"),r=new RegExp(`@list l${e.id}:level\\d\\s*{[^{]*mso-level-number-format:`,"gi"),a=s.exec(t),l=r.exec(t),c=a&&!l,u=i.exec(t),d="decimal",h="ol",f=null;if(u&&u[1]){let m=o.exec(u[1]);if(m&&m[1]&&(d=m[1].trim(),h=d!=="bullet"&&d!=="image"?"ol":"ul"),d==="bullet"){let g=mL(e.element);g&&(d=g)}else{let g=n.exec(u[1]);g&&g[1]&&(f=parseInt(g[1]))}c&&(h="ol")}return{type:h,startIndex:f,style:pL(d),isLegalStyleList:c}}function mL(e){if(e.name=="li"&&e.parent.name=="ul"&&e.parent.hasAttribute("type"))return e.parent.getAttribute("type");let t=gL(e);if(!t)return null;let i=t._data;return i==="o"?"circle":i==="\xB7"?"disc":i==="\xA7"?"square":null}function gL(e){if(e.getChild(0).is("$text"))return null;for(let t of e.getChildren()){if(!t.is("element","span"))continue;let i=t.getChild(0);if(i)return i.is("$text")?i:i.getChild(0)}/* v8 ignore next -- @preserve */return null}function pL(e){if(e.startsWith("arabic-leading-zero"))return"decimal-leading-zero";switch(e){case"alpha-upper":return"upper-alpha";case"alpha-lower":return"lower-alpha";case"roman-upper":return"upper-roman";case"roman-lower":return"lower-roman";case"circle":case"disc":case"square":return e;default:return null}}function bL(e,t,i){let o=t.createElement(e.type);return m5(o,e,t,i),o}function m5(e,t,i,o){t.style&&i.setStyle("list-style-type",t.style,e),t.startIndex&&t.startIndex>1&&i.setAttribute("start",t.startIndex,e),t.isLegalStyleList&&o&&i.addClass("legal-list",e)}function wL(e){let t=e.getStyle("mso-list");if(t===void 0)return{};let i=t.match(/(^|\s{1,100})l(\d+)/i),o=t.match(/\s{0,100}lfo(\d+)/i),n=t.match(/\s{0,100}level(\d+)/i);return i&&o&&n?{id:i[2],order:o[1],indent:parseInt(n[1])}:{indent:1}}function yL(e,t){let i=new We({name:"span",styles:{"mso-list":"Ignore"}}),o=t.createRangeIn(e);for(let n of o)n.type==="elementStart"&&i.match(n.item)&&t.remove(n.item)}function _L(e){let t=e.getStyle("margin-left");return t===void 0||t.endsWith("px")?t:f5(t)}/** +*/function cL(e,t,i,o=!1){if(!e.childCount)return;let n=new Lt(e.document),s=hL(e,n);if(!s.length)return;let r=[],a=[],l=Tc();for(let c of s)if(c.indent!==void 0){fL(c)||(Ec(n,a,l),l=Tc(),r.length=1,a.length=0);let u=`${c.id}:${c.indent}`,d=o?c.indent-1:Math.min(c.indent-1,a.length);d0&&(Ec(n,a,l),l=Tc()),r.length=d,a.length=d),da.length-1||a[d].listElement.name!=h.type){h.type=="ol"&&c.id!==void 0&&r[d]&&r[d][u]&&(h.startIndex=r[d][u]);let m=yL(h,n,i);if(a.length==0){let g=c.element.parent,b=g.getChildIndex(c.element)+1;n.insertChild(b,m,g)}else if(d==0){let g=a[0].listElement,b=g.parent,k=b.getChildIndex(g)+1;n.insertChild(k,m,b)}else{let g=a[d-1].listItemElements;n.appendChild(m,g[g.length-1])}a[d]={...c,listElement:m,listItemElements:[]},c.id!==void 0&&(r[d]||(r[d]={}),r[d][u]=h.startIndex||1)}else if(a[d].isIntermediate){g5(a[d].listElement,h,n,i),a[d]={...c,listElement:a[d].listElement,listItemElements:a[d].listItemElements};/* v8 ignore else -- @preserve */if(c.id!==void 0){/* v8 ignore else -- @preserve */r[d]||(r[d]={}),r[d][u]=h.startIndex||1}}let f=c.element.name=="li"?c.element:n.createElement("li");uL(n,a,l,c,f,d),n.appendChild(f,a[d].listElement),a[d].listItemElements.push(f),c.id!==void 0&&r[d]&&r[d][u]++,c.element!=f&&n.appendChild(c.element,f),vL(c.element,n),n.removeStyle("text-indent",c.element),n.removeStyle("margin-left",c.element)}else{let u=a.find(d=>d.marginLeft==c.marginLeft);if(u){let d=u.listItemElements;n.appendChild(c.element,d[d.length-1]),n.removeStyle("margin-left",c.element),a.length=a.indexOf(u)+1,r.length=a.length+1}else Ec(n,a,l),l=Tc(),a.length=0}Ec(n,a,l)}function uL(e,t,i,o,n,s){if(o.marginLeft===void 0){s==0&&(i.canApplyMarginOnList=!1);return}let r=parseFloat(o.marginLeft),a=0;for(let u=0;u0){e.setStyle("margin-left",i.marginLeft,t[0].listElement);for(let o of i.topLevelListItemElements)e.removeStyle("margin-left",o)}}function dL(e,t){for(let i of t.createRangeIn(e)){let o=i.item;if(o.is("element","li")){let n=o.getChild(0);n&&n.is("element","p")&&t.unwrapElement(n)}}}function hL(e,t){let i=t.createRangeIn(e),o=[],n=new Set;for(let s of i.getItems()){if(!s.is("element")||!s.name.match(/^(p|h\d+|li|div)$/))continue;let r=kL(s);if(r!==void 0&&parseFloat(r)==0&&!Array.from(s.getClassNames()).find(a=>a.startsWith("MsoList"))&&(r=void 0),s.hasStyle("mso-list")&&s.getStyle("mso-list")!=="none"||r!==void 0&&n.has(r)){let a=_L(s);o.push({element:s,id:a.id,order:a.order,indent:a.indent,marginLeft:r}),r!==void 0&&n.add(r)}else n.clear()}return o}function fL(e){let t=e.element.previousSibling;for(;t&&mL(t);)t=t.previousSibling;if(!t){let i=e.element.parent;return yf(i)&&(!i.previousSibling||yf(i.previousSibling))}return yf(t)}function mL(e){return e.is("element")&&e.childCount===0&&/^(?:span|a|o:p)$/.test(e.name)}function yf(e){return e.is("element","ol")||e.is("element","ul")}function gL(e,t){let i=new RegExp(`@list l${e.id}:level${e.indent}\\s*({[^}]*)`,"gi"),o=/mso-level-number-format:([^;]{0,100});/gi,n=/mso-level-start-at:\s{0,100}([0-9]{0,10})\s{0,100};/gi,s=new RegExp(`@list\\s+l${e.id}:level\\d\\s*{[^{]*mso-level-text:"%\\d\\\\.`,"gi"),r=new RegExp(`@list l${e.id}:level\\d\\s*{[^{]*mso-level-number-format:`,"gi"),a=s.exec(t),l=r.exec(t),c=a&&!l,u=i.exec(t),d="decimal",h="ol",f=null;if(u&&u[1]){let m=o.exec(u[1]);if(m&&m[1]&&(d=m[1].trim(),h=d!=="bullet"&&d!=="image"?"ol":"ul"),d==="bullet"){let g=pL(e.element);g&&(d=g)}else{let g=n.exec(u[1]);g&&g[1]&&(f=parseInt(g[1]))}c&&(h="ol")}return{type:h,startIndex:f,style:wL(d),isLegalStyleList:c}}function pL(e){if(e.name=="li"&&e.parent.name=="ul"&&e.parent.hasAttribute("type"))return e.parent.getAttribute("type");let t=bL(e);if(!t)return null;let i=t._data;return i==="o"?"circle":i==="\xB7"?"disc":i==="\xA7"?"square":null}function bL(e){if(e.getChild(0).is("$text"))return null;for(let t of e.getChildren()){if(!t.is("element","span"))continue;let i=t.getChild(0);if(i)return i.is("$text")?i:i.getChild(0)}/* v8 ignore next -- @preserve */return null}function wL(e){if(e.startsWith("arabic-leading-zero"))return"decimal-leading-zero";switch(e){case"alpha-upper":return"upper-alpha";case"alpha-lower":return"lower-alpha";case"roman-upper":return"upper-roman";case"roman-lower":return"lower-roman";case"circle":case"disc":case"square":return e;default:return null}}function yL(e,t,i){let o=t.createElement(e.type);return g5(o,e,t,i),o}function g5(e,t,i,o){t.style&&i.setStyle("list-style-type",t.style,e),t.startIndex&&t.startIndex>1&&i.setAttribute("start",t.startIndex,e),t.isLegalStyleList&&o&&i.addClass("legal-list",e)}function _L(e){let t=e.getStyle("mso-list");if(t===void 0)return{};let i=t.match(/(^|\s{1,100})l(\d+)/i),o=t.match(/\s{0,100}lfo(\d+)/i),n=t.match(/\s{0,100}level(\d+)/i);return i&&o&&n?{id:i[2],order:o[1],indent:parseInt(n[1])}:{indent:1}}function vL(e,t){let i=new We({name:"span",styles:{"mso-list":"Ignore"}}),o=t.createRangeIn(e);for(let n of o)n.type==="elementStart"&&i.match(n.item)&&t.remove(n.item)}function kL(e){let t=e.getStyle("margin-left");return t===void 0||t.endsWith("px")?t:m5(t)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function vL(e,t){if(!e.childCount)return;let i=new Vt(e.document),o=CL(e,i);xL(o,e,i),EL(o,e,i),TL(e,i);let n=AL(e,i);n.length&&SL(n,IL(t),i)}function kL(e){return btoa(e.match(/\w{2}/g).map(t=>String.fromCharCode(parseInt(t,16))).join(""))}function CL(e,t){let i=t.createRangeIn(e),o=new We({name:/v:(.+)/}),n=[];for(let s of i){if(s.type!="elementStart")continue;let r=s.item,a=r.previousSibling,l=a&&a.is("element")?a.name:null,c=["Chart"],u=o.match(r),d=r.getAttribute("o:gfxdata"),h=l==="v:shapetype",f=d&&c.some(m=>r.getAttribute("id").includes(m));u&&d&&!h&&!f&&n.push(s.item.getAttribute("id"))}return n}function xL(e,t,i){let o=i.createRangeIn(t),n=new We({name:"img"}),s=[];for(let r of o)if(r.item.is("element")&&n.match(r.item)){let a=r.item,l=a.getAttribute("v:shapes")?a.getAttribute("v:shapes").split(" "):[];l.length&&l.every(c=>e.indexOf(c)>-1)?s.push(a):a.getAttribute("src")||s.push(a)}for(let r of s)i.remove(r)}function TL(e,t){let i=t.createRangeIn(e),o=new We({name:/v:(.+)/}),n=[];for(let s of i)s.type=="elementStart"&&o.match(s.item)&&n.push(s.item);for(let s of n)t.remove(s)}function EL(e,t,i){let o=i.createRangeIn(t),n=[];for(let a of o)if(a.type=="elementStart"&&a.item.is("element","v:shape")){let l=a.item.getAttribute("id");if(e.includes(l))continue;s(a.item.parent.getChildren(),l)||n.push(a.item)}for(let a of n){let l={src:r(a)};a.hasAttribute("alt")&&(l.alt=a.getAttribute("alt"));let c=i.createElement("img",l);i.insertChild(a.index+1,c,a.parent)}function s(a,l){for(let c of a)if(c.is("element")&&(c.name=="img"&&c.getAttribute("v:shapes")==l||s(c.getChildren(),l)))return!0;return!1}function r(a){for(let l of a.getChildren())if(l.is("element")&&l.getAttribute("src"))return l.getAttribute("src")}}function AL(e,t){let i=t.createRangeIn(e),o=new We({name:"img"}),n=[],s=0;for(let r of i)r.item.is("element")&&o.match(r.item)&&(r.item.getAttribute("src").startsWith("file://")&&n.push({element:r.item,imageIndex:s}),s++);return n}function IL(e){if(!e)return[];let t=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,i=new RegExp("(?:("+t.source+"))([\\da-fA-F\\s]+)\\}","g"),o=e.match(i),n=[];if(o)for(let s of o){let r=!1;s.includes("\\pngblip")?r="image/png":s.includes("\\jpegblip")&&(r="image/jpeg"),r&&n.push({hex:s.replace(t,"").replace(/[^\da-fA-F]/g,""),type:r})}return n}function SL(e,t,i){for(let o=0;oString.fromCharCode(parseInt(t,16))).join(""))}function TL(e,t){let i=t.createRangeIn(e),o=new We({name:/v:(.+)/}),n=[];for(let s of i){if(s.type!="elementStart")continue;let r=s.item,a=r.previousSibling,l=a&&a.is("element")?a.name:null,c=["Chart"],u=o.match(r),d=r.getAttribute("o:gfxdata"),h=l==="v:shapetype",f=d&&c.some(m=>r.getAttribute("id").includes(m));u&&d&&!h&&!f&&n.push(s.item.getAttribute("id"))}return n}function EL(e,t,i){let o=i.createRangeIn(t),n=new We({name:"img"}),s=[];for(let r of o)if(r.item.is("element")&&n.match(r.item)){let a=r.item,l=a.getAttribute("v:shapes")?a.getAttribute("v:shapes").split(" "):[];l.length&&l.every(c=>e.indexOf(c)>-1)?s.push(a):a.getAttribute("src")||s.push(a)}for(let r of s)i.remove(r)}function AL(e,t){let i=t.createRangeIn(e),o=new We({name:/v:(.+)/}),n=[];for(let s of i)s.type=="elementStart"&&o.match(s.item)&&n.push(s.item);for(let s of n)t.remove(s)}function IL(e,t,i){let o=i.createRangeIn(t),n=[];for(let a of o)if(a.type=="elementStart"&&a.item.is("element","v:shape")){let l=a.item.getAttribute("id");if(e.includes(l))continue;s(a.item.parent.getChildren(),l)||n.push(a.item)}for(let a of n){let l={src:r(a)};a.hasAttribute("alt")&&(l.alt=a.getAttribute("alt"));let c=i.createElement("img",l);i.insertChild(a.index+1,c,a.parent)}function s(a,l){for(let c of a)if(c.is("element")&&(c.name=="img"&&c.getAttribute("v:shapes")==l||s(c.getChildren(),l)))return!0;return!1}function r(a){for(let l of a.getChildren())if(l.is("element")&&l.getAttribute("src"))return l.getAttribute("src")}}function SL(e,t){let i=t.createRangeIn(e),o=new We({name:"img"}),n=[],s=0;for(let r of i)r.item.is("element")&&o.match(r.item)&&(r.item.getAttribute("src").startsWith("file://")&&n.push({element:r.item,imageIndex:s}),s++);return n}function PL(e){if(!e)return[];let t=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,i=new RegExp("(?:("+t.source+"))([\\da-fA-F\\s]+)\\}","g"),o=e.match(i),n=[];if(o)for(let s of o){let r=!1;s.includes("\\pngblip")?r="image/png":s.includes("\\jpegblip")&&(r="image/jpeg"),r&&n.push({hex:s.replace(t,"").replace(/[^\da-fA-F]/g,""),type:r})}return n}function RL(e,t,i){for(let o=0;o!o.hasStyle(`border-${r}-style`)))t.setStyle("border-style","none",o);else for(let r of n)o.hasStyle(`border-${r}-style`)||t.setStyle(`border-${r}-style`,"none",o);let s=["width","height",...n.map(r=>`border-${r}-width`),...n.map(r=>`padding-${r}`)];for(let r of s)o.hasStyle(r)&&t.setStyle(r,f5(o.getStyle(r)),o)}}/** +*/function LL(e,t,i=!1){for(let o of t.createRangeIn(e).getItems()){if(!o.is("element","table")&&!o.is("element","td")&&!o.is("element","th"))continue;if(i&&o.is("element","table")){let r=o.parent?.is("element","div")?o.parent:null,a=o.parent?.parent?.is("element","div")?o.parent.parent:null,l=r??a;l&&l.getAttribute("align")==="center"&&!o.getAttribute("align")?(t.setStyle("margin-left","auto",o),t.setStyle("margin-right","auto",o)):l&&l.getAttribute("align")==="right"&&!o.getAttribute("align")?(t.setStyle("margin-left","auto",o),t.setStyle("margin-right","0",o)):!l&&!o.getAttribute("align")&&(t.setStyle("margin-left","0",o),t.setStyle("margin-right","auto",o))}let n=["left","top","right","bottom"];if(n.every(r=>!o.hasStyle(`border-${r}-style`)))t.setStyle("border-style","none",o);else for(let r of n)o.hasStyle(`border-${r}-style`)||t.setStyle(`border-${r}-style`,"none",o);let s=["width","height",...n.map(r=>`border-${r}-width`),...n.map(r=>`padding-${r}`)];for(let r of s)o.hasStyle(r)&&t.setStyle(r,m5(o.getStyle(r)),o)}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function g5(e,t){for(let i of t.createRangeIn(e).getItems())i.is("element","table")&&(i.getStyle("width")==="0px"&&t.removeStyle("width",i),i.getAttribute("width")==="0"&&t.removeAttribute("width",i))}/** +*/function p5(e,t){for(let i of t.createRangeIn(e).getItems())i.is("element","table")&&(i.getStyle("width")==="0px"&&t.removeStyle("width",i),i.getAttribute("width")==="0"&&t.removeAttribute("width",i))}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function VL(e,t){let i=new Map,o=new Map,n=null;for(let{item:r}of t.createRangeIn(e))if(r.is("element")){if(r.getStyle("mso-element")==="footnote-list"){n=r;continue}if(r.hasStyle("mso-footnote-id")){let a=r.findAncestor("element",l=>l.getStyle("mso-element")==="footnote");if(a){let l=a.getAttribute("id");o.set(l,a)}else{let l=r.getStyle("mso-footnote-id");i.set(l,r)}continue}}if(!i.size||!n)return;let s=ML(t);t.replace(n,s.wrapper);for(let[r,a]of i){let l=o.get(r);if(!l)continue;t.replace(a,BL(t,r));let c=OL(t,r);LL(t,l);for(let u of l.getChildren()){let d=u;/* v8 ignore else -- @preserve */u.is("element")&&(d=t.clone(u,!0)),t.appendChild(d,c.content)}t.appendChild(c.listItem,s.list)}}function LL(e,t){let i=[],o=[];for(let{item:n}of e.createRangeIn(t))if(n.is("element")&&n.getStyle("mso-footnote-id")){i.unshift(n);let{nextSibling:s}=n;s?.is("$text")&&s.data.startsWith(" ")&&o.unshift(s)}for(let n of i)e.remove(n);for(let n of o){let s=n.data.substring(1);if(s.length>0){let r=n.parent,a=r.getChildIndex(n),l=e.createText(s);e.remove(n),e.insertChild(a,l,r)}else e.remove(n)}return t}function ML(e){let t=e.createElement("hr",{class:"footnotes-divider"}),i=e.createElement("ol",{class:"footnotes-list"});return{list:i,wrapper:e.createElement("div",{class:"footnotes"},[t,i])}}function BL(e,t){let i=e.createElement("sup",{class:"footnote"}),o=e.createElement("a",{id:`ref-${t}`,href:`#${t}`});return e.appendChild(o,i),i}function OL(e,t){let i=e.createElement("li",{id:t,class:"footnote-definition"}),o=e.createElement("a",{href:`#ref-${t}`,class:"footnote-backlink"}),n=e.createElement("div",{class:"footnote-content"});return e.appendChild(e.createText("^"),o),e.appendChild(o,i),e.appendChild(n,i),{listItem:i,content:n}}/** +*/function ML(e,t){let i=new Map,o=new Map,n=null;for(let{item:r}of t.createRangeIn(e))if(r.is("element")){if(r.getStyle("mso-element")==="footnote-list"){n=r;continue}if(r.hasStyle("mso-footnote-id")){let a=r.findAncestor("element",l=>l.getStyle("mso-element")==="footnote");if(a){let l=a.getAttribute("id");o.set(l,a)}else{let l=r.getStyle("mso-footnote-id");i.set(l,r)}continue}}if(!i.size||!n)return;let s=OL(t);t.replace(n,s.wrapper);for(let[r,a]of i){let l=o.get(r);if(!l)continue;t.replace(a,DL(t,r));let c=FL(t,r);BL(t,l);for(let u of l.getChildren()){let d=u;/* v8 ignore else -- @preserve */u.is("element")&&(d=t.clone(u,!0)),t.appendChild(d,c.content)}t.appendChild(c.listItem,s.list)}}function BL(e,t){let i=[],o=[];for(let{item:n}of e.createRangeIn(t))if(n.is("element")&&n.getStyle("mso-footnote-id")){i.unshift(n);let{nextSibling:s}=n;s?.is("$text")&&s.data.startsWith(" ")&&o.unshift(s)}for(let n of i)e.remove(n);for(let n of o){let s=n.data.substring(1);if(s.length>0){let r=n.parent,a=r.getChildIndex(n),l=e.createText(s);e.remove(n),e.insertChild(a,l,r)}else e.remove(n)}return t}function OL(e){let t=e.createElement("hr",{class:"footnotes-divider"}),i=e.createElement("ol",{class:"footnotes-list"});return{list:i,wrapper:e.createElement("div",{class:"footnotes"},[t,i])}}function DL(e,t){let i=e.createElement("sup",{class:"footnote"}),o=e.createElement("a",{id:`ref-${t}`,href:`#${t}`});return e.appendChild(o,i),i}function FL(e,t){let i=e.createElement("li",{id:t,class:"footnote-definition"}),o=e.createElement("a",{href:`#ref-${t}`,class:"footnote-backlink"}),n=e.createElement("div",{class:"footnote-content"});return e.appendChild(e.createText("^"),o),e.appendChild(o,i),e.appendChild(n,i),{listItem:i,content:n}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var DL=//i,FL=/xmlns:o="urn:schemas-microsoft-com/i,NL=//i,zL=class{document;hasMultiLevelListPlugin;hasTablePropertiesPlugin;enableSkipLevelLists;constructor(e,t=!1,i=!1,o=!1){this.document=e,this.hasMultiLevelListPlugin=t,this.hasTablePropertiesPlugin=i,this.enableSkipLevelLists=o}isActive(e){return DL.test(e)||FL.test(e)||NL.test(e)}execute(e){let t=new Vt(this.document),i=e.extraContent.stylesString;sL(e.content,t),aL(e.content,i,this.hasMultiLevelListPlugin,this.enableSkipLevelLists),vL(e.content,e.dataTransfer.getData("text/rtf")),RL(e.content,t,this.hasTablePropertiesPlugin),g5(e.content,t),VL(e.content,t),PL(e.content)}};/** +*/var NL=//i,zL=/xmlns:o="urn:schemas-microsoft-com/i,HL=//i,WL=class{document;hasMultiLevelListPlugin;hasTablePropertiesPlugin;enableSkipLevelLists;constructor(e,t=!1,i=!1,o=!1){this.document=e,this.hasMultiLevelListPlugin=t,this.hasTablePropertiesPlugin=i,this.enableSkipLevelLists=o}isActive(e){return NL.test(e)||zL.test(e)||HL.test(e)}execute(e){let t=new Lt(this.document),i=e.extraContent.stylesString;aL(e.content,t),cL(e.content,i,this.hasMultiLevelListPlugin,this.enableSkipLevelLists),CL(e.content,e.dataTransfer.getData("text/rtf")),LL(e.content,t,this.hasTablePropertiesPlugin),p5(e.content,t),ML(e.content,t),VL(e.content)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function HL(e,t){for(let i of e.getChildren())if(i.is("element","b")&&i.getStyle("font-weight")==="normal"){let o=e.getChildIndex(i);t.remove(i),t.insertChild(o,i.getChildren(),e)}}/** +*/function UL(e,t){for(let i of e.getChildren())if(i.is("element","b")&&i.getStyle("font-weight")==="normal"){let o=e.getChildIndex(i);t.remove(i),t.insertChild(o,i.getChildren(),e)}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function WL(e,t){let i=new ar(t.document.stylesProcessor),o=new To(i,{renderingMode:"data"}),n=o.blockElements,s=o.inlineObjectElements,r=[];for(let a of t.createRangeIn(e)){let l=a.item;if(l.is("element","br")){let c=u5(l,"forward",t,{blockElements:n,inlineObjectElements:s}),u=u5(l,"backward",t,{blockElements:n,inlineObjectElements:s}),d=d5(c,n);(d5(u,n)||d)&&r.push(l)}}for(let a of r)a.hasClass("Apple-interchange-newline")?t.remove(a):t.replace(a,t.createElement("p"))}function u5(e,t,i,{blockElements:o,inlineObjectElements:n}){let s=i.createPositionAt(e,t=="forward"?"after":"before");return s=s.getLastMatchingPosition(({item:r})=>r.is("element")&&!o.includes(r.name)&&!n.includes(r.name),{direction:t}),t=="forward"?s.nodeAfter:s.nodeBefore}function d5(e,t){return!!e&&e.is("element")&&t.includes(e.name)}/** +*/function qL(e,t){let i=new ar(t.document.stylesProcessor),o=new Eo(i,{renderingMode:"data"}),n=o.blockElements,s=o.inlineObjectElements,r=[];for(let a of t.createRangeIn(e)){let l=a.item;if(l.is("element","br")){let c=d5(l,"forward",t,{blockElements:n,inlineObjectElements:s}),u=d5(l,"backward",t,{blockElements:n,inlineObjectElements:s}),d=h5(c,n);(h5(u,n)||d)&&r.push(l)}}for(let a of r)a.hasClass("Apple-interchange-newline")?t.remove(a):t.replace(a,t.createElement("p"))}function d5(e,t,i,{blockElements:o,inlineObjectElements:n}){let s=i.createPositionAt(e,t=="forward"?"after":"before");return s=s.getLastMatchingPosition(({item:r})=>r.is("element")&&!o.includes(r.name)&&!n.includes(r.name),{direction:t}),t=="forward"?s.nodeAfter:s.nodeBefore}function h5(e,t){return!!e&&e.is("element")&&t.includes(e.name)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function UL(e,t,i){let o=new Set;for(let n of t.createRangeIn(e).getItems())!n.is("view:$textProxy")||!n.data.includes(" ")||qL(n.parent)&&o.add(n.textNode);for(let n of o)$L(n,t,i)}function qL(e){let t=e;for(;t;){if(t.is("element")&&t.getStyle?.("white-space")==="pre-wrap")return!0;t=t.parent}return!1}function $L(e,t,i){let{parent:o,data:n}=e,s=n.replaceAll(" "," ".repeat(i)),r=o.getChildIndex(e);t.remove(e),t.insertChild(r,t.createText(s),o)}/** +*/function $L(e,t,i){let o=new Set;for(let n of t.createRangeIn(e).getItems())!n.is("view:$textProxy")||!n.data.includes(" ")||jL(n.parent)&&o.add(n.textNode);for(let n of o)KL(n,t,i)}function jL(e){let t=e;for(;t;){if(t.is("element")&&t.getStyle?.("white-space")==="pre-wrap")return!0;t=t.parent}return!1}function KL(e,t,i){let{parent:o,data:n}=e,s=n.replaceAll(" "," ".repeat(i)),r=o.getChildIndex(e);t.remove(e),t.insertChild(r,t.createText(s),o)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var jL=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i,KL=class{document;constructor(e){this.document=e}isActive(e){return jL.test(e)}execute(e){let t=new Vt(this.document);HL(e.content,t),cL(e.content,t),WL(e.content,t),UL(e.content,t,8)}};/** +*/var GL=/id=("|')docs-internal-guid-[-0-9a-f]+("|')/i,JL=class{document;constructor(e){this.document=e}isActive(e){return GL.test(e)}execute(e){let t=new Lt(this.document);UL(e.content,t),dL(e.content,t),qL(e.content,t),$L(e.content,t,8)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function GL(e,t){for(let i of e.getChildren())i.is("element","table")&&i.hasAttribute("xmlns")&&t.removeAttribute("xmlns",i)}/** +*/function ZL(e,t){for(let i of e.getChildren())i.is("element","table")&&i.hasAttribute("xmlns")&&t.removeAttribute("xmlns",i)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function JL(e,t){for(let i of e.getChildren())if(i.is("element","google-sheets-html-origin")){let o=e.getChildIndex(i);t.remove(i),t.insertChild(o,i.getChildren(),e)}}/** +*/function QL(e,t){for(let i of e.getChildren())if(i.is("element","google-sheets-html-origin")){let o=e.getChildIndex(i);t.remove(i),t.insertChild(o,i.getChildren(),e)}}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function ZL(e,t){for(let i of Array.from(e.getChildren()))i.is("element","style")&&t.remove(i)}/** +*/function YL(e,t){for(let i of Array.from(e.getChildren()))i.is("element","style")&&t.remove(i)}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var QL=/[^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<\/span>/g,"").replace(/()[\r\n]+(<\/span>)/g,"$1 $2").replace(/ <\//g,"\xA0<\/o:p>/g,"\xA0").replace(/( |\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)<")}function eM(e){e.querySelectorAll("span[style*=spacerun]").forEach(t=>{let i=t,o=i.innerText.length||0;i.innerText=Array(o+1).join("\xA0 ").substr(0,o)})}function h5(e){return e.replace(/(\s+)<\/span>/g,(t,i)=>i.length===1?" ":Array(i.length+1).join("\xA0 ").substr(0,i.length))}/** +*/function tM(e){return f5(f5(e)).replace(/([^\S\r\n]*?)[\r\n]+([^\S\r\n]*<\/span>)/g,"$1$2").replace(/<\/span>/g,"").replace(/()[\r\n]+(<\/span>)/g,"$1 $2").replace(/ <\//g,"\xA0<\/o:p>/g,"\xA0").replace(/( |\u00A0)<\/o:p>/g,"").replace(/>([^\S\r\n]*[\r\n]\s*)<")}function iM(e){e.querySelectorAll("span[style*=spacerun]").forEach(t=>{let i=t,o=i.innerText.length||0;i.innerText=Array(o+1).join("\xA0 ").substr(0,o)})}function f5(e){return e.replace(/(\s+)<\/span>/g,(t,i)=>i.length===1?" ":Array(i.length+1).join("\xA0 ").substr(0,i.length))}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/function tM(e,t){let i=new DOMParser;e=e.replace(/",UB="<[?][\\s\\S]*?[?]>",qB="]*>",$B="",yv=new RegExp("^(?:"+bv+"|"+wv+"|"+WB+"|"+UB+"|"+qB+"|"+$B+")"),_v=new RegExp("^(?:"+bv+"|"+wv+")");var vs=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(_v.source+"\\s*$"),/^$/,!1]];function im(e,t,i,o){let n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(n)!==60)return!1;let r=e.src.slice(n,s),a=0;for(;a=4)return!1;let r=e.src.charCodeAt(n);if(r!==35||n>=s)return!1;let a=1;for(r=e.src.charCodeAt(++n);r===35&&n6||nn&&H(e.src.charCodeAt(l-1))&&(s=l),e.line=t+1;let c=e.push("heading_open","h"+String(a),1);c.markup="########".slice(0,a),c.map=[t,e.line];let u=e.push("inline","",0);u.content=e.src.slice(n,s).trim(),u.map=[t,e.line],u.children=[];let d=e.push("heading_close","h"+String(a),-1);return d.markup="########".slice(0,a),!0}function nm(e,t,i){let o=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;let n=e.parentType;e.parentType="paragraph";let s=0,r,a=t+1;for(;a3)continue;if(e.sCount[a]>=e.blkIndent){let f=e.bMarks[a]+e.tShift[a],m=e.eMarks[a];if(f=m))){s=r===61?1:2;break}}if(e.sCount[a]<0)continue;let h=!1;for(let f=0,m=o.length;f3||e.sCount[s]<0)continue;let c=!1;for(let u=0,d=o.length;u=i||e.sCount[r]=s){e.line=i;break}let l=e.line,c=!1;for(let u=0;u=e.line)throw new Error("block rule didn't increment state.line");break}if(!c)throw new Error("none of the block rules matched");e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),r=e.line,r0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],n={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(n),o};ea.prototype.scanDelims=function(e,t){let i=this.posMax,o=this.src.charCodeAt(e),n=e>0?this.src.charCodeAt(e-1):32,s=e;for(;s0)return!1;let i=e.pos,o=e.posMax;if(i+3>o||e.src.charCodeAt(i)!==58||e.src.charCodeAt(i+1)!==47||e.src.charCodeAt(i+2)!==47)return!1;let n=e.pending.match(KB);if(!n)return!1;let s=n[1],r=e.md.linkify.matchAtStart(e.src.slice(i-s.length));if(!r)return!1;let a=r.url;if(a.length<=s.length)return!1;a=a.replace(/\*+$/,"");let l=e.md.normalizeLink(a);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-s.length);let c=e.push("link_open","a",1);c.attrs=[["href",l]],c.markup="linkify",c.info="auto";let u=e.push("text","",0);u.content=e.md.normalizeLinkText(a);let d=e.push("link_close","a",-1);d.markup="linkify",d.info="auto"}return e.pos+=a.length-s.length,!0}function lm(e,t){let i=e.pos;if(e.src.charCodeAt(i)!==10)return!1;let o=e.pending.length-1,n=e.posMax;if(!t)if(o>=0&&e.pending.charCodeAt(o)===32)if(o>=1&&e.pending.charCodeAt(o-1)===32){let s=o-1;for(;s>=1&&e.pending.charCodeAt(s-1)===32;)s--;e.pending=e.pending.slice(0,s),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(i++;i?@[]^_`{|}~-".split("").forEach(function(e){cm[e.charCodeAt(0)]=1});function um(e,t){let i=e.pos,o=e.posMax;if(e.src.charCodeAt(i)!==92||(i++,i>=o))return!1;let n=e.src.charCodeAt(i);if(n===10){for(t||e.push("hardbreak","br",0),i++;i=55296&&n<=56319&&i+1=56320&&a<=57343&&(s+=e.src[i+1],i++)}let r="\\"+s;if(!t){let a=e.push("text_special","",0);n<256&&cm[n]!==0?a.content=s:a.content=r,a.markup=r,a.info="escape"}return e.pos=i+1,!0}function dm(e,t){let i=e.pos;if(e.src.charCodeAt(i)!==96)return!1;let n=i;i++;let s=e.posMax;for(;i=0;o--){let n=t[o];if(n.marker!==95&&n.marker!==42||n.end===-1)continue;let s=t[n.end],r=o>0&&t[o-1].end===n.end+1&&t[o-1].marker===n.marker&&t[o-1].token===n.token-1&&t[n.end+1].token===s.token+1,a=String.fromCharCode(n.marker),l=e.tokens[n.token];l.type=r?"strong_open":"em_open",l.tag=r?"strong":"em",l.nesting=1,l.markup=r?a+a:a,l.content="";let c=e.tokens[s.token];c.type=r?"strong_close":"em_close",c.tag=r?"strong":"em",c.nesting=-1,c.markup=r?a+a:a,c.content="",r&&(e.tokens[t[o-1].token].content="",e.tokens[t[n.end+1].token].content="",o--)}}function QB(e){let t=e.tokens_meta,i=e.tokens_meta.length;xv(e,e.delimiters);for(let o=0;o=d)return!1;if(l=m,n=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),n.ok){for(r=e.md.normalizeLink(n.str),e.md.validateLink(r)?m=n.pos:r="",l=m;m=d||e.src.charCodeAt(m)!==41)&&(c=!0),m++}if(c){if(typeof e.env.references>"u")return!1;if(m=0?o=e.src.slice(l,m++):m=f+1):m=f+1,o||(o=e.src.slice(h,f)),s=e.env.references[Wo(o)],!s)return e.pos=u,!1;r=s.href,a=s.title}if(!t){e.pos=h,e.posMax=f;let g=e.push("link_open","a",1),b=[["href",r]];g.attrs=b,a&&b.push(["title",a]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=m,e.posMax=d,!0}function gm(e,t){let i,o,n,s,r,a,l,c,u="",d=e.pos,h=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;let f=e.pos+2,m=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(m<0)return!1;if(s=m+1,s=h)return!1;for(c=s,a=e.md.helpers.parseLinkDestination(e.src,s,e.posMax),a.ok&&(u=e.md.normalizeLink(a.str),e.md.validateLink(u)?s=a.pos:u=""),c=s;s=h||e.src.charCodeAt(s)!==41)return e.pos=d,!1;s++}else{if(typeof e.env.references>"u")return!1;if(s=0?n=e.src.slice(c,s++):s=m+1):s=m+1,n||(n=e.src.slice(f,m)),r=e.env.references[Wo(n)],!r)return e.pos=d,!1;u=r.href,l=r.title}if(!t){o=e.src.slice(f,m);let g=[];e.md.inline.parse(o,e.md,e.env,g);let b=e.push("image","img",0),k=[["src",u],["alt",""]];b.attrs=k,b.children=g,b.content=o,l&&k.push(["title",l])}return e.pos=s,e.posMax=h,!0}var YB=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,XB=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function pm(e,t){let i=e.pos;if(e.src.charCodeAt(i)!==60)return!1;let o=e.pos,n=e.posMax;for(;;){if(++i>=n)return!1;let r=e.src.charCodeAt(i);if(r===60)return!1;if(r===62)break}let s=e.src.slice(o+1,i);if(XB.test(s)){let r=e.md.normalizeLink(s);if(!e.md.validateLink(r))return!1;if(!t){let a=e.push("link_open","a",1);a.attrs=[["href",r]],a.markup="autolink",a.info="auto";let l=e.push("text","",0);l.content=e.md.normalizeLinkText(s);let c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=s.length+2,!0}if(YB.test(s)){let r=e.md.normalizeLink("mailto:"+s);if(!e.md.validateLink(r))return!1;if(!t){let a=e.push("link_open","a",1);a.attrs=[["href",r]],a.markup="autolink",a.info="auto";let l=e.push("text","",0);l.content=e.md.normalizeLinkText(s);let c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=s.length+2,!0}return!1}function eO(e){return/^\s]/i.test(e)}function tO(e){return/^<\/a\s*>/i.test(e)}function iO(e){let t=e|32;return t>=97&&t<=122}function bm(e,t){if(!e.md.options.html)return!1;let i=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==60||o+2>=i)return!1;let n=e.src.charCodeAt(o+1);if(n!==33&&n!==63&&n!==47&&!iO(n))return!1;let s=e.src.slice(o).match(yv);if(!s)return!1;if(!t){let r=e.push("html_inline","",0);r.content=s[0],eO(r.content)&&e.linkLevel++,tO(r.content)&&e.linkLevel--}return e.pos+=s[0].length,!0}var oO=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,nO=/^&([a-z][a-z0-9]{1,31});/i;function wm(e,t){let i=e.pos,o=e.posMax;if(e.src.charCodeAt(i)!==38||i+1>=o)return!1;if(e.src.charCodeAt(i+1)===35){let s=e.src.slice(i).match(oO);if(s){if(!t){let r=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),a=e.push("text_special","",0);a.content=Hc(r)?Xr(r):Xr(65533),a.markup=s[0],a.info="entity"}return e.pos+=s[0].length,!0}}else{let s=e.src.slice(i).match(nO);if(s){let r=oo(s[0]);if(r!==s[0]){if(!t){let a=e.push("text_special","",0);a.content=r,a.markup=s[0],a.info="entity"}return e.pos+=s[0].length,!0}}}return!1}function Tv(e){let t={},i=e.length;if(!i)return;let o=0,n=-2,s=[];for(let r=0;rl;c-=s[c]+1){let d=e[c];if(d.marker===a.marker&&d.open&&d.end<0){let h=!1;if((d.close||a.open)&&(d.length+a.length)%3===0&&(d.length%3!==0||a.length%3!==0)&&(h=!0),!h){let f=c>0&&!e[c-1].open?s[c-1]+1:0;s[r]=r-c+f,s[c]=f,a.open=!1,d.end=r,d.close=!1,u=-1,n=-2;break}}}u!==-1&&(t[a.marker][(a.open?3:0)+(a.length||0)%3]=u)}}function ym(e){let t=e.tokens_meta,i=e.tokens_meta.length;Tv(e.delimiters);for(let o=0;o0&&o++,n[t].type==="text"&&t+1=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;r||e.pos++,s[t]=e.pos};ta.prototype.tokenize=function(e){let t=this.ruler.getRules(""),i=t.length,o=e.posMax,n=e.md.options.maxNesting;for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=o)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()};ta.prototype.parse=function(e,t,i,o){let n=new this.State(e,t,i,o);this.tokenize(n);let s=this.ruler2.getRules(""),r=s.length;for(let a=0;a|$))",t.tpl_email_fuzzy="(^|"+i+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|"+t.src_ZPCc+"))((?![$+<=>^`|\uFF5C])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|"+t.src_ZPCc+"))((?![$+<=>^`|\uFF5C])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function Cm(e){return Array.prototype.slice.call(arguments,1).forEach(function(i){i&&Object.keys(i).forEach(function(o){e[o]=i[o]})}),e}function jc(e){return Object.prototype.toString.call(e)}function sO(e){return jc(e)==="[object String]"}function rO(e){return jc(e)==="[object Object]"}function aO(e){return jc(e)==="[object RegExp]"}function Iv(e){return jc(e)==="[object Function]"}function lO(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var Pv={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function cO(e){return Object.keys(e||{}).reduce(function(t,i){return t||Pv.hasOwnProperty(i)},!1)}var uO={"http:":{validate:function(e,t,i){let o=e.slice(t);return i.re.http||(i.re.http=new RegExp("^\\/\\/"+i.re.src_auth+i.re.src_host_port_strict+i.re.src_path,"i")),i.re.http.test(o)?o.match(i.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,i){let o=e.slice(t);return i.re.no_http||(i.re.no_http=new RegExp("^"+i.re.src_auth+"(?:localhost|(?:(?:"+i.re.src_domain+")\\.)+"+i.re.src_domain_root+")"+i.re.src_port+i.re.src_host_terminator+i.re.src_path,"i")),i.re.no_http.test(o)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o.match(i.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,i){let o=e.slice(t);return i.re.mailto||(i.re.mailto=new RegExp("^"+i.re.src_email_name+"@"+i.re.src_host_strict,"i")),i.re.mailto.test(o)?o.match(i.re.mailto)[0].length:0}}},dO="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",hO="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function fO(e){e.__index__=-1,e.__text_cache__=""}function mO(e){return function(t,i){let o=t.slice(i);return e.test(o)?o.match(e)[0].length:0}}function Sv(){return function(e,t){t.normalize(e)}}function $c(e){let t=e.re=Av(e.__opts__),i=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||i.push(dO),i.push(t.src_xn),t.src_tlds=i.join("|");function o(a){return a.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(o(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(o(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(o(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(o(t.tpl_host_fuzzy_test),"i");let n=[];e.__compiled__={};function s(a,l){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+l)}Object.keys(e.__schemas__).forEach(function(a){let l=e.__schemas__[a];if(l===null)return;let c={validate:null,link:null};if(e.__compiled__[a]=c,rO(l)){aO(l.validate)?c.validate=mO(l.validate):Iv(l.validate)?c.validate=l.validate:s(a,l),Iv(l.normalize)?c.normalize=l.normalize:l.normalize?s(a,l):c.normalize=Sv();return}if(sO(l)){n.push(a);return}s(a,l)}),n.forEach(function(a){e.__compiled__[e.__schemas__[a]]&&(e.__compiled__[a].validate=e.__compiled__[e.__schemas__[a]].validate,e.__compiled__[a].normalize=e.__compiled__[e.__schemas__[a]].normalize)}),e.__compiled__[""]={validate:null,normalize:Sv()};let r=Object.keys(e.__compiled__).filter(function(a){return a.length>0&&e.__compiled__[a]}).map(lO).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><\uFF5C]|"+t.src_ZPCc+"))("+r+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><\uFF5C]|"+t.src_ZPCc+"))("+r+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),fO(e)}function gO(e,t){let i=e.__index__,o=e.__last_index__,n=e.__text_cache__.slice(i,o);this.schema=e.__schema__.toLowerCase(),this.index=i+t,this.lastIndex=o+t,this.raw=n,this.text=n,this.url=n}function xm(e,t){let i=new gO(e,t);return e.__compiled__[i.schema].normalize(i,e),i}function mt(e,t){if(!(this instanceof mt))return new mt(e,t);t||cO(e)&&(t=e,e={}),this.__opts__=Cm({},Pv,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Cm({},uO,e),this.__compiled__={},this.__tlds__=hO,this.__tlds_replaced__=!1,this.re={},$c(this)}mt.prototype.add=function(t,i){return this.__schemas__[t]=i,$c(this),this};mt.prototype.set=function(t){return this.__opts__=Cm(this.__opts__,t),this};mt.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let i,o,n,s,r,a,l,c,u;if(this.re.schema_test.test(t)){for(l=this.re.schema_search,l.lastIndex=0;(i=l.exec(t))!==null;)if(s=this.testSchemaAt(t,i[2],l.lastIndex),s){this.__schema__=i[2],this.__index__=i.index+i[1].length,this.__last_index__=i.index+i[0].length+s;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=t.search(this.re.host_fuzzy_test),c>=0&&(this.__index__<0||c=0&&(n=t.match(this.re.email_fuzzy))!==null&&(r=n.index+n[1].length,a=n.index+n[0].length,(this.__index__<0||rthis.__last_index__)&&(this.__schema__="mailto:",this.__index__=r,this.__last_index__=a))),this.__index__>=0};mt.prototype.pretest=function(t){return this.re.pretest.test(t)};mt.prototype.testSchemaAt=function(t,i,o){return this.__compiled__[i.toLowerCase()]?this.__compiled__[i.toLowerCase()].validate(t,o,this):0};mt.prototype.match=function(t){let i=[],o=0;this.__index__>=0&&this.__text_cache__===t&&(i.push(xm(this,o)),o=this.__last_index__);let n=o?t.slice(o):t;for(;this.test(n);)i.push(xm(this,o)),n=n.slice(this.__last_index__),o+=this.__last_index__;return i.length?i:null};mt.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;let i=this.re.schema_at_start.exec(t);if(!i)return null;let o=this.testSchemaAt(t,i[2],i[0].length);return o?(this.__schema__=i[2],this.__index__=i.index+i[1].length,this.__last_index__=i.index+i[0].length+o,xm(this,0)):null};mt.prototype.tlds=function(t,i){return t=Array.isArray(t)?t:[t],i?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(o,n,s){return o!==s[n-1]}).reverse(),$c(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,$c(this),this)};mt.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};mt.prototype.onCompile=function(){};var Rv=mt;var pO=/^xn--/,bO=/[^\0-\x7F]/,wO=/[\x2E\u3002\uFF0E\uFF61]/g,yO={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Tm=35,ri=Math.floor,Em=String.fromCharCode;function no(e){throw new RangeError(yO[e])}function _O(e,t){let i=[],o=e.length;for(;o--;)i[o]=t(e[o]);return i}function Lv(e,t){let i=e.split("@"),o="";i.length>1&&(o=i[0]+"@",e=i[1]),e=e.replace(wO,".");let n=e.split("."),s=_O(n,t).join(".");return o+s}function Mv(e){let t=[],i=0,o=e.length;for(;i=55296&&n<=56319&&iString.fromCodePoint(...e),kO=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:36},Vv=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Bv=function(e,t,i){let o=0;for(e=i?ri(e/700):e>>1,e+=ri(e/t);e>Tm*26>>1;o+=36)e=ri(e/Tm);return ri(o+(Tm+1)*e/(e+38))},Ov=function(e){let t=[],i=e.length,o=0,n=128,s=72,r=e.lastIndexOf("-");r<0&&(r=0);for(let a=0;a=128&&no("not-basic"),t.push(e.charCodeAt(a));for(let a=r>0?r+1:0;a=i&&no("invalid-input");let h=kO(e.charCodeAt(a++));h>=36&&no("invalid-input"),h>ri((2147483647-o)/u)&&no("overflow"),o+=h*u;let f=d<=s?1:d>=s+26?26:d-s;if(hri(2147483647/m)&&no("overflow"),u*=m}let c=t.length+1;s=Bv(o-l,c,l==0),ri(o/c)>2147483647-n&&no("overflow"),n+=ri(o/c),o%=c,t.splice(o++,0,n)}return String.fromCodePoint(...t)},Dv=function(e){let t=[];e=Mv(e);let i=e.length,o=128,n=0,s=72;for(let l of e)l<128&&t.push(Em(l));let r=t.length,a=r;for(r&&t.push("-");a=o&&uri((2147483647-n)/c)&&no("overflow"),n+=(l-o)*c,o=l;for(let u of e)if(u2147483647&&no("overflow"),u===o){let d=n;for(let h=36;;h+=36){let f=h<=s?1:h>=s+26?26:h-s;if(d=0))try{t.hostname=Am.toASCII(t.hostname)}catch{}return Rc(ps(t))}function RO(e){let t=Yr(e,!0);if(t.hostname&&(!t.protocol||Hv.indexOf(t.protocol)>=0))try{t.hostname=Am.toUnicode(t.hostname)}catch{}return Qr(ps(t),Qr.defaultChars+"%")}function Et(e,t){if(!(this instanceof Et))return new Et(e,t);t||zc(e)||(t=e||{},e="default"),this.inline=new Ev,this.block=new vv,this.core=new dv,this.renderer=new sv,this.linkify=new Rv,this.validateLink=SO,this.normalizeLink=PO,this.normalizeLinkText=RO,this.utils=Mf,this.helpers=ws({},Ff),this.options={},this.configure(e),t&&this.set(t)}Et.prototype.set=function(e){return ws(this.options,e),this};Et.prototype.configure=function(e){let t=this;if(zc(e)){let i=e;if(e=EO[i],!e)throw new Error('Wrong `markdown-it` preset "'+i+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(i){e.components[i].rules&&t[i].ruler.enableOnly(e.components[i].rules),e.components[i].rules2&&t[i].ruler2.enableOnly(e.components[i].rules2)}),this};Et.prototype.enable=function(e,t){let i=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(n){i=i.concat(this[n].ruler.enable(e,!0))},this),i=i.concat(this.inline.ruler2.enable(e,!0));let o=e.filter(function(n){return i.indexOf(n)<0});if(o.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+o);return this};Et.prototype.disable=function(e,t){let i=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(n){i=i.concat(this[n].ruler.disable(e,!0))},this),i=i.concat(this.inline.ruler2.disable(e,!0));let o=e.filter(function(n){return i.indexOf(n)<0});if(o.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+o);return this};Et.prototype.use=function(e){let t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this};Et.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");let i=new this.core.State(e,this,t);return this.core.process(i),i.tokens};Et.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};Et.prototype.parseInline=function(e,t){let i=new this.core.State(e,this,t);return i.inlineMode=!0,this.core.process(i),i.tokens};Et.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};var Im=Et;var Kv=Um(jv());/** +`;break;default:}return o};ys.prototype.render=function(e,t,i){let o="",n=this.rules;for(let s=0,r=e.length;s=0&&(o=this.attrs[i][1]),o};_s.prototype.attrJoin=function(t,i){let o=this.attrIndex(t);o<0?this.attrPush([t,i]):this.attrs[o][1]=this.attrs[o][1]+" "+i};var Vi=_s;function lv(e,t,i){this.src=e,this.env=i,this.tokens=[],this.inlineMode=!1,this.md=t}lv.prototype.Token=Vi;var cv=lv;var EB=/\r\n?|\n/g,AB=/\0/g;function Hf(e){let t;t=e.src.replace(EB,` +`),t=t.replace(AB,"\uFFFD"),e.src=t}function Wf(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function Uf(e){let t=e.tokens;for(let i=0,o=t.length;i\s]/i.test(e)}function SB(e){return/^<\/a\s*>/i.test(e)}function qf(e){let t=e.tokens;if(e.md.options.linkify)for(let i=0,o=t.length;i=0;r--){let a=n[r];if(a.type==="link_close"){for(r--;n[r].level!==a.level&&n[r].type!=="link_open";)r--;continue}if(a.type==="html_inline"&&(IB(a.content)&&s>0&&s--,SB(a.content)&&s++),!(s>0)&&a.type==="text"&&e.md.linkify.test(a.content)){let l=a.content,c=e.md.linkify.match(l),u=[],d=a.level,h=0;c.length>0&&c[0].index===0&&r>0&&n[r-1].type==="text_special"&&(c=c.slice(1));for(let f=0;fh){let y=new e.Token("text","",0);y.content=l.slice(h,k),y.level=d,u.push(y)}let v=new e.Token("link_open","a",1);v.attrs=[["href",g]],v.level=d++,v.markup="linkify",v.info="auto",u.push(v);let _=new e.Token("text","",0);_.content=b,_.level=d,u.push(_);let C=new e.Token("link_close","a",-1);C.level=--d,C.markup="linkify",C.info="auto",u.push(C),h=c[f].lastIndex}if(h=0;i--){let o=e[i];o.type==="text"&&!t&&(o.content=o.content.replace(RB,LB)),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function BB(e){let t=0;for(let i=e.length-1;i>=0;i--){let o=e[i];o.type==="text"&&!t&&uv.test(o.content)&&(o.content=o.content.replace(/\+-/g,"\xB1").replace(/\.{2,}/g,"\u2026").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1\u2014").replace(/(^|\s)--(?=\s|$)/mg,"$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1\u2013")),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function $f(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(PB.test(e.tokens[t].content)&&MB(e.tokens[t].children),uv.test(e.tokens[t].content)&&BB(e.tokens[t].children))}var OB=/['"]/,dv=/['"]/g,hv="\u2019";function qc(e,t,i){return e.slice(0,t)+i+e.slice(t+1)}function DB(e,t){let i,o=[];for(let n=0;n=0&&!(o[i].level<=r);i--);if(o.length=i+1,s.type!=="text")continue;let a=s.content,l=0,c=a.length;e:for(;l=0)m=a.charCodeAt(u.index-1);else for(i=n-1;i>=0&&!(e[i].type==="softbreak"||e[i].type==="hardbreak");i--)if(e[i].content){m=e[i].content.charCodeAt(e[i].content.length-1);break}let g=32;if(l=48&&m<=57&&(h=d=!1),d&&h&&(d=b,h=k),!d&&!h){f&&(s.content=qc(s.content,u.index,hv));continue}if(h)for(i=o.length-1;i>=0;i--){let C=o[i];if(o[i].level=0;t--)e.tokens[t].type!=="inline"||!OB.test(e.tokens[t].content)||DB(e.tokens[t].children,e)}function Kf(e){let t,i,o=e.tokens,n=o.length;for(let s=0;s0&&this.level++,this.tokens.push(o),o};ai.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};ai.prototype.skipEmptyLines=function(t){for(let i=this.lineMax;ti;)if(!H(this.src.charCodeAt(--t)))return t+1;return t};ai.prototype.skipChars=function(t,i){for(let o=this.src.length;to;)if(i!==this.src.charCodeAt(--t))return t+1;return t};ai.prototype.getLines=function(t,i,o,n){if(t>=i)return"";let s=new Array(i-t);for(let r=0,a=t;ao?s[r]=new Array(l-o+1).join(" ")+this.src.slice(u,d):s[r]=this.src.slice(u,d)}return s.join("")};ai.prototype.Token=Vi;var mv=ai;var FB=65536;function Zf(e,t){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(i,o)}function gv(e){let t=[],i=e.length,o=0,n=e.charCodeAt(o),s=!1,r=0,a="";for(;oi)return!1;let n=t+1;if(e.sCount[n]=4)return!1;let s=e.bMarks[n]+e.tShift[n];if(s>=e.eMarks[n])return!1;let r=e.src.charCodeAt(s++);if(r!==124&&r!==45&&r!==58||s>=e.eMarks[n])return!1;let a=e.src.charCodeAt(s++);if(a!==124&&a!==45&&a!==58&&!H(a)||r===45&&H(a))return!1;for(;s=4)return!1;c=gv(l),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();let d=c.length;if(d===0||d!==u.length)return!1;if(o)return!0;let h=e.parentType;e.parentType="table";let f=e.md.block.ruler.getRules("blockquote"),m=e.push("table_open","table",1),g=[t,0];m.map=g;let b=e.push("thead_open","thead",1);b.map=[t,t+1];let k=e.push("tr_open","tr",1);k.map=[t,t+1];for(let C=0;C=4||(c=gv(l),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),_+=d-c.length,_>FB))break;if(n===t+2){let E=e.push("tbody_open","tbody",1);E.map=v=[t+2,0]}let y=e.push("tr_open","tr",1);y.map=[n,n+1];for(let E=0;E=4){o++,n=o;continue}break}e.line=n;let s=e.push("code_block","code",0);return s.content=e.getLines(t,n,4+e.blkIndent,!1)+` +`,s.map=[t,e.line],!0}function Xf(e,t,i,o){let n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||n+3>s)return!1;let r=e.src.charCodeAt(n);if(r!==126&&r!==96)return!1;let a=n;n=e.skipChars(n,r);let l=n-a;if(l<3)return!1;let c=e.src.slice(a,n),u=e.src.slice(n,s);if(r===96&&u.indexOf(String.fromCharCode(r))>=0)return!1;if(o)return!0;let d=t,h=!1;for(;d++,!(d>=i||(n=a=e.bMarks[d]+e.tShift[d],s=e.eMarks[d],n=4)&&(n=e.skipChars(n,r),!(n-a=4||e.src.charCodeAt(n)!==62)return!1;if(o)return!0;let a=[],l=[],c=[],u=[],d=e.md.block.ruler.getRules("blockquote"),h=e.parentType;e.parentType="blockquote";let f=!1,m;for(m=t;m=s)break;if(e.src.charCodeAt(n++)===62&&!_){let y=e.sCount[m]+1,E,x;e.src.charCodeAt(n)===32?(n++,y++,x=!1,E=!0):e.src.charCodeAt(n)===9?(E=!0,(e.bsCount[m]+y)%4===3?(n++,y++,x=!1):x=!0):E=!1;let B=y;for(a.push(e.bMarks[m]),e.bMarks[m]=n;n=s,l.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+(E?1:0),c.push(e.sCount[m]),e.sCount[m]=B-y,u.push(e.tShift[m]),e.tShift[m]=n-e.bMarks[m];continue}if(f)break;let C=!1;for(let y=0,E=d.length;y";let k=[t,0];b.map=k,e.md.block.tokenize(e,t,m);let v=e.push("blockquote_close","blockquote",-1);v.markup=">",e.lineMax=r,e.parentType=h,k[1]=e.line;for(let _=0;_=4)return!1;let s=e.bMarks[t]+e.tShift[t],r=e.src.charCodeAt(s++);if(r!==42&&r!==45&&r!==95)return!1;let a=1;for(;s=o)return-1;let s=e.src.charCodeAt(n++);if(s<48||s>57)return-1;for(;;){if(n>=o)return-1;if(s=e.src.charCodeAt(n++),s>=48&&s<=57){if(n-i>=10)return-1;continue}if(s===41||s===46)break;return-1}return n=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]=e.blkIndent&&(u=!0);let d,h,f;if((f=bv(e,l))>=0){if(d=!0,r=e.bMarks[l]+e.tShift[l],h=Number(e.src.slice(r,f-1)),u&&h!==1)return!1}else if((f=pv(e,l))>=0)d=!1;else return!1;if(u&&e.skipSpaces(f)>=e.eMarks[l])return!1;if(o)return!0;let m=e.src.charCodeAt(f-1),g=e.tokens.length;d?(a=e.push("ordered_list_open","ol",1),h!==1&&(a.attrs=[["start",h]])):a=e.push("bullet_list_open","ul",1);let b=[l,0];a.map=b,a.markup=String.fromCharCode(m);let k=!1,v=e.md.block.ruler.getRules("list"),_=e.parentType;for(e.parentType="list";l=n?x=1:x=y-C,x>4&&(x=1);let B=C+x;a=e.push("list_item_open","li",1),a.markup=String.fromCharCode(m);let de=[l,0];a.map=de,d&&(a.info=e.src.slice(r,f-1));let Ve=e.tight,Go=e.tShift[l],nu=e.sCount[l],xk=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=B,e.tight=!0,e.tShift[l]=E-e.bMarks[l],e.sCount[l]=y,E>=n&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,i):e.md.block.tokenize(e,l,i,!0),(!e.tight||k)&&(c=!1),k=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=xk,e.tShift[l]=Go,e.sCount[l]=nu,e.tight=Ve,a=e.push("list_item_close","li",-1),a.markup=String.fromCharCode(m),l=e.line,de[1]=l,l>=i||e.sCount[l]=4)break;let Um=!1;for(let Jo=0,Tk=v.length;Jo=4||e.src.charCodeAt(n)!==91)return!1;function a(v){let _=e.lineMax;if(v>=_||e.isEmpty(v))return null;let C=!1;if(e.sCount[v]-e.blkIndent>3&&(C=!0),e.sCount[v]<0&&(C=!0),!C){let x=e.md.block.ruler.getRules("reference"),B=e.parentType;e.parentType="reference";let de=!1;for(let Ve=0,Go=x.length;Ve"u"&&(e.env.references={}),typeof e.env.references[k]>"u"&&(e.env.references[k]={title:b,href:d}),e.line=r),!0):!1}var wv=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"];var zB="[a-zA-Z_:][a-zA-Z0-9:._-]*",HB="[^\"'=<>`\\x00-\\x20]+",WB="'[^']*'",UB='"[^"]*"',qB="(?:"+HB+"|"+WB+"|"+UB+")",$B="(?:\\s+"+zB+"(?:\\s*=\\s*"+qB+")?)",yv="<[A-Za-z][A-Za-z0-9\\-]*"+$B+"*\\s*\\/?>",_v="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",jB="",KB="<[?][\\s\\S]*?[?]>",GB="]*>",JB="",vv=new RegExp("^(?:"+yv+"|"+_v+"|"+jB+"|"+KB+"|"+GB+"|"+JB+")"),kv=new RegExp("^(?:"+yv+"|"+_v+")");var vs=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(kv.source+"\\s*$"),/^$/,!1]];function nm(e,t,i,o){let n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(n)!==60)return!1;let r=e.src.slice(n,s),a=0;for(;a=4)return!1;let r=e.src.charCodeAt(n);if(r!==35||n>=s)return!1;let a=1;for(r=e.src.charCodeAt(++n);r===35&&n6||nn&&H(e.src.charCodeAt(l-1))&&(s=l),e.line=t+1;let c=e.push("heading_open","h"+String(a),1);c.markup="########".slice(0,a),c.map=[t,e.line];let u=e.push("inline","",0);u.content=e.src.slice(n,s).trim(),u.map=[t,e.line],u.children=[];let d=e.push("heading_close","h"+String(a),-1);return d.markup="########".slice(0,a),!0}function rm(e,t,i){let o=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;let n=e.parentType;e.parentType="paragraph";let s=0,r,a=t+1;for(;a3)continue;if(e.sCount[a]>=e.blkIndent){let f=e.bMarks[a]+e.tShift[a],m=e.eMarks[a];if(f=m))){s=r===61?1:2;break}}if(e.sCount[a]<0)continue;let h=!1;for(let f=0,m=o.length;f3||e.sCount[s]<0)continue;let c=!1;for(let u=0,d=o.length;u=i||e.sCount[r]=s){e.line=i;break}let l=e.line,c=!1;for(let u=0;u=e.line)throw new Error("block rule didn't increment state.line");break}if(!c)throw new Error("none of the block rules matched");e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),r=e.line,r0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],n={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(n),o};ta.prototype.scanDelims=function(e,t){let i=this.posMax,o=this.src.charCodeAt(e),n=e>0?this.src.charCodeAt(e-1):32,s=e;for(;s0)return!1;let i=e.pos,o=e.posMax;if(i+3>o||e.src.charCodeAt(i)!==58||e.src.charCodeAt(i+1)!==47||e.src.charCodeAt(i+2)!==47)return!1;let n=e.pending.match(QB);if(!n)return!1;let s=n[1],r=e.md.linkify.matchAtStart(e.src.slice(i-s.length));if(!r)return!1;let a=r.url;if(a.length<=s.length)return!1;a=a.replace(/\*+$/,"");let l=e.md.normalizeLink(a);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-s.length);let c=e.push("link_open","a",1);c.attrs=[["href",l]],c.markup="linkify",c.info="auto";let u=e.push("text","",0);u.content=e.md.normalizeLinkText(a);let d=e.push("link_close","a",-1);d.markup="linkify",d.info="auto"}return e.pos+=a.length-s.length,!0}function um(e,t){let i=e.pos;if(e.src.charCodeAt(i)!==10)return!1;let o=e.pending.length-1,n=e.posMax;if(!t)if(o>=0&&e.pending.charCodeAt(o)===32)if(o>=1&&e.pending.charCodeAt(o-1)===32){let s=o-1;for(;s>=1&&e.pending.charCodeAt(s-1)===32;)s--;e.pending=e.pending.slice(0,s),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(i++;i?@[]^_`{|}~-".split("").forEach(function(e){dm[e.charCodeAt(0)]=1});function hm(e,t){let i=e.pos,o=e.posMax;if(e.src.charCodeAt(i)!==92||(i++,i>=o))return!1;let n=e.src.charCodeAt(i);if(n===10){for(t||e.push("hardbreak","br",0),i++;i=55296&&n<=56319&&i+1=56320&&a<=57343&&(s+=e.src[i+1],i++)}let r="\\"+s;if(!t){let a=e.push("text_special","",0);n<256&&dm[n]!==0?a.content=s:a.content=r,a.markup=r,a.info="escape"}return e.pos=i+1,!0}function fm(e,t){let i=e.pos;if(e.src.charCodeAt(i)!==96)return!1;let n=i;i++;let s=e.posMax;for(;i=0;o--){let n=t[o];if(n.marker!==95&&n.marker!==42||n.end===-1)continue;let s=t[n.end],r=o>0&&t[o-1].end===n.end+1&&t[o-1].marker===n.marker&&t[o-1].token===n.token-1&&t[n.end+1].token===s.token+1,a=String.fromCharCode(n.marker),l=e.tokens[n.token];l.type=r?"strong_open":"em_open",l.tag=r?"strong":"em",l.nesting=1,l.markup=r?a+a:a,l.content="";let c=e.tokens[s.token];c.type=r?"strong_close":"em_close",c.tag=r?"strong":"em",c.nesting=-1,c.markup=r?a+a:a,c.content="",r&&(e.tokens[t[o-1].token].content="",e.tokens[t[n.end+1].token].content="",o--)}}function tO(e){let t=e.tokens_meta,i=e.tokens_meta.length;Ev(e,e.delimiters);for(let o=0;o=d)return!1;if(l=m,n=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),n.ok){for(r=e.md.normalizeLink(n.str),e.md.validateLink(r)?m=n.pos:r="",l=m;m=d||e.src.charCodeAt(m)!==41)&&(c=!0),m++}if(c){if(typeof e.env.references>"u")return!1;if(m=0?o=e.src.slice(l,m++):m=f+1):m=f+1,o||(o=e.src.slice(h,f)),s=e.env.references[Wo(o)],!s)return e.pos=u,!1;r=s.href,a=s.title}if(!t){e.pos=h,e.posMax=f;let g=e.push("link_open","a",1),b=[["href",r]];g.attrs=b,a&&b.push(["title",a]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=m,e.posMax=d,!0}function bm(e,t){let i,o,n,s,r,a,l,c,u="",d=e.pos,h=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;let f=e.pos+2,m=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(m<0)return!1;if(s=m+1,s=h)return!1;for(c=s,a=e.md.helpers.parseLinkDestination(e.src,s,e.posMax),a.ok&&(u=e.md.normalizeLink(a.str),e.md.validateLink(u)?s=a.pos:u=""),c=s;s=h||e.src.charCodeAt(s)!==41)return e.pos=d,!1;s++}else{if(typeof e.env.references>"u")return!1;if(s=0?n=e.src.slice(c,s++):s=m+1):s=m+1,n||(n=e.src.slice(f,m)),r=e.env.references[Wo(n)],!r)return e.pos=d,!1;u=r.href,l=r.title}if(!t){o=e.src.slice(f,m);let g=[];e.md.inline.parse(o,e.md,e.env,g);let b=e.push("image","img",0),k=[["src",u],["alt",""]];b.attrs=k,b.children=g,b.content=o,l&&k.push(["title",l])}return e.pos=s,e.posMax=h,!0}var iO=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,oO=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function wm(e,t){let i=e.pos;if(e.src.charCodeAt(i)!==60)return!1;let o=e.pos,n=e.posMax;for(;;){if(++i>=n)return!1;let r=e.src.charCodeAt(i);if(r===60)return!1;if(r===62)break}let s=e.src.slice(o+1,i);if(oO.test(s)){let r=e.md.normalizeLink(s);if(!e.md.validateLink(r))return!1;if(!t){let a=e.push("link_open","a",1);a.attrs=[["href",r]],a.markup="autolink",a.info="auto";let l=e.push("text","",0);l.content=e.md.normalizeLinkText(s);let c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=s.length+2,!0}if(iO.test(s)){let r=e.md.normalizeLink("mailto:"+s);if(!e.md.validateLink(r))return!1;if(!t){let a=e.push("link_open","a",1);a.attrs=[["href",r]],a.markup="autolink",a.info="auto";let l=e.push("text","",0);l.content=e.md.normalizeLinkText(s);let c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=s.length+2,!0}return!1}function nO(e){return/^\s]/i.test(e)}function sO(e){return/^<\/a\s*>/i.test(e)}function rO(e){let t=e|32;return t>=97&&t<=122}function ym(e,t){if(!e.md.options.html)return!1;let i=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==60||o+2>=i)return!1;let n=e.src.charCodeAt(o+1);if(n!==33&&n!==63&&n!==47&&!rO(n))return!1;let s=e.src.slice(o).match(vv);if(!s)return!1;if(!t){let r=e.push("html_inline","",0);r.content=s[0],nO(r.content)&&e.linkLevel++,sO(r.content)&&e.linkLevel--}return e.pos+=s[0].length,!0}var aO=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,lO=/^&([a-z][a-z0-9]{1,31});/i;function _m(e,t){let i=e.pos,o=e.posMax;if(e.src.charCodeAt(i)!==38||i+1>=o)return!1;if(e.src.charCodeAt(i+1)===35){let s=e.src.slice(i).match(aO);if(s){if(!t){let r=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),a=e.push("text_special","",0);a.content=Uc(r)?ea(r):ea(65533),a.markup=s[0],a.info="entity"}return e.pos+=s[0].length,!0}}else{let s=e.src.slice(i).match(lO);if(s){let r=no(s[0]);if(r!==s[0]){if(!t){let a=e.push("text_special","",0);a.content=r,a.markup=s[0],a.info="entity"}return e.pos+=s[0].length,!0}}}return!1}function Av(e){let t={},i=e.length;if(!i)return;let o=0,n=-2,s=[];for(let r=0;rl;c-=s[c]+1){let d=e[c];if(d.marker===a.marker&&d.open&&d.end<0){let h=!1;if((d.close||a.open)&&(d.length+a.length)%3===0&&(d.length%3!==0||a.length%3!==0)&&(h=!0),!h){let f=c>0&&!e[c-1].open?s[c-1]+1:0;s[r]=r-c+f,s[c]=f,a.open=!1,d.end=r,d.close=!1,u=-1,n=-2;break}}}u!==-1&&(t[a.marker][(a.open?3:0)+(a.length||0)%3]=u)}}function vm(e){let t=e.tokens_meta,i=e.tokens_meta.length;Av(e.delimiters);for(let o=0;o0&&o++,n[t].type==="text"&&t+1=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;r||e.pos++,s[t]=e.pos};ia.prototype.tokenize=function(e){let t=this.ruler.getRules(""),i=t.length,o=e.posMax,n=e.md.options.maxNesting;for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(r){if(e.pos>=o)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()};ia.prototype.parse=function(e,t,i,o){let n=new this.State(e,t,i,o);this.tokenize(n);let s=this.ruler2.getRules(""),r=s.length;for(let a=0;a|$))",t.tpl_email_fuzzy="(^|"+i+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|"+t.src_ZPCc+"))((?![$+<=>^`|\uFF5C])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|"+t.src_ZPCc+"))((?![$+<=>^`|\uFF5C])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function Tm(e){return Array.prototype.slice.call(arguments,1).forEach(function(i){i&&Object.keys(i).forEach(function(o){e[o]=i[o]})}),e}function Gc(e){return Object.prototype.toString.call(e)}function cO(e){return Gc(e)==="[object String]"}function uO(e){return Gc(e)==="[object Object]"}function dO(e){return Gc(e)==="[object RegExp]"}function Pv(e){return Gc(e)==="[object Function]"}function hO(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var Vv={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function fO(e){return Object.keys(e||{}).reduce(function(t,i){return t||Vv.hasOwnProperty(i)},!1)}var mO={"http:":{validate:function(e,t,i){let o=e.slice(t);return i.re.http||(i.re.http=new RegExp("^\\/\\/"+i.re.src_auth+i.re.src_host_port_strict+i.re.src_path,"i")),i.re.http.test(o)?o.match(i.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,i){let o=e.slice(t);return i.re.no_http||(i.re.no_http=new RegExp("^"+i.re.src_auth+"(?:localhost|(?:(?:"+i.re.src_domain+")\\.)+"+i.re.src_domain_root+")"+i.re.src_port+i.re.src_host_terminator+i.re.src_path,"i")),i.re.no_http.test(o)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o.match(i.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,i){let o=e.slice(t);return i.re.mailto||(i.re.mailto=new RegExp("^"+i.re.src_email_name+"@"+i.re.src_host_strict,"i")),i.re.mailto.test(o)?o.match(i.re.mailto)[0].length:0}}},gO="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",pO="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function bO(e){e.__index__=-1,e.__text_cache__=""}function wO(e){return function(t,i){let o=t.slice(i);return e.test(o)?o.match(e)[0].length:0}}function Rv(){return function(e,t){t.normalize(e)}}function Kc(e){let t=e.re=Sv(e.__opts__),i=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||i.push(gO),i.push(t.src_xn),t.src_tlds=i.join("|");function o(a){return a.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(o(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(o(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(o(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(o(t.tpl_host_fuzzy_test),"i");let n=[];e.__compiled__={};function s(a,l){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+l)}Object.keys(e.__schemas__).forEach(function(a){let l=e.__schemas__[a];if(l===null)return;let c={validate:null,link:null};if(e.__compiled__[a]=c,uO(l)){dO(l.validate)?c.validate=wO(l.validate):Pv(l.validate)?c.validate=l.validate:s(a,l),Pv(l.normalize)?c.normalize=l.normalize:l.normalize?s(a,l):c.normalize=Rv();return}if(cO(l)){n.push(a);return}s(a,l)}),n.forEach(function(a){e.__compiled__[e.__schemas__[a]]&&(e.__compiled__[a].validate=e.__compiled__[e.__schemas__[a]].validate,e.__compiled__[a].normalize=e.__compiled__[e.__schemas__[a]].normalize)}),e.__compiled__[""]={validate:null,normalize:Rv()};let r=Object.keys(e.__compiled__).filter(function(a){return a.length>0&&e.__compiled__[a]}).map(hO).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><\uFF5C]|"+t.src_ZPCc+"))("+r+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><\uFF5C]|"+t.src_ZPCc+"))("+r+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),bO(e)}function yO(e,t){let i=e.__index__,o=e.__last_index__,n=e.__text_cache__.slice(i,o);this.schema=e.__schema__.toLowerCase(),this.index=i+t,this.lastIndex=o+t,this.raw=n,this.text=n,this.url=n}function Em(e,t){let i=new yO(e,t);return e.__compiled__[i.schema].normalize(i,e),i}function gt(e,t){if(!(this instanceof gt))return new gt(e,t);t||fO(e)&&(t=e,e={}),this.__opts__=Tm({},Vv,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Tm({},mO,e),this.__compiled__={},this.__tlds__=pO,this.__tlds_replaced__=!1,this.re={},Kc(this)}gt.prototype.add=function(t,i){return this.__schemas__[t]=i,Kc(this),this};gt.prototype.set=function(t){return this.__opts__=Tm(this.__opts__,t),this};gt.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let i,o,n,s,r,a,l,c,u;if(this.re.schema_test.test(t)){for(l=this.re.schema_search,l.lastIndex=0;(i=l.exec(t))!==null;)if(s=this.testSchemaAt(t,i[2],l.lastIndex),s){this.__schema__=i[2],this.__index__=i.index+i[1].length,this.__last_index__=i.index+i[0].length+s;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=t.search(this.re.host_fuzzy_test),c>=0&&(this.__index__<0||c=0&&(n=t.match(this.re.email_fuzzy))!==null&&(r=n.index+n[1].length,a=n.index+n[0].length,(this.__index__<0||rthis.__last_index__)&&(this.__schema__="mailto:",this.__index__=r,this.__last_index__=a))),this.__index__>=0};gt.prototype.pretest=function(t){return this.re.pretest.test(t)};gt.prototype.testSchemaAt=function(t,i,o){return this.__compiled__[i.toLowerCase()]?this.__compiled__[i.toLowerCase()].validate(t,o,this):0};gt.prototype.match=function(t){let i=[],o=0;this.__index__>=0&&this.__text_cache__===t&&(i.push(Em(this,o)),o=this.__last_index__);let n=o?t.slice(o):t;for(;this.test(n);)i.push(Em(this,o)),n=n.slice(this.__last_index__),o+=this.__last_index__;return i.length?i:null};gt.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;let i=this.re.schema_at_start.exec(t);if(!i)return null;let o=this.testSchemaAt(t,i[2],i[0].length);return o?(this.__schema__=i[2],this.__index__=i.index+i[1].length,this.__last_index__=i.index+i[0].length+o,Em(this,0)):null};gt.prototype.tlds=function(t,i){return t=Array.isArray(t)?t:[t],i?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(o,n,s){return o!==s[n-1]}).reverse(),Kc(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,Kc(this),this)};gt.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};gt.prototype.onCompile=function(){};var Lv=gt;var _O=/^xn--/,vO=/[^\0-\x7F]/,kO=/[\x2E\u3002\uFF0E\uFF61]/g,CO={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Am=35,li=Math.floor,Im=String.fromCharCode;function so(e){throw new RangeError(CO[e])}function xO(e,t){let i=[],o=e.length;for(;o--;)i[o]=t(e[o]);return i}function Bv(e,t){let i=e.split("@"),o="";i.length>1&&(o=i[0]+"@",e=i[1]),e=e.replace(kO,".");let n=e.split("."),s=xO(n,t).join(".");return o+s}function Ov(e){let t=[],i=0,o=e.length;for(;i=55296&&n<=56319&&iString.fromCodePoint(...e),EO=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:36},Mv=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Dv=function(e,t,i){let o=0;for(e=i?li(e/700):e>>1,e+=li(e/t);e>Am*26>>1;o+=36)e=li(e/Am);return li(o+(Am+1)*e/(e+38))},Fv=function(e){let t=[],i=e.length,o=0,n=128,s=72,r=e.lastIndexOf("-");r<0&&(r=0);for(let a=0;a=128&&so("not-basic"),t.push(e.charCodeAt(a));for(let a=r>0?r+1:0;a=i&&so("invalid-input");let h=EO(e.charCodeAt(a++));h>=36&&so("invalid-input"),h>li((2147483647-o)/u)&&so("overflow"),o+=h*u;let f=d<=s?1:d>=s+26?26:d-s;if(hli(2147483647/m)&&so("overflow"),u*=m}let c=t.length+1;s=Dv(o-l,c,l==0),li(o/c)>2147483647-n&&so("overflow"),n+=li(o/c),o%=c,t.splice(o++,0,n)}return String.fromCodePoint(...t)},Nv=function(e){let t=[];e=Ov(e);let i=e.length,o=128,n=0,s=72;for(let l of e)l<128&&t.push(Im(l));let r=t.length,a=r;for(r&&t.push("-");a=o&&uli((2147483647-n)/c)&&so("overflow"),n+=(l-o)*c,o=l;for(let u of e)if(u2147483647&&so("overflow"),u===o){let d=n;for(let h=36;;h+=36){let f=h<=s?1:h>=s+26?26:h-s;if(d=0))try{t.hostname=Sm.toASCII(t.hostname)}catch{}return Lc(ps(t))}function BO(e){let t=Xr(e,!0);if(t.hostname&&(!t.protocol||Uv.indexOf(t.protocol)>=0))try{t.hostname=Sm.toUnicode(t.hostname)}catch{}return Yr(ps(t),Yr.defaultChars+"%")}function At(e,t){if(!(this instanceof At))return new At(e,t);t||Wc(e)||(t=e||{},e="default"),this.inline=new Iv,this.block=new Cv,this.core=new fv,this.renderer=new av,this.linkify=new Lv,this.validateLink=LO,this.normalizeLink=MO,this.normalizeLinkText=BO,this.utils=Of,this.helpers=ws({},zf),this.options={},this.configure(e),t&&this.set(t)}At.prototype.set=function(e){return ws(this.options,e),this};At.prototype.configure=function(e){let t=this;if(Wc(e)){let i=e;if(e=PO[i],!e)throw new Error('Wrong `markdown-it` preset "'+i+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(i){e.components[i].rules&&t[i].ruler.enableOnly(e.components[i].rules),e.components[i].rules2&&t[i].ruler2.enableOnly(e.components[i].rules2)}),this};At.prototype.enable=function(e,t){let i=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(n){i=i.concat(this[n].ruler.enable(e,!0))},this),i=i.concat(this.inline.ruler2.enable(e,!0));let o=e.filter(function(n){return i.indexOf(n)<0});if(o.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+o);return this};At.prototype.disable=function(e,t){let i=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(n){i=i.concat(this[n].ruler.disable(e,!0))},this),i=i.concat(this.inline.ruler2.disable(e,!0));let o=e.filter(function(n){return i.indexOf(n)<0});if(o.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+o);return this};At.prototype.use=function(e){let t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this};At.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");let i=new this.core.State(e,this,t);return this.core.process(i),i.tokens};At.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};At.prototype.parseInline=function(e,t){let i=new this.core.State(e,this,t);return i.inlineMode=!0,this.core.process(i),i.tokens};At.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};var Pm=At;var Jv=$m(Gv());/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. - */var Gv="data-original-src",UO=/^(#{1,3})(\d+|[A-Z][A-Z0-9_]*-\d+)(?!\w)/;function qO(e){if(!e.some(t=>t.type==="html_inline"&&t.content.startsWith("=0;t--){let i=e[t];if(i.type!=="html_inline")continue;let o=i.content;if(o.startsWith("0&&/[\w#]/.test(o[i-1]))return!1;let n=UO.exec(o.slice(i));if(!n)return!1;if(t)return e.pos=i+n[0].length,!0;if(qO(e.tokens))return!1;e.pos=i+n[0].length;let s=n[1].length,r=n[2],a=n[0],l=s===1?`${a}`:`${a}`,c=e.push("html_inline","",0);return c.content=l,!0}var jO=/(?:\\\[){3}([0-9]+):([^\\\n]+)(?:\\\]){3}/;function KO(e,t,i){let o=e.pos,n=e.src;if(n.charCodeAt(o)!==92)return!1;let s=n.slice(o),r=jO.exec(s);if(!r)return!1;if(t)return!0;let a=r[1],l=r[2],c=crypto.randomUUID(),u=Xt(i).wikiPageLinkMacro(a,l,c),d=e.push("html_inline","",0);return d.content=GO(c,u,a,l).outerHTML,e.pos=o+r[0].length,!0}function GO(e,t,i,o){let n=document.createElement("turbo-frame");return n.id=e,n.src=t,n.dataset.providerId=i,n.dataset.pageIdentifier=o,n.dataset.type="wiki-page-link",n}var ia=class{constructor(t){let i=t.editing.view.document;this._htmlDP=new kd(i),this._domConverter=new To(i),this.editor=t}toView(t){let i=Im({html:!0,breaks:!0,langPrefix:"language-"}),o=i.use(Kv.default,{label:!0});o.inline.ruler.before("text","op_workpackage_ref",$O),o.inline.ruler.before("text","op_wiki_page_link",(l,c)=>KO(l,c,this.editor));let n=o.renderer.rules.code_block;i.renderer.rules.code_block=function(l,c,u,d,h){return l[c].content=l[c].content.replace(/\n$/,""),n(l,c,u,d,h)};let s=o.render(t),r=this._htmlDP._toDom(s);return B5(r),F5(r),D5(r),N5(r),O5(r),this._domConverter.domToView(r)}toData(t){let i=this._domConverter.viewToDom(t,document);V5(i,["strong","em"],["pre","code","table"]),L5(i),M5(i);let o=function(r,a){if(a.tagName==="CODE"){let l=(a.getAttribute("class")||"").replace("language-",""),c=a.textContent||"";return"```"+l+` + */var Zv="data-original-src",KO=/^(#{1,3})(\d+|[A-Z][A-Z0-9_]*-\d+)(?!\w)/;function GO(e){if(!e.some(t=>t.type==="html_inline"&&t.content.startsWith("=0;t--){let i=e[t];if(i.type!=="html_inline")continue;let o=i.content;if(o.startsWith("0&&/[\w#]/.test(o[i-1]))return!1;let n=KO.exec(o.slice(i));if(!n)return!1;if(t)return e.pos=i+n[0].length,!0;if(GO(e.tokens))return!1;e.pos=i+n[0].length;let s=n[1].length,r=n[2],a=n[0],l=s===1?`${a}`:`${a}`,c=e.push("html_inline","",0);return c.content=l,!0}var ZO=/(?:\\\[){3}([0-9]+):([^\\\n]+)(?:\\\]){3}/;function QO(e,t,i){let o=e.pos,n=e.src;if(n.charCodeAt(o)!==92)return!1;let s=n.slice(o),r=ZO.exec(s);if(!r)return!1;if(t)return!0;let a=r[1],l=r[2],c=crypto.randomUUID(),u=ti(i).wikiPageLinkMacro(a,l,c),d=e.push("html_inline","",0);return d.content=YO(c,u,a,l).outerHTML,e.pos=o+r[0].length,!0}function YO(e,t,i,o){let n=document.createElement("turbo-frame");return n.id=e,n.src=t,n.dataset.providerId=i,n.dataset.pageIdentifier=o,n.dataset.type="wiki-page-link",n}var oa=class{constructor(t){let i=t.editing.view.document;this._htmlDP=new xd(i),this._domConverter=new Eo(i),this.editor=t}toView(t){let i=Pm({html:!0,breaks:!0,langPrefix:"language-"}),o=i.use(Jv.default,{label:!0});o.inline.ruler.before("text","op_workpackage_ref",JO),o.inline.ruler.before("text","op_wiki_page_link",(l,c)=>QO(l,c,this.editor));let n=o.renderer.rules.code_block;i.renderer.rules.code_block=function(l,c,u,d,h){return l[c].content=l[c].content.replace(/\n$/,""),n(l,c,u,d,h)};let s=o.render(t),r=this._htmlDP._toDom(s);return D5(r),z5(r),N5(r),H5(r),F5(r),this._domConverter.domToView(r)}toData(t){let i=this._domConverter.viewToDom(t,document);M5(i,["strong","em"],["pre","code","table"]),B5(i),O5(i);let o=function(r,a){if(a.tagName==="CODE"){let l=(a.getAttribute("class")||"").replace("language-",""),c=a.textContent||"";return"```"+l+` `+(c.length?c:` `)+"```\n"}else if(a.tagName==="PRE")return r;return a.isBlock?` -`:""},n=new R5({headingStyle:"atx",codeBlockStyle:"fenced",blankReplacement:o});return n.use([y5]),n.addRule("taskListItems",{filter:function(r){let a=r.type==="checkbox",l=r.parentNode&&r.parentNode.nodeName==="LI",c=r.parentNode&&r.parentNode.parentNode&&r.parentNode.parentNode.nodeName==="LI";return a&&(l||c)},replacement:function(r,a){return(a.checked?"[x]":"[ ]")+" "}}),n.addRule("orderedListItems",{filter:function(r){return r.nodeName!=="LI"?!1:!!r.closest("ol")},replacement:function(r,a,l){r=r.replace(/^\n+/,"").replace(/\n+$/,` +`:""},n=new L5({headingStyle:"atx",codeBlockStyle:"fenced",blankReplacement:o});return n.use([v5]),n.addRule("taskListItems",{filter:function(r){let a=r.type==="checkbox",l=r.parentNode&&r.parentNode.nodeName==="LI",c=r.parentNode&&r.parentNode.parentNode&&r.parentNode.parentNode.nodeName==="LI";return a&&(l||c)},replacement:function(r,a){return(a.checked?"[x]":"[ ]")+" "}}),n.addRule("orderedListItems",{filter:function(r){return r.nodeName!=="LI"?!1:!!r.closest("ol")},replacement:function(r,a,l){r=r.replace(/^\n+/,"").replace(/\n+$/,` `);var c=a.parentNode,u=l.bulletListMarker+" ",d=1;if(c.nodeName==="OL"){var h=c.getAttribute("start"),f=Array.prototype.indexOf.call(c.children,a);d=h?Number(h)+f:f+1,u=d+". "}var m=u.length,g=" ".repeat(m);return r=r.replace(/\n/gm,` `+g),u+r+(a.nextSibling&&!/\n$/.test(r)?` `:"")}}),n.addRule("imageFigure",{filter:"img",replacement:function(r,a){let l=a.parentElement;return l&&l.classList.contains("op-uc-figure--content")?l.parentElement.outerHTML:a.outerHTML}}),n.addRule("figcaption",{filter:"figcaption",replacement:function(r,a){return""}}),n.addRule("markdownTables",{filter:function(r){return r.nodeName==="TABLE"&&(!r.parentElement||r.parentElement.nodeName!=="FIGURE")},replacement:function(r,a){return a.outerHTML}}),n.addRule("htmlTables",{filter:function(r){let a=r.getElementsByTagName("table");return r.nodeName==="FIGURE"&&a.length},replacement:function(r,a){return a.querySelectorAll("td br[data-cke-filler]").forEach(l=>{l.nextElementSibling&&l.removeAttribute("data-cke-filler")}),a.outerHTML}}),n.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(r){return"~~"+r+"~~"}}),n.addRule("workPackageQuickinfo",{filter:r=>r.nodeName==="OPCE-MACRO-WP-QUICKINFO",replacement:(r,a)=>{let l=a.getAttribute("data-display-id")||a.getAttribute("data-id")||"";return l?a.getAttribute("data-detailed")==="true"?`###${l}`:`##${l}`:""}}),n.addRule("wikiPageLink",{filter:r=>r.nodeName==="TURBO-FRAME"&&r.getAttribute("data-type")==="wiki-page-link",replacement:(r,a)=>{let l=a.getAttribute("data-provider-id")||"",c=a.getAttribute("data-page-identifier")||"";return`\\[\\[\\[${l}:${c}\\]\\]\\]`}}),n.addRule("openProjectMacros",{filter:["macro"],replacement:(r,a)=>(a.innerHTML="",a.outerHTML.replace("",` -`))}),n.addRule("mentions",{filter:r=>r.nodeName==="MENTION"&&r.classList.contains("mention"),replacement:(r,a)=>a.getAttribute("data-type")==="work_package"?a.getAttribute("data-display-id")?a.outerHTML:a.getAttribute("data-text")||a.textContent||"":a.outerHTML}),n.addRule("emptyParagraphs",{filter:r=>r.nodeName==="P"&&(r.childNodes.length===0||r.childNodes.length===1&&r.childNodes[0].nodeName==="BR"),replacement:(r,a)=>!a.parentElement&&!a.nextSibling&&!a.previousSibling?"":a.childNodes.length===1&&Ic(a.childNodes[0])?Tf+` +`))}),n.addRule("mentions",{filter:r=>r.nodeName==="MENTION"&&r.classList.contains("mention"),replacement:(r,a)=>a.getAttribute("data-type")==="work_package"?a.getAttribute("data-display-id")?a.outerHTML:a.getAttribute("data-text")||a.textContent||"":a.outerHTML}),n.addRule("emptyParagraphs",{filter:r=>r.nodeName==="P"&&(r.childNodes.length===0||r.childNodes.length===1&&r.childNodes[0].nodeName==="BR"),replacement:(r,a)=>!a.parentElement&&!a.nextSibling&&!a.previousSibling?"":a.childNodes.length===1&&Pc(a.childNodes[0])?Af+` `:`
-`}),n.addRule("openProjectPageBreak",{filter:r=>r.nodeName==="DIV"&&r.classList.contains("page-break"),replacement:(r,a)=>Tf}),n.turndown(i).replace(/\u00A0/," ").replace(`###turndown-ignore### -`,"")}};function JO(e){return i=>{i.on("attribute:src:imageBlock",t,{priority:"highest"}),i.on("attribute:src:imageInline",t,{priority:"highest"})};function t(i,o,n){let s=o.attributeNewValue;if(!(s&&e.lookupDownloadLocationByName))return;let r=e.lookupDownloadLocationByName(s);o.attributeNewValue=r||s}}function ZO(e){return i=>{i.on("attribute:src:imageBlock",t,{priority:"highest"}),i.on("attribute:src:imageInline",t,{priority:"highest"})};function t(i,o,n){let s=o.attributeNewValue;if(!(s&&e.lookupDownloadLocationByName))return;let r=e.lookupDownloadLocationByName(s);o.attributeNewValue=r||s;let a=n.writer,l=n.mapper.toViewElement(o.item),c;o.item.name==="imageInline"?c=l:c=l.getChild(0),r&&a.setAttribute(Gv,s,c)}}var oa=class extends y{static get pluginName(){return"OpImageAttachmentLookup"}init(){let t=this.editor,i=t.conversion,o=Ji(t);i.for("editingDowncast").add(JO(o)),i.for("dataDowncast").add(ZO(o));let n=t.plugins.get("ImageUtils");n.decorate("setImageNaturalSizeAttributes"),n.on("setImageNaturalSizeAttributes",(s,[r])=>{console.log("model image element:",{element:r}),s.stop()},{priority:"highest"})}};/** +`}),n.addRule("openProjectPageBreak",{filter:r=>r.nodeName==="DIV"&&r.classList.contains("page-break"),replacement:(r,a)=>Af}),n.turndown(i).replace(/\u00A0/," ").replace(`###turndown-ignore### +`,"")}};function XO(e){return i=>{i.on("attribute:src:imageBlock",t,{priority:"highest"}),i.on("attribute:src:imageInline",t,{priority:"highest"})};function t(i,o,n){let s=o.attributeNewValue;if(!(s&&e.lookupDownloadLocationByName))return;let r=e.lookupDownloadLocationByName(s);o.attributeNewValue=r||s}}function eD(e){return i=>{i.on("attribute:src:imageBlock",t,{priority:"highest"}),i.on("attribute:src:imageInline",t,{priority:"highest"})};function t(i,o,n){let s=o.attributeNewValue;if(!(s&&e.lookupDownloadLocationByName))return;let r=e.lookupDownloadLocationByName(s);o.attributeNewValue=r||s;let a=n.writer,l=n.mapper.toViewElement(o.item),c;o.item.name==="imageInline"?c=l:c=l.getChild(0),r&&a.setAttribute(Zv,s,c)}}var na=class extends w{static get pluginName(){return"OpImageAttachmentLookup"}init(){let t=this.editor,i=t.conversion,o=Dt(t);i.for("editingDowncast").add(XO(o)),i.for("dataDowncast").add(eD(o));let n=t.plugins.get("ImageUtils");n.decorate("setImageNaturalSizeAttributes"),n.on("setImageNaturalSizeAttributes",(s,[r])=>{console.log("model image element:",{element:r}),s.stop()},{priority:"highest"})}};/** * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. - */function Pm(e){e.data.processor=new ia(e)}var Rm=` + */function Vm(e){e.data.processor=new oa(e)}var Lm=` -`;var Jv=` +`;var Qv=` -`;function Zv(e){return e.__currentlyDisabled=e.__currentlyDisabled||[],e.ui.view.toolbar?e.ui.view.toolbar.items._items:[]}function Qv(e,t){Zv(e).forEach(i=>{i===t||!Object.prototype.hasOwnProperty.call(i,"isEnabled")||(i.isEnabled?i.isEnabled=!1:e.__currentlyDisabled.push(i))})}function Yv(e){Zv(e).forEach(t=>{Object.prototype.hasOwnProperty.call(t,"isEnabled")&&e.__currentlyDisabled.indexOf(t)<0&&(t.isEnabled=!0)}),e.__currentlyDisabled=[]}var na=class extends y{static get pluginName(){return"OPSourceCode"}init(){let t=this.editor,i=!1,o={source:window.I18n.t("js.editor.mode.manual"),wysiwyg:window.I18n.t("js.editor.mode.wysiwyg")};t.ui.componentFactory.add("opShowSource",n=>{let s=new I(n);s.set({label:o.source,class:"",icon:Rm,tooltip:!0});let r=function(l){let u=t.ui.getEditableElement()?.parentElement;if(!u?.parentElement){console.error("Cannot show source: invalid editor structure");return}let d=document.createElement("div");d.className="ck-editor__source",Array.from(u.parentElement.children).filter(f=>f!==u&&f.classList.contains("ck-editor__source")).forEach(f=>f.remove()),u.style.display="none",u.parentElement.insertBefore(d,u.nextSibling),Qv(t,s),t.fire("op:source-code-enabled"),s.set({label:o.wysiwyg,class:"-source-enabled",icon:Jv,tooltip:!0})},a=function(){let c=t.ui.getEditableElement()?.parentElement;if(!c?.parentElement){console.error("Cannot hide source: invalid editor structure");return}t.fire("op:source-code-disabled"),Array.from(c.parentElement.children).filter(d=>d!==c&&d.classList.contains("ck-editor__source")).forEach(d=>d.remove()),c.style.display="",Yv(t),s.set({label:o.source,class:"",icon:Rm,tooltip:!0})};return s.on("execute",()=>{i?(i=!1,a()):(i=!0,r())}),s})}};/** +`;function Yv(e){return e.__currentlyDisabled=e.__currentlyDisabled||[],e.ui.view.toolbar?e.ui.view.toolbar.items._items:[]}function Xv(e,t){Yv(e).forEach(i=>{i===t||!Object.prototype.hasOwnProperty.call(i,"isEnabled")||(i.isEnabled?i.isEnabled=!1:e.__currentlyDisabled.push(i))})}function ek(e){Yv(e).forEach(t=>{Object.prototype.hasOwnProperty.call(t,"isEnabled")&&e.__currentlyDisabled.indexOf(t)<0&&(t.isEnabled=!0)}),e.__currentlyDisabled=[]}var sa=class extends w{static get pluginName(){return"OPSourceCode"}init(){let t=this.editor,i=!1,o={source:window.I18n.t("js.editor.mode.manual"),wysiwyg:window.I18n.t("js.editor.mode.wysiwyg")};t.ui.componentFactory.add("opShowSource",n=>{let s=new I(n);s.set({label:o.source,class:"",icon:Lm,tooltip:!0});let r=function(l){let u=t.ui.getEditableElement()?.parentElement;if(!u?.parentElement){console.error("Cannot show source: invalid editor structure");return}let d=document.createElement("div");d.className="ck-editor__source",Array.from(u.parentElement.children).filter(f=>f!==u&&f.classList.contains("ck-editor__source")).forEach(f=>f.remove()),u.style.display="none",u.parentElement.insertBefore(d,u.nextSibling),Xv(t,s),t.fire("op:source-code-enabled"),s.set({label:o.wysiwyg,class:"-source-enabled",icon:Qv,tooltip:!0})},a=function(){let c=t.ui.getEditableElement()?.parentElement;if(!c?.parentElement){console.error("Cannot hide source: invalid editor structure");return}t.fire("op:source-code-disabled"),Array.from(c.parentElement.children).filter(d=>d!==c&&d.classList.contains("ck-editor__source")).forEach(d=>d.remove()),c.style.display="",ek(t),s.set({label:o.source,class:"",icon:Lm,tooltip:!0})};return s.on("execute",()=>{i?(i=!1,a()):(i=!0,r())}),s})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Xv={"(":")","[":"]","{":"}"},XO=class extends M{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}refresh(){let e=this.editor.model,t=e.document;this.isEnabled=e.schema.checkAttributeInSelection(t.selection,"mention")}execute(e){let t=this.editor.model,i=t.document.selection,o=typeof e.mention=="string"?{id:e.mention}:e.mention,n=o.id,s=e.range||i.getFirstRange();if(!t.canEditAt(s))return;let r=e.text||n,a=ek({_text:r,id:n},o);if(!n.startsWith(e.marker))throw new p("mentioncommand-incorrect-id",this);t.change(l=>{let c=lt(i.getAttributes()),u=new Map(c.entries());u.set("mention",a);let d=t.insertContent(l.createText(r,u),s),h=d.start.nodeBefore,f=d.end.nodeAfter,m=f&&f.is("$text")&&f.data.startsWith(" "),g=!1;if(h&&f&&h.is("$text")&&f.is("$text")){let b=h.data.slice(-1),k=b in Xv,v=k&&f.data.startsWith(Xv[b]);g=k&&v}!g&&!m&&t.insertContent(l.createText(" ",c),s.start.getShiftedBy(r.length))})}};/** +*/var tk={"(":")","[":"]","{":"}"},oD=class extends M{constructor(e){super(e),this._isEnabledBasedOnSelection=!1}refresh(){let e=this.editor.model,t=e.document;this.isEnabled=e.schema.checkAttributeInSelection(t.selection,"mention")}execute(e){let t=this.editor.model,i=t.document.selection,o=typeof e.mention=="string"?{id:e.mention}:e.mention,n=o.id,s=e.range||i.getFirstRange();if(!t.canEditAt(s))return;let r=e.text||n,a=ik({_text:r,id:n},o);if(!n.startsWith(e.marker))throw new p("mentioncommand-incorrect-id",this);t.change(l=>{let c=lt(i.getAttributes()),u=new Map(c.entries());u.set("mention",a);let d=t.insertContent(l.createText(r,u),s),h=d.start.nodeBefore,f=d.end.nodeAfter,m=f&&f.is("$text")&&f.data.startsWith(" "),g=!1;if(h&&f&&h.is("$text")&&f.is("$text")){let b=h.data.slice(-1),k=b in tk,v=k&&f.data.startsWith(tk[b]);g=k&&v}!g&&!m&&t.insertContent(l.createText(" ",c),s.start.getShiftedBy(r.length))})}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var eD=class extends y{static get pluginName(){return"MentionEditing"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.model,i=t.document;t.schema.extend("$text",{allowAttributes:"mention"}),t.schema.addAttributeCheck(o=>{if(o.endsWith("codeBlock $text"))return!1},"mention"),e.conversion.for("upcast").elementToAttribute({view:{name:"span",attributes:"data-mention",classes:"mention"},model:{key:"mention",value:o=>tk(o)}}),e.conversion.for("downcast").attributeToElement({model:"mention",view:iD}),e.conversion.for("downcast").add(tD),i.registerPostFixer(o=>sD(o,i,t.schema)),i.registerPostFixer(o=>rD(o,i)),i.registerPostFixer(o=>oD(o,i)),e.commands.add("mention",new XO(e))}};function ek(e,t){return Object.assign({uid:ne().slice(0,8)},e,t||{})}function tk(e,t){let i=e.getAttribute("data-mention"),o=e.getChild(0);if(!o)return;let n=e.getAttribute("data-mention-uid");return ek({id:i,_text:o.data},n?{uid:n,...t}:t)}function tD(e){e.on("attribute:mention",(t,i,o)=>{let n=i.attributeNewValue;if(!i.item.is("$textProxy")||!n)return;let s=i.range.start;(s.textNode||s.nodeAfter).data!=n._text&&o.consumable.consume(i.item,t.name)},{priority:"highest"})}function iD(e,{writer:t,options:i}){if(e)return t.createAttributeElement("span",{class:"mention","data-mention":e.id,...!i.isClipboardPipeline&&{"data-mention-uid":e.uid}},{id:e.uid,priority:20})}function oD(e,t){let i=t.selection,o=i.focus;return i.isCollapsed&&i.hasAttribute("mention")&&nD(o)?(e.removeSelectionAttribute("mention"),!0):!1}function nD(e){let t=e.isAtStart;return e.nodeBefore&&e.nodeBefore.is("$text")||t}function sD(e,t,i){let o=t.differ.getChanges(),n=!1;for(let s of o){if(s.type=="attribute")continue;let r=s.position;if(s.name=="$text"){let a=r.textNode&&r.textNode.nextSibling;n=qo(r.textNode,e)||n,n=qo(a,e)||n,n=qo(r.nodeBefore,e)||n,n=qo(r.nodeAfter,e)||n}if(s.name!="$text"&&s.type=="insert"){let a=r.nodeAfter;for(let l of e.createRangeIn(a).getItems())n=qo(l,e)||n}if(s.type=="insert"&&i.isInline(s.name)){let a=r.nodeAfter&&r.nodeAfter.nextSibling;n=qo(r.nodeBefore,e)||n,n=qo(a,e)||n}}return n}function rD(e,t){let i=t.differ.getChanges(),o=!1;for(let n of i)if(n.type==="attribute"&&n.attributeKey!="mention"){let s=n.range.start.nodeBefore,r=n.range.end.nodeAfter;for(let a of[s,r])ik(a)&&a.getAttribute(n.attributeKey)!=n.attributeNewValue&&(e.setAttribute(n.attributeKey,n.attributeNewValue,a),o=!0)}return o}function ik(e){return!e||!(e.is("$text")||e.is("$textProxy"))||!e.hasAttribute("mention")?!1:e.data!=e.getAttribute("mention")._text}function qo(e,t){return ik(e)?(t.removeAttribute("mention",e),!0):!1}/** +*/var nD=class extends w{static get pluginName(){return"MentionEditing"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.model,i=t.document;t.schema.extend("$text",{allowAttributes:"mention"}),t.schema.addAttributeCheck(o=>{if(o.endsWith("codeBlock $text"))return!1},"mention"),e.conversion.for("upcast").elementToAttribute({view:{name:"span",attributes:"data-mention",classes:"mention"},model:{key:"mention",value:o=>ok(o)}}),e.conversion.for("downcast").attributeToElement({model:"mention",view:rD}),e.conversion.for("downcast").add(sD),i.registerPostFixer(o=>cD(o,i,t.schema)),i.registerPostFixer(o=>uD(o,i)),i.registerPostFixer(o=>aD(o,i)),e.commands.add("mention",new oD(e))}};function ik(e,t){return Object.assign({uid:ne().slice(0,8)},e,t||{})}function ok(e,t){let i=e.getAttribute("data-mention"),o=e.getChild(0);if(!o)return;let n=e.getAttribute("data-mention-uid");return ik({id:i,_text:o.data},n?{uid:n,...t}:t)}function sD(e){e.on("attribute:mention",(t,i,o)=>{let n=i.attributeNewValue;if(!i.item.is("$textProxy")||!n)return;let s=i.range.start;(s.textNode||s.nodeAfter).data!=n._text&&o.consumable.consume(i.item,t.name)},{priority:"highest"})}function rD(e,{writer:t,options:i}){if(e)return t.createAttributeElement("span",{class:"mention","data-mention":e.id,...!i.isClipboardPipeline&&{"data-mention-uid":e.uid}},{id:e.uid,priority:20})}function aD(e,t){let i=t.selection,o=i.focus;return i.isCollapsed&&i.hasAttribute("mention")&&lD(o)?(e.removeSelectionAttribute("mention"),!0):!1}function lD(e){let t=e.isAtStart;return e.nodeBefore&&e.nodeBefore.is("$text")||t}function cD(e,t,i){let o=t.differ.getChanges(),n=!1;for(let s of o){if(s.type=="attribute")continue;let r=s.position;if(s.name=="$text"){let a=r.textNode&&r.textNode.nextSibling;n=qo(r.textNode,e)||n,n=qo(a,e)||n,n=qo(r.nodeBefore,e)||n,n=qo(r.nodeAfter,e)||n}if(s.name!="$text"&&s.type=="insert"){let a=r.nodeAfter;for(let l of e.createRangeIn(a).getItems())n=qo(l,e)||n}if(s.type=="insert"&&i.isInline(s.name)){let a=r.nodeAfter&&r.nodeAfter.nextSibling;n=qo(r.nodeBefore,e)||n,n=qo(a,e)||n}}return n}function uD(e,t){let i=t.differ.getChanges(),o=!1;for(let n of i)if(n.type==="attribute"&&n.attributeKey!="mention"){let s=n.range.start.nodeBefore,r=n.range.end.nodeAfter;for(let a of[s,r])nk(a)&&a.getAttribute(n.attributeKey)!=n.attributeNewValue&&(e.setAttribute(n.attributeKey,n.attributeNewValue,a),o=!0)}return o}function nk(e){return!e||!(e.is("$text")||e.is("$textProxy"))||!e.hasAttribute("mention")?!1:e.data!=e.getAttribute("mention")._text}function qo(e,t){return nk(e)?(t.removeAttribute("mention",e),!0):!1}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var aD=class extends vi{selected;position;constructor(e){super(e),this.extendTemplate({attributes:{class:["ck-mentions"],tabindex:"-1"}})}selectFirst(){this.select(0)}selectNext(){let e=this.selected,t=this.items.getIndex(e);this.select(t+1)}selectPrevious(){let e=this.selected,t=this.items.getIndex(e);this.select(t-1)}select(e){let t=0;e>0&&e0&&e{n?(this.domElement.classList.add("ck-on"),this.domElement.classList.remove("ck-off")):(this.domElement.classList.add("ck-off"),this.domElement.classList.remove("ck-on"))}),this.listenTo(this.domElement,"click",()=>{this.fire("execute")})}render(){super.render(),this.element=this.domElement}focus(){this.domElement.focus()}};/** +*/var hD=class extends R{domElement;constructor(e,t){super(e),this.template=void 0,this.domElement=t,this.domElement.classList.add("ck-button","ck-list-item-button"),this.set("isOn",!1),this.on("change:isOn",(i,o,n)=>{n?(this.domElement.classList.add("ck-on"),this.domElement.classList.remove("ck-off")):(this.domElement.classList.add("ck-off"),this.domElement.classList.remove("ck-on"))}),this.listenTo(this.domElement,"click",()=>{this.fire("execute")})}render(){super.render(),this.element=this.domElement}focus(){this.domElement.focus()}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var cD=class extends ot{item;marker;constructor(e){super(e);let t=this.bindTemplate;this.set("isHighlighted",!1),this.extendTemplate({attributes:{class:[t.if("isHighlighted","ck-mentions__item_focused")]}})}highlight(){this.isHighlighted=!0}removeHighlight(){this.isHighlighted=!1}};/** +*/var fD=class extends ot{item;marker;constructor(e){super(e);let t=this.bindTemplate;this.set("isHighlighted",!1),this.extendTemplate({attributes:{class:[t.if("isHighlighted","ck-mentions__item_focused")]}})}highlight(){this.isHighlighted=!0}removeHighlight(){this.isHighlighted=!1}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Kc=3,uD=[O.arrowup,O.arrowdown,O.esc],dD=[O.enter,O.tab],hD=class extends y{_mentionsView;_mentionsConfigurations;_balloon;_items=new J;_lastRequested;_requestFeedDebounced;static get pluginName(){return"MentionUI"}static get isOfficialPlugin(){return!0}static get requires(){return[re]}constructor(e){super(e),this._mentionsView=this._createMentionView(),this._mentionsConfigurations=new Map,this._requestFeedDebounced=ye(this._requestFeed,100),e.config.define("mention",{feeds:[]})}init(){let e=this.editor,t=e.config.get("mention.commitKeys")||dD,i=uD.concat(t);this._balloon=e.plugins.get(re),e.editing.view.document.on("keydown",(s,r)=>{n(r.keyCode)&&this._isUIVisible&&(r.preventDefault(),s.stop(),r.keyCode==O.arrowdown&&this._mentionsView.selectNext(),r.keyCode==O.arrowup&&this._mentionsView.selectPrevious(),t.includes(r.keyCode)&&this._mentionsView.executeSelected(),r.keyCode==O.esc&&this._hideUIAndRemoveMarker())},{priority:"highest"}),vt({emitter:this._mentionsView,activator:()=>this._isUIVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideUIAndRemoveMarker()});let o=e.config.get("mention.feeds");for(let s of o){let{feed:r,marker:a,dropdownLimit:l}=s;if(!yD(a))throw new p("mentionconfig-incorrect-marker",null,{marker:a});let c={marker:a,feedCallback:typeof r=="function"?r.bind(this.editor):pD(r),itemRenderer:s.itemRenderer,dropdownLimit:l};this._mentionsConfigurations.set(a,c)}this._setupTextWatcher(o),this.listenTo(e,"change:isReadOnly",()=>{this._hideUIAndRemoveMarker()}),this.on("requestFeed:response",(s,r)=>this._handleFeedResponse(r)),this.on("requestFeed:error",()=>this._hideUIAndRemoveMarker());function n(s){return i.includes(s)}}destroy(){super.destroy(),this._mentionsView.destroy()}get _isUIVisible(){return this._balloon.visibleView===this._mentionsView}_createMentionView(){let e=this.editor.locale,t=new aD(e);return t.items.bindTo(this._items).using(i=>{let{item:o,marker:n}=i,{dropdownLimit:s}=this._mentionsConfigurations.get(n),r=s||this.editor.config.get("mention.dropdownLimit")||10;if(t.items.length>=r)return null;let a=new cD(e),l=this._renderItem(o,n);return l.delegate("execute").to(a),a.children.add(l),a.item=o,a.marker=n,a.on("execute",()=>{t.fire("execute",{item:o,marker:n})}),a}),t.on("execute",(i,o)=>{let n=this.editor,s=n.model,r=o.item,a=o.marker,l=n.model.markers.get("mention"),c=s.createPositionAt(s.document.selection.focus),u=s.createPositionAt(l.getStart()),d=s.createRange(u,c);this._hideUIAndRemoveMarker(),n.execute("mention",{mention:r,text:r.text,marker:a,range:d}),n.editing.view.focus()}),t}_getItemRenderer(e){let{itemRenderer:t}=this._mentionsConfigurations.get(e);return t}_requestFeed(e,t){this._lastRequested=t;let{feedCallback:i}=this._mentionsConfigurations.get(e),o=i(t);if(!(o instanceof Promise)){this.fire("requestFeed:response",{feed:o,marker:e,feedText:t});return}o.then(n=>{this._lastRequested==t?this.fire("requestFeed:response",{feed:n,marker:e,feedText:t}):this.fire("requestFeed:discarded",{feed:n,marker:e,feedText:t})}).catch(n=>{this.fire("requestFeed:error",{error:n}),D("mention-feed-callback-error",{marker:e})})}_setupTextWatcher(e){let t=this.editor,i=e.map(s=>({...s,pattern:nk(s.marker,s.minimumCharacters||0)})),o=new Fl(t.model,mD(i));o.on("matched",(s,r)=>{let a=ok(i,r.text),l=t.model.document.selection.focus,c=t.model.createPositionAt(l.parent,a.position);if(bD(l)||wD(c)){this._hideUIAndRemoveMarker();return}let u=gD(a,r.text),d=a.marker.length+u.length,h=l.getShiftedBy(-d),f=l.getShiftedBy(-u.length),m=t.model.createRange(h,f);if(Vm(t)){let g=t.model.markers.get("mention");t.model.change(b=>{b.updateMarker(g,{range:m})})}else t.model.change(g=>{g.addMarker("mention",{range:m,usingOperation:!1,affectsData:!1})});this._requestFeedDebounced(a.marker,u)}),o.on("unmatched",()=>{this._hideUIAndRemoveMarker()});let n=t.commands.get("mention");return o.bind("isEnabled").to(n),o}_handleFeedResponse(e){let{feed:t,marker:i}=e;if(!Vm(this.editor))return;if(!this.editor.commands.get("mention").isEnabled){this._hideUIAndRemoveMarker();return}this._items.clear();for(let n of t){let s=typeof n!="object"?{id:n,text:n}:n;this._items.add({item:s,marker:i})}let o=this.editor.model.markers.get("mention");this._items.length?this._showOrUpdateUI(o):this._hideUIAndRemoveMarker()}_showOrUpdateUI(e){this._isUIVisible?this._balloon.updatePosition(this._getBalloonPanelPositionData(e,this._mentionsView.position)):this._balloon.add({view:this._mentionsView,position:this._getBalloonPanelPositionData(e,this._mentionsView.position),singleViewMode:!0,balloonClassName:"ck-mention-balloon"}),this._mentionsView.position=this._balloon.view.position,this._mentionsView.selectFirst()}_hideUIAndRemoveMarker(){this._balloon.hasView(this._mentionsView)&&this._balloon.remove(this._mentionsView),Vm(this.editor)&&this.editor.model.change(e=>e.removeMarker("mention")),this._mentionsView.position=void 0}_renderItem(e,t){let i=this.editor,o,n=e.id,s=this._getItemRenderer(t);if(s){let r=s(e);typeof r!="string"?o=new lD(i.locale,r):n=r}if(!o){let r=new ji(i.locale);r.label=n,r.withText=!0,o=r}return o}_getBalloonPanelPositionData(e,t){let i=this.editor,o=i.editing,n=o.view.domConverter,s=o.mapper,r=i.locale.uiLanguageDirection;return{target:()=>{let a=e.getRange();a.start.root.rootName=="$graveyard"&&(a=i.model.document.selection.getFirstRange());let l=s.toViewRange(a);return F.getDomRangeRects(n.viewRangeToDom(l)).pop()},limiter:()=>{let a=this.editor.editing.view,l=a.document.selection.editableElement;return l?a.domConverter.mapViewToDom(l.root):null},positions:fD(t,r)}}};function fD(e,t){let i={caret_se:(o,n,s)=>({top:o.bottom+Kc,left:Gc(o.right,n,s),name:"caret_se",config:{withArrow:!1}}),caret_ne:(o,n,s)=>({top:o.top-n.height-Kc,left:Gc(o.right,n,s),name:"caret_ne",config:{withArrow:!1}}),caret_sw:(o,n,s)=>({top:o.bottom+Kc,left:Gc(o.right-n.width,n,s),name:"caret_sw",config:{withArrow:!1}}),caret_nw:(o,n,s)=>({top:o.top-n.height-Kc,left:Gc(o.right-n.width,n,s),name:"caret_nw",config:{withArrow:!1}})};return Object.prototype.hasOwnProperty.call(i,e)?[i[e]]:t!=="rtl"?[i.caret_se,i.caret_sw,i.caret_ne,i.caret_nw]:[i.caret_sw,i.caret_se,i.caret_nw,i.caret_ne]}function Gc(e,t,i){return Math.max(i.left,Math.min(e,i.right-t.width))}function ok(e,t){let i;for(let o of e){let n=t.lastIndexOf(o.marker);n>0&&!t.substring(n-1).match(o.pattern)||(!i||n>=i.position)&&(i={marker:o.marker,position:n,minimumCharacters:o.minimumCharacters,pattern:o.pattern})}return i}function nk(e,t){let i=t==0?"*":`{${t},}`,o=V.features.isRegExpUnicodePropertySupported?`\\p{Ps}\\p{Pi}"'`:`\\(\\[{"'`,n="[^#@]";e=e.replace(/[.*+?^${}()\-|[\]\\]/g,"\\$&");let s=`(?:^|[ ${o}])(${e})(${n}${i})$`;return new RegExp(s,"u")}function mD(e){return i=>{let o=ok(e,i);if(!o)return!1;let n=0;o.position!==0&&(n=o.position-1);let s=i.substring(n);return o.pattern.test(s)}}function gD(e,t){let i=0;e.position!==0&&(i=e.position-1);let o=nk(e.marker,0);return t.substring(i).match(o)[2]}function pD(e){return t=>e.filter(i=>(typeof i=="string"?i:String(i.id)).toLowerCase().includes(t.toLowerCase()))}function bD(e){let t=e.textNode&&e.textNode.hasAttribute("mention"),i=e.nodeBefore;return t||i&&i.is("$text")&&i.hasAttribute("mention")}function wD(e){let t=e.nodeAfter;return t&&t.is("$text")&&t.hasAttribute("mention")}function yD(e){return!!e}function Vm(e){return e.model.markers.has("mention")}/** +*/var Jc=3,mD=[O.arrowup,O.arrowdown,O.esc],gD=[O.enter,O.tab],pD=class extends w{_mentionsView;_mentionsConfigurations;_balloon;_items=new G;_lastRequested;_requestFeedDebounced;static get pluginName(){return"MentionUI"}static get isOfficialPlugin(){return!0}static get requires(){return[re]}constructor(e){super(e),this._mentionsView=this._createMentionView(),this._mentionsConfigurations=new Map,this._requestFeedDebounced=ve(this._requestFeed,100),e.config.define("mention",{feeds:[]})}init(){let e=this.editor,t=e.config.get("mention.commitKeys")||gD,i=mD.concat(t);this._balloon=e.plugins.get(re),e.editing.view.document.on("keydown",(s,r)=>{n(r.keyCode)&&this._isUIVisible&&(r.preventDefault(),s.stop(),r.keyCode==O.arrowdown&&this._mentionsView.selectNext(),r.keyCode==O.arrowup&&this._mentionsView.selectPrevious(),t.includes(r.keyCode)&&this._mentionsView.executeSelected(),r.keyCode==O.esc&&this._hideUIAndRemoveMarker())},{priority:"highest"}),kt({emitter:this._mentionsView,activator:()=>this._isUIVisible,contextElements:()=>[this._balloon.view.element],callback:()=>this._hideUIAndRemoveMarker()});let o=e.config.get("mention.feeds");for(let s of o){let{feed:r,marker:a,dropdownLimit:l}=s;if(!CD(a))throw new p("mentionconfig-incorrect-marker",null,{marker:a});let c={marker:a,feedCallback:typeof r=="function"?r.bind(this.editor):_D(r),itemRenderer:s.itemRenderer,dropdownLimit:l};this._mentionsConfigurations.set(a,c)}this._setupTextWatcher(o),this.listenTo(e,"change:isReadOnly",()=>{this._hideUIAndRemoveMarker()}),this.on("requestFeed:response",(s,r)=>this._handleFeedResponse(r)),this.on("requestFeed:error",()=>this._hideUIAndRemoveMarker());function n(s){return i.includes(s)}}destroy(){super.destroy(),this._mentionsView.destroy()}get _isUIVisible(){return this._balloon.visibleView===this._mentionsView}_createMentionView(){let e=this.editor.locale,t=new dD(e);return t.items.bindTo(this._items).using(i=>{let{item:o,marker:n}=i,{dropdownLimit:s}=this._mentionsConfigurations.get(n),r=s||this.editor.config.get("mention.dropdownLimit")||10;if(t.items.length>=r)return null;let a=new fD(e),l=this._renderItem(o,n);return l.delegate("execute").to(a),a.children.add(l),a.item=o,a.marker=n,a.on("execute",()=>{t.fire("execute",{item:o,marker:n})}),a}),t.on("execute",(i,o)=>{let n=this.editor,s=n.model,r=o.item,a=o.marker,l=n.model.markers.get("mention"),c=s.createPositionAt(s.document.selection.focus),u=s.createPositionAt(l.getStart()),d=s.createRange(u,c);this._hideUIAndRemoveMarker(),n.execute("mention",{mention:r,text:r.text,marker:a,range:d}),n.editing.view.focus()}),t}_getItemRenderer(e){let{itemRenderer:t}=this._mentionsConfigurations.get(e);return t}_requestFeed(e,t){this._lastRequested=t;let{feedCallback:i}=this._mentionsConfigurations.get(e),o=i(t);if(!(o instanceof Promise)){this.fire("requestFeed:response",{feed:o,marker:e,feedText:t});return}o.then(n=>{this._lastRequested==t?this.fire("requestFeed:response",{feed:n,marker:e,feedText:t}):this.fire("requestFeed:discarded",{feed:n,marker:e,feedText:t})}).catch(n=>{this.fire("requestFeed:error",{error:n}),D("mention-feed-callback-error",{marker:e})})}_setupTextWatcher(e){let t=this.editor,i=e.map(s=>({...s,pattern:rk(s.marker,s.minimumCharacters||0)})),o=new Nl(t.model,wD(i));o.on("matched",(s,r)=>{let a=sk(i,r.text),l=t.model.document.selection.focus,c=t.model.createPositionAt(l.parent,a.position);if(vD(l)||kD(c)){this._hideUIAndRemoveMarker();return}let u=yD(a,r.text),d=a.marker.length+u.length,h=l.getShiftedBy(-d),f=l.getShiftedBy(-u.length),m=t.model.createRange(h,f);if(Mm(t)){let g=t.model.markers.get("mention");t.model.change(b=>{b.updateMarker(g,{range:m})})}else t.model.change(g=>{g.addMarker("mention",{range:m,usingOperation:!1,affectsData:!1})});this._requestFeedDebounced(a.marker,u)}),o.on("unmatched",()=>{this._hideUIAndRemoveMarker()});let n=t.commands.get("mention");return o.bind("isEnabled").to(n),o}_handleFeedResponse(e){let{feed:t,marker:i}=e;if(!Mm(this.editor))return;if(!this.editor.commands.get("mention").isEnabled){this._hideUIAndRemoveMarker();return}this._items.clear();for(let n of t){let s=typeof n!="object"?{id:n,text:n}:n;this._items.add({item:s,marker:i})}let o=this.editor.model.markers.get("mention");this._items.length?this._showOrUpdateUI(o):this._hideUIAndRemoveMarker()}_showOrUpdateUI(e){this._isUIVisible?this._balloon.updatePosition(this._getBalloonPanelPositionData(e,this._mentionsView.position)):this._balloon.add({view:this._mentionsView,position:this._getBalloonPanelPositionData(e,this._mentionsView.position),singleViewMode:!0,balloonClassName:"ck-mention-balloon"}),this._mentionsView.position=this._balloon.view.position,this._mentionsView.selectFirst()}_hideUIAndRemoveMarker(){this._balloon.hasView(this._mentionsView)&&this._balloon.remove(this._mentionsView),Mm(this.editor)&&this.editor.model.change(e=>e.removeMarker("mention")),this._mentionsView.position=void 0}_renderItem(e,t){let i=this.editor,o,n=e.id,s=this._getItemRenderer(t);if(s){let r=s(e);typeof r!="string"?o=new hD(i.locale,r):n=r}if(!o){let r=new Gi(i.locale);r.label=n,r.withText=!0,o=r}return o}_getBalloonPanelPositionData(e,t){let i=this.editor,o=i.editing,n=o.view.domConverter,s=o.mapper,r=i.locale.uiLanguageDirection;return{target:()=>{let a=e.getRange();a.start.root.rootName=="$graveyard"&&(a=i.model.document.selection.getFirstRange());let l=s.toViewRange(a);return F.getDomRangeRects(n.viewRangeToDom(l)).pop()},limiter:()=>{let a=this.editor.editing.view,l=a.document.selection.editableElement;return l?a.domConverter.mapViewToDom(l.root):null},positions:bD(t,r)}}};function bD(e,t){let i={caret_se:(o,n,s)=>({top:o.bottom+Jc,left:Zc(o.right,n,s),name:"caret_se",config:{withArrow:!1}}),caret_ne:(o,n,s)=>({top:o.top-n.height-Jc,left:Zc(o.right,n,s),name:"caret_ne",config:{withArrow:!1}}),caret_sw:(o,n,s)=>({top:o.bottom+Jc,left:Zc(o.right-n.width,n,s),name:"caret_sw",config:{withArrow:!1}}),caret_nw:(o,n,s)=>({top:o.top-n.height-Jc,left:Zc(o.right-n.width,n,s),name:"caret_nw",config:{withArrow:!1}})};return Object.prototype.hasOwnProperty.call(i,e)?[i[e]]:t!=="rtl"?[i.caret_se,i.caret_sw,i.caret_ne,i.caret_nw]:[i.caret_sw,i.caret_se,i.caret_nw,i.caret_ne]}function Zc(e,t,i){return Math.max(i.left,Math.min(e,i.right-t.width))}function sk(e,t){let i;for(let o of e){let n=t.lastIndexOf(o.marker);n>0&&!t.substring(n-1).match(o.pattern)||(!i||n>=i.position)&&(i={marker:o.marker,position:n,minimumCharacters:o.minimumCharacters,pattern:o.pattern})}return i}function rk(e,t){let i=t==0?"*":`{${t},}`,o=V.features.isRegExpUnicodePropertySupported?`\\p{Ps}\\p{Pi}"'`:`\\(\\[{"'`,n="[^#@]";e=e.replace(/[.*+?^${}()\-|[\]\\]/g,"\\$&");let s=`(?:^|[ ${o}])(${e})(${n}${i})$`;return new RegExp(s,"u")}function wD(e){return i=>{let o=sk(e,i);if(!o)return!1;let n=0;o.position!==0&&(n=o.position-1);let s=i.substring(n);return o.pattern.test(s)}}function yD(e,t){let i=0;e.position!==0&&(i=e.position-1);let o=rk(e.marker,0);return t.substring(i).match(o)[2]}function _D(e){return t=>e.filter(i=>(typeof i=="string"?i:String(i.id)).toLowerCase().includes(t.toLowerCase()))}function vD(e){let t=e.textNode&&e.textNode.hasAttribute("mention"),i=e.nodeBefore;return t||i&&i.is("$text")&&i.hasAttribute("mention")}function kD(e){let t=e.nodeAfter;return t&&t.is("$text")&&t.hasAttribute("mention")}function CD(e){return!!e}function Mm(e){return e.model.markers.has("mention")}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var sk=class extends y{toMentionAttribute(e,t){return tk(e,t)}static get pluginName(){return"Mention"}static get isOfficialPlugin(){return!0}static get requires(){return[eD,hD]}};/** +*/var ak=class extends w{toMentionAttribute(e,t){return ok(e,t)}static get pluginName(){return"Mention"}static get isOfficialPlugin(){return!0}static get requires(){return[nD,pD]}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var _D=/^#{2,3}/;function Jc(e){if(e.getAttribute("data-type")!=="work_package")return!1;let t=e.getAttribute("data-text");return!!t&&_D.test(t)}function rk(e){let t=Re(e),i=e.editing.view,o=i.document;i.addObserver(ll),e.listenTo(o,"click",(s,r)=>{if(r.domTarget.nodeName==="A"&&r.domTarget.classList.contains("mention")){let a=document.createElement("a");a.target="_blank",a.href=r.domTarget.attributes.href.value,a.click()}}),e.conversion.for("upcast").elementToAttribute({view:{name:"mention",key:"data-mention",classes:"mention"},model:{key:"mention",value:s=>{let r=s.getAttribute("data-id"),a=s.getAttribute("data-display-id"),l=s.getAttribute("data-type"),c=s.getAttribute("data-text");if(Jc(s))return null;let u=n(a||r,l);return e.plugins.get("Mention").toMentionAttribute(s,{dataId:r,dataDisplayId:a,link:u,text:c,type:l})}},converterPriority:"high"}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",key:"data-mention",classes:"mention"},model:{key:"mention",value:s=>{let a=[...s.getChildren()][0],l=a&&a.data;if(l){let c=`[Invalid mention: ${l}]`;a._data=c}}},converterPriority:"high"}),e.conversion.for("editingDowncast").attributeToElement({model:"mention",converterPriority:"high",view:(s,{writer:r})=>s?s.type==="emoji"?r.createAttributeElement("span"):r.createAttributeElement("a",{class:"mention",href:s.link,"data-mention":s.text,title:s.text}):void 0}),e.conversion.for("dataDowncast").attributeToElement({model:"mention",converterPriority:"high",view:(s,{writer:r})=>{if(!s)return;if(s.type==="emoji")return r.createAttributeElement("span");let a={class:"mention","data-id":s.dataId,"data-type":s.type,"data-text":s.text};return s.dataDisplayId&&(a["data-display-id"]=s.dataDisplayId),r.createAttributeElement("mention",a)}});function n(s,r){let a=t.services.apiV3Service[`${r}s`].segment;return`${window.OpenProject.urlRoot}/${a}/${s}`}}var sa=class extends y{get config(){let t="op-uc-",i=[`${t}container`,`${t}container_editing`],o={paragraph:`${t}p`,heading1:`${t}h1`,heading2:`${t}h2`,heading3:`${t}h3`,heading4:`${t}h4`,heading5:`${t}h5`,heading6:`${t}h6`,blockQuote:`${t}blockquote`,figure:`${t}figure`,table:`${t}table`,thead:`${t}table--head`,tr:`${t}table--row`,td:`${t}table--cell`,th:[`${t}table--cell`,`${t}table--cell_head`],tableCell:`${t}table--cell`,tableRow:`${t}table--row`,ol:`${t}list`,ul:`${t}list`,list:`${t}list`,todo:`${t}list ${t}list_task-list`,listItem:`${t}list--item`,li:`${t}list--item`,imageInline:`${t}image ${t}image_inline`,imageBlock:`${t}image`,img:`${t}image`,codeblock:`${t}code-block`,caption:`${t}figure--description`,"op-macro-embedded-table":[`${t}placeholder`,`${t}embedded-table`],"op-macro-wp-button":[`${t}placeholder`,`${t}wp-button`],"op-macro-child-pages":[`${t}placeholder`,`${t}child-pages`],"op-macro-toc":[`${t}placeholder`,`${t}toc`],content:`${t}figure--content`},n={code:`${t}code`,linkHref:`${t}link`,alignment:`${t}figure_align-`,tableAlignment:`${t}figure_align-`,todo:`${t}list_task-list`,numbered:`${t}list`,bulleted:`${t}list`,listType:null,headingColumns:null,width:null,uploadStatus:null};return{preFix:t,editorClasses:i,elementsWithCustomClassesMap:o,attributesWithCustomClassesMap:n,alignmentValuesMap:{left:"start",right:"end",blockLeft:"start",blockRight:"end",center:"center",default:"center"}}}init(){this._addCustomCSSClassesToTheEditorContainer(this.editor),this._addCustomCSSClassesToElements(this.config),this._addCustomCSSClassesToAttributes(this.config)}_addCustomCSSClassesToTheEditorContainer(t){t.sourceElement.classList.add(...this.config.editorClasses)}_addCustomCSSClassesToElements(t){this.editor.model.schema.extend("table",{allowAttributes:["figureClasses"]}),this.editor.conversion.for("upcast").add(i=>i.on("element:table",this._manageTableUpcast(t)),{priority:"high"}),this.editor.conversion.for("downcast").add(i=>i.on("insert",this._manageElementsInsertion(t),{priority:"low"}))}_addCustomCSSClassesToAttributes(t){this.editor.conversion.for("downcast").add(i=>i.on("attribute",this._manageAttributesInsertion(t),{priority:"low"}))}_manageTableUpcast(t){return(i,o,n)=>{let s=n.writer,r=o.viewItem,a=o.modelRange,l=a&&a.start.nodeAfter;if(!l)return;let c=l.getAttribute("figureClasses")||[],u=r.parent.getClassNames&&r.parent.getClassNames(),d=u?[...u].filter(g=>!!g):[];c=[...c,...d];let h=d.filter(g=>g.startsWith(t.attributesWithCustomClassesMap.alignment))[0],f=h&&h.replace(t.attributesWithCustomClassesMap.alignment,"")||t.alignmentValuesMap.default,m=Object.keys(t.alignmentValuesMap).find(g=>t.alignmentValuesMap[g]===f)||"center";if(!h){let g=`${t.attributesWithCustomClassesMap.alignment}${f}`;c=[...c,g]}s.setAttribute("figureClasses",c,l),m==="center"?s.setAttribute("alignment",null,l):s.setAttribute("alignment",m,l)}}_manageElementsInsertion(t){return(i,o,n)=>{let s=Object.keys(t.elementsWithCustomClassesMap),r=n.writer,a=o.item.name,l=o.item,c=n.mapper.toViewElement(l),u=[c],h=["imageBlock","table","tableCell","tableRow","listItem"].includes(a);if(!(!s.includes(a)||!c)){if(h)if(a==="listItem")u=this._manageListItems(r,l,c,u,t);else{let f=c,m=Array.from(r.createRangeIn(c).getItems());if(a==="imageBlock"){let g=m.find(b=>b.is("element","img"));this._wrapInFigureContentContainer(g,f,t,r),u=[...u,g]}else if(a==="table"||a==="tableRow"){let g=m.filter(b=>s.includes(b.name));if(u=[...u,...g],a==="table"&&!l.getAttribute("tableAlignment")){let k=`${t.attributesWithCustomClassesMap.alignment}${t.alignmentValuesMap.default}`;r.addClass(k,f)}}}u.forEach(f=>{let m=h?f.name:a,g=t.elementsWithCustomClassesMap[m];r.addClass(g,f)})}}}_manageAttributesInsertion(t){return(i,o,n)=>{let s=Object.keys(t.attributesWithCustomClassesMap),r=o.attributeKey,a=n.writer,l=o.item,c=n.mapper.toViewElement(l);if(s.includes(r)){if(r==="linkHref"||r==="code"){let u=r==="linkHref"?"a":r,d=r==="linkHref"?5:10,h=a.document.selection,f=a.createAttributeElement(u,{class:t.attributesWithCustomClassesMap[r]},{priority:d});l.is("selection")?a.wrap(h.getFirstRange(),f):a.wrap(n.mapper.toViewRange(o.range),f)}else if(r==="tableAlignment"){let u=c,d=t.alignmentValuesMap[o.attributeNewValue]||t.alignmentValuesMap.default;Array.from(new Set(Object.values(t.alignmentValuesMap))).map(f=>`${t.attributesWithCustomClassesMap[r]}${f}`).filter(f=>u.hasClass(f)).forEach(f=>a.removeClass(f,u)),u.hasStyle("float")&&a.removeStyle("float",u),a.addClass(`${t.attributesWithCustomClassesMap[r]}${d}`,u)}else if(r==="listType")this._manageListItems(a,l,c,[c],t).forEach(d=>{let h=d.name,f=t.elementsWithCustomClassesMap[h];a.addClass(f,d)});else if(r==="headingColumns"){let u=o.attributeNewValue,h=Array.from(a.createRangeIn(c).getItems()).filter(f=>Object.keys(t.elementsWithCustomClassesMap).includes(f.name));u?h.forEach(f=>{let m=f.name,g=t.elementsWithCustomClassesMap[m];a.addClass(g,f)}):h.filter(f=>f.hasClass(t.elementsWithCustomClassesMap.th[1])).forEach(f=>{let m=f.nextSibling;m&&m.name!=="th"&&a.removeClass(t.elementsWithCustomClassesMap.th[1],f)})}else if(r==="width")c.hasClass("image_resized")&&a.removeClass("image_resized",c);else if(r==="uploadStatus"&&o.attributeNewValue==="complete"){let d=Array.from(a.createRangeIn(c).getItems()).find(h=>h.hasClass("ck-upload-placeholder-loader"));d&&a.remove(a.createRangeOn(d))}}}}_manageListItems(t,i,o,n,s){let r=o.findAncestor("li"),a=o.findAncestor(/^(ul|ol)$/);if(!a)return n;let l=i.getAttribute("listType"),c=s.attributesWithCustomClassesMap[l];if(l==="todo")t.addClass(c,a);else{let u=s.attributesWithCustomClassesMap.todo;a.hasClass(u)&&t.removeClass(u,a)}return[...n,a,r]}_wrapInFigureContentContainer(t,i,o,n){let s=n.createContainerElement("div",{class:o.elementsWithCustomClassesMap.content});n.insert(n.createPositionAt(s,0),t),n.insert(n.createPositionAt(i,0),s)}};/** +*/var xD=/^#{2,3}/;function Qc(e){if(e.getAttribute("data-type")!=="work_package")return!1;let t=e.getAttribute("data-text");return!!t&&xD.test(t)}function lk(e){let t=ge(e),i=e.editing.view,o=i.document;i.addObserver(cl),e.listenTo(o,"click",(s,r)=>{if(r.domTarget.nodeName==="A"&&r.domTarget.classList.contains("mention")){let a=document.createElement("a");a.target="_blank",a.href=r.domTarget.attributes.href.value,a.click()}}),e.conversion.for("upcast").elementToAttribute({view:{name:"mention",key:"data-mention",classes:"mention"},model:{key:"mention",value:s=>{let r=s.getAttribute("data-id"),a=s.getAttribute("data-display-id"),l=s.getAttribute("data-type"),c=s.getAttribute("data-text");if(Qc(s))return null;let u=n(a||r,l);return e.plugins.get("Mention").toMentionAttribute(s,{dataId:r,dataDisplayId:a,link:u,text:c,type:l})}},converterPriority:"high"}),e.conversion.for("upcast").elementToAttribute({view:{name:"span",key:"data-mention",classes:"mention"},model:{key:"mention",value:s=>{let a=[...s.getChildren()][0],l=a&&a.data;if(l){let c=`[Invalid mention: ${l}]`;a._data=c}}},converterPriority:"high"}),e.conversion.for("editingDowncast").attributeToElement({model:"mention",converterPriority:"high",view:(s,{writer:r})=>s?s.type==="emoji"?r.createAttributeElement("span"):r.createAttributeElement("a",{class:"mention",href:s.link,"data-mention":s.text,title:s.text}):void 0}),e.conversion.for("dataDowncast").attributeToElement({model:"mention",converterPriority:"high",view:(s,{writer:r})=>{if(!s)return;if(s.type==="emoji")return r.createAttributeElement("span");let a={class:"mention","data-id":s.dataId,"data-type":s.type,"data-text":s.text};return s.dataDisplayId&&(a["data-display-id"]=s.dataDisplayId),r.createAttributeElement("mention",a)}});function n(s,r){let a=t.services.apiV3Service[`${r}s`].segment;return`${window.OpenProject.urlRoot}/${a}/${s}`}}var ra=class extends w{get config(){let t="op-uc-",i=[`${t}container`,`${t}container_editing`],o={paragraph:`${t}p`,heading1:`${t}h1`,heading2:`${t}h2`,heading3:`${t}h3`,heading4:`${t}h4`,heading5:`${t}h5`,heading6:`${t}h6`,blockQuote:`${t}blockquote`,figure:`${t}figure`,table:`${t}table`,thead:`${t}table--head`,tr:`${t}table--row`,td:`${t}table--cell`,th:[`${t}table--cell`,`${t}table--cell_head`],tableCell:`${t}table--cell`,tableRow:`${t}table--row`,ol:`${t}list`,ul:`${t}list`,list:`${t}list`,todo:`${t}list ${t}list_task-list`,listItem:`${t}list--item`,li:`${t}list--item`,imageInline:`${t}image ${t}image_inline`,imageBlock:`${t}image`,img:`${t}image`,codeblock:`${t}code-block`,caption:`${t}figure--description`,"op-macro-embedded-table":[`${t}placeholder`,`${t}embedded-table`],"op-macro-wp-button":[`${t}placeholder`,`${t}wp-button`],"op-macro-child-pages":[`${t}placeholder`,`${t}child-pages`],"op-macro-toc":[`${t}placeholder`,`${t}toc`],content:`${t}figure--content`},n={code:`${t}code`,linkHref:`${t}link`,alignment:`${t}figure_align-`,tableAlignment:`${t}figure_align-`,todo:`${t}list_task-list`,numbered:`${t}list`,bulleted:`${t}list`,listType:null,headingColumns:null,width:null,uploadStatus:null};return{preFix:t,editorClasses:i,elementsWithCustomClassesMap:o,attributesWithCustomClassesMap:n,alignmentValuesMap:{left:"start",right:"end",blockLeft:"start",blockRight:"end",center:"center",default:"center"}}}init(){this._addCustomCSSClassesToTheEditorContainer(this.editor),this._addCustomCSSClassesToElements(this.config),this._addCustomCSSClassesToAttributes(this.config)}_addCustomCSSClassesToTheEditorContainer(t){t.sourceElement.classList.add(...this.config.editorClasses)}_addCustomCSSClassesToElements(t){this.editor.model.schema.extend("table",{allowAttributes:["figureClasses"]}),this.editor.conversion.for("upcast").add(i=>i.on("element:table",this._manageTableUpcast(t)),{priority:"high"}),this.editor.conversion.for("downcast").add(i=>i.on("insert",this._manageElementsInsertion(t),{priority:"low"}))}_addCustomCSSClassesToAttributes(t){this.editor.conversion.for("downcast").add(i=>i.on("attribute",this._manageAttributesInsertion(t),{priority:"low"}))}_manageTableUpcast(t){return(i,o,n)=>{let s=n.writer,r=o.viewItem,a=o.modelRange,l=a&&a.start.nodeAfter;if(!l)return;let c=l.getAttribute("figureClasses")||[],u=r.parent.getClassNames&&r.parent.getClassNames(),d=u?[...u].filter(g=>!!g):[];c=[...c,...d];let h=d.filter(g=>g.startsWith(t.attributesWithCustomClassesMap.alignment))[0],f=h&&h.replace(t.attributesWithCustomClassesMap.alignment,"")||t.alignmentValuesMap.default,m=Object.keys(t.alignmentValuesMap).find(g=>t.alignmentValuesMap[g]===f)||"center";if(!h){let g=`${t.attributesWithCustomClassesMap.alignment}${f}`;c=[...c,g]}s.setAttribute("figureClasses",c,l),m==="center"?s.setAttribute("alignment",null,l):s.setAttribute("alignment",m,l)}}_manageElementsInsertion(t){return(i,o,n)=>{let s=Object.keys(t.elementsWithCustomClassesMap),r=n.writer,a=o.item.name,l=o.item,c=n.mapper.toViewElement(l),u=[c],h=["imageBlock","table","tableCell","tableRow","listItem"].includes(a);if(!(!s.includes(a)||!c)){if(h)if(a==="listItem")u=this._manageListItems(r,l,c,u,t);else{let f=c,m=Array.from(r.createRangeIn(c).getItems());if(a==="imageBlock"){let g=m.find(b=>b.is("element","img"));this._wrapInFigureContentContainer(g,f,t,r),u=[...u,g]}else if(a==="table"||a==="tableRow"){let g=m.filter(b=>s.includes(b.name));if(u=[...u,...g],a==="table"&&!l.getAttribute("tableAlignment")){let k=`${t.attributesWithCustomClassesMap.alignment}${t.alignmentValuesMap.default}`;r.addClass(k,f)}}}u.forEach(f=>{let m=h?f.name:a,g=t.elementsWithCustomClassesMap[m];r.addClass(g,f)})}}}_manageAttributesInsertion(t){return(i,o,n)=>{let s=Object.keys(t.attributesWithCustomClassesMap),r=o.attributeKey,a=n.writer,l=o.item,c=n.mapper.toViewElement(l);if(s.includes(r)){if(r==="linkHref"||r==="code"){let u=r==="linkHref"?"a":r,d=r==="linkHref"?5:10,h=a.document.selection,f=a.createAttributeElement(u,{class:t.attributesWithCustomClassesMap[r]},{priority:d});l.is("selection")?a.wrap(h.getFirstRange(),f):a.wrap(n.mapper.toViewRange(o.range),f)}else if(r==="tableAlignment"){let u=c,d=t.alignmentValuesMap[o.attributeNewValue]||t.alignmentValuesMap.default;Array.from(new Set(Object.values(t.alignmentValuesMap))).map(f=>`${t.attributesWithCustomClassesMap[r]}${f}`).filter(f=>u.hasClass(f)).forEach(f=>a.removeClass(f,u)),u.hasStyle("float")&&a.removeStyle("float",u),a.addClass(`${t.attributesWithCustomClassesMap[r]}${d}`,u)}else if(r==="listType")this._manageListItems(a,l,c,[c],t).forEach(d=>{let h=d.name,f=t.elementsWithCustomClassesMap[h];a.addClass(f,d)});else if(r==="headingColumns"){let u=o.attributeNewValue,h=Array.from(a.createRangeIn(c).getItems()).filter(f=>Object.keys(t.elementsWithCustomClassesMap).includes(f.name));u?h.forEach(f=>{let m=f.name,g=t.elementsWithCustomClassesMap[m];a.addClass(g,f)}):h.filter(f=>f.hasClass(t.elementsWithCustomClassesMap.th[1])).forEach(f=>{let m=f.nextSibling;m&&m.name!=="th"&&a.removeClass(t.elementsWithCustomClassesMap.th[1],f)})}else if(r==="width")c.hasClass("image_resized")&&a.removeClass("image_resized",c);else if(r==="uploadStatus"&&o.attributeNewValue==="complete"){let d=Array.from(a.createRangeIn(c).getItems()).find(h=>h.hasClass("ck-upload-placeholder-loader"));d&&a.remove(a.createRangeOn(d))}}}}_manageListItems(t,i,o,n,s){let r=o.findAncestor("li"),a=o.findAncestor(/^(ul|ol)$/);if(!a)return n;let l=i.getAttribute("listType"),c=s.attributesWithCustomClassesMap[l];if(l==="todo")t.addClass(c,a);else{let u=s.attributesWithCustomClassesMap.todo;a.hasClass(u)&&t.removeClass(u,a)}return[...n,a,r]}_wrapInFigureContentContainer(t,i,o,n){let s=n.createContainerElement("div",{class:o.elementsWithCustomClassesMap.content});n.insert(n.createPositionAt(s,0),t),n.insert(n.createPositionAt(i,0),s)}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var vD=class extends M{refresh(){let e=this.editor.model,t=e.schema,i=e.document.selection;this.isEnabled=kD(i,t,e)}execute(){let e=this.editor.model;e.change(t=>{let i=t.createElement("pageBreak");e.insertObject(i,null,null,{setSelection:"after"})})}};function kD(e,t,i){let o=CD(e,i);return t.checkChild(o,"pageBreak")}function CD(e,t){let i=es(e,t).start.parent;return i.isEmpty&&!i.is("rootElement")?i.parent:i}/** +*/var TD=class extends M{refresh(){let e=this.editor.model,t=e.schema,i=e.document.selection;this.isEnabled=ED(i,t,e)}execute(){let e=this.editor.model;e.change(t=>{let i=t.createElement("pageBreak");e.insertObject(i,null,null,{setSelection:"after"})})}};function ED(e,t,i){let o=AD(e,i);return t.checkChild(o,"pageBreak")}function AD(e,t){let i=es(e,t).start.parent;return i.isEmpty&&!i.is("rootElement")?i.parent:i}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var xD=class extends y{static get pluginName(){return"PageBreakEditing"}static get licenseFeatureCode(){return"PB"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}init(){let e=this.editor,t=e.model.schema,i=e.t,o=e.conversion;t.register("pageBreak",{inheritAllFrom:"$blockObject"}),o.for("dataDowncast").elementToStructure({model:"pageBreak",view:(n,{writer:s})=>s.createContainerElement("div",{class:"page-break",style:"page-break-after: always"},s.createContainerElement("span",{style:"display: none"}))}),o.for("editingDowncast").elementToStructure({model:"pageBreak",view:(n,{writer:s})=>{let r=i("Page break"),a=s.createContainerElement("div"),l=s.createRawElement("span",{class:"page-break__label"},function(c){c.innerText=i("Page break")});return s.addClass("page-break",a),s.insert(s.createPositionAt(a,0),l),TD(a,s,r)}}),o.for("upcast").elementToElement({view:n=>{let s=n.getStyle("page-break-before")=="always",r=n.getStyle("page-break-after")=="always";if(!s&&!r)return null;if(n.childCount==1){let a=n.getChild(0);if(!a.is("element","span")||a.getStyle("display")!="none")return null}else if(n.childCount>1)return null;return{name:!0,styles:[...s?["page-break-before"]:[],...r?["page-break-after"]:[]],...n.hasClass("page-break")&&{classes:["page-break"]}}},model:"pageBreak",converterPriority:"high"}),e.commands.add("pageBreak",new vD(e))}};function TD(e,t,i){return t.setCustomProperty("pageBreak",!0,e),me(e,t,{label:i})}/** +*/var ID=class extends w{static get pluginName(){return"PageBreakEditing"}static get licenseFeatureCode(){return"PB"}static get isOfficialPlugin(){return!0}static get isPremiumPlugin(){return!0}init(){let e=this.editor,t=e.model.schema,i=e.t,o=e.conversion;t.register("pageBreak",{inheritAllFrom:"$blockObject"}),o.for("dataDowncast").elementToStructure({model:"pageBreak",view:(n,{writer:s})=>s.createContainerElement("div",{class:"page-break",style:"page-break-after: always"},s.createContainerElement("span",{style:"display: none"}))}),o.for("editingDowncast").elementToStructure({model:"pageBreak",view:(n,{writer:s})=>{let r=i("Page break"),a=s.createContainerElement("div"),l=s.createRawElement("span",{class:"page-break__label"},function(c){c.innerText=i("Page break")});return s.addClass("page-break",a),s.insert(s.createPositionAt(a,0),l),SD(a,s,r)}}),o.for("upcast").elementToElement({view:n=>{let s=n.getStyle("page-break-before")=="always",r=n.getStyle("page-break-after")=="always";if(!s&&!r)return null;if(n.childCount==1){let a=n.getChild(0);if(!a.is("element","span")||a.getStyle("display")!="none")return null}else if(n.childCount>1)return null;return{name:!0,styles:[...s?["page-break-before"]:[],...r?["page-break-after"]:[]],...n.hasClass("page-break")&&{classes:["page-break"]}}},model:"pageBreak",converterPriority:"high"}),e.commands.add("pageBreak",new TD(e))}};function SD(e,t,i){return t.setCustomProperty("pageBreak",!0,e),me(e,t,{label:i})}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var ED=class extends y{static get pluginName(){return"PageBreakUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor;e.ui.componentFactory.add("pageBreak",()=>{let t=this._createButton(I);return t.set({tooltip:!0}),t}),e.ui.componentFactory.add("menuBar:pageBreak",()=>this._createButton(oe))}_createButton(e){let t=this.editor,i=t.locale,o=t.commands.get("pageBreak"),n=new e(t.locale),s=i.t;return n.set({label:s("Page break"),icon:eb}),n.bind("isEnabled").to(o,"isEnabled"),this.listenTo(n,"execute",()=>{t.execute("pageBreak"),t.editing.view.focus()}),n}};/** +*/var PD=class extends w{static get pluginName(){return"PageBreakUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor;e.ui.componentFactory.add("pageBreak",()=>{let t=this._createButton(I);return t.set({tooltip:!0}),t}),e.ui.componentFactory.add("menuBar:pageBreak",()=>this._createButton(oe))}_createButton(e){let t=this.editor,i=t.locale,o=t.commands.get("pageBreak"),n=new e(t.locale),s=i.t;return n.set({label:s("Page break"),icon:ib}),n.bind("isEnabled").to(o,"isEnabled"),this.listenTo(n,"execute",()=>{t.execute("pageBreak"),t.editing.view.focus()}),n}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var ak=class extends y{static get requires(){return[xD,ED,Pe]}static get pluginName(){return"PageBreak"}static get isOfficialPlugin(){return!0}};/** +*/var ck=class extends w{static get requires(){return[ID,PD,Re]}static get pluginName(){return"PageBreak"}static get isOfficialPlugin(){return!0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -2647,16 +2648,16 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var AD=class extends M{refresh(){let e=this.editor.model,t=e.schema,i=e.document.selection;this.isEnabled=ID(i,t,e)}execute(){let e=this.editor.model;e.change(t=>{let i=t.createElement("horizontalLine");e.insertObject(i,null,null,{setSelection:"after"})})}};function ID(e,t,i){let o=SD(e,i);return t.checkChild(o,"horizontalLine")}function SD(e,t){let i=es(e,t).start.parent;return i.isEmpty&&!i.is("rootElement")?i.parent:i}/** +*/var RD=class extends M{refresh(){let e=this.editor.model,t=e.schema,i=e.document.selection;this.isEnabled=VD(i,t,e)}execute(){let e=this.editor.model;e.change(t=>{let i=t.createElement("horizontalLine");e.insertObject(i,null,null,{setSelection:"after"})})}};function VD(e,t,i){let o=LD(e,i);return t.checkChild(o,"horizontalLine")}function LD(e,t){let i=es(e,t).start.parent;return i.isEmpty&&!i.is("rootElement")?i.parent:i}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var PD=class extends y{static get pluginName(){return"HorizontalLineEditing"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.model.schema,i=e.t,o=e.conversion;t.register("horizontalLine",{inheritAllFrom:"$blockObject"}),o.for("dataDowncast").elementToElement({model:"horizontalLine",view:(n,{writer:s})=>s.createEmptyElement("hr")}),o.for("editingDowncast").elementToStructure({model:"horizontalLine",view:(n,{writer:s})=>{let r=i("Horizontal line"),a=s.createContainerElement("div",null,s.createEmptyElement("hr"));return s.addClass("ck-horizontal-line",a),s.setCustomProperty("hr",!0,a),RD(a,s,r)}}),o.for("upcast").elementToElement({view:"hr",model:"horizontalLine"}),e.commands.add("horizontalLine",new AD(e))}};function RD(e,t,i){return t.setCustomProperty("horizontalLine",!0,e),me(e,t,{label:i})}/** +*/var MD=class extends w{static get pluginName(){return"HorizontalLineEditing"}static get isOfficialPlugin(){return!0}init(){let e=this.editor,t=e.model.schema,i=e.t,o=e.conversion;t.register("horizontalLine",{inheritAllFrom:"$blockObject"}),o.for("dataDowncast").elementToElement({model:"horizontalLine",view:(n,{writer:s})=>s.createEmptyElement("hr")}),o.for("editingDowncast").elementToStructure({model:"horizontalLine",view:(n,{writer:s})=>{let r=i("Horizontal line"),a=s.createContainerElement("div",null,s.createEmptyElement("hr"));return s.addClass("ck-horizontal-line",a),s.setCustomProperty("hr",!0,a),BD(a,s,r)}}),o.for("upcast").elementToElement({view:"hr",model:"horizontalLine"}),e.commands.add("horizontalLine",new RD(e))}};function BD(e,t,i){return t.setCustomProperty("horizontalLine",!0,e),me(e,t,{label:i})}/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var VD=class extends y{static get pluginName(){return"HorizontalLineUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor;e.ui.componentFactory.add("horizontalLine",()=>{let t=this._createButton(I);return t.set({tooltip:!0}),t}),e.ui.componentFactory.add("menuBar:horizontalLine",()=>this._createButton(oe))}_createButton(e){let t=this.editor,i=t.locale,o=t.commands.get("horizontalLine"),n=new e(t.locale),s=i.t;return n.set({label:s("Horizontal line"),icon:H1}),n.bind("isEnabled").to(o,"isEnabled"),this.listenTo(n,"execute",()=>{t.execute("horizontalLine"),t.editing.view.focus()}),n}};/** +*/var OD=class extends w{static get pluginName(){return"HorizontalLineUI"}static get isOfficialPlugin(){return!0}init(){let e=this.editor;e.ui.componentFactory.add("horizontalLine",()=>{let t=this._createButton(I);return t.set({tooltip:!0}),t}),e.ui.componentFactory.add("menuBar:horizontalLine",()=>this._createButton(oe))}_createButton(e){let t=this.editor,i=t.locale,o=t.commands.get("horizontalLine"),n=new e(t.locale),s=i.t;return n.set({label:s("Horizontal line"),icon:U1}),n.bind("isEnabled").to(o,"isEnabled"),this.listenTo(n,"execute",()=>{t.execute("horizontalLine"),t.editing.view.focus()}),n}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var lk=class extends y{static get requires(){return[PD,VD,Pe]}static get pluginName(){return"HorizontalLine"}static get isOfficialPlugin(){return!0}};/** +*/var uk=class extends w{static get requires(){return[MD,OD,Re]}static get pluginName(){return"HorizontalLine"}static get isOfficialPlugin(){return!0}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options *//** @@ -2665,11 +2666,11 @@ Original error: ${i.name}: ${i.message}`:"";return e+s+r+a}function U0(e,t){let *//** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Zc=class extends y{adapter;_debouncedSave;_lastDocumentVersion;_savePromise;_domEmitter;_config;_pendingActions;_makeImmediateSave;_action=null;static get pluginName(){return"Autosave"}static get isOfficialPlugin(){return!0}static get requires(){return[Bn]}constructor(e){super(e);let t=e.config.get("autosave")||{},i=t.waitingTime||1e3;this.set("state","synchronized"),this._debouncedSave=ye(this._save.bind(this),i),this._lastDocumentVersion=e.model.document.version,this._savePromise=null,this._domEmitter=new(pe()),this._config=t,this._pendingActions=e.plugins.get(Bn),this._makeImmediateSave=!1}init(){let e=this.editor,t=e.model.document;this.listenTo(e,"ready",()=>{this.listenTo(t,"change:data",(i,o)=>{this._saveCallbacks.length&&o.isLocal&&(this.state==="synchronized"&&(this.state="waiting",this._setPendingAction()),this.state==="waiting"&&this._debouncedSave())})}),this.listenTo(e,"destroy",()=>this._flush(),{priority:"highest"});/* v8 ignore next -- @preserve */this._domEmitter.listenTo(window,"beforeunload",(i,o)=>{this._pendingActions.hasAny&&(o.returnValue=this._pendingActions.first.message)})}destroy(){this._domEmitter.stopListening(),super.destroy()}save(){return this._debouncedSave.cancel(),this._save()}_flush(){this._debouncedSave.flush()}_save(){return this._savePromise?(this._makeImmediateSave=this.editor.model.document.version>this._lastDocumentVersion,this._savePromise):(this._setPendingAction(),this.state="saving",this._lastDocumentVersion=this.editor.model.document.version,this._savePromise=Promise.resolve().then(()=>Promise.all(this._saveCallbacks.map(e=>e(this.editor)))).finally(()=>{this._savePromise=null}).then(()=>{if(this._makeImmediateSave)return this._makeImmediateSave=!1,this._save();this.editor.model.document.version>this._lastDocumentVersion?(this.state="waiting",this._debouncedSave()):(this.state="synchronized",this._pendingActions.remove(this._action),this._action=null)}).catch(e=>{throw this.state="error",this.state="saving",this._debouncedSave(),e}),this._savePromise)}_setPendingAction(){let e=this.editor.t;this._action||(this._action=this._pendingActions.add(e("Saving changes")))}get _saveCallbacks(){let e=[];return this.adapter&&this.adapter.save&&e.push(this.adapter.save),this._config.save&&e.push(this._config.save),e}};/** +*/var Yc=class extends w{adapter;_debouncedSave;_lastDocumentVersion;_savePromise;_domEmitter;_config;_pendingActions;_makeImmediateSave;_action=null;static get pluginName(){return"Autosave"}static get isOfficialPlugin(){return!0}static get requires(){return[Bn]}constructor(e){super(e);let t=e.config.get("autosave")||{},i=t.waitingTime||1e3;this.set("state","synchronized"),this._debouncedSave=ve(this._save.bind(this),i),this._lastDocumentVersion=e.model.document.version,this._savePromise=null,this._domEmitter=new(be()),this._config=t,this._pendingActions=e.plugins.get(Bn),this._makeImmediateSave=!1}init(){let e=this.editor,t=e.model.document;this.listenTo(e,"ready",()=>{this.listenTo(t,"change:data",(i,o)=>{this._saveCallbacks.length&&o.isLocal&&(this.state==="synchronized"&&(this.state="waiting",this._setPendingAction()),this.state==="waiting"&&this._debouncedSave())})}),this.listenTo(e,"destroy",()=>this._flush(),{priority:"highest"});/* v8 ignore next -- @preserve */this._domEmitter.listenTo(window,"beforeunload",(i,o)=>{this._pendingActions.hasAny&&(o.returnValue=this._pendingActions.first.message)})}destroy(){this._domEmitter.stopListening(),super.destroy()}save(){return this._debouncedSave.cancel(),this._save()}_flush(){this._debouncedSave.flush()}_save(){return this._savePromise?(this._makeImmediateSave=this.editor.model.document.version>this._lastDocumentVersion,this._savePromise):(this._setPendingAction(),this.state="saving",this._lastDocumentVersion=this.editor.model.document.version,this._savePromise=Promise.resolve().then(()=>Promise.all(this._saveCallbacks.map(e=>e(this.editor)))).finally(()=>{this._savePromise=null}).then(()=>{if(this._makeImmediateSave)return this._makeImmediateSave=!1,this._save();this.editor.model.document.version>this._lastDocumentVersion?(this.state="waiting",this._debouncedSave()):(this.state="synchronized",this._pendingActions.remove(this._action),this._action=null)}).catch(e=>{throw this.state="error",this.state="saving",this._debouncedSave(),e}),this._savePromise)}_setPendingAction(){let e=this.editor.t;this._action||(this._action=this._pendingActions.add(e("Saving changes")))}get _saveCallbacks(){let e=[];return this.adapter&&this.adapter.save&&e.push(this.adapter.save),this._config.save&&e.push(this._config.save),e}};/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options -*/var Xc=Um(ck());function uk(e){return e.trim().split(/\s+/).length}function Yc(e){let t=e.length,i=5381;for(let o=0;o>>0}function $o(e){let t=localStorage.getItem(e);if(!t)return null;try{return JSON.parse(Xc.decompress(t))}catch(i){return console.error("Failed to load CKEditor revisions from localStorage: "+i.toString()),null}}async function dk(e){let t=Date.now(),i=e.config.get(jo),o=await e.getData();o||console.warn("Trying to save snapshot but data is not defined.");let n={timestamp:t,hash:Yc(o),content:o},r=$o(i)?.items||[];r.find(l=>n.hash===l.hash)||r.push(n);try{let l=Xc.compress(JSON.stringify({items:r,updatedAt:t}));localStorage.setItem(i,l)}catch(l){Ct(e,"notifications").addError("Failed to save CKEditor data to localStorage: "+l.toString())}return!0}var hk=` +*/var tu=$m(dk());function hk(e){return e.trim().split(/\s+/).length}function eu(e){let t=e.length,i=5381;for(let o=0;o>>0}function $o(e){let t=localStorage.getItem(e);if(!t)return null;try{return JSON.parse(tu.decompress(t))}catch(i){return console.error("Failed to load CKEditor revisions from localStorage: "+i.toString()),null}}async function fk(e){let t=Date.now(),i=e.config.get(jo),o=await e.getData();o||console.warn("Trying to save snapshot but data is not defined.");let n={timestamp:t,hash:eu(o),content:o},r=$o(i)?.items||[];r.find(l=>n.hash===l.hash)||r.push(n);try{let l=tu.compress(JSON.stringify({items:r,updatedAt:t}));localStorage.setItem(i,l)}catch(l){xt(e,"notifications").addError("Failed to save CKEditor data to localStorage: "+l.toString())}return!0}var mk=` -`;var ra=class extends y{init(){let t=this.editor,i=Ch(t);t.ui.componentFactory.add("opContentRevisions",o=>{let n=Se(o),s=new J;return Bt(n,s,{role:"menu",ariaLabel:i.t("js.editor.revisions")}),n.buttonView.set({label:i.t("js.editor.revisions"),icon:hk,tooltip:!0}),this.listenTo(n.buttonView,"execute",async()=>{s.clear(),MD(t,s)}),n.on("execute",r=>{let{timestamp:a}=r.source;a&&t.execute("opContentRevisionApply",a)}),n})}};function MD(e,t){let i=e.config.get(jo),o=$o(i),n=Ch(e),s=Ct(e,"timezone");if(!o?.items||o.items.count<=0){let l={type:"button",model:{label:n.t("js.editor.no_revisions"),withText:!0}};t.add(l);return}let r=e.getData(),a=Yc(r);for(let l=o.items.length;l>0;){l--;let c=o.items[l],u=s.formattedRelativeDateTime(c.timestamp),d=n.t("js.units.word",{count:uk(c.content)}),f=`${c.hash===a?`${n.t("js.label_current")} - `:""}${u} (${d})`,m={type:"button",model:{timestamp:c.timestamp,label:f,withText:!0}};t.add(m)}}var aa=class extends M{async execute(t){let i=this.editor,o=i.config.get(jo),n=await $o(o);if(!n){console.error(`Trying to load revision ${t} but no record present.`);return}let s=n.items.find(r=>r.timestamp===t);s&&(i.setData(s.content),setTimeout(()=>{i.editing.view.focus()}))}};var jo="opContentRevisionKey",fk="op_ckeditor_rev",BD="storageKey",la=class extends y{static get requires(){return[Zc,ra]}static get pluginName(){return"OpContentRevisions"}constructor(t){super(t);let i=this.getStorageKey(t);t.config.define(jo,i)}init(){let t=this.editor;t.commands.add("opContentRevisionApply",new aa(t)),t.once("ready",()=>{let i=Date.now();t.plugins.get("Autosave")._domEmitter.stopListening(window,"beforeunload"),Object.keys(localStorage).forEach(o=>{if(o.startsWith(fk)){let n=$o(o);n?.updatedAt&&i-n.updatedAt>=288e5&&localStorage.removeItem(o)}})})}getStorageKey(t){let i=t.config.get(BD);return i||this.createLocalStorageKey(t)}createLocalStorageKey(t){let i=Ji(t),o=l2(t),n="";return i?.href?n=i.href:n=location.pathname,o&&(n+=`_${o}`),`${fk}_${n}`}};var ks="op-macro-wp-quickinfo",Mm="opce-macro-wp-quickinfo",ca=class extends y{static get requires(){return[Pe]}static get pluginName(){return"OPMacroWpQuickinfo"}init(){let t=this.editor,i=t.model,o=t.conversion;i.schema.register(ks,{allowWhere:"$text",isInline:!0,isObject:!0,allowAttributes:["wpId","wpDisplayId","detailed","markerText"]}),o.for("upcast").elementToElement({view:{name:Mm},model:(n,{writer:s})=>{let r=n.getAttribute("data-id")||"",l=n.getAttribute("data-display-id")||""||r,c=n.getAttribute("data-detailed")==="true",u={wpDisplayId:l,detailed:c};return r&&r!==l&&(u.wpId=r),s.createElement(ks,u)},converterPriority:"high"}),o.for("upcast").elementToElement({view:{name:"mention",classes:"mention"},model:(n,{writer:s})=>{if(!Jc(n))return null;let r=n.getAttribute("data-text"),a=r.startsWith("###"),l=n.getAttribute("data-id")||"",c=n.getAttribute("data-display-id")||l;return s.createElement(ks,{wpId:l,wpDisplayId:c,detailed:a,markerText:r})},converterPriority:"highest"}),o.for("editingDowncast").elementToElement({model:ks,view:(n,{writer:s})=>{let r=n.getAttribute("wpDisplayId")||"",a=!!n.getAttribute("detailed"),l=n.getAttribute("wpId")||r,c=n.getAttribute("markerText")||`${a?"###":"##"}${r}`,u=s.createContainerElement("span",{class:"op-macro-wp-quickinfo-widget"}),d=s.createRawElement(Mm,{"data-id":l,"data-display-id":r,"data-detailed":String(a)},()=>{});return s.insert(s.createPositionAt(u,0),d),me(u,s,{label:c})}}),o.for("dataDowncast").elementToElement({model:ks,view:(n,{writer:s})=>{let r=n.getAttribute("wpDisplayId")||"",a=!!n.getAttribute("detailed"),l=n.getAttribute("wpId"),c=n.getAttribute("markerText")||`${a?"###":"##"}${r}`;if(l){let d=s.createContainerElement("mention",{class:"mention","data-id":l,"data-type":"work_package","data-text":c,"data-display-id":r});return s.insert(s.createPositionAt(d,0),s.createText(c)),d}let u=s.createContainerElement(Mm,{"data-id":l||r,"data-display-id":r,"data-detailed":String(a)});return s.insert(s.createPositionAt(u,0),s.createText(c)),u}})}afterInit(){let t=this.editor,i=t.commands.get("mention");i&&i.on("execute",(o,n)=>{let s=n&&n[0];if(!s||!s.mention||s.mention.type!=="work_package")return;let r=s.marker;if(r!=="##"&&r!=="###")return;o.stop();let a=r==="###",l=String(s.mention.dataDisplayId),c=s.mention.dataId!=null?String(s.mention.dataId):null,u=s.mention.text||`${r}${l}`;t.model.change(d=>{let h=s.range||t.model.document.selection.getFirstRange();h&&d.remove(h);let f={wpDisplayId:l,detailed:a,markerText:u};c&&(f.wpId=c);let m=d.createElement(ks,f);t.model.insertContent(m,t.model.document.selection),d.setSelection(d.createPositionAfter(m))})},{priority:"high"})}};function Bm(e,t,i,o){return Xt(e).wikiPageLinkMacro(t,i,o)}var ua="op-macro-wiki-page-link",Ko=class extends y{static get pluginName(){return"OpMacroWikiPageLink"}static get modelElementName(){return ua}init(){let t=this.editor,i=t.conversion;t.model.schema.register(ua,{allowWhere:"$text",isInline:!0,isObject:!0,allowAttributes:["providerId","pageIdentifier"]}),i.for("upcast").elementToElement({view:{name:"turbo-frame",attributes:{"data-type":"wiki-page-link"}},model:(o,{writer:n})=>{let s=o.getAttribute("data-provider-id"),r=o.getAttribute("data-page-identifier");return n.createElement(ua,{providerId:s,pageIdentifier:r})}}),i.for("dataDowncast").elementToElement({model:ua,view:(o,{writer:n})=>{let s=o.getAttribute("providerId"),r=o.getAttribute("pageIdentifier"),a=crypto.randomUUID(),l=n.createContainerElement("turbo-frame",{id:a,src:Bm(t,s,r,a),"data-provider-id":s,"data-page-identifier":r,"data-type":"wiki-page-link"}),c=`[[[${s}:${r}]]]`;return n.insert(n.createPositionAt(l,0),n.createText(c)),l}}),i.for("editingDowncast").elementToElement({model:ua,view:(o,{writer:n})=>{let s=o.getAttribute("providerId"),r=o.getAttribute("pageIdentifier"),a=crypto.randomUUID(),l=n.createContainerElement("span",{class:"my-wiki-page-link-widget"}),c=n.createRawElement("turbo-frame",{id:a,src:Bm(t,s,r,a),"data-provider-id":s,"data-page-identifier":r,"data-type":"wiki-page-link"},()=>{});return n.insert(n.createPositionAt(l,0),c),me(l,n,{label:`[[[${s}:${r}]]]`})}})}};function eu(e,t,i){if(!t||!i)return;let o=e.model;o.change(n=>{let s=n.createElement(Ko.modelElementName,{providerId:t,pageIdentifier:i});o.insertContent(s,o.document.selection)})}var da=class e extends y{static get pluginName(){return"OpMacroWikiPageLinkAddExisting"}static get buttonName(){return"insertExistingWikiPageLink"}get label(){return window.I18n.t("js.editor.macro.wikis.add_existing")}closeDialogHandler=this.handleCloseDialog.bind(this);init(){let t=this.editor;t.ui.componentFactory.add(e.buttonName,i=>{let o=new I(i);return o.set({label:this.label,withText:!0}),o.on("execute",()=>{this.runModalDialog(t)}),o})}runModalDialog(t){document.addEventListener("dialog:close",this.closeDialogHandler);let i=Ct(t,"turboRequests"),o=Xt(t).openExistingWikiPageDialog();i.request(o,{method:"GET"})}handleCloseDialog(t){if(t.detail.additional?.action!=="close_existing_page_dialog")return;document.removeEventListener("dialog:close",this.closeDialogHandler);let{providerId:i,pageIdentifier:o}=t.detail.additional;eu(this.editor,i,o)}};var ha=class e extends y{static get pluginName(){return"OpMacroWikiPageLinkCreateNew"}static get buttonName(){return"createNewWikiPageLink"}get label(){return window.I18n.t("js.editor.macro.wikis.create_new")}closeDialogHandler=this.handleCloseDialog.bind(this);init(){let t=this.editor;t.ui.componentFactory.add(e.buttonName,i=>{let o=new I(i);return o.set({label:this.label,withText:!0}),o.on("execute",()=>{this.runModalDialog(t)}),o})}runModalDialog(t){document.addEventListener("dialog:close",this.closeDialogHandler);let i=Ct(t,"turboRequests"),o=Xt(t).openNewWikiPageDialog();i.request(o,{method:"GET"})}handleCloseDialog(t){if(t.detail.additional?.action!=="close_new_page_dialog")return;document.removeEventListener("dialog:close",this.closeDialogHandler);let{providerId:i,pageIdentifier:o}=t.detail.additional;eu(this.editor,i,o)}};var fa=class extends y{static get requires(){return[is]}static get pluginName(){return"OPResizerGuard"}afterInit(){let t=this.editor.plugins.get("WidgetResize"),i=t.redrawSelectedResizer.bind(t),o=!1;t.redrawSelectedResizer=function(){if(!o){o=!0;try{return i()}finally{o=!1}}}}};var gs=[Cr,Tr,Ar,Lr,da,ha],Om=[Rr,Zr],Dm=[cy,hy,my,Zc,yy,_y,vy,ky,Ty,Py,W2,U2,$2,iy,X2,oy,oa,fa,Fy,r_,a_,ak,lk,tc,Dl,sk,rk,p5,zr,na,la,ca,Ko,qr,Pm,K_,Z_,c5,l5,Jr,sa].concat(gs,Om);var ma=class{constructor(t){this.response=t}get statusCode(){return this.response.status}get redirected(){return this.response.redirected}get ok(){return this.response.ok}get unauthenticated(){return this.statusCode===401}get unprocessableEntity(){return this.statusCode===422}get authenticationURL(){return this.response.headers.get("WWW-Authenticate")}get contentType(){return(this.response.headers.get("Content-Type")||"").replace(/;.*$/,"")}get headers(){return this.response.headers}get html(){return this.contentType.match(/^(application|text)\/(html|xhtml\+xml)$/)?this.text:Promise.reject(new Error(`Expected an HTML response but got "${this.contentType}" instead`))}get json(){return this.contentType.match(/^application\/.*json$/)?this.responseJson||(this.responseJson=this.response.json()):Promise.reject(new Error(`Expected a JSON response but got "${this.contentType}" instead`))}get text(){return this.responseText||(this.responseText=this.response.text())}get isTurboStream(){return this.contentType.match(/^text\/vnd\.turbo-stream\.html/)}get isScript(){return this.contentType.match(/\b(?:java|ecma)script\b/)}async renderTurboStream(){if(this.isTurboStream)window.Turbo?await window.Turbo.renderStreamMessage(await this.text):console.warn("You must set `window.Turbo = Turbo` to automatically process Turbo Stream events with request.js");else return Promise.reject(new Error(`Expected a Turbo Stream response but got "${this.contentType}" instead`))}async activeScript(){if(this.isScript){let t=document.createElement("script"),i=document.querySelector("meta[name=csp-nonce]");if(i){let o=i.nonce===""?i.content:i.nonce;o&&t.setAttribute("nonce",o)}t.innerHTML=await this.text,document.body.appendChild(t)}else return Promise.reject(new Error(`Expected a Script response but got "${this.contentType}" instead`))}};var ga=class{static register(t){this.interceptor=t}static get(){return this.interceptor}static reset(){this.interceptor=void 0}};function mk(e){let t=document.cookie?document.cookie.split("; "):[],i=`${encodeURIComponent(e)}=`,o=t.find(n=>n.startsWith(i));if(o){let n=o.split("=").slice(1).join("=");if(n)return decodeURIComponent(n)}}function gk(e){let t={};for(let i in e){let o=e[i];o!==void 0&&(t[i]=o)}return t}function Fm(e){let t=document.head.querySelector(`meta[name="${e}"]`);return t&&t.content}function pk(e){return[...e].reduce((t,[i,o])=>t.concat(typeof o=="string"?[[i,o]]:[]),[])}function bk(e,t){for(let[i,o]of t)o instanceof window.File||(e.has(i)&&!i.includes("[]")?(e.delete(i),e.set(i,o)):e.append(i,o))}var pa=class{constructor(t,i,o={}){this.method=t,this.options=o,this.originalUrl=i.toString()}async perform(){try{let n=ga.get();n&&await n(this)}catch(n){console.error(n)}let t=window.Turbo?window.Turbo.fetch:window.fetch,i=new ma(await t(this.url,this.fetchOptions));return i.unauthenticated&&i.authenticationURL?Promise.reject(window.location.href=i.authenticationURL):(i.isScript&&await i.activeScript(),(i.ok||i.unprocessableEntity)&&i.isTurboStream&&await i.renderTurboStream(),i)}addHeader(t,i){let o=this.additionalHeaders;o[t]=i,this.options.headers=o}sameHostname(){if(!this.originalUrl.startsWith("http:")&&!this.originalUrl.startsWith("https:"))return!0;try{return new URL(this.originalUrl).hostname===window.location.hostname}catch{return!0}}get fetchOptions(){return{method:this.method.toUpperCase(),headers:this.headers,body:this.formattedBody,signal:this.signal,credentials:this.credentials,redirect:this.redirect,keepalive:this.keepalive}}get headers(){let t={"X-Requested-With":"XMLHttpRequest","Content-Type":this.contentType,Accept:this.accept};return this.sameHostname()&&(t["X-CSRF-Token"]=this.csrfToken),gk(Object.assign(t,this.additionalHeaders))}get csrfToken(){return mk(Fm("csrf-param"))||Fm("csrf-token")}get contentType(){return this.options.contentType?this.options.contentType:this.body==null||this.body instanceof window.FormData?void 0:this.body instanceof window.File?this.body.type:"application/json"}get accept(){switch(this.responseKind){case"html":return"text/html, application/xhtml+xml";case"turbo-stream":return"text/vnd.turbo-stream.html, text/html, application/xhtml+xml";case"json":return"application/json, application/vnd.api+json";case"script":return"text/javascript, application/javascript";default:return"*/*"}}get body(){return this.options.body}get query(){let t=(this.originalUrl.split("?")[1]||"").split("#")[0],i=new URLSearchParams(t),o=this.options.query;o instanceof window.FormData?o=pk(o):o instanceof window.URLSearchParams?o=o.entries():o=Object.entries(o||{}),bk(i,o);let n=i.toString();return n.length>0?`?${n}`:""}get url(){return this.originalUrl.split("?")[0].split("#")[0]+this.query}get responseKind(){return this.options.responseKind||"html"}get signal(){return this.options.signal}get redirect(){return this.options.redirect||"follow"}get credentials(){return this.options.credentials||"same-origin"}get keepalive(){return this.options.keepalive||!1}get additionalHeaders(){return this.options.headers||{}}get formattedBody(){let t=Object.prototype.toString.call(this.body)==="[object String]";return this.headers["Content-Type"]==="application/json"&&!t?JSON.stringify(this.body):this.body}};async function ba(e,t){return new pa("get",e,t).perform()}function OD(e,t){let i=new Set;return e.filter(o=>{let n=t(o);return i.has(n)?!1:(i.add(n),!0)})}function wk(e){let t=this,i=Ji(t);if(i&&i._type==="Activity::Comment"){let r=i.$embedded.workPackage;r&&(i=r)}if(!i)return[];if(t.config.get("disabledMentions").includes("user"))return[];let o=Xt(t).api.v3.principals(i,e);if(!o)return[];let n=Re(t),s=window.OpenProject.urlRoot;return new Promise((r,a)=>{ba(o,{responseKind:"json",query:{select:"elements/_type,elements/id,elements/name"}}).then(l=>l.json).then(l=>{r(OD(l._embedded.elements,c=>c.id).map(c=>{let u=c._type.toLowerCase(),d=`@${c.name}`,h=`@${c.id}`,f=n.services.apiV3Service[`${u}s`].segment,m=`${s}/${f}/${c.id}`;return{type:u,id:h,text:d,link:m,dataId:c.id,name:c.name}}))}).catch(l=>{console.error("Error fetching user mentions:",l),a(l)})})}function tu(e){return function(t){let i=this,o=window.OpenProject.urlRoot,n=`${o}/work_packages/auto_complete.json`;return i.config.get("disabledMentions").includes("work_package")?[]:new Promise((s,r)=>{ba(n,{responseKind:"json",query:{q:t,scope:"all"}}).then(a=>a.json).then(a=>{s(a.map(l=>{let c=l.displayId||l.id,u=`${e}${c}`;return{id:u,dataId:l.id,dataDisplayId:c,type:"work_package",text:u,name:l.to_s,link:`${o}/work_packages/${c}`}}))}).catch(a=>{console.error("Error fetching work package mentions:",a),r(a)})})}}function wa(e){let t=document.createElement("span");return(e.type==="user"||e.type==="work_package")&&(t.setAttribute("data-hover-card-trigger-target","trigger"),t.setAttribute("data-hover-card-url",`${e.link}/hover_card`)),t.classList.add("mention-list-item"),t.textContent=e.name,t}function yk(e){let t=document.createElement("span");return t.classList.add("mention-list-item"),t.textContent=`${e.text} ${e.name}`,t}var _k=[{id:":grinning_face:",symbol:"\u{1F600}",group:"people",keywords:["face","grin","grinning face"]},{id:":beaming_face_with_smiling_eyes:",symbol:"\u{1F601}",group:"people",keywords:["beaming face with smiling eyes","eye","face","grin","smile"]},{id:":face_with_tears_of_joy:",symbol:"\u{1F602}",group:"people",keywords:["face","face with tears of joy","joy","laugh","tear"]},{id:":rolling_on_the_floor_laughing:",symbol:"\u{1F923}",group:"people",keywords:["face","floor","laugh","rolling","rolling on the floor laughing"]},{id:":grinning_face_with_big_eyes:",symbol:"\u{1F603}",group:"people",keywords:["face","grinning face with big eyes","mouth","open","smile"]},{id:":grinning_face_with_smiling_eyes:",symbol:"\u{1F604}",group:"people",keywords:["eye","face","grinning face with smiling eyes","mouth","open","smile"]},{id:":grinning_face_with_sweat:",symbol:"\u{1F605}",group:"people",keywords:["cold","face","grinning face with sweat","open","smile","sweat"]},{id:":grinning_squinting_face:",symbol:"\u{1F606}",group:"people",keywords:["face","grinning squinting face","laugh","mouth","satisfied","smile"]},{id:":winking_face:",symbol:"\u{1F609}",group:"people",keywords:["face","wink","winking face"]},{id:":smiling_face_with_smiling_eyes:",symbol:"\u{1F60A}",group:"people",keywords:["blush","eye","face","smile","smiling face with smiling eyes"]},{id:":face_savoring_food:",symbol:"\u{1F60B}",group:"people",keywords:["delicious","face","face savoring food","savouring","smile","yum"]},{id:":smiling_face_with_sunglasses:",symbol:"\u{1F60E}",group:"people",keywords:["bright","cool","face","smiling face with sunglasses","sun","sunglasses"]},{id:":smiling_face_with_heart-eyes:",symbol:"\u{1F60D}",group:"people",keywords:["eye","face","love","smile","smiling face with heart-eyes"]},{id:":face_blowing_a_kiss:",symbol:"\u{1F618}",group:"people",keywords:["face","face blowing a kiss","kiss"]},{id:":kissing_face:",symbol:"\u{1F617}",group:"people",keywords:["face","kiss","kissing face"]},{id:":kissing_face_with_smiling_eyes:",symbol:"\u{1F619}",group:"people",keywords:["eye","face","kiss","kissing face with smiling eyes","smile"]},{id:":kissing_face_with_closed_eyes:",symbol:"\u{1F61A}",group:"people",keywords:["closed","eye","face","kiss","kissing face with closed eyes"]},{id:":smiling_face:",symbol:"\u263A",group:"people",keywords:["face","outlined","relaxed","smile","smiling face"]},{id:":slightly_smiling_face:",symbol:"\u{1F642}",group:"people",keywords:["face","slightly smiling face","smile"]},{id:":hugging_face:",symbol:"\u{1F917}",group:"people",keywords:["face","hug","hugging"]},{id:":star-struck:",symbol:"\u{1F929}",group:"people",keywords:["eyes","face","grinning","star","star-struck",""]},{id:":thinking_face:",symbol:"\u{1F914}",group:"people",keywords:["face","thinking"]},{id:":face_with_raised_eyebrow:",symbol:"\u{1F928}",group:"people",keywords:["distrust","face with raised eyebrow","skeptic",""]},{id:":neutral_face:",symbol:"\u{1F610}",group:"people",keywords:["deadpan","face","neutral"]},{id:":expressionless_face:",symbol:"\u{1F611}",group:"people",keywords:["expressionless","face","inexpressive","unexpressive"]},{id:":face_without_mouth:",symbol:"\u{1F636}",group:"people",keywords:["face","face without mouth","mouth","quiet","silent"]},{id:":face_with_rolling_eyes:",symbol:"\u{1F644}",group:"people",keywords:["eyes","face","face with rolling eyes","rolling"]},{id:":smirking_face:",symbol:"\u{1F60F}",group:"people",keywords:["face","smirk","smirking face"]},{id:":persevering_face:",symbol:"\u{1F623}",group:"people",keywords:["face","persevere","persevering face"]},{id:":sad_but_relieved_face:",symbol:"\u{1F625}",group:"people",keywords:["disappointed","face","relieved","sad but relieved face","whew"]},{id:":face_with_open_mouth:",symbol:"\u{1F62E}",group:"people",keywords:["face","face with open mouth","mouth","open","sympathy"]},{id:":zipper-mouth_face:",symbol:"\u{1F910}",group:"people",keywords:["face","mouth","zipper","zipper-mouth face"]},{id:":hushed_face:",symbol:"\u{1F62F}",group:"people",keywords:["face","hushed","stunned","surprised"]},{id:":sleepy_face:",symbol:"\u{1F62A}",group:"people",keywords:["face","sleep","sleepy face"]},{id:":tired_face:",symbol:"\u{1F62B}",group:"people",keywords:["face","tired"]},{id:":sleeping_face:",symbol:"\u{1F634}",group:"people",keywords:["face","sleep","sleeping face","zzz"]},{id:":relieved_face:",symbol:"\u{1F60C}",group:"people",keywords:["face","relieved"]},{id:":face_with_tongue:",symbol:"\u{1F61B}",group:"people",keywords:["face","face with tongue","tongue"]},{id:":winking_face_with_tongue:",symbol:"\u{1F61C}",group:"people",keywords:["eye","face","joke","tongue","wink","winking face with tongue"]},{id:":squinting_face_with_tongue:",symbol:"\u{1F61D}",group:"people",keywords:["eye","face","horrible","squinting face with tongue","taste","tongue"]},{id:":drooling_face:",symbol:"\u{1F924}",group:"people",keywords:["drooling","face"]},{id:":unamused_face:",symbol:"\u{1F612}",group:"people",keywords:["face","unamused","unhappy"]},{id:":downcast_face_with_sweat:",symbol:"\u{1F613}",group:"people",keywords:["cold","downcast face with sweat","face","sweat"]},{id:":pensive_face:",symbol:"\u{1F614}",group:"people",keywords:["dejected","face","pensive"]},{id:":confused_face:",symbol:"\u{1F615}",group:"people",keywords:["confused","face"]},{id:":upside-down_face:",symbol:"\u{1F643}",group:"people",keywords:["face","upside-down"]},{id:":money-mouth_face:",symbol:"\u{1F911}",group:"people",keywords:["face","money","money-mouth face","mouth"]},{id:":astonished_face:",symbol:"\u{1F632}",group:"people",keywords:["astonished","face","shocked","totally"]},{id:":frowning_face:",symbol:"\u2639",group:"people",keywords:["face","frown","frowning face"]},{id:":slightly_frowning_face:",symbol:"\u{1F641}",group:"people",keywords:["face","frown","slightly frowning face"]},{id:":confounded_face:",symbol:"\u{1F616}",group:"people",keywords:["confounded","face"]},{id:":disappointed_face:",symbol:"\u{1F61E}",group:"people",keywords:["disappointed","face"]},{id:":worried_face:",symbol:"\u{1F61F}",group:"people",keywords:["face","worried"]},{id:":face_with_steam_from_nose:",symbol:"\u{1F624}",group:"people",keywords:["face","face with steam from nose","triumph","won"]},{id:":crying_face:",symbol:"\u{1F622}",group:"people",keywords:["cry","crying face","face","sad","tear"]},{id:":loudly_crying_face:",symbol:"\u{1F62D}",group:"people",keywords:["cry","face","loudly crying face","sad","sob","tear"]},{id:":frowning_face_with_open_mouth:",symbol:"\u{1F626}",group:"people",keywords:["face","frown","frowning face with open mouth","mouth","open"]},{id:":anguished_face:",symbol:"\u{1F627}",group:"people",keywords:["anguished","face"]},{id:":fearful_face:",symbol:"\u{1F628}",group:"people",keywords:["face","fear","fearful","scared"]},{id:":weary_face:",symbol:"\u{1F629}",group:"people",keywords:["face","tired","weary"]},{id:":exploding_head:",symbol:"\u{1F92F}",group:"people",keywords:["exploding head","shocked"]},{id:":grimacing_face:",symbol:"\u{1F62C}",group:"people",keywords:["face","grimace","grimacing face"]},{id:":anxious_face_with_sweat:",symbol:"\u{1F630}",group:"people",keywords:["anxious face with sweat","blue","cold","face","rushed","sweat"]},{id:":face_screaming_in_fear:",symbol:"\u{1F631}",group:"people",keywords:["face","face screaming in fear","fear","munch","scared","scream"]},{id:":flushed_face:",symbol:"\u{1F633}",group:"people",keywords:["dazed","face","flushed"]},{id:":zany_face:",symbol:"\u{1F92A}",group:"people",keywords:["eye","goofy","large","small","zany face"]},{id:":dizzy_face:",symbol:"\u{1F635}",group:"people",keywords:["dizzy","face"]},{id:":pouting_face:",symbol:"\u{1F621}",group:"people",keywords:["angry","face","mad","pouting","rage","red"]},{id:":angry_face:",symbol:"\u{1F620}",group:"people",keywords:["angry","face","mad"]},{id:":face_with_symbols_on_mouth:",symbol:"\u{1F92C}",group:"people",keywords:["face with symbols on mouth","swearing",""]},{id:":face_with_medical_mask:",symbol:"\u{1F637}",group:"people",keywords:["cold","doctor","face","face with medical mask","mask","sick"]},{id:":face_with_thermometer:",symbol:"\u{1F912}",group:"people",keywords:["face","face with thermometer","ill","sick","thermometer"]},{id:":face_with_head-bandage:",symbol:"\u{1F915}",group:"people",keywords:["bandage","face","face with head-bandage","hurt","injury"]},{id:":nauseated_face:",symbol:"\u{1F922}",group:"people",keywords:["face","nauseated","vomit"]},{id:":face_vomiting:",symbol:"\u{1F92E}",group:"people",keywords:["face vomiting","sick","vomit"]},{id:":sneezing_face:",symbol:"\u{1F927}",group:"people",keywords:["face","gesundheit","sneeze","sneezing face"]},{id:":smiling_face_with_halo:",symbol:"\u{1F607}",group:"people",keywords:["angel","face","fantasy","halo","innocent","smiling face with halo"]},{id:":cowboy_hat_face:",symbol:"\u{1F920}",group:"people",keywords:["cowboy","cowgirl","face","hat"]},{id:":lying_face:",symbol:"\u{1F925}",group:"people",keywords:["face","lie","lying face","pinocchio"]},{id:":shushing_face:",symbol:"\u{1F92B}",group:"people",keywords:["quiet","shush","shushing face"]},{id:":face_with_hand_over_mouth:",symbol:"\u{1F92D}",group:"people",keywords:["face with hand over mouth","whoops",""]},{id:":face_with_monocle:",symbol:"\u{1F9D0}",group:"people",keywords:["face with monocle","stuffy",""]},{id:":nerd_face:",symbol:"\u{1F913}",group:"people",keywords:["face","geek","nerd"]},{id:":smiling_face_with_horns:",symbol:"\u{1F608}",group:"people",keywords:["face","fairy tale","fantasy","horns","smile","smiling face with horns"]},{id:":angry_face_with_horns:",symbol:"\u{1F47F}",group:"people",keywords:["angry face with horns","demon","devil","face","fantasy","imp"]},{id:":clown_face:",symbol:"\u{1F921}",group:"people",keywords:["clown","face"]},{id:":ogre:",symbol:"\u{1F479}",group:"people",keywords:["creature","face","fairy tale","fantasy","monster","ogre",""]},{id:":goblin:",symbol:"\u{1F47A}",group:"people",keywords:["creature","face","fairy tale","fantasy","goblin","monster"]},{id:":skull:",symbol:"\u{1F480}",group:"people",keywords:["death","face","fairy tale","monster","skull"]},{id:":skull_and_crossbones:",symbol:"\u2620",group:"people",keywords:["crossbones","death","face","monster","skull","skull and crossbones"]},{id:":ghost:",symbol:"\u{1F47B}",group:"people",keywords:["creature","face","fairy tale","fantasy","ghost","monster"]},{id:":alien:",symbol:"\u{1F47D}",group:"people",keywords:["alien","creature","extraterrestrial","face","fantasy","ufo"]},{id:":alien_monster:",symbol:"\u{1F47E}",group:"people",keywords:["alien","creature","extraterrestrial","face","monster","ufo"]},{id:":robot_face:",symbol:"\u{1F916}",group:"people",keywords:["face","monster","robot"]},{id:":pile_of_poo:",symbol:"\u{1F4A9}",group:"people",keywords:["dung","face","monster","pile of poo","poo","poop"]},{id:":grinning_cat_face:",symbol:"\u{1F63A}",group:"people",keywords:["cat","face","grinning cat face","mouth","open","smile"]},{id:":grinning_cat_face_with_smiling_eyes:",symbol:"\u{1F638}",group:"people",keywords:["cat","eye","face","grin","grinning cat face with smiling eyes","smile"]},{id:":cat_face_with_tears_of_joy:",symbol:"\u{1F639}",group:"people",keywords:["cat","cat face with tears of joy","face","joy","tear"]},{id:":smiling_cat_face_with_heart-eyes:",symbol:"\u{1F63B}",group:"people",keywords:["cat","eye","face","love","smile","smiling cat face with heart-eyes"]},{id:":cat_face_with_wry_smile:",symbol:"\u{1F63C}",group:"people",keywords:["cat","cat face with wry smile","face","ironic","smile","wry"]},{id:":kissing_cat_face:",symbol:"\u{1F63D}",group:"people",keywords:["cat","eye","face","kiss","kissing cat face"]},{id:":weary_cat_face:",symbol:"\u{1F640}",group:"people",keywords:["cat","face","oh","surprised","weary"]},{id:":crying_cat_face:",symbol:"\u{1F63F}",group:"people",keywords:["cat","cry","crying cat face","face","sad","tear"]},{id:":pouting_cat_face:",symbol:"\u{1F63E}",group:"people",keywords:["cat","face","pouting"]},{id:":see-no-evil_monkey:",symbol:"\u{1F648}",group:"people",keywords:["evil","face","forbidden","monkey","see","see-no-evil monkey"]},{id:":hear-no-evil_monkey:",symbol:"\u{1F649}",group:"people",keywords:["evil","face","forbidden","hear","hear-no-evil monkey","monkey"]},{id:":speak-no-evil_monkey:",symbol:"\u{1F64A}",group:"people",keywords:["evil","face","forbidden","monkey","speak","speak-no-evil monkey"]},{id:":baby:",symbol:"\u{1F476}",group:"people",keywords:["baby","young"]},{id:":child:",symbol:"\u{1F9D2}",group:"people",keywords:["child","gender-neutral","unspecified gender","young"]},{id:":boy:",symbol:"\u{1F466}",group:"people",keywords:["boy","young"]},{id:":girl:",symbol:"\u{1F467}",group:"people",keywords:["girl","Virgo","young","zodiac"]},{id:":person:",symbol:"\u{1F9D1}",group:"people",keywords:["adult","gender-neutral","person","unspecified gender"]},{id:":person_blond_hair:",symbol:"\u{1F471}",group:"people",keywords:["blond","blond-haired person","person: blond hair"]},{id:":man:",symbol:"\u{1F468}",group:"people",keywords:["adult","man"]},{id:":man_blond_hair:",symbol:"\u{1F471}\u200D\u2642\uFE0F",group:"people",keywords:["blond","blond-haired man","man","man: blond hair"]},{id:":man_beard:",symbol:"\u{1F9D4}",group:"people",keywords:["beard","man: beard","person",""]},{id:":woman:",symbol:"\u{1F469}",group:"people",keywords:["adult","woman"]},{id:":woman_blond_hair:",symbol:"\u{1F471}\u200D\u2640\uFE0F",group:"people",keywords:["blond-haired woman","blonde","woman","woman: blond hair"]},{id:":older_person:",symbol:"\u{1F9D3}",group:"people",keywords:["adult","gender-neutral","old","older person","unspecified gender"]},{id:":old_man:",symbol:"\u{1F474}",group:"people",keywords:["adult","man","old"]},{id:":old_woman:",symbol:"\u{1F475}",group:"people",keywords:["adult","old","woman"]},{id:":man_health_worker:",symbol:"\u{1F468}\u200D\u2695\uFE0F",group:"people",keywords:["doctor","healthcare","man","man health worker","nurse","therapist"]},{id:":woman_health_worker:",symbol:"\u{1F469}\u200D\u2695\uFE0F",group:"people",keywords:["doctor","healthcare","nurse","therapist","woman","woman health worker"]},{id:":man_student:",symbol:"\u{1F468}\u200D\u{1F393}",group:"people",keywords:["graduate","man","student"]},{id:":woman_student:",symbol:"\u{1F469}\u200D\u{1F393}",group:"people",keywords:["graduate","student","woman"]},{id:":man_teacher:",symbol:"\u{1F468}\u200D\u{1F3EB}",group:"people",keywords:["instructor","man","professor","teacher"]},{id:":woman_teacher:",symbol:"\u{1F469}\u200D\u{1F3EB}",group:"people",keywords:["instructor","professor","teacher","woman"]},{id:":man_judge:",symbol:"\u{1F468}\u200D\u2696\uFE0F",group:"people",keywords:["justice","man","man judge","scales"]},{id:":woman_judge:",symbol:"\u{1F469}\u200D\u2696\uFE0F",group:"people",keywords:["judge","scales","woman"]},{id:":man_farmer:",symbol:"\u{1F468}\u200D\u{1F33E}",group:"people",keywords:["farmer","gardener","man","rancher"]},{id:":woman_farmer:",symbol:"\u{1F469}\u200D\u{1F33E}",group:"people",keywords:["farmer","gardener","rancher","woman"]},{id:":man_cook:",symbol:"\u{1F468}\u200D\u{1F373}",group:"people",keywords:["chef","cook","man"]},{id:":woman_cook:",symbol:"\u{1F469}\u200D\u{1F373}",group:"people",keywords:["chef","cook","woman"]},{id:":man_mechanic:",symbol:"\u{1F468}\u200D\u{1F527}",group:"people",keywords:["electrician","man","mechanic","plumber","tradesperson"]},{id:":woman_mechanic:",symbol:"\u{1F469}\u200D\u{1F527}",group:"people",keywords:["electrician","mechanic","plumber","tradesperson","woman"]},{id:":man_factory_worker:",symbol:"\u{1F468}\u200D\u{1F3ED}",group:"people",keywords:["assembly","factory","industrial","man","worker"]},{id:":woman_factory_worker:",symbol:"\u{1F469}\u200D\u{1F3ED}",group:"people",keywords:["assembly","factory","industrial","woman","worker"]},{id:":man_office_worker:",symbol:"\u{1F468}\u200D\u{1F4BC}",group:"people",keywords:["architect","business","man","man office worker","manager","white-collar"]},{id:":woman_office_worker:",symbol:"\u{1F469}\u200D\u{1F4BC}",group:"people",keywords:["architect","business","manager","white-collar","woman","woman office worker"]},{id:":man_scientist:",symbol:"\u{1F468}\u200D\u{1F52C}",group:"people",keywords:["biologist","chemist","engineer","man","physicist","scientist"]},{id:":woman_scientist:",symbol:"\u{1F469}\u200D\u{1F52C}",group:"people",keywords:["biologist","chemist","engineer","physicist","scientist","woman"]},{id:":man_technologist:",symbol:"\u{1F468}\u200D\u{1F4BB}",group:"people",keywords:["coder","developer","inventor","man","software","technologist"]},{id:":woman_technologist:",symbol:"\u{1F469}\u200D\u{1F4BB}",group:"people",keywords:["coder","developer","inventor","software","technologist","woman"]},{id:":man_singer:",symbol:"\u{1F468}\u200D\u{1F3A4}",group:"people",keywords:["actor","entertainer","man","rock","singer","star"]},{id:":woman_singer:",symbol:"\u{1F469}\u200D\u{1F3A4}",group:"people",keywords:["actor","entertainer","rock","singer","star","woman"]},{id:":man_artist:",symbol:"\u{1F468}\u200D\u{1F3A8}",group:"people",keywords:["artist","man","palette"]},{id:":woman_artist:",symbol:"\u{1F469}\u200D\u{1F3A8}",group:"people",keywords:["artist","palette","woman"]},{id:":man_pilot:",symbol:"\u{1F468}\u200D\u2708\uFE0F",group:"people",keywords:["man","pilot","plane"]},{id:":woman_pilot:",symbol:"\u{1F469}\u200D\u2708\uFE0F",group:"people",keywords:["pilot","plane","woman"]},{id:":man_astronaut:",symbol:"\u{1F468}\u200D\u{1F680}",group:"people",keywords:["astronaut","man","rocket"]},{id:":woman_astronaut:",symbol:"\u{1F469}\u200D\u{1F680}",group:"people",keywords:["astronaut","rocket","woman"]},{id:":man_firefighter:",symbol:"\u{1F468}\u200D\u{1F692}",group:"people",keywords:["firefighter","firetruck","man"]},{id:":woman_firefighter:",symbol:"\u{1F469}\u200D\u{1F692}",group:"people",keywords:["firefighter","firetruck","woman"]},{id:":police_officer:",symbol:"\u{1F46E}",group:"people",keywords:["cop","officer","police"]},{id:":man_police_officer:",symbol:"\u{1F46E}\u200D\u2642\uFE0F",group:"people",keywords:["cop","man","officer","police"]},{id:":woman_police_officer:",symbol:"\u{1F46E}\u200D\u2640\uFE0F",group:"people",keywords:["cop","officer","police","woman"]},{id:":detective:",symbol:"\u{1F575}",group:"people",keywords:["detective","sleuth","spy"]},{id:":man_detective:",symbol:"\u{1F575}\uFE0F\u200D\u2642\uFE0F",group:"people",keywords:["detective","man","sleuth","spy"]},{id:":woman_detective:",symbol:"\u{1F575}\uFE0F\u200D\u2640\uFE0F",group:"people",keywords:["detective","sleuth","spy","woman"]},{id:":guard:",symbol:"\u{1F482}",group:"people",keywords:["guard"]},{id:":man_guard:",symbol:"\u{1F482}\u200D\u2642\uFE0F",group:"people",keywords:["guard","man"]},{id:":woman_guard:",symbol:"\u{1F482}\u200D\u2640\uFE0F",group:"people",keywords:["guard","woman"]},{id:":construction_worker:",symbol:"\u{1F477}",group:"people",keywords:["construction","hat","worker"]},{id:":man_construction_worker:",symbol:"\u{1F477}\u200D\u2642\uFE0F",group:"people",keywords:["construction","man","worker"]},{id:":woman_construction_worker:",symbol:"\u{1F477}\u200D\u2640\uFE0F",group:"people",keywords:["construction","woman","worker"]},{id:":prince:",symbol:"\u{1F934}",group:"people",keywords:["prince"]},{id:":princess:",symbol:"\u{1F478}",group:"people",keywords:["fairy tale","fantasy","princess"]},{id:":person_wearing_turban:",symbol:"\u{1F473}",group:"people",keywords:["person wearing turban","turban"]},{id:":man_wearing_turban:",symbol:"\u{1F473}\u200D\u2642\uFE0F",group:"people",keywords:["man","man wearing turban","turban"]},{id:":woman_wearing_turban:",symbol:"\u{1F473}\u200D\u2640\uFE0F",group:"people",keywords:["turban","woman","woman wearing turban"]},{id:":man_with_chinese_cap:",symbol:"\u{1F472}",group:"people",keywords:["gua pi mao","hat","man","man with Chinese cap"]},{id:":woman_with_headscarf:",symbol:"\u{1F9D5}",group:"people",keywords:["headscarf","hijab","mantilla","tichel","woman with headscarf",""]},{id:":man_in_tuxedo:",symbol:"\u{1F935}",group:"people",keywords:["groom","man","man in tuxedo","tuxedo"]},{id:":bride_with_veil:",symbol:"\u{1F470}",group:"people",keywords:["bride","bride with veil","veil","wedding"]},{id:":pregnant_woman:",symbol:"\u{1F930}",group:"people",keywords:["pregnant","woman"]},{id:":breast-feeding:",symbol:"\u{1F931}",group:"people",keywords:["baby","breast","breast-feeding","nursing"]},{id:":baby_angel:",symbol:"\u{1F47C}",group:"people",keywords:["angel","baby","face","fairy tale","fantasy"]},{id:":santa_claus:",symbol:"\u{1F385}",group:"people",keywords:["celebration","Christmas","claus","father","santa","Santa Claus"]},{id:":mrs._claus:",symbol:"\u{1F936}",group:"people",keywords:["celebration","Christmas","claus","mother","Mrs.","Mrs. Claus"]},{id:":mage:",symbol:"\u{1F9D9}",group:"people",keywords:["mage","sorcerer","sorceress","witch","wizard"]},{id:":man_mage:",symbol:"\u{1F9D9}\u200D\u2642\uFE0F",group:"people",keywords:["man mage","sorcerer","wizard"]},{id:":woman_mage:",symbol:"\u{1F9D9}\u200D\u2640\uFE0F",group:"people",keywords:["sorceress","witch","woman mage"]},{id:":fairy:",symbol:"\u{1F9DA}",group:"people",keywords:["fairy","Oberon","Puck","Titania"]},{id:":man_fairy:",symbol:"\u{1F9DA}\u200D\u2642\uFE0F",group:"people",keywords:["man fairy","Oberon","Puck"]},{id:":woman_fairy:",symbol:"\u{1F9DA}\u200D\u2640\uFE0F",group:"people",keywords:["Titania","woman fairy"]},{id:":vampire:",symbol:"\u{1F9DB}",group:"people",keywords:["Dracula","undead","vampire"]},{id:":man_vampire:",symbol:"\u{1F9DB}\u200D\u2642\uFE0F",group:"people",keywords:["Dracula","man vampire","undead"]},{id:":woman_vampire:",symbol:"\u{1F9DB}\u200D\u2640\uFE0F",group:"people",keywords:["undead","woman vampire"]},{id:":merperson:",symbol:"\u{1F9DC}",group:"people",keywords:["mermaid","merman","merperson","merwoman"]},{id:":merman:",symbol:"\u{1F9DC}\u200D\u2642\uFE0F",group:"people",keywords:["merman","Triton"]},{id:":mermaid:",symbol:"\u{1F9DC}\u200D\u2640\uFE0F",group:"people",keywords:["mermaid","merwoman"]},{id:":elf:",symbol:"\u{1F9DD}",group:"people",keywords:["elf","magical",""]},{id:":man_elf:",symbol:"\u{1F9DD}\u200D\u2642\uFE0F",group:"people",keywords:["magical","man elf"]},{id:":woman_elf:",symbol:"\u{1F9DD}\u200D\u2640\uFE0F",group:"people",keywords:["magical","woman elf"]},{id:":genie:",symbol:"\u{1F9DE}",group:"people",keywords:["djinn","genie",""]},{id:":man_genie:",symbol:"\u{1F9DE}\u200D\u2642\uFE0F",group:"people",keywords:["djinn","man genie"]},{id:":woman_genie:",symbol:"\u{1F9DE}\u200D\u2640\uFE0F",group:"people",keywords:["djinn","woman genie"]},{id:":zombie:",symbol:"\u{1F9DF}",group:"people",keywords:["undead","walking dead","zombie",""]},{id:":man_zombie:",symbol:"\u{1F9DF}\u200D\u2642\uFE0F",group:"people",keywords:["man zombie","undead","walking dead"]},{id:":woman_zombie:",symbol:"\u{1F9DF}\u200D\u2640\uFE0F",group:"people",keywords:["undead","walking dead","woman zombie"]},{id:":person_frowning:",symbol:"\u{1F64D}",group:"people",keywords:["frown","gesture","person frowning"]},{id:":man_frowning:",symbol:"\u{1F64D}\u200D\u2642\uFE0F",group:"people",keywords:["frowning","gesture","man"]},{id:":woman_frowning:",symbol:"\u{1F64D}\u200D\u2640\uFE0F",group:"people",keywords:["frowning","gesture","woman"]},{id:":person_pouting:",symbol:"\u{1F64E}",group:"people",keywords:["gesture","person pouting","pouting"]},{id:":man_pouting:",symbol:"\u{1F64E}\u200D\u2642\uFE0F",group:"people",keywords:["gesture","man","pouting"]},{id:":woman_pouting:",symbol:"\u{1F64E}\u200D\u2640\uFE0F",group:"people",keywords:["gesture","pouting","woman"]},{id:":person_gesturing_no:",symbol:"\u{1F645}",group:"people",keywords:["forbidden","gesture","hand","person gesturing NO","prohibited"]},{id:":man_gesturing_no:",symbol:"\u{1F645}\u200D\u2642\uFE0F",group:"people",keywords:["forbidden","gesture","hand","man","man gesturing NO","prohibited"]},{id:":woman_gesturing_no:",symbol:"\u{1F645}\u200D\u2640\uFE0F",group:"people",keywords:["forbidden","gesture","hand","prohibited","woman","woman gesturing NO"]},{id:":person_gesturing_ok:",symbol:"\u{1F646}",group:"people",keywords:["gesture","hand","OK","person gesturing OK"]},{id:":man_gesturing_ok:",symbol:"\u{1F646}\u200D\u2642\uFE0F",group:"people",keywords:["gesture","hand","man","man gesturing OK","OK"]},{id:":woman_gesturing_ok:",symbol:"\u{1F646}\u200D\u2640\uFE0F",group:"people",keywords:["gesture","hand","OK","woman","woman gesturing OK"]},{id:":person_tipping_hand:",symbol:"\u{1F481}",group:"people",keywords:["hand","help","information","person tipping hand","sassy","tipping"]},{id:":man_tipping_hand:",symbol:"\u{1F481}\u200D\u2642\uFE0F",group:"people",keywords:["man","man tipping hand","sassy","tipping hand"]},{id:":woman_tipping_hand:",symbol:"\u{1F481}\u200D\u2640\uFE0F",group:"people",keywords:["sassy","tipping hand","woman","woman tipping hand"]},{id:":person_raising_hand:",symbol:"\u{1F64B}",group:"people",keywords:["gesture","hand","happy","person raising hand","raised"]},{id:":man_raising_hand:",symbol:"\u{1F64B}\u200D\u2642\uFE0F",group:"people",keywords:["gesture","man","man raising hand","raising hand"]},{id:":woman_raising_hand:",symbol:"\u{1F64B}\u200D\u2640\uFE0F",group:"people",keywords:["gesture","raising hand","woman","woman raising hand"]},{id:":person_bowing:",symbol:"\u{1F647}",group:"people",keywords:["apology","bow","gesture","person bowing","sorry"]},{id:":man_bowing:",symbol:"\u{1F647}\u200D\u2642\uFE0F",group:"people",keywords:["apology","bowing","favor","gesture","man","sorry"]},{id:":woman_bowing:",symbol:"\u{1F647}\u200D\u2640\uFE0F",group:"people",keywords:["apology","bowing","favor","gesture","sorry","woman"]},{id:":person_facepalming:",symbol:"\u{1F926}",group:"people",keywords:["disbelief","exasperation","face","palm","person facepalming"]},{id:":man_facepalming:",symbol:"\u{1F926}\u200D\u2642\uFE0F",group:"people",keywords:["disbelief","exasperation","facepalm","man","man facepalming"]},{id:":woman_facepalming:",symbol:"\u{1F926}\u200D\u2640\uFE0F",group:"people",keywords:["disbelief","exasperation","facepalm","woman","woman facepalming"]},{id:":person_shrugging:",symbol:"\u{1F937}",group:"people",keywords:["doubt","ignorance","indifference","person shrugging","shrug"]},{id:":man_shrugging:",symbol:"\u{1F937}\u200D\u2642\uFE0F",group:"people",keywords:["doubt","ignorance","indifference","man","man shrugging","shrug"]},{id:":woman_shrugging:",symbol:"\u{1F937}\u200D\u2640\uFE0F",group:"people",keywords:["doubt","ignorance","indifference","shrug","woman","woman shrugging"]},{id:":person_getting_massage:",symbol:"\u{1F486}",group:"people",keywords:["face","massage","person getting massage","salon"]},{id:":man_getting_massage:",symbol:"\u{1F486}\u200D\u2642\uFE0F",group:"people",keywords:["face","man","man getting massage","massage"]},{id:":woman_getting_massage:",symbol:"\u{1F486}\u200D\u2640\uFE0F",group:"people",keywords:["face","massage","woman","woman getting massage"]},{id:":person_getting_haircut:",symbol:"\u{1F487}",group:"people",keywords:["barber","beauty","haircut","parlor","person getting haircut"]},{id:":man_getting_haircut:",symbol:"\u{1F487}\u200D\u2642\uFE0F",group:"people",keywords:["haircut","man","man getting haircut"]},{id:":woman_getting_haircut:",symbol:"\u{1F487}\u200D\u2640\uFE0F",group:"people",keywords:["haircut","woman","woman getting haircut"]},{id:":person_walking:",symbol:"\u{1F6B6}",group:"people",keywords:["hike","person walking","walk","walking"]},{id:":man_walking:",symbol:"\u{1F6B6}\u200D\u2642\uFE0F",group:"people",keywords:["hike","man","man walking","walk"]},{id:":woman_walking:",symbol:"\u{1F6B6}\u200D\u2640\uFE0F",group:"people",keywords:["hike","walk","woman","woman walking"]},{id:":person_running:",symbol:"\u{1F3C3}",group:"people",keywords:["marathon","person running","running"]},{id:":man_running:",symbol:"\u{1F3C3}\u200D\u2642\uFE0F",group:"people",keywords:["man","marathon","racing","running"]},{id:":woman_running:",symbol:"\u{1F3C3}\u200D\u2640\uFE0F",group:"people",keywords:["marathon","racing","running","woman"]},{id:":woman_dancing:",symbol:"\u{1F483}",group:"people",keywords:["dancing","woman"]},{id:":man_dancing:",symbol:"\u{1F57A}",group:"people",keywords:["dance","man","man dancing"]},{id:":people_with_bunny_ears:",symbol:"\u{1F46F}",group:"people",keywords:["bunny ear","dancer","partying","people with bunny ears"]},{id:":men_with_bunny_ears:",symbol:"\u{1F46F}\u200D\u2642\uFE0F",group:"people",keywords:["bunny ear","dancer","men","men with bunny ears","partying"]},{id:":women_with_bunny_ears:",symbol:"\u{1F46F}\u200D\u2640\uFE0F",group:"people",keywords:["bunny ear","dancer","partying","women","women with bunny ears"]},{id:":person_in_steamy_room:",symbol:"\u{1F9D6}",group:"people",keywords:["person in steamy room","sauna","steam room",""]},{id:":man_in_steamy_room:",symbol:"\u{1F9D6}\u200D\u2642\uFE0F",group:"people",keywords:["man in steamy room","sauna","steam room"]},{id:":woman_in_steamy_room:",symbol:"\u{1F9D6}\u200D\u2640\uFE0F",group:"people",keywords:["sauna","steam room","woman in steamy room"]},{id:":person_climbing:",symbol:"\u{1F9D7}",group:"people",keywords:["climber","person climbing"]},{id:":man_climbing:",symbol:"\u{1F9D7}\u200D\u2642\uFE0F",group:"people",keywords:["climber","man climbing"]},{id:":woman_climbing:",symbol:"\u{1F9D7}\u200D\u2640\uFE0F",group:"people",keywords:["climber","woman climbing"]},{id:":person_in_lotus_position:",symbol:"\u{1F9D8}",group:"people",keywords:["meditation","person in lotus position","yoga",""]},{id:":man_in_lotus_position:",symbol:"\u{1F9D8}\u200D\u2642\uFE0F",group:"people",keywords:["man in lotus position","meditation","yoga"]},{id:":woman_in_lotus_position:",symbol:"\u{1F9D8}\u200D\u2640\uFE0F",group:"people",keywords:["meditation","woman in lotus position","yoga"]},{id:":person_taking_bath:",symbol:"\u{1F6C0}",group:"people",keywords:["bath","bathtub","person taking bath"]},{id:":person_in_bed:",symbol:"\u{1F6CC}",group:"people",keywords:["hotel","person in bed","sleep"]},{id:":man_in_suit_levitating:",symbol:"\u{1F574}",group:"people",keywords:["business","man","man in suit levitating","suit"]},{id:":speaking_head:",symbol:"\u{1F5E3}",group:"people",keywords:["face","head","silhouette","speak","speaking"]},{id:":bust_in_silhouette:",symbol:"\u{1F464}",group:"people",keywords:["bust","bust in silhouette","silhouette"]},{id:":busts_in_silhouette:",symbol:"\u{1F465}",group:"people",keywords:["bust","busts in silhouette","silhouette"]},{id:":person_fencing:",symbol:"\u{1F93A}",group:"people",keywords:["fencer","fencing","person fencing","sword"]},{id:":horse_racing:",symbol:"\u{1F3C7}",group:"people",keywords:["horse","jockey","racehorse","racing"]},{id:":skier:",symbol:"\u26F7",group:"people",keywords:["ski","skier","snow"]},{id:":snowboarder:",symbol:"\u{1F3C2}",group:"people",keywords:["ski","snow","snowboard","snowboarder"]},{id:":person_golfing:",symbol:"\u{1F3CC}",group:"people",keywords:["ball","golf","person golfing"]},{id:":man_golfing:",symbol:"\u{1F3CC}\uFE0F\u200D\u2642\uFE0F",group:"people",keywords:["golf","man","man golfing"]},{id:":woman_golfing:",symbol:"\u{1F3CC}\uFE0F\u200D\u2640\uFE0F",group:"people",keywords:["golf","woman","woman golfing"]},{id:":person_surfing:",symbol:"\u{1F3C4}",group:"people",keywords:["person surfing","surfing"]},{id:":man_surfing:",symbol:"\u{1F3C4}\u200D\u2642\uFE0F",group:"people",keywords:["man","surfing"]},{id:":woman_surfing:",symbol:"\u{1F3C4}\u200D\u2640\uFE0F",group:"people",keywords:["surfing","woman"]},{id:":person_rowing_boat:",symbol:"\u{1F6A3}",group:"people",keywords:["boat","person rowing boat","rowboat"]},{id:":man_rowing_boat:",symbol:"\u{1F6A3}\u200D\u2642\uFE0F",group:"people",keywords:["boat","man","man rowing boat","rowboat"]},{id:":woman_rowing_boat:",symbol:"\u{1F6A3}\u200D\u2640\uFE0F",group:"people",keywords:["boat","rowboat","woman","woman rowing boat"]},{id:":person_swimming:",symbol:"\u{1F3CA}",group:"people",keywords:["person swimming","swim"]},{id:":man_swimming:",symbol:"\u{1F3CA}\u200D\u2642\uFE0F",group:"people",keywords:["man","man swimming","swim"]},{id:":woman_swimming:",symbol:"\u{1F3CA}\u200D\u2640\uFE0F",group:"people",keywords:["swim","woman","woman swimming"]},{id:":person_bouncing_ball:",symbol:"\u26F9",group:"people",keywords:["ball","person bouncing ball"]},{id:":man_bouncing_ball:",symbol:"\u26F9\uFE0F\u200D\u2642\uFE0F",group:"people",keywords:["ball","man","man bouncing ball"]},{id:":woman_bouncing_ball:",symbol:"\u26F9\uFE0F\u200D\u2640\uFE0F",group:"people",keywords:["ball","woman","woman bouncing ball"]},{id:":person_lifting_weights:",symbol:"\u{1F3CB}",group:"people",keywords:["lifter","person lifting weights","weight"]},{id:":man_lifting_weights:",symbol:"\u{1F3CB}\uFE0F\u200D\u2642\uFE0F",group:"people",keywords:["man","man lifting weights","weight lifter"]},{id:":woman_lifting_weights:",symbol:"\u{1F3CB}\uFE0F\u200D\u2640\uFE0F",group:"people",keywords:["weight lifter","woman","woman lifting weights"]},{id:":person_biking:",symbol:"\u{1F6B4}",group:"people",keywords:["bicycle","biking","cyclist","person biking"]},{id:":man_biking:",symbol:"\u{1F6B4}\u200D\u2642\uFE0F",group:"people",keywords:["bicycle","biking","cyclist","man"]},{id:":woman_biking:",symbol:"\u{1F6B4}\u200D\u2640\uFE0F",group:"people",keywords:["bicycle","biking","cyclist","woman"]},{id:":person_mountain_biking:",symbol:"\u{1F6B5}",group:"people",keywords:["bicycle","bicyclist","bike","cyclist","mountain","person mountain biking"]},{id:":man_mountain_biking:",symbol:"\u{1F6B5}\u200D\u2642\uFE0F",group:"people",keywords:["bicycle","bike","cyclist","man","man mountain biking","mountain"]},{id:":woman_mountain_biking:",symbol:"\u{1F6B5}\u200D\u2640\uFE0F",group:"people",keywords:["bicycle","bike","biking","cyclist","mountain","woman"]},{id:":racing_car:",symbol:"\u{1F3CE}",group:"people",keywords:["car","racing"]},{id:":motorcycle:",symbol:"\u{1F3CD}",group:"people",keywords:["motorcycle","racing"]},{id:":person_cartwheeling:",symbol:"\u{1F938}",group:"people",keywords:["cartwheel","gymnastics","person cartwheeling"]},{id:":man_cartwheeling:",symbol:"\u{1F938}\u200D\u2642\uFE0F",group:"people",keywords:["cartwheel","gymnastics","man","man cartwheeling"]},{id:":woman_cartwheeling:",symbol:"\u{1F938}\u200D\u2640\uFE0F",group:"people",keywords:["cartwheel","gymnastics","woman","woman cartwheeling"]},{id:":people_wrestling:",symbol:"\u{1F93C}",group:"people",keywords:["people wrestling","wrestle","wrestler"]},{id:":men_wrestling:",symbol:"\u{1F93C}\u200D\u2642\uFE0F",group:"people",keywords:["men","men wrestling","wrestle"]},{id:":women_wrestling:",symbol:"\u{1F93C}\u200D\u2640\uFE0F",group:"people",keywords:["women","women wrestling","wrestle"]},{id:":person_playing_water_polo:",symbol:"\u{1F93D}",group:"people",keywords:["person playing water polo","polo","water"]},{id:":man_playing_water_polo:",symbol:"\u{1F93D}\u200D\u2642\uFE0F",group:"people",keywords:["man","man playing water polo","water polo"]},{id:":woman_playing_water_polo:",symbol:"\u{1F93D}\u200D\u2640\uFE0F",group:"people",keywords:["water polo","woman","woman playing water polo"]},{id:":person_playing_handball:",symbol:"\u{1F93E}",group:"people",keywords:["ball","handball","person playing handball"]},{id:":man_playing_handball:",symbol:"\u{1F93E}\u200D\u2642\uFE0F",group:"people",keywords:["handball","man","man playing handball"]},{id:":woman_playing_handball:",symbol:"\u{1F93E}\u200D\u2640\uFE0F",group:"people",keywords:["handball","woman","woman playing handball"]},{id:":person_juggling:",symbol:"\u{1F939}",group:"people",keywords:["balance","juggle","multitask","person juggling","skill"]},{id:":man_juggling:",symbol:"\u{1F939}\u200D\u2642\uFE0F",group:"people",keywords:["juggling","man","multitask"]},{id:":woman_juggling:",symbol:"\u{1F939}\u200D\u2640\uFE0F",group:"people",keywords:["juggling","multitask","woman"]},{id:":man_and_woman_holding_hands:",symbol:"\u{1F46B}",group:"people",keywords:["couple","hand","hold","man","man and woman holding hands","woman"]},{id:":two_men_holding_hands:",symbol:"\u{1F46C}",group:"people",keywords:["couple","Gemini","man","twins","two men holding hands","zodiac"]},{id:":two_women_holding_hands:",symbol:"\u{1F46D}",group:"people",keywords:["couple","hand","two women holding hands","woman"]},{id:":kiss:",symbol:"\u{1F48F}",group:"people",keywords:["couple","kiss"]},{id:":kiss_woman_man:",symbol:"\u{1F469}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}",group:"people",keywords:["couple","kiss","man","woman"]},{id:":kiss_man_man:",symbol:"\u{1F468}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}",group:"people",keywords:["couple","kiss","man"]},{id:":kiss_woman_woman:",symbol:"\u{1F469}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}",group:"people",keywords:["couple","kiss","woman"]},{id:":couple_with_heart:",symbol:"\u{1F491}",group:"people",keywords:["couple","couple with heart","love"]},{id:":couple_with_heart_woman_man:",symbol:"\u{1F469}\u200D\u2764\uFE0F\u200D\u{1F468}",group:"people",keywords:["couple","couple with heart","love","man","woman"]},{id:":couple_with_heart_man_man:",symbol:"\u{1F468}\u200D\u2764\uFE0F\u200D\u{1F468}",group:"people",keywords:["couple","couple with heart","love","man"]},{id:":couple_with_heart_woman_woman:",symbol:"\u{1F469}\u200D\u2764\uFE0F\u200D\u{1F469}",group:"people",keywords:["couple","couple with heart","love","woman"]},{id:":family:",symbol:"\u{1F46A}",group:"people",keywords:["family"]},{id:":family_man_woman_boy:",symbol:"\u{1F468}\u200D\u{1F469}\u200D\u{1F466}",group:"people",keywords:["boy","family","man","woman"]},{id:":family_man_woman_girl:",symbol:"\u{1F468}\u200D\u{1F469}\u200D\u{1F467}",group:"people",keywords:["family","girl","man","woman"]},{id:":family_man_woman_girl_boy:",symbol:"\u{1F468}\u200D\u{1F469}\u200D\u{1F467}\u200D\u{1F466}",group:"people",keywords:["boy","family","girl","man","woman"]},{id:":family_man_woman_boy_boy:",symbol:"\u{1F468}\u200D\u{1F469}\u200D\u{1F466}\u200D\u{1F466}",group:"people",keywords:["boy","family","man","woman"]},{id:":family_man_woman_girl_girl:",symbol:"\u{1F468}\u200D\u{1F469}\u200D\u{1F467}\u200D\u{1F467}",group:"people",keywords:["family","girl","man","woman"]},{id:":family_man_man_boy:",symbol:"\u{1F468}\u200D\u{1F468}\u200D\u{1F466}",group:"people",keywords:["boy","family","man"]},{id:":family_man_man_girl:",symbol:"\u{1F468}\u200D\u{1F468}\u200D\u{1F467}",group:"people",keywords:["family","girl","man"]},{id:":family_man_man_girl_boy:",symbol:"\u{1F468}\u200D\u{1F468}\u200D\u{1F467}\u200D\u{1F466}",group:"people",keywords:["boy","family","girl","man"]},{id:":family_man_man_boy_boy:",symbol:"\u{1F468}\u200D\u{1F468}\u200D\u{1F466}\u200D\u{1F466}",group:"people",keywords:["boy","family","man"]},{id:":family_man_man_girl_girl:",symbol:"\u{1F468}\u200D\u{1F468}\u200D\u{1F467}\u200D\u{1F467}",group:"people",keywords:["family","girl","man"]},{id:":family_woman_woman_boy:",symbol:"\u{1F469}\u200D\u{1F469}\u200D\u{1F466}",group:"people",keywords:["boy","family","woman"]},{id:":family_woman_woman_girl:",symbol:"\u{1F469}\u200D\u{1F469}\u200D\u{1F467}",group:"people",keywords:["family","girl","woman"]},{id:":family_woman_woman_girl_boy:",symbol:"\u{1F469}\u200D\u{1F469}\u200D\u{1F467}\u200D\u{1F466}",group:"people",keywords:["boy","family","girl","woman"]},{id:":family_woman_woman_boy_boy:",symbol:"\u{1F469}\u200D\u{1F469}\u200D\u{1F466}\u200D\u{1F466}",group:"people",keywords:["boy","family","woman"]},{id:":family_woman_woman_girl_girl:",symbol:"\u{1F469}\u200D\u{1F469}\u200D\u{1F467}\u200D\u{1F467}",group:"people",keywords:["family","girl","woman"]},{id:":family_man_boy:",symbol:"\u{1F468}\u200D\u{1F466}",group:"people",keywords:["boy","family","man"]},{id:":family_man_boy_boy:",symbol:"\u{1F468}\u200D\u{1F466}\u200D\u{1F466}",group:"people",keywords:["boy","family","man"]},{id:":family_man_girl:",symbol:"\u{1F468}\u200D\u{1F467}",group:"people",keywords:["family","girl","man"]},{id:":family_man_girl_boy:",symbol:"\u{1F468}\u200D\u{1F467}\u200D\u{1F466}",group:"people",keywords:["boy","family","girl","man"]},{id:":family_man_girl_girl:",symbol:"\u{1F468}\u200D\u{1F467}\u200D\u{1F467}",group:"people",keywords:["family","girl","man"]},{id:":family_woman_boy:",symbol:"\u{1F469}\u200D\u{1F466}",group:"people",keywords:["boy","family","woman"]},{id:":family_woman_boy_boy:",symbol:"\u{1F469}\u200D\u{1F466}\u200D\u{1F466}",group:"people",keywords:["boy","family","woman"]},{id:":family_woman_girl:",symbol:"\u{1F469}\u200D\u{1F467}",group:"people",keywords:["family","girl","woman"]},{id:":family_woman_girl_boy:",symbol:"\u{1F469}\u200D\u{1F467}\u200D\u{1F466}",group:"people",keywords:["boy","family","girl","woman"]},{id:":family_woman_girl_girl:",symbol:"\u{1F469}\u200D\u{1F467}\u200D\u{1F467}",group:"people",keywords:["family","girl","woman"]},{id:":selfie:",symbol:"\u{1F933}",group:"people",keywords:["camera","phone","selfie"]},{id:":flexed_biceps:",symbol:"\u{1F4AA}",group:"people",keywords:["biceps","comic","flex","flexed biceps","muscle"]},{id:":backhand_index_pointing_left:",symbol:"\u{1F448}",group:"people",keywords:["backhand","backhand index pointing left","finger","hand","index","point"]},{id:":backhand_index_pointing_right:",symbol:"\u{1F449}",group:"people",keywords:["backhand","backhand index pointing right","finger","hand","index","point"]},{id:":index_pointing_up:",symbol:"\u261D",group:"people",keywords:["finger","hand","index","index pointing up","point","up"]},{id:":backhand_index_pointing_up:",symbol:"\u{1F446}",group:"people",keywords:["backhand","backhand index pointing up","finger","hand","point","up"]},{id:":middle_finger:",symbol:"\u{1F595}",group:"people",keywords:["finger","hand","middle finger"]},{id:":backhand_index_pointing_down:",symbol:"\u{1F447}",group:"people",keywords:["backhand","backhand index pointing down","down","finger","hand","point"]},{id:":victory_hand:",symbol:"\u270C",group:"people",keywords:["hand","v","victory"]},{id:":crossed_fingers:",symbol:"\u{1F91E}",group:"people",keywords:["cross","crossed fingers","finger","hand","luck"]},{id:":vulcan_salute:",symbol:"\u{1F596}",group:"people",keywords:["finger","hand","spock","vulcan","vulcan salute"]},{id:":sign_of_the_horns:",symbol:"\u{1F918}",group:"people",keywords:["finger","hand","horns","rock-on","sign of the horns"]},{id:":call_me_hand:",symbol:"\u{1F919}",group:"people",keywords:["call","call me hand","hand"]},{id:":hand_with_fingers_splayed:",symbol:"\u{1F590}",group:"people",keywords:["finger","hand","hand with fingers splayed","splayed"]},{id:":raised_hand:",symbol:"\u270B",group:"people",keywords:["hand","raised hand"]},{id:":ok_hand:",symbol:"\u{1F44C}",group:"people",keywords:["hand","OK"]},{id:":thumbs_up:",symbol:"\u{1F44D}",group:"people",keywords:["+1","hand","thumb","thumbs up","up"]},{id:":thumbs_down:",symbol:"\u{1F44E}",group:"people",keywords:["-1","down","hand","thumb","thumbs down"]},{id:":raised_fist:",symbol:"\u270A",group:"people",keywords:["clenched","fist","hand","punch","raised fist"]},{id:":oncoming_fist:",symbol:"\u{1F44A}",group:"people",keywords:["clenched","fist","hand","oncoming fist","punch"]},{id:":left-facing_fist:",symbol:"\u{1F91B}",group:"people",keywords:["fist","left-facing fist","leftwards"]},{id:":right-facing_fist:",symbol:"\u{1F91C}",group:"people",keywords:["fist","right-facing fist","rightwards"]},{id:":raised_back_of_hand:",symbol:"\u{1F91A}",group:"people",keywords:["backhand","raised","raised back of hand"]},{id:":waving_hand:",symbol:"\u{1F44B}",group:"people",keywords:["hand","wave","waving"]},{id:":love-you_gesture:",symbol:"\u{1F91F}",group:"people",keywords:["hand","ILY","love-you gesture"]},{id:":writing_hand:",symbol:"\u270D",group:"people",keywords:["hand","write","writing hand"]},{id:":clapping_hands:",symbol:"\u{1F44F}",group:"people",keywords:["clap","clapping hands","hand"]},{id:":open_hands:",symbol:"\u{1F450}",group:"people",keywords:["hand","open","open hands"]},{id:":raising_hands:",symbol:"\u{1F64C}",group:"people",keywords:["celebration","gesture","hand","hooray","raised","raising hands"]},{id:":palms_up_together:",symbol:"\u{1F932}",group:"people",keywords:["palms up together","prayer",""]},{id:":folded_hands:",symbol:"\u{1F64F}",group:"people",keywords:["ask","folded hands","hand","please","pray","thanks"]},{id:":handshake:",symbol:"\u{1F91D}",group:"people",keywords:["agreement","hand","handshake","meeting","shake"]},{id:":nail_polish:",symbol:"\u{1F485}",group:"people",keywords:["care","cosmetics","manicure","nail","polish"]},{id:":ear:",symbol:"\u{1F442}",group:"people",keywords:["body","ear"]},{id:":nose:",symbol:"\u{1F443}",group:"people",keywords:["body","nose"]},{id:":footprints:",symbol:"\u{1F463}",group:"people",keywords:["clothing","footprint","footprints","print"]},{id:":eyes:",symbol:"\u{1F440}",group:"people",keywords:["eye","eyes","face"]},{id:":eye:",symbol:"\u{1F441}",group:"people",keywords:["body","eye"]},{id:":eye_in_speech_bubble:",symbol:"\u{1F441}\uFE0F\u200D\u{1F5E8}\uFE0F",group:"people",keywords:["eye","eye in speech bubble","speech bubble","witness"]},{id:":brain:",symbol:"\u{1F9E0}",group:"people",keywords:["brain","intelligent"]},{id:":tongue:",symbol:"\u{1F445}",group:"people",keywords:["body","tongue"]},{id:":mouth:",symbol:"\u{1F444}",group:"people",keywords:["lips","mouth"]},{id:":kiss_mark:",symbol:"\u{1F48B}",group:"people",keywords:["kiss","kiss mark","lips"]},{id:":heart_with_arrow:",symbol:"\u{1F498}",group:"people",keywords:["arrow","cupid","heart with arrow"]},{id:":heart_with_ribbon:",symbol:"\u{1F49D}",group:"people",keywords:["heart with ribbon","ribbon","valentine"]},{id:":sparkling_heart:",symbol:"\u{1F496}",group:"people",keywords:["excited","sparkle","sparkling heart"]},{id:":growing_heart:",symbol:"\u{1F497}",group:"people",keywords:["excited","growing","growing heart","nervous","pulse"]},{id:":beating_heart:",symbol:"\u{1F493}",group:"people",keywords:["beating","beating heart","heartbeat","pulsating"]},{id:":revolving_hearts:",symbol:"\u{1F49E}",group:"people",keywords:["revolving","revolving hearts"]},{id:":two_hearts:",symbol:"\u{1F495}",group:"people",keywords:["love","two hearts"]},{id:":love_letter:",symbol:"\u{1F48C}",group:"people",keywords:["heart","letter","love","mail"]},{id:":heavy_heart_exclamation:",symbol:"\u2763",group:"people",keywords:["exclamation","heavy heart exclamation","mark","punctuation"]},{id:":broken_heart:",symbol:"\u{1F494}",group:"people",keywords:["break","broken","broken heart"]},{id:":red_heart:",symbol:"\u2764",group:"people",keywords:["heart","red heart"]},{id:":orange_heart:",symbol:"\u{1F9E1}",group:"people",keywords:["orange","orange heart"]},{id:":yellow_heart:",symbol:"\u{1F49B}",group:"people",keywords:["yellow","yellow heart"]},{id:":green_heart:",symbol:"\u{1F49A}",group:"people",keywords:["green","green heart"]},{id:":blue_heart:",symbol:"\u{1F499}",group:"people",keywords:["blue","blue heart"]},{id:":purple_heart:",symbol:"\u{1F49C}",group:"people",keywords:["purple","purple heart"]},{id:":black_heart:",symbol:"\u{1F5A4}",group:"people",keywords:["black","black heart","evil","wicked"]},{id:":heart_decoration:",symbol:"\u{1F49F}",group:"people",keywords:["heart","heart decoration"]},{id:":zzz:",symbol:"\u{1F4A4}",group:"people",keywords:["comic","sleep","zzz"]},{id:":anger_symbol:",symbol:"\u{1F4A2}",group:"people",keywords:["anger symbol","angry","comic","mad"]},{id:":bomb:",symbol:"\u{1F4A3}",group:"people",keywords:["bomb","comic"]},{id:":collision:",symbol:"\u{1F4A5}",group:"people",keywords:["boom","collision","comic"]},{id:":sweat_droplets:",symbol:"\u{1F4A6}",group:"people",keywords:["comic","splashing","sweat","sweat droplets"]},{id:":dashing_away:",symbol:"\u{1F4A8}",group:"people",keywords:["comic","dash","dashing away","running"]},{id:":dizzy:",symbol:"\u{1F4AB}",group:"people",keywords:["comic","dizzy","star"]},{id:":speech_balloon:",symbol:"\u{1F4AC}",group:"people",keywords:["balloon","bubble","comic","dialog","speech"]},{id:":left_speech_bubble:",symbol:"\u{1F5E8}",group:"people",keywords:["dialog","left speech bubble","speech"]},{id:":right_anger_bubble:",symbol:"\u{1F5EF}",group:"people",keywords:["angry","balloon","bubble","mad","right anger bubble"]},{id:":thought_balloon:",symbol:"\u{1F4AD}",group:"people",keywords:["balloon","bubble","comic","thought"]},{id:":hole:",symbol:"\u{1F573}",group:"people",keywords:["hole"]},{id:":glasses:",symbol:"\u{1F453}",group:"people",keywords:["clothing","eye","eyeglasses","eyewear","glasses"]},{id:":sunglasses:",symbol:"\u{1F576}",group:"people",keywords:["dark","eye","eyewear","glasses","sunglasses"]},{id:":necktie:",symbol:"\u{1F454}",group:"people",keywords:["clothing","necktie","tie"]},{id:":t-shirt:",symbol:"\u{1F455}",group:"people",keywords:["clothing","shirt","t-shirt","tshirt"]},{id:":jeans:",symbol:"\u{1F456}",group:"people",keywords:["clothing","jeans","pants","trousers"]},{id:":scarf:",symbol:"\u{1F9E3}",group:"people",keywords:["neck","scarf"]},{id:":gloves:",symbol:"\u{1F9E4}",group:"people",keywords:["gloves","hand"]},{id:":coat:",symbol:"\u{1F9E5}",group:"people",keywords:["coat","jacket"]},{id:":socks:",symbol:"\u{1F9E6}",group:"people",keywords:["socks","stocking"]},{id:":dress:",symbol:"\u{1F457}",group:"people",keywords:["clothing","dress"]},{id:":kimono:",symbol:"\u{1F458}",group:"people",keywords:["clothing","kimono"]},{id:":bikini:",symbol:"\u{1F459}",group:"people",keywords:["bikini","clothing","swim"]},{id:":woman\u2019s_clothes:",symbol:"\u{1F45A}",group:"people",keywords:["clothing","woman","woman\u2019s clothes"]},{id:":purse:",symbol:"\u{1F45B}",group:"people",keywords:["clothing","coin","purse"]},{id:":handbag:",symbol:"\u{1F45C}",group:"people",keywords:["bag","clothing","handbag","purse"]},{id:":clutch_bag:",symbol:"\u{1F45D}",group:"people",keywords:["bag","clothing","clutch bag","pouch"]},{id:":shopping_bags:",symbol:"\u{1F6CD}",group:"people",keywords:["bag","hotel","shopping","shopping bags"]},{id:":backpack:",symbol:"\u{1F392}",group:"people",keywords:["backpack","bag","rucksack","satchel","school"]},{id:":man\u2019s_shoe:",symbol:"\u{1F45E}",group:"people",keywords:["clothing","man","man\u2019s shoe","shoe"]},{id:":running_shoe:",symbol:"\u{1F45F}",group:"people",keywords:["athletic","clothing","running shoe","shoe","sneaker"]},{id:":high-heeled_shoe:",symbol:"\u{1F460}",group:"people",keywords:["clothing","heel","high-heeled shoe","shoe","woman"]},{id:":woman\u2019s_sandal:",symbol:"\u{1F461}",group:"people",keywords:["clothing","sandal","shoe","woman","woman\u2019s sandal"]},{id:":woman\u2019s_boot:",symbol:"\u{1F462}",group:"people",keywords:["boot","clothing","shoe","woman","woman\u2019s boot"]},{id:":crown:",symbol:"\u{1F451}",group:"people",keywords:["clothing","crown","king","queen"]},{id:":woman\u2019s_hat:",symbol:"\u{1F452}",group:"people",keywords:["clothing","hat","woman","woman\u2019s hat"]},{id:":top_hat:",symbol:"\u{1F3A9}",group:"people",keywords:["clothing","hat","top","tophat"]},{id:":graduation_cap:",symbol:"\u{1F393}",group:"people",keywords:["cap","celebration","clothing","graduation","hat"]},{id:":billed_cap:",symbol:"\u{1F9E2}",group:"people",keywords:["baseball cap","billed cap"]},{id:":rescue_worker\u2019s_helmet:",symbol:"\u26D1",group:"people",keywords:["aid","cross","face","hat","helmet","rescue worker\u2019s helmet"]},{id:":prayer_beads:",symbol:"\u{1F4FF}",group:"people",keywords:["beads","clothing","necklace","prayer","religion"]},{id:":lipstick:",symbol:"\u{1F484}",group:"people",keywords:["cosmetics","lipstick","makeup"]},{id:":ring:",symbol:"\u{1F48D}",group:"people",keywords:["diamond","ring"]},{id:":gem_stone:",symbol:"\u{1F48E}",group:"people",keywords:["diamond","gem","gem stone","jewel"]},{id:":monkey_face:",symbol:"\u{1F435}",group:"nature",keywords:["face","monkey"]},{id:":monkey:",symbol:"\u{1F412}",group:"nature",keywords:["monkey"]},{id:":gorilla:",symbol:"\u{1F98D}",group:"nature",keywords:["gorilla"]},{id:":dog_face:",symbol:"\u{1F436}",group:"nature",keywords:["dog","face","pet"]},{id:":dog:",symbol:"\u{1F415}",group:"nature",keywords:["dog","pet"]},{id:":poodle:",symbol:"\u{1F429}",group:"nature",keywords:["dog","poodle"]},{id:":wolf_face:",symbol:"\u{1F43A}",group:"nature",keywords:["face","wolf"]},{id:":fox_face:",symbol:"\u{1F98A}",group:"nature",keywords:["face","fox"]},{id:":cat_face:",symbol:"\u{1F431}",group:"nature",keywords:["cat","face","pet"]},{id:":cat:",symbol:"\u{1F408}",group:"nature",keywords:["cat","pet"]},{id:":lion_face:",symbol:"\u{1F981}",group:"nature",keywords:["face","Leo","lion","zodiac"]},{id:":tiger_face:",symbol:"\u{1F42F}",group:"nature",keywords:["face","tiger"]},{id:":tiger:",symbol:"\u{1F405}",group:"nature",keywords:["tiger"]},{id:":leopard:",symbol:"\u{1F406}",group:"nature",keywords:["leopard"]},{id:":horse_face:",symbol:"\u{1F434}",group:"nature",keywords:["face","horse"]},{id:":horse:",symbol:"\u{1F40E}",group:"nature",keywords:["equestrian","horse","racehorse","racing"]},{id:":unicorn_face:",symbol:"\u{1F984}",group:"nature",keywords:["face","unicorn"]},{id:":zebra:",symbol:"\u{1F993}",group:"nature",keywords:["stripe","zebra"]},{id:":deer:",symbol:"\u{1F98C}",group:"nature",keywords:["deer"]},{id:":cow_face:",symbol:"\u{1F42E}",group:"nature",keywords:["cow","face"]},{id:":ox:",symbol:"\u{1F402}",group:"nature",keywords:["bull","ox","Taurus","zodiac"]},{id:":water_buffalo:",symbol:"\u{1F403}",group:"nature",keywords:["buffalo","water"]},{id:":cow:",symbol:"\u{1F404}",group:"nature",keywords:["cow"]},{id:":pig_face:",symbol:"\u{1F437}",group:"nature",keywords:["face","pig"]},{id:":pig:",symbol:"\u{1F416}",group:"nature",keywords:["pig","sow"]},{id:":boar:",symbol:"\u{1F417}",group:"nature",keywords:["boar","pig"]},{id:":pig_nose:",symbol:"\u{1F43D}",group:"nature",keywords:["face","nose","pig"]},{id:":ram:",symbol:"\u{1F40F}",group:"nature",keywords:["Aries","male","ram","sheep","zodiac"]},{id:":ewe:",symbol:"\u{1F411}",group:"nature",keywords:["ewe","female","sheep"]},{id:":goat:",symbol:"\u{1F410}",group:"nature",keywords:["Capricorn","goat","zodiac"]},{id:":camel:",symbol:"\u{1F42A}",group:"nature",keywords:["camel","dromedary","hump"]},{id:":two-hump_camel:",symbol:"\u{1F42B}",group:"nature",keywords:["bactrian","camel","hump","two-hump camel"]},{id:":giraffe:",symbol:"\u{1F992}",group:"nature",keywords:["giraffe","spots"]},{id:":elephant:",symbol:"\u{1F418}",group:"nature",keywords:["elephant"]},{id:":rhinoceros:",symbol:"\u{1F98F}",group:"nature",keywords:["rhinoceros"]},{id:":mouse_face:",symbol:"\u{1F42D}",group:"nature",keywords:["face","mouse"]},{id:":mouse:",symbol:"\u{1F401}",group:"nature",keywords:["mouse"]},{id:":rat:",symbol:"\u{1F400}",group:"nature",keywords:["rat"]},{id:":hamster_face:",symbol:"\u{1F439}",group:"nature",keywords:["face","hamster","pet"]},{id:":rabbit_face:",symbol:"\u{1F430}",group:"nature",keywords:["bunny","face","pet","rabbit"]},{id:":rabbit:",symbol:"\u{1F407}",group:"nature",keywords:["bunny","pet","rabbit"]},{id:":chipmunk:",symbol:"\u{1F43F}",group:"nature",keywords:["chipmunk","squirrel"]},{id:":hedgehog:",symbol:"\u{1F994}",group:"nature",keywords:["hedgehog","spiny"]},{id:":bat:",symbol:"\u{1F987}",group:"nature",keywords:["bat","vampire"]},{id:":bear_face:",symbol:"\u{1F43B}",group:"nature",keywords:["bear","face"]},{id:":koala:",symbol:"\u{1F428}",group:"nature",keywords:["bear","koala"]},{id:":panda_face:",symbol:"\u{1F43C}",group:"nature",keywords:["face","panda"]},{id:":paw_prints:",symbol:"\u{1F43E}",group:"nature",keywords:["feet","paw","paw prints","print"]},{id:":turkey:",symbol:"\u{1F983}",group:"nature",keywords:["bird","turkey"]},{id:":chicken:",symbol:"\u{1F414}",group:"nature",keywords:["bird","chicken"]},{id:":rooster:",symbol:"\u{1F413}",group:"nature",keywords:["bird","rooster"]},{id:":hatching_chick:",symbol:"\u{1F423}",group:"nature",keywords:["baby","bird","chick","hatching"]},{id:":baby_chick:",symbol:"\u{1F424}",group:"nature",keywords:["baby","bird","chick"]},{id:":front-facing_baby_chick:",symbol:"\u{1F425}",group:"nature",keywords:["baby","bird","chick","front-facing baby chick"]},{id:":bird:",symbol:"\u{1F426}",group:"nature",keywords:["bird"]},{id:":penguin:",symbol:"\u{1F427}",group:"nature",keywords:["bird","penguin"]},{id:":dove:",symbol:"\u{1F54A}",group:"nature",keywords:["bird","dove","fly","peace"]},{id:":eagle:",symbol:"\u{1F985}",group:"nature",keywords:["bird","eagle"]},{id:":duck:",symbol:"\u{1F986}",group:"nature",keywords:["bird","duck"]},{id:":owl:",symbol:"\u{1F989}",group:"nature",keywords:["bird","owl","wise"]},{id:":frog_face:",symbol:"\u{1F438}",group:"nature",keywords:["face","frog"]},{id:":crocodile:",symbol:"\u{1F40A}",group:"nature",keywords:["crocodile"]},{id:":turtle:",symbol:"\u{1F422}",group:"nature",keywords:["terrapin","tortoise","turtle"]},{id:":lizard:",symbol:"\u{1F98E}",group:"nature",keywords:["lizard","reptile"]},{id:":snake:",symbol:"\u{1F40D}",group:"nature",keywords:["bearer","Ophiuchus","serpent","snake","zodiac"]},{id:":dragon_face:",symbol:"\u{1F432}",group:"nature",keywords:["dragon","face","fairy tale"]},{id:":dragon:",symbol:"\u{1F409}",group:"nature",keywords:["dragon","fairy tale"]},{id:":sauropod:",symbol:"\u{1F995}",group:"nature",keywords:["brachiosaurus","brontosaurus","diplodocus","sauropod"]},{id:":t-rex:",symbol:"\u{1F996}",group:"nature",keywords:["T-Rex","Tyrannosaurus Rex"]},{id:":spouting_whale:",symbol:"\u{1F433}",group:"nature",keywords:["face","spouting","whale"]},{id:":whale:",symbol:"\u{1F40B}",group:"nature",keywords:["whale"]},{id:":dolphin:",symbol:"\u{1F42C}",group:"nature",keywords:["dolphin","flipper"]},{id:":fish:",symbol:"\u{1F41F}",group:"nature",keywords:["fish","Pisces","zodiac"]},{id:":tropical_fish:",symbol:"\u{1F420}",group:"nature",keywords:["fish","tropical"]},{id:":blowfish:",symbol:"\u{1F421}",group:"nature",keywords:["blowfish","fish"]},{id:":shark:",symbol:"\u{1F988}",group:"nature",keywords:["fish","shark"]},{id:":octopus:",symbol:"\u{1F419}",group:"nature",keywords:["octopus"]},{id:":spiral_shell:",symbol:"\u{1F41A}",group:"nature",keywords:["shell","spiral"]},{id:":crab:",symbol:"\u{1F980}",group:"nature",keywords:["Cancer","crab","zodiac"]},{id:":shrimp:",symbol:"\u{1F990}",group:"nature",keywords:["food","shellfish","shrimp","small"]},{id:":squid:",symbol:"\u{1F991}",group:"nature",keywords:["food","molusc","squid"]},{id:":snail:",symbol:"\u{1F40C}",group:"nature",keywords:["snail"]},{id:":butterfly:",symbol:"\u{1F98B}",group:"nature",keywords:["butterfly","insect","pretty"]},{id:":bug:",symbol:"\u{1F41B}",group:"nature",keywords:["bug","insect"]},{id:":ant:",symbol:"\u{1F41C}",group:"nature",keywords:["ant","insect"]},{id:":honeybee:",symbol:"\u{1F41D}",group:"nature",keywords:["bee","honeybee","insect"]},{id:":lady_beetle:",symbol:"\u{1F41E}",group:"nature",keywords:["beetle","insect","lady beetle","ladybird","ladybug"]},{id:":cricket:",symbol:"\u{1F997}",group:"nature",keywords:["cricket","grasshopper",""]},{id:":spider:",symbol:"\u{1F577}",group:"nature",keywords:["insect","spider"]},{id:":spider_web:",symbol:"\u{1F578}",group:"nature",keywords:["spider","web"]},{id:":scorpion:",symbol:"\u{1F982}",group:"nature",keywords:["scorpio","Scorpio","scorpion","zodiac"]},{id:":bouquet:",symbol:"\u{1F490}",group:"nature",keywords:["bouquet","flower"]},{id:":cherry_blossom:",symbol:"\u{1F338}",group:"nature",keywords:["blossom","cherry","flower"]},{id:":white_flower:",symbol:"\u{1F4AE}",group:"nature",keywords:["flower","white flower"]},{id:":rosette:",symbol:"\u{1F3F5}",group:"nature",keywords:["plant","rosette"]},{id:":rose:",symbol:"\u{1F339}",group:"nature",keywords:["flower","rose"]},{id:":wilted_flower:",symbol:"\u{1F940}",group:"nature",keywords:["flower","wilted"]},{id:":hibiscus:",symbol:"\u{1F33A}",group:"nature",keywords:["flower","hibiscus"]},{id:":sunflower:",symbol:"\u{1F33B}",group:"nature",keywords:["flower","sun","sunflower"]},{id:":blossom:",symbol:"\u{1F33C}",group:"nature",keywords:["blossom","flower"]},{id:":tulip:",symbol:"\u{1F337}",group:"nature",keywords:["flower","tulip"]},{id:":seedling:",symbol:"\u{1F331}",group:"nature",keywords:["seedling","young"]},{id:":evergreen_tree:",symbol:"\u{1F332}",group:"nature",keywords:["evergreen tree","tree"]},{id:":deciduous_tree:",symbol:"\u{1F333}",group:"nature",keywords:["deciduous","shedding","tree"]},{id:":palm_tree:",symbol:"\u{1F334}",group:"nature",keywords:["palm","tree"]},{id:":cactus:",symbol:"\u{1F335}",group:"nature",keywords:["cactus","plant"]},{id:":sheaf_of_rice:",symbol:"\u{1F33E}",group:"nature",keywords:["ear","grain","rice","sheaf of rice"]},{id:":herb:",symbol:"\u{1F33F}",group:"nature",keywords:["herb","leaf"]},{id:":shamrock:",symbol:"\u2618",group:"nature",keywords:["plant","shamrock"]},{id:":four_leaf_clover:",symbol:"\u{1F340}",group:"nature",keywords:["4","clover","four","four-leaf clover","leaf"]},{id:":maple_leaf:",symbol:"\u{1F341}",group:"nature",keywords:["falling","leaf","maple"]},{id:":fallen_leaf:",symbol:"\u{1F342}",group:"nature",keywords:["fallen leaf","falling","leaf"]},{id:":leaf_fluttering_in_wind:",symbol:"\u{1F343}",group:"nature",keywords:["blow","flutter","leaf","leaf fluttering in wind","wind"]},{id:":grapes:",symbol:"\u{1F347}",group:"food",keywords:["fruit","grape","grapes"]},{id:":melon:",symbol:"\u{1F348}",group:"food",keywords:["fruit","melon"]},{id:":watermelon:",symbol:"\u{1F349}",group:"food",keywords:["fruit","watermelon"]},{id:":tangerine:",symbol:"\u{1F34A}",group:"food",keywords:["fruit","orange","tangerine"]},{id:":lemon:",symbol:"\u{1F34B}",group:"food",keywords:["citrus","fruit","lemon"]},{id:":banana:",symbol:"\u{1F34C}",group:"food",keywords:["banana","fruit"]},{id:":pineapple:",symbol:"\u{1F34D}",group:"food",keywords:["fruit","pineapple"]},{id:":red_apple:",symbol:"\u{1F34E}",group:"food",keywords:["apple","fruit","red"]},{id:":green_apple:",symbol:"\u{1F34F}",group:"food",keywords:["apple","fruit","green"]},{id:":pear:",symbol:"\u{1F350}",group:"food",keywords:["fruit","pear"]},{id:":peach:",symbol:"\u{1F351}",group:"food",keywords:["fruit","peach"]},{id:":cherries:",symbol:"\u{1F352}",group:"food",keywords:["berries","cherries","cherry","fruit","red"]},{id:":strawberry:",symbol:"\u{1F353}",group:"food",keywords:["berry","fruit","strawberry"]},{id:":kiwi_fruit:",symbol:"\u{1F95D}",group:"food",keywords:["food","fruit","kiwi"]},{id:":tomato:",symbol:"\u{1F345}",group:"food",keywords:["fruit","tomato","vegetable"]},{id:":coconut:",symbol:"\u{1F965}",group:"food",keywords:["coconut","palm","pi\xF1a colada"]},{id:":avocado:",symbol:"\u{1F951}",group:"food",keywords:["avocado","food","fruit"]},{id:":eggplant:",symbol:"\u{1F346}",group:"food",keywords:["aubergine","eggplant","vegetable"]},{id:":potato:",symbol:"\u{1F954}",group:"food",keywords:["food","potato","vegetable"]},{id:":carrot:",symbol:"\u{1F955}",group:"food",keywords:["carrot","food","vegetable"]},{id:":ear_of_corn:",symbol:"\u{1F33D}",group:"food",keywords:["corn","ear","ear of corn","maize","maze"]},{id:":hot_pepper:",symbol:"\u{1F336}",group:"food",keywords:["hot","pepper"]},{id:":cucumber:",symbol:"\u{1F952}",group:"food",keywords:["cucumber","food","pickle","vegetable"]},{id:":broccoli:",symbol:"\u{1F966}",group:"food",keywords:["broccoli","wild cabbage"]},{id:":mushroom:",symbol:"\u{1F344}",group:"food",keywords:["mushroom","toadstool"]},{id:":peanuts:",symbol:"\u{1F95C}",group:"food",keywords:["food","nut","peanut","peanuts","vegetable"]},{id:":chestnut:",symbol:"\u{1F330}",group:"food",keywords:["chestnut","plant"]},{id:":bread:",symbol:"\u{1F35E}",group:"food",keywords:["bread","loaf"]},{id:":croissant:",symbol:"\u{1F950}",group:"food",keywords:["bread","crescent roll","croissant","food","french"]},{id:":baguette_bread:",symbol:"\u{1F956}",group:"food",keywords:["baguette","bread","food","french"]},{id:":pretzel:",symbol:"\u{1F968}",group:"food",keywords:["pretzel","twisted",""]},{id:":pancakes:",symbol:"\u{1F95E}",group:"food",keywords:["cr\xEApe","food","hotcake","pancake","pancakes"]},{id:":cheese_wedge:",symbol:"\u{1F9C0}",group:"food",keywords:["cheese","cheese wedge"]},{id:":meat_on_bone:",symbol:"\u{1F356}",group:"food",keywords:["bone","meat","meat on bone"]},{id:":poultry_leg:",symbol:"\u{1F357}",group:"food",keywords:["bone","chicken","drumstick","leg","poultry"]},{id:":cut_of_meat:",symbol:"\u{1F969}",group:"food",keywords:["chop","cut of meat","lambchop","porkchop","steak"]},{id:":bacon:",symbol:"\u{1F953}",group:"food",keywords:["bacon","food","meat"]},{id:":hamburger:",symbol:"\u{1F354}",group:"food",keywords:["burger","hamburger"]},{id:":french_fries:",symbol:"\u{1F35F}",group:"food",keywords:["french","fries"]},{id:":pizza:",symbol:"\u{1F355}",group:"food",keywords:["cheese","pizza","slice"]},{id:":hot_dog:",symbol:"\u{1F32D}",group:"food",keywords:["frankfurter","hot dog","hotdog","sausage"]},{id:":sandwich:",symbol:"\u{1F96A}",group:"food",keywords:["bread","sandwich"]},{id:":taco:",symbol:"\u{1F32E}",group:"food",keywords:["mexican","taco"]},{id:":burrito:",symbol:"\u{1F32F}",group:"food",keywords:["burrito","mexican","wrap"]},{id:":stuffed_flatbread:",symbol:"\u{1F959}",group:"food",keywords:["falafel","flatbread","food","gyro","kebab","stuffed"]},{id:":egg:",symbol:"\u{1F95A}",group:"food",keywords:["egg","food"]},{id:":cooking:",symbol:"\u{1F373}",group:"food",keywords:["cooking","egg","frying","pan"]},{id:":shallow_pan_of_food:",symbol:"\u{1F958}",group:"food",keywords:["casserole","food","paella","pan","shallow","shallow pan of food"]},{id:":pot_of_food:",symbol:"\u{1F372}",group:"food",keywords:["pot","pot of food","stew"]},{id:":bowl_with_spoon:",symbol:"\u{1F963}",group:"food",keywords:["bowl with spoon","breakfast","cereal","congee",""]},{id:":green_salad:",symbol:"\u{1F957}",group:"food",keywords:["food","green","salad"]},{id:":popcorn:",symbol:"\u{1F37F}",group:"food",keywords:["popcorn"]},{id:":canned_food:",symbol:"\u{1F96B}",group:"food",keywords:["can","canned food"]},{id:":bento_box:",symbol:"\u{1F371}",group:"food",keywords:["bento","box"]},{id:":rice_cracker:",symbol:"\u{1F358}",group:"food",keywords:["cracker","rice"]},{id:":rice_ball:",symbol:"\u{1F359}",group:"food",keywords:["ball","Japanese","rice"]},{id:":cooked_rice:",symbol:"\u{1F35A}",group:"food",keywords:["cooked","rice"]},{id:":curry_rice:",symbol:"\u{1F35B}",group:"food",keywords:["curry","rice"]},{id:":steaming_bowl:",symbol:"\u{1F35C}",group:"food",keywords:["bowl","noodle","ramen","steaming"]},{id:":spaghetti:",symbol:"\u{1F35D}",group:"food",keywords:["pasta","spaghetti"]},{id:":roasted_sweet_potato:",symbol:"\u{1F360}",group:"food",keywords:["potato","roasted","sweet"]},{id:":oden:",symbol:"\u{1F362}",group:"food",keywords:["kebab","oden","seafood","skewer","stick"]},{id:":sushi:",symbol:"\u{1F363}",group:"food",keywords:["sushi"]},{id:":fried_shrimp:",symbol:"\u{1F364}",group:"food",keywords:["fried","prawn","shrimp","tempura"]},{id:":fish_cake_with_swirl:",symbol:"\u{1F365}",group:"food",keywords:["cake","fish","fish cake with swirl","pastry","swirl"]},{id:":dango:",symbol:"\u{1F361}",group:"food",keywords:["dango","dessert","Japanese","skewer","stick","sweet"]},{id:":dumpling:",symbol:"\u{1F95F}",group:"food",keywords:["dumpling","empanada","gy\u014Dza","jiaozi","pierogi","potsticker"]},{id:":fortune_cookie:",symbol:"\u{1F960}",group:"food",keywords:["fortune cookie","prophecy"]},{id:":takeout_box:",symbol:"\u{1F961}",group:"food",keywords:["oyster pail","takeout box"]},{id:":soft_ice_cream:",symbol:"\u{1F366}",group:"food",keywords:["cream","dessert","ice","icecream","soft","sweet"]},{id:":shaved_ice:",symbol:"\u{1F367}",group:"food",keywords:["dessert","ice","shaved","sweet"]},{id:":ice_cream:",symbol:"\u{1F368}",group:"food",keywords:["cream","dessert","ice","sweet"]},{id:":doughnut:",symbol:"\u{1F369}",group:"food",keywords:["dessert","donut","doughnut","sweet"]},{id:":cookie:",symbol:"\u{1F36A}",group:"food",keywords:["cookie","dessert","sweet"]},{id:":birthday_cake:",symbol:"\u{1F382}",group:"food",keywords:["birthday","cake","celebration","dessert","pastry","sweet"]},{id:":shortcake:",symbol:"\u{1F370}",group:"food",keywords:["cake","dessert","pastry","shortcake","slice","sweet"]},{id:":pie:",symbol:"\u{1F967}",group:"food",keywords:["filling","pastry","pie",""]},{id:":chocolate_bar:",symbol:"\u{1F36B}",group:"food",keywords:["bar","chocolate","dessert","sweet"]},{id:":candy:",symbol:"\u{1F36C}",group:"food",keywords:["candy","dessert","sweet"]},{id:":lollipop:",symbol:"\u{1F36D}",group:"food",keywords:["candy","dessert","lollipop","sweet"]},{id:":custard:",symbol:"\u{1F36E}",group:"food",keywords:["custard","dessert","pudding","sweet"]},{id:":honey_pot:",symbol:"\u{1F36F}",group:"food",keywords:["honey","honeypot","pot","sweet"]},{id:":baby_bottle:",symbol:"\u{1F37C}",group:"food",keywords:["baby","bottle","drink","milk"]},{id:":glass_of_milk:",symbol:"\u{1F95B}",group:"food",keywords:["drink","glass","glass of milk","milk"]},{id:":hot_beverage:",symbol:"\u2615",group:"food",keywords:["beverage","coffee","drink","hot","steaming","tea"]},{id:":teacup_without_handle:",symbol:"\u{1F375}",group:"food",keywords:["beverage","cup","drink","tea","teacup","teacup without handle"]},{id:":sake:",symbol:"\u{1F376}",group:"food",keywords:["bar","beverage","bottle","cup","drink","sake"]},{id:":bottle_with_popping_cork:",symbol:"\u{1F37E}",group:"food",keywords:["bar","bottle","bottle with popping cork","cork","drink","popping"]},{id:":wine_glass:",symbol:"\u{1F377}",group:"food",keywords:["bar","beverage","drink","glass","wine"]},{id:":cocktail_glass:",symbol:"\u{1F378}",group:"food",keywords:["bar","cocktail","drink","glass"]},{id:":tropical_drink:",symbol:"\u{1F379}",group:"food",keywords:["bar","drink","tropical"]},{id:":beer_mug:",symbol:"\u{1F37A}",group:"food",keywords:["bar","beer","drink","mug"]},{id:":clinking_beer_mugs:",symbol:"\u{1F37B}",group:"food",keywords:["bar","beer","clink","clinking beer mugs","drink","mug"]},{id:":clinking_glasses:",symbol:"\u{1F942}",group:"food",keywords:["celebrate","clink","clinking glasses","drink","glass"]},{id:":tumbler_glass:",symbol:"\u{1F943}",group:"food",keywords:["glass","liquor","shot","tumbler","whisky"]},{id:":cup_with_straw:",symbol:"\u{1F964}",group:"food",keywords:["cup with straw","juice","soda",""]},{id:":chopsticks:",symbol:"\u{1F962}",group:"food",keywords:["chopsticks","hashi",""]},{id:":fork_and_knife_with_plate:",symbol:"\u{1F37D}",group:"food",keywords:["cooking","fork","fork and knife with plate","knife","plate"]},{id:":fork_and_knife:",symbol:"\u{1F374}",group:"food",keywords:["cooking","cutlery","fork","fork and knife","knife"]},{id:":spoon:",symbol:"\u{1F944}",group:"food",keywords:["spoon","tableware"]},{id:":kitchen_knife:",symbol:"\u{1F52A}",group:"food",keywords:["cooking","hocho","kitchen knife","knife","tool","weapon"]},{id:":amphora:",symbol:"\u{1F3FA}",group:"food",keywords:["amphora","Aquarius","cooking","drink","jug","zodiac"]},{id:":globe_showing_europe-africa:",symbol:"\u{1F30D}",group:"travel",keywords:["Africa","earth","Europe","globe","globe showing Europe-Africa","world"]},{id:":globe_showing_americas:",symbol:"\u{1F30E}",group:"travel",keywords:["Americas","earth","globe","globe showing Americas","world"]},{id:":globe_showing_asia-australia:",symbol:"\u{1F30F}",group:"travel",keywords:["Asia","Australia","earth","globe","globe showing Asia-Australia","world"]},{id:":globe_with_meridians:",symbol:"\u{1F310}",group:"travel",keywords:["earth","globe","globe with meridians","meridians","world"]},{id:":world_map:",symbol:"\u{1F5FA}",group:"travel",keywords:["map","world"]},{id:":map_of_japan:",symbol:"\u{1F5FE}",group:"travel",keywords:["Japan","map","map of Japan"]},{id:":snow-capped_mountain:",symbol:"\u{1F3D4}",group:"travel",keywords:["cold","mountain","snow","snow-capped mountain"]},{id:":mountain:",symbol:"\u26F0",group:"travel",keywords:["mountain"]},{id:":volcano:",symbol:"\u{1F30B}",group:"travel",keywords:["eruption","mountain","volcano"]},{id:":mount_fuji:",symbol:"\u{1F5FB}",group:"travel",keywords:["fuji","mount fuji","mountain"]},{id:":camping:",symbol:"\u{1F3D5}",group:"travel",keywords:["camping"]},{id:":beach_with_umbrella:",symbol:"\u{1F3D6}",group:"travel",keywords:["beach","beach with umbrella","umbrella"]},{id:":desert:",symbol:"\u{1F3DC}",group:"travel",keywords:["desert"]},{id:":desert_island:",symbol:"\u{1F3DD}",group:"travel",keywords:["desert","island"]},{id:":national_park:",symbol:"\u{1F3DE}",group:"travel",keywords:["national park","park"]},{id:":stadium:",symbol:"\u{1F3DF}",group:"travel",keywords:["stadium"]},{id:":classical_building:",symbol:"\u{1F3DB}",group:"travel",keywords:["classical","classical building"]},{id:":building_construction:",symbol:"\u{1F3D7}",group:"travel",keywords:["building construction","construction"]},{id:":houses:",symbol:"\u{1F3D8}",group:"travel",keywords:["houses"]},{id:":derelict_house:",symbol:"\u{1F3DA}",group:"travel",keywords:["derelict","house"]},{id:":house:",symbol:"\u{1F3E0}",group:"travel",keywords:["home","house"]},{id:":house_with_garden:",symbol:"\u{1F3E1}",group:"travel",keywords:["garden","home","house","house with garden"]},{id:":office_building:",symbol:"\u{1F3E2}",group:"travel",keywords:["building","office building"]},{id:":japanese_post_office:",symbol:"\u{1F3E3}",group:"travel",keywords:["Japanese","Japanese post office","post"]},{id:":post_office:",symbol:"\u{1F3E4}",group:"travel",keywords:["European","post","post office"]},{id:":hospital:",symbol:"\u{1F3E5}",group:"travel",keywords:["doctor","hospital","medicine"]},{id:":bank:",symbol:"\u{1F3E6}",group:"travel",keywords:["bank","building"]},{id:":hotel:",symbol:"\u{1F3E8}",group:"travel",keywords:["building","hotel"]},{id:":love_hotel:",symbol:"\u{1F3E9}",group:"travel",keywords:["hotel","love"]},{id:":convenience_store:",symbol:"\u{1F3EA}",group:"travel",keywords:["convenience","store"]},{id:":school:",symbol:"\u{1F3EB}",group:"travel",keywords:["building","school"]},{id:":department_store:",symbol:"\u{1F3EC}",group:"travel",keywords:["department","store"]},{id:":factory:",symbol:"\u{1F3ED}",group:"travel",keywords:["building","factory"]},{id:":japanese_castle:",symbol:"\u{1F3EF}",group:"travel",keywords:["castle","Japanese"]},{id:":castle:",symbol:"\u{1F3F0}",group:"travel",keywords:["castle","European"]},{id:":wedding:",symbol:"\u{1F492}",group:"travel",keywords:["chapel","romance","wedding"]},{id:":tokyo_tower:",symbol:"\u{1F5FC}",group:"travel",keywords:["Tokyo","tower"]},{id:":statue_of_liberty:",symbol:"\u{1F5FD}",group:"travel",keywords:["liberty","statue","Statue of Liberty"]},{id:":church:",symbol:"\u26EA",group:"travel",keywords:["Christian","church","cross","religion"]},{id:":mosque:",symbol:"\u{1F54C}",group:"travel",keywords:["islam","mosque","Muslim","religion"]},{id:":synagogue:",symbol:"\u{1F54D}",group:"travel",keywords:["Jew","Jewish","religion","synagogue","temple"]},{id:":shinto_shrine:",symbol:"\u26E9",group:"travel",keywords:["religion","shinto","shrine"]},{id:":kaaba:",symbol:"\u{1F54B}",group:"travel",keywords:["islam","kaaba","Muslim","religion"]},{id:":fountain:",symbol:"\u26F2",group:"travel",keywords:["fountain"]},{id:":tent:",symbol:"\u26FA",group:"travel",keywords:["camping","tent"]},{id:":foggy:",symbol:"\u{1F301}",group:"travel",keywords:["fog","foggy"]},{id:":night_with_stars:",symbol:"\u{1F303}",group:"travel",keywords:["night","night with stars","star"]},{id:":cityscape:",symbol:"\u{1F3D9}",group:"travel",keywords:["city","cityscape"]},{id:":sunrise_over_mountains:",symbol:"\u{1F304}",group:"travel",keywords:["morning","mountain","sun","sunrise","sunrise over mountains"]},{id:":sunrise:",symbol:"\u{1F305}",group:"travel",keywords:["morning","sun","sunrise"]},{id:":cityscape_at_dusk:",symbol:"\u{1F306}",group:"travel",keywords:["city","cityscape at dusk","dusk","evening","landscape","sunset"]},{id:":sunset:",symbol:"\u{1F307}",group:"travel",keywords:["dusk","sun","sunset"]},{id:":bridge_at_night:",symbol:"\u{1F309}",group:"travel",keywords:["bridge","bridge at night","night"]},{id:":hot_springs:",symbol:"\u2668",group:"travel",keywords:["hot","hotsprings","springs","steaming"]},{id:":milky_way:",symbol:"\u{1F30C}",group:"travel",keywords:["milky way","space"]},{id:":carousel_horse:",symbol:"\u{1F3A0}",group:"travel",keywords:["carousel","horse"]},{id:":ferris_wheel:",symbol:"\u{1F3A1}",group:"travel",keywords:["amusement park","ferris","wheel"]},{id:":roller_coaster:",symbol:"\u{1F3A2}",group:"travel",keywords:["amusement park","coaster","roller"]},{id:":barber_pole:",symbol:"\u{1F488}",group:"travel",keywords:["barber","haircut","pole"]},{id:":circus_tent:",symbol:"\u{1F3AA}",group:"travel",keywords:["circus","tent"]},{id:":locomotive:",symbol:"\u{1F682}",group:"travel",keywords:["engine","locomotive","railway","steam","train"]},{id:":railway_car:",symbol:"\u{1F683}",group:"travel",keywords:["car","electric","railway","train","tram","trolleybus"]},{id:":high-speed_train:",symbol:"\u{1F684}",group:"travel",keywords:["high-speed train","railway","shinkansen","speed","train"]},{id:":bullet_train:",symbol:"\u{1F685}",group:"travel",keywords:["bullet","railway","shinkansen","speed","train"]},{id:":train:",symbol:"\u{1F686}",group:"travel",keywords:["railway","train"]},{id:":metro:",symbol:"\u{1F687}",group:"travel",keywords:["metro","subway"]},{id:":light_rail:",symbol:"\u{1F688}",group:"travel",keywords:["light rail","railway"]},{id:":station:",symbol:"\u{1F689}",group:"travel",keywords:["railway","station","train"]},{id:":tram:",symbol:"\u{1F68A}",group:"travel",keywords:["tram","trolleybus"]},{id:":monorail:",symbol:"\u{1F69D}",group:"travel",keywords:["monorail","vehicle"]},{id:":mountain_railway:",symbol:"\u{1F69E}",group:"travel",keywords:["car","mountain","railway"]},{id:":tram_car:",symbol:"\u{1F68B}",group:"travel",keywords:["car","tram","trolleybus"]},{id:":bus:",symbol:"\u{1F68C}",group:"travel",keywords:["bus","vehicle"]},{id:":oncoming_bus:",symbol:"\u{1F68D}",group:"travel",keywords:["bus","oncoming"]},{id:":trolleybus:",symbol:"\u{1F68E}",group:"travel",keywords:["bus","tram","trolley","trolleybus"]},{id:":minibus:",symbol:"\u{1F690}",group:"travel",keywords:["bus","minibus"]},{id:":ambulance:",symbol:"\u{1F691}",group:"travel",keywords:["ambulance","vehicle"]},{id:":fire_engine:",symbol:"\u{1F692}",group:"travel",keywords:["engine","fire","truck"]},{id:":police_car:",symbol:"\u{1F693}",group:"travel",keywords:["car","patrol","police"]},{id:":oncoming_police_car:",symbol:"\u{1F694}",group:"travel",keywords:["car","oncoming","police"]},{id:":taxi:",symbol:"\u{1F695}",group:"travel",keywords:["taxi","vehicle"]},{id:":oncoming_taxi:",symbol:"\u{1F696}",group:"travel",keywords:["oncoming","taxi"]},{id:":automobile:",symbol:"\u{1F697}",group:"travel",keywords:["automobile","car"]},{id:":oncoming_automobile:",symbol:"\u{1F698}",group:"travel",keywords:["automobile","car","oncoming"]},{id:":sport_utility_vehicle:",symbol:"\u{1F699}",group:"travel",keywords:["recreational","sport utility","sport utility vehicle"]},{id:":delivery_truck:",symbol:"\u{1F69A}",group:"travel",keywords:["delivery","truck"]},{id:":articulated_lorry:",symbol:"\u{1F69B}",group:"travel",keywords:["articulated lorry","lorry","semi","truck"]},{id:":tractor:",symbol:"\u{1F69C}",group:"travel",keywords:["tractor","vehicle"]},{id:":bicycle:",symbol:"\u{1F6B2}",group:"travel",keywords:["bicycle","bike"]},{id:":kick_scooter:",symbol:"\u{1F6F4}",group:"travel",keywords:["kick","scooter"]},{id:":motor_scooter:",symbol:"\u{1F6F5}",group:"travel",keywords:["motor","scooter"]},{id:":bus_stop:",symbol:"\u{1F68F}",group:"travel",keywords:["bus","busstop","stop"]},{id:":motorway:",symbol:"\u{1F6E3}",group:"travel",keywords:["highway","motorway","road"]},{id:":railway_track:",symbol:"\u{1F6E4}",group:"travel",keywords:["railway","railway track","train"]},{id:":oil_drum:",symbol:"\u{1F6E2}",group:"travel",keywords:["drum","oil"]},{id:":fuel_pump:",symbol:"\u26FD",group:"travel",keywords:["diesel","fuel","fuelpump","gas","pump","station"]},{id:":police_car_light:",symbol:"\u{1F6A8}",group:"travel",keywords:["beacon","car","light","police","revolving"]},{id:":horizontal_traffic_light:",symbol:"\u{1F6A5}",group:"travel",keywords:["horizontal traffic light","light","signal","traffic"]},{id:":vertical_traffic_light:",symbol:"\u{1F6A6}",group:"travel",keywords:["light","signal","traffic","vertical traffic light"]},{id:":stop_sign:",symbol:"\u{1F6D1}",group:"travel",keywords:["octagonal","sign","stop"]},{id:":construction:",symbol:"\u{1F6A7}",group:"travel",keywords:["barrier","construction"]},{id:":anchor:",symbol:"\u2693",group:"travel",keywords:["anchor","ship","tool"]},{id:":sailboat:",symbol:"\u26F5",group:"travel",keywords:["boat","resort","sailboat","sea","yacht"]},{id:":canoe:",symbol:"\u{1F6F6}",group:"travel",keywords:["boat","canoe"]},{id:":speedboat:",symbol:"\u{1F6A4}",group:"travel",keywords:["boat","speedboat"]},{id:":passenger_ship:",symbol:"\u{1F6F3}",group:"travel",keywords:["passenger","ship"]},{id:":ferry:",symbol:"\u26F4",group:"travel",keywords:["boat","ferry","passenger"]},{id:":motor_boat:",symbol:"\u{1F6E5}",group:"travel",keywords:["boat","motor boat","motorboat"]},{id:":ship:",symbol:"\u{1F6A2}",group:"travel",keywords:["boat","passenger","ship"]},{id:":airplane:",symbol:"\u2708",group:"travel",keywords:["aeroplane","airplane"]},{id:":small_airplane:",symbol:"\u{1F6E9}",group:"travel",keywords:["aeroplane","airplane","small airplane"]},{id:":airplane_departure:",symbol:"\u{1F6EB}",group:"travel",keywords:["aeroplane","airplane","check-in","departure","departures"]},{id:":airplane_arrival:",symbol:"\u{1F6EC}",group:"travel",keywords:["aeroplane","airplane","airplane arrival","arrivals","arriving","landing"]},{id:":seat:",symbol:"\u{1F4BA}",group:"travel",keywords:["chair","seat"]},{id:":helicopter:",symbol:"\u{1F681}",group:"travel",keywords:["helicopter","vehicle"]},{id:":suspension_railway:",symbol:"\u{1F69F}",group:"travel",keywords:["railway","suspension"]},{id:":mountain_cableway:",symbol:"\u{1F6A0}",group:"travel",keywords:["cable","gondola","mountain","mountain cableway"]},{id:":aerial_tramway:",symbol:"\u{1F6A1}",group:"travel",keywords:["aerial","cable","car","gondola","tramway"]},{id:":satellite:",symbol:"\u{1F6F0}",group:"travel",keywords:["satellite","space"]},{id:":rocket:",symbol:"\u{1F680}",group:"travel",keywords:["rocket","space"]},{id:":flying_saucer:",symbol:"\u{1F6F8}",group:"travel",keywords:["flying saucer","UFO"]},{id:":bellhop_bell:",symbol:"\u{1F6CE}",group:"travel",keywords:["bell","bellhop","hotel"]},{id:":hourglass_done:",symbol:"\u231B",group:"travel",keywords:["hourglass done","sand","timer"]},{id:":hourglass_not_done:",symbol:"\u23F3",group:"travel",keywords:["hourglass","hourglass not done","sand","timer"]},{id:":watch:",symbol:"\u231A",group:"travel",keywords:["clock","watch"]},{id:":alarm_clock:",symbol:"\u23F0",group:"travel",keywords:["alarm","clock"]},{id:":stopwatch:",symbol:"\u23F1",group:"travel",keywords:["clock","stopwatch"]},{id:":timer_clock:",symbol:"\u23F2",group:"travel",keywords:["clock","timer"]},{id:":mantelpiece_clock:",symbol:"\u{1F570}",group:"travel",keywords:["clock","mantelpiece clock"]},{id:":twelve_o\u2019clock:",symbol:"\u{1F55B}",group:"travel",keywords:["00","12","12:00","clock","o\u2019clock","twelve"]},{id:":twelve-thirty:",symbol:"\u{1F567}",group:"travel",keywords:["12","12:30","clock","thirty","twelve","twelve-thirty"]},{id:":one_o\u2019clock:",symbol:"\u{1F550}",group:"travel",keywords:["00","1","1:00","clock","o\u2019clock","one"]},{id:":one-thirty:",symbol:"\u{1F55C}",group:"travel",keywords:["1","1:30","clock","one","one-thirty","thirty"]},{id:":two_o\u2019clock:",symbol:"\u{1F551}",group:"travel",keywords:["00","2","2:00","clock","o\u2019clock","two"]},{id:":two-thirty:",symbol:"\u{1F55D}",group:"travel",keywords:["2","2:30","clock","thirty","two","two-thirty"]},{id:":three_o\u2019clock:",symbol:"\u{1F552}",group:"travel",keywords:["00","3","3:00","clock","o\u2019clock","three"]},{id:":three-thirty:",symbol:"\u{1F55E}",group:"travel",keywords:["3","3:30","clock","thirty","three","three-thirty"]},{id:":four_o\u2019clock:",symbol:"\u{1F553}",group:"travel",keywords:["00","4","4:00","clock","four","o\u2019clock"]},{id:":four-thirty:",symbol:"\u{1F55F}",group:"travel",keywords:["4","4:30","clock","four","four-thirty","thirty"]},{id:":five_o\u2019clock:",symbol:"\u{1F554}",group:"travel",keywords:["00","5","5:00","clock","five","o\u2019clock"]},{id:":five-thirty:",symbol:"\u{1F560}",group:"travel",keywords:["5","5:30","clock","five","five-thirty","thirty"]},{id:":six_o\u2019clock:",symbol:"\u{1F555}",group:"travel",keywords:["00","6","6:00","clock","o\u2019clock","six"]},{id:":six-thirty:",symbol:"\u{1F561}",group:"travel",keywords:["6","6:30","clock","six","six-thirty","thirty"]},{id:":seven_o\u2019clock:",symbol:"\u{1F556}",group:"travel",keywords:["00","7","7:00","clock","o\u2019clock","seven"]},{id:":seven-thirty:",symbol:"\u{1F562}",group:"travel",keywords:["7","7:30","clock","seven","seven-thirty","thirty"]},{id:":eight_o\u2019clock:",symbol:"\u{1F557}",group:"travel",keywords:["00","8","8:00","clock","eight","o\u2019clock"]},{id:":eight-thirty:",symbol:"\u{1F563}",group:"travel",keywords:["8","8:30","clock","eight","eight-thirty","thirty"]},{id:":nine_o\u2019clock:",symbol:"\u{1F558}",group:"travel",keywords:["00","9","9:00","clock","nine","o\u2019clock"]},{id:":nine-thirty:",symbol:"\u{1F564}",group:"travel",keywords:["9","9:30","clock","nine","nine-thirty","thirty"]},{id:":ten_o\u2019clock:",symbol:"\u{1F559}",group:"travel",keywords:["00","10","10:00","clock","o\u2019clock","ten"]},{id:":ten-thirty:",symbol:"\u{1F565}",group:"travel",keywords:["10","10:30","clock","ten","ten-thirty","thirty"]},{id:":eleven_o\u2019clock:",symbol:"\u{1F55A}",group:"travel",keywords:["00","11","11:00","clock","eleven","o\u2019clock"]},{id:":eleven-thirty:",symbol:"\u{1F566}",group:"travel",keywords:["11","11:30","clock","eleven","eleven-thirty","thirty"]},{id:":new_moon:",symbol:"\u{1F311}",group:"travel",keywords:["dark","moon","new moon"]},{id:":waxing_crescent_moon:",symbol:"\u{1F312}",group:"travel",keywords:["crescent","moon","waxing"]},{id:":first_quarter_moon:",symbol:"\u{1F313}",group:"travel",keywords:["first quarter moon","moon","quarter"]},{id:":waxing_gibbous_moon:",symbol:"\u{1F314}",group:"travel",keywords:["gibbous","moon","waxing"]},{id:":full_moon:",symbol:"\u{1F315}",group:"travel",keywords:["full","moon"]},{id:":waning_gibbous_moon:",symbol:"\u{1F316}",group:"travel",keywords:["gibbous","moon","waning"]},{id:":last_quarter_moon:",symbol:"\u{1F317}",group:"travel",keywords:["last quarter moon","moon","quarter"]},{id:":waning_crescent_moon:",symbol:"\u{1F318}",group:"travel",keywords:["crescent","moon","waning"]},{id:":crescent_moon:",symbol:"\u{1F319}",group:"travel",keywords:["crescent","moon"]},{id:":new_moon_face:",symbol:"\u{1F31A}",group:"travel",keywords:["face","moon","new moon face"]},{id:":first_quarter_moon_face:",symbol:"\u{1F31B}",group:"travel",keywords:["face","first quarter moon face","moon","quarter"]},{id:":last_quarter_moon_face:",symbol:"\u{1F31C}",group:"travel",keywords:["face","last quarter moon face","moon","quarter"]},{id:":thermometer:",symbol:"\u{1F321}",group:"travel",keywords:["thermometer","weather"]},{id:":sun:",symbol:"\u2600",group:"travel",keywords:["bright","rays","sun","sunny"]},{id:":full_moon_face:",symbol:"\u{1F31D}",group:"travel",keywords:["bright","face","full","moon"]},{id:":sun_with_face:",symbol:"\u{1F31E}",group:"travel",keywords:["bright","face","sun","sun with face"]},{id:":star:",symbol:"\u2B50",group:"travel",keywords:["star"]},{id:":glowing_star:",symbol:"\u{1F31F}",group:"travel",keywords:["glittery","glow","glowing star","shining","sparkle","star"]},{id:":shooting_star:",symbol:"\u{1F320}",group:"travel",keywords:["falling","shooting","star"]},{id:":cloud:",symbol:"\u2601\uFE0F",group:"travel",keywords:["cloud","weather"]},{id:":sun_behind_cloud:",symbol:"\u26C5",group:"travel",keywords:["cloud","sun","sun behind cloud"]},{id:":cloud_with_lightning_and_rain:",symbol:"\u26C8\uFE0F",group:"travel",keywords:["cloud","cloud with lightning and rain","rain","thunder"]},{id:":sun_behind_small_cloud:",symbol:"\u{1F324}",group:"travel",keywords:["cloud","sun","sun behind small cloud"]},{id:":sun_behind_large_cloud:",symbol:"\u{1F325}",group:"travel",keywords:["cloud","sun","sun behind large cloud"]},{id:":sun_behind_rain_cloud:",symbol:"\u{1F326}",group:"travel",keywords:["cloud","rain","sun","sun behind rain cloud"]},{id:":cloud_with_rain:",symbol:"\u{1F327}",group:"travel",keywords:["cloud","cloud with rain","rain"]},{id:":cloud_with_snow:",symbol:"\u{1F328}",group:"travel",keywords:["cloud","cloud with snow","cold","snow"]},{id:":cloud_with_lightning:",symbol:"\u{1F329}",group:"travel",keywords:["cloud","cloud with lightning","lightning"]},{id:":tornado:",symbol:"\u{1F32A}",group:"travel",keywords:["cloud","tornado","whirlwind"]},{id:":fog:",symbol:"\u{1F32B}",group:"travel",keywords:["cloud","fog"]},{id:":wind_face:",symbol:"\u{1F32C}",group:"travel",keywords:["blow","cloud","face","wind"]},{id:":cyclone:",symbol:"\u{1F300}",group:"travel",keywords:["cyclone","dizzy","hurricane","twister","typhoon"]},{id:":rainbow:",symbol:"\u{1F308}",group:"travel",keywords:["rain","rainbow"]},{id:":closed_umbrella:",symbol:"\u{1F302}",group:"travel",keywords:["closed umbrella","clothing","rain","umbrella"]},{id:":umbrella:",symbol:"\u2602",group:"travel",keywords:["clothing","rain","umbrella"]},{id:":umbrella_with_rain_drops:",symbol:"\u2614",group:"travel",keywords:["clothing","drop","rain","umbrella","umbrella with rain drops"]},{id:":umbrella_on_ground:",symbol:"\u26F1",group:"travel",keywords:["rain","sun","umbrella","umbrella on ground"]},{id:":high_voltage:",symbol:"\u26A1",group:"travel",keywords:["danger","electric","high voltage","lightning","voltage","zap"]},{id:":snowflake:",symbol:"\u2744",group:"travel",keywords:["cold","snow","snowflake"]},{id:":snowman:",symbol:"\u2603",group:"travel",keywords:["cold","snow","snowman"]},{id:":snowman_without_snow:",symbol:"\u26C4",group:"travel",keywords:["cold","snow","snowman","snowman without snow"]},{id:":comet:",symbol:"\u2604",group:"travel",keywords:["comet","space"]},{id:":fire:",symbol:"\u{1F525}",group:"travel",keywords:["fire","flame","tool"]},{id:":droplet:",symbol:"\u{1F4A7}",group:"travel",keywords:["cold","comic","drop","droplet","sweat"]},{id:":water_wave:",symbol:"\u{1F30A}",group:"travel",keywords:["ocean","water","wave"]},{id:":jack-o-lantern:",symbol:"\u{1F383}",group:"activities",keywords:["celebration","halloween","jack","jack-o-lantern","lantern"]},{id:":christmas_tree:",symbol:"\u{1F384}",group:"activities",keywords:["celebration","Christmas","tree"]},{id:":fireworks:",symbol:"\u{1F386}",group:"activities",keywords:["celebration","fireworks"]},{id:":sparkler:",symbol:"\u{1F387}",group:"activities",keywords:["celebration","fireworks","sparkle","sparkler"]},{id:":sparkles:",symbol:"\u2728",group:"activities",keywords:["sparkle","sparkles","star"]},{id:":balloon:",symbol:"\u{1F388}",group:"activities",keywords:["balloon","celebration"]},{id:":party_popper:",symbol:"\u{1F389}",group:"activities",keywords:["celebration","party","popper","tada"]},{id:":confetti_ball:",symbol:"\u{1F38A}",group:"activities",keywords:["ball","celebration","confetti"]},{id:":tanabata_tree:",symbol:"\u{1F38B}",group:"activities",keywords:["banner","celebration","Japanese","tanabata tree","tree"]},{id:":pine_decoration:",symbol:"\u{1F38D}",group:"activities",keywords:["bamboo","celebration","Japanese","pine","pine decoration"]},{id:":japanese_dolls:",symbol:"\u{1F38E}",group:"activities",keywords:["celebration","doll","festival","Japanese","Japanese dolls"]},{id:":carp_streamer:",symbol:"\u{1F38F}",group:"activities",keywords:["carp","celebration","streamer"]},{id:":wind_chime:",symbol:"\u{1F390}",group:"activities",keywords:["bell","celebration","chime","wind"]},{id:":moon_viewing_ceremony:",symbol:"\u{1F391}",group:"activities",keywords:["celebration","ceremony","moon","moon viewing ceremony"]},{id:":ribbon:",symbol:"\u{1F380}",group:"activities",keywords:["celebration","ribbon"]},{id:":wrapped_gift:",symbol:"\u{1F381}",group:"activities",keywords:["box","celebration","gift","present","wrapped"]},{id:":reminder_ribbon:",symbol:"\u{1F397}",group:"activities",keywords:["celebration","reminder","ribbon"]},{id:":admission_tickets:",symbol:"\u{1F39F}",group:"activities",keywords:["admission","admission tickets","ticket"]},{id:":ticket:",symbol:"\u{1F3AB}",group:"activities",keywords:["admission","ticket"]},{id:":military_medal:",symbol:"\u{1F396}",group:"activities",keywords:["celebration","medal","military"]},{id:":trophy:",symbol:"\u{1F3C6}",group:"activities",keywords:["prize","trophy"]},{id:":sports_medal:",symbol:"\u{1F3C5}",group:"activities",keywords:["medal","sports medal"]},{id:":1st_place_medal:",symbol:"\u{1F947}",group:"activities",keywords:["1st place medal","first","gold","medal"]},{id:":2nd_place_medal:",symbol:"\u{1F948}",group:"activities",keywords:["2nd place medal","medal","second","silver"]},{id:":3rd_place_medal:",symbol:"\u{1F949}",group:"activities",keywords:["3rd place medal","bronze","medal","third"]},{id:":soccer_ball:",symbol:"\u26BD",group:"activities",keywords:["ball","football","soccer"]},{id:":baseball:",symbol:"\u26BE",group:"activities",keywords:["ball","baseball"]},{id:":basketball:",symbol:"\u{1F3C0}",group:"activities",keywords:["ball","basketball","hoop"]},{id:":volleyball:",symbol:"\u{1F3D0}",group:"activities",keywords:["ball","game","volleyball"]},{id:":american_football:",symbol:"\u{1F3C8}",group:"activities",keywords:["american","ball","football"]},{id:":rugby_football:",symbol:"\u{1F3C9}",group:"activities",keywords:["ball","football","rugby"]},{id:":tennis:",symbol:"\u{1F3BE}",group:"activities",keywords:["ball","racquet","tennis"]},{id:":bowling:",symbol:"\u{1F3B3}",group:"activities",keywords:["ball","bowling","game"]},{id:":cricket_game:",symbol:"\u{1F3CF}",group:"activities",keywords:["ball","bat","cricket game","game"]},{id:":field_hockey:",symbol:"\u{1F3D1}",group:"activities",keywords:["ball","field","game","hockey","stick"]},{id:":ice_hockey:",symbol:"\u{1F3D2}",group:"activities",keywords:["game","hockey","ice","puck","stick"]},{id:":ping_pong:",symbol:"\u{1F3D3}",group:"activities",keywords:["ball","bat","game","paddle","ping pong","table tennis"]},{id:":badminton:",symbol:"\u{1F3F8}",group:"activities",keywords:["badminton","birdie","game","racquet","shuttlecock"]},{id:":boxing_glove:",symbol:"\u{1F94A}",group:"activities",keywords:["boxing","glove"]},{id:":martial_arts_uniform:",symbol:"\u{1F94B}",group:"activities",keywords:["judo","karate","martial arts","martial arts uniform","taekwondo","uniform"]},{id:":goal_net:",symbol:"\u{1F945}",group:"activities",keywords:["goal","net"]},{id:":flag_in_hole:",symbol:"\u26F3",group:"activities",keywords:["flag in hole","golf","hole"]},{id:":ice_skate:",symbol:"\u26F8",group:"activities",keywords:["ice","skate"]},{id:":fishing_pole:",symbol:"\u{1F3A3}",group:"activities",keywords:["fish","fishing pole","pole"]},{id:":running_shirt:",symbol:"\u{1F3BD}",group:"activities",keywords:["athletics","running","sash","shirt"]},{id:":skis:",symbol:"\u{1F3BF}",group:"activities",keywords:["ski","skis","snow"]},{id:":sled:",symbol:"\u{1F6F7}",group:"activities",keywords:["sled","sledge","sleigh",""]},{id:":curling_stone:",symbol:"\u{1F94C}",group:"activities",keywords:["curling stone","game","rock"]},{id:":direct_hit:",symbol:"\u{1F3AF}",group:"activities",keywords:["bullseye","dart","direct hit","game","hit","target"]},{id:":pool_8_ball:",symbol:"\u{1F3B1}",group:"activities",keywords:["8","ball","billiard","eight","game","pool 8 ball"]},{id:":crystal_ball:",symbol:"\u{1F52E}",group:"activities",keywords:["ball","crystal","fairy tale","fantasy","fortune","tool"]},{id:":video_game:",symbol:"\u{1F3AE}",group:"activities",keywords:["controller","game","video game"]},{id:":joystick:",symbol:"\u{1F579}",group:"activities",keywords:["game","joystick","video game"]},{id:":slot_machine:",symbol:"\u{1F3B0}",group:"activities",keywords:["game","slot","slot machine"]},{id:":game_die:",symbol:"\u{1F3B2}",group:"activities",keywords:["dice","die","game"]},{id:":spade_suit:",symbol:"\u2660",group:"activities",keywords:["card","game","spade suit"]},{id:":heart_suit:",symbol:"\u2665",group:"activities",keywords:["card","game","heart suit"]},{id:":diamond_suit:",symbol:"\u2666",group:"activities",keywords:["card","diamond suit","game"]},{id:":club_suit:",symbol:"\u2663",group:"activities",keywords:["card","club suit","game"]},{id:":joker:",symbol:"\u{1F0CF}",group:"activities",keywords:["card","game","joker","wildcard"]},{id:":mahjong_red_dragon:",symbol:"\u{1F004}",group:"activities",keywords:["game","mahjong","mahjong red dragon","red"]},{id:":flower_playing_cards:",symbol:"\u{1F3B4}",group:"activities",keywords:["card","flower","flower playing cards","game","Japanese","playing"]},{id:":performing_arts:",symbol:"\u{1F3AD}",group:"activities",keywords:["art","mask","performing","performing arts","theater","theatre"]},{id:":framed_picture:",symbol:"\u{1F5BC}",group:"activities",keywords:["art","frame","framed picture","museum","painting","picture"]},{id:":artist_palette:",symbol:"\u{1F3A8}",group:"activities",keywords:["art","artist palette","museum","painting","palette"]},{id:":muted_speaker:",symbol:"\u{1F507}",group:"objects",keywords:["mute","muted speaker","quiet","silent","speaker"]},{id:":speaker_low_volume:",symbol:"\u{1F508}",group:"objects",keywords:["soft","speaker low volume"]},{id:":speaker_medium_volume:",symbol:"\u{1F509}",group:"objects",keywords:["medium","speaker medium volume"]},{id:":speaker_high_volume:",symbol:"\u{1F50A}",group:"objects",keywords:["loud","speaker high volume"]},{id:":loudspeaker:",symbol:"\u{1F4E2}",group:"objects",keywords:["loud","loudspeaker","public address"]},{id:":megaphone:",symbol:"\u{1F4E3}",group:"objects",keywords:["cheering","megaphone"]},{id:":postal_horn:",symbol:"\u{1F4EF}",group:"objects",keywords:["horn","post","postal"]},{id:":bell:",symbol:"\u{1F514}",group:"objects",keywords:["bell"]},{id:":bell_with_slash:",symbol:"\u{1F515}",group:"objects",keywords:["bell","bell with slash","forbidden","mute","quiet","silent"]},{id:":musical_score:",symbol:"\u{1F3BC}",group:"objects",keywords:["music","musical score","score"]},{id:":musical_note:",symbol:"\u{1F3B5}",group:"objects",keywords:["music","musical note","note"]},{id:":musical_notes:",symbol:"\u{1F3B6}",group:"objects",keywords:["music","musical notes","note","notes"]},{id:":studio_microphone:",symbol:"\u{1F399}",group:"objects",keywords:["mic","microphone","music","studio"]},{id:":level_slider:",symbol:"\u{1F39A}",group:"objects",keywords:["level","music","slider"]},{id:":control_knobs:",symbol:"\u{1F39B}",group:"objects",keywords:["control","knobs","music"]},{id:":microphone:",symbol:"\u{1F3A4}",group:"objects",keywords:["karaoke","mic","microphone"]},{id:":headphone:",symbol:"\u{1F3A7}",group:"objects",keywords:["earbud","headphone"]},{id:":radio:",symbol:"\u{1F4FB}",group:"objects",keywords:["radio","video"]},{id:":saxophone:",symbol:"\u{1F3B7}",group:"objects",keywords:["instrument","music","sax","saxophone"]},{id:":guitar:",symbol:"\u{1F3B8}",group:"objects",keywords:["guitar","instrument","music"]},{id:":musical_keyboard:",symbol:"\u{1F3B9}",group:"objects",keywords:["instrument","keyboard","music","musical keyboard","piano"]},{id:":trumpet:",symbol:"\u{1F3BA}",group:"objects",keywords:["instrument","music","trumpet"]},{id:":violin:",symbol:"\u{1F3BB}",group:"objects",keywords:["instrument","music","violin"]},{id:":drum:",symbol:"\u{1F941}",group:"objects",keywords:["drum","drumsticks","music"]},{id:":mobile_phone:",symbol:"\u{1F4F1}",group:"objects",keywords:["cell","mobile","phone","telephone"]},{id:":mobile_phone_with_arrow:",symbol:"\u{1F4F2}",group:"objects",keywords:["arrow","cell","mobile","mobile phone with arrow","phone","receive"]},{id:":telephone:",symbol:"\u260E",group:"objects",keywords:["phone","telephone"]},{id:":telephone_receiver:",symbol:"\u{1F4DE}",group:"objects",keywords:["phone","receiver","telephone"]},{id:":pager:",symbol:"\u{1F4DF}",group:"objects",keywords:["pager"]},{id:":fax_machine:",symbol:"\u{1F4E0}",group:"objects",keywords:["fax","fax machine"]},{id:":battery:",symbol:"\u{1F50B}",group:"objects",keywords:["battery"]},{id:":electric_plug:",symbol:"\u{1F50C}",group:"objects",keywords:["electric","electricity","plug"]},{id:":laptop_computer:",symbol:"\u{1F4BB}",group:"objects",keywords:["computer","laptop computer","pc","personal"]},{id:":desktop_computer:",symbol:"\u{1F5A5}",group:"objects",keywords:["computer","desktop"]},{id:":printer:",symbol:"\u{1F5A8}",group:"objects",keywords:["computer","printer"]},{id:":keyboard:",symbol:"\u2328",group:"objects",keywords:["computer","keyboard"]},{id:":computer_mouse:",symbol:"\u{1F5B1}",group:"objects",keywords:["computer","computer mouse"]},{id:":trackball:",symbol:"\u{1F5B2}",group:"objects",keywords:["computer","trackball"]},{id:":computer_disk:",symbol:"\u{1F4BD}",group:"objects",keywords:["computer","disk","minidisk","optical"]},{id:":floppy_disk:",symbol:"\u{1F4BE}",group:"objects",keywords:["computer","disk","floppy"]},{id:":optical_disk:",symbol:"\u{1F4BF}",group:"objects",keywords:["cd","computer","disk","optical"]},{id:":dvd:",symbol:"\u{1F4C0}",group:"objects",keywords:["blu-ray","computer","disk","dvd","optical"]},{id:":movie_camera:",symbol:"\u{1F3A5}",group:"objects",keywords:["camera","cinema","movie"]},{id:":film_frames:",symbol:"\u{1F39E}",group:"objects",keywords:["cinema","film","frames","movie"]},{id:":film_projector:",symbol:"\u{1F4FD}",group:"objects",keywords:["cinema","film","movie","projector","video"]},{id:":clapper_board:",symbol:"\u{1F3AC}",group:"objects",keywords:["clapper","clapper board","movie"]},{id:":television:",symbol:"\u{1F4FA}",group:"objects",keywords:["television","tv","video"]},{id:":camera:",symbol:"\u{1F4F7}",group:"objects",keywords:["camera","video"]},{id:":camera_with_flash:",symbol:"\u{1F4F8}",group:"objects",keywords:["camera","camera with flash","flash","video"]},{id:":video_camera:",symbol:"\u{1F4F9}",group:"objects",keywords:["camera","video"]},{id:":videocassette:",symbol:"\u{1F4FC}",group:"objects",keywords:["tape","vhs","video","videocassette"]},{id:":magnifying_glass_tilted_left:",symbol:"\u{1F50D}",group:"objects",keywords:["glass","magnifying","magnifying glass tilted left","search","tool"]},{id:":magnifying_glass_tilted_right:",symbol:"\u{1F50E}",group:"objects",keywords:["glass","magnifying","magnifying glass tilted right","search","tool"]},{id:":candle:",symbol:"\u{1F56F}",group:"objects",keywords:["candle","light"]},{id:":light_bulb:",symbol:"\u{1F4A1}",group:"objects",keywords:["bulb","comic","electric","idea","light"]},{id:":flashlight:",symbol:"\u{1F526}",group:"objects",keywords:["electric","flashlight","light","tool","torch"]},{id:":red_paper_lantern:",symbol:"\u{1F3EE}",group:"objects",keywords:["bar","lantern","light","red","red paper lantern"]},{id:":notebook_with_decorative_cover:",symbol:"\u{1F4D4}",group:"objects",keywords:["book","cover","decorated","notebook","notebook with decorative cover"]},{id:":closed_book:",symbol:"\u{1F4D5}",group:"objects",keywords:["book","closed"]},{id:":open_book:",symbol:"\u{1F4D6}",group:"objects",keywords:["book","open"]},{id:":green_book:",symbol:"\u{1F4D7}",group:"objects",keywords:["book","green"]},{id:":blue_book:",symbol:"\u{1F4D8}",group:"objects",keywords:["blue","book"]},{id:":orange_book:",symbol:"\u{1F4D9}",group:"objects",keywords:["book","orange"]},{id:":books:",symbol:"\u{1F4DA}",group:"objects",keywords:["book","books"]},{id:":notebook:",symbol:"\u{1F4D3}",group:"objects",keywords:["notebook"]},{id:":ledger:",symbol:"\u{1F4D2}",group:"objects",keywords:["ledger","notebook"]},{id:":page_with_curl:",symbol:"\u{1F4C3}",group:"objects",keywords:["curl","document","page","page with curl"]},{id:":scroll:",symbol:"\u{1F4DC}",group:"objects",keywords:["paper","scroll"]},{id:":page_facing_up:",symbol:"\u{1F4C4}",group:"objects",keywords:["document","page","page facing up"]},{id:":newspaper:",symbol:"\u{1F4F0}",group:"objects",keywords:["news","newspaper","paper"]},{id:":rolled-up_newspaper:",symbol:"\u{1F5DE}",group:"objects",keywords:["news","newspaper","paper","rolled","rolled-up newspaper"]},{id:":bookmark_tabs:",symbol:"\u{1F4D1}",group:"objects",keywords:["bookmark","mark","marker","tabs"]},{id:":bookmark:",symbol:"\u{1F516}",group:"objects",keywords:["bookmark","mark"]},{id:":label:",symbol:"\u{1F3F7}",group:"objects",keywords:["label"]},{id:":money_bag:",symbol:"\u{1F4B0}",group:"objects",keywords:["bag","dollar","money","moneybag"]},{id:":yen_banknote:",symbol:"\u{1F4B4}",group:"objects",keywords:["banknote","bill","currency","money","note","yen"]},{id:":dollar_banknote:",symbol:"\u{1F4B5}",group:"objects",keywords:["banknote","bill","currency","dollar","money","note"]},{id:":euro_banknote:",symbol:"\u{1F4B6}",group:"objects",keywords:["banknote","bill","currency","euro","money","note"]},{id:":pound_banknote:",symbol:"\u{1F4B7}",group:"objects",keywords:["banknote","bill","currency","money","note","pound"]},{id:":money_with_wings:",symbol:"\u{1F4B8}",group:"objects",keywords:["banknote","bill","fly","money","money with wings","wings"]},{id:":credit_card:",symbol:"\u{1F4B3}",group:"objects",keywords:["card","credit","money"]},{id:":chart_increasing_with_yen:",symbol:"\u{1F4B9}",group:"objects",keywords:["chart","chart increasing with yen","graph","growth","money","yen"]},{id:":currency_exchange:",symbol:"\u{1F4B1}",group:"objects",keywords:["bank","currency","exchange","money"]},{id:":heavy_dollar_sign:",symbol:"\u{1F4B2}",group:"objects",keywords:["currency","dollar","heavy dollar sign","money"]},{id:":envelope:",symbol:"\u2709",group:"objects",keywords:["email","envelope","letter"]},{id:":e-mail:",symbol:"\u{1F4E7}",group:"objects",keywords:["e-mail","email","letter","mail"]},{id:":incoming_envelope:",symbol:"\u{1F4E8}",group:"objects",keywords:["e-mail","email","envelope","incoming","letter","receive"]},{id:":envelope_with_arrow:",symbol:"\u{1F4E9}",group:"objects",keywords:["arrow","e-mail","email","envelope","envelope with arrow","outgoing"]},{id:":outbox_tray:",symbol:"\u{1F4E4}",group:"objects",keywords:["box","letter","mail","outbox","sent","tray"]},{id:":inbox_tray:",symbol:"\u{1F4E5}",group:"objects",keywords:["box","inbox","letter","mail","receive","tray"]},{id:":package:",symbol:"\u{1F4E6}",group:"objects",keywords:["box","package","parcel"]},{id:":closed_mailbox_with_raised_flag:",symbol:"\u{1F4EB}",group:"objects",keywords:["closed","closed mailbox with raised flag","mail","mailbox","postbox"]},{id:":closed_mailbox_with_lowered_flag:",symbol:"\u{1F4EA}",group:"objects",keywords:["closed","closed mailbox with lowered flag","lowered","mail","mailbox","postbox"]},{id:":open_mailbox_with_raised_flag:",symbol:"\u{1F4EC}",group:"objects",keywords:["mail","mailbox","open","open mailbox with raised flag","postbox"]},{id:":open_mailbox_with_lowered_flag:",symbol:"\u{1F4ED}",group:"objects",keywords:["lowered","mail","mailbox","open","open mailbox with lowered flag","postbox"]},{id:":postbox:",symbol:"\u{1F4EE}",group:"objects",keywords:["mail","mailbox","postbox"]},{id:":ballot_box_with_ballot:",symbol:"\u{1F5F3}",group:"objects",keywords:["ballot","ballot box with ballot","box"]},{id:":pencil:",symbol:"\u270F",group:"objects",keywords:["pencil"]},{id:":black_nib:",symbol:"\u2712",group:"objects",keywords:["black nib","nib","pen"]},{id:":fountain_pen:",symbol:"\u{1F58B}",group:"objects",keywords:["fountain","pen"]},{id:":pen:",symbol:"\u{1F58A}",group:"objects",keywords:["ballpoint","pen"]},{id:":paintbrush:",symbol:"\u{1F58C}",group:"objects",keywords:["paintbrush","painting"]},{id:":crayon:",symbol:"\u{1F58D}",group:"objects",keywords:["crayon"]},{id:":memo:",symbol:"\u{1F4DD}",group:"objects",keywords:["memo","pencil"]},{id:":briefcase:",symbol:"\u{1F4BC}",group:"objects",keywords:["briefcase"]},{id:":file_folder:",symbol:"\u{1F4C1}",group:"objects",keywords:["file","folder"]},{id:":open_file_folder:",symbol:"\u{1F4C2}",group:"objects",keywords:["file","folder","open"]},{id:":card_index_dividers:",symbol:"\u{1F5C2}",group:"objects",keywords:["card","dividers","index"]},{id:":calendar:",symbol:"\u{1F4C5}",group:"objects",keywords:["calendar","date"]},{id:":tear-off_calendar:",symbol:"\u{1F4C6}",group:"objects",keywords:["calendar","tear-off calendar"]},{id:":spiral_notepad:",symbol:"\u{1F5D2}",group:"objects",keywords:["note","pad","spiral","spiral notepad"]},{id:":spiral_calendar:",symbol:"\u{1F5D3}",group:"objects",keywords:["calendar","pad","spiral"]},{id:":card_index:",symbol:"\u{1F4C7}",group:"objects",keywords:["card","index","rolodex"]},{id:":chart_increasing:",symbol:"\u{1F4C8}",group:"objects",keywords:["chart","chart increasing","graph","growth","trend","upward"]},{id:":chart_decreasing:",symbol:"\u{1F4C9}",group:"objects",keywords:["chart","chart decreasing","down","graph","trend"]},{id:":bar_chart:",symbol:"\u{1F4CA}",group:"objects",keywords:["bar","chart","graph"]},{id:":clipboard:",symbol:"\u{1F4CB}",group:"objects",keywords:["clipboard"]},{id:":pushpin:",symbol:"\u{1F4CC}",group:"objects",keywords:["pin","pushpin"]},{id:":round_pushpin:",symbol:"\u{1F4CD}",group:"objects",keywords:["pin","pushpin","round pushpin"]},{id:":paperclip:",symbol:"\u{1F4CE}",group:"objects",keywords:["paperclip"]},{id:":linked_paperclips:",symbol:"\u{1F587}",group:"objects",keywords:["link","linked paperclips","paperclip"]},{id:":straight_ruler:",symbol:"\u{1F4CF}",group:"objects",keywords:["ruler","straight edge","straight ruler"]},{id:":triangular_ruler:",symbol:"\u{1F4D0}",group:"objects",keywords:["ruler","set","triangle","triangular ruler"]},{id:":scissors:",symbol:"\u2702",group:"objects",keywords:["cutting","scissors","tool"]},{id:":card_file_box:",symbol:"\u{1F5C3}",group:"objects",keywords:["box","card","file"]},{id:":file_cabinet:",symbol:"\u{1F5C4}",group:"objects",keywords:["cabinet","file","filing"]},{id:":wastebasket:",symbol:"\u{1F5D1}",group:"objects",keywords:["wastebasket"]},{id:":locked:",symbol:"\u{1F512}",group:"objects",keywords:["closed","locked"]},{id:":unlocked:",symbol:"\u{1F513}",group:"objects",keywords:["lock","open","unlock","unlocked"]},{id:":locked_with_pen:",symbol:"\u{1F50F}",group:"objects",keywords:["ink","lock","locked with pen","nib","pen","privacy"]},{id:":locked_with_key:",symbol:"\u{1F510}",group:"objects",keywords:["closed","key","lock","locked with key","secure"]},{id:":key:",symbol:"\u{1F511}",group:"objects",keywords:["key","lock","password"]},{id:":old_key:",symbol:"\u{1F5DD}",group:"objects",keywords:["clue","key","lock","old"]},{id:":hammer:",symbol:"\u{1F528}",group:"objects",keywords:["hammer","tool"]},{id:":pick:",symbol:"\u26CF",group:"objects",keywords:["mining","pick","tool"]},{id:":hammer_and_pick:",symbol:"\u2692",group:"objects",keywords:["hammer","hammer and pick","pick","tool"]},{id:":hammer_and_wrench:",symbol:"\u{1F6E0}",group:"objects",keywords:["hammer","hammer and wrench","spanner","tool","wrench"]},{id:":dagger:",symbol:"\u{1F5E1}",group:"objects",keywords:["dagger","knife","weapon"]},{id:":crossed_swords:",symbol:"\u2694",group:"objects",keywords:["crossed","swords","weapon"]},{id:":pistol:",symbol:"\u{1F52B}",group:"objects",keywords:["gun","handgun","pistol","revolver","tool","weapon"]},{id:":bow_and_arrow:",symbol:"\u{1F3F9}",group:"objects",keywords:["archer","arrow","bow","bow and arrow","Sagittarius","zodiac"]},{id:":shield:",symbol:"\u{1F6E1}",group:"objects",keywords:["shield","weapon"]},{id:":wrench:",symbol:"\u{1F527}",group:"objects",keywords:["spanner","tool","wrench"]},{id:":nut_and_bolt:",symbol:"\u{1F529}",group:"objects",keywords:["bolt","nut","nut and bolt","tool"]},{id:":gear:",symbol:"\u2699",group:"objects",keywords:["cog","cogwheel","gear","tool"]},{id:":clamp:",symbol:"\u{1F5DC}",group:"objects",keywords:["clamp","compress","tool","vice"]},{id:":balance_scale:",symbol:"\u2696",group:"objects",keywords:["balance","justice","Libra","scale","zodiac"]},{id:":link:",symbol:"\u{1F517}",group:"objects",keywords:["link"]},{id:":chains:",symbol:"\u26D3",group:"objects",keywords:["chain","chains"]},{id:":alembic:",symbol:"\u2697",group:"objects",keywords:["alembic","chemistry","tool"]},{id:":microscope:",symbol:"\u{1F52C}",group:"objects",keywords:["microscope","science","tool"]},{id:":telescope:",symbol:"\u{1F52D}",group:"objects",keywords:["science","telescope","tool"]},{id:":satellite_antenna:",symbol:"\u{1F4E1}",group:"objects",keywords:["antenna","dish","satellite"]},{id:":syringe:",symbol:"\u{1F489}",group:"objects",keywords:["medicine","needle","shot","sick","syringe"]},{id:":pill:",symbol:"\u{1F48A}",group:"objects",keywords:["doctor","medicine","pill","sick"]},{id:":door:",symbol:"\u{1F6AA}",group:"objects",keywords:["door"]},{id:":bed:",symbol:"\u{1F6CF}",group:"objects",keywords:["bed","hotel","sleep"]},{id:":couch_and_lamp:",symbol:"\u{1F6CB}",group:"objects",keywords:["couch","couch and lamp","hotel","lamp"]},{id:":toilet:",symbol:"\u{1F6BD}",group:"objects",keywords:["toilet"]},{id:":shower:",symbol:"\u{1F6BF}",group:"objects",keywords:["shower","water"]},{id:":bathtub:",symbol:"\u{1F6C1}",group:"objects",keywords:["bath","bathtub"]},{id:":shopping_cart:",symbol:"\u{1F6D2}",group:"objects",keywords:["cart","shopping","trolley"]},{id:":cigarette:",symbol:"\u{1F6AC}",group:"objects",keywords:["cigarette","smoking"]},{id:":coffin:",symbol:"\u26B0",group:"objects",keywords:["coffin","death"]},{id:":funeral_urn:",symbol:"\u26B1",group:"objects",keywords:["ashes","death","funeral","urn"]},{id:":moai:",symbol:"\u{1F5FF}",group:"objects",keywords:["face","moai","moyai","statue"]},{id:":atm_sign:",symbol:"\u{1F3E7}",group:"symbols",keywords:["atm","ATM sign","automated","bank","teller"]},{id:":litter_in_bin_sign:",symbol:"\u{1F6AE}",group:"symbols",keywords:["litter","litter bin","litter in bin sign"]},{id:":potable_water:",symbol:"\u{1F6B0}",group:"symbols",keywords:["drinking","potable","water"]},{id:":wheelchair_symbol:",symbol:"\u267F",group:"symbols",keywords:["access","wheelchair symbol"]},{id:":men\u2019s_room:",symbol:"\u{1F6B9}",group:"symbols",keywords:["lavatory","man","men\u2019s room","restroom","wc"]},{id:":women\u2019s_room:",symbol:"\u{1F6BA}",group:"symbols",keywords:["lavatory","restroom","wc","woman","women\u2019s room"]},{id:":restroom:",symbol:"\u{1F6BB}",group:"symbols",keywords:["lavatory","restroom","WC"]},{id:":baby_symbol:",symbol:"\u{1F6BC}",group:"symbols",keywords:["baby","baby symbol","changing"]},{id:":water_closet:",symbol:"\u{1F6BE}",group:"symbols",keywords:["closet","lavatory","restroom","water","wc"]},{id:":passport_control:",symbol:"\u{1F6C2}",group:"symbols",keywords:["control","passport"]},{id:":customs:",symbol:"\u{1F6C3}",group:"symbols",keywords:["customs"]},{id:":baggage_claim:",symbol:"\u{1F6C4}",group:"symbols",keywords:["baggage","claim"]},{id:":left_luggage:",symbol:"\u{1F6C5}",group:"symbols",keywords:["baggage","left luggage","locker","luggage"]},{id:":warning:",symbol:"\u26A0",group:"symbols",keywords:["warning"]},{id:":children_crossing:",symbol:"\u{1F6B8}",group:"symbols",keywords:["child","children crossing","crossing","pedestrian","traffic"]},{id:":no_entry:",symbol:"\u26D4",group:"symbols",keywords:["entry","forbidden","no","not","prohibited","traffic"]},{id:":prohibited:",symbol:"\u{1F6AB}",group:"symbols",keywords:["entry","forbidden","no","not","prohibited"]},{id:":no_bicycles:",symbol:"\u{1F6B3}",group:"symbols",keywords:["bicycle","bike","forbidden","no","no bicycles","prohibited"]},{id:":no_smoking:",symbol:"\u{1F6AD}",group:"symbols",keywords:["forbidden","no","not","prohibited","smoking"]},{id:":no_littering:",symbol:"\u{1F6AF}",group:"symbols",keywords:["forbidden","litter","no","no littering","not","prohibited"]},{id:":non-potable_water:",symbol:"\u{1F6B1}",group:"symbols",keywords:["non-drinking","non-potable","water"]},{id:":no_pedestrians:",symbol:"\u{1F6B7}",group:"symbols",keywords:["forbidden","no","no pedestrians","not","pedestrian","prohibited"]},{id:":no_mobile_phones:",symbol:"\u{1F4F5}",group:"symbols",keywords:["cell","forbidden","mobile","no","no mobile phones","phone"]},{id:":no_one_under_eighteen:",symbol:"\u{1F51E}",group:"symbols",keywords:["18","age restriction","eighteen","no one under eighteen","prohibited","underage"]},{id:":radioactive:",symbol:"\u2622",group:"symbols",keywords:["radioactive","sign"]},{id:":biohazard:",symbol:"\u2623",group:"symbols",keywords:["biohazard","sign"]},{id:":up_arrow:",symbol:"\u2B06",group:"symbols",keywords:["arrow","cardinal","direction","north","up arrow"]},{id:":up-right_arrow:",symbol:"\u2197",group:"symbols",keywords:["arrow","direction","intercardinal","northeast","up-right arrow"]},{id:":right_arrow:",symbol:"\u27A1",group:"symbols",keywords:["arrow","cardinal","direction","east","right arrow"]},{id:":down-right_arrow:",symbol:"\u2198",group:"symbols",keywords:["arrow","direction","down-right arrow","intercardinal","southeast"]},{id:":down_arrow:",symbol:"\u2B07",group:"symbols",keywords:["arrow","cardinal","direction","down","south"]},{id:":down-left_arrow:",symbol:"\u2199",group:"symbols",keywords:["arrow","direction","down-left arrow","intercardinal","southwest"]},{id:":left_arrow:",symbol:"\u2B05",group:"symbols",keywords:["arrow","cardinal","direction","left arrow","west"]},{id:":up-left_arrow:",symbol:"\u2196",group:"symbols",keywords:["arrow","direction","intercardinal","northwest","up-left arrow"]},{id:":up-down_arrow:",symbol:"\u2195",group:"symbols",keywords:["arrow","up-down arrow"]},{id:":left-right_arrow:",symbol:"\u2194",group:"symbols",keywords:["arrow","left-right arrow"]},{id:":right_arrow_curving_left:",symbol:"\u21A9",group:"symbols",keywords:["arrow","right arrow curving left"]},{id:":left_arrow_curving_right:",symbol:"\u21AA",group:"symbols",keywords:["arrow","left arrow curving right"]},{id:":right_arrow_curving_up:",symbol:"\u2934",group:"symbols",keywords:["arrow","right arrow curving up"]},{id:":right_arrow_curving_down:",symbol:"\u2935",group:"symbols",keywords:["arrow","down","right arrow curving down"]},{id:":clockwise_vertical_arrows:",symbol:"\u{1F503}",group:"symbols",keywords:["arrow","clockwise","clockwise vertical arrows","reload"]},{id:":counterclockwise_arrows_button:",symbol:"\u{1F504}",group:"symbols",keywords:["anticlockwise","arrow","counterclockwise","counterclockwise arrows button","withershins"]},{id:":back_arrow:",symbol:"\u{1F519}",group:"symbols",keywords:["arrow","back","BACK arrow"]},{id:":end_arrow:",symbol:"\u{1F51A}",group:"symbols",keywords:["arrow","end","END arrow"]},{id:":on!_arrow:",symbol:"\u{1F51B}",group:"symbols",keywords:["arrow","mark","on","ON! arrow"]},{id:":soon_arrow:",symbol:"\u{1F51C}",group:"symbols",keywords:["arrow","soon","SOON arrow"]},{id:":top_arrow:",symbol:"\u{1F51D}",group:"symbols",keywords:["arrow","top","TOP arrow","up"]},{id:":place_of_worship:",symbol:"\u{1F6D0}",group:"symbols",keywords:["place of worship","religion","worship"]},{id:":atom_symbol:",symbol:"\u269B",group:"symbols",keywords:["atheist","atom","atom symbol"]},{id:":om:",symbol:"\u{1F549}",group:"symbols",keywords:["Hindu","om","religion"]},{id:":star_of_david:",symbol:"\u2721",group:"symbols",keywords:["David","Jew","Jewish","religion","star","star of David"]},{id:":wheel_of_dharma:",symbol:"\u2638",group:"symbols",keywords:["Buddhist","dharma","religion","wheel","wheel of dharma"]},{id:":yin_yang:",symbol:"\u262F",group:"symbols",keywords:["religion","tao","taoist","yang","yin"]},{id:":latin_cross:",symbol:"\u271D",group:"symbols",keywords:["Christian","cross","latin cross","religion"]},{id:":orthodox_cross:",symbol:"\u2626",group:"symbols",keywords:["Christian","cross","orthodox cross","religion"]},{id:":star_and_crescent:",symbol:"\u262A",group:"symbols",keywords:["islam","Muslim","religion","star and crescent"]},{id:":peace_symbol:",symbol:"\u262E",group:"symbols",keywords:["peace","peace symbol"]},{id:":menorah:",symbol:"\u{1F54E}",group:"symbols",keywords:["candelabrum","candlestick","menorah","religion"]},{id:":dotted_six-pointed_star:",symbol:"\u{1F52F}",group:"symbols",keywords:["dotted six-pointed star","fortune","star"]},{id:":aries:",symbol:"\u2648",group:"symbols",keywords:["Aries","ram","zodiac"]},{id:":taurus:",symbol:"\u2649",group:"symbols",keywords:["bull","ox","Taurus","zodiac"]},{id:":gemini:",symbol:"\u264A",group:"symbols",keywords:["Gemini","twins","zodiac"]},{id:":cancer:",symbol:"\u264B",group:"symbols",keywords:["Cancer","crab","zodiac"]},{id:":leo:",symbol:"\u264C",group:"symbols",keywords:["Leo","lion","zodiac"]},{id:":virgo:",symbol:"\u264D",group:"symbols",keywords:["Virgo","zodiac"]},{id:":libra:",symbol:"\u264E",group:"symbols",keywords:["balance","justice","Libra","scales","zodiac"]},{id:":scorpio:",symbol:"\u264F",group:"symbols",keywords:["Scorpio","scorpion","scorpius","zodiac"]},{id:":sagittarius:",symbol:"\u2650",group:"symbols",keywords:["archer","Sagittarius","zodiac"]},{id:":capricorn:",symbol:"\u2651",group:"symbols",keywords:["Capricorn","goat","zodiac"]},{id:":aquarius:",symbol:"\u2652",group:"symbols",keywords:["Aquarius","bearer","water","zodiac"]},{id:":pisces:",symbol:"\u2653",group:"symbols",keywords:["fish","Pisces","zodiac"]},{id:":ophiuchus:",symbol:"\u26CE",group:"symbols",keywords:["bearer","Ophiuchus","serpent","snake","zodiac"]},{id:":shuffle_tracks_button:",symbol:"\u{1F500}",group:"symbols",keywords:["arrow","crossed","shuffle tracks button"]},{id:":repeat_button:",symbol:"\u{1F501}",group:"symbols",keywords:["arrow","clockwise","repeat","repeat button"]},{id:":repeat_single_button:",symbol:"\u{1F502}",group:"symbols",keywords:["arrow","clockwise","once","repeat single button"]},{id:":play_button:",symbol:"\u25B6",group:"symbols",keywords:["arrow","play","play button","right","triangle"]},{id:":fast-forward_button:",symbol:"\u23E9",group:"symbols",keywords:["arrow","double","fast","fast-forward button","forward"]},{id:":next_track_button:",symbol:"\u23ED",group:"symbols",keywords:["arrow","next scene","next track","next track button","triangle"]},{id:":play_or_pause_button:",symbol:"\u23EF",group:"symbols",keywords:["arrow","pause","play","play or pause button","right","triangle"]},{id:":reverse_button:",symbol:"\u25C0",group:"symbols",keywords:["arrow","left","reverse","reverse button","triangle"]},{id:":fast_reverse_button:",symbol:"\u23EA",group:"symbols",keywords:["arrow","double","fast reverse button","rewind"]},{id:":last_track_button:",symbol:"\u23EE",group:"symbols",keywords:["arrow","last track button","previous scene","previous track","triangle"]},{id:":upwards_button:",symbol:"\u{1F53C}",group:"symbols",keywords:["arrow","button","red","upwards button"]},{id:":fast_up_button:",symbol:"\u23EB",group:"symbols",keywords:["arrow","double","fast up button"]},{id:":downwards_button:",symbol:"\u{1F53D}",group:"symbols",keywords:["arrow","button","down","downwards button","red"]},{id:":fast_down_button:",symbol:"\u23EC",group:"symbols",keywords:["arrow","double","down","fast down button"]},{id:":pause_button:",symbol:"\u23F8",group:"symbols",keywords:["bar","double","pause","pause button","vertical"]},{id:":stop_button:",symbol:"\u23F9",group:"symbols",keywords:["square","stop","stop button"]},{id:":record_button:",symbol:"\u23FA",group:"symbols",keywords:["circle","record","record button"]},{id:":eject_button:",symbol:"\u23CF",group:"symbols",keywords:["eject","eject button"]},{id:":cinema:",symbol:"\u{1F3A6}",group:"symbols",keywords:["camera","cinema","film","movie"]},{id:":dim_button:",symbol:"\u{1F505}",group:"symbols",keywords:["brightness","dim","dim button","low"]},{id:":bright_button:",symbol:"\u{1F506}",group:"symbols",keywords:["bright","bright button","brightness"]},{id:":antenna_bars:",symbol:"\u{1F4F6}",group:"symbols",keywords:["antenna","antenna bars","bar","cell","mobile","phone"]},{id:":vibration_mode:",symbol:"\u{1F4F3}",group:"symbols",keywords:["cell","mobile","mode","phone","telephone","vibration"]},{id:":mobile_phone_off:",symbol:"\u{1F4F4}",group:"symbols",keywords:["cell","mobile","off","phone","telephone"]},{id:":female_sign:",symbol:"\u2640",group:"symbols",keywords:["female sign","woman"]},{id:":male_sign:",symbol:"\u2642",group:"symbols",keywords:["male sign","man"]},{id:":medical_symbol:",symbol:"\u2695",group:"symbols",keywords:["aesculapius","medical symbol","medicine","staff"]},{id:":recycling_symbol:",symbol:"\u267B",group:"symbols",keywords:["recycle","recycling symbol"]},{id:":fleur-de-lis:",symbol:"\u269C",group:"symbols",keywords:["fleur-de-lis"]},{id:":trident_emblem:",symbol:"\u{1F531}",group:"symbols",keywords:["anchor","emblem","ship","tool","trident"]},{id:":name_badge:",symbol:"\u{1F4DB}",group:"symbols",keywords:["badge","name"]},{id:":japanese_symbol_for_beginner:",symbol:"\u{1F530}",group:"symbols",keywords:["beginner","chevron","Japanese","Japanese symbol for beginner","leaf"]},{id:":heavy_large_circle:",symbol:"\u2B55",group:"symbols",keywords:["circle","heavy large circle","o"]},{id:":white_heavy_check_mark:",symbol:"\u2705",group:"symbols",keywords:["check","mark","white heavy check mark"]},{id:":ballot_box_with_check:",symbol:"\u2611",group:"symbols",keywords:["ballot","ballot box with check","box","check"]},{id:":heavy_check_mark:",symbol:"\u2714",group:"symbols",keywords:["check","heavy check mark","mark"]},{id:":heavy_multiplication_x:",symbol:"\u2716",group:"symbols",keywords:["cancel","heavy multiplication x","multiplication","multiply","x"]},{id:":cross_mark:",symbol:"\u274C",group:"symbols",keywords:["cancel","cross mark","mark","multiplication","multiply","x"]},{id:":cross_mark_button:",symbol:"\u274E",group:"symbols",keywords:["cross mark button","mark","square"]},{id:":heavy_plus_sign:",symbol:"\u2795",group:"symbols",keywords:["heavy plus sign","math","plus"]},{id:":heavy_minus_sign:",symbol:"\u2796",group:"symbols",keywords:["heavy minus sign","math","minus"]},{id:":heavy_division_sign:",symbol:"\u2797",group:"symbols",keywords:["division","heavy division sign","math"]},{id:":curly_loop:",symbol:"\u27B0",group:"symbols",keywords:["curl","curly loop","loop"]},{id:":double_curly_loop:",symbol:"\u27BF",group:"symbols",keywords:["curl","double","double curly loop","loop"]},{id:":part_alternation_mark:",symbol:"\u303D",group:"symbols",keywords:["mark","part","part alternation mark"]},{id:":eight-spoked_asterisk:",symbol:"\u2733",group:"symbols",keywords:["asterisk","eight-spoked asterisk"]},{id:":eight-pointed_star:",symbol:"\u2734",group:"symbols",keywords:["eight-pointed star","star"]},{id:":sparkle:",symbol:"\u2747",group:"symbols",keywords:["sparkle"]},{id:":double_exclamation_mark:",symbol:"\u203C",group:"symbols",keywords:["bangbang","double exclamation mark","exclamation","mark","punctuation"]},{id:":exclamation_question_mark:",symbol:"\u2049",group:"symbols",keywords:["exclamation","interrobang","mark","punctuation","question"]},{id:":question_mark:",symbol:"\u2753",group:"symbols",keywords:["mark","punctuation","question"]},{id:":white_question_mark:",symbol:"\u2754",group:"symbols",keywords:["mark","outlined","punctuation","question","white question mark"]},{id:":white_exclamation_mark:",symbol:"\u2755",group:"symbols",keywords:["exclamation","mark","outlined","punctuation","white exclamation mark"]},{id:":exclamation_mark:",symbol:"\u2757",group:"symbols",keywords:["exclamation","mark","punctuation"]},{id:":wavy_dash:",symbol:"\u3030",group:"symbols",keywords:["dash","punctuation","wavy"]},{id:":copyright:",symbol:"\xA9",group:"symbols",keywords:["copyright"]},{id:":registered:",symbol:"\xAE",group:"symbols",keywords:["registered"]},{id:":trade_mark:",symbol:"\u2122",group:"symbols",keywords:["mark","tm","trade mark","trademark"]},{id:":keycap_#:",symbol:"#\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_*:",symbol:"*\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_0:",symbol:"0\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_1:",symbol:"1\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_2:",symbol:"2\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_3:",symbol:"3\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_4:",symbol:"4\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_5:",symbol:"5\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_6:",symbol:"6\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_7:",symbol:"7\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_8:",symbol:"8\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_9:",symbol:"9\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_10:",symbol:"\u{1F51F}",group:"symbols",keywords:["keycap"]},{id:":hundred_points:",symbol:"\u{1F4AF}",group:"symbols",keywords:["100","full","hundred","hundred points","score"]},{id:":input_latin_uppercase:",symbol:"\u{1F520}",group:"symbols",keywords:["ABCD","input","latin","letters","uppercase"]},{id:":input_latin_lowercase:",symbol:"\u{1F521}",group:"symbols",keywords:["abcd","input","latin","letters","lowercase"]},{id:":input_numbers:",symbol:"\u{1F522}",group:"symbols",keywords:["1234","input","numbers"]},{id:":input_symbols:",symbol:"\u{1F523}",group:"symbols",keywords:["\u3012\u266A&%","input","input symbols"]},{id:":input_latin_letters:",symbol:"\u{1F524}",group:"symbols",keywords:["abc","alphabet","input","latin","letters"]},{id:":a_button_(blood_type):",symbol:"\u{1F170}",group:"symbols",keywords:["a","A button (blood type)","blood type"]},{id:":ab_button_(blood_type):",symbol:"\u{1F18E}",group:"symbols",keywords:["ab","AB button (blood type)","blood type"]},{id:":b_button_(blood_type):",symbol:"\u{1F171}",group:"symbols",keywords:["b","B button (blood type)","blood type"]},{id:":cl_button:",symbol:"\u{1F191}",group:"symbols",keywords:["cl","CL button"]},{id:":cool_button:",symbol:"\u{1F192}",group:"symbols",keywords:["cool","COOL button"]},{id:":free_button:",symbol:"\u{1F193}",group:"symbols",keywords:["free","FREE button"]},{id:":information:",symbol:"\u2139",group:"symbols",keywords:["i","information"]},{id:":id_button:",symbol:"\u{1F194}",group:"symbols",keywords:["id","ID button","identity"]},{id:":circled_m:",symbol:"\u24C2",group:"symbols",keywords:["circle","circled M","m"]},{id:":new_button:",symbol:"\u{1F195}",group:"symbols",keywords:["new","NEW button"]},{id:":ng_button:",symbol:"\u{1F196}",group:"symbols",keywords:["ng","NG button"]},{id:":o_button_(blood_type):",symbol:"\u{1F17E}",group:"symbols",keywords:["blood type","o","O button (blood type)"]},{id:":ok_button:",symbol:"\u{1F197}",group:"symbols",keywords:["OK","OK button"]},{id:":p_button:",symbol:"\u{1F17F}",group:"symbols",keywords:["P button","parking"]},{id:":sos_button:",symbol:"\u{1F198}",group:"symbols",keywords:["help","sos","SOS button"]},{id:":up!_button:",symbol:"\u{1F199}",group:"symbols",keywords:["mark","up","UP! button"]},{id:":vs_button:",symbol:"\u{1F19A}",group:"symbols",keywords:["versus","vs","VS button"]},{id:":japanese_\u201Chere\u201D_button:",symbol:"\u{1F201}",group:"symbols",keywords:["\u201Chere\u201D","Japanese","Japanese \u201Chere\u201D button","katakana","\u30B3\u30B3"]},{id:":japanese_\u201Cservice_charge\u201D_button:",symbol:"\u{1F202}",group:"symbols",keywords:["\u201Cservice charge\u201D","Japanese","Japanese \u201Cservice charge\u201D button","katakana","\u30B5"]},{id:":japanese_\u201Cmonthly_amount\u201D_button:",symbol:"\u{1F237}",group:"symbols",keywords:["\u201Cmonthly amount\u201D","ideograph","Japanese","Japanese \u201Cmonthly amount\u201D button","\u6708"]},{id:":japanese_\u201Cnot_free_of_charge\u201D_button:",symbol:"\u{1F236}",group:"symbols",keywords:["\u201Cnot free of charge\u201D","ideograph","Japanese","Japanese \u201Cnot free of charge\u201D button","\u6709"]},{id:":japanese_\u201Creserved\u201D_button:",symbol:"\u{1F22F}",group:"symbols",keywords:["\u201Creserved\u201D","ideograph","Japanese","Japanese \u201Creserved\u201D button","\u6307"]},{id:":japanese_\u201Cbargain\u201D_button:",symbol:"\u{1F250}",group:"symbols",keywords:["\u201Cbargain\u201D","ideograph","Japanese","Japanese \u201Cbargain\u201D button","\u5F97"]},{id:":japanese_\u201Cdiscount\u201D_button:",symbol:"\u{1F239}",group:"symbols",keywords:["\u201Cdiscount\u201D","ideograph","Japanese","Japanese \u201Cdiscount\u201D button","\u5272"]},{id:":japanese_\u201Cfree_of_charge\u201D_button:",symbol:"\u{1F21A}",group:"symbols",keywords:["\u201Cfree of charge\u201D","ideograph","Japanese","Japanese \u201Cfree of charge\u201D button","\u7121"]},{id:":japanese_\u201Cprohibited\u201D_button:",symbol:"\u{1F232}",group:"symbols",keywords:["\u201Cprohibited\u201D","ideograph","Japanese","Japanese \u201Cprohibited\u201D button","\u7981"]},{id:":japanese_\u201Cacceptable\u201D_button:",symbol:"\u{1F251}",group:"symbols",keywords:["\u201Cacceptable\u201D","ideograph","Japanese","Japanese \u201Cacceptable\u201D button","\u53EF"]},{id:":japanese_\u201Capplication\u201D_button:",symbol:"\u{1F238}",group:"symbols",keywords:["\u201Capplication\u201D","ideograph","Japanese","Japanese \u201Capplication\u201D button","\u7533"]},{id:":japanese_\u201Cpassing_grade\u201D_button:",symbol:"\u{1F234}",group:"symbols",keywords:["\u201Cpassing grade\u201D","ideograph","Japanese","Japanese \u201Cpassing grade\u201D button","\u5408"]},{id:":japanese_\u201Cvacancy\u201D_button:",symbol:"\u{1F233}",group:"symbols",keywords:["\u201Cvacancy\u201D","ideograph","Japanese","Japanese \u201Cvacancy\u201D button","\u7A7A"]},{id:":japanese_\u201Ccongratulations\u201D_button:",symbol:"\u3297",group:"symbols",keywords:["\u201Ccongratulations\u201D","ideograph","Japanese","Japanese \u201Ccongratulations\u201D button","\u795D"]},{id:":japanese_\u201Csecret\u201D_button:",symbol:"\u3299",group:"symbols",keywords:["\u201Csecret\u201D","ideograph","Japanese","Japanese \u201Csecret\u201D button","\u79D8"]},{id:":japanese_\u201Copen_for_business\u201D_button:",symbol:"\u{1F23A}",group:"symbols",keywords:["\u201Copen for business\u201D","ideograph","Japanese","Japanese \u201Copen for business\u201D button","\u55B6"]},{id:":japanese_\u201Cno_vacancy\u201D_button:",symbol:"\u{1F235}",group:"symbols",keywords:["\u201Cno vacancy\u201D","ideograph","Japanese","Japanese \u201Cno vacancy\u201D button","\u6E80"]},{id:":red_circle:",symbol:"\u{1F534}",group:"symbols",keywords:["circle","geometric","red"]},{id:":blue_circle:",symbol:"\u{1F535}",group:"symbols",keywords:["blue","circle","geometric"]},{id:":white_circle:",symbol:"\u26AA",group:"symbols",keywords:["circle","geometric","white circle"]},{id:":black_circle:",symbol:"\u26AB",group:"symbols",keywords:["black circle","circle","geometric"]},{id:":white_large_square:",symbol:"\u2B1C",group:"symbols",keywords:["geometric","square","white large square"]},{id:":black_large_square:",symbol:"\u2B1B",group:"symbols",keywords:["black large square","geometric","square"]},{id:":black_medium_square:",symbol:"\u25FC",group:"symbols",keywords:["black medium square","geometric","square"]},{id:":white_medium_square:",symbol:"\u25FB",group:"symbols",keywords:["geometric","square","white medium square"]},{id:":white_medium-small_square:",symbol:"\u25FD",group:"symbols",keywords:["geometric","square","white medium-small square"]},{id:":black_medium-small_square:",symbol:"\u25FE",group:"symbols",keywords:["black medium-small square","geometric","square"]},{id:":white_small_square:",symbol:"\u25AB",group:"symbols",keywords:["geometric","square","white small square"]},{id:":black_small_square:",symbol:"\u25AA",group:"symbols",keywords:["black small square","geometric","square"]},{id:":large_orange_diamond:",symbol:"\u{1F536}",group:"symbols",keywords:["diamond","geometric","large orange diamond","orange"]},{id:":large_blue_diamond:",symbol:"\u{1F537}",group:"symbols",keywords:["blue","diamond","geometric","large blue diamond"]},{id:":small_orange_diamond:",symbol:"\u{1F538}",group:"symbols",keywords:["diamond","geometric","orange","small orange diamond"]},{id:":small_blue_diamond:",symbol:"\u{1F539}",group:"symbols",keywords:["blue","diamond","geometric","small blue diamond"]},{id:":red_triangle_pointed_up:",symbol:"\u{1F53A}",group:"symbols",keywords:["geometric","red","red triangle pointed up"]},{id:":red_triangle_pointed_down:",symbol:"\u{1F53B}",group:"symbols",keywords:["down","geometric","red","red triangle pointed down"]},{id:":diamond_with_a_dot:",symbol:"\u{1F4A0}",group:"symbols",keywords:["comic","diamond","diamond with a dot","geometric","inside"]},{id:":radio_button:",symbol:"\u{1F518}",group:"symbols",keywords:["button","geometric","radio"]},{id:":black_square_button:",symbol:"\u{1F532}",group:"symbols",keywords:["black square button","button","geometric","square"]},{id:":white_square_button:",symbol:"\u{1F533}",group:"symbols",keywords:["button","geometric","outlined","square","white square button"]},{id:":chequered_flag:",symbol:"\u{1F3C1}",group:"flags",keywords:["checkered","chequered","chequered flag","racing"]},{id:":triangular_flag:",symbol:"\u{1F6A9}",group:"flags",keywords:["post","triangular flag"]},{id:":crossed_flags:",symbol:"\u{1F38C}",group:"flags",keywords:["celebration","cross","crossed","crossed flags","Japanese"]},{id:":black_flag:",symbol:"\u{1F3F4}",group:"flags",keywords:["black flag","waving"]},{id:":white_flag:",symbol:"\u{1F3F3}",group:"flags",keywords:["waving","white flag"]},{id:":rainbow_flag:",symbol:"\u{1F3F3}\uFE0F\u200D\u{1F308}",group:"flags",keywords:["rainbow","rainbow flag"]},{id:":flag_ascension_island:",symbol:"\u{1F1E6}\u{1F1E8}",group:"flags",keywords:["flag"]},{id:":flag_andorra:",symbol:"\u{1F1E6}\u{1F1E9}",group:"flags",keywords:["flag"]},{id:":flag_united_arab_emirates:",symbol:"\u{1F1E6}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_afghanistan:",symbol:"\u{1F1E6}\u{1F1EB}",group:"flags",keywords:["flag"]},{id:":flag_antigua_&_barbuda:",symbol:"\u{1F1E6}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_anguilla:",symbol:"\u{1F1E6}\u{1F1EE}",group:"flags",keywords:["flag"]},{id:":flag_albania:",symbol:"\u{1F1E6}\u{1F1F1}",group:"flags",keywords:["flag"]},{id:":flag_armenia:",symbol:"\u{1F1E6}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_angola:",symbol:"\u{1F1E6}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_antarctica:",symbol:"\u{1F1E6}\u{1F1F6}",group:"flags",keywords:["flag"]},{id:":flag_argentina:",symbol:"\u{1F1E6}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_american_samoa:",symbol:"\u{1F1E6}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_austria:",symbol:"\u{1F1E6}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_australia:",symbol:"\u{1F1E6}\u{1F1FA}",group:"flags",keywords:["flag"]},{id:":flag_aruba:",symbol:"\u{1F1E6}\u{1F1FC}",group:"flags",keywords:["flag"]},{id:":flag_\xE5land_islands:",symbol:"\u{1F1E6}\u{1F1FD}",group:"flags",keywords:["flag"]},{id:":flag_azerbaijan:",symbol:"\u{1F1E6}\u{1F1FF}",group:"flags",keywords:["flag"]},{id:":flag_bosnia_&_herzegovina:",symbol:"\u{1F1E7}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_barbados:",symbol:"\u{1F1E7}\u{1F1E7}",group:"flags",keywords:["flag"]},{id:":flag_bangladesh:",symbol:"\u{1F1E7}\u{1F1E9}",group:"flags",keywords:["flag"]},{id:":flag_belgium:",symbol:"\u{1F1E7}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_burkina_faso:",symbol:"\u{1F1E7}\u{1F1EB}",group:"flags",keywords:["flag"]},{id:":flag_bulgaria:",symbol:"\u{1F1E7}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_bahrain:",symbol:"\u{1F1E7}\u{1F1ED}",group:"flags",keywords:["flag"]},{id:":flag_burundi:",symbol:"\u{1F1E7}\u{1F1EE}",group:"flags",keywords:["flag"]},{id:":flag_benin:",symbol:"\u{1F1E7}\u{1F1EF}",group:"flags",keywords:["flag"]},{id:":flag_st._barth\xE9lemy:",symbol:"\u{1F1E7}\u{1F1F1}",group:"flags",keywords:["flag"]},{id:":flag_bermuda:",symbol:"\u{1F1E7}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_brunei:",symbol:"\u{1F1E7}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_bolivia:",symbol:"\u{1F1E7}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_caribbean_netherlands:",symbol:"\u{1F1E7}\u{1F1F6}",group:"flags",keywords:["flag"]},{id:":flag_brazil:",symbol:"\u{1F1E7}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_bahamas:",symbol:"\u{1F1E7}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_bhutan:",symbol:"\u{1F1E7}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_bouvet_island:",symbol:"\u{1F1E7}\u{1F1FB}",group:"flags",keywords:["flag"]},{id:":flag_botswana:",symbol:"\u{1F1E7}\u{1F1FC}",group:"flags",keywords:["flag"]},{id:":flag_belarus:",symbol:"\u{1F1E7}\u{1F1FE}",group:"flags",keywords:["flag"]},{id:":flag_belize:",symbol:"\u{1F1E7}\u{1F1FF}",group:"flags",keywords:["flag"]},{id:":flag_canada:",symbol:"\u{1F1E8}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_cocos_(keeling)_islands:",symbol:"\u{1F1E8}\u{1F1E8}",group:"flags",keywords:["flag"]},{id:":flag_congo_-_kinshasa:",symbol:"\u{1F1E8}\u{1F1E9}",group:"flags",keywords:["flag"]},{id:":flag_central_african_republic:",symbol:"\u{1F1E8}\u{1F1EB}",group:"flags",keywords:["flag"]},{id:":flag_congo_-_brazzaville:",symbol:"\u{1F1E8}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_switzerland:",symbol:"\u{1F1E8}\u{1F1ED}",group:"flags",keywords:["flag"]},{id:":flag_c\xF4te_d\u2019ivoire:",symbol:"\u{1F1E8}\u{1F1EE}",group:"flags",keywords:["flag"]},{id:":flag_cook_islands:",symbol:"\u{1F1E8}\u{1F1F0}",group:"flags",keywords:["flag"]},{id:":flag_chile:",symbol:"\u{1F1E8}\u{1F1F1}",group:"flags",keywords:["flag"]},{id:":flag_cameroon:",symbol:"\u{1F1E8}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_china:",symbol:"\u{1F1E8}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_colombia:",symbol:"\u{1F1E8}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_clipperton_island:",symbol:"\u{1F1E8}\u{1F1F5}",group:"flags",keywords:["flag"]},{id:":flag_costa_rica:",symbol:"\u{1F1E8}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_cuba:",symbol:"\u{1F1E8}\u{1F1FA}",group:"flags",keywords:["flag"]},{id:":flag_cape_verde:",symbol:"\u{1F1E8}\u{1F1FB}",group:"flags",keywords:["flag"]},{id:":flag_cura\xE7ao:",symbol:"\u{1F1E8}\u{1F1FC}",group:"flags",keywords:["flag"]},{id:":flag_christmas_island:",symbol:"\u{1F1E8}\u{1F1FD}",group:"flags",keywords:["flag"]},{id:":flag_cyprus:",symbol:"\u{1F1E8}\u{1F1FE}",group:"flags",keywords:["flag"]},{id:":flag_czechia:",symbol:"\u{1F1E8}\u{1F1FF}",group:"flags",keywords:["flag"]},{id:":flag_germany:",symbol:"\u{1F1E9}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_diego_garcia:",symbol:"\u{1F1E9}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_djibouti:",symbol:"\u{1F1E9}\u{1F1EF}",group:"flags",keywords:["flag"]},{id:":flag_denmark:",symbol:"\u{1F1E9}\u{1F1F0}",group:"flags",keywords:["flag"]},{id:":flag_dominica:",symbol:"\u{1F1E9}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_dominican_republic:",symbol:"\u{1F1E9}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_algeria:",symbol:"\u{1F1E9}\u{1F1FF}",group:"flags",keywords:["flag"]},{id:":flag_ceuta_&_melilla:",symbol:"\u{1F1EA}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_ecuador:",symbol:"\u{1F1EA}\u{1F1E8}",group:"flags",keywords:["flag"]},{id:":flag_estonia:",symbol:"\u{1F1EA}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_egypt:",symbol:"\u{1F1EA}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_western_sahara:",symbol:"\u{1F1EA}\u{1F1ED}",group:"flags",keywords:["flag"]},{id:":flag_eritrea:",symbol:"\u{1F1EA}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_spain:",symbol:"\u{1F1EA}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_ethiopia:",symbol:"\u{1F1EA}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_european_union:",symbol:"\u{1F1EA}\u{1F1FA}",group:"flags",keywords:["flag"]},{id:":flag_finland:",symbol:"\u{1F1EB}\u{1F1EE}",group:"flags",keywords:["flag"]},{id:":flag_fiji:",symbol:"\u{1F1EB}\u{1F1EF}",group:"flags",keywords:["flag"]},{id:":flag_falkland_islands:",symbol:"\u{1F1EB}\u{1F1F0}",group:"flags",keywords:["flag"]},{id:":flag_micronesia:",symbol:"\u{1F1EB}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_faroe_islands:",symbol:"\u{1F1EB}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_france:",symbol:"\u{1F1EB}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_gabon:",symbol:"\u{1F1EC}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_united_kingdom:",symbol:"\u{1F1EC}\u{1F1E7}",group:"flags",keywords:["flag"]},{id:":flag_grenada:",symbol:"\u{1F1EC}\u{1F1E9}",group:"flags",keywords:["flag"]},{id:":flag_georgia:",symbol:"\u{1F1EC}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_french_guiana:",symbol:"\u{1F1EC}\u{1F1EB}",group:"flags",keywords:["flag"]},{id:":flag_guernsey:",symbol:"\u{1F1EC}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_ghana:",symbol:"\u{1F1EC}\u{1F1ED}",group:"flags",keywords:["flag"]},{id:":flag_gibraltar:",symbol:"\u{1F1EC}\u{1F1EE}",group:"flags",keywords:["flag"]},{id:":flag_greenland:",symbol:"\u{1F1EC}\u{1F1F1}",group:"flags",keywords:["flag"]},{id:":flag_gambia:",symbol:"\u{1F1EC}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_guinea:",symbol:"\u{1F1EC}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_guadeloupe:",symbol:"\u{1F1EC}\u{1F1F5}",group:"flags",keywords:["flag"]},{id:":flag_equatorial_guinea:",symbol:"\u{1F1EC}\u{1F1F6}",group:"flags",keywords:["flag"]},{id:":flag_greece:",symbol:"\u{1F1EC}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_south_georgia_&_south_sandwich_islands:",symbol:"\u{1F1EC}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_guatemala:",symbol:"\u{1F1EC}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_guam:",symbol:"\u{1F1EC}\u{1F1FA}",group:"flags",keywords:["flag"]},{id:":flag_guinea-bissau:",symbol:"\u{1F1EC}\u{1F1FC}",group:"flags",keywords:["flag"]},{id:":flag_guyana:",symbol:"\u{1F1EC}\u{1F1FE}",group:"flags",keywords:["flag"]},{id:":flag_hong_kong_sar_china:",symbol:"\u{1F1ED}\u{1F1F0}",group:"flags",keywords:["flag"]},{id:":flag_heard_&_mcdonald_islands:",symbol:"\u{1F1ED}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_honduras:",symbol:"\u{1F1ED}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_croatia:",symbol:"\u{1F1ED}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_haiti:",symbol:"\u{1F1ED}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_hungary:",symbol:"\u{1F1ED}\u{1F1FA}",group:"flags",keywords:["flag"]},{id:":flag_canary_islands:",symbol:"\u{1F1EE}\u{1F1E8}",group:"flags",keywords:["flag"]},{id:":flag_indonesia:",symbol:"\u{1F1EE}\u{1F1E9}",group:"flags",keywords:["flag"]},{id:":flag_ireland:",symbol:"\u{1F1EE}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_israel:",symbol:"\u{1F1EE}\u{1F1F1}",group:"flags",keywords:["flag"]},{id:":flag_isle_of_man:",symbol:"\u{1F1EE}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_india:",symbol:"\u{1F1EE}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_british_indian_ocean_territory:",symbol:"\u{1F1EE}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_iraq:",symbol:"\u{1F1EE}\u{1F1F6}",group:"flags",keywords:["flag"]},{id:":flag_iran:",symbol:"\u{1F1EE}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_iceland:",symbol:"\u{1F1EE}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_italy:",symbol:"\u{1F1EE}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_jersey:",symbol:"\u{1F1EF}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_jamaica:",symbol:"\u{1F1EF}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_jordan:",symbol:"\u{1F1EF}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_japan:",symbol:"\u{1F1EF}\u{1F1F5}",group:"flags",keywords:["flag"]},{id:":flag_kenya:",symbol:"\u{1F1F0}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_kyrgyzstan:",symbol:"\u{1F1F0}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_cambodia:",symbol:"\u{1F1F0}\u{1F1ED}",group:"flags",keywords:["flag"]},{id:":flag_kiribati:",symbol:"\u{1F1F0}\u{1F1EE}",group:"flags",keywords:["flag"]},{id:":flag_comoros:",symbol:"\u{1F1F0}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_st._kitts_&_nevis:",symbol:"\u{1F1F0}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_north_korea:",symbol:"\u{1F1F0}\u{1F1F5}",group:"flags",keywords:["flag"]},{id:":flag_south_korea:",symbol:"\u{1F1F0}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_kuwait:",symbol:"\u{1F1F0}\u{1F1FC}",group:"flags",keywords:["flag"]},{id:":flag_cayman_islands:",symbol:"\u{1F1F0}\u{1F1FE}",group:"flags",keywords:["flag"]},{id:":flag_kazakhstan:",symbol:"\u{1F1F0}\u{1F1FF}",group:"flags",keywords:["flag"]},{id:":flag_laos:",symbol:"\u{1F1F1}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_lebanon:",symbol:"\u{1F1F1}\u{1F1E7}",group:"flags",keywords:["flag"]},{id:":flag_st._lucia:",symbol:"\u{1F1F1}\u{1F1E8}",group:"flags",keywords:["flag"]},{id:":flag_liechtenstein:",symbol:"\u{1F1F1}\u{1F1EE}",group:"flags",keywords:["flag"]},{id:":flag_sri_lanka:",symbol:"\u{1F1F1}\u{1F1F0}",group:"flags",keywords:["flag"]},{id:":flag_liberia:",symbol:"\u{1F1F1}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_lesotho:",symbol:"\u{1F1F1}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_lithuania:",symbol:"\u{1F1F1}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_luxembourg:",symbol:"\u{1F1F1}\u{1F1FA}",group:"flags",keywords:["flag"]},{id:":flag_latvia:",symbol:"\u{1F1F1}\u{1F1FB}",group:"flags",keywords:["flag"]},{id:":flag_libya:",symbol:"\u{1F1F1}\u{1F1FE}",group:"flags",keywords:["flag"]},{id:":flag_morocco:",symbol:"\u{1F1F2}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_monaco:",symbol:"\u{1F1F2}\u{1F1E8}",group:"flags",keywords:["flag"]},{id:":flag_moldova:",symbol:"\u{1F1F2}\u{1F1E9}",group:"flags",keywords:["flag"]},{id:":flag_montenegro:",symbol:"\u{1F1F2}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_st._martin:",symbol:"\u{1F1F2}\u{1F1EB}",group:"flags",keywords:["flag"]},{id:":flag_madagascar:",symbol:"\u{1F1F2}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_marshall_islands:",symbol:"\u{1F1F2}\u{1F1ED}",group:"flags",keywords:["flag"]},{id:":flag_macedonia:",symbol:"\u{1F1F2}\u{1F1F0}",group:"flags",keywords:["flag"]},{id:":flag_mali:",symbol:"\u{1F1F2}\u{1F1F1}",group:"flags",keywords:["flag"]},{id:":flag_myanmar_(burma):",symbol:"\u{1F1F2}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_mongolia:",symbol:"\u{1F1F2}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_macau_sar_china:",symbol:"\u{1F1F2}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_northern_mariana_islands:",symbol:"\u{1F1F2}\u{1F1F5}",group:"flags",keywords:["flag"]},{id:":flag_martinique:",symbol:"\u{1F1F2}\u{1F1F6}",group:"flags",keywords:["flag"]},{id:":flag_mauritania:",symbol:"\u{1F1F2}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_montserrat:",symbol:"\u{1F1F2}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_malta:",symbol:"\u{1F1F2}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_mauritius:",symbol:"\u{1F1F2}\u{1F1FA}",group:"flags",keywords:["flag"]},{id:":flag_maldives:",symbol:"\u{1F1F2}\u{1F1FB}",group:"flags",keywords:["flag"]},{id:":flag_malawi:",symbol:"\u{1F1F2}\u{1F1FC}",group:"flags",keywords:["flag"]},{id:":flag_mexico:",symbol:"\u{1F1F2}\u{1F1FD}",group:"flags",keywords:["flag"]},{id:":flag_malaysia:",symbol:"\u{1F1F2}\u{1F1FE}",group:"flags",keywords:["flag"]},{id:":flag_mozambique:",symbol:"\u{1F1F2}\u{1F1FF}",group:"flags",keywords:["flag"]},{id:":flag_namibia:",symbol:"\u{1F1F3}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_new_caledonia:",symbol:"\u{1F1F3}\u{1F1E8}",group:"flags",keywords:["flag"]},{id:":flag_niger:",symbol:"\u{1F1F3}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_norfolk_island:",symbol:"\u{1F1F3}\u{1F1EB}",group:"flags",keywords:["flag"]},{id:":flag_nigeria:",symbol:"\u{1F1F3}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_nicaragua:",symbol:"\u{1F1F3}\u{1F1EE}",group:"flags",keywords:["flag"]},{id:":flag_netherlands:",symbol:"\u{1F1F3}\u{1F1F1}",group:"flags",keywords:["flag"]},{id:":flag_norway:",symbol:"\u{1F1F3}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_nepal:",symbol:"\u{1F1F3}\u{1F1F5}",group:"flags",keywords:["flag"]},{id:":flag_nauru:",symbol:"\u{1F1F3}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_niue:",symbol:"\u{1F1F3}\u{1F1FA}",group:"flags",keywords:["flag"]},{id:":flag_new_zealand:",symbol:"\u{1F1F3}\u{1F1FF}",group:"flags",keywords:["flag"]},{id:":flag_oman:",symbol:"\u{1F1F4}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_panama:",symbol:"\u{1F1F5}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_peru:",symbol:"\u{1F1F5}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_french_polynesia:",symbol:"\u{1F1F5}\u{1F1EB}",group:"flags",keywords:["flag"]},{id:":flag_papua_new_guinea:",symbol:"\u{1F1F5}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_philippines:",symbol:"\u{1F1F5}\u{1F1ED}",group:"flags",keywords:["flag"]},{id:":flag_pakistan:",symbol:"\u{1F1F5}\u{1F1F0}",group:"flags",keywords:["flag"]},{id:":flag_poland:",symbol:"\u{1F1F5}\u{1F1F1}",group:"flags",keywords:["flag"]},{id:":flag_st._pierre_&_miquelon:",symbol:"\u{1F1F5}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_pitcairn_islands:",symbol:"\u{1F1F5}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_puerto_rico:",symbol:"\u{1F1F5}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_palestinian_territories:",symbol:"\u{1F1F5}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_portugal:",symbol:"\u{1F1F5}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_palau:",symbol:"\u{1F1F5}\u{1F1FC}",group:"flags",keywords:["flag"]},{id:":flag_paraguay:",symbol:"\u{1F1F5}\u{1F1FE}",group:"flags",keywords:["flag"]},{id:":flag_qatar:",symbol:"\u{1F1F6}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_r\xE9union:",symbol:"\u{1F1F7}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_romania:",symbol:"\u{1F1F7}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_serbia:",symbol:"\u{1F1F7}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_russia:",symbol:"\u{1F1F7}\u{1F1FA}",group:"flags",keywords:["flag"]},{id:":flag_rwanda:",symbol:"\u{1F1F7}\u{1F1FC}",group:"flags",keywords:["flag"]},{id:":flag_saudi_arabia:",symbol:"\u{1F1F8}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_solomon_islands:",symbol:"\u{1F1F8}\u{1F1E7}",group:"flags",keywords:["flag"]},{id:":flag_seychelles:",symbol:"\u{1F1F8}\u{1F1E8}",group:"flags",keywords:["flag"]},{id:":flag_sudan:",symbol:"\u{1F1F8}\u{1F1E9}",group:"flags",keywords:["flag"]},{id:":flag_sweden:",symbol:"\u{1F1F8}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_singapore:",symbol:"\u{1F1F8}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_st._helena:",symbol:"\u{1F1F8}\u{1F1ED}",group:"flags",keywords:["flag"]},{id:":flag_slovenia:",symbol:"\u{1F1F8}\u{1F1EE}",group:"flags",keywords:["flag"]},{id:":flag_svalbard_&_jan_mayen:",symbol:"\u{1F1F8}\u{1F1EF}",group:"flags",keywords:["flag"]},{id:":flag_slovakia:",symbol:"\u{1F1F8}\u{1F1F0}",group:"flags",keywords:["flag"]},{id:":flag_sierra_leone:",symbol:"\u{1F1F8}\u{1F1F1}",group:"flags",keywords:["flag"]},{id:":flag_san_marino:",symbol:"\u{1F1F8}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_senegal:",symbol:"\u{1F1F8}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_somalia:",symbol:"\u{1F1F8}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_suriname:",symbol:"\u{1F1F8}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_south_sudan:",symbol:"\u{1F1F8}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_s\xE3o_tom\xE9_&_pr\xEDncipe:",symbol:"\u{1F1F8}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_el_salvador:",symbol:"\u{1F1F8}\u{1F1FB}",group:"flags",keywords:["flag"]},{id:":flag_sint_maarten:",symbol:"\u{1F1F8}\u{1F1FD}",group:"flags",keywords:["flag"]},{id:":flag_syria:",symbol:"\u{1F1F8}\u{1F1FE}",group:"flags",keywords:["flag"]},{id:":flag_swaziland:",symbol:"\u{1F1F8}\u{1F1FF}",group:"flags",keywords:["flag"]},{id:":flag_tristan_da_cunha:",symbol:"\u{1F1F9}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_turks_&_caicos_islands:",symbol:"\u{1F1F9}\u{1F1E8}",group:"flags",keywords:["flag"]},{id:":flag_chad:",symbol:"\u{1F1F9}\u{1F1E9}",group:"flags",keywords:["flag"]},{id:":flag_french_southern_territories:",symbol:"\u{1F1F9}\u{1F1EB}",group:"flags",keywords:["flag"]},{id:":flag_togo:",symbol:"\u{1F1F9}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_thailand:",symbol:"\u{1F1F9}\u{1F1ED}",group:"flags",keywords:["flag"]},{id:":flag_tajikistan:",symbol:"\u{1F1F9}\u{1F1EF}",group:"flags",keywords:["flag"]},{id:":flag_tokelau:",symbol:"\u{1F1F9}\u{1F1F0}",group:"flags",keywords:["flag"]},{id:":flag_timor-leste:",symbol:"\u{1F1F9}\u{1F1F1}",group:"flags",keywords:["flag"]},{id:":flag_turkmenistan:",symbol:"\u{1F1F9}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_tunisia:",symbol:"\u{1F1F9}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_tonga:",symbol:"\u{1F1F9}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_turkey:",symbol:"\u{1F1F9}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_trinidad_&_tobago:",symbol:"\u{1F1F9}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_tuvalu:",symbol:"\u{1F1F9}\u{1F1FB}",group:"flags",keywords:["flag"]},{id:":flag_taiwan:",symbol:"\u{1F1F9}\u{1F1FC}",group:"flags",keywords:["flag"]},{id:":flag_tanzania:",symbol:"\u{1F1F9}\u{1F1FF}",group:"flags",keywords:["flag"]},{id:":flag_ukraine:",symbol:"\u{1F1FA}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_uganda:",symbol:"\u{1F1FA}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_u.s._outlying_islands:",symbol:"\u{1F1FA}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_united_nations:",symbol:"\u{1F1FA}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_united_states:",symbol:"\u{1F1FA}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_uruguay:",symbol:"\u{1F1FA}\u{1F1FE}",group:"flags",keywords:["flag"]},{id:":flag_uzbekistan:",symbol:"\u{1F1FA}\u{1F1FF}",group:"flags",keywords:["flag"]},{id:":flag_vatican_city:",symbol:"\u{1F1FB}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_st._vincent_&_grenadines:",symbol:"\u{1F1FB}\u{1F1E8}",group:"flags",keywords:["flag"]},{id:":flag_venezuela:",symbol:"\u{1F1FB}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_british_virgin_islands:",symbol:"\u{1F1FB}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_u.s._virgin_islands:",symbol:"\u{1F1FB}\u{1F1EE}",group:"flags",keywords:["flag"]},{id:":flag_vietnam:",symbol:"\u{1F1FB}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_vanuatu:",symbol:"\u{1F1FB}\u{1F1FA}",group:"flags",keywords:["flag"]},{id:":flag_wallis_&_futuna:",symbol:"\u{1F1FC}\u{1F1EB}",group:"flags",keywords:["flag"]},{id:":flag_samoa:",symbol:"\u{1F1FC}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_kosovo:",symbol:"\u{1F1FD}\u{1F1F0}",group:"flags",keywords:["flag"]},{id:":flag_yemen:",symbol:"\u{1F1FE}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_mayotte:",symbol:"\u{1F1FE}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_south_africa:",symbol:"\u{1F1FF}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_zambia:",symbol:"\u{1F1FF}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_zimbabwe:",symbol:"\u{1F1FF}\u{1F1FC}",group:"flags",keywords:["flag"]},{id:":flag_england:",symbol:"\u{1F3F4}\u{E0067}\u{E0062}\u{E0065}\u{E006E}\u{E0067}\u{E007F}",group:"flags",keywords:["flag"]},{id:":flag_scotland:",symbol:"\u{1F3F4}\u{E0067}\u{E0062}\u{E0073}\u{E0063}\u{E0074}\u{E007F}",group:"flags",keywords:["flag"]},{id:":flag_wales:",symbol:"\u{1F3F4}\u{E0067}\u{E0062}\u{E0077}\u{E006C}\u{E0073}\u{E007F}",group:"flags",keywords:["flag"]}];function vk(e){function t(i,o,n){if(o.includes(i))return!0;if(n.length!==0){for(let s=0;s{let s=_k.filter(r=>t(e,r.id,r.keywords)).map(r=>({id:r.id,name:r.id.replace(/:/g,""),text:r.symbol,type:"emoji"}));i(s)})}var Nm={autosave:{waitingTime:5e3,save(e){return dk(e)}},heading:{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h1",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h2",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h3",title:"Heading 3",class:"ck-heading_heading3"},{model:"heading4",view:"h4",title:"Heading 4",class:"ck-heading_heading4"},{model:"heading5",view:"h5",title:"Heading 5",class:"ck-heading_heading5"}]},toolbar:{},OPMacroEmbeddedTable:{toolbar:["opEditEmbeddedTableQuery"]},OPMacroWpButton:{toolbar:["opEditWpMacroButton"]},OPWikiIncludePage:{toolbar:["opEditWikiIncludeMacroButton"]},OPCodeBlock:{toolbar:["opEditCodeBlock"]},OPChildPages:{toolbar:["opEditChildPagesMacroButton"]},image:{insert:{type:"inline"},resizeUnit:"px",resizeOptions:[{name:"imageResize:original",value:null,icon:"original"},{name:"imageResize:50",value:"50",icon:"medium"},{name:"imageResize:75",value:"75",icon:"large"}],toolbar:["toggleImageCaption","imageTextAlternative","|","imageStyle:inline","imageStyle:block","|","imageResize:original"]},table:{contentToolbar:["tableColumn","tableRow","mergeTableCells","tableProperties","tableCellProperties"]},mention:{feeds:[{marker:"@",feed:wk,itemRenderer:wa,minimumCharacters:0},{marker:"###",feed:tu("###"),itemRenderer:wa,minimumCharacters:1},{marker:"##",feed:tu("##"),itemRenderer:wa,minimumCharacters:1},{marker:"#",feed:tu("#"),itemRenderer:wa,minimumCharacters:1},{marker:":",feed:vk,itemRenderer:yk,minimumCharacters:1}]},language:"en",licenseKey:"GPL"};function zm(e){return(t,i)=>{let o=i.openProject.context;i.removePlugins=i.removePlugins||[];let n=o.resource;if(n&&n.canAddAttachments||i.removePlugins.push(...Om.map(r=>r.pluginName)),o.macros===!1&&(i.openProject.disableAllMacros=!0,i.removePlugins.push(...gs.map(r=>r.pluginName))),Array.isArray(o.macros)){let r=gs.filter(a=>o.macros.indexOf(a.pluginName)===-1);i.removePlugins.push(...r)}i.disabledMentions=[];let s=o.disabledMentions;return Array.isArray(s)&&(i.disabledMentions=s),e.create({...i,root:{...i.root,element:t}})}}var so=class extends wh{},ro=class extends wh{};window.OPConstrainedEditor=so;window.OPClassicEditor=ro;ro.createCustomized=zm(ro);ro.builtinPlugins=Dm;ro.defaultConfig=Object.assign({},Nm);ro.defaultConfig.toolbar={items:["heading","|","bold","italic","strikethrough","code","insertCodeBlock","link","bulletedList","numberedList","todoList","imageUpload","blockQuote","|","insertTable","macroList","|","opContentRevisions","undo","redo","openProjectShowFormattingHelp","|","pageBreak","|","preview","opShowSource"]};so.createCustomized=zm(so);so.builtinPlugins=Dm;so.defaultConfig=Object.assign({},Nm);so.defaultConfig.toolbar={items:["bold","italic","strikethrough","code","insertCodeBlock","link","bulletedList","numberedList","todoList","imageUpload","blockQuote","|","opContentRevisions","undo","redo","openProjectShowFormattingHelp","preview","opShowSource"]};export{so as ConstrainedEditor,ro as FullEditor}; +`;var aa=class extends w{init(){let t=this.editor,i=Th(t);t.ui.componentFactory.add("opContentRevisions",o=>{let n=ye(o),s=new G;return ht(n,s,{role:"menu",ariaLabel:i.t("js.editor.revisions")}),n.buttonView.set({label:i.t("js.editor.revisions"),icon:mk,tooltip:!0}),this.listenTo(n.buttonView,"execute",async()=>{s.clear(),FD(t,s)}),n.on("execute",r=>{let{timestamp:a}=r.source;a&&t.execute("opContentRevisionApply",a)}),n})}};function FD(e,t){let i=e.config.get(jo),o=$o(i),n=Th(e),s=xt(e,"timezone");if(!o?.items||o.items.count<=0){let l={type:"button",model:{label:n.t("js.editor.no_revisions"),withText:!0}};t.add(l);return}let r=e.getData(),a=eu(r);for(let l=o.items.length;l>0;){l--;let c=o.items[l],u=s.formattedRelativeDateTime(c.timestamp),d=n.t("js.units.word",{count:hk(c.content)}),f=`${c.hash===a?`${n.t("js.label_current")} - `:""}${u} (${d})`,m={type:"button",model:{timestamp:c.timestamp,label:f,withText:!0}};t.add(m)}}var la=class extends M{async execute(t){let i=this.editor,o=i.config.get(jo),n=await $o(o);if(!n){console.error(`Trying to load revision ${t} but no record present.`);return}let s=n.items.find(r=>r.timestamp===t);s&&(i.setData(s.content),setTimeout(()=>{i.editing.view.focus()}))}};var jo="opContentRevisionKey",gk="op_ckeditor_rev",ND="storageKey",ca=class extends w{static get requires(){return[Yc,aa]}static get pluginName(){return"OpContentRevisions"}constructor(t){super(t);let i=this.getStorageKey(t);t.config.define(jo,i)}init(){let t=this.editor;t.commands.add("opContentRevisionApply",new la(t)),t.once("ready",()=>{let i=Date.now();t.plugins.get("Autosave")._domEmitter.stopListening(window,"beforeunload"),Object.keys(localStorage).forEach(o=>{if(o.startsWith(gk)){let n=$o(o);n?.updatedAt&&i-n.updatedAt>=288e5&&localStorage.removeItem(o)}})})}getStorageKey(t){let i=t.config.get(ND);return i||this.createLocalStorageKey(t)}createLocalStorageKey(t){let i=Dt(t),o=ql(t),n="";return i?.href?n=i.href:n=location.pathname,o&&(n+=`_${o}`),`${gk}_${n}`}};var ks="op-macro-wp-quickinfo",Om="opce-macro-wp-quickinfo",ua=class extends w{static get requires(){return[Re]}static get pluginName(){return"OPMacroWpQuickinfo"}init(){let t=this.editor,i=t.model,o=t.conversion;i.schema.register(ks,{allowWhere:"$text",isInline:!0,isObject:!0,allowAttributes:["wpId","wpDisplayId","detailed","markerText"]}),o.for("upcast").elementToElement({view:{name:Om},model:(n,{writer:s})=>{let r=n.getAttribute("data-id")||"",l=n.getAttribute("data-display-id")||""||r,c=n.getAttribute("data-detailed")==="true",u={wpDisplayId:l,detailed:c};return r&&r!==l&&(u.wpId=r),s.createElement(ks,u)},converterPriority:"high"}),o.for("upcast").elementToElement({view:{name:"mention",classes:"mention"},model:(n,{writer:s})=>{if(!Qc(n))return null;let r=n.getAttribute("data-text"),a=r.startsWith("###"),l=n.getAttribute("data-id")||"",c=n.getAttribute("data-display-id")||l;return s.createElement(ks,{wpId:l,wpDisplayId:c,detailed:a,markerText:r})},converterPriority:"highest"}),o.for("editingDowncast").elementToElement({model:ks,view:(n,{writer:s})=>{let r=n.getAttribute("wpDisplayId")||"",a=!!n.getAttribute("detailed"),l=n.getAttribute("wpId")||r,c=n.getAttribute("markerText")||`${a?"###":"##"}${r}`,u=s.createContainerElement("span",{class:"op-macro-wp-quickinfo-widget"}),d=s.createRawElement(Om,{"data-id":l,"data-display-id":r,"data-detailed":String(a)},()=>{});return s.insert(s.createPositionAt(u,0),d),me(u,s,{label:c})}}),o.for("dataDowncast").elementToElement({model:ks,view:(n,{writer:s})=>{let r=n.getAttribute("wpDisplayId")||"",a=!!n.getAttribute("detailed"),l=n.getAttribute("wpId"),c=n.getAttribute("markerText")||`${a?"###":"##"}${r}`;if(l){let d=s.createContainerElement("mention",{class:"mention","data-id":l,"data-type":"work_package","data-text":c,"data-display-id":r});return s.insert(s.createPositionAt(d,0),s.createText(c)),d}let u=s.createContainerElement(Om,{"data-id":l||r,"data-display-id":r,"data-detailed":String(a)});return s.insert(s.createPositionAt(u,0),s.createText(c)),u}})}afterInit(){let t=this.editor,i=t.commands.get("mention");i&&i.on("execute",(o,n)=>{let s=n&&n[0];if(!s||!s.mention||s.mention.type!=="work_package")return;let r=s.marker;if(r!=="##"&&r!=="###")return;o.stop();let a=r==="###",l=String(s.mention.dataDisplayId),c=s.mention.dataId!=null?String(s.mention.dataId):null,u=s.mention.text||`${r}${l}`;t.model.change(d=>{let h=s.range||t.model.document.selection.getFirstRange();h&&d.remove(h);let f={wpDisplayId:l,detailed:a,markerText:u};c&&(f.wpId=c);let m=d.createElement(ks,f);t.model.insertContent(m,t.model.document.selection),d.setSelection(d.createPositionAfter(m))})},{priority:"high"})}};function Dm(e,t,i,o){return ti(e).wikiPageLinkMacro(t,i,o)}var da="op-macro-wiki-page-link",Ko=class extends w{static get pluginName(){return"OpMacroWikiPageLink"}static get modelElementName(){return da}init(){let t=this.editor,i=t.conversion;t.model.schema.register(da,{allowWhere:"$text",isInline:!0,isObject:!0,allowAttributes:["providerId","pageIdentifier"]}),i.for("upcast").elementToElement({view:{name:"turbo-frame",attributes:{"data-type":"wiki-page-link"}},model:(o,{writer:n})=>{let s=o.getAttribute("data-provider-id"),r=o.getAttribute("data-page-identifier");return n.createElement(da,{providerId:s,pageIdentifier:r})}}),i.for("dataDowncast").elementToElement({model:da,view:(o,{writer:n})=>{let s=o.getAttribute("providerId"),r=o.getAttribute("pageIdentifier"),a=crypto.randomUUID(),l=n.createContainerElement("turbo-frame",{id:a,src:Dm(t,s,r,a),"data-provider-id":s,"data-page-identifier":r,"data-type":"wiki-page-link"}),c=`[[[${s}:${r}]]]`;return n.insert(n.createPositionAt(l,0),n.createText(c)),l}}),i.for("editingDowncast").elementToElement({model:da,view:(o,{writer:n})=>{let s=o.getAttribute("providerId"),r=o.getAttribute("pageIdentifier"),a=crypto.randomUUID(),l=n.createContainerElement("span",{class:"my-wiki-page-link-widget"}),c=n.createRawElement("turbo-frame",{id:a,src:Dm(t,s,r,a),"data-provider-id":s,"data-page-identifier":r,"data-type":"wiki-page-link"},()=>{});return n.insert(n.createPositionAt(l,0),c),me(l,n,{label:`[[[${s}:${r}]]]`})}})}};function iu(e,t,i){if(!t||!i)return;let o=e.model;o.change(n=>{let s=n.createElement(Ko.modelElementName,{providerId:t,pageIdentifier:i});o.insertContent(s,o.document.selection)})}var ha=class e extends w{static get pluginName(){return"OpMacroWikiPageLinkAddExisting"}static get buttonName(){return"insertExistingWikiPageLink"}get label(){return window.I18n.t("js.editor.macro.wikis.add_existing")}closeDialogHandler=this.handleCloseDialog.bind(this);init(){let t=this.editor;t.ui.componentFactory.add(e.buttonName,i=>{let o=new I(i);return o.set({label:this.label,withText:!0}),o.on("execute",()=>{this.runModalDialog(t)}),o})}runModalDialog(t){document.addEventListener("dialog:close",this.closeDialogHandler);let i=xt(t,"turboRequests"),o=ti(t).openExistingWikiPageDialog();i.request(o,{method:"GET"})}handleCloseDialog(t){if(t.detail.additional?.action!=="close_existing_page_dialog")return;document.removeEventListener("dialog:close",this.closeDialogHandler);let{providerId:i,pageIdentifier:o}=t.detail.additional;iu(this.editor,i,o)}};var fa=class e extends w{static get pluginName(){return"OpMacroWikiPageLinkCreateNew"}static get buttonName(){return"createNewWikiPageLink"}get label(){return window.I18n.t("js.editor.macro.wikis.create_new")}closeDialogHandler=this.handleCloseDialog.bind(this);init(){let t=this.editor;t.ui.componentFactory.add(e.buttonName,i=>{let o=new I(i);return o.set({label:this.label,withText:!0}),o.on("execute",()=>{this.runModalDialog(t)}),o})}runModalDialog(t){document.addEventListener("dialog:close",this.closeDialogHandler);let i=xt(t,"turboRequests"),o=ti(t).openNewWikiPageDialog();i.request(o,{method:"GET"})}handleCloseDialog(t){if(t.detail.additional?.action!=="close_new_page_dialog")return;document.removeEventListener("dialog:close",this.closeDialogHandler);let{providerId:i,pageIdentifier:o}=t.detail.additional;iu(this.editor,i,o)}};var ma=class extends w{static get requires(){return[is]}static get pluginName(){return"OPResizerGuard"}afterInit(){let t=this.editor.plugins.get("WidgetResize"),i=t.redrawSelectedResizer.bind(t),o=!1;t.redrawSelectedResizer=function(){if(!o){o=!0;try{return i()}finally{o=!1}}}}};var gs=[Cr,Tr,Ar,Lr,ha,fa],Fm=[Rr,Qr],Nm=[uy,fy,gy,Yc,_y,vy,ky,Cy,Ey,Ry,U2,q2,j2,oy,ey,ny,na,ma,Ny,a_,l_,ck,uk,oc,Fl,ak,lk,b5,zr,sa,ca,ua,Ko,qr,Vm,G_,Q_,u5,c5,Jr,Zr,ra].concat(gs,Fm);var ga=class{constructor(t){this.response=t}get statusCode(){return this.response.status}get redirected(){return this.response.redirected}get ok(){return this.response.ok}get unauthenticated(){return this.statusCode===401}get unprocessableEntity(){return this.statusCode===422}get authenticationURL(){return this.response.headers.get("WWW-Authenticate")}get contentType(){return(this.response.headers.get("Content-Type")||"").replace(/;.*$/,"")}get headers(){return this.response.headers}get html(){return this.contentType.match(/^(application|text)\/(html|xhtml\+xml)$/)?this.text:Promise.reject(new Error(`Expected an HTML response but got "${this.contentType}" instead`))}get json(){return this.contentType.match(/^application\/.*json$/)?this.responseJson||(this.responseJson=this.response.json()):Promise.reject(new Error(`Expected a JSON response but got "${this.contentType}" instead`))}get text(){return this.responseText||(this.responseText=this.response.text())}get isTurboStream(){return this.contentType.match(/^text\/vnd\.turbo-stream\.html/)}get isScript(){return this.contentType.match(/\b(?:java|ecma)script\b/)}async renderTurboStream(){if(this.isTurboStream)window.Turbo?await window.Turbo.renderStreamMessage(await this.text):console.warn("You must set `window.Turbo = Turbo` to automatically process Turbo Stream events with request.js");else return Promise.reject(new Error(`Expected a Turbo Stream response but got "${this.contentType}" instead`))}async activeScript(){if(this.isScript){let t=document.createElement("script"),i=document.querySelector("meta[name=csp-nonce]");if(i){let o=i.nonce===""?i.content:i.nonce;o&&t.setAttribute("nonce",o)}t.innerHTML=await this.text,document.body.appendChild(t)}else return Promise.reject(new Error(`Expected a Script response but got "${this.contentType}" instead`))}};var pa=class{static register(t){this.interceptor=t}static get(){return this.interceptor}static reset(){this.interceptor=void 0}};function pk(e){let t=document.cookie?document.cookie.split("; "):[],i=`${encodeURIComponent(e)}=`,o=t.find(n=>n.startsWith(i));if(o){let n=o.split("=").slice(1).join("=");if(n)return decodeURIComponent(n)}}function bk(e){let t={};for(let i in e){let o=e[i];o!==void 0&&(t[i]=o)}return t}function zm(e){let t=document.head.querySelector(`meta[name="${e}"]`);return t&&t.content}function wk(e){return[...e].reduce((t,[i,o])=>t.concat(typeof o=="string"?[[i,o]]:[]),[])}function yk(e,t){for(let[i,o]of t)o instanceof window.File||(e.has(i)&&!i.includes("[]")?(e.delete(i),e.set(i,o)):e.append(i,o))}var ba=class{constructor(t,i,o={}){this.method=t,this.options=o,this.originalUrl=i.toString()}async perform(){try{let n=pa.get();n&&await n(this)}catch(n){console.error(n)}let t=window.Turbo?window.Turbo.fetch:window.fetch,i=new ga(await t(this.url,this.fetchOptions));return i.unauthenticated&&i.authenticationURL?Promise.reject(window.location.href=i.authenticationURL):(i.isScript&&await i.activeScript(),(i.ok||i.unprocessableEntity)&&i.isTurboStream&&await i.renderTurboStream(),i)}addHeader(t,i){let o=this.additionalHeaders;o[t]=i,this.options.headers=o}sameHostname(){if(!this.originalUrl.startsWith("http:")&&!this.originalUrl.startsWith("https:"))return!0;try{return new URL(this.originalUrl).hostname===window.location.hostname}catch{return!0}}get fetchOptions(){return{method:this.method.toUpperCase(),headers:this.headers,body:this.formattedBody,signal:this.signal,credentials:this.credentials,redirect:this.redirect,keepalive:this.keepalive}}get headers(){let t={"X-Requested-With":"XMLHttpRequest","Content-Type":this.contentType,Accept:this.accept};return this.sameHostname()&&(t["X-CSRF-Token"]=this.csrfToken),bk(Object.assign(t,this.additionalHeaders))}get csrfToken(){return pk(zm("csrf-param"))||zm("csrf-token")}get contentType(){return this.options.contentType?this.options.contentType:this.body==null||this.body instanceof window.FormData?void 0:this.body instanceof window.File?this.body.type:"application/json"}get accept(){switch(this.responseKind){case"html":return"text/html, application/xhtml+xml";case"turbo-stream":return"text/vnd.turbo-stream.html, text/html, application/xhtml+xml";case"json":return"application/json, application/vnd.api+json";case"script":return"text/javascript, application/javascript";default:return"*/*"}}get body(){return this.options.body}get query(){let t=(this.originalUrl.split("?")[1]||"").split("#")[0],i=new URLSearchParams(t),o=this.options.query;o instanceof window.FormData?o=wk(o):o instanceof window.URLSearchParams?o=o.entries():o=Object.entries(o||{}),yk(i,o);let n=i.toString();return n.length>0?`?${n}`:""}get url(){return this.originalUrl.split("?")[0].split("#")[0]+this.query}get responseKind(){return this.options.responseKind||"html"}get signal(){return this.options.signal}get redirect(){return this.options.redirect||"follow"}get credentials(){return this.options.credentials||"same-origin"}get keepalive(){return this.options.keepalive||!1}get additionalHeaders(){return this.options.headers||{}}get formattedBody(){let t=Object.prototype.toString.call(this.body)==="[object String]";return this.headers["Content-Type"]==="application/json"&&!t?JSON.stringify(this.body):this.body}};async function wa(e,t){return new ba("get",e,t).perform()}function zD(e,t){let i=new Set;return e.filter(o=>{let n=t(o);return i.has(n)?!1:(i.add(n),!0)})}function _k(e){let t=this,i=Dt(t);if(i&&i._type==="Activity::Comment"){let r=i.$embedded.workPackage;r&&(i=r)}if(!i)return[];if(t.config.get("disabledMentions").includes("user"))return[];let o=ti(t).api.v3.principals(i,e);if(!o)return[];let n=ge(t),s=window.OpenProject.urlRoot;return new Promise((r,a)=>{wa(o,{responseKind:"json",query:{select:"elements/_type,elements/id,elements/name"}}).then(l=>l.json).then(l=>{r(zD(l._embedded.elements,c=>c.id).map(c=>{let u=c._type.toLowerCase(),d=`@${c.name}`,h=`@${c.id}`,f=n.services.apiV3Service[`${u}s`].segment,m=`${s}/${f}/${c.id}`;return{type:u,id:h,text:d,link:m,dataId:c.id,name:c.name}}))}).catch(l=>{console.error("Error fetching user mentions:",l),a(l)})})}function ou(e){return function(t){let i=this,o=window.OpenProject.urlRoot,n=`${o}/work_packages/auto_complete.json`;return i.config.get("disabledMentions").includes("work_package")?[]:new Promise((s,r)=>{wa(n,{responseKind:"json",query:{q:t,scope:"all"}}).then(a=>a.json).then(a=>{s(a.map(l=>{let c=l.displayId||l.id,u=`${e}${c}`;return{id:u,dataId:l.id,dataDisplayId:c,type:"work_package",text:u,name:l.to_s,link:`${o}/work_packages/${c}`}}))}).catch(a=>{console.error("Error fetching work package mentions:",a),r(a)})})}}function ya(e){let t=document.createElement("span");return(e.type==="user"||e.type==="work_package")&&(t.setAttribute("data-hover-card-trigger-target","trigger"),t.setAttribute("data-hover-card-url",`${e.link}/hover_card`)),t.classList.add("mention-list-item"),t.textContent=e.name,t}function vk(e){let t=document.createElement("span");return t.classList.add("mention-list-item"),t.textContent=`${e.text} ${e.name}`,t}var kk=[{id:":grinning_face:",symbol:"\u{1F600}",group:"people",keywords:["face","grin","grinning face"]},{id:":beaming_face_with_smiling_eyes:",symbol:"\u{1F601}",group:"people",keywords:["beaming face with smiling eyes","eye","face","grin","smile"]},{id:":face_with_tears_of_joy:",symbol:"\u{1F602}",group:"people",keywords:["face","face with tears of joy","joy","laugh","tear"]},{id:":rolling_on_the_floor_laughing:",symbol:"\u{1F923}",group:"people",keywords:["face","floor","laugh","rolling","rolling on the floor laughing"]},{id:":grinning_face_with_big_eyes:",symbol:"\u{1F603}",group:"people",keywords:["face","grinning face with big eyes","mouth","open","smile"]},{id:":grinning_face_with_smiling_eyes:",symbol:"\u{1F604}",group:"people",keywords:["eye","face","grinning face with smiling eyes","mouth","open","smile"]},{id:":grinning_face_with_sweat:",symbol:"\u{1F605}",group:"people",keywords:["cold","face","grinning face with sweat","open","smile","sweat"]},{id:":grinning_squinting_face:",symbol:"\u{1F606}",group:"people",keywords:["face","grinning squinting face","laugh","mouth","satisfied","smile"]},{id:":winking_face:",symbol:"\u{1F609}",group:"people",keywords:["face","wink","winking face"]},{id:":smiling_face_with_smiling_eyes:",symbol:"\u{1F60A}",group:"people",keywords:["blush","eye","face","smile","smiling face with smiling eyes"]},{id:":face_savoring_food:",symbol:"\u{1F60B}",group:"people",keywords:["delicious","face","face savoring food","savouring","smile","yum"]},{id:":smiling_face_with_sunglasses:",symbol:"\u{1F60E}",group:"people",keywords:["bright","cool","face","smiling face with sunglasses","sun","sunglasses"]},{id:":smiling_face_with_heart-eyes:",symbol:"\u{1F60D}",group:"people",keywords:["eye","face","love","smile","smiling face with heart-eyes"]},{id:":face_blowing_a_kiss:",symbol:"\u{1F618}",group:"people",keywords:["face","face blowing a kiss","kiss"]},{id:":kissing_face:",symbol:"\u{1F617}",group:"people",keywords:["face","kiss","kissing face"]},{id:":kissing_face_with_smiling_eyes:",symbol:"\u{1F619}",group:"people",keywords:["eye","face","kiss","kissing face with smiling eyes","smile"]},{id:":kissing_face_with_closed_eyes:",symbol:"\u{1F61A}",group:"people",keywords:["closed","eye","face","kiss","kissing face with closed eyes"]},{id:":smiling_face:",symbol:"\u263A",group:"people",keywords:["face","outlined","relaxed","smile","smiling face"]},{id:":slightly_smiling_face:",symbol:"\u{1F642}",group:"people",keywords:["face","slightly smiling face","smile"]},{id:":hugging_face:",symbol:"\u{1F917}",group:"people",keywords:["face","hug","hugging"]},{id:":star-struck:",symbol:"\u{1F929}",group:"people",keywords:["eyes","face","grinning","star","star-struck",""]},{id:":thinking_face:",symbol:"\u{1F914}",group:"people",keywords:["face","thinking"]},{id:":face_with_raised_eyebrow:",symbol:"\u{1F928}",group:"people",keywords:["distrust","face with raised eyebrow","skeptic",""]},{id:":neutral_face:",symbol:"\u{1F610}",group:"people",keywords:["deadpan","face","neutral"]},{id:":expressionless_face:",symbol:"\u{1F611}",group:"people",keywords:["expressionless","face","inexpressive","unexpressive"]},{id:":face_without_mouth:",symbol:"\u{1F636}",group:"people",keywords:["face","face without mouth","mouth","quiet","silent"]},{id:":face_with_rolling_eyes:",symbol:"\u{1F644}",group:"people",keywords:["eyes","face","face with rolling eyes","rolling"]},{id:":smirking_face:",symbol:"\u{1F60F}",group:"people",keywords:["face","smirk","smirking face"]},{id:":persevering_face:",symbol:"\u{1F623}",group:"people",keywords:["face","persevere","persevering face"]},{id:":sad_but_relieved_face:",symbol:"\u{1F625}",group:"people",keywords:["disappointed","face","relieved","sad but relieved face","whew"]},{id:":face_with_open_mouth:",symbol:"\u{1F62E}",group:"people",keywords:["face","face with open mouth","mouth","open","sympathy"]},{id:":zipper-mouth_face:",symbol:"\u{1F910}",group:"people",keywords:["face","mouth","zipper","zipper-mouth face"]},{id:":hushed_face:",symbol:"\u{1F62F}",group:"people",keywords:["face","hushed","stunned","surprised"]},{id:":sleepy_face:",symbol:"\u{1F62A}",group:"people",keywords:["face","sleep","sleepy face"]},{id:":tired_face:",symbol:"\u{1F62B}",group:"people",keywords:["face","tired"]},{id:":sleeping_face:",symbol:"\u{1F634}",group:"people",keywords:["face","sleep","sleeping face","zzz"]},{id:":relieved_face:",symbol:"\u{1F60C}",group:"people",keywords:["face","relieved"]},{id:":face_with_tongue:",symbol:"\u{1F61B}",group:"people",keywords:["face","face with tongue","tongue"]},{id:":winking_face_with_tongue:",symbol:"\u{1F61C}",group:"people",keywords:["eye","face","joke","tongue","wink","winking face with tongue"]},{id:":squinting_face_with_tongue:",symbol:"\u{1F61D}",group:"people",keywords:["eye","face","horrible","squinting face with tongue","taste","tongue"]},{id:":drooling_face:",symbol:"\u{1F924}",group:"people",keywords:["drooling","face"]},{id:":unamused_face:",symbol:"\u{1F612}",group:"people",keywords:["face","unamused","unhappy"]},{id:":downcast_face_with_sweat:",symbol:"\u{1F613}",group:"people",keywords:["cold","downcast face with sweat","face","sweat"]},{id:":pensive_face:",symbol:"\u{1F614}",group:"people",keywords:["dejected","face","pensive"]},{id:":confused_face:",symbol:"\u{1F615}",group:"people",keywords:["confused","face"]},{id:":upside-down_face:",symbol:"\u{1F643}",group:"people",keywords:["face","upside-down"]},{id:":money-mouth_face:",symbol:"\u{1F911}",group:"people",keywords:["face","money","money-mouth face","mouth"]},{id:":astonished_face:",symbol:"\u{1F632}",group:"people",keywords:["astonished","face","shocked","totally"]},{id:":frowning_face:",symbol:"\u2639",group:"people",keywords:["face","frown","frowning face"]},{id:":slightly_frowning_face:",symbol:"\u{1F641}",group:"people",keywords:["face","frown","slightly frowning face"]},{id:":confounded_face:",symbol:"\u{1F616}",group:"people",keywords:["confounded","face"]},{id:":disappointed_face:",symbol:"\u{1F61E}",group:"people",keywords:["disappointed","face"]},{id:":worried_face:",symbol:"\u{1F61F}",group:"people",keywords:["face","worried"]},{id:":face_with_steam_from_nose:",symbol:"\u{1F624}",group:"people",keywords:["face","face with steam from nose","triumph","won"]},{id:":crying_face:",symbol:"\u{1F622}",group:"people",keywords:["cry","crying face","face","sad","tear"]},{id:":loudly_crying_face:",symbol:"\u{1F62D}",group:"people",keywords:["cry","face","loudly crying face","sad","sob","tear"]},{id:":frowning_face_with_open_mouth:",symbol:"\u{1F626}",group:"people",keywords:["face","frown","frowning face with open mouth","mouth","open"]},{id:":anguished_face:",symbol:"\u{1F627}",group:"people",keywords:["anguished","face"]},{id:":fearful_face:",symbol:"\u{1F628}",group:"people",keywords:["face","fear","fearful","scared"]},{id:":weary_face:",symbol:"\u{1F629}",group:"people",keywords:["face","tired","weary"]},{id:":exploding_head:",symbol:"\u{1F92F}",group:"people",keywords:["exploding head","shocked"]},{id:":grimacing_face:",symbol:"\u{1F62C}",group:"people",keywords:["face","grimace","grimacing face"]},{id:":anxious_face_with_sweat:",symbol:"\u{1F630}",group:"people",keywords:["anxious face with sweat","blue","cold","face","rushed","sweat"]},{id:":face_screaming_in_fear:",symbol:"\u{1F631}",group:"people",keywords:["face","face screaming in fear","fear","munch","scared","scream"]},{id:":flushed_face:",symbol:"\u{1F633}",group:"people",keywords:["dazed","face","flushed"]},{id:":zany_face:",symbol:"\u{1F92A}",group:"people",keywords:["eye","goofy","large","small","zany face"]},{id:":dizzy_face:",symbol:"\u{1F635}",group:"people",keywords:["dizzy","face"]},{id:":pouting_face:",symbol:"\u{1F621}",group:"people",keywords:["angry","face","mad","pouting","rage","red"]},{id:":angry_face:",symbol:"\u{1F620}",group:"people",keywords:["angry","face","mad"]},{id:":face_with_symbols_on_mouth:",symbol:"\u{1F92C}",group:"people",keywords:["face with symbols on mouth","swearing",""]},{id:":face_with_medical_mask:",symbol:"\u{1F637}",group:"people",keywords:["cold","doctor","face","face with medical mask","mask","sick"]},{id:":face_with_thermometer:",symbol:"\u{1F912}",group:"people",keywords:["face","face with thermometer","ill","sick","thermometer"]},{id:":face_with_head-bandage:",symbol:"\u{1F915}",group:"people",keywords:["bandage","face","face with head-bandage","hurt","injury"]},{id:":nauseated_face:",symbol:"\u{1F922}",group:"people",keywords:["face","nauseated","vomit"]},{id:":face_vomiting:",symbol:"\u{1F92E}",group:"people",keywords:["face vomiting","sick","vomit"]},{id:":sneezing_face:",symbol:"\u{1F927}",group:"people",keywords:["face","gesundheit","sneeze","sneezing face"]},{id:":smiling_face_with_halo:",symbol:"\u{1F607}",group:"people",keywords:["angel","face","fantasy","halo","innocent","smiling face with halo"]},{id:":cowboy_hat_face:",symbol:"\u{1F920}",group:"people",keywords:["cowboy","cowgirl","face","hat"]},{id:":lying_face:",symbol:"\u{1F925}",group:"people",keywords:["face","lie","lying face","pinocchio"]},{id:":shushing_face:",symbol:"\u{1F92B}",group:"people",keywords:["quiet","shush","shushing face"]},{id:":face_with_hand_over_mouth:",symbol:"\u{1F92D}",group:"people",keywords:["face with hand over mouth","whoops",""]},{id:":face_with_monocle:",symbol:"\u{1F9D0}",group:"people",keywords:["face with monocle","stuffy",""]},{id:":nerd_face:",symbol:"\u{1F913}",group:"people",keywords:["face","geek","nerd"]},{id:":smiling_face_with_horns:",symbol:"\u{1F608}",group:"people",keywords:["face","fairy tale","fantasy","horns","smile","smiling face with horns"]},{id:":angry_face_with_horns:",symbol:"\u{1F47F}",group:"people",keywords:["angry face with horns","demon","devil","face","fantasy","imp"]},{id:":clown_face:",symbol:"\u{1F921}",group:"people",keywords:["clown","face"]},{id:":ogre:",symbol:"\u{1F479}",group:"people",keywords:["creature","face","fairy tale","fantasy","monster","ogre",""]},{id:":goblin:",symbol:"\u{1F47A}",group:"people",keywords:["creature","face","fairy tale","fantasy","goblin","monster"]},{id:":skull:",symbol:"\u{1F480}",group:"people",keywords:["death","face","fairy tale","monster","skull"]},{id:":skull_and_crossbones:",symbol:"\u2620",group:"people",keywords:["crossbones","death","face","monster","skull","skull and crossbones"]},{id:":ghost:",symbol:"\u{1F47B}",group:"people",keywords:["creature","face","fairy tale","fantasy","ghost","monster"]},{id:":alien:",symbol:"\u{1F47D}",group:"people",keywords:["alien","creature","extraterrestrial","face","fantasy","ufo"]},{id:":alien_monster:",symbol:"\u{1F47E}",group:"people",keywords:["alien","creature","extraterrestrial","face","monster","ufo"]},{id:":robot_face:",symbol:"\u{1F916}",group:"people",keywords:["face","monster","robot"]},{id:":pile_of_poo:",symbol:"\u{1F4A9}",group:"people",keywords:["dung","face","monster","pile of poo","poo","poop"]},{id:":grinning_cat_face:",symbol:"\u{1F63A}",group:"people",keywords:["cat","face","grinning cat face","mouth","open","smile"]},{id:":grinning_cat_face_with_smiling_eyes:",symbol:"\u{1F638}",group:"people",keywords:["cat","eye","face","grin","grinning cat face with smiling eyes","smile"]},{id:":cat_face_with_tears_of_joy:",symbol:"\u{1F639}",group:"people",keywords:["cat","cat face with tears of joy","face","joy","tear"]},{id:":smiling_cat_face_with_heart-eyes:",symbol:"\u{1F63B}",group:"people",keywords:["cat","eye","face","love","smile","smiling cat face with heart-eyes"]},{id:":cat_face_with_wry_smile:",symbol:"\u{1F63C}",group:"people",keywords:["cat","cat face with wry smile","face","ironic","smile","wry"]},{id:":kissing_cat_face:",symbol:"\u{1F63D}",group:"people",keywords:["cat","eye","face","kiss","kissing cat face"]},{id:":weary_cat_face:",symbol:"\u{1F640}",group:"people",keywords:["cat","face","oh","surprised","weary"]},{id:":crying_cat_face:",symbol:"\u{1F63F}",group:"people",keywords:["cat","cry","crying cat face","face","sad","tear"]},{id:":pouting_cat_face:",symbol:"\u{1F63E}",group:"people",keywords:["cat","face","pouting"]},{id:":see-no-evil_monkey:",symbol:"\u{1F648}",group:"people",keywords:["evil","face","forbidden","monkey","see","see-no-evil monkey"]},{id:":hear-no-evil_monkey:",symbol:"\u{1F649}",group:"people",keywords:["evil","face","forbidden","hear","hear-no-evil monkey","monkey"]},{id:":speak-no-evil_monkey:",symbol:"\u{1F64A}",group:"people",keywords:["evil","face","forbidden","monkey","speak","speak-no-evil monkey"]},{id:":baby:",symbol:"\u{1F476}",group:"people",keywords:["baby","young"]},{id:":child:",symbol:"\u{1F9D2}",group:"people",keywords:["child","gender-neutral","unspecified gender","young"]},{id:":boy:",symbol:"\u{1F466}",group:"people",keywords:["boy","young"]},{id:":girl:",symbol:"\u{1F467}",group:"people",keywords:["girl","Virgo","young","zodiac"]},{id:":person:",symbol:"\u{1F9D1}",group:"people",keywords:["adult","gender-neutral","person","unspecified gender"]},{id:":person_blond_hair:",symbol:"\u{1F471}",group:"people",keywords:["blond","blond-haired person","person: blond hair"]},{id:":man:",symbol:"\u{1F468}",group:"people",keywords:["adult","man"]},{id:":man_blond_hair:",symbol:"\u{1F471}\u200D\u2642\uFE0F",group:"people",keywords:["blond","blond-haired man","man","man: blond hair"]},{id:":man_beard:",symbol:"\u{1F9D4}",group:"people",keywords:["beard","man: beard","person",""]},{id:":woman:",symbol:"\u{1F469}",group:"people",keywords:["adult","woman"]},{id:":woman_blond_hair:",symbol:"\u{1F471}\u200D\u2640\uFE0F",group:"people",keywords:["blond-haired woman","blonde","woman","woman: blond hair"]},{id:":older_person:",symbol:"\u{1F9D3}",group:"people",keywords:["adult","gender-neutral","old","older person","unspecified gender"]},{id:":old_man:",symbol:"\u{1F474}",group:"people",keywords:["adult","man","old"]},{id:":old_woman:",symbol:"\u{1F475}",group:"people",keywords:["adult","old","woman"]},{id:":man_health_worker:",symbol:"\u{1F468}\u200D\u2695\uFE0F",group:"people",keywords:["doctor","healthcare","man","man health worker","nurse","therapist"]},{id:":woman_health_worker:",symbol:"\u{1F469}\u200D\u2695\uFE0F",group:"people",keywords:["doctor","healthcare","nurse","therapist","woman","woman health worker"]},{id:":man_student:",symbol:"\u{1F468}\u200D\u{1F393}",group:"people",keywords:["graduate","man","student"]},{id:":woman_student:",symbol:"\u{1F469}\u200D\u{1F393}",group:"people",keywords:["graduate","student","woman"]},{id:":man_teacher:",symbol:"\u{1F468}\u200D\u{1F3EB}",group:"people",keywords:["instructor","man","professor","teacher"]},{id:":woman_teacher:",symbol:"\u{1F469}\u200D\u{1F3EB}",group:"people",keywords:["instructor","professor","teacher","woman"]},{id:":man_judge:",symbol:"\u{1F468}\u200D\u2696\uFE0F",group:"people",keywords:["justice","man","man judge","scales"]},{id:":woman_judge:",symbol:"\u{1F469}\u200D\u2696\uFE0F",group:"people",keywords:["judge","scales","woman"]},{id:":man_farmer:",symbol:"\u{1F468}\u200D\u{1F33E}",group:"people",keywords:["farmer","gardener","man","rancher"]},{id:":woman_farmer:",symbol:"\u{1F469}\u200D\u{1F33E}",group:"people",keywords:["farmer","gardener","rancher","woman"]},{id:":man_cook:",symbol:"\u{1F468}\u200D\u{1F373}",group:"people",keywords:["chef","cook","man"]},{id:":woman_cook:",symbol:"\u{1F469}\u200D\u{1F373}",group:"people",keywords:["chef","cook","woman"]},{id:":man_mechanic:",symbol:"\u{1F468}\u200D\u{1F527}",group:"people",keywords:["electrician","man","mechanic","plumber","tradesperson"]},{id:":woman_mechanic:",symbol:"\u{1F469}\u200D\u{1F527}",group:"people",keywords:["electrician","mechanic","plumber","tradesperson","woman"]},{id:":man_factory_worker:",symbol:"\u{1F468}\u200D\u{1F3ED}",group:"people",keywords:["assembly","factory","industrial","man","worker"]},{id:":woman_factory_worker:",symbol:"\u{1F469}\u200D\u{1F3ED}",group:"people",keywords:["assembly","factory","industrial","woman","worker"]},{id:":man_office_worker:",symbol:"\u{1F468}\u200D\u{1F4BC}",group:"people",keywords:["architect","business","man","man office worker","manager","white-collar"]},{id:":woman_office_worker:",symbol:"\u{1F469}\u200D\u{1F4BC}",group:"people",keywords:["architect","business","manager","white-collar","woman","woman office worker"]},{id:":man_scientist:",symbol:"\u{1F468}\u200D\u{1F52C}",group:"people",keywords:["biologist","chemist","engineer","man","physicist","scientist"]},{id:":woman_scientist:",symbol:"\u{1F469}\u200D\u{1F52C}",group:"people",keywords:["biologist","chemist","engineer","physicist","scientist","woman"]},{id:":man_technologist:",symbol:"\u{1F468}\u200D\u{1F4BB}",group:"people",keywords:["coder","developer","inventor","man","software","technologist"]},{id:":woman_technologist:",symbol:"\u{1F469}\u200D\u{1F4BB}",group:"people",keywords:["coder","developer","inventor","software","technologist","woman"]},{id:":man_singer:",symbol:"\u{1F468}\u200D\u{1F3A4}",group:"people",keywords:["actor","entertainer","man","rock","singer","star"]},{id:":woman_singer:",symbol:"\u{1F469}\u200D\u{1F3A4}",group:"people",keywords:["actor","entertainer","rock","singer","star","woman"]},{id:":man_artist:",symbol:"\u{1F468}\u200D\u{1F3A8}",group:"people",keywords:["artist","man","palette"]},{id:":woman_artist:",symbol:"\u{1F469}\u200D\u{1F3A8}",group:"people",keywords:["artist","palette","woman"]},{id:":man_pilot:",symbol:"\u{1F468}\u200D\u2708\uFE0F",group:"people",keywords:["man","pilot","plane"]},{id:":woman_pilot:",symbol:"\u{1F469}\u200D\u2708\uFE0F",group:"people",keywords:["pilot","plane","woman"]},{id:":man_astronaut:",symbol:"\u{1F468}\u200D\u{1F680}",group:"people",keywords:["astronaut","man","rocket"]},{id:":woman_astronaut:",symbol:"\u{1F469}\u200D\u{1F680}",group:"people",keywords:["astronaut","rocket","woman"]},{id:":man_firefighter:",symbol:"\u{1F468}\u200D\u{1F692}",group:"people",keywords:["firefighter","firetruck","man"]},{id:":woman_firefighter:",symbol:"\u{1F469}\u200D\u{1F692}",group:"people",keywords:["firefighter","firetruck","woman"]},{id:":police_officer:",symbol:"\u{1F46E}",group:"people",keywords:["cop","officer","police"]},{id:":man_police_officer:",symbol:"\u{1F46E}\u200D\u2642\uFE0F",group:"people",keywords:["cop","man","officer","police"]},{id:":woman_police_officer:",symbol:"\u{1F46E}\u200D\u2640\uFE0F",group:"people",keywords:["cop","officer","police","woman"]},{id:":detective:",symbol:"\u{1F575}",group:"people",keywords:["detective","sleuth","spy"]},{id:":man_detective:",symbol:"\u{1F575}\uFE0F\u200D\u2642\uFE0F",group:"people",keywords:["detective","man","sleuth","spy"]},{id:":woman_detective:",symbol:"\u{1F575}\uFE0F\u200D\u2640\uFE0F",group:"people",keywords:["detective","sleuth","spy","woman"]},{id:":guard:",symbol:"\u{1F482}",group:"people",keywords:["guard"]},{id:":man_guard:",symbol:"\u{1F482}\u200D\u2642\uFE0F",group:"people",keywords:["guard","man"]},{id:":woman_guard:",symbol:"\u{1F482}\u200D\u2640\uFE0F",group:"people",keywords:["guard","woman"]},{id:":construction_worker:",symbol:"\u{1F477}",group:"people",keywords:["construction","hat","worker"]},{id:":man_construction_worker:",symbol:"\u{1F477}\u200D\u2642\uFE0F",group:"people",keywords:["construction","man","worker"]},{id:":woman_construction_worker:",symbol:"\u{1F477}\u200D\u2640\uFE0F",group:"people",keywords:["construction","woman","worker"]},{id:":prince:",symbol:"\u{1F934}",group:"people",keywords:["prince"]},{id:":princess:",symbol:"\u{1F478}",group:"people",keywords:["fairy tale","fantasy","princess"]},{id:":person_wearing_turban:",symbol:"\u{1F473}",group:"people",keywords:["person wearing turban","turban"]},{id:":man_wearing_turban:",symbol:"\u{1F473}\u200D\u2642\uFE0F",group:"people",keywords:["man","man wearing turban","turban"]},{id:":woman_wearing_turban:",symbol:"\u{1F473}\u200D\u2640\uFE0F",group:"people",keywords:["turban","woman","woman wearing turban"]},{id:":man_with_chinese_cap:",symbol:"\u{1F472}",group:"people",keywords:["gua pi mao","hat","man","man with Chinese cap"]},{id:":woman_with_headscarf:",symbol:"\u{1F9D5}",group:"people",keywords:["headscarf","hijab","mantilla","tichel","woman with headscarf",""]},{id:":man_in_tuxedo:",symbol:"\u{1F935}",group:"people",keywords:["groom","man","man in tuxedo","tuxedo"]},{id:":bride_with_veil:",symbol:"\u{1F470}",group:"people",keywords:["bride","bride with veil","veil","wedding"]},{id:":pregnant_woman:",symbol:"\u{1F930}",group:"people",keywords:["pregnant","woman"]},{id:":breast-feeding:",symbol:"\u{1F931}",group:"people",keywords:["baby","breast","breast-feeding","nursing"]},{id:":baby_angel:",symbol:"\u{1F47C}",group:"people",keywords:["angel","baby","face","fairy tale","fantasy"]},{id:":santa_claus:",symbol:"\u{1F385}",group:"people",keywords:["celebration","Christmas","claus","father","santa","Santa Claus"]},{id:":mrs._claus:",symbol:"\u{1F936}",group:"people",keywords:["celebration","Christmas","claus","mother","Mrs.","Mrs. Claus"]},{id:":mage:",symbol:"\u{1F9D9}",group:"people",keywords:["mage","sorcerer","sorceress","witch","wizard"]},{id:":man_mage:",symbol:"\u{1F9D9}\u200D\u2642\uFE0F",group:"people",keywords:["man mage","sorcerer","wizard"]},{id:":woman_mage:",symbol:"\u{1F9D9}\u200D\u2640\uFE0F",group:"people",keywords:["sorceress","witch","woman mage"]},{id:":fairy:",symbol:"\u{1F9DA}",group:"people",keywords:["fairy","Oberon","Puck","Titania"]},{id:":man_fairy:",symbol:"\u{1F9DA}\u200D\u2642\uFE0F",group:"people",keywords:["man fairy","Oberon","Puck"]},{id:":woman_fairy:",symbol:"\u{1F9DA}\u200D\u2640\uFE0F",group:"people",keywords:["Titania","woman fairy"]},{id:":vampire:",symbol:"\u{1F9DB}",group:"people",keywords:["Dracula","undead","vampire"]},{id:":man_vampire:",symbol:"\u{1F9DB}\u200D\u2642\uFE0F",group:"people",keywords:["Dracula","man vampire","undead"]},{id:":woman_vampire:",symbol:"\u{1F9DB}\u200D\u2640\uFE0F",group:"people",keywords:["undead","woman vampire"]},{id:":merperson:",symbol:"\u{1F9DC}",group:"people",keywords:["mermaid","merman","merperson","merwoman"]},{id:":merman:",symbol:"\u{1F9DC}\u200D\u2642\uFE0F",group:"people",keywords:["merman","Triton"]},{id:":mermaid:",symbol:"\u{1F9DC}\u200D\u2640\uFE0F",group:"people",keywords:["mermaid","merwoman"]},{id:":elf:",symbol:"\u{1F9DD}",group:"people",keywords:["elf","magical",""]},{id:":man_elf:",symbol:"\u{1F9DD}\u200D\u2642\uFE0F",group:"people",keywords:["magical","man elf"]},{id:":woman_elf:",symbol:"\u{1F9DD}\u200D\u2640\uFE0F",group:"people",keywords:["magical","woman elf"]},{id:":genie:",symbol:"\u{1F9DE}",group:"people",keywords:["djinn","genie",""]},{id:":man_genie:",symbol:"\u{1F9DE}\u200D\u2642\uFE0F",group:"people",keywords:["djinn","man genie"]},{id:":woman_genie:",symbol:"\u{1F9DE}\u200D\u2640\uFE0F",group:"people",keywords:["djinn","woman genie"]},{id:":zombie:",symbol:"\u{1F9DF}",group:"people",keywords:["undead","walking dead","zombie",""]},{id:":man_zombie:",symbol:"\u{1F9DF}\u200D\u2642\uFE0F",group:"people",keywords:["man zombie","undead","walking dead"]},{id:":woman_zombie:",symbol:"\u{1F9DF}\u200D\u2640\uFE0F",group:"people",keywords:["undead","walking dead","woman zombie"]},{id:":person_frowning:",symbol:"\u{1F64D}",group:"people",keywords:["frown","gesture","person frowning"]},{id:":man_frowning:",symbol:"\u{1F64D}\u200D\u2642\uFE0F",group:"people",keywords:["frowning","gesture","man"]},{id:":woman_frowning:",symbol:"\u{1F64D}\u200D\u2640\uFE0F",group:"people",keywords:["frowning","gesture","woman"]},{id:":person_pouting:",symbol:"\u{1F64E}",group:"people",keywords:["gesture","person pouting","pouting"]},{id:":man_pouting:",symbol:"\u{1F64E}\u200D\u2642\uFE0F",group:"people",keywords:["gesture","man","pouting"]},{id:":woman_pouting:",symbol:"\u{1F64E}\u200D\u2640\uFE0F",group:"people",keywords:["gesture","pouting","woman"]},{id:":person_gesturing_no:",symbol:"\u{1F645}",group:"people",keywords:["forbidden","gesture","hand","person gesturing NO","prohibited"]},{id:":man_gesturing_no:",symbol:"\u{1F645}\u200D\u2642\uFE0F",group:"people",keywords:["forbidden","gesture","hand","man","man gesturing NO","prohibited"]},{id:":woman_gesturing_no:",symbol:"\u{1F645}\u200D\u2640\uFE0F",group:"people",keywords:["forbidden","gesture","hand","prohibited","woman","woman gesturing NO"]},{id:":person_gesturing_ok:",symbol:"\u{1F646}",group:"people",keywords:["gesture","hand","OK","person gesturing OK"]},{id:":man_gesturing_ok:",symbol:"\u{1F646}\u200D\u2642\uFE0F",group:"people",keywords:["gesture","hand","man","man gesturing OK","OK"]},{id:":woman_gesturing_ok:",symbol:"\u{1F646}\u200D\u2640\uFE0F",group:"people",keywords:["gesture","hand","OK","woman","woman gesturing OK"]},{id:":person_tipping_hand:",symbol:"\u{1F481}",group:"people",keywords:["hand","help","information","person tipping hand","sassy","tipping"]},{id:":man_tipping_hand:",symbol:"\u{1F481}\u200D\u2642\uFE0F",group:"people",keywords:["man","man tipping hand","sassy","tipping hand"]},{id:":woman_tipping_hand:",symbol:"\u{1F481}\u200D\u2640\uFE0F",group:"people",keywords:["sassy","tipping hand","woman","woman tipping hand"]},{id:":person_raising_hand:",symbol:"\u{1F64B}",group:"people",keywords:["gesture","hand","happy","person raising hand","raised"]},{id:":man_raising_hand:",symbol:"\u{1F64B}\u200D\u2642\uFE0F",group:"people",keywords:["gesture","man","man raising hand","raising hand"]},{id:":woman_raising_hand:",symbol:"\u{1F64B}\u200D\u2640\uFE0F",group:"people",keywords:["gesture","raising hand","woman","woman raising hand"]},{id:":person_bowing:",symbol:"\u{1F647}",group:"people",keywords:["apology","bow","gesture","person bowing","sorry"]},{id:":man_bowing:",symbol:"\u{1F647}\u200D\u2642\uFE0F",group:"people",keywords:["apology","bowing","favor","gesture","man","sorry"]},{id:":woman_bowing:",symbol:"\u{1F647}\u200D\u2640\uFE0F",group:"people",keywords:["apology","bowing","favor","gesture","sorry","woman"]},{id:":person_facepalming:",symbol:"\u{1F926}",group:"people",keywords:["disbelief","exasperation","face","palm","person facepalming"]},{id:":man_facepalming:",symbol:"\u{1F926}\u200D\u2642\uFE0F",group:"people",keywords:["disbelief","exasperation","facepalm","man","man facepalming"]},{id:":woman_facepalming:",symbol:"\u{1F926}\u200D\u2640\uFE0F",group:"people",keywords:["disbelief","exasperation","facepalm","woman","woman facepalming"]},{id:":person_shrugging:",symbol:"\u{1F937}",group:"people",keywords:["doubt","ignorance","indifference","person shrugging","shrug"]},{id:":man_shrugging:",symbol:"\u{1F937}\u200D\u2642\uFE0F",group:"people",keywords:["doubt","ignorance","indifference","man","man shrugging","shrug"]},{id:":woman_shrugging:",symbol:"\u{1F937}\u200D\u2640\uFE0F",group:"people",keywords:["doubt","ignorance","indifference","shrug","woman","woman shrugging"]},{id:":person_getting_massage:",symbol:"\u{1F486}",group:"people",keywords:["face","massage","person getting massage","salon"]},{id:":man_getting_massage:",symbol:"\u{1F486}\u200D\u2642\uFE0F",group:"people",keywords:["face","man","man getting massage","massage"]},{id:":woman_getting_massage:",symbol:"\u{1F486}\u200D\u2640\uFE0F",group:"people",keywords:["face","massage","woman","woman getting massage"]},{id:":person_getting_haircut:",symbol:"\u{1F487}",group:"people",keywords:["barber","beauty","haircut","parlor","person getting haircut"]},{id:":man_getting_haircut:",symbol:"\u{1F487}\u200D\u2642\uFE0F",group:"people",keywords:["haircut","man","man getting haircut"]},{id:":woman_getting_haircut:",symbol:"\u{1F487}\u200D\u2640\uFE0F",group:"people",keywords:["haircut","woman","woman getting haircut"]},{id:":person_walking:",symbol:"\u{1F6B6}",group:"people",keywords:["hike","person walking","walk","walking"]},{id:":man_walking:",symbol:"\u{1F6B6}\u200D\u2642\uFE0F",group:"people",keywords:["hike","man","man walking","walk"]},{id:":woman_walking:",symbol:"\u{1F6B6}\u200D\u2640\uFE0F",group:"people",keywords:["hike","walk","woman","woman walking"]},{id:":person_running:",symbol:"\u{1F3C3}",group:"people",keywords:["marathon","person running","running"]},{id:":man_running:",symbol:"\u{1F3C3}\u200D\u2642\uFE0F",group:"people",keywords:["man","marathon","racing","running"]},{id:":woman_running:",symbol:"\u{1F3C3}\u200D\u2640\uFE0F",group:"people",keywords:["marathon","racing","running","woman"]},{id:":woman_dancing:",symbol:"\u{1F483}",group:"people",keywords:["dancing","woman"]},{id:":man_dancing:",symbol:"\u{1F57A}",group:"people",keywords:["dance","man","man dancing"]},{id:":people_with_bunny_ears:",symbol:"\u{1F46F}",group:"people",keywords:["bunny ear","dancer","partying","people with bunny ears"]},{id:":men_with_bunny_ears:",symbol:"\u{1F46F}\u200D\u2642\uFE0F",group:"people",keywords:["bunny ear","dancer","men","men with bunny ears","partying"]},{id:":women_with_bunny_ears:",symbol:"\u{1F46F}\u200D\u2640\uFE0F",group:"people",keywords:["bunny ear","dancer","partying","women","women with bunny ears"]},{id:":person_in_steamy_room:",symbol:"\u{1F9D6}",group:"people",keywords:["person in steamy room","sauna","steam room",""]},{id:":man_in_steamy_room:",symbol:"\u{1F9D6}\u200D\u2642\uFE0F",group:"people",keywords:["man in steamy room","sauna","steam room"]},{id:":woman_in_steamy_room:",symbol:"\u{1F9D6}\u200D\u2640\uFE0F",group:"people",keywords:["sauna","steam room","woman in steamy room"]},{id:":person_climbing:",symbol:"\u{1F9D7}",group:"people",keywords:["climber","person climbing"]},{id:":man_climbing:",symbol:"\u{1F9D7}\u200D\u2642\uFE0F",group:"people",keywords:["climber","man climbing"]},{id:":woman_climbing:",symbol:"\u{1F9D7}\u200D\u2640\uFE0F",group:"people",keywords:["climber","woman climbing"]},{id:":person_in_lotus_position:",symbol:"\u{1F9D8}",group:"people",keywords:["meditation","person in lotus position","yoga",""]},{id:":man_in_lotus_position:",symbol:"\u{1F9D8}\u200D\u2642\uFE0F",group:"people",keywords:["man in lotus position","meditation","yoga"]},{id:":woman_in_lotus_position:",symbol:"\u{1F9D8}\u200D\u2640\uFE0F",group:"people",keywords:["meditation","woman in lotus position","yoga"]},{id:":person_taking_bath:",symbol:"\u{1F6C0}",group:"people",keywords:["bath","bathtub","person taking bath"]},{id:":person_in_bed:",symbol:"\u{1F6CC}",group:"people",keywords:["hotel","person in bed","sleep"]},{id:":man_in_suit_levitating:",symbol:"\u{1F574}",group:"people",keywords:["business","man","man in suit levitating","suit"]},{id:":speaking_head:",symbol:"\u{1F5E3}",group:"people",keywords:["face","head","silhouette","speak","speaking"]},{id:":bust_in_silhouette:",symbol:"\u{1F464}",group:"people",keywords:["bust","bust in silhouette","silhouette"]},{id:":busts_in_silhouette:",symbol:"\u{1F465}",group:"people",keywords:["bust","busts in silhouette","silhouette"]},{id:":person_fencing:",symbol:"\u{1F93A}",group:"people",keywords:["fencer","fencing","person fencing","sword"]},{id:":horse_racing:",symbol:"\u{1F3C7}",group:"people",keywords:["horse","jockey","racehorse","racing"]},{id:":skier:",symbol:"\u26F7",group:"people",keywords:["ski","skier","snow"]},{id:":snowboarder:",symbol:"\u{1F3C2}",group:"people",keywords:["ski","snow","snowboard","snowboarder"]},{id:":person_golfing:",symbol:"\u{1F3CC}",group:"people",keywords:["ball","golf","person golfing"]},{id:":man_golfing:",symbol:"\u{1F3CC}\uFE0F\u200D\u2642\uFE0F",group:"people",keywords:["golf","man","man golfing"]},{id:":woman_golfing:",symbol:"\u{1F3CC}\uFE0F\u200D\u2640\uFE0F",group:"people",keywords:["golf","woman","woman golfing"]},{id:":person_surfing:",symbol:"\u{1F3C4}",group:"people",keywords:["person surfing","surfing"]},{id:":man_surfing:",symbol:"\u{1F3C4}\u200D\u2642\uFE0F",group:"people",keywords:["man","surfing"]},{id:":woman_surfing:",symbol:"\u{1F3C4}\u200D\u2640\uFE0F",group:"people",keywords:["surfing","woman"]},{id:":person_rowing_boat:",symbol:"\u{1F6A3}",group:"people",keywords:["boat","person rowing boat","rowboat"]},{id:":man_rowing_boat:",symbol:"\u{1F6A3}\u200D\u2642\uFE0F",group:"people",keywords:["boat","man","man rowing boat","rowboat"]},{id:":woman_rowing_boat:",symbol:"\u{1F6A3}\u200D\u2640\uFE0F",group:"people",keywords:["boat","rowboat","woman","woman rowing boat"]},{id:":person_swimming:",symbol:"\u{1F3CA}",group:"people",keywords:["person swimming","swim"]},{id:":man_swimming:",symbol:"\u{1F3CA}\u200D\u2642\uFE0F",group:"people",keywords:["man","man swimming","swim"]},{id:":woman_swimming:",symbol:"\u{1F3CA}\u200D\u2640\uFE0F",group:"people",keywords:["swim","woman","woman swimming"]},{id:":person_bouncing_ball:",symbol:"\u26F9",group:"people",keywords:["ball","person bouncing ball"]},{id:":man_bouncing_ball:",symbol:"\u26F9\uFE0F\u200D\u2642\uFE0F",group:"people",keywords:["ball","man","man bouncing ball"]},{id:":woman_bouncing_ball:",symbol:"\u26F9\uFE0F\u200D\u2640\uFE0F",group:"people",keywords:["ball","woman","woman bouncing ball"]},{id:":person_lifting_weights:",symbol:"\u{1F3CB}",group:"people",keywords:["lifter","person lifting weights","weight"]},{id:":man_lifting_weights:",symbol:"\u{1F3CB}\uFE0F\u200D\u2642\uFE0F",group:"people",keywords:["man","man lifting weights","weight lifter"]},{id:":woman_lifting_weights:",symbol:"\u{1F3CB}\uFE0F\u200D\u2640\uFE0F",group:"people",keywords:["weight lifter","woman","woman lifting weights"]},{id:":person_biking:",symbol:"\u{1F6B4}",group:"people",keywords:["bicycle","biking","cyclist","person biking"]},{id:":man_biking:",symbol:"\u{1F6B4}\u200D\u2642\uFE0F",group:"people",keywords:["bicycle","biking","cyclist","man"]},{id:":woman_biking:",symbol:"\u{1F6B4}\u200D\u2640\uFE0F",group:"people",keywords:["bicycle","biking","cyclist","woman"]},{id:":person_mountain_biking:",symbol:"\u{1F6B5}",group:"people",keywords:["bicycle","bicyclist","bike","cyclist","mountain","person mountain biking"]},{id:":man_mountain_biking:",symbol:"\u{1F6B5}\u200D\u2642\uFE0F",group:"people",keywords:["bicycle","bike","cyclist","man","man mountain biking","mountain"]},{id:":woman_mountain_biking:",symbol:"\u{1F6B5}\u200D\u2640\uFE0F",group:"people",keywords:["bicycle","bike","biking","cyclist","mountain","woman"]},{id:":racing_car:",symbol:"\u{1F3CE}",group:"people",keywords:["car","racing"]},{id:":motorcycle:",symbol:"\u{1F3CD}",group:"people",keywords:["motorcycle","racing"]},{id:":person_cartwheeling:",symbol:"\u{1F938}",group:"people",keywords:["cartwheel","gymnastics","person cartwheeling"]},{id:":man_cartwheeling:",symbol:"\u{1F938}\u200D\u2642\uFE0F",group:"people",keywords:["cartwheel","gymnastics","man","man cartwheeling"]},{id:":woman_cartwheeling:",symbol:"\u{1F938}\u200D\u2640\uFE0F",group:"people",keywords:["cartwheel","gymnastics","woman","woman cartwheeling"]},{id:":people_wrestling:",symbol:"\u{1F93C}",group:"people",keywords:["people wrestling","wrestle","wrestler"]},{id:":men_wrestling:",symbol:"\u{1F93C}\u200D\u2642\uFE0F",group:"people",keywords:["men","men wrestling","wrestle"]},{id:":women_wrestling:",symbol:"\u{1F93C}\u200D\u2640\uFE0F",group:"people",keywords:["women","women wrestling","wrestle"]},{id:":person_playing_water_polo:",symbol:"\u{1F93D}",group:"people",keywords:["person playing water polo","polo","water"]},{id:":man_playing_water_polo:",symbol:"\u{1F93D}\u200D\u2642\uFE0F",group:"people",keywords:["man","man playing water polo","water polo"]},{id:":woman_playing_water_polo:",symbol:"\u{1F93D}\u200D\u2640\uFE0F",group:"people",keywords:["water polo","woman","woman playing water polo"]},{id:":person_playing_handball:",symbol:"\u{1F93E}",group:"people",keywords:["ball","handball","person playing handball"]},{id:":man_playing_handball:",symbol:"\u{1F93E}\u200D\u2642\uFE0F",group:"people",keywords:["handball","man","man playing handball"]},{id:":woman_playing_handball:",symbol:"\u{1F93E}\u200D\u2640\uFE0F",group:"people",keywords:["handball","woman","woman playing handball"]},{id:":person_juggling:",symbol:"\u{1F939}",group:"people",keywords:["balance","juggle","multitask","person juggling","skill"]},{id:":man_juggling:",symbol:"\u{1F939}\u200D\u2642\uFE0F",group:"people",keywords:["juggling","man","multitask"]},{id:":woman_juggling:",symbol:"\u{1F939}\u200D\u2640\uFE0F",group:"people",keywords:["juggling","multitask","woman"]},{id:":man_and_woman_holding_hands:",symbol:"\u{1F46B}",group:"people",keywords:["couple","hand","hold","man","man and woman holding hands","woman"]},{id:":two_men_holding_hands:",symbol:"\u{1F46C}",group:"people",keywords:["couple","Gemini","man","twins","two men holding hands","zodiac"]},{id:":two_women_holding_hands:",symbol:"\u{1F46D}",group:"people",keywords:["couple","hand","two women holding hands","woman"]},{id:":kiss:",symbol:"\u{1F48F}",group:"people",keywords:["couple","kiss"]},{id:":kiss_woman_man:",symbol:"\u{1F469}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}",group:"people",keywords:["couple","kiss","man","woman"]},{id:":kiss_man_man:",symbol:"\u{1F468}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F468}",group:"people",keywords:["couple","kiss","man"]},{id:":kiss_woman_woman:",symbol:"\u{1F469}\u200D\u2764\uFE0F\u200D\u{1F48B}\u200D\u{1F469}",group:"people",keywords:["couple","kiss","woman"]},{id:":couple_with_heart:",symbol:"\u{1F491}",group:"people",keywords:["couple","couple with heart","love"]},{id:":couple_with_heart_woman_man:",symbol:"\u{1F469}\u200D\u2764\uFE0F\u200D\u{1F468}",group:"people",keywords:["couple","couple with heart","love","man","woman"]},{id:":couple_with_heart_man_man:",symbol:"\u{1F468}\u200D\u2764\uFE0F\u200D\u{1F468}",group:"people",keywords:["couple","couple with heart","love","man"]},{id:":couple_with_heart_woman_woman:",symbol:"\u{1F469}\u200D\u2764\uFE0F\u200D\u{1F469}",group:"people",keywords:["couple","couple with heart","love","woman"]},{id:":family:",symbol:"\u{1F46A}",group:"people",keywords:["family"]},{id:":family_man_woman_boy:",symbol:"\u{1F468}\u200D\u{1F469}\u200D\u{1F466}",group:"people",keywords:["boy","family","man","woman"]},{id:":family_man_woman_girl:",symbol:"\u{1F468}\u200D\u{1F469}\u200D\u{1F467}",group:"people",keywords:["family","girl","man","woman"]},{id:":family_man_woman_girl_boy:",symbol:"\u{1F468}\u200D\u{1F469}\u200D\u{1F467}\u200D\u{1F466}",group:"people",keywords:["boy","family","girl","man","woman"]},{id:":family_man_woman_boy_boy:",symbol:"\u{1F468}\u200D\u{1F469}\u200D\u{1F466}\u200D\u{1F466}",group:"people",keywords:["boy","family","man","woman"]},{id:":family_man_woman_girl_girl:",symbol:"\u{1F468}\u200D\u{1F469}\u200D\u{1F467}\u200D\u{1F467}",group:"people",keywords:["family","girl","man","woman"]},{id:":family_man_man_boy:",symbol:"\u{1F468}\u200D\u{1F468}\u200D\u{1F466}",group:"people",keywords:["boy","family","man"]},{id:":family_man_man_girl:",symbol:"\u{1F468}\u200D\u{1F468}\u200D\u{1F467}",group:"people",keywords:["family","girl","man"]},{id:":family_man_man_girl_boy:",symbol:"\u{1F468}\u200D\u{1F468}\u200D\u{1F467}\u200D\u{1F466}",group:"people",keywords:["boy","family","girl","man"]},{id:":family_man_man_boy_boy:",symbol:"\u{1F468}\u200D\u{1F468}\u200D\u{1F466}\u200D\u{1F466}",group:"people",keywords:["boy","family","man"]},{id:":family_man_man_girl_girl:",symbol:"\u{1F468}\u200D\u{1F468}\u200D\u{1F467}\u200D\u{1F467}",group:"people",keywords:["family","girl","man"]},{id:":family_woman_woman_boy:",symbol:"\u{1F469}\u200D\u{1F469}\u200D\u{1F466}",group:"people",keywords:["boy","family","woman"]},{id:":family_woman_woman_girl:",symbol:"\u{1F469}\u200D\u{1F469}\u200D\u{1F467}",group:"people",keywords:["family","girl","woman"]},{id:":family_woman_woman_girl_boy:",symbol:"\u{1F469}\u200D\u{1F469}\u200D\u{1F467}\u200D\u{1F466}",group:"people",keywords:["boy","family","girl","woman"]},{id:":family_woman_woman_boy_boy:",symbol:"\u{1F469}\u200D\u{1F469}\u200D\u{1F466}\u200D\u{1F466}",group:"people",keywords:["boy","family","woman"]},{id:":family_woman_woman_girl_girl:",symbol:"\u{1F469}\u200D\u{1F469}\u200D\u{1F467}\u200D\u{1F467}",group:"people",keywords:["family","girl","woman"]},{id:":family_man_boy:",symbol:"\u{1F468}\u200D\u{1F466}",group:"people",keywords:["boy","family","man"]},{id:":family_man_boy_boy:",symbol:"\u{1F468}\u200D\u{1F466}\u200D\u{1F466}",group:"people",keywords:["boy","family","man"]},{id:":family_man_girl:",symbol:"\u{1F468}\u200D\u{1F467}",group:"people",keywords:["family","girl","man"]},{id:":family_man_girl_boy:",symbol:"\u{1F468}\u200D\u{1F467}\u200D\u{1F466}",group:"people",keywords:["boy","family","girl","man"]},{id:":family_man_girl_girl:",symbol:"\u{1F468}\u200D\u{1F467}\u200D\u{1F467}",group:"people",keywords:["family","girl","man"]},{id:":family_woman_boy:",symbol:"\u{1F469}\u200D\u{1F466}",group:"people",keywords:["boy","family","woman"]},{id:":family_woman_boy_boy:",symbol:"\u{1F469}\u200D\u{1F466}\u200D\u{1F466}",group:"people",keywords:["boy","family","woman"]},{id:":family_woman_girl:",symbol:"\u{1F469}\u200D\u{1F467}",group:"people",keywords:["family","girl","woman"]},{id:":family_woman_girl_boy:",symbol:"\u{1F469}\u200D\u{1F467}\u200D\u{1F466}",group:"people",keywords:["boy","family","girl","woman"]},{id:":family_woman_girl_girl:",symbol:"\u{1F469}\u200D\u{1F467}\u200D\u{1F467}",group:"people",keywords:["family","girl","woman"]},{id:":selfie:",symbol:"\u{1F933}",group:"people",keywords:["camera","phone","selfie"]},{id:":flexed_biceps:",symbol:"\u{1F4AA}",group:"people",keywords:["biceps","comic","flex","flexed biceps","muscle"]},{id:":backhand_index_pointing_left:",symbol:"\u{1F448}",group:"people",keywords:["backhand","backhand index pointing left","finger","hand","index","point"]},{id:":backhand_index_pointing_right:",symbol:"\u{1F449}",group:"people",keywords:["backhand","backhand index pointing right","finger","hand","index","point"]},{id:":index_pointing_up:",symbol:"\u261D",group:"people",keywords:["finger","hand","index","index pointing up","point","up"]},{id:":backhand_index_pointing_up:",symbol:"\u{1F446}",group:"people",keywords:["backhand","backhand index pointing up","finger","hand","point","up"]},{id:":middle_finger:",symbol:"\u{1F595}",group:"people",keywords:["finger","hand","middle finger"]},{id:":backhand_index_pointing_down:",symbol:"\u{1F447}",group:"people",keywords:["backhand","backhand index pointing down","down","finger","hand","point"]},{id:":victory_hand:",symbol:"\u270C",group:"people",keywords:["hand","v","victory"]},{id:":crossed_fingers:",symbol:"\u{1F91E}",group:"people",keywords:["cross","crossed fingers","finger","hand","luck"]},{id:":vulcan_salute:",symbol:"\u{1F596}",group:"people",keywords:["finger","hand","spock","vulcan","vulcan salute"]},{id:":sign_of_the_horns:",symbol:"\u{1F918}",group:"people",keywords:["finger","hand","horns","rock-on","sign of the horns"]},{id:":call_me_hand:",symbol:"\u{1F919}",group:"people",keywords:["call","call me hand","hand"]},{id:":hand_with_fingers_splayed:",symbol:"\u{1F590}",group:"people",keywords:["finger","hand","hand with fingers splayed","splayed"]},{id:":raised_hand:",symbol:"\u270B",group:"people",keywords:["hand","raised hand"]},{id:":ok_hand:",symbol:"\u{1F44C}",group:"people",keywords:["hand","OK"]},{id:":thumbs_up:",symbol:"\u{1F44D}",group:"people",keywords:["+1","hand","thumb","thumbs up","up"]},{id:":thumbs_down:",symbol:"\u{1F44E}",group:"people",keywords:["-1","down","hand","thumb","thumbs down"]},{id:":raised_fist:",symbol:"\u270A",group:"people",keywords:["clenched","fist","hand","punch","raised fist"]},{id:":oncoming_fist:",symbol:"\u{1F44A}",group:"people",keywords:["clenched","fist","hand","oncoming fist","punch"]},{id:":left-facing_fist:",symbol:"\u{1F91B}",group:"people",keywords:["fist","left-facing fist","leftwards"]},{id:":right-facing_fist:",symbol:"\u{1F91C}",group:"people",keywords:["fist","right-facing fist","rightwards"]},{id:":raised_back_of_hand:",symbol:"\u{1F91A}",group:"people",keywords:["backhand","raised","raised back of hand"]},{id:":waving_hand:",symbol:"\u{1F44B}",group:"people",keywords:["hand","wave","waving"]},{id:":love-you_gesture:",symbol:"\u{1F91F}",group:"people",keywords:["hand","ILY","love-you gesture"]},{id:":writing_hand:",symbol:"\u270D",group:"people",keywords:["hand","write","writing hand"]},{id:":clapping_hands:",symbol:"\u{1F44F}",group:"people",keywords:["clap","clapping hands","hand"]},{id:":open_hands:",symbol:"\u{1F450}",group:"people",keywords:["hand","open","open hands"]},{id:":raising_hands:",symbol:"\u{1F64C}",group:"people",keywords:["celebration","gesture","hand","hooray","raised","raising hands"]},{id:":palms_up_together:",symbol:"\u{1F932}",group:"people",keywords:["palms up together","prayer",""]},{id:":folded_hands:",symbol:"\u{1F64F}",group:"people",keywords:["ask","folded hands","hand","please","pray","thanks"]},{id:":handshake:",symbol:"\u{1F91D}",group:"people",keywords:["agreement","hand","handshake","meeting","shake"]},{id:":nail_polish:",symbol:"\u{1F485}",group:"people",keywords:["care","cosmetics","manicure","nail","polish"]},{id:":ear:",symbol:"\u{1F442}",group:"people",keywords:["body","ear"]},{id:":nose:",symbol:"\u{1F443}",group:"people",keywords:["body","nose"]},{id:":footprints:",symbol:"\u{1F463}",group:"people",keywords:["clothing","footprint","footprints","print"]},{id:":eyes:",symbol:"\u{1F440}",group:"people",keywords:["eye","eyes","face"]},{id:":eye:",symbol:"\u{1F441}",group:"people",keywords:["body","eye"]},{id:":eye_in_speech_bubble:",symbol:"\u{1F441}\uFE0F\u200D\u{1F5E8}\uFE0F",group:"people",keywords:["eye","eye in speech bubble","speech bubble","witness"]},{id:":brain:",symbol:"\u{1F9E0}",group:"people",keywords:["brain","intelligent"]},{id:":tongue:",symbol:"\u{1F445}",group:"people",keywords:["body","tongue"]},{id:":mouth:",symbol:"\u{1F444}",group:"people",keywords:["lips","mouth"]},{id:":kiss_mark:",symbol:"\u{1F48B}",group:"people",keywords:["kiss","kiss mark","lips"]},{id:":heart_with_arrow:",symbol:"\u{1F498}",group:"people",keywords:["arrow","cupid","heart with arrow"]},{id:":heart_with_ribbon:",symbol:"\u{1F49D}",group:"people",keywords:["heart with ribbon","ribbon","valentine"]},{id:":sparkling_heart:",symbol:"\u{1F496}",group:"people",keywords:["excited","sparkle","sparkling heart"]},{id:":growing_heart:",symbol:"\u{1F497}",group:"people",keywords:["excited","growing","growing heart","nervous","pulse"]},{id:":beating_heart:",symbol:"\u{1F493}",group:"people",keywords:["beating","beating heart","heartbeat","pulsating"]},{id:":revolving_hearts:",symbol:"\u{1F49E}",group:"people",keywords:["revolving","revolving hearts"]},{id:":two_hearts:",symbol:"\u{1F495}",group:"people",keywords:["love","two hearts"]},{id:":love_letter:",symbol:"\u{1F48C}",group:"people",keywords:["heart","letter","love","mail"]},{id:":heavy_heart_exclamation:",symbol:"\u2763",group:"people",keywords:["exclamation","heavy heart exclamation","mark","punctuation"]},{id:":broken_heart:",symbol:"\u{1F494}",group:"people",keywords:["break","broken","broken heart"]},{id:":red_heart:",symbol:"\u2764",group:"people",keywords:["heart","red heart"]},{id:":orange_heart:",symbol:"\u{1F9E1}",group:"people",keywords:["orange","orange heart"]},{id:":yellow_heart:",symbol:"\u{1F49B}",group:"people",keywords:["yellow","yellow heart"]},{id:":green_heart:",symbol:"\u{1F49A}",group:"people",keywords:["green","green heart"]},{id:":blue_heart:",symbol:"\u{1F499}",group:"people",keywords:["blue","blue heart"]},{id:":purple_heart:",symbol:"\u{1F49C}",group:"people",keywords:["purple","purple heart"]},{id:":black_heart:",symbol:"\u{1F5A4}",group:"people",keywords:["black","black heart","evil","wicked"]},{id:":heart_decoration:",symbol:"\u{1F49F}",group:"people",keywords:["heart","heart decoration"]},{id:":zzz:",symbol:"\u{1F4A4}",group:"people",keywords:["comic","sleep","zzz"]},{id:":anger_symbol:",symbol:"\u{1F4A2}",group:"people",keywords:["anger symbol","angry","comic","mad"]},{id:":bomb:",symbol:"\u{1F4A3}",group:"people",keywords:["bomb","comic"]},{id:":collision:",symbol:"\u{1F4A5}",group:"people",keywords:["boom","collision","comic"]},{id:":sweat_droplets:",symbol:"\u{1F4A6}",group:"people",keywords:["comic","splashing","sweat","sweat droplets"]},{id:":dashing_away:",symbol:"\u{1F4A8}",group:"people",keywords:["comic","dash","dashing away","running"]},{id:":dizzy:",symbol:"\u{1F4AB}",group:"people",keywords:["comic","dizzy","star"]},{id:":speech_balloon:",symbol:"\u{1F4AC}",group:"people",keywords:["balloon","bubble","comic","dialog","speech"]},{id:":left_speech_bubble:",symbol:"\u{1F5E8}",group:"people",keywords:["dialog","left speech bubble","speech"]},{id:":right_anger_bubble:",symbol:"\u{1F5EF}",group:"people",keywords:["angry","balloon","bubble","mad","right anger bubble"]},{id:":thought_balloon:",symbol:"\u{1F4AD}",group:"people",keywords:["balloon","bubble","comic","thought"]},{id:":hole:",symbol:"\u{1F573}",group:"people",keywords:["hole"]},{id:":glasses:",symbol:"\u{1F453}",group:"people",keywords:["clothing","eye","eyeglasses","eyewear","glasses"]},{id:":sunglasses:",symbol:"\u{1F576}",group:"people",keywords:["dark","eye","eyewear","glasses","sunglasses"]},{id:":necktie:",symbol:"\u{1F454}",group:"people",keywords:["clothing","necktie","tie"]},{id:":t-shirt:",symbol:"\u{1F455}",group:"people",keywords:["clothing","shirt","t-shirt","tshirt"]},{id:":jeans:",symbol:"\u{1F456}",group:"people",keywords:["clothing","jeans","pants","trousers"]},{id:":scarf:",symbol:"\u{1F9E3}",group:"people",keywords:["neck","scarf"]},{id:":gloves:",symbol:"\u{1F9E4}",group:"people",keywords:["gloves","hand"]},{id:":coat:",symbol:"\u{1F9E5}",group:"people",keywords:["coat","jacket"]},{id:":socks:",symbol:"\u{1F9E6}",group:"people",keywords:["socks","stocking"]},{id:":dress:",symbol:"\u{1F457}",group:"people",keywords:["clothing","dress"]},{id:":kimono:",symbol:"\u{1F458}",group:"people",keywords:["clothing","kimono"]},{id:":bikini:",symbol:"\u{1F459}",group:"people",keywords:["bikini","clothing","swim"]},{id:":woman\u2019s_clothes:",symbol:"\u{1F45A}",group:"people",keywords:["clothing","woman","woman\u2019s clothes"]},{id:":purse:",symbol:"\u{1F45B}",group:"people",keywords:["clothing","coin","purse"]},{id:":handbag:",symbol:"\u{1F45C}",group:"people",keywords:["bag","clothing","handbag","purse"]},{id:":clutch_bag:",symbol:"\u{1F45D}",group:"people",keywords:["bag","clothing","clutch bag","pouch"]},{id:":shopping_bags:",symbol:"\u{1F6CD}",group:"people",keywords:["bag","hotel","shopping","shopping bags"]},{id:":backpack:",symbol:"\u{1F392}",group:"people",keywords:["backpack","bag","rucksack","satchel","school"]},{id:":man\u2019s_shoe:",symbol:"\u{1F45E}",group:"people",keywords:["clothing","man","man\u2019s shoe","shoe"]},{id:":running_shoe:",symbol:"\u{1F45F}",group:"people",keywords:["athletic","clothing","running shoe","shoe","sneaker"]},{id:":high-heeled_shoe:",symbol:"\u{1F460}",group:"people",keywords:["clothing","heel","high-heeled shoe","shoe","woman"]},{id:":woman\u2019s_sandal:",symbol:"\u{1F461}",group:"people",keywords:["clothing","sandal","shoe","woman","woman\u2019s sandal"]},{id:":woman\u2019s_boot:",symbol:"\u{1F462}",group:"people",keywords:["boot","clothing","shoe","woman","woman\u2019s boot"]},{id:":crown:",symbol:"\u{1F451}",group:"people",keywords:["clothing","crown","king","queen"]},{id:":woman\u2019s_hat:",symbol:"\u{1F452}",group:"people",keywords:["clothing","hat","woman","woman\u2019s hat"]},{id:":top_hat:",symbol:"\u{1F3A9}",group:"people",keywords:["clothing","hat","top","tophat"]},{id:":graduation_cap:",symbol:"\u{1F393}",group:"people",keywords:["cap","celebration","clothing","graduation","hat"]},{id:":billed_cap:",symbol:"\u{1F9E2}",group:"people",keywords:["baseball cap","billed cap"]},{id:":rescue_worker\u2019s_helmet:",symbol:"\u26D1",group:"people",keywords:["aid","cross","face","hat","helmet","rescue worker\u2019s helmet"]},{id:":prayer_beads:",symbol:"\u{1F4FF}",group:"people",keywords:["beads","clothing","necklace","prayer","religion"]},{id:":lipstick:",symbol:"\u{1F484}",group:"people",keywords:["cosmetics","lipstick","makeup"]},{id:":ring:",symbol:"\u{1F48D}",group:"people",keywords:["diamond","ring"]},{id:":gem_stone:",symbol:"\u{1F48E}",group:"people",keywords:["diamond","gem","gem stone","jewel"]},{id:":monkey_face:",symbol:"\u{1F435}",group:"nature",keywords:["face","monkey"]},{id:":monkey:",symbol:"\u{1F412}",group:"nature",keywords:["monkey"]},{id:":gorilla:",symbol:"\u{1F98D}",group:"nature",keywords:["gorilla"]},{id:":dog_face:",symbol:"\u{1F436}",group:"nature",keywords:["dog","face","pet"]},{id:":dog:",symbol:"\u{1F415}",group:"nature",keywords:["dog","pet"]},{id:":poodle:",symbol:"\u{1F429}",group:"nature",keywords:["dog","poodle"]},{id:":wolf_face:",symbol:"\u{1F43A}",group:"nature",keywords:["face","wolf"]},{id:":fox_face:",symbol:"\u{1F98A}",group:"nature",keywords:["face","fox"]},{id:":cat_face:",symbol:"\u{1F431}",group:"nature",keywords:["cat","face","pet"]},{id:":cat:",symbol:"\u{1F408}",group:"nature",keywords:["cat","pet"]},{id:":lion_face:",symbol:"\u{1F981}",group:"nature",keywords:["face","Leo","lion","zodiac"]},{id:":tiger_face:",symbol:"\u{1F42F}",group:"nature",keywords:["face","tiger"]},{id:":tiger:",symbol:"\u{1F405}",group:"nature",keywords:["tiger"]},{id:":leopard:",symbol:"\u{1F406}",group:"nature",keywords:["leopard"]},{id:":horse_face:",symbol:"\u{1F434}",group:"nature",keywords:["face","horse"]},{id:":horse:",symbol:"\u{1F40E}",group:"nature",keywords:["equestrian","horse","racehorse","racing"]},{id:":unicorn_face:",symbol:"\u{1F984}",group:"nature",keywords:["face","unicorn"]},{id:":zebra:",symbol:"\u{1F993}",group:"nature",keywords:["stripe","zebra"]},{id:":deer:",symbol:"\u{1F98C}",group:"nature",keywords:["deer"]},{id:":cow_face:",symbol:"\u{1F42E}",group:"nature",keywords:["cow","face"]},{id:":ox:",symbol:"\u{1F402}",group:"nature",keywords:["bull","ox","Taurus","zodiac"]},{id:":water_buffalo:",symbol:"\u{1F403}",group:"nature",keywords:["buffalo","water"]},{id:":cow:",symbol:"\u{1F404}",group:"nature",keywords:["cow"]},{id:":pig_face:",symbol:"\u{1F437}",group:"nature",keywords:["face","pig"]},{id:":pig:",symbol:"\u{1F416}",group:"nature",keywords:["pig","sow"]},{id:":boar:",symbol:"\u{1F417}",group:"nature",keywords:["boar","pig"]},{id:":pig_nose:",symbol:"\u{1F43D}",group:"nature",keywords:["face","nose","pig"]},{id:":ram:",symbol:"\u{1F40F}",group:"nature",keywords:["Aries","male","ram","sheep","zodiac"]},{id:":ewe:",symbol:"\u{1F411}",group:"nature",keywords:["ewe","female","sheep"]},{id:":goat:",symbol:"\u{1F410}",group:"nature",keywords:["Capricorn","goat","zodiac"]},{id:":camel:",symbol:"\u{1F42A}",group:"nature",keywords:["camel","dromedary","hump"]},{id:":two-hump_camel:",symbol:"\u{1F42B}",group:"nature",keywords:["bactrian","camel","hump","two-hump camel"]},{id:":giraffe:",symbol:"\u{1F992}",group:"nature",keywords:["giraffe","spots"]},{id:":elephant:",symbol:"\u{1F418}",group:"nature",keywords:["elephant"]},{id:":rhinoceros:",symbol:"\u{1F98F}",group:"nature",keywords:["rhinoceros"]},{id:":mouse_face:",symbol:"\u{1F42D}",group:"nature",keywords:["face","mouse"]},{id:":mouse:",symbol:"\u{1F401}",group:"nature",keywords:["mouse"]},{id:":rat:",symbol:"\u{1F400}",group:"nature",keywords:["rat"]},{id:":hamster_face:",symbol:"\u{1F439}",group:"nature",keywords:["face","hamster","pet"]},{id:":rabbit_face:",symbol:"\u{1F430}",group:"nature",keywords:["bunny","face","pet","rabbit"]},{id:":rabbit:",symbol:"\u{1F407}",group:"nature",keywords:["bunny","pet","rabbit"]},{id:":chipmunk:",symbol:"\u{1F43F}",group:"nature",keywords:["chipmunk","squirrel"]},{id:":hedgehog:",symbol:"\u{1F994}",group:"nature",keywords:["hedgehog","spiny"]},{id:":bat:",symbol:"\u{1F987}",group:"nature",keywords:["bat","vampire"]},{id:":bear_face:",symbol:"\u{1F43B}",group:"nature",keywords:["bear","face"]},{id:":koala:",symbol:"\u{1F428}",group:"nature",keywords:["bear","koala"]},{id:":panda_face:",symbol:"\u{1F43C}",group:"nature",keywords:["face","panda"]},{id:":paw_prints:",symbol:"\u{1F43E}",group:"nature",keywords:["feet","paw","paw prints","print"]},{id:":turkey:",symbol:"\u{1F983}",group:"nature",keywords:["bird","turkey"]},{id:":chicken:",symbol:"\u{1F414}",group:"nature",keywords:["bird","chicken"]},{id:":rooster:",symbol:"\u{1F413}",group:"nature",keywords:["bird","rooster"]},{id:":hatching_chick:",symbol:"\u{1F423}",group:"nature",keywords:["baby","bird","chick","hatching"]},{id:":baby_chick:",symbol:"\u{1F424}",group:"nature",keywords:["baby","bird","chick"]},{id:":front-facing_baby_chick:",symbol:"\u{1F425}",group:"nature",keywords:["baby","bird","chick","front-facing baby chick"]},{id:":bird:",symbol:"\u{1F426}",group:"nature",keywords:["bird"]},{id:":penguin:",symbol:"\u{1F427}",group:"nature",keywords:["bird","penguin"]},{id:":dove:",symbol:"\u{1F54A}",group:"nature",keywords:["bird","dove","fly","peace"]},{id:":eagle:",symbol:"\u{1F985}",group:"nature",keywords:["bird","eagle"]},{id:":duck:",symbol:"\u{1F986}",group:"nature",keywords:["bird","duck"]},{id:":owl:",symbol:"\u{1F989}",group:"nature",keywords:["bird","owl","wise"]},{id:":frog_face:",symbol:"\u{1F438}",group:"nature",keywords:["face","frog"]},{id:":crocodile:",symbol:"\u{1F40A}",group:"nature",keywords:["crocodile"]},{id:":turtle:",symbol:"\u{1F422}",group:"nature",keywords:["terrapin","tortoise","turtle"]},{id:":lizard:",symbol:"\u{1F98E}",group:"nature",keywords:["lizard","reptile"]},{id:":snake:",symbol:"\u{1F40D}",group:"nature",keywords:["bearer","Ophiuchus","serpent","snake","zodiac"]},{id:":dragon_face:",symbol:"\u{1F432}",group:"nature",keywords:["dragon","face","fairy tale"]},{id:":dragon:",symbol:"\u{1F409}",group:"nature",keywords:["dragon","fairy tale"]},{id:":sauropod:",symbol:"\u{1F995}",group:"nature",keywords:["brachiosaurus","brontosaurus","diplodocus","sauropod"]},{id:":t-rex:",symbol:"\u{1F996}",group:"nature",keywords:["T-Rex","Tyrannosaurus Rex"]},{id:":spouting_whale:",symbol:"\u{1F433}",group:"nature",keywords:["face","spouting","whale"]},{id:":whale:",symbol:"\u{1F40B}",group:"nature",keywords:["whale"]},{id:":dolphin:",symbol:"\u{1F42C}",group:"nature",keywords:["dolphin","flipper"]},{id:":fish:",symbol:"\u{1F41F}",group:"nature",keywords:["fish","Pisces","zodiac"]},{id:":tropical_fish:",symbol:"\u{1F420}",group:"nature",keywords:["fish","tropical"]},{id:":blowfish:",symbol:"\u{1F421}",group:"nature",keywords:["blowfish","fish"]},{id:":shark:",symbol:"\u{1F988}",group:"nature",keywords:["fish","shark"]},{id:":octopus:",symbol:"\u{1F419}",group:"nature",keywords:["octopus"]},{id:":spiral_shell:",symbol:"\u{1F41A}",group:"nature",keywords:["shell","spiral"]},{id:":crab:",symbol:"\u{1F980}",group:"nature",keywords:["Cancer","crab","zodiac"]},{id:":shrimp:",symbol:"\u{1F990}",group:"nature",keywords:["food","shellfish","shrimp","small"]},{id:":squid:",symbol:"\u{1F991}",group:"nature",keywords:["food","molusc","squid"]},{id:":snail:",symbol:"\u{1F40C}",group:"nature",keywords:["snail"]},{id:":butterfly:",symbol:"\u{1F98B}",group:"nature",keywords:["butterfly","insect","pretty"]},{id:":bug:",symbol:"\u{1F41B}",group:"nature",keywords:["bug","insect"]},{id:":ant:",symbol:"\u{1F41C}",group:"nature",keywords:["ant","insect"]},{id:":honeybee:",symbol:"\u{1F41D}",group:"nature",keywords:["bee","honeybee","insect"]},{id:":lady_beetle:",symbol:"\u{1F41E}",group:"nature",keywords:["beetle","insect","lady beetle","ladybird","ladybug"]},{id:":cricket:",symbol:"\u{1F997}",group:"nature",keywords:["cricket","grasshopper",""]},{id:":spider:",symbol:"\u{1F577}",group:"nature",keywords:["insect","spider"]},{id:":spider_web:",symbol:"\u{1F578}",group:"nature",keywords:["spider","web"]},{id:":scorpion:",symbol:"\u{1F982}",group:"nature",keywords:["scorpio","Scorpio","scorpion","zodiac"]},{id:":bouquet:",symbol:"\u{1F490}",group:"nature",keywords:["bouquet","flower"]},{id:":cherry_blossom:",symbol:"\u{1F338}",group:"nature",keywords:["blossom","cherry","flower"]},{id:":white_flower:",symbol:"\u{1F4AE}",group:"nature",keywords:["flower","white flower"]},{id:":rosette:",symbol:"\u{1F3F5}",group:"nature",keywords:["plant","rosette"]},{id:":rose:",symbol:"\u{1F339}",group:"nature",keywords:["flower","rose"]},{id:":wilted_flower:",symbol:"\u{1F940}",group:"nature",keywords:["flower","wilted"]},{id:":hibiscus:",symbol:"\u{1F33A}",group:"nature",keywords:["flower","hibiscus"]},{id:":sunflower:",symbol:"\u{1F33B}",group:"nature",keywords:["flower","sun","sunflower"]},{id:":blossom:",symbol:"\u{1F33C}",group:"nature",keywords:["blossom","flower"]},{id:":tulip:",symbol:"\u{1F337}",group:"nature",keywords:["flower","tulip"]},{id:":seedling:",symbol:"\u{1F331}",group:"nature",keywords:["seedling","young"]},{id:":evergreen_tree:",symbol:"\u{1F332}",group:"nature",keywords:["evergreen tree","tree"]},{id:":deciduous_tree:",symbol:"\u{1F333}",group:"nature",keywords:["deciduous","shedding","tree"]},{id:":palm_tree:",symbol:"\u{1F334}",group:"nature",keywords:["palm","tree"]},{id:":cactus:",symbol:"\u{1F335}",group:"nature",keywords:["cactus","plant"]},{id:":sheaf_of_rice:",symbol:"\u{1F33E}",group:"nature",keywords:["ear","grain","rice","sheaf of rice"]},{id:":herb:",symbol:"\u{1F33F}",group:"nature",keywords:["herb","leaf"]},{id:":shamrock:",symbol:"\u2618",group:"nature",keywords:["plant","shamrock"]},{id:":four_leaf_clover:",symbol:"\u{1F340}",group:"nature",keywords:["4","clover","four","four-leaf clover","leaf"]},{id:":maple_leaf:",symbol:"\u{1F341}",group:"nature",keywords:["falling","leaf","maple"]},{id:":fallen_leaf:",symbol:"\u{1F342}",group:"nature",keywords:["fallen leaf","falling","leaf"]},{id:":leaf_fluttering_in_wind:",symbol:"\u{1F343}",group:"nature",keywords:["blow","flutter","leaf","leaf fluttering in wind","wind"]},{id:":grapes:",symbol:"\u{1F347}",group:"food",keywords:["fruit","grape","grapes"]},{id:":melon:",symbol:"\u{1F348}",group:"food",keywords:["fruit","melon"]},{id:":watermelon:",symbol:"\u{1F349}",group:"food",keywords:["fruit","watermelon"]},{id:":tangerine:",symbol:"\u{1F34A}",group:"food",keywords:["fruit","orange","tangerine"]},{id:":lemon:",symbol:"\u{1F34B}",group:"food",keywords:["citrus","fruit","lemon"]},{id:":banana:",symbol:"\u{1F34C}",group:"food",keywords:["banana","fruit"]},{id:":pineapple:",symbol:"\u{1F34D}",group:"food",keywords:["fruit","pineapple"]},{id:":red_apple:",symbol:"\u{1F34E}",group:"food",keywords:["apple","fruit","red"]},{id:":green_apple:",symbol:"\u{1F34F}",group:"food",keywords:["apple","fruit","green"]},{id:":pear:",symbol:"\u{1F350}",group:"food",keywords:["fruit","pear"]},{id:":peach:",symbol:"\u{1F351}",group:"food",keywords:["fruit","peach"]},{id:":cherries:",symbol:"\u{1F352}",group:"food",keywords:["berries","cherries","cherry","fruit","red"]},{id:":strawberry:",symbol:"\u{1F353}",group:"food",keywords:["berry","fruit","strawberry"]},{id:":kiwi_fruit:",symbol:"\u{1F95D}",group:"food",keywords:["food","fruit","kiwi"]},{id:":tomato:",symbol:"\u{1F345}",group:"food",keywords:["fruit","tomato","vegetable"]},{id:":coconut:",symbol:"\u{1F965}",group:"food",keywords:["coconut","palm","pi\xF1a colada"]},{id:":avocado:",symbol:"\u{1F951}",group:"food",keywords:["avocado","food","fruit"]},{id:":eggplant:",symbol:"\u{1F346}",group:"food",keywords:["aubergine","eggplant","vegetable"]},{id:":potato:",symbol:"\u{1F954}",group:"food",keywords:["food","potato","vegetable"]},{id:":carrot:",symbol:"\u{1F955}",group:"food",keywords:["carrot","food","vegetable"]},{id:":ear_of_corn:",symbol:"\u{1F33D}",group:"food",keywords:["corn","ear","ear of corn","maize","maze"]},{id:":hot_pepper:",symbol:"\u{1F336}",group:"food",keywords:["hot","pepper"]},{id:":cucumber:",symbol:"\u{1F952}",group:"food",keywords:["cucumber","food","pickle","vegetable"]},{id:":broccoli:",symbol:"\u{1F966}",group:"food",keywords:["broccoli","wild cabbage"]},{id:":mushroom:",symbol:"\u{1F344}",group:"food",keywords:["mushroom","toadstool"]},{id:":peanuts:",symbol:"\u{1F95C}",group:"food",keywords:["food","nut","peanut","peanuts","vegetable"]},{id:":chestnut:",symbol:"\u{1F330}",group:"food",keywords:["chestnut","plant"]},{id:":bread:",symbol:"\u{1F35E}",group:"food",keywords:["bread","loaf"]},{id:":croissant:",symbol:"\u{1F950}",group:"food",keywords:["bread","crescent roll","croissant","food","french"]},{id:":baguette_bread:",symbol:"\u{1F956}",group:"food",keywords:["baguette","bread","food","french"]},{id:":pretzel:",symbol:"\u{1F968}",group:"food",keywords:["pretzel","twisted",""]},{id:":pancakes:",symbol:"\u{1F95E}",group:"food",keywords:["cr\xEApe","food","hotcake","pancake","pancakes"]},{id:":cheese_wedge:",symbol:"\u{1F9C0}",group:"food",keywords:["cheese","cheese wedge"]},{id:":meat_on_bone:",symbol:"\u{1F356}",group:"food",keywords:["bone","meat","meat on bone"]},{id:":poultry_leg:",symbol:"\u{1F357}",group:"food",keywords:["bone","chicken","drumstick","leg","poultry"]},{id:":cut_of_meat:",symbol:"\u{1F969}",group:"food",keywords:["chop","cut of meat","lambchop","porkchop","steak"]},{id:":bacon:",symbol:"\u{1F953}",group:"food",keywords:["bacon","food","meat"]},{id:":hamburger:",symbol:"\u{1F354}",group:"food",keywords:["burger","hamburger"]},{id:":french_fries:",symbol:"\u{1F35F}",group:"food",keywords:["french","fries"]},{id:":pizza:",symbol:"\u{1F355}",group:"food",keywords:["cheese","pizza","slice"]},{id:":hot_dog:",symbol:"\u{1F32D}",group:"food",keywords:["frankfurter","hot dog","hotdog","sausage"]},{id:":sandwich:",symbol:"\u{1F96A}",group:"food",keywords:["bread","sandwich"]},{id:":taco:",symbol:"\u{1F32E}",group:"food",keywords:["mexican","taco"]},{id:":burrito:",symbol:"\u{1F32F}",group:"food",keywords:["burrito","mexican","wrap"]},{id:":stuffed_flatbread:",symbol:"\u{1F959}",group:"food",keywords:["falafel","flatbread","food","gyro","kebab","stuffed"]},{id:":egg:",symbol:"\u{1F95A}",group:"food",keywords:["egg","food"]},{id:":cooking:",symbol:"\u{1F373}",group:"food",keywords:["cooking","egg","frying","pan"]},{id:":shallow_pan_of_food:",symbol:"\u{1F958}",group:"food",keywords:["casserole","food","paella","pan","shallow","shallow pan of food"]},{id:":pot_of_food:",symbol:"\u{1F372}",group:"food",keywords:["pot","pot of food","stew"]},{id:":bowl_with_spoon:",symbol:"\u{1F963}",group:"food",keywords:["bowl with spoon","breakfast","cereal","congee",""]},{id:":green_salad:",symbol:"\u{1F957}",group:"food",keywords:["food","green","salad"]},{id:":popcorn:",symbol:"\u{1F37F}",group:"food",keywords:["popcorn"]},{id:":canned_food:",symbol:"\u{1F96B}",group:"food",keywords:["can","canned food"]},{id:":bento_box:",symbol:"\u{1F371}",group:"food",keywords:["bento","box"]},{id:":rice_cracker:",symbol:"\u{1F358}",group:"food",keywords:["cracker","rice"]},{id:":rice_ball:",symbol:"\u{1F359}",group:"food",keywords:["ball","Japanese","rice"]},{id:":cooked_rice:",symbol:"\u{1F35A}",group:"food",keywords:["cooked","rice"]},{id:":curry_rice:",symbol:"\u{1F35B}",group:"food",keywords:["curry","rice"]},{id:":steaming_bowl:",symbol:"\u{1F35C}",group:"food",keywords:["bowl","noodle","ramen","steaming"]},{id:":spaghetti:",symbol:"\u{1F35D}",group:"food",keywords:["pasta","spaghetti"]},{id:":roasted_sweet_potato:",symbol:"\u{1F360}",group:"food",keywords:["potato","roasted","sweet"]},{id:":oden:",symbol:"\u{1F362}",group:"food",keywords:["kebab","oden","seafood","skewer","stick"]},{id:":sushi:",symbol:"\u{1F363}",group:"food",keywords:["sushi"]},{id:":fried_shrimp:",symbol:"\u{1F364}",group:"food",keywords:["fried","prawn","shrimp","tempura"]},{id:":fish_cake_with_swirl:",symbol:"\u{1F365}",group:"food",keywords:["cake","fish","fish cake with swirl","pastry","swirl"]},{id:":dango:",symbol:"\u{1F361}",group:"food",keywords:["dango","dessert","Japanese","skewer","stick","sweet"]},{id:":dumpling:",symbol:"\u{1F95F}",group:"food",keywords:["dumpling","empanada","gy\u014Dza","jiaozi","pierogi","potsticker"]},{id:":fortune_cookie:",symbol:"\u{1F960}",group:"food",keywords:["fortune cookie","prophecy"]},{id:":takeout_box:",symbol:"\u{1F961}",group:"food",keywords:["oyster pail","takeout box"]},{id:":soft_ice_cream:",symbol:"\u{1F366}",group:"food",keywords:["cream","dessert","ice","icecream","soft","sweet"]},{id:":shaved_ice:",symbol:"\u{1F367}",group:"food",keywords:["dessert","ice","shaved","sweet"]},{id:":ice_cream:",symbol:"\u{1F368}",group:"food",keywords:["cream","dessert","ice","sweet"]},{id:":doughnut:",symbol:"\u{1F369}",group:"food",keywords:["dessert","donut","doughnut","sweet"]},{id:":cookie:",symbol:"\u{1F36A}",group:"food",keywords:["cookie","dessert","sweet"]},{id:":birthday_cake:",symbol:"\u{1F382}",group:"food",keywords:["birthday","cake","celebration","dessert","pastry","sweet"]},{id:":shortcake:",symbol:"\u{1F370}",group:"food",keywords:["cake","dessert","pastry","shortcake","slice","sweet"]},{id:":pie:",symbol:"\u{1F967}",group:"food",keywords:["filling","pastry","pie",""]},{id:":chocolate_bar:",symbol:"\u{1F36B}",group:"food",keywords:["bar","chocolate","dessert","sweet"]},{id:":candy:",symbol:"\u{1F36C}",group:"food",keywords:["candy","dessert","sweet"]},{id:":lollipop:",symbol:"\u{1F36D}",group:"food",keywords:["candy","dessert","lollipop","sweet"]},{id:":custard:",symbol:"\u{1F36E}",group:"food",keywords:["custard","dessert","pudding","sweet"]},{id:":honey_pot:",symbol:"\u{1F36F}",group:"food",keywords:["honey","honeypot","pot","sweet"]},{id:":baby_bottle:",symbol:"\u{1F37C}",group:"food",keywords:["baby","bottle","drink","milk"]},{id:":glass_of_milk:",symbol:"\u{1F95B}",group:"food",keywords:["drink","glass","glass of milk","milk"]},{id:":hot_beverage:",symbol:"\u2615",group:"food",keywords:["beverage","coffee","drink","hot","steaming","tea"]},{id:":teacup_without_handle:",symbol:"\u{1F375}",group:"food",keywords:["beverage","cup","drink","tea","teacup","teacup without handle"]},{id:":sake:",symbol:"\u{1F376}",group:"food",keywords:["bar","beverage","bottle","cup","drink","sake"]},{id:":bottle_with_popping_cork:",symbol:"\u{1F37E}",group:"food",keywords:["bar","bottle","bottle with popping cork","cork","drink","popping"]},{id:":wine_glass:",symbol:"\u{1F377}",group:"food",keywords:["bar","beverage","drink","glass","wine"]},{id:":cocktail_glass:",symbol:"\u{1F378}",group:"food",keywords:["bar","cocktail","drink","glass"]},{id:":tropical_drink:",symbol:"\u{1F379}",group:"food",keywords:["bar","drink","tropical"]},{id:":beer_mug:",symbol:"\u{1F37A}",group:"food",keywords:["bar","beer","drink","mug"]},{id:":clinking_beer_mugs:",symbol:"\u{1F37B}",group:"food",keywords:["bar","beer","clink","clinking beer mugs","drink","mug"]},{id:":clinking_glasses:",symbol:"\u{1F942}",group:"food",keywords:["celebrate","clink","clinking glasses","drink","glass"]},{id:":tumbler_glass:",symbol:"\u{1F943}",group:"food",keywords:["glass","liquor","shot","tumbler","whisky"]},{id:":cup_with_straw:",symbol:"\u{1F964}",group:"food",keywords:["cup with straw","juice","soda",""]},{id:":chopsticks:",symbol:"\u{1F962}",group:"food",keywords:["chopsticks","hashi",""]},{id:":fork_and_knife_with_plate:",symbol:"\u{1F37D}",group:"food",keywords:["cooking","fork","fork and knife with plate","knife","plate"]},{id:":fork_and_knife:",symbol:"\u{1F374}",group:"food",keywords:["cooking","cutlery","fork","fork and knife","knife"]},{id:":spoon:",symbol:"\u{1F944}",group:"food",keywords:["spoon","tableware"]},{id:":kitchen_knife:",symbol:"\u{1F52A}",group:"food",keywords:["cooking","hocho","kitchen knife","knife","tool","weapon"]},{id:":amphora:",symbol:"\u{1F3FA}",group:"food",keywords:["amphora","Aquarius","cooking","drink","jug","zodiac"]},{id:":globe_showing_europe-africa:",symbol:"\u{1F30D}",group:"travel",keywords:["Africa","earth","Europe","globe","globe showing Europe-Africa","world"]},{id:":globe_showing_americas:",symbol:"\u{1F30E}",group:"travel",keywords:["Americas","earth","globe","globe showing Americas","world"]},{id:":globe_showing_asia-australia:",symbol:"\u{1F30F}",group:"travel",keywords:["Asia","Australia","earth","globe","globe showing Asia-Australia","world"]},{id:":globe_with_meridians:",symbol:"\u{1F310}",group:"travel",keywords:["earth","globe","globe with meridians","meridians","world"]},{id:":world_map:",symbol:"\u{1F5FA}",group:"travel",keywords:["map","world"]},{id:":map_of_japan:",symbol:"\u{1F5FE}",group:"travel",keywords:["Japan","map","map of Japan"]},{id:":snow-capped_mountain:",symbol:"\u{1F3D4}",group:"travel",keywords:["cold","mountain","snow","snow-capped mountain"]},{id:":mountain:",symbol:"\u26F0",group:"travel",keywords:["mountain"]},{id:":volcano:",symbol:"\u{1F30B}",group:"travel",keywords:["eruption","mountain","volcano"]},{id:":mount_fuji:",symbol:"\u{1F5FB}",group:"travel",keywords:["fuji","mount fuji","mountain"]},{id:":camping:",symbol:"\u{1F3D5}",group:"travel",keywords:["camping"]},{id:":beach_with_umbrella:",symbol:"\u{1F3D6}",group:"travel",keywords:["beach","beach with umbrella","umbrella"]},{id:":desert:",symbol:"\u{1F3DC}",group:"travel",keywords:["desert"]},{id:":desert_island:",symbol:"\u{1F3DD}",group:"travel",keywords:["desert","island"]},{id:":national_park:",symbol:"\u{1F3DE}",group:"travel",keywords:["national park","park"]},{id:":stadium:",symbol:"\u{1F3DF}",group:"travel",keywords:["stadium"]},{id:":classical_building:",symbol:"\u{1F3DB}",group:"travel",keywords:["classical","classical building"]},{id:":building_construction:",symbol:"\u{1F3D7}",group:"travel",keywords:["building construction","construction"]},{id:":houses:",symbol:"\u{1F3D8}",group:"travel",keywords:["houses"]},{id:":derelict_house:",symbol:"\u{1F3DA}",group:"travel",keywords:["derelict","house"]},{id:":house:",symbol:"\u{1F3E0}",group:"travel",keywords:["home","house"]},{id:":house_with_garden:",symbol:"\u{1F3E1}",group:"travel",keywords:["garden","home","house","house with garden"]},{id:":office_building:",symbol:"\u{1F3E2}",group:"travel",keywords:["building","office building"]},{id:":japanese_post_office:",symbol:"\u{1F3E3}",group:"travel",keywords:["Japanese","Japanese post office","post"]},{id:":post_office:",symbol:"\u{1F3E4}",group:"travel",keywords:["European","post","post office"]},{id:":hospital:",symbol:"\u{1F3E5}",group:"travel",keywords:["doctor","hospital","medicine"]},{id:":bank:",symbol:"\u{1F3E6}",group:"travel",keywords:["bank","building"]},{id:":hotel:",symbol:"\u{1F3E8}",group:"travel",keywords:["building","hotel"]},{id:":love_hotel:",symbol:"\u{1F3E9}",group:"travel",keywords:["hotel","love"]},{id:":convenience_store:",symbol:"\u{1F3EA}",group:"travel",keywords:["convenience","store"]},{id:":school:",symbol:"\u{1F3EB}",group:"travel",keywords:["building","school"]},{id:":department_store:",symbol:"\u{1F3EC}",group:"travel",keywords:["department","store"]},{id:":factory:",symbol:"\u{1F3ED}",group:"travel",keywords:["building","factory"]},{id:":japanese_castle:",symbol:"\u{1F3EF}",group:"travel",keywords:["castle","Japanese"]},{id:":castle:",symbol:"\u{1F3F0}",group:"travel",keywords:["castle","European"]},{id:":wedding:",symbol:"\u{1F492}",group:"travel",keywords:["chapel","romance","wedding"]},{id:":tokyo_tower:",symbol:"\u{1F5FC}",group:"travel",keywords:["Tokyo","tower"]},{id:":statue_of_liberty:",symbol:"\u{1F5FD}",group:"travel",keywords:["liberty","statue","Statue of Liberty"]},{id:":church:",symbol:"\u26EA",group:"travel",keywords:["Christian","church","cross","religion"]},{id:":mosque:",symbol:"\u{1F54C}",group:"travel",keywords:["islam","mosque","Muslim","religion"]},{id:":synagogue:",symbol:"\u{1F54D}",group:"travel",keywords:["Jew","Jewish","religion","synagogue","temple"]},{id:":shinto_shrine:",symbol:"\u26E9",group:"travel",keywords:["religion","shinto","shrine"]},{id:":kaaba:",symbol:"\u{1F54B}",group:"travel",keywords:["islam","kaaba","Muslim","religion"]},{id:":fountain:",symbol:"\u26F2",group:"travel",keywords:["fountain"]},{id:":tent:",symbol:"\u26FA",group:"travel",keywords:["camping","tent"]},{id:":foggy:",symbol:"\u{1F301}",group:"travel",keywords:["fog","foggy"]},{id:":night_with_stars:",symbol:"\u{1F303}",group:"travel",keywords:["night","night with stars","star"]},{id:":cityscape:",symbol:"\u{1F3D9}",group:"travel",keywords:["city","cityscape"]},{id:":sunrise_over_mountains:",symbol:"\u{1F304}",group:"travel",keywords:["morning","mountain","sun","sunrise","sunrise over mountains"]},{id:":sunrise:",symbol:"\u{1F305}",group:"travel",keywords:["morning","sun","sunrise"]},{id:":cityscape_at_dusk:",symbol:"\u{1F306}",group:"travel",keywords:["city","cityscape at dusk","dusk","evening","landscape","sunset"]},{id:":sunset:",symbol:"\u{1F307}",group:"travel",keywords:["dusk","sun","sunset"]},{id:":bridge_at_night:",symbol:"\u{1F309}",group:"travel",keywords:["bridge","bridge at night","night"]},{id:":hot_springs:",symbol:"\u2668",group:"travel",keywords:["hot","hotsprings","springs","steaming"]},{id:":milky_way:",symbol:"\u{1F30C}",group:"travel",keywords:["milky way","space"]},{id:":carousel_horse:",symbol:"\u{1F3A0}",group:"travel",keywords:["carousel","horse"]},{id:":ferris_wheel:",symbol:"\u{1F3A1}",group:"travel",keywords:["amusement park","ferris","wheel"]},{id:":roller_coaster:",symbol:"\u{1F3A2}",group:"travel",keywords:["amusement park","coaster","roller"]},{id:":barber_pole:",symbol:"\u{1F488}",group:"travel",keywords:["barber","haircut","pole"]},{id:":circus_tent:",symbol:"\u{1F3AA}",group:"travel",keywords:["circus","tent"]},{id:":locomotive:",symbol:"\u{1F682}",group:"travel",keywords:["engine","locomotive","railway","steam","train"]},{id:":railway_car:",symbol:"\u{1F683}",group:"travel",keywords:["car","electric","railway","train","tram","trolleybus"]},{id:":high-speed_train:",symbol:"\u{1F684}",group:"travel",keywords:["high-speed train","railway","shinkansen","speed","train"]},{id:":bullet_train:",symbol:"\u{1F685}",group:"travel",keywords:["bullet","railway","shinkansen","speed","train"]},{id:":train:",symbol:"\u{1F686}",group:"travel",keywords:["railway","train"]},{id:":metro:",symbol:"\u{1F687}",group:"travel",keywords:["metro","subway"]},{id:":light_rail:",symbol:"\u{1F688}",group:"travel",keywords:["light rail","railway"]},{id:":station:",symbol:"\u{1F689}",group:"travel",keywords:["railway","station","train"]},{id:":tram:",symbol:"\u{1F68A}",group:"travel",keywords:["tram","trolleybus"]},{id:":monorail:",symbol:"\u{1F69D}",group:"travel",keywords:["monorail","vehicle"]},{id:":mountain_railway:",symbol:"\u{1F69E}",group:"travel",keywords:["car","mountain","railway"]},{id:":tram_car:",symbol:"\u{1F68B}",group:"travel",keywords:["car","tram","trolleybus"]},{id:":bus:",symbol:"\u{1F68C}",group:"travel",keywords:["bus","vehicle"]},{id:":oncoming_bus:",symbol:"\u{1F68D}",group:"travel",keywords:["bus","oncoming"]},{id:":trolleybus:",symbol:"\u{1F68E}",group:"travel",keywords:["bus","tram","trolley","trolleybus"]},{id:":minibus:",symbol:"\u{1F690}",group:"travel",keywords:["bus","minibus"]},{id:":ambulance:",symbol:"\u{1F691}",group:"travel",keywords:["ambulance","vehicle"]},{id:":fire_engine:",symbol:"\u{1F692}",group:"travel",keywords:["engine","fire","truck"]},{id:":police_car:",symbol:"\u{1F693}",group:"travel",keywords:["car","patrol","police"]},{id:":oncoming_police_car:",symbol:"\u{1F694}",group:"travel",keywords:["car","oncoming","police"]},{id:":taxi:",symbol:"\u{1F695}",group:"travel",keywords:["taxi","vehicle"]},{id:":oncoming_taxi:",symbol:"\u{1F696}",group:"travel",keywords:["oncoming","taxi"]},{id:":automobile:",symbol:"\u{1F697}",group:"travel",keywords:["automobile","car"]},{id:":oncoming_automobile:",symbol:"\u{1F698}",group:"travel",keywords:["automobile","car","oncoming"]},{id:":sport_utility_vehicle:",symbol:"\u{1F699}",group:"travel",keywords:["recreational","sport utility","sport utility vehicle"]},{id:":delivery_truck:",symbol:"\u{1F69A}",group:"travel",keywords:["delivery","truck"]},{id:":articulated_lorry:",symbol:"\u{1F69B}",group:"travel",keywords:["articulated lorry","lorry","semi","truck"]},{id:":tractor:",symbol:"\u{1F69C}",group:"travel",keywords:["tractor","vehicle"]},{id:":bicycle:",symbol:"\u{1F6B2}",group:"travel",keywords:["bicycle","bike"]},{id:":kick_scooter:",symbol:"\u{1F6F4}",group:"travel",keywords:["kick","scooter"]},{id:":motor_scooter:",symbol:"\u{1F6F5}",group:"travel",keywords:["motor","scooter"]},{id:":bus_stop:",symbol:"\u{1F68F}",group:"travel",keywords:["bus","busstop","stop"]},{id:":motorway:",symbol:"\u{1F6E3}",group:"travel",keywords:["highway","motorway","road"]},{id:":railway_track:",symbol:"\u{1F6E4}",group:"travel",keywords:["railway","railway track","train"]},{id:":oil_drum:",symbol:"\u{1F6E2}",group:"travel",keywords:["drum","oil"]},{id:":fuel_pump:",symbol:"\u26FD",group:"travel",keywords:["diesel","fuel","fuelpump","gas","pump","station"]},{id:":police_car_light:",symbol:"\u{1F6A8}",group:"travel",keywords:["beacon","car","light","police","revolving"]},{id:":horizontal_traffic_light:",symbol:"\u{1F6A5}",group:"travel",keywords:["horizontal traffic light","light","signal","traffic"]},{id:":vertical_traffic_light:",symbol:"\u{1F6A6}",group:"travel",keywords:["light","signal","traffic","vertical traffic light"]},{id:":stop_sign:",symbol:"\u{1F6D1}",group:"travel",keywords:["octagonal","sign","stop"]},{id:":construction:",symbol:"\u{1F6A7}",group:"travel",keywords:["barrier","construction"]},{id:":anchor:",symbol:"\u2693",group:"travel",keywords:["anchor","ship","tool"]},{id:":sailboat:",symbol:"\u26F5",group:"travel",keywords:["boat","resort","sailboat","sea","yacht"]},{id:":canoe:",symbol:"\u{1F6F6}",group:"travel",keywords:["boat","canoe"]},{id:":speedboat:",symbol:"\u{1F6A4}",group:"travel",keywords:["boat","speedboat"]},{id:":passenger_ship:",symbol:"\u{1F6F3}",group:"travel",keywords:["passenger","ship"]},{id:":ferry:",symbol:"\u26F4",group:"travel",keywords:["boat","ferry","passenger"]},{id:":motor_boat:",symbol:"\u{1F6E5}",group:"travel",keywords:["boat","motor boat","motorboat"]},{id:":ship:",symbol:"\u{1F6A2}",group:"travel",keywords:["boat","passenger","ship"]},{id:":airplane:",symbol:"\u2708",group:"travel",keywords:["aeroplane","airplane"]},{id:":small_airplane:",symbol:"\u{1F6E9}",group:"travel",keywords:["aeroplane","airplane","small airplane"]},{id:":airplane_departure:",symbol:"\u{1F6EB}",group:"travel",keywords:["aeroplane","airplane","check-in","departure","departures"]},{id:":airplane_arrival:",symbol:"\u{1F6EC}",group:"travel",keywords:["aeroplane","airplane","airplane arrival","arrivals","arriving","landing"]},{id:":seat:",symbol:"\u{1F4BA}",group:"travel",keywords:["chair","seat"]},{id:":helicopter:",symbol:"\u{1F681}",group:"travel",keywords:["helicopter","vehicle"]},{id:":suspension_railway:",symbol:"\u{1F69F}",group:"travel",keywords:["railway","suspension"]},{id:":mountain_cableway:",symbol:"\u{1F6A0}",group:"travel",keywords:["cable","gondola","mountain","mountain cableway"]},{id:":aerial_tramway:",symbol:"\u{1F6A1}",group:"travel",keywords:["aerial","cable","car","gondola","tramway"]},{id:":satellite:",symbol:"\u{1F6F0}",group:"travel",keywords:["satellite","space"]},{id:":rocket:",symbol:"\u{1F680}",group:"travel",keywords:["rocket","space"]},{id:":flying_saucer:",symbol:"\u{1F6F8}",group:"travel",keywords:["flying saucer","UFO"]},{id:":bellhop_bell:",symbol:"\u{1F6CE}",group:"travel",keywords:["bell","bellhop","hotel"]},{id:":hourglass_done:",symbol:"\u231B",group:"travel",keywords:["hourglass done","sand","timer"]},{id:":hourglass_not_done:",symbol:"\u23F3",group:"travel",keywords:["hourglass","hourglass not done","sand","timer"]},{id:":watch:",symbol:"\u231A",group:"travel",keywords:["clock","watch"]},{id:":alarm_clock:",symbol:"\u23F0",group:"travel",keywords:["alarm","clock"]},{id:":stopwatch:",symbol:"\u23F1",group:"travel",keywords:["clock","stopwatch"]},{id:":timer_clock:",symbol:"\u23F2",group:"travel",keywords:["clock","timer"]},{id:":mantelpiece_clock:",symbol:"\u{1F570}",group:"travel",keywords:["clock","mantelpiece clock"]},{id:":twelve_o\u2019clock:",symbol:"\u{1F55B}",group:"travel",keywords:["00","12","12:00","clock","o\u2019clock","twelve"]},{id:":twelve-thirty:",symbol:"\u{1F567}",group:"travel",keywords:["12","12:30","clock","thirty","twelve","twelve-thirty"]},{id:":one_o\u2019clock:",symbol:"\u{1F550}",group:"travel",keywords:["00","1","1:00","clock","o\u2019clock","one"]},{id:":one-thirty:",symbol:"\u{1F55C}",group:"travel",keywords:["1","1:30","clock","one","one-thirty","thirty"]},{id:":two_o\u2019clock:",symbol:"\u{1F551}",group:"travel",keywords:["00","2","2:00","clock","o\u2019clock","two"]},{id:":two-thirty:",symbol:"\u{1F55D}",group:"travel",keywords:["2","2:30","clock","thirty","two","two-thirty"]},{id:":three_o\u2019clock:",symbol:"\u{1F552}",group:"travel",keywords:["00","3","3:00","clock","o\u2019clock","three"]},{id:":three-thirty:",symbol:"\u{1F55E}",group:"travel",keywords:["3","3:30","clock","thirty","three","three-thirty"]},{id:":four_o\u2019clock:",symbol:"\u{1F553}",group:"travel",keywords:["00","4","4:00","clock","four","o\u2019clock"]},{id:":four-thirty:",symbol:"\u{1F55F}",group:"travel",keywords:["4","4:30","clock","four","four-thirty","thirty"]},{id:":five_o\u2019clock:",symbol:"\u{1F554}",group:"travel",keywords:["00","5","5:00","clock","five","o\u2019clock"]},{id:":five-thirty:",symbol:"\u{1F560}",group:"travel",keywords:["5","5:30","clock","five","five-thirty","thirty"]},{id:":six_o\u2019clock:",symbol:"\u{1F555}",group:"travel",keywords:["00","6","6:00","clock","o\u2019clock","six"]},{id:":six-thirty:",symbol:"\u{1F561}",group:"travel",keywords:["6","6:30","clock","six","six-thirty","thirty"]},{id:":seven_o\u2019clock:",symbol:"\u{1F556}",group:"travel",keywords:["00","7","7:00","clock","o\u2019clock","seven"]},{id:":seven-thirty:",symbol:"\u{1F562}",group:"travel",keywords:["7","7:30","clock","seven","seven-thirty","thirty"]},{id:":eight_o\u2019clock:",symbol:"\u{1F557}",group:"travel",keywords:["00","8","8:00","clock","eight","o\u2019clock"]},{id:":eight-thirty:",symbol:"\u{1F563}",group:"travel",keywords:["8","8:30","clock","eight","eight-thirty","thirty"]},{id:":nine_o\u2019clock:",symbol:"\u{1F558}",group:"travel",keywords:["00","9","9:00","clock","nine","o\u2019clock"]},{id:":nine-thirty:",symbol:"\u{1F564}",group:"travel",keywords:["9","9:30","clock","nine","nine-thirty","thirty"]},{id:":ten_o\u2019clock:",symbol:"\u{1F559}",group:"travel",keywords:["00","10","10:00","clock","o\u2019clock","ten"]},{id:":ten-thirty:",symbol:"\u{1F565}",group:"travel",keywords:["10","10:30","clock","ten","ten-thirty","thirty"]},{id:":eleven_o\u2019clock:",symbol:"\u{1F55A}",group:"travel",keywords:["00","11","11:00","clock","eleven","o\u2019clock"]},{id:":eleven-thirty:",symbol:"\u{1F566}",group:"travel",keywords:["11","11:30","clock","eleven","eleven-thirty","thirty"]},{id:":new_moon:",symbol:"\u{1F311}",group:"travel",keywords:["dark","moon","new moon"]},{id:":waxing_crescent_moon:",symbol:"\u{1F312}",group:"travel",keywords:["crescent","moon","waxing"]},{id:":first_quarter_moon:",symbol:"\u{1F313}",group:"travel",keywords:["first quarter moon","moon","quarter"]},{id:":waxing_gibbous_moon:",symbol:"\u{1F314}",group:"travel",keywords:["gibbous","moon","waxing"]},{id:":full_moon:",symbol:"\u{1F315}",group:"travel",keywords:["full","moon"]},{id:":waning_gibbous_moon:",symbol:"\u{1F316}",group:"travel",keywords:["gibbous","moon","waning"]},{id:":last_quarter_moon:",symbol:"\u{1F317}",group:"travel",keywords:["last quarter moon","moon","quarter"]},{id:":waning_crescent_moon:",symbol:"\u{1F318}",group:"travel",keywords:["crescent","moon","waning"]},{id:":crescent_moon:",symbol:"\u{1F319}",group:"travel",keywords:["crescent","moon"]},{id:":new_moon_face:",symbol:"\u{1F31A}",group:"travel",keywords:["face","moon","new moon face"]},{id:":first_quarter_moon_face:",symbol:"\u{1F31B}",group:"travel",keywords:["face","first quarter moon face","moon","quarter"]},{id:":last_quarter_moon_face:",symbol:"\u{1F31C}",group:"travel",keywords:["face","last quarter moon face","moon","quarter"]},{id:":thermometer:",symbol:"\u{1F321}",group:"travel",keywords:["thermometer","weather"]},{id:":sun:",symbol:"\u2600",group:"travel",keywords:["bright","rays","sun","sunny"]},{id:":full_moon_face:",symbol:"\u{1F31D}",group:"travel",keywords:["bright","face","full","moon"]},{id:":sun_with_face:",symbol:"\u{1F31E}",group:"travel",keywords:["bright","face","sun","sun with face"]},{id:":star:",symbol:"\u2B50",group:"travel",keywords:["star"]},{id:":glowing_star:",symbol:"\u{1F31F}",group:"travel",keywords:["glittery","glow","glowing star","shining","sparkle","star"]},{id:":shooting_star:",symbol:"\u{1F320}",group:"travel",keywords:["falling","shooting","star"]},{id:":cloud:",symbol:"\u2601\uFE0F",group:"travel",keywords:["cloud","weather"]},{id:":sun_behind_cloud:",symbol:"\u26C5",group:"travel",keywords:["cloud","sun","sun behind cloud"]},{id:":cloud_with_lightning_and_rain:",symbol:"\u26C8\uFE0F",group:"travel",keywords:["cloud","cloud with lightning and rain","rain","thunder"]},{id:":sun_behind_small_cloud:",symbol:"\u{1F324}",group:"travel",keywords:["cloud","sun","sun behind small cloud"]},{id:":sun_behind_large_cloud:",symbol:"\u{1F325}",group:"travel",keywords:["cloud","sun","sun behind large cloud"]},{id:":sun_behind_rain_cloud:",symbol:"\u{1F326}",group:"travel",keywords:["cloud","rain","sun","sun behind rain cloud"]},{id:":cloud_with_rain:",symbol:"\u{1F327}",group:"travel",keywords:["cloud","cloud with rain","rain"]},{id:":cloud_with_snow:",symbol:"\u{1F328}",group:"travel",keywords:["cloud","cloud with snow","cold","snow"]},{id:":cloud_with_lightning:",symbol:"\u{1F329}",group:"travel",keywords:["cloud","cloud with lightning","lightning"]},{id:":tornado:",symbol:"\u{1F32A}",group:"travel",keywords:["cloud","tornado","whirlwind"]},{id:":fog:",symbol:"\u{1F32B}",group:"travel",keywords:["cloud","fog"]},{id:":wind_face:",symbol:"\u{1F32C}",group:"travel",keywords:["blow","cloud","face","wind"]},{id:":cyclone:",symbol:"\u{1F300}",group:"travel",keywords:["cyclone","dizzy","hurricane","twister","typhoon"]},{id:":rainbow:",symbol:"\u{1F308}",group:"travel",keywords:["rain","rainbow"]},{id:":closed_umbrella:",symbol:"\u{1F302}",group:"travel",keywords:["closed umbrella","clothing","rain","umbrella"]},{id:":umbrella:",symbol:"\u2602",group:"travel",keywords:["clothing","rain","umbrella"]},{id:":umbrella_with_rain_drops:",symbol:"\u2614",group:"travel",keywords:["clothing","drop","rain","umbrella","umbrella with rain drops"]},{id:":umbrella_on_ground:",symbol:"\u26F1",group:"travel",keywords:["rain","sun","umbrella","umbrella on ground"]},{id:":high_voltage:",symbol:"\u26A1",group:"travel",keywords:["danger","electric","high voltage","lightning","voltage","zap"]},{id:":snowflake:",symbol:"\u2744",group:"travel",keywords:["cold","snow","snowflake"]},{id:":snowman:",symbol:"\u2603",group:"travel",keywords:["cold","snow","snowman"]},{id:":snowman_without_snow:",symbol:"\u26C4",group:"travel",keywords:["cold","snow","snowman","snowman without snow"]},{id:":comet:",symbol:"\u2604",group:"travel",keywords:["comet","space"]},{id:":fire:",symbol:"\u{1F525}",group:"travel",keywords:["fire","flame","tool"]},{id:":droplet:",symbol:"\u{1F4A7}",group:"travel",keywords:["cold","comic","drop","droplet","sweat"]},{id:":water_wave:",symbol:"\u{1F30A}",group:"travel",keywords:["ocean","water","wave"]},{id:":jack-o-lantern:",symbol:"\u{1F383}",group:"activities",keywords:["celebration","halloween","jack","jack-o-lantern","lantern"]},{id:":christmas_tree:",symbol:"\u{1F384}",group:"activities",keywords:["celebration","Christmas","tree"]},{id:":fireworks:",symbol:"\u{1F386}",group:"activities",keywords:["celebration","fireworks"]},{id:":sparkler:",symbol:"\u{1F387}",group:"activities",keywords:["celebration","fireworks","sparkle","sparkler"]},{id:":sparkles:",symbol:"\u2728",group:"activities",keywords:["sparkle","sparkles","star"]},{id:":balloon:",symbol:"\u{1F388}",group:"activities",keywords:["balloon","celebration"]},{id:":party_popper:",symbol:"\u{1F389}",group:"activities",keywords:["celebration","party","popper","tada"]},{id:":confetti_ball:",symbol:"\u{1F38A}",group:"activities",keywords:["ball","celebration","confetti"]},{id:":tanabata_tree:",symbol:"\u{1F38B}",group:"activities",keywords:["banner","celebration","Japanese","tanabata tree","tree"]},{id:":pine_decoration:",symbol:"\u{1F38D}",group:"activities",keywords:["bamboo","celebration","Japanese","pine","pine decoration"]},{id:":japanese_dolls:",symbol:"\u{1F38E}",group:"activities",keywords:["celebration","doll","festival","Japanese","Japanese dolls"]},{id:":carp_streamer:",symbol:"\u{1F38F}",group:"activities",keywords:["carp","celebration","streamer"]},{id:":wind_chime:",symbol:"\u{1F390}",group:"activities",keywords:["bell","celebration","chime","wind"]},{id:":moon_viewing_ceremony:",symbol:"\u{1F391}",group:"activities",keywords:["celebration","ceremony","moon","moon viewing ceremony"]},{id:":ribbon:",symbol:"\u{1F380}",group:"activities",keywords:["celebration","ribbon"]},{id:":wrapped_gift:",symbol:"\u{1F381}",group:"activities",keywords:["box","celebration","gift","present","wrapped"]},{id:":reminder_ribbon:",symbol:"\u{1F397}",group:"activities",keywords:["celebration","reminder","ribbon"]},{id:":admission_tickets:",symbol:"\u{1F39F}",group:"activities",keywords:["admission","admission tickets","ticket"]},{id:":ticket:",symbol:"\u{1F3AB}",group:"activities",keywords:["admission","ticket"]},{id:":military_medal:",symbol:"\u{1F396}",group:"activities",keywords:["celebration","medal","military"]},{id:":trophy:",symbol:"\u{1F3C6}",group:"activities",keywords:["prize","trophy"]},{id:":sports_medal:",symbol:"\u{1F3C5}",group:"activities",keywords:["medal","sports medal"]},{id:":1st_place_medal:",symbol:"\u{1F947}",group:"activities",keywords:["1st place medal","first","gold","medal"]},{id:":2nd_place_medal:",symbol:"\u{1F948}",group:"activities",keywords:["2nd place medal","medal","second","silver"]},{id:":3rd_place_medal:",symbol:"\u{1F949}",group:"activities",keywords:["3rd place medal","bronze","medal","third"]},{id:":soccer_ball:",symbol:"\u26BD",group:"activities",keywords:["ball","football","soccer"]},{id:":baseball:",symbol:"\u26BE",group:"activities",keywords:["ball","baseball"]},{id:":basketball:",symbol:"\u{1F3C0}",group:"activities",keywords:["ball","basketball","hoop"]},{id:":volleyball:",symbol:"\u{1F3D0}",group:"activities",keywords:["ball","game","volleyball"]},{id:":american_football:",symbol:"\u{1F3C8}",group:"activities",keywords:["american","ball","football"]},{id:":rugby_football:",symbol:"\u{1F3C9}",group:"activities",keywords:["ball","football","rugby"]},{id:":tennis:",symbol:"\u{1F3BE}",group:"activities",keywords:["ball","racquet","tennis"]},{id:":bowling:",symbol:"\u{1F3B3}",group:"activities",keywords:["ball","bowling","game"]},{id:":cricket_game:",symbol:"\u{1F3CF}",group:"activities",keywords:["ball","bat","cricket game","game"]},{id:":field_hockey:",symbol:"\u{1F3D1}",group:"activities",keywords:["ball","field","game","hockey","stick"]},{id:":ice_hockey:",symbol:"\u{1F3D2}",group:"activities",keywords:["game","hockey","ice","puck","stick"]},{id:":ping_pong:",symbol:"\u{1F3D3}",group:"activities",keywords:["ball","bat","game","paddle","ping pong","table tennis"]},{id:":badminton:",symbol:"\u{1F3F8}",group:"activities",keywords:["badminton","birdie","game","racquet","shuttlecock"]},{id:":boxing_glove:",symbol:"\u{1F94A}",group:"activities",keywords:["boxing","glove"]},{id:":martial_arts_uniform:",symbol:"\u{1F94B}",group:"activities",keywords:["judo","karate","martial arts","martial arts uniform","taekwondo","uniform"]},{id:":goal_net:",symbol:"\u{1F945}",group:"activities",keywords:["goal","net"]},{id:":flag_in_hole:",symbol:"\u26F3",group:"activities",keywords:["flag in hole","golf","hole"]},{id:":ice_skate:",symbol:"\u26F8",group:"activities",keywords:["ice","skate"]},{id:":fishing_pole:",symbol:"\u{1F3A3}",group:"activities",keywords:["fish","fishing pole","pole"]},{id:":running_shirt:",symbol:"\u{1F3BD}",group:"activities",keywords:["athletics","running","sash","shirt"]},{id:":skis:",symbol:"\u{1F3BF}",group:"activities",keywords:["ski","skis","snow"]},{id:":sled:",symbol:"\u{1F6F7}",group:"activities",keywords:["sled","sledge","sleigh",""]},{id:":curling_stone:",symbol:"\u{1F94C}",group:"activities",keywords:["curling stone","game","rock"]},{id:":direct_hit:",symbol:"\u{1F3AF}",group:"activities",keywords:["bullseye","dart","direct hit","game","hit","target"]},{id:":pool_8_ball:",symbol:"\u{1F3B1}",group:"activities",keywords:["8","ball","billiard","eight","game","pool 8 ball"]},{id:":crystal_ball:",symbol:"\u{1F52E}",group:"activities",keywords:["ball","crystal","fairy tale","fantasy","fortune","tool"]},{id:":video_game:",symbol:"\u{1F3AE}",group:"activities",keywords:["controller","game","video game"]},{id:":joystick:",symbol:"\u{1F579}",group:"activities",keywords:["game","joystick","video game"]},{id:":slot_machine:",symbol:"\u{1F3B0}",group:"activities",keywords:["game","slot","slot machine"]},{id:":game_die:",symbol:"\u{1F3B2}",group:"activities",keywords:["dice","die","game"]},{id:":spade_suit:",symbol:"\u2660",group:"activities",keywords:["card","game","spade suit"]},{id:":heart_suit:",symbol:"\u2665",group:"activities",keywords:["card","game","heart suit"]},{id:":diamond_suit:",symbol:"\u2666",group:"activities",keywords:["card","diamond suit","game"]},{id:":club_suit:",symbol:"\u2663",group:"activities",keywords:["card","club suit","game"]},{id:":joker:",symbol:"\u{1F0CF}",group:"activities",keywords:["card","game","joker","wildcard"]},{id:":mahjong_red_dragon:",symbol:"\u{1F004}",group:"activities",keywords:["game","mahjong","mahjong red dragon","red"]},{id:":flower_playing_cards:",symbol:"\u{1F3B4}",group:"activities",keywords:["card","flower","flower playing cards","game","Japanese","playing"]},{id:":performing_arts:",symbol:"\u{1F3AD}",group:"activities",keywords:["art","mask","performing","performing arts","theater","theatre"]},{id:":framed_picture:",symbol:"\u{1F5BC}",group:"activities",keywords:["art","frame","framed picture","museum","painting","picture"]},{id:":artist_palette:",symbol:"\u{1F3A8}",group:"activities",keywords:["art","artist palette","museum","painting","palette"]},{id:":muted_speaker:",symbol:"\u{1F507}",group:"objects",keywords:["mute","muted speaker","quiet","silent","speaker"]},{id:":speaker_low_volume:",symbol:"\u{1F508}",group:"objects",keywords:["soft","speaker low volume"]},{id:":speaker_medium_volume:",symbol:"\u{1F509}",group:"objects",keywords:["medium","speaker medium volume"]},{id:":speaker_high_volume:",symbol:"\u{1F50A}",group:"objects",keywords:["loud","speaker high volume"]},{id:":loudspeaker:",symbol:"\u{1F4E2}",group:"objects",keywords:["loud","loudspeaker","public address"]},{id:":megaphone:",symbol:"\u{1F4E3}",group:"objects",keywords:["cheering","megaphone"]},{id:":postal_horn:",symbol:"\u{1F4EF}",group:"objects",keywords:["horn","post","postal"]},{id:":bell:",symbol:"\u{1F514}",group:"objects",keywords:["bell"]},{id:":bell_with_slash:",symbol:"\u{1F515}",group:"objects",keywords:["bell","bell with slash","forbidden","mute","quiet","silent"]},{id:":musical_score:",symbol:"\u{1F3BC}",group:"objects",keywords:["music","musical score","score"]},{id:":musical_note:",symbol:"\u{1F3B5}",group:"objects",keywords:["music","musical note","note"]},{id:":musical_notes:",symbol:"\u{1F3B6}",group:"objects",keywords:["music","musical notes","note","notes"]},{id:":studio_microphone:",symbol:"\u{1F399}",group:"objects",keywords:["mic","microphone","music","studio"]},{id:":level_slider:",symbol:"\u{1F39A}",group:"objects",keywords:["level","music","slider"]},{id:":control_knobs:",symbol:"\u{1F39B}",group:"objects",keywords:["control","knobs","music"]},{id:":microphone:",symbol:"\u{1F3A4}",group:"objects",keywords:["karaoke","mic","microphone"]},{id:":headphone:",symbol:"\u{1F3A7}",group:"objects",keywords:["earbud","headphone"]},{id:":radio:",symbol:"\u{1F4FB}",group:"objects",keywords:["radio","video"]},{id:":saxophone:",symbol:"\u{1F3B7}",group:"objects",keywords:["instrument","music","sax","saxophone"]},{id:":guitar:",symbol:"\u{1F3B8}",group:"objects",keywords:["guitar","instrument","music"]},{id:":musical_keyboard:",symbol:"\u{1F3B9}",group:"objects",keywords:["instrument","keyboard","music","musical keyboard","piano"]},{id:":trumpet:",symbol:"\u{1F3BA}",group:"objects",keywords:["instrument","music","trumpet"]},{id:":violin:",symbol:"\u{1F3BB}",group:"objects",keywords:["instrument","music","violin"]},{id:":drum:",symbol:"\u{1F941}",group:"objects",keywords:["drum","drumsticks","music"]},{id:":mobile_phone:",symbol:"\u{1F4F1}",group:"objects",keywords:["cell","mobile","phone","telephone"]},{id:":mobile_phone_with_arrow:",symbol:"\u{1F4F2}",group:"objects",keywords:["arrow","cell","mobile","mobile phone with arrow","phone","receive"]},{id:":telephone:",symbol:"\u260E",group:"objects",keywords:["phone","telephone"]},{id:":telephone_receiver:",symbol:"\u{1F4DE}",group:"objects",keywords:["phone","receiver","telephone"]},{id:":pager:",symbol:"\u{1F4DF}",group:"objects",keywords:["pager"]},{id:":fax_machine:",symbol:"\u{1F4E0}",group:"objects",keywords:["fax","fax machine"]},{id:":battery:",symbol:"\u{1F50B}",group:"objects",keywords:["battery"]},{id:":electric_plug:",symbol:"\u{1F50C}",group:"objects",keywords:["electric","electricity","plug"]},{id:":laptop_computer:",symbol:"\u{1F4BB}",group:"objects",keywords:["computer","laptop computer","pc","personal"]},{id:":desktop_computer:",symbol:"\u{1F5A5}",group:"objects",keywords:["computer","desktop"]},{id:":printer:",symbol:"\u{1F5A8}",group:"objects",keywords:["computer","printer"]},{id:":keyboard:",symbol:"\u2328",group:"objects",keywords:["computer","keyboard"]},{id:":computer_mouse:",symbol:"\u{1F5B1}",group:"objects",keywords:["computer","computer mouse"]},{id:":trackball:",symbol:"\u{1F5B2}",group:"objects",keywords:["computer","trackball"]},{id:":computer_disk:",symbol:"\u{1F4BD}",group:"objects",keywords:["computer","disk","minidisk","optical"]},{id:":floppy_disk:",symbol:"\u{1F4BE}",group:"objects",keywords:["computer","disk","floppy"]},{id:":optical_disk:",symbol:"\u{1F4BF}",group:"objects",keywords:["cd","computer","disk","optical"]},{id:":dvd:",symbol:"\u{1F4C0}",group:"objects",keywords:["blu-ray","computer","disk","dvd","optical"]},{id:":movie_camera:",symbol:"\u{1F3A5}",group:"objects",keywords:["camera","cinema","movie"]},{id:":film_frames:",symbol:"\u{1F39E}",group:"objects",keywords:["cinema","film","frames","movie"]},{id:":film_projector:",symbol:"\u{1F4FD}",group:"objects",keywords:["cinema","film","movie","projector","video"]},{id:":clapper_board:",symbol:"\u{1F3AC}",group:"objects",keywords:["clapper","clapper board","movie"]},{id:":television:",symbol:"\u{1F4FA}",group:"objects",keywords:["television","tv","video"]},{id:":camera:",symbol:"\u{1F4F7}",group:"objects",keywords:["camera","video"]},{id:":camera_with_flash:",symbol:"\u{1F4F8}",group:"objects",keywords:["camera","camera with flash","flash","video"]},{id:":video_camera:",symbol:"\u{1F4F9}",group:"objects",keywords:["camera","video"]},{id:":videocassette:",symbol:"\u{1F4FC}",group:"objects",keywords:["tape","vhs","video","videocassette"]},{id:":magnifying_glass_tilted_left:",symbol:"\u{1F50D}",group:"objects",keywords:["glass","magnifying","magnifying glass tilted left","search","tool"]},{id:":magnifying_glass_tilted_right:",symbol:"\u{1F50E}",group:"objects",keywords:["glass","magnifying","magnifying glass tilted right","search","tool"]},{id:":candle:",symbol:"\u{1F56F}",group:"objects",keywords:["candle","light"]},{id:":light_bulb:",symbol:"\u{1F4A1}",group:"objects",keywords:["bulb","comic","electric","idea","light"]},{id:":flashlight:",symbol:"\u{1F526}",group:"objects",keywords:["electric","flashlight","light","tool","torch"]},{id:":red_paper_lantern:",symbol:"\u{1F3EE}",group:"objects",keywords:["bar","lantern","light","red","red paper lantern"]},{id:":notebook_with_decorative_cover:",symbol:"\u{1F4D4}",group:"objects",keywords:["book","cover","decorated","notebook","notebook with decorative cover"]},{id:":closed_book:",symbol:"\u{1F4D5}",group:"objects",keywords:["book","closed"]},{id:":open_book:",symbol:"\u{1F4D6}",group:"objects",keywords:["book","open"]},{id:":green_book:",symbol:"\u{1F4D7}",group:"objects",keywords:["book","green"]},{id:":blue_book:",symbol:"\u{1F4D8}",group:"objects",keywords:["blue","book"]},{id:":orange_book:",symbol:"\u{1F4D9}",group:"objects",keywords:["book","orange"]},{id:":books:",symbol:"\u{1F4DA}",group:"objects",keywords:["book","books"]},{id:":notebook:",symbol:"\u{1F4D3}",group:"objects",keywords:["notebook"]},{id:":ledger:",symbol:"\u{1F4D2}",group:"objects",keywords:["ledger","notebook"]},{id:":page_with_curl:",symbol:"\u{1F4C3}",group:"objects",keywords:["curl","document","page","page with curl"]},{id:":scroll:",symbol:"\u{1F4DC}",group:"objects",keywords:["paper","scroll"]},{id:":page_facing_up:",symbol:"\u{1F4C4}",group:"objects",keywords:["document","page","page facing up"]},{id:":newspaper:",symbol:"\u{1F4F0}",group:"objects",keywords:["news","newspaper","paper"]},{id:":rolled-up_newspaper:",symbol:"\u{1F5DE}",group:"objects",keywords:["news","newspaper","paper","rolled","rolled-up newspaper"]},{id:":bookmark_tabs:",symbol:"\u{1F4D1}",group:"objects",keywords:["bookmark","mark","marker","tabs"]},{id:":bookmark:",symbol:"\u{1F516}",group:"objects",keywords:["bookmark","mark"]},{id:":label:",symbol:"\u{1F3F7}",group:"objects",keywords:["label"]},{id:":money_bag:",symbol:"\u{1F4B0}",group:"objects",keywords:["bag","dollar","money","moneybag"]},{id:":yen_banknote:",symbol:"\u{1F4B4}",group:"objects",keywords:["banknote","bill","currency","money","note","yen"]},{id:":dollar_banknote:",symbol:"\u{1F4B5}",group:"objects",keywords:["banknote","bill","currency","dollar","money","note"]},{id:":euro_banknote:",symbol:"\u{1F4B6}",group:"objects",keywords:["banknote","bill","currency","euro","money","note"]},{id:":pound_banknote:",symbol:"\u{1F4B7}",group:"objects",keywords:["banknote","bill","currency","money","note","pound"]},{id:":money_with_wings:",symbol:"\u{1F4B8}",group:"objects",keywords:["banknote","bill","fly","money","money with wings","wings"]},{id:":credit_card:",symbol:"\u{1F4B3}",group:"objects",keywords:["card","credit","money"]},{id:":chart_increasing_with_yen:",symbol:"\u{1F4B9}",group:"objects",keywords:["chart","chart increasing with yen","graph","growth","money","yen"]},{id:":currency_exchange:",symbol:"\u{1F4B1}",group:"objects",keywords:["bank","currency","exchange","money"]},{id:":heavy_dollar_sign:",symbol:"\u{1F4B2}",group:"objects",keywords:["currency","dollar","heavy dollar sign","money"]},{id:":envelope:",symbol:"\u2709",group:"objects",keywords:["email","envelope","letter"]},{id:":e-mail:",symbol:"\u{1F4E7}",group:"objects",keywords:["e-mail","email","letter","mail"]},{id:":incoming_envelope:",symbol:"\u{1F4E8}",group:"objects",keywords:["e-mail","email","envelope","incoming","letter","receive"]},{id:":envelope_with_arrow:",symbol:"\u{1F4E9}",group:"objects",keywords:["arrow","e-mail","email","envelope","envelope with arrow","outgoing"]},{id:":outbox_tray:",symbol:"\u{1F4E4}",group:"objects",keywords:["box","letter","mail","outbox","sent","tray"]},{id:":inbox_tray:",symbol:"\u{1F4E5}",group:"objects",keywords:["box","inbox","letter","mail","receive","tray"]},{id:":package:",symbol:"\u{1F4E6}",group:"objects",keywords:["box","package","parcel"]},{id:":closed_mailbox_with_raised_flag:",symbol:"\u{1F4EB}",group:"objects",keywords:["closed","closed mailbox with raised flag","mail","mailbox","postbox"]},{id:":closed_mailbox_with_lowered_flag:",symbol:"\u{1F4EA}",group:"objects",keywords:["closed","closed mailbox with lowered flag","lowered","mail","mailbox","postbox"]},{id:":open_mailbox_with_raised_flag:",symbol:"\u{1F4EC}",group:"objects",keywords:["mail","mailbox","open","open mailbox with raised flag","postbox"]},{id:":open_mailbox_with_lowered_flag:",symbol:"\u{1F4ED}",group:"objects",keywords:["lowered","mail","mailbox","open","open mailbox with lowered flag","postbox"]},{id:":postbox:",symbol:"\u{1F4EE}",group:"objects",keywords:["mail","mailbox","postbox"]},{id:":ballot_box_with_ballot:",symbol:"\u{1F5F3}",group:"objects",keywords:["ballot","ballot box with ballot","box"]},{id:":pencil:",symbol:"\u270F",group:"objects",keywords:["pencil"]},{id:":black_nib:",symbol:"\u2712",group:"objects",keywords:["black nib","nib","pen"]},{id:":fountain_pen:",symbol:"\u{1F58B}",group:"objects",keywords:["fountain","pen"]},{id:":pen:",symbol:"\u{1F58A}",group:"objects",keywords:["ballpoint","pen"]},{id:":paintbrush:",symbol:"\u{1F58C}",group:"objects",keywords:["paintbrush","painting"]},{id:":crayon:",symbol:"\u{1F58D}",group:"objects",keywords:["crayon"]},{id:":memo:",symbol:"\u{1F4DD}",group:"objects",keywords:["memo","pencil"]},{id:":briefcase:",symbol:"\u{1F4BC}",group:"objects",keywords:["briefcase"]},{id:":file_folder:",symbol:"\u{1F4C1}",group:"objects",keywords:["file","folder"]},{id:":open_file_folder:",symbol:"\u{1F4C2}",group:"objects",keywords:["file","folder","open"]},{id:":card_index_dividers:",symbol:"\u{1F5C2}",group:"objects",keywords:["card","dividers","index"]},{id:":calendar:",symbol:"\u{1F4C5}",group:"objects",keywords:["calendar","date"]},{id:":tear-off_calendar:",symbol:"\u{1F4C6}",group:"objects",keywords:["calendar","tear-off calendar"]},{id:":spiral_notepad:",symbol:"\u{1F5D2}",group:"objects",keywords:["note","pad","spiral","spiral notepad"]},{id:":spiral_calendar:",symbol:"\u{1F5D3}",group:"objects",keywords:["calendar","pad","spiral"]},{id:":card_index:",symbol:"\u{1F4C7}",group:"objects",keywords:["card","index","rolodex"]},{id:":chart_increasing:",symbol:"\u{1F4C8}",group:"objects",keywords:["chart","chart increasing","graph","growth","trend","upward"]},{id:":chart_decreasing:",symbol:"\u{1F4C9}",group:"objects",keywords:["chart","chart decreasing","down","graph","trend"]},{id:":bar_chart:",symbol:"\u{1F4CA}",group:"objects",keywords:["bar","chart","graph"]},{id:":clipboard:",symbol:"\u{1F4CB}",group:"objects",keywords:["clipboard"]},{id:":pushpin:",symbol:"\u{1F4CC}",group:"objects",keywords:["pin","pushpin"]},{id:":round_pushpin:",symbol:"\u{1F4CD}",group:"objects",keywords:["pin","pushpin","round pushpin"]},{id:":paperclip:",symbol:"\u{1F4CE}",group:"objects",keywords:["paperclip"]},{id:":linked_paperclips:",symbol:"\u{1F587}",group:"objects",keywords:["link","linked paperclips","paperclip"]},{id:":straight_ruler:",symbol:"\u{1F4CF}",group:"objects",keywords:["ruler","straight edge","straight ruler"]},{id:":triangular_ruler:",symbol:"\u{1F4D0}",group:"objects",keywords:["ruler","set","triangle","triangular ruler"]},{id:":scissors:",symbol:"\u2702",group:"objects",keywords:["cutting","scissors","tool"]},{id:":card_file_box:",symbol:"\u{1F5C3}",group:"objects",keywords:["box","card","file"]},{id:":file_cabinet:",symbol:"\u{1F5C4}",group:"objects",keywords:["cabinet","file","filing"]},{id:":wastebasket:",symbol:"\u{1F5D1}",group:"objects",keywords:["wastebasket"]},{id:":locked:",symbol:"\u{1F512}",group:"objects",keywords:["closed","locked"]},{id:":unlocked:",symbol:"\u{1F513}",group:"objects",keywords:["lock","open","unlock","unlocked"]},{id:":locked_with_pen:",symbol:"\u{1F50F}",group:"objects",keywords:["ink","lock","locked with pen","nib","pen","privacy"]},{id:":locked_with_key:",symbol:"\u{1F510}",group:"objects",keywords:["closed","key","lock","locked with key","secure"]},{id:":key:",symbol:"\u{1F511}",group:"objects",keywords:["key","lock","password"]},{id:":old_key:",symbol:"\u{1F5DD}",group:"objects",keywords:["clue","key","lock","old"]},{id:":hammer:",symbol:"\u{1F528}",group:"objects",keywords:["hammer","tool"]},{id:":pick:",symbol:"\u26CF",group:"objects",keywords:["mining","pick","tool"]},{id:":hammer_and_pick:",symbol:"\u2692",group:"objects",keywords:["hammer","hammer and pick","pick","tool"]},{id:":hammer_and_wrench:",symbol:"\u{1F6E0}",group:"objects",keywords:["hammer","hammer and wrench","spanner","tool","wrench"]},{id:":dagger:",symbol:"\u{1F5E1}",group:"objects",keywords:["dagger","knife","weapon"]},{id:":crossed_swords:",symbol:"\u2694",group:"objects",keywords:["crossed","swords","weapon"]},{id:":pistol:",symbol:"\u{1F52B}",group:"objects",keywords:["gun","handgun","pistol","revolver","tool","weapon"]},{id:":bow_and_arrow:",symbol:"\u{1F3F9}",group:"objects",keywords:["archer","arrow","bow","bow and arrow","Sagittarius","zodiac"]},{id:":shield:",symbol:"\u{1F6E1}",group:"objects",keywords:["shield","weapon"]},{id:":wrench:",symbol:"\u{1F527}",group:"objects",keywords:["spanner","tool","wrench"]},{id:":nut_and_bolt:",symbol:"\u{1F529}",group:"objects",keywords:["bolt","nut","nut and bolt","tool"]},{id:":gear:",symbol:"\u2699",group:"objects",keywords:["cog","cogwheel","gear","tool"]},{id:":clamp:",symbol:"\u{1F5DC}",group:"objects",keywords:["clamp","compress","tool","vice"]},{id:":balance_scale:",symbol:"\u2696",group:"objects",keywords:["balance","justice","Libra","scale","zodiac"]},{id:":link:",symbol:"\u{1F517}",group:"objects",keywords:["link"]},{id:":chains:",symbol:"\u26D3",group:"objects",keywords:["chain","chains"]},{id:":alembic:",symbol:"\u2697",group:"objects",keywords:["alembic","chemistry","tool"]},{id:":microscope:",symbol:"\u{1F52C}",group:"objects",keywords:["microscope","science","tool"]},{id:":telescope:",symbol:"\u{1F52D}",group:"objects",keywords:["science","telescope","tool"]},{id:":satellite_antenna:",symbol:"\u{1F4E1}",group:"objects",keywords:["antenna","dish","satellite"]},{id:":syringe:",symbol:"\u{1F489}",group:"objects",keywords:["medicine","needle","shot","sick","syringe"]},{id:":pill:",symbol:"\u{1F48A}",group:"objects",keywords:["doctor","medicine","pill","sick"]},{id:":door:",symbol:"\u{1F6AA}",group:"objects",keywords:["door"]},{id:":bed:",symbol:"\u{1F6CF}",group:"objects",keywords:["bed","hotel","sleep"]},{id:":couch_and_lamp:",symbol:"\u{1F6CB}",group:"objects",keywords:["couch","couch and lamp","hotel","lamp"]},{id:":toilet:",symbol:"\u{1F6BD}",group:"objects",keywords:["toilet"]},{id:":shower:",symbol:"\u{1F6BF}",group:"objects",keywords:["shower","water"]},{id:":bathtub:",symbol:"\u{1F6C1}",group:"objects",keywords:["bath","bathtub"]},{id:":shopping_cart:",symbol:"\u{1F6D2}",group:"objects",keywords:["cart","shopping","trolley"]},{id:":cigarette:",symbol:"\u{1F6AC}",group:"objects",keywords:["cigarette","smoking"]},{id:":coffin:",symbol:"\u26B0",group:"objects",keywords:["coffin","death"]},{id:":funeral_urn:",symbol:"\u26B1",group:"objects",keywords:["ashes","death","funeral","urn"]},{id:":moai:",symbol:"\u{1F5FF}",group:"objects",keywords:["face","moai","moyai","statue"]},{id:":atm_sign:",symbol:"\u{1F3E7}",group:"symbols",keywords:["atm","ATM sign","automated","bank","teller"]},{id:":litter_in_bin_sign:",symbol:"\u{1F6AE}",group:"symbols",keywords:["litter","litter bin","litter in bin sign"]},{id:":potable_water:",symbol:"\u{1F6B0}",group:"symbols",keywords:["drinking","potable","water"]},{id:":wheelchair_symbol:",symbol:"\u267F",group:"symbols",keywords:["access","wheelchair symbol"]},{id:":men\u2019s_room:",symbol:"\u{1F6B9}",group:"symbols",keywords:["lavatory","man","men\u2019s room","restroom","wc"]},{id:":women\u2019s_room:",symbol:"\u{1F6BA}",group:"symbols",keywords:["lavatory","restroom","wc","woman","women\u2019s room"]},{id:":restroom:",symbol:"\u{1F6BB}",group:"symbols",keywords:["lavatory","restroom","WC"]},{id:":baby_symbol:",symbol:"\u{1F6BC}",group:"symbols",keywords:["baby","baby symbol","changing"]},{id:":water_closet:",symbol:"\u{1F6BE}",group:"symbols",keywords:["closet","lavatory","restroom","water","wc"]},{id:":passport_control:",symbol:"\u{1F6C2}",group:"symbols",keywords:["control","passport"]},{id:":customs:",symbol:"\u{1F6C3}",group:"symbols",keywords:["customs"]},{id:":baggage_claim:",symbol:"\u{1F6C4}",group:"symbols",keywords:["baggage","claim"]},{id:":left_luggage:",symbol:"\u{1F6C5}",group:"symbols",keywords:["baggage","left luggage","locker","luggage"]},{id:":warning:",symbol:"\u26A0",group:"symbols",keywords:["warning"]},{id:":children_crossing:",symbol:"\u{1F6B8}",group:"symbols",keywords:["child","children crossing","crossing","pedestrian","traffic"]},{id:":no_entry:",symbol:"\u26D4",group:"symbols",keywords:["entry","forbidden","no","not","prohibited","traffic"]},{id:":prohibited:",symbol:"\u{1F6AB}",group:"symbols",keywords:["entry","forbidden","no","not","prohibited"]},{id:":no_bicycles:",symbol:"\u{1F6B3}",group:"symbols",keywords:["bicycle","bike","forbidden","no","no bicycles","prohibited"]},{id:":no_smoking:",symbol:"\u{1F6AD}",group:"symbols",keywords:["forbidden","no","not","prohibited","smoking"]},{id:":no_littering:",symbol:"\u{1F6AF}",group:"symbols",keywords:["forbidden","litter","no","no littering","not","prohibited"]},{id:":non-potable_water:",symbol:"\u{1F6B1}",group:"symbols",keywords:["non-drinking","non-potable","water"]},{id:":no_pedestrians:",symbol:"\u{1F6B7}",group:"symbols",keywords:["forbidden","no","no pedestrians","not","pedestrian","prohibited"]},{id:":no_mobile_phones:",symbol:"\u{1F4F5}",group:"symbols",keywords:["cell","forbidden","mobile","no","no mobile phones","phone"]},{id:":no_one_under_eighteen:",symbol:"\u{1F51E}",group:"symbols",keywords:["18","age restriction","eighteen","no one under eighteen","prohibited","underage"]},{id:":radioactive:",symbol:"\u2622",group:"symbols",keywords:["radioactive","sign"]},{id:":biohazard:",symbol:"\u2623",group:"symbols",keywords:["biohazard","sign"]},{id:":up_arrow:",symbol:"\u2B06",group:"symbols",keywords:["arrow","cardinal","direction","north","up arrow"]},{id:":up-right_arrow:",symbol:"\u2197",group:"symbols",keywords:["arrow","direction","intercardinal","northeast","up-right arrow"]},{id:":right_arrow:",symbol:"\u27A1",group:"symbols",keywords:["arrow","cardinal","direction","east","right arrow"]},{id:":down-right_arrow:",symbol:"\u2198",group:"symbols",keywords:["arrow","direction","down-right arrow","intercardinal","southeast"]},{id:":down_arrow:",symbol:"\u2B07",group:"symbols",keywords:["arrow","cardinal","direction","down","south"]},{id:":down-left_arrow:",symbol:"\u2199",group:"symbols",keywords:["arrow","direction","down-left arrow","intercardinal","southwest"]},{id:":left_arrow:",symbol:"\u2B05",group:"symbols",keywords:["arrow","cardinal","direction","left arrow","west"]},{id:":up-left_arrow:",symbol:"\u2196",group:"symbols",keywords:["arrow","direction","intercardinal","northwest","up-left arrow"]},{id:":up-down_arrow:",symbol:"\u2195",group:"symbols",keywords:["arrow","up-down arrow"]},{id:":left-right_arrow:",symbol:"\u2194",group:"symbols",keywords:["arrow","left-right arrow"]},{id:":right_arrow_curving_left:",symbol:"\u21A9",group:"symbols",keywords:["arrow","right arrow curving left"]},{id:":left_arrow_curving_right:",symbol:"\u21AA",group:"symbols",keywords:["arrow","left arrow curving right"]},{id:":right_arrow_curving_up:",symbol:"\u2934",group:"symbols",keywords:["arrow","right arrow curving up"]},{id:":right_arrow_curving_down:",symbol:"\u2935",group:"symbols",keywords:["arrow","down","right arrow curving down"]},{id:":clockwise_vertical_arrows:",symbol:"\u{1F503}",group:"symbols",keywords:["arrow","clockwise","clockwise vertical arrows","reload"]},{id:":counterclockwise_arrows_button:",symbol:"\u{1F504}",group:"symbols",keywords:["anticlockwise","arrow","counterclockwise","counterclockwise arrows button","withershins"]},{id:":back_arrow:",symbol:"\u{1F519}",group:"symbols",keywords:["arrow","back","BACK arrow"]},{id:":end_arrow:",symbol:"\u{1F51A}",group:"symbols",keywords:["arrow","end","END arrow"]},{id:":on!_arrow:",symbol:"\u{1F51B}",group:"symbols",keywords:["arrow","mark","on","ON! arrow"]},{id:":soon_arrow:",symbol:"\u{1F51C}",group:"symbols",keywords:["arrow","soon","SOON arrow"]},{id:":top_arrow:",symbol:"\u{1F51D}",group:"symbols",keywords:["arrow","top","TOP arrow","up"]},{id:":place_of_worship:",symbol:"\u{1F6D0}",group:"symbols",keywords:["place of worship","religion","worship"]},{id:":atom_symbol:",symbol:"\u269B",group:"symbols",keywords:["atheist","atom","atom symbol"]},{id:":om:",symbol:"\u{1F549}",group:"symbols",keywords:["Hindu","om","religion"]},{id:":star_of_david:",symbol:"\u2721",group:"symbols",keywords:["David","Jew","Jewish","religion","star","star of David"]},{id:":wheel_of_dharma:",symbol:"\u2638",group:"symbols",keywords:["Buddhist","dharma","religion","wheel","wheel of dharma"]},{id:":yin_yang:",symbol:"\u262F",group:"symbols",keywords:["religion","tao","taoist","yang","yin"]},{id:":latin_cross:",symbol:"\u271D",group:"symbols",keywords:["Christian","cross","latin cross","religion"]},{id:":orthodox_cross:",symbol:"\u2626",group:"symbols",keywords:["Christian","cross","orthodox cross","religion"]},{id:":star_and_crescent:",symbol:"\u262A",group:"symbols",keywords:["islam","Muslim","religion","star and crescent"]},{id:":peace_symbol:",symbol:"\u262E",group:"symbols",keywords:["peace","peace symbol"]},{id:":menorah:",symbol:"\u{1F54E}",group:"symbols",keywords:["candelabrum","candlestick","menorah","religion"]},{id:":dotted_six-pointed_star:",symbol:"\u{1F52F}",group:"symbols",keywords:["dotted six-pointed star","fortune","star"]},{id:":aries:",symbol:"\u2648",group:"symbols",keywords:["Aries","ram","zodiac"]},{id:":taurus:",symbol:"\u2649",group:"symbols",keywords:["bull","ox","Taurus","zodiac"]},{id:":gemini:",symbol:"\u264A",group:"symbols",keywords:["Gemini","twins","zodiac"]},{id:":cancer:",symbol:"\u264B",group:"symbols",keywords:["Cancer","crab","zodiac"]},{id:":leo:",symbol:"\u264C",group:"symbols",keywords:["Leo","lion","zodiac"]},{id:":virgo:",symbol:"\u264D",group:"symbols",keywords:["Virgo","zodiac"]},{id:":libra:",symbol:"\u264E",group:"symbols",keywords:["balance","justice","Libra","scales","zodiac"]},{id:":scorpio:",symbol:"\u264F",group:"symbols",keywords:["Scorpio","scorpion","scorpius","zodiac"]},{id:":sagittarius:",symbol:"\u2650",group:"symbols",keywords:["archer","Sagittarius","zodiac"]},{id:":capricorn:",symbol:"\u2651",group:"symbols",keywords:["Capricorn","goat","zodiac"]},{id:":aquarius:",symbol:"\u2652",group:"symbols",keywords:["Aquarius","bearer","water","zodiac"]},{id:":pisces:",symbol:"\u2653",group:"symbols",keywords:["fish","Pisces","zodiac"]},{id:":ophiuchus:",symbol:"\u26CE",group:"symbols",keywords:["bearer","Ophiuchus","serpent","snake","zodiac"]},{id:":shuffle_tracks_button:",symbol:"\u{1F500}",group:"symbols",keywords:["arrow","crossed","shuffle tracks button"]},{id:":repeat_button:",symbol:"\u{1F501}",group:"symbols",keywords:["arrow","clockwise","repeat","repeat button"]},{id:":repeat_single_button:",symbol:"\u{1F502}",group:"symbols",keywords:["arrow","clockwise","once","repeat single button"]},{id:":play_button:",symbol:"\u25B6",group:"symbols",keywords:["arrow","play","play button","right","triangle"]},{id:":fast-forward_button:",symbol:"\u23E9",group:"symbols",keywords:["arrow","double","fast","fast-forward button","forward"]},{id:":next_track_button:",symbol:"\u23ED",group:"symbols",keywords:["arrow","next scene","next track","next track button","triangle"]},{id:":play_or_pause_button:",symbol:"\u23EF",group:"symbols",keywords:["arrow","pause","play","play or pause button","right","triangle"]},{id:":reverse_button:",symbol:"\u25C0",group:"symbols",keywords:["arrow","left","reverse","reverse button","triangle"]},{id:":fast_reverse_button:",symbol:"\u23EA",group:"symbols",keywords:["arrow","double","fast reverse button","rewind"]},{id:":last_track_button:",symbol:"\u23EE",group:"symbols",keywords:["arrow","last track button","previous scene","previous track","triangle"]},{id:":upwards_button:",symbol:"\u{1F53C}",group:"symbols",keywords:["arrow","button","red","upwards button"]},{id:":fast_up_button:",symbol:"\u23EB",group:"symbols",keywords:["arrow","double","fast up button"]},{id:":downwards_button:",symbol:"\u{1F53D}",group:"symbols",keywords:["arrow","button","down","downwards button","red"]},{id:":fast_down_button:",symbol:"\u23EC",group:"symbols",keywords:["arrow","double","down","fast down button"]},{id:":pause_button:",symbol:"\u23F8",group:"symbols",keywords:["bar","double","pause","pause button","vertical"]},{id:":stop_button:",symbol:"\u23F9",group:"symbols",keywords:["square","stop","stop button"]},{id:":record_button:",symbol:"\u23FA",group:"symbols",keywords:["circle","record","record button"]},{id:":eject_button:",symbol:"\u23CF",group:"symbols",keywords:["eject","eject button"]},{id:":cinema:",symbol:"\u{1F3A6}",group:"symbols",keywords:["camera","cinema","film","movie"]},{id:":dim_button:",symbol:"\u{1F505}",group:"symbols",keywords:["brightness","dim","dim button","low"]},{id:":bright_button:",symbol:"\u{1F506}",group:"symbols",keywords:["bright","bright button","brightness"]},{id:":antenna_bars:",symbol:"\u{1F4F6}",group:"symbols",keywords:["antenna","antenna bars","bar","cell","mobile","phone"]},{id:":vibration_mode:",symbol:"\u{1F4F3}",group:"symbols",keywords:["cell","mobile","mode","phone","telephone","vibration"]},{id:":mobile_phone_off:",symbol:"\u{1F4F4}",group:"symbols",keywords:["cell","mobile","off","phone","telephone"]},{id:":female_sign:",symbol:"\u2640",group:"symbols",keywords:["female sign","woman"]},{id:":male_sign:",symbol:"\u2642",group:"symbols",keywords:["male sign","man"]},{id:":medical_symbol:",symbol:"\u2695",group:"symbols",keywords:["aesculapius","medical symbol","medicine","staff"]},{id:":recycling_symbol:",symbol:"\u267B",group:"symbols",keywords:["recycle","recycling symbol"]},{id:":fleur-de-lis:",symbol:"\u269C",group:"symbols",keywords:["fleur-de-lis"]},{id:":trident_emblem:",symbol:"\u{1F531}",group:"symbols",keywords:["anchor","emblem","ship","tool","trident"]},{id:":name_badge:",symbol:"\u{1F4DB}",group:"symbols",keywords:["badge","name"]},{id:":japanese_symbol_for_beginner:",symbol:"\u{1F530}",group:"symbols",keywords:["beginner","chevron","Japanese","Japanese symbol for beginner","leaf"]},{id:":heavy_large_circle:",symbol:"\u2B55",group:"symbols",keywords:["circle","heavy large circle","o"]},{id:":white_heavy_check_mark:",symbol:"\u2705",group:"symbols",keywords:["check","mark","white heavy check mark"]},{id:":ballot_box_with_check:",symbol:"\u2611",group:"symbols",keywords:["ballot","ballot box with check","box","check"]},{id:":heavy_check_mark:",symbol:"\u2714",group:"symbols",keywords:["check","heavy check mark","mark"]},{id:":heavy_multiplication_x:",symbol:"\u2716",group:"symbols",keywords:["cancel","heavy multiplication x","multiplication","multiply","x"]},{id:":cross_mark:",symbol:"\u274C",group:"symbols",keywords:["cancel","cross mark","mark","multiplication","multiply","x"]},{id:":cross_mark_button:",symbol:"\u274E",group:"symbols",keywords:["cross mark button","mark","square"]},{id:":heavy_plus_sign:",symbol:"\u2795",group:"symbols",keywords:["heavy plus sign","math","plus"]},{id:":heavy_minus_sign:",symbol:"\u2796",group:"symbols",keywords:["heavy minus sign","math","minus"]},{id:":heavy_division_sign:",symbol:"\u2797",group:"symbols",keywords:["division","heavy division sign","math"]},{id:":curly_loop:",symbol:"\u27B0",group:"symbols",keywords:["curl","curly loop","loop"]},{id:":double_curly_loop:",symbol:"\u27BF",group:"symbols",keywords:["curl","double","double curly loop","loop"]},{id:":part_alternation_mark:",symbol:"\u303D",group:"symbols",keywords:["mark","part","part alternation mark"]},{id:":eight-spoked_asterisk:",symbol:"\u2733",group:"symbols",keywords:["asterisk","eight-spoked asterisk"]},{id:":eight-pointed_star:",symbol:"\u2734",group:"symbols",keywords:["eight-pointed star","star"]},{id:":sparkle:",symbol:"\u2747",group:"symbols",keywords:["sparkle"]},{id:":double_exclamation_mark:",symbol:"\u203C",group:"symbols",keywords:["bangbang","double exclamation mark","exclamation","mark","punctuation"]},{id:":exclamation_question_mark:",symbol:"\u2049",group:"symbols",keywords:["exclamation","interrobang","mark","punctuation","question"]},{id:":question_mark:",symbol:"\u2753",group:"symbols",keywords:["mark","punctuation","question"]},{id:":white_question_mark:",symbol:"\u2754",group:"symbols",keywords:["mark","outlined","punctuation","question","white question mark"]},{id:":white_exclamation_mark:",symbol:"\u2755",group:"symbols",keywords:["exclamation","mark","outlined","punctuation","white exclamation mark"]},{id:":exclamation_mark:",symbol:"\u2757",group:"symbols",keywords:["exclamation","mark","punctuation"]},{id:":wavy_dash:",symbol:"\u3030",group:"symbols",keywords:["dash","punctuation","wavy"]},{id:":copyright:",symbol:"\xA9",group:"symbols",keywords:["copyright"]},{id:":registered:",symbol:"\xAE",group:"symbols",keywords:["registered"]},{id:":trade_mark:",symbol:"\u2122",group:"symbols",keywords:["mark","tm","trade mark","trademark"]},{id:":keycap_#:",symbol:"#\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_*:",symbol:"*\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_0:",symbol:"0\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_1:",symbol:"1\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_2:",symbol:"2\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_3:",symbol:"3\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_4:",symbol:"4\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_5:",symbol:"5\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_6:",symbol:"6\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_7:",symbol:"7\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_8:",symbol:"8\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_9:",symbol:"9\uFE0F\u20E3",group:"symbols",keywords:["keycap"]},{id:":keycap_10:",symbol:"\u{1F51F}",group:"symbols",keywords:["keycap"]},{id:":hundred_points:",symbol:"\u{1F4AF}",group:"symbols",keywords:["100","full","hundred","hundred points","score"]},{id:":input_latin_uppercase:",symbol:"\u{1F520}",group:"symbols",keywords:["ABCD","input","latin","letters","uppercase"]},{id:":input_latin_lowercase:",symbol:"\u{1F521}",group:"symbols",keywords:["abcd","input","latin","letters","lowercase"]},{id:":input_numbers:",symbol:"\u{1F522}",group:"symbols",keywords:["1234","input","numbers"]},{id:":input_symbols:",symbol:"\u{1F523}",group:"symbols",keywords:["\u3012\u266A&%","input","input symbols"]},{id:":input_latin_letters:",symbol:"\u{1F524}",group:"symbols",keywords:["abc","alphabet","input","latin","letters"]},{id:":a_button_(blood_type):",symbol:"\u{1F170}",group:"symbols",keywords:["a","A button (blood type)","blood type"]},{id:":ab_button_(blood_type):",symbol:"\u{1F18E}",group:"symbols",keywords:["ab","AB button (blood type)","blood type"]},{id:":b_button_(blood_type):",symbol:"\u{1F171}",group:"symbols",keywords:["b","B button (blood type)","blood type"]},{id:":cl_button:",symbol:"\u{1F191}",group:"symbols",keywords:["cl","CL button"]},{id:":cool_button:",symbol:"\u{1F192}",group:"symbols",keywords:["cool","COOL button"]},{id:":free_button:",symbol:"\u{1F193}",group:"symbols",keywords:["free","FREE button"]},{id:":information:",symbol:"\u2139",group:"symbols",keywords:["i","information"]},{id:":id_button:",symbol:"\u{1F194}",group:"symbols",keywords:["id","ID button","identity"]},{id:":circled_m:",symbol:"\u24C2",group:"symbols",keywords:["circle","circled M","m"]},{id:":new_button:",symbol:"\u{1F195}",group:"symbols",keywords:["new","NEW button"]},{id:":ng_button:",symbol:"\u{1F196}",group:"symbols",keywords:["ng","NG button"]},{id:":o_button_(blood_type):",symbol:"\u{1F17E}",group:"symbols",keywords:["blood type","o","O button (blood type)"]},{id:":ok_button:",symbol:"\u{1F197}",group:"symbols",keywords:["OK","OK button"]},{id:":p_button:",symbol:"\u{1F17F}",group:"symbols",keywords:["P button","parking"]},{id:":sos_button:",symbol:"\u{1F198}",group:"symbols",keywords:["help","sos","SOS button"]},{id:":up!_button:",symbol:"\u{1F199}",group:"symbols",keywords:["mark","up","UP! button"]},{id:":vs_button:",symbol:"\u{1F19A}",group:"symbols",keywords:["versus","vs","VS button"]},{id:":japanese_\u201Chere\u201D_button:",symbol:"\u{1F201}",group:"symbols",keywords:["\u201Chere\u201D","Japanese","Japanese \u201Chere\u201D button","katakana","\u30B3\u30B3"]},{id:":japanese_\u201Cservice_charge\u201D_button:",symbol:"\u{1F202}",group:"symbols",keywords:["\u201Cservice charge\u201D","Japanese","Japanese \u201Cservice charge\u201D button","katakana","\u30B5"]},{id:":japanese_\u201Cmonthly_amount\u201D_button:",symbol:"\u{1F237}",group:"symbols",keywords:["\u201Cmonthly amount\u201D","ideograph","Japanese","Japanese \u201Cmonthly amount\u201D button","\u6708"]},{id:":japanese_\u201Cnot_free_of_charge\u201D_button:",symbol:"\u{1F236}",group:"symbols",keywords:["\u201Cnot free of charge\u201D","ideograph","Japanese","Japanese \u201Cnot free of charge\u201D button","\u6709"]},{id:":japanese_\u201Creserved\u201D_button:",symbol:"\u{1F22F}",group:"symbols",keywords:["\u201Creserved\u201D","ideograph","Japanese","Japanese \u201Creserved\u201D button","\u6307"]},{id:":japanese_\u201Cbargain\u201D_button:",symbol:"\u{1F250}",group:"symbols",keywords:["\u201Cbargain\u201D","ideograph","Japanese","Japanese \u201Cbargain\u201D button","\u5F97"]},{id:":japanese_\u201Cdiscount\u201D_button:",symbol:"\u{1F239}",group:"symbols",keywords:["\u201Cdiscount\u201D","ideograph","Japanese","Japanese \u201Cdiscount\u201D button","\u5272"]},{id:":japanese_\u201Cfree_of_charge\u201D_button:",symbol:"\u{1F21A}",group:"symbols",keywords:["\u201Cfree of charge\u201D","ideograph","Japanese","Japanese \u201Cfree of charge\u201D button","\u7121"]},{id:":japanese_\u201Cprohibited\u201D_button:",symbol:"\u{1F232}",group:"symbols",keywords:["\u201Cprohibited\u201D","ideograph","Japanese","Japanese \u201Cprohibited\u201D button","\u7981"]},{id:":japanese_\u201Cacceptable\u201D_button:",symbol:"\u{1F251}",group:"symbols",keywords:["\u201Cacceptable\u201D","ideograph","Japanese","Japanese \u201Cacceptable\u201D button","\u53EF"]},{id:":japanese_\u201Capplication\u201D_button:",symbol:"\u{1F238}",group:"symbols",keywords:["\u201Capplication\u201D","ideograph","Japanese","Japanese \u201Capplication\u201D button","\u7533"]},{id:":japanese_\u201Cpassing_grade\u201D_button:",symbol:"\u{1F234}",group:"symbols",keywords:["\u201Cpassing grade\u201D","ideograph","Japanese","Japanese \u201Cpassing grade\u201D button","\u5408"]},{id:":japanese_\u201Cvacancy\u201D_button:",symbol:"\u{1F233}",group:"symbols",keywords:["\u201Cvacancy\u201D","ideograph","Japanese","Japanese \u201Cvacancy\u201D button","\u7A7A"]},{id:":japanese_\u201Ccongratulations\u201D_button:",symbol:"\u3297",group:"symbols",keywords:["\u201Ccongratulations\u201D","ideograph","Japanese","Japanese \u201Ccongratulations\u201D button","\u795D"]},{id:":japanese_\u201Csecret\u201D_button:",symbol:"\u3299",group:"symbols",keywords:["\u201Csecret\u201D","ideograph","Japanese","Japanese \u201Csecret\u201D button","\u79D8"]},{id:":japanese_\u201Copen_for_business\u201D_button:",symbol:"\u{1F23A}",group:"symbols",keywords:["\u201Copen for business\u201D","ideograph","Japanese","Japanese \u201Copen for business\u201D button","\u55B6"]},{id:":japanese_\u201Cno_vacancy\u201D_button:",symbol:"\u{1F235}",group:"symbols",keywords:["\u201Cno vacancy\u201D","ideograph","Japanese","Japanese \u201Cno vacancy\u201D button","\u6E80"]},{id:":red_circle:",symbol:"\u{1F534}",group:"symbols",keywords:["circle","geometric","red"]},{id:":blue_circle:",symbol:"\u{1F535}",group:"symbols",keywords:["blue","circle","geometric"]},{id:":white_circle:",symbol:"\u26AA",group:"symbols",keywords:["circle","geometric","white circle"]},{id:":black_circle:",symbol:"\u26AB",group:"symbols",keywords:["black circle","circle","geometric"]},{id:":white_large_square:",symbol:"\u2B1C",group:"symbols",keywords:["geometric","square","white large square"]},{id:":black_large_square:",symbol:"\u2B1B",group:"symbols",keywords:["black large square","geometric","square"]},{id:":black_medium_square:",symbol:"\u25FC",group:"symbols",keywords:["black medium square","geometric","square"]},{id:":white_medium_square:",symbol:"\u25FB",group:"symbols",keywords:["geometric","square","white medium square"]},{id:":white_medium-small_square:",symbol:"\u25FD",group:"symbols",keywords:["geometric","square","white medium-small square"]},{id:":black_medium-small_square:",symbol:"\u25FE",group:"symbols",keywords:["black medium-small square","geometric","square"]},{id:":white_small_square:",symbol:"\u25AB",group:"symbols",keywords:["geometric","square","white small square"]},{id:":black_small_square:",symbol:"\u25AA",group:"symbols",keywords:["black small square","geometric","square"]},{id:":large_orange_diamond:",symbol:"\u{1F536}",group:"symbols",keywords:["diamond","geometric","large orange diamond","orange"]},{id:":large_blue_diamond:",symbol:"\u{1F537}",group:"symbols",keywords:["blue","diamond","geometric","large blue diamond"]},{id:":small_orange_diamond:",symbol:"\u{1F538}",group:"symbols",keywords:["diamond","geometric","orange","small orange diamond"]},{id:":small_blue_diamond:",symbol:"\u{1F539}",group:"symbols",keywords:["blue","diamond","geometric","small blue diamond"]},{id:":red_triangle_pointed_up:",symbol:"\u{1F53A}",group:"symbols",keywords:["geometric","red","red triangle pointed up"]},{id:":red_triangle_pointed_down:",symbol:"\u{1F53B}",group:"symbols",keywords:["down","geometric","red","red triangle pointed down"]},{id:":diamond_with_a_dot:",symbol:"\u{1F4A0}",group:"symbols",keywords:["comic","diamond","diamond with a dot","geometric","inside"]},{id:":radio_button:",symbol:"\u{1F518}",group:"symbols",keywords:["button","geometric","radio"]},{id:":black_square_button:",symbol:"\u{1F532}",group:"symbols",keywords:["black square button","button","geometric","square"]},{id:":white_square_button:",symbol:"\u{1F533}",group:"symbols",keywords:["button","geometric","outlined","square","white square button"]},{id:":chequered_flag:",symbol:"\u{1F3C1}",group:"flags",keywords:["checkered","chequered","chequered flag","racing"]},{id:":triangular_flag:",symbol:"\u{1F6A9}",group:"flags",keywords:["post","triangular flag"]},{id:":crossed_flags:",symbol:"\u{1F38C}",group:"flags",keywords:["celebration","cross","crossed","crossed flags","Japanese"]},{id:":black_flag:",symbol:"\u{1F3F4}",group:"flags",keywords:["black flag","waving"]},{id:":white_flag:",symbol:"\u{1F3F3}",group:"flags",keywords:["waving","white flag"]},{id:":rainbow_flag:",symbol:"\u{1F3F3}\uFE0F\u200D\u{1F308}",group:"flags",keywords:["rainbow","rainbow flag"]},{id:":flag_ascension_island:",symbol:"\u{1F1E6}\u{1F1E8}",group:"flags",keywords:["flag"]},{id:":flag_andorra:",symbol:"\u{1F1E6}\u{1F1E9}",group:"flags",keywords:["flag"]},{id:":flag_united_arab_emirates:",symbol:"\u{1F1E6}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_afghanistan:",symbol:"\u{1F1E6}\u{1F1EB}",group:"flags",keywords:["flag"]},{id:":flag_antigua_&_barbuda:",symbol:"\u{1F1E6}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_anguilla:",symbol:"\u{1F1E6}\u{1F1EE}",group:"flags",keywords:["flag"]},{id:":flag_albania:",symbol:"\u{1F1E6}\u{1F1F1}",group:"flags",keywords:["flag"]},{id:":flag_armenia:",symbol:"\u{1F1E6}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_angola:",symbol:"\u{1F1E6}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_antarctica:",symbol:"\u{1F1E6}\u{1F1F6}",group:"flags",keywords:["flag"]},{id:":flag_argentina:",symbol:"\u{1F1E6}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_american_samoa:",symbol:"\u{1F1E6}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_austria:",symbol:"\u{1F1E6}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_australia:",symbol:"\u{1F1E6}\u{1F1FA}",group:"flags",keywords:["flag"]},{id:":flag_aruba:",symbol:"\u{1F1E6}\u{1F1FC}",group:"flags",keywords:["flag"]},{id:":flag_\xE5land_islands:",symbol:"\u{1F1E6}\u{1F1FD}",group:"flags",keywords:["flag"]},{id:":flag_azerbaijan:",symbol:"\u{1F1E6}\u{1F1FF}",group:"flags",keywords:["flag"]},{id:":flag_bosnia_&_herzegovina:",symbol:"\u{1F1E7}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_barbados:",symbol:"\u{1F1E7}\u{1F1E7}",group:"flags",keywords:["flag"]},{id:":flag_bangladesh:",symbol:"\u{1F1E7}\u{1F1E9}",group:"flags",keywords:["flag"]},{id:":flag_belgium:",symbol:"\u{1F1E7}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_burkina_faso:",symbol:"\u{1F1E7}\u{1F1EB}",group:"flags",keywords:["flag"]},{id:":flag_bulgaria:",symbol:"\u{1F1E7}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_bahrain:",symbol:"\u{1F1E7}\u{1F1ED}",group:"flags",keywords:["flag"]},{id:":flag_burundi:",symbol:"\u{1F1E7}\u{1F1EE}",group:"flags",keywords:["flag"]},{id:":flag_benin:",symbol:"\u{1F1E7}\u{1F1EF}",group:"flags",keywords:["flag"]},{id:":flag_st._barth\xE9lemy:",symbol:"\u{1F1E7}\u{1F1F1}",group:"flags",keywords:["flag"]},{id:":flag_bermuda:",symbol:"\u{1F1E7}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_brunei:",symbol:"\u{1F1E7}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_bolivia:",symbol:"\u{1F1E7}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_caribbean_netherlands:",symbol:"\u{1F1E7}\u{1F1F6}",group:"flags",keywords:["flag"]},{id:":flag_brazil:",symbol:"\u{1F1E7}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_bahamas:",symbol:"\u{1F1E7}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_bhutan:",symbol:"\u{1F1E7}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_bouvet_island:",symbol:"\u{1F1E7}\u{1F1FB}",group:"flags",keywords:["flag"]},{id:":flag_botswana:",symbol:"\u{1F1E7}\u{1F1FC}",group:"flags",keywords:["flag"]},{id:":flag_belarus:",symbol:"\u{1F1E7}\u{1F1FE}",group:"flags",keywords:["flag"]},{id:":flag_belize:",symbol:"\u{1F1E7}\u{1F1FF}",group:"flags",keywords:["flag"]},{id:":flag_canada:",symbol:"\u{1F1E8}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_cocos_(keeling)_islands:",symbol:"\u{1F1E8}\u{1F1E8}",group:"flags",keywords:["flag"]},{id:":flag_congo_-_kinshasa:",symbol:"\u{1F1E8}\u{1F1E9}",group:"flags",keywords:["flag"]},{id:":flag_central_african_republic:",symbol:"\u{1F1E8}\u{1F1EB}",group:"flags",keywords:["flag"]},{id:":flag_congo_-_brazzaville:",symbol:"\u{1F1E8}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_switzerland:",symbol:"\u{1F1E8}\u{1F1ED}",group:"flags",keywords:["flag"]},{id:":flag_c\xF4te_d\u2019ivoire:",symbol:"\u{1F1E8}\u{1F1EE}",group:"flags",keywords:["flag"]},{id:":flag_cook_islands:",symbol:"\u{1F1E8}\u{1F1F0}",group:"flags",keywords:["flag"]},{id:":flag_chile:",symbol:"\u{1F1E8}\u{1F1F1}",group:"flags",keywords:["flag"]},{id:":flag_cameroon:",symbol:"\u{1F1E8}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_china:",symbol:"\u{1F1E8}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_colombia:",symbol:"\u{1F1E8}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_clipperton_island:",symbol:"\u{1F1E8}\u{1F1F5}",group:"flags",keywords:["flag"]},{id:":flag_costa_rica:",symbol:"\u{1F1E8}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_cuba:",symbol:"\u{1F1E8}\u{1F1FA}",group:"flags",keywords:["flag"]},{id:":flag_cape_verde:",symbol:"\u{1F1E8}\u{1F1FB}",group:"flags",keywords:["flag"]},{id:":flag_cura\xE7ao:",symbol:"\u{1F1E8}\u{1F1FC}",group:"flags",keywords:["flag"]},{id:":flag_christmas_island:",symbol:"\u{1F1E8}\u{1F1FD}",group:"flags",keywords:["flag"]},{id:":flag_cyprus:",symbol:"\u{1F1E8}\u{1F1FE}",group:"flags",keywords:["flag"]},{id:":flag_czechia:",symbol:"\u{1F1E8}\u{1F1FF}",group:"flags",keywords:["flag"]},{id:":flag_germany:",symbol:"\u{1F1E9}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_diego_garcia:",symbol:"\u{1F1E9}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_djibouti:",symbol:"\u{1F1E9}\u{1F1EF}",group:"flags",keywords:["flag"]},{id:":flag_denmark:",symbol:"\u{1F1E9}\u{1F1F0}",group:"flags",keywords:["flag"]},{id:":flag_dominica:",symbol:"\u{1F1E9}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_dominican_republic:",symbol:"\u{1F1E9}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_algeria:",symbol:"\u{1F1E9}\u{1F1FF}",group:"flags",keywords:["flag"]},{id:":flag_ceuta_&_melilla:",symbol:"\u{1F1EA}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_ecuador:",symbol:"\u{1F1EA}\u{1F1E8}",group:"flags",keywords:["flag"]},{id:":flag_estonia:",symbol:"\u{1F1EA}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_egypt:",symbol:"\u{1F1EA}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_western_sahara:",symbol:"\u{1F1EA}\u{1F1ED}",group:"flags",keywords:["flag"]},{id:":flag_eritrea:",symbol:"\u{1F1EA}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_spain:",symbol:"\u{1F1EA}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_ethiopia:",symbol:"\u{1F1EA}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_european_union:",symbol:"\u{1F1EA}\u{1F1FA}",group:"flags",keywords:["flag"]},{id:":flag_finland:",symbol:"\u{1F1EB}\u{1F1EE}",group:"flags",keywords:["flag"]},{id:":flag_fiji:",symbol:"\u{1F1EB}\u{1F1EF}",group:"flags",keywords:["flag"]},{id:":flag_falkland_islands:",symbol:"\u{1F1EB}\u{1F1F0}",group:"flags",keywords:["flag"]},{id:":flag_micronesia:",symbol:"\u{1F1EB}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_faroe_islands:",symbol:"\u{1F1EB}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_france:",symbol:"\u{1F1EB}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_gabon:",symbol:"\u{1F1EC}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_united_kingdom:",symbol:"\u{1F1EC}\u{1F1E7}",group:"flags",keywords:["flag"]},{id:":flag_grenada:",symbol:"\u{1F1EC}\u{1F1E9}",group:"flags",keywords:["flag"]},{id:":flag_georgia:",symbol:"\u{1F1EC}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_french_guiana:",symbol:"\u{1F1EC}\u{1F1EB}",group:"flags",keywords:["flag"]},{id:":flag_guernsey:",symbol:"\u{1F1EC}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_ghana:",symbol:"\u{1F1EC}\u{1F1ED}",group:"flags",keywords:["flag"]},{id:":flag_gibraltar:",symbol:"\u{1F1EC}\u{1F1EE}",group:"flags",keywords:["flag"]},{id:":flag_greenland:",symbol:"\u{1F1EC}\u{1F1F1}",group:"flags",keywords:["flag"]},{id:":flag_gambia:",symbol:"\u{1F1EC}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_guinea:",symbol:"\u{1F1EC}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_guadeloupe:",symbol:"\u{1F1EC}\u{1F1F5}",group:"flags",keywords:["flag"]},{id:":flag_equatorial_guinea:",symbol:"\u{1F1EC}\u{1F1F6}",group:"flags",keywords:["flag"]},{id:":flag_greece:",symbol:"\u{1F1EC}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_south_georgia_&_south_sandwich_islands:",symbol:"\u{1F1EC}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_guatemala:",symbol:"\u{1F1EC}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_guam:",symbol:"\u{1F1EC}\u{1F1FA}",group:"flags",keywords:["flag"]},{id:":flag_guinea-bissau:",symbol:"\u{1F1EC}\u{1F1FC}",group:"flags",keywords:["flag"]},{id:":flag_guyana:",symbol:"\u{1F1EC}\u{1F1FE}",group:"flags",keywords:["flag"]},{id:":flag_hong_kong_sar_china:",symbol:"\u{1F1ED}\u{1F1F0}",group:"flags",keywords:["flag"]},{id:":flag_heard_&_mcdonald_islands:",symbol:"\u{1F1ED}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_honduras:",symbol:"\u{1F1ED}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_croatia:",symbol:"\u{1F1ED}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_haiti:",symbol:"\u{1F1ED}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_hungary:",symbol:"\u{1F1ED}\u{1F1FA}",group:"flags",keywords:["flag"]},{id:":flag_canary_islands:",symbol:"\u{1F1EE}\u{1F1E8}",group:"flags",keywords:["flag"]},{id:":flag_indonesia:",symbol:"\u{1F1EE}\u{1F1E9}",group:"flags",keywords:["flag"]},{id:":flag_ireland:",symbol:"\u{1F1EE}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_israel:",symbol:"\u{1F1EE}\u{1F1F1}",group:"flags",keywords:["flag"]},{id:":flag_isle_of_man:",symbol:"\u{1F1EE}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_india:",symbol:"\u{1F1EE}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_british_indian_ocean_territory:",symbol:"\u{1F1EE}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_iraq:",symbol:"\u{1F1EE}\u{1F1F6}",group:"flags",keywords:["flag"]},{id:":flag_iran:",symbol:"\u{1F1EE}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_iceland:",symbol:"\u{1F1EE}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_italy:",symbol:"\u{1F1EE}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_jersey:",symbol:"\u{1F1EF}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_jamaica:",symbol:"\u{1F1EF}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_jordan:",symbol:"\u{1F1EF}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_japan:",symbol:"\u{1F1EF}\u{1F1F5}",group:"flags",keywords:["flag"]},{id:":flag_kenya:",symbol:"\u{1F1F0}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_kyrgyzstan:",symbol:"\u{1F1F0}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_cambodia:",symbol:"\u{1F1F0}\u{1F1ED}",group:"flags",keywords:["flag"]},{id:":flag_kiribati:",symbol:"\u{1F1F0}\u{1F1EE}",group:"flags",keywords:["flag"]},{id:":flag_comoros:",symbol:"\u{1F1F0}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_st._kitts_&_nevis:",symbol:"\u{1F1F0}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_north_korea:",symbol:"\u{1F1F0}\u{1F1F5}",group:"flags",keywords:["flag"]},{id:":flag_south_korea:",symbol:"\u{1F1F0}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_kuwait:",symbol:"\u{1F1F0}\u{1F1FC}",group:"flags",keywords:["flag"]},{id:":flag_cayman_islands:",symbol:"\u{1F1F0}\u{1F1FE}",group:"flags",keywords:["flag"]},{id:":flag_kazakhstan:",symbol:"\u{1F1F0}\u{1F1FF}",group:"flags",keywords:["flag"]},{id:":flag_laos:",symbol:"\u{1F1F1}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_lebanon:",symbol:"\u{1F1F1}\u{1F1E7}",group:"flags",keywords:["flag"]},{id:":flag_st._lucia:",symbol:"\u{1F1F1}\u{1F1E8}",group:"flags",keywords:["flag"]},{id:":flag_liechtenstein:",symbol:"\u{1F1F1}\u{1F1EE}",group:"flags",keywords:["flag"]},{id:":flag_sri_lanka:",symbol:"\u{1F1F1}\u{1F1F0}",group:"flags",keywords:["flag"]},{id:":flag_liberia:",symbol:"\u{1F1F1}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_lesotho:",symbol:"\u{1F1F1}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_lithuania:",symbol:"\u{1F1F1}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_luxembourg:",symbol:"\u{1F1F1}\u{1F1FA}",group:"flags",keywords:["flag"]},{id:":flag_latvia:",symbol:"\u{1F1F1}\u{1F1FB}",group:"flags",keywords:["flag"]},{id:":flag_libya:",symbol:"\u{1F1F1}\u{1F1FE}",group:"flags",keywords:["flag"]},{id:":flag_morocco:",symbol:"\u{1F1F2}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_monaco:",symbol:"\u{1F1F2}\u{1F1E8}",group:"flags",keywords:["flag"]},{id:":flag_moldova:",symbol:"\u{1F1F2}\u{1F1E9}",group:"flags",keywords:["flag"]},{id:":flag_montenegro:",symbol:"\u{1F1F2}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_st._martin:",symbol:"\u{1F1F2}\u{1F1EB}",group:"flags",keywords:["flag"]},{id:":flag_madagascar:",symbol:"\u{1F1F2}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_marshall_islands:",symbol:"\u{1F1F2}\u{1F1ED}",group:"flags",keywords:["flag"]},{id:":flag_macedonia:",symbol:"\u{1F1F2}\u{1F1F0}",group:"flags",keywords:["flag"]},{id:":flag_mali:",symbol:"\u{1F1F2}\u{1F1F1}",group:"flags",keywords:["flag"]},{id:":flag_myanmar_(burma):",symbol:"\u{1F1F2}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_mongolia:",symbol:"\u{1F1F2}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_macau_sar_china:",symbol:"\u{1F1F2}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_northern_mariana_islands:",symbol:"\u{1F1F2}\u{1F1F5}",group:"flags",keywords:["flag"]},{id:":flag_martinique:",symbol:"\u{1F1F2}\u{1F1F6}",group:"flags",keywords:["flag"]},{id:":flag_mauritania:",symbol:"\u{1F1F2}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_montserrat:",symbol:"\u{1F1F2}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_malta:",symbol:"\u{1F1F2}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_mauritius:",symbol:"\u{1F1F2}\u{1F1FA}",group:"flags",keywords:["flag"]},{id:":flag_maldives:",symbol:"\u{1F1F2}\u{1F1FB}",group:"flags",keywords:["flag"]},{id:":flag_malawi:",symbol:"\u{1F1F2}\u{1F1FC}",group:"flags",keywords:["flag"]},{id:":flag_mexico:",symbol:"\u{1F1F2}\u{1F1FD}",group:"flags",keywords:["flag"]},{id:":flag_malaysia:",symbol:"\u{1F1F2}\u{1F1FE}",group:"flags",keywords:["flag"]},{id:":flag_mozambique:",symbol:"\u{1F1F2}\u{1F1FF}",group:"flags",keywords:["flag"]},{id:":flag_namibia:",symbol:"\u{1F1F3}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_new_caledonia:",symbol:"\u{1F1F3}\u{1F1E8}",group:"flags",keywords:["flag"]},{id:":flag_niger:",symbol:"\u{1F1F3}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_norfolk_island:",symbol:"\u{1F1F3}\u{1F1EB}",group:"flags",keywords:["flag"]},{id:":flag_nigeria:",symbol:"\u{1F1F3}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_nicaragua:",symbol:"\u{1F1F3}\u{1F1EE}",group:"flags",keywords:["flag"]},{id:":flag_netherlands:",symbol:"\u{1F1F3}\u{1F1F1}",group:"flags",keywords:["flag"]},{id:":flag_norway:",symbol:"\u{1F1F3}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_nepal:",symbol:"\u{1F1F3}\u{1F1F5}",group:"flags",keywords:["flag"]},{id:":flag_nauru:",symbol:"\u{1F1F3}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_niue:",symbol:"\u{1F1F3}\u{1F1FA}",group:"flags",keywords:["flag"]},{id:":flag_new_zealand:",symbol:"\u{1F1F3}\u{1F1FF}",group:"flags",keywords:["flag"]},{id:":flag_oman:",symbol:"\u{1F1F4}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_panama:",symbol:"\u{1F1F5}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_peru:",symbol:"\u{1F1F5}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_french_polynesia:",symbol:"\u{1F1F5}\u{1F1EB}",group:"flags",keywords:["flag"]},{id:":flag_papua_new_guinea:",symbol:"\u{1F1F5}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_philippines:",symbol:"\u{1F1F5}\u{1F1ED}",group:"flags",keywords:["flag"]},{id:":flag_pakistan:",symbol:"\u{1F1F5}\u{1F1F0}",group:"flags",keywords:["flag"]},{id:":flag_poland:",symbol:"\u{1F1F5}\u{1F1F1}",group:"flags",keywords:["flag"]},{id:":flag_st._pierre_&_miquelon:",symbol:"\u{1F1F5}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_pitcairn_islands:",symbol:"\u{1F1F5}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_puerto_rico:",symbol:"\u{1F1F5}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_palestinian_territories:",symbol:"\u{1F1F5}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_portugal:",symbol:"\u{1F1F5}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_palau:",symbol:"\u{1F1F5}\u{1F1FC}",group:"flags",keywords:["flag"]},{id:":flag_paraguay:",symbol:"\u{1F1F5}\u{1F1FE}",group:"flags",keywords:["flag"]},{id:":flag_qatar:",symbol:"\u{1F1F6}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_r\xE9union:",symbol:"\u{1F1F7}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_romania:",symbol:"\u{1F1F7}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_serbia:",symbol:"\u{1F1F7}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_russia:",symbol:"\u{1F1F7}\u{1F1FA}",group:"flags",keywords:["flag"]},{id:":flag_rwanda:",symbol:"\u{1F1F7}\u{1F1FC}",group:"flags",keywords:["flag"]},{id:":flag_saudi_arabia:",symbol:"\u{1F1F8}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_solomon_islands:",symbol:"\u{1F1F8}\u{1F1E7}",group:"flags",keywords:["flag"]},{id:":flag_seychelles:",symbol:"\u{1F1F8}\u{1F1E8}",group:"flags",keywords:["flag"]},{id:":flag_sudan:",symbol:"\u{1F1F8}\u{1F1E9}",group:"flags",keywords:["flag"]},{id:":flag_sweden:",symbol:"\u{1F1F8}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_singapore:",symbol:"\u{1F1F8}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_st._helena:",symbol:"\u{1F1F8}\u{1F1ED}",group:"flags",keywords:["flag"]},{id:":flag_slovenia:",symbol:"\u{1F1F8}\u{1F1EE}",group:"flags",keywords:["flag"]},{id:":flag_svalbard_&_jan_mayen:",symbol:"\u{1F1F8}\u{1F1EF}",group:"flags",keywords:["flag"]},{id:":flag_slovakia:",symbol:"\u{1F1F8}\u{1F1F0}",group:"flags",keywords:["flag"]},{id:":flag_sierra_leone:",symbol:"\u{1F1F8}\u{1F1F1}",group:"flags",keywords:["flag"]},{id:":flag_san_marino:",symbol:"\u{1F1F8}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_senegal:",symbol:"\u{1F1F8}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_somalia:",symbol:"\u{1F1F8}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_suriname:",symbol:"\u{1F1F8}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_south_sudan:",symbol:"\u{1F1F8}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_s\xE3o_tom\xE9_&_pr\xEDncipe:",symbol:"\u{1F1F8}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_el_salvador:",symbol:"\u{1F1F8}\u{1F1FB}",group:"flags",keywords:["flag"]},{id:":flag_sint_maarten:",symbol:"\u{1F1F8}\u{1F1FD}",group:"flags",keywords:["flag"]},{id:":flag_syria:",symbol:"\u{1F1F8}\u{1F1FE}",group:"flags",keywords:["flag"]},{id:":flag_swaziland:",symbol:"\u{1F1F8}\u{1F1FF}",group:"flags",keywords:["flag"]},{id:":flag_tristan_da_cunha:",symbol:"\u{1F1F9}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_turks_&_caicos_islands:",symbol:"\u{1F1F9}\u{1F1E8}",group:"flags",keywords:["flag"]},{id:":flag_chad:",symbol:"\u{1F1F9}\u{1F1E9}",group:"flags",keywords:["flag"]},{id:":flag_french_southern_territories:",symbol:"\u{1F1F9}\u{1F1EB}",group:"flags",keywords:["flag"]},{id:":flag_togo:",symbol:"\u{1F1F9}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_thailand:",symbol:"\u{1F1F9}\u{1F1ED}",group:"flags",keywords:["flag"]},{id:":flag_tajikistan:",symbol:"\u{1F1F9}\u{1F1EF}",group:"flags",keywords:["flag"]},{id:":flag_tokelau:",symbol:"\u{1F1F9}\u{1F1F0}",group:"flags",keywords:["flag"]},{id:":flag_timor-leste:",symbol:"\u{1F1F9}\u{1F1F1}",group:"flags",keywords:["flag"]},{id:":flag_turkmenistan:",symbol:"\u{1F1F9}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_tunisia:",symbol:"\u{1F1F9}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_tonga:",symbol:"\u{1F1F9}\u{1F1F4}",group:"flags",keywords:["flag"]},{id:":flag_turkey:",symbol:"\u{1F1F9}\u{1F1F7}",group:"flags",keywords:["flag"]},{id:":flag_trinidad_&_tobago:",symbol:"\u{1F1F9}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_tuvalu:",symbol:"\u{1F1F9}\u{1F1FB}",group:"flags",keywords:["flag"]},{id:":flag_taiwan:",symbol:"\u{1F1F9}\u{1F1FC}",group:"flags",keywords:["flag"]},{id:":flag_tanzania:",symbol:"\u{1F1F9}\u{1F1FF}",group:"flags",keywords:["flag"]},{id:":flag_ukraine:",symbol:"\u{1F1FA}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_uganda:",symbol:"\u{1F1FA}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_u.s._outlying_islands:",symbol:"\u{1F1FA}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_united_nations:",symbol:"\u{1F1FA}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_united_states:",symbol:"\u{1F1FA}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_uruguay:",symbol:"\u{1F1FA}\u{1F1FE}",group:"flags",keywords:["flag"]},{id:":flag_uzbekistan:",symbol:"\u{1F1FA}\u{1F1FF}",group:"flags",keywords:["flag"]},{id:":flag_vatican_city:",symbol:"\u{1F1FB}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_st._vincent_&_grenadines:",symbol:"\u{1F1FB}\u{1F1E8}",group:"flags",keywords:["flag"]},{id:":flag_venezuela:",symbol:"\u{1F1FB}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_british_virgin_islands:",symbol:"\u{1F1FB}\u{1F1EC}",group:"flags",keywords:["flag"]},{id:":flag_u.s._virgin_islands:",symbol:"\u{1F1FB}\u{1F1EE}",group:"flags",keywords:["flag"]},{id:":flag_vietnam:",symbol:"\u{1F1FB}\u{1F1F3}",group:"flags",keywords:["flag"]},{id:":flag_vanuatu:",symbol:"\u{1F1FB}\u{1F1FA}",group:"flags",keywords:["flag"]},{id:":flag_wallis_&_futuna:",symbol:"\u{1F1FC}\u{1F1EB}",group:"flags",keywords:["flag"]},{id:":flag_samoa:",symbol:"\u{1F1FC}\u{1F1F8}",group:"flags",keywords:["flag"]},{id:":flag_kosovo:",symbol:"\u{1F1FD}\u{1F1F0}",group:"flags",keywords:["flag"]},{id:":flag_yemen:",symbol:"\u{1F1FE}\u{1F1EA}",group:"flags",keywords:["flag"]},{id:":flag_mayotte:",symbol:"\u{1F1FE}\u{1F1F9}",group:"flags",keywords:["flag"]},{id:":flag_south_africa:",symbol:"\u{1F1FF}\u{1F1E6}",group:"flags",keywords:["flag"]},{id:":flag_zambia:",symbol:"\u{1F1FF}\u{1F1F2}",group:"flags",keywords:["flag"]},{id:":flag_zimbabwe:",symbol:"\u{1F1FF}\u{1F1FC}",group:"flags",keywords:["flag"]},{id:":flag_england:",symbol:"\u{1F3F4}\u{E0067}\u{E0062}\u{E0065}\u{E006E}\u{E0067}\u{E007F}",group:"flags",keywords:["flag"]},{id:":flag_scotland:",symbol:"\u{1F3F4}\u{E0067}\u{E0062}\u{E0073}\u{E0063}\u{E0074}\u{E007F}",group:"flags",keywords:["flag"]},{id:":flag_wales:",symbol:"\u{1F3F4}\u{E0067}\u{E0062}\u{E0077}\u{E006C}\u{E0073}\u{E007F}",group:"flags",keywords:["flag"]}];function Ck(e){function t(i,o,n){if(o.includes(i))return!0;if(n.length!==0){for(let s=0;s{let s=kk.filter(r=>t(e,r.id,r.keywords)).map(r=>({id:r.id,name:r.id.replace(/:/g,""),text:r.symbol,type:"emoji"}));i(s)})}var Hm={autosave:{waitingTime:5e3,save(e){return fk(e)}},heading:{options:[{model:"paragraph",title:"Paragraph",class:"ck-heading_paragraph"},{model:"heading1",view:"h1",title:"Heading 1",class:"ck-heading_heading1"},{model:"heading2",view:"h2",title:"Heading 2",class:"ck-heading_heading2"},{model:"heading3",view:"h3",title:"Heading 3",class:"ck-heading_heading3"},{model:"heading4",view:"h4",title:"Heading 4",class:"ck-heading_heading4"},{model:"heading5",view:"h5",title:"Heading 5",class:"ck-heading_heading5"}]},toolbar:{},OPMacroEmbeddedTable:{toolbar:["opEditEmbeddedTableQuery"]},OPMacroWpButton:{toolbar:["opEditWpMacroButton"]},OPWikiIncludePage:{toolbar:["opEditWikiIncludeMacroButton"]},OPCodeBlock:{toolbar:["opEditCodeBlock"]},OPChildPages:{toolbar:["opEditChildPagesMacroButton"]},image:{insert:{type:"inline"},resizeUnit:"px",resizeOptions:[{name:"imageResize:original",value:null,icon:"original"},{name:"imageResize:50",value:"50",icon:"medium"},{name:"imageResize:75",value:"75",icon:"large"}],toolbar:["toggleImageCaption","imageTextAlternative","|","imageStyle:inline","imageStyle:block","|","imageResize:original"]},table:{contentToolbar:["tableColumn","tableRow","mergeTableCells","tableProperties","tableCellProperties"]},mention:{feeds:[{marker:"@",feed:_k,itemRenderer:ya,minimumCharacters:0},{marker:"###",feed:ou("###"),itemRenderer:ya,minimumCharacters:1},{marker:"##",feed:ou("##"),itemRenderer:ya,minimumCharacters:1},{marker:"#",feed:ou("#"),itemRenderer:ya,minimumCharacters:1},{marker:":",feed:Ck,itemRenderer:vk,minimumCharacters:1}]},language:"en",licenseKey:"GPL"};function Wm(e){return(t,i)=>{let o=i.openProject.context;i.removePlugins=i.removePlugins||[];let n=o.resource;if(n&&n.canAddAttachments||i.removePlugins.push(...Fm.map(r=>r.pluginName)),o.macros===!1&&(i.openProject.disableAllMacros=!0,i.removePlugins.push(...gs.map(r=>r.pluginName))),Array.isArray(o.macros)){let r=gs.filter(a=>o.macros.indexOf(a.pluginName)===-1);i.removePlugins.push(...r)}i.disabledMentions=[];let s=o.disabledMentions;return Array.isArray(s)&&(i.disabledMentions=s),e.create({...i,root:{...i.root,element:t}})}}var ro=class extends _h{},ao=class extends _h{};window.OPConstrainedEditor=ro;window.OPClassicEditor=ao;ao.createCustomized=Wm(ao);ao.builtinPlugins=Nm;ao.defaultConfig=Object.assign({},Hm);ao.defaultConfig.toolbar={items:["heading","|","bold","italic","strikethrough","code","insertCodeBlock","link","bulletedList","numberedList","todoList","imageUpload","blockQuote","|","insertTable","macroList","|","opContentRevisions","undo","redo","openProjectShowFormattingHelp","|","pageBreak","|","preview","opShowSource"]};ro.createCustomized=Wm(ro);ro.builtinPlugins=Nm;ro.defaultConfig=Object.assign({},Hm);ro.defaultConfig.toolbar={items:["bold","italic","strikethrough","code","insertCodeBlock","link","bulletedList","numberedList","todoList","imageUpload","blockQuote","|","opContentRevisions","undo","redo","openProjectShowFormattingHelp","preview","opShowSource"]};export{ro as ConstrainedEditor,ao as FullEditor}; //# sourceMappingURL=ckeditor.js.map diff --git a/frontend/src/vendor/ckeditor/ckeditor.js.map b/frontend/src/vendor/ckeditor/ckeditor.js.map index 9fb4cc1ff992..e3930309b315 100644 --- a/frontend/src/vendor/ckeditor/ckeditor.js.map +++ b/frontend/src/vendor/ckeditor/ckeditor.js.map @@ -1,7 +1,7 @@ { "version": 3, - "sources": ["../../../../../home/node/app/node_modules/markdown-it-task-lists/index.js", "../../../../../home/node/app/node_modules/lz-string/libs/lz-string.js", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/predicate/isArray.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/predicate/isPlainObject.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/util/eq.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/function/noop.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/_internal/getTag.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/_internal/tags.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/_internal/globalThis.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/predicate/isBuffer.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/predicate/isPlainObject.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/predicate/isEqualWith.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/predicate/isEqual.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/predicate/isLength.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/predicate/isArrayLike.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/predicate/isSymbol.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/util/toString.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/_internal/toKey.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/util/toPath.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/object/get.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/object/property.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/predicate/isObject.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/predicate/isPrimitive.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/predicate/isMatchWith.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/predicate/isMatch.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/predicate/isTypedArray.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/object/cloneDeepWith.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/object/cloneDeep.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/predicate/matches.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/object/cloneDeepWith.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/object/cloneDeep.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/predicate/isArguments.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/_internal/isIndex.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/object/has.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/predicate/matchesProperty.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/function/identity.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/util/iteratee.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/predicate/isObjectLike.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/predicate/isArrayLikeObject.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/util/toNumber.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/util/toFinite.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/util/toInteger.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/predicate/isString.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/function/identity.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/_internal/isKey.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/predicate/isTypedArray.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/util/times.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/_internal/isPrototype.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/_internal/assignValue.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/_internal/isUnsafeToWriteProperty.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/object/updateWith.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/object/set.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/function/debounce.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/function/debounce.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/function/throttle.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/object/keysIn.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/object/assignIn.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/object/clone.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/object/mapValues.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/object/mapValues.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/object/clone.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/object/mergeWith.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/object/merge.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/predicate/isFunction.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/predicate/isElement.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/predicate/isEmpty.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/function/after.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/predicate/isEqualWith.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/string/upperFirst.mjs", "../../../../../home/node/app/node_modules/es-toolkit/dist/compat/string/upperFirst.mjs", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-utils/dist/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-engine/dist/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-core/dist/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-icons/dist/index.js", "../../../../../home/node/app/node_modules/color-parse/node_modules/color-name/index.js", "../../../../../home/node/app/node_modules/color-parse/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-name/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/conversions.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/route.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-ui/node_modules/color-convert/index.js", "../../../../../home/node/app/node_modules/vanilla-colorful/lib/utils/math.js", "../../../../../home/node/app/node_modules/vanilla-colorful/lib/utils/convert.js", "../../../../../home/node/app/node_modules/vanilla-colorful/lib/utils/compare.js", "../../../../../home/node/app/node_modules/vanilla-colorful/lib/utils/dom.js", "../../../../../home/node/app/node_modules/vanilla-colorful/lib/components/slider.js", "../../../../../home/node/app/node_modules/vanilla-colorful/lib/components/hue.js", "../../../../../home/node/app/node_modules/vanilla-colorful/lib/components/saturation.js", "../../../../../home/node/app/node_modules/vanilla-colorful/lib/styles/color-picker.js", "../../../../../home/node/app/node_modules/vanilla-colorful/lib/styles/hue.js", "../../../../../home/node/app/node_modules/vanilla-colorful/lib/styles/saturation.js", "../../../../../home/node/app/node_modules/vanilla-colorful/lib/components/color-picker.js", "../../../../../home/node/app/node_modules/vanilla-colorful/lib/entrypoints/hex.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-ui/dist/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-editor-decoupled/dist/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-typing/dist/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-enter/dist/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-widget/dist/index.js", "../../../../../home/node/app/src/plugins/op-macro-toc-plugin.ts", "../../../../../home/node/app/src/plugins/op-macro-embedded-table/utils.ts", "../../../../../home/node/app/src/plugins/op-context/op-context.ts", "../../../../../home/node/app/src/plugins/op-macro-embedded-table/embedded-table-editing.ts", "../../../../../home/node/app/src/icons/edit.svg", "../../../../../home/node/app/src/helpers/create-toolbar-edit-button.ts", "../../../../../home/node/app/src/helpers/create-toolbar.ts", "../../../../../home/node/app/src/plugins/op-macro-embedded-table/embedded-table-toolbar.ts", "../../../../../home/node/app/src/plugins/op-macro-embedded-table/embedded-table-plugin.ts", "../../../../../home/node/app/src/plugins/op-macro-wp-button/utils.ts", "../../../../../home/node/app/src/plugins/op-macro-wp-button/op-macro-wp-button-editing.ts", "../../../../../home/node/app/src/plugins/op-macro-wp-button/op-macro-wp-button-toolbar.ts", "../../../../../home/node/app/src/plugins/op-macro-wp-button/op-macro-wp-button-plugin.ts", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-upload/dist/index.js", "../../../../../home/node/app/src/plugins/op-upload-resource-adapter.ts", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-clipboard/dist/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-undo/dist/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-image/dist/index.js", "../../../../../home/node/app/src/plugins/op-upload-plugin.ts", "../../../../../home/node/app/src/plugins/op-macro-child-pages/utils.ts", "../../../../../home/node/app/src/plugins/op-macro-child-pages/op-macro-child-pages-editing.ts", "../../../../../home/node/app/src/plugins/op-macro-child-pages/op-macro-child-pages-toolbar.ts", "../../../../../home/node/app/src/plugins/op-macro-child-pages/op-macro-child-pages-plugin.ts", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-select-all/dist/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-essentials/dist/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-adapter-ckfinder/dist/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-autoformat/dist/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-basic-styles/dist/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-block-quote/dist/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-paragraph/dist/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-heading/dist/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-link/dist/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-font/dist/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-list/dist/index.js", "../../../../../home/node/app/src/icons/help.svg", "../../../../../home/node/app/src/plugins/op-help-link-plugin/op-help-link-plugin.ts", "../../../../../home/node/app/src/icons/code-block.svg", "../../../../../home/node/app/src/plugins/code-block/widget.ts", "../../../../../home/node/app/src/plugins/code-block/converters.ts", "../../../../../home/node/app/src/plugins/code-block/click-observer.ts", "../../../../../home/node/app/src/plugins/code-block/code-block-editing.ts", "../../../../../home/node/app/src/plugins/code-block/code-block-toolbar.ts", "../../../../../home/node/app/src/plugins/code-block/code-block.ts", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-table/dist/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-paste-from-office/dist/index.js", "../../../../../home/node/app/src/icons/plus.svg", "../../../../../home/node/app/src/plugins/op-macro-list-plugin.ts", "../../../../../home/node/app/src/plugins/op-attachment-listener-plugin.ts", "../../../../../home/node/app/node_modules/turndown-plugin-gfm/lib/turndown-plugin-gfm.es.js", "../../../../../home/node/app/node_modules/turndown/lib/turndown.browser.es.js", "../../../../../home/node/app/src/commonmark/utils/preprocessor.ts", "../../../../../home/node/app/src/commonmark/utils/fix-tasklist-whitespaces.ts", "../../../../../home/node/app/src/commonmark/utils/hoist-task-list-checkboxes.ts", "../../../../../home/node/app/src/commonmark/utils/page-breaks.ts", "../../../../../home/node/app/src/commonmark/utils/fix-breaks.ts", "../../../../../home/node/app/node_modules/markdown-it/lib/common/utils.mjs", "../../../../../home/node/app/node_modules/mdurl/index.mjs", "../../../../../home/node/app/node_modules/mdurl/lib/decode.mjs", "../../../../../home/node/app/node_modules/mdurl/lib/encode.mjs", "../../../../../home/node/app/node_modules/mdurl/lib/format.mjs", "../../../../../home/node/app/node_modules/mdurl/lib/parse.mjs", "../../../../../home/node/app/node_modules/uc.micro/index.mjs", "../../../../../home/node/app/node_modules/uc.micro/properties/Any/regex.mjs", "../../../../../home/node/app/node_modules/uc.micro/categories/Cc/regex.mjs", "../../../../../home/node/app/node_modules/uc.micro/categories/Cf/regex.mjs", "../../../../../home/node/app/node_modules/uc.micro/categories/P/regex.mjs", "../../../../../home/node/app/node_modules/uc.micro/categories/S/regex.mjs", "../../../../../home/node/app/node_modules/uc.micro/categories/Z/regex.mjs", "../../../../../home/node/app/node_modules/entities/lib/esm/generated/decode-data-html.js", "../../../../../home/node/app/node_modules/entities/lib/esm/generated/decode-data-xml.js", "../../../../../home/node/app/node_modules/entities/lib/esm/decode_codepoint.js", "../../../../../home/node/app/node_modules/entities/lib/esm/decode.js", "../../../../../home/node/app/node_modules/entities/lib/esm/generated/encode-html.js", "../../../../../home/node/app/node_modules/entities/lib/esm/escape.js", "../../../../../home/node/app/node_modules/entities/lib/esm/index.js", "../../../../../home/node/app/node_modules/markdown-it/lib/helpers/index.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/helpers/parse_link_label.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/helpers/parse_link_destination.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/helpers/parse_link_title.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/renderer.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/ruler.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/token.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_core/state_core.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_core/normalize.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_core/block.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_core/inline.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_core/linkify.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_core/replacements.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_core/smartquotes.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_core/text_join.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/parser_core.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_block/state_block.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_block/table.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_block/code.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_block/fence.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_block/blockquote.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_block/hr.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_block/list.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_block/reference.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/common/html_blocks.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/common/html_re.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_block/html_block.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_block/heading.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_block/lheading.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_block/paragraph.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/parser_block.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_inline/state_inline.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_inline/text.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_inline/linkify.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_inline/newline.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_inline/escape.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_inline/backticks.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_inline/strikethrough.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_inline/emphasis.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_inline/link.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_inline/image.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_inline/autolink.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_inline/html_inline.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_inline/entity.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/rules_inline/fragments_join.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/parser_inline.mjs", "../../../../../home/node/app/node_modules/linkify-it/lib/re.mjs", "../../../../../home/node/app/node_modules/linkify-it/index.mjs", "../../../../../home/node/app/node_modules/punycode.js/punycode.es6.js", "../../../../../home/node/app/node_modules/markdown-it/lib/presets/default.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/presets/zero.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/presets/commonmark.mjs", "../../../../../home/node/app/node_modules/markdown-it/lib/index.mjs", "../../../../../home/node/app/src/commonmark/commonmarkdataprocessor.ts", "../../../../../home/node/app/src/plugins/op-image-attachment-lookup/op-image-attachment-lookup-plugin.ts", "../../../../../home/node/app/src/commonmark/commonmark.ts", "../../../../../home/node/app/src/icons/source.svg", "../../../../../home/node/app/src/icons/wysiwyg.svg", "../../../../../home/node/app/src/helpers/button-disabler.ts", "../../../../../home/node/app/src/plugins/op-source-code.plugin.ts", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-mention/dist/index.js", "../../../../../home/node/app/src/plugins/op-macro-wp-quickinfo/predicate.ts", "../../../../../home/node/app/src/mentions/mentions-caster.ts", "../../../../../home/node/app/src/plugins/op-custom-css-classes-plugin.ts", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-page-break/dist/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-horizontal-line/dist/index.js", "../../../../../home/node/app/node_modules/@ckeditor/ckeditor5-autosave/dist/index.js", "../../../../../home/node/app/src/plugins/op-content-revisions/storage.ts", "../../../../../home/node/app/src/plugins/op-content-revisions/utils.ts", "../../../../../home/node/app/src/icons/revisions.svg", "../../../../../home/node/app/src/plugins/op-content-revisions/ui.ts", "../../../../../home/node/app/src/plugins/op-content-revisions/command.ts", "../../../../../home/node/app/src/plugins/op-content-revisions/op-content-revisions.ts", "../../../../../home/node/app/src/plugins/op-macro-wp-quickinfo/op-macro-wp-quickinfo-plugin.ts", "../../../../../home/node/app/src/plugins/op-macro-wiki-page-link/macro-url.ts", "../../../../../home/node/app/src/plugins/op-macro-wiki-page-link/op-macro-wiki-page-link-plugin.ts", "../../../../../home/node/app/src/plugins/op-macro-wiki-page-link/insert-wiki-page-link.ts", "../../../../../home/node/app/src/plugins/op-macro-wiki-page-link/op-macro-wiki-page-link-add-existing.ts", "../../../../../home/node/app/src/plugins/op-macro-wiki-page-link/op-macro-wiki-page-link-create-new.ts", "../../../../../home/node/app/src/plugins/op-resizer-guard/op-resizer-guard-plugin.ts", "../../../../../home/node/app/src/op-plugins.ts", "../../../../../home/node/app/node_modules/@rails/request.js/src/fetch_response.js", "../../../../../home/node/app/node_modules/@rails/request.js/src/request_interceptor.js", "../../../../../home/node/app/node_modules/@rails/request.js/src/lib/utils.js", "../../../../../home/node/app/node_modules/@rails/request.js/src/fetch_request.js", "../../../../../home/node/app/node_modules/@rails/request.js/src/verbs.js", "../../../../../home/node/app/src/mentions/user-mentions.ts", "../../../../../home/node/app/src/mentions/work-package-mentions.ts", "../../../../../home/node/app/src/mentions/mentions-item-renderer.ts", "../../../../../home/node/app/src/mentions/emojis.json", "../../../../../home/node/app/src/mentions/emoji-mentions.ts", "../../../../../home/node/app/src/op-ckeditor-config.ts", "../../../../../home/node/app/src/op-config-customizer.ts", "../../../../../home/node/app/src/op-ckeditor.ts"], - "sourcesContent": ["// Markdown-it plugin to render GitHub-style task lists; see\n//\n// https://github.com/blog/1375-task-lists-in-gfm-issues-pulls-comments\n// https://github.com/blog/1825-task-lists-in-all-markdown-documents\n\nvar disableCheckboxes = true;\nvar useLabelWrapper = false;\nvar useLabelAfter = false;\n\nmodule.exports = function(md, options) {\n\tif (options) {\n\t\tdisableCheckboxes = !options.enabled;\n\t\tuseLabelWrapper = !!options.label;\n\t\tuseLabelAfter = !!options.labelAfter;\n\t}\n\n\tmd.core.ruler.after('inline', 'github-task-lists', function(state) {\n\t\tvar tokens = state.tokens;\n\t\tfor (var i = 2; i < tokens.length; i++) {\n\t\t\tif (isTodoItem(tokens, i)) {\n\t\t\t\ttodoify(tokens[i], state.Token);\n\t\t\t\tattrSet(tokens[i-2], 'class', 'task-list-item' + (!disableCheckboxes ? ' enabled' : ''));\n\t\t\t\tattrSet(tokens[parentToken(tokens, i-2)], 'class', 'contains-task-list');\n\t\t\t}\n\t\t}\n\t});\n};\n\nfunction attrSet(token, name, value) {\n\tvar index = token.attrIndex(name);\n\tvar attr = [name, value];\n\n\tif (index < 0) {\n\t\ttoken.attrPush(attr);\n\t} else {\n\t\ttoken.attrs[index] = attr;\n\t}\n}\n\nfunction parentToken(tokens, index) {\n\tvar targetLevel = tokens[index].level - 1;\n\tfor (var i = index - 1; i >= 0; i--) {\n\t\tif (tokens[i].level === targetLevel) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}\n\nfunction isTodoItem(tokens, index) {\n\treturn isInline(tokens[index]) &&\n\t isParagraph(tokens[index - 1]) &&\n\t isListItem(tokens[index - 2]) &&\n\t startsWithTodoMarkdown(tokens[index]);\n}\n\nfunction todoify(token, TokenConstructor) {\n\ttoken.children.unshift(makeCheckbox(token, TokenConstructor));\n\ttoken.children[1].content = token.children[1].content.slice(3);\n\ttoken.content = token.content.slice(3);\n\n\tif (useLabelWrapper) {\n\t\tif (useLabelAfter) {\n\t\t\ttoken.children.pop();\n\n\t\t\t// Use large random number as id property of the checkbox.\n\t\t\tvar id = 'task-item-' + Math.ceil(Math.random() * (10000 * 1000) - 1000);\n\t\t\ttoken.children[0].content = token.children[0].content.slice(0, -1) + ' id=\"' + id + '\">';\n\t\t\ttoken.children.push(afterLabel(token.content, id, TokenConstructor));\n\t\t} else {\n\t\t\ttoken.children.unshift(beginLabel(TokenConstructor));\n\t\t\ttoken.children.push(endLabel(TokenConstructor));\n\t\t}\n\t}\n}\n\nfunction makeCheckbox(token, TokenConstructor) {\n\tvar checkbox = new TokenConstructor('html_inline', '', 0);\n\tvar disabledAttr = disableCheckboxes ? ' disabled=\"\" ' : '';\n\tif (token.content.indexOf('[ ] ') === 0) {\n\t\tcheckbox.content = '')); // false\n*/\nfunction isElement(value) {\n\treturn isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n}\n//#endregion\nexport { isElement };\n", "import { isBuffer } from \"../../predicate/isBuffer.mjs\";\nimport { isArrayLike } from \"./isArrayLike.mjs\";\nimport { isArguments } from \"./isArguments.mjs\";\nimport { isPrototype } from \"../_internal/isPrototype.mjs\";\nimport { isTypedArray } from \"./isTypedArray.mjs\";\n//#region src/compat/predicate/isEmpty.ts\n/**\n* Checks if a given value is empty.\n*\n* - If the given value is a string, checks if it is an empty string.\n* - If the given value is an array, `Map`, or `Set`, checks if its size is 0.\n* - If the given value is an [array-like object](../predicate/isArrayLike.md), checks if its length is 0.\n* - If the given value is an object, checks if it is an empty object with no properties.\n* - Primitive values (booleans, numbers, or bigints) are considered empty.\n*\n* @param [value] - The value to check.\n* @returns `true` if the value is empty, `false` otherwise.\n*\n* @example\n* isEmpty(); // true\n* isEmpty(null); // true\n* isEmpty(\"\"); // true\n* isEmpty([]); // true\n* isEmpty({}); // true\n* isEmpty(new Map()); // true\n* isEmpty(new Set()); // true\n* isEmpty(\"hello\"); // false\n* isEmpty([1, 2, 3]); // false\n* isEmpty({ a: 1 }); // false\n* isEmpty(new Map([[\"key\", \"value\"]])); // false\n* isEmpty(new Set([1, 2, 3])); // false\n*/\nfunction isEmpty(value) {\n\tif (value == null) return true;\n\tif (isArrayLike(value)) {\n\t\tif (typeof value.splice !== \"function\" && typeof value !== \"string\" && !isBuffer(value) && !isTypedArray(value) && !isArguments(value)) return false;\n\t\treturn value.length === 0;\n\t}\n\tif (typeof value === \"object\" || typeof value === \"function\") {\n\t\tif (value instanceof Map || value instanceof Set) return value.size === 0;\n\t\tconst keys = Object.keys(value);\n\t\tif (isPrototype(value)) return keys.filter((x) => x !== \"constructor\").length === 0;\n\t\treturn keys.length === 0;\n\t}\n\treturn true;\n}\n//#endregion\nexport { isEmpty };\n", "//#region src/function/after.ts\n/**\n* Creates a function that only executes starting from the `n`-th call.\n* The provided function will be invoked starting from the `n`-th call.\n*\n* This is particularly useful for scenarios involving events or asynchronous operations\n* where an action should occur only after a certain number of invocations.\n*\n* @template F - The type of the function to be invoked.\n* @param n - The number of calls required for `func` to execute.\n* @param func - The function to be invoked.\n* @returns A new function that:\n* - Tracks the number of calls.\n* - Invokes `func` starting from the `n`-th call.\n* - Returns `undefined` if fewer than `n` calls have been made.\n* @throws {Error} - Throws an error if `n` is negative.\n* @example\n*\n* const afterFn = after(3, () => {\n* console.log(\"called\")\n* });\n*\n* // Will not log anything.\n* afterFn()\n* // Will not log anything.\n* afterFn()\n* // Will log 'called'.\n* afterFn()\n*/\nfunction after(n, func) {\n\tif (!Number.isInteger(n) || n < 0) throw new Error(`n must be a non-negative integer.`);\n\tlet counter = 0;\n\treturn (...args) => {\n\t\tif (++counter >= n) return func(...args);\n\t};\n}\n//#endregion\nexport { after };\n", "import { after } from \"../../function/after.mjs\";\nimport { isEqualWith as isEqualWith$1 } from \"../../predicate/isEqualWith.mjs\";\n//#region src/compat/predicate/isEqualWith.ts\n/**\n* Compares two values for equality using a custom comparison function.\n*\n* The custom function allows for fine-tuned control over the comparison process. If it returns a boolean, that result determines the equality. If it returns undefined, the function falls back to the default equality comparison.\n*\n* This function also uses the custom equality function to compare values inside objects,\n* arrays, maps, sets, and other complex structures, ensuring a deep comparison.\n*\n* This approach provides flexibility in handling complex comparisons while maintaining efficient default behavior for simpler cases.\n*\n* The custom comparison function can take up to six parameters:\n* - `x`: The value from the first object `a`.\n* - `y`: The value from the second object `b`.\n* - `property`: The property key used to get `x` and `y`.\n* - `xParent`: The parent of the first value `x`.\n* - `yParent`: The parent of the second value `y`.\n* - `stack`: An internal stack (Map) to handle circular references.\n*\n* @param a - The first value to compare.\n* @param b - The second value to compare.\n* @param [areValuesEqual=noop] - A function to customize the comparison.\n* If it returns a boolean, that result will be used. If it returns undefined,\n* the default equality comparison will be used.\n* @returns `true` if the values are equal according to the customizer, otherwise `false`.\n*\n* @example\n* const customizer = (a, b) => {\n* if (typeof a === 'string' && typeof b === 'string') {\n* return a.toLowerCase() === b.toLowerCase();\n* }\n* };\n* isEqualWith('Hello', 'hello', customizer); // true\n* isEqualWith({ a: 'Hello' }, { a: 'hello' }, customizer); // true\n* isEqualWith([1, 2, 3], [1, 2, 3], customizer); // true\n*/\nfunction isEqualWith(a, b, areValuesEqual) {\n\tif (typeof areValuesEqual !== \"function\") areValuesEqual = () => void 0;\n\treturn isEqualWith$1(a, b, (...args) => {\n\t\tconst result = areValuesEqual(...args);\n\t\tif (result !== void 0) return Boolean(result);\n\t\tif (a instanceof Map && b instanceof Map) return isEqualWith(Array.from(a), Array.from(b), after(2, areValuesEqual));\n\t\tif (a instanceof Set && b instanceof Set) return isEqualWith(Array.from(a), Array.from(b), after(2, areValuesEqual));\n\t});\n}\n//#endregion\nexport { isEqualWith };\n", "//#region src/string/upperFirst.ts\n/**\n* Converts the first character of string to upper case.\n*\n* @param str - The string that is to be changed\n* @returns The converted string.\n*\n* @example\n* const convertedStr1 = upperFirst('fred') // returns 'Fred'\n* const convertedStr2 = upperFirst('Fred') // returns 'Fred'\n* const convertedStr3 = upperFirst('FRED') // returns 'FRED'\n*/\nfunction upperFirst(str) {\n\treturn str.substring(0, 1).toUpperCase() + str.substring(1);\n}\n//#endregion\nexport { upperFirst };\n", "import { upperFirst as upperFirst$1 } from \"../../string/upperFirst.mjs\";\nimport { toString } from \"../util/toString.mjs\";\n//#region src/compat/string/upperFirst.ts\n/**\n* Converts the first character of string to upper case.\n*\n* @param str - The string that is to be changed\n* @returns The converted string.\n*\n* @example\n* const convertedStr1 = upperFirst('fred') // returns 'Fred'\n* const convertedStr2 = upperFirst('Fred') // returns 'Fred'\n* const convertedStr3 = upperFirst('FRED') // returns 'FRED'\n*/\nfunction upperFirst(str) {\n\treturn upperFirst$1(toString(str));\n}\n//#endregion\nexport { upperFirst };\n", "/**\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\nimport { cloneDeepWith, isElement, isFunction, isObject, isPlainObject, isString, merge } from \"es-toolkit/compat\";\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* A helper (module) giving an access to the global DOM objects such as `window` and\n* `document`. Accessing these objects using this helper allows easy and bulletproof\n* testing, i.e. stubbing native properties:\n*\n* ```ts\n* import { global } from 'ckeditor5';\n*\n* // This stub will work for any code using global module.\n* vi.spyOn( global, 'window', 'get' ).mockReturnValue( {\n* \tinnerWidth: 10000\n* } );\n*\n* console.log( global.window.innerWidth );\n* ```\n*/\nlet globalVar;\ntry {\n\tglobalVar = {\n\t\twindow,\n\t\tdocument\n\t};\n} catch {\n\t/* v8 ignore start -- @preserve */\n\tglobalVar = {\n\t\twindow: {},\n\t\tdocument: {}\n\t};\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/env\n*/\n/**\n* Safely returns `userAgent` from browser's navigator API in a lower case.\n* If navigator API is not available it will return an empty string.\n*\n* @internal\n*/\nfunction getUserAgent() {\n\ttry {\n\t\treturn navigator.userAgent.toLowerCase();\n\t} catch {\n\t\treturn \"\";\n\t}\n}\nconst userAgent = /* #__PURE__ */ getUserAgent();\n/**\n* A namespace containing environment and browser information.\n*/\nconst env = {\n\tisMac: /* #__PURE__ */ isMac(userAgent),\n\tisWindows: /* #__PURE__ */ isWindows(userAgent),\n\tisGecko: /* #__PURE__ */ isGecko(userAgent),\n\tisSafari: /* #__PURE__ */ isSafari(userAgent),\n\tisiOS: /* #__PURE__ */ isiOS(userAgent),\n\tisAndroid: /* #__PURE__ */ isAndroid(userAgent),\n\tisBlink: /* #__PURE__ */ isBlink(userAgent),\n\tget isMediaForcedColors() {\n\t\treturn isMediaForcedColors();\n\t},\n\tget isMotionReduced() {\n\t\treturn isMotionReduced();\n\t},\n\tfeatures: { isRegExpUnicodePropertySupported: /* #__PURE__ */ isRegExpUnicodePropertySupported() }\n};\n/**\n* Checks if User Agent represented by the string is running on Macintosh.\n*\n* @internal\n* @param userAgent **Lowercase** `navigator.userAgent` string.\n* @returns Whether User Agent is running on Macintosh or not.\n*/\nfunction isMac(userAgent) {\n\treturn userAgent.indexOf(\"macintosh\") > -1;\n}\n/**\n* Checks if User Agent represented by the string is running on Windows.\n*\n* @internal\n* @param userAgent **Lowercase** `navigator.userAgent` string.\n* @returns Whether User Agent is running on Windows or not.\n*/\nfunction isWindows(userAgent) {\n\treturn userAgent.indexOf(\"windows\") > -1;\n}\n/**\n* Checks if User Agent represented by the string is Firefox (Gecko).\n*\n* @internal\n* @param userAgent **Lowercase** `navigator.userAgent` string.\n* @returns Whether User Agent is Firefox or not.\n*/\nfunction isGecko(userAgent) {\n\treturn !!userAgent.match(/gecko\\/\\d+/);\n}\n/**\n* Checks if User Agent represented by the string is Safari.\n*\n* @internal\n* @param userAgent **Lowercase** `navigator.userAgent` string.\n* @returns Whether User Agent is Safari or not.\n*/\nfunction isSafari(userAgent) {\n\treturn userAgent.indexOf(\" applewebkit/\") > -1 && userAgent.indexOf(\"chrome\") === -1;\n}\n/**\n* Checks if User Agent represented by the string is running in iOS.\n*\n* @internal\n* @param userAgent **Lowercase** `navigator.userAgent` string.\n* @returns Whether User Agent is running in iOS or not.\n*/\nfunction isiOS(userAgent) {\n\treturn !!userAgent.match(/iphone|ipad/i) || isMac(userAgent) && navigator.maxTouchPoints > 0;\n}\n/**\n* Checks if User Agent represented by the string is Android mobile device.\n*\n* @internal\n* @param userAgent **Lowercase** `navigator.userAgent` string.\n* @returns Whether User Agent is Safari or not.\n*/\nfunction isAndroid(userAgent) {\n\treturn userAgent.indexOf(\"android\") > -1;\n}\n/**\n* Checks if User Agent represented by the string is Blink engine.\n*\n* @internal\n* @param userAgent **Lowercase** `navigator.userAgent` string.\n* @returns Whether User Agent is Blink engine or not.\n*/\nfunction isBlink(userAgent) {\n\treturn userAgent.indexOf(\"chrome/\") > -1 && userAgent.indexOf(\"edge/\") < 0;\n}\n/**\n* Checks if the current environment supports ES2018 Unicode properties like `\\p{P}` or `\\p{L}`.\n* More information about unicode properties might be found\n* [in Unicode Standard Annex #44](https://www.unicode.org/reports/tr44/#GC_Values_Table).\n*\n* @internal\n*/\nfunction isRegExpUnicodePropertySupported() {\n\tlet isSupported = false;\n\ttry {\n\t\tisSupported = \"\u0107\".search(new RegExp(\"[\\\\p{L}]\", \"u\")) === 0;\n\t} catch {}\n\treturn isSupported;\n}\n/**\n* Checks if the user agent has enabled a forced colors mode (e.g. Windows High Contrast mode).\n*\n* Returns `false` in environments where `window` global object is not available.\n*\n* @internal\n*/\nfunction isMediaForcedColors() {\n\treturn globalVar.window.matchMedia ? globalVar.window.matchMedia(\"(forced-colors: active)\").matches : false;\n}\n/**\n* Checks if the user enabled \"prefers reduced motion\" setting in browser.\n*\n* Returns `false` in environments where `window` global object is not available.\n*\n* @internal\n*/\nfunction isMotionReduced() {\n\treturn globalVar.window.matchMedia ? globalVar.window.matchMedia(\"(prefers-reduced-motion)\").matches : false;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* Finds positions of the first and last change in the given string/array and generates a set of changes:\n*\n* ```ts\n* fastDiff( '12a', '12xyza' );\n* // [ { index: 2, type: 'insert', values: [ 'x', 'y', 'z' ] } ]\n*\n* fastDiff( '12a', '12aa' );\n* // [ { index: 3, type: 'insert', values: [ 'a' ] } ]\n*\n* fastDiff( '12xyza', '12a' );\n* // [ { index: 2, type: 'delete', howMany: 3 } ]\n*\n* fastDiff( [ '1', '2', 'a', 'a' ], [ '1', '2', 'a' ] );\n* // [ { index: 3, type: 'delete', howMany: 1 } ]\n*\n* fastDiff( [ '1', '2', 'a', 'b', 'c', '3' ], [ '2', 'a', 'b' ] );\n* // [ { index: 0, type: 'insert', values: [ '2', 'a', 'b' ] }, { index: 3, type: 'delete', howMany: 6 } ]\n* ```\n*\n* Passed arrays can contain any type of data, however to compare them correctly custom comparator function\n* should be passed as a third parameter:\n*\n* ```ts\n* fastDiff( [ { value: 1 }, { value: 2 } ], [ { value: 1 }, { value: 3 } ], ( a, b ) => {\n* \treturn a.value === b.value;\n* } );\n* // [ { index: 1, type: 'insert', values: [ { value: 3 } ] }, { index: 2, type: 'delete', howMany: 1 } ]\n* ```\n*\n* The resulted set of changes can be applied to the input in order to transform it into the output, for example:\n*\n* ```ts\n* let input = '12abc3';\n* const output = '2ab';\n* const changes = fastDiff( input, output );\n*\n* changes.forEach( change => {\n* \tif ( change.type == 'insert' ) {\n* \t\tinput = input.substring( 0, change.index ) + change.values.join( '' ) + input.substring( change.index );\n* \t} else if ( change.type == 'delete' ) {\n* \t\tinput = input.substring( 0, change.index ) + input.substring( change.index + change.howMany );\n* \t}\n* } );\n*\n* // input equals output now\n* ```\n*\n* or in case of arrays:\n*\n* ```ts\n* let input = [ '1', '2', 'a', 'b', 'c', '3' ];\n* const output = [ '2', 'a', 'b' ];\n* const changes = fastDiff( input, output );\n*\n* changes.forEach( change => {\n* \tif ( change.type == 'insert' ) {\n* \t\tinput = input.slice( 0, change.index ).concat( change.values, input.slice( change.index ) );\n* \t} else if ( change.type == 'delete' ) {\n* \t\tinput = input.slice( 0, change.index ).concat( input.slice( change.index + change.howMany ) );\n* \t}\n* } );\n*\n* // input equals output now\n* ```\n*\n* By passing `true` as the fourth parameter (`atomicChanges`) the output of this function will become compatible with\n* the {@link module:utils/diff~diff `diff()`} function:\n*\n* ```ts\n* fastDiff( '12a', '12xyza', undefined, true );\n* // [ 'equal', 'equal', 'insert', 'insert', 'insert', 'equal' ]\n* ```\n*\n* The default output format of this function is compatible with the output format of\n* {@link module:utils/difftochanges~diffToChanges `diffToChanges()`}. The `diffToChanges()` input format is, in turn,\n* compatible with the output of {@link module:utils/diff~diff `diff()`}:\n*\n* ```ts\n* const a = '1234';\n* const b = '12xyz34';\n*\n* // Both calls will return the same results (grouped changes format).\n* fastDiff( a, b );\n* diffToChanges( diff( a, b ) );\n*\n* // Again, both calls will return the same results (atomic changes format).\n* fastDiff( a, b, undefined, true );\n* diff( a, b );\n* ```\n*\n* @typeParam T The type of array elements.\n* @typeParam AtomicChanges The type of `atomicChanges` parameter (selects the result type).\n* @param a Input array or string.\n* @param b Input array or string.\n* @param cmp Optional function used to compare array values, by default `===` (strict equal operator) is used.\n* @param atomicChanges Whether an array of `inset|delete|equal` operations should\n* be returned instead of changes set. This makes this function compatible with {@link module:utils/diff~diff `diff()`}.\n* Defaults to `false`.\n* @returns Array of changes. The elements are either {@link module:utils/diff~DiffResult} or {@link module:utils/difftochanges~Change},\n* depending on `atomicChanges` parameter.\n*/\nfunction fastDiff(a, b, cmp, atomicChanges) {\n\tcmp = cmp || function(a, b) {\n\t\treturn a === b;\n\t};\n\tconst arrayA = Array.isArray(a) ? a : Array.prototype.slice.call(a);\n\tconst arrayB = Array.isArray(b) ? b : Array.prototype.slice.call(b);\n\tconst changeIndexes = findChangeBoundaryIndexes(arrayA, arrayB, cmp);\n\treturn atomicChanges ? changeIndexesToAtomicChanges(changeIndexes, arrayB.length) : changeIndexesToChanges(arrayB, changeIndexes);\n}\n/**\n* Finds position of the first and last change in the given arrays. For example:\n*\n* ```ts\n* const indexes = findChangeBoundaryIndexes( [ '1', '2', '3', '4' ], [ '1', '3', '4', '2', '4' ] );\n* console.log( indexes ); // { firstIndex: 1, lastIndexOld: 3, lastIndexNew: 4 }\n* ```\n*\n* The above indexes means that in the first array the modified part is `1[23]4` and in the second array it is `1[342]4`.\n* Based on such indexes, array with `insert`/`delete` operations which allows transforming first value into the second one\n* can be generated.\n*/\nfunction findChangeBoundaryIndexes(arr1, arr2, cmp) {\n\tconst firstIndex = findFirstDifferenceIndex(arr1, arr2, cmp);\n\tif (firstIndex === -1) return {\n\t\tfirstIndex: -1,\n\t\tlastIndexOld: -1,\n\t\tlastIndexNew: -1\n\t};\n\tconst lastIndex = findFirstDifferenceIndex(cutAndReverse(arr1, firstIndex), cutAndReverse(arr2, firstIndex), cmp);\n\treturn {\n\t\tfirstIndex,\n\t\tlastIndexOld: arr1.length - lastIndex,\n\t\tlastIndexNew: arr2.length - lastIndex\n\t};\n}\n/**\n* Returns a first index on which given arrays differ. If both arrays are the same, -1 is returned.\n*/\nfunction findFirstDifferenceIndex(arr1, arr2, cmp) {\n\tfor (let i = 0; i < Math.max(arr1.length, arr2.length); i++) if (arr1[i] === void 0 || arr2[i] === void 0 || !cmp(arr1[i], arr2[i])) return i;\n\treturn -1;\n}\n/**\n* Returns a copy of the given array with `howMany` elements removed starting from the beginning and in reversed order.\n*\n* @param arr Array to be processed.\n* @param howMany How many elements from array beginning to remove.\n* @returns Shortened and reversed array.\n*/\nfunction cutAndReverse(arr, howMany) {\n\treturn arr.slice(howMany).reverse();\n}\n/**\n* Generates changes array based on change indexes from `findChangeBoundaryIndexes` function. This function will\n* generate array with 0 (no changes), 1 (deletion or insertion) or 2 records (insertion and deletion).\n*\n* @param newArray New array for which change indexes were calculated.\n* @param changeIndexes Change indexes object from `findChangeBoundaryIndexes` function.\n* @returns Array of changes compatible with {@link module:utils/difftochanges~diffToChanges} format.\n*/\nfunction changeIndexesToChanges(newArray, changeIndexes) {\n\tconst result = [];\n\tconst { firstIndex, lastIndexOld, lastIndexNew } = changeIndexes;\n\tif (lastIndexNew - firstIndex > 0) result.push({\n\t\tindex: firstIndex,\n\t\ttype: \"insert\",\n\t\tvalues: newArray.slice(firstIndex, lastIndexNew)\n\t});\n\tif (lastIndexOld - firstIndex > 0) result.push({\n\t\tindex: firstIndex + (lastIndexNew - firstIndex),\n\t\ttype: \"delete\",\n\t\thowMany: lastIndexOld - firstIndex\n\t});\n\treturn result;\n}\n/**\n* Generates array with set `equal|insert|delete` operations based on change indexes from `findChangeBoundaryIndexes` function.\n*\n* @param changeIndexes Change indexes object from `findChangeBoundaryIndexes` function.\n* @param newLength Length of the new array on which `findChangeBoundaryIndexes` calculated change indexes.\n* @returns Array of changes compatible with {@link module:utils/diff~diff} format.\n*/\nfunction changeIndexesToAtomicChanges(changeIndexes, newLength) {\n\tconst { firstIndex, lastIndexOld, lastIndexNew } = changeIndexes;\n\tif (firstIndex === -1) return Array(newLength).fill(\"equal\");\n\tlet result = [];\n\tif (firstIndex > 0) result = result.concat(Array(firstIndex).fill(\"equal\"));\n\tif (lastIndexNew - firstIndex > 0) result = result.concat(Array(lastIndexNew - firstIndex).fill(\"insert\"));\n\tif (lastIndexOld - firstIndex > 0) result = result.concat(Array(lastIndexOld - firstIndex).fill(\"delete\"));\n\tif (lastIndexNew < newLength) result = result.concat(Array(newLength - lastIndexNew).fill(\"equal\"));\n\treturn result;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/diff\n*/\n/**\n* Calculates the difference between two arrays or strings producing an array containing a list of changes\n* necessary to transform input into output.\n*\n* ```ts\n* diff( 'aba', 'acca' ); // [ 'equal', 'insert', 'insert', 'delete', 'equal' ]\n* ```\n*\n* This function is based on the \"O(NP) Sequence Comparison Algorithm\" by Sun Wu, Udi Manber, Gene Myers, Webb Miller.\n* Unfortunately, while it gives the most precise results, its to complex for longer strings/arrow (above 200 items).\n* Therefore, `diff()` automatically switches to {@link module:utils/fastdiff~fastDiff `fastDiff()`} when detecting\n* such a scenario. The return formats of both functions are identical.\n*\n* @param a Input array or string.\n* @param b Output array or string.\n* @param cmp Optional function used to compare array values, by default === is used.\n* @returns Array of changes.\n*/\nconst diff = function(a, b, cmp) {\n\tcmp = cmp || function(a, b) {\n\t\treturn a === b;\n\t};\n\tconst aLength = a.length;\n\tconst bLength = b.length;\n\tif (aLength > 200 || bLength > 200 || aLength + bLength > 300) return diff.fastDiff(a, b, cmp, true);\n\tlet _insert, _delete;\n\tif (bLength < aLength) {\n\t\tconst tmp = a;\n\t\ta = b;\n\t\tb = tmp;\n\t\t_insert = \"delete\";\n\t\t_delete = \"insert\";\n\t} else {\n\t\t_insert = \"insert\";\n\t\t_delete = \"delete\";\n\t}\n\tconst m = a.length;\n\tconst n = b.length;\n\tconst delta = n - m;\n\tconst es = {};\n\tconst fp = {};\n\tfunction snake(k) {\n\t\tconst y1 = (fp[k - 1] !== void 0 ? fp[k - 1] : -1) + 1;\n\t\tconst y2 = fp[k + 1] !== void 0 ? fp[k + 1] : -1;\n\t\tconst dir = y1 > y2 ? -1 : 1;\n\t\tif (es[k + dir]) es[k] = es[k + dir].slice(0);\n\t\tif (!es[k]) es[k] = [];\n\t\tes[k].push(y1 > y2 ? _insert : _delete);\n\t\tlet y = Math.max(y1, y2);\n\t\tlet x = y - k;\n\t\twhile (x < m && y < n && cmp(a[x], b[y])) {\n\t\t\tx++;\n\t\t\ty++;\n\t\t\tes[k].push(\"equal\");\n\t\t}\n\t\treturn y;\n\t}\n\tlet p = 0;\n\tlet k;\n\tdo {\n\t\tfor (k = -p; k < delta; k++) fp[k] = snake(k);\n\t\tfor (k = delta + p; k > delta; k--) fp[k] = snake(k);\n\t\tfp[delta] = snake(delta);\n\t\tp++;\n\t} while (fp[delta] !== n);\n\treturn es[delta].slice(1);\n};\ndiff.fastDiff = fastDiff;\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* Creates a set of changes which need to be applied to the input in order to transform\n* it into the output. This function can be used with strings or arrays.\n*\n* ```ts\n* const input = Array.from( 'abc' );\n* const output = Array.from( 'xaby' );\n* const changes = diffToChanges( diff( input, output ), output );\n*\n* changes.forEach( change => {\n* \tif ( change.type == 'insert' ) {\n* \t\tinput.splice( change.index, 0, ...change.values );\n* \t} else if ( change.type == 'delete' ) {\n* \t\tinput.splice( change.index, change.howMany );\n* \t}\n* } );\n*\n* input.join( '' ) == output.join( '' ); // -> true\n* ```\n*\n* @typeParam T The type of output array element.\n* @param diff Result of {@link module:utils/diff~diff}.\n* @param output The string or array which was passed as diff's output.\n* @returns Set of changes (insert or delete) which need to be applied to the input\n* in order to transform it into the output.\n*/\nfunction diffToChanges(diff, output) {\n\tconst changes = [];\n\tlet index = 0;\n\tlet lastOperation = null;\n\tdiff.forEach((change) => {\n\t\tif (change == \"equal\") {\n\t\t\tpushLast();\n\t\t\tindex++;\n\t\t} else if (change == \"insert\") {\n\t\t\tif (lastOperation && lastOperation.type == \"insert\") lastOperation.values.push(output[index]);\n\t\t\telse {\n\t\t\t\tpushLast();\n\t\t\t\tlastOperation = {\n\t\t\t\t\ttype: \"insert\",\n\t\t\t\t\tindex,\n\t\t\t\t\tvalues: [output[index]]\n\t\t\t\t};\n\t\t\t}\n\t\t\tindex++;\n\t\t} else if (lastOperation && lastOperation.type == \"delete\") lastOperation.howMany++;\n\t\telse {\n\t\t\tpushLast();\n\t\t\tlastOperation = {\n\t\t\t\ttype: \"delete\",\n\t\t\t\tindex,\n\t\t\t\thowMany: 1\n\t\t\t};\n\t\t}\n\t});\n\tpushLast();\n\treturn changes;\n\tfunction pushLast() {\n\t\tif (lastOperation) {\n\t\t\tchanges.push(lastOperation);\n\t\t\tlastOperation = null;\n\t\t}\n\t}\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/areconnectedthroughproperties\n*/\n/**\n* Traverses both structures to find out whether there is a reference that is shared between both structures.\n*/\nfunction areConnectedThroughProperties(obj1, obj2) {\n\tif (obj1 === obj2 && isObject$1(obj1)) return true;\n\tconst subNodes1 = getSubNodes(obj1);\n\tconst subNodes2 = getSubNodes(obj2);\n\tfor (const node of subNodes1) if (subNodes2.has(node)) return true;\n\treturn false;\n}\n/**\n* Traverses JS structure and stores all sub-nodes, including the head node.\n* It walks into each iterable structures with the `try catch` block to omit errors that might be thrown during\n* tree walking. All primitives, functions and built-ins are skipped.\n*/\nfunction getSubNodes(head) {\n\tconst nodes = [head];\n\tconst subNodes = /* @__PURE__ */ new Set();\n\twhile (nodes.length > 0) {\n\t\tconst node = nodes.shift();\n\t\tif (subNodes.has(node) || shouldNodeBeSkipped(node)) continue;\n\t\tsubNodes.add(node);\n\t\tif (node[Symbol.iterator]) try {\n\t\t\tnodes.push(...node);\n\t\t} catch {}\n\t\telse nodes.push(...Object.values(node));\n\t}\n\treturn subNodes;\n}\nfunction shouldNodeBeSkipped(node) {\n\tconst type = Object.prototype.toString.call(node);\n\treturn type === \"[object Number]\" || type === \"[object Boolean]\" || type === \"[object String]\" || type === \"[object Symbol]\" || type === \"[object Function]\" || type === \"[object Date]\" || type === \"[object RegExp]\" || node === void 0 || node === null || node instanceof EventTarget || node instanceof Event;\n}\nfunction isObject$1(structure) {\n\treturn typeof structure === \"object\" && structure !== null;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/spy\n*/\n/**\n* Creates a spy function (ala Sinon.js) that can be used to inspect call to it.\n*\n* The following are the present features:\n*\n* * spy.called: property set to `true` if the function has been called at least once.\n*\n* @returns The spy function.\n*/\nfunction spy() {\n\treturn function spy() {\n\t\tspy.called = true;\n\t};\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/eventinfo\n*/\n/**\n* The event object passed to event callbacks. It is used to provide information about the event as well as a tool to\n* manipulate it.\n*/\nvar EventInfo = class {\n\t/**\n\t* The object that fired the event.\n\t*/\n\tsource;\n\t/**\n\t* The event name.\n\t*/\n\tname;\n\t/**\n\t* Path this event has followed. See {@link module:utils/emittermixin~Emitter#delegate}.\n\t*/\n\tpath;\n\t/**\n\t* Stops the event emitter to call further callbacks for this event interaction.\n\t*/\n\tstop;\n\t/**\n\t* Removes the current callback from future interactions of this event.\n\t*/\n\toff;\n\t/**\n\t* The value which will be returned by {@link module:utils/emittermixin~Emitter#fire}.\n\t*\n\t* It's `undefined` by default and can be changed by an event listener:\n\t*\n\t* ```ts\n\t* dataController.fire( 'getSelectedContent', ( evt ) => {\n\t* \t// This listener will make `dataController.fire( 'getSelectedContent' )`\n\t* \t// always return an empty DocumentFragment.\n\t* \tevt.return = new DocumentFragment();\n\t*\n\t* \t// Make sure no other listeners are executed.\n\t* \tevt.stop();\n\t* } );\n\t* ```\n\t*/\n\treturn;\n\t/**\n\t* @param source The emitter.\n\t* @param name The event name.\n\t*/\n\tconstructor(source, name) {\n\t\tthis.source = source;\n\t\tthis.name = name;\n\t\tthis.path = [];\n\t\tthis.stop = spy();\n\t\tthis.off = spy();\n\t}\n};\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/uid\n*/\n/**\n* A hash table of hex numbers to avoid using toString() in uid() which is costly.\n* [ '00', '01', '02', ..., 'fe', 'ff' ]\n*/\nconst HEX_NUMBERS = new Array(256).fill(\"\").map((_, index) => (\"0\" + index.toString(16)).slice(-2));\n/**\n* Returns a unique id. The id starts with an \"e\" character and a randomly generated string of\n* 32 alphanumeric characters.\n*\n* **Note**: The characters the unique id is built from correspond to the hex number notation\n* (from \"0\" to \"9\", from \"a\" to \"f\"). In other words, each id corresponds to an \"e\" followed\n* by 16 8-bit numbers next to each other.\n*\n* @returns An unique id string.\n*/\nfunction uid() {\n\tconst [r1, r2, r3, r4] = crypto.getRandomValues(/* @__PURE__ */ new Uint32Array(4));\n\treturn \"e\" + HEX_NUMBERS[r1 >> 0 & 255] + HEX_NUMBERS[r1 >> 8 & 255] + HEX_NUMBERS[r1 >> 16 & 255] + HEX_NUMBERS[r1 >> 24 & 255] + HEX_NUMBERS[r2 >> 0 & 255] + HEX_NUMBERS[r2 >> 8 & 255] + HEX_NUMBERS[r2 >> 16 & 255] + HEX_NUMBERS[r2 >> 24 & 255] + HEX_NUMBERS[r3 >> 0 & 255] + HEX_NUMBERS[r3 >> 8 & 255] + HEX_NUMBERS[r3 >> 16 & 255] + HEX_NUMBERS[r3 >> 24 & 255] + HEX_NUMBERS[r4 >> 0 & 255] + HEX_NUMBERS[r4 >> 8 & 255] + HEX_NUMBERS[r4 >> 16 & 255] + HEX_NUMBERS[r4 >> 24 & 255];\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* Provides group of constants to use instead of hardcoding numeric priority values.\n*/\nconst priorities = {\n\tget(priority = \"normal\") {\n\t\tif (typeof priority != \"number\") return this[priority] || this.normal;\n\t\telse return priority;\n\t},\n\thighest: 1e5,\n\thigh: 1e3,\n\tnormal: 0,\n\tlow: -1e3,\n\tlowest: -1e5\n};\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/inserttopriorityarray\n*/\n/**\n* Inserts any object with priority at correct index by priority so registered objects are always sorted from highest to lowest priority.\n*\n* @param objects Array of objects with priority to insert object to.\n* @param objectToInsert Object with `priority` property.\n*/\nfunction insertToPriorityArray(objects, objectToInsert) {\n\tconst priority = priorities.get(objectToInsert.priority);\n\tlet left = 0;\n\tlet right = objects.length;\n\twhile (left < right) {\n\t\tconst mid = left + right >> 1;\n\t\tif (priorities.get(objects[mid].priority) < priority) right = mid;\n\t\telse left = mid + 1;\n\t}\n\tobjects.splice(left, 0, objectToInsert);\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/ckeditorerror\n*/\n/**\n* URL to the documentation with error codes.\n*/\nconst DOCUMENTATION_URL = \"https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html\";\n/**\n* The CKEditor error class.\n*\n* You should throw `CKEditorError` when:\n*\n* * An unexpected situation occurred and the editor (most probably) will not work properly. Such exception will be\n* reported to the callbacks registered with {@link module:core/errorreporter~onEditorError `onEditorError()`},\n* * If the editor is incorrectly integrated or the editor API is used in the wrong way. This way you will give\n* feedback to the developer as soon as possible. Keep in mind that for common integration issues which should not\n* stop editor initialization (like missing upload adapter, wrong name of a toolbar component) we use\n* {@link module:utils/ckeditorerror~logWarning `logWarning()`} and\n* {@link module:utils/ckeditorerror~logError `logError()`}\n* to improve developers experience and let them see the a working editor as soon as possible.\n*\n* ```ts\n* /**\n* * Error thrown when a plugin cannot be loaded due to JavaScript errors, lack of plugins with a given name, etc.\n* *\n* * @error plugin-load\n* * @param pluginName The name of the plugin that could not be loaded.\n* * @param moduleName The name of the module which tried to load this plugin.\n* *\\/\n* throw new CKEditorError( 'plugin-load', {\n* \tpluginName: 'foo',\n* \tmoduleName: 'bar'\n* } );\n* ```\n*/\nvar CKEditorError = class CKEditorError extends Error {\n\t/**\n\t* A context of the error by which error reporting works out which editor the error came from.\n\t*/\n\tcontext;\n\t/**\n\t* The additional error data passed to the constructor. Undefined if none was passed.\n\t*/\n\tdata;\n\t/**\n\t* Creates an instance of the CKEditorError class.\n\t*\n\t* @param errorName The error id in an `error-name` format. A link to this error documentation page will be added\n\t* to the thrown error's `message`.\n\t* @param context A context of the error by which {@link module:core/errorreporter~onEditorError error reporting}\n\t* works out which editor the error came from. Pass the editor, the context, or the plugin or command that throws the error.\n\t* Pass `null` if the error should not be attributed to any editor (e.g. during the editor initialization).\n\t* @param data Additional data describing the error. A stringified version of this object\n\t* will be appended to the error message, so the data are quickly visible in the console. The original\n\t* data object will also be later available under the {@link #data} property.\n\t* @param originalError An optional original error that is being wrapped in the `CKEditorError` instance.\n\t*/\n\tconstructor(errorName, context, data, originalError) {\n\t\tsuper(getErrorMessage(errorName, data, originalError));\n\t\tthis.name = \"CKEditorError\";\n\t\tthis.context = context;\n\t\tthis.data = data;\n\t\tif (originalError) this.stack = originalError.stack;\n\t}\n\t/**\n\t* Checks if the error is of the `CKEditorError` type.\n\t*/\n\tis(type) {\n\t\treturn type === \"CKEditorError\";\n\t}\n\t/**\n\t* A utility that ensures that the thrown error is a {@link module:utils/ckeditorerror~CKEditorError} one.\n\t* Only a {@link module:utils/ckeditorerror~CKEditorError} is reported to the callbacks registered with\n\t* {@link module:core/errorreporter~onEditorError `onEditorError()`}, so wrapping an unexpected error in one is what\n\t* makes it reach them.\n\t*\n\t* @param error The error to rethrow.\n\t* @param context An object connected through properties with the editor instance. This context is what error\n\t* reporting uses to work out which editor the error came from.\n\t*/\n\tstatic rethrowUnexpectedError(error, context) {\n\t\tif (error.is && error.is(\"CKEditorError\")) throw error;\n\t\t/**\n\t\t* An unexpected error occurred inside the CKEditor 5 codebase. This error will look like the original one\n\t\t* to make the debugging easier.\n\t\t*\n\t\t* Like any {@link module:utils/ckeditorerror~CKEditorError}, it is reported to the callbacks registered with\n\t\t* {@link module:core/errorreporter~onEditorError `onEditorError()`}, naming the editor it came from.\n\t\t*\n\t\t* @error unexpected-error\n\t\t*/\n\t\tthrow new CKEditorError(\"unexpected-error\", context, void 0, error);\n\t}\n};\n/**\n* Logs a warning to the console with a properly formatted message and adds a link to the documentation.\n* Use whenever you want to log a warning to the console.\n*\n* ```ts\n* /**\n* * There was a problem processing the configuration of the toolbar. The item with the given\n* * name does not exist, so it was omitted when rendering the toolbar.\n* *\n* * @error toolbarview-item-unavailable\n* * @param {String} name The name of the component.\n* *\\/\n* logWarning( 'toolbarview-item-unavailable', { name } );\n* ```\n*\n* See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to throw an error and when to log\n* a warning or an error to the console.\n*\n* @param errorName The error name to be logged.\n* @param data Additional data to be logged.\n*/\nfunction logWarning(errorName, data) {\n\tconsole.warn(...formatConsoleArguments(errorName, data));\n}\n/**\n* Logs an error to the console with a properly formatted message and adds a link to the documentation.\n* Use whenever you want to log an error to the console.\n*\n* ```ts\n* /**\n* * There was a problem processing the configuration of the toolbar. The item with the given\n* * name does not exist, so it was omitted when rendering the toolbar.\n* *\n* * @error toolbarview-item-unavailable\n* * @param {String} name The name of the component.\n* *\\/\n* logError( 'toolbarview-item-unavailable', { name } );\n* ```\n*\n* **Note**: In most cases logging a warning using {@link module:utils/ckeditorerror~logWarning} is enough.\n*\n* See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to use each method.\n*\n* @param errorName The error name to be logged.\n* @param data Additional data to be logged.\n*/\nfunction logError(errorName, data) {\n\tconsole.error(...formatConsoleArguments(errorName, data));\n}\n/**\n* Returns formatted link to documentation message.\n*/\nfunction getLinkToDocumentationMessage(errorName) {\n\treturn `\\nRead more: ${DOCUMENTATION_URL}#error-${errorName}`;\n}\n/**\n* Returns formatted error message.\n*/\nfunction getErrorMessage(errorName, data, originalError) {\n\tconst processedObjects = /* @__PURE__ */ new WeakSet();\n\tconst circularReferencesReplacer = (key, value) => {\n\t\tif (typeof value === \"object\" && value !== null) {\n\t\t\tif (processedObjects.has(value)) return `[object ${value.constructor.name}]`;\n\t\t\tprocessedObjects.add(value);\n\t\t}\n\t\treturn value;\n\t};\n\tconst stringifiedData = data ? ` ${JSON.stringify(data, circularReferencesReplacer)}` : \"\";\n\tconst documentationLink = getLinkToDocumentationMessage(errorName);\n\tconst originalErrorMessage = originalError ? `\\nOriginal error: ${originalError.name}: ${originalError.message}` : \"\";\n\treturn errorName + stringifiedData + documentationLink + originalErrorMessage;\n}\n/**\n* Returns formatted console error arguments.\n*/\nfunction formatConsoleArguments(errorName, data) {\n\tconst documentationMessage = getLinkToDocumentationMessage(errorName);\n\treturn data ? [\n\t\terrorName,\n\t\tdata,\n\t\tdocumentationMessage\n\t] : [errorName, documentationMessage];\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/version\n*/\nconst version = \"49.0.0\";\nconst releaseDate = new Date(2026, 5, 2);\n/* v8 ignore next -- @preserve */\nif (globalThis.CKEDITOR_VERSION)\n /**\n* This error is thrown when, due to a mistake in the way CKEditor 5 was installed,\n* imported, or initialized, some of its modules were evaluated and executed twice.\n* Duplicate modules inevitably lead to runtime errors and increased bundle size.\n*\n* # Check dependency versions\n*\n* First, make sure that you use the latest version of all CKEditor 5 dependencies.\n* Depending on the installation method, you should check the versions of the `ckeditor5`,\n* `ckeditor5-premium-features`, or `@ckeditor/ckeditor5-` packages. If you cannot update\n* to the latest version, ensure that all the CKEditor 5 packages are\n* in the same version.\n*\n* If you use third-party plugins, make sure to update them, too. If they are incompatible\n* with the version of CKEditor 5 you use, you may need to downgrade the CKEditor 5 packages\n* (which we do not recommend). Ask the plugin's author to upgrade the dependencies,\n* or fork their project and update it yourself.\n*\n* # Check imports\n*\n* The next step is to look at how you import CKEditor 5 into your project.\n*\n* **The {@glink updating/nim-migration/migration-to-new-installation-methods new installation methods}\n* are designed to prevent module duplication, so if you are not using them yet, you should consider\n* updating your project**. However, several legacy installation methods are still supported for backward\n* compatibility, and mixing them may result in module duplication.\n*\n* These are the most common import methods of the CKEditor 5 packages.\n*\n* - **New installation methods (NIM)** – Imports from the `ckeditor5` and `ckeditor5-premium-features` packages.\n* - **Optimized build** for the new installation methods – Imports from the `@ckeditor/ckeditor5-/dist/index.js`.\n* - **Predefined builds** (no longer supported) – Imports from the `@ckeditor/ckeditor5-build-` packages.\n* - **Default imports** (legacy) – Imports from the `@ckeditor/ckeditor5-` packages (default export).\n* - **`src`** (legacy) – Imports from the `@ckeditor/ckeditor5-/src/*`.\n* - **DLL builds** (legacy) – Imports from the `ckeditor5/build/` and `@ckeditor/ckeditor5-/build/*`.\n*\n* The best way to avoid duplicate modules is to avoid mixing these installation methods. For example, if you use imports\n* specific to the optimized build, you should use them for all CKEditor 5 packages. In addition, since\n* the DLL builds already include the core of the editor, they cannot be used with other types of imports.\n*\n* Here is a matrix showing which installation methods are compatible with each other:\n*\n* | | NIM | Optimized build | Predefined builds | Default imports | `src` | DLL builds |\n* |------------------|-----|-----------------|-------------------|-----------------|-------|------------|\n* | NIM | \u2705 | \u2705 | \u274C | \u274C | \u274C | \u274C |\n* | Optimized builds | \u2705 | \u2705 | \u274C | \u274C | \u274C | \u274C |\n* | Predefined build | \u274C | \u274C | \u2705 | \u274C | \u274C | \u274C |\n* | Default imports | \u274C | \u274C | \u274C | \u2705 | \u2705 | \u274C |\n* | `src` | \u274C | \u274C | \u274C | \u2705 | \u2705 | \u274C |\n* | DLL builds | \u274C | \u274C | \u274C | \u274C | \u274C | \u2705 |\n*\n* If you use any third-party plugins, make sure the way you import them is compatible with\n* the way you import CKEditor 5.\n*\n*
\n* New installation methods and optimized builds\n*\n* If you use the {@glink updating/nim-migration/migration-to-new-installation-methods new installation methods},\n* you should only import { code } from the `ckeditor5` and `ckeditor5-premium-features` packages.\n* Do not import { code } from the `@ckeditor/ckeditor5-` packages unless you follow\n* the {@glink getting-started/setup/optimizing-build-size Optimizing build size} guide and the imports from\n* the `@ckeditor/ckeditor5-` packages end with `/dist/index.js`.\n*\n* If you use a CDN, ensure that some files are not included twice in your project.\n*\n* Examples of valid and invalid import paths:\n*\n* ```js\n* import { ClassicEditor, Highlight } from 'ckeditor5'; // \u2705\n* import { Highlight } from '@ckeditor/ckeditor5-highlight/dist/index.js'; // \u2705\n* import { Highlight } from '@ckeditor/ckeditor5-highlight/src/highlight.js'; // \u274C\n* import { Highlight } from '@ckeditor/ckeditor5-highlight'; // \u274C\n* import '@ckeditor/ckeditor5-highlight/build/highlight.js'; // \u274C\n* ```\n*
\n*\n*
\n* (Deprecated) Predefined builds\n*\n* **As of April, 2025 predefined build are no longer supported. Please refer to the\n* {@glink getting-started/index Quick Start} guide\n* to choose one of the modern installation and integration methods available**.\n*\n* If you use the predefined builds, you cannot import any additional plugins.\n* These builds already include the editor's core and selected plugins and importing additional\n* ones will cause some modules to be bundled and loaded twice.\n*\n* Examples of valid and invalid import paths:\n*\n* ```js\n* import { ClassicEditor } from '@ckeditor/ckeditor5-build-classic'; // \u2705\n* import { Highlight } from 'ckeditor5'; // \u274C\n* import { Highlight } from '@ckeditor/ckeditor5-highlight/dist/index.js'; // \u274C\n* import { Highlight } from '@ckeditor/ckeditor5-highlight'; // \u274C\n* import { Highlight } from '@ckeditor/ckeditor5-highlight/src/highlight'; // \u274C\n* import '@ckeditor/ckeditor5-highlight/build/highlight'; // \u274C\n* ```\n*\n* If you are missing some features from the list of plugins, you should switch to the\n* {@glink updating/nim-migration/migration-to-new-installation-methods new installation methods}\n* which do not have this limitation.\n*
\n*\n*
\n* (Legacy) Default imports and `src` imports\n*\n* If you use the legacy customized installation\n* method, you should only import code from the `@ckeditor/ckeditor5-` packages. While you can import code from\n* the `@ckeditor/ckeditor5-/src/*` files, it is not recommended as it can make migration to the new installation\n* methods more difficult.\n*\n* If you use this installation method, you should not import { code } from the `ckeditor5` or `ckeditor5-premium-features` packages.\n*\n* Examples of valid and invalid import paths:\n*\n* ```js\n* import { ClassicEditor } from '@ckeditor/ckeditor5-editor-classic'; // \u2705\n* import { Highlight } from '@ckeditor/ckeditor5-highlight'; // \u2705\n* import { Highlight } from '@ckeditor/ckeditor5-highlight/src/highlight.js'; // \u2705 (not recommended)\n* import { Highlight } from 'ckeditor5'; // \u274C\n* import { Highlight } from '@ckeditor/ckeditor5-highlight/dist/index.js'; // \u274C\n* import '@ckeditor/ckeditor5-highlight/build/highlight'; // \u274C\n* ```\n*
\n*\n*
\n* (Legacy) DLL builds\n*\n* If you are using the {@glink updating/nim-migration/dll-builds legacy DLL builds},\n* you should not import any non-DLL modules.\n*\n* Examples of valid and invalid import paths:\n*\n* ```js\n* import 'ckeditor5/build/ckeditor5-dll.js';// \u2705\n* import '@ckeditor/ckeditor5-editor-classic/build/editor-classic.js';// \u2705\n* import '@ckeditor/ckeditor5-highlight/build/highlight.js';// \u2705\n* import { Highlight } from 'ckeditor5'; // \u274C\n* import { Highlight } from '@ckeditor/ckeditor5-highlight/dist/index.js'; // \u274C\n* import { Highlight } from '@ckeditor/ckeditor5-highlight'; // \u274C\n* import { Highlight } from '@ckeditor/ckeditor5-highlight/src/highlight.js'; // \u274C\n* ```\n*
\n*\n* # Reinstall `node_modules`\n*\n* Usually, npm and other package managers deduplicate all packages - for example, `ckeditor5` is only installed once\n* in `node_modules/`. However, it is known to fail to do so occasionally.\n*\n* To rule out this possibility, you can try the following:\n*\n* 1. Remove the `node_modules` directory.\n* 2. Remove the `package-lock.json`, `yarn.lock`, or `pnpm-lock.yaml` files (depending on the package manager used).\n* 3. Run `npm install` to reinstall all packages.\n* 4. Run `npm ls` to check how many times packages like `@ckeditor/ckeditor5-core` are installed.\n* If they are installed more than once, verify which package causes that.\n*\n* @error ckeditor-duplicated-modules\n*/\nthrow new CKEditorError(\"ckeditor-duplicated-modules\", null);\nelse globalThis.CKEDITOR_VERSION = version;\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/emittermixin\n*/\nconst _listeningTo = Symbol(\"listeningTo\");\nconst _emitterId = Symbol(\"emitterId\");\nconst _delegations = Symbol(\"delegations\");\nconst defaultEmitterClass$1 = /* #__PURE__ */ EmitterMixin(Object);\nfunction EmitterMixin(base) {\n\tif (!base) return defaultEmitterClass$1;\n\tclass Mixin extends base {\n\t\ton(event, callback, options) {\n\t\t\tthis.listenTo(this, event, callback, options);\n\t\t}\n\t\tonce(event, callback, options) {\n\t\t\tlet wasFired = false;\n\t\t\tconst onceCallback = (event, ...args) => {\n\t\t\t\tif (!wasFired) {\n\t\t\t\t\twasFired = true;\n\t\t\t\t\tevent.off();\n\t\t\t\t\tcallback.call(this, event, ...args);\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis.listenTo(this, event, onceCallback, options);\n\t\t}\n\t\toff(event, callback) {\n\t\t\tthis.stopListening(this, event, callback);\n\t\t}\n\t\tlistenTo(emitter, event, callback, options = {}) {\n\t\t\tlet emitterInfo, eventCallbacks;\n\t\t\tif (!this[_listeningTo]) this[_listeningTo] = {};\n\t\t\tconst emitters = this[_listeningTo];\n\t\t\tif (!_getEmitterId(emitter)) _setEmitterId(emitter);\n\t\t\tconst emitterId = _getEmitterId(emitter);\n\t\t\tif (!(emitterInfo = emitters[emitterId])) emitterInfo = emitters[emitterId] = {\n\t\t\t\temitter,\n\t\t\t\tcallbacks: {}\n\t\t\t};\n\t\t\tif (!(eventCallbacks = emitterInfo.callbacks[event])) eventCallbacks = emitterInfo.callbacks[event] = [];\n\t\t\teventCallbacks.push(callback);\n\t\t\taddEventListener(this, emitter, event, callback, options);\n\t\t}\n\t\tstopListening(emitter, event, callback) {\n\t\t\tconst emitters = this[_listeningTo];\n\t\t\tlet emitterId = emitter && _getEmitterId(emitter);\n\t\t\tconst emitterInfo = emitters && emitterId ? emitters[emitterId] : void 0;\n\t\t\tconst eventCallbacks = emitterInfo && event ? emitterInfo.callbacks[event] : void 0;\n\t\t\tif (!emitters || emitter && !emitterInfo || event && !eventCallbacks) return;\n\t\t\tif (callback) {\n\t\t\t\tremoveEventListener(this, emitter, event, callback);\n\t\t\t\tif (eventCallbacks.indexOf(callback) !== -1) {\n\t\t\t\t\tif (eventCallbacks.length === 1) delete emitterInfo.callbacks[event];\n\t\t\t\t\telse removeEventListener(this, emitter, event, callback);\n\t\t\t\t}\n\t\t\t} else if (eventCallbacks) {\n\t\t\t\twhile (callback = eventCallbacks.pop()) removeEventListener(this, emitter, event, callback);\n\t\t\t\tdelete emitterInfo.callbacks[event];\n\t\t\t} else if (emitterInfo) {\n\t\t\t\tfor (event in emitterInfo.callbacks) this.stopListening(emitter, event);\n\t\t\t\tdelete emitters[emitterId];\n\t\t\t} else {\n\t\t\t\tfor (emitterId in emitters) this.stopListening(emitters[emitterId].emitter);\n\t\t\t\tdelete this[_listeningTo];\n\t\t\t}\n\t\t}\n\t\tfire(eventOrInfo, ...args) {\n\t\t\ttry {\n\t\t\t\tconst eventInfo = eventOrInfo instanceof EventInfo ? eventOrInfo : new EventInfo(this, eventOrInfo);\n\t\t\t\tconst event = eventInfo.name;\n\t\t\t\tlet callbacks = getCallbacksForEvent(this, event);\n\t\t\t\teventInfo.path.push(this);\n\t\t\t\tif (callbacks) {\n\t\t\t\t\tcallbacks = callbacks.slice();\n\t\t\t\t\tfor (let i = 0; i < callbacks.length; i++) {\n\t\t\t\t\t\tconst fn = callbacks[i].callback;\n\t\t\t\t\t\tfn.call(this, eventInfo, ...args);\n\t\t\t\t\t\tif (eventInfo.off.called) {\n\t\t\t\t\t\t\tdelete eventInfo.off.called;\n\t\t\t\t\t\t\tthis._removeEventListener(event, fn);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (eventInfo.stop.called) break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst delegations = this[_delegations];\n\t\t\t\tif (delegations) {\n\t\t\t\t\tconst destinations = delegations.get(event);\n\t\t\t\t\tconst passAllDestinations = delegations.get(\"*\");\n\t\t\t\t\tif (destinations) fireDelegatedEvents(destinations, eventInfo, args);\n\t\t\t\t\tif (passAllDestinations) fireDelegatedEvents(passAllDestinations, eventInfo, args);\n\t\t\t\t}\n\t\t\t\treturn eventInfo.return;\n\t\t\t} catch (err) {\n\t\t\t\t/* v8 ignore next -- @preserve */\n\t\t\t\tCKEditorError.rethrowUnexpectedError(err, this);\n\t\t\t}\n\t\t}\n\t\tdelegate(...events) {\n\t\t\treturn { to: (emitter, nameOrFunction) => {\n\t\t\t\tif (!this[_delegations]) this[_delegations] = /* @__PURE__ */ new Map();\n\t\t\t\tevents.forEach((eventName) => {\n\t\t\t\t\tconst destinations = this[_delegations].get(eventName);\n\t\t\t\t\tif (!destinations) this[_delegations].set(eventName, /* @__PURE__ */ new Map([[emitter, nameOrFunction]]));\n\t\t\t\t\telse destinations.set(emitter, nameOrFunction);\n\t\t\t\t});\n\t\t\t} };\n\t\t}\n\t\tstopDelegating(event, emitter) {\n\t\t\tif (!this[_delegations]) return;\n\t\t\tif (!event) this[_delegations].clear();\n\t\t\telse if (!emitter) this[_delegations].delete(event);\n\t\t\telse {\n\t\t\t\tconst destinations = this[_delegations].get(event);\n\t\t\t\tif (destinations) destinations.delete(emitter);\n\t\t\t}\n\t\t}\n\t\t_addEventListener(event, callback, options) {\n\t\t\tcreateEventNamespace(this, event);\n\t\t\tconst lists = getCallbacksListsForNamespace(this, event);\n\t\t\tconst callbackDefinition = {\n\t\t\t\tcallback,\n\t\t\t\tpriority: priorities.get(options.priority)\n\t\t\t};\n\t\t\tfor (const callbacks of lists) insertToPriorityArray(callbacks, callbackDefinition);\n\t\t}\n\t\t_removeEventListener(event, callback) {\n\t\t\tconst lists = getCallbacksListsForNamespace(this, event);\n\t\t\tfor (const callbacks of lists) for (let i = 0; i < callbacks.length; i++) if (callbacks[i].callback == callback) {\n\t\t\t\tcallbacks.splice(i, 1);\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\t}\n\treturn Mixin;\n}\n/**\n* Checks if `listeningEmitter` listens to an emitter with given `listenedToEmitterId` and if so, returns that emitter.\n* If not, returns `null`.\n*\n* @internal\n* @param listeningEmitter An emitter that listens.\n* @param listenedToEmitterId Unique emitter id of emitter listened to.\n*/\nfunction _getEmitterListenedTo(listeningEmitter, listenedToEmitterId) {\n\tconst listeningTo = listeningEmitter[_listeningTo];\n\tif (listeningTo && listeningTo[listenedToEmitterId]) return listeningTo[listenedToEmitterId].emitter;\n\treturn null;\n}\n/**\n* Sets emitter's unique id.\n*\n* **Note:** `_emitterId` can be set only once.\n*\n* @internal\n* @param emitter An emitter for which id will be set.\n* @param id Unique id to set. If not passed, random unique id will be set.\n*/\nfunction _setEmitterId(emitter, id) {\n\tif (!emitter[_emitterId]) emitter[_emitterId] = id || uid();\n}\n/**\n* Returns emitter's unique id.\n*\n* @internal\n* @param emitter An emitter which id will be returned.\n*/\nfunction _getEmitterId(emitter) {\n\treturn emitter[_emitterId];\n}\n/**\n* Gets the internal `_events` property of the given object.\n* `_events` property store all lists with callbacks for registered event names.\n* If there were no events registered on the object, empty `_events` object is created.\n*/\nfunction getEvents(source) {\n\tif (!source._events) Object.defineProperty(source, \"_events\", { value: {} });\n\treturn source._events;\n}\n/**\n* Creates event node for generic-specific events relation architecture.\n*/\nfunction makeEventNode() {\n\treturn {\n\t\tcallbacks: [],\n\t\tchildEvents: []\n\t};\n}\n/**\n* Creates an architecture for generic-specific events relation.\n* If needed, creates all events for given eventName, i.e. if the first registered event\n* is foo:bar:abc, it will create foo:bar:abc, foo:bar and foo event and tie them together.\n* It also copies callbacks from more generic events to more specific events when\n* specific events are created.\n*/\nfunction createEventNamespace(source, eventName) {\n\tconst events = getEvents(source);\n\tif (events[eventName]) return;\n\tlet name = eventName;\n\tlet childEventName = null;\n\tconst newEventNodes = [];\n\twhile (name !== \"\") {\n\t\tif (events[name]) break;\n\t\tevents[name] = makeEventNode();\n\t\tnewEventNodes.push(events[name]);\n\t\tif (childEventName) events[name].childEvents.push(childEventName);\n\t\tchildEventName = name;\n\t\tconst colonIndex = name.lastIndexOf(\":\");\n\t\tname = colonIndex > -1 ? name.substring(0, colonIndex) : \"\";\n\t}\n\tif (name !== \"\") {\n\t\tfor (const node of newEventNodes) node.callbacks = events[name].callbacks.slice();\n\t\tevents[name].childEvents.push(childEventName);\n\t}\n}\n/**\n* Gets an array containing callbacks list for a given event and it's more specific events.\n* I.e. if given event is foo:bar and there is also foo:bar:abc event registered, this will\n* return callback list of foo:bar and foo:bar:abc (but not foo).\n*/\nfunction getCallbacksListsForNamespace(source, eventName) {\n\tconst eventNode = getEvents(source)[eventName];\n\tif (!eventNode) return [];\n\tlet callbacksLists = [eventNode.callbacks];\n\tfor (let i = 0; i < eventNode.childEvents.length; i++) {\n\t\tconst childCallbacksLists = getCallbacksListsForNamespace(source, eventNode.childEvents[i]);\n\t\tcallbacksLists = callbacksLists.concat(childCallbacksLists);\n\t}\n\treturn callbacksLists;\n}\n/**\n* Get the list of callbacks for a given event, but only if there any callbacks have been registered.\n* If there are no callbacks registered for given event, it checks if this is a specific event and looks\n* for callbacks for it's more generic version.\n*/\nfunction getCallbacksForEvent(source, eventName) {\n\tif (!source._events) return null;\n\tlet currentEventName = eventName;\n\tdo {\n\t\tconst event = source._events[currentEventName];\n\t\tif (event && event.callbacks && event.callbacks.length) return event.callbacks;\n\t\tconst colonIndex = currentEventName.lastIndexOf(\":\");\n\t\tcurrentEventName = colonIndex > -1 ? currentEventName.substring(0, colonIndex) : \"\";\n\t} while (currentEventName);\n\treturn null;\n}\n/**\n* Fires delegated events for given map of destinations.\n*\n* @param destinations A map containing `[ {@link module:utils/emittermixin~Emitter}, \"event name\" ]` pair destinations.\n* @param eventInfo The original event info object.\n* @param fireArgs Arguments the original event was fired with.\n*/\nfunction fireDelegatedEvents(destinations, eventInfo, fireArgs) {\n\tfor (let [emitter, name] of destinations) {\n\t\tif (!name) name = eventInfo.name;\n\t\telse if (typeof name == \"function\") name = name(eventInfo.name);\n\t\tconst delegatedInfo = new EventInfo(eventInfo.source, name);\n\t\tdelegatedInfo.path = [...eventInfo.path];\n\t\temitter.fire(delegatedInfo, ...fireArgs);\n\t}\n}\n/**\n* Helper for registering event callback on the emitter.\n*/\nfunction addEventListener(listener, emitter, event, callback, options) {\n\tif (emitter._addEventListener) emitter._addEventListener(event, callback, options);\n\telse listener._addEventListener.call(emitter, event, callback, options);\n}\n/**\n* Helper for removing event callback from the emitter.\n*/\nfunction removeEventListener(listener, emitter, event, callback) {\n\tif (emitter._removeEventListener) emitter._removeEventListener(event, callback);\n\telse listener._removeEventListener.call(emitter, event, callback);\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/observablemixin\n*/\nconst observablePropertiesSymbol = Symbol(\"observableProperties\");\nconst boundObservablesSymbol = Symbol(\"boundObservables\");\nconst boundPropertiesSymbol = Symbol(\"boundProperties\");\nconst decoratedMethods = Symbol(\"decoratedMethods\");\nconst decoratedOriginal = Symbol(\"decoratedOriginal\");\nconst defaultObservableClass = /* #__PURE__ */ ObservableMixin(/* #__PURE__ */ EmitterMixin());\nfunction ObservableMixin(base) {\n\tif (!base) return defaultObservableClass;\n\tclass Mixin extends base {\n\t\tset(name, value) {\n\t\t\tif (isObject(name)) {\n\t\t\t\tObject.keys(name).forEach((property) => {\n\t\t\t\t\tthis.set(property, name[property]);\n\t\t\t\t}, this);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tinitObservable(this);\n\t\t\tconst properties = this[observablePropertiesSymbol];\n\t\t\tif (name in this && !properties.has(name))\n /**\n\t\t\t* Cannot override an existing property.\n\t\t\t*\n\t\t\t* This error is thrown when trying to {@link module:utils/observablemixin~Observable#set set} a property with\n\t\t\t* a name of an already existing property. For example:\n\t\t\t*\n\t\t\t* ```ts\n\t\t\t* let observable = new Model();\n\t\t\t* observable.property = 1;\n\t\t\t* observable.set( 'property', 2 );\t\t\t// throws\n\t\t\t*\n\t\t\t* observable.set( 'property', 1 );\n\t\t\t* observable.set( 'property', 2 );\t\t\t// ok, because this is an existing property.\n\t\t\t* ```\n\t\t\t*\n\t\t\t* @error observable-set-cannot-override\n\t\t\t*/\n\t\t\tthrow new CKEditorError(\"observable-set-cannot-override\", this);\n\t\t\tObject.defineProperty(this, name, {\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true,\n\t\t\t\tget() {\n\t\t\t\t\treturn properties.get(name);\n\t\t\t\t},\n\t\t\t\tset(value) {\n\t\t\t\t\tconst oldValue = properties.get(name);\n\t\t\t\t\tlet newValue = this.fire(`set:${name}`, name, value, oldValue);\n\t\t\t\t\tif (newValue === void 0) newValue = value;\n\t\t\t\t\tif (oldValue !== newValue || !properties.has(name)) {\n\t\t\t\t\t\tproperties.set(name, newValue);\n\t\t\t\t\t\tthis.fire(`change:${name}`, name, newValue, oldValue);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis[name] = value;\n\t\t}\n\t\tbind(...bindProperties) {\n\t\t\tif (!bindProperties.length || !isStringArray(bindProperties))\n /**\n\t\t\t* All properties must be strings.\n\t\t\t*\n\t\t\t* @error observable-bind-wrong-properties\n\t\t\t*/\n\t\t\tthrow new CKEditorError(\"observable-bind-wrong-properties\", this);\n\t\t\tif (new Set(bindProperties).size !== bindProperties.length)\n /**\n\t\t\t* Properties must be unique.\n\t\t\t*\n\t\t\t* @error observable-bind-duplicate-properties\n\t\t\t*/\n\t\t\tthrow new CKEditorError(\"observable-bind-duplicate-properties\", this);\n\t\t\tinitObservable(this);\n\t\t\tconst boundProperties = this[boundPropertiesSymbol];\n\t\t\tbindProperties.forEach((propertyName) => {\n\t\t\t\tif (boundProperties.has(propertyName))\n /**\n\t\t\t\t* Cannot bind the same property more than once.\n\t\t\t\t*\n\t\t\t\t* @error observable-bind-rebind\n\t\t\t\t*/\n\t\t\t\tthrow new CKEditorError(\"observable-bind-rebind\", this);\n\t\t\t});\n\t\t\tconst bindings = /* @__PURE__ */ new Map();\n\t\t\tbindProperties.forEach((a) => {\n\t\t\t\tconst binding = {\n\t\t\t\t\tproperty: a,\n\t\t\t\t\tto: []\n\t\t\t\t};\n\t\t\t\tboundProperties.set(a, binding);\n\t\t\t\tbindings.set(a, binding);\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tto: bindTo,\n\t\t\t\ttoMany: bindToMany,\n\t\t\t\t_observable: this,\n\t\t\t\t_bindProperties: bindProperties,\n\t\t\t\t_to: [],\n\t\t\t\t_bindings: bindings\n\t\t\t};\n\t\t}\n\t\tunbind(...unbindProperties) {\n\t\t\tif (!this[observablePropertiesSymbol]) return;\n\t\t\tconst boundProperties = this[boundPropertiesSymbol];\n\t\t\tconst boundObservables = this[boundObservablesSymbol];\n\t\t\tif (unbindProperties.length) {\n\t\t\t\tif (!isStringArray(unbindProperties))\n /**\n\t\t\t\t* Properties must be strings.\n\t\t\t\t*\n\t\t\t\t* @error observable-unbind-wrong-properties\n\t\t\t\t*/\n\t\t\t\tthrow new CKEditorError(\"observable-unbind-wrong-properties\", this);\n\t\t\t\tunbindProperties.forEach((propertyName) => {\n\t\t\t\t\tconst binding = boundProperties.get(propertyName);\n\t\t\t\t\tif (!binding) return;\n\t\t\t\t\tbinding.to.forEach(([toObservable, toProperty]) => {\n\t\t\t\t\t\tconst toProperties = boundObservables.get(toObservable);\n\t\t\t\t\t\tconst toPropertyBindings = toProperties[toProperty];\n\t\t\t\t\t\ttoPropertyBindings.delete(binding);\n\t\t\t\t\t\tif (!toPropertyBindings.size) delete toProperties[toProperty];\n\t\t\t\t\t\tif (!Object.keys(toProperties).length) {\n\t\t\t\t\t\t\tboundObservables.delete(toObservable);\n\t\t\t\t\t\t\tthis.stopListening(toObservable, \"change\");\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tboundProperties.delete(propertyName);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tboundObservables.forEach((bindings, boundObservable) => {\n\t\t\t\t\tthis.stopListening(boundObservable, \"change\");\n\t\t\t\t});\n\t\t\t\tboundObservables.clear();\n\t\t\t\tboundProperties.clear();\n\t\t\t}\n\t\t}\n\t\tdecorate(methodName) {\n\t\t\tinitObservable(this);\n\t\t\tconst originalMethod = this[methodName];\n\t\t\tif (!originalMethod)\n /**\n\t\t\t* Cannot decorate an undefined method.\n\t\t\t*\n\t\t\t* @error observablemixin-cannot-decorate-undefined\n\t\t\t* @param {object} object The object which method should be decorated.\n\t\t\t* @param {string} methodName Name of the method which does not exist.\n\t\t\t*/\n\t\t\tthrow new CKEditorError(\"observablemixin-cannot-decorate-undefined\", this, {\n\t\t\t\tobject: this,\n\t\t\t\tmethodName\n\t\t\t});\n\t\t\tthis.on(methodName, (evt, args) => {\n\t\t\t\tevt.return = originalMethod.apply(this, args);\n\t\t\t});\n\t\t\tthis[methodName] = function(...args) {\n\t\t\t\treturn this.fire(methodName, args);\n\t\t\t};\n\t\t\tthis[methodName][decoratedOriginal] = originalMethod;\n\t\t\tif (!this[decoratedMethods]) this[decoratedMethods] = [];\n\t\t\tthis[decoratedMethods].push(methodName);\n\t\t}\n\t\tstopListening(emitter, event, callback) {\n\t\t\tif (!emitter && this[decoratedMethods]) {\n\t\t\t\tfor (const methodName of this[decoratedMethods]) this[methodName] = this[methodName][decoratedOriginal];\n\t\t\t\tdelete this[decoratedMethods];\n\t\t\t}\n\t\t\tsuper.stopListening(emitter, event, callback);\n\t\t}\n\t\t[observablePropertiesSymbol];\n\t\t[decoratedMethods];\n\t\t[boundPropertiesSymbol];\n\t\t[boundObservablesSymbol];\n\t}\n\treturn Mixin;\n}\nfunction initObservable(observable) {\n\tif (observable[observablePropertiesSymbol]) return;\n\tObject.defineProperty(observable, observablePropertiesSymbol, { value: /* @__PURE__ */ new Map() });\n\tObject.defineProperty(observable, boundObservablesSymbol, { value: /* @__PURE__ */ new Map() });\n\tObject.defineProperty(observable, boundPropertiesSymbol, { value: /* @__PURE__ */ new Map() });\n}\n/**\n* A chaining for {@link module:utils/observablemixin~Observable#bind} providing `.to()` interface.\n*\n* @param args Arguments of the `.to( args )` binding.\n*/\nfunction bindTo(...args) {\n\tconst parsedArgs = parseBindToArgs(...args);\n\tconst bindingsKeys = Array.from(this._bindings.keys());\n\tconst numberOfBindings = bindingsKeys.length;\n\tif (!parsedArgs.callback && parsedArgs.to.length > 1)\n /**\n\t* Binding multiple observables only possible with callback.\n\t*\n\t* @error observable-bind-to-no-callback\n\t*/\n\tthrow new CKEditorError(\"observable-bind-to-no-callback\", this);\n\tif (numberOfBindings > 1 && parsedArgs.callback)\n /**\n\t* Cannot bind multiple properties and use a callback in one binding.\n\t*\n\t* @error observable-bind-to-extra-callback\n\t*/\n\tthrow new CKEditorError(\"observable-bind-to-extra-callback\", this);\n\tparsedArgs.to.forEach((to) => {\n\t\tif (to.properties.length && to.properties.length !== numberOfBindings)\n /**\n\t\t* The number of properties must match.\n\t\t*\n\t\t* @error observable-bind-to-properties-length\n\t\t*/\n\t\tthrow new CKEditorError(\"observable-bind-to-properties-length\", this);\n\t\tif (!to.properties.length) to.properties = this._bindProperties;\n\t});\n\tthis._to = parsedArgs.to;\n\tif (parsedArgs.callback) this._bindings.get(bindingsKeys[0]).callback = parsedArgs.callback;\n\tattachBindToListeners(this._observable, this._to);\n\tupdateBindToBound(this);\n\tthis._bindProperties.forEach((propertyName) => {\n\t\tupdateBoundObservableProperty(this._observable, propertyName);\n\t});\n}\n/**\n* Binds to an attribute in a set of iterable observables.\n*/\nfunction bindToMany(observables, attribute, callback) {\n\tif (this._bindings.size > 1)\n /**\n\t* Binding one attribute to many observables only possible with one attribute.\n\t*\n\t* @error observable-bind-to-many-not-one-binding\n\t*/\n\tthrow new CKEditorError(\"observable-bind-to-many-not-one-binding\", this);\n\tthis.to(...getBindingTargets(observables, attribute), callback);\n}\n/**\n* Returns an array of binding components for\n* {@link Observable#bind} from a set of iterable observables.\n*/\nfunction getBindingTargets(observables, attribute) {\n\tconst observableAndAttributePairs = observables.map((observable) => [observable, attribute]);\n\treturn Array.prototype.concat.apply([], observableAndAttributePairs);\n}\n/**\n* Check if all entries of the array are of `String` type.\n*/\nfunction isStringArray(arr) {\n\treturn arr.every((a) => typeof a == \"string\");\n}\n/**\n* Parses and validates {@link Observable#bind}`.to( args )` arguments and returns\n* an object with a parsed structure. For example\n*\n* ```ts\n* A.bind( 'x' ).to( B, 'a', C, 'b', call );\n* ```\n*\n* becomes\n*\n* ```ts\n* {\n* \tto: [\n* \t\t{ observable: B, properties: [ 'a' ] },\n* \t\t{ observable: C, properties: [ 'b' ] },\n* \t],\n* \tcallback: call\n* }\n*\n* @param args Arguments of {@link Observable#bind}`.to( args )`.\n*/\nfunction parseBindToArgs(...args) {\n\tif (!args.length)\n /**\n\t* Invalid argument syntax in `to()`.\n\t*\n\t* @error observable-bind-to-parse-error\n\t*/\n\tthrow new CKEditorError(\"observable-bind-to-parse-error\", null);\n\tconst parsed = { to: [] };\n\tlet lastObservable;\n\tif (typeof args[args.length - 1] == \"function\") parsed.callback = args.pop();\n\targs.forEach((a) => {\n\t\tif (typeof a == \"string\") lastObservable.properties.push(a);\n\t\telse if (typeof a == \"object\") {\n\t\t\tlastObservable = {\n\t\t\t\tobservable: a,\n\t\t\t\tproperties: []\n\t\t\t};\n\t\t\tparsed.to.push(lastObservable);\n\t\t} else throw new CKEditorError(\"observable-bind-to-parse-error\", null);\n\t});\n\treturn parsed;\n}\n/**\n* Synchronizes {@link module:utils/observable#_boundObservables} with {@link Binding}.\n*\n* @param binding A binding to store in {@link Observable#_boundObservables}.\n* @param toObservable A observable, which is a new component of `binding`.\n* @param toPropertyName A name of `toObservable`'s property, a new component of the `binding`.\n*/\nfunction updateBoundObservables(observable, binding, toObservable, toPropertyName) {\n\tconst boundObservables = observable[boundObservablesSymbol];\n\tconst bindingsToObservable = boundObservables.get(toObservable);\n\tconst bindings = bindingsToObservable || {};\n\tif (!bindings[toPropertyName]) bindings[toPropertyName] = /* @__PURE__ */ new Set();\n\tbindings[toPropertyName].add(binding);\n\tif (!bindingsToObservable) boundObservables.set(toObservable, bindings);\n}\n/**\n* Synchronizes {@link Observable#_boundProperties} and {@link Observable#_boundObservables}\n* with {@link BindChain}.\n*\n* Assuming the following binding being created\n*\n* ```ts\n* A.bind( 'a', 'b' ).to( B, 'x', 'y' );\n* ```\n*\n* the following bindings were initialized by {@link Observable#bind} in {@link BindChain#_bindings}:\n*\n* ```ts\n* {\n* \ta: { observable: A, property: 'a', to: [] },\n* \tb: { observable: A, property: 'b', to: [] },\n* }\n* ```\n*\n* Iterate over all bindings in this chain and fill their `to` properties with\n* corresponding to( ... ) arguments (components of the binding), so\n*\n* ```ts\n* {\n* \ta: { observable: A, property: 'a', to: [ B, 'x' ] },\n* \tb: { observable: A, property: 'b', to: [ B, 'y' ] },\n* }\n* ```\n*\n* Then update the structure of {@link Observable#_boundObservables} with updated\n* binding, so it becomes:\n*\n* ```ts\n* Map( {\n* \tB: {\n* \t\tx: Set( [\n* \t\t\t{ observable: A, property: 'a', to: [ [ B, 'x' ] ] }\n* \t\t] ),\n* \t\ty: Set( [\n* \t\t\t{ observable: A, property: 'b', to: [ [ B, 'y' ] ] },\n* \t\t] )\n* \t}\n* } )\n* ```\n*\n* @param chain The binding initialized by {@link Observable#bind}.\n*/\nfunction updateBindToBound(chain) {\n\tlet toProperty;\n\tchain._bindings.forEach((binding, propertyName) => {\n\t\tchain._to.forEach((to) => {\n\t\t\ttoProperty = to.properties[binding.callback ? 0 : chain._bindProperties.indexOf(propertyName)];\n\t\t\tbinding.to.push([to.observable, toProperty]);\n\t\t\tupdateBoundObservables(chain._observable, binding, to.observable, toProperty);\n\t\t});\n\t});\n}\n/**\n* Updates an property of a {@link Observable} with a value\n* determined by an entry in {@link Observable#_boundProperties}.\n*\n* @param observable A observable which property is to be updated.\n* @param propertyName An property to be updated.\n*/\nfunction updateBoundObservableProperty(observable, propertyName) {\n\tconst binding = observable[boundPropertiesSymbol].get(propertyName);\n\tlet propertyValue;\n\tif (binding.callback) propertyValue = binding.callback.apply(observable, binding.to.map((to) => to[0][to[1]]));\n\telse {\n\t\tpropertyValue = binding.to[0];\n\t\tpropertyValue = propertyValue[0][propertyValue[1]];\n\t}\n\tif (Object.prototype.hasOwnProperty.call(observable, propertyName)) observable[propertyName] = propertyValue;\n\telse observable.set(propertyName, propertyValue);\n}\n/**\n* Starts listening to changes in {@link BindChain._to} observables to update\n* {@link BindChain._observable} {@link BindChain._bindProperties}. Also sets the\n* initial state of {@link BindChain._observable}.\n*\n* @param chain The chain initialized by {@link Observable#bind}.\n*/\nfunction attachBindToListeners(observable, toBindings) {\n\ttoBindings.forEach((to) => {\n\t\tconst boundObservables = observable[boundObservablesSymbol];\n\t\tlet bindings;\n\t\tif (!boundObservables.get(to.observable)) observable.listenTo(to.observable, \"change\", (evt, propertyName) => {\n\t\t\tbindings = boundObservables.get(to.observable)[propertyName];\n\t\t\tif (bindings) bindings.forEach((binding) => {\n\t\t\t\tupdateBoundObservableProperty(observable, binding.property);\n\t\t\t});\n\t\t});\n\t});\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/isshadowroot\n*/\n/**\n* Checks whether the given object is a native DOM `ShadowRoot`.\n*\n* A type guard, safe to call on any value, and correct for a root belonging to another document or iframe.\n*\n* @param obj The object to check.\n*/\nfunction isShadowRoot(obj) {\n\tif (!obj) return false;\n\tconst defaultView = obj.ownerDocument?.defaultView;\n\treturn obj instanceof (defaultView ? defaultView.ShadowRoot : ShadowRoot);\n}\n/**\n* Checks whether the given object is a shadow root the platform itself accepts.\n*\n* A page may run a shadow DOM polyfill that emulates the boundary in the light DOM instead of asking the\n* engine for one \u2013 a *synthetic* shadow root. Such a root passes {@link ~isShadowRoot}, because the polyfill\n* replaces the global `ShadowRoot` with its own constructor and patches `Symbol.hasInstance` on it. It\n* emulates the tree faithfully enough for traversal (`host`, `parentNode`, `contains`, `activeElement` all\n* behave), which is why {@link ~isShadowRoot} stays truthful about it, but being no platform object it\n* cannot be:\n*\n* * passed to a DOM API expecting a real root \u2013 `Selection#getComposedRanges()` and\n* `Document#caretPositionFromPoint()` reject it while converting their arguments;\n* * asked for its selection or stylesheets \u2013 those are the members a polyfill cannot emulate, so it\n* usually makes them throw;\n* * used as a mount target \u2013 its `appendChild()` delegates to the host element, so the node ends up in the\n* surrounding tree rather than at the top of the one it was mounted in.\n*\n* Use it wherever a root crosses into one of those, and {@link ~isShadowRoot} everywhere else. Answering\n* `false` here falls back to the light-DOM path, which is the correct answer for a synthetic root: the\n* boundary it emulates is not one the engine actually has, so the document-level APIs already see the real\n* nodes behind it.\n*\n* @internal\n* @param obj The object to check.\n*/\nfunction isNativeShadowRoot(obj) {\n\treturn isShadowRoot(obj) && obj.synthetic !== true;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/getparentnode\n*/\n/**\n* Returns the node one step up the composed tree, crossing shadow boundaries.\n*\n* The shadow-aware replacement for `Node#parentNode`, and the primitive for walking from a node outwards to the\n* document. It steps over any node, so such a walk visits the `ShadowRoot` nodes on the way and reaches the\n* `Document` at the top \u2013 to walk elements only, use\n* {@link module:utils/dom/getparentelement~getParentElement}. Works for open and closed roots alike.\n*\n* @param node The node to step up from.\n*/\nfunction getParentNode(node) {\n\treturn isShadowRoot(node) ? node.host : node.parentNode;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/elementreplacer\n*/\n/**\n* Utility class allowing to hide existing HTML elements or replace them with given ones in a way that doesn't remove\n* the original elements from the DOM.\n*/\nvar ElementReplacer = class {\n\t/**\n\t* The elements replaced by {@link #replace} and their replacements.\n\t*/\n\t_replacedElements;\n\tconstructor() {\n\t\tthis._replacedElements = [];\n\t}\n\t/**\n\t* Hides the `element` and, if specified, inserts the the given element next to it.\n\t*\n\t* The effect of this method can be reverted by {@link #restore}.\n\t*\n\t* @param element The element to replace.\n\t* @param newElement The replacement element. If not passed, then the `element` will just be hidden.\n\t*/\n\treplace(element, newElement) {\n\t\tthis._replacedElements.push({\n\t\t\telement,\n\t\t\tnewElement\n\t\t});\n\t\telement.style.display = \"none\";\n\t\tif (newElement) getParentNode(element).insertBefore(newElement, element.nextSibling);\n\t}\n\t/**\n\t* Restores what {@link #replace} did.\n\t*/\n\trestore() {\n\t\tthis._replacedElements.forEach(({ element, newElement }) => {\n\t\t\telement.style.display = \"\";\n\t\t\tif (newElement) newElement.remove();\n\t\t});\n\t\tthis._replacedElements = [];\n\t}\n};\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/abortabledebounce\n*/\n/**\n* Returns a function wrapper that will execute the provided function and abort any previous call that is still in progress.\n*\n* @param func The function to be called. It will be provided with `AbortSignal` as the first parameter.\n*/\nfunction abortableDebounce(func) {\n\tlet controller = new AbortController();\n\tfunction abortable(...args) {\n\t\tcontroller.abort();\n\t\tcontroller = new AbortController();\n\t\treturn func(controller.signal, ...args);\n\t}\n\tabortable.abort = () => controller.abort();\n\treturn abortable;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/count\n*/\n/**\n* Returns the number of items return by the iterator.\n*\n* ```ts\n* count( [ 1, 2, 3, 4, 5 ] ); // 5;\n* ```\n*\n* @param iterable Any iterable.\n* @returns Number of items returned by that iterable.\n*/\nfunction count(iterable) {\n\tlet count = 0;\n\tfor (const _ of iterable) count++;\n\treturn count;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/comparearrays\n*/\n/**\n* Compares how given arrays relate to each other. One array can be: same as another array, prefix of another array\n* or completely different. If arrays are different, first index at which they differ is returned. Otherwise,\n* a flag specifying the relation is returned. Flags are negative numbers, so whenever a number >= 0 is returned\n* it means that arrays differ.\n*\n* ```ts\n* compareArrays( [ 0, 2 ], [ 0, 2 ] );\t\t// 'same'\n* compareArrays( [ 0, 2 ], [ 0, 2, 1 ] );\t\t// 'prefix'\n* compareArrays( [ 0, 2 ], [ 0 ] );\t\t\t// 'extension'\n* compareArrays( [ 0, 2 ], [ 1, 2 ] );\t\t// 0\n* compareArrays( [ 0, 2 ], [ 0, 1 ] );\t\t// 1\n* ```\n*\n* @param a Array that is compared.\n* @param b Array to compare with.\n* @returns How array `a` is related to `b`.\n*/\nfunction compareArrays(a, b) {\n\tconst minLen = Math.min(a.length, b.length);\n\tfor (let i = 0; i < minLen; i++) if (a[i] != b[i]) return i;\n\tif (a.length == b.length) return \"same\";\n\telse if (a.length < b.length) return \"prefix\";\n\telse return \"extension\";\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/isiterable\n*/\n/**\n* Checks if value implements iterator interface.\n*\n* @param value The value to check.\n* @returns True if value implements iterator interface.\n*/\nfunction isIterable(value) {\n\treturn !!(value && value[Symbol.iterator]);\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/createelement\n*/\n/**\n* Creates an HTML or SVG element with attributes and children elements.\n*\n* ```ts\n* createElement( document, 'p' ); //

\n* createElement( document, 'mask', { xmlns: 'http://www.w3.org/2000/svg' } ); // \n* ```\n*\n* @param doc Document used to create the element.\n* @param name Name of the element.\n* @param attributes Object where keys represent attribute keys and values represent attribute values.\n* @param children Child or any iterable of children. Strings will be automatically turned into Text nodes.\n* @returns HTML or SVG element.\n*/\nfunction createElement(doc, name, attributes = {}, children = []) {\n\tconst namespace = attributes && attributes.xmlns;\n\tconst element = namespace ? doc.createElementNS(namespace, name) : doc.createElement(name);\n\tfor (const key in attributes) element.setAttribute(key, attributes[key]);\n\tif (isString(children) || !isIterable(children)) children = [children];\n\tfor (let child of children) {\n\t\tif (isString(child)) child = doc.createTextNode(child);\n\t\telement.appendChild(child);\n\t}\n\treturn element;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/config\n*/\n/**\n* Handles a configuration dictionary.\n*\n* @typeParam Cfg A type of the configuration dictionary.\n*/\nvar Config = class {\n\t/**\n\t* Store for the whole configuration.\n\t*/\n\t_config;\n\t/**\n\t* Creates an instance of the {@link ~Config} class.\n\t*\n\t* @param configurations The initial configurations to be set. Usually, provided by the user.\n\t* @param defaultConfigurations The default configurations. Usually, provided by the system.\n\t*/\n\tconstructor(configurations, defaultConfigurations) {\n\t\tthis._config = Object.create(null);\n\t\tif (defaultConfigurations) this.define(cloneConfig(defaultConfigurations));\n\t\tif (configurations) this._setObjectToTarget(this._config, configurations);\n\t}\n\tset(name, value) {\n\t\tthis._setToTarget(this._config, name, value);\n\t}\n\tdefine(name, value) {\n\t\tthis._setToTarget(this._config, name, value, true);\n\t}\n\t/**\n\t* Gets the value for a configuration entry.\n\t*\n\t* ```ts\n\t* config.get( 'name' );\n\t* ```\n\t*\n\t* Deep configurations can be retrieved by separating each part with a dot.\n\t*\n\t* ```ts\n\t* config.get( 'toolbar.collapsed' );\n\t* ```\n\t*\n\t* @param name The configuration name. Configuration names are case-sensitive.\n\t* @returns The configuration value or `undefined` if the configuration entry was not found.\n\t*/\n\tget(name) {\n\t\treturn this._getFromSource(this._config, name);\n\t}\n\t/**\n\t* Iterates over all top level configuration names.\n\t*/\n\t*names() {\n\t\tfor (const name of Object.keys(this._config)) yield name;\n\t}\n\t/**\n\t* Saves passed configuration to the specified target (nested object).\n\t*\n\t* @param target Nested config object.\n\t* @param name The configuration name or an object from which take properties as\n\t* configuration entries. Configuration names are case-sensitive.\n\t* @param value The configuration value. Used if a name is passed.\n\t* @param isDefine Define if passed configuration should overwrite existing one.\n\t*/\n\t_setToTarget(target, name, value, isDefine = false) {\n\t\tif (isPlainObject(name)) {\n\t\t\tthis._setObjectToTarget(target, name, isDefine);\n\t\t\treturn;\n\t\t}\n\t\tconst parts = name.split(\".\");\n\t\tname = parts.pop();\n\t\tfor (const part of parts) {\n\t\t\tif (!isPlainObject(target[part])) target[part] = Object.create(null);\n\t\t\ttarget = target[part];\n\t\t}\n\t\tif (isPlainObject(value)) {\n\t\t\tif (!isPlainObject(target[name])) target[name] = Object.create(null);\n\t\t\ttarget = target[name];\n\t\t\tthis._setObjectToTarget(target, value, isDefine);\n\t\t\treturn;\n\t\t}\n\t\tif (isDefine && typeof target[name] != \"undefined\") return;\n\t\ttarget[name] = value;\n\t}\n\t/**\n\t* Get specified configuration from specified source (nested object).\n\t*\n\t* @param source level of nested object.\n\t* @param name The configuration name. Configuration names are case-sensitive.\n\t* @returns The configuration value or `undefined` if the configuration entry was not found.\n\t*/\n\t_getFromSource(source, name) {\n\t\tconst parts = name.split(\".\");\n\t\tname = parts.pop();\n\t\tfor (const part of parts) {\n\t\t\tif (!isPlainObject(source[part])) {\n\t\t\t\tsource = null;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsource = source[part];\n\t\t}\n\t\treturn source ? cloneConfig(source[name]) : void 0;\n\t}\n\t/**\n\t* Iterates through passed object and calls {@link #_setToTarget} method with object key and value for each property.\n\t*\n\t* @param target Nested config object.\n\t* @param configuration Configuration data set\n\t* @param isDefine Defines if passed configuration is default configuration or not.\n\t*/\n\t_setObjectToTarget(target, configuration, isDefine) {\n\t\tObject.keys(configuration).forEach((key) => {\n\t\t\tthis._setToTarget(target, key, configuration[key], isDefine);\n\t\t});\n\t}\n};\n/**\n* Clones configuration object or value.\n*/\nfunction cloneConfig(source) {\n\treturn cloneDeepWith(source, leaveItemReferences);\n}\n/**\n* A customized function for cloneDeepWith.\n* In case if it's a DOM Element it will leave references to DOM Elements instead of cloning them.\n* If it's a function it will leave reference to actuall function.\n*/\nfunction leaveItemReferences(value) {\n\treturn isElement(value) || typeof value === \"function\" ? value : void 0;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/isnode\n*/\n/**\n* Checks if the object is a native DOM Node.\n*/\nfunction isNode(obj) {\n\tif (obj) {\n\t\tif (obj.defaultView) return obj instanceof obj.defaultView.Document;\n\t\telse if (obj.ownerDocument && obj.ownerDocument.defaultView) return obj instanceof obj.ownerDocument.defaultView.Node;\n\t}\n\treturn false;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/iswindow\n*/\n/**\n* Checks if the object is a native DOM Window.\n*/\nfunction isWindow(obj) {\n\tconst stringifiedObject = Object.prototype.toString.apply(obj);\n\tif (stringifiedObject == \"[object Window]\") return true;\n\tif (stringifiedObject == \"[object global]\") return true;\n\treturn false;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/emittermixin\n*/\nconst defaultEmitterClass = /* #__PURE__ */ DomEmitterMixin(/* #__PURE__ */ EmitterMixin());\nconst ProxyEmitterBase = /* #__PURE__ */ EmitterMixin();\nfunction DomEmitterMixin(base) {\n\tif (!base) return defaultEmitterClass;\n\tclass Mixin extends base {\n\t\tlistenTo(emitter, event, callback, options = {}) {\n\t\t\tif (isNode(emitter) || isWindow(emitter) || emitter instanceof globalVar.window.EventTarget) {\n\t\t\t\tif (isShadowRoot(emitter) && !isNativeShadowRoot(emitter)) return;\n\t\t\t\tconst proxyOptions = {\n\t\t\t\t\tcapture: !!options.useCapture,\n\t\t\t\t\tpassive: !!options.usePassive\n\t\t\t\t};\n\t\t\t\tconst proxyEmitter = this._getProxyEmitter(emitter, proxyOptions) || new ProxyEmitter(emitter, proxyOptions);\n\t\t\t\tthis.listenTo(proxyEmitter, event, callback, options);\n\t\t\t} else super.listenTo(emitter, event, callback, options);\n\t\t}\n\t\tstopListening(emitter, event, callback) {\n\t\t\tif (isNode(emitter) || isWindow(emitter) || emitter instanceof globalVar.window.EventTarget) {\n\t\t\t\tconst proxyEmitters = this._getAllProxyEmitters(emitter);\n\t\t\t\tfor (const proxy of proxyEmitters) this.stopListening(proxy, event, callback);\n\t\t\t} else super.stopListening(emitter, event, callback);\n\t\t}\n\t\t/**\n\t\t* Retrieves ProxyEmitter instance for given DOM Node residing in this Host and given options.\n\t\t*\n\t\t* @param node DOM Node of the ProxyEmitter.\n\t\t* @param options Additional options.\n\t\t* @param options.useCapture Indicates that events of this type will be dispatched to the registered\n\t\t* listener before being dispatched to any EventTarget beneath it in the DOM tree.\n\t\t* @param options.usePassive Indicates that the function specified by listener will never call preventDefault()\n\t\t* and prevents blocking browser's main thread by this event handler.\n\t\t* @returns ProxyEmitter instance bound to the DOM Node.\n\t\t*/\n\t\t_getProxyEmitter(node, options) {\n\t\t\treturn _getEmitterListenedTo(this, getProxyEmitterId(node, options));\n\t\t}\n\t\t/**\n\t\t* Retrieves all the ProxyEmitter instances for given DOM Node residing in this Host.\n\t\t*\n\t\t* @param node DOM Node of the ProxyEmitter.\n\t\t*/\n\t\t_getAllProxyEmitters(node) {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tcapture: false,\n\t\t\t\t\tpassive: false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcapture: false,\n\t\t\t\t\tpassive: true\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcapture: true,\n\t\t\t\t\tpassive: false\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcapture: true,\n\t\t\t\t\tpassive: true\n\t\t\t\t}\n\t\t\t].map((options) => this._getProxyEmitter(node, options)).filter((proxy) => !!proxy);\n\t\t}\n\t}\n\treturn Mixin;\n}\n/**\n* Creates a ProxyEmitter instance. Such an instance is a bridge between a DOM Node firing events\n* and any Host listening to them. It is backwards compatible with {@link module:utils/emittermixin~Emitter#on}.\n* There is a separate instance for each combination of modes (useCapture & usePassive). The mode is concatenated with\n* UID stored in HTMLElement to give each instance unique identifier.\n*\n* listenTo( click, ... )\n* +-----------------------------------------+\n* | stopListening( ... ) |\n* +----------------------------+ | addEventListener( click, ... )\n* | Host | | +---------------------------------------------+\n* +----------------------------+ | | removeEventListener( click, ... ) |\n* | _listeningTo: { | +----------v-------------+ |\n* | UID+mode: { | | ProxyEmitter | |\n* | emitter: ProxyEmitter, | +------------------------+ +------------v----------+\n* | callbacks: { | | events: { | | Node (HTMLElement) |\n* | click: [ callbacks ] | | click: [ callbacks ] | +-----------------------+\n* | } | | }, | | data-ck-expando: UID |\n* | } | | _domNode: Node, | +-----------------------+\n* | } | | _domListeners: {}, | |\n* | +------------------------+ | | _emitterId: UID+mode | |\n* | | DomEmitterMixin | | +--------------^---------+ |\n* | +------------------------+ | | | |\n* +--------------^-------------+ | +---------------------------------------------+\n* | | click (DOM Event)\n* +-----------------------------------------+\n* fire( click, DOM Event )\n*/\nvar ProxyEmitter = class extends ProxyEmitterBase {\n\t_domNode;\n\t_options;\n\t/**\n\t* @param node DOM Node that fires events.\n\t* @param options Additional options.\n\t* @param options.useCapture Indicates that events of this type will be dispatched to the registered\n\t* listener before being dispatched to any EventTarget beneath it in the DOM tree.\n\t* @param options.usePassive Indicates that the function specified by listener will never call preventDefault()\n\t* and prevents blocking browser's main thread by this event handler.\n\t*/\n\tconstructor(node, options) {\n\t\tsuper();\n\t\t_setEmitterId(this, getProxyEmitterId(node, options));\n\t\tthis._domNode = node;\n\t\tthis._options = options;\n\t}\n\t/**\n\t* Collection of native DOM listeners.\n\t*/\n\t_domListeners;\n\t/**\n\t* Registers a callback function to be executed when an event is fired.\n\t*\n\t* It attaches a native DOM listener to the DOM Node. When fired,\n\t* a corresponding Emitter event will also fire with DOM Event object as an argument.\n\t*\n\t* **Note**: This is automatically called by the\n\t* {@link module:utils/emittermixin~Emitter#listenTo `Emitter#listenTo()`}.\n\t*\n\t* @param event The name of the event.\n\t*/\n\tattach(event) {\n\t\tif (this._domListeners && this._domListeners[event]) return;\n\t\tconst domListener = this._createDomListener(event);\n\t\tthis._domNode.addEventListener(event, domListener, this._options);\n\t\tif (!this._domListeners) this._domListeners = {};\n\t\tthis._domListeners[event] = domListener;\n\t}\n\t/**\n\t* Stops executing the callback on the given event.\n\t*\n\t* **Note**: This is automatically called by the\n\t* {@link module:utils/emittermixin~Emitter#stopListening `Emitter#stopListening()`}.\n\t*\n\t* @param event The name of the event.\n\t*/\n\tdetach(event) {\n\t\tlet events;\n\t\tif (this._domListeners[event] && (!(events = this._events[event]) || !events.callbacks.length)) this._domListeners[event].removeListener();\n\t}\n\t/**\n\t* Adds callback to emitter for given event.\n\t*\n\t* @internal\n\t* @param event The name of the event.\n\t* @param callback The function to be called on event.\n\t* @param options Additional options.\n\t*/\n\t_addEventListener(event, callback, options) {\n\t\tthis.attach(event);\n\t\tEmitterMixin().prototype._addEventListener.call(this, event, callback, options);\n\t}\n\t/**\n\t* Removes callback from emitter for given event.\n\t*\n\t* @internal\n\t* @param event The name of the event.\n\t* @param callback The function to stop being called.\n\t*/\n\t_removeEventListener(event, callback) {\n\t\tEmitterMixin().prototype._removeEventListener.call(this, event, callback);\n\t\tthis.detach(event);\n\t}\n\t/**\n\t* Creates a native DOM listener callback. When the native DOM event\n\t* is fired it will fire corresponding event on this ProxyEmitter.\n\t* Note: A native DOM Event is passed as an argument.\n\t*\n\t* @param event The name of the event.\n\t* @returns The DOM listener callback.\n\t*/\n\t_createDomListener(event) {\n\t\tconst domListener = (domEvt) => {\n\t\t\tthis.fire(event, domEvt);\n\t\t};\n\t\tdomListener.removeListener = () => {\n\t\t\tthis._domNode.removeEventListener(event, domListener, this._options);\n\t\t\tdelete this._domListeners[event];\n\t\t};\n\t\treturn domListener;\n\t}\n};\n/**\n* Gets an unique DOM Node identifier. The identifier will be set if not defined.\n*\n* @returns UID for given DOM Node.\n*/\nfunction getNodeUID(node) {\n\treturn node[\"data-ck-expando\"] || (node[\"data-ck-expando\"] = uid());\n}\n/**\n* Gets id of the ProxyEmitter for the given node.\n*/\nfunction getProxyEmitterId(node, options) {\n\tlet id = getNodeUID(node);\n\tfor (const option of Object.keys(options).sort()) if (options[option]) id += \"-\" + option;\n\treturn id;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/getparentelement\n*/\n/**\n* Returns the parent element of the given node, crossing shadow boundaries.\n*\n* The shadow-aware replacement for `Node#parentElement`, which is `null` for a node sitting directly in a\n* `ShadowRoot` and so stops an outward walk at the boundary. Works for open and closed roots alike.\n*\n* @param node The node to get the parent element of.\n*/\nfunction getParentElement(node) {\n\tconst parent = node.parentNode;\n\treturn isShadowRoot(parent) ? parent.host : node.parentElement;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/getlayoutparentelement\n*/\n/**\n* Returns the parent element in the **flattened tree**, the one the browser lays out and paints.\n*\n* The layout-aware counterpart of {@link module:utils/dom/getparentelement~getParentElement}, and the element-only\n* form of {@link module:utils/dom/getlayoutparentnode~getLayoutParentNode} \u2013 see that one for why the flattened\n* tree and the node tree disagree for slotted content, and for when to prefer which.\n*\n* Use it to walk outwards over the elements that lay a node out: its scrollable ancestors, its clipping ancestors.\n* Works for open and closed roots alike, and falls back to the node tree for slotted content inside a closed root,\n* whose slot the DOM standard does not expose.\n*\n* @param node The node to get the layout parent element of.\n*/\nfunction getLayoutParentElement(node) {\n\treturn node.assignedSlot || getParentElement(node);\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/findclosestscrollableancestor\n*/\n/**\n* Returns the closest scrollable ancestor of a DOM element.\n*\n* The search crosses shadow DOM boundaries, continuing from the host element of a shadow root instead of\n* stopping at it. Without that, an element rendered inside a shadow tree would report no scrollable ancestor at\n* all, even when one exists further up in the surrounding document, because the walk goes over `parentElement`,\n* which is `null` for a direct child of a shadow root. Works for both open and closed shadow roots.\n*\n* @param domElement DOM element.\n* @returns First ancestor of `domElement` that is scrollable or null if such ancestor doesn't exist.\n*/\nfunction findClosestScrollableAncestor(domElement) {\n\tlet element = getLayoutParentElement(domElement);\n\tif (!element) return null;\n\twhile (element.tagName != \"BODY\") {\n\t\tconst overflow = element.style.overflowY || globalVar.window.getComputedStyle(element).overflowY;\n\t\tif (overflow === \"auto\" || overflow === \"scroll\") break;\n\t\telement = getLayoutParentElement(element);\n\t\tif (!element) return null;\n\t}\n\treturn element;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/getlayoutparentnode\n*/\n/**\n* Returns the node one step up the **flattened tree**, the one the browser lays out and paints.\n*\n* The layout-aware counterpart of {@link module:utils/dom/getparentnode~getParentNode}, which walks the node\n* tree. The two agree everywhere except for slotted content: assigning a node to a `` does not move it, so\n* it stays a child of the host in the node tree while rendering inside the slot. A node-tree walk out of such a\n* node therefore leaves into the light DOM and skips every element of the shadow tree that actually lays it out.\n*\n* Use this one for questions about geometry \u2013 what scrolls a node, what clips it, what it renders inside \u2013 and\n* {@link module:utils/dom/getparentnode~getParentNode} for questions about structure, such as what a node is a\n* descendant of for the purposes of DOM manipulation or event retargeting. Both cross shadow boundaries and both\n* work for open and closed roots alike.\n*\n* **Note**: `Element#assignedSlot` is `null` when the slot lives in a *closed* shadow root, which the DOM\n* standard does not expose. For slotted content inside a closed root this falls back to the node tree and\n* answers exactly as {@link module:utils/dom/getparentnode~getParentNode} does.\n*\n* @param node The node to step up from.\n*/\nfunction getLayoutParentNode(node) {\n\treturn node.assignedSlot || getParentNode(node);\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/containsnode\n*/\n/**\n* Checks whether `node` is inside `container`, looking through shadow roots on the way.\n*\n* Use it instead of `Node#contains()`, which stops at a shadow root: that one says `false` even when\n* `container` really is an ancestor, as long as a shadow root sits between the two. A node contains itself\n* here, just like it does there.\n*\n* `container` can also be a `Document` or a `ShadowRoot` \u2013 useful for a `scroll` event, for example, whose\n* target is the document and not an element. Works with open and closed shadow roots.\n*\n* @param container The node that may be the ancestor.\n* @param node The node to look for. May be `null`, which always gives `false`.\n*/\nfunction containsNode(container, node) {\n\tlet current = node;\n\twhile (current) {\n\t\tif (current === container) return true;\n\t\tcurrent = getLayoutParentNode(current);\n\t}\n\treturn false;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/getancestors\n*/\n/**\n* Returns all ancestors of given DOM node, starting from the top-most (root). Includes the given node itself. If the\n* node is a part of `DocumentFragment` that `DocumentFragment` will be returned. In contrary, if the node is\n* appended to a `Document`, that `Document` will not be returned (algorithms operating on DOM tree care for `Document#documentElement`\n* at most, which will be returned).\n*\n* @param node DOM node.\n* @returns Array of given `node` parents.\n*/\nfunction getAncestors(node) {\n\tconst nodes = [];\n\tlet currentNode = node;\n\twhile (currentNode && currentNode.nodeType != Node.DOCUMENT_NODE) {\n\t\tnodes.unshift(currentNode);\n\t\tcurrentNode = currentNode.parentNode;\n\t}\n\treturn nodes;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/getdatafromelement\n*/\n/**\n* Gets data from a given source element.\n*\n* @param el The element from which the data will be retrieved.\n* @returns The data string.\n*/\nfunction getDataFromElement(el) {\n\tif (el instanceof HTMLTextAreaElement) return el.value;\n\treturn el.innerHTML;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/getborderwidths\n*/\n/**\n* Returns an object containing CSS border widths of a specified HTML element.\n*\n* @param element An element which has CSS borders.\n* @returns An object containing `top`, `left`, `right` and `bottom` properties\n* with numerical values of the `border-[top,left,right,bottom]-width` CSS styles.\n*/\nfunction getBorderWidths(element) {\n\tconst style = element.ownerDocument.defaultView.getComputedStyle(element);\n\treturn {\n\t\ttop: parseInt(style.borderTopWidth, 10),\n\t\tright: parseInt(style.borderRightWidth, 10),\n\t\tbottom: parseInt(style.borderBottomWidth, 10),\n\t\tleft: parseInt(style.borderLeftWidth, 10)\n\t};\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/getrangefrommouseevent\n*/\n/**\n* Returns a DOM range from a given point specified by a mouse event.\n*\n* **Note**: The point is resolved inside the shadow root the event was dispatched in, so a click inside a shadow\n* tree gives a range in that tree rather than one at its host. Works for open and closed shadow roots alike, on\n* the engines that honor the `shadowRoots` option of `Document#caretPositionFromPoint()`; elsewhere the range\n* still lands beside the host.\n*\n* @param domEvent The mouse event.\n* @returns The DOM range.\n*/\nfunction getRangeFromMouseEvent(domEvent) {\n\tif (!domEvent.target) return null;\n\tconst domTarget = domEvent.target;\n\tconst domDoc = domTarget.ownerDocument;\n\tconst x = domEvent.clientX;\n\tconst y = domEvent.clientY;\n\tlet domRange = null;\n\tif (domDoc.caretPositionFromPoint) {\n\t\tconst rootNode = domTarget.getRootNode();\n\t\tconst shadowRoots = isNativeShadowRoot(rootNode) ? [rootNode] : [];\n\t\tconst caretPosition = domDoc.caretPositionFromPoint(x, y, { shadowRoots });\n\t\tif (caretPosition) {\n\t\t\tconst offsetNode = caretPosition.offsetNode;\n\t\t\tconst maxOffset = offsetNode.nodeType === Node.TEXT_NODE ? offsetNode.data.length : offsetNode.childNodes.length;\n\t\t\tconst offset = Math.min(caretPosition.offset, maxOffset);\n\t\t\tdomRange = domDoc.createRange();\n\t\t\tdomRange.setStart(offsetNode, offset);\n\t\t\tdomRange.collapse(true);\n\t\t}\n\t} else if (domDoc.caretRangeFromPoint && domDoc.caretRangeFromPoint(x, y)) domRange = domDoc.caretRangeFromPoint(x, y);\n\telse if (domEvent.rangeParent) {\n\t\tdomRange = domDoc.createRange();\n\t\tdomRange.setStart(domEvent.rangeParent, domEvent.rangeOffset);\n\t\tdomRange.collapse(true);\n\t}\n\treturn domRange;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/getelementfrompoint\n*/\n/**\n* Returns the topmost element at the given viewport point, looking inside the given shadow roots.\n*\n* The shadow-aware replacement for `Document#elementFromPoint()`, which retargets a point inside a shadow tree\n* to that tree's host and so cannot report the element actually under it.\n*\n* Pass every shadow root a hit may land in \u2013 typically each editable's own `getRootNode()`. Only the innermost\n* root containing the point matters, so ancestor roots do not need to be listed, and a point in the light DOM\n* needs no roots at all.\n*\n* The point is hit tested strictly, honoring `pointer-events`, so the answer is the element that a click at\n* those coordinates would reach. The exception is an engine that cannot hit test a shadow root, where the point\n* is resolved from the nearest caret position instead and may land beside what it really hit.\n*\n* @param x The horizontal coordinate, relative to the viewport.\n* @param y The vertical coordinate, relative to the viewport.\n* @param shadowRoots The shadow roots the lookup is allowed to look inside. Empty for the light DOM.\n*/\nfunction getElementFromPoint(x, y, shadowRoots = []) {\n\tconst doc = globalVar.document;\n\tconst [firstRoot] = shadowRoots;\n\tif (firstRoot && \"elementFromPoint\" in firstRoot) for (const root of shadowRoots) {\n\t\tconst element = root.elementFromPoint(x, y);\n\t\tif (element && element.getRootNode() === root) return element;\n\t}\n\telse if (firstRoot && doc.caretPositionFromPoint) {\n\t\tconst nativeShadowRoots = shadowRoots.filter(isNativeShadowRoot);\n\t\tconst caretPosition = doc.caretPositionFromPoint(x, y, { shadowRoots: nativeShadowRoots });\n\t\tconst offsetNode = caretPosition && caretPosition.offsetNode;\n\t\tconst element = offsetNode && offsetNode.nodeType === Node.TEXT_NODE ? getParentElement(offsetNode) : offsetNode;\n\t\tif (isElement$2(element) && nativeShadowRoots.includes(element.getRootNode())) return element;\n\t}\n\treturn doc.elementFromPoint(x, y);\n}\nfunction isElement$2(value) {\n\treturn isElement(value);\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/getpositionedancestor\n*/\n/**\n* Returns the element the given one is laid out against while absolutely positioned \u2013 the element whose padding\n* box its `top` and `left` are relative to. Returns `null` when there is nothing to compensate for: the element\n* is laid out against the initial containing block, is `position: fixed`, or is not rendered at all.\n*\n* Use it when turning a position measured against the viewport into the `top` and `left` to set on an absolutely\n* positioned element, by subtracting the returned element's padding-box offset \u2013 the way\n* {@link module:utils/dom/rect~Rect#toAbsoluteRect} and {@link module:utils/dom/position~getOptimalPosition} do.\n*\n* The layout-aware counterpart of `Element#offsetParent`, and what to reach for instead of it: this one follows\n* the **flattened tree**, the one the browser lays out, so it stays right for slotted content \u2013 an editor slotted\n* into a container component \u2013 where `offsetParent` names an element that does not lay that content out. Falls\n* back to `offsetParent` for slotted content inside a closed root, whose slot the DOM standard does not expose.\n*\n* @param element The native DOM element to be checked.\n*/\nfunction getPositionedAncestor(element) {\n\tif (!element || !element.isConnected) return null;\n\tconst offsetParent = element.offsetParent;\n\tif (!offsetParent) return null;\n\tconst slot = findSlotCloserThan(element, offsetParent);\n\tif (!slot) {\n\t\tif (offsetParent === offsetParent.ownerDocument.body && !isContainingBlock(offsetParent)) return null;\n\t\treturn offsetParent;\n\t}\n\tlet candidate = slot;\n\twhile (candidate.localName === \"slot\" && !isContainingBlock(candidate)) candidate = getLayoutParentElement(candidate);\n\tif (isContainingBlock(candidate)) return candidate;\n\treturn getPositionedAncestor(candidate);\n}\n/**\n* Walks outwards from the given node looking for the slot it is assigned to, and stops once `offsetParent` is\n* reached \u2013 so the result tells which of the two is nearer. A slot means the node tree and the flattened tree\n* part ways first; `null` means they agree all the way to `offsetParent`.\n*/\nfunction findSlotCloserThan(node, offsetParent) {\n\tlet current = node;\n\twhile (current && current !== offsetParent) {\n\t\tif (current.assignedSlot) return current.assignedSlot;\n\t\tcurrent = getParentElement(current);\n\t}\n\treturn null;\n}\n/**\n* `contain` values that include layout or paint containment, either of which makes an element the containing\n* block of its absolutely positioned descendants. `size` alone does not.\n*/\nconst CONTAINING_BLOCK_CONTAIN = /\\b(?:layout|paint|strict|content)\\b/;\n/**\n* `will-change` values naming a property that establishes a containing block on its own. `filter` also matches\n* `backdrop-filter`, which is intended.\n*/\nconst CONTAINING_BLOCK_WILL_CHANGE = /\\b(?:transform|perspective|filter|contain)\\b/;\n/**\n* Whether the given element is the containing block of its absolutely positioned descendants.\n*\n* Needed where `offsetParent` cannot answer: the slot a node is assigned to and the element above it, which it\n* cannot be asked about at all \u2013 it answers what lies *above* an element, never whether the element itself\n* qualifies \u2013 and ``, which it also names when nothing above the element establishes a containing block.\n* The property list is what Chrome establishes a containing block for, verified against `offsetParent`, which\n* agrees with the rendered result in every one of these cases.\n*/\nfunction isContainingBlock(element) {\n\tconst styles = element.ownerDocument.defaultView.getComputedStyle(element);\n\tif (styles.display === \"contents\") return false;\n\tif (styles.position !== \"static\") return true;\n\treturn isNonInitial(styles.transform, \"none\") || isNonInitial(styles.translate, \"none\") || isNonInitial(styles.rotate, \"none\") || isNonInitial(styles.scale, \"none\") || isNonInitial(styles.perspective, \"none\") || isNonInitial(styles.filter, \"none\") || isNonInitial(styles.backdropFilter, \"none\") || isNonInitial(styles.contentVisibility, \"visible\") || CONTAINING_BLOCK_CONTAIN.test(styles.contain) || CONTAINING_BLOCK_WILL_CHANGE.test(styles.willChange);\n}\n/**\n* Whether a computed value is something other than the property's initial value, which is what makes the\n* property establish a containing block.\n*\n* A property the browser does not know has no computed value at all, and the comparison alone would read that\n* as a value unlike the initial one. Something unsupported establishes nothing, so it answers `false` instead.\n*/\nfunction isNonInitial(value, initialValue) {\n\treturn !!value && value !== initialValue;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/getactiveelement\n*/\n/**\n* Returns the focused element in the tree the given node lives in.\n*\n* The shadow-aware replacement for `document.activeElement`, which reports the host of a shadow tree rather\n* than the focused element inside it. Pass any node from the tree whose focus is in question \u2013 typically the\n* element being checked itself. Works for open and closed roots alike.\n*\n* @param node The node whose tree's active element should be returned.\n*/\nfunction getActiveElement(node) {\n\treturn node.getRootNode().activeElement ?? null;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/getshadowroots\n*/\n/**\n* Returns every shadow root the given node renders in, innermost first.\n*\n* For code that has to act on *all* the shadow boundaries above a node \u2013 attaching listeners, injecting styles \u2013\n* rather than only the nearest one. Empty for a node in the light DOM, and one entry per boundary for a node\n* inside nested trees. Works for open and closed roots alike.\n*\n* Derived from the tree the node sits in, not from whether that tree is in a document: a node inside a shadow\n* root reports that root even while its host is detached, because `attachShadow()` makes the shadow tree \u2013 and\n* its root \u2013 real right away. Callers that only care about the roots a node is currently *rendered* in should\n* check `Node#isConnected` themselves.\n*\n* @param node The node to collect the hosting shadow roots of.\n*/\nfunction getShadowRoots(node) {\n\tconst shadowRoots = [];\n\tlet current = node;\n\twhile (current) {\n\t\tif (isShadowRoot(current)) shadowRoots.push(current);\n\t\tcurrent = getLayoutParentNode(current);\n\t}\n\treturn shadowRoots;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/getoverlaymountroot\n*/\n/**\n* Returns the DOM tree that a feature's floating UI \u2013 its balloons, dialogs and tooltips \u2013 should be put in:\n* the same one the feature itself is in.\n*\n* Floating UI would otherwise go into `document.body`. That is outside the shadow root an editor may live in,\n* so the UI would leave the tree the editor's styles were loaded into, and lose them.\n*\n* Being in the same tree means one of three things:\n*\n* * the shadow root the given element is in, if it is in one. A shadow root passed in returns itself.\n* * the `` of that element's own document otherwise, so an editor in an iframe stays in that iframe.\n* * `null` while the element is detached, because there is no telling yet which tree it will end up in. Put\n* the UI nowhere for now and ask again once the element is in the DOM.\n*\n* Feed the result to {@link module:ui/editorui/bodycollection~BodyCollection#syncMountTarget}, and call this\n* again whenever the element may have moved. Works with open and closed shadow roots.\n*\n* @param containerNode The element the floating UI belongs to \u2013 usually the feature's container.\n*/\nfunction getOverlayMountRoot(containerNode) {\n\tif (!containerNode.isConnected) return null;\n\tconst root = containerNode.getRootNode();\n\treturn isNativeShadowRoot(root) ? root : containerNode.ownerDocument.body;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/adoptglobalstylesheet\n*/\n/**\n* The stylesheet text already adopted into a document, so the same rules are adopted once no matter how many\n* editors ask for them, or how many times.\n*/\nconst adoptedStyleSheets = /* @__PURE__ */ new WeakMap();\n/**\n* Ships a stylesheet that has to reach the light DOM, whatever tree the editor itself lives in.\n*\n* For the few rules that a shadow-scoped theme stylesheet cannot express, because they style nodes no shadow\n* root can contain: the `` and `` elements, or third-party UI mounted in `document.body`. Anything\n* that styles the editor UI belongs in a theme stylesheet instead, where an integrator can see and override it.\n*\n* Safe to call from any number of editors sharing a document, and at any time: the same stylesheet text is\n* adopted once per document. The stylesheet then stays for the lifetime of the document, inert unless the\n* classes it targets are present.\n*\n* @param doc The document to adopt the stylesheet into.\n* @param css The stylesheet text. Pass a constant \u2013 repeated calls with the same text are a no-op.\n*/\nfunction adoptGlobalStyleSheet(doc, css) {\n\tconst adopted = adoptedStyleSheets.get(doc) || /* @__PURE__ */ new Set();\n\tadoptedStyleSheets.set(doc, adopted);\n\tif (adopted.has(css)) return;\n\tadopted.add(css);\n\tconst styleSheet = new doc.defaultView.CSSStyleSheet();\n\tstyleSheet.replaceSync(css);\n\tdoc.adoptedStyleSheets.push(styleSheet);\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\nfunction toArray(data) {\n\treturn Array.isArray(data) ? data : [data];\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* Returns `true` if the given selection is backward, that is, if its `focus` is positioned before its `anchor`.\n*\n* A replacement for reading `Selection#direction`, which is absent on older engines and reports `'none'` for a\n* selection made with the mouse inside a shadow root. The orientation is then recovered from the anchor and\n* focus positions instead, so an answer is always available.\n*\n* @param selection The selection to check.\n*/\nfunction isDomSelectionBackward(selection) {\n\tif (selection.isCollapsed) return false;\n\tif (\"direction\" in selection && selection.direction != \"none\") return selection.direction == \"backward\";\n\tconst range = selection.anchorNode.ownerDocument.createRange();\n\ttry {\n\t\trange.setStart(selection.anchorNode, selection.anchorOffset);\n\t\trange.setEnd(selection.focusNode, selection.focusOffset);\n\t} catch {\n\t\treturn false;\n\t}\n\tconst backward = range.collapsed;\n\trange.detach();\n\treturn backward;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/iscomment\n*/\n/**\n* Checks whether the object is a native DOM Comment node.\n*/\nfunction isComment(obj) {\n\treturn obj && obj.nodeType === Node.COMMENT_NODE;\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/istext\n*/\n/**\n* Checks if the object is a native DOM Text node.\n*/\nfunction isText(obj) {\n\treturn Object.prototype.toString.call(obj) == \"[object Text]\";\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/getselection\n*/\n/**\n* Returns the selection of the tree the given node lives in.\n*\n* Use it instead of `window.getSelection()`, which cannot see into a shadow root: its `anchorNode` and\n* `focusNode` point at the host of the tree, not at the nodes selected inside it.\n*\n* Pass the node the selection is read for, usually an editable. Pass several nodes to cover several editables\n* at once. A node in the light DOM gives the document selection, unchanged. Works with open and closed shadow\n* roots.\n*\n* The result behaves like a `Selection` \u2013 the part of one the editor uses \u2013 so read it and change it the same\n* way. It is `null` when there is no selection to read: a detached node, or a document with no window.\n*\n* One thing this helper cannot fix. In Safari and Chromium browsers, a selection made with the mouse inside a\n* shadow root reports no direction, so a backward selection may look forward. Chromium is asked through its own\n* API where possible. Safari has none.\n*\n* @param nodeOrNodes The node (or nodes) whose tree's selection should be returned.\n*/\nfunction getSelection(nodeOrNodes) {\n\tconst nodes = toArray(nodeOrNodes);\n\tif (!nodes.length) return null;\n\tconst shadowRoots = /* @__PURE__ */ new Set();\n\tfor (const node of nodes) {\n\t\tconst treeRoot = node.getRootNode();\n\t\tif (isNativeShadowRoot(treeRoot)) shadowRoots.add(treeRoot);\n\t}\n\tif (shadowRoots.size) {\n\t\tconst [firstShadowRoot] = shadowRoots;\n\t\tconst domWindow = firstShadowRoot.ownerDocument.defaultView;\n\t\tif (!domWindow) return null;\n\t\tconst domSelection = domWindow.getSelection();\n\t\tif (domSelection && typeof domSelection.getComposedRanges == \"function\") return new ShadowSelection(domSelection, Array.from(shadowRoots));\n\t\tfor (const shadowRoot of shadowRoots) {\n\t\t\tconst shadowRootSelection = shadowRoot;\n\t\t\tif (typeof shadowRootSelection.getSelection == \"function\") {\n\t\t\t\tconst selection = shadowRootSelection.getSelection();\n\t\t\t\tif (selection?.anchorNode) return selection;\n\t\t\t}\n\t\t}\n\t\treturn domSelection;\n\t}\n\tfor (const node of nodes) {\n\t\tif (!node.isConnected) continue;\n\t\tconst domWindow = node.ownerDocument?.defaultView;\n\t\tif (domWindow) return domWindow.getSelection();\n\t}\n\treturn null;\n}\n/**\n* A `Selection` view over the composed ranges of a set of shadow roots. Read accessors are resolved live\n* from the composed ranges on each access, so the view stays in sync with the underlying document selection;\n* selection mutations are delegated to it. Only the subset of the `Selection` interface consumed by the\n* editor is implemented, so `getSelection()` returns it alongside the native `Selection`.\n*/\nvar ShadowSelection = class ShadowSelection {\n\t/**\n\t* The underlying document-level selection that mutations are delegated to and composed ranges read\n\t* from.\n\t*/\n\t_domSelection;\n\t/**\n\t* The shadow roots the composed ranges are resolved against.\n\t*/\n\t_shadowRoots;\n\t/**\n\t* Whether the engine only accepts the legacy rest-parameter form of `getComposedRanges()`. This is\n\t* a fixed property of the engine, so it is detected once (the first call throws on the dictionary\n\t* form) and cached for all instances, keeping the exception off the selection-read hot path.\n\t*/\n\tstatic _useLegacyComposedRanges = false;\n\t/**\n\t* @internal\n\t*/\n\tconstructor(domSelection, shadowRoots) {\n\t\tthis._domSelection = domSelection;\n\t\tthis._shadowRoots = shadowRoots;\n\t}\n\tget rangeCount() {\n\t\treturn this._getRanges().length;\n\t}\n\tget isCollapsed() {\n\t\tconst ranges = this._getRanges();\n\t\treturn !ranges.length || ranges[0].collapsed;\n\t}\n\tget anchorNode() {\n\t\treturn this._getEndpoint(\"anchor\").node;\n\t}\n\tget anchorOffset() {\n\t\treturn this._getEndpoint(\"anchor\").offset;\n\t}\n\tget focusNode() {\n\t\treturn this._getEndpoint(\"focus\").node;\n\t}\n\tget focusOffset() {\n\t\treturn this._getEndpoint(\"focus\").offset;\n\t}\n\t/**\n\t* The direction of the selection, resolved against the tree the first composed range lives in. It is\n\t* already computed to orient the anchor and focus endpoints, so exposing it lets consumers read the\n\t* orientation directly instead of re-deriving it from the endpoints.\n\t*/\n\tget direction() {\n\t\tconst ranges = this._getRanges();\n\t\tif (!ranges.length) return \"none\";\n\t\treturn this._getDirection(ranges[0].startContainer.getRootNode());\n\t}\n\tgetRangeAt(index) {\n\t\tconst staticRange = this._getRanges()[index];\n\t\tif (!staticRange) throw new DOMException(`Index ${index} is out of range.`, \"IndexSizeError\");\n\t\tconst range = this._shadowRoots[0].ownerDocument.createRange();\n\t\trange.setStart(staticRange.startContainer, staticRange.startOffset);\n\t\trange.setEnd(staticRange.endContainer, staticRange.endOffset);\n\t\treturn range;\n\t}\n\tremoveAllRanges() {\n\t\tthis._domSelection.removeAllRanges();\n\t}\n\taddRange(range) {\n\t\tthis._domSelection.addRange(range);\n\t}\n\tcollapse(node, offset) {\n\t\tthis._domSelection.collapse(node, offset);\n\t}\n\textend(node, offset) {\n\t\tthis._domSelection.extend(node, offset);\n\t}\n\tsetBaseAndExtent(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t\tthis._domSelection.setBaseAndExtent(anchorNode, anchorOffset, focusNode, focusOffset);\n\t}\n\t/**\n\t* The composed ranges fully contained in one of the trees on the path from the given nodes to the\n\t* document, in document order (start before end).\n\t*\n\t* Only ranges whose both endpoints resolve into the same tree can be represented as a live, single-tree\n\t* `Range`. A range crossing a shadow boundary is therefore dropped, and so is one resolving into an\n\t* unrelated tree, rather than surfacing foreign nodes. The document itself is one of those trees: it is\n\t* where every node ends up when walking out of its shadow roots, and it is where a selection made in a\n\t* sibling light-DOM editable lives, so such a selection is kept rather than dropped.\n\t*\n\t* A range with an endpoint outside its container is dropped as well, see `isOffsetInNode()` below.\n\t*/\n\t_getRanges() {\n\t\tconst domDocument = this._shadowRoots[0].ownerDocument;\n\t\treturn this._getComposedRanges().filter((range) => {\n\t\t\tconst rootNode = range.startContainer.getRootNode();\n\t\t\tif (rootNode != range.endContainer.getRootNode()) return false;\n\t\t\tif (rootNode != domDocument && !this._shadowRoots.includes(rootNode)) return false;\n\t\t\treturn isOffsetInNode(range.startContainer, range.startOffset) && isOffsetInNode(range.endContainer, range.endOffset);\n\t\t});\n\t}\n\t/**\n\t* The raw composed ranges reported for the shadow roots by the underlying selection.\n\t*/\n\t_getComposedRanges() {\n\t\tconst domSelection = this._domSelection;\n\t\tconst shadowRoots = this._shadowRoots;\n\t\tif (ShadowSelection._useLegacyComposedRanges) return domSelection.getComposedRanges(...shadowRoots);\n\t\ttry {\n\t\t\treturn domSelection.getComposedRanges({ shadowRoots });\n\t\t} catch {\n\t\t\tShadowSelection._useLegacyComposedRanges = true;\n\t\t\treturn domSelection.getComposedRanges(...shadowRoots);\n\t\t}\n\t}\n\t/**\n\t* The direction of the underlying selection, preferring the one reported by Blink's shadow-scoped\n\t* selection, which stays meaningful for a mouse selection made inside a shadow root.\n\t*/\n\t_getDirection(rootNode) {\n\t\tconst shadowRootSelection = rootNode.getSelection?.();\n\t\tif (shadowRootSelection) {\n\t\t\tif (shadowRootSelection.direction && shadowRootSelection.direction != \"none\") return shadowRootSelection.direction;\n\t\t\tif (shadowRootSelection.anchorNode) return isDomSelectionBackward(shadowRootSelection) ? \"backward\" : \"forward\";\n\t\t}\n\t\treturn this._domSelection.direction ?? \"forward\";\n\t}\n\t/**\n\t* The anchor or focus endpoint of the first composed range.\n\t*\n\t* `getComposedRanges()` returns ranges in document order (start before end); the anchor/focus\n\t* orientation therefore has to come from `Selection#direction`. Known limitation: WebKit and Blink\n\t* report `direction` as `'none'` for a selection made *with the mouse* inside a shadow root (a\n\t* keyboard selection reports it correctly). Blink's shadow-scoped selection still knows the direction\n\t* in that case, so it is consulted first; it is of no use for the ranges themselves, as it covers\n\t* a single tree only. Safari has no such API, so its mouse selections fall back to forward.\n\t*/\n\t_getEndpoint(endpoint) {\n\t\tconst ranges = this._getRanges();\n\t\tif (!ranges.length) return {\n\t\t\tnode: null,\n\t\t\toffset: 0\n\t\t};\n\t\tconst range = ranges[0];\n\t\tconst isBackward = this._getDirection(range.startContainer.getRootNode()) == \"backward\";\n\t\treturn (endpoint == \"anchor\" ? !isBackward : isBackward) ? {\n\t\t\tnode: range.startContainer,\n\t\t\toffset: range.startOffset\n\t\t} : {\n\t\t\tnode: range.endContainer,\n\t\t\toffset: range.endOffset\n\t\t};\n\t}\n};\n/**\n* Whether the offset is a position the container can actually hold: within its text for a character-data\n* node, within its children for any other node.\n*\n* Unlike a `Range`, a `StaticRange` is not validated, so the offsets `getComposedRanges()` returns may\n* point past the end of their containers. Safari can report a range describing the tree as it was before\n* the last DOM mutation, so an offset can outlive the children it pointed at, for example while rendering\n* a change that removed the last child of a container. Such an endpoint has no position to resolve to and\n* cannot be turned into a `Range` (which validates and throws an `IndexSizeError`), so the whole range is\n* left out rather than reported as an out-of-bounds position.\n*/\nfunction isOffsetInNode(node, offset) {\n\treturn offset <= (isText(node) || isComment(node) ? node.length : node.childNodes.length);\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/isrange\n*/\n/**\n* Checks if the object is a native DOM Range.\n*/\nfunction isRange(obj) {\n\treturn Object.prototype.toString.apply(obj) == \"[object Range]\";\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/rect\n*/\nconst RECT_PROPERTIES = [\n\t\"top\",\n\t\"right\",\n\t\"bottom\",\n\t\"left\",\n\t\"width\",\n\t\"height\"\n];\nconst POSITIONING_VALUES = /* @__PURE__ */ new Set([\n\t\"relative\",\n\t\"absolute\",\n\t\"fixed\",\n\t\"sticky\"\n]);\n/**\n* A helper class representing a `ClientRect` object, e.g. value returned by\n* the native `object.getBoundingClientRect()` method. Provides a set of methods\n* to manipulate the rect and compare it against other rect instances.\n*/\nvar Rect = class Rect {\n\t/**\n\t* The \"top\" value of the rect.\n\t*\n\t* @readonly\n\t*/\n\ttop;\n\t/**\n\t* The \"right\" value of the rect.\n\t*\n\t* @readonly\n\t*/\n\tright;\n\t/**\n\t* The \"bottom\" value of the rect.\n\t*\n\t* @readonly\n\t*/\n\tbottom;\n\t/**\n\t* The \"left\" value of the rect.\n\t*\n\t* @readonly\n\t*/\n\tleft;\n\t/**\n\t* The \"width\" value of the rect.\n\t*\n\t* @readonly\n\t*/\n\twidth;\n\t/**\n\t* The \"height\" value of the rect.\n\t*\n\t* @readonly\n\t*/\n\theight;\n\t/**\n\t* The object this rect is for.\n\t*\n\t* @readonly\n\t*/\n\t_source;\n\t/**\n\t* Creates an instance of rect.\n\t*\n\t* ```ts\n\t* // Rect of an HTMLElement.\n\t* const rectA = new Rect( document.body );\n\t*\n\t* // Rect of a DOM Range.\n\t* const rectB = new Rect( document.getSelection().getRangeAt( 0 ) );\n\t*\n\t* // Rect of a window (web browser viewport).\n\t* const rectC = new Rect( window );\n\t*\n\t* // Rect out of an object.\n\t* const rectD = new Rect( { top: 0, right: 10, bottom: 10, left: 0, width: 10, height: 10 } );\n\t*\n\t* // Rect out of another Rect instance.\n\t* const rectE = new Rect( rectD );\n\t*\n\t* // Rect out of a ClientRect.\n\t* const rectF = new Rect( document.body.getClientRects().item( 0 ) );\n\t* ```\n\t*\n\t* **Note**: By default a rect of an HTML element includes its CSS borders and scrollbars (if any)\n\t* ant the rect of a `window` includes scrollbars too. Use {@link #excludeScrollbarsAndBorders}\n\t* to get the inner part of the rect.\n\t*\n\t* @param source A source object to create the rect.\n\t*/\n\tconstructor(source) {\n\t\tconst isSourceRange = isRange(source);\n\t\tObject.defineProperty(this, \"_source\", {\n\t\t\tvalue: source._source || source,\n\t\t\twritable: true,\n\t\t\tenumerable: false\n\t\t});\n\t\tif (isDomElement(source) || isSourceRange) {\n\t\t\tif (isSourceRange) {\n\t\t\t\tconst rangeRects = Rect.getDomRangeRects(source);\n\t\t\t\tcopyRectProperties(this, Rect.getBoundingRect(rangeRects));\n\t\t\t} else copyRectProperties(this, source.getBoundingClientRect());\n\t\t} else if (isWindow(source)) {\n\t\t\tconst { innerWidth, innerHeight } = source;\n\t\t\tcopyRectProperties(this, {\n\t\t\t\ttop: 0,\n\t\t\t\tright: innerWidth,\n\t\t\t\tbottom: innerHeight,\n\t\t\t\tleft: 0,\n\t\t\t\twidth: innerWidth,\n\t\t\t\theight: innerHeight\n\t\t\t});\n\t\t} else copyRectProperties(this, source);\n\t}\n\t/**\n\t* Returns a clone of the rect.\n\t*\n\t* @returns A cloned rect.\n\t*/\n\tclone() {\n\t\treturn new Rect(this);\n\t}\n\t/**\n\t* Moves the rect so that its upper\u2013left corner lands in desired `[ x, y ]` location.\n\t*\n\t* @param x Desired horizontal location.\n\t* @param y Desired vertical location.\n\t* @returns A rect which has been moved.\n\t*/\n\tmoveTo(x, y) {\n\t\tthis.top = y;\n\t\tthis.right = x + this.width;\n\t\tthis.bottom = y + this.height;\n\t\tthis.left = x;\n\t\treturn this;\n\t}\n\t/**\n\t* Moves the rect in\u2013place by a dedicated offset.\n\t*\n\t* @param x A horizontal offset.\n\t* @param y A vertical offset\n\t* @returns A rect which has been moved.\n\t*/\n\tmoveBy(x, y) {\n\t\tthis.top += y;\n\t\tthis.right += x;\n\t\tthis.left += x;\n\t\tthis.bottom += y;\n\t\treturn this;\n\t}\n\t/**\n\t* Returns a new rect a a result of intersection with another rect.\n\t*/\n\tgetIntersection(anotherRect) {\n\t\tconst rect = {\n\t\t\ttop: Math.max(this.top, anotherRect.top),\n\t\t\tright: Math.min(this.right, anotherRect.right),\n\t\t\tbottom: Math.min(this.bottom, anotherRect.bottom),\n\t\t\tleft: Math.max(this.left, anotherRect.left),\n\t\t\twidth: 0,\n\t\t\theight: 0\n\t\t};\n\t\trect.width = rect.right - rect.left;\n\t\trect.height = rect.bottom - rect.top;\n\t\tif (rect.width < 0 || rect.height < 0) return null;\n\t\telse {\n\t\t\tconst newRect = new Rect(rect);\n\t\t\tnewRect._source = this._source;\n\t\t\treturn newRect;\n\t\t}\n\t}\n\t/**\n\t* Returns the area of intersection with another rect.\n\t*\n\t* @returns Area of intersection.\n\t*/\n\tgetIntersectionArea(anotherRect) {\n\t\tconst rect = this.getIntersection(anotherRect);\n\t\tif (rect) return rect.getArea();\n\t\telse return 0;\n\t}\n\t/**\n\t* Returns the area of the rect.\n\t*/\n\tgetArea() {\n\t\treturn this.width * this.height;\n\t}\n\t/**\n\t* Returns a new rect, a part of the original rect, which is actually visible to the user and is relative to the,`body`,\n\t* e.g. an original rect cropped by parent element rects which have `overflow` set in CSS\n\t* other than `\"visible\"`.\n\t*\n\t* If there's no such visible rect, which is when the rect is limited by one or many of\n\t* the ancestors, `null` is returned.\n\t*\n\t* **Note**: This method does not consider the boundaries of the viewport (window).\n\t* To get a rect cropped by all ancestors and the viewport, use an intersection such as:\n\t*\n\t* ```ts\n\t* const visibleInViewportRect = new Rect( window ).getIntersection( new Rect( source ).getVisible() );\n\t* ```\n\t*\n\t* **Note**: The ancestor walk crosses shadow DOM boundaries, continuing from the host element of a shadow\n\t* root instead of stopping at it, so a rect inside a shadow tree is still cropped by the ancestors in the\n\t* surrounding document. Works for open and closed shadow roots alike.\n\t*\n\t* @returns A visible rect instance or `null`, if there's none.\n\t*/\n\tgetVisible() {\n\t\tconst source = this._source;\n\t\tlet visibleRect = this.clone();\n\t\tif (isBody(source)) return visibleRect;\n\t\tlet child = source;\n\t\tlet parent = null;\n\t\tif (isDomElement(source)) parent = getLayoutParentElement(source);\n\t\telse if (isRange(source)) {\n\t\t\tconst container = source.commonAncestorContainer;\n\t\t\tparent = isShadowRoot(container) ? container.host : container;\n\t\t}\n\t\tlet lastPositionedChildElement;\n\t\twhile (parent && !isBody(parent)) {\n\t\t\tconst isNonClippingParent = getElementOverflow(parent) === \"visible\";\n\t\t\tif (isPositioned(child)) lastPositionedChildElement = child;\n\t\t\tif (isNonClippingParent || lastPositionedChildElement && getElementPosition(lastPositionedChildElement) === \"absolute\" && !isPositioned(parent)) {\n\t\t\t\tchild = parent;\n\t\t\t\tparent = getLayoutParentElement(parent);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst parentRect = new Rect(parent);\n\t\t\tconst intersectionRect = visibleRect.getIntersection(parentRect);\n\t\t\tif (intersectionRect) {\n\t\t\t\tif (intersectionRect.getArea() < visibleRect.getArea()) visibleRect = intersectionRect;\n\t\t\t} else return null;\n\t\t\tchild = parent;\n\t\t\tparent = getLayoutParentElement(parent);\n\t\t}\n\t\treturn visibleRect;\n\t}\n\t/**\n\t* Checks if all property values ({@link #top}, {@link #left}, {@link #right},\n\t* {@link #bottom}, {@link #width} and {@link #height}) are the equal in both rect\n\t* instances.\n\t*\n\t* @param anotherRect A rect instance to compare with.\n\t* @returns `true` when Rects are equal. `false` otherwise.\n\t*/\n\tisEqual(anotherRect) {\n\t\tfor (const prop of RECT_PROPERTIES) if (this[prop] !== anotherRect[prop]) return false;\n\t\treturn true;\n\t}\n\t/**\n\t* Checks whether a rect fully contains another rect instance.\n\t*\n\t* @param anotherRect\n\t* @returns `true` if contains, `false` otherwise.\n\t*/\n\tcontains(anotherRect) {\n\t\tconst intersectRect = this.getIntersection(anotherRect);\n\t\treturn !!(intersectRect && intersectRect.isEqual(anotherRect));\n\t}\n\t/**\n\t* Recalculates screen coordinates to coordinates relative to the positioned ancestor offset.\n\t*/\n\ttoAbsoluteRect() {\n\t\tconst { scrollX, scrollY } = globalVar.window;\n\t\tconst absoluteRect = this.clone().moveBy(scrollX, scrollY);\n\t\tif (isDomElement(absoluteRect._source)) {\n\t\t\tconst positionedAncestor = getPositionedAncestor(absoluteRect._source);\n\t\t\tif (positionedAncestor) shiftRectToCompensatePositionedAncestor(absoluteRect, positionedAncestor);\n\t\t}\n\t\treturn absoluteRect;\n\t}\n\t/**\n\t* Excludes scrollbars and CSS borders from the rect.\n\t*\n\t* * Borders are removed when {@link #_source} is an HTML element.\n\t* * Scrollbars are excluded from HTML elements and the `window`.\n\t*\n\t* @returns A rect which has been updated.\n\t*/\n\texcludeScrollbarsAndBorders() {\n\t\tconst source = this._source;\n\t\tlet scrollBarWidth, scrollBarHeight, direction;\n\t\tif (isWindow(source)) {\n\t\t\tscrollBarWidth = source.innerWidth - source.document.documentElement.clientWidth;\n\t\t\tscrollBarHeight = source.innerHeight - source.document.documentElement.clientHeight;\n\t\t\tdirection = source.getComputedStyle(source.document.documentElement).direction;\n\t\t} else {\n\t\t\tconst borderWidths = getBorderWidths(source);\n\t\t\tscrollBarWidth = source.offsetWidth - source.clientWidth - borderWidths.left - borderWidths.right;\n\t\t\tscrollBarHeight = source.offsetHeight - source.clientHeight - borderWidths.top - borderWidths.bottom;\n\t\t\tdirection = source.ownerDocument.defaultView.getComputedStyle(source).direction;\n\t\t\tthis.left += borderWidths.left;\n\t\t\tthis.top += borderWidths.top;\n\t\t\tthis.right -= borderWidths.right;\n\t\t\tthis.bottom -= borderWidths.bottom;\n\t\t\tthis.width = this.right - this.left;\n\t\t\tthis.height = this.bottom - this.top;\n\t\t}\n\t\tthis.width -= scrollBarWidth;\n\t\tif (direction === \"ltr\") this.right -= scrollBarWidth;\n\t\telse this.left += scrollBarWidth;\n\t\tthis.height -= scrollBarHeight;\n\t\tthis.bottom -= scrollBarHeight;\n\t\treturn this;\n\t}\n\t/**\n\t* Returns an array of rects of the given native DOM Range.\n\t*\n\t* Also see {@link module:utils/dom/rect~Rect.getDomElementRects}.\n\t*\n\t* @param range A native DOM range.\n\t* @returns DOM Range rects.\n\t*/\n\tstatic getDomRangeRects(range) {\n\t\tconst rects = [];\n\t\tconst clientRects = Array.from(range.getClientRects());\n\t\tif (clientRects.length) for (const rect of clientRects) {\n\t\t\tconst r = new Rect(rect);\n\t\t\tr._source = range;\n\t\t\trects.push(r);\n\t\t}\n\t\telse {\n\t\t\tlet startContainer = range.startContainer;\n\t\t\tif (isText(startContainer)) startContainer = getParentElement(startContainer);\n\t\t\tconst rect = new Rect(startContainer.getBoundingClientRect());\n\t\t\trect.right = rect.left;\n\t\t\trect.width = 0;\n\t\t\trects.push(rect);\n\t\t}\n\t\treturn rects;\n\t}\n\t/**\n\t* Returns an array of Rects of the given DOM Element based on its native `getClientRects()` method.\n\t*\n\t* Also see {@link module:utils/dom/rect~Rect.getDomRangeRects}.\n\t*/\n\tstatic getDomElementRects(element) {\n\t\treturn Array.from(element.getClientRects()).map((clientRect) => {\n\t\t\tconst rect = new Rect(clientRect);\n\t\t\trect._source = element;\n\t\t\treturn rect;\n\t\t});\n\t}\n\t/**\n\t* Returns a bounding rectangle that contains all the given `rects`.\n\t*\n\t* @param rects A list of rectangles that should be contained in the result rectangle.\n\t* @returns Bounding rectangle or `null` if no `rects` were given.\n\t*/\n\tstatic getBoundingRect(rects) {\n\t\tconst boundingRectData = {\n\t\t\tleft: Number.POSITIVE_INFINITY,\n\t\t\ttop: Number.POSITIVE_INFINITY,\n\t\t\tright: Number.NEGATIVE_INFINITY,\n\t\t\tbottom: Number.NEGATIVE_INFINITY,\n\t\t\twidth: 0,\n\t\t\theight: 0\n\t\t};\n\t\tlet rectangleCount = 0;\n\t\tfor (const rect of rects) {\n\t\t\trectangleCount++;\n\t\t\tboundingRectData.left = Math.min(boundingRectData.left, rect.left);\n\t\t\tboundingRectData.top = Math.min(boundingRectData.top, rect.top);\n\t\t\tboundingRectData.right = Math.max(boundingRectData.right, rect.right);\n\t\t\tboundingRectData.bottom = Math.max(boundingRectData.bottom, rect.bottom);\n\t\t}\n\t\tif (rectangleCount == 0) return null;\n\t\tboundingRectData.width = boundingRectData.right - boundingRectData.left;\n\t\tboundingRectData.height = boundingRectData.bottom - boundingRectData.top;\n\t\treturn new Rect(boundingRectData);\n\t}\n};\n/**\n* Acquires all the rect properties from the passed source.\n*/\nfunction copyRectProperties(rect, source) {\n\tfor (const p of RECT_PROPERTIES) rect[p] = source[p];\n}\n/**\n* Checks if provided object is a HTML element.\n*/\nfunction isBody(value) {\n\tif (!isDomElement(value)) return false;\n\treturn value === value.ownerDocument.body;\n}\n/**\n* Checks if provided object \"looks like\" a DOM Element and has API required by `Rect` class.\n*/\nfunction isDomElement(value) {\n\treturn value !== null && typeof value === \"object\" && value.nodeType === 1 && typeof value.getBoundingClientRect === \"function\";\n}\n/**\n* Returns the value of the `position` style of an `HTMLElement`.\n*/\nfunction getElementPosition(element) {\n\treturn element.ownerDocument.defaultView.getComputedStyle(element).position;\n}\n/**\n* Returns the value of the `overflow` style of an `HTMLElement` or a `Range`.\n*/\nfunction getElementOverflow(element) {\n\treturn element instanceof HTMLElement ? element.ownerDocument.defaultView.getComputedStyle(element).overflow : \"visible\";\n}\n/**\n* Checks if the given node is positioned in any other way than `position: static`.\n*/\nfunction isPositioned(node) {\n\treturn node instanceof HTMLElement && POSITIONING_VALUES.has(getElementPosition(node));\n}\n/**\n* For a given absolute Rect coordinates object and a positioned element ancestor, it updates its\n* coordinates that make up for the position and the scroll of the ancestor.\n*\n* This is necessary because while Rects (and DOMRects) are relative to the browser's viewport, their coordinates\n* are used in real\u2013life to position elements with `position: absolute`, which are scoped by any positioned\n* (and scrollable) ancestors.\n*/\nfunction shiftRectToCompensatePositionedAncestor(rect, positionedElementAncestor) {\n\tconst ancestorPosition = new Rect(positionedElementAncestor);\n\tconst ancestorBorderWidths = getBorderWidths(positionedElementAncestor);\n\tlet moveX = 0;\n\tlet moveY = 0;\n\tmoveX -= ancestorPosition.left;\n\tmoveY -= ancestorPosition.top;\n\tmoveX += positionedElementAncestor.scrollLeft;\n\tmoveY += positionedElementAncestor.scrollTop;\n\tmoveX -= ancestorBorderWidths.left;\n\tmoveY -= ancestorBorderWidths.top;\n\trect.moveBy(moveX, moveY);\n}\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/resizeobserver\n*/\n/**\n* A helper class which instances allow performing custom actions when native DOM elements are resized.\n*\n* ```ts\n* const editableElement = editor.editing.view.getDomRoot();\n*\n* const observer = new ResizeObserver( editableElement, entry => {\n* \tconsole.log( 'The editable element has been resized in DOM.' );\n* \tconsole.log( entry.target ); // -> editableElement\n* \tconsole.log( entry.contentRect.width ); // -> e.g. '423px'\n* } );\n* ```\n*\n* It uses the [native DOM resize observer](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver)\n* under the hood.\n*/\nvar ResizeObserver = class ResizeObserver {\n\t/**\n\t* The element observed by this observer.\n\t*/\n\t_element;\n\t/**\n\t* The callback executed each time {@link #_element} is resized.\n\t*/\n\t_callback;\n\t/**\n\t* The single native observer instance shared across all {@link module:utils/dom/resizeobserver~ResizeObserver} instances.\n\t*/\n\tstatic _observerInstance = null;\n\t/**\n\t* A mapping of native DOM elements and their callbacks shared across all\n\t* {@link module:utils/dom/resizeobserver~ResizeObserver} instances.\n\t*/\n\tstatic _elementCallbacks = null;\n\t/**\n\t* Creates an instance of the `ResizeObserver` class.\n\t*\n\t* @param element A DOM element that is to be observed for resizing. Note that\n\t* the element must be visible (i.e. not detached from DOM) for the observer to work.\n\t* @param callback A function called when the observed element was resized. It passes\n\t* the [`ResizeObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry)\n\t* object with information about the resize event.\n\t*/\n\tconstructor(element, callback) {\n\t\tif (!ResizeObserver._observerInstance) ResizeObserver._createObserver();\n\t\tthis._element = element;\n\t\tthis._callback = callback;\n\t\tResizeObserver._addElementCallback(element, callback);\n\t\tResizeObserver._observerInstance.observe(element);\n\t}\n\t/**\n\t* The element observed by this observer.\n\t*/\n\tget element() {\n\t\treturn this._element;\n\t}\n\t/**\n\t* Destroys the observer which disables the `callback` passed to the {@link #constructor}.\n\t*/\n\tdestroy() {\n\t\tResizeObserver._deleteElementCallback(this._element, this._callback);\n\t}\n\t/**\n\t* Registers a new resize callback for the DOM element.\n\t*/\n\tstatic _addElementCallback(element, callback) {\n\t\tif (!ResizeObserver._elementCallbacks) ResizeObserver._elementCallbacks = /* @__PURE__ */ new Map();\n\t\tlet callbacks = ResizeObserver._elementCallbacks.get(element);\n\t\tif (!callbacks) {\n\t\t\tcallbacks = /* @__PURE__ */ new Set();\n\t\t\tResizeObserver._elementCallbacks.set(element, callbacks);\n\t\t}\n\t\tcallbacks.add(callback);\n\t}\n\t/**\n\t* Removes a resize callback from the DOM element. If no callbacks are left\n\t* for the element, it removes the element from the native observer.\n\t*/\n\tstatic _deleteElementCallback(element, callback) {\n\t\tconst callbacks = ResizeObserver._getElementCallbacks(element);\n\t\tif (callbacks) {\n\t\t\tcallbacks.delete(callback);\n\t\t\tif (!callbacks.size) {\n\t\t\t\tResizeObserver._elementCallbacks.delete(element);\n\t\t\t\tResizeObserver._observerInstance.unobserve(element);\n\t\t\t}\n\t\t}\n\t\tif (ResizeObserver._elementCallbacks && !ResizeObserver._elementCallbacks.size) {\n\t\t\tResizeObserver._observerInstance = null;\n\t\t\tResizeObserver._elementCallbacks = null;\n\t\t}\n\t}\n\t/**\n\t* Returns are registered resize callbacks for the DOM element.\n\t*/\n\tstatic _getElementCallbacks(element) {\n\t\tif (!ResizeObserver._elementCallbacks) return null;\n\t\treturn ResizeObserver._elementCallbacks.get(element);\n\t}\n\t/**\n\t* Creates the single native observer shared across all `ResizeObserver` instances.\n\t*/\n\tstatic _createObserver() {\n\t\tResizeObserver._observerInstance = new globalVar.window.ResizeObserver((entries) => {\n\t\t\tfor (const entry of entries) {\n\t\t\t\tconst callbacks = ResizeObserver._getElementCallbacks(entry.target);\n\t\t\t\tif (callbacks) for (const callback of callbacks) callback(entry);\n\t\t\t}\n\t\t});\n\t}\n};\n\n/**\n* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n*/\n/**\n* @module utils/dom/trustedtypes\n*/\n/**\n* The name of the editor's policy. An application that enforces Trusted Types must list it in the `trusted-types` CSP\n* directive, or the browser refuses to create the policy.\n*/\nconst POLICY_NAME = \"ckeditor5\";\n/**\n* An object whose methods return the string they were given. The browser builds the editor's policy from it, because the\n* editor writes markup that it created itself, and content that the application loaded into it. It also takes the place of\n* that policy when the editor cannot have one, so that both cases behave the same way.\n*/\nconst PASS_THROUGH = {\n\tcreateHTML: (input) => input,\n\tcreateScript: (input) => input,\n\tcreateScriptURL: (input) => input\n};\n/**\n* The editor's policy, created on first use. The browser allows each policy name only once per document, so a single\n* policy is shared by every editor in the document, by all roots of a multi-root editor, and by editors created later,\n* such as one recreated after an error.\n*/\nlet policy;\n/**\n* Whether the application enforces Trusted Types, or `undefined` before the first check. The answer cannot change while\n* the document lives, and finding it out makes the browser report a policy violation, so it is checked only once.\n*/\nlet isEnforced;\n/**\n* Prepares an HTML string for a DOM injection sink, which means any place that turns a string into HTML, for example\n* `innerHTML` or `DOMParser#parseFromString()`:\n*\n* ```ts\n* element.innerHTML = trustedHtml( '

Hello world!

' );\n* ```\n*\n* An application can tell the browser to reject plain strings in those places, using the `require-trusted-types-for 'script'`\n* CSP directive. A sink then accepts only a `TrustedHTML` object. This function returns such an object when the browser\n* supports Trusted Types, and the string it was given when it does not. TypeScript types every sink as taking a\n* `string`, so the result is typed that way too, whichever it is. That keeps type casts out of the call sites, but it\n* also means the result is not always a real string: pass it to a sink, and do not call string methods on it. For the\n* same reason `+=` never works on a sink: it reads the property, joins the strings and assigns a plain one.\n*\n* An application that enforces Trusted Types must also allow the name of the editor's policy, plus `lit-html` when it\n* loads the premium features, whichever of them it uses:\n*\n* ```\n* Content-Security-Policy: require-trusted-types-for 'script'; trusted-types ckeditor5 lit-html;\n* ```\n*\n* The policy returns the string unchanged, because the editor writes markup that it created itself. It makes the browser\n* accept the assignment, but it cleans nothing, so pass this function only markup that the calling code produced, and\n* never content that came from a user or from a server response. Making sure that the data loaded into the editor is\n* safe stays the job of the application, exactly as before.\n*\n* See the {@glink getting-started/setup/csp#trusted-types Content Security Policy} guide for more information.\n*\n* @param html The HTML string to prepare.\n* @returns A value that can be assigned to a DOM injection sink.\n*/\nfunction trustedHtml(html) {\n\tif (!policy) policy = createPolicy();\n\treturn policy.createHTML(html);\n}\n/**\n* Returns `true` if the application enforces Trusted Types with the `require-trusted-types-for 'script'` CSP directive.\n* That is the only case where a DOM injection sink rejects a plain string, so it is also the only case where a feature\n* that writes HTML in code the editor cannot reach, for example inside a third-party library, stops working.\n*/\nfunction isTrustedTypesEnforced() {\n\tif (isEnforced === void 0) try {\n\t\tglobalVar.document.createElement(\"div\").innerHTML = \"\";\n\t\tisEnforced = false;\n\t} catch {\n\t\tisEnforced = typeof globalVar.document.createElement === \"function\";\n\t}\n\treturn isEnforced;\n}\n/**\n* Prepares the value of an attribute for `setAttribute()`. Under Trusted Types, some attributes accept only the object of\n* a Trusted Type, even in a document that is not displayed: an event handler such as `onclick` takes a `TrustedScript`,\n* `src` of a `